@mountaya/client 0.0.0-stage → 0.2.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +149 -0
  2. package/LICENCE.fr.txt +280 -0
  3. package/LICENSE.txt +262 -0
  4. package/README.md +1260 -2
  5. package/dist/admin/index.cjs +2895 -0
  6. package/dist/admin/index.cjs.map +1 -0
  7. package/dist/admin/index.d.cts +889 -0
  8. package/dist/admin/index.d.ts +889 -0
  9. package/dist/admin/index.js +204 -0
  10. package/dist/admin/index.js.map +1 -0
  11. package/dist/browser.cjs +5993 -0
  12. package/dist/browser.cjs.map +1 -0
  13. package/dist/browser.d.cts +70 -0
  14. package/dist/browser.d.ts +70 -0
  15. package/dist/browser.js +22 -0
  16. package/dist/browser.js.map +1 -0
  17. package/dist/chunk-CeEX7ayk.d.cts +75531 -0
  18. package/dist/chunk-CeEX7ayk.d.ts +75531 -0
  19. package/dist/chunk-Cg7Dtcb4.js +2987 -0
  20. package/dist/chunk-Cg7Dtcb4.js.map +1 -0
  21. package/dist/chunk-DJqUsgsy.d.ts +1463 -0
  22. package/dist/chunk-DNc8T5K1.js +241 -0
  23. package/dist/chunk-DNc8T5K1.js.map +1 -0
  24. package/dist/chunk-DTxzw3hu.d.cts +1463 -0
  25. package/dist/chunk-DmxQID5X.js +2289 -0
  26. package/dist/chunk-DmxQID5X.js.map +1 -0
  27. package/dist/chunk-DoZt_oIV.d.ts +3991 -0
  28. package/dist/chunk-DpJrqANO.js +11 -0
  29. package/dist/chunk-Dx8mPAdC.d.cts +3991 -0
  30. package/dist/chunk-X2ukY3ho.js +419 -0
  31. package/dist/chunk-X2ukY3ho.js.map +1 -0
  32. package/dist/events/index.cjs +1436 -0
  33. package/dist/events/index.cjs.map +1 -0
  34. package/dist/events/index.d.cts +772 -0
  35. package/dist/events/index.d.ts +772 -0
  36. package/dist/events/index.js +543 -0
  37. package/dist/events/index.js.map +1 -0
  38. package/dist/index.cjs +5992 -0
  39. package/dist/index.cjs.map +1 -0
  40. package/dist/index.d.cts +44 -0
  41. package/dist/index.d.ts +44 -0
  42. package/dist/index.js +21 -0
  43. package/dist/index.js.map +1 -0
  44. package/package.json +126 -4
  45. package/src/admin/index.ts +47 -0
  46. package/src/admin/rules/mountayaAdmin.ts +102 -0
  47. package/src/browser.ts +233 -0
  48. package/src/core/engines/sessionToken.ts +870 -0
  49. package/src/core/rules/auth.ts +1017 -0
  50. package/src/core/rules/clientHeader.ts +28 -0
  51. package/src/core/rules/dates.ts +200 -0
  52. package/src/core/rules/decode.ts +154 -0
  53. package/src/core/rules/envelope.ts +41 -0
  54. package/src/core/rules/errors.ts +1486 -0
  55. package/src/core/rules/graphql.ts +576 -0
  56. package/src/core/rules/headerValue.ts +42 -0
  57. package/src/core/rules/idempotencyKey.ts +64 -0
  58. package/src/core/rules/nullMask.ts +127 -0
  59. package/src/core/rules/nullMasks.gen.ts +428 -0
  60. package/src/core/rules/paginate.ts +316 -0
  61. package/src/core/rules/rateLimit.ts +507 -0
  62. package/src/core/rules/redaction.ts +219 -0
  63. package/src/core/rules/resourceRef.ts +110 -0
  64. package/src/core/rules/responseBody.ts +492 -0
  65. package/src/core/rules/retry.ts +386 -0
  66. package/src/core/rules/selection.ts +416 -0
  67. package/src/core/rules/sessionAnswer.ts +90 -0
  68. package/src/core/rules/sessionSchedule.ts +131 -0
  69. package/src/core/rules/sessionWait.ts +112 -0
  70. package/src/core/rules/transport.ts +2386 -0
  71. package/src/core/rules/version.gen.ts +16 -0
  72. package/src/core/rules/webAddress.ts +165 -0
  73. package/src/core/rules/webAddresses.gen.ts +30 -0
  74. package/src/data/operations.gen.ts +603 -0
  75. package/src/data/schema.gen.ts +8078 -0
  76. package/src/data/selection.gen.ts +472 -0
  77. package/src/events/index.ts +63 -0
  78. package/src/events/rules/agent.ts +439 -0
  79. package/src/events/rules/collab.ts +554 -0
  80. package/src/events/rules/collabNulls.gen.ts +17 -0
  81. package/src/events/rules/eventStream.ts +94 -0
  82. package/src/events/rules/openSseStream.ts +594 -0
  83. package/src/events/rules/sse.ts +349 -0
  84. package/src/index.ts +231 -0
  85. package/src/rest/adminOperations.gen.ts +70 -0
  86. package/src/rest/adminResources.gen.ts +138 -0
  87. package/src/rest/coreOperations.gen.ts +74 -0
  88. package/src/rest/coreResources.gen.ts +244 -0
  89. package/src/rest/dates.gen.ts +217 -0
  90. package/src/rest/operations.gen.ts +4341 -0
  91. package/src/rest/resources.gen.ts +371 -0
  92. package/src/rest/schema.gen.ts +57027 -0
  93. package/src/tiles/operations.gen.ts +206 -0
  94. package/src/tiles/schema.gen.ts +8406 -0
  95. package/src/webhooks/rules/constructWebhookEvent.ts +482 -0
  96. package/src/webhooks/rules/webhookEvent.ts +38 -0
  97. package/src/webhooks/rules/webhookEvents.gen.ts +732 -0
