@agentuity/schedule 3.0.10 → 3.1.0

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 CHANGED
@@ -13,7 +13,7 @@ Standalone package for the Agentuity Schedule service. Provides a simple, ergono
13
13
  ## Architecture
14
14
 
15
15
  - **Runtime**: Node.js and Bun compatible
16
- - **Exports**: ScheduleClient and all types from @agentuity/core/schedule
16
+ - **Exports**: ScheduleClient and all types from `@agentuity/schedule`
17
17
  - **Dependencies**: @agentuity/core, @agentuity/server, zod
18
18
 
19
19
  ## Usage
@@ -0,0 +1,351 @@
1
+ declare const service: {
2
+ name: string;
3
+ slug: string;
4
+ description: string;
5
+ endpoints: ({
6
+ id: string;
7
+ title: string;
8
+ sectionTitle: string;
9
+ method: string;
10
+ path: string;
11
+ description: string;
12
+ pathParams: never[];
13
+ queryParams: never[];
14
+ requestBody: {
15
+ description: string;
16
+ fields: {
17
+ schema: import("zod").ZodObject<{
18
+ name: import("zod").ZodString;
19
+ description: import("zod").ZodOptional<import("zod").ZodString>;
20
+ expression: import("zod").ZodString;
21
+ internal: import("zod").ZodOptional<import("zod").ZodBoolean>;
22
+ destinations: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodLazy<import("zod").ZodObject<{
23
+ type: import("zod").ZodEnum<{
24
+ sandbox: "sandbox";
25
+ url: "url";
26
+ }>;
27
+ config: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
28
+ }, import("zod/v4/core").$strip>>>>;
29
+ }, import("zod/v4/core").$strip>;
30
+ };
31
+ };
32
+ responseDescription: string;
33
+ responseFields: {
34
+ schema: import("zod").ZodObject<{
35
+ schedule: import("zod").ZodObject<{
36
+ id: import("zod").ZodString;
37
+ created_at: import("zod").ZodString;
38
+ updated_at: import("zod").ZodString;
39
+ created_by: import("zod").ZodString;
40
+ name: import("zod").ZodString;
41
+ description: import("zod").ZodNullable<import("zod").ZodString>;
42
+ expression: import("zod").ZodString;
43
+ due_date: import("zod").ZodString;
44
+ internal: import("zod").ZodBoolean;
45
+ }, import("zod/v4/core").$strip>;
46
+ destinations: import("zod").ZodArray<import("zod").ZodObject<{
47
+ id: import("zod").ZodString;
48
+ schedule_id: import("zod").ZodString;
49
+ created_at: import("zod").ZodString;
50
+ updated_at: import("zod").ZodString;
51
+ created_by: import("zod").ZodString;
52
+ type: import("zod").ZodEnum<{
53
+ sandbox: "sandbox";
54
+ url: "url";
55
+ }>;
56
+ config: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
57
+ }, import("zod/v4/core").$strip>>;
58
+ }, import("zod/v4/core").$strip>;
59
+ stripRequired?: undefined;
60
+ };
61
+ statuses: {
62
+ code: number;
63
+ description: string;
64
+ }[];
65
+ examplePath: string;
66
+ exampleBody: {
67
+ name: string;
68
+ expression: string;
69
+ destinations: {
70
+ type: string;
71
+ config: {
72
+ url: string;
73
+ };
74
+ }[];
75
+ type?: undefined;
76
+ config?: undefined;
77
+ };
78
+ } | {
79
+ id: string;
80
+ title: string;
81
+ sectionTitle: string;
82
+ method: string;
83
+ path: string;
84
+ description: string;
85
+ pathParams: never[];
86
+ queryParams: {
87
+ name: string;
88
+ type: string;
89
+ description: string;
90
+ required: boolean;
91
+ }[];
92
+ requestBody: null;
93
+ responseDescription: string;
94
+ responseFields: {
95
+ schema: import("zod").ZodObject<{
96
+ schedules: import("zod").ZodArray<import("zod").ZodObject<{
97
+ id: import("zod").ZodString;
98
+ created_at: import("zod").ZodString;
99
+ updated_at: import("zod").ZodString;
100
+ created_by: import("zod").ZodString;
101
+ name: import("zod").ZodString;
102
+ description: import("zod").ZodNullable<import("zod").ZodString>;
103
+ expression: import("zod").ZodString;
104
+ due_date: import("zod").ZodString;
105
+ internal: import("zod").ZodBoolean;
106
+ }, import("zod/v4/core").$strip>>;
107
+ total: import("zod").ZodNumber;
108
+ }, import("zod/v4/core").$strip>;
109
+ stripRequired?: undefined;
110
+ };
111
+ statuses: {
112
+ code: number;
113
+ description: string;
114
+ }[];
115
+ examplePath: string;
116
+ exampleBody?: undefined;
117
+ } | {
118
+ id: string;
119
+ title: string;
120
+ sectionTitle: string;
121
+ method: string;
122
+ path: string;
123
+ description: string;
124
+ pathParams: {
125
+ name: string;
126
+ type: string;
127
+ description: string;
128
+ required: boolean;
129
+ }[];
130
+ queryParams: never[];
131
+ requestBody: null;
132
+ responseDescription: string;
133
+ responseFields: {
134
+ schema: import("zod").ZodObject<{
135
+ schedule: import("zod").ZodObject<{
136
+ id: import("zod").ZodString;
137
+ created_at: import("zod").ZodString;
138
+ updated_at: import("zod").ZodString;
139
+ created_by: import("zod").ZodString;
140
+ name: import("zod").ZodString;
141
+ description: import("zod").ZodNullable<import("zod").ZodString>;
142
+ expression: import("zod").ZodString;
143
+ due_date: import("zod").ZodString;
144
+ internal: import("zod").ZodBoolean;
145
+ }, import("zod/v4/core").$strip>;
146
+ destinations: import("zod").ZodArray<import("zod").ZodObject<{
147
+ id: import("zod").ZodString;
148
+ schedule_id: import("zod").ZodString;
149
+ created_at: import("zod").ZodString;
150
+ updated_at: import("zod").ZodString;
151
+ created_by: import("zod").ZodString;
152
+ type: import("zod").ZodEnum<{
153
+ sandbox: "sandbox";
154
+ url: "url";
155
+ }>;
156
+ config: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
157
+ }, import("zod/v4/core").$strip>>;
158
+ }, import("zod/v4/core").$strip>;
159
+ stripRequired: boolean;
160
+ };
161
+ statuses: {
162
+ code: number;
163
+ description: string;
164
+ }[];
165
+ examplePath: string;
166
+ exampleBody?: undefined;
167
+ } | {
168
+ id: string;
169
+ title: string;
170
+ sectionTitle: string;
171
+ method: string;
172
+ path: string;
173
+ description: string;
174
+ pathParams: {
175
+ name: string;
176
+ type: string;
177
+ description: string;
178
+ required: boolean;
179
+ }[];
180
+ queryParams: never[];
181
+ requestBody: {
182
+ description: string;
183
+ fields: {
184
+ schema: import("zod").ZodObject<{
185
+ name: import("zod").ZodOptional<import("zod").ZodString>;
186
+ description: import("zod").ZodOptional<import("zod").ZodString>;
187
+ expression: import("zod").ZodOptional<import("zod").ZodString>;
188
+ }, import("zod/v4/core").$strip>;
189
+ };
190
+ };
191
+ responseDescription: string;
192
+ responseFields: {
193
+ schema: import("zod").ZodObject<{
194
+ schedule: import("zod").ZodObject<{
195
+ id: import("zod").ZodString;
196
+ created_at: import("zod").ZodString;
197
+ updated_at: import("zod").ZodString;
198
+ created_by: import("zod").ZodString;
199
+ name: import("zod").ZodString;
200
+ description: import("zod").ZodNullable<import("zod").ZodString>;
201
+ expression: import("zod").ZodString;
202
+ due_date: import("zod").ZodString;
203
+ internal: import("zod").ZodBoolean;
204
+ }, import("zod/v4/core").$strip>;
205
+ }, import("zod/v4/core").$strip>;
206
+ stripRequired: boolean;
207
+ };
208
+ statuses: {
209
+ code: number;
210
+ description: string;
211
+ }[];
212
+ examplePath: string;
213
+ exampleBody: {
214
+ name?: undefined;
215
+ destinations?: undefined;
216
+ expression: string;
217
+ type?: undefined;
218
+ config?: undefined;
219
+ };
220
+ } | {
221
+ id: string;
222
+ title: string;
223
+ sectionTitle: string;
224
+ method: string;
225
+ path: string;
226
+ description: string;
227
+ pathParams: {
228
+ name: string;
229
+ type: string;
230
+ description: string;
231
+ required: boolean;
232
+ }[];
233
+ queryParams: never[];
234
+ requestBody: null;
235
+ responseDescription: string;
236
+ statuses: {
237
+ code: number;
238
+ description: string;
239
+ }[];
240
+ examplePath: string;
241
+ exampleBody?: undefined;
242
+ responseFields?: undefined;
243
+ } | {
244
+ id: string;
245
+ title: string;
246
+ sectionTitle: string;
247
+ method: string;
248
+ path: string;
249
+ description: string;
250
+ pathParams: {
251
+ name: string;
252
+ type: string;
253
+ description: string;
254
+ required: boolean;
255
+ }[];
256
+ queryParams: never[];
257
+ requestBody: {
258
+ description: string;
259
+ fields: {
260
+ schema: import("zod").ZodObject<{
261
+ type: import("zod").ZodEnum<{
262
+ sandbox: "sandbox";
263
+ url: "url";
264
+ }>;
265
+ config: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
266
+ }, import("zod/v4/core").$strip>;
267
+ };
268
+ };
269
+ responseDescription: string;
270
+ responseFields: {
271
+ schema: import("zod").ZodObject<{
272
+ destination: import("zod").ZodObject<{
273
+ id: import("zod").ZodString;
274
+ schedule_id: import("zod").ZodString;
275
+ created_at: import("zod").ZodString;
276
+ updated_at: import("zod").ZodString;
277
+ created_by: import("zod").ZodString;
278
+ type: import("zod").ZodEnum<{
279
+ sandbox: "sandbox";
280
+ url: "url";
281
+ }>;
282
+ config: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
283
+ }, import("zod/v4/core").$strip>;
284
+ }, import("zod/v4/core").$strip>;
285
+ stripRequired: boolean;
286
+ };
287
+ statuses: {
288
+ code: number;
289
+ description: string;
290
+ }[];
291
+ examplePath: string;
292
+ exampleBody: {
293
+ name?: undefined;
294
+ destinations?: undefined;
295
+ expression?: undefined;
296
+ type: string;
297
+ config: {
298
+ url: string;
299
+ method: string;
300
+ };
301
+ };
302
+ } | {
303
+ exampleBody?: undefined;
304
+ id: string;
305
+ title: string;
306
+ sectionTitle: string;
307
+ method: string;
308
+ path: string;
309
+ description: string;
310
+ pathParams: {
311
+ name: string;
312
+ type: string;
313
+ description: string;
314
+ required: boolean;
315
+ }[];
316
+ queryParams: {
317
+ name: string;
318
+ type: string;
319
+ description: string;
320
+ required: boolean;
321
+ }[];
322
+ requestBody: null;
323
+ responseDescription: string;
324
+ responseFields: {
325
+ schema: import("zod").ZodObject<{
326
+ deliveries: import("zod").ZodArray<import("zod").ZodObject<{
327
+ id: import("zod").ZodString;
328
+ date: import("zod").ZodString;
329
+ schedule_id: import("zod").ZodString;
330
+ schedule_destination_id: import("zod").ZodString;
331
+ status: import("zod").ZodEnum<{
332
+ failed: "failed";
333
+ pending: "pending";
334
+ success: "success";
335
+ }>;
336
+ retries: import("zod").ZodNumber;
337
+ error: import("zod").ZodNullable<import("zod").ZodString>;
338
+ response: import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
339
+ }, import("zod/v4/core").$strip>>;
340
+ }, import("zod/v4/core").$strip>;
341
+ stripRequired: boolean;
342
+ };
343
+ statuses: {
344
+ code: number;
345
+ description: string;
346
+ }[];
347
+ examplePath: string;
348
+ })[];
349
+ };
350
+ export default service;
351
+ //# sourceMappingURL=api-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-reference.d.ts","sourceRoot":"","sources":["../src/api-reference.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;YAgBT,WAAW;YACX,MAAM;gBAAI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAYwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA+C1B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;YAA2B,aAAa;;;;;;;;;;;;;;;;;;;;;;;YAoB/D,WAAW;YACX,MAAM;gBAAI,MAAM;;;;;;;;;YAGC,MAAM;;;;;;;;;;;;;YAA8B,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0ClE,WAAW;YACX,MAAM;gBAAI,MAAM;;;;;;;;;;;YAGC,MAAM;;;;;;;;;;;;;;YAAyC,aAAa;;;;;;;;;;;;;gBASnE,GAAG;gBAAkC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;YAiDpC,MAAM;;;;;;;;;;;;;;;;YAAoC,aAAa;;;;;;;;CAS3E,CAAC;eAEa,OAAO"}
@@ -0,0 +1,215 @@
1
+ import { CreateScheduleDestinationParamsSchema, CreateScheduleParamsSchema, ScheduleCreateDestinationResultSchema, ScheduleCreateResultSchema, ScheduleDeliveryListResultSchema, ScheduleGetResultSchema, ScheduleListResultSchema, ScheduleUpdateResultSchema, UpdateScheduleParamsSchema, } from '@agentuity/schedule';
2
+ const service = {
3
+ name: 'Schedules',
4
+ slug: 'schedules',
5
+ description: 'Create and manage cron-based scheduled jobs with destinations and delivery tracking',
6
+ endpoints: [
7
+ {
8
+ id: 'create-schedule',
9
+ title: 'Create Schedule',
10
+ sectionTitle: 'Schedule Management',
11
+ method: 'POST',
12
+ path: '/schedule/create',
13
+ description: 'Create a new cron-based schedule with optional destinations.',
14
+ pathParams: [],
15
+ queryParams: [],
16
+ requestBody: {
17
+ description: 'Schedule creation payload.',
18
+ fields: { schema: CreateScheduleParamsSchema },
19
+ },
20
+ responseDescription: 'Returns the created schedule and its destinations.',
21
+ responseFields: { schema: ScheduleCreateResultSchema },
22
+ statuses: [
23
+ { code: 201, description: 'Schedule created' },
24
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
25
+ ],
26
+ examplePath: '/schedule/create',
27
+ exampleBody: {
28
+ name: 'Daily Report',
29
+ expression: '0 9 * * *',
30
+ destinations: [{ type: 'url', config: { url: 'https://example.com/webhook' } }],
31
+ },
32
+ },
33
+ {
34
+ id: 'list-schedules',
35
+ title: 'List Schedules',
36
+ sectionTitle: 'Schedule Management',
37
+ method: 'GET',
38
+ path: '/schedule/list',
39
+ description: 'List all schedules with optional pagination.',
40
+ pathParams: [],
41
+ queryParams: [
42
+ {
43
+ name: 'limit',
44
+ type: 'number',
45
+ description: 'Max results (max 500)',
46
+ required: false,
47
+ },
48
+ { name: 'offset', type: 'number', description: 'Pagination offset', required: false },
49
+ ],
50
+ requestBody: null,
51
+ responseDescription: 'Returns paginated list of schedules.',
52
+ responseFields: { schema: ScheduleListResultSchema },
53
+ statuses: [
54
+ { code: 200, description: 'Schedules returned' },
55
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
56
+ ],
57
+ examplePath: '/schedule/list',
58
+ },
59
+ {
60
+ id: 'get-schedule',
61
+ title: 'Get Schedule',
62
+ sectionTitle: 'Schedule Management',
63
+ method: 'GET',
64
+ path: '/schedule/get/{scheduleId}',
65
+ description: 'Get a specific schedule by ID.',
66
+ pathParams: [
67
+ {
68
+ name: 'scheduleId',
69
+ type: 'string',
70
+ description: 'Schedule ID (sch_ prefix)',
71
+ required: true,
72
+ },
73
+ ],
74
+ queryParams: [],
75
+ requestBody: null,
76
+ responseDescription: 'Returns the schedule object.',
77
+ responseFields: { schema: ScheduleGetResultSchema, stripRequired: true },
78
+ statuses: [
79
+ { code: 200, description: 'Schedule returned' },
80
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
81
+ { code: 404, description: 'Schedule not found' },
82
+ ],
83
+ examplePath: '/schedule/get/sch_abc123',
84
+ },
85
+ {
86
+ id: 'update-schedule',
87
+ title: 'Update Schedule',
88
+ sectionTitle: 'Schedule Management',
89
+ method: 'PUT',
90
+ path: '/schedule/update/{scheduleId}',
91
+ description: "Update a schedule's name, description, or cron expression.",
92
+ pathParams: [
93
+ { name: 'scheduleId', type: 'string', description: 'Schedule ID', required: true },
94
+ ],
95
+ queryParams: [],
96
+ requestBody: {
97
+ description: 'Fields to update.',
98
+ fields: { schema: UpdateScheduleParamsSchema },
99
+ },
100
+ responseDescription: 'Returns the updated schedule.',
101
+ responseFields: { schema: ScheduleUpdateResultSchema, stripRequired: true },
102
+ statuses: [
103
+ { code: 200, description: 'Schedule updated' },
104
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
105
+ { code: 404, description: 'Schedule not found' },
106
+ ],
107
+ examplePath: '/schedule/update/sch_abc123',
108
+ exampleBody: { expression: '0 */6 * * *' },
109
+ },
110
+ {
111
+ id: 'delete-schedule',
112
+ title: 'Delete Schedule',
113
+ sectionTitle: 'Schedule Management',
114
+ method: 'DELETE',
115
+ path: '/schedule/delete/{scheduleId}',
116
+ description: 'Delete a schedule and all associated destinations and delivery history.',
117
+ pathParams: [
118
+ { name: 'scheduleId', type: 'string', description: 'Schedule ID', required: true },
119
+ ],
120
+ queryParams: [],
121
+ requestBody: null,
122
+ responseDescription: 'Deletes the schedule and all associated destinations and delivery history.',
123
+ statuses: [
124
+ { code: 204, description: 'Schedule deleted' },
125
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
126
+ { code: 404, description: 'Schedule not found' },
127
+ ],
128
+ examplePath: '/schedule/delete/sch_abc123',
129
+ },
130
+ {
131
+ id: 'create-schedule-destination',
132
+ title: 'Create Destination',
133
+ sectionTitle: 'Destinations',
134
+ method: 'POST',
135
+ path: '/schedule/destinations/create/{scheduleId}',
136
+ description: 'Add a destination to a schedule.',
137
+ pathParams: [
138
+ { name: 'scheduleId', type: 'string', description: 'Schedule ID', required: true },
139
+ ],
140
+ queryParams: [],
141
+ requestBody: {
142
+ description: 'Destination creation payload.',
143
+ fields: { schema: CreateScheduleDestinationParamsSchema },
144
+ },
145
+ responseDescription: 'Returns the created destination.',
146
+ responseFields: { schema: ScheduleCreateDestinationResultSchema, stripRequired: true },
147
+ statuses: [
148
+ { code: 201, description: 'Destination created' },
149
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
150
+ { code: 404, description: 'Schedule not found' },
151
+ ],
152
+ examplePath: '/schedule/destinations/create/sch_abc123',
153
+ exampleBody: {
154
+ type: 'url',
155
+ config: { url: 'https://example.com/callback', method: 'POST' },
156
+ },
157
+ },
158
+ {
159
+ id: 'delete-schedule-destination',
160
+ title: 'Delete Destination',
161
+ sectionTitle: 'Destinations',
162
+ method: 'DELETE',
163
+ path: '/schedule/destinations/delete/{destinationId}',
164
+ description: 'Delete a destination from a schedule.',
165
+ pathParams: [
166
+ {
167
+ name: 'destinationId',
168
+ type: 'string',
169
+ description: 'Destination ID (sdst_ prefix)',
170
+ required: true,
171
+ },
172
+ ],
173
+ queryParams: [],
174
+ requestBody: null,
175
+ responseDescription: 'Empty response on success.',
176
+ statuses: [
177
+ { code: 204, description: 'Destination deleted' },
178
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
179
+ { code: 404, description: 'Destination not found' },
180
+ ],
181
+ examplePath: '/schedule/destinations/delete/sdst_abc123',
182
+ },
183
+ {
184
+ id: 'list-schedule-deliveries',
185
+ title: 'List Deliveries',
186
+ sectionTitle: 'Deliveries',
187
+ method: 'GET',
188
+ path: '/schedule/deliveries/{scheduleId}',
189
+ description: 'List delivery attempts for a schedule.',
190
+ pathParams: [
191
+ { name: 'scheduleId', type: 'string', description: 'Schedule ID', required: true },
192
+ ],
193
+ queryParams: [
194
+ {
195
+ name: 'limit',
196
+ type: 'number',
197
+ description: 'Maximum results to return',
198
+ required: false,
199
+ },
200
+ { name: 'offset', type: 'number', description: 'Pagination offset', required: false },
201
+ ],
202
+ requestBody: null,
203
+ responseDescription: 'Returns delivery attempts with status, retries, and error details.',
204
+ responseFields: { schema: ScheduleDeliveryListResultSchema, stripRequired: true },
205
+ statuses: [
206
+ { code: 200, description: 'Deliveries returned' },
207
+ { code: 401, description: 'Unauthorized — invalid or missing Bearer token' },
208
+ { code: 404, description: 'Schedule not found' },
209
+ ],
210
+ examplePath: '/schedule/deliveries/sch_abc123',
211
+ },
212
+ ],
213
+ };
214
+ export default service;
215
+ //# sourceMappingURL=api-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-reference.js","sourceRoot":"","sources":["../src/api-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,qCAAqC,EACrC,0BAA0B,EAC1B,qCAAqC,EACrC,0BAA0B,EAC1B,gCAAgC,EAChC,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,GAAG;IACf,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,WAAW,EACV,qFAAqF;IACtF,SAAS,EAAE;QACV;YACC,EAAE,EAAE,iBAAiB;YACrB,KAAK,EAAE,iBAAiB;YACxB,YAAY,EAAE,qBAAqB;YACnC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,8DAA8D;YAC3E,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AuB,EAAE;aACnD;YACD,WAAW,EAAE,2CAA2C;SACxD;QACD;YACC,EAAE,EAAE,0BAA0B;YAC9B,KAAK,EAAE,iBAAiB;YACxB,YAAY,EAAE,YAAY;YAC1B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,mCAAmC;YACzC,WAAW,EAAE,wCAAwC;YACrD,UAAU,EAAE;gBACX,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;aAClF;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;oBACxC,QAAQ,EAAE,KAAK;iBACf;gBACD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,KAAK,EAAE;aACrF;YACD,WAAW,EAAE,IAAI;YACjB,mBAAmB,EAAE,oEAAoE;YACzF,cAAc,EAAE,EAAE,MAAM,EAAE,gCAAgC,EAAE,aAAa,EAAE,IAAI,EAAE;YACjF,QAAQ,EAAE;gBACT,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,qBAAqB,EAAE;gBACjD,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,gDAAgD,EAAE;gBAC5E,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,oBAAoB,EAAE;aAChD;YACD,WAAW,EAAE,iCAAiC;SAC9C;KACD;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- export { ScheduleService, type Schedule, type ScheduleDestination, type ScheduleDelivery, type CreateScheduleParams, type UpdateScheduleParams, type CreateScheduleDestinationParams, type ScheduleListResult, type ScheduleGetResult, type ScheduleCreateResult, type ScheduleDeliveryListResult, ScheduleSchema, ScheduleDestinationSchema, ScheduleDeliverySchema, CreateScheduleParamsSchema, UpdateScheduleParamsSchema, CreateScheduleDestinationParamsSchema, ScheduleListResultSchema, ScheduleGetResultSchema, ScheduleCreateResultSchema, ScheduleDeliveryListResultSchema, } from '@agentuity/core/schedule';
2
- import { type CreateScheduleParams, type UpdateScheduleParams, type CreateScheduleDestinationParams, type ScheduleGetResult, type ScheduleListResult, type ScheduleCreateResult, type ScheduleDeliveryListResult, type Schedule, type ScheduleDestination } from '@agentuity/core/schedule';
3
- import { type Logger } from '@agentuity/adapter';
1
+ export * from './service.ts';
2
+ export * from './types.ts';
3
+ import { type CreateScheduleParams, type UpdateScheduleParams, type CreateScheduleDestinationParams, type ScheduleGetResult, type ScheduleListResult, type ScheduleCreateResult, type ScheduleDeliveryListResult, type Schedule, type ScheduleDestination } from './service.ts';
4
+ import { type Logger } from '@agentuity/client';
4
5
  import { z } from 'zod';
