@agentuity/core 2.0.0 → 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.
Files changed (59) hide show
  1. package/AGENTS.md +15 -0
  2. package/dist/deprecation.d.ts +1 -1
  3. package/dist/deprecation.d.ts.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/services/auth/index.d.ts +7 -0
  9. package/dist/services/auth/index.d.ts.map +1 -0
  10. package/dist/services/auth/index.js +7 -0
  11. package/dist/services/auth/index.js.map +1 -0
  12. package/dist/services/auth/types.d.ts +192 -0
  13. package/dist/services/auth/types.d.ts.map +1 -0
  14. package/dist/services/auth/types.js +11 -0
  15. package/dist/services/auth/types.js.map +1 -0
  16. package/dist/services/index.d.ts +2 -0
  17. package/dist/services/index.d.ts.map +1 -1
  18. package/dist/services/index.js +2 -0
  19. package/dist/services/index.js.map +1 -1
  20. package/dist/services/queue/destinations.d.ts +10 -0
  21. package/dist/services/queue/destinations.d.ts.map +1 -1
  22. package/dist/services/queue/destinations.js.map +1 -1
  23. package/dist/services/queue/types.d.ts +24 -33
  24. package/dist/services/queue/types.d.ts.map +1 -1
  25. package/dist/services/queue/types.js +11 -5
  26. package/dist/services/queue/types.js.map +1 -1
  27. package/dist/services/webhook/types.d.ts +1 -0
  28. package/dist/services/webhook/types.d.ts.map +1 -1
  29. package/dist/services/webhook/types.js +1 -0
  30. package/dist/services/webhook/types.js.map +1 -1
  31. package/dist/services/workflow/api-reference.d.ts +4 -0
  32. package/dist/services/workflow/api-reference.d.ts.map +1 -0
  33. package/dist/services/workflow/api-reference.js +335 -0
  34. package/dist/services/workflow/api-reference.js.map +1 -0
  35. package/dist/services/workflow/index.d.ts +3 -0
  36. package/dist/services/workflow/index.d.ts.map +1 -0
  37. package/dist/services/workflow/index.js +3 -0
  38. package/dist/services/workflow/index.js.map +1 -0
  39. package/dist/services/workflow/service.d.ts +235 -0
  40. package/dist/services/workflow/service.d.ts.map +1 -0
  41. package/dist/services/workflow/service.js +553 -0
  42. package/dist/services/workflow/service.js.map +1 -0
  43. package/dist/services/workflow/types.d.ts +270 -0
  44. package/dist/services/workflow/types.d.ts.map +1 -0
  45. package/dist/services/workflow/types.js +174 -0
  46. package/dist/services/workflow/types.js.map +1 -0
  47. package/package.json +2 -2
  48. package/src/deprecation.ts +1 -1
  49. package/src/index.ts +1 -1
  50. package/src/services/auth/index.ts +19 -0
  51. package/src/services/auth/types.ts +223 -0
  52. package/src/services/index.ts +2 -0
  53. package/src/services/queue/destinations.ts +1 -1
  54. package/src/services/queue/types.ts +11 -5
  55. package/src/services/webhook/types.ts +1 -0
  56. package/src/services/workflow/api-reference.ts +350 -0
  57. package/src/services/workflow/index.ts +2 -0
  58. package/src/services/workflow/service.ts +633 -0
  59. package/src/services/workflow/types.ts +233 -0