@@ -0,0 +1,2895 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, {
3
+ __esModule: { value: true },
4
+ [Symbol.toStringTag]: { value: "Module" }
5
+ });
6
+ var __defProp = Object.defineProperty;
7
+ var __exportAll = (all, no_symbols) => {
8
+ let target = {};
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
14
+ return target;
15
+ };
16
+ const agentRunDates = { created_at: true };
17
+ const collabCollectionChangedEventDates = { occurred_at: true };
18
+ const collabItineraryChangedEventDates = { occurred_at: true };
19
+ const collabMemberDates = { connected_at: true };
20
+ const collabPresenceJoinEventDates = { connected_at: true };
21
+ const collabPresenceSnapshotEventDates = { members: [collabMemberDates] };
22
+ const collabSegmentChangedEventDates = { occurred_at: true };
23
+ const collabStreamEventDates = {
24
+ connected_at: true,
25
+ members: [collabMemberDates],
26
+ occurred_at: true
27
+ };
28
+ const collabWaypointChangedEventDates = { occurred_at: true };
29
+ const collabZoneChangedEventDates = { occurred_at: true };
30
+ const collectionDates = {
31
+ created_at: true,
32
+ updated_at: true
33
+ };
34
+ const collectionEventObjectDates = {
35
+ created_at: true,
36
+ updated_at: true
37
+ };
38
+ const collectionShareLinkEventObjectDates = { created_at: true };
39
+ const invoiceDates = { created_at: true };
40
+ const invoiceEventObjectDates = { created_at: true };
41
+ const itineraryDates = {
42
+ created_at: true,
43
+ updated_at: true
44
+ };
45
+ const itineraryEventObjectDates = {
46
+ created_at: true,
47
+ updated_at: true
48
+ };
49
+ const itinerarySegmentDates = {
50
+ created_at: true,
51
+ start_at: true
52
+ };
53
+ const itinerarySegmentEventObjectDates = { created_at: true };
54
+ const itinerarySegmentGroupDates = { created_at: true };
55
+ const itinerarySegmentGroupEventObjectDates = { created_at: true };
56
+ const itineraryShareLinkEventObjectDates = { created_at: true };
57
+ const waypointTimingDates = { cutoff_at: true };
58
+ const itineraryWaypointDates = {
59
+ created_at: true,
60
+ timing: waypointTimingDates
61
+ };
62
+ const itineraryWaypointEventObjectDates = { created_at: true };
63
+ const itineraryWithDetailsDates = {
64
+ created_at: true,
65
+ groups: [itinerarySegmentGroupDates],
66
+ published_at: true,
67
+ segments: [itinerarySegmentDates],
68
+ updated_at: true,
69
+ waypoints: [itineraryWaypointDates]
70
+ };
71
+ const membershipDates = { joined_at: true };
72
+ const organizationDates = {
73
+ created_at: true,
74
+ updated_at: true
75
+ };
76
+ const organizationEventObjectDates = {
77
+ created_at: true,
78
+ updated_at: true
79
+ };
80
+ const organizationInvitationDates = {
81
+ created_at: true,
82
+ expires_at: true
83
+ };
84
+ const organizationInvitationEventObjectDates = {
85
+ created_at: true,
86
+ expires_at: true
87
+ };
88
+ const organizationMemberDates = { joined_at: true };
89
+ const organizationMemberEventObjectDates = { joined_at: true };
90
+ const subscriptionDiscountDates = { ends_at: true };
91
+ const organizationSubscriptionDates = {
92
+ current_period_end_at: true,
93
+ discount: subscriptionDiscountDates,
94
+ ended_at: true
95
+ };
96
+ const organizationSubscriptionEventObjectDates = { current_period_end_at: true };
97
+ const organizationSubscriptionSummaryDates = { api: organizationSubscriptionDates };
98
+ const publishableKeyDates = {
99
+ created_at: true,
100
+ last_used_at: true,
101
+ revoked_at: true
102
+ };
103
+ const publishableKeyEventObjectDates = {
104
+ created_at: true,
105
+ revoked_at: true
106
+ };
107
+ const secretKeyEventObjectDates = {
108
+ created_at: true,
109
+ revoked_at: true
110
+ };
111
+ const segmentCreateParamsDates = { start_at: true };
112
+ const segmentUpdateParamsDates = { start_at: true };
113
+ const sessionDates = { expires_at: true };
114
+ const shareLinkDates = { created_at: true };
115
+ const userInvitationDates = {
116
+ created_at: true,
117
+ expires_at: true
118
+ };
119
+ const waypointCreateParamsDates = { timing: waypointTimingDates };
120
+ const waypointUpdateParamsDates = { timing: waypointTimingDates };
121
+ const webhookDeliveryDates = {
122
+ created_at: true,
123
+ last_attempt_at: true,
124
+ next_attempt_at: true
125
+ };
126
+ const webhookDeliveryAttemptDates = {
127
+ attempted_at: true,
128
+ scheduled_at: true
129
+ };
130
+ const webhookDeliveryCreateParamsDates = { since: true };
131
+ const webhookDeliveryTriggerDates = {
132
+ created_at: true,
133
+ since: true
134
+ };
135
+ const webhookDeliveryWithAttemptsDates = {
136
+ attempts: [webhookDeliveryAttemptDates],
137
+ created_at: true,
138
+ last_attempt_at: true,
139
+ next_attempt_at: true
140
+ };
141
+ const webhookEndpointDates = {
142
+ created_at: true,
143
+ disabled_at: true,
144
+ failing_since: true,
145
+ updated_at: true
146
+ };
147
+ const webhookEndpointEventObjectDates = {
148
+ created_at: true,
149
+ failing_since: true,
150
+ updated_at: true
151
+ };
152
+ const webhookEndpointWithSecretDates = webhookEndpointDates;
153
+ const webhookEventObjectDates = {
154
+ created_at: true,
155
+ current_period_end_at: true,
156
+ end_at: true,
157
+ expires_at: true,
158
+ failing_since: true,
159
+ joined_at: true,
160
+ revoked_at: true,
161
+ start_at: true,
162
+ updated_at: true
163
+ };
164
+ const webhookEventDataDates = { object: webhookEventObjectDates };
165
+ const webhookEventDates = {
166
+ created_at: true,
167
+ data: webhookEventDataDates
168
+ };
169
+ const webhookEventWithDeliveriesDates = {
170
+ created_at: true,
171
+ data: webhookEventDataDates,
172
+ deliveries: [webhookDeliveryDates]
173
+ };
174
+ const webhookHealthDestinationDates = {
175
+ failing_since: true,
176
+ last_success_at: true
177
+ };
178
+ const webhookHealthPointDates = { start_at: true };
179
+ const webhookHealthDates = {
180
+ destinations: [webhookHealthDestinationDates],
181
+ end_at: true,
182
+ series: [webhookHealthPointDates],
183
+ start_at: true
184
+ };
185
+ const zoneDates = {
186
+ created_at: true,
187
+ end_at: true,
188
+ published_at: true,
189
+ start_at: true,
190
+ updated_at: true
191
+ };
192
+ const restSchemaDates = {
193
+ AgentRun: agentRunDates,
194
+ CollabCollectionChangedEvent: collabCollectionChangedEventDates,
195
+ CollabItineraryChangedEvent: collabItineraryChangedEventDates,
196
+ CollabMember: collabMemberDates,
197
+ CollabPresenceJoinEvent: collabPresenceJoinEventDates,
198
+ CollabPresenceSnapshotEvent: collabPresenceSnapshotEventDates,
199
+ CollabSegmentChangedEvent: collabSegmentChangedEventDates,
200
+ CollabStreamEvent: collabStreamEventDates,
201
+ CollabWaypointChangedEvent: collabWaypointChangedEventDates,
202
+ CollabZoneChangedEvent: collabZoneChangedEventDates,
203
+ Collection: collectionDates,
204
+ CollectionEventObject: collectionEventObjectDates,
205
+ CollectionShareLinkEventObject: collectionShareLinkEventObjectDates,
206
+ Invoice: invoiceDates,
207
+ InvoiceEventObject: invoiceEventObjectDates,
208
+ Itinerary: itineraryDates,
209
+ ItineraryEventObject: itineraryEventObjectDates,
210
+ ItinerarySegment: itinerarySegmentDates,
211
+ ItinerarySegmentEventObject: itinerarySegmentEventObjectDates,
212
+ ItinerarySegmentGroup: itinerarySegmentGroupDates,
213
+ ItinerarySegmentGroupEventObject: itinerarySegmentGroupEventObjectDates,
214
+ ItineraryShareLinkEventObject: itineraryShareLinkEventObjectDates,
215
+ ItineraryWaypoint: itineraryWaypointDates,
216
+ ItineraryWaypointEventObject: itineraryWaypointEventObjectDates,
217
+ ItineraryWithDetails: itineraryWithDetailsDates,
218
+ Membership: membershipDates,
219
+ Organization: organizationDates,
220
+ OrganizationEventObject: organizationEventObjectDates,
221
+ OrganizationInvitation: organizationInvitationDates,
222
+ OrganizationInvitationEventObject: organizationInvitationEventObjectDates,
223
+ OrganizationMember: organizationMemberDates,
224
+ OrganizationMemberEventObject: organizationMemberEventObjectDates,
225
+ OrganizationSubscription: organizationSubscriptionDates,
226
+ OrganizationSubscriptionEventObject: organizationSubscriptionEventObjectDates,
227
+ OrganizationSubscriptionSummary: organizationSubscriptionSummaryDates,
228
+ PublishableKey: publishableKeyDates,
229
+ PublishableKeyEventObject: publishableKeyEventObjectDates,
230
+ SecretKeyEventObject: secretKeyEventObjectDates,
231
+ SegmentCreateParams: segmentCreateParamsDates,
232
+ SegmentUpdateParams: segmentUpdateParamsDates,
233
+ Session: sessionDates,
234
+ ShareLink: shareLinkDates,
235
+ SubscriptionDiscount: subscriptionDiscountDates,
236
+ UserInvitation: userInvitationDates,
237
+ WaypointCreateParams: waypointCreateParamsDates,
238
+ WaypointTiming: waypointTimingDates,
239
+ WaypointUpdateParams: waypointUpdateParamsDates,
240
+ WebhookDelivery: webhookDeliveryDates,
241
+ WebhookDeliveryAttempt: webhookDeliveryAttemptDates,
242
+ WebhookDeliveryCreateParams: webhookDeliveryCreateParamsDates,
243
+ WebhookDeliveryTrigger: webhookDeliveryTriggerDates,
244
+ WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsDates,
245
+ WebhookEndpoint: webhookEndpointDates,
246
+ WebhookEndpointEventObject: webhookEndpointEventObjectDates,
247
+ WebhookEndpointWithSecret: webhookEndpointWithSecretDates,
248
+ WebhookEvent: webhookEventDates,
249
+ WebhookEventData: webhookEventDataDates,
250
+ WebhookEventObject: webhookEventObjectDates,
251
+ WebhookEventWithDeliveries: webhookEventWithDeliveriesDates,
252
+ WebhookHealth: webhookHealthDates,
253
+ WebhookHealthDestination: webhookHealthDestinationDates,
254
+ WebhookHealthPoint: webhookHealthPointDates,
255
+ Zone: zoneDates,
256
+ ZoneCreateParams: {
257
+ end_at: true,
258
+ start_at: true
259
+ },
260
+ ZoneEventObject: {
261
+ created_at: true,
262
+ end_at: true,
263
+ start_at: true,
264
+ updated_at: true
265
+ },
266
+ ZoneUpdateParams: {
267
+ end_at: true,
268
+ start_at: true
269
+ }
270
+ };
271
+ const deleteCollection = (transport, args, options) => transport.request({
272
+ actsAsMember: true,
273
+ idempotencyKey: args.idempotencyKey,
274
+ idempotent: true,
275
+ ifMatch: args.ifMatch,
276
+ method: "DELETE",
277
+ operationId: "deleteCollection",
278
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
279
+ requiresSession: true,
280
+ retry: options?.retry,
281
+ serverBudgetMs: 3e4,
282
+ signal: options?.signal,
283
+ surface: "rest",
284
+ takesIdempotencyKey: true,
285
+ timeoutMs: options?.timeoutMs
286
+ });
287
+ const deleteCollectionItinerary = (transport, args, options) => transport.request({
288
+ actsAsMember: true,
289
+ dates: { data: collectionDates },
290
+ idempotencyKey: args.idempotencyKey,
291
+ idempotent: true,
292
+ ifMatch: args.ifMatch,
293
+ method: "DELETE",
294
+ operationId: "deleteCollectionItinerary",
295
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
296
+ requiresSession: true,
297
+ retry: options?.retry,
298
+ serverBudgetMs: 3e4,
299
+ signal: options?.signal,
300
+ surface: "rest",
301
+ takesIdempotencyKey: true,
302
+ timeoutMs: options?.timeoutMs
303
+ });
304
+ const deleteCollectionShareLink = (transport, args, options) => transport.request({
305
+ actsAsMember: true,
306
+ idempotencyKey: args.idempotencyKey,
307
+ idempotent: true,
308
+ method: "DELETE",
309
+ operationId: "deleteCollectionShareLink",
310
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
311
+ requiresSession: true,
312
+ retry: options?.retry,
313
+ serverBudgetMs: 3e4,
314
+ signal: options?.signal,
315
+ surface: "rest",
316
+ takesIdempotencyKey: true,
317
+ timeoutMs: options?.timeoutMs
318
+ });
319
+ const deleteCollectionZone = (transport, args, options) => transport.request({
320
+ actsAsMember: true,
321
+ dates: { data: collectionDates },
322
+ idempotencyKey: args.idempotencyKey,
323
+ idempotent: true,
324
+ ifMatch: args.ifMatch,
325
+ method: "DELETE",
326
+ operationId: "deleteCollectionZone",
327
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones/${encodeURIComponent(String(args.zone_id))}`,
328
+ requiresSession: true,
329
+ retry: options?.retry,
330
+ serverBudgetMs: 3e4,
331
+ signal: options?.signal,
332
+ surface: "rest",
333
+ takesIdempotencyKey: true,
334
+ timeoutMs: options?.timeoutMs
335
+ });
336
+ const deleteItinerary = (transport, args, options) => transport.request({
337
+ actsAsMember: true,
338
+ idempotencyKey: args.idempotencyKey,
339
+ idempotent: true,
340
+ ifMatch: args.ifMatch,
341
+ method: "DELETE",
342
+ operationId: "deleteItinerary",
343
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
344
+ requiresSession: true,
345
+ retry: options?.retry,
346
+ serverBudgetMs: 3e4,
347
+ signal: options?.signal,
348
+ surface: "rest",
349
+ takesIdempotencyKey: true,
350
+ timeoutMs: options?.timeoutMs
351
+ });
352
+ const deleteItineraryPublication = (transport, args, options) => transport.request({
353
+ actsAsMember: true,
354
+ dates: { data: itineraryWithDetailsDates },
355
+ idempotencyKey: args.idempotencyKey,
356
+ idempotent: true,
357
+ ifMatch: args.ifMatch,
358
+ method: "DELETE",
359
+ operationId: "deleteItineraryPublication",
360
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/publication`,
361
+ requiresSession: true,
362
+ retry: options?.retry,
363
+ serverBudgetMs: 3e4,
364
+ signal: options?.signal,
365
+ surface: "rest",
366
+ takesIdempotencyKey: true,
367
+ timeoutMs: options?.timeoutMs
368
+ });
369
+ const deleteItinerarySegment = (transport, args, options) => transport.request({
370
+ actsAsMember: true,
371
+ dates: { data: itineraryWithDetailsDates },
372
+ idempotencyKey: args.idempotencyKey,
373
+ idempotent: true,
374
+ ifMatch: args.ifMatch,
375
+ method: "DELETE",
376
+ operationId: "deleteItinerarySegment",
377
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}`,
378
+ requiresSession: true,
379
+ retry: options?.retry,
380
+ serverBudgetMs: 3e4,
381
+ signal: options?.signal,
382
+ surface: "rest",
383
+ takesIdempotencyKey: true,
384
+ timeoutMs: options?.timeoutMs
385
+ });
386
+ const deleteItinerarySegmentGroup = (transport, args, options) => transport.request({
387
+ actsAsMember: true,
388
+ dates: { data: itineraryWithDetailsDates },
389
+ idempotencyKey: args.idempotencyKey,
390
+ idempotent: true,
391
+ ifMatch: args.ifMatch,
392
+ method: "DELETE",
393
+ operationId: "deleteItinerarySegmentGroup",
394
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups/${encodeURIComponent(String(args.group_id))}`,
395
+ requiresSession: true,
396
+ retry: options?.retry,
397
+ serverBudgetMs: 3e4,
398
+ signal: options?.signal,
399
+ surface: "rest",
400
+ takesIdempotencyKey: true,
401
+ timeoutMs: options?.timeoutMs
402
+ });
403
+ const deleteItineraryShareLink = (transport, args, options) => transport.request({
404
+ actsAsMember: true,
405
+ idempotencyKey: args.idempotencyKey,
406
+ idempotent: true,
407
+ method: "DELETE",
408
+ operationId: "deleteItineraryShareLink",
409
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
410
+ requiresSession: true,
411
+ retry: options?.retry,
412
+ serverBudgetMs: 3e4,
413
+ signal: options?.signal,
414
+ surface: "rest",
415
+ takesIdempotencyKey: true,
416
+ timeoutMs: options?.timeoutMs
417
+ });
418
+ const deleteItineraryWaypoint = (transport, args, options) => transport.request({
419
+ actsAsMember: true,
420
+ dates: { data: itineraryWithDetailsDates },
421
+ idempotencyKey: args.idempotencyKey,
422
+ idempotent: true,
423
+ ifMatch: args.ifMatch,
424
+ method: "DELETE",
425
+ operationId: "deleteItineraryWaypoint",
426
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints/${encodeURIComponent(String(args.waypoint_id))}`,
427
+ requiresSession: true,
428
+ retry: options?.retry,
429
+ serverBudgetMs: 3e4,
430
+ signal: options?.signal,
431
+ surface: "rest",
432
+ takesIdempotencyKey: true,
433
+ timeoutMs: options?.timeoutMs
434
+ });
435
+ const deleteMyInvitation = (transport, args, options) => transport.request({
436
+ actsAsMember: true,
437
+ idempotencyKey: args.idempotencyKey,
438
+ idempotent: true,
439
+ method: "DELETE",
440
+ operationId: "deleteMyInvitation",
441
+ path: `/v1/me/invitations/${encodeURIComponent(String(args.invitation_id))}`,
442
+ requiresSession: true,
443
+ retry: options?.retry,
444
+ serverBudgetMs: 3e4,
445
+ signal: options?.signal,
446
+ surface: "rest",
447
+ takesIdempotencyKey: true,
448
+ timeoutMs: options?.timeoutMs
449
+ });
450
+ const deleteOrganizationAiProviderConfig = (transport, args, options) => transport.request({
451
+ actsAsMember: true,
452
+ idempotencyKey: args.idempotencyKey,
453
+ idempotent: true,
454
+ ifMatch: args.ifMatch,
455
+ method: "DELETE",
456
+ operationId: "deleteOrganizationAiProviderConfig",
457
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
458
+ requiresSession: true,
459
+ retry: options?.retry,
460
+ serverBudgetMs: 3e4,
461
+ signal: options?.signal,
462
+ surface: "rest",
463
+ takesIdempotencyKey: true,
464
+ timeoutMs: options?.timeoutMs
465
+ });
466
+ const deleteOrganizationBillingPaymentMethod = (transport, args, options) => transport.request({
467
+ actsAsMember: true,
468
+ idempotencyKey: args.idempotencyKey,
469
+ idempotent: true,
470
+ method: "DELETE",
471
+ operationId: "deleteOrganizationBillingPaymentMethod",
472
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/${encodeURIComponent(String(args.payment_method_id))}`,
473
+ requiresSession: true,
474
+ retry: options?.retry,
475
+ serverBudgetMs: 3e4,
476
+ signal: options?.signal,
477
+ surface: "rest",
478
+ takesIdempotencyKey: true,
479
+ timeoutMs: options?.timeoutMs
480
+ });
481
+ const deleteOrganizationBillingSubscription = (transport, args, options) => transport.request({
482
+ actsAsMember: true,
483
+ dates: { data: organizationSubscriptionSummaryDates },
484
+ idempotencyKey: args.idempotencyKey,
485
+ idempotent: true,
486
+ method: "DELETE",
487
+ operationId: "deleteOrganizationBillingSubscription",
488
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
489
+ requiresSession: true,
490
+ retry: options?.retry,
491
+ serverBudgetMs: 3e4,
492
+ signal: options?.signal,
493
+ surface: "rest",
494
+ takesIdempotencyKey: true,
495
+ timeoutMs: options?.timeoutMs
496
+ });
497
+ const deleteOrganizationInvitation = (transport, args, options) => transport.request({
498
+ actsAsMember: true,
499
+ idempotencyKey: args.idempotencyKey,
500
+ idempotent: true,
501
+ method: "DELETE",
502
+ operationId: "deleteOrganizationInvitation",
503
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations/${encodeURIComponent(String(args.invitation_id))}`,
504
+ requiresSession: true,
505
+ retry: options?.retry,
506
+ serverBudgetMs: 3e4,
507
+ signal: options?.signal,
508
+ surface: "rest",
509
+ takesIdempotencyKey: true,
510
+ timeoutMs: options?.timeoutMs
511
+ });
512
+ const deleteOrganizationMember = (transport, args, options) => transport.request({
513
+ actsAsMember: true,
514
+ idempotencyKey: args.idempotencyKey,
515
+ idempotent: true,
516
+ method: "DELETE",
517
+ operationId: "deleteOrganizationMember",
518
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members/${encodeURIComponent(String(args.user_id))}`,
519
+ requiresSession: true,
520
+ retry: options?.retry,
521
+ serverBudgetMs: 3e4,
522
+ signal: options?.signal,
523
+ surface: "rest",
524
+ takesIdempotencyKey: true,
525
+ timeoutMs: options?.timeoutMs
526
+ });
527
+ const deleteOrganizationPublishableKey = (transport, args, options) => transport.request({
528
+ actsAsMember: true,
529
+ dates: { data: publishableKeyDates },
530
+ idempotencyKey: args.idempotencyKey,
531
+ idempotent: true,
532
+ ifMatch: args.ifMatch,
533
+ method: "DELETE",
534
+ operationId: "deleteOrganizationPublishableKey",
535
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
536
+ requiresSession: true,
537
+ retry: options?.retry,
538
+ serverBudgetMs: 3e4,
539
+ signal: options?.signal,
540
+ surface: "rest",
541
+ takesIdempotencyKey: true,
542
+ timeoutMs: options?.timeoutMs
543
+ });
544
+ const deleteOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
545
+ actsAsMember: true,
546
+ idempotencyKey: args.idempotencyKey,
547
+ idempotent: true,
548
+ ifMatch: args.ifMatch,
549
+ method: "DELETE",
550
+ operationId: "deleteOrganizationWebhookEndpoint",
551
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
552
+ requiresSession: true,
553
+ retry: options?.retry,
554
+ serverBudgetMs: 3e4,
555
+ signal: options?.signal,
556
+ surface: "rest",
557
+ takesIdempotencyKey: true,
558
+ timeoutMs: options?.timeoutMs
559
+ });
560
+ const deleteZone = (transport, args, options) => transport.request({
561
+ actsAsMember: true,
562
+ idempotencyKey: args.idempotencyKey,
563
+ idempotent: true,
564
+ ifMatch: args.ifMatch,
565
+ method: "DELETE",
566
+ operationId: "deleteZone",
567
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
568
+ requiresSession: true,
569
+ retry: options?.retry,
570
+ serverBudgetMs: 3e4,
571
+ signal: options?.signal,
572
+ surface: "rest",
573
+ takesIdempotencyKey: true,
574
+ timeoutMs: options?.timeoutMs
575
+ });
576
+ const deleteZonePublication = (transport, args, options) => transport.request({
577
+ actsAsMember: true,
578
+ dates: { data: zoneDates },
579
+ idempotencyKey: args.idempotencyKey,
580
+ idempotent: true,
581
+ ifMatch: args.ifMatch,
582
+ method: "DELETE",
583
+ operationId: "deleteZonePublication",
584
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/publication`,
585
+ requiresSession: true,
586
+ retry: options?.retry,
587
+ serverBudgetMs: 3e4,
588
+ signal: options?.signal,
589
+ surface: "rest",
590
+ takesIdempotencyKey: true,
591
+ timeoutMs: options?.timeoutMs
592
+ });
593
+ const getActivities = (transport, options) => transport.request({
594
+ acceptsShareToken: true,
595
+ idempotent: true,
596
+ method: "GET",
597
+ operationId: "getActivities",
598
+ path: "/v1/activities",
599
+ retry: options?.retry,
600
+ serverBudgetMs: 3e4,
601
+ signal: options?.signal,
602
+ surface: "rest",
603
+ timeoutMs: options?.timeoutMs
604
+ });
605
+ const getAgentRunEvents = (transport, args, options) => transport.requestBinary({
606
+ accept: "text/event-stream",
607
+ actsAsMember: true,
608
+ idempotent: true,
609
+ method: "GET",
610
+ operationId: "getAgentRunEvents",
611
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/events`,
612
+ requiresSession: true,
613
+ retry: options?.retry,
614
+ signal: options?.signal,
615
+ surface: "rest",
616
+ timeoutMs: options?.timeoutMs
617
+ });
618
+ const getAiProviders = (transport, options) => transport.request({
619
+ idempotent: true,
620
+ method: "GET",
621
+ operationId: "getAiProviders",
622
+ path: "/v1/ai-providers",
623
+ requiresSession: true,
624
+ retry: options?.retry,
625
+ serverBudgetMs: 3e4,
626
+ signal: options?.signal,
627
+ surface: "rest",
628
+ timeoutMs: options?.timeoutMs
629
+ });
630
+ const getBillingProducts = (transport, options) => transport.request({
631
+ idempotent: true,
632
+ method: "GET",
633
+ operationId: "getBillingProducts",
634
+ path: "/v1/billing/products",
635
+ requiresSession: true,
636
+ retry: options?.retry,
637
+ serverBudgetMs: 3e4,
638
+ signal: options?.signal,
639
+ surface: "rest",
640
+ timeoutMs: options?.timeoutMs
641
+ });
642
+ const getCollection = (transport, args, options) => transport.request({
643
+ acceptsShareToken: true,
644
+ dates: { data: collectionDates },
645
+ idempotent: true,
646
+ method: "GET",
647
+ operationId: "getCollection",
648
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
649
+ retry: options?.retry,
650
+ serverBudgetMs: 3e4,
651
+ signal: options?.signal,
652
+ surface: "rest",
653
+ timeoutMs: options?.timeoutMs
654
+ });
655
+ const getCollectionItineraries = (transport, args, options) => transport.request({
656
+ acceptsShareToken: true,
657
+ dates: { data: [itineraryDates] },
658
+ idempotent: true,
659
+ method: "GET",
660
+ operationId: "getCollectionItineraries",
661
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries`,
662
+ query: args.query,
663
+ retry: options?.retry,
664
+ serverBudgetMs: 3e4,
665
+ signal: options?.signal,
666
+ surface: "rest",
667
+ timeoutMs: options?.timeoutMs
668
+ });
669
+ const getCollections = (transport, args = {}, options) => transport.request({
670
+ dates: { data: [collectionDates] },
671
+ idempotent: true,
672
+ method: "GET",
673
+ operationId: "getCollections",
674
+ path: "/v1/collections",
675
+ query: args.query,
676
+ retry: options?.retry,
677
+ serverBudgetMs: 3e4,
678
+ signal: options?.signal,
679
+ surface: "rest",
680
+ timeoutMs: options?.timeoutMs
681
+ });
682
+ const getCollectionShareLink = (transport, args, options) => transport.request({
683
+ actsAsMember: true,
684
+ dates: { data: shareLinkDates },
685
+ idempotent: true,
686
+ method: "GET",
687
+ operationId: "getCollectionShareLink",
688
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
689
+ requiresSession: true,
690
+ retry: options?.retry,
691
+ serverBudgetMs: 3e4,
692
+ signal: options?.signal,
693
+ surface: "rest",
694
+ timeoutMs: options?.timeoutMs
695
+ });
696
+ const getCollectionZones = (transport, args, options) => transport.request({
697
+ acceptsShareToken: true,
698
+ dates: { data: [zoneDates] },
699
+ idempotent: true,
700
+ method: "GET",
701
+ operationId: "getCollectionZones",
702
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones`,
703
+ query: args.query,
704
+ retry: options?.retry,
705
+ serverBudgetMs: 3e4,
706
+ signal: options?.signal,
707
+ surface: "rest",
708
+ timeoutMs: options?.timeoutMs
709
+ });
710
+ const getItineraries = (transport, args = {}, options) => transport.request({
711
+ dates: { data: [itineraryDates] },
712
+ idempotent: true,
713
+ method: "GET",
714
+ operationId: "getItineraries",
715
+ path: "/v1/itineraries",
716
+ query: args.query,
717
+ retry: options?.retry,
718
+ serverBudgetMs: 3e4,
719
+ signal: options?.signal,
720
+ surface: "rest",
721
+ timeoutMs: options?.timeoutMs
722
+ });
723
+ const getItinerary = (transport, args, options) => transport.request({
724
+ acceptsShareToken: true,
725
+ dates: { data: itineraryWithDetailsDates },
726
+ idempotent: true,
727
+ method: "GET",
728
+ operationId: "getItinerary",
729
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
730
+ query: args.query,
731
+ retry: options?.retry,
732
+ serverBudgetMs: 3e4,
733
+ signal: options?.signal,
734
+ surface: "rest",
735
+ timeoutMs: options?.timeoutMs
736
+ });
737
+ const getItineraryEvents = (transport, args, options) => transport.requestBinary({
738
+ accept: "text/event-stream",
739
+ actsAsMember: true,
740
+ idempotent: true,
741
+ method: "GET",
742
+ operationId: "getItineraryEvents",
743
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/events`,
744
+ requiresSession: true,
745
+ retry: options?.retry,
746
+ signal: options?.signal,
747
+ surface: "rest",
748
+ timeoutMs: options?.timeoutMs
749
+ });
750
+ const getItineraryExport = (transport, args, options) => transport.requestBinary({
751
+ accept: "application/gpx+xml, application/geo+json, application/vnd.google-earth.kml+xml, application/vnd.google-earth.kmz, application/vnd.ant.fit, application/vnd.garmin.tcx+xml, text/csv",
752
+ acceptsShareToken: true,
753
+ idempotent: true,
754
+ method: "GET",
755
+ operationId: "getItineraryExport",
756
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/export`,
757
+ query: args.query,
758
+ retry: options?.retry,
759
+ serverBudgetMs: 3e4,
760
+ signal: options?.signal,
761
+ surface: "rest",
762
+ timeoutMs: options?.timeoutMs
763
+ });
764
+ const getItineraryPace = (transport, args, options) => transport.request({
765
+ acceptsShareToken: true,
766
+ idempotent: true,
767
+ method: "GET",
768
+ operationId: "getItineraryPace",
769
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/pace`,
770
+ query: args.query,
771
+ retry: options?.retry,
772
+ serverBudgetMs: 3e4,
773
+ signal: options?.signal,
774
+ surface: "rest",
775
+ timeoutMs: options?.timeoutMs
776
+ });
777
+ const getItineraryShareLink = (transport, args, options) => transport.request({
778
+ actsAsMember: true,
779
+ dates: { data: shareLinkDates },
780
+ idempotent: true,
781
+ method: "GET",
782
+ operationId: "getItineraryShareLink",
783
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
784
+ requiresSession: true,
785
+ retry: options?.retry,
786
+ serverBudgetMs: 3e4,
787
+ signal: options?.signal,
788
+ surface: "rest",
789
+ timeoutMs: options?.timeoutMs
790
+ });
791
+ const getLayers = (transport, args = {}, options) => transport.request({
792
+ acceptsShareToken: true,
793
+ idempotent: true,
794
+ method: "GET",
795
+ operationId: "getLayers",
796
+ path: "/v1/layers",
797
+ query: args.query,
798
+ retry: options?.retry,
799
+ serverBudgetMs: 3e4,
800
+ signal: options?.signal,
801
+ surface: "rest",
802
+ timeoutMs: options?.timeoutMs
803
+ });
804
+ const getMyInvitations = (transport, args = {}, options) => transport.request({
805
+ actsAsMember: true,
806
+ dates: { data: [userInvitationDates] },
807
+ idempotent: true,
808
+ method: "GET",
809
+ operationId: "getMyInvitations",
810
+ path: "/v1/me/invitations",
811
+ query: args.query,
812
+ requiresSession: true,
813
+ retry: options?.retry,
814
+ serverBudgetMs: 3e4,
815
+ signal: options?.signal,
816
+ surface: "rest",
817
+ timeoutMs: options?.timeoutMs
818
+ });
819
+ const getMyOrganizationNotificationPreferences = (transport, args, options) => transport.request({
820
+ actsAsMember: true,
821
+ idempotent: true,
822
+ method: "GET",
823
+ operationId: "getMyOrganizationNotificationPreferences",
824
+ path: `/v1/me/organizations/${encodeURIComponent(String(args.organization_id))}/notification-preferences`,
825
+ requiresSession: true,
826
+ retry: options?.retry,
827
+ serverBudgetMs: 3e4,
828
+ signal: options?.signal,
829
+ surface: "rest",
830
+ timeoutMs: options?.timeoutMs
831
+ });
832
+ const getMyOrganizations = (transport, args = {}, options) => transport.request({
833
+ actsAsMember: true,
834
+ dates: { data: [membershipDates] },
835
+ idempotent: true,
836
+ method: "GET",
837
+ operationId: "getMyOrganizations",
838
+ path: "/v1/me/organizations",
839
+ query: args.query,
840
+ requiresSession: true,
841
+ retry: options?.retry,
842
+ serverBudgetMs: 3e4,
843
+ signal: options?.signal,
844
+ surface: "rest",
845
+ timeoutMs: options?.timeoutMs
846
+ });
847
+ const getMyPreferences = (transport, options) => transport.request({
848
+ actsAsMember: true,
849
+ idempotent: true,
850
+ method: "GET",
851
+ operationId: "getMyPreferences",
852
+ path: "/v1/me/preferences",
853
+ requiresSession: true,
854
+ retry: options?.retry,
855
+ serverBudgetMs: 3e4,
856
+ signal: options?.signal,
857
+ surface: "rest",
858
+ timeoutMs: options?.timeoutMs
859
+ });
860
+ const getOrganization = (transport, args, options) => transport.request({
861
+ acceptsShareToken: true,
862
+ dates: { data: organizationDates },
863
+ idempotent: true,
864
+ method: "GET",
865
+ operationId: "getOrganization",
866
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}`,
867
+ retry: options?.retry,
868
+ serverBudgetMs: 3e4,
869
+ signal: options?.signal,
870
+ surface: "rest",
871
+ timeoutMs: options?.timeoutMs
872
+ });
873
+ const getOrganizationAiProviderConfig = (transport, args, options) => transport.request({
874
+ idempotent: true,
875
+ method: "GET",
876
+ operationId: "getOrganizationAiProviderConfig",
877
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
878
+ requiresSession: true,
879
+ retry: options?.retry,
880
+ serverBudgetMs: 3e4,
881
+ signal: options?.signal,
882
+ surface: "rest",
883
+ timeoutMs: options?.timeoutMs
884
+ });
885
+ const getOrganizationBillingInfo = (transport, args, options) => transport.request({
886
+ idempotent: true,
887
+ method: "GET",
888
+ operationId: "getOrganizationBillingInfo",
889
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/info`,
890
+ requiresSession: true,
891
+ retry: options?.retry,
892
+ serverBudgetMs: 3e4,
893
+ signal: options?.signal,
894
+ surface: "rest",
895
+ timeoutMs: options?.timeoutMs
896
+ });
897
+ const getOrganizationBillingInvoices = (transport, args, options) => transport.request({
898
+ dates: { data: [invoiceDates] },
899
+ idempotent: true,
900
+ method: "GET",
901
+ operationId: "getOrganizationBillingInvoices",
902
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/invoices`,
903
+ query: args.query,
904
+ requiresSession: true,
905
+ retry: options?.retry,
906
+ serverBudgetMs: 3e4,
907
+ signal: options?.signal,
908
+ surface: "rest",
909
+ timeoutMs: options?.timeoutMs
910
+ });
911
+ const getOrganizationBillingPaymentMethods = (transport, args, options) => transport.request({
912
+ idempotent: true,
913
+ method: "GET",
914
+ operationId: "getOrganizationBillingPaymentMethods",
915
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods`,
916
+ query: args.query,
917
+ requiresSession: true,
918
+ retry: options?.retry,
919
+ serverBudgetMs: 3e4,
920
+ signal: options?.signal,
921
+ surface: "rest",
922
+ timeoutMs: options?.timeoutMs
923
+ });
924
+ const getOrganizationBillingPromotionCode = (transport, args, options) => transport.request({
925
+ idempotent: true,
926
+ method: "GET",
927
+ operationId: "getOrganizationBillingPromotionCode",
928
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/promotion-codes/${encodeURIComponent(String(args.code))}`,
929
+ requiresSession: true,
930
+ retry: options?.retry,
931
+ serverBudgetMs: 3e4,
932
+ signal: options?.signal,
933
+ surface: "rest",
934
+ timeoutMs: options?.timeoutMs
935
+ });
936
+ const getOrganizationBillingSubscription = (transport, args, options) => transport.request({
937
+ dates: { data: organizationSubscriptionSummaryDates },
938
+ idempotent: true,
939
+ method: "GET",
940
+ operationId: "getOrganizationBillingSubscription",
941
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
942
+ requiresSession: true,
943
+ retry: options?.retry,
944
+ serverBudgetMs: 3e4,
945
+ signal: options?.signal,
946
+ surface: "rest",
947
+ timeoutMs: options?.timeoutMs
948
+ });
949
+ const getOrganizationEvents = (transport, args, options) => transport.requestBinary({
950
+ accept: "text/event-stream",
951
+ actsAsMember: true,
952
+ idempotent: true,
953
+ method: "GET",
954
+ operationId: "getOrganizationEvents",
955
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/events`,
956
+ requiresSession: true,
957
+ retry: options?.retry,
958
+ signal: options?.signal,
959
+ surface: "rest",
960
+ timeoutMs: options?.timeoutMs
961
+ });
962
+ const getOrganizationInvitation = (transport, args, options) => transport.request({
963
+ dates: { data: organizationInvitationDates },
964
+ idempotent: true,
965
+ method: "GET",
966
+ operationId: "getOrganizationInvitation",
967
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations/${encodeURIComponent(String(args.invitation_id))}`,
968
+ requiresSession: true,
969
+ retry: options?.retry,
970
+ serverBudgetMs: 3e4,
971
+ signal: options?.signal,
972
+ surface: "rest",
973
+ timeoutMs: options?.timeoutMs
974
+ });
975
+ const getOrganizationInvitations = (transport, args, options) => transport.request({
976
+ dates: { data: [organizationInvitationDates] },
977
+ idempotent: true,
978
+ method: "GET",
979
+ operationId: "getOrganizationInvitations",
980
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations`,
981
+ query: args.query,
982
+ requiresSession: true,
983
+ retry: options?.retry,
984
+ serverBudgetMs: 3e4,
985
+ signal: options?.signal,
986
+ surface: "rest",
987
+ timeoutMs: options?.timeoutMs
988
+ });
989
+ const getOrganizationMembers = (transport, args, options) => transport.request({
990
+ dates: { data: [organizationMemberDates] },
991
+ idempotent: true,
992
+ method: "GET",
993
+ operationId: "getOrganizationMembers",
994
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members`,
995
+ query: args.query,
996
+ requiresSession: true,
997
+ retry: options?.retry,
998
+ serverBudgetMs: 3e4,
999
+ signal: options?.signal,
1000
+ surface: "rest",
1001
+ timeoutMs: options?.timeoutMs
1002
+ });
1003
+ const getOrganizationPublishableKey = (transport, args, options) => transport.request({
1004
+ dates: { data: publishableKeyDates },
1005
+ idempotent: true,
1006
+ method: "GET",
1007
+ operationId: "getOrganizationPublishableKey",
1008
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
1009
+ requiresSession: true,
1010
+ retry: options?.retry,
1011
+ serverBudgetMs: 3e4,
1012
+ signal: options?.signal,
1013
+ surface: "rest",
1014
+ timeoutMs: options?.timeoutMs
1015
+ });
1016
+ const getOrganizationPublishableKeys = (transport, args, options) => transport.request({
1017
+ dates: { data: [publishableKeyDates] },
1018
+ idempotent: true,
1019
+ method: "GET",
1020
+ operationId: "getOrganizationPublishableKeys",
1021
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys`,
1022
+ query: args.query,
1023
+ requiresSession: true,
1024
+ retry: options?.retry,
1025
+ serverBudgetMs: 3e4,
1026
+ signal: options?.signal,
1027
+ surface: "rest",
1028
+ timeoutMs: options?.timeoutMs
1029
+ });
1030
+ const getOrganizationSettings = (transport, args, options) => transport.request({
1031
+ idempotent: true,
1032
+ method: "GET",
1033
+ operationId: "getOrganizationSettings",
1034
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/settings`,
1035
+ requiresSession: true,
1036
+ retry: options?.retry,
1037
+ serverBudgetMs: 3e4,
1038
+ signal: options?.signal,
1039
+ surface: "rest",
1040
+ timeoutMs: options?.timeoutMs
1041
+ });
1042
+ const getOrganizationUsageData = (transport, args, options) => transport.request({
1043
+ idempotent: true,
1044
+ method: "GET",
1045
+ operationId: "getOrganizationUsageData",
1046
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/usage/data`,
1047
+ query: args.query,
1048
+ requiresSession: true,
1049
+ retry: options?.retry,
1050
+ serverBudgetMs: 3e4,
1051
+ signal: options?.signal,
1052
+ surface: "rest",
1053
+ timeoutMs: options?.timeoutMs
1054
+ });
1055
+ const getOrganizationUsageTiles = (transport, args, options) => transport.request({
1056
+ idempotent: true,
1057
+ method: "GET",
1058
+ operationId: "getOrganizationUsageTiles",
1059
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/usage/tiles`,
1060
+ query: args.query,
1061
+ requiresSession: true,
1062
+ retry: options?.retry,
1063
+ serverBudgetMs: 3e4,
1064
+ signal: options?.signal,
1065
+ surface: "rest",
1066
+ timeoutMs: options?.timeoutMs
1067
+ });
1068
+ const getOrganizationWebhookDeliveries = (transport, args, options) => transport.request({
1069
+ dates: { data: [webhookDeliveryDates] },
1070
+ idempotent: true,
1071
+ method: "GET",
1072
+ operationId: "getOrganizationWebhookDeliveries",
1073
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries`,
1074
+ query: args.query,
1075
+ requiresSession: true,
1076
+ retry: options?.retry,
1077
+ serverBudgetMs: 3e4,
1078
+ signal: options?.signal,
1079
+ surface: "rest",
1080
+ timeoutMs: options?.timeoutMs
1081
+ });
1082
+ const getOrganizationWebhookDelivery = (transport, args, options) => transport.request({
1083
+ dates: { data: webhookDeliveryWithAttemptsDates },
1084
+ idempotent: true,
1085
+ method: "GET",
1086
+ operationId: "getOrganizationWebhookDelivery",
1087
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries/${encodeURIComponent(String(args.delivery_id))}`,
1088
+ requiresSession: true,
1089
+ retry: options?.retry,
1090
+ serverBudgetMs: 3e4,
1091
+ signal: options?.signal,
1092
+ surface: "rest",
1093
+ timeoutMs: options?.timeoutMs
1094
+ });
1095
+ const getOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
1096
+ dates: { data: webhookEndpointDates },
1097
+ idempotent: true,
1098
+ method: "GET",
1099
+ operationId: "getOrganizationWebhookEndpoint",
1100
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
1101
+ requiresSession: true,
1102
+ retry: options?.retry,
1103
+ serverBudgetMs: 3e4,
1104
+ signal: options?.signal,
1105
+ surface: "rest",
1106
+ timeoutMs: options?.timeoutMs
1107
+ });
1108
+ const getOrganizationWebhookEndpoints = (transport, args, options) => transport.request({
1109
+ dates: { data: [webhookEndpointDates] },
1110
+ idempotent: true,
1111
+ method: "GET",
1112
+ operationId: "getOrganizationWebhookEndpoints",
1113
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints`,
1114
+ query: args.query,
1115
+ requiresSession: true,
1116
+ retry: options?.retry,
1117
+ serverBudgetMs: 3e4,
1118
+ signal: options?.signal,
1119
+ surface: "rest",
1120
+ timeoutMs: options?.timeoutMs
1121
+ });
1122
+ const getOrganizationWebhookEvent = (transport, args, options) => transport.request({
1123
+ dates: { data: webhookEventWithDeliveriesDates },
1124
+ idempotent: true,
1125
+ method: "GET",
1126
+ operationId: "getOrganizationWebhookEvent",
1127
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-events/${encodeURIComponent(String(args.event_id))}`,
1128
+ requiresSession: true,
1129
+ retry: options?.retry,
1130
+ serverBudgetMs: 3e4,
1131
+ signal: options?.signal,
1132
+ surface: "rest",
1133
+ timeoutMs: options?.timeoutMs
1134
+ });
1135
+ const getOrganizationWebhookEvents = (transport, args, options) => transport.request({
1136
+ dates: { data: [webhookEventDates] },
1137
+ idempotent: true,
1138
+ method: "GET",
1139
+ operationId: "getOrganizationWebhookEvents",
1140
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-events`,
1141
+ query: args.query,
1142
+ requiresSession: true,
1143
+ retry: options?.retry,
1144
+ serverBudgetMs: 3e4,
1145
+ signal: options?.signal,
1146
+ surface: "rest",
1147
+ timeoutMs: options?.timeoutMs
1148
+ });
1149
+ const getOrganizationWebhookHealth = (transport, args, options) => transport.request({
1150
+ dates: { data: webhookHealthDates },
1151
+ idempotent: true,
1152
+ method: "GET",
1153
+ operationId: "getOrganizationWebhookHealth",
1154
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-health`,
1155
+ query: args.query,
1156
+ requiresSession: true,
1157
+ retry: options?.retry,
1158
+ serverBudgetMs: 3e4,
1159
+ signal: options?.signal,
1160
+ surface: "rest",
1161
+ timeoutMs: options?.timeoutMs
1162
+ });
1163
+ const getWebhookEventTypes = (transport, options) => transport.request({
1164
+ idempotent: true,
1165
+ method: "GET",
1166
+ operationId: "getWebhookEventTypes",
1167
+ path: "/v1/webhook-event-types",
1168
+ requiresSession: true,
1169
+ retry: options?.retry,
1170
+ serverBudgetMs: 3e4,
1171
+ signal: options?.signal,
1172
+ surface: "rest",
1173
+ timeoutMs: options?.timeoutMs
1174
+ });
1175
+ const getZone = (transport, args, options) => transport.request({
1176
+ acceptsShareToken: true,
1177
+ dates: { data: zoneDates },
1178
+ idempotent: true,
1179
+ method: "GET",
1180
+ operationId: "getZone",
1181
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
1182
+ query: args.query,
1183
+ retry: options?.retry,
1184
+ serverBudgetMs: 3e4,
1185
+ signal: options?.signal,
1186
+ surface: "rest",
1187
+ timeoutMs: options?.timeoutMs
1188
+ });
1189
+ const getZoneEvents = (transport, args, options) => transport.requestBinary({
1190
+ accept: "text/event-stream",
1191
+ actsAsMember: true,
1192
+ idempotent: true,
1193
+ method: "GET",
1194
+ operationId: "getZoneEvents",
1195
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/events`,
1196
+ requiresSession: true,
1197
+ retry: options?.retry,
1198
+ signal: options?.signal,
1199
+ surface: "rest",
1200
+ timeoutMs: options?.timeoutMs
1201
+ });
1202
+ const getZones = (transport, args = {}, options) => transport.request({
1203
+ dates: { data: [zoneDates] },
1204
+ idempotent: true,
1205
+ method: "GET",
1206
+ operationId: "getZones",
1207
+ path: "/v1/zones",
1208
+ query: args.query,
1209
+ retry: options?.retry,
1210
+ serverBudgetMs: 3e4,
1211
+ signal: options?.signal,
1212
+ surface: "rest",
1213
+ timeoutMs: options?.timeoutMs
1214
+ });
1215
+ const patchCollection = (transport, args, options) => transport.request({
1216
+ actsAsMember: true,
1217
+ body: args.body,
1218
+ dates: { data: collectionDates },
1219
+ idempotencyKey: args.idempotencyKey,
1220
+ idempotent: true,
1221
+ ifMatch: args.ifMatch,
1222
+ method: "PATCH",
1223
+ operationId: "patchCollection",
1224
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
1225
+ requiresSession: true,
1226
+ retry: options?.retry,
1227
+ serverBudgetMs: 3e4,
1228
+ signal: options?.signal,
1229
+ surface: "rest",
1230
+ takesIdempotencyKey: true,
1231
+ timeoutMs: options?.timeoutMs
1232
+ });
1233
+ const patchCollectionItinerary = (transport, args, options) => transport.request({
1234
+ actsAsMember: true,
1235
+ body: args.body,
1236
+ dates: { data: collectionDates },
1237
+ idempotencyKey: args.idempotencyKey,
1238
+ idempotent: true,
1239
+ ifMatch: args.ifMatch,
1240
+ method: "PATCH",
1241
+ operationId: "patchCollectionItinerary",
1242
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
1243
+ requiresSession: true,
1244
+ retry: options?.retry,
1245
+ serverBudgetMs: 3e4,
1246
+ signal: options?.signal,
1247
+ surface: "rest",
1248
+ takesIdempotencyKey: true,
1249
+ timeoutMs: options?.timeoutMs
1250
+ });
1251
+ const patchItinerary = (transport, args, options) => transport.request({
1252
+ actsAsMember: true,
1253
+ body: args.body,
1254
+ dates: { data: itineraryWithDetailsDates },
1255
+ idempotencyKey: args.idempotencyKey,
1256
+ idempotent: true,
1257
+ ifMatch: args.ifMatch,
1258
+ method: "PATCH",
1259
+ operationId: "patchItinerary",
1260
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
1261
+ requiresSession: true,
1262
+ retry: options?.retry,
1263
+ serverBudgetMs: 3e4,
1264
+ signal: options?.signal,
1265
+ surface: "rest",
1266
+ takesIdempotencyKey: true,
1267
+ timeoutMs: options?.timeoutMs
1268
+ });
1269
+ const patchItinerarySegment = (transport, args, options) => transport.request({
1270
+ actsAsMember: true,
1271
+ body: args.body,
1272
+ dates: { data: itineraryWithDetailsDates },
1273
+ idempotencyKey: args.idempotencyKey,
1274
+ idempotent: true,
1275
+ ifMatch: args.ifMatch,
1276
+ method: "PATCH",
1277
+ operationId: "patchItinerarySegment",
1278
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}`,
1279
+ requiresSession: true,
1280
+ retry: options?.retry,
1281
+ serverBudgetMs: 3e4,
1282
+ signal: options?.signal,
1283
+ surface: "rest",
1284
+ takesIdempotencyKey: true,
1285
+ timeoutMs: options?.timeoutMs
1286
+ });
1287
+ const patchItinerarySegmentGroup = (transport, args, options) => transport.request({
1288
+ actsAsMember: true,
1289
+ body: args.body,
1290
+ dates: { data: itineraryWithDetailsDates },
1291
+ idempotencyKey: args.idempotencyKey,
1292
+ idempotent: true,
1293
+ ifMatch: args.ifMatch,
1294
+ method: "PATCH",
1295
+ operationId: "patchItinerarySegmentGroup",
1296
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups/${encodeURIComponent(String(args.group_id))}`,
1297
+ requiresSession: true,
1298
+ retry: options?.retry,
1299
+ serverBudgetMs: 3e4,
1300
+ signal: options?.signal,
1301
+ surface: "rest",
1302
+ takesIdempotencyKey: true,
1303
+ timeoutMs: options?.timeoutMs
1304
+ });
1305
+ const patchItineraryWaypoint = (transport, args, options) => transport.request({
1306
+ actsAsMember: true,
1307
+ body: args.body,
1308
+ dates: { data: itineraryWithDetailsDates },
1309
+ idempotencyKey: args.idempotencyKey,
1310
+ idempotent: true,
1311
+ ifMatch: args.ifMatch,
1312
+ method: "PATCH",
1313
+ operationId: "patchItineraryWaypoint",
1314
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints/${encodeURIComponent(String(args.waypoint_id))}`,
1315
+ requiresSession: true,
1316
+ retry: options?.retry,
1317
+ serverBudgetMs: 3e4,
1318
+ signal: options?.signal,
1319
+ surface: "rest",
1320
+ takesIdempotencyKey: true,
1321
+ timeoutMs: options?.timeoutMs
1322
+ });
1323
+ const patchMyOrganizationNotificationPreferences = (transport, args, options) => transport.request({
1324
+ actsAsMember: true,
1325
+ body: args.body,
1326
+ idempotencyKey: args.idempotencyKey,
1327
+ idempotent: true,
1328
+ method: "PATCH",
1329
+ operationId: "patchMyOrganizationNotificationPreferences",
1330
+ path: `/v1/me/organizations/${encodeURIComponent(String(args.organization_id))}/notification-preferences`,
1331
+ requiresSession: true,
1332
+ retry: options?.retry,
1333
+ serverBudgetMs: 3e4,
1334
+ signal: options?.signal,
1335
+ surface: "rest",
1336
+ takesIdempotencyKey: true,
1337
+ timeoutMs: options?.timeoutMs
1338
+ });
1339
+ const patchMyPreferences = (transport, args, options) => transport.request({
1340
+ actsAsMember: true,
1341
+ body: args.body,
1342
+ idempotencyKey: args.idempotencyKey,
1343
+ idempotent: true,
1344
+ method: "PATCH",
1345
+ operationId: "patchMyPreferences",
1346
+ path: "/v1/me/preferences",
1347
+ requiresSession: true,
1348
+ retry: options?.retry,
1349
+ serverBudgetMs: 3e4,
1350
+ signal: options?.signal,
1351
+ surface: "rest",
1352
+ takesIdempotencyKey: true,
1353
+ timeoutMs: options?.timeoutMs
1354
+ });
1355
+ const patchOrganization = (transport, args, options) => transport.request({
1356
+ actsAsMember: true,
1357
+ body: args.body,
1358
+ dates: { data: organizationDates },
1359
+ idempotencyKey: args.idempotencyKey,
1360
+ idempotent: true,
1361
+ ifMatch: args.ifMatch,
1362
+ method: "PATCH",
1363
+ operationId: "patchOrganization",
1364
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}`,
1365
+ requiresSession: true,
1366
+ retry: options?.retry,
1367
+ serverBudgetMs: 3e4,
1368
+ signal: options?.signal,
1369
+ surface: "rest",
1370
+ takesIdempotencyKey: true,
1371
+ timeoutMs: options?.timeoutMs
1372
+ });
1373
+ const patchOrganizationAiProviderConfig = (transport, args, options) => transport.request({
1374
+ actsAsMember: true,
1375
+ body: args.body,
1376
+ idempotencyKey: args.idempotencyKey,
1377
+ idempotent: true,
1378
+ ifMatch: args.ifMatch,
1379
+ method: "PATCH",
1380
+ operationId: "patchOrganizationAiProviderConfig",
1381
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
1382
+ requiresSession: true,
1383
+ retry: options?.retry,
1384
+ serverBudgetMs: 3e4,
1385
+ signal: options?.signal,
1386
+ surface: "rest",
1387
+ takesIdempotencyKey: true,
1388
+ timeoutMs: options?.timeoutMs
1389
+ });
1390
+ const patchOrganizationBillingInfo = (transport, args, options) => transport.request({
1391
+ actsAsMember: true,
1392
+ body: args.body,
1393
+ idempotencyKey: args.idempotencyKey,
1394
+ idempotent: true,
1395
+ method: "PATCH",
1396
+ operationId: "patchOrganizationBillingInfo",
1397
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/info`,
1398
+ requiresSession: true,
1399
+ retry: options?.retry,
1400
+ serverBudgetMs: 3e4,
1401
+ signal: options?.signal,
1402
+ surface: "rest",
1403
+ takesIdempotencyKey: true,
1404
+ timeoutMs: options?.timeoutMs
1405
+ });
1406
+ const patchOrganizationMember = (transport, args, options) => transport.request({
1407
+ actsAsMember: true,
1408
+ body: args.body,
1409
+ dates: { data: organizationMemberDates },
1410
+ idempotencyKey: args.idempotencyKey,
1411
+ idempotent: true,
1412
+ method: "PATCH",
1413
+ operationId: "patchOrganizationMember",
1414
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members/${encodeURIComponent(String(args.user_id))}`,
1415
+ requiresSession: true,
1416
+ retry: options?.retry,
1417
+ serverBudgetMs: 3e4,
1418
+ signal: options?.signal,
1419
+ surface: "rest",
1420
+ takesIdempotencyKey: true,
1421
+ timeoutMs: options?.timeoutMs
1422
+ });
1423
+ const patchOrganizationPublishableKey = (transport, args, options) => transport.request({
1424
+ actsAsMember: true,
1425
+ body: args.body,
1426
+ dates: { data: publishableKeyDates },
1427
+ idempotencyKey: args.idempotencyKey,
1428
+ idempotent: true,
1429
+ ifMatch: args.ifMatch,
1430
+ method: "PATCH",
1431
+ operationId: "patchOrganizationPublishableKey",
1432
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
1433
+ requiresSession: true,
1434
+ retry: options?.retry,
1435
+ serverBudgetMs: 3e4,
1436
+ signal: options?.signal,
1437
+ surface: "rest",
1438
+ takesIdempotencyKey: true,
1439
+ timeoutMs: options?.timeoutMs
1440
+ });
1441
+ const patchOrganizationSettings = (transport, args, options) => transport.request({
1442
+ actsAsMember: true,
1443
+ body: args.body,
1444
+ idempotencyKey: args.idempotencyKey,
1445
+ idempotent: true,
1446
+ ifMatch: args.ifMatch,
1447
+ method: "PATCH",
1448
+ operationId: "patchOrganizationSettings",
1449
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/settings`,
1450
+ requiresSession: true,
1451
+ retry: options?.retry,
1452
+ serverBudgetMs: 3e4,
1453
+ signal: options?.signal,
1454
+ surface: "rest",
1455
+ takesIdempotencyKey: true,
1456
+ timeoutMs: options?.timeoutMs
1457
+ });
1458
+ const patchOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
1459
+ actsAsMember: true,
1460
+ body: args.body,
1461
+ dates: { data: webhookEndpointDates },
1462
+ idempotencyKey: args.idempotencyKey,
1463
+ idempotent: true,
1464
+ ifMatch: args.ifMatch,
1465
+ method: "PATCH",
1466
+ operationId: "patchOrganizationWebhookEndpoint",
1467
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
1468
+ requiresSession: true,
1469
+ retry: options?.retry,
1470
+ serverBudgetMs: 3e4,
1471
+ signal: options?.signal,
1472
+ surface: "rest",
1473
+ takesIdempotencyKey: true,
1474
+ timeoutMs: options?.timeoutMs
1475
+ });
1476
+ const patchZone = (transport, args, options) => transport.request({
1477
+ actsAsMember: true,
1478
+ body: args.body,
1479
+ dates: { data: zoneDates },
1480
+ idempotencyKey: args.idempotencyKey,
1481
+ idempotent: true,
1482
+ ifMatch: args.ifMatch,
1483
+ method: "PATCH",
1484
+ operationId: "patchZone",
1485
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
1486
+ requiresSession: true,
1487
+ retry: options?.retry,
1488
+ serverBudgetMs: 3e4,
1489
+ signal: options?.signal,
1490
+ surface: "rest",
1491
+ takesIdempotencyKey: true,
1492
+ timeoutMs: options?.timeoutMs
1493
+ });
1494
+ const postAgentRun = (transport, args, options) => transport.request({
1495
+ actsAsMember: true,
1496
+ body: args.body,
1497
+ dates: { data: agentRunDates },
1498
+ idempotencyKey: args.idempotencyKey,
1499
+ idempotent: false,
1500
+ method: "POST",
1501
+ operationId: "postAgentRun",
1502
+ path: "/v1/agent/runs",
1503
+ requiresSession: true,
1504
+ retry: options?.retry,
1505
+ serverBudgetMs: 3e4,
1506
+ signal: options?.signal,
1507
+ surface: "rest",
1508
+ takesIdempotencyKey: true,
1509
+ timeoutMs: options?.timeoutMs
1510
+ });
1511
+ const postAgentRunFeedback = (transport, args, options) => transport.request({
1512
+ actsAsMember: true,
1513
+ body: args.body,
1514
+ idempotencyKey: args.idempotencyKey,
1515
+ idempotent: false,
1516
+ method: "POST",
1517
+ operationId: "postAgentRunFeedback",
1518
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/feedback`,
1519
+ requiresSession: true,
1520
+ retry: options?.retry,
1521
+ serverBudgetMs: 3e4,
1522
+ signal: options?.signal,
1523
+ surface: "rest",
1524
+ takesIdempotencyKey: true,
1525
+ timeoutMs: options?.timeoutMs
1526
+ });
1527
+ const postAgentRunInput = (transport, args, options) => transport.request({
1528
+ actsAsMember: true,
1529
+ body: args.body,
1530
+ idempotencyKey: args.idempotencyKey,
1531
+ idempotent: false,
1532
+ method: "POST",
1533
+ operationId: "postAgentRunInput",
1534
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/input`,
1535
+ requiresSession: true,
1536
+ retry: options?.retry,
1537
+ serverBudgetMs: 3e4,
1538
+ signal: options?.signal,
1539
+ surface: "rest",
1540
+ takesIdempotencyKey: true,
1541
+ timeoutMs: options?.timeoutMs
1542
+ });
1543
+ const postCollection = (transport, args, options) => transport.request({
1544
+ actsAsMember: true,
1545
+ body: args.body,
1546
+ dates: { data: collectionDates },
1547
+ idempotencyKey: args.idempotencyKey,
1548
+ idempotent: false,
1549
+ method: "POST",
1550
+ operationId: "postCollection",
1551
+ path: "/v1/collections",
1552
+ requiresSession: true,
1553
+ retry: options?.retry,
1554
+ serverBudgetMs: 3e4,
1555
+ signal: options?.signal,
1556
+ surface: "rest",
1557
+ takesIdempotencyKey: true,
1558
+ timeoutMs: options?.timeoutMs
1559
+ });
1560
+ const postCollectionItineraries = (transport, args, options) => transport.request({
1561
+ actsAsMember: true,
1562
+ body: args.body,
1563
+ dates: { data: collectionDates },
1564
+ idempotencyKey: args.idempotencyKey,
1565
+ idempotent: true,
1566
+ ifMatch: args.ifMatch,
1567
+ method: "POST",
1568
+ operationId: "postCollectionItineraries",
1569
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries`,
1570
+ requiresSession: true,
1571
+ retry: options?.retry,
1572
+ serverBudgetMs: 3e4,
1573
+ signal: options?.signal,
1574
+ surface: "rest",
1575
+ takesIdempotencyKey: true,
1576
+ timeoutMs: options?.timeoutMs
1577
+ });
1578
+ const postCollectionShareLink = (transport, args, options) => transport.request({
1579
+ actsAsMember: true,
1580
+ dates: { data: shareLinkDates },
1581
+ idempotencyKey: args.idempotencyKey,
1582
+ idempotent: true,
1583
+ method: "POST",
1584
+ operationId: "postCollectionShareLink",
1585
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
1586
+ requiresSession: true,
1587
+ retry: options?.retry,
1588
+ serverBudgetMs: 3e4,
1589
+ signal: options?.signal,
1590
+ surface: "rest",
1591
+ takesIdempotencyKey: true,
1592
+ timeoutMs: options?.timeoutMs
1593
+ });
1594
+ const postCollectionShareLinkRotate = (transport, args, options) => transport.request({
1595
+ actsAsMember: true,
1596
+ dates: { data: shareLinkDates },
1597
+ idempotencyKey: args.idempotencyKey,
1598
+ idempotent: false,
1599
+ method: "POST",
1600
+ operationId: "postCollectionShareLinkRotate",
1601
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link/rotate`,
1602
+ requiresSession: true,
1603
+ retry: options?.retry,
1604
+ serverBudgetMs: 3e4,
1605
+ signal: options?.signal,
1606
+ surface: "rest",
1607
+ takesIdempotencyKey: true,
1608
+ timeoutMs: options?.timeoutMs
1609
+ });
1610
+ const postCollectionZones = (transport, args, options) => transport.request({
1611
+ actsAsMember: true,
1612
+ body: args.body,
1613
+ dates: { data: collectionDates },
1614
+ idempotencyKey: args.idempotencyKey,
1615
+ idempotent: true,
1616
+ ifMatch: args.ifMatch,
1617
+ method: "POST",
1618
+ operationId: "postCollectionZones",
1619
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones`,
1620
+ requiresSession: true,
1621
+ retry: options?.retry,
1622
+ serverBudgetMs: 3e4,
1623
+ signal: options?.signal,
1624
+ surface: "rest",
1625
+ takesIdempotencyKey: true,
1626
+ timeoutMs: options?.timeoutMs
1627
+ });
1628
+ const postItinerary = (transport, args, options) => transport.request({
1629
+ actsAsMember: true,
1630
+ body: args.body,
1631
+ dates: { data: itineraryWithDetailsDates },
1632
+ idempotencyKey: args.idempotencyKey,
1633
+ idempotent: false,
1634
+ method: "POST",
1635
+ operationId: "postItinerary",
1636
+ path: "/v1/itineraries",
1637
+ requiresSession: true,
1638
+ retry: options?.retry,
1639
+ serverBudgetMs: 3e4,
1640
+ signal: options?.signal,
1641
+ surface: "rest",
1642
+ takesIdempotencyKey: true,
1643
+ timeoutMs: options?.timeoutMs
1644
+ });
1645
+ const postItineraryCollab = (transport, args, options) => transport.request({
1646
+ actsAsMember: true,
1647
+ body: args.body,
1648
+ idempotent: true,
1649
+ method: "POST",
1650
+ operationId: "postItineraryCollab",
1651
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/collab`,
1652
+ requiresSession: true,
1653
+ retry: options?.retry,
1654
+ serverBudgetMs: 3e4,
1655
+ signal: options?.signal,
1656
+ surface: "rest",
1657
+ timeoutMs: options?.timeoutMs
1658
+ });
1659
+ const postItineraryDuplicate = (transport, args, options) => transport.request({
1660
+ actsAsMember: true,
1661
+ body: args.body,
1662
+ dates: { data: itineraryWithDetailsDates },
1663
+ idempotencyKey: args.idempotencyKey,
1664
+ idempotent: false,
1665
+ method: "POST",
1666
+ operationId: "postItineraryDuplicate",
1667
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/duplicate`,
1668
+ query: args.query,
1669
+ requiresSession: true,
1670
+ retry: options?.retry,
1671
+ serverBudgetMs: 3e4,
1672
+ signal: options?.signal,
1673
+ surface: "rest",
1674
+ takesIdempotencyKey: true,
1675
+ timeoutMs: options?.timeoutMs
1676
+ });
1677
+ const postItineraryImport = (transport, args, options) => transport.request({
1678
+ actsAsMember: true,
1679
+ body: args.body,
1680
+ dates: { data: itineraryWithDetailsDates },
1681
+ idempotencyKey: args.idempotencyKey,
1682
+ idempotent: false,
1683
+ method: "POST",
1684
+ operationId: "postItineraryImport",
1685
+ path: "/v1/itineraries/import",
1686
+ requiresSession: true,
1687
+ retry: options?.retry,
1688
+ serverBudgetMs: 55e3,
1689
+ signal: options?.signal,
1690
+ surface: "rest",
1691
+ takesIdempotencyKey: true,
1692
+ timeoutMs: options?.timeoutMs
1693
+ });
1694
+ const postItineraryPreview = (transport, args, options) => transport.request({
1695
+ actsAsMember: true,
1696
+ body: args.body,
1697
+ idempotencyKey: args.idempotencyKey,
1698
+ idempotent: true,
1699
+ method: "POST",
1700
+ operationId: "postItineraryPreview",
1701
+ path: "/v1/itineraries/preview",
1702
+ requiresSession: true,
1703
+ retry: options?.retry,
1704
+ serverBudgetMs: 55e3,
1705
+ signal: options?.signal,
1706
+ surface: "rest",
1707
+ takesIdempotencyKey: true,
1708
+ timeoutMs: options?.timeoutMs
1709
+ });
1710
+ const postItineraryPublication = (transport, args, options) => transport.request({
1711
+ actsAsMember: true,
1712
+ dates: { data: itineraryWithDetailsDates },
1713
+ idempotencyKey: args.idempotencyKey,
1714
+ idempotent: true,
1715
+ ifMatch: args.ifMatch,
1716
+ method: "POST",
1717
+ operationId: "postItineraryPublication",
1718
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/publication`,
1719
+ requiresSession: true,
1720
+ retry: options?.retry,
1721
+ serverBudgetMs: 3e4,
1722
+ signal: options?.signal,
1723
+ surface: "rest",
1724
+ takesIdempotencyKey: true,
1725
+ timeoutMs: options?.timeoutMs
1726
+ });
1727
+ const postItinerarySegment = (transport, args, options) => transport.request({
1728
+ actsAsMember: true,
1729
+ body: args.body,
1730
+ dates: { data: itineraryWithDetailsDates },
1731
+ idempotencyKey: args.idempotencyKey,
1732
+ idempotent: false,
1733
+ ifMatch: args.ifMatch,
1734
+ method: "POST",
1735
+ operationId: "postItinerarySegment",
1736
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments`,
1737
+ requiresSession: true,
1738
+ retry: options?.retry,
1739
+ serverBudgetMs: 3e4,
1740
+ signal: options?.signal,
1741
+ surface: "rest",
1742
+ takesIdempotencyKey: true,
1743
+ timeoutMs: options?.timeoutMs
1744
+ });
1745
+ const postItinerarySegmentConvert = (transport, args, options) => transport.request({
1746
+ actsAsMember: true,
1747
+ body: args.body,
1748
+ dates: { data: itineraryWithDetailsDates },
1749
+ idempotencyKey: args.idempotencyKey,
1750
+ idempotent: true,
1751
+ ifMatch: args.ifMatch,
1752
+ method: "POST",
1753
+ operationId: "postItinerarySegmentConvert",
1754
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/convert`,
1755
+ requiresSession: true,
1756
+ retry: options?.retry,
1757
+ serverBudgetMs: 3e4,
1758
+ signal: options?.signal,
1759
+ surface: "rest",
1760
+ takesIdempotencyKey: true,
1761
+ timeoutMs: options?.timeoutMs
1762
+ });
1763
+ const postItinerarySegmentGroup = (transport, args, options) => transport.request({
1764
+ actsAsMember: true,
1765
+ body: args.body,
1766
+ dates: { data: itineraryWithDetailsDates },
1767
+ idempotencyKey: args.idempotencyKey,
1768
+ idempotent: false,
1769
+ ifMatch: args.ifMatch,
1770
+ method: "POST",
1771
+ operationId: "postItinerarySegmentGroup",
1772
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups`,
1773
+ requiresSession: true,
1774
+ retry: options?.retry,
1775
+ serverBudgetMs: 3e4,
1776
+ signal: options?.signal,
1777
+ surface: "rest",
1778
+ takesIdempotencyKey: true,
1779
+ timeoutMs: options?.timeoutMs
1780
+ });
1781
+ const postItinerarySegmentMerge = (transport, args, options) => transport.request({
1782
+ actsAsMember: true,
1783
+ dates: { data: itineraryWithDetailsDates },
1784
+ idempotencyKey: args.idempotencyKey,
1785
+ idempotent: false,
1786
+ ifMatch: args.ifMatch,
1787
+ method: "POST",
1788
+ operationId: "postItinerarySegmentMerge",
1789
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/merge`,
1790
+ requiresSession: true,
1791
+ retry: options?.retry,
1792
+ serverBudgetMs: 3e4,
1793
+ signal: options?.signal,
1794
+ surface: "rest",
1795
+ takesIdempotencyKey: true,
1796
+ timeoutMs: options?.timeoutMs
1797
+ });
1798
+ const postItinerarySegmentSplit = (transport, args, options) => transport.request({
1799
+ actsAsMember: true,
1800
+ body: args.body,
1801
+ dates: { data: itineraryWithDetailsDates },
1802
+ idempotencyKey: args.idempotencyKey,
1803
+ idempotent: false,
1804
+ ifMatch: args.ifMatch,
1805
+ method: "POST",
1806
+ operationId: "postItinerarySegmentSplit",
1807
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/split`,
1808
+ requiresSession: true,
1809
+ retry: options?.retry,
1810
+ serverBudgetMs: 3e4,
1811
+ signal: options?.signal,
1812
+ surface: "rest",
1813
+ takesIdempotencyKey: true,
1814
+ timeoutMs: options?.timeoutMs
1815
+ });
1816
+ const postItineraryShareLink = (transport, args, options) => transport.request({
1817
+ actsAsMember: true,
1818
+ dates: { data: shareLinkDates },
1819
+ idempotencyKey: args.idempotencyKey,
1820
+ idempotent: true,
1821
+ method: "POST",
1822
+ operationId: "postItineraryShareLink",
1823
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
1824
+ requiresSession: true,
1825
+ retry: options?.retry,
1826
+ serverBudgetMs: 3e4,
1827
+ signal: options?.signal,
1828
+ surface: "rest",
1829
+ takesIdempotencyKey: true,
1830
+ timeoutMs: options?.timeoutMs
1831
+ });
1832
+ const postItineraryShareLinkRotate = (transport, args, options) => transport.request({
1833
+ actsAsMember: true,
1834
+ dates: { data: shareLinkDates },
1835
+ idempotencyKey: args.idempotencyKey,
1836
+ idempotent: false,
1837
+ method: "POST",
1838
+ operationId: "postItineraryShareLinkRotate",
1839
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link/rotate`,
1840
+ requiresSession: true,
1841
+ retry: options?.retry,
1842
+ serverBudgetMs: 3e4,
1843
+ signal: options?.signal,
1844
+ surface: "rest",
1845
+ takesIdempotencyKey: true,
1846
+ timeoutMs: options?.timeoutMs
1847
+ });
1848
+ const postItineraryWaypoint = (transport, args, options) => transport.request({
1849
+ actsAsMember: true,
1850
+ body: args.body,
1851
+ dates: { data: itineraryWithDetailsDates },
1852
+ idempotencyKey: args.idempotencyKey,
1853
+ idempotent: false,
1854
+ ifMatch: args.ifMatch,
1855
+ method: "POST",
1856
+ operationId: "postItineraryWaypoint",
1857
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints`,
1858
+ requiresSession: true,
1859
+ retry: options?.retry,
1860
+ serverBudgetMs: 3e4,
1861
+ signal: options?.signal,
1862
+ surface: "rest",
1863
+ takesIdempotencyKey: true,
1864
+ timeoutMs: options?.timeoutMs
1865
+ });
1866
+ const postMyInvitationAccept = (transport, args, options) => transport.request({
1867
+ actsAsMember: true,
1868
+ dates: { data: membershipDates },
1869
+ idempotencyKey: args.idempotencyKey,
1870
+ idempotent: true,
1871
+ method: "POST",
1872
+ operationId: "postMyInvitationAccept",
1873
+ path: `/v1/me/invitations/${encodeURIComponent(String(args.invitation_id))}/accept`,
1874
+ requiresSession: true,
1875
+ retry: options?.retry,
1876
+ serverBudgetMs: 3e4,
1877
+ signal: options?.signal,
1878
+ surface: "rest",
1879
+ takesIdempotencyKey: true,
1880
+ timeoutMs: options?.timeoutMs
1881
+ });
1882
+ const postOrganization = (transport, args, options) => transport.request({
1883
+ actsAsMember: true,
1884
+ body: args.body,
1885
+ dates: { data: organizationDates },
1886
+ idempotencyKey: args.idempotencyKey,
1887
+ idempotent: false,
1888
+ method: "POST",
1889
+ operationId: "postOrganization",
1890
+ path: "/v1/organizations",
1891
+ requiresSession: true,
1892
+ retry: options?.retry,
1893
+ serverBudgetMs: 3e4,
1894
+ signal: options?.signal,
1895
+ surface: "rest",
1896
+ takesIdempotencyKey: true,
1897
+ timeoutMs: options?.timeoutMs
1898
+ });
1899
+ const postOrganizationAiProviderConfig = (transport, args, options) => transport.request({
1900
+ actsAsMember: true,
1901
+ body: args.body,
1902
+ idempotencyKey: args.idempotencyKey,
1903
+ idempotent: false,
1904
+ method: "POST",
1905
+ operationId: "postOrganizationAiProviderConfig",
1906
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
1907
+ requiresSession: true,
1908
+ retry: options?.retry,
1909
+ serverBudgetMs: 3e4,
1910
+ signal: options?.signal,
1911
+ surface: "rest",
1912
+ takesIdempotencyKey: true,
1913
+ timeoutMs: options?.timeoutMs
1914
+ });
1915
+ const postOrganizationBillingPaymentMethod = (transport, args, options) => transport.request({
1916
+ actsAsMember: true,
1917
+ body: args.body,
1918
+ idempotencyKey: args.idempotencyKey,
1919
+ idempotent: true,
1920
+ method: "POST",
1921
+ operationId: "postOrganizationBillingPaymentMethod",
1922
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods`,
1923
+ requiresSession: true,
1924
+ retry: options?.retry,
1925
+ serverBudgetMs: 3e4,
1926
+ signal: options?.signal,
1927
+ surface: "rest",
1928
+ takesIdempotencyKey: true,
1929
+ timeoutMs: options?.timeoutMs
1930
+ });
1931
+ const postOrganizationBillingPaymentMethodSetDefault = (transport, args, options) => transport.request({
1932
+ actsAsMember: true,
1933
+ idempotencyKey: args.idempotencyKey,
1934
+ idempotent: true,
1935
+ method: "POST",
1936
+ operationId: "postOrganizationBillingPaymentMethodSetDefault",
1937
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/${encodeURIComponent(String(args.payment_method_id))}/set-default`,
1938
+ requiresSession: true,
1939
+ retry: options?.retry,
1940
+ serverBudgetMs: 3e4,
1941
+ signal: options?.signal,
1942
+ surface: "rest",
1943
+ takesIdempotencyKey: true,
1944
+ timeoutMs: options?.timeoutMs
1945
+ });
1946
+ const postOrganizationBillingPaymentMethodSetup = (transport, args, options) => transport.request({
1947
+ actsAsMember: true,
1948
+ idempotencyKey: args.idempotencyKey,
1949
+ idempotent: false,
1950
+ method: "POST",
1951
+ operationId: "postOrganizationBillingPaymentMethodSetup",
1952
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/setup`,
1953
+ requiresSession: true,
1954
+ retry: options?.retry,
1955
+ serverBudgetMs: 3e4,
1956
+ signal: options?.signal,
1957
+ surface: "rest",
1958
+ takesIdempotencyKey: true,
1959
+ timeoutMs: options?.timeoutMs
1960
+ });
1961
+ const postOrganizationBillingProvision = (transport, args, options) => transport.request({
1962
+ actsAsMember: true,
1963
+ body: args.body,
1964
+ idempotencyKey: args.idempotencyKey,
1965
+ idempotent: true,
1966
+ method: "POST",
1967
+ operationId: "postOrganizationBillingProvision",
1968
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/provision`,
1969
+ requiresSession: true,
1970
+ retry: options?.retry,
1971
+ serverBudgetMs: 3e4,
1972
+ signal: options?.signal,
1973
+ surface: "rest",
1974
+ takesIdempotencyKey: true,
1975
+ timeoutMs: options?.timeoutMs
1976
+ });
1977
+ const postOrganizationBillingSubscription = (transport, args, options) => transport.request({
1978
+ actsAsMember: true,
1979
+ dates: { data: organizationSubscriptionSummaryDates },
1980
+ idempotencyKey: args.idempotencyKey,
1981
+ idempotent: true,
1982
+ method: "POST",
1983
+ operationId: "postOrganizationBillingSubscription",
1984
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
1985
+ requiresSession: true,
1986
+ retry: options?.retry,
1987
+ serverBudgetMs: 3e4,
1988
+ signal: options?.signal,
1989
+ surface: "rest",
1990
+ takesIdempotencyKey: true,
1991
+ timeoutMs: options?.timeoutMs
1992
+ });
1993
+ const postOrganizationInvitation = (transport, args, options) => transport.request({
1994
+ actsAsMember: true,
1995
+ body: args.body,
1996
+ dates: { data: organizationInvitationDates },
1997
+ idempotencyKey: args.idempotencyKey,
1998
+ idempotent: false,
1999
+ method: "POST",
2000
+ operationId: "postOrganizationInvitation",
2001
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations`,
2002
+ requiresSession: true,
2003
+ retry: options?.retry,
2004
+ serverBudgetMs: 3e4,
2005
+ signal: options?.signal,
2006
+ surface: "rest",
2007
+ takesIdempotencyKey: true,
2008
+ timeoutMs: options?.timeoutMs
2009
+ });
2010
+ const postOrganizationLookup = (transport, args, options) => transport.request({
2011
+ body: args.body,
2012
+ dates: { data: organizationDates },
2013
+ idempotent: true,
2014
+ method: "POST",
2015
+ operationId: "postOrganizationLookup",
2016
+ path: "/v1/organizations/lookup",
2017
+ retry: options?.retry,
2018
+ serverBudgetMs: 3e4,
2019
+ signal: options?.signal,
2020
+ surface: "rest",
2021
+ takesNoCredential: true,
2022
+ timeoutMs: options?.timeoutMs
2023
+ });
2024
+ const postOrganizationPublishableKey = (transport, args, options) => transport.request({
2025
+ actsAsMember: true,
2026
+ body: args.body,
2027
+ dates: { data: publishableKeyDates },
2028
+ idempotencyKey: args.idempotencyKey,
2029
+ idempotent: false,
2030
+ method: "POST",
2031
+ operationId: "postOrganizationPublishableKey",
2032
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys`,
2033
+ requiresSession: true,
2034
+ retry: options?.retry,
2035
+ serverBudgetMs: 3e4,
2036
+ signal: options?.signal,
2037
+ surface: "rest",
2038
+ takesIdempotencyKey: true,
2039
+ timeoutMs: options?.timeoutMs
2040
+ });
2041
+ const postOrganizationWebhookDelivery = (transport, args, options) => transport.request({
2042
+ actsAsMember: true,
2043
+ body: args.body,
2044
+ dates: { data: webhookDeliveryTriggerDates },
2045
+ idempotencyKey: args.idempotencyKey,
2046
+ idempotent: false,
2047
+ method: "POST",
2048
+ operationId: "postOrganizationWebhookDelivery",
2049
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries`,
2050
+ requiresSession: true,
2051
+ retry: options?.retry,
2052
+ serverBudgetMs: 3e4,
2053
+ signal: options?.signal,
2054
+ surface: "rest",
2055
+ takesIdempotencyKey: true,
2056
+ timeoutMs: options?.timeoutMs
2057
+ });
2058
+ const postOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
2059
+ actsAsMember: true,
2060
+ body: args.body,
2061
+ dates: { data: webhookEndpointWithSecretDates },
2062
+ idempotencyKey: args.idempotencyKey,
2063
+ idempotent: false,
2064
+ method: "POST",
2065
+ operationId: "postOrganizationWebhookEndpoint",
2066
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints`,
2067
+ requiresSession: true,
2068
+ retry: options?.retry,
2069
+ serverBudgetMs: 3e4,
2070
+ signal: options?.signal,
2071
+ surface: "rest",
2072
+ takesIdempotencyKey: true,
2073
+ timeoutMs: options?.timeoutMs
2074
+ });
2075
+ const postSession = (transport, args, options) => transport.request({
2076
+ body: args.body,
2077
+ dates: { data: sessionDates },
2078
+ idempotent: true,
2079
+ method: "POST",
2080
+ operationId: "postSession",
2081
+ path: "/v1/sessions",
2082
+ requiresSecretKey: true,
2083
+ retry: options?.retry,
2084
+ serverBudgetMs: 3e4,
2085
+ signal: options?.signal,
2086
+ surface: "rest",
2087
+ timeoutMs: options?.timeoutMs
2088
+ });
2089
+ const postZone = (transport, args, options) => transport.request({
2090
+ actsAsMember: true,
2091
+ body: args.body,
2092
+ dates: { data: zoneDates },
2093
+ idempotencyKey: args.idempotencyKey,
2094
+ idempotent: false,
2095
+ method: "POST",
2096
+ operationId: "postZone",
2097
+ path: "/v1/zones",
2098
+ requiresSession: true,
2099
+ retry: options?.retry,
2100
+ serverBudgetMs: 3e4,
2101
+ signal: options?.signal,
2102
+ surface: "rest",
2103
+ takesIdempotencyKey: true,
2104
+ timeoutMs: options?.timeoutMs
2105
+ });
2106
+ const postZoneCollab = (transport, args, options) => transport.request({
2107
+ actsAsMember: true,
2108
+ body: args.body,
2109
+ idempotent: true,
2110
+ method: "POST",
2111
+ operationId: "postZoneCollab",
2112
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/collab`,
2113
+ requiresSession: true,
2114
+ retry: options?.retry,
2115
+ serverBudgetMs: 3e4,
2116
+ signal: options?.signal,
2117
+ surface: "rest",
2118
+ timeoutMs: options?.timeoutMs
2119
+ });
2120
+ const postZonePublication = (transport, args, options) => transport.request({
2121
+ actsAsMember: true,
2122
+ dates: { data: zoneDates },
2123
+ idempotencyKey: args.idempotencyKey,
2124
+ idempotent: true,
2125
+ ifMatch: args.ifMatch,
2126
+ method: "POST",
2127
+ operationId: "postZonePublication",
2128
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/publication`,
2129
+ requiresSession: true,
2130
+ retry: options?.retry,
2131
+ serverBudgetMs: 3e4,
2132
+ signal: options?.signal,
2133
+ surface: "rest",
2134
+ takesIdempotencyKey: true,
2135
+ timeoutMs: options?.timeoutMs
2136
+ });
2137
+ const bind = (transport) => ({
2138
+ admin: {
2139
+ billing: {
2140
+ deleteOrganizationBillingPaymentMethod: (args, options) => deleteOrganizationBillingPaymentMethod(transport, args, options),
2141
+ deleteOrganizationBillingSubscription: (args, options) => deleteOrganizationBillingSubscription(transport, args, options),
2142
+ getBillingProducts: (options) => getBillingProducts(transport, options),
2143
+ getOrganizationBillingInfo: (args, options) => getOrganizationBillingInfo(transport, args, options),
2144
+ getOrganizationBillingInvoices: (args, options) => getOrganizationBillingInvoices(transport, args, options),
2145
+ getOrganizationBillingPaymentMethods: (args, options) => getOrganizationBillingPaymentMethods(transport, args, options),
2146
+ getOrganizationBillingPromotionCode: (args, options) => getOrganizationBillingPromotionCode(transport, args, options),
2147
+ getOrganizationBillingSubscription: (args, options) => getOrganizationBillingSubscription(transport, args, options),
2148
+ patchOrganizationBillingInfo: (args, options) => patchOrganizationBillingInfo(transport, args, options),
2149
+ postOrganizationBillingPaymentMethod: (args, options) => postOrganizationBillingPaymentMethod(transport, args, options),
2150
+ postOrganizationBillingPaymentMethodSetDefault: (args, options) => postOrganizationBillingPaymentMethodSetDefault(transport, args, options),
2151
+ postOrganizationBillingPaymentMethodSetup: (args, options) => postOrganizationBillingPaymentMethodSetup(transport, args, options),
2152
+ postOrganizationBillingProvision: (args, options) => postOrganizationBillingProvision(transport, args, options),
2153
+ postOrganizationBillingSubscription: (args, options) => postOrganizationBillingSubscription(transport, args, options)
2154
+ },
2155
+ invitations: {
2156
+ deleteOrganizationInvitation: (args, options) => deleteOrganizationInvitation(transport, args, options),
2157
+ getOrganizationInvitation: (args, options) => getOrganizationInvitation(transport, args, options),
2158
+ getOrganizationInvitations: (args, options) => getOrganizationInvitations(transport, args, options),
2159
+ postOrganizationInvitation: (args, options) => postOrganizationInvitation(transport, args, options)
2160
+ },
2161
+ keys: {
2162
+ deleteOrganizationPublishableKey: (args, options) => deleteOrganizationPublishableKey(transport, args, options),
2163
+ getOrganizationPublishableKey: (args, options) => getOrganizationPublishableKey(transport, args, options),
2164
+ getOrganizationPublishableKeys: (args, options) => getOrganizationPublishableKeys(transport, args, options),
2165
+ patchOrganizationPublishableKey: (args, options) => patchOrganizationPublishableKey(transport, args, options),
2166
+ postOrganizationPublishableKey: (args, options) => postOrganizationPublishableKey(transport, args, options)
2167
+ },
2168
+ members: {
2169
+ deleteOrganizationMember: (args, options) => deleteOrganizationMember(transport, args, options),
2170
+ getOrganizationMembers: (args, options) => getOrganizationMembers(transport, args, options),
2171
+ patchOrganizationMember: (args, options) => patchOrganizationMember(transport, args, options)
2172
+ },
2173
+ organizations: {
2174
+ deleteOrganizationAiProviderConfig: (args, options) => deleteOrganizationAiProviderConfig(transport, args, options),
2175
+ getAiProviders: (options) => getAiProviders(transport, options),
2176
+ getOrganization: (args, options) => getOrganization(transport, args, options),
2177
+ getOrganizationAiProviderConfig: (args, options) => getOrganizationAiProviderConfig(transport, args, options),
2178
+ getOrganizationSettings: (args, options) => getOrganizationSettings(transport, args, options),
2179
+ getOrganizationUsageData: (args, options) => getOrganizationUsageData(transport, args, options),
2180
+ getOrganizationUsageTiles: (args, options) => getOrganizationUsageTiles(transport, args, options),
2181
+ patchOrganization: (args, options) => patchOrganization(transport, args, options),
2182
+ patchOrganizationAiProviderConfig: (args, options) => patchOrganizationAiProviderConfig(transport, args, options),
2183
+ patchOrganizationSettings: (args, options) => patchOrganizationSettings(transport, args, options),
2184
+ postOrganization: (args, options) => postOrganization(transport, args, options),
2185
+ postOrganizationAiProviderConfig: (args, options) => postOrganizationAiProviderConfig(transport, args, options)
2186
+ },
2187
+ sessions: { postSession: (args, options) => postSession(transport, args, options) },
2188
+ users: {
2189
+ deleteMyInvitation: (args, options) => deleteMyInvitation(transport, args, options),
2190
+ getMyInvitations: (args, options) => getMyInvitations(transport, args, options),
2191
+ getMyOrganizationNotificationPreferences: (args, options) => getMyOrganizationNotificationPreferences(transport, args, options),
2192
+ getMyOrganizations: (args, options) => getMyOrganizations(transport, args, options),
2193
+ getMyPreferences: (options) => getMyPreferences(transport, options),
2194
+ patchMyOrganizationNotificationPreferences: (args, options) => patchMyOrganizationNotificationPreferences(transport, args, options),
2195
+ patchMyPreferences: (args, options) => patchMyPreferences(transport, args, options),
2196
+ postMyInvitationAccept: (args, options) => postMyInvitationAccept(transport, args, options)
2197
+ },
2198
+ webhooks: {
2199
+ deleteOrganizationWebhookEndpoint: (args, options) => deleteOrganizationWebhookEndpoint(transport, args, options),
2200
+ getOrganizationWebhookDeliveries: (args, options) => getOrganizationWebhookDeliveries(transport, args, options),
2201
+ getOrganizationWebhookDelivery: (args, options) => getOrganizationWebhookDelivery(transport, args, options),
2202
+ getOrganizationWebhookEndpoint: (args, options) => getOrganizationWebhookEndpoint(transport, args, options),
2203
+ getOrganizationWebhookEndpoints: (args, options) => getOrganizationWebhookEndpoints(transport, args, options),
2204
+ getOrganizationWebhookEvent: (args, options) => getOrganizationWebhookEvent(transport, args, options),
2205
+ getOrganizationWebhookEvents: (args, options) => getOrganizationWebhookEvents(transport, args, options),
2206
+ getOrganizationWebhookHealth: (args, options) => getOrganizationWebhookHealth(transport, args, options),
2207
+ getWebhookEventTypes: (options) => getWebhookEventTypes(transport, options),
2208
+ patchOrganizationWebhookEndpoint: (args, options) => patchOrganizationWebhookEndpoint(transport, args, options),
2209
+ postOrganizationWebhookDelivery: (args, options) => postOrganizationWebhookDelivery(transport, args, options),
2210
+ postOrganizationWebhookEndpoint: (args, options) => postOrganizationWebhookEndpoint(transport, args, options)
2211
+ }
2212
+ },
2213
+ agent: { runs: {
2214
+ getAgentRunEvents: (args, options) => getAgentRunEvents(transport, args, options),
2215
+ postAgentRun: (args, options) => postAgentRun(transport, args, options),
2216
+ postAgentRunFeedback: (args, options) => postAgentRunFeedback(transport, args, options),
2217
+ postAgentRunInput: (args, options) => postAgentRunInput(transport, args, options)
2218
+ } },
2219
+ studio: {
2220
+ activities: { getActivities: (options) => getActivities(transport, options) },
2221
+ collab: {
2222
+ getItineraryEvents: (args, options) => getItineraryEvents(transport, args, options),
2223
+ getOrganizationEvents: (args, options) => getOrganizationEvents(transport, args, options),
2224
+ getZoneEvents: (args, options) => getZoneEvents(transport, args, options),
2225
+ postItineraryCollab: (args, options) => postItineraryCollab(transport, args, options),
2226
+ postZoneCollab: (args, options) => postZoneCollab(transport, args, options)
2227
+ },
2228
+ collections: {
2229
+ deleteCollection: (args, options) => deleteCollection(transport, args, options),
2230
+ deleteCollectionItinerary: (args, options) => deleteCollectionItinerary(transport, args, options),
2231
+ deleteCollectionShareLink: (args, options) => deleteCollectionShareLink(transport, args, options),
2232
+ deleteCollectionZone: (args, options) => deleteCollectionZone(transport, args, options),
2233
+ getCollection: (args, options) => getCollection(transport, args, options),
2234
+ getCollectionItineraries: (args, options) => getCollectionItineraries(transport, args, options),
2235
+ getCollections: (args, options) => getCollections(transport, args, options),
2236
+ getCollectionShareLink: (args, options) => getCollectionShareLink(transport, args, options),
2237
+ getCollectionZones: (args, options) => getCollectionZones(transport, args, options),
2238
+ patchCollection: (args, options) => patchCollection(transport, args, options),
2239
+ patchCollectionItinerary: (args, options) => patchCollectionItinerary(transport, args, options),
2240
+ postCollection: (args, options) => postCollection(transport, args, options),
2241
+ postCollectionItineraries: (args, options) => postCollectionItineraries(transport, args, options),
2242
+ postCollectionShareLink: (args, options) => postCollectionShareLink(transport, args, options),
2243
+ postCollectionShareLinkRotate: (args, options) => postCollectionShareLinkRotate(transport, args, options),
2244
+ postCollectionZones: (args, options) => postCollectionZones(transport, args, options)
2245
+ },
2246
+ itineraries: {
2247
+ deleteItinerary: (args, options) => deleteItinerary(transport, args, options),
2248
+ deleteItineraryPublication: (args, options) => deleteItineraryPublication(transport, args, options),
2249
+ deleteItinerarySegment: (args, options) => deleteItinerarySegment(transport, args, options),
2250
+ deleteItinerarySegmentGroup: (args, options) => deleteItinerarySegmentGroup(transport, args, options),
2251
+ deleteItineraryShareLink: (args, options) => deleteItineraryShareLink(transport, args, options),
2252
+ deleteItineraryWaypoint: (args, options) => deleteItineraryWaypoint(transport, args, options),
2253
+ getItineraries: (args, options) => getItineraries(transport, args, options),
2254
+ getItinerary: (args, options) => getItinerary(transport, args, options),
2255
+ getItineraryExport: (args, options) => getItineraryExport(transport, args, options),
2256
+ getItineraryPace: (args, options) => getItineraryPace(transport, args, options),
2257
+ getItineraryShareLink: (args, options) => getItineraryShareLink(transport, args, options),
2258
+ patchItinerary: (args, options) => patchItinerary(transport, args, options),
2259
+ patchItinerarySegment: (args, options) => patchItinerarySegment(transport, args, options),
2260
+ patchItinerarySegmentGroup: (args, options) => patchItinerarySegmentGroup(transport, args, options),
2261
+ patchItineraryWaypoint: (args, options) => patchItineraryWaypoint(transport, args, options),
2262
+ postItinerary: (args, options) => postItinerary(transport, args, options),
2263
+ postItineraryDuplicate: (args, options) => postItineraryDuplicate(transport, args, options),
2264
+ postItineraryImport: (args, options) => postItineraryImport(transport, args, options),
2265
+ postItineraryPreview: (args, options) => postItineraryPreview(transport, args, options),
2266
+ postItineraryPublication: (args, options) => postItineraryPublication(transport, args, options),
2267
+ postItinerarySegment: (args, options) => postItinerarySegment(transport, args, options),
2268
+ postItinerarySegmentConvert: (args, options) => postItinerarySegmentConvert(transport, args, options),
2269
+ postItinerarySegmentGroup: (args, options) => postItinerarySegmentGroup(transport, args, options),
2270
+ postItinerarySegmentMerge: (args, options) => postItinerarySegmentMerge(transport, args, options),
2271
+ postItinerarySegmentSplit: (args, options) => postItinerarySegmentSplit(transport, args, options),
2272
+ postItineraryShareLink: (args, options) => postItineraryShareLink(transport, args, options),
2273
+ postItineraryShareLinkRotate: (args, options) => postItineraryShareLinkRotate(transport, args, options),
2274
+ postItineraryWaypoint: (args, options) => postItineraryWaypoint(transport, args, options)
2275
+ },
2276
+ layers: { getLayers: (args, options) => getLayers(transport, args, options) },
2277
+ organizations: { postOrganizationLookup: (args, options) => postOrganizationLookup(transport, args, options) },
2278
+ zones: {
2279
+ deleteZone: (args, options) => deleteZone(transport, args, options),
2280
+ deleteZonePublication: (args, options) => deleteZonePublication(transport, args, options),
2281
+ getZone: (args, options) => getZone(transport, args, options),
2282
+ getZones: (args, options) => getZones(transport, args, options),
2283
+ patchZone: (args, options) => patchZone(transport, args, options),
2284
+ postZone: (args, options) => postZone(transport, args, options),
2285
+ postZonePublication: (args, options) => postZonePublication(transport, args, options)
2286
+ }
2287
+ }
2288
+ });
2289
+ var adminOperations_gen_exports = /* @__PURE__ */ __exportAll({
2290
+ deleteMyInvitation: () => deleteMyInvitation,
2291
+ deleteOrganizationAiProviderConfig: () => deleteOrganizationAiProviderConfig,
2292
+ deleteOrganizationBillingPaymentMethod: () => deleteOrganizationBillingPaymentMethod,
2293
+ deleteOrganizationBillingSubscription: () => deleteOrganizationBillingSubscription,
2294
+ deleteOrganizationInvitation: () => deleteOrganizationInvitation,
2295
+ deleteOrganizationMember: () => deleteOrganizationMember,
2296
+ deleteOrganizationPublishableKey: () => deleteOrganizationPublishableKey,
2297
+ deleteOrganizationWebhookEndpoint: () => deleteOrganizationWebhookEndpoint,
2298
+ getAiProviders: () => getAiProviders,
2299
+ getBillingProducts: () => getBillingProducts,
2300
+ getMyInvitations: () => getMyInvitations,
2301
+ getMyOrganizationNotificationPreferences: () => getMyOrganizationNotificationPreferences,
2302
+ getMyOrganizations: () => getMyOrganizations,
2303
+ getMyPreferences: () => getMyPreferences,
2304
+ getOrganization: () => getOrganization,
2305
+ getOrganizationAiProviderConfig: () => getOrganizationAiProviderConfig,
2306
+ getOrganizationBillingInfo: () => getOrganizationBillingInfo,
2307
+ getOrganizationBillingInvoices: () => getOrganizationBillingInvoices,
2308
+ getOrganizationBillingPaymentMethods: () => getOrganizationBillingPaymentMethods,
2309
+ getOrganizationBillingPromotionCode: () => getOrganizationBillingPromotionCode,
2310
+ getOrganizationBillingSubscription: () => getOrganizationBillingSubscription,
2311
+ getOrganizationInvitation: () => getOrganizationInvitation,
2312
+ getOrganizationInvitations: () => getOrganizationInvitations,
2313
+ getOrganizationMembers: () => getOrganizationMembers,
2314
+ getOrganizationPublishableKey: () => getOrganizationPublishableKey,
2315
+ getOrganizationPublishableKeys: () => getOrganizationPublishableKeys,
2316
+ getOrganizationSettings: () => getOrganizationSettings,
2317
+ getOrganizationUsageData: () => getOrganizationUsageData,
2318
+ getOrganizationUsageTiles: () => getOrganizationUsageTiles,
2319
+ getOrganizationWebhookDeliveries: () => getOrganizationWebhookDeliveries,
2320
+ getOrganizationWebhookDelivery: () => getOrganizationWebhookDelivery,
2321
+ getOrganizationWebhookEndpoint: () => getOrganizationWebhookEndpoint,
2322
+ getOrganizationWebhookEndpoints: () => getOrganizationWebhookEndpoints,
2323
+ getOrganizationWebhookEvent: () => getOrganizationWebhookEvent,
2324
+ getOrganizationWebhookEvents: () => getOrganizationWebhookEvents,
2325
+ getOrganizationWebhookHealth: () => getOrganizationWebhookHealth,
2326
+ getWebhookEventTypes: () => getWebhookEventTypes,
2327
+ patchMyOrganizationNotificationPreferences: () => patchMyOrganizationNotificationPreferences,
2328
+ patchMyPreferences: () => patchMyPreferences,
2329
+ patchOrganization: () => patchOrganization,
2330
+ patchOrganizationAiProviderConfig: () => patchOrganizationAiProviderConfig,
2331
+ patchOrganizationBillingInfo: () => patchOrganizationBillingInfo,
2332
+ patchOrganizationMember: () => patchOrganizationMember,
2333
+ patchOrganizationPublishableKey: () => patchOrganizationPublishableKey,
2334
+ patchOrganizationSettings: () => patchOrganizationSettings,
2335
+ patchOrganizationWebhookEndpoint: () => patchOrganizationWebhookEndpoint,
2336
+ postMyInvitationAccept: () => postMyInvitationAccept,
2337
+ postOrganization: () => postOrganization,
2338
+ postOrganizationAiProviderConfig: () => postOrganizationAiProviderConfig,
2339
+ postOrganizationBillingPaymentMethod: () => postOrganizationBillingPaymentMethod,
2340
+ postOrganizationBillingPaymentMethodSetDefault: () => postOrganizationBillingPaymentMethodSetDefault,
2341
+ postOrganizationBillingPaymentMethodSetup: () => postOrganizationBillingPaymentMethodSetup,
2342
+ postOrganizationBillingProvision: () => postOrganizationBillingProvision,
2343
+ postOrganizationBillingSubscription: () => postOrganizationBillingSubscription,
2344
+ postOrganizationInvitation: () => postOrganizationInvitation,
2345
+ postOrganizationPublishableKey: () => postOrganizationPublishableKey,
2346
+ postOrganizationWebhookDelivery: () => postOrganizationWebhookDelivery,
2347
+ postOrganizationWebhookEndpoint: () => postOrganizationWebhookEndpoint,
2348
+ postSession: () => postSession
2349
+ });
2350
+ var MountayaError = class extends Error {
2351
+ name = "MountayaError";
2352
+ idempotencyKey;
2353
+ constructor(message, options) {
2354
+ super(message, options);
2355
+ this.idempotencyKey = options?.idempotencyKey;
2356
+ }
2357
+ };
2358
+ var MountayaConfigurationError = class extends MountayaError {
2359
+ name = "MountayaConfigurationError";
2360
+ };
2361
+ const describeType = (value) => {
2362
+ if (value === null || value === void 0) return String(value);
2363
+ const type = Array.isArray(value) ? "array" : typeof value;
2364
+ return /^[aeiou]/.test(type) ? `an ${type}` : `a ${type}`;
2365
+ };
2366
+ const describeValue = (value) => {
2367
+ if (typeof value === "string") return JSON.stringify(value);
2368
+ try {
2369
+ return String(value);
2370
+ } catch {
2371
+ return describeType(value);
2372
+ }
2373
+ };
2374
+ const refuseOption = (path, value, remedy, context) => new MountayaConfigurationError(`${context === void 0 ? "" : `${context}: `}${path} is ${describeValue(value)}; ${remedy}`);
2375
+ const isoDate = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/;
2376
+ const ISO_DATE_MIN_LENGTH = 20;
2377
+ const ISO_DATE_SEPARATOR = 84;
2378
+ const MONTH_DAYS = [
2379
+ 31,
2380
+ 28,
2381
+ 31,
2382
+ 30,
2383
+ 31,
2384
+ 30,
2385
+ 31,
2386
+ 31,
2387
+ 30,
2388
+ 31,
2389
+ 30,
2390
+ 31
2391
+ ];
2392
+ const isLeapYear = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2393
+ const daysIn = (year, month) => month === 2 && isLeapYear(year) ? 29 : MONTH_DAYS[month - 1] ?? 0;
2394
+ const instantOf = (value) => {
2395
+ if (value.length < ISO_DATE_MIN_LENGTH || value.charCodeAt(10) !== ISO_DATE_SEPARATOR) return;
2396
+ const fields = isoDate.exec(value);
2397
+ if (fields === null) return;
2398
+ const field = (index) => Number(fields[index] ?? 0);
2399
+ const year = field(1);
2400
+ const month = field(2);
2401
+ const day = field(3);
2402
+ if (!(month >= 1 && month <= 12 && day >= 1 && day <= daysIn(year, month) && field(4) <= 23 && field(5) <= 59 && field(6) <= 59 && field(7) <= 23 && field(8) <= 59)) return;
2403
+ const instant = new Date(value);
2404
+ return Number.isNaN(instant.getTime()) ? void 0 : instant;
2405
+ };
2406
+ const isHolding = (mask) => Array.isArray(mask) && mask.length === 2 && mask[0] === true;
2407
+ const isVariants = (mask) => Array.isArray(mask) && mask.length === 2 && typeof mask[0] === "string";
2408
+ const isListMask = (mask) => Array.isArray(mask) && mask.length === 1;
2409
+ const isMembers = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2410
+ const withAbsentNulls = (value, mask) => {
2411
+ if (mask === void 0 || mask === true || isHolding(mask)) return value;
2412
+ if (isListMask(mask)) {
2413
+ if (!Array.isArray(value)) return value;
2414
+ let copy;
2415
+ for (const [index, element] of value.entries()) {
2416
+ const written = withAbsentNulls(element, mask[0]);
2417
+ if (written !== element) {
2418
+ copy ??= [...value];
2419
+ copy[index] = written;
2420
+ }
2421
+ }
2422
+ return copy ?? value;
2423
+ }
2424
+ if (!isMembers(value)) return value;
2425
+ if (isVariants(mask)) {
2426
+ const [discriminator, variants] = mask;
2427
+ const variant = value[discriminator];
2428
+ return typeof variant === "string" && Object.hasOwn(variants, variant) ? withAbsentNulls(value, variants[variant]) : value;
2429
+ }
2430
+ let copy;
2431
+ for (const [member, inner] of Object.entries(mask)) {
2432
+ if (!Object.hasOwn(value, member)) {
2433
+ if (inner === true || isHolding(inner)) {
2434
+ copy ??= { ...value };
2435
+ copy[member] = null;
2436
+ }
2437
+ continue;
2438
+ }
2439
+ const held = value[member];
2440
+ const written = withAbsentNulls(held, isHolding(inner) ? inner[1] : inner);
2441
+ if (written !== held) {
2442
+ copy ??= { ...value };
2443
+ copy[member] = written;
2444
+ }
2445
+ }
2446
+ return copy ?? value;
2447
+ };
2448
+ const localesNulls = {
2449
+ de: true,
2450
+ en: true,
2451
+ es: true,
2452
+ fr: true,
2453
+ it: true,
2454
+ ja: true,
2455
+ zh: true
2456
+ };
2457
+ const activityNulls = { locales: localesNulls };
2458
+ const aiProviderConfigNulls = { base_url: true };
2459
+ const billingPricingNulls = { unit_amount: true };
2460
+ const billingProductNulls = { prices: [billingPricingNulls] };
2461
+ const categoryActivitiesNulls = {
2462
+ children: [activityNulls],
2463
+ locales: localesNulls
2464
+ };
2465
+ const tileLegendNulls = { locales: localesNulls };
2466
+ const tileLayerNulls = {
2467
+ layout: true,
2468
+ legend: tileLegendNulls,
2469
+ paint: true
2470
+ };
2471
+ const tileSourceNulls = { layers: [tileLayerNulls] };
2472
+ const overlayNulls = {
2473
+ locales: localesNulls,
2474
+ sources: [tileSourceNulls]
2475
+ };
2476
+ const categoryOverlaysNulls = {
2477
+ children: [overlayNulls],
2478
+ locales: localesNulls
2479
+ };
2480
+ const collabCursorEventNulls = { position: true };
2481
+ const collabCursorSignalNulls = { position: true };
2482
+ const collabSelectionEventNulls = { selection: true };
2483
+ const collabSelectionSignalNulls = { selection: true };
2484
+ const collabSignalParamsNulls = ["type", {
2485
+ cursor: collabCursorSignalNulls,
2486
+ selection: collabSelectionSignalNulls
2487
+ }];
2488
+ const collabStreamEventNulls = ["type", {
2489
+ cursor: collabCursorEventNulls,
2490
+ selection: collabSelectionEventNulls
2491
+ }];
2492
+ const collectionNulls = {
2493
+ description: true,
2494
+ organization_id: true,
2495
+ sources: [tileSourceNulls]
2496
+ };
2497
+ const collectionEventObjectNulls = { description: true };
2498
+ const itineraryNulls = {
2499
+ ascent: true,
2500
+ description: true,
2501
+ distance: true,
2502
+ organization_id: true
2503
+ };
2504
+ const itineraryDirectionsStepNulls = { exit_number: true };
2505
+ const itineraryEventObjectNulls = { description: true };
2506
+ const proposedSegmentNulls = { recommendation_reason: true };
2507
+ const itineraryImportPreviewNulls = { segments: [proposedSegmentNulls] };
2508
+ const itinerarySegmentNulls = {
2509
+ altitude_max: true,
2510
+ altitude_min: true,
2511
+ ascent: true,
2512
+ color: true,
2513
+ descent: true,
2514
+ description: true,
2515
+ distance: true,
2516
+ duration: true,
2517
+ geojson: true,
2518
+ gradient_max: true,
2519
+ gradient_min: true,
2520
+ group_id: true,
2521
+ road_access_info: true,
2522
+ slope_info: true,
2523
+ speed: true,
2524
+ speed_info: true,
2525
+ start_at: true,
2526
+ steps: [true, [itineraryDirectionsStepNulls]],
2527
+ surface_info: true,
2528
+ trail_difficulty_info: true,
2529
+ way_type_info: true
2530
+ };
2531
+ const itinerarySegmentGroupNulls = { speed: true };
2532
+ const itineraryWaypointNulls = {
2533
+ color: true,
2534
+ contact: true,
2535
+ description: true,
2536
+ geojson: true,
2537
+ icon: true,
2538
+ media: true,
2539
+ name: true,
2540
+ properties: true,
2541
+ timing: true
2542
+ };
2543
+ const itineraryWaypointEventObjectNulls = { name: true };
2544
+ const itineraryWithDetailsNulls = {
2545
+ ascent: true,
2546
+ description: true,
2547
+ distance: true,
2548
+ groups: [itinerarySegmentGroupNulls],
2549
+ organization_id: true,
2550
+ published_at: true,
2551
+ segments: [itinerarySegmentNulls],
2552
+ waypoints: [itineraryWaypointNulls]
2553
+ };
2554
+ const terrainNulls = { locales: localesNulls };
2555
+ const layersNulls = {
2556
+ itineraries: overlayNulls,
2557
+ overlays: [categoryOverlaysNulls],
2558
+ terrains: [terrainNulls],
2559
+ zones: overlayNulls
2560
+ };
2561
+ const paginationMetadataNulls = { next_cursor: true };
2562
+ const listMetadataNulls = { pagination: paginationMetadataNulls };
2563
+ const notificationPreferenceNulls = { locked_reason: true };
2564
+ const notificationPreferencesNulls = { notifications: [notificationPreferenceNulls] };
2565
+ const subscriptionDiscountNulls = {
2566
+ covers_through: true,
2567
+ ends_at: true
2568
+ };
2569
+ const organizationSubscriptionNulls = {
2570
+ discount: subscriptionDiscountNulls,
2571
+ end_reason: true,
2572
+ ended_at: true
2573
+ };
2574
+ const organizationSubscriptionSummaryNulls = { api: organizationSubscriptionNulls };
2575
+ const sessionNulls = { user_id: true };
2576
+ const usageDataPointNulls = { client_version: true };
2577
+ const usageTilePointNulls = { client_version: true };
2578
+ const webhookDeliveryNulls = { next_attempt_at: true };
2579
+ const webhookDeliveryTriggerNulls = { delivery_id: true };
2580
+ const webhookDeliveryWithAttemptsNulls = { next_attempt_at: true };
2581
+ const webhookEndpointNulls = {
2582
+ created_by: true,
2583
+ description: true,
2584
+ disabled_at: true,
2585
+ disabled_reason: true,
2586
+ failing_since: true
2587
+ };
2588
+ const webhookEndpointEventObjectNulls = { failing_since: true };
2589
+ const webhookEndpointWithSecretNulls = {
2590
+ created_by: true,
2591
+ description: true,
2592
+ disabled_at: true,
2593
+ disabled_reason: true,
2594
+ failing_since: true
2595
+ };
2596
+ const zoneEventObjectNulls = {
2597
+ description: true,
2598
+ end_at: true,
2599
+ start_at: true
2600
+ };
2601
+ const webhookEventObjectNulls = ["object", {
2602
+ collection: collectionEventObjectNulls,
2603
+ itinerary: itineraryEventObjectNulls,
2604
+ "itinerary.waypoint": itineraryWaypointEventObjectNulls,
2605
+ "organization.webhook_endpoint": webhookEndpointEventObjectNulls,
2606
+ zone: zoneEventObjectNulls
2607
+ }];
2608
+ const webhookEventDataNulls = { object: webhookEventObjectNulls };
2609
+ const webhookEventNulls = {
2610
+ data: webhookEventDataNulls,
2611
+ request: true
2612
+ };
2613
+ const webhookEventWithDeliveriesNulls = {
2614
+ data: webhookEventDataNulls,
2615
+ deliveries: [webhookDeliveryNulls],
2616
+ request: true
2617
+ };
2618
+ const webhookHealthDestinationNulls = {
2619
+ eventual_success_rate: true,
2620
+ first_attempt_success_rate: true,
2621
+ last_success_at: true
2622
+ };
2623
+ const webhookHealthFiguresNulls = {
2624
+ availability: true,
2625
+ dispatch_delay_p50_ms: true,
2626
+ dispatch_delay_p95_ms: true,
2627
+ dispatched_within_60s: true,
2628
+ eventual_success_rate: true,
2629
+ first_attempt_success_rate: true,
2630
+ response_time_p50_ms: true,
2631
+ response_time_p95_ms: true
2632
+ };
2633
+ const webhookHealthPointNulls = {
2634
+ availability: true,
2635
+ dispatch_delay_p50_ms: true,
2636
+ dispatch_delay_p95_ms: true,
2637
+ dispatched_within_60s: true,
2638
+ eventual_success_rate: true,
2639
+ first_attempt_success_rate: true,
2640
+ response_time_p50_ms: true,
2641
+ response_time_p95_ms: true
2642
+ };
2643
+ const restSchemaNulls = {
2644
+ Activity: activityNulls,
2645
+ AiProviderConfig: aiProviderConfigNulls,
2646
+ BillingPricing: billingPricingNulls,
2647
+ BillingProduct: billingProductNulls,
2648
+ CategoryActivities: categoryActivitiesNulls,
2649
+ CategoryOverlays: categoryOverlaysNulls,
2650
+ CollabCursorEvent: collabCursorEventNulls,
2651
+ CollabCursorSignal: collabCursorSignalNulls,
2652
+ CollabSelectionEvent: collabSelectionEventNulls,
2653
+ CollabSelectionSignal: collabSelectionSignalNulls,
2654
+ CollabSignalParams: collabSignalParamsNulls,
2655
+ CollabStreamEvent: collabStreamEventNulls,
2656
+ Collection: collectionNulls,
2657
+ CollectionEventObject: collectionEventObjectNulls,
2658
+ Itinerary: itineraryNulls,
2659
+ ItineraryDirectionsStep: itineraryDirectionsStepNulls,
2660
+ ItineraryEventObject: itineraryEventObjectNulls,
2661
+ ItineraryImportPreview: itineraryImportPreviewNulls,
2662
+ ItinerarySegment: itinerarySegmentNulls,
2663
+ ItinerarySegmentGroup: itinerarySegmentGroupNulls,
2664
+ ItineraryWaypoint: itineraryWaypointNulls,
2665
+ ItineraryWaypointEventObject: itineraryWaypointEventObjectNulls,
2666
+ ItineraryWithDetails: itineraryWithDetailsNulls,
2667
+ Layers: layersNulls,
2668
+ ListMetadata: listMetadataNulls,
2669
+ Locales: localesNulls,
2670
+ NotificationPreference: notificationPreferenceNulls,
2671
+ NotificationPreferences: notificationPreferencesNulls,
2672
+ OrganizationSubscription: organizationSubscriptionNulls,
2673
+ OrganizationSubscriptionSummary: organizationSubscriptionSummaryNulls,
2674
+ Overlay: overlayNulls,
2675
+ PaginationMetadata: paginationMetadataNulls,
2676
+ ProposedSegment: proposedSegmentNulls,
2677
+ Session: sessionNulls,
2678
+ SubscriptionDiscount: subscriptionDiscountNulls,
2679
+ Terrain: terrainNulls,
2680
+ TileLayer: tileLayerNulls,
2681
+ TileLegend: tileLegendNulls,
2682
+ TileSource: tileSourceNulls,
2683
+ UsageDataPoint: usageDataPointNulls,
2684
+ UsageTilePoint: usageTilePointNulls,
2685
+ WebhookDelivery: webhookDeliveryNulls,
2686
+ WebhookDeliveryTrigger: webhookDeliveryTriggerNulls,
2687
+ WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsNulls,
2688
+ WebhookEndpoint: webhookEndpointNulls,
2689
+ WebhookEndpointEventObject: webhookEndpointEventObjectNulls,
2690
+ WebhookEndpointWithSecret: webhookEndpointWithSecretNulls,
2691
+ WebhookEvent: webhookEventNulls,
2692
+ WebhookEventData: webhookEventDataNulls,
2693
+ WebhookEventObject: webhookEventObjectNulls,
2694
+ WebhookEventWithDeliveries: webhookEventWithDeliveriesNulls,
2695
+ WebhookHealth: {
2696
+ destinations: [webhookHealthDestinationNulls],
2697
+ series: [webhookHealthPointNulls],
2698
+ totals: webhookHealthFiguresNulls
2699
+ },
2700
+ WebhookHealthDestination: webhookHealthDestinationNulls,
2701
+ WebhookHealthFigures: webhookHealthFiguresNulls,
2702
+ WebhookHealthPoint: webhookHealthPointNulls,
2703
+ Zone: {
2704
+ description: true,
2705
+ end_at: true,
2706
+ organization_id: true,
2707
+ published_at: true,
2708
+ source: true,
2709
+ start_at: true
2710
+ },
2711
+ ZoneEventObject: zoneEventObjectNulls
2712
+ };
2713
+ const schemaDates = restSchemaDates;
2714
+ const schemaNulls = restSchemaNulls;
2715
+ const isList = (value) => Array.isArray(value);
2716
+ const decodedCopy = (value, mask) => {
2717
+ if (mask === true) return typeof value === "string" ? instantOf(value) ?? value : value;
2718
+ if (isList(mask)) {
2719
+ if (!isList(value)) return value;
2720
+ const [element] = mask;
2721
+ let copy;
2722
+ for (const [index, member] of value.entries()) {
2723
+ const decoded = decodedCopy(member, element);
2724
+ if (decoded !== member) {
2725
+ copy ??= [...value];
2726
+ copy[index] = decoded;
2727
+ }
2728
+ }
2729
+ return copy ?? value;
2730
+ }
2731
+ if (typeof value !== "object" || value === null || isList(value)) return value;
2732
+ let copy;
2733
+ for (const [field, fieldMask] of Object.entries(mask)) if (Object.hasOwn(value, field)) {
2734
+ const current = Reflect.get(value, field);
2735
+ const decoded = decodedCopy(current, fieldMask);
2736
+ if (decoded !== current) {
2737
+ copy ??= { ...value };
2738
+ copy[field] = decoded;
2739
+ }
2740
+ }
2741
+ return copy ?? value;
2742
+ };
2743
+ const decodeRestSchema = (schema, json) => withAbsentNulls(decodeSchemaInstants(schema, json), Object.hasOwn(schemaNulls, schema) ? schemaNulls[schema] : void 0);
2744
+ const decodeSchemaInstants = (schema, json) => {
2745
+ const mask = schemaDates[schema];
2746
+ return mask === void 0 ? json : decodedCopy(json, mask);
2747
+ };
2748
+ const CONTEXT = "constructWebhookEvent";
2749
+ const DEFAULT_TOLERANCE_SECONDS = 300;
2750
+ const SECRET_PREFIX = "whsk_";
2751
+ const wholeSeconds = /^\d+$/;
2752
+ const LATEST_WRITTEN_SECONDS = 253402300799;
2753
+ const signedAt = (timestamp) => timestamp <= LATEST_WRITTEN_SECONDS ? (/* @__PURE__ */ new Date(timestamp * 1e3)).toISOString() : `t=${timestamp}`;
2754
+ var MountayaWebhookSignatureError = class extends MountayaError {
2755
+ name = "MountayaWebhookSignatureError";
2756
+ reason;
2757
+ constructor(message, reason) {
2758
+ super(message);
2759
+ this.reason = reason;
2760
+ }
2761
+ };
2762
+ const parseSignatureHeader = (header) => {
2763
+ const signatures = [];
2764
+ const timestamps = [];
2765
+ for (const element of header.split(",")) {
2766
+ const separator = element.indexOf("=");
2767
+ if (separator === -1) return;
2768
+ const key = element.slice(0, separator).trim();
2769
+ const value = element.slice(separator + 1).trim();
2770
+ if (key === "t") timestamps.push(value);
2771
+ else if (key === "v1") signatures.push(value);
2772
+ }
2773
+ const [stated] = timestamps;
2774
+ if (timestamps.length !== 1 || stated === void 0 || !wholeSeconds.test(stated)) return;
2775
+ const timestamp = Number(stated);
2776
+ if (!Number.isSafeInteger(timestamp) || signatures.length === 0) return;
2777
+ return {
2778
+ signatures,
2779
+ stated,
2780
+ timestamp
2781
+ };
2782
+ };
2783
+ const subtleCrypto = () => {
2784
+ return globalThis.crypto?.subtle;
2785
+ };
2786
+ const hexOf = (bytes) => Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
2787
+ const equalInConstantTime = (candidate, expected) => {
2788
+ if (candidate.length !== expected.length) return false;
2789
+ let difference = 0;
2790
+ for (let index = 0; index < expected.length; index += 1) difference |= candidate.charCodeAt(index) ^ expected.charCodeAt(index);
2791
+ return difference === 0;
2792
+ };
2793
+ const signedBytes = (stated, body) => {
2794
+ const prefix = new TextEncoder().encode(`${stated}.`);
2795
+ const signed = new Uint8Array(prefix.length + body.length);
2796
+ signed.set(prefix);
2797
+ signed.set(body, prefix.length);
2798
+ return signed;
2799
+ };
2800
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
2801
+ const envelopeOf = (body) => {
2802
+ const refusal = `${CONTEXT}: the delivery verified and its body holds no webhook event, not even the envelope every event is delivered in. Answer the request with a 400 and act on nothing it asks.`;
2803
+ let parsed;
2804
+ try {
2805
+ parsed = JSON.parse(new TextDecoder().decode(body));
2806
+ } catch (cause) {
2807
+ throw new MountayaConfigurationError(refusal, { cause });
2808
+ }
2809
+ if (!isRecord(parsed)) throw new MountayaConfigurationError(refusal);
2810
+ return parsed;
2811
+ };
2812
+ const withPreviousAttributes = (event) => {
2813
+ if (!isRecord(event) || !isRecord(event.data) || !isRecord(event.data.previous_attributes)) return event;
2814
+ const held = event.data.previous_attributes;
2815
+ const decoded = decodeSchemaInstants("WebhookEventObject", held);
2816
+ return decoded === held ? event : {
2817
+ ...event,
2818
+ data: {
2819
+ ...event.data,
2820
+ previous_attributes: decoded
2821
+ }
2822
+ };
2823
+ };
2824
+ const millisecondsOf = (value) => {
2825
+ try {
2826
+ return Date.prototype.getTime.call(value);
2827
+ } catch {
2828
+ return;
2829
+ }
2830
+ };
2831
+ const constructWebhookEvent = async (rawBody, signatureHeader, secret, options) => {
2832
+ if (typeof rawBody !== "string" && !(rawBody instanceof Uint8Array)) throw new MountayaConfigurationError(`${CONTEXT}: rawBody is ${describeType(rawBody)}; pass the body exactly as it arrived, as a string or a Uint8Array, before any JSON parser reads it.`);
2833
+ if (typeof secret !== "string" || !secret.startsWith(SECRET_PREFIX)) throw new MountayaConfigurationError(`${CONTEXT}: secret is ${typeof secret === "string" ? "a string that does not start with whsk_" : describeType(secret)}; pass the signing secret of the endpoint the delivery was sent to, whsk_ included.`);
2834
+ if (options !== void 0 && (typeof options !== "object" || options === null)) throw refuseOption("options", options, "pass an object such as { toleranceSeconds: 600 }, or leave it out for the defaults.", CONTEXT);
2835
+ const toleranceSeconds = options?.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
2836
+ if (typeof toleranceSeconds !== "number" || !Number.isFinite(toleranceSeconds) || toleranceSeconds < 0) throw refuseOption("toleranceSeconds", toleranceSeconds, `pass a finite number of seconds from 0, or leave it out for ${DEFAULT_TOLERANCE_SECONDS}.`, CONTEXT);
2837
+ const stated = options?.now;
2838
+ const statedMilliseconds = stated === void 0 ? void 0 : millisecondsOf(stated);
2839
+ if (stated !== void 0 && (statedMilliseconds === void 0 || !Number.isFinite(statedMilliseconds))) throw refuseOption("now", stated, "pass a Date that names an instant, or leave it out for the machine's wall clock.", CONTEXT);
2840
+ const subtle = subtleCrypto();
2841
+ if (subtle === void 0) throw new MountayaConfigurationError(`${CONTEXT}: this runtime provides no Web Crypto (crypto.subtle) to compute the signature with. Verify the delivery on a server, in Node 22.18 or later, a worker or an edge runtime.`);
2842
+ if (signatureHeader === null || signatureHeader === void 0 || signatureHeader.trim() === "") throw new MountayaWebhookSignatureError(`${CONTEXT}: the request carries no Mountaya-Signature header. Pass the header the request carries, such as request.headers.get("Mountaya-Signature"), and answer a request without one with a 400.`, "missing-header");
2843
+ const header = parseSignatureHeader(signatureHeader);
2844
+ if (header === void 0) throw new MountayaWebhookSignatureError(`${CONTEXT}: the Mountaya-Signature header ${JSON.stringify(signatureHeader)} is not t=<unix seconds>,v1=<signature>. Pass the header exactly as the request carries it.`, "malformed-header");
2845
+ const body = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody;
2846
+ const key = await subtle.importKey("raw", new TextEncoder().encode(secret), {
2847
+ hash: "SHA-256",
2848
+ name: "HMAC"
2849
+ }, false, ["sign"]);
2850
+ const expected = hexOf(await subtle.sign("HMAC", key, signedBytes(header.stated, body)));
2851
+ if (!header.signatures.reduce((found, candidate) => equalInConstantTime(candidate, expected) || found, false)) throw new MountayaWebhookSignatureError(`${CONTEXT}: no v1 of the Mountaya-Signature header is the signature of this body under this secret. Pass the body exactly as it arrived, before any JSON parser reads it, and the secret of the endpoint the delivery was sent to.`, "signature");
2852
+ const skew = Math.abs((statedMilliseconds ?? Date.now()) / 1e3 - header.timestamp);
2853
+ if (skew > toleranceSeconds) throw new MountayaWebhookSignatureError(`${CONTEXT}: the delivery was signed at ${signedAt(header.timestamp)}, ${Math.round(skew)} seconds from this clock, past the tolerance of ${toleranceSeconds} seconds. A delivery replayed later is refused this way; where the clock is wrong, set it right.`, "timestamp");
2854
+ return withPreviousAttributes(decodeRestSchema("WebhookEvent", envelopeOf(body)));
2855
+ };
2856
+ const bound = /* @__PURE__ */ new WeakMap();
2857
+ const adminOperationsOf = (transport) => {
2858
+ const held = bound.get(transport);
2859
+ if (held !== void 0) return held;
2860
+ const table = bind(transport).admin;
2861
+ bound.set(transport, table);
2862
+ return table;
2863
+ };
2864
+ var MountayaAdmin = class {
2865
+ billing;
2866
+ invitations;
2867
+ keys;
2868
+ members;
2869
+ organizations;
2870
+ sessions;
2871
+ users;
2872
+ webhooks;
2873
+ constructor(mountaya) {
2874
+ const operations = adminOperationsOf(mountaya.transport);
2875
+ this.billing = operations.billing;
2876
+ this.invitations = operations.invitations;
2877
+ this.keys = operations.keys;
2878
+ this.members = operations.members;
2879
+ this.organizations = operations.organizations;
2880
+ this.sessions = operations.sessions;
2881
+ this.users = operations.users;
2882
+ this.webhooks = operations.webhooks;
2883
+ }
2884
+ };
2885
+ exports.MountayaAdmin = MountayaAdmin;
2886
+ exports.MountayaWebhookSignatureError = MountayaWebhookSignatureError;
2887
+ exports.constructWebhookEvent = constructWebhookEvent;
2888
+ Object.defineProperty(exports, "rest", {
2889
+ enumerable: true,
2890
+ get: function() {
2891
+ return adminOperations_gen_exports;
2892
+ }
2893
+ });
2894
+
2895
+ //# sourceMappingURL=index.cjs.map