@chronary/schemas 0.4.1 → 0.7.1
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/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/dist/events.cjs +84 -29
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +113 -21
- package/dist/events.d.ts +113 -21
- package/dist/events.js +81 -29
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +84 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +81 -29
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -23,6 +23,7 @@ __export(index_exports, {
|
|
|
23
23
|
AgentCreatedPayloadSchema: () => AgentCreatedPayloadSchema,
|
|
24
24
|
AgentUpdatedPayloadSchema: () => AgentUpdatedPayloadSchema,
|
|
25
25
|
AvailabilityQuerySchema: () => AvailabilityQuerySchema,
|
|
26
|
+
CalendarConnectionReauthorizationRequiredPayloadSchema: () => CalendarConnectionReauthorizationRequiredPayloadSchema,
|
|
26
27
|
CreateAgentSchema: () => CreateAgentSchema,
|
|
27
28
|
CreateCalendarSchema: () => CreateCalendarSchema,
|
|
28
29
|
CreateEventSchema: () => CreateEventSchema,
|
|
@@ -48,6 +49,7 @@ __export(index_exports, {
|
|
|
48
49
|
ListEventsQuerySchema: () => ListEventsQuerySchema,
|
|
49
50
|
ListICalSubscriptionsQuerySchema: () => ListICalSubscriptionsQuerySchema,
|
|
50
51
|
ListWebhooksQuerySchema: () => ListWebhooksQuerySchema,
|
|
52
|
+
OrgPlanChangedPayloadSchema: () => OrgPlanChangedPayloadSchema,
|
|
51
53
|
ProposalCancelledPayloadSchema: () => ProposalCancelledPayloadSchema,
|
|
52
54
|
ProposalConfirmedPayloadSchema: () => ProposalConfirmedPayloadSchema,
|
|
53
55
|
ProposalCreatedPayloadSchema: () => ProposalCreatedPayloadSchema,
|
|
@@ -64,6 +66,7 @@ __export(index_exports, {
|
|
|
64
66
|
UpdateEventSchema: () => UpdateEventSchema,
|
|
65
67
|
UpdateICalSubscriptionSchema: () => UpdateICalSubscriptionSchema,
|
|
66
68
|
UpdateWebhookSchema: () => UpdateWebhookSchema,
|
|
69
|
+
UsageThresholdCrossedPayloadSchema: () => UsageThresholdCrossedPayloadSchema,
|
|
67
70
|
WEBHOOK_DELIVERY_STATUSES: () => WEBHOOK_DELIVERY_STATUSES,
|
|
68
71
|
WEBHOOK_EVENT_TYPES: () => WEBHOOK_EVENT_TYPES,
|
|
69
72
|
WebhookDeactivatedPayloadSchema: () => WebhookDeactivatedPayloadSchema,
|
|
@@ -78,16 +81,17 @@ var import_zod2 = require("zod");
|
|
|
78
81
|
|
|
79
82
|
// src/shared.ts
|
|
80
83
|
var import_zod = require("zod");
|
|
84
|
+
var isoDateTimeInput = import_zod.z.string().datetime({ offset: true }).transform((v) => v.endsWith("Z") ? v : new Date(v).toISOString());
|
|
81
85
|
var metadataSchema = import_zod.z.record(import_zod.z.string(), import_zod.z.unknown()).refine((v) => JSON.stringify(v).length <= 16384, "metadata exceeds 16KB");
|
|
82
86
|
var CreateAgentSchema = import_zod.z.object({
|
|
83
87
|
name: import_zod.z.string().min(1).max(255),
|
|
84
88
|
type: import_zod.z.enum(["ai", "human", "resource"]),
|
|
85
|
-
description: import_zod.z.string().optional(),
|
|
89
|
+
description: import_zod.z.string().max(5e3).optional(),
|
|
86
90
|
metadata: metadataSchema.optional()
|
|
87
91
|
});
|
|
88
92
|
var UpdateAgentSchema = import_zod.z.object({
|
|
89
93
|
name: import_zod.z.string().min(1).max(255).optional(),
|
|
90
|
-
description: import_zod.z.string().nullable().optional(),
|
|
94
|
+
description: import_zod.z.string().max(5e3).nullable().optional(),
|
|
91
95
|
metadata: metadataSchema.optional(),
|
|
92
96
|
status: import_zod.z.enum(["active", "paused"]).optional()
|
|
93
97
|
}).refine((v) => Object.keys(v).length > 0, "request body must include at least one field");
|
|
@@ -105,7 +109,7 @@ var DEFAULT_EVENT_REMINDERS = [10];
|
|
|
105
109
|
var RemindersSchema = import_zod.z.array(import_zod.z.number().int().min(REMINDER_MIN_MINUTES).max(REMINDER_MAX_MINUTES)).max(REMINDER_MAX_COUNT, `at most ${REMINDER_MAX_COUNT} reminders allowed`).transform((arr) => Array.from(new Set(arr)).sort((a, b) => a - b));
|
|
106
110
|
var CreateCalendarSchema = import_zod.z.object({
|
|
107
111
|
name: import_zod.z.string().min(1).max(255),
|
|
108
|
-
timezone: import_zod.z.string().min(1),
|
|
112
|
+
timezone: import_zod.z.string().min(1).max(64),
|
|
109
113
|
agent_status: AgentStatusEnum.optional(),
|
|
110
114
|
// Default reminders inherited by events on this calendar that don't set their
|
|
111
115
|
// own. `null` means "use the system default"; `[]` means "no reminders".
|
|
@@ -114,7 +118,7 @@ var CreateCalendarSchema = import_zod.z.object({
|
|
|
114
118
|
});
|
|
115
119
|
var UpdateCalendarSchema = import_zod.z.object({
|
|
116
120
|
name: import_zod.z.string().min(1).max(255).optional(),
|
|
117
|
-
timezone: import_zod.z.string().min(1).optional(),
|
|
121
|
+
timezone: import_zod.z.string().min(1).max(64).optional(),
|
|
118
122
|
agent_status: AgentStatusEnum.optional(),
|
|
119
123
|
default_reminders: RemindersSchema.nullable().optional(),
|
|
120
124
|
metadata: metadataSchema.optional()
|
|
@@ -129,14 +133,14 @@ var HOLD_TTL_MIN_SECONDS = 30;
|
|
|
129
133
|
var HOLD_TTL_MAX_SECONDS = 15 * 60;
|
|
130
134
|
var CreateEventSchema = import_zod.z.object({
|
|
131
135
|
title: import_zod.z.string().min(1).max(500),
|
|
132
|
-
start_time:
|
|
133
|
-
end_time:
|
|
134
|
-
description: import_zod.z.string().optional(),
|
|
136
|
+
start_time: isoDateTimeInput,
|
|
137
|
+
end_time: isoDateTimeInput,
|
|
138
|
+
description: import_zod.z.string().max(1e4).optional(),
|
|
135
139
|
all_day: import_zod.z.boolean().default(false),
|
|
136
140
|
status: import_zod.z.enum(EVENT_STATUSES).default("confirmed"),
|
|
137
141
|
metadata: metadataSchema.optional(),
|
|
138
142
|
reminders: RemindersSchema.nullable().optional(),
|
|
139
|
-
hold_expires_at:
|
|
143
|
+
hold_expires_at: isoDateTimeInput.optional(),
|
|
140
144
|
hold_priority: import_zod.z.number().int().min(0).max(100).optional()
|
|
141
145
|
}).refine((v) => new Date(v.end_time) > new Date(v.start_time), "end_time must be after start_time").superRefine((v, ctx) => {
|
|
142
146
|
if (v.status === "hold") {
|
|
@@ -182,17 +186,17 @@ var CreateEventSchema = import_zod.z.object({
|
|
|
182
186
|
});
|
|
183
187
|
var UpdateEventSchema = import_zod.z.object({
|
|
184
188
|
title: import_zod.z.string().min(1).max(500).optional(),
|
|
185
|
-
description: import_zod.z.string().nullable().optional(),
|
|
186
|
-
start_time:
|
|
187
|
-
end_time:
|
|
189
|
+
description: import_zod.z.string().max(1e4).nullable().optional(),
|
|
190
|
+
start_time: isoDateTimeInput.optional(),
|
|
191
|
+
end_time: isoDateTimeInput.optional(),
|
|
188
192
|
all_day: import_zod.z.boolean().optional(),
|
|
189
193
|
status: import_zod.z.enum(["confirmed", "tentative", "cancelled"]).optional(),
|
|
190
194
|
metadata: metadataSchema.optional(),
|
|
191
195
|
reminders: RemindersSchema.nullable().optional()
|
|
192
196
|
}).refine((v) => Object.keys(v).length > 0, "request body must include at least one field");
|
|
193
197
|
var ListEventsQuerySchema = import_zod.z.object({
|
|
194
|
-
start_after:
|
|
195
|
-
start_before:
|
|
198
|
+
start_after: isoDateTimeInput.optional(),
|
|
199
|
+
start_before: isoDateTimeInput.optional(),
|
|
196
200
|
status: import_zod.z.enum(EVENT_STATUSES).optional(),
|
|
197
201
|
source: import_zod.z.enum(["internal", "external_ical"]).optional(),
|
|
198
202
|
limit: import_zod.z.coerce.number().int().min(1).max(200).default(50),
|
|
@@ -238,15 +242,15 @@ function resolveDuration(v) {
|
|
|
238
242
|
return { ...rest, slot_duration: duration ?? v.slot_duration ?? DEFAULT_SLOT_DURATION };
|
|
239
243
|
}
|
|
240
244
|
var AvailabilityQuerySchema = import_zod.z.object({
|
|
241
|
-
start:
|
|
242
|
-
end:
|
|
245
|
+
start: isoDateTimeInput,
|
|
246
|
+
end: isoDateTimeInput,
|
|
243
247
|
...durationFields,
|
|
244
248
|
include_busy: import_zod.z.enum(["true", "false"]).default("false").transform((v) => v === "true")
|
|
245
249
|
}).superRefine(refineDurationConflict).transform(resolveDuration).refine((v) => new Date(v.end) > new Date(v.start), "end must be after start");
|
|
246
250
|
var CrossAgentAvailabilityQuerySchema = import_zod.z.object({
|
|
247
251
|
agents: import_zod.z.string().min(1).transform((v) => v.split(",")),
|
|
248
|
-
start:
|
|
249
|
-
end:
|
|
252
|
+
start: isoDateTimeInput,
|
|
253
|
+
end: isoDateTimeInput,
|
|
250
254
|
...durationFields,
|
|
251
255
|
calendars: import_zod.z.string().transform((v) => v.split(",")).optional(),
|
|
252
256
|
include_busy: import_zod.z.enum(["true", "false"]).default("false").transform((v) => v === "true")
|
|
@@ -269,14 +273,17 @@ var WEBHOOK_EVENT_TYPES = [
|
|
|
269
273
|
"proposal.confirmed",
|
|
270
274
|
"proposal.expired",
|
|
271
275
|
"proposal.cancelled",
|
|
272
|
-
"webhook.deactivated"
|
|
276
|
+
"webhook.deactivated",
|
|
277
|
+
"org.plan_changed",
|
|
278
|
+
"calendar_connection.reauthorization_required",
|
|
279
|
+
"usage.threshold_crossed"
|
|
273
280
|
];
|
|
274
281
|
var CreateWebhookSchema = import_zod.z.object({
|
|
275
|
-
url: import_zod.z.string().url("Must be a valid URL"),
|
|
282
|
+
url: import_zod.z.string().url("Must be a valid URL").max(2048),
|
|
276
283
|
events: import_zod.z.array(import_zod.z.enum(WEBHOOK_EVENT_TYPES)).min(1, "At least one event type must be specified")
|
|
277
284
|
});
|
|
278
285
|
var UpdateWebhookSchema = import_zod.z.object({
|
|
279
|
-
url: import_zod.z.string().url("Must be a valid URL").optional(),
|
|
286
|
+
url: import_zod.z.string().url("Must be a valid URL").max(2048).optional(),
|
|
280
287
|
events: import_zod.z.array(import_zod.z.enum(WEBHOOK_EVENT_TYPES)).optional(),
|
|
281
288
|
active: import_zod.z.boolean().optional()
|
|
282
289
|
});
|
|
@@ -284,22 +291,37 @@ var ListWebhooksQuerySchema = import_zod.z.object({
|
|
|
284
291
|
limit: import_zod.z.coerce.number().int().min(1).max(100).default(20),
|
|
285
292
|
offset: import_zod.z.coerce.number().int().min(0).default(0)
|
|
286
293
|
});
|
|
287
|
-
var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed"];
|
|
294
|
+
var WEBHOOK_DELIVERY_STATUSES = ["pending", "delivered", "failed", "dropped"];
|
|
288
295
|
var WebhookDeliveryStatusSchema = import_zod.z.enum(WEBHOOK_DELIVERY_STATUSES);
|
|
289
296
|
var ListDeliveriesQuerySchema = import_zod.z.object({
|
|
290
297
|
limit: import_zod.z.coerce.number().int().min(1).max(100).default(20),
|
|
291
298
|
offset: import_zod.z.coerce.number().int().min(0).default(0),
|
|
292
299
|
status: WebhookDeliveryStatusSchema.optional(),
|
|
293
|
-
include_payload: import_zod.z.enum(["true", "false"]).optional().transform((v) => v === "true")
|
|
300
|
+
include_payload: import_zod.z.enum(["true", "false"]).optional().transform((v) => v === "true"),
|
|
301
|
+
/** An exact event type (`event.created`) or a prefix ending in a dot (`event.`). */
|
|
302
|
+
event_type: import_zod.z.string().max(100).regex(/^[a-z_]+\.(?:[a-z_]+)?$/).optional(),
|
|
303
|
+
created_after: isoDateTimeInput.optional(),
|
|
304
|
+
created_before: isoDateTimeInput.optional(),
|
|
305
|
+
delivery_id: import_zod.z.string().max(100).regex(/^whd_[A-Za-z0-9_-]+$/).optional(),
|
|
306
|
+
is_test: import_zod.z.enum(["true", "false"]).transform((v) => v === "true").optional(),
|
|
307
|
+
/** The `next_cursor` from the previous page; cannot be combined with a non-zero `offset`. */
|
|
308
|
+
cursor: import_zod.z.string().min(1).max(1024).optional()
|
|
309
|
+
}).superRefine((v, ctx) => {
|
|
310
|
+
if (v.cursor !== void 0 && v.offset > 0) {
|
|
311
|
+
ctx.addIssue({ code: "custom", path: ["cursor"], message: "cursor and offset cannot be combined" });
|
|
312
|
+
}
|
|
313
|
+
if (v.created_after !== void 0 && v.created_before !== void 0 && Date.parse(v.created_after) >= Date.parse(v.created_before)) {
|
|
314
|
+
ctx.addIssue({ code: "custom", path: ["created_after"], message: "created_after must be before created_before" });
|
|
315
|
+
}
|
|
294
316
|
});
|
|
295
317
|
var CreateICalSubscriptionSchema = import_zod.z.object({
|
|
296
318
|
calendar_id: import_zod.z.string().min(1),
|
|
297
|
-
url: import_zod.z.string().url().refine((u) => u.startsWith("https://"), "URL must use HTTPS"),
|
|
319
|
+
url: import_zod.z.string().url().max(2048).refine((u) => u.startsWith("https://"), "URL must use HTTPS"),
|
|
298
320
|
label: import_zod.z.string().min(1).max(255).optional()
|
|
299
321
|
});
|
|
300
322
|
var UpdateICalSubscriptionSchema = import_zod.z.object({
|
|
301
323
|
label: import_zod.z.string().min(1).max(255).optional(),
|
|
302
|
-
url: import_zod.z.string().url().refine((u) => u.startsWith("https://"), "URL must use HTTPS").optional()
|
|
324
|
+
url: import_zod.z.string().url().max(2048).refine((u) => u.startsWith("https://"), "URL must use HTTPS").optional()
|
|
303
325
|
}).refine((v) => Object.keys(v).length > 0, "request body must include at least one field");
|
|
304
326
|
var ListICalSubscriptionsQuerySchema = import_zod.z.object({
|
|
305
327
|
status: import_zod.z.enum(["active", "error", "paused"]).optional(),
|
|
@@ -308,8 +330,8 @@ var ListICalSubscriptionsQuerySchema = import_zod.z.object({
|
|
|
308
330
|
});
|
|
309
331
|
var proposalMetadataSchema = metadataSchema.optional().default({});
|
|
310
332
|
var ProposalSlotSchema = import_zod.z.object({
|
|
311
|
-
start_time:
|
|
312
|
-
end_time:
|
|
333
|
+
start_time: isoDateTimeInput,
|
|
334
|
+
end_time: isoDateTimeInput,
|
|
313
335
|
weight: import_zod.z.number().min(0).max(10).default(1).optional(),
|
|
314
336
|
calendar_id: import_zod.z.string().optional()
|
|
315
337
|
});
|
|
@@ -320,7 +342,7 @@ var CreateProposalSchema = import_zod.z.object({
|
|
|
320
342
|
participant_agent_ids: import_zod.z.array(import_zod.z.string()).min(1).max(50),
|
|
321
343
|
calendar_id: import_zod.z.string(),
|
|
322
344
|
slots: import_zod.z.array(ProposalSlotSchema).min(1).max(20),
|
|
323
|
-
expires_at:
|
|
345
|
+
expires_at: isoDateTimeInput.optional(),
|
|
324
346
|
metadata: proposalMetadataSchema
|
|
325
347
|
});
|
|
326
348
|
var RespondToProposalSchema = import_zod.z.object({
|
|
@@ -405,9 +427,36 @@ var ProposalCancelledPayloadSchema = import_zod2.z.object({
|
|
|
405
427
|
var ProposalExpiredPayloadSchema = import_zod2.z.object({
|
|
406
428
|
proposal_id: import_zod2.z.string()
|
|
407
429
|
}).passthrough();
|
|
430
|
+
var OrgPlanChangedPayloadSchema = import_zod2.z.object({
|
|
431
|
+
org_id: import_zod2.z.string(),
|
|
432
|
+
previous_plan: import_zod2.z.string(),
|
|
433
|
+
plan: import_zod2.z.string(),
|
|
434
|
+
source: import_zod2.z.enum(["subscription", "founding_expiry", "admin_override", "soft_launch_toggle", "system"]),
|
|
435
|
+
subscription_status: import_zod2.z.string().nullable(),
|
|
436
|
+
interval: import_zod2.z.enum(["month", "year"]).nullable(),
|
|
437
|
+
upgrade_request_id: import_zod2.z.string().nullable()
|
|
438
|
+
}).passthrough();
|
|
439
|
+
var CalendarConnectionReauthorizationRequiredPayloadSchema = import_zod2.z.object({
|
|
440
|
+
connection_id: import_zod2.z.string(),
|
|
441
|
+
provider: import_zod2.z.string(),
|
|
442
|
+
reauthorization_reason: import_zod2.z.string(),
|
|
443
|
+
impacted_agent_count: import_zod2.z.number().int().nonnegative(),
|
|
444
|
+
occurred_at: import_zod2.z.string()
|
|
445
|
+
}).passthrough();
|
|
446
|
+
var UsageThresholdCrossedPayloadSchema = import_zod2.z.object({
|
|
447
|
+
metric: import_zod2.z.string(),
|
|
448
|
+
used: import_zod2.z.number().int().nonnegative(),
|
|
449
|
+
limit: import_zod2.z.number().int().nonnegative(),
|
|
450
|
+
threshold_pct: import_zod2.z.number().int(),
|
|
451
|
+
period: import_zod2.z.string(),
|
|
452
|
+
resets_at: import_zod2.z.string()
|
|
453
|
+
}).passthrough();
|
|
408
454
|
var WebhookDeactivatedPayloadSchema = import_zod2.z.object({
|
|
409
455
|
webhook_id: import_zod2.z.string(),
|
|
410
|
-
|
|
456
|
+
webhook_origin: import_zod2.z.string().optional(),
|
|
457
|
+
webhook_path: import_zod2.z.string().optional(),
|
|
458
|
+
/** @deprecated Deliveries send `webhook_origin` and `webhook_path` instead. */
|
|
459
|
+
url: import_zod2.z.string().optional(),
|
|
411
460
|
reason: import_zod2.z.string()
|
|
412
461
|
}).passthrough();
|
|
413
462
|
var PAYLOAD_SCHEMAS = {
|
|
@@ -428,7 +477,10 @@ var PAYLOAD_SCHEMAS = {
|
|
|
428
477
|
"proposal.confirmed": ProposalConfirmedPayloadSchema,
|
|
429
478
|
"proposal.expired": ProposalExpiredPayloadSchema,
|
|
430
479
|
"proposal.cancelled": ProposalCancelledPayloadSchema,
|
|
431
|
-
"webhook.deactivated": WebhookDeactivatedPayloadSchema
|
|
480
|
+
"webhook.deactivated": WebhookDeactivatedPayloadSchema,
|
|
481
|
+
"org.plan_changed": OrgPlanChangedPayloadSchema,
|
|
482
|
+
"calendar_connection.reauthorization_required": CalendarConnectionReauthorizationRequiredPayloadSchema,
|
|
483
|
+
"usage.threshold_crossed": UsageThresholdCrossedPayloadSchema
|
|
432
484
|
};
|
|
433
485
|
function parseWebhookEvent(eventType, body) {
|
|
434
486
|
if (!eventType) {
|
|
@@ -461,6 +513,7 @@ function parseWebhookEvent(eventType, body) {
|
|
|
461
513
|
AgentCreatedPayloadSchema,
|
|
462
514
|
AgentUpdatedPayloadSchema,
|
|
463
515
|
AvailabilityQuerySchema,
|
|
516
|
+
CalendarConnectionReauthorizationRequiredPayloadSchema,
|
|
464
517
|
CreateAgentSchema,
|
|
465
518
|
CreateCalendarSchema,
|
|
466
519
|
CreateEventSchema,
|
|
@@ -486,6 +539,7 @@ function parseWebhookEvent(eventType, body) {
|
|
|
486
539
|
ListEventsQuerySchema,
|
|
487
540
|
ListICalSubscriptionsQuerySchema,
|
|
488
541
|
ListWebhooksQuerySchema,
|
|
542
|
+
OrgPlanChangedPayloadSchema,
|
|
489
543
|
ProposalCancelledPayloadSchema,
|
|
490
544
|
ProposalConfirmedPayloadSchema,
|
|
491
545
|
ProposalCreatedPayloadSchema,
|
|
@@ -502,6 +556,7 @@ function parseWebhookEvent(eventType, body) {
|
|
|
502
556
|
UpdateEventSchema,
|
|
503
557
|
UpdateICalSubscriptionSchema,
|
|
504
558
|
UpdateWebhookSchema,
|
|
559
|
+
UsageThresholdCrossedPayloadSchema,
|
|
505
560
|
WEBHOOK_DELIVERY_STATUSES,
|
|
506
561
|
WEBHOOK_EVENT_TYPES,
|
|
507
562
|
WebhookDeactivatedPayloadSchema,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/events.ts","../src/shared.ts"],"sourcesContent":["/**\n * `@chronary/schemas` — Zod schemas + types for the Chronary calendar API.\n *\n * Self-contained public schemas for external consumers, plus per-event-type\n * webhook payload schemas for runtime validation of incoming webhooks.\n *\n * See {@link ./events | `./events`} for webhook-specific exports.\n */\n\n// Webhook payload schemas + discriminator.\nexport * from './events';\n\nexport {\n // Calendars\n CreateCalendarSchema,\n UpdateCalendarSchema,\n ListCalendarsQuerySchema,\n type CreateCalendarInput,\n type UpdateCalendarInput,\n type ListCalendarsQuery,\n\n // Events\n EVENT_STATUSES,\n CreateEventSchema,\n UpdateEventSchema,\n ListEventsQuerySchema,\n RemindersSchema,\n REMINDER_MIN_MINUTES,\n REMINDER_MAX_MINUTES,\n REMINDER_MAX_COUNT,\n DEFAULT_EVENT_REMINDERS,\n type EventStatus,\n type CreateEventInput,\n type UpdateEventInput,\n type ListEventsQuery,\n\n // Availability\n WorkingHoursSchema,\n UpdateAvailabilityRulesSchema,\n AvailabilityQuerySchema,\n CrossAgentAvailabilityQuerySchema,\n type WorkingHours,\n type UpdateAvailabilityRules,\n type AvailabilityQuery,\n type CrossAgentAvailabilityQuery,\n\n // Webhook subscriptions (management) — event payload schemas are in ./events\n CreateWebhookSchema,\n UpdateWebhookSchema,\n ListWebhooksQuerySchema,\n ListDeliveriesQuerySchema,\n WebhookDeliveryStatusSchema,\n WEBHOOK_DELIVERY_STATUSES,\n type CreateWebhookInput,\n type UpdateWebhookInput,\n type ListWebhooksQuery,\n type ListDeliveriesQuery,\n type WebhookDeliveryStatus,\n\n // iCal subscriptions\n CreateICalSubscriptionSchema,\n UpdateICalSubscriptionSchema,\n ListICalSubscriptionsQuerySchema,\n type CreateICalSubscriptionInput,\n type UpdateICalSubscriptionInput,\n type ListICalSubscriptionsQuery,\n\n // Agents\n CreateAgentSchema,\n UpdateAgentSchema,\n ListAgentsQuerySchema,\n type CreateAgentInput,\n type UpdateAgentInput,\n type ListAgentsQuery,\n\n // Scheduling / proposals\n CreateProposalSchema,\n RespondToProposalSchema,\n type CreateProposalInput,\n type RespondToProposalInput,\n} from './shared';\n","/**\n * Webhook event payload schemas and discriminator.\n *\n * The Chronary webhook wire format puts the event type in the\n * `X-Chronary-Event-Type` header and a raw payload object in the body.\n * Use {@link parseWebhookEvent} to combine the two into a typed,\n * discriminated object.\n */\n\nimport { z } from 'zod';\n\nimport { WEBHOOK_EVENT_TYPES, type WebhookEventType } from './shared';\n\nexport { WEBHOOK_EVENT_TYPES } from './shared';\nexport type { WebhookEventType } from './shared';\n\n// Each payload schema uses .passthrough() so forward-compatible field\n// additions on the API side don't break consumers. Known fields are\n// validated strictly; unknown fields are preserved.\n\nconst AgentCreatedPayloadSchema = z\n .object({\n agent: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst AgentUpdatedPayloadSchema = z\n .object({\n agent: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst EventCreatedPayloadSchema = z\n .object({\n event: z.object({}).passthrough(),\n // Present when the event was created through a public booking page\n // (#1036). Lets consumers correlate an inbound booking to the page that\n // produced it. Absent for events created via the normal API/MCP paths.\n booking_page_id: z.string().optional(),\n })\n .passthrough();\n\nconst EventUpdatedPayloadSchema = z\n .object({\n event: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst EventDeletedPayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n })\n .passthrough();\n\nconst EventLifecyclePayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n title: z.string(),\n start_time: z.string(),\n end_time: z.string(),\n // Present when the fire is for one occurrence of a recurring series (#996).\n // The ISO start of that occurrence; start_time/end_time are the occurrence's\n // own times, and event_id is the series master's id.\n occurrence_start: z.string().optional(),\n })\n .passthrough();\n\nconst EventHoldCreatedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventStartedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventEndedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventReminderPayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n title: z.string(),\n start_time: z.string(),\n end_time: z.string(),\n reminder_minutes: z.number().int(),\n // See EventLifecyclePayloadSchema — set for recurring-occurrence reminders.\n occurrence_start: z.string().optional(),\n })\n .passthrough();\nconst EventHoldExpiredPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\nconst EventHoldReleasedPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\nconst EventHoldConfirmedPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\n\nconst ProposalCreatedPayloadSchema = z\n .object({\n proposal: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst ProposalRespondedPayloadSchema = z\n .object({\n proposal_id: z.string(),\n agent_id: z.string(),\n response: z.string(),\n })\n .passthrough();\n\nconst ProposalConfirmedPayloadSchema = z\n .object({\n proposal_id: z.string(),\n })\n .passthrough();\n\nconst ProposalCancelledPayloadSchema = z\n .object({\n proposal_id: z.string(),\n reason: z.string().optional(),\n })\n .passthrough();\n\nconst ProposalExpiredPayloadSchema = z\n .object({\n proposal_id: z.string(),\n })\n .passthrough();\n\nconst WebhookDeactivatedPayloadSchema = z\n .object({\n webhook_id: z.string(),\n url: z.string(),\n reason: z.string(),\n })\n .passthrough();\n\nconst PAYLOAD_SCHEMAS = {\n 'agent.created': AgentCreatedPayloadSchema,\n 'agent.updated': AgentUpdatedPayloadSchema,\n 'event.created': EventCreatedPayloadSchema,\n 'event.updated': EventUpdatedPayloadSchema,\n 'event.deleted': EventDeletedPayloadSchema,\n 'event.started': EventStartedPayloadSchema,\n 'event.ended': EventEndedPayloadSchema,\n 'event.reminder': EventReminderPayloadSchema,\n 'event.hold_created': EventHoldCreatedPayloadSchema,\n 'event.hold_expired': EventHoldExpiredPayloadSchema,\n 'event.hold_released': EventHoldReleasedPayloadSchema,\n 'event.hold_confirmed': EventHoldConfirmedPayloadSchema,\n 'proposal.created': ProposalCreatedPayloadSchema,\n 'proposal.responded': ProposalRespondedPayloadSchema,\n 'proposal.confirmed': ProposalConfirmedPayloadSchema,\n 'proposal.expired': ProposalExpiredPayloadSchema,\n 'proposal.cancelled': ProposalCancelledPayloadSchema,\n 'webhook.deactivated': WebhookDeactivatedPayloadSchema,\n} satisfies Record<WebhookEventType, z.ZodType>;\n\nexport {\n AgentCreatedPayloadSchema,\n AgentUpdatedPayloadSchema,\n EventCreatedPayloadSchema,\n EventUpdatedPayloadSchema,\n EventDeletedPayloadSchema,\n EventStartedPayloadSchema,\n EventEndedPayloadSchema,\n EventReminderPayloadSchema,\n EventHoldCreatedPayloadSchema,\n EventHoldExpiredPayloadSchema,\n EventHoldReleasedPayloadSchema,\n EventHoldConfirmedPayloadSchema,\n ProposalCreatedPayloadSchema,\n ProposalRespondedPayloadSchema,\n ProposalConfirmedPayloadSchema,\n ProposalCancelledPayloadSchema,\n ProposalExpiredPayloadSchema,\n WebhookDeactivatedPayloadSchema,\n};\n\n/**\n * A webhook event combines the event type (from the\n * `X-Chronary-Event-Type` header) with the parsed payload body.\n *\n * Use discriminated narrowing on `type`:\n * ```ts\n * const event = parseWebhookEvent(\n * req.header('x-chronary-event-type'),\n * req.body,\n * );\n * if (event.type === 'event.created') {\n * // ^ narrowed to { type: 'event.created'; data: EventCreatedPayload }\n * }\n * ```\n */\nexport type WebhookEvent = {\n [K in WebhookEventType]: {\n type: K;\n data: z.infer<(typeof PAYLOAD_SCHEMAS)[K]>;\n };\n}[WebhookEventType];\n\n/**\n * Parse an incoming webhook into a typed, discriminated event.\n *\n * Returns a Zod-style `SafeParseReturnType`-shaped object for ergonomic\n * handling of unknown event types + invalid payloads.\n */\nexport function parseWebhookEvent(\n eventType: string | null | undefined,\n body: unknown,\n):\n | { success: true; event: WebhookEvent }\n | { success: false; error: string } {\n if (!eventType) {\n return {\n success: false,\n error: 'Missing X-Chronary-Event-Type header.',\n };\n }\n\n if (!WEBHOOK_EVENT_TYPES.includes(eventType as WebhookEventType)) {\n return {\n success: false,\n error: `Unknown event type: ${eventType}`,\n };\n }\n\n const schema = PAYLOAD_SCHEMAS[eventType as WebhookEventType];\n const result = schema.safeParse(body);\n if (!result.success) {\n return {\n success: false,\n error: `Invalid payload for ${eventType}: ${result.error.message}`,\n };\n }\n\n return {\n success: true,\n event: { type: eventType, data: result.data } as WebhookEvent,\n };\n}\n","import { z } from 'zod';\n\nconst metadataSchema = z\n .record(z.string(), z.unknown())\n .refine((v) => JSON.stringify(v).length <= 16_384, 'metadata exceeds 16KB');\n\nexport const CreateAgentSchema = z.object({\n name: z.string().min(1).max(255),\n type: z.enum(['ai', 'human', 'resource']),\n description: z.string().optional(),\n metadata: metadataSchema.optional(),\n});\n\nexport const UpdateAgentSchema = z\n .object({\n name: z.string().min(1).max(255).optional(),\n description: z.string().nullable().optional(),\n metadata: metadataSchema.optional(),\n status: z.enum(['active', 'paused']).optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListAgentsQuerySchema = z.object({\n type: z.enum(['ai', 'human', 'resource']).optional(),\n status: z.enum(['active', 'paused', 'decommissioned']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nexport const AgentStatusEnum = z.enum(['idle', 'working', 'waiting', 'error']);\n\n// Reminders — minutes before an event's start_time at which an `event.reminder`\n// webhook fires. The system default applies when neither the event nor its\n// calendar sets a value.\nexport const REMINDER_MIN_MINUTES = 1;\nexport const REMINDER_MAX_MINUTES = 40_320; // 28 days\nexport const REMINDER_MAX_COUNT = 5;\nexport const DEFAULT_EVENT_REMINDERS: readonly number[] = [10];\n\n// Array of \"minutes before start\". Deduped and sorted ascending. An empty array\n// means \"explicitly no reminders\"; `null` (on an event/calendar) means \"inherit\".\nexport const RemindersSchema = z\n .array(z.number().int().min(REMINDER_MIN_MINUTES).max(REMINDER_MAX_MINUTES))\n .max(REMINDER_MAX_COUNT, `at most ${REMINDER_MAX_COUNT} reminders allowed`)\n .transform((arr) => Array.from(new Set(arr)).sort((a, b) => a - b));\n\nexport const CreateCalendarSchema = z.object({\n name: z.string().min(1).max(255),\n timezone: z.string().min(1),\n agent_status: AgentStatusEnum.optional(),\n // Default reminders inherited by events on this calendar that don't set their\n // own. `null` means \"use the system default\"; `[]` means \"no reminders\".\n default_reminders: RemindersSchema.nullable().optional(),\n metadata: metadataSchema.optional(),\n});\n\nexport const UpdateCalendarSchema = z\n .object({\n name: z.string().min(1).max(255).optional(),\n timezone: z.string().min(1).optional(),\n agent_status: AgentStatusEnum.optional(),\n default_reminders: RemindersSchema.nullable().optional(),\n metadata: metadataSchema.optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListCalendarsQuerySchema = z.object({\n include: z.enum(['all']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nexport const EVENT_STATUSES = ['confirmed', 'tentative', 'cancelled', 'hold'] as const;\nexport type EventStatus = (typeof EVENT_STATUSES)[number];\n\nexport const HOLD_TTL_MIN_SECONDS = 30;\nexport const HOLD_TTL_MAX_SECONDS = 15 * 60;\n\nexport const CreateEventSchema = z\n .object({\n title: z.string().min(1).max(500),\n start_time: z.string().datetime(),\n end_time: z.string().datetime(),\n description: z.string().optional(),\n all_day: z.boolean().default(false),\n status: z.enum(EVENT_STATUSES).default('confirmed'),\n metadata: metadataSchema.optional(),\n reminders: RemindersSchema.nullable().optional(),\n hold_expires_at: z.string().datetime().optional(),\n hold_priority: z.number().int().min(0).max(100).optional(),\n })\n .refine((v) => new Date(v.end_time) > new Date(v.start_time), 'end_time must be after start_time')\n .superRefine((v, ctx) => {\n if (v.status === 'hold') {\n if (!v.hold_expires_at) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: 'hold_expires_at is required when status is \"hold\"',\n });\n return;\n }\n const ttlMs = new Date(v.hold_expires_at).getTime() - Date.now();\n if (ttlMs < HOLD_TTL_MIN_SECONDS * 1000) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: `hold_expires_at must be at least ${HOLD_TTL_MIN_SECONDS}s in the future`,\n });\n }\n if (ttlMs > HOLD_TTL_MAX_SECONDS * 1000) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: `hold_expires_at must be at most ${HOLD_TTL_MAX_SECONDS}s (${HOLD_TTL_MAX_SECONDS / 60} min) in the future`,\n });\n }\n } else {\n if (v.hold_expires_at !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: 'hold_expires_at is only valid when status is \"hold\"',\n });\n }\n if (v.hold_priority !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_priority'],\n message: 'hold_priority is only valid when status is \"hold\"',\n });\n }\n }\n });\n\nexport const UpdateEventSchema = z\n .object({\n title: z.string().min(1).max(500).optional(),\n description: z.string().nullable().optional(),\n start_time: z.string().datetime().optional(),\n end_time: z.string().datetime().optional(),\n all_day: z.boolean().optional(),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional(),\n metadata: metadataSchema.optional(),\n reminders: RemindersSchema.nullable().optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListEventsQuerySchema = z.object({\n start_after: z.string().datetime().optional(),\n start_before: z.string().datetime().optional(),\n status: z.enum(EVENT_STATUSES).optional(),\n source: z.enum(['internal', 'external_ical']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nconst WorkingHoursDaySchema = z\n .object({\n start: z.string().regex(/^\\d{2}:\\d{2}$/, 'must be HH:MM'),\n end: z.string().regex(/^\\d{2}:\\d{2}$/, 'must be HH:MM'),\n })\n .refine((v) => v.end > v.start, 'end must be after start');\n\nexport const WorkingHoursSchema = z\n .object({\n mon: WorkingHoursDaySchema.optional(),\n tue: WorkingHoursDaySchema.optional(),\n wed: WorkingHoursDaySchema.optional(),\n thu: WorkingHoursDaySchema.optional(),\n fri: WorkingHoursDaySchema.optional(),\n sat: WorkingHoursDaySchema.optional(),\n sun: WorkingHoursDaySchema.optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'at least one day must be specified');\n\nexport const UpdateAvailabilityRulesSchema = z.object({\n buffer_before_minutes: z.number().int().min(0).max(120).default(0),\n buffer_after_minutes: z.number().int().min(0).max(120).default(0),\n working_hours: WorkingHoursSchema.nullable().default(null),\n timezone: z.string().min(1).max(64).default('UTC'),\n});\n\nconst SLOT_DURATIONS = ['15m', '30m', '45m', '1h', '2h'] as const;\ntype SlotDuration = (typeof SLOT_DURATIONS)[number];\nconst DEFAULT_SLOT_DURATION: SlotDuration = '30m';\n\nconst DurationEnum = z.enum(SLOT_DURATIONS);\n\n// `duration` is the preferred public parameter for the requested slot length;\n// `slot_duration` is a deprecated backward-compatible alias. Callers may send\n// either (or both, if identical). Both are optional at the boundary and are\n// coalesced into the canonical internal `slot_duration` — so downstream\n// services keep reading `query.slot_duration` unchanged. Sending both with\n// DIFFERENT values is a 400 rather than a silent pick, so an agent that\n// disagrees with itself gets told instead of getting the wrong slot length.\nconst durationFields = {\n duration: DurationEnum.optional(),\n slot_duration: DurationEnum.optional(),\n};\n\nfunction refineDurationConflict(\n v: { duration?: SlotDuration; slot_duration?: SlotDuration },\n ctx: z.RefinementCtx,\n): void {\n if (\n v.duration !== undefined &&\n v.slot_duration !== undefined &&\n v.duration !== v.slot_duration\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"`duration` and `slot_duration` conflict; send only one (they are aliases). `slot_duration` is deprecated — prefer `duration`.\",\n path: ['duration'],\n });\n }\n}\n\nfunction resolveDuration<T extends { duration?: SlotDuration; slot_duration?: SlotDuration }>(\n v: T,\n): Omit<T, 'duration'> & { slot_duration: SlotDuration } {\n const { duration, ...rest } = v;\n return { ...rest, slot_duration: duration ?? v.slot_duration ?? DEFAULT_SLOT_DURATION };\n}\n\nexport const AvailabilityQuerySchema = z\n .object({\n start: z.string().datetime(),\n end: z.string().datetime(),\n ...durationFields,\n include_busy: z\n .enum(['true', 'false'])\n .default('false')\n .transform((v) => v === 'true'),\n })\n .superRefine(refineDurationConflict)\n .transform(resolveDuration)\n .refine((v) => new Date(v.end) > new Date(v.start), 'end must be after start');\n\nexport const CrossAgentAvailabilityQuerySchema = z\n .object({\n agents: z.string().min(1).transform((v) => v.split(',')),\n start: z.string().datetime(),\n end: z.string().datetime(),\n ...durationFields,\n calendars: z.string().transform((v) => v.split(',')).optional(),\n include_busy: z\n .enum(['true', 'false'])\n .default('false')\n .transform((v) => v === 'true'),\n })\n .superRefine(refineDurationConflict)\n .transform(resolveDuration)\n .refine((v) => new Date(v.end) > new Date(v.start), 'end must be after start');\n\nexport const WEBHOOK_EVENT_TYPES = [\n 'agent.created',\n 'agent.updated',\n 'event.created',\n 'event.updated',\n 'event.deleted',\n 'event.started',\n 'event.ended',\n 'event.reminder',\n 'event.hold_created',\n 'event.hold_expired',\n 'event.hold_released',\n 'event.hold_confirmed',\n 'proposal.created',\n 'proposal.responded',\n 'proposal.confirmed',\n 'proposal.expired',\n 'proposal.cancelled',\n 'webhook.deactivated',\n] as const;\n\nexport type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];\n\nexport const CreateWebhookSchema = z.object({\n url: z.string().url('Must be a valid URL'),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).min(1, 'At least one event type must be specified'),\n});\n\nexport const UpdateWebhookSchema = z.object({\n url: z.string().url('Must be a valid URL').optional(),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).optional(),\n active: z.boolean().optional(),\n});\n\nexport const ListWebhooksQuerySchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).default(20),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nexport const WEBHOOK_DELIVERY_STATUSES = ['pending', 'delivered', 'failed'] as const;\nexport const WebhookDeliveryStatusSchema = z.enum(WEBHOOK_DELIVERY_STATUSES);\n\nexport const ListDeliveriesQuerySchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).default(20),\n offset: z.coerce.number().int().min(0).default(0),\n status: WebhookDeliveryStatusSchema.optional(),\n include_payload: z\n .enum(['true', 'false'])\n .optional()\n .transform((v) => v === 'true'),\n});\n\n// HTTPS via `.refine`, not `.startsWith`: zod 4's startsWith overwrites the\n// string `format` ('uri' → 'starts_with'), so JSON Schema consumers (MCP\n// clients, agent frameworks) would lose `format: uri`.\nexport const CreateICalSubscriptionSchema = z.object({\n calendar_id: z.string().min(1),\n url: z.string().url().refine((u) => u.startsWith('https://'), 'URL must use HTTPS'),\n label: z.string().min(1).max(255).optional(),\n});\n\nexport const UpdateICalSubscriptionSchema = z\n .object({\n label: z.string().min(1).max(255).optional(),\n url: z.string().url().refine((u) => u.startsWith('https://'), 'URL must use HTTPS').optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListICalSubscriptionsQuerySchema = z.object({\n status: z.enum(['active', 'error', 'paused']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nconst proposalMetadataSchema = metadataSchema.optional().default({});\n\nexport const ProposalSlotSchema = z.object({\n start_time: z.string().datetime(),\n end_time: z.string().datetime(),\n weight: z.number().min(0).max(10).default(1.0).optional(),\n calendar_id: z.string().optional(),\n});\n\nexport const CreateProposalSchema = z.object({\n title: z.string().min(1).max(500),\n description: z.string().max(5000).optional(),\n organizer_agent_id: z.string(),\n participant_agent_ids: z.array(z.string()).min(1).max(50),\n calendar_id: z.string(),\n slots: z.array(ProposalSlotSchema).min(1).max(20),\n expires_at: z.string().datetime().optional(),\n metadata: proposalMetadataSchema,\n});\n\nexport const RespondToProposalSchema = z\n .object({\n agent_id: z.string(),\n response: z.enum(['accept', 'decline', 'counter']),\n selected_slot_id: z.string().optional(),\n counter_slots: z.array(ProposalSlotSchema).max(20).optional(),\n message: z.string().max(2000).optional(),\n })\n .refine((d) => d.response !== 'accept' || d.selected_slot_id !== undefined, {\n message: 'selected_slot_id is required when response is \"accept\"',\n });\n\nexport type CreateAgentInput = z.input<typeof CreateAgentSchema>;\nexport type UpdateAgentInput = z.input<typeof UpdateAgentSchema>;\nexport type ListAgentsQuery = z.infer<typeof ListAgentsQuerySchema>;\nexport type CreateCalendarInput = z.input<typeof CreateCalendarSchema>;\nexport type UpdateCalendarInput = z.input<typeof UpdateCalendarSchema>;\nexport type ListCalendarsQuery = z.infer<typeof ListCalendarsQuerySchema>;\nexport type CreateEventInput = z.input<typeof CreateEventSchema>;\nexport type UpdateEventInput = z.input<typeof UpdateEventSchema>;\nexport type ListEventsQuery = z.infer<typeof ListEventsQuerySchema>;\nexport type WorkingHours = z.infer<typeof WorkingHoursSchema>;\nexport type UpdateAvailabilityRules = z.infer<typeof UpdateAvailabilityRulesSchema>;\nexport type AvailabilityQuery = z.infer<typeof AvailabilityQuerySchema>;\nexport type CrossAgentAvailabilityQuery = z.infer<typeof CrossAgentAvailabilityQuerySchema>;\nexport type CreateWebhookInput = z.input<typeof CreateWebhookSchema>;\nexport type UpdateWebhookInput = z.input<typeof UpdateWebhookSchema>;\nexport type ListWebhooksQuery = z.infer<typeof ListWebhooksQuerySchema>;\nexport type ListDeliveriesQuery = z.infer<typeof ListDeliveriesQuerySchema>;\nexport type WebhookDeliveryStatus = z.infer<typeof WebhookDeliveryStatusSchema>;\nexport type CreateICalSubscriptionInput = z.input<typeof CreateICalSubscriptionSchema>;\nexport type UpdateICalSubscriptionInput = z.input<typeof UpdateICalSubscriptionSchema>;\nexport type ListICalSubscriptionsQuery = z.infer<typeof ListICalSubscriptionsQuerySchema>;\nexport type CreateProposalInput = z.input<typeof CreateProposalSchema>;\nexport type RespondToProposalInput = z.input<typeof RespondToProposalSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSA,IAAAA,cAAkB;;;ACTlB,iBAAkB;AAElB,IAAM,iBAAiB,aACpB,OAAO,aAAE,OAAO,GAAG,aAAE,QAAQ,CAAC,EAC9B,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE,UAAU,OAAQ,uBAAuB;AAErE,IAAM,oBAAoB,aAAE,OAAO;AAAA,EACxC,MAAM,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,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ACd,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,CAAC,oBAAoB,SAAS,SAA6B,GAAG;AAChE,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,uBAAuB,SAAS;AAAA,IACzC;AAAA,EACF;AAEA,QAAM,SAAS,gBAAgB,SAA6B;AAC5D,QAAM,SAAS,OAAO,UAAU,IAAI;AACpC,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,uBAAuB,SAAS,KAAK,OAAO,MAAM,OAAO;AAAA,IAClE;AAAA,EACF;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,EAAE,MAAM,WAAW,MAAM,OAAO,KAAK;AAAA,EAC9C;AACF;","names":["import_zod"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/events.ts","../src/shared.ts"],"sourcesContent":["/**\n * `@chronary/schemas` — Zod schemas + types for the Chronary calendar API.\n *\n * Self-contained public schemas for external consumers, plus per-event-type\n * webhook payload schemas for runtime validation of incoming webhooks.\n *\n * See {@link ./events | `./events`} for webhook-specific exports.\n */\n\n// Webhook payload schemas + discriminator.\nexport * from './events';\n\nexport {\n // Calendars\n CreateCalendarSchema,\n UpdateCalendarSchema,\n ListCalendarsQuerySchema,\n type CreateCalendarInput,\n type UpdateCalendarInput,\n type ListCalendarsQuery,\n\n // Events\n EVENT_STATUSES,\n CreateEventSchema,\n UpdateEventSchema,\n ListEventsQuerySchema,\n RemindersSchema,\n REMINDER_MIN_MINUTES,\n REMINDER_MAX_MINUTES,\n REMINDER_MAX_COUNT,\n DEFAULT_EVENT_REMINDERS,\n type EventStatus,\n type CreateEventInput,\n type UpdateEventInput,\n type ListEventsQuery,\n\n // Availability\n WorkingHoursSchema,\n UpdateAvailabilityRulesSchema,\n AvailabilityQuerySchema,\n CrossAgentAvailabilityQuerySchema,\n type WorkingHours,\n type UpdateAvailabilityRules,\n type AvailabilityQuery,\n type CrossAgentAvailabilityQuery,\n\n // Webhook subscriptions (management) — event payload schemas are in ./events\n CreateWebhookSchema,\n UpdateWebhookSchema,\n ListWebhooksQuerySchema,\n ListDeliveriesQuerySchema,\n WebhookDeliveryStatusSchema,\n WEBHOOK_DELIVERY_STATUSES,\n type CreateWebhookInput,\n type UpdateWebhookInput,\n type ListWebhooksQuery,\n type ListDeliveriesQuery,\n type WebhookDeliveryStatus,\n\n // iCal subscriptions\n CreateICalSubscriptionSchema,\n UpdateICalSubscriptionSchema,\n ListICalSubscriptionsQuerySchema,\n type CreateICalSubscriptionInput,\n type UpdateICalSubscriptionInput,\n type ListICalSubscriptionsQuery,\n\n // Agents\n CreateAgentSchema,\n UpdateAgentSchema,\n ListAgentsQuerySchema,\n type CreateAgentInput,\n type UpdateAgentInput,\n type ListAgentsQuery,\n\n // Scheduling / proposals\n CreateProposalSchema,\n RespondToProposalSchema,\n type CreateProposalInput,\n type RespondToProposalInput,\n} from './shared';\n","/**\n * Webhook event payload schemas and discriminator.\n *\n * The Chronary webhook wire format puts the event type in the\n * `X-Chronary-Event-Type` header and a raw payload object in the body.\n * Use {@link parseWebhookEvent} to combine the two into a typed,\n * discriminated object.\n */\n\nimport { z } from 'zod';\n\nimport { WEBHOOK_EVENT_TYPES, type WebhookEventType } from './shared';\n\nexport { WEBHOOK_EVENT_TYPES } from './shared';\nexport type { WebhookEventType } from './shared';\n\n// Each payload schema uses .passthrough() so forward-compatible field\n// additions on the API side don't break consumers. Known fields are\n// validated strictly; unknown fields are preserved.\n\nconst AgentCreatedPayloadSchema = z\n .object({\n agent: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst AgentUpdatedPayloadSchema = z\n .object({\n agent: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst EventCreatedPayloadSchema = z\n .object({\n event: z.object({}).passthrough(),\n // Present when the event was created through a public booking page\n // (#1036). Lets consumers correlate an inbound booking to the page that\n // produced it. Absent for events created via the normal API/MCP paths.\n booking_page_id: z.string().optional(),\n })\n .passthrough();\n\nconst EventUpdatedPayloadSchema = z\n .object({\n event: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst EventDeletedPayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n })\n .passthrough();\n\nconst EventLifecyclePayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n title: z.string(),\n start_time: z.string(),\n end_time: z.string(),\n // Present when the fire is for one occurrence of a recurring series (#996).\n // The ISO start of that occurrence; start_time/end_time are the occurrence's\n // own times, and event_id is the series master's id.\n occurrence_start: z.string().optional(),\n })\n .passthrough();\n\nconst EventHoldCreatedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventStartedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventEndedPayloadSchema = EventLifecyclePayloadSchema;\nconst EventReminderPayloadSchema = z\n .object({\n event_id: z.string(),\n calendar_id: z.string(),\n title: z.string(),\n start_time: z.string(),\n end_time: z.string(),\n reminder_minutes: z.number().int(),\n // See EventLifecyclePayloadSchema — set for recurring-occurrence reminders.\n occurrence_start: z.string().optional(),\n })\n .passthrough();\nconst EventHoldExpiredPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\nconst EventHoldReleasedPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\nconst EventHoldConfirmedPayloadSchema = z\n .object({\n event_id: z.string(),\n })\n .passthrough();\n\nconst ProposalCreatedPayloadSchema = z\n .object({\n proposal: z.object({}).passthrough(),\n })\n .passthrough();\n\nconst ProposalRespondedPayloadSchema = z\n .object({\n proposal_id: z.string(),\n agent_id: z.string(),\n response: z.string(),\n })\n .passthrough();\n\nconst ProposalConfirmedPayloadSchema = z\n .object({\n proposal_id: z.string(),\n })\n .passthrough();\n\nconst ProposalCancelledPayloadSchema = z\n .object({\n proposal_id: z.string(),\n reason: z.string().optional(),\n })\n .passthrough();\n\nconst ProposalExpiredPayloadSchema = z\n .object({\n proposal_id: z.string(),\n })\n .passthrough();\n\n// org.plan_changed (#1130) — the org's plan changed (upgrade, downgrade,\n// subscription end). Never carries payment-provider ids.\nconst OrgPlanChangedPayloadSchema = z\n .object({\n org_id: z.string(),\n previous_plan: z.string(),\n plan: z.string(),\n source: z.enum(['subscription', 'founding_expiry', 'admin_override', 'soft_launch_toggle', 'system']),\n subscription_status: z.string().nullable(),\n interval: z.enum(['month', 'year']).nullable(),\n upgrade_request_id: z.string().nullable(),\n })\n .passthrough();\n\n// calendar_connection.reauthorization_required (#1196) — a human calendar the\n// org connected stopped accepting Chronary's access. Never carries the\n// account label or email: agents never receive account identities.\nconst CalendarConnectionReauthorizationRequiredPayloadSchema = z\n .object({\n connection_id: z.string(),\n provider: z.string(),\n reauthorization_reason: z.string(),\n impacted_agent_count: z.number().int().nonnegative(),\n occurred_at: z.string(),\n })\n .passthrough();\n\n// usage.threshold_crossed (#1211) — a monthly usage metric reached a threshold\n// of the plan limit (50, 80, 90, 95 or 100). Fires once per metric, period and\n// threshold. `resets_at` is the next UTC month start, when the counter resets.\nconst UsageThresholdCrossedPayloadSchema = z\n .object({\n metric: z.string(),\n used: z.number().int().nonnegative(),\n limit: z.number().int().nonnegative(),\n threshold_pct: z.number().int(),\n period: z.string(),\n resets_at: z.string(),\n })\n .passthrough();\n\n// webhook.deactivated — an endpoint was disabled (circuit breaker or an unsafe\n// destination). Deliveries carry the endpoint's origin and path with the query\n// string removed, never the full URL. `url` is deprecated: no delivery sends it,\n// and it stays optional only so older fixtures still parse.\nconst WebhookDeactivatedPayloadSchema = z\n .object({\n webhook_id: z.string(),\n webhook_origin: z.string().optional(),\n webhook_path: z.string().optional(),\n /** @deprecated Deliveries send `webhook_origin` and `webhook_path` instead. */\n url: z.string().optional(),\n reason: z.string(),\n })\n .passthrough();\n\nconst PAYLOAD_SCHEMAS = {\n 'agent.created': AgentCreatedPayloadSchema,\n 'agent.updated': AgentUpdatedPayloadSchema,\n 'event.created': EventCreatedPayloadSchema,\n 'event.updated': EventUpdatedPayloadSchema,\n 'event.deleted': EventDeletedPayloadSchema,\n 'event.started': EventStartedPayloadSchema,\n 'event.ended': EventEndedPayloadSchema,\n 'event.reminder': EventReminderPayloadSchema,\n 'event.hold_created': EventHoldCreatedPayloadSchema,\n 'event.hold_expired': EventHoldExpiredPayloadSchema,\n 'event.hold_released': EventHoldReleasedPayloadSchema,\n 'event.hold_confirmed': EventHoldConfirmedPayloadSchema,\n 'proposal.created': ProposalCreatedPayloadSchema,\n 'proposal.responded': ProposalRespondedPayloadSchema,\n 'proposal.confirmed': ProposalConfirmedPayloadSchema,\n 'proposal.expired': ProposalExpiredPayloadSchema,\n 'proposal.cancelled': ProposalCancelledPayloadSchema,\n 'webhook.deactivated': WebhookDeactivatedPayloadSchema,\n 'org.plan_changed': OrgPlanChangedPayloadSchema,\n 'calendar_connection.reauthorization_required': CalendarConnectionReauthorizationRequiredPayloadSchema,\n 'usage.threshold_crossed': UsageThresholdCrossedPayloadSchema,\n} satisfies Record<WebhookEventType, z.ZodType>;\n\nexport {\n AgentCreatedPayloadSchema,\n AgentUpdatedPayloadSchema,\n EventCreatedPayloadSchema,\n EventUpdatedPayloadSchema,\n EventDeletedPayloadSchema,\n EventStartedPayloadSchema,\n EventEndedPayloadSchema,\n EventReminderPayloadSchema,\n EventHoldCreatedPayloadSchema,\n EventHoldExpiredPayloadSchema,\n EventHoldReleasedPayloadSchema,\n EventHoldConfirmedPayloadSchema,\n ProposalCreatedPayloadSchema,\n ProposalRespondedPayloadSchema,\n ProposalConfirmedPayloadSchema,\n ProposalCancelledPayloadSchema,\n ProposalExpiredPayloadSchema,\n WebhookDeactivatedPayloadSchema,\n OrgPlanChangedPayloadSchema,\n CalendarConnectionReauthorizationRequiredPayloadSchema,\n UsageThresholdCrossedPayloadSchema,\n};\n\n/**\n * A webhook event combines the event type (from the\n * `X-Chronary-Event-Type` header) with the parsed payload body.\n *\n * Use discriminated narrowing on `type`:\n * ```ts\n * const event = parseWebhookEvent(\n * req.header('x-chronary-event-type'),\n * req.body,\n * );\n * if (event.type === 'event.created') {\n * // ^ narrowed to { type: 'event.created'; data: EventCreatedPayload }\n * }\n * ```\n */\nexport type WebhookEvent = {\n [K in WebhookEventType]: {\n type: K;\n data: z.infer<(typeof PAYLOAD_SCHEMAS)[K]>;\n };\n}[WebhookEventType];\n\n/**\n * Parse an incoming webhook into a typed, discriminated event.\n *\n * Returns a Zod-style `SafeParseReturnType`-shaped object for ergonomic\n * handling of unknown event types + invalid payloads.\n */\nexport function parseWebhookEvent(\n eventType: string | null | undefined,\n body: unknown,\n):\n | { success: true; event: WebhookEvent }\n | { success: false; error: string } {\n if (!eventType) {\n return {\n success: false,\n error: 'Missing X-Chronary-Event-Type header.',\n };\n }\n\n if (!WEBHOOK_EVENT_TYPES.includes(eventType as WebhookEventType)) {\n return {\n success: false,\n error: `Unknown event type: ${eventType}`,\n };\n }\n\n const schema = PAYLOAD_SCHEMAS[eventType as WebhookEventType];\n const result = schema.safeParse(body);\n if (!result.success) {\n return {\n success: false,\n error: `Invalid payload for ${eventType}: ${result.error.message}`,\n };\n }\n\n return {\n success: true,\n event: { type: eventType, data: result.data } as WebhookEvent,\n };\n}\n","import { z } from 'zod';\n\n/**\n * A request date-time: RFC 3339 with `Z` or a numeric offset (`+00:00`,\n * `-08:00`, `+05:30`), the same rule the API applies. An offset value becomes\n * the same instant in UTC (`toISOString()`); a `Z` value passes through\n * unchanged. Refines on the enclosing object compare the normalised values.\n */\nconst isoDateTimeInput = z\n .string()\n .datetime({ offset: true })\n .transform((v) => (v.endsWith('Z') ? v : new Date(v).toISOString()));\n\nconst metadataSchema = z\n .record(z.string(), z.unknown())\n .refine((v) => JSON.stringify(v).length <= 16_384, 'metadata exceeds 16KB');\n\nexport const CreateAgentSchema = z.object({\n name: z.string().min(1).max(255),\n type: z.enum(['ai', 'human', 'resource']),\n description: z.string().max(5_000).optional(),\n metadata: metadataSchema.optional(),\n});\n\nexport const UpdateAgentSchema = z\n .object({\n name: z.string().min(1).max(255).optional(),\n description: z.string().max(5_000).nullable().optional(),\n metadata: metadataSchema.optional(),\n status: z.enum(['active', 'paused']).optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListAgentsQuerySchema = z.object({\n type: z.enum(['ai', 'human', 'resource']).optional(),\n status: z.enum(['active', 'paused', 'decommissioned']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nexport const AgentStatusEnum = z.enum(['idle', 'working', 'waiting', 'error']);\n\n// Reminders — minutes before an event's start_time at which an `event.reminder`\n// webhook fires. The system default applies when neither the event nor its\n// calendar sets a value.\nexport const REMINDER_MIN_MINUTES = 1;\nexport const REMINDER_MAX_MINUTES = 40_320; // 28 days\nexport const REMINDER_MAX_COUNT = 5;\nexport const DEFAULT_EVENT_REMINDERS: readonly number[] = [10];\n\n// Array of \"minutes before start\". Deduped and sorted ascending. An empty array\n// means \"explicitly no reminders\"; `null` (on an event/calendar) means \"inherit\".\nexport const RemindersSchema = z\n .array(z.number().int().min(REMINDER_MIN_MINUTES).max(REMINDER_MAX_MINUTES))\n .max(REMINDER_MAX_COUNT, `at most ${REMINDER_MAX_COUNT} reminders allowed`)\n .transform((arr) => Array.from(new Set(arr)).sort((a, b) => a - b));\n\nexport const CreateCalendarSchema = z.object({\n name: z.string().min(1).max(255),\n timezone: z.string().min(1).max(64),\n agent_status: AgentStatusEnum.optional(),\n // Default reminders inherited by events on this calendar that don't set their\n // own. `null` means \"use the system default\"; `[]` means \"no reminders\".\n default_reminders: RemindersSchema.nullable().optional(),\n metadata: metadataSchema.optional(),\n});\n\nexport const UpdateCalendarSchema = z\n .object({\n name: z.string().min(1).max(255).optional(),\n timezone: z.string().min(1).max(64).optional(),\n agent_status: AgentStatusEnum.optional(),\n default_reminders: RemindersSchema.nullable().optional(),\n metadata: metadataSchema.optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListCalendarsQuerySchema = z.object({\n include: z.enum(['all']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nexport const EVENT_STATUSES = ['confirmed', 'tentative', 'cancelled', 'hold'] as const;\nexport type EventStatus = (typeof EVENT_STATUSES)[number];\n\nexport const HOLD_TTL_MIN_SECONDS = 30;\nexport const HOLD_TTL_MAX_SECONDS = 15 * 60;\n\nexport const CreateEventSchema = z\n .object({\n title: z.string().min(1).max(500),\n start_time: isoDateTimeInput,\n end_time: isoDateTimeInput,\n description: z.string().max(10_000).optional(),\n all_day: z.boolean().default(false),\n status: z.enum(EVENT_STATUSES).default('confirmed'),\n metadata: metadataSchema.optional(),\n reminders: RemindersSchema.nullable().optional(),\n hold_expires_at: isoDateTimeInput.optional(),\n hold_priority: z.number().int().min(0).max(100).optional(),\n })\n .refine((v) => new Date(v.end_time) > new Date(v.start_time), 'end_time must be after start_time')\n .superRefine((v, ctx) => {\n if (v.status === 'hold') {\n if (!v.hold_expires_at) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: 'hold_expires_at is required when status is \"hold\"',\n });\n return;\n }\n const ttlMs = new Date(v.hold_expires_at).getTime() - Date.now();\n if (ttlMs < HOLD_TTL_MIN_SECONDS * 1000) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: `hold_expires_at must be at least ${HOLD_TTL_MIN_SECONDS}s in the future`,\n });\n }\n if (ttlMs > HOLD_TTL_MAX_SECONDS * 1000) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: `hold_expires_at must be at most ${HOLD_TTL_MAX_SECONDS}s (${HOLD_TTL_MAX_SECONDS / 60} min) in the future`,\n });\n }\n } else {\n if (v.hold_expires_at !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_expires_at'],\n message: 'hold_expires_at is only valid when status is \"hold\"',\n });\n }\n if (v.hold_priority !== undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['hold_priority'],\n message: 'hold_priority is only valid when status is \"hold\"',\n });\n }\n }\n });\n\nexport const UpdateEventSchema = z\n .object({\n title: z.string().min(1).max(500).optional(),\n description: z.string().max(10_000).nullable().optional(),\n start_time: isoDateTimeInput.optional(),\n end_time: isoDateTimeInput.optional(),\n all_day: z.boolean().optional(),\n status: z.enum(['confirmed', 'tentative', 'cancelled']).optional(),\n metadata: metadataSchema.optional(),\n reminders: RemindersSchema.nullable().optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListEventsQuerySchema = z.object({\n start_after: isoDateTimeInput.optional(),\n start_before: isoDateTimeInput.optional(),\n status: z.enum(EVENT_STATUSES).optional(),\n source: z.enum(['internal', 'external_ical']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nconst WorkingHoursDaySchema = z\n .object({\n start: z.string().regex(/^\\d{2}:\\d{2}$/, 'must be HH:MM'),\n end: z.string().regex(/^\\d{2}:\\d{2}$/, 'must be HH:MM'),\n })\n .refine((v) => v.end > v.start, 'end must be after start');\n\nexport const WorkingHoursSchema = z\n .object({\n mon: WorkingHoursDaySchema.optional(),\n tue: WorkingHoursDaySchema.optional(),\n wed: WorkingHoursDaySchema.optional(),\n thu: WorkingHoursDaySchema.optional(),\n fri: WorkingHoursDaySchema.optional(),\n sat: WorkingHoursDaySchema.optional(),\n sun: WorkingHoursDaySchema.optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'at least one day must be specified');\n\nexport const UpdateAvailabilityRulesSchema = z.object({\n buffer_before_minutes: z.number().int().min(0).max(120).default(0),\n buffer_after_minutes: z.number().int().min(0).max(120).default(0),\n working_hours: WorkingHoursSchema.nullable().default(null),\n timezone: z.string().min(1).max(64).default('UTC'),\n});\n\nconst SLOT_DURATIONS = ['15m', '30m', '45m', '1h', '2h'] as const;\ntype SlotDuration = (typeof SLOT_DURATIONS)[number];\nconst DEFAULT_SLOT_DURATION: SlotDuration = '30m';\n\nconst DurationEnum = z.enum(SLOT_DURATIONS);\n\n// `duration` is the preferred public parameter for the requested slot length;\n// `slot_duration` is a deprecated backward-compatible alias. Callers may send\n// either (or both, if identical). Both are optional at the boundary and are\n// coalesced into the canonical internal `slot_duration` — so downstream\n// services keep reading `query.slot_duration` unchanged. Sending both with\n// DIFFERENT values is a 400 rather than a silent pick, so an agent that\n// disagrees with itself gets told instead of getting the wrong slot length.\nconst durationFields = {\n duration: DurationEnum.optional(),\n slot_duration: DurationEnum.optional(),\n};\n\nfunction refineDurationConflict(\n v: { duration?: SlotDuration; slot_duration?: SlotDuration },\n ctx: z.RefinementCtx,\n): void {\n if (\n v.duration !== undefined &&\n v.slot_duration !== undefined &&\n v.duration !== v.slot_duration\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message:\n \"`duration` and `slot_duration` conflict; send only one (they are aliases). `slot_duration` is deprecated — prefer `duration`.\",\n path: ['duration'],\n });\n }\n}\n\nfunction resolveDuration<T extends { duration?: SlotDuration; slot_duration?: SlotDuration }>(\n v: T,\n): Omit<T, 'duration'> & { slot_duration: SlotDuration } {\n const { duration, ...rest } = v;\n return { ...rest, slot_duration: duration ?? v.slot_duration ?? DEFAULT_SLOT_DURATION };\n}\n\nexport const AvailabilityQuerySchema = z\n .object({\n start: isoDateTimeInput,\n end: isoDateTimeInput,\n ...durationFields,\n include_busy: z\n .enum(['true', 'false'])\n .default('false')\n .transform((v) => v === 'true'),\n })\n .superRefine(refineDurationConflict)\n .transform(resolveDuration)\n .refine((v) => new Date(v.end) > new Date(v.start), 'end must be after start');\n\nexport const CrossAgentAvailabilityQuerySchema = z\n .object({\n agents: z.string().min(1).transform((v) => v.split(',')),\n start: isoDateTimeInput,\n end: isoDateTimeInput,\n ...durationFields,\n calendars: z.string().transform((v) => v.split(',')).optional(),\n include_busy: z\n .enum(['true', 'false'])\n .default('false')\n .transform((v) => v === 'true'),\n })\n .superRefine(refineDurationConflict)\n .transform(resolveDuration)\n .refine((v) => new Date(v.end) > new Date(v.start), 'end must be after start');\n\nexport const WEBHOOK_EVENT_TYPES = [\n 'agent.created',\n 'agent.updated',\n 'event.created',\n 'event.updated',\n 'event.deleted',\n 'event.started',\n 'event.ended',\n 'event.reminder',\n 'event.hold_created',\n 'event.hold_expired',\n 'event.hold_released',\n 'event.hold_confirmed',\n 'proposal.created',\n 'proposal.responded',\n 'proposal.confirmed',\n 'proposal.expired',\n 'proposal.cancelled',\n 'webhook.deactivated',\n 'org.plan_changed',\n 'calendar_connection.reauthorization_required',\n 'usage.threshold_crossed',\n] as const;\n\nexport type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];\n\nexport const CreateWebhookSchema = z.object({\n url: z.string().url('Must be a valid URL').max(2_048),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).min(1, 'At least one event type must be specified'),\n});\n\nexport const UpdateWebhookSchema = z.object({\n url: z.string().url('Must be a valid URL').max(2_048).optional(),\n events: z.array(z.enum(WEBHOOK_EVENT_TYPES)).optional(),\n active: z.boolean().optional(),\n});\n\nexport const ListWebhooksQuerySchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).default(20),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\n/**\n * `dropped` is a Free-plan delivery the monthly limit stopped: never sent,\n * counted or retried, with `last_error_code: 'quota_exceeded'`.\n */\nexport const WEBHOOK_DELIVERY_STATUSES = ['pending', 'delivered', 'failed', 'dropped'] as const;\nexport const WebhookDeliveryStatusSchema = z.enum(WEBHOOK_DELIVERY_STATUSES);\n\nexport const ListDeliveriesQuerySchema = z\n .object({\n limit: z.coerce.number().int().min(1).max(100).default(20),\n offset: z.coerce.number().int().min(0).default(0),\n status: WebhookDeliveryStatusSchema.optional(),\n include_payload: z\n .enum(['true', 'false'])\n .optional()\n .transform((v) => v === 'true'),\n /** An exact event type (`event.created`) or a prefix ending in a dot (`event.`). */\n event_type: z.string().max(100).regex(/^[a-z_]+\\.(?:[a-z_]+)?$/).optional(),\n created_after: isoDateTimeInput.optional(),\n created_before: isoDateTimeInput.optional(),\n delivery_id: z.string().max(100).regex(/^whd_[A-Za-z0-9_-]+$/).optional(),\n is_test: z.enum(['true', 'false']).transform((v) => v === 'true').optional(),\n /** The `next_cursor` from the previous page; cannot be combined with a non-zero `offset`. */\n cursor: z.string().min(1).max(1024).optional(),\n })\n .superRefine((v, ctx) => {\n if (v.cursor !== undefined && v.offset > 0) {\n ctx.addIssue({ code: 'custom', path: ['cursor'], message: 'cursor and offset cannot be combined' });\n }\n if (\n v.created_after !== undefined &&\n v.created_before !== undefined &&\n Date.parse(v.created_after) >= Date.parse(v.created_before)\n ) {\n ctx.addIssue({ code: 'custom', path: ['created_after'], message: 'created_after must be before created_before' });\n }\n });\n\n// HTTPS via `.refine`, not `.startsWith`: zod 4's startsWith overwrites the\n// string `format` ('uri' → 'starts_with'), so JSON Schema consumers (MCP\n// clients, agent frameworks) would lose `format: uri`.\nexport const CreateICalSubscriptionSchema = z.object({\n calendar_id: z.string().min(1),\n url: z.string().url().max(2_048).refine((u) => u.startsWith('https://'), 'URL must use HTTPS'),\n label: z.string().min(1).max(255).optional(),\n});\n\nexport const UpdateICalSubscriptionSchema = z\n .object({\n label: z.string().min(1).max(255).optional(),\n url: z.string().url().max(2_048).refine((u) => u.startsWith('https://'), 'URL must use HTTPS').optional(),\n })\n .refine((v) => Object.keys(v).length > 0, 'request body must include at least one field');\n\nexport const ListICalSubscriptionsQuerySchema = z.object({\n status: z.enum(['active', 'error', 'paused']).optional(),\n limit: z.coerce.number().int().min(1).max(200).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n});\n\nconst proposalMetadataSchema = metadataSchema.optional().default({});\n\nexport const ProposalSlotSchema = z.object({\n start_time: isoDateTimeInput,\n end_time: isoDateTimeInput,\n weight: z.number().min(0).max(10).default(1.0).optional(),\n calendar_id: z.string().optional(),\n});\n\nexport const CreateProposalSchema = z.object({\n title: z.string().min(1).max(500),\n description: z.string().max(5000).optional(),\n organizer_agent_id: z.string(),\n participant_agent_ids: z.array(z.string()).min(1).max(50),\n calendar_id: z.string(),\n slots: z.array(ProposalSlotSchema).min(1).max(20),\n expires_at: isoDateTimeInput.optional(),\n metadata: proposalMetadataSchema,\n});\n\nexport const RespondToProposalSchema = z\n .object({\n agent_id: z.string(),\n response: z.enum(['accept', 'decline', 'counter']),\n selected_slot_id: z.string().optional(),\n counter_slots: z.array(ProposalSlotSchema).max(20).optional(),\n message: z.string().max(2000).optional(),\n })\n .refine((d) => d.response !== 'accept' || d.selected_slot_id !== undefined, {\n message: 'selected_slot_id is required when response is \"accept\"',\n });\n\nexport type CreateAgentInput = z.input<typeof CreateAgentSchema>;\nexport type UpdateAgentInput = z.input<typeof UpdateAgentSchema>;\nexport type ListAgentsQuery = z.infer<typeof ListAgentsQuerySchema>;\nexport type CreateCalendarInput = z.input<typeof CreateCalendarSchema>;\nexport type UpdateCalendarInput = z.input<typeof UpdateCalendarSchema>;\nexport type ListCalendarsQuery = z.infer<typeof ListCalendarsQuerySchema>;\nexport type CreateEventInput = z.input<typeof CreateEventSchema>;\nexport type UpdateEventInput = z.input<typeof UpdateEventSchema>;\nexport type ListEventsQuery = z.infer<typeof ListEventsQuerySchema>;\nexport type WorkingHours = z.infer<typeof WorkingHoursSchema>;\nexport type UpdateAvailabilityRules = z.infer<typeof UpdateAvailabilityRulesSchema>;\nexport type AvailabilityQuery = z.infer<typeof AvailabilityQuerySchema>;\nexport type CrossAgentAvailabilityQuery = z.infer<typeof CrossAgentAvailabilityQuerySchema>;\nexport type CreateWebhookInput = z.input<typeof CreateWebhookSchema>;\nexport type UpdateWebhookInput = z.input<typeof UpdateWebhookSchema>;\nexport type ListWebhooksQuery = z.infer<typeof ListWebhooksQuerySchema>;\nexport type ListDeliveriesQuery = z.infer<typeof ListDeliveriesQuerySchema>;\nexport type WebhookDeliveryStatus = z.infer<typeof WebhookDeliveryStatusSchema>;\nexport type CreateICalSubscriptionInput = z.input<typeof CreateICalSubscriptionSchema>;\nexport type UpdateICalSubscriptionInput = z.input<typeof UpdateICalSubscriptionSchema>;\nexport type ListICalSubscriptionsQuery = z.infer<typeof ListICalSubscriptionsQuerySchema>;\nexport type CreateProposalInput = z.input<typeof CreateProposalSchema>;\nexport type RespondToProposalInput = z.input<typeof RespondToProposalSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSA,IAAAA,cAAkB;;;ACTlB,iBAAkB;AAQlB,IAAM,mBAAmB,aACtB,OAAO,EACP,SAAS,EAAE,QAAQ,KAAK,CAAC,EACzB,UAAU,CAAC,MAAO,EAAE,SAAS,GAAG,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,YAAY,CAAE;AAErE,IAAM,iBAAiB,aACpB,OAAO,aAAE,OAAO,GAAG,aAAE,QAAQ,CAAC,EAC9B,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC,EAAE,UAAU,OAAQ,uBAAuB;AAErE,IAAM,oBAAoB,aAAE,OAAO;AAAA,EACxC,MAAM,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,MAAM,aAAE,KAAK,CAAC,MAAM,SAAS,UAAU,CAAC;AAAA,EACxC,aAAa,aAAE,OAAO,EAAE,IAAI,GAAK,EAAE,SAAS;AAAA,EAC5C,UAAU,eAAe,SAAS;AACpC,CAAC;AAEM,IAAM,oBAAoB,aAC9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jB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EACpB,gDAAgD;AAAA,EAChD,2BAA2B;AAC7B;AAsDO,SAAS,kBACd,WACA,MAGoC;AACpC,MAAI,CAAC,WAAW;AACd,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO;AAAA,IACT;AAAA,EACF;AAEA,MAAI,CAAC,oBAAoB,SAAS,SAA6B,GAAG;AAChE,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,uBAAuB,SAAS;AAAA,IACzC;AAAA,EACF;AAEA,QAAM,SAAS,gBAAgB,SAA6B;AAC5D,QAAM,SAAS,OAAO,UAAU,IAAI;AACpC,MAAI,CAAC,OAAO,SAAS;AACnB,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,uBAAuB,SAAS,KAAK,OAAO,MAAM,OAAO;AAAA,IAClE;AAAA,EACF;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,IACT,OAAO,EAAE,MAAM,WAAW,MAAM,OAAO,KAAK;AAAA,EAC9C;AACF;","names":["import_zod"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AgentCreatedPayloadSchema, AgentUpdatedPayloadSchema, A as AvailabilityQuery, a as AvailabilityQuerySchema, C as CreateAgentInput, b as CreateAgentSchema, c as CreateCalendarInput, d as CreateCalendarSchema, e as CreateEventInput, f as CreateEventSchema, g as CreateICalSubscriptionInput, h as CreateICalSubscriptionSchema, i as CreateProposalInput, j as CreateProposalSchema, k as CreateWebhookInput, l as CreateWebhookSchema, m as CrossAgentAvailabilityQuery, n as CrossAgentAvailabilityQuerySchema, D as DEFAULT_EVENT_REMINDERS, E as EVENT_STATUSES, EventCreatedPayloadSchema, EventDeletedPayloadSchema, EventEndedPayloadSchema, EventHoldConfirmedPayloadSchema, EventHoldCreatedPayloadSchema, EventHoldExpiredPayloadSchema, EventHoldReleasedPayloadSchema, EventReminderPayloadSchema, EventStartedPayloadSchema, o as EventStatus, EventUpdatedPayloadSchema, L as ListAgentsQuery, p as ListAgentsQuerySchema, q as ListCalendarsQuery, r as ListCalendarsQuerySchema, s as ListDeliveriesQuery, t as ListDeliveriesQuerySchema, u as ListEventsQuery, v as ListEventsQuerySchema, w as ListICalSubscriptionsQuery, x as ListICalSubscriptionsQuerySchema, y as ListWebhooksQuery, z as ListWebhooksQuerySchema, ProposalCancelledPayloadSchema, ProposalConfirmedPayloadSchema, ProposalCreatedPayloadSchema, ProposalExpiredPayloadSchema, ProposalRespondedPayloadSchema, R as REMINDER_MAX_COUNT, B as REMINDER_MAX_MINUTES, F as REMINDER_MIN_MINUTES, G as RemindersSchema, H as RespondToProposalInput, I as RespondToProposalSchema, U as UpdateAgentInput, J as UpdateAgentSchema, K as UpdateAvailabilityRules, M as UpdateAvailabilityRulesSchema, N as UpdateCalendarInput, O as UpdateCalendarSchema, P as UpdateEventInput, Q as UpdateEventSchema, S as UpdateICalSubscriptionInput, T as UpdateICalSubscriptionSchema, V as UpdateWebhookInput, W as UpdateWebhookSchema, X as WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookDeactivatedPayloadSchema, Y as WebhookDeliveryStatus, Z as WebhookDeliveryStatusSchema, WebhookEvent, WebhookEventType, _ as WorkingHours, $ as WorkingHoursSchema, parseWebhookEvent } from './events.cjs';
|
|
1
|
+
export { AgentCreatedPayloadSchema, AgentUpdatedPayloadSchema, A as AvailabilityQuery, a as AvailabilityQuerySchema, CalendarConnectionReauthorizationRequiredPayloadSchema, C as CreateAgentInput, b as CreateAgentSchema, c as CreateCalendarInput, d as CreateCalendarSchema, e as CreateEventInput, f as CreateEventSchema, g as CreateICalSubscriptionInput, h as CreateICalSubscriptionSchema, i as CreateProposalInput, j as CreateProposalSchema, k as CreateWebhookInput, l as CreateWebhookSchema, m as CrossAgentAvailabilityQuery, n as CrossAgentAvailabilityQuerySchema, D as DEFAULT_EVENT_REMINDERS, E as EVENT_STATUSES, EventCreatedPayloadSchema, EventDeletedPayloadSchema, EventEndedPayloadSchema, EventHoldConfirmedPayloadSchema, EventHoldCreatedPayloadSchema, EventHoldExpiredPayloadSchema, EventHoldReleasedPayloadSchema, EventReminderPayloadSchema, EventStartedPayloadSchema, o as EventStatus, EventUpdatedPayloadSchema, L as ListAgentsQuery, p as ListAgentsQuerySchema, q as ListCalendarsQuery, r as ListCalendarsQuerySchema, s as ListDeliveriesQuery, t as ListDeliveriesQuerySchema, u as ListEventsQuery, v as ListEventsQuerySchema, w as ListICalSubscriptionsQuery, x as ListICalSubscriptionsQuerySchema, y as ListWebhooksQuery, z as ListWebhooksQuerySchema, OrgPlanChangedPayloadSchema, ProposalCancelledPayloadSchema, ProposalConfirmedPayloadSchema, ProposalCreatedPayloadSchema, ProposalExpiredPayloadSchema, ProposalRespondedPayloadSchema, R as REMINDER_MAX_COUNT, B as REMINDER_MAX_MINUTES, F as REMINDER_MIN_MINUTES, G as RemindersSchema, H as RespondToProposalInput, I as RespondToProposalSchema, U as UpdateAgentInput, J as UpdateAgentSchema, K as UpdateAvailabilityRules, M as UpdateAvailabilityRulesSchema, N as UpdateCalendarInput, O as UpdateCalendarSchema, P as UpdateEventInput, Q as UpdateEventSchema, S as UpdateICalSubscriptionInput, T as UpdateICalSubscriptionSchema, V as UpdateWebhookInput, W as UpdateWebhookSchema, UsageThresholdCrossedPayloadSchema, X as WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookDeactivatedPayloadSchema, Y as WebhookDeliveryStatus, Z as WebhookDeliveryStatusSchema, WebhookEvent, WebhookEventType, _ as WorkingHours, $ as WorkingHoursSchema, parseWebhookEvent } from './events.cjs';
|
|
2
2
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AgentCreatedPayloadSchema, AgentUpdatedPayloadSchema, A as AvailabilityQuery, a as AvailabilityQuerySchema, C as CreateAgentInput, b as CreateAgentSchema, c as CreateCalendarInput, d as CreateCalendarSchema, e as CreateEventInput, f as CreateEventSchema, g as CreateICalSubscriptionInput, h as CreateICalSubscriptionSchema, i as CreateProposalInput, j as CreateProposalSchema, k as CreateWebhookInput, l as CreateWebhookSchema, m as CrossAgentAvailabilityQuery, n as CrossAgentAvailabilityQuerySchema, D as DEFAULT_EVENT_REMINDERS, E as EVENT_STATUSES, EventCreatedPayloadSchema, EventDeletedPayloadSchema, EventEndedPayloadSchema, EventHoldConfirmedPayloadSchema, EventHoldCreatedPayloadSchema, EventHoldExpiredPayloadSchema, EventHoldReleasedPayloadSchema, EventReminderPayloadSchema, EventStartedPayloadSchema, o as EventStatus, EventUpdatedPayloadSchema, L as ListAgentsQuery, p as ListAgentsQuerySchema, q as ListCalendarsQuery, r as ListCalendarsQuerySchema, s as ListDeliveriesQuery, t as ListDeliveriesQuerySchema, u as ListEventsQuery, v as ListEventsQuerySchema, w as ListICalSubscriptionsQuery, x as ListICalSubscriptionsQuerySchema, y as ListWebhooksQuery, z as ListWebhooksQuerySchema, ProposalCancelledPayloadSchema, ProposalConfirmedPayloadSchema, ProposalCreatedPayloadSchema, ProposalExpiredPayloadSchema, ProposalRespondedPayloadSchema, R as REMINDER_MAX_COUNT, B as REMINDER_MAX_MINUTES, F as REMINDER_MIN_MINUTES, G as RemindersSchema, H as RespondToProposalInput, I as RespondToProposalSchema, U as UpdateAgentInput, J as UpdateAgentSchema, K as UpdateAvailabilityRules, M as UpdateAvailabilityRulesSchema, N as UpdateCalendarInput, O as UpdateCalendarSchema, P as UpdateEventInput, Q as UpdateEventSchema, S as UpdateICalSubscriptionInput, T as UpdateICalSubscriptionSchema, V as UpdateWebhookInput, W as UpdateWebhookSchema, X as WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookDeactivatedPayloadSchema, Y as WebhookDeliveryStatus, Z as WebhookDeliveryStatusSchema, WebhookEvent, WebhookEventType, _ as WorkingHours, $ as WorkingHoursSchema, parseWebhookEvent } from './events.js';
|
|
1
|
+
export { AgentCreatedPayloadSchema, AgentUpdatedPayloadSchema, A as AvailabilityQuery, a as AvailabilityQuerySchema, CalendarConnectionReauthorizationRequiredPayloadSchema, C as CreateAgentInput, b as CreateAgentSchema, c as CreateCalendarInput, d as CreateCalendarSchema, e as CreateEventInput, f as CreateEventSchema, g as CreateICalSubscriptionInput, h as CreateICalSubscriptionSchema, i as CreateProposalInput, j as CreateProposalSchema, k as CreateWebhookInput, l as CreateWebhookSchema, m as CrossAgentAvailabilityQuery, n as CrossAgentAvailabilityQuerySchema, D as DEFAULT_EVENT_REMINDERS, E as EVENT_STATUSES, EventCreatedPayloadSchema, EventDeletedPayloadSchema, EventEndedPayloadSchema, EventHoldConfirmedPayloadSchema, EventHoldCreatedPayloadSchema, EventHoldExpiredPayloadSchema, EventHoldReleasedPayloadSchema, EventReminderPayloadSchema, EventStartedPayloadSchema, o as EventStatus, EventUpdatedPayloadSchema, L as ListAgentsQuery, p as ListAgentsQuerySchema, q as ListCalendarsQuery, r as ListCalendarsQuerySchema, s as ListDeliveriesQuery, t as ListDeliveriesQuerySchema, u as ListEventsQuery, v as ListEventsQuerySchema, w as ListICalSubscriptionsQuery, x as ListICalSubscriptionsQuerySchema, y as ListWebhooksQuery, z as ListWebhooksQuerySchema, OrgPlanChangedPayloadSchema, ProposalCancelledPayloadSchema, ProposalConfirmedPayloadSchema, ProposalCreatedPayloadSchema, ProposalExpiredPayloadSchema, ProposalRespondedPayloadSchema, R as REMINDER_MAX_COUNT, B as REMINDER_MAX_MINUTES, F as REMINDER_MIN_MINUTES, G as RemindersSchema, H as RespondToProposalInput, I as RespondToProposalSchema, U as UpdateAgentInput, J as UpdateAgentSchema, K as UpdateAvailabilityRules, M as UpdateAvailabilityRulesSchema, N as UpdateCalendarInput, O as UpdateCalendarSchema, P as UpdateEventInput, Q as UpdateEventSchema, S as UpdateICalSubscriptionInput, T as UpdateICalSubscriptionSchema, V as UpdateWebhookInput, W as UpdateWebhookSchema, UsageThresholdCrossedPayloadSchema, X as WEBHOOK_DELIVERY_STATUSES, WEBHOOK_EVENT_TYPES, WebhookDeactivatedPayloadSchema, Y as WebhookDeliveryStatus, Z as WebhookDeliveryStatusSchema, WebhookEvent, WebhookEventType, _ as WorkingHours, $ as WorkingHoursSchema, parseWebhookEvent } from './events.js';
|
|
2
2
|
import 'zod';
|