@@ -0,0 +1,223 @@
1
+ /**
2
+ * Core authentication types for Agentuity.
3
+ *
4
+ * These types are defined in @agentuity/core to avoid circular dependencies
5
+ * and allow packages like @agentuity/runtime to use auth types without
6
+ * pulling in heavy dependencies like drizzle-orm.
7
+ *
8
+ * @module services/auth/types
9
+ */
10
+
11
+ // =============================================================================
12
+ // Canonical User/Session Types
13
+ // =============================================================================
14
+
15
+ /**
16
+ * Canonical authenticated user type for Agentuity Auth.
17
+ *
18
+ * Common fields include:
19
+ * - `id` – Stable user identifier
20
+ * - `email` – Primary email address
21
+ * - `name` – Display name
22
+ * - `image` – Avatar URL (if configured)
23
+ * - `createdAt` / `updatedAt` – Timestamps
24
+ */
25
+ export interface AuthUser {
26
+ id: string;
27
+ email: string;
28
+ name?: string | null;
29
+ image?: string | null;
30
+ createdAt?: Date | string;
31
+ updatedAt?: Date | string;
32
+ }
33
+
34
+ /**
35
+ * Auth session type with organization plugin fields.
36
+ */
37
+ export interface AuthSession {
38
+ id: string;
39
+ userId: string;
40
+ expiresAt: Date | string;
41
+ /** Active organization ID from the organization plugin */
42
+ activeOrganizationId?: string;
43
+ ipAddress?: string | null;
44
+ userAgent?: string | null;
45
+ createdAt?: Date | string;
46
+ updatedAt?: Date | string;
47
+ }
48
+
49
+ /**
50
+ * Auth context containing user, session, and org data.
51
+ * This is the full auth context available on AgentContext.auth and c.var.auth.
52
+ * Session may be null for API key authentication.
53
+ */
54
+ export interface AuthContext<TUser = AuthUser, TSession = AuthSession | null> {
55
+ user: TUser;
56
+ session: TSession;
57
+ org: AuthOrgContext | null;
58
+ }
59
+
60
+ /**
61
+ * Organization context from the organization plugin.
62
+ */
63
+ export interface AuthOrgContext {
64
+ /** Organization ID */
65
+ id: string;
66
+ /** Organization slug (URL-friendly identifier) */
67
+ slug?: string | null;
68
+ /** Organization display name */
69
+ name?: string | null;
70
+ /** Member's role in this organization (e.g., 'owner', 'admin', 'member') */
71
+ role?: string | null;
72
+ /** Member ID for this user in this organization */
73
+ memberId?: string | null;
74
+ /** Organization metadata (if enabled) */
75
+ metadata?: unknown;
76
+ }
77
+
78
+ // =============================================================================
79
+ // API Key Types
80
+ // =============================================================================
81
+
82
+ /**
83
+ * API key permissions format.
84
+ * Maps resource names to arrays of allowed actions.
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * const permissions: AuthApiKeyPermissions = {
89
+ * project: ['read', 'write'],
90
+ * user: ['read'],
91
+ * admin: ['*'], // wildcard - all actions
92
+ * };
93
+ * ```
94
+ */
95
+ export interface AuthApiKeyPermissions {
96
+ [key: string]: string[];
97
+ }
98
+
99
+ /**
100
+ * API key context when request is authenticated via API key.
101
+ */
102
+ export interface AuthApiKeyContext {
103
+ /** API key ID */
104
+ id: string;
105
+ /** Display name of the API key */
106
+ name?: string | null;
107
+ /** Permissions associated with this API key */
108
+ permissions: AuthApiKeyPermissions;
109
+ /** User ID the API key belongs to */
110
+ userId?: string | null;
111
+ }
112
+
113
+ /**
114
+ * Authentication method used for the current request.
115
+ */
116
+ export type AuthMethod = 'session' | 'api-key' | 'bearer';
117
+
118
+ // =============================================================================
119
+ // Auth Interface
120
+ // =============================================================================
121
+
122
+ /**
123
+ * Generic authentication interface exposed on Hono context.
124
+ *
125
+ * This type is intentionally provider-agnostic.
126
+ *
127
+ * @typeParam TUser - Domain user type (defaults to unknown for flexibility).
128
+ * @typeParam TRaw - Underlying auth context (defaults to unknown for flexibility).
129
+ */
130
+ export interface AgentuityAuth<TUser = unknown, TRaw = unknown> {
131
+ /** Get the authenticated user, throws if not authenticated */
132
+ getUser(): Promise<TUser>;
133
+
134
+ /** Get the raw JWT token */
135
+ getToken(): Promise<string | null>;
136
+
137
+ /** Raw provider-specific auth object or auth context */
138
+ raw: TRaw;
139
+ }
140
+
141
+ /**
142
+ * Organization helpers available on the auth context.
143
+ */
144
+ export interface AuthOrgHelpers {
145
+ /** Active organization context if available, null otherwise */
146
+ org: AuthOrgContext | null;
147
+
148
+ /** Returns active org or null (never throws) */
149
+ getOrg(): Promise<AuthOrgContext | null>;
150
+
151
+ /** Convenience accessor for the member's role on the active org */
152
+ getOrgRole(): Promise<string | null>;
153
+
154
+ /** True if the current member's role is one of the provided roles */
155
+ hasOrgRole(...roles: string[]): Promise<boolean>;
156
+ }
157
+
158
+ /**
159
+ * API key helpers available on the auth context.
160
+ */
161
+ export interface AuthApiKeyHelpers {
162
+ /** How this request was authenticated */
163
+ authMethod: AuthMethod;
164
+
165
+ /** API key context when request is authenticated via API key, null otherwise */
166
+ apiKey: AuthApiKeyContext | null;
167
+
168
+ /**
169
+ * Check if the API key has the required permissions.
170
+ * All specified actions must be present for the resource.
171
+ * Supports '*' wildcard which matches any action.
172
+ *
173
+ * @param resource - The resource to check (e.g., 'project', 'user')
174
+ * @param actions - Actions required (e.g., 'read', 'write')
175
+ * @returns true if all actions are permitted, false otherwise
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * // Check for specific permission
180
+ * if (c.var.auth.hasPermission('project', 'write')) { ... }
181
+ *
182
+ * // Check for multiple permissions (all required)
183
+ * if (c.var.auth.hasPermission('project', 'read', 'write')) { ... }
184
+ * ```
185
+ */
186
+ hasPermission(resource: string, ...actions: string[]): boolean;
187
+ }
188
+
189
+ /**
190
+ * Full authentication interface available on `c.var.auth` and `ctx.auth`.
191
+ *
192
+ * This is the primary interface you'll use to access authentication data
193
+ * in your route handlers and agents. It provides:
194
+ *
195
+ * - User data via `getUser()`
196
+ * - Organization helpers via `getOrg()`, `getOrgRole()`, `hasOrgRole()`
197
+ * - API key helpers via `apiKey`, `hasPermission()`
198
+ * - Token access via `getToken()`
199
+ *
200
+ * @example Route handler
201
+ * ```typescript
202
+ * app.get('/api/profile', async (c) => {
203
+ * const user = await c.var.auth.getUser();
204
+ * const org = await c.var.auth.getOrg();
205
+ * return c.json({ user, org });
206
+ * });
207
+ * ```
208
+ *
209
+ * @example Agent handler
210
+ * ```typescript
211
+ * handler: async (ctx, input) => {
212
+ * if (!ctx.auth) return { error: 'Unauthorized' };
213
+ * const user = await ctx.auth.getUser();
214
+ * return { message: `Hello, ${user.email}!` };
215
+ * }
216
+ * ```
217
+ *
218
+ * @typeParam TUser - User type (extends AuthUser, defaults to AuthUser)
219
+ */
220
+ export interface AuthInterface<TUser extends AuthUser = AuthUser>
221
+ extends AgentuityAuth<TUser, AuthContext<TUser>>,
222
+ AuthOrgHelpers,
223
+ AuthApiKeyHelpers {}
@@ -1,4 +1,5 @@
1
1
  export * from './adapter.ts';
