MCPcopy Create free account
hub / github.com/ShipSecAI/studio / regeneratePath

Method regeneratePath

backend/src/webhooks/webhooks.service.ts:168–194  ·  view source on GitHub ↗
(auth: AuthContext | null, id: string)

Source from the content-addressed store, hash-verified

166 }
167
168 async regeneratePath(auth: AuthContext | null, id: string): Promise<WebhookUrlResponse> {
169 const existing = await this.repository.findById(id, { organizationId: auth?.organizationId });
170 if (!existing) {
171 throw new NotFoundException(`Webhook ${id} not found`);
172 }
173
174 await this.workflowsService.ensureWorkflowAdminAccess(existing.workflowId, auth);
175
176 const newPath = this.generateWebhookPath();
177 const updated = await this.repository.update(
178 id,
179 { webhookPath: newPath },
180 { organizationId: auth?.organizationId },
181 );
182
183 if (!updated) {
184 throw new NotFoundException(`Webhook ${id} not found`);
185 }
186
187 this.logger.log(`Regenerated path for webhook ${id}: ${newPath}`);
188 return {
189 id: updated.id,
190 name: updated.name,
191 webhookPath: updated.webhookPath,
192 url: this.buildWebhookUrl(updated.webhookPath),
193 };
194 }
195
196 async getUrl(auth: AuthContext | null, id: string): Promise<WebhookUrlResponse> {
197 const webhook = await this.get(auth, id);

Callers 1

Calls 5

generateWebhookPathMethod · 0.95
buildWebhookUrlMethod · 0.95
findByIdMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected