@tiempo/sdk 0.0.0-stage → 0.1.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +269 -2
  3. package/dist/cjs/client.d.ts +24 -0
  4. package/dist/cjs/client.js +42 -0
  5. package/dist/cjs/core.d.ts +72 -0
  6. package/dist/cjs/core.js +187 -0
  7. package/dist/cjs/crypto.d.ts +5 -0
  8. package/dist/cjs/crypto.js +29 -0
  9. package/dist/cjs/errors.d.ts +86 -0
  10. package/dist/cjs/errors.js +134 -0
  11. package/dist/cjs/events.d.ts +23 -0
  12. package/dist/cjs/events.js +10 -0
  13. package/dist/cjs/generated/events.d.ts +51 -0
  14. package/dist/cjs/generated/events.js +51 -0
  15. package/dist/cjs/generated/meta.d.ts +4 -0
  16. package/dist/cjs/generated/meta.js +8 -0
  17. package/dist/cjs/generated/openapi.d.ts +3721 -0
  18. package/dist/cjs/generated/openapi.js +2 -0
  19. package/dist/cjs/generated/resources.d.ts +416 -0
  20. package/dist/cjs/generated/resources.js +621 -0
  21. package/dist/cjs/generated/types.d.ts +134 -0
  22. package/dist/cjs/generated/types.js +3 -0
  23. package/dist/cjs/index.d.ts +16 -0
  24. package/dist/cjs/index.js +49 -0
  25. package/dist/cjs/list.d.ts +43 -0
  26. package/dist/cjs/list.js +78 -0
  27. package/dist/cjs/package.json +1 -0
  28. package/dist/cjs/query.d.ts +8 -0
  29. package/dist/cjs/query.js +47 -0
  30. package/dist/cjs/shared.d.ts +7 -0
  31. package/dist/cjs/shared.js +2 -0
  32. package/dist/cjs/webhooks.d.ts +34 -0
  33. package/dist/cjs/webhooks.js +115 -0
  34. package/dist/esm/client.d.ts +24 -0
  35. package/dist/esm/client.js +38 -0
  36. package/dist/esm/core.d.ts +72 -0
  37. package/dist/esm/core.js +181 -0
  38. package/dist/esm/crypto.d.ts +5 -0
  39. package/dist/esm/crypto.js +26 -0
  40. package/dist/esm/errors.d.ts +86 -0
  41. package/dist/esm/errors.js +120 -0
  42. package/dist/esm/events.d.ts +23 -0
  43. package/dist/esm/events.js +8 -0
  44. package/dist/esm/generated/events.d.ts +51 -0
  45. package/dist/esm/generated/events.js +48 -0
  46. package/dist/esm/generated/meta.d.ts +4 -0
  47. package/dist/esm/generated/meta.js +5 -0
  48. package/dist/esm/generated/openapi.d.ts +3721 -0
  49. package/dist/esm/generated/openapi.js +1 -0
  50. package/dist/esm/generated/resources.d.ts +416 -0
  51. package/dist/esm/generated/resources.js +603 -0
  52. package/dist/esm/generated/types.d.ts +134 -0
  53. package/dist/esm/generated/types.js +2 -0
  54. package/dist/esm/index.d.ts +16 -0
  55. package/dist/esm/index.js +10 -0
  56. package/dist/esm/list.d.ts +43 -0
  57. package/dist/esm/list.js +74 -0
  58. package/dist/esm/package.json +1 -0
  59. package/dist/esm/query.d.ts +8 -0
  60. package/dist/esm/query.js +43 -0
  61. package/dist/esm/shared.d.ts +7 -0
  62. package/dist/esm/shared.js +1 -0
  63. package/dist/esm/webhooks.d.ts +34 -0
  64. package/dist/esm/webhooks.js +109 -0
  65. package/package.json +74 -4
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,416 @@
1
+ import type { Core, RequestOptions } from '../core.js';
2
+ import type { ListPromise } from '../list.js';
3
+ import type { TiempoEvent } from '../events.js';
4
+ import type { Account, AccountCreateParams, AccountListParams, AccountUpdateParams, Attendee, AttendeeCancelParams, AttendeeCreateParams, AttendeeListParams, AttendeeUpdateParams, Availability, AvailabilityCalendar, AvailabilityCalendarParams, AvailabilitySearchParams, Block, BlockCreateParams, BlockListParams, BlockUpdateParams, Booking, BookingCancelParams, BookingCreateParams, BookingImportParams, BookingListParams, BookingRescheduleParams, BookingUpdateParams, ConflictPreview, ConflictPreviewCreateParams, DeletedObject, EventListParams, EventResendParams, Location, LocationCreateParams, LocationListParams, LocationUpdateParams, Resource, ResourceCreateParams, ResourceListParams, ResourceUpdateParams, Schedule, ScheduleCreateParams, ScheduleListParams, ScheduleOverride, ScheduleOverrideCreateParams, ScheduleOverrideListParams, ScheduleOverrideUpdateParams, ScheduleUpdateParams, Series, SeriesCancelParams, SeriesCreateParams, SeriesListParams, SeriesSplitParams, SeriesUpdateParams, SkippedOccurrence, UsageGetParams, UsageStatement, UsageSummary, WebhookDelivery, WebhookEndpoint, WebhookEndpointCreateParams, WebhookEndpointDeliveriesParams, WebhookEndpointListParams, WebhookEndpointResendParams, WebhookEndpointResendResult, WebhookEndpointUpdateParams } from './types.js';
5
+ /** `tiempo.accounts` */
6
+ export declare class AccountsResource {
7
+ private readonly core;
8
+ constructor(core: Core);
9
+ /**
10
+ * `GET /v1/accounts`
11
+ *
12
+ * Await for one page, or `for await` to iterate every item.
13
+ */
14
+ list(params?: AccountListParams, options?: RequestOptions): ListPromise<Account>;
15
+ /**
16
+ * `POST /v1/accounts`
17
+ */
18
+ create(params: AccountCreateParams, options?: RequestOptions): Promise<Account>;
19
+ /**
20
+ * `GET /v1/accounts/{id}`
21
+ */
22
+ get(id: string, options?: RequestOptions): Promise<Account>;
23
+ /**
24
+ * `POST /v1/accounts/{id}`
25
+ */
26
+ update(id: string, params?: AccountUpdateParams, options?: RequestOptions): Promise<Account>;
27
+ /**
28
+ * `DELETE /v1/accounts/{id}`
29
+ */
30
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
31
+ }
32
+ /** `tiempo.attendees` */
33
+ export declare class AttendeesResource {
34
+ private readonly core;
35
+ constructor(core: Core);
36
+ /**
37
+ * `GET /v1/bookings/{id}/attendees` (business-scoped: needs an account)
38
+ *
39
+ * Await for one page, or `for await` to iterate every item.
40
+ */
41
+ list(id: string, params?: AttendeeListParams, options?: RequestOptions): ListPromise<Attendee>;
42
+ /**
43
+ * `POST /v1/bookings/{id}/attendees` (business-scoped: needs an account)
44
+ */
45
+ create(id: string, params?: AttendeeCreateParams, options?: RequestOptions): Promise<Attendee>;
46
+ /**
47
+ * `GET /v1/attendees/{id}` (business-scoped: needs an account)
48
+ */
49
+ get(id: string, options?: RequestOptions): Promise<Attendee>;
50
+ /**
51
+ * `POST /v1/attendees/{id}` (business-scoped: needs an account)
52
+ */
53
+ update(id: string, params?: AttendeeUpdateParams, options?: RequestOptions): Promise<Attendee>;
54
+ /**
55
+ * `POST /v1/attendees/{id}/cancel` (business-scoped: needs an account)
56
+ */
57
+ cancel(id: string, params?: AttendeeCancelParams, options?: RequestOptions): Promise<Attendee>;
58
+ /**
59
+ * `POST /v1/attendees/{id}/complete` (business-scoped: needs an account)
60
+ */
61
+ complete(id: string, options?: RequestOptions): Promise<Attendee>;
62
+ /**
63
+ * `POST /v1/attendees/{id}/confirm` (business-scoped: needs an account)
64
+ */
65
+ confirm(id: string, options?: RequestOptions): Promise<Attendee>;
66
+ /**
67
+ * `POST /v1/attendees/{id}/no_show` (business-scoped: needs an account)
68
+ */
69
+ noShow(id: string, options?: RequestOptions): Promise<Attendee>;
70
+ }
71
+ /** `tiempo.availability` */
72
+ export declare class AvailabilityResource {
73
+ private readonly core;
74
+ constructor(core: Core);
75
+ /**
76
+ * `GET /v1/availability/calendar` (business-scoped: needs an account)
77
+ */
78
+ calendar(params?: AvailabilityCalendarParams, options?: RequestOptions): Promise<AvailabilityCalendar>;
79
+ /**
80
+ * `POST /v1/availability` (business-scoped: needs an account)
81
+ */
82
+ search(params: AvailabilitySearchParams, options?: RequestOptions): Promise<Availability>;
83
+ }
84
+ /** `tiempo.blocks` */
85
+ export declare class BlocksResource {
86
+ private readonly core;
87
+ constructor(core: Core);
88
+ /**
89
+ * `GET /v1/blocks` (business-scoped: needs an account)
90
+ *
91
+ * Await for one page, or `for await` to iterate every item.
92
+ */
93
+ list(params?: BlockListParams, options?: RequestOptions): ListPromise<Block>;
94
+ /**
95
+ * `POST /v1/blocks` (business-scoped: needs an account)
96
+ */
97
+ create(params?: BlockCreateParams, options?: RequestOptions): Promise<Block>;
98
+ /**
99
+ * `GET /v1/blocks/{id}` (business-scoped: needs an account)
100
+ */
101
+ get(id: string, options?: RequestOptions): Promise<Block>;
102
+ /**
103
+ * `POST /v1/blocks/{id}` (business-scoped: needs an account)
104
+ */
105
+ update(id: string, params?: BlockUpdateParams, options?: RequestOptions): Promise<Block>;
106
+ /**
107
+ * `DELETE /v1/blocks/{id}` (business-scoped: needs an account)
108
+ */
109
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
110
+ }
111
+ /** `tiempo.bookings` */
112
+ export declare class BookingsResource {
113
+ private readonly core;
114
+ constructor(core: Core);
115
+ /**
116
+ * `GET /v1/bookings` (business-scoped: needs an account)
117
+ *
118
+ * Await for one page, or `for await` to iterate every item.
119
+ */
120
+ list(params?: BookingListParams, options?: RequestOptions): ListPromise<Booking>;
121
+ /**
122
+ * `POST /v1/bookings` (business-scoped: needs an account)
123
+ */
124
+ create(params: BookingCreateParams, options?: RequestOptions): Promise<Booking>;
125
+ /**
126
+ * `GET /v1/bookings/{id}` (business-scoped: needs an account)
127
+ */
128
+ get(id: string, options?: RequestOptions): Promise<Booking>;
129
+ /**
130
+ * `POST /v1/bookings/{id}` (business-scoped: needs an account)
131
+ */
132
+ update(id: string, params?: BookingUpdateParams, options?: RequestOptions): Promise<Booking>;
133
+ /**
134
+ * `POST /v1/bookings/{id}/cancel` (business-scoped: needs an account)
135
+ */
136
+ cancel(id: string, params?: BookingCancelParams, options?: RequestOptions): Promise<Booking>;
137
+ /**
138
+ * `POST /v1/bookings/{id}/complete` (business-scoped: needs an account)
139
+ */
140
+ complete(id: string, options?: RequestOptions): Promise<Booking>;
141
+ /**
142
+ * `POST /v1/bookings/{id}/confirm` (business-scoped: needs an account)
143
+ */
144
+ confirm(id: string, options?: RequestOptions): Promise<Booking>;
145
+ /**
146
+ * `POST /v1/bookings/import` (business-scoped: needs an account)
147
+ *
148
+ * Returns a single page; this endpoint does not paginate.
149
+ */
150
+ import(params: BookingImportParams, options?: RequestOptions): ListPromise<Booking>;
151
+ /**
152
+ * `POST /v1/bookings/{id}/no_show` (business-scoped: needs an account)
153
+ */
154
+ noShow(id: string, options?: RequestOptions): Promise<Booking>;
155
+ /**
156
+ * `POST /v1/bookings/{id}/reschedule` (business-scoped: needs an account)
157
+ */
158
+ reschedule(id: string, params: BookingRescheduleParams, options?: RequestOptions): Promise<Booking>;
159
+ }
160
+ /** `tiempo.conflictPreviews` */
161
+ export declare class ConflictPreviewsResource {
162
+ private readonly core;
163
+ constructor(core: Core);
164
+ /**
165
+ * `POST /v1/conflict_previews` (business-scoped: needs an account)
166
+ */
167
+ create(params: ConflictPreviewCreateParams, options?: RequestOptions): Promise<ConflictPreview>;
168
+ }
169
+ /** `tiempo.events` */
170
+ export declare class EventsResource {
171
+ private readonly core;
172
+ constructor(core: Core);
173
+ /**
174
+ * `GET /v1/events` (business-scoped: needs an account)
175
+ *
176
+ * Await for one page, or `for await` to iterate every item.
177
+ */
178
+ list(params?: EventListParams, options?: RequestOptions): ListPromise<TiempoEvent>;
179
+ /**
180
+ * `GET /v1/events/{id}`
181
+ */
182
+ get(id: string, options?: RequestOptions): Promise<TiempoEvent>;
183
+ /**
184
+ * `GET /v1/events/{id}/deliveries`
185
+ *
186
+ * Returns a single page; this endpoint does not paginate.
187
+ */
188
+ deliveries(id: string, options?: RequestOptions): ListPromise<WebhookDelivery>;
189
+ /**
190
+ * `POST /v1/events/{id}/resend`
191
+ */
192
+ resend(id: string, params: EventResendParams, options?: RequestOptions): Promise<WebhookDelivery>;
193
+ }
194
+ /** `tiempo.locations` */
195
+ export declare class LocationsResource {
196
+ private readonly core;
197
+ constructor(core: Core);
198
+ /**
199
+ * `GET /v1/locations` (business-scoped: needs an account)
200
+ *
201
+ * Await for one page, or `for await` to iterate every item.
202
+ */
203
+ list(params?: LocationListParams, options?: RequestOptions): ListPromise<Location>;
204
+ /**
205
+ * `POST /v1/locations` (business-scoped: needs an account)
206
+ */
207
+ create(params: LocationCreateParams, options?: RequestOptions): Promise<Location>;
208
+ /**
209
+ * `GET /v1/locations/{id}` (business-scoped: needs an account)
210
+ */
211
+ get(id: string, options?: RequestOptions): Promise<Location>;
212
+ /**
213
+ * `POST /v1/locations/{id}` (business-scoped: needs an account)
214
+ */
215
+ update(id: string, params?: LocationUpdateParams, options?: RequestOptions): Promise<Location>;
216
+ /**
217
+ * `DELETE /v1/locations/{id}` (business-scoped: needs an account)
218
+ */
219
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
220
+ }
221
+ /** `tiempo.resources` */
222
+ export declare class ResourcesResource {
223
+ private readonly core;
224
+ constructor(core: Core);
225
+ /**
226
+ * `GET /v1/resources` (business-scoped: needs an account)
227
+ *
228
+ * Await for one page, or `for await` to iterate every item.
229
+ */
230
+ list(params?: ResourceListParams, options?: RequestOptions): ListPromise<Resource>;
231
+ /**
232
+ * `POST /v1/resources` (business-scoped: needs an account)
233
+ */
234
+ create(params: ResourceCreateParams, options?: RequestOptions): Promise<Resource>;
235
+ /**
236
+ * `GET /v1/resources/{id}` (business-scoped: needs an account)
237
+ */
238
+ get(id: string, options?: RequestOptions): Promise<Resource>;
239
+ /**
240
+ * `POST /v1/resources/{id}` (business-scoped: needs an account)
241
+ */
242
+ update(id: string, params?: ResourceUpdateParams, options?: RequestOptions): Promise<Resource>;
243
+ /**
244
+ * `DELETE /v1/resources/{id}` (business-scoped: needs an account)
245
+ */
246
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
247
+ /**
248
+ * `POST /v1/resources/{id}/archive` (business-scoped: needs an account)
249
+ */
250
+ archive(id: string, options?: RequestOptions): Promise<Resource>;
251
+ /**
252
+ * `POST /v1/resources/{id}/unarchive` (business-scoped: needs an account)
253
+ */
254
+ unarchive(id: string, options?: RequestOptions): Promise<Resource>;
255
+ }
256
+ /** `tiempo.scheduleOverrides` */
257
+ export declare class ScheduleOverridesResource {
258
+ private readonly core;
259
+ constructor(core: Core);
260
+ /**
261
+ * `GET /v1/schedule_overrides` (business-scoped: needs an account)
262
+ *
263
+ * Await for one page, or `for await` to iterate every item.
264
+ */
265
+ list(params?: ScheduleOverrideListParams, options?: RequestOptions): ListPromise<ScheduleOverride>;
266
+ /**
267
+ * `POST /v1/schedule_overrides` (business-scoped: needs an account)
268
+ */
269
+ create(params: ScheduleOverrideCreateParams, options?: RequestOptions): Promise<ScheduleOverride>;
270
+ /**
271
+ * `GET /v1/schedule_overrides/{id}` (business-scoped: needs an account)
272
+ */
273
+ get(id: string, options?: RequestOptions): Promise<ScheduleOverride>;
274
+ /**
275
+ * `POST /v1/schedule_overrides/{id}` (business-scoped: needs an account)
276
+ */
277
+ update(id: string, params?: ScheduleOverrideUpdateParams, options?: RequestOptions): Promise<ScheduleOverride>;
278
+ /**
279
+ * `DELETE /v1/schedule_overrides/{id}` (business-scoped: needs an account)
280
+ */
281
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
282
+ }
283
+ /** `tiempo.schedules` */
284
+ export declare class SchedulesResource {
285
+ private readonly core;
286
+ constructor(core: Core);
287
+ /**
288
+ * `GET /v1/schedules` (business-scoped: needs an account)
289
+ *
290
+ * Await for one page, or `for await` to iterate every item.
291
+ */
292
+ list(params?: ScheduleListParams, options?: RequestOptions): ListPromise<Schedule>;
293
+ /**
294
+ * `POST /v1/schedules` (business-scoped: needs an account)
295
+ */
296
+ create(params: ScheduleCreateParams, options?: RequestOptions): Promise<Schedule>;
297
+ /**
298
+ * `GET /v1/schedules/{id}` (business-scoped: needs an account)
299
+ */
300
+ get(id: string, options?: RequestOptions): Promise<Schedule>;
301
+ /**
302
+ * `POST /v1/schedules/{id}` (business-scoped: needs an account)
303
+ */
304
+ update(id: string, params?: ScheduleUpdateParams, options?: RequestOptions): Promise<Schedule>;
305
+ /**
306
+ * `DELETE /v1/schedules/{id}` (business-scoped: needs an account)
307
+ */
308
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
309
+ }
310
+ /** `tiempo.series` */
311
+ export declare class SeriesResource {
312
+ private readonly core;
313
+ constructor(core: Core);
314
+ /**
315
+ * `GET /v1/series` (business-scoped: needs an account)
316
+ *
317
+ * Await for one page, or `for await` to iterate every item.
318
+ */
319
+ list(params?: SeriesListParams, options?: RequestOptions): ListPromise<Series>;
320
+ /**
321
+ * `POST /v1/series` (business-scoped: needs an account)
322
+ */
323
+ create(params: SeriesCreateParams, options?: RequestOptions): Promise<Series>;
324
+ /**
325
+ * `GET /v1/series/{id}` (business-scoped: needs an account)
326
+ */
327
+ get(id: string, options?: RequestOptions): Promise<Series>;
328
+ /**
329
+ * `POST /v1/series/{id}` (business-scoped: needs an account)
330
+ */
331
+ update(id: string, params?: SeriesUpdateParams, options?: RequestOptions): Promise<Series>;
332
+ /**
333
+ * `POST /v1/series/{id}/cancel` (business-scoped: needs an account)
334
+ */
335
+ cancel(id: string, params?: SeriesCancelParams, options?: RequestOptions): Promise<Series>;
336
+ /**
337
+ * `GET /v1/series/{id}/skipped_occurrences` (business-scoped: needs an account)
338
+ *
339
+ * Returns a single page; this endpoint does not paginate.
340
+ */
341
+ skipped(id: string, options?: RequestOptions): ListPromise<SkippedOccurrence>;
342
+ /**
343
+ * `POST /v1/series/{id}/split` (business-scoped: needs an account)
344
+ */
345
+ split(id: string, params: SeriesSplitParams, options?: RequestOptions): Promise<Series>;
346
+ }
347
+ /** `tiempo.usage` */
348
+ export declare class UsageResource {
349
+ private readonly core;
350
+ constructor(core: Core);
351
+ /**
352
+ * `GET /v1/usage`
353
+ */
354
+ get(params?: UsageGetParams, options?: RequestOptions): Promise<UsageSummary>;
355
+ /**
356
+ * `GET /v1/usage/statements`
357
+ *
358
+ * Returns a single page; this endpoint does not paginate.
359
+ */
360
+ statements(options?: RequestOptions): ListPromise<UsageStatement>;
361
+ }
362
+ /** `tiempo.webhookEndpoints` */
363
+ export declare class WebhookEndpointsResource {
364
+ private readonly core;
365
+ constructor(core: Core);
366
+ /**
367
+ * `GET /v1/webhook_endpoints`
368
+ *
369
+ * Await for one page, or `for await` to iterate every item.
370
+ */
371
+ list(params?: WebhookEndpointListParams, options?: RequestOptions): ListPromise<WebhookEndpoint>;
372
+ /**
373
+ * `POST /v1/webhook_endpoints`
374
+ */
375
+ create(params: WebhookEndpointCreateParams, options?: RequestOptions): Promise<WebhookEndpoint>;
376
+ /**
377
+ * `GET /v1/webhook_endpoints/{id}`
378
+ */
379
+ get(id: string, options?: RequestOptions): Promise<WebhookEndpoint>;
380
+ /**
381
+ * `POST /v1/webhook_endpoints/{id}`
382
+ */
383
+ update(id: string, params?: WebhookEndpointUpdateParams, options?: RequestOptions): Promise<WebhookEndpoint>;
384
+ /**
385
+ * `DELETE /v1/webhook_endpoints/{id}`
386
+ */
387
+ delete(id: string, options?: RequestOptions): Promise<DeletedObject>;
388
+ /**
389
+ * `GET /v1/webhook_endpoints/{id}/deliveries`
390
+ *
391
+ * Await for one page, or `for await` to iterate every item.
392
+ */
393
+ deliveries(id: string, params?: WebhookEndpointDeliveriesParams, options?: RequestOptions): ListPromise<WebhookDelivery>;
394
+ /**
395
+ * `POST /v1/webhook_endpoints/{id}/resend`
396
+ */
397
+ resend(id: string, params?: WebhookEndpointResendParams, options?: RequestOptions): Promise<WebhookEndpointResendResult>;
398
+ }
399
+ /** Every resource, as properties of the client. */
400
+ export declare abstract class TiempoResources {
401
+ readonly accounts: AccountsResource;
402
+ readonly attendees: AttendeesResource;
403
+ readonly availability: AvailabilityResource;
404
+ readonly blocks: BlocksResource;
405
+ readonly bookings: BookingsResource;
406
+ readonly conflictPreviews: ConflictPreviewsResource;
407
+ readonly events: EventsResource;
408
+ readonly locations: LocationsResource;
409
+ readonly resources: ResourcesResource;
410
+ readonly scheduleOverrides: ScheduleOverridesResource;
411
+ readonly schedules: SchedulesResource;
412
+ readonly series: SeriesResource;
413
+ readonly usage: UsageResource;
414
+ readonly webhookEndpoints: WebhookEndpointsResource;
415
+ protected constructor(core: Core);
416
+ }