@agentuity/core 2.0.1 → 2.0.2
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/AGENTS.md +15 -0
- package/dist/deprecation.d.ts +1 -1
- package/dist/deprecation.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/services/auth/index.d.ts +1 -1
- package/dist/services/auth/index.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/destinations.d.ts +10 -0
- package/dist/services/queue/destinations.d.ts.map +1 -1
- package/dist/services/queue/destinations.js.map +1 -1
- package/dist/services/queue/types.d.ts +24 -33
- package/dist/services/queue/types.d.ts.map +1 -1
- package/dist/services/queue/types.js +11 -5
- package/dist/services/queue/types.js.map +1 -1
- package/dist/services/webhook/types.d.ts +1 -0
- package/dist/services/webhook/types.d.ts.map +1 -1
- package/dist/services/webhook/types.js +1 -0
- package/dist/services/webhook/types.js.map +1 -1
- package/dist/services/workflow/api-reference.d.ts +4 -0
- package/dist/services/workflow/api-reference.d.ts.map +1 -0
- package/dist/services/workflow/api-reference.js +335 -0
- package/dist/services/workflow/api-reference.js.map +1 -0
- package/dist/services/workflow/index.d.ts +3 -0
- package/dist/services/workflow/index.d.ts.map +1 -0
- package/dist/services/workflow/index.js +3 -0
- package/dist/services/workflow/index.js.map +1 -0
- package/dist/services/workflow/service.d.ts +235 -0
- package/dist/services/workflow/service.d.ts.map +1 -0
- package/dist/services/workflow/service.js +553 -0
- package/dist/services/workflow/service.js.map +1 -0
- package/dist/services/workflow/types.d.ts +270 -0
- package/dist/services/workflow/types.d.ts.map +1 -0
- package/dist/services/workflow/types.js +174 -0
- package/dist/services/workflow/types.js.map +1 -0
- package/package.json +2 -2
- package/src/deprecation.ts +1 -1
- package/src/index.ts +1 -1
- package/src/services/auth/index.ts +1 -1
- package/src/services/index.ts +1 -0
- package/src/services/queue/destinations.ts +1 -1
- package/src/services/queue/types.ts +11 -5
- package/src/services/webhook/types.ts +1 -0
- package/src/services/workflow/api-reference.ts +350 -0
- package/src/services/workflow/index.ts +2 -0
- package/src/services/workflow/service.ts +633 -0
- package/src/services/workflow/types.ts +233 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import type { Service } from '../api-reference.ts';
|
|
2
|
+
import {
|
|
3
|
+
CreateWorkflowRequestSchema,
|
|
4
|
+
UpdateWorkflowRequestSchema,
|
|
5
|
+
UpdateWorkflowGraphRequestSchema,
|
|
6
|
+
TestWorkflowRequestSchema,
|
|
7
|
+
WorkflowListResultSchema,
|
|
8
|
+
WorkflowGetResultSchema,
|
|
9
|
+
WorkflowCreateResultSchema,
|
|
10
|
+
WorkflowUpdateResultSchema,
|
|
11
|
+
WorkflowActivitySchema,
|
|
12
|
+
WorkflowExecutionSchema,
|
|
13
|
+
WorkflowDeliverySchema,
|
|
14
|
+
TestWorkflowResultSchema,
|
|
15
|
+
} from './types.ts';
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
|
|
18
|
+
const service: Service = {
|
|
19
|
+
name: 'Workflows',
|
|
20
|
+
slug: 'workflows',
|
|
21
|
+
description: 'Create and manage workflows that route events from sources to destinations',
|
|
22
|
+
endpoints: [
|
|
23
|
+
{
|
|
24
|
+
id: 'list-workflows',
|
|
25
|
+
title: 'List Workflows',
|
|
26
|
+
sectionTitle: 'Workflow Management',
|
|
27
|
+
method: 'GET',
|
|
28
|
+
path: '/workflow/list',
|
|
29
|
+
description: 'List all workflows with optional filtering and pagination.',
|
|
30
|
+
pathParams: [],
|
|
31
|
+
queryParams: [
|
|
32
|
+
{
|
|
33
|
+
name: 'limit',
|
|
34
|
+
type: 'number',
|
|
35
|
+
description: 'Maximum number of workflows to return',
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'offset',
|
|
40
|
+
type: 'number',
|
|
41
|
+
description: 'Pagination offset',
|
|
42
|
+
required: false,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'status',
|
|
46
|
+
type: 'string',
|
|
47
|
+
description: 'Filter by status (enabled or disabled)',
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'source_type',
|
|
52
|
+
type: 'string',
|
|
53
|
+
description: 'Filter by source type (email, queue, webhook, or schedule)',
|
|
54
|
+
required: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'filter',
|
|
58
|
+
type: 'string',
|
|
59
|
+
description: 'Filter workflows by name',
|
|
60
|
+
required: false,
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
requestBody: null,
|
|
64
|
+
responseDescription: 'Returns paginated list of workflows.',
|
|
65
|
+
responseFields: { schema: WorkflowListResultSchema },
|
|
66
|
+
statuses: [
|
|
67
|
+
{ code: 200, description: 'Workflows returned' },
|
|
68
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
69
|
+
],
|
|
70
|
+
examplePath: '/workflow/list',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'get-workflow',
|
|
74
|
+
title: 'Get Workflow',
|
|
75
|
+
sectionTitle: 'Workflow Management',
|
|
76
|
+
method: 'GET',
|
|
77
|
+
path: '/workflow/{workflowId}',
|
|
78
|
+
description: 'Get a specific workflow by ID.',
|
|
79
|
+
pathParams: [
|
|
80
|
+
{
|
|
81
|
+
name: 'workflowId',
|
|
82
|
+
type: 'string',
|
|
83
|
+
description: 'Workflow ID (wf_ prefix)',
|
|
84
|
+
required: true,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
queryParams: [],
|
|
88
|
+
requestBody: null,
|
|
89
|
+
responseDescription: 'Returns the workflow object.',
|
|
90
|
+
responseFields: { schema: WorkflowGetResultSchema, stripRequired: true },
|
|
91
|
+
statuses: [
|
|
92
|
+
{ code: 200, description: 'Workflow returned' },
|
|
93
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
94
|
+
{ code: 404, description: 'Workflow not found' },
|
|
95
|
+
],
|
|
96
|
+
examplePath: '/workflow/wf_abc123',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: 'create-workflow',
|
|
100
|
+
title: 'Create Workflow',
|
|
101
|
+
sectionTitle: 'Workflow Management',
|
|
102
|
+
method: 'POST',
|
|
103
|
+
path: '/workflow/create',
|
|
104
|
+
description: 'Create a new workflow with a source type and reference.',
|
|
105
|
+
pathParams: [],
|
|
106
|
+
queryParams: [],
|
|
107
|
+
requestBody: {
|
|
108
|
+
description: 'Workflow creation payload.',
|
|
109
|
+
fields: { schema: CreateWorkflowRequestSchema },
|
|
110
|
+
},
|
|
111
|
+
responseDescription: 'Returns the created workflow.',
|
|
112
|
+
responseFields: { schema: WorkflowCreateResultSchema },
|
|
113
|
+
statuses: [
|
|
114
|
+
{ code: 201, description: 'Workflow created' },
|
|
115
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
116
|
+
],
|
|
117
|
+
examplePath: '/workflow/create',
|
|
118
|
+
exampleBody: {
|
|
119
|
+
name: 'GitHub to Slack',
|
|
120
|
+
source_type: 'webhook',
|
|
121
|
+
source_ref_id: 'wh_abc123',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'update-workflow',
|
|
126
|
+
title: 'Update Workflow',
|
|
127
|
+
sectionTitle: 'Workflow Management',
|
|
128
|
+
method: 'PATCH',
|
|
129
|
+
path: '/workflow/{workflowId}',
|
|
130
|
+
description: "Update a workflow's name, description, or status.",
|
|
131
|
+
pathParams: [
|
|
132
|
+
{
|
|
133
|
+
name: 'workflowId',
|
|
134
|
+
type: 'string',
|
|
135
|
+
description: 'Workflow ID',
|
|
136
|
+
required: true,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
queryParams: [],
|
|
140
|
+
requestBody: {
|
|
141
|
+
description: 'Fields to update.',
|
|
142
|
+
fields: { schema: UpdateWorkflowRequestSchema },
|
|
143
|
+
},
|
|
144
|
+
responseDescription: 'Returns the updated workflow.',
|
|
145
|
+
responseFields: { schema: WorkflowUpdateResultSchema, stripRequired: true },
|
|
146
|
+
statuses: [
|
|
147
|
+
{ code: 200, description: 'Workflow updated' },
|
|
148
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
149
|
+
{ code: 404, description: 'Workflow not found' },
|
|
150
|
+
],
|
|
151
|
+
examplePath: '/workflow/wf_abc123',
|
|
152
|
+
exampleBody: { name: 'Renamed Workflow', status: 'disabled' },
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'update-workflow-graph',
|
|
156
|
+
title: 'Update Workflow Graph',
|
|
157
|
+
sectionTitle: 'Workflow Management',
|
|
158
|
+
method: 'PUT',
|
|
159
|
+
path: '/workflow/{workflowId}/graph',
|
|
160
|
+
description: 'Update the workflow graph definition (nodes and edges).',
|
|
161
|
+
pathParams: [
|
|
162
|
+
{
|
|
163
|
+
name: 'workflowId',
|
|
164
|
+
type: 'string',
|
|
165
|
+
description: 'Workflow ID',
|
|
166
|
+
required: true,
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
queryParams: [],
|
|
170
|
+
requestBody: {
|
|
171
|
+
description: 'Graph definition with nodes and edges.',
|
|
172
|
+
fields: { schema: UpdateWorkflowGraphRequestSchema },
|
|
173
|
+
},
|
|
174
|
+
responseDescription: 'Returns the updated workflow.',
|
|
175
|
+
responseFields: { schema: WorkflowUpdateResultSchema, stripRequired: true },
|
|
176
|
+
statuses: [
|
|
177
|
+
{ code: 200, description: 'Workflow graph updated' },
|
|
178
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
179
|
+
{ code: 404, description: 'Workflow not found' },
|
|
180
|
+
],
|
|
181
|
+
examplePath: '/workflow/wf_abc123/graph',
|
|
182
|
+
exampleBody: {
|
|
183
|
+
nodes: [
|
|
184
|
+
{ id: 'n1', type: 'filter' },
|
|
185
|
+
{ id: 'n2', type: 'action' },
|
|
186
|
+
],
|
|
187
|
+
edges: [{ id: 'e1', source: 'n1', target: 'n2' }],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: 'delete-workflow',
|
|
192
|
+
title: 'Delete Workflow',
|
|
193
|
+
sectionTitle: 'Workflow Management',
|
|
194
|
+
method: 'DELETE',
|
|
195
|
+
path: '/workflow/{workflowId}',
|
|
196
|
+
description: 'Delete a workflow and all associated executions and deliveries.',
|
|
197
|
+
pathParams: [
|
|
198
|
+
{
|
|
199
|
+
name: 'workflowId',
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'Workflow ID',
|
|
202
|
+
required: true,
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
queryParams: [],
|
|
206
|
+
requestBody: null,
|
|
207
|
+
responseDescription: 'Empty response on success.',
|
|
208
|
+
statuses: [
|
|
209
|
+
{ code: 204, description: 'Workflow deleted' },
|
|
210
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
211
|
+
{ code: 404, description: 'Workflow not found' },
|
|
212
|
+
],
|
|
213
|
+
examplePath: '/workflow/wf_abc123',
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: 'test-workflow',
|
|
217
|
+
title: 'Test Workflow',
|
|
218
|
+
sectionTitle: 'Testing',
|
|
219
|
+
method: 'POST',
|
|
220
|
+
path: '/workflow/{workflowId}/test',
|
|
221
|
+
description: 'Test a workflow with a sample payload.',
|
|
222
|
+
pathParams: [
|
|
223
|
+
{
|
|
224
|
+
name: 'workflowId',
|
|
225
|
+
type: 'string',
|
|
226
|
+
description: 'Workflow ID',
|
|
227
|
+
required: true,
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
queryParams: [],
|
|
231
|
+
requestBody: {
|
|
232
|
+
description: 'Test payload to send through the workflow.',
|
|
233
|
+
fields: { schema: TestWorkflowRequestSchema },
|
|
234
|
+
},
|
|
235
|
+
responseDescription: 'Returns the test execution result.',
|
|
236
|
+
responseFields: { schema: TestWorkflowResultSchema },
|
|
237
|
+
statuses: [
|
|
238
|
+
{ code: 200, description: 'Test completed' },
|
|
239
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
240
|
+
{ code: 404, description: 'Workflow not found' },
|
|
241
|
+
],
|
|
242
|
+
examplePath: '/workflow/wf_abc123/test',
|
|
243
|
+
exampleBody: { payload: { event: 'test', data: { key: 'value' } } },
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 'workflow-activity',
|
|
247
|
+
title: 'Get Workflow Activity',
|
|
248
|
+
sectionTitle: 'Analytics',
|
|
249
|
+
method: 'GET',
|
|
250
|
+
path: '/workflow/activity',
|
|
251
|
+
description: 'Get workflow activity statistics for the organization.',
|
|
252
|
+
pathParams: [],
|
|
253
|
+
queryParams: [
|
|
254
|
+
{
|
|
255
|
+
name: 'days',
|
|
256
|
+
type: 'number',
|
|
257
|
+
description: 'Number of days to look back',
|
|
258
|
+
required: false,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
requestBody: null,
|
|
262
|
+
responseDescription: 'Returns aggregate workflow activity statistics.',
|
|
263
|
+
responseFields: { schema: WorkflowActivitySchema },
|
|
264
|
+
statuses: [
|
|
265
|
+
{ code: 200, description: 'Activity returned' },
|
|
266
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
267
|
+
],
|
|
268
|
+
examplePath: '/workflow/activity',
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
id: 'list-workflow-executions',
|
|
272
|
+
title: 'List Workflow Executions',
|
|
273
|
+
sectionTitle: 'Executions',
|
|
274
|
+
method: 'GET',
|
|
275
|
+
path: '/workflow/{workflowId}/executions',
|
|
276
|
+
description: 'List execution records for a specific workflow.',
|
|
277
|
+
pathParams: [
|
|
278
|
+
{
|
|
279
|
+
name: 'workflowId',
|
|
280
|
+
type: 'string',
|
|
281
|
+
description: 'Workflow ID',
|
|
282
|
+
required: true,
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
queryParams: [],
|
|
286
|
+
requestBody: null,
|
|
287
|
+
responseDescription: 'Returns list of executions.',
|
|
288
|
+
responseFields: { schema: z.array(WorkflowExecutionSchema) },
|
|
289
|
+
statuses: [
|
|
290
|
+
{ code: 200, description: 'Executions returned' },
|
|
291
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
292
|
+
{ code: 404, description: 'Workflow not found' },
|
|
293
|
+
],
|
|
294
|
+
examplePath: '/workflow/wf_abc123/executions',
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: 'list-workflow-deliveries',
|
|
298
|
+
title: 'List Workflow Deliveries',
|
|
299
|
+
sectionTitle: 'Deliveries',
|
|
300
|
+
method: 'GET',
|
|
301
|
+
path: '/workflow/executions/{executionId}/deliveries',
|
|
302
|
+
description: 'List delivery records for a specific execution.',
|
|
303
|
+
pathParams: [
|
|
304
|
+
{
|
|
305
|
+
name: 'executionId',
|
|
306
|
+
type: 'string',
|
|
307
|
+
description: 'Execution ID',
|
|
308
|
+
required: true,
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
queryParams: [],
|
|
312
|
+
requestBody: null,
|
|
313
|
+
responseDescription: 'Returns list of deliveries.',
|
|
314
|
+
responseFields: { schema: z.array(WorkflowDeliverySchema) },
|
|
315
|
+
statuses: [
|
|
316
|
+
{ code: 200, description: 'Deliveries returned' },
|
|
317
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
318
|
+
{ code: 404, description: 'Execution not found' },
|
|
319
|
+
],
|
|
320
|
+
examplePath: '/workflow/executions/exec_abc123/deliveries',
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: 'get-recent-payload',
|
|
324
|
+
title: 'Get Recent Payload',
|
|
325
|
+
sectionTitle: 'Analytics',
|
|
326
|
+
method: 'GET',
|
|
327
|
+
path: '/workflow/{workflowId}/recent-payload',
|
|
328
|
+
description: 'Get the most recent payload received by a workflow.',
|
|
329
|
+
pathParams: [
|
|
330
|
+
{
|
|
331
|
+
name: 'workflowId',
|
|
332
|
+
type: 'string',
|
|
333
|
+
description: 'Workflow ID',
|
|
334
|
+
required: true,
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
queryParams: [],
|
|
338
|
+
requestBody: null,
|
|
339
|
+
responseDescription: 'Returns the most recent payload data.',
|
|
340
|
+
statuses: [
|
|
341
|
+
{ code: 200, description: 'Payload returned' },
|
|
342
|
+
{ code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
|
|
343
|
+
{ code: 404, description: 'Workflow not found or no recent payload' },
|
|
344
|
+
],
|
|
345
|
+
examplePath: '/workflow/wf_abc123/recent-payload',
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export default service;
|