@chronary/sdk 0.4.1 → 0.5.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/dist/index.cjs +25 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -5
- package/dist/index.d.ts +71 -5
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -195,6 +195,14 @@ interface CalendarEvent {
|
|
|
195
195
|
metadata: Record<string, unknown>;
|
|
196
196
|
/** Reminder offsets (minutes before start). null = inherit calendar default (then system default of 10 min); [] = no reminders. */
|
|
197
197
|
reminders: number[] | null;
|
|
198
|
+
/** RFC 5545 RRULE subset (no "RRULE:" prefix) when this event is a recurring series master, e.g. "FREQ=WEEKLY;BYDAY=MO,WE;COUNT=12". null = one-off event. */
|
|
199
|
+
recurrenceRule: string | null;
|
|
200
|
+
/** ISO 8601 starts of individually cancelled occurrences (EXDATE). */
|
|
201
|
+
recurrenceExdates: string[];
|
|
202
|
+
/** Present only on expanded instances (`expand: true` lists): id of the recurring series master this instance belongs to. */
|
|
203
|
+
recurringEventId?: string;
|
|
204
|
+
/** Present only on expanded instances: the occurrence start this instance was generated for. */
|
|
205
|
+
originalStartTime?: string;
|
|
198
206
|
holdExpiresAt: string | null;
|
|
199
207
|
holdPriority: number | null;
|
|
200
208
|
deletedAt: string | null;
|
|
@@ -215,6 +223,15 @@ interface CreateEventParams {
|
|
|
215
223
|
hold_expires_at?: string;
|
|
216
224
|
/** Priority for conflict resolution. Only valid with status='hold'. 0-100. */
|
|
217
225
|
hold_priority?: number;
|
|
226
|
+
/**
|
|
227
|
+
* RFC 5545 RRULE subset (no "RRULE:" prefix), e.g. "FREQ=WEEKLY;BYDAY=MO,WE;COUNT=12" —
|
|
228
|
+
* makes the event a recurring series master. Not allowed with status='hold'.
|
|
229
|
+
* Fails with 400 on an invalid rule; 429 when the plan's active
|
|
230
|
+
* recurring-series cap is reached (free: 5, Pro: 250 — see
|
|
231
|
+
* `usage.recurring_events`); 403 plan_required when the series is unbounded
|
|
232
|
+
* or ends more than 90 days out on the free plan (Pro allows unbounded).
|
|
233
|
+
*/
|
|
234
|
+
recurrence_rule?: string;
|
|
218
235
|
}
|
|
219
236
|
interface UpdateEventParams {
|
|
220
237
|
title?: string;
|
|
@@ -227,6 +244,16 @@ interface UpdateEventParams {
|
|
|
227
244
|
metadata?: Record<string, unknown>;
|
|
228
245
|
/** Reminder offsets in minutes before start. null = inherit calendar default; [] = no reminders. */
|
|
229
246
|
reminders?: number[] | null;
|
|
247
|
+
/**
|
|
248
|
+
* Full-series edit of the recurrence rule (RFC 5545 RRULE subset, no
|
|
249
|
+
* "RRULE:" prefix). null clears the rule, turning the series back into a
|
|
250
|
+
* one-off event. Fails with 400 on an invalid rule; 429 when converting a
|
|
251
|
+
* one-off to recurring and the plan's active recurring-series cap is
|
|
252
|
+
* reached (free: 5, Pro: 250); 403 plan_required when the series is
|
|
253
|
+
* unbounded or ends more than 90 days out on the free plan (Pro allows
|
|
254
|
+
* unbounded).
|
|
255
|
+
*/
|
|
256
|
+
recurrence_rule?: string | null;
|
|
230
257
|
}
|
|
231
258
|
interface ListEventsParams {
|
|
232
259
|
calendarId?: string;
|
|
@@ -237,6 +264,25 @@ interface ListEventsParams {
|
|
|
237
264
|
source?: 'internal' | 'external_ical';
|
|
238
265
|
limit?: number;
|
|
239
266
|
offset?: number;
|
|
267
|
+
/**
|
|
268
|
+
* Expand recurring series into individual occurrence instances within the
|
|
269
|
+
* window. When true, both `start_after` and `start_before` are required
|
|
270
|
+
* (max 366 days apart) — the API returns 400 otherwise. Expanded instances
|
|
271
|
+
* carry `recurringEventId` + `originalStartTime`.
|
|
272
|
+
*/
|
|
273
|
+
expand?: boolean;
|
|
274
|
+
}
|
|
275
|
+
/** Options for event delete calls — `RequestOptions` plus recurrence controls. */
|
|
276
|
+
interface DeleteEventOptions extends RequestOptions {
|
|
277
|
+
/**
|
|
278
|
+
* For recurring series only: ISO 8601 start of the single occurrence to
|
|
279
|
+
* cancel (recorded as an EXDATE). The series lives on and the delete call
|
|
280
|
+
* resolves to the updated series master event instead of void. Fails with
|
|
281
|
+
* 400 if the timestamp is not an active occurrence of the series, or 409
|
|
282
|
+
* if the event is not a recurring series. Omit to delete the whole
|
|
283
|
+
* event/series (resolves to void).
|
|
284
|
+
*/
|
|
285
|
+
occurrence_start?: string;
|
|
240
286
|
}
|
|
241
287
|
type SlotDuration = '15m' | '30m' | '45m' | '1h' | '2h';
|
|
242
288
|
interface AvailabilitySlot {
|
|
@@ -252,6 +298,9 @@ interface BusyBlock {
|
|
|
252
298
|
interface AvailabilityParams {
|
|
253
299
|
start: string;
|
|
254
300
|
end: string;
|
|
301
|
+
/** Requested slot length. Preferred over `slot_duration`. */
|
|
302
|
+
duration?: SlotDuration;
|
|
303
|
+
/** @deprecated Use `duration` instead. */
|
|
255
304
|
slot_duration?: SlotDuration;
|
|
256
305
|
include_busy?: boolean;
|
|
257
306
|
}
|
|
@@ -259,6 +308,9 @@ interface CrossAgentAvailabilityParams {
|
|
|
259
308
|
agents: string[];
|
|
260
309
|
start: string;
|
|
261
310
|
end: string;
|
|
311
|
+
/** Requested slot length. Preferred over `slot_duration`. */
|
|
312
|
+
duration?: SlotDuration;
|
|
313
|
+
/** @deprecated Use `duration` instead. */
|
|
262
314
|
slot_duration?: SlotDuration;
|
|
263
315
|
calendars?: string[];
|
|
264
316
|
include_busy?: boolean;
|
|
@@ -514,6 +566,8 @@ interface Usage {
|
|
|
514
566
|
availability_queries: UsageMetric;
|
|
515
567
|
ical_subscriptions: UsageMetric;
|
|
516
568
|
proposals: UsageMetric;
|
|
569
|
+
/** Active recurring series masters vs. the plan cap (free: 5, Pro: 250; null = unlimited). */
|
|
570
|
+
recurring_events: UsageMetric;
|
|
517
571
|
holds: HoldsUsage;
|
|
518
572
|
cross_calendar_queries: CrossCalendarQueriesUsage;
|
|
519
573
|
}
|
|
@@ -787,7 +841,15 @@ declare class EventsClient {
|
|
|
787
841
|
get(calendarId: string, eventId: string, options?: RequestOptions): Promise<CalendarEvent>;
|
|
788
842
|
list(params?: ListEventsParams): PageIterator<CalendarEvent>;
|
|
789
843
|
update(calendarId: string, eventId: string, params: UpdateEventParams, options?: RequestOptions): Promise<CalendarEvent>;
|
|
790
|
-
|
|
844
|
+
/**
|
|
845
|
+
* Delete an event (or, for a recurring series, the whole series). Pass
|
|
846
|
+
* `occurrence_start` to cancel just one occurrence of a recurring series
|
|
847
|
+
* instead — the series lives on and the updated series master is returned.
|
|
848
|
+
* Plain deletes resolve to void. With `occurrence_start`, fails with 400 if
|
|
849
|
+
* the timestamp is not an active occurrence, or 409 if the event is not a
|
|
850
|
+
* recurring series.
|
|
851
|
+
*/
|
|
852
|
+
delete(calendarId: string, eventId: string, options?: DeleteEventOptions): Promise<CalendarEvent | void>;
|
|
791
853
|
/**
|
|
792
854
|
* Fetch an event by ID alone. The calendar is resolved internally from the
|
|
793
855
|
* event, so no calendar ID is required.
|
|
@@ -800,9 +862,13 @@ declare class EventsClient {
|
|
|
800
862
|
updateById(eventId: string, params: UpdateEventParams, options?: RequestOptions): Promise<CalendarEvent>;
|
|
801
863
|
/**
|
|
802
864
|
* Delete an event by ID alone. The calendar is resolved internally from the
|
|
803
|
-
* event, so no calendar ID is required.
|
|
865
|
+
* event, so no calendar ID is required. Pass `occurrence_start` to cancel
|
|
866
|
+
* just one occurrence of a recurring series — the series lives on and the
|
|
867
|
+
* updated series master is returned; plain deletes resolve to void. With
|
|
868
|
+
* `occurrence_start`, fails with 400 if the timestamp is not an active
|
|
869
|
+
* occurrence, or 409 if the event is not a recurring series.
|
|
804
870
|
*/
|
|
805
|
-
deleteById(eventId: string, options?:
|
|
871
|
+
deleteById(eventId: string, options?: DeleteEventOptions): Promise<CalendarEvent | void>;
|
|
806
872
|
/**
|
|
807
873
|
* Promote a held event (status='hold') to status='confirmed'. Fails with 409
|
|
808
874
|
* if the event is not a hold, or if the hold has already expired.
|
|
@@ -1019,7 +1085,7 @@ declare class TermsClient {
|
|
|
1019
1085
|
declare function verifySignature(rawBody: string, headers: Headers | Record<string, string>, secret: string, options?: VerifyOptions): Promise<void>;
|
|
1020
1086
|
declare function constructEvent(rawBody: string, headers: Headers | Record<string, string>, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
1021
1087
|
|
|
1022
|
-
declare const VERSION = "0.
|
|
1088
|
+
declare const VERSION = "0.5.0";
|
|
1023
1089
|
|
|
1024
1090
|
declare class ChronaryError extends Error {
|
|
1025
1091
|
readonly status: number;
|
|
@@ -1075,4 +1141,4 @@ declare class Chronary {
|
|
|
1075
1141
|
};
|
|
1076
1142
|
}
|
|
1077
1143
|
|
|
1078
|
-
export { APIPromise, type AcceptTermsParams, type AcceptTermsResult, type Agent, type AgentSignUpExistingOrgResponse, type AgentSignUpNewOrgResponse, type AgentSignUpParams, type AgentSignUpResponse, type AgentStatus, type AgentVerifyParams, type AgentVerifyResponse, type AppInfo, type AuditLogEntry, type AuditLogResponse, AuthenticationError, type AvailabilityParams, type AvailabilityResponse, type AvailabilityRules, type AvailabilitySlot, type BusyBlock, type Calendar, type CalendarContext, type CalendarEvent, type CancelProposalResponse, Chronary, type ChronaryConfig, ChronaryError, ConnectionError, CoreClient, type CreateAgentParams, type CreateCalendarParams, type CreateEventParams, type CreateICalSubscriptionParams, type CreateProposalParams, type CreateScopedApiKeyParams, type CreateWebhookParams, type CreatedScopedApiKey, type CrossAgentAvailabilityParams, type DataExport, type FeedbackAcceptedResponse, type FeedbackType, type ICalSubscription, type ListAgentsParams, type ListAuditLogParams, type ListCalendarsParams, type ListEventsParams, type ListICalSubscriptionsParams, type ListProposalsParams, type ListWebhookDeliveriesParams, type ListWebhooksParams, type LogLevel, NotFoundError, type Page, PageIterator, type PageResponse, type Plan, type PlanId, type PlanLimits, type PlansListResponse, type Proposal, type ProposalResponse, type ProposalResponseAction, type ProposalSlot, type ProposalStatus, type ProposalSummary, QuotaExceededError, type QuotaSnapshot, RateLimitError, type RawResponse, type RequestOptions, type ResolveProposalResponse, type RespondToProposalParams, type ScopedApiKey, type SetAvailabilityRulesParams, type SlotDuration, type SubmitFeedbackParams, TimeoutError, type UpdateAgentParams, type UpdateCalendarParams, type UpdateEventParams, type UpdateICalSubscriptionParams, type UpdateWebhookParams, type Usage, type UsageMetric, VERSION, ValidationError, type VerifyOptions, type WaitlistJoinParams, type WaitlistJoinResponse, type WaitlistedOrg, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryStats, type WebhookEvent, type WebhookEventType, type WithResponse, type WorkingHours, type WorkingHoursDay, constructEvent, Chronary as default, isAgentSignUpNewOrg, verifySignature };
|
|
1144
|
+
export { APIPromise, type AcceptTermsParams, type AcceptTermsResult, type Agent, type AgentSignUpExistingOrgResponse, type AgentSignUpNewOrgResponse, type AgentSignUpParams, type AgentSignUpResponse, type AgentStatus, type AgentVerifyParams, type AgentVerifyResponse, type AppInfo, type AuditLogEntry, type AuditLogResponse, AuthenticationError, type AvailabilityParams, type AvailabilityResponse, type AvailabilityRules, type AvailabilitySlot, type BusyBlock, type Calendar, type CalendarContext, type CalendarEvent, type CancelProposalResponse, Chronary, type ChronaryConfig, ChronaryError, ConnectionError, CoreClient, type CreateAgentParams, type CreateCalendarParams, type CreateEventParams, type CreateICalSubscriptionParams, type CreateProposalParams, type CreateScopedApiKeyParams, type CreateWebhookParams, type CreatedScopedApiKey, type CrossAgentAvailabilityParams, type DataExport, type DeleteEventOptions, type FeedbackAcceptedResponse, type FeedbackType, type ICalSubscription, type ListAgentsParams, type ListAuditLogParams, type ListCalendarsParams, type ListEventsParams, type ListICalSubscriptionsParams, type ListProposalsParams, type ListWebhookDeliveriesParams, type ListWebhooksParams, type LogLevel, NotFoundError, type Page, PageIterator, type PageResponse, type Plan, type PlanId, type PlanLimits, type PlansListResponse, type Proposal, type ProposalResponse, type ProposalResponseAction, type ProposalSlot, type ProposalStatus, type ProposalSummary, QuotaExceededError, type QuotaSnapshot, RateLimitError, type RawResponse, type RequestOptions, type ResolveProposalResponse, type RespondToProposalParams, type ScopedApiKey, type SetAvailabilityRulesParams, type SlotDuration, type SubmitFeedbackParams, TimeoutError, type UpdateAgentParams, type UpdateCalendarParams, type UpdateEventParams, type UpdateICalSubscriptionParams, type UpdateWebhookParams, type Usage, type UsageMetric, VERSION, ValidationError, type VerifyOptions, type WaitlistJoinParams, type WaitlistJoinResponse, type WaitlistedOrg, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryStats, type WebhookEvent, type WebhookEventType, type WithResponse, type WorkingHours, type WorkingHoursDay, constructEvent, Chronary as default, isAgentSignUpNewOrg, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -195,6 +195,14 @@ interface CalendarEvent {
|
|
|
195
195
|
metadata: Record<string, unknown>;
|
|
196
196
|
/** Reminder offsets (minutes before start). null = inherit calendar default (then system default of 10 min); [] = no reminders. */
|
|
197
197
|
reminders: number[] | null;
|
|
198
|
+
/** RFC 5545 RRULE subset (no "RRULE:" prefix) when this event is a recurring series master, e.g. "FREQ=WEEKLY;BYDAY=MO,WE;COUNT=12". null = one-off event. */
|
|
199
|
+
recurrenceRule: string | null;
|
|
200
|
+
/** ISO 8601 starts of individually cancelled occurrences (EXDATE). */
|
|
201
|
+
recurrenceExdates: string[];
|
|
202
|
+
/** Present only on expanded instances (`expand: true` lists): id of the recurring series master this instance belongs to. */
|
|
203
|
+
recurringEventId?: string;
|
|
204
|
+
/** Present only on expanded instances: the occurrence start this instance was generated for. */
|
|
205
|
+
originalStartTime?: string;
|
|
198
206
|
holdExpiresAt: string | null;
|
|
199
207
|
holdPriority: number | null;
|
|
200
208
|
deletedAt: string | null;
|
|
@@ -215,6 +223,15 @@ interface CreateEventParams {
|
|
|
215
223
|
hold_expires_at?: string;
|
|
216
224
|
/** Priority for conflict resolution. Only valid with status='hold'. 0-100. */
|
|
217
225
|
hold_priority?: number;
|
|
226
|
+
/**
|
|
227
|
+
* RFC 5545 RRULE subset (no "RRULE:" prefix), e.g. "FREQ=WEEKLY;BYDAY=MO,WE;COUNT=12" —
|
|
228
|
+
* makes the event a recurring series master. Not allowed with status='hold'.
|
|
229
|
+
* Fails with 400 on an invalid rule; 429 when the plan's active
|
|
230
|
+
* recurring-series cap is reached (free: 5, Pro: 250 — see
|
|
231
|
+
* `usage.recurring_events`); 403 plan_required when the series is unbounded
|
|
232
|
+
* or ends more than 90 days out on the free plan (Pro allows unbounded).
|
|
233
|
+
*/
|
|
234
|
+
recurrence_rule?: string;
|
|
218
235
|
}
|
|
219
236
|
interface UpdateEventParams {
|
|
220
237
|
title?: string;
|
|
@@ -227,6 +244,16 @@ interface UpdateEventParams {
|
|
|
227
244
|
metadata?: Record<string, unknown>;
|
|
228
245
|
/** Reminder offsets in minutes before start. null = inherit calendar default; [] = no reminders. */
|
|
229
246
|
reminders?: number[] | null;
|
|
247
|
+
/**
|
|
248
|
+
* Full-series edit of the recurrence rule (RFC 5545 RRULE subset, no
|
|
249
|
+
* "RRULE:" prefix). null clears the rule, turning the series back into a
|
|
250
|
+
* one-off event. Fails with 400 on an invalid rule; 429 when converting a
|
|
251
|
+
* one-off to recurring and the plan's active recurring-series cap is
|
|
252
|
+
* reached (free: 5, Pro: 250); 403 plan_required when the series is
|
|
253
|
+
* unbounded or ends more than 90 days out on the free plan (Pro allows
|
|
254
|
+
* unbounded).
|
|
255
|
+
*/
|
|
256
|
+
recurrence_rule?: string | null;
|
|
230
257
|
}
|
|
231
258
|
interface ListEventsParams {
|
|
232
259
|
calendarId?: string;
|
|
@@ -237,6 +264,25 @@ interface ListEventsParams {
|
|
|
237
264
|
source?: 'internal' | 'external_ical';
|
|
238
265
|
limit?: number;
|
|
239
266
|
offset?: number;
|
|
267
|
+
/**
|
|
268
|
+
* Expand recurring series into individual occurrence instances within the
|
|
269
|
+
* window. When true, both `start_after` and `start_before` are required
|
|
270
|
+
* (max 366 days apart) — the API returns 400 otherwise. Expanded instances
|
|
271
|
+
* carry `recurringEventId` + `originalStartTime`.
|
|
272
|
+
*/
|
|
273
|
+
expand?: boolean;
|
|
274
|
+
}
|
|
275
|
+
/** Options for event delete calls — `RequestOptions` plus recurrence controls. */
|
|
276
|
+
interface DeleteEventOptions extends RequestOptions {
|
|
277
|
+
/**
|
|
278
|
+
* For recurring series only: ISO 8601 start of the single occurrence to
|
|
279
|
+
* cancel (recorded as an EXDATE). The series lives on and the delete call
|
|
280
|
+
* resolves to the updated series master event instead of void. Fails with
|
|
281
|
+
* 400 if the timestamp is not an active occurrence of the series, or 409
|
|
282
|
+
* if the event is not a recurring series. Omit to delete the whole
|
|
283
|
+
* event/series (resolves to void).
|
|
284
|
+
*/
|
|
285
|
+
occurrence_start?: string;
|
|
240
286
|
}
|
|
241
287
|
type SlotDuration = '15m' | '30m' | '45m' | '1h' | '2h';
|
|
242
288
|
interface AvailabilitySlot {
|
|
@@ -252,6 +298,9 @@ interface BusyBlock {
|
|
|
252
298
|
interface AvailabilityParams {
|
|
253
299
|
start: string;
|
|
254
300
|
end: string;
|
|
301
|
+
/** Requested slot length. Preferred over `slot_duration`. */
|
|
302
|
+
duration?: SlotDuration;
|
|
303
|
+
/** @deprecated Use `duration` instead. */
|
|
255
304
|
slot_duration?: SlotDuration;
|
|
256
305
|
include_busy?: boolean;
|
|
257
306
|
}
|
|
@@ -259,6 +308,9 @@ interface CrossAgentAvailabilityParams {
|
|
|
259
308
|
agents: string[];
|
|
260
309
|
start: string;
|
|
261
310
|
end: string;
|
|
311
|
+
/** Requested slot length. Preferred over `slot_duration`. */
|
|
312
|
+
duration?: SlotDuration;
|
|
313
|
+
/** @deprecated Use `duration` instead. */
|
|
262
314
|
slot_duration?: SlotDuration;
|
|
263
315
|
calendars?: string[];
|
|
264
316
|
include_busy?: boolean;
|
|
@@ -514,6 +566,8 @@ interface Usage {
|
|
|
514
566
|
availability_queries: UsageMetric;
|
|
515
567
|
ical_subscriptions: UsageMetric;
|
|
516
568
|
proposals: UsageMetric;
|
|
569
|
+
/** Active recurring series masters vs. the plan cap (free: 5, Pro: 250; null = unlimited). */
|
|
570
|
+
recurring_events: UsageMetric;
|
|
517
571
|
holds: HoldsUsage;
|
|
518
572
|
cross_calendar_queries: CrossCalendarQueriesUsage;
|
|
519
573
|
}
|
|
@@ -787,7 +841,15 @@ declare class EventsClient {
|
|
|
787
841
|
get(calendarId: string, eventId: string, options?: RequestOptions): Promise<CalendarEvent>;
|
|
788
842
|
list(params?: ListEventsParams): PageIterator<CalendarEvent>;
|
|
789
843
|
update(calendarId: string, eventId: string, params: UpdateEventParams, options?: RequestOptions): Promise<CalendarEvent>;
|
|
790
|
-
|
|
844
|
+
/**
|
|
845
|
+
* Delete an event (or, for a recurring series, the whole series). Pass
|
|
846
|
+
* `occurrence_start` to cancel just one occurrence of a recurring series
|
|
847
|
+
* instead — the series lives on and the updated series master is returned.
|
|
848
|
+
* Plain deletes resolve to void. With `occurrence_start`, fails with 400 if
|
|
849
|
+
* the timestamp is not an active occurrence, or 409 if the event is not a
|
|
850
|
+
* recurring series.
|
|
851
|
+
*/
|
|
852
|
+
delete(calendarId: string, eventId: string, options?: DeleteEventOptions): Promise<CalendarEvent | void>;
|
|
791
853
|
/**
|
|
792
854
|
* Fetch an event by ID alone. The calendar is resolved internally from the
|
|
793
855
|
* event, so no calendar ID is required.
|
|
@@ -800,9 +862,13 @@ declare class EventsClient {
|
|
|
800
862
|
updateById(eventId: string, params: UpdateEventParams, options?: RequestOptions): Promise<CalendarEvent>;
|
|
801
863
|
/**
|
|
802
864
|
* Delete an event by ID alone. The calendar is resolved internally from the
|
|
803
|
-
* event, so no calendar ID is required.
|
|
865
|
+
* event, so no calendar ID is required. Pass `occurrence_start` to cancel
|
|
866
|
+
* just one occurrence of a recurring series — the series lives on and the
|
|
867
|
+
* updated series master is returned; plain deletes resolve to void. With
|
|
868
|
+
* `occurrence_start`, fails with 400 if the timestamp is not an active
|
|
869
|
+
* occurrence, or 409 if the event is not a recurring series.
|
|
804
870
|
*/
|
|
805
|
-
deleteById(eventId: string, options?:
|
|
871
|
+
deleteById(eventId: string, options?: DeleteEventOptions): Promise<CalendarEvent | void>;
|
|
806
872
|
/**
|
|
807
873
|
* Promote a held event (status='hold') to status='confirmed'. Fails with 409
|
|
808
874
|
* if the event is not a hold, or if the hold has already expired.
|
|
@@ -1019,7 +1085,7 @@ declare class TermsClient {
|
|
|
1019
1085
|
declare function verifySignature(rawBody: string, headers: Headers | Record<string, string>, secret: string, options?: VerifyOptions): Promise<void>;
|
|
1020
1086
|
declare function constructEvent(rawBody: string, headers: Headers | Record<string, string>, secret: string, options?: VerifyOptions): Promise<WebhookEvent>;
|
|
1021
1087
|
|
|
1022
|
-
declare const VERSION = "0.
|
|
1088
|
+
declare const VERSION = "0.5.0";
|
|
1023
1089
|
|
|
1024
1090
|
declare class ChronaryError extends Error {
|
|
1025
1091
|
readonly status: number;
|
|
@@ -1075,4 +1141,4 @@ declare class Chronary {
|
|
|
1075
1141
|
};
|
|
1076
1142
|
}
|
|
1077
1143
|
|
|
1078
|
-
export { APIPromise, type AcceptTermsParams, type AcceptTermsResult, type Agent, type AgentSignUpExistingOrgResponse, type AgentSignUpNewOrgResponse, type AgentSignUpParams, type AgentSignUpResponse, type AgentStatus, type AgentVerifyParams, type AgentVerifyResponse, type AppInfo, type AuditLogEntry, type AuditLogResponse, AuthenticationError, type AvailabilityParams, type AvailabilityResponse, type AvailabilityRules, type AvailabilitySlot, type BusyBlock, type Calendar, type CalendarContext, type CalendarEvent, type CancelProposalResponse, Chronary, type ChronaryConfig, ChronaryError, ConnectionError, CoreClient, type CreateAgentParams, type CreateCalendarParams, type CreateEventParams, type CreateICalSubscriptionParams, type CreateProposalParams, type CreateScopedApiKeyParams, type CreateWebhookParams, type CreatedScopedApiKey, type CrossAgentAvailabilityParams, type DataExport, type FeedbackAcceptedResponse, type FeedbackType, type ICalSubscription, type ListAgentsParams, type ListAuditLogParams, type ListCalendarsParams, type ListEventsParams, type ListICalSubscriptionsParams, type ListProposalsParams, type ListWebhookDeliveriesParams, type ListWebhooksParams, type LogLevel, NotFoundError, type Page, PageIterator, type PageResponse, type Plan, type PlanId, type PlanLimits, type PlansListResponse, type Proposal, type ProposalResponse, type ProposalResponseAction, type ProposalSlot, type ProposalStatus, type ProposalSummary, QuotaExceededError, type QuotaSnapshot, RateLimitError, type RawResponse, type RequestOptions, type ResolveProposalResponse, type RespondToProposalParams, type ScopedApiKey, type SetAvailabilityRulesParams, type SlotDuration, type SubmitFeedbackParams, TimeoutError, type UpdateAgentParams, type UpdateCalendarParams, type UpdateEventParams, type UpdateICalSubscriptionParams, type UpdateWebhookParams, type Usage, type UsageMetric, VERSION, ValidationError, type VerifyOptions, type WaitlistJoinParams, type WaitlistJoinResponse, type WaitlistedOrg, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryStats, type WebhookEvent, type WebhookEventType, type WithResponse, type WorkingHours, type WorkingHoursDay, constructEvent, Chronary as default, isAgentSignUpNewOrg, verifySignature };
|
|
1144
|
+
export { APIPromise, type AcceptTermsParams, type AcceptTermsResult, type Agent, type AgentSignUpExistingOrgResponse, type AgentSignUpNewOrgResponse, type AgentSignUpParams, type AgentSignUpResponse, type AgentStatus, type AgentVerifyParams, type AgentVerifyResponse, type AppInfo, type AuditLogEntry, type AuditLogResponse, AuthenticationError, type AvailabilityParams, type AvailabilityResponse, type AvailabilityRules, type AvailabilitySlot, type BusyBlock, type Calendar, type CalendarContext, type CalendarEvent, type CancelProposalResponse, Chronary, type ChronaryConfig, ChronaryError, ConnectionError, CoreClient, type CreateAgentParams, type CreateCalendarParams, type CreateEventParams, type CreateICalSubscriptionParams, type CreateProposalParams, type CreateScopedApiKeyParams, type CreateWebhookParams, type CreatedScopedApiKey, type CrossAgentAvailabilityParams, type DataExport, type DeleteEventOptions, type FeedbackAcceptedResponse, type FeedbackType, type ICalSubscription, type ListAgentsParams, type ListAuditLogParams, type ListCalendarsParams, type ListEventsParams, type ListICalSubscriptionsParams, type ListProposalsParams, type ListWebhookDeliveriesParams, type ListWebhooksParams, type LogLevel, NotFoundError, type Page, PageIterator, type PageResponse, type Plan, type PlanId, type PlanLimits, type PlansListResponse, type Proposal, type ProposalResponse, type ProposalResponseAction, type ProposalSlot, type ProposalStatus, type ProposalSummary, QuotaExceededError, type QuotaSnapshot, RateLimitError, type RawResponse, type RequestOptions, type ResolveProposalResponse, type RespondToProposalParams, type ScopedApiKey, type SetAvailabilityRulesParams, type SlotDuration, type SubmitFeedbackParams, TimeoutError, type UpdateAgentParams, type UpdateCalendarParams, type UpdateEventParams, type UpdateICalSubscriptionParams, type UpdateWebhookParams, type Usage, type UsageMetric, VERSION, ValidationError, type VerifyOptions, type WaitlistJoinParams, type WaitlistJoinResponse, type WaitlistedOrg, type Webhook, type WebhookDelivery, type WebhookDeliveryListResponse, type WebhookDeliveryStats, type WebhookEvent, type WebhookEventType, type WithResponse, type WorkingHours, type WorkingHoursDay, constructEvent, Chronary as default, isAgentSignUpNewOrg, verifySignature };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var VERSION = "0.
|
|
2
|
+
var VERSION = "0.5.0";
|
|
3
3
|
|
|
4
4
|
// src/error.ts
|
|
5
5
|
var ChronaryError = class extends Error {
|
|
@@ -541,13 +541,22 @@ var EventsClient = class {
|
|
|
541
541
|
options
|
|
542
542
|
);
|
|
543
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* Delete an event (or, for a recurring series, the whole series). Pass
|
|
546
|
+
* `occurrence_start` to cancel just one occurrence of a recurring series
|
|
547
|
+
* instead — the series lives on and the updated series master is returned.
|
|
548
|
+
* Plain deletes resolve to void. With `occurrence_start`, fails with 400 if
|
|
549
|
+
* the timestamp is not an active occurrence, or 409 if the event is not a
|
|
550
|
+
* recurring series.
|
|
551
|
+
*/
|
|
544
552
|
async delete(calendarId, eventId, options) {
|
|
545
|
-
|
|
553
|
+
const { occurrence_start, ...requestOptions } = options ?? {};
|
|
554
|
+
return this.client.request(
|
|
546
555
|
"DELETE",
|
|
547
556
|
`/v1/calendars/${calendarId}/events/${eventId}`,
|
|
548
557
|
void 0,
|
|
549
|
-
void 0,
|
|
550
|
-
|
|
558
|
+
occurrence_start !== void 0 ? { occurrence_start } : void 0,
|
|
559
|
+
requestOptions
|
|
551
560
|
);
|
|
552
561
|
}
|
|
553
562
|
/**
|
|
@@ -578,15 +587,20 @@ var EventsClient = class {
|
|
|
578
587
|
}
|
|
579
588
|
/**
|
|
580
589
|
* Delete an event by ID alone. The calendar is resolved internally from the
|
|
581
|
-
* event, so no calendar ID is required.
|
|
590
|
+
* event, so no calendar ID is required. Pass `occurrence_start` to cancel
|
|
591
|
+
* just one occurrence of a recurring series — the series lives on and the
|
|
592
|
+
* updated series master is returned; plain deletes resolve to void. With
|
|
593
|
+
* `occurrence_start`, fails with 400 if the timestamp is not an active
|
|
594
|
+
* occurrence, or 409 if the event is not a recurring series.
|
|
582
595
|
*/
|
|
583
596
|
async deleteById(eventId, options) {
|
|
584
|
-
|
|
597
|
+
const { occurrence_start, ...requestOptions } = options ?? {};
|
|
598
|
+
return this.client.request(
|
|
585
599
|
"DELETE",
|
|
586
600
|
`/v1/events/${eventId}`,
|
|
587
601
|
void 0,
|
|
588
|
-
void 0,
|
|
589
|
-
|
|
602
|
+
occurrence_start !== void 0 ? { occurrence_start } : void 0,
|
|
603
|
+
requestOptions
|
|
590
604
|
);
|
|
591
605
|
}
|
|
592
606
|
/**
|
|
@@ -631,6 +645,7 @@ var AvailabilityClient = class {
|
|
|
631
645
|
{
|
|
632
646
|
start: params.start,
|
|
633
647
|
end: params.end,
|
|
648
|
+
duration: params.duration,
|
|
634
649
|
slot_duration: params.slot_duration,
|
|
635
650
|
include_busy: params.include_busy
|
|
636
651
|
},
|
|
@@ -645,6 +660,7 @@ var AvailabilityClient = class {
|
|
|
645
660
|
{
|
|
646
661
|
start: params.start,
|
|
647
662
|
end: params.end,
|
|
663
|
+
duration: params.duration,
|
|
648
664
|
slot_duration: params.slot_duration,
|
|
649
665
|
include_busy: params.include_busy
|
|
650
666
|
},
|
|
@@ -660,6 +676,7 @@ var AvailabilityClient = class {
|
|
|
660
676
|
agents: params.agents.join(","),
|
|
661
677
|
start: params.start,
|
|
662
678
|
end: params.end,
|
|
679
|
+
duration: params.duration,
|
|
663
680
|
slot_duration: params.slot_duration,
|
|
664
681
|
calendars: params.calendars?.join(","),
|
|
665
682
|
include_busy: params.include_busy
|