2
+ export * from './auth/index.ts';
2
3
  export * from './email/index.ts';
3
4
  export * from './exception.ts';
4
5
  export * from './keyvalue/index.ts';
@@ -30,5 +31,6 @@ export * from './stream/index.ts';
30
31
  export * from './thread/index.ts';
31
32
  export * from './user/index.ts';
32
33
  export * from './webhook/index.ts';
34
+ export * from './workflow/index.ts';
33
35
 
34
36
  export { buildUrl, fromResponse, toPayload, toServiceException } from './_util.ts';
@@ -78,7 +78,7 @@ export async function createDestination(
78
78
  undefined,
79
79
  buildQueueHeaders(options?.orgId)
80
80
  ),
81
- { queueName, destinationUrl: params.config?.url }
81
+ { queueName, destinationUrl: params.config?.url as string | undefined }
82
82
  );
83
83
 
84
84
  if (resp.success) {
@@ -319,9 +319,11 @@ export const MessageSchema = z
319
319
  export type Message = z.infer<typeof MessageSchema>;
320
320
 
321
321
  /**
322
- * Destination type schema. Currently only HTTP webhooks are supported.
322
+ * Destination type schema. Supports webhook, queue, sandbox, and email destinations.
323
323
  */
324
- export const DestinationTypeSchema = z.enum(['http']).describe('Destination type schema');
324
+ export const DestinationTypeSchema = z
325
+ .enum(['http', 'url', 'webhook', 'queue', 'sandbox', 'email'])
326
+ .describe('Destination type schema');
325
327
 
326
328
  /**
327
329
  * Destination type.
@@ -591,6 +593,7 @@ export const CreateQueueRequestSchema = z
591
593
  name: z.string().optional().describe('Optional queue name (auto-generated if not provided).'),
592
594
  description: z.string().optional().describe("Optional description of the queue's purpose."),
593
595
  queue_type: QueueTypeSchema.describe('Type of queue to create.'),
596
+ internal: z.boolean().optional().describe('Whether the queue is system-managed.'),
594
597
  settings: QueueSettingsSchemaBase.partial()
595
598
  .optional()
596
599
  .describe(
@@ -747,7 +750,9 @@ export const CreateDestinationRequestSchema = z
747
750
  name: z.string().describe('Human-readable name for the destination.'),
748
751
  description: z.string().optional().describe('Optional description of the destination.'),
749
752
  destination_type: DestinationTypeSchema.describe('Type of destination to create.'),
750
- config: HttpDestinationConfigSchema.describe('HTTP configuration for the destination.'),
753
+ config: z
754
+ .record(z.string(), z.unknown())
755
+ .describe('Configuration for the destination (type-specific).'),
751
756
  enabled: z
752
757
  .boolean()
753
758
  .default(true)
@@ -769,9 +774,10 @@ export const UpdateDestinationRequestSchema = z
769
774
  .nullable()
770
775
  .optional()
771
776
  .describe('Updated description of the destination.'),
772
- config: HttpDestinationConfigSchema.partial()
777
+ config: z
778
+ .record(z.string(), z.unknown())
773
779
  .optional()
774
- .describe('HTTP configuration updates (partial update supported).'),
780
+ .describe('Configuration updates (partial update supported).'),
775
781
  enabled: z.boolean().optional().describe('Enable or disable the destination.'),
776
782
  })
777
783
  .describe('Update destination request schema');
@@ -213,6 +213,7 @@ export const CreateWebhookRequestSchema = z
213
213
  .object({
214
214
  name: z.string().describe('Human-readable name for the webhook'),
215
215
  description: z.string().optional().describe("Optional description of the webhook's purpose"),
216
+ internal: z.boolean().optional().describe('Whether the webhook is system-managed.'),
216
217
  })
217
218
  .describe('Request for creating a new webhook');
218
219
 
@@ -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;
@@ -0,0 +1,2 @@
1
+ export * from './service.ts';
2
+ export * from './types.ts';