5
6
  export declare const ScheduleClientOptionsSchema: z.ZodObject<{
6
7
  apiKey: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,qCAAqC,EACrC,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,gCAAgC,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEN,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,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E,MAAM,EAClB,MAAM,EAAE,+BAA+B,GACrC,OAAO,CAAC;QAAE,WAAW,EAAE,mBAAmB,CAAA;KAAE,CAAC,CAE/C;IAEK,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5D;IAEK,cAAc,CACnB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1C,OAAO,CAAC,0BAA0B,CAAC,CAErC;CACD"}
package/dist/index.js CHANGED
@@ -1,13 +1,9 @@
1
- export { ScheduleService, ScheduleSchema, ScheduleDestinationSchema, ScheduleDeliverySchema, CreateScheduleParamsSchema, UpdateScheduleParamsSchema, CreateScheduleDestinationParamsSchema, ScheduleListResultSchema, ScheduleGetResultSchema, ScheduleCreateResultSchema, ScheduleDeliveryListResultSchema, } from '@agentuity/core/schedule';
2
- import { ScheduleService, } from '@agentuity/core/schedule';
3
- import { createServerFetchAdapter, buildClientHeaders } from '@agentuity/adapter';
4
- import { createMinimalLogger } from '@agentuity/core';
5
- import { getEnv } from '@agentuity/core';
6
- import { getServiceUrls } from '@agentuity/core/config';
1
+ export * from './service.js';
2
+ export * from './types.js';
3
+ import { ScheduleService, } from './service.js';
4
+ import { getServiceUrls } from '@agentuity/config';
5
+ import { createServiceAdapter, isLogger, resolveApiKey, resolveRegion, resolveServiceUrl, } from '@agentuity/client';
7
6
  import { z } from 'zod';
8
- const isLogger = (val) => typeof val === 'object' &&
9
- val !== null &&
10
- ['info', 'warn', 'error', 'debug', 'trace'].every((m) => typeof val[m] === 'function');
11
7
  export const ScheduleClientOptionsSchema = z.object({
12
8
  apiKey: z.string().optional().describe('API key for authentication'),
13
9
  url: z.string().optional().describe('Base URL for the Schedule API'),
@@ -18,16 +14,17 @@ export class ScheduleClient {
18
14
  #service;
19
15
  constructor(options = {}) {
20
16
  const validatedOptions = ScheduleClientOptionsSchema.parse(options);
21
- const apiKey = validatedOptions.apiKey || getEnv('AGENTUITY_SDK_KEY') || getEnv('AGENTUITY_CLI_KEY');
22
- const region = getEnv('AGENTUITY_REGION') ?? 'usc';
23
- const serviceUrls = getServiceUrls(region);
24
- const url = validatedOptions.url || getEnv('AGENTUITY_SCHEDULE_URL') || serviceUrls.catalyst;
25
- const logger = validatedOptions.logger ?? createMinimalLogger();
26
- const headers = buildClientHeaders({
27
- apiKey,
17
+ const serviceUrls = getServiceUrls(resolveRegion());
18
+ const url = resolveServiceUrl({
19
+ url: validatedOptions.url,
20
+ envKey: 'AGENTUITY_SCHEDULE_URL',
21
+ fallback: serviceUrls.catalyst,
22
+ });
23
+ const { adapter } = createServiceAdapter({
24
+ apiKey: resolveApiKey(validatedOptions.apiKey),
28
25
  orgId: validatedOptions.orgId,
26
+ logger: validatedOptions.logger,
29
27
  });
30
- const adapter = createServerFetchAdapter({ headers }, logger);
31
28
  this.#service = new ScheduleService(url, adapter);
32
29
  }
33
30
  async create(params) {