@agentuity/server 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/project/deploy.d.ts +8 -0
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +14 -13
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/sandbox/execute.d.ts +2 -2
- package/dist/api/sandbox/execution.d.ts +4 -4
- package/dist/api/sandbox/snapshot-build.d.ts +2 -0
- package/dist/api/sandbox/snapshot-build.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot-build.js +4 -0
- package/dist/api/sandbox/snapshot-build.js.map +1 -1
- package/dist/api/webhook/deliveries.d.ts +94 -0
- package/dist/api/webhook/deliveries.d.ts.map +1 -0
- package/dist/api/webhook/deliveries.js +79 -0
- package/dist/api/webhook/deliveries.js.map +1 -0
- package/dist/api/webhook/destinations.d.ts +136 -0
- package/dist/api/webhook/destinations.d.ts.map +1 -0
- package/dist/api/webhook/destinations.js +137 -0
- package/dist/api/webhook/destinations.js.map +1 -0
- package/dist/api/webhook/index.d.ts +41 -0
- package/dist/api/webhook/index.d.ts.map +1 -0
- package/dist/api/webhook/index.js +59 -0
- package/dist/api/webhook/index.js.map +1 -0
- package/dist/api/webhook/receipts.d.ts +77 -0
- package/dist/api/webhook/receipts.d.ts.map +1 -0
- package/dist/api/webhook/receipts.js +78 -0
- package/dist/api/webhook/receipts.js.map +1 -0
- package/dist/api/webhook/types.d.ts +249 -0
- package/dist/api/webhook/types.d.ts.map +1 -0
- package/dist/api/webhook/types.js +221 -0
- package/dist/api/webhook/types.js.map +1 -0
- package/dist/api/webhook/util.d.ts +202 -0
- package/dist/api/webhook/util.d.ts.map +1 -0
- package/dist/api/webhook/util.js +201 -0
- package/dist/api/webhook/util.js.map +1 -0
- package/dist/api/webhook/webhooks.d.ts +146 -0
- package/dist/api/webhook/webhooks.d.ts.map +1 -0
- package/dist/api/webhook/webhooks.js +165 -0
- package/dist/api/webhook/webhooks.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/runtime-bootstrap.d.ts.map +1 -1
- package/dist/runtime-bootstrap.js +3 -0
- package/dist/runtime-bootstrap.js.map +1 -1
- package/package.json +4 -4
- package/src/api/index.ts +1 -0
- package/src/api/project/deploy.ts +16 -16
- package/src/api/sandbox/snapshot-build.ts +6 -0
- package/src/api/webhook/deliveries.ts +129 -0
- package/src/api/webhook/destinations.ts +224 -0
- package/src/api/webhook/index.ts +133 -0
- package/src/api/webhook/receipts.ts +124 -0
- package/src/api/webhook/types.ts +309 -0
- package/src/api/webhook/util.ts +237 -0
- package/src/api/webhook/webhooks.ts +260 -0
- package/src/config.ts +2 -0
- package/src/runtime-bootstrap.ts +3 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient } from '../api.ts';
|
|
3
|
+
import { type CreateWebhookRequest, type ListWebhooksRequest, type UpdateWebhookRequest, type Webhook, type WebhookApiOptions } from './types.ts';
|
|
4
|
+
export declare const WebhookResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
success: z.ZodLiteral<false>;
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
code: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
success: z.ZodLiteral<true>;
|
|
10
|
+
data: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
created_at: z.ZodString;
|
|
13
|
+
updated_at: z.ZodString;
|
|
14
|
+
created_by: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
url: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>], "success">;
|
|
20
|
+
export declare const WebhooksListResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
21
|
+
success: z.ZodLiteral<false>;
|
|
22
|
+
message: z.ZodString;
|
|
23
|
+
code: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
success: z.ZodLiteral<true>;
|
|
26
|
+
data: z.ZodArray<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
created_at: z.ZodString;
|
|
29
|
+
updated_at: z.ZodString;
|
|
30
|
+
created_by: z.ZodString;
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
33
|
+
url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>], "success">;
|
|
36
|
+
export declare const DeleteWebhookResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
+
success: z.ZodLiteral<false>;
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
code: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
success: z.ZodLiteral<true>;
|
|
42
|
+
}, z.core.$strip>], "success">;
|
|
43
|
+
/**
|
|
44
|
+
* Create a new webhook.
|
|
45
|
+
*
|
|
46
|
+
* Creates a webhook with the specified name and optional description.
|
|
47
|
+
*
|
|
48
|
+
* @param client - The API client instance
|
|
49
|
+
* @param params - Webhook creation parameters
|
|
50
|
+
* @param options - Optional API options (e.g., orgId)
|
|
51
|
+
* @returns The created webhook
|
|
52
|
+
* @throws {WebhookError} If the API request fails
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const webhook = await createWebhook(client, {
|
|
57
|
+
* name: 'github-events',
|
|
58
|
+
* description: 'Receives GitHub webhook events',
|
|
59
|
+
* });
|
|
60
|
+
* console.log(`Created webhook: ${webhook.id}`);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function createWebhook(client: APIClient, params: CreateWebhookRequest, options?: WebhookApiOptions): Promise<Webhook>;
|
|
64
|
+
/**
|
|
65
|
+
* Get a webhook by ID.
|
|
66
|
+
*
|
|
67
|
+
* Retrieves the webhook details.
|
|
68
|
+
*
|
|
69
|
+
* @param client - The API client instance
|
|
70
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
71
|
+
* @param options - Optional API options (e.g., orgId)
|
|
72
|
+
* @returns The webhook details
|
|
73
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
74
|
+
* @throws {WebhookError} If the API request fails
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const webhook = await getWebhook(client, 'wh_abc123');
|
|
79
|
+
* console.log(`Webhook: ${webhook.name}`);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function getWebhook(client: APIClient, webhookId: string, options?: WebhookApiOptions): Promise<Webhook>;
|
|
83
|
+
/**
|
|
84
|
+
* List all webhooks with optional pagination.
|
|
85
|
+
*
|
|
86
|
+
* @param client - The API client instance
|
|
87
|
+
* @param params - Optional pagination parameters
|
|
88
|
+
* @param options - Optional API options (e.g., orgId)
|
|
89
|
+
* @returns Object containing the list of webhooks
|
|
90
|
+
* @throws {WebhookError} If the API request fails
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```typescript
|
|
94
|
+
* // List first 10 webhooks
|
|
95
|
+
* const { webhooks } = await listWebhooks(client, { limit: 10 });
|
|
96
|
+
* console.log(`Found ${webhooks.length} webhooks`);
|
|
97
|
+
*
|
|
98
|
+
* // Paginate through all webhooks
|
|
99
|
+
* const { webhooks: page2 } = await listWebhooks(client, { limit: 10, offset: 10 });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export declare function listWebhooks(client: APIClient, params?: ListWebhooksRequest, options?: WebhookApiOptions): Promise<{
|
|
103
|
+
webhooks: Webhook[];
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Update an existing webhook.
|
|
107
|
+
*
|
|
108
|
+
* Updates the webhook name and/or description.
|
|
109
|
+
*
|
|
110
|
+
* @param client - The API client instance
|
|
111
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
112
|
+
* @param params - Update parameters
|
|
113
|
+
* @param options - Optional API options (e.g., orgId)
|
|
114
|
+
* @returns The updated webhook
|
|
115
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
116
|
+
* @throws {WebhookError} If the API request fails
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const webhook = await updateWebhook(client, 'wh_abc123', {
|
|
121
|
+
* name: 'github-events-v2',
|
|
122
|
+
* description: 'Updated description',
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare function updateWebhook(client: APIClient, webhookId: string, params: UpdateWebhookRequest, options?: WebhookApiOptions): Promise<Webhook>;
|
|
127
|
+
/**
|
|
128
|
+
* Delete a webhook.
|
|
129
|
+
*
|
|
130
|
+
* Permanently deletes a webhook and all its destinations, receipts, and deliveries.
|
|
131
|
+
* This action cannot be undone.
|
|
132
|
+
*
|
|
133
|
+
* @param client - The API client instance
|
|
134
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
135
|
+
* @param options - Optional API options (e.g., orgId)
|
|
136
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
137
|
+
* @throws {WebhookError} If the API request fails
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* await deleteWebhook(client, 'wh_abc123');
|
|
142
|
+
* console.log('Webhook deleted');
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export declare function deleteWebhook(client: APIClient, webhookId: string, options?: WebhookApiOptions): Promise<void>;
|
|
146
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/api/webhook/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAA8C,MAAM,WAAW,CAAC;AACvF,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EAEzB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EAEtB,MAAM,YAAY,CAAC;AASpB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;8BAAmC,CAAC;AACtE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;8BAA4C,CAAC;AACpF,eAAO,MAAM,2BAA2B;;;;;;8BAA4B,CAAC;AAErE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAsBlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAC/B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAelB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC,CA6BlC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,OAAO,CAAC,CAuBlB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { APIResponseSchema, APIResponseSchemaNoData } from "../api.js";
|
|
3
|
+
import { CreateWebhookRequestSchema, UpdateWebhookRequestSchema, WebhookSchema, } from "./types.js";
|
|
4
|
+
import { buildWebhookHeaders, WebhookError, webhookApiPath, webhookApiPathWithQuery, withWebhookErrorHandling, } from "./util.js";
|
|
5
|
+
export const WebhookResponseSchema = APIResponseSchema(WebhookSchema);
|
|
6
|
+
export const WebhooksListResponseSchema = APIResponseSchema(z.array(WebhookSchema));
|
|
7
|
+
export const DeleteWebhookResponseSchema = APIResponseSchemaNoData();
|
|
8
|
+
/**
|
|
9
|
+
* Create a new webhook.
|
|
10
|
+
*
|
|
11
|
+
* Creates a webhook with the specified name and optional description.
|
|
12
|
+
*
|
|
13
|
+
* @param client - The API client instance
|
|
14
|
+
* @param params - Webhook creation parameters
|
|
15
|
+
* @param options - Optional API options (e.g., orgId)
|
|
16
|
+
* @returns The created webhook
|
|
17
|
+
* @throws {WebhookError} If the API request fails
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const webhook = await createWebhook(client, {
|
|
22
|
+
* name: 'github-events',
|
|
23
|
+
* description: 'Receives GitHub webhook events',
|
|
24
|
+
* });
|
|
25
|
+
* console.log(`Created webhook: ${webhook.id}`);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export async function createWebhook(client, params, options) {
|
|
29
|
+
const url = webhookApiPath('create');
|
|
30
|
+
const resp = await withWebhookErrorHandling(() => client.post(url, params, WebhookResponseSchema, CreateWebhookRequestSchema, undefined, buildWebhookHeaders(options?.orgId)), {});
|
|
31
|
+
if (resp.success) {
|
|
32
|
+
return resp.data;
|
|
33
|
+
}
|
|
34
|
+
throw new WebhookError({
|
|
35
|
+
message: resp.message || 'Failed to create webhook',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get a webhook by ID.
|
|
40
|
+
*
|
|
41
|
+
* Retrieves the webhook details.
|
|
42
|
+
*
|
|
43
|
+
* @param client - The API client instance
|
|
44
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
45
|
+
* @param options - Optional API options (e.g., orgId)
|
|
46
|
+
* @returns The webhook details
|
|
47
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
48
|
+
* @throws {WebhookError} If the API request fails
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const webhook = await getWebhook(client, 'wh_abc123');
|
|
53
|
+
* console.log(`Webhook: ${webhook.name}`);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export async function getWebhook(client, webhookId, options) {
|
|
57
|
+
const url = webhookApiPath('get', webhookId);
|
|
58
|
+
const resp = await withWebhookErrorHandling(() => client.get(url, WebhookResponseSchema, undefined, buildWebhookHeaders(options?.orgId)), { webhookId });
|
|
59
|
+
if (resp.success) {
|
|
60
|
+
return resp.data;
|
|
61
|
+
}
|
|
62
|
+
throw new WebhookError({
|
|
63
|
+
webhookId,
|
|
64
|
+
message: resp.message || 'Failed to get webhook',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* List all webhooks with optional pagination.
|
|
69
|
+
*
|
|
70
|
+
* @param client - The API client instance
|
|
71
|
+
* @param params - Optional pagination parameters
|
|
72
|
+
* @param options - Optional API options (e.g., orgId)
|
|
73
|
+
* @returns Object containing the list of webhooks
|
|
74
|
+
* @throws {WebhookError} If the API request fails
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* // List first 10 webhooks
|
|
79
|
+
* const { webhooks } = await listWebhooks(client, { limit: 10 });
|
|
80
|
+
* console.log(`Found ${webhooks.length} webhooks`);
|
|
81
|
+
*
|
|
82
|
+
* // Paginate through all webhooks
|
|
83
|
+
* const { webhooks: page2 } = await listWebhooks(client, { limit: 10, offset: 10 });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export async function listWebhooks(client, params, options) {
|
|
87
|
+
const searchParams = new URLSearchParams();
|
|
88
|
+
if (params?.limit !== undefined) {
|
|
89
|
+
searchParams.set('limit', String(params.limit));
|
|
90
|
+
}
|
|
91
|
+
if (params?.offset !== undefined) {
|
|
92
|
+
searchParams.set('offset', String(params.offset));
|
|
93
|
+
}
|
|
94
|
+
const queryString = searchParams.toString();
|
|
95
|
+
const url = webhookApiPathWithQuery('list', queryString || undefined);
|
|
96
|
+
const resp = await withWebhookErrorHandling(() => client.get(url, WebhooksListResponseSchema, undefined, buildWebhookHeaders(options?.orgId)), {});
|
|
97
|
+
if (resp.success) {
|
|
98
|
+
return { webhooks: resp.data };
|
|
99
|
+
}
|
|
100
|
+
throw new WebhookError({
|
|
101
|
+
message: resp.message || 'Failed to list webhooks',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Update an existing webhook.
|
|
106
|
+
*
|
|
107
|
+
* Updates the webhook name and/or description.
|
|
108
|
+
*
|
|
109
|
+
* @param client - The API client instance
|
|
110
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
111
|
+
* @param params - Update parameters
|
|
112
|
+
* @param options - Optional API options (e.g., orgId)
|
|
113
|
+
* @returns The updated webhook
|
|
114
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
115
|
+
* @throws {WebhookError} If the API request fails
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const webhook = await updateWebhook(client, 'wh_abc123', {
|
|
120
|
+
* name: 'github-events-v2',
|
|
121
|
+
* description: 'Updated description',
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export async function updateWebhook(client, webhookId, params, options) {
|
|
126
|
+
const url = webhookApiPath('update', webhookId);
|
|
127
|
+
const resp = await withWebhookErrorHandling(() => client.put(url, params, WebhookResponseSchema, UpdateWebhookRequestSchema, undefined, buildWebhookHeaders(options?.orgId)), { webhookId });
|
|
128
|
+
if (resp.success) {
|
|
129
|
+
return resp.data;
|
|
130
|
+
}
|
|
131
|
+
throw new WebhookError({
|
|
132
|
+
webhookId,
|
|
133
|
+
message: resp.message || 'Failed to update webhook',
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Delete a webhook.
|
|
138
|
+
*
|
|
139
|
+
* Permanently deletes a webhook and all its destinations, receipts, and deliveries.
|
|
140
|
+
* This action cannot be undone.
|
|
141
|
+
*
|
|
142
|
+
* @param client - The API client instance
|
|
143
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
144
|
+
* @param options - Optional API options (e.g., orgId)
|
|
145
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
146
|
+
* @throws {WebhookError} If the API request fails
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* await deleteWebhook(client, 'wh_abc123');
|
|
151
|
+
* console.log('Webhook deleted');
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export async function deleteWebhook(client, webhookId, options) {
|
|
155
|
+
const url = webhookApiPath('delete', webhookId);
|
|
156
|
+
const resp = await withWebhookErrorHandling(() => client.delete(url, DeleteWebhookResponseSchema, undefined, buildWebhookHeaders(options?.orgId)), { webhookId });
|
|
157
|
+
if (resp.success) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
throw new WebhookError({
|
|
161
|
+
webhookId,
|
|
162
|
+
message: resp.message || 'Failed to delete webhook',
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../src/api/webhook/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAkB,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACvF,OAAO,EAEN,0BAA0B,EAG1B,0BAA0B,EAG1B,aAAa,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,wBAAwB,GACxB,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;AACpF,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,EAAE,CAAC;AAErE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,MAAiB,EACjB,MAA4B,EAC5B,OAA2B;IAE3B,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,MAAM,wBAAwB,CAC1C,GAAG,EAAE,CACJ,MAAM,CAAC,IAAI,CACV,GAAG,EACH,MAAM,EACN,qBAAqB,EACrB,0BAA0B,EAC1B,SAAS,EACT,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CACnC,EACF,EAAE,CACF,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EA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AK,UAAU,aAAa,CAClC,MAAiB,EACjB,SAAiB,EACjB,OAA2B;IAE3B,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,MAAM,wBAAwB,CAC1C,GAAG,EAAE,CACJ,MAAM,CAAC,MAAM,CACZ,GAAG,EACH,2BAA2B,EAC3B,SAAS,EACT,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CACnC,EACF,EAAE,SAAS,EAAE,CACb,CAAC;IAEF,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO;IACR,CAAC;IAED,MAAM,IAAI,YAAY,CAAC;QACtB,SAAS;QACT,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,0BAA0B;KACnD,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAc3D"}
|
package/dist/config.js
CHANGED
|
@@ -23,6 +23,7 @@ export function getServiceUrls(region) {
|
|
|
23
23
|
catalyst: process.env.AGENTUITY_CATALYST_URL || transportUrl,
|
|
24
24
|
otel: process.env.AGENTUITY_OTLP_URL || buildRegionalURL(resolvedRegion, 'otel'),
|
|
25
25
|
sandbox: process.env.AGENTUITY_SANDBOX_URL || transportUrl,
|
|
26
|
+
email: process.env.AGENTUITY_EMAIL_URL || transportUrl,
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
function getDomainSuffix(region) {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,MAAe;IAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IACxD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACd,mHAAmH,CACnH,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC7C,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,YAAY,GACjB,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,gBAAgB,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;IAErF,OAAO;QACN,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,YAAY;QAC5D,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,gB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{"version":3,"file":"runtime-bootstrap.d.ts","sourceRoot":"","sources":["../src/runtime-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,uBAA4B,GAAG,IAAI,CA6C/E"}
|
|
@@ -66,5 +66,8 @@ export function bootstrapRuntimeEnv(options = {}) {
|
|
|
66
66
|
if (!process.env.AGENTUITY_OTLP_URL) {
|
|
67
67
|
process.env.AGENTUITY_OTLP_URL = serviceUrls.otel;
|
|
68
68
|
}
|
|
69
|
+
if (!process.env.AGENTUITY_EMAIL_URL) {
|
|
70
|
+
process.env.AGENTUITY_EMAIL_URL = serviceUrls.email;
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
73
|
//# sourceMappingURL=runtime-bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-bootstrap.js","sourceRoot":"","sources":["../src/runtime-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAe7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAmC,EAAE;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC;IAE5E,6DAA6D;IAC7D,IACC,CAAC,OAAO,KAAK,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;QAC/D,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAC5B,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,O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Q,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC;IACzD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,WAAW,CAAC,MAAM,CAAC;IACvD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,WAAW,CAAC,MAAM,CAAC;IACvD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,WAAW,CAAC,QAAQ,CAAC;IAC3D,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC;IACnD,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,WAAW,CAAC,KAAK,CAAC;IACrD,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"prepublishOnly": "bun run clean && bun run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@agentuity/core": "1.0.
|
|
29
|
-
"@agentuity/schema": "1.0.
|
|
28
|
+
"@agentuity/core": "1.0.23",
|
|
29
|
+
"@agentuity/schema": "1.0.23",
|
|
30
30
|
"zod": "^4.3.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@agentuity/test-utils": "1.0.
|
|
33
|
+
"@agentuity/test-utils": "1.0.23",
|
|
34
34
|
"@types/bun": "latest",
|
|
35
35
|
"@types/node": "^22.0.0",
|
|
36
36
|
"bun-types": "latest",
|
package/src/api/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './org/index.ts';
|
|
|
7
7
|
export * from './project/index.ts';
|
|
8
8
|
export * from './queue/index.ts';
|
|
9
9
|
export * from './region/index.ts';
|
|
10
|
+
export * from './webhook/index.ts';
|
|
10
11
|
export * from './sandbox/index.ts';
|
|
11
12
|
export * from './session/index.ts';
|
|
12
13
|
export * from './stream/index.ts';
|
|
@@ -16,6 +16,18 @@ export const Mode = z.object({
|
|
|
16
16
|
idle: z.string().optional().describe('duration in seconds if on-demand'),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
export const ProjectBuildConfig = z.object({
|
|
20
|
+
timeout: z.string().optional().describe('Build execution timeout (e.g. "30m")'),
|
|
21
|
+
resources: z
|
|
22
|
+
.object({
|
|
23
|
+
memory: z.string().optional().describe('Build sandbox memory (e.g. "4Gi")'),
|
|
24
|
+
cpu: z.string().optional().describe('Build sandbox CPU (e.g. "2")'),
|
|
25
|
+
disk: z.string().optional().describe('Build sandbox disk (e.g. "4Gi")'),
|
|
26
|
+
})
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Build sandbox resource limits'),
|
|
29
|
+
});
|
|
30
|
+
|
|
19
31
|
export const DeploymentConfig = z.object({
|
|
20
32
|
resources: Resources.optional().describe('the resource requirements for your deployed project'),
|
|
21
33
|
mode: Mode.optional().describe('the provisioning mode for the project'),
|
|
@@ -70,14 +82,8 @@ export const BuildMetadataSchema = z.object({
|
|
|
70
82
|
method: z.enum(['get', 'post', 'put', 'delete', 'patch']).describe('the HTTP method'),
|
|
71
83
|
version: z.string().describe('the SHA256 content of the file'),
|
|
72
84
|
type: z.enum(['api', 'sms', 'email', 'cron', 'websocket', 'sse', 'stream']),
|
|
73
|
-
agentIds: z
|
|
74
|
-
|
|
75
|
-
.optional()
|
|
76
|
-
.describe('the agent ids associated with this route'),
|
|
77
|
-
config: z
|
|
78
|
-
.record(z.string(), z.unknown())
|
|
79
|
-
.optional()
|
|
80
|
-
.describe('type specific configuration'),
|
|
85
|
+
agentIds: z.array(z.string()).optional().describe('the agent ids associated with this route'),
|
|
86
|
+
config: z.record(z.string(), z.unknown()).optional().describe('type specific configuration'),
|
|
81
87
|
schema: z
|
|
82
88
|
.object({
|
|
83
89
|
input: z.string().optional().describe('JSON schema for input (stringified JSON)'),
|
|
@@ -127,11 +133,7 @@ export const BuildMetadataSchema = z.object({
|
|
|
127
133
|
.default('cli')
|
|
128
134
|
.optional()
|
|
129
135
|
.describe('the trigger that caused the build'),
|
|
130
|
-
url: z
|
|
131
|
-
.string()
|
|
132
|
-
.url()
|
|
133
|
-
.optional()
|
|
134
|
-
.describe('the url to the commit for the CI provider'),
|
|
136
|
+
url: z.string().url().optional().describe('the url to the commit for the CI provider'),
|
|
135
137
|
buildUrl: z
|
|
136
138
|
.string()
|
|
137
139
|
.url()
|
|
@@ -150,9 +152,7 @@ export const BuildMetadataSchema = z.object({
|
|
|
150
152
|
url: z.string().optional(),
|
|
151
153
|
})
|
|
152
154
|
.optional()
|
|
153
|
-
.describe(
|
|
154
|
-
'This is only present when the deployment was triggered via a pull request.'
|
|
155
|
-
),
|
|
155
|
+
.describe('This is only present when the deployment was triggered via a pull request.'),
|
|
156
156
|
})
|
|
157
157
|
.optional()
|
|
158
158
|
.describe('git commit information'),
|
|
@@ -28,6 +28,12 @@ export const SnapshotBuildFileBaseSchema = z
|
|
|
28
28
|
.optional()
|
|
29
29
|
.describe('Snapshot name (alphanumeric, underscores, dashes only)'),
|
|
30
30
|
description: z.string().optional().describe('Human-readable description of the snapshot'),
|
|
31
|
+
dir: z
|
|
32
|
+
.string()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe(
|
|
35
|
+
'Subdirectory to use as the build context for file resolution (relative to the CLI directory argument)'
|
|
36
|
+
),
|
|
31
37
|
dependencies: z
|
|
32
38
|
.array(z.string())
|
|
33
39
|
.optional()
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api.ts';
|
|
3
|
+
import {
|
|
4
|
+
type ListWebhookDeliveriesRequest,
|
|
5
|
+
type WebhookApiOptions,
|
|
6
|
+
type WebhookDelivery,
|
|
7
|
+
WebhookDeliverySchema,
|
|
8
|
+
} from './types.ts';
|
|
9
|
+
import {
|
|
10
|
+
buildWebhookHeaders,
|
|
11
|
+
WebhookError,
|
|
12
|
+
webhookApiPath,
|
|
13
|
+
webhookApiPathWithQuery,
|
|
14
|
+
withWebhookErrorHandling,
|
|
15
|
+
} from './util.ts';
|
|
16
|
+
|
|
17
|
+
export const WebhookDeliveryResponseSchema = APIResponseSchema(WebhookDeliverySchema);
|
|
18
|
+
export const WebhookDeliveriesListResponseSchema = APIResponseSchema(
|
|
19
|
+
z.array(WebhookDeliverySchema)
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* List deliveries for a webhook with optional pagination.
|
|
24
|
+
*
|
|
25
|
+
* Deliveries represent attempts to forward a received webhook payload to a destination.
|
|
26
|
+
*
|
|
27
|
+
* @param client - The API client instance
|
|
28
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
29
|
+
* @param params - Optional pagination parameters
|
|
30
|
+
* @param options - Optional API options (e.g., orgId)
|
|
31
|
+
* @returns Object containing the list of deliveries
|
|
32
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
33
|
+
* @throws {WebhookError} If the API request fails
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const { deliveries } = await listWebhookDeliveries(client, 'wh_abc123', { limit: 10 });
|
|
38
|
+
* for (const delivery of deliveries) {
|
|
39
|
+
* console.log(`Delivery ${delivery.id}: ${delivery.status}`);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export async function listWebhookDeliveries(
|
|
44
|
+
client: APIClient,
|
|
45
|
+
webhookId: string,
|
|
46
|
+
params?: ListWebhookDeliveriesRequest,
|
|
47
|
+
options?: WebhookApiOptions
|
|
48
|
+
): Promise<{ deliveries: WebhookDelivery[] }> {
|
|
49
|
+
const searchParams = new URLSearchParams();
|
|
50
|
+
if (params?.limit !== undefined) {
|
|
51
|
+
searchParams.set('limit', String(params.limit));
|
|
52
|
+
}
|
|
53
|
+
if (params?.offset !== undefined) {
|
|
54
|
+
searchParams.set('offset', String(params.offset));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const queryString = searchParams.toString();
|
|
58
|
+
const url = webhookApiPathWithQuery('delivery-list', queryString || undefined, webhookId);
|
|
59
|
+
const resp = await withWebhookErrorHandling(
|
|
60
|
+
() =>
|
|
61
|
+
client.get(
|
|
62
|
+
url,
|
|
63
|
+
WebhookDeliveriesListResponseSchema,
|
|
64
|
+
undefined,
|
|
65
|
+
buildWebhookHeaders(options?.orgId)
|
|
66
|
+
),
|
|
67
|
+
{ webhookId }
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if (resp.success) {
|
|
71
|
+
return { deliveries: resp.data };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
throw new WebhookError({
|
|
75
|
+
webhookId,
|
|
76
|
+
message: resp.message || 'Failed to list webhook deliveries',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Retry a failed webhook delivery.
|
|
82
|
+
*
|
|
83
|
+
* Re-attempts delivery of a webhook payload to the destination. This creates
|
|
84
|
+
* a new delivery attempt for the same receipt and destination.
|
|
85
|
+
*
|
|
86
|
+
* @param client - The API client instance
|
|
87
|
+
* @param webhookId - The webhook ID (prefixed with wh_)
|
|
88
|
+
* @param deliveryId - The delivery ID to retry (prefixed with whdv_)
|
|
89
|
+
* @param options - Optional API options (e.g., orgId)
|
|
90
|
+
* @returns The new delivery attempt
|
|
91
|
+
* @throws {WebhookDeliveryNotFoundError} If the delivery does not exist
|
|
92
|
+
* @throws {WebhookNotFoundError} If the webhook does not exist
|
|
93
|
+
* @throws {WebhookError} If the API request fails
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* const delivery = await retryWebhookDelivery(client, 'wh_abc123', 'whdv_def456');
|
|
98
|
+
* console.log(`Retry delivery ${delivery.id}: ${delivery.status}`);
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export async function retryWebhookDelivery(
|
|
102
|
+
client: APIClient,
|
|
103
|
+
webhookId: string,
|
|
104
|
+
deliveryId: string,
|
|
105
|
+
options?: WebhookApiOptions
|
|
106
|
+
): Promise<WebhookDelivery> {
|
|
107
|
+
const url = webhookApiPath('delivery-retry', webhookId, deliveryId);
|
|
108
|
+
const resp = await withWebhookErrorHandling(
|
|
109
|
+
() =>
|
|
110
|
+
client.post(
|
|
111
|
+
url,
|
|
112
|
+
{},
|
|
113
|
+
WebhookDeliveryResponseSchema,
|
|
114
|
+
z.object({}),
|
|
115
|
+
undefined,
|
|
116
|
+
buildWebhookHeaders(options?.orgId)
|
|
117
|
+
),
|
|
118
|
+
{ webhookId, deliveryId }
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
if (resp.success) {
|
|
122
|
+
return resp.data;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
throw new WebhookError({
|
|
126
|
+
webhookId,
|
|
127
|
+
message: resp.message || 'Failed to retry webhook delivery',
|
|
128
|
+
});
|
|
129
|
+
}
|