@mountaya/client 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +104 -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 +3521 -0
  6. package/dist/admin/index.cjs.map +1 -0
  7. package/dist/admin/index.d.cts +1070 -0
  8. package/dist/admin/index.d.ts +1070 -0
  9. package/dist/admin/index.js +301 -0
  10. package/dist/admin/index.js.map +1 -0
  11. package/dist/browser.cjs +8073 -0
  12. package/dist/browser.cjs.map +1 -0
  13. package/dist/browser.d.cts +106 -0
  14. package/dist/browser.d.ts +106 -0
  15. package/dist/browser.js +53 -0
  16. package/dist/browser.js.map +1 -0
  17. package/dist/chunk-BM526BHG.js +342 -0
  18. package/dist/chunk-BM526BHG.js.map +1 -0
  19. package/dist/chunk-D2YEVTG7.js +327 -0
  20. package/dist/chunk-D2YEVTG7.js.map +1 -0
  21. package/dist/chunk-OHKVUREN.js +3500 -0
  22. package/dist/chunk-OHKVUREN.js.map +1 -0
  23. package/dist/chunk-TDTK2L5H.js +3842 -0
  24. package/dist/chunk-TDTK2L5H.js.map +1 -0
  25. package/dist/coreOperations.gen-BMYPoBbz.d.ts +1760 -0
  26. package/dist/coreOperations.gen-BxX5xRxw.d.cts +1760 -0
  27. package/dist/errors-B-GqAtQv.d.cts +75960 -0
  28. package/dist/errors-B-GqAtQv.d.ts +75960 -0
  29. package/dist/events/index.cjs +1972 -0
  30. package/dist/events/index.cjs.map +1 -0
  31. package/dist/events/index.d.cts +781 -0
  32. package/dist/events/index.d.ts +781 -0
  33. package/dist/events/index.js +826 -0
  34. package/dist/events/index.js.map +1 -0
  35. package/dist/index.cjs +8072 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.cts +76 -0
  38. package/dist/index.d.ts +76 -0
  39. package/dist/index.js +52 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/operations.gen-CvTyzKNF.d.cts +3993 -0
  42. package/dist/operations.gen-DUD406TV.d.ts +3993 -0
  43. package/package.json +127 -4
  44. package/src/admin/index.ts +47 -0
  45. package/src/admin/rules/mountayaAdmin.ts +102 -0
  46. package/src/browser.ts +232 -0
  47. package/src/core/engines/sessionToken.ts +870 -0
  48. package/src/core/rules/auth.ts +1017 -0
  49. package/src/core/rules/clientHeader.ts +28 -0
  50. package/src/core/rules/dates.ts +200 -0
  51. package/src/core/rules/decode.ts +154 -0
  52. package/src/core/rules/envelope.ts +41 -0
  53. package/src/core/rules/errors.ts +1486 -0
  54. package/src/core/rules/graphql.ts +576 -0
  55. package/src/core/rules/headerValue.ts +42 -0
  56. package/src/core/rules/idempotencyKey.ts +64 -0
  57. package/src/core/rules/nullMask.ts +127 -0
  58. package/src/core/rules/nullMasks.gen.ts +416 -0
  59. package/src/core/rules/paginate.ts +316 -0
  60. package/src/core/rules/rateLimit.ts +507 -0
  61. package/src/core/rules/redaction.ts +219 -0
  62. package/src/core/rules/resourceRef.ts +110 -0
  63. package/src/core/rules/responseBody.ts +492 -0
  64. package/src/core/rules/retry.ts +386 -0
  65. package/src/core/rules/selection.ts +416 -0
  66. package/src/core/rules/sessionAnswer.ts +90 -0
  67. package/src/core/rules/sessionSchedule.ts +131 -0
  68. package/src/core/rules/sessionWait.ts +112 -0
  69. package/src/core/rules/transport.ts +2386 -0
  70. package/src/core/rules/version.gen.ts +16 -0
  71. package/src/core/rules/webAddress.ts +165 -0
  72. package/src/core/rules/webAddresses.gen.ts +30 -0
  73. package/src/data/operations.gen.ts +603 -0
  74. package/src/data/schema.gen.ts +8078 -0
  75. package/src/data/selection.gen.ts +472 -0
  76. package/src/events/index.ts +67 -0
  77. package/src/events/rules/agent.ts +439 -0
  78. package/src/events/rules/collab.ts +554 -0
  79. package/src/events/rules/collabNulls.gen.ts +17 -0
  80. package/src/events/rules/eventStream.ts +94 -0
  81. package/src/events/rules/openSseStream.ts +594 -0
  82. package/src/events/rules/sse.ts +349 -0
  83. package/src/index.ts +231 -0
  84. package/src/rest/adminOperations.gen.ts +70 -0
  85. package/src/rest/adminResources.gen.ts +136 -0
  86. package/src/rest/coreOperations.gen.ts +74 -0
  87. package/src/rest/coreResources.gen.ts +244 -0
  88. package/src/rest/dates.gen.ts +217 -0
  89. package/src/rest/operations.gen.ts +4341 -0
  90. package/src/rest/resources.gen.ts +369 -0
  91. package/src/rest/schema.gen.ts +56840 -0
  92. package/src/tiles/operations.gen.ts +206 -0
  93. package/src/tiles/schema.gen.ts +8408 -0
  94. package/src/webhooks/rules/constructWebhookEvent.ts +482 -0
  95. package/src/webhooks/rules/webhookEvent.ts +38 -0
  96. package/src/webhooks/rules/webhookEvents.gen.ts +732 -0
@@ -0,0 +1,3521 @@
1
+ 'use strict';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __export = (target, all) => {
5
+ for (var name in all)
6
+ __defProp(target, name, { get: all[name], enumerable: true });
7
+ };
8
+
9
+ // src/rest/adminOperations.gen.ts
10
+ var adminOperations_gen_exports = {};
11
+ __export(adminOperations_gen_exports, {
12
+ deleteMyInvitation: () => deleteMyInvitation,
13
+ deleteOrganizationAiProviderConfig: () => deleteOrganizationAiProviderConfig,
14
+ deleteOrganizationBillingPaymentMethod: () => deleteOrganizationBillingPaymentMethod,
15
+ deleteOrganizationBillingSubscription: () => deleteOrganizationBillingSubscription,
16
+ deleteOrganizationInvitation: () => deleteOrganizationInvitation,
17
+ deleteOrganizationMember: () => deleteOrganizationMember,
18
+ deleteOrganizationPublishableKey: () => deleteOrganizationPublishableKey,
19
+ deleteOrganizationWebhookEndpoint: () => deleteOrganizationWebhookEndpoint,
20
+ getAiProviders: () => getAiProviders,
21
+ getBillingProducts: () => getBillingProducts,
22
+ getMyInvitations: () => getMyInvitations,
23
+ getMyOrganizationNotificationPreferences: () => getMyOrganizationNotificationPreferences,
24
+ getMyOrganizations: () => getMyOrganizations,
25
+ getMyPreferences: () => getMyPreferences,
26
+ getOrganization: () => getOrganization,
27
+ getOrganizationAiProviderConfig: () => getOrganizationAiProviderConfig,
28
+ getOrganizationBillingInfo: () => getOrganizationBillingInfo,
29
+ getOrganizationBillingInvoices: () => getOrganizationBillingInvoices,
30
+ getOrganizationBillingPaymentMethods: () => getOrganizationBillingPaymentMethods,
31
+ getOrganizationBillingPromotionCode: () => getOrganizationBillingPromotionCode,
32
+ getOrganizationBillingSubscription: () => getOrganizationBillingSubscription,
33
+ getOrganizationInvitation: () => getOrganizationInvitation,
34
+ getOrganizationInvitations: () => getOrganizationInvitations,
35
+ getOrganizationMembers: () => getOrganizationMembers,
36
+ getOrganizationPublishableKey: () => getOrganizationPublishableKey,
37
+ getOrganizationPublishableKeys: () => getOrganizationPublishableKeys,
38
+ getOrganizationSettings: () => getOrganizationSettings,
39
+ getOrganizationUsageData: () => getOrganizationUsageData,
40
+ getOrganizationUsageTiles: () => getOrganizationUsageTiles,
41
+ getOrganizationWebhookDeliveries: () => getOrganizationWebhookDeliveries,
42
+ getOrganizationWebhookDelivery: () => getOrganizationWebhookDelivery,
43
+ getOrganizationWebhookEndpoint: () => getOrganizationWebhookEndpoint,
44
+ getOrganizationWebhookEndpoints: () => getOrganizationWebhookEndpoints,
45
+ getOrganizationWebhookEvent: () => getOrganizationWebhookEvent,
46
+ getOrganizationWebhookEvents: () => getOrganizationWebhookEvents,
47
+ getOrganizationWebhookHealth: () => getOrganizationWebhookHealth,
48
+ getWebhookEventTypes: () => getWebhookEventTypes,
49
+ patchMyOrganizationNotificationPreferences: () => patchMyOrganizationNotificationPreferences,
50
+ patchMyPreferences: () => patchMyPreferences,
51
+ patchOrganization: () => patchOrganization,
52
+ patchOrganizationAiProviderConfig: () => patchOrganizationAiProviderConfig,
53
+ patchOrganizationBillingInfo: () => patchOrganizationBillingInfo,
54
+ patchOrganizationMember: () => patchOrganizationMember,
55
+ patchOrganizationPublishableKey: () => patchOrganizationPublishableKey,
56
+ patchOrganizationSettings: () => patchOrganizationSettings,
57
+ patchOrganizationWebhookEndpoint: () => patchOrganizationWebhookEndpoint,
58
+ postMyInvitationAccept: () => postMyInvitationAccept,
59
+ postOrganization: () => postOrganization,
60
+ postOrganizationAiProviderConfig: () => postOrganizationAiProviderConfig,
61
+ postOrganizationBillingPaymentMethod: () => postOrganizationBillingPaymentMethod,
62
+ postOrganizationBillingPaymentMethodSetDefault: () => postOrganizationBillingPaymentMethodSetDefault,
63
+ postOrganizationBillingPaymentMethodSetup: () => postOrganizationBillingPaymentMethodSetup,
64
+ postOrganizationBillingProvision: () => postOrganizationBillingProvision,
65
+ postOrganizationBillingSubscription: () => postOrganizationBillingSubscription,
66
+ postOrganizationInvitation: () => postOrganizationInvitation,
67
+ postOrganizationPublishableKey: () => postOrganizationPublishableKey,
68
+ postOrganizationWebhookDelivery: () => postOrganizationWebhookDelivery,
69
+ postOrganizationWebhookEndpoint: () => postOrganizationWebhookEndpoint,
70
+ postSession: () => postSession
71
+ });
72
+
73
+ // src/rest/dates.gen.ts
74
+ var agentRunDates = { created_at: true };
75
+ var collabCollectionChangedEventDates = { occurred_at: true };
76
+ var collabItineraryChangedEventDates = { occurred_at: true };
77
+ var collabMemberDates = { connected_at: true };
78
+ var collabPresenceJoinEventDates = { connected_at: true };
79
+ var collabPresenceSnapshotEventDates = { members: [collabMemberDates] };
80
+ var collabSegmentChangedEventDates = { occurred_at: true };
81
+ var collabStreamEventDates = { connected_at: true, members: [collabMemberDates], occurred_at: true };
82
+ var collabWaypointChangedEventDates = { occurred_at: true };
83
+ var collabZoneChangedEventDates = { occurred_at: true };
84
+ var collectionDates = { created_at: true, updated_at: true };
85
+ var collectionEventObjectDates = { created_at: true, updated_at: true };
86
+ var collectionShareLinkEventObjectDates = { created_at: true };
87
+ var invoiceDates = { created_at: true };
88
+ var invoiceEventObjectDates = { created_at: true };
89
+ var itineraryDates = { created_at: true, updated_at: true };
90
+ var itineraryEventObjectDates = { created_at: true, updated_at: true };
91
+ var itinerarySegmentDates = { created_at: true, start_at: true };
92
+ var itinerarySegmentEventObjectDates = { created_at: true };
93
+ var itinerarySegmentGroupDates = { created_at: true };
94
+ var itinerarySegmentGroupEventObjectDates = { created_at: true };
95
+ var itineraryShareLinkEventObjectDates = { created_at: true };
96
+ var waypointTimingDates = { cutoff_at: true };
97
+ var itineraryWaypointDates = { created_at: true, timing: waypointTimingDates };
98
+ var itineraryWaypointEventObjectDates = { created_at: true };
99
+ var itineraryWithDetailsDates = { created_at: true, groups: [itinerarySegmentGroupDates], published_at: true, segments: [itinerarySegmentDates], updated_at: true, waypoints: [itineraryWaypointDates] };
100
+ var membershipDates = { joined_at: true };
101
+ var organizationDates = { created_at: true, updated_at: true };
102
+ var organizationEventObjectDates = { created_at: true, updated_at: true };
103
+ var organizationInvitationDates = { created_at: true, expires_at: true };
104
+ var organizationInvitationEventObjectDates = { created_at: true, expires_at: true };
105
+ var organizationMemberDates = { joined_at: true };
106
+ var organizationMemberEventObjectDates = { joined_at: true };
107
+ var subscriptionDiscountDates = { ends_at: true };
108
+ var organizationSubscriptionDates = { current_period_end_at: true, discount: subscriptionDiscountDates };
109
+ var organizationSubscriptionEventObjectDates = { current_period_end_at: true };
110
+ var organizationSubscriptionSummaryDates = { api: organizationSubscriptionDates };
111
+ var publishableKeyDates = { created_at: true, last_used_at: true, revoked_at: true };
112
+ var publishableKeyEventObjectDates = { created_at: true, revoked_at: true };
113
+ var secretKeyEventObjectDates = { created_at: true, revoked_at: true };
114
+ var segmentCreateParamsDates = { start_at: true };
115
+ var segmentUpdateParamsDates = { start_at: true };
116
+ var sessionDates = { expires_at: true };
117
+ var shareLinkDates = { created_at: true };
118
+ var userInvitationDates = { created_at: true, expires_at: true };
119
+ var waypointCreateParamsDates = { timing: waypointTimingDates };
120
+ var waypointUpdateParamsDates = { timing: waypointTimingDates };
121
+ var webhookDeliveryDates = { created_at: true, last_attempt_at: true, next_attempt_at: true };
122
+ var webhookDeliveryAttemptDates = { attempted_at: true, scheduled_at: true };
123
+ var webhookDeliveryCreateParamsDates = { since: true };
124
+ var webhookDeliveryTriggerDates = { created_at: true, since: true };
125
+ var webhookDeliveryWithAttemptsDates = { attempts: [webhookDeliveryAttemptDates], created_at: true, last_attempt_at: true, next_attempt_at: true };
126
+ var webhookEndpointDates = { created_at: true, disabled_at: true, failing_since: true, updated_at: true };
127
+ var webhookEndpointEventObjectDates = { created_at: true, failing_since: true, updated_at: true };
128
+ var webhookEndpointWithSecretDates = webhookEndpointDates;
129
+ var webhookEventObjectDates = { created_at: true, current_period_end_at: true, end_at: true, expires_at: true, failing_since: true, joined_at: true, revoked_at: true, start_at: true, updated_at: true };
130
+ var webhookEventDataDates = { object: webhookEventObjectDates };
131
+ var webhookEventDates = { created_at: true, data: webhookEventDataDates };
132
+ var webhookEventWithDeliveriesDates = { created_at: true, data: webhookEventDataDates, deliveries: [webhookDeliveryDates] };
133
+ var webhookHealthDestinationDates = { failing_since: true, last_success_at: true };
134
+ var webhookHealthPointDates = { start_at: true };
135
+ var webhookHealthDates = { destinations: [webhookHealthDestinationDates], end_at: true, series: [webhookHealthPointDates], start_at: true };
136
+ var zoneDates = { created_at: true, end_at: true, published_at: true, start_at: true, updated_at: true };
137
+ var zoneCreateParamsDates = { end_at: true, start_at: true };
138
+ var zoneEventObjectDates = { created_at: true, end_at: true, start_at: true, updated_at: true };
139
+ var zoneUpdateParamsDates = { end_at: true, start_at: true };
140
+ var restSchemaDates = { AgentRun: agentRunDates, CollabCollectionChangedEvent: collabCollectionChangedEventDates, CollabItineraryChangedEvent: collabItineraryChangedEventDates, CollabMember: collabMemberDates, CollabPresenceJoinEvent: collabPresenceJoinEventDates, CollabPresenceSnapshotEvent: collabPresenceSnapshotEventDates, CollabSegmentChangedEvent: collabSegmentChangedEventDates, CollabStreamEvent: collabStreamEventDates, CollabWaypointChangedEvent: collabWaypointChangedEventDates, CollabZoneChangedEvent: collabZoneChangedEventDates, Collection: collectionDates, CollectionEventObject: collectionEventObjectDates, CollectionShareLinkEventObject: collectionShareLinkEventObjectDates, Invoice: invoiceDates, InvoiceEventObject: invoiceEventObjectDates, Itinerary: itineraryDates, ItineraryEventObject: itineraryEventObjectDates, ItinerarySegment: itinerarySegmentDates, ItinerarySegmentEventObject: itinerarySegmentEventObjectDates, ItinerarySegmentGroup: itinerarySegmentGroupDates, ItinerarySegmentGroupEventObject: itinerarySegmentGroupEventObjectDates, ItineraryShareLinkEventObject: itineraryShareLinkEventObjectDates, ItineraryWaypoint: itineraryWaypointDates, ItineraryWaypointEventObject: itineraryWaypointEventObjectDates, ItineraryWithDetails: itineraryWithDetailsDates, Membership: membershipDates, Organization: organizationDates, OrganizationEventObject: organizationEventObjectDates, OrganizationInvitation: organizationInvitationDates, OrganizationInvitationEventObject: organizationInvitationEventObjectDates, OrganizationMember: organizationMemberDates, OrganizationMemberEventObject: organizationMemberEventObjectDates, OrganizationSubscription: organizationSubscriptionDates, OrganizationSubscriptionEventObject: organizationSubscriptionEventObjectDates, OrganizationSubscriptionSummary: organizationSubscriptionSummaryDates, PublishableKey: publishableKeyDates, PublishableKeyEventObject: publishableKeyEventObjectDates, SecretKeyEventObject: secretKeyEventObjectDates, SegmentCreateParams: segmentCreateParamsDates, SegmentUpdateParams: segmentUpdateParamsDates, Session: sessionDates, ShareLink: shareLinkDates, SubscriptionDiscount: subscriptionDiscountDates, UserInvitation: userInvitationDates, WaypointCreateParams: waypointCreateParamsDates, WaypointTiming: waypointTimingDates, WaypointUpdateParams: waypointUpdateParamsDates, WebhookDelivery: webhookDeliveryDates, WebhookDeliveryAttempt: webhookDeliveryAttemptDates, WebhookDeliveryCreateParams: webhookDeliveryCreateParamsDates, WebhookDeliveryTrigger: webhookDeliveryTriggerDates, WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsDates, WebhookEndpoint: webhookEndpointDates, WebhookEndpointEventObject: webhookEndpointEventObjectDates, WebhookEndpointWithSecret: webhookEndpointWithSecretDates, WebhookEvent: webhookEventDates, WebhookEventData: webhookEventDataDates, WebhookEventObject: webhookEventObjectDates, WebhookEventWithDeliveries: webhookEventWithDeliveriesDates, WebhookHealth: webhookHealthDates, WebhookHealthDestination: webhookHealthDestinationDates, WebhookHealthPoint: webhookHealthPointDates, Zone: zoneDates, ZoneCreateParams: zoneCreateParamsDates, ZoneEventObject: zoneEventObjectDates, ZoneUpdateParams: zoneUpdateParamsDates };
141
+
142
+ // src/rest/operations.gen.ts
143
+ var deleteCollection = (transport, args, options) => transport.request({
144
+ actsAsMember: true,
145
+ idempotencyKey: args.idempotencyKey,
146
+ idempotent: true,
147
+ ifMatch: args.ifMatch,
148
+ method: "DELETE",
149
+ operationId: "deleteCollection",
150
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
151
+ requiresSession: true,
152
+ retry: options?.retry,
153
+ serverBudgetMs: 3e4,
154
+ signal: options?.signal,
155
+ surface: "rest",
156
+ takesIdempotencyKey: true,
157
+ timeoutMs: options?.timeoutMs
158
+ });
159
+ var deleteCollectionItinerary = (transport, args, options) => transport.request({
160
+ actsAsMember: true,
161
+ dates: { data: collectionDates },
162
+ idempotencyKey: args.idempotencyKey,
163
+ idempotent: true,
164
+ ifMatch: args.ifMatch,
165
+ method: "DELETE",
166
+ operationId: "deleteCollectionItinerary",
167
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
168
+ requiresSession: true,
169
+ retry: options?.retry,
170
+ serverBudgetMs: 3e4,
171
+ signal: options?.signal,
172
+ surface: "rest",
173
+ takesIdempotencyKey: true,
174
+ timeoutMs: options?.timeoutMs
175
+ });
176
+ var deleteCollectionShareLink = (transport, args, options) => transport.request({
177
+ actsAsMember: true,
178
+ idempotencyKey: args.idempotencyKey,
179
+ idempotent: true,
180
+ method: "DELETE",
181
+ operationId: "deleteCollectionShareLink",
182
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
183
+ requiresSession: true,
184
+ retry: options?.retry,
185
+ serverBudgetMs: 3e4,
186
+ signal: options?.signal,
187
+ surface: "rest",
188
+ takesIdempotencyKey: true,
189
+ timeoutMs: options?.timeoutMs
190
+ });
191
+ var deleteCollectionZone = (transport, args, options) => transport.request({
192
+ actsAsMember: true,
193
+ dates: { data: collectionDates },
194
+ idempotencyKey: args.idempotencyKey,
195
+ idempotent: true,
196
+ ifMatch: args.ifMatch,
197
+ method: "DELETE",
198
+ operationId: "deleteCollectionZone",
199
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones/${encodeURIComponent(String(args.zone_id))}`,
200
+ requiresSession: true,
201
+ retry: options?.retry,
202
+ serverBudgetMs: 3e4,
203
+ signal: options?.signal,
204
+ surface: "rest",
205
+ takesIdempotencyKey: true,
206
+ timeoutMs: options?.timeoutMs
207
+ });
208
+ var deleteItinerary = (transport, args, options) => transport.request({
209
+ actsAsMember: true,
210
+ idempotencyKey: args.idempotencyKey,
211
+ idempotent: true,
212
+ ifMatch: args.ifMatch,
213
+ method: "DELETE",
214
+ operationId: "deleteItinerary",
215
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
216
+ requiresSession: true,
217
+ retry: options?.retry,
218
+ serverBudgetMs: 3e4,
219
+ signal: options?.signal,
220
+ surface: "rest",
221
+ takesIdempotencyKey: true,
222
+ timeoutMs: options?.timeoutMs
223
+ });
224
+ var deleteItineraryPublication = (transport, args, options) => transport.request({
225
+ actsAsMember: true,
226
+ dates: { data: itineraryWithDetailsDates },
227
+ idempotencyKey: args.idempotencyKey,
228
+ idempotent: true,
229
+ ifMatch: args.ifMatch,
230
+ method: "DELETE",
231
+ operationId: "deleteItineraryPublication",
232
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/publication`,
233
+ requiresSession: true,
234
+ retry: options?.retry,
235
+ serverBudgetMs: 3e4,
236
+ signal: options?.signal,
237
+ surface: "rest",
238
+ takesIdempotencyKey: true,
239
+ timeoutMs: options?.timeoutMs
240
+ });
241
+ var deleteItinerarySegment = (transport, args, options) => transport.request({
242
+ actsAsMember: true,
243
+ dates: { data: itineraryWithDetailsDates },
244
+ idempotencyKey: args.idempotencyKey,
245
+ idempotent: true,
246
+ ifMatch: args.ifMatch,
247
+ method: "DELETE",
248
+ operationId: "deleteItinerarySegment",
249
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}`,
250
+ requiresSession: true,
251
+ retry: options?.retry,
252
+ serverBudgetMs: 3e4,
253
+ signal: options?.signal,
254
+ surface: "rest",
255
+ takesIdempotencyKey: true,
256
+ timeoutMs: options?.timeoutMs
257
+ });
258
+ var deleteItinerarySegmentGroup = (transport, args, options) => transport.request({
259
+ actsAsMember: true,
260
+ dates: { data: itineraryWithDetailsDates },
261
+ idempotencyKey: args.idempotencyKey,
262
+ idempotent: true,
263
+ ifMatch: args.ifMatch,
264
+ method: "DELETE",
265
+ operationId: "deleteItinerarySegmentGroup",
266
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups/${encodeURIComponent(String(args.group_id))}`,
267
+ requiresSession: true,
268
+ retry: options?.retry,
269
+ serverBudgetMs: 3e4,
270
+ signal: options?.signal,
271
+ surface: "rest",
272
+ takesIdempotencyKey: true,
273
+ timeoutMs: options?.timeoutMs
274
+ });
275
+ var deleteItineraryShareLink = (transport, args, options) => transport.request({
276
+ actsAsMember: true,
277
+ idempotencyKey: args.idempotencyKey,
278
+ idempotent: true,
279
+ method: "DELETE",
280
+ operationId: "deleteItineraryShareLink",
281
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
282
+ requiresSession: true,
283
+ retry: options?.retry,
284
+ serverBudgetMs: 3e4,
285
+ signal: options?.signal,
286
+ surface: "rest",
287
+ takesIdempotencyKey: true,
288
+ timeoutMs: options?.timeoutMs
289
+ });
290
+ var deleteItineraryWaypoint = (transport, args, options) => transport.request({
291
+ actsAsMember: true,
292
+ dates: { data: itineraryWithDetailsDates },
293
+ idempotencyKey: args.idempotencyKey,
294
+ idempotent: true,
295
+ ifMatch: args.ifMatch,
296
+ method: "DELETE",
297
+ operationId: "deleteItineraryWaypoint",
298
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints/${encodeURIComponent(String(args.waypoint_id))}`,
299
+ requiresSession: true,
300
+ retry: options?.retry,
301
+ serverBudgetMs: 3e4,
302
+ signal: options?.signal,
303
+ surface: "rest",
304
+ takesIdempotencyKey: true,
305
+ timeoutMs: options?.timeoutMs
306
+ });
307
+ var deleteMyInvitation = (transport, args, options) => transport.request({
308
+ actsAsMember: true,
309
+ idempotencyKey: args.idempotencyKey,
310
+ idempotent: true,
311
+ method: "DELETE",
312
+ operationId: "deleteMyInvitation",
313
+ path: `/v1/me/invitations/${encodeURIComponent(String(args.invitation_id))}`,
314
+ requiresSession: true,
315
+ retry: options?.retry,
316
+ serverBudgetMs: 3e4,
317
+ signal: options?.signal,
318
+ surface: "rest",
319
+ takesIdempotencyKey: true,
320
+ timeoutMs: options?.timeoutMs
321
+ });
322
+ var deleteOrganizationAiProviderConfig = (transport, args, options) => transport.request({
323
+ actsAsMember: true,
324
+ idempotencyKey: args.idempotencyKey,
325
+ idempotent: true,
326
+ ifMatch: args.ifMatch,
327
+ method: "DELETE",
328
+ operationId: "deleteOrganizationAiProviderConfig",
329
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
330
+ requiresSession: true,
331
+ retry: options?.retry,
332
+ serverBudgetMs: 3e4,
333
+ signal: options?.signal,
334
+ surface: "rest",
335
+ takesIdempotencyKey: true,
336
+ timeoutMs: options?.timeoutMs
337
+ });
338
+ var deleteOrganizationBillingPaymentMethod = (transport, args, options) => transport.request({
339
+ actsAsMember: true,
340
+ idempotencyKey: args.idempotencyKey,
341
+ idempotent: true,
342
+ method: "DELETE",
343
+ operationId: "deleteOrganizationBillingPaymentMethod",
344
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/${encodeURIComponent(String(args.payment_method_id))}`,
345
+ requiresSession: true,
346
+ retry: options?.retry,
347
+ serverBudgetMs: 3e4,
348
+ signal: options?.signal,
349
+ surface: "rest",
350
+ takesIdempotencyKey: true,
351
+ timeoutMs: options?.timeoutMs
352
+ });
353
+ var deleteOrganizationBillingSubscription = (transport, args, options) => transport.request({
354
+ actsAsMember: true,
355
+ dates: { data: organizationSubscriptionSummaryDates },
356
+ idempotencyKey: args.idempotencyKey,
357
+ idempotent: true,
358
+ method: "DELETE",
359
+ operationId: "deleteOrganizationBillingSubscription",
360
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
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
+ var deleteOrganizationInvitation = (transport, args, options) => transport.request({
370
+ actsAsMember: true,
371
+ idempotencyKey: args.idempotencyKey,
372
+ idempotent: true,
373
+ method: "DELETE",
374
+ operationId: "deleteOrganizationInvitation",
375
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations/${encodeURIComponent(String(args.invitation_id))}`,
376
+ requiresSession: true,
377
+ retry: options?.retry,
378
+ serverBudgetMs: 3e4,
379
+ signal: options?.signal,
380
+ surface: "rest",
381
+ takesIdempotencyKey: true,
382
+ timeoutMs: options?.timeoutMs
383
+ });
384
+ var deleteOrganizationMember = (transport, args, options) => transport.request({
385
+ actsAsMember: true,
386
+ idempotencyKey: args.idempotencyKey,
387
+ idempotent: true,
388
+ method: "DELETE",
389
+ operationId: "deleteOrganizationMember",
390
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members/${encodeURIComponent(String(args.user_id))}`,
391
+ requiresSession: true,
392
+ retry: options?.retry,
393
+ serverBudgetMs: 3e4,
394
+ signal: options?.signal,
395
+ surface: "rest",
396
+ takesIdempotencyKey: true,
397
+ timeoutMs: options?.timeoutMs
398
+ });
399
+ var deleteOrganizationPublishableKey = (transport, args, options) => transport.request({
400
+ actsAsMember: true,
401
+ dates: { data: publishableKeyDates },
402
+ idempotencyKey: args.idempotencyKey,
403
+ idempotent: true,
404
+ ifMatch: args.ifMatch,
405
+ method: "DELETE",
406
+ operationId: "deleteOrganizationPublishableKey",
407
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
408
+ requiresSession: true,
409
+ retry: options?.retry,
410
+ serverBudgetMs: 3e4,
411
+ signal: options?.signal,
412
+ surface: "rest",
413
+ takesIdempotencyKey: true,
414
+ timeoutMs: options?.timeoutMs
415
+ });
416
+ var deleteOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
417
+ actsAsMember: true,
418
+ idempotencyKey: args.idempotencyKey,
419
+ idempotent: true,
420
+ ifMatch: args.ifMatch,
421
+ method: "DELETE",
422
+ operationId: "deleteOrganizationWebhookEndpoint",
423
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
424
+ requiresSession: true,
425
+ retry: options?.retry,
426
+ serverBudgetMs: 3e4,
427
+ signal: options?.signal,
428
+ surface: "rest",
429
+ takesIdempotencyKey: true,
430
+ timeoutMs: options?.timeoutMs
431
+ });
432
+ var deleteZone = (transport, args, options) => transport.request({
433
+ actsAsMember: true,
434
+ idempotencyKey: args.idempotencyKey,
435
+ idempotent: true,
436
+ ifMatch: args.ifMatch,
437
+ method: "DELETE",
438
+ operationId: "deleteZone",
439
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
440
+ requiresSession: true,
441
+ retry: options?.retry,
442
+ serverBudgetMs: 3e4,
443
+ signal: options?.signal,
444
+ surface: "rest",
445
+ takesIdempotencyKey: true,
446
+ timeoutMs: options?.timeoutMs
447
+ });
448
+ var deleteZonePublication = (transport, args, options) => transport.request({
449
+ actsAsMember: true,
450
+ dates: { data: zoneDates },
451
+ idempotencyKey: args.idempotencyKey,
452
+ idempotent: true,
453
+ ifMatch: args.ifMatch,
454
+ method: "DELETE",
455
+ operationId: "deleteZonePublication",
456
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/publication`,
457
+ requiresSession: true,
458
+ retry: options?.retry,
459
+ serverBudgetMs: 3e4,
460
+ signal: options?.signal,
461
+ surface: "rest",
462
+ takesIdempotencyKey: true,
463
+ timeoutMs: options?.timeoutMs
464
+ });
465
+ var getActivities = (transport, options) => transport.request({
466
+ acceptsShareToken: true,
467
+ idempotent: true,
468
+ method: "GET",
469
+ operationId: "getActivities",
470
+ path: "/v1/activities",
471
+ retry: options?.retry,
472
+ serverBudgetMs: 3e4,
473
+ signal: options?.signal,
474
+ surface: "rest",
475
+ timeoutMs: options?.timeoutMs
476
+ });
477
+ var getAgentRunEvents = (transport, args, options) => transport.requestBinary({
478
+ accept: "text/event-stream",
479
+ actsAsMember: true,
480
+ idempotent: true,
481
+ method: "GET",
482
+ operationId: "getAgentRunEvents",
483
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/events`,
484
+ requiresSession: true,
485
+ retry: options?.retry,
486
+ signal: options?.signal,
487
+ surface: "rest",
488
+ timeoutMs: options?.timeoutMs
489
+ });
490
+ var getAiProviders = (transport, options) => transport.request({
491
+ idempotent: true,
492
+ method: "GET",
493
+ operationId: "getAiProviders",
494
+ path: "/v1/ai-providers",
495
+ requiresSession: true,
496
+ retry: options?.retry,
497
+ serverBudgetMs: 3e4,
498
+ signal: options?.signal,
499
+ surface: "rest",
500
+ timeoutMs: options?.timeoutMs
501
+ });
502
+ var getBillingProducts = (transport, options) => transport.request({
503
+ idempotent: true,
504
+ method: "GET",
505
+ operationId: "getBillingProducts",
506
+ path: "/v1/billing/products",
507
+ requiresSession: true,
508
+ retry: options?.retry,
509
+ serverBudgetMs: 3e4,
510
+ signal: options?.signal,
511
+ surface: "rest",
512
+ timeoutMs: options?.timeoutMs
513
+ });
514
+ var getCollection = (transport, args, options) => transport.request({
515
+ acceptsShareToken: true,
516
+ dates: { data: collectionDates },
517
+ idempotent: true,
518
+ method: "GET",
519
+ operationId: "getCollection",
520
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
521
+ retry: options?.retry,
522
+ serverBudgetMs: 3e4,
523
+ signal: options?.signal,
524
+ surface: "rest",
525
+ timeoutMs: options?.timeoutMs
526
+ });
527
+ var getCollectionItineraries = (transport, args, options) => transport.request({
528
+ acceptsShareToken: true,
529
+ dates: { data: [itineraryDates] },
530
+ idempotent: true,
531
+ method: "GET",
532
+ operationId: "getCollectionItineraries",
533
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries`,
534
+ query: args.query,
535
+ retry: options?.retry,
536
+ serverBudgetMs: 3e4,
537
+ signal: options?.signal,
538
+ surface: "rest",
539
+ timeoutMs: options?.timeoutMs
540
+ });
541
+ var getCollections = (transport, args = {}, options) => transport.request({
542
+ dates: { data: [collectionDates] },
543
+ idempotent: true,
544
+ method: "GET",
545
+ operationId: "getCollections",
546
+ path: "/v1/collections",
547
+ query: args.query,
548
+ retry: options?.retry,
549
+ serverBudgetMs: 3e4,
550
+ signal: options?.signal,
551
+ surface: "rest",
552
+ timeoutMs: options?.timeoutMs
553
+ });
554
+ var getCollectionShareLink = (transport, args, options) => transport.request({
555
+ actsAsMember: true,
556
+ dates: { data: shareLinkDates },
557
+ idempotent: true,
558
+ method: "GET",
559
+ operationId: "getCollectionShareLink",
560
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
561
+ requiresSession: true,
562
+ retry: options?.retry,
563
+ serverBudgetMs: 3e4,
564
+ signal: options?.signal,
565
+ surface: "rest",
566
+ timeoutMs: options?.timeoutMs
567
+ });
568
+ var getCollectionZones = (transport, args, options) => transport.request({
569
+ acceptsShareToken: true,
570
+ dates: { data: [zoneDates] },
571
+ idempotent: true,
572
+ method: "GET",
573
+ operationId: "getCollectionZones",
574
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones`,
575
+ query: args.query,
576
+ retry: options?.retry,
577
+ serverBudgetMs: 3e4,
578
+ signal: options?.signal,
579
+ surface: "rest",
580
+ timeoutMs: options?.timeoutMs
581
+ });
582
+ var getItineraries = (transport, args = {}, options) => transport.request({
583
+ dates: { data: [itineraryDates] },
584
+ idempotent: true,
585
+ method: "GET",
586
+ operationId: "getItineraries",
587
+ path: "/v1/itineraries",
588
+ query: args.query,
589
+ retry: options?.retry,
590
+ serverBudgetMs: 3e4,
591
+ signal: options?.signal,
592
+ surface: "rest",
593
+ timeoutMs: options?.timeoutMs
594
+ });
595
+ var getItinerary = (transport, args, options) => transport.request({
596
+ acceptsShareToken: true,
597
+ dates: { data: itineraryWithDetailsDates },
598
+ idempotent: true,
599
+ method: "GET",
600
+ operationId: "getItinerary",
601
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
602
+ query: args.query,
603
+ retry: options?.retry,
604
+ serverBudgetMs: 3e4,
605
+ signal: options?.signal,
606
+ surface: "rest",
607
+ timeoutMs: options?.timeoutMs
608
+ });
609
+ var getItineraryEvents = (transport, args, options) => transport.requestBinary({
610
+ accept: "text/event-stream",
611
+ actsAsMember: true,
612
+ idempotent: true,
613
+ method: "GET",
614
+ operationId: "getItineraryEvents",
615
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/events`,
616
+ requiresSession: true,
617
+ retry: options?.retry,
618
+ signal: options?.signal,
619
+ surface: "rest",
620
+ timeoutMs: options?.timeoutMs
621
+ });
622
+ var getItineraryExport = (transport, args, options) => transport.requestBinary({
623
+ 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",
624
+ acceptsShareToken: true,
625
+ idempotent: true,
626
+ method: "GET",
627
+ operationId: "getItineraryExport",
628
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/export`,
629
+ query: args.query,
630
+ retry: options?.retry,
631
+ serverBudgetMs: 3e4,
632
+ signal: options?.signal,
633
+ surface: "rest",
634
+ timeoutMs: options?.timeoutMs
635
+ });
636
+ var getItineraryPace = (transport, args, options) => transport.request({
637
+ acceptsShareToken: true,
638
+ idempotent: true,
639
+ method: "GET",
640
+ operationId: "getItineraryPace",
641
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/pace`,
642
+ query: args.query,
643
+ retry: options?.retry,
644
+ serverBudgetMs: 3e4,
645
+ signal: options?.signal,
646
+ surface: "rest",
647
+ timeoutMs: options?.timeoutMs
648
+ });
649
+ var getItineraryShareLink = (transport, args, options) => transport.request({
650
+ actsAsMember: true,
651
+ dates: { data: shareLinkDates },
652
+ idempotent: true,
653
+ method: "GET",
654
+ operationId: "getItineraryShareLink",
655
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
656
+ requiresSession: true,
657
+ retry: options?.retry,
658
+ serverBudgetMs: 3e4,
659
+ signal: options?.signal,
660
+ surface: "rest",
661
+ timeoutMs: options?.timeoutMs
662
+ });
663
+ var getLayers = (transport, args = {}, options) => transport.request({
664
+ acceptsShareToken: true,
665
+ idempotent: true,
666
+ method: "GET",
667
+ operationId: "getLayers",
668
+ path: "/v1/layers",
669
+ query: args.query,
670
+ retry: options?.retry,
671
+ serverBudgetMs: 3e4,
672
+ signal: options?.signal,
673
+ surface: "rest",
674
+ timeoutMs: options?.timeoutMs
675
+ });
676
+ var getMyInvitations = (transport, args = {}, options) => transport.request({
677
+ actsAsMember: true,
678
+ dates: { data: [userInvitationDates] },
679
+ idempotent: true,
680
+ method: "GET",
681
+ operationId: "getMyInvitations",
682
+ path: "/v1/me/invitations",
683
+ query: args.query,
684
+ requiresSession: true,
685
+ retry: options?.retry,
686
+ serverBudgetMs: 3e4,
687
+ signal: options?.signal,
688
+ surface: "rest",
689
+ timeoutMs: options?.timeoutMs
690
+ });
691
+ var getMyOrganizationNotificationPreferences = (transport, args, options) => transport.request({
692
+ actsAsMember: true,
693
+ idempotent: true,
694
+ method: "GET",
695
+ operationId: "getMyOrganizationNotificationPreferences",
696
+ path: `/v1/me/organizations/${encodeURIComponent(String(args.organization_id))}/notification-preferences`,
697
+ requiresSession: true,
698
+ retry: options?.retry,
699
+ serverBudgetMs: 3e4,
700
+ signal: options?.signal,
701
+ surface: "rest",
702
+ timeoutMs: options?.timeoutMs
703
+ });
704
+ var getMyOrganizations = (transport, args = {}, options) => transport.request({
705
+ actsAsMember: true,
706
+ dates: { data: [membershipDates] },
707
+ idempotent: true,
708
+ method: "GET",
709
+ operationId: "getMyOrganizations",
710
+ path: "/v1/me/organizations",
711
+ query: args.query,
712
+ requiresSession: true,
713
+ retry: options?.retry,
714
+ serverBudgetMs: 3e4,
715
+ signal: options?.signal,
716
+ surface: "rest",
717
+ timeoutMs: options?.timeoutMs
718
+ });
719
+ var getMyPreferences = (transport, options) => transport.request({
720
+ actsAsMember: true,
721
+ idempotent: true,
722
+ method: "GET",
723
+ operationId: "getMyPreferences",
724
+ path: "/v1/me/preferences",
725
+ requiresSession: true,
726
+ retry: options?.retry,
727
+ serverBudgetMs: 3e4,
728
+ signal: options?.signal,
729
+ surface: "rest",
730
+ timeoutMs: options?.timeoutMs
731
+ });
732
+ var getOrganization = (transport, args, options) => transport.request({
733
+ acceptsShareToken: true,
734
+ dates: { data: organizationDates },
735
+ idempotent: true,
736
+ method: "GET",
737
+ operationId: "getOrganization",
738
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}`,
739
+ retry: options?.retry,
740
+ serverBudgetMs: 3e4,
741
+ signal: options?.signal,
742
+ surface: "rest",
743
+ timeoutMs: options?.timeoutMs
744
+ });
745
+ var getOrganizationAiProviderConfig = (transport, args, options) => transport.request({
746
+ idempotent: true,
747
+ method: "GET",
748
+ operationId: "getOrganizationAiProviderConfig",
749
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
750
+ requiresSession: true,
751
+ retry: options?.retry,
752
+ serverBudgetMs: 3e4,
753
+ signal: options?.signal,
754
+ surface: "rest",
755
+ timeoutMs: options?.timeoutMs
756
+ });
757
+ var getOrganizationBillingInfo = (transport, args, options) => transport.request({
758
+ idempotent: true,
759
+ method: "GET",
760
+ operationId: "getOrganizationBillingInfo",
761
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/info`,
762
+ requiresSession: true,
763
+ retry: options?.retry,
764
+ serverBudgetMs: 3e4,
765
+ signal: options?.signal,
766
+ surface: "rest",
767
+ timeoutMs: options?.timeoutMs
768
+ });
769
+ var getOrganizationBillingInvoices = (transport, args, options) => transport.request({
770
+ dates: { data: [invoiceDates] },
771
+ idempotent: true,
772
+ method: "GET",
773
+ operationId: "getOrganizationBillingInvoices",
774
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/invoices`,
775
+ query: args.query,
776
+ requiresSession: true,
777
+ retry: options?.retry,
778
+ serverBudgetMs: 3e4,
779
+ signal: options?.signal,
780
+ surface: "rest",
781
+ timeoutMs: options?.timeoutMs
782
+ });
783
+ var getOrganizationBillingPaymentMethods = (transport, args, options) => transport.request({
784
+ idempotent: true,
785
+ method: "GET",
786
+ operationId: "getOrganizationBillingPaymentMethods",
787
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods`,
788
+ query: args.query,
789
+ requiresSession: true,
790
+ retry: options?.retry,
791
+ serverBudgetMs: 3e4,
792
+ signal: options?.signal,
793
+ surface: "rest",
794
+ timeoutMs: options?.timeoutMs
795
+ });
796
+ var getOrganizationBillingPromotionCode = (transport, args, options) => transport.request({
797
+ idempotent: true,
798
+ method: "GET",
799
+ operationId: "getOrganizationBillingPromotionCode",
800
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/promotion-codes/${encodeURIComponent(String(args.code))}`,
801
+ requiresSession: true,
802
+ retry: options?.retry,
803
+ serverBudgetMs: 3e4,
804
+ signal: options?.signal,
805
+ surface: "rest",
806
+ timeoutMs: options?.timeoutMs
807
+ });
808
+ var getOrganizationBillingSubscription = (transport, args, options) => transport.request({
809
+ dates: { data: organizationSubscriptionSummaryDates },
810
+ idempotent: true,
811
+ method: "GET",
812
+ operationId: "getOrganizationBillingSubscription",
813
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
814
+ requiresSession: true,
815
+ retry: options?.retry,
816
+ serverBudgetMs: 3e4,
817
+ signal: options?.signal,
818
+ surface: "rest",
819
+ timeoutMs: options?.timeoutMs
820
+ });
821
+ var getOrganizationEvents = (transport, args, options) => transport.requestBinary({
822
+ accept: "text/event-stream",
823
+ actsAsMember: true,
824
+ idempotent: true,
825
+ method: "GET",
826
+ operationId: "getOrganizationEvents",
827
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/events`,
828
+ requiresSession: true,
829
+ retry: options?.retry,
830
+ signal: options?.signal,
831
+ surface: "rest",
832
+ timeoutMs: options?.timeoutMs
833
+ });
834
+ var getOrganizationInvitation = (transport, args, options) => transport.request({
835
+ dates: { data: organizationInvitationDates },
836
+ idempotent: true,
837
+ method: "GET",
838
+ operationId: "getOrganizationInvitation",
839
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations/${encodeURIComponent(String(args.invitation_id))}`,
840
+ requiresSession: true,
841
+ retry: options?.retry,
842
+ serverBudgetMs: 3e4,
843
+ signal: options?.signal,
844
+ surface: "rest",
845
+ timeoutMs: options?.timeoutMs
846
+ });
847
+ var getOrganizationInvitations = (transport, args, options) => transport.request({
848
+ dates: { data: [organizationInvitationDates] },
849
+ idempotent: true,
850
+ method: "GET",
851
+ operationId: "getOrganizationInvitations",
852
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations`,
853
+ query: args.query,
854
+ requiresSession: true,
855
+ retry: options?.retry,
856
+ serverBudgetMs: 3e4,
857
+ signal: options?.signal,
858
+ surface: "rest",
859
+ timeoutMs: options?.timeoutMs
860
+ });
861
+ var getOrganizationMembers = (transport, args, options) => transport.request({
862
+ dates: { data: [organizationMemberDates] },
863
+ idempotent: true,
864
+ method: "GET",
865
+ operationId: "getOrganizationMembers",
866
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members`,
867
+ query: args.query,
868
+ requiresSession: true,
869
+ retry: options?.retry,
870
+ serverBudgetMs: 3e4,
871
+ signal: options?.signal,
872
+ surface: "rest",
873
+ timeoutMs: options?.timeoutMs
874
+ });
875
+ var getOrganizationPublishableKey = (transport, args, options) => transport.request({
876
+ dates: { data: publishableKeyDates },
877
+ idempotent: true,
878
+ method: "GET",
879
+ operationId: "getOrganizationPublishableKey",
880
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
881
+ requiresSession: true,
882
+ retry: options?.retry,
883
+ serverBudgetMs: 3e4,
884
+ signal: options?.signal,
885
+ surface: "rest",
886
+ timeoutMs: options?.timeoutMs
887
+ });
888
+ var getOrganizationPublishableKeys = (transport, args, options) => transport.request({
889
+ dates: { data: [publishableKeyDates] },
890
+ idempotent: true,
891
+ method: "GET",
892
+ operationId: "getOrganizationPublishableKeys",
893
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys`,
894
+ query: args.query,
895
+ requiresSession: true,
896
+ retry: options?.retry,
897
+ serverBudgetMs: 3e4,
898
+ signal: options?.signal,
899
+ surface: "rest",
900
+ timeoutMs: options?.timeoutMs
901
+ });
902
+ var getOrganizationSettings = (transport, args, options) => transport.request({
903
+ idempotent: true,
904
+ method: "GET",
905
+ operationId: "getOrganizationSettings",
906
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/settings`,
907
+ requiresSession: true,
908
+ retry: options?.retry,
909
+ serverBudgetMs: 3e4,
910
+ signal: options?.signal,
911
+ surface: "rest",
912
+ timeoutMs: options?.timeoutMs
913
+ });
914
+ var getOrganizationUsageData = (transport, args, options) => transport.request({
915
+ idempotent: true,
916
+ method: "GET",
917
+ operationId: "getOrganizationUsageData",
918
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/usage/data`,
919
+ query: args.query,
920
+ requiresSession: true,
921
+ retry: options?.retry,
922
+ serverBudgetMs: 3e4,
923
+ signal: options?.signal,
924
+ surface: "rest",
925
+ timeoutMs: options?.timeoutMs
926
+ });
927
+ var getOrganizationUsageTiles = (transport, args, options) => transport.request({
928
+ idempotent: true,
929
+ method: "GET",
930
+ operationId: "getOrganizationUsageTiles",
931
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/usage/tiles`,
932
+ query: args.query,
933
+ requiresSession: true,
934
+ retry: options?.retry,
935
+ serverBudgetMs: 3e4,
936
+ signal: options?.signal,
937
+ surface: "rest",
938
+ timeoutMs: options?.timeoutMs
939
+ });
940
+ var getOrganizationWebhookDeliveries = (transport, args, options) => transport.request({
941
+ dates: { data: [webhookDeliveryDates] },
942
+ idempotent: true,
943
+ method: "GET",
944
+ operationId: "getOrganizationWebhookDeliveries",
945
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries`,
946
+ query: args.query,
947
+ requiresSession: true,
948
+ retry: options?.retry,
949
+ serverBudgetMs: 3e4,
950
+ signal: options?.signal,
951
+ surface: "rest",
952
+ timeoutMs: options?.timeoutMs
953
+ });
954
+ var getOrganizationWebhookDelivery = (transport, args, options) => transport.request({
955
+ dates: { data: webhookDeliveryWithAttemptsDates },
956
+ idempotent: true,
957
+ method: "GET",
958
+ operationId: "getOrganizationWebhookDelivery",
959
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries/${encodeURIComponent(String(args.delivery_id))}`,
960
+ requiresSession: true,
961
+ retry: options?.retry,
962
+ serverBudgetMs: 3e4,
963
+ signal: options?.signal,
964
+ surface: "rest",
965
+ timeoutMs: options?.timeoutMs
966
+ });
967
+ var getOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
968
+ dates: { data: webhookEndpointDates },
969
+ idempotent: true,
970
+ method: "GET",
971
+ operationId: "getOrganizationWebhookEndpoint",
972
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
973
+ requiresSession: true,
974
+ retry: options?.retry,
975
+ serverBudgetMs: 3e4,
976
+ signal: options?.signal,
977
+ surface: "rest",
978
+ timeoutMs: options?.timeoutMs
979
+ });
980
+ var getOrganizationWebhookEndpoints = (transport, args, options) => transport.request({
981
+ dates: { data: [webhookEndpointDates] },
982
+ idempotent: true,
983
+ method: "GET",
984
+ operationId: "getOrganizationWebhookEndpoints",
985
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints`,
986
+ query: args.query,
987
+ requiresSession: true,
988
+ retry: options?.retry,
989
+ serverBudgetMs: 3e4,
990
+ signal: options?.signal,
991
+ surface: "rest",
992
+ timeoutMs: options?.timeoutMs
993
+ });
994
+ var getOrganizationWebhookEvent = (transport, args, options) => transport.request({
995
+ dates: { data: webhookEventWithDeliveriesDates },
996
+ idempotent: true,
997
+ method: "GET",
998
+ operationId: "getOrganizationWebhookEvent",
999
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-events/${encodeURIComponent(String(args.event_id))}`,
1000
+ requiresSession: true,
1001
+ retry: options?.retry,
1002
+ serverBudgetMs: 3e4,
1003
+ signal: options?.signal,
1004
+ surface: "rest",
1005
+ timeoutMs: options?.timeoutMs
1006
+ });
1007
+ var getOrganizationWebhookEvents = (transport, args, options) => transport.request({
1008
+ dates: { data: [webhookEventDates] },
1009
+ idempotent: true,
1010
+ method: "GET",
1011
+ operationId: "getOrganizationWebhookEvents",
1012
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-events`,
1013
+ query: args.query,
1014
+ requiresSession: true,
1015
+ retry: options?.retry,
1016
+ serverBudgetMs: 3e4,
1017
+ signal: options?.signal,
1018
+ surface: "rest",
1019
+ timeoutMs: options?.timeoutMs
1020
+ });
1021
+ var getOrganizationWebhookHealth = (transport, args, options) => transport.request({
1022
+ dates: { data: webhookHealthDates },
1023
+ idempotent: true,
1024
+ method: "GET",
1025
+ operationId: "getOrganizationWebhookHealth",
1026
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-health`,
1027
+ query: args.query,
1028
+ requiresSession: true,
1029
+ retry: options?.retry,
1030
+ serverBudgetMs: 3e4,
1031
+ signal: options?.signal,
1032
+ surface: "rest",
1033
+ timeoutMs: options?.timeoutMs
1034
+ });
1035
+ var getWebhookEventTypes = (transport, options) => transport.request({
1036
+ idempotent: true,
1037
+ method: "GET",
1038
+ operationId: "getWebhookEventTypes",
1039
+ path: "/v1/webhook-event-types",
1040
+ requiresSession: true,
1041
+ retry: options?.retry,
1042
+ serverBudgetMs: 3e4,
1043
+ signal: options?.signal,
1044
+ surface: "rest",
1045
+ timeoutMs: options?.timeoutMs
1046
+ });
1047
+ var getZone = (transport, args, options) => transport.request({
1048
+ acceptsShareToken: true,
1049
+ dates: { data: zoneDates },
1050
+ idempotent: true,
1051
+ method: "GET",
1052
+ operationId: "getZone",
1053
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
1054
+ query: args.query,
1055
+ retry: options?.retry,
1056
+ serverBudgetMs: 3e4,
1057
+ signal: options?.signal,
1058
+ surface: "rest",
1059
+ timeoutMs: options?.timeoutMs
1060
+ });
1061
+ var getZoneEvents = (transport, args, options) => transport.requestBinary({
1062
+ accept: "text/event-stream",
1063
+ actsAsMember: true,
1064
+ idempotent: true,
1065
+ method: "GET",
1066
+ operationId: "getZoneEvents",
1067
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/events`,
1068
+ requiresSession: true,
1069
+ retry: options?.retry,
1070
+ signal: options?.signal,
1071
+ surface: "rest",
1072
+ timeoutMs: options?.timeoutMs
1073
+ });
1074
+ var getZones = (transport, args = {}, options) => transport.request({
1075
+ dates: { data: [zoneDates] },
1076
+ idempotent: true,
1077
+ method: "GET",
1078
+ operationId: "getZones",
1079
+ path: "/v1/zones",
1080
+ query: args.query,
1081
+ retry: options?.retry,
1082
+ serverBudgetMs: 3e4,
1083
+ signal: options?.signal,
1084
+ surface: "rest",
1085
+ timeoutMs: options?.timeoutMs
1086
+ });
1087
+ var patchCollection = (transport, args, options) => transport.request({
1088
+ actsAsMember: true,
1089
+ body: args.body,
1090
+ dates: { data: collectionDates },
1091
+ idempotencyKey: args.idempotencyKey,
1092
+ idempotent: true,
1093
+ ifMatch: args.ifMatch,
1094
+ method: "PATCH",
1095
+ operationId: "patchCollection",
1096
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}`,
1097
+ requiresSession: true,
1098
+ retry: options?.retry,
1099
+ serverBudgetMs: 3e4,
1100
+ signal: options?.signal,
1101
+ surface: "rest",
1102
+ takesIdempotencyKey: true,
1103
+ timeoutMs: options?.timeoutMs
1104
+ });
1105
+ var patchCollectionItinerary = (transport, args, options) => transport.request({
1106
+ actsAsMember: true,
1107
+ body: args.body,
1108
+ dates: { data: collectionDates },
1109
+ idempotencyKey: args.idempotencyKey,
1110
+ idempotent: true,
1111
+ ifMatch: args.ifMatch,
1112
+ method: "PATCH",
1113
+ operationId: "patchCollectionItinerary",
1114
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
1115
+ requiresSession: true,
1116
+ retry: options?.retry,
1117
+ serverBudgetMs: 3e4,
1118
+ signal: options?.signal,
1119
+ surface: "rest",
1120
+ takesIdempotencyKey: true,
1121
+ timeoutMs: options?.timeoutMs
1122
+ });
1123
+ var patchItinerary = (transport, args, options) => transport.request({
1124
+ actsAsMember: true,
1125
+ body: args.body,
1126
+ dates: { data: itineraryWithDetailsDates },
1127
+ idempotencyKey: args.idempotencyKey,
1128
+ idempotent: true,
1129
+ ifMatch: args.ifMatch,
1130
+ method: "PATCH",
1131
+ operationId: "patchItinerary",
1132
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}`,
1133
+ requiresSession: true,
1134
+ retry: options?.retry,
1135
+ serverBudgetMs: 3e4,
1136
+ signal: options?.signal,
1137
+ surface: "rest",
1138
+ takesIdempotencyKey: true,
1139
+ timeoutMs: options?.timeoutMs
1140
+ });
1141
+ var patchItinerarySegment = (transport, args, options) => transport.request({
1142
+ actsAsMember: true,
1143
+ body: args.body,
1144
+ dates: { data: itineraryWithDetailsDates },
1145
+ idempotencyKey: args.idempotencyKey,
1146
+ idempotent: true,
1147
+ ifMatch: args.ifMatch,
1148
+ method: "PATCH",
1149
+ operationId: "patchItinerarySegment",
1150
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}`,
1151
+ requiresSession: true,
1152
+ retry: options?.retry,
1153
+ serverBudgetMs: 3e4,
1154
+ signal: options?.signal,
1155
+ surface: "rest",
1156
+ takesIdempotencyKey: true,
1157
+ timeoutMs: options?.timeoutMs
1158
+ });
1159
+ var patchItinerarySegmentGroup = (transport, args, options) => transport.request({
1160
+ actsAsMember: true,
1161
+ body: args.body,
1162
+ dates: { data: itineraryWithDetailsDates },
1163
+ idempotencyKey: args.idempotencyKey,
1164
+ idempotent: true,
1165
+ ifMatch: args.ifMatch,
1166
+ method: "PATCH",
1167
+ operationId: "patchItinerarySegmentGroup",
1168
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups/${encodeURIComponent(String(args.group_id))}`,
1169
+ requiresSession: true,
1170
+ retry: options?.retry,
1171
+ serverBudgetMs: 3e4,
1172
+ signal: options?.signal,
1173
+ surface: "rest",
1174
+ takesIdempotencyKey: true,
1175
+ timeoutMs: options?.timeoutMs
1176
+ });
1177
+ var patchItineraryWaypoint = (transport, args, options) => transport.request({
1178
+ actsAsMember: true,
1179
+ body: args.body,
1180
+ dates: { data: itineraryWithDetailsDates },
1181
+ idempotencyKey: args.idempotencyKey,
1182
+ idempotent: true,
1183
+ ifMatch: args.ifMatch,
1184
+ method: "PATCH",
1185
+ operationId: "patchItineraryWaypoint",
1186
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints/${encodeURIComponent(String(args.waypoint_id))}`,
1187
+ requiresSession: true,
1188
+ retry: options?.retry,
1189
+ serverBudgetMs: 3e4,
1190
+ signal: options?.signal,
1191
+ surface: "rest",
1192
+ takesIdempotencyKey: true,
1193
+ timeoutMs: options?.timeoutMs
1194
+ });
1195
+ var patchMyOrganizationNotificationPreferences = (transport, args, options) => transport.request({
1196
+ actsAsMember: true,
1197
+ body: args.body,
1198
+ idempotencyKey: args.idempotencyKey,
1199
+ idempotent: true,
1200
+ method: "PATCH",
1201
+ operationId: "patchMyOrganizationNotificationPreferences",
1202
+ path: `/v1/me/organizations/${encodeURIComponent(String(args.organization_id))}/notification-preferences`,
1203
+ requiresSession: true,
1204
+ retry: options?.retry,
1205
+ serverBudgetMs: 3e4,
1206
+ signal: options?.signal,
1207
+ surface: "rest",
1208
+ takesIdempotencyKey: true,
1209
+ timeoutMs: options?.timeoutMs
1210
+ });
1211
+ var patchMyPreferences = (transport, args, options) => transport.request({
1212
+ actsAsMember: true,
1213
+ body: args.body,
1214
+ idempotencyKey: args.idempotencyKey,
1215
+ idempotent: true,
1216
+ method: "PATCH",
1217
+ operationId: "patchMyPreferences",
1218
+ path: "/v1/me/preferences",
1219
+ requiresSession: true,
1220
+ retry: options?.retry,
1221
+ serverBudgetMs: 3e4,
1222
+ signal: options?.signal,
1223
+ surface: "rest",
1224
+ takesIdempotencyKey: true,
1225
+ timeoutMs: options?.timeoutMs
1226
+ });
1227
+ var patchOrganization = (transport, args, options) => transport.request({
1228
+ actsAsMember: true,
1229
+ body: args.body,
1230
+ dates: { data: organizationDates },
1231
+ idempotencyKey: args.idempotencyKey,
1232
+ idempotent: true,
1233
+ ifMatch: args.ifMatch,
1234
+ method: "PATCH",
1235
+ operationId: "patchOrganization",
1236
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}`,
1237
+ requiresSession: true,
1238
+ retry: options?.retry,
1239
+ serverBudgetMs: 3e4,
1240
+ signal: options?.signal,
1241
+ surface: "rest",
1242
+ takesIdempotencyKey: true,
1243
+ timeoutMs: options?.timeoutMs
1244
+ });
1245
+ var patchOrganizationAiProviderConfig = (transport, args, options) => transport.request({
1246
+ actsAsMember: true,
1247
+ body: args.body,
1248
+ idempotencyKey: args.idempotencyKey,
1249
+ idempotent: true,
1250
+ ifMatch: args.ifMatch,
1251
+ method: "PATCH",
1252
+ operationId: "patchOrganizationAiProviderConfig",
1253
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
1254
+ requiresSession: true,
1255
+ retry: options?.retry,
1256
+ serverBudgetMs: 3e4,
1257
+ signal: options?.signal,
1258
+ surface: "rest",
1259
+ takesIdempotencyKey: true,
1260
+ timeoutMs: options?.timeoutMs
1261
+ });
1262
+ var patchOrganizationBillingInfo = (transport, args, options) => transport.request({
1263
+ actsAsMember: true,
1264
+ body: args.body,
1265
+ idempotencyKey: args.idempotencyKey,
1266
+ idempotent: true,
1267
+ method: "PATCH",
1268
+ operationId: "patchOrganizationBillingInfo",
1269
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/info`,
1270
+ requiresSession: true,
1271
+ retry: options?.retry,
1272
+ serverBudgetMs: 3e4,
1273
+ signal: options?.signal,
1274
+ surface: "rest",
1275
+ takesIdempotencyKey: true,
1276
+ timeoutMs: options?.timeoutMs
1277
+ });
1278
+ var patchOrganizationMember = (transport, args, options) => transport.request({
1279
+ actsAsMember: true,
1280
+ body: args.body,
1281
+ dates: { data: organizationMemberDates },
1282
+ idempotencyKey: args.idempotencyKey,
1283
+ idempotent: true,
1284
+ method: "PATCH",
1285
+ operationId: "patchOrganizationMember",
1286
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/members/${encodeURIComponent(String(args.user_id))}`,
1287
+ requiresSession: true,
1288
+ retry: options?.retry,
1289
+ serverBudgetMs: 3e4,
1290
+ signal: options?.signal,
1291
+ surface: "rest",
1292
+ takesIdempotencyKey: true,
1293
+ timeoutMs: options?.timeoutMs
1294
+ });
1295
+ var patchOrganizationPublishableKey = (transport, args, options) => transport.request({
1296
+ actsAsMember: true,
1297
+ body: args.body,
1298
+ dates: { data: publishableKeyDates },
1299
+ idempotencyKey: args.idempotencyKey,
1300
+ idempotent: true,
1301
+ ifMatch: args.ifMatch,
1302
+ method: "PATCH",
1303
+ operationId: "patchOrganizationPublishableKey",
1304
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys/${encodeURIComponent(String(args.key_id))}`,
1305
+ requiresSession: true,
1306
+ retry: options?.retry,
1307
+ serverBudgetMs: 3e4,
1308
+ signal: options?.signal,
1309
+ surface: "rest",
1310
+ takesIdempotencyKey: true,
1311
+ timeoutMs: options?.timeoutMs
1312
+ });
1313
+ var patchOrganizationSettings = (transport, args, options) => transport.request({
1314
+ actsAsMember: true,
1315
+ body: args.body,
1316
+ idempotencyKey: args.idempotencyKey,
1317
+ idempotent: true,
1318
+ ifMatch: args.ifMatch,
1319
+ method: "PATCH",
1320
+ operationId: "patchOrganizationSettings",
1321
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/settings`,
1322
+ requiresSession: true,
1323
+ retry: options?.retry,
1324
+ serverBudgetMs: 3e4,
1325
+ signal: options?.signal,
1326
+ surface: "rest",
1327
+ takesIdempotencyKey: true,
1328
+ timeoutMs: options?.timeoutMs
1329
+ });
1330
+ var patchOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
1331
+ actsAsMember: true,
1332
+ body: args.body,
1333
+ dates: { data: webhookEndpointDates },
1334
+ idempotencyKey: args.idempotencyKey,
1335
+ idempotent: true,
1336
+ ifMatch: args.ifMatch,
1337
+ method: "PATCH",
1338
+ operationId: "patchOrganizationWebhookEndpoint",
1339
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints/${encodeURIComponent(String(args.webhook_endpoint_id))}`,
1340
+ requiresSession: true,
1341
+ retry: options?.retry,
1342
+ serverBudgetMs: 3e4,
1343
+ signal: options?.signal,
1344
+ surface: "rest",
1345
+ takesIdempotencyKey: true,
1346
+ timeoutMs: options?.timeoutMs
1347
+ });
1348
+ var patchZone = (transport, args, options) => transport.request({
1349
+ actsAsMember: true,
1350
+ body: args.body,
1351
+ dates: { data: zoneDates },
1352
+ idempotencyKey: args.idempotencyKey,
1353
+ idempotent: true,
1354
+ ifMatch: args.ifMatch,
1355
+ method: "PATCH",
1356
+ operationId: "patchZone",
1357
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}`,
1358
+ requiresSession: true,
1359
+ retry: options?.retry,
1360
+ serverBudgetMs: 3e4,
1361
+ signal: options?.signal,
1362
+ surface: "rest",
1363
+ takesIdempotencyKey: true,
1364
+ timeoutMs: options?.timeoutMs
1365
+ });
1366
+ var postAgentRun = (transport, args, options) => transport.request({
1367
+ actsAsMember: true,
1368
+ body: args.body,
1369
+ dates: { data: agentRunDates },
1370
+ idempotencyKey: args.idempotencyKey,
1371
+ idempotent: false,
1372
+ method: "POST",
1373
+ operationId: "postAgentRun",
1374
+ path: "/v1/agent/runs",
1375
+ requiresSession: true,
1376
+ retry: options?.retry,
1377
+ serverBudgetMs: 3e4,
1378
+ signal: options?.signal,
1379
+ surface: "rest",
1380
+ takesIdempotencyKey: true,
1381
+ timeoutMs: options?.timeoutMs
1382
+ });
1383
+ var postAgentRunFeedback = (transport, args, options) => transport.request({
1384
+ actsAsMember: true,
1385
+ body: args.body,
1386
+ idempotencyKey: args.idempotencyKey,
1387
+ idempotent: false,
1388
+ method: "POST",
1389
+ operationId: "postAgentRunFeedback",
1390
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/feedback`,
1391
+ requiresSession: true,
1392
+ retry: options?.retry,
1393
+ serverBudgetMs: 3e4,
1394
+ signal: options?.signal,
1395
+ surface: "rest",
1396
+ takesIdempotencyKey: true,
1397
+ timeoutMs: options?.timeoutMs
1398
+ });
1399
+ var postAgentRunInput = (transport, args, options) => transport.request({
1400
+ actsAsMember: true,
1401
+ body: args.body,
1402
+ idempotencyKey: args.idempotencyKey,
1403
+ idempotent: false,
1404
+ method: "POST",
1405
+ operationId: "postAgentRunInput",
1406
+ path: `/v1/agent/runs/${encodeURIComponent(String(args.run_id))}/input`,
1407
+ requiresSession: true,
1408
+ retry: options?.retry,
1409
+ serverBudgetMs: 3e4,
1410
+ signal: options?.signal,
1411
+ surface: "rest",
1412
+ takesIdempotencyKey: true,
1413
+ timeoutMs: options?.timeoutMs
1414
+ });
1415
+ var postCollection = (transport, args, options) => transport.request({
1416
+ actsAsMember: true,
1417
+ body: args.body,
1418
+ dates: { data: collectionDates },
1419
+ idempotencyKey: args.idempotencyKey,
1420
+ idempotent: false,
1421
+ method: "POST",
1422
+ operationId: "postCollection",
1423
+ path: "/v1/collections",
1424
+ requiresSession: true,
1425
+ retry: options?.retry,
1426
+ serverBudgetMs: 3e4,
1427
+ signal: options?.signal,
1428
+ surface: "rest",
1429
+ takesIdempotencyKey: true,
1430
+ timeoutMs: options?.timeoutMs
1431
+ });
1432
+ var postCollectionItineraries = (transport, args, options) => transport.request({
1433
+ actsAsMember: true,
1434
+ body: args.body,
1435
+ dates: { data: collectionDates },
1436
+ idempotencyKey: args.idempotencyKey,
1437
+ idempotent: true,
1438
+ ifMatch: args.ifMatch,
1439
+ method: "POST",
1440
+ operationId: "postCollectionItineraries",
1441
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/itineraries`,
1442
+ requiresSession: true,
1443
+ retry: options?.retry,
1444
+ serverBudgetMs: 3e4,
1445
+ signal: options?.signal,
1446
+ surface: "rest",
1447
+ takesIdempotencyKey: true,
1448
+ timeoutMs: options?.timeoutMs
1449
+ });
1450
+ var postCollectionShareLink = (transport, args, options) => transport.request({
1451
+ actsAsMember: true,
1452
+ dates: { data: shareLinkDates },
1453
+ idempotencyKey: args.idempotencyKey,
1454
+ idempotent: true,
1455
+ method: "POST",
1456
+ operationId: "postCollectionShareLink",
1457
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link`,
1458
+ requiresSession: true,
1459
+ retry: options?.retry,
1460
+ serverBudgetMs: 3e4,
1461
+ signal: options?.signal,
1462
+ surface: "rest",
1463
+ takesIdempotencyKey: true,
1464
+ timeoutMs: options?.timeoutMs
1465
+ });
1466
+ var postCollectionShareLinkRotate = (transport, args, options) => transport.request({
1467
+ actsAsMember: true,
1468
+ dates: { data: shareLinkDates },
1469
+ idempotencyKey: args.idempotencyKey,
1470
+ idempotent: false,
1471
+ method: "POST",
1472
+ operationId: "postCollectionShareLinkRotate",
1473
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/share-link/rotate`,
1474
+ requiresSession: true,
1475
+ retry: options?.retry,
1476
+ serverBudgetMs: 3e4,
1477
+ signal: options?.signal,
1478
+ surface: "rest",
1479
+ takesIdempotencyKey: true,
1480
+ timeoutMs: options?.timeoutMs
1481
+ });
1482
+ var postCollectionZones = (transport, args, options) => transport.request({
1483
+ actsAsMember: true,
1484
+ body: args.body,
1485
+ dates: { data: collectionDates },
1486
+ idempotencyKey: args.idempotencyKey,
1487
+ idempotent: true,
1488
+ ifMatch: args.ifMatch,
1489
+ method: "POST",
1490
+ operationId: "postCollectionZones",
1491
+ path: `/v1/collections/${encodeURIComponent(String(args.collection_id))}/zones`,
1492
+ requiresSession: true,
1493
+ retry: options?.retry,
1494
+ serverBudgetMs: 3e4,
1495
+ signal: options?.signal,
1496
+ surface: "rest",
1497
+ takesIdempotencyKey: true,
1498
+ timeoutMs: options?.timeoutMs
1499
+ });
1500
+ var postItinerary = (transport, args, options) => transport.request({
1501
+ actsAsMember: true,
1502
+ body: args.body,
1503
+ dates: { data: itineraryWithDetailsDates },
1504
+ idempotencyKey: args.idempotencyKey,
1505
+ idempotent: false,
1506
+ method: "POST",
1507
+ operationId: "postItinerary",
1508
+ path: "/v1/itineraries",
1509
+ requiresSession: true,
1510
+ retry: options?.retry,
1511
+ serverBudgetMs: 3e4,
1512
+ signal: options?.signal,
1513
+ surface: "rest",
1514
+ takesIdempotencyKey: true,
1515
+ timeoutMs: options?.timeoutMs
1516
+ });
1517
+ var postItineraryCollab = (transport, args, options) => transport.request({
1518
+ actsAsMember: true,
1519
+ body: args.body,
1520
+ idempotent: true,
1521
+ method: "POST",
1522
+ operationId: "postItineraryCollab",
1523
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/collab`,
1524
+ requiresSession: true,
1525
+ retry: options?.retry,
1526
+ serverBudgetMs: 3e4,
1527
+ signal: options?.signal,
1528
+ surface: "rest",
1529
+ timeoutMs: options?.timeoutMs
1530
+ });
1531
+ var postItineraryDuplicate = (transport, args, options) => transport.request({
1532
+ actsAsMember: true,
1533
+ body: args.body,
1534
+ dates: { data: itineraryWithDetailsDates },
1535
+ idempotencyKey: args.idempotencyKey,
1536
+ idempotent: false,
1537
+ method: "POST",
1538
+ operationId: "postItineraryDuplicate",
1539
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/duplicate`,
1540
+ query: args.query,
1541
+ requiresSession: true,
1542
+ retry: options?.retry,
1543
+ serverBudgetMs: 3e4,
1544
+ signal: options?.signal,
1545
+ surface: "rest",
1546
+ takesIdempotencyKey: true,
1547
+ timeoutMs: options?.timeoutMs
1548
+ });
1549
+ var postItineraryImport = (transport, args, options) => transport.request({
1550
+ actsAsMember: true,
1551
+ body: args.body,
1552
+ dates: { data: itineraryWithDetailsDates },
1553
+ idempotencyKey: args.idempotencyKey,
1554
+ idempotent: false,
1555
+ method: "POST",
1556
+ operationId: "postItineraryImport",
1557
+ path: "/v1/itineraries/import",
1558
+ requiresSession: true,
1559
+ retry: options?.retry,
1560
+ serverBudgetMs: 55e3,
1561
+ signal: options?.signal,
1562
+ surface: "rest",
1563
+ takesIdempotencyKey: true,
1564
+ timeoutMs: options?.timeoutMs
1565
+ });
1566
+ var postItineraryPreview = (transport, args, options) => transport.request({
1567
+ actsAsMember: true,
1568
+ body: args.body,
1569
+ idempotencyKey: args.idempotencyKey,
1570
+ idempotent: true,
1571
+ method: "POST",
1572
+ operationId: "postItineraryPreview",
1573
+ path: "/v1/itineraries/preview",
1574
+ requiresSession: true,
1575
+ retry: options?.retry,
1576
+ serverBudgetMs: 55e3,
1577
+ signal: options?.signal,
1578
+ surface: "rest",
1579
+ takesIdempotencyKey: true,
1580
+ timeoutMs: options?.timeoutMs
1581
+ });
1582
+ var postItineraryPublication = (transport, args, options) => transport.request({
1583
+ actsAsMember: true,
1584
+ dates: { data: itineraryWithDetailsDates },
1585
+ idempotencyKey: args.idempotencyKey,
1586
+ idempotent: true,
1587
+ ifMatch: args.ifMatch,
1588
+ method: "POST",
1589
+ operationId: "postItineraryPublication",
1590
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/publication`,
1591
+ requiresSession: true,
1592
+ retry: options?.retry,
1593
+ serverBudgetMs: 3e4,
1594
+ signal: options?.signal,
1595
+ surface: "rest",
1596
+ takesIdempotencyKey: true,
1597
+ timeoutMs: options?.timeoutMs
1598
+ });
1599
+ var postItinerarySegment = (transport, args, options) => transport.request({
1600
+ actsAsMember: true,
1601
+ body: args.body,
1602
+ dates: { data: itineraryWithDetailsDates },
1603
+ idempotencyKey: args.idempotencyKey,
1604
+ idempotent: false,
1605
+ ifMatch: args.ifMatch,
1606
+ method: "POST",
1607
+ operationId: "postItinerarySegment",
1608
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments`,
1609
+ requiresSession: true,
1610
+ retry: options?.retry,
1611
+ serverBudgetMs: 3e4,
1612
+ signal: options?.signal,
1613
+ surface: "rest",
1614
+ takesIdempotencyKey: true,
1615
+ timeoutMs: options?.timeoutMs
1616
+ });
1617
+ var postItinerarySegmentConvert = (transport, args, options) => transport.request({
1618
+ actsAsMember: true,
1619
+ body: args.body,
1620
+ dates: { data: itineraryWithDetailsDates },
1621
+ idempotencyKey: args.idempotencyKey,
1622
+ idempotent: true,
1623
+ ifMatch: args.ifMatch,
1624
+ method: "POST",
1625
+ operationId: "postItinerarySegmentConvert",
1626
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/convert`,
1627
+ requiresSession: true,
1628
+ retry: options?.retry,
1629
+ serverBudgetMs: 3e4,
1630
+ signal: options?.signal,
1631
+ surface: "rest",
1632
+ takesIdempotencyKey: true,
1633
+ timeoutMs: options?.timeoutMs
1634
+ });
1635
+ var postItinerarySegmentGroup = (transport, args, options) => transport.request({
1636
+ actsAsMember: true,
1637
+ body: args.body,
1638
+ dates: { data: itineraryWithDetailsDates },
1639
+ idempotencyKey: args.idempotencyKey,
1640
+ idempotent: false,
1641
+ ifMatch: args.ifMatch,
1642
+ method: "POST",
1643
+ operationId: "postItinerarySegmentGroup",
1644
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segment-groups`,
1645
+ requiresSession: true,
1646
+ retry: options?.retry,
1647
+ serverBudgetMs: 3e4,
1648
+ signal: options?.signal,
1649
+ surface: "rest",
1650
+ takesIdempotencyKey: true,
1651
+ timeoutMs: options?.timeoutMs
1652
+ });
1653
+ var postItinerarySegmentMerge = (transport, args, options) => transport.request({
1654
+ actsAsMember: true,
1655
+ dates: { data: itineraryWithDetailsDates },
1656
+ idempotencyKey: args.idempotencyKey,
1657
+ idempotent: false,
1658
+ ifMatch: args.ifMatch,
1659
+ method: "POST",
1660
+ operationId: "postItinerarySegmentMerge",
1661
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/merge`,
1662
+ requiresSession: true,
1663
+ retry: options?.retry,
1664
+ serverBudgetMs: 3e4,
1665
+ signal: options?.signal,
1666
+ surface: "rest",
1667
+ takesIdempotencyKey: true,
1668
+ timeoutMs: options?.timeoutMs
1669
+ });
1670
+ var postItinerarySegmentSplit = (transport, args, options) => transport.request({
1671
+ actsAsMember: true,
1672
+ body: args.body,
1673
+ dates: { data: itineraryWithDetailsDates },
1674
+ idempotencyKey: args.idempotencyKey,
1675
+ idempotent: false,
1676
+ ifMatch: args.ifMatch,
1677
+ method: "POST",
1678
+ operationId: "postItinerarySegmentSplit",
1679
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/segments/${encodeURIComponent(String(args.segment_id))}/split`,
1680
+ requiresSession: true,
1681
+ retry: options?.retry,
1682
+ serverBudgetMs: 3e4,
1683
+ signal: options?.signal,
1684
+ surface: "rest",
1685
+ takesIdempotencyKey: true,
1686
+ timeoutMs: options?.timeoutMs
1687
+ });
1688
+ var postItineraryShareLink = (transport, args, options) => transport.request({
1689
+ actsAsMember: true,
1690
+ dates: { data: shareLinkDates },
1691
+ idempotencyKey: args.idempotencyKey,
1692
+ idempotent: true,
1693
+ method: "POST",
1694
+ operationId: "postItineraryShareLink",
1695
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link`,
1696
+ requiresSession: true,
1697
+ retry: options?.retry,
1698
+ serverBudgetMs: 3e4,
1699
+ signal: options?.signal,
1700
+ surface: "rest",
1701
+ takesIdempotencyKey: true,
1702
+ timeoutMs: options?.timeoutMs
1703
+ });
1704
+ var postItineraryShareLinkRotate = (transport, args, options) => transport.request({
1705
+ actsAsMember: true,
1706
+ dates: { data: shareLinkDates },
1707
+ idempotencyKey: args.idempotencyKey,
1708
+ idempotent: false,
1709
+ method: "POST",
1710
+ operationId: "postItineraryShareLinkRotate",
1711
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/share-link/rotate`,
1712
+ requiresSession: true,
1713
+ retry: options?.retry,
1714
+ serverBudgetMs: 3e4,
1715
+ signal: options?.signal,
1716
+ surface: "rest",
1717
+ takesIdempotencyKey: true,
1718
+ timeoutMs: options?.timeoutMs
1719
+ });
1720
+ var postItineraryWaypoint = (transport, args, options) => transport.request({
1721
+ actsAsMember: true,
1722
+ body: args.body,
1723
+ dates: { data: itineraryWithDetailsDates },
1724
+ idempotencyKey: args.idempotencyKey,
1725
+ idempotent: false,
1726
+ ifMatch: args.ifMatch,
1727
+ method: "POST",
1728
+ operationId: "postItineraryWaypoint",
1729
+ path: `/v1/itineraries/${encodeURIComponent(String(args.itinerary_id))}/waypoints`,
1730
+ requiresSession: true,
1731
+ retry: options?.retry,
1732
+ serverBudgetMs: 3e4,
1733
+ signal: options?.signal,
1734
+ surface: "rest",
1735
+ takesIdempotencyKey: true,
1736
+ timeoutMs: options?.timeoutMs
1737
+ });
1738
+ var postMyInvitationAccept = (transport, args, options) => transport.request({
1739
+ actsAsMember: true,
1740
+ dates: { data: membershipDates },
1741
+ idempotencyKey: args.idempotencyKey,
1742
+ idempotent: true,
1743
+ method: "POST",
1744
+ operationId: "postMyInvitationAccept",
1745
+ path: `/v1/me/invitations/${encodeURIComponent(String(args.invitation_id))}/accept`,
1746
+ requiresSession: true,
1747
+ retry: options?.retry,
1748
+ serverBudgetMs: 3e4,
1749
+ signal: options?.signal,
1750
+ surface: "rest",
1751
+ takesIdempotencyKey: true,
1752
+ timeoutMs: options?.timeoutMs
1753
+ });
1754
+ var postOrganization = (transport, args, options) => transport.request({
1755
+ actsAsMember: true,
1756
+ body: args.body,
1757
+ dates: { data: organizationDates },
1758
+ idempotencyKey: args.idempotencyKey,
1759
+ idempotent: false,
1760
+ method: "POST",
1761
+ operationId: "postOrganization",
1762
+ path: "/v1/organizations",
1763
+ requiresSession: true,
1764
+ retry: options?.retry,
1765
+ serverBudgetMs: 3e4,
1766
+ signal: options?.signal,
1767
+ surface: "rest",
1768
+ takesIdempotencyKey: true,
1769
+ timeoutMs: options?.timeoutMs
1770
+ });
1771
+ var postOrganizationAiProviderConfig = (transport, args, options) => transport.request({
1772
+ actsAsMember: true,
1773
+ body: args.body,
1774
+ idempotencyKey: args.idempotencyKey,
1775
+ idempotent: false,
1776
+ method: "POST",
1777
+ operationId: "postOrganizationAiProviderConfig",
1778
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/ai-provider-config`,
1779
+ requiresSession: true,
1780
+ retry: options?.retry,
1781
+ serverBudgetMs: 3e4,
1782
+ signal: options?.signal,
1783
+ surface: "rest",
1784
+ takesIdempotencyKey: true,
1785
+ timeoutMs: options?.timeoutMs
1786
+ });
1787
+ var postOrganizationBillingPaymentMethod = (transport, args, options) => transport.request({
1788
+ actsAsMember: true,
1789
+ body: args.body,
1790
+ idempotencyKey: args.idempotencyKey,
1791
+ idempotent: true,
1792
+ method: "POST",
1793
+ operationId: "postOrganizationBillingPaymentMethod",
1794
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods`,
1795
+ requiresSession: true,
1796
+ retry: options?.retry,
1797
+ serverBudgetMs: 3e4,
1798
+ signal: options?.signal,
1799
+ surface: "rest",
1800
+ takesIdempotencyKey: true,
1801
+ timeoutMs: options?.timeoutMs
1802
+ });
1803
+ var postOrganizationBillingPaymentMethodSetDefault = (transport, args, options) => transport.request({
1804
+ actsAsMember: true,
1805
+ idempotencyKey: args.idempotencyKey,
1806
+ idempotent: true,
1807
+ method: "POST",
1808
+ operationId: "postOrganizationBillingPaymentMethodSetDefault",
1809
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/${encodeURIComponent(String(args.payment_method_id))}/set-default`,
1810
+ requiresSession: true,
1811
+ retry: options?.retry,
1812
+ serverBudgetMs: 3e4,
1813
+ signal: options?.signal,
1814
+ surface: "rest",
1815
+ takesIdempotencyKey: true,
1816
+ timeoutMs: options?.timeoutMs
1817
+ });
1818
+ var postOrganizationBillingPaymentMethodSetup = (transport, args, options) => transport.request({
1819
+ actsAsMember: true,
1820
+ idempotencyKey: args.idempotencyKey,
1821
+ idempotent: false,
1822
+ method: "POST",
1823
+ operationId: "postOrganizationBillingPaymentMethodSetup",
1824
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/payment-methods/setup`,
1825
+ requiresSession: true,
1826
+ retry: options?.retry,
1827
+ serverBudgetMs: 3e4,
1828
+ signal: options?.signal,
1829
+ surface: "rest",
1830
+ takesIdempotencyKey: true,
1831
+ timeoutMs: options?.timeoutMs
1832
+ });
1833
+ var postOrganizationBillingProvision = (transport, args, options) => transport.request({
1834
+ actsAsMember: true,
1835
+ body: args.body,
1836
+ idempotencyKey: args.idempotencyKey,
1837
+ idempotent: true,
1838
+ method: "POST",
1839
+ operationId: "postOrganizationBillingProvision",
1840
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/provision`,
1841
+ requiresSession: true,
1842
+ retry: options?.retry,
1843
+ serverBudgetMs: 3e4,
1844
+ signal: options?.signal,
1845
+ surface: "rest",
1846
+ takesIdempotencyKey: true,
1847
+ timeoutMs: options?.timeoutMs
1848
+ });
1849
+ var postOrganizationBillingSubscription = (transport, args, options) => transport.request({
1850
+ actsAsMember: true,
1851
+ dates: { data: organizationSubscriptionSummaryDates },
1852
+ idempotencyKey: args.idempotencyKey,
1853
+ idempotent: true,
1854
+ method: "POST",
1855
+ operationId: "postOrganizationBillingSubscription",
1856
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/billing/subscription`,
1857
+ requiresSession: true,
1858
+ retry: options?.retry,
1859
+ serverBudgetMs: 3e4,
1860
+ signal: options?.signal,
1861
+ surface: "rest",
1862
+ takesIdempotencyKey: true,
1863
+ timeoutMs: options?.timeoutMs
1864
+ });
1865
+ var postOrganizationInvitation = (transport, args, options) => transport.request({
1866
+ actsAsMember: true,
1867
+ body: args.body,
1868
+ dates: { data: organizationInvitationDates },
1869
+ idempotencyKey: args.idempotencyKey,
1870
+ idempotent: false,
1871
+ method: "POST",
1872
+ operationId: "postOrganizationInvitation",
1873
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/invitations`,
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
+ var postOrganizationLookup = (transport, args, options) => transport.request({
1883
+ body: args.body,
1884
+ dates: { data: organizationDates },
1885
+ idempotent: true,
1886
+ method: "POST",
1887
+ operationId: "postOrganizationLookup",
1888
+ path: "/v1/organizations/lookup",
1889
+ retry: options?.retry,
1890
+ serverBudgetMs: 3e4,
1891
+ signal: options?.signal,
1892
+ surface: "rest",
1893
+ takesNoCredential: true,
1894
+ timeoutMs: options?.timeoutMs
1895
+ });
1896
+ var postOrganizationPublishableKey = (transport, args, options) => transport.request({
1897
+ actsAsMember: true,
1898
+ body: args.body,
1899
+ dates: { data: publishableKeyDates },
1900
+ idempotencyKey: args.idempotencyKey,
1901
+ idempotent: false,
1902
+ method: "POST",
1903
+ operationId: "postOrganizationPublishableKey",
1904
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/publishable-keys`,
1905
+ requiresSession: true,
1906
+ retry: options?.retry,
1907
+ serverBudgetMs: 3e4,
1908
+ signal: options?.signal,
1909
+ surface: "rest",
1910
+ takesIdempotencyKey: true,
1911
+ timeoutMs: options?.timeoutMs
1912
+ });
1913
+ var postOrganizationWebhookDelivery = (transport, args, options) => transport.request({
1914
+ actsAsMember: true,
1915
+ body: args.body,
1916
+ dates: { data: webhookDeliveryTriggerDates },
1917
+ idempotencyKey: args.idempotencyKey,
1918
+ idempotent: false,
1919
+ method: "POST",
1920
+ operationId: "postOrganizationWebhookDelivery",
1921
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-deliveries`,
1922
+ requiresSession: true,
1923
+ retry: options?.retry,
1924
+ serverBudgetMs: 3e4,
1925
+ signal: options?.signal,
1926
+ surface: "rest",
1927
+ takesIdempotencyKey: true,
1928
+ timeoutMs: options?.timeoutMs
1929
+ });
1930
+ var postOrganizationWebhookEndpoint = (transport, args, options) => transport.request({
1931
+ actsAsMember: true,
1932
+ body: args.body,
1933
+ dates: { data: webhookEndpointWithSecretDates },
1934
+ idempotencyKey: args.idempotencyKey,
1935
+ idempotent: false,
1936
+ method: "POST",
1937
+ operationId: "postOrganizationWebhookEndpoint",
1938
+ path: `/v1/organizations/${encodeURIComponent(String(args.organization_id))}/webhook-endpoints`,
1939
+ requiresSession: true,
1940
+ retry: options?.retry,
1941
+ serverBudgetMs: 3e4,
1942
+ signal: options?.signal,
1943
+ surface: "rest",
1944
+ takesIdempotencyKey: true,
1945
+ timeoutMs: options?.timeoutMs
1946
+ });
1947
+ var postSession = (transport, args, options) => transport.request({
1948
+ body: args.body,
1949
+ dates: { data: sessionDates },
1950
+ idempotent: true,
1951
+ method: "POST",
1952
+ operationId: "postSession",
1953
+ path: "/v1/sessions",
1954
+ requiresSecretKey: true,
1955
+ retry: options?.retry,
1956
+ serverBudgetMs: 3e4,
1957
+ signal: options?.signal,
1958
+ surface: "rest",
1959
+ timeoutMs: options?.timeoutMs
1960
+ });
1961
+ var postZone = (transport, args, options) => transport.request({
1962
+ actsAsMember: true,
1963
+ body: args.body,
1964
+ dates: { data: zoneDates },
1965
+ idempotencyKey: args.idempotencyKey,
1966
+ idempotent: false,
1967
+ method: "POST",
1968
+ operationId: "postZone",
1969
+ path: "/v1/zones",
1970
+ requiresSession: true,
1971
+ retry: options?.retry,
1972
+ serverBudgetMs: 3e4,
1973
+ signal: options?.signal,
1974
+ surface: "rest",
1975
+ takesIdempotencyKey: true,
1976
+ timeoutMs: options?.timeoutMs
1977
+ });
1978
+ var postZoneCollab = (transport, args, options) => transport.request({
1979
+ actsAsMember: true,
1980
+ body: args.body,
1981
+ idempotent: true,
1982
+ method: "POST",
1983
+ operationId: "postZoneCollab",
1984
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/collab`,
1985
+ requiresSession: true,
1986
+ retry: options?.retry,
1987
+ serverBudgetMs: 3e4,
1988
+ signal: options?.signal,
1989
+ surface: "rest",
1990
+ timeoutMs: options?.timeoutMs
1991
+ });
1992
+ var postZonePublication = (transport, args, options) => transport.request({
1993
+ actsAsMember: true,
1994
+ dates: { data: zoneDates },
1995
+ idempotencyKey: args.idempotencyKey,
1996
+ idempotent: true,
1997
+ ifMatch: args.ifMatch,
1998
+ method: "POST",
1999
+ operationId: "postZonePublication",
2000
+ path: `/v1/zones/${encodeURIComponent(String(args.zone_id))}/publication`,
2001
+ requiresSession: true,
2002
+ retry: options?.retry,
2003
+ serverBudgetMs: 3e4,
2004
+ signal: options?.signal,
2005
+ surface: "rest",
2006
+ takesIdempotencyKey: true,
2007
+ timeoutMs: options?.timeoutMs
2008
+ });
2009
+ var bind = (transport) => ({
2010
+ admin: {
2011
+ billing: {
2012
+ /**
2013
+ * Detach a payment method from an organization.
2014
+ * DELETE /v1/organizations/{organization_id}/billing/payment-methods/{payment_method_id}
2015
+ * Requires a publishable key with the `management` scope.
2016
+ * Acts as the user its session token was minted for, so the token must name one.
2017
+ * @see {@link deleteOrganizationBillingPaymentMethod}
2018
+ */
2019
+ deleteOrganizationBillingPaymentMethod: (args, options) => deleteOrganizationBillingPaymentMethod(transport, args, options),
2020
+ /**
2021
+ * End an organization's Data API subscription at the end of its period.
2022
+ * DELETE /v1/organizations/{organization_id}/billing/subscription
2023
+ * Requires a publishable key with the `management` scope.
2024
+ * Acts as the user its session token was minted for, so the token must name one.
2025
+ * @see {@link deleteOrganizationBillingSubscription}
2026
+ */
2027
+ deleteOrganizationBillingSubscription: (args, options) => deleteOrganizationBillingSubscription(transport, args, options),
2028
+ /**
2029
+ * List the billing catalog.
2030
+ * GET /v1/billing/products
2031
+ * Requires a publishable key with the `management` scope.
2032
+ * @see {@link getBillingProducts}
2033
+ */
2034
+ getBillingProducts: (options) => getBillingProducts(transport, options),
2035
+ /**
2036
+ * Retrieve an organization's billing information.
2037
+ * GET /v1/organizations/{organization_id}/billing/info
2038
+ * Requires a publishable key with the `management` scope.
2039
+ * @see {@link getOrganizationBillingInfo}
2040
+ */
2041
+ getOrganizationBillingInfo: (args, options) => getOrganizationBillingInfo(transport, args, options),
2042
+ /**
2043
+ * List an organization's invoices.
2044
+ * GET /v1/organizations/{organization_id}/billing/invoices
2045
+ * Requires a publishable key with the `management` scope.
2046
+ * @see {@link getOrganizationBillingInvoices}
2047
+ */
2048
+ getOrganizationBillingInvoices: (args, options) => getOrganizationBillingInvoices(transport, args, options),
2049
+ /**
2050
+ * List an organization's saved payment methods.
2051
+ * GET /v1/organizations/{organization_id}/billing/payment-methods
2052
+ * Requires a publishable key with the `management` scope.
2053
+ * @see {@link getOrganizationBillingPaymentMethods}
2054
+ */
2055
+ getOrganizationBillingPaymentMethods: (args, options) => getOrganizationBillingPaymentMethods(transport, args, options),
2056
+ /**
2057
+ * Check what a promotion code is worth to an organization.
2058
+ * GET /v1/organizations/{organization_id}/billing/promotion-codes/{code}
2059
+ * Requires a publishable key with the `management` scope.
2060
+ * @see {@link getOrganizationBillingPromotionCode}
2061
+ */
2062
+ getOrganizationBillingPromotionCode: (args, options) => getOrganizationBillingPromotionCode(transport, args, options),
2063
+ /**
2064
+ * Retrieve an organization's subscription.
2065
+ * GET /v1/organizations/{organization_id}/billing/subscription
2066
+ * Requires a publishable key with the `management` scope.
2067
+ * @see {@link getOrganizationBillingSubscription}
2068
+ */
2069
+ getOrganizationBillingSubscription: (args, options) => getOrganizationBillingSubscription(transport, args, options),
2070
+ /**
2071
+ * Update an organization's billing information.
2072
+ * PATCH /v1/organizations/{organization_id}/billing/info
2073
+ * Requires a publishable key with the `management` scope.
2074
+ * Acts as the user its session token was minted for, so the token must name one.
2075
+ * @see {@link patchOrganizationBillingInfo}
2076
+ */
2077
+ patchOrganizationBillingInfo: (args, options) => patchOrganizationBillingInfo(transport, args, options),
2078
+ /**
2079
+ * Save a confirmed card against an organization.
2080
+ * POST /v1/organizations/{organization_id}/billing/payment-methods
2081
+ * Requires a publishable key with the `management` scope.
2082
+ * Acts as the user its session token was minted for, so the token must name one.
2083
+ * @see {@link postOrganizationBillingPaymentMethod}
2084
+ */
2085
+ postOrganizationBillingPaymentMethod: (args, options) => postOrganizationBillingPaymentMethod(transport, args, options),
2086
+ /**
2087
+ * Choose which payment method an organization is charged on.
2088
+ * POST /v1/organizations/{organization_id}/billing/payment-methods/{payment_method_id}/set-default
2089
+ * Requires a publishable key with the `management` scope.
2090
+ * Acts as the user its session token was minted for, so the token must name one.
2091
+ * @see {@link postOrganizationBillingPaymentMethodSetDefault}
2092
+ */
2093
+ postOrganizationBillingPaymentMethodSetDefault: (args, options) => postOrganizationBillingPaymentMethodSetDefault(transport, args, options),
2094
+ /**
2095
+ * Start collecting a card for an organization.
2096
+ * POST /v1/organizations/{organization_id}/billing/payment-methods/setup
2097
+ * Requires a publishable key with the `management` scope.
2098
+ * Acts as the user its session token was minted for, so the token must name one.
2099
+ * @see {@link postOrganizationBillingPaymentMethodSetup}
2100
+ */
2101
+ postOrganizationBillingPaymentMethodSetup: (args, options) => postOrganizationBillingPaymentMethodSetup(transport, args, options),
2102
+ /**
2103
+ * Open an organization's billing.
2104
+ * POST /v1/organizations/{organization_id}/billing/provision
2105
+ * Requires a publishable key with the `management` scope.
2106
+ * Acts as the user its session token was minted for, so the token must name one.
2107
+ * @see {@link postOrganizationBillingProvision}
2108
+ */
2109
+ postOrganizationBillingProvision: (args, options) => postOrganizationBillingProvision(transport, args, options),
2110
+ /**
2111
+ * Run an organization's Data API subscription.
2112
+ * POST /v1/organizations/{organization_id}/billing/subscription
2113
+ * Requires a publishable key with the `management` scope.
2114
+ * Acts as the user its session token was minted for, so the token must name one.
2115
+ * @see {@link postOrganizationBillingSubscription}
2116
+ */
2117
+ postOrganizationBillingSubscription: (args, options) => postOrganizationBillingSubscription(transport, args, options)
2118
+ },
2119
+ invitations: {
2120
+ /**
2121
+ * Withdraw a pending invitation.
2122
+ * DELETE /v1/organizations/{organization_id}/invitations/{invitation_id}
2123
+ * Requires a publishable key with the `management` scope.
2124
+ * Acts as the user its session token was minted for, so the token must name one.
2125
+ * @see {@link deleteOrganizationInvitation}
2126
+ */
2127
+ deleteOrganizationInvitation: (args, options) => deleteOrganizationInvitation(transport, args, options),
2128
+ /**
2129
+ * Retrieve a pending invitation.
2130
+ * GET /v1/organizations/{organization_id}/invitations/{invitation_id}
2131
+ * Requires a publishable key with the `management` scope.
2132
+ * @see {@link getOrganizationInvitation}
2133
+ */
2134
+ getOrganizationInvitation: (args, options) => getOrganizationInvitation(transport, args, options),
2135
+ /**
2136
+ * List an organization's pending invitations.
2137
+ * GET /v1/organizations/{organization_id}/invitations
2138
+ * Requires a publishable key with the `management` scope.
2139
+ * @see {@link getOrganizationInvitations}
2140
+ */
2141
+ getOrganizationInvitations: (args, options) => getOrganizationInvitations(transport, args, options),
2142
+ /**
2143
+ * Invite somebody to an organization by email.
2144
+ * POST /v1/organizations/{organization_id}/invitations
2145
+ * Requires a publishable key with the `management` scope.
2146
+ * Acts as the user its session token was minted for, so the token must name one.
2147
+ * @see {@link postOrganizationInvitation}
2148
+ */
2149
+ postOrganizationInvitation: (args, options) => postOrganizationInvitation(transport, args, options)
2150
+ },
2151
+ keys: {
2152
+ /**
2153
+ * Revoke a publishable key.
2154
+ * DELETE /v1/organizations/{organization_id}/publishable-keys/{key_id}
2155
+ * Requires a publishable key with the `management` scope.
2156
+ * Acts as the user its session token was minted for, so the token must name one.
2157
+ * @see {@link deleteOrganizationPublishableKey}
2158
+ */
2159
+ deleteOrganizationPublishableKey: (args, options) => deleteOrganizationPublishableKey(transport, args, options),
2160
+ /**
2161
+ * Retrieve a publishable key.
2162
+ * GET /v1/organizations/{organization_id}/publishable-keys/{key_id}
2163
+ * Requires a publishable key with the `management` scope.
2164
+ * @see {@link getOrganizationPublishableKey}
2165
+ */
2166
+ getOrganizationPublishableKey: (args, options) => getOrganizationPublishableKey(transport, args, options),
2167
+ /**
2168
+ * List an organization's publishable keys.
2169
+ * GET /v1/organizations/{organization_id}/publishable-keys
2170
+ * Requires a publishable key with the `management` scope.
2171
+ * @see {@link getOrganizationPublishableKeys}
2172
+ */
2173
+ getOrganizationPublishableKeys: (args, options) => getOrganizationPublishableKeys(transport, args, options),
2174
+ /**
2175
+ * Update a publishable key's name or scopes.
2176
+ * PATCH /v1/organizations/{organization_id}/publishable-keys/{key_id}
2177
+ * Requires a publishable key with the `management` scope.
2178
+ * Acts as the user its session token was minted for, so the token must name one.
2179
+ * @see {@link patchOrganizationPublishableKey}
2180
+ */
2181
+ patchOrganizationPublishableKey: (args, options) => patchOrganizationPublishableKey(transport, args, options),
2182
+ /**
2183
+ * Create a publishable key.
2184
+ * POST /v1/organizations/{organization_id}/publishable-keys
2185
+ * Requires a publishable key with the `management` scope.
2186
+ * Acts as the user its session token was minted for, so the token must name one.
2187
+ * @see {@link postOrganizationPublishableKey}
2188
+ */
2189
+ postOrganizationPublishableKey: (args, options) => postOrganizationPublishableKey(transport, args, options)
2190
+ },
2191
+ members: {
2192
+ /**
2193
+ * Remove a member from an organization, or leave it.
2194
+ * DELETE /v1/organizations/{organization_id}/members/{user_id}
2195
+ * Requires a publishable key with the `management` scope.
2196
+ * Acts as the user its session token was minted for, so the token must name one.
2197
+ * @see {@link deleteOrganizationMember}
2198
+ */
2199
+ deleteOrganizationMember: (args, options) => deleteOrganizationMember(transport, args, options),
2200
+ /**
2201
+ * List an organization's members.
2202
+ * GET /v1/organizations/{organization_id}/members
2203
+ * Requires a publishable key with the `management` scope.
2204
+ * @see {@link getOrganizationMembers}
2205
+ */
2206
+ getOrganizationMembers: (args, options) => getOrganizationMembers(transport, args, options),
2207
+ /**
2208
+ * Change a member's role.
2209
+ * PATCH /v1/organizations/{organization_id}/members/{user_id}
2210
+ * Requires a publishable key with the `management` scope.
2211
+ * Acts as the user its session token was minted for, so the token must name one.
2212
+ * @see {@link patchOrganizationMember}
2213
+ */
2214
+ patchOrganizationMember: (args, options) => patchOrganizationMember(transport, args, options)
2215
+ },
2216
+ organizations: {
2217
+ /**
2218
+ * Delete an organization's AI provider configuration.
2219
+ * DELETE /v1/organizations/{organization_id}/ai-provider-config
2220
+ * Requires a publishable key with the `management` scope.
2221
+ * Acts as the user its session token was minted for, so the token must name one.
2222
+ * @see {@link deleteOrganizationAiProviderConfig}
2223
+ */
2224
+ deleteOrganizationAiProviderConfig: (args, options) => deleteOrganizationAiProviderConfig(transport, args, options),
2225
+ /**
2226
+ * List the AI provider catalog.
2227
+ * GET /v1/ai-providers
2228
+ * Requires a publishable key with the `management` scope.
2229
+ * @see {@link getAiProviders}
2230
+ */
2231
+ getAiProviders: (options) => getAiProviders(transport, options),
2232
+ /**
2233
+ * Retrieve an organization.
2234
+ * GET /v1/organizations/{organization_id}
2235
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2236
+ * @see {@link getOrganization}
2237
+ */
2238
+ getOrganization: (args, options) => getOrganization(transport, args, options),
2239
+ /**
2240
+ * Retrieve an organization's AI provider configuration.
2241
+ * GET /v1/organizations/{organization_id}/ai-provider-config
2242
+ * Requires a publishable key with the `management` scope.
2243
+ * @see {@link getOrganizationAiProviderConfig}
2244
+ */
2245
+ getOrganizationAiProviderConfig: (args, options) => getOrganizationAiProviderConfig(transport, args, options),
2246
+ /**
2247
+ * Retrieve an organization's Map Publishing settings.
2248
+ * GET /v1/organizations/{organization_id}/settings
2249
+ * Requires a publishable key with the `management` scope.
2250
+ * @see {@link getOrganizationSettings}
2251
+ */
2252
+ getOrganizationSettings: (args, options) => getOrganizationSettings(transport, args, options),
2253
+ /**
2254
+ * Retrieve an organization's data usage.
2255
+ * GET /v1/organizations/{organization_id}/usage/data
2256
+ * Requires a publishable key with the `management` scope.
2257
+ * @see {@link getOrganizationUsageData}
2258
+ */
2259
+ getOrganizationUsageData: (args, options) => getOrganizationUsageData(transport, args, options),
2260
+ /**
2261
+ * Retrieve an organization's Tile API usage.
2262
+ * GET /v1/organizations/{organization_id}/usage/tiles
2263
+ * Requires a publishable key with the `management` scope.
2264
+ * @see {@link getOrganizationUsageTiles}
2265
+ */
2266
+ getOrganizationUsageTiles: (args, options) => getOrganizationUsageTiles(transport, args, options),
2267
+ /**
2268
+ * Update an organization.
2269
+ * PATCH /v1/organizations/{organization_id}
2270
+ * Requires a publishable key with the `management` scope.
2271
+ * Acts as the user its session token was minted for, so the token must name one.
2272
+ * @see {@link patchOrganization}
2273
+ */
2274
+ patchOrganization: (args, options) => patchOrganization(transport, args, options),
2275
+ /**
2276
+ * Update an organization's AI provider configuration.
2277
+ * PATCH /v1/organizations/{organization_id}/ai-provider-config
2278
+ * Requires a publishable key with the `management` scope.
2279
+ * Acts as the user its session token was minted for, so the token must name one.
2280
+ * @see {@link patchOrganizationAiProviderConfig}
2281
+ */
2282
+ patchOrganizationAiProviderConfig: (args, options) => patchOrganizationAiProviderConfig(transport, args, options),
2283
+ /**
2284
+ * Update an organization's Map Publishing settings.
2285
+ * PATCH /v1/organizations/{organization_id}/settings
2286
+ * Requires a publishable key with the `management` scope.
2287
+ * Acts as the user its session token was minted for, so the token must name one.
2288
+ * @see {@link patchOrganizationSettings}
2289
+ */
2290
+ patchOrganizationSettings: (args, options) => patchOrganizationSettings(transport, args, options),
2291
+ /**
2292
+ * Create an organization.
2293
+ * POST /v1/organizations
2294
+ * Requires a publishable key with the `management` scope.
2295
+ * Acts as the user its session token was minted for, so the token must name one.
2296
+ * @see {@link postOrganization}
2297
+ */
2298
+ postOrganization: (args, options) => postOrganization(transport, args, options),
2299
+ /**
2300
+ * Configure an organization's AI provider.
2301
+ * POST /v1/organizations/{organization_id}/ai-provider-config
2302
+ * Requires a publishable key with the `management` scope.
2303
+ * Acts as the user its session token was minted for, so the token must name one.
2304
+ * @see {@link postOrganizationAiProviderConfig}
2305
+ */
2306
+ postOrganizationAiProviderConfig: (args, options) => postOrganizationAiProviderConfig(transport, args, options)
2307
+ },
2308
+ sessions: {
2309
+ /**
2310
+ * Create a session token using a secret key.
2311
+ * POST /v1/sessions
2312
+ * Requires a secret key, and takes no other credential.
2313
+ * @see {@link postSession}
2314
+ */
2315
+ postSession: (args, options) => postSession(transport, args, options)
2316
+ },
2317
+ users: {
2318
+ /**
2319
+ * Decline an invitation.
2320
+ * DELETE /v1/me/invitations/{invitation_id}
2321
+ * Requires a publishable key with the `studio-embedded` scope.
2322
+ * Acts as the user its session token was minted for, so the token must name one.
2323
+ * @see {@link deleteMyInvitation}
2324
+ */
2325
+ deleteMyInvitation: (args, options) => deleteMyInvitation(transport, args, options),
2326
+ /**
2327
+ * List the invitations waiting for the acting user.
2328
+ * GET /v1/me/invitations
2329
+ * Requires a publishable key with the `studio-embedded` scope.
2330
+ * Acts as the user its session token was minted for, so the token must name one.
2331
+ * @see {@link getMyInvitations}
2332
+ */
2333
+ getMyInvitations: (args, options) => getMyInvitations(transport, args, options),
2334
+ /**
2335
+ * Retrieve the acting user's notification emails for an organization.
2336
+ * GET /v1/me/organizations/{organization_id}/notification-preferences
2337
+ * Requires a publishable key with the `studio-embedded` scope.
2338
+ * Acts as the user its session token was minted for, so the token must name one.
2339
+ * @see {@link getMyOrganizationNotificationPreferences}
2340
+ */
2341
+ getMyOrganizationNotificationPreferences: (args, options) => getMyOrganizationNotificationPreferences(transport, args, options),
2342
+ /**
2343
+ * List the acting user's memberships.
2344
+ * GET /v1/me/organizations
2345
+ * Requires a publishable key with the `studio-embedded` scope.
2346
+ * Acts as the user its session token was minted for, so the token must name one.
2347
+ * @see {@link getMyOrganizations}
2348
+ */
2349
+ getMyOrganizations: (args, options) => getMyOrganizations(transport, args, options),
2350
+ /**
2351
+ * Retrieve the acting user's display preferences.
2352
+ * GET /v1/me/preferences
2353
+ * Requires a publishable key with the `studio-embedded` scope.
2354
+ * Acts as the user its session token was minted for, so the token must name one.
2355
+ * @see {@link getMyPreferences}
2356
+ */
2357
+ getMyPreferences: (options) => getMyPreferences(transport, options),
2358
+ /**
2359
+ * Turn the acting user's notification emails for an organization on or off.
2360
+ * PATCH /v1/me/organizations/{organization_id}/notification-preferences
2361
+ * Requires a publishable key with the `studio-embedded` scope.
2362
+ * Acts as the user its session token was minted for, so the token must name one.
2363
+ * @see {@link patchMyOrganizationNotificationPreferences}
2364
+ */
2365
+ patchMyOrganizationNotificationPreferences: (args, options) => patchMyOrganizationNotificationPreferences(transport, args, options),
2366
+ /**
2367
+ * Update the acting user's display preferences.
2368
+ * PATCH /v1/me/preferences
2369
+ * Requires a publishable key with the `studio-embedded` scope.
2370
+ * Acts as the user its session token was minted for, so the token must name one.
2371
+ * @see {@link patchMyPreferences}
2372
+ */
2373
+ patchMyPreferences: (args, options) => patchMyPreferences(transport, args, options),
2374
+ /**
2375
+ * Accept an invitation.
2376
+ * POST /v1/me/invitations/{invitation_id}/accept
2377
+ * Requires a publishable key with the `studio-embedded` scope.
2378
+ * Acts as the user its session token was minted for, so the token must name one.
2379
+ * @see {@link postMyInvitationAccept}
2380
+ */
2381
+ postMyInvitationAccept: (args, options) => postMyInvitationAccept(transport, args, options)
2382
+ },
2383
+ webhooks: {
2384
+ /**
2385
+ * Delete a webhook endpoint.
2386
+ * DELETE /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}
2387
+ * Requires a publishable key with the `management` scope.
2388
+ * Acts as the user its session token was minted for, so the token must name one.
2389
+ * @see {@link deleteOrganizationWebhookEndpoint}
2390
+ */
2391
+ deleteOrganizationWebhookEndpoint: (args, options) => deleteOrganizationWebhookEndpoint(transport, args, options),
2392
+ /**
2393
+ * List an organization's webhook deliveries.
2394
+ * GET /v1/organizations/{organization_id}/webhook-deliveries
2395
+ * Requires a publishable key with the `management` scope.
2396
+ * @see {@link getOrganizationWebhookDeliveries}
2397
+ */
2398
+ getOrganizationWebhookDeliveries: (args, options) => getOrganizationWebhookDeliveries(transport, args, options),
2399
+ /**
2400
+ * Retrieve a webhook delivery with its attempts.
2401
+ * GET /v1/organizations/{organization_id}/webhook-deliveries/{delivery_id}
2402
+ * Requires a publishable key with the `management` scope.
2403
+ * @see {@link getOrganizationWebhookDelivery}
2404
+ */
2405
+ getOrganizationWebhookDelivery: (args, options) => getOrganizationWebhookDelivery(transport, args, options),
2406
+ /**
2407
+ * Retrieve a webhook endpoint.
2408
+ * GET /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}
2409
+ * Requires a publishable key with the `management` scope.
2410
+ * @see {@link getOrganizationWebhookEndpoint}
2411
+ */
2412
+ getOrganizationWebhookEndpoint: (args, options) => getOrganizationWebhookEndpoint(transport, args, options),
2413
+ /**
2414
+ * List an organization's webhook endpoints.
2415
+ * GET /v1/organizations/{organization_id}/webhook-endpoints
2416
+ * Requires a publishable key with the `management` scope.
2417
+ * @see {@link getOrganizationWebhookEndpoints}
2418
+ */
2419
+ getOrganizationWebhookEndpoints: (args, options) => getOrganizationWebhookEndpoints(transport, args, options),
2420
+ /**
2421
+ * Retrieve a webhook event with its deliveries.
2422
+ * GET /v1/organizations/{organization_id}/webhook-events/{event_id}
2423
+ * Requires a publishable key with the `management` scope.
2424
+ * @see {@link getOrganizationWebhookEvent}
2425
+ */
2426
+ getOrganizationWebhookEvent: (args, options) => getOrganizationWebhookEvent(transport, args, options),
2427
+ /**
2428
+ * List an organization's webhook events.
2429
+ * GET /v1/organizations/{organization_id}/webhook-events
2430
+ * Requires a publishable key with the `management` scope.
2431
+ * @see {@link getOrganizationWebhookEvents}
2432
+ */
2433
+ getOrganizationWebhookEvents: (args, options) => getOrganizationWebhookEvents(transport, args, options),
2434
+ /**
2435
+ * Retrieve the reliability of an organization's webhooks.
2436
+ * GET /v1/organizations/{organization_id}/webhook-health
2437
+ * Requires a publishable key with the `management` scope.
2438
+ * @see {@link getOrganizationWebhookHealth}
2439
+ */
2440
+ getOrganizationWebhookHealth: (args, options) => getOrganizationWebhookHealth(transport, args, options),
2441
+ /**
2442
+ * List the public webhook event types.
2443
+ * GET /v1/webhook-event-types
2444
+ * Requires a publishable key with the `management` scope.
2445
+ * @see {@link getWebhookEventTypes}
2446
+ */
2447
+ getWebhookEventTypes: (options) => getWebhookEventTypes(transport, options),
2448
+ /**
2449
+ * Update a webhook endpoint.
2450
+ * PATCH /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}
2451
+ * Requires a publishable key with the `management` scope.
2452
+ * Acts as the user its session token was minted for, so the token must name one.
2453
+ * @see {@link patchOrganizationWebhookEndpoint}
2454
+ */
2455
+ patchOrganizationWebhookEndpoint: (args, options) => patchOrganizationWebhookEndpoint(transport, args, options),
2456
+ /**
2457
+ * Resend an event, send a test event, or redeliver an endpoint's events.
2458
+ * POST /v1/organizations/{organization_id}/webhook-deliveries
2459
+ * Requires a publishable key with the `management` scope.
2460
+ * Acts as the user its session token was minted for, so the token must name one.
2461
+ * @see {@link postOrganizationWebhookDelivery}
2462
+ */
2463
+ postOrganizationWebhookDelivery: (args, options) => postOrganizationWebhookDelivery(transport, args, options),
2464
+ /**
2465
+ * Create a webhook endpoint.
2466
+ * POST /v1/organizations/{organization_id}/webhook-endpoints
2467
+ * Requires a publishable key with the `management` scope.
2468
+ * Acts as the user its session token was minted for, so the token must name one.
2469
+ * @see {@link postOrganizationWebhookEndpoint}
2470
+ */
2471
+ postOrganizationWebhookEndpoint: (args, options) => postOrganizationWebhookEndpoint(transport, args, options)
2472
+ }
2473
+ },
2474
+ agent: {
2475
+ runs: {
2476
+ /**
2477
+ * Stream an agent run's events over Server-Sent Events.
2478
+ * GET /v1/agent/runs/{run_id}/events
2479
+ * Requires a publishable key with the `studio-embedded` scope.
2480
+ * Acts as the user its session token was minted for, so the token must name one.
2481
+ * @see {@link getAgentRunEvents}
2482
+ */
2483
+ getAgentRunEvents: (args, options) => getAgentRunEvents(transport, args, options),
2484
+ /**
2485
+ * Start a new agent run.
2486
+ * POST /v1/agent/runs
2487
+ * Requires a publishable key with the `studio-embedded` scope.
2488
+ * Acts as the user its session token was minted for, so the token must name one.
2489
+ * @see {@link postAgentRun}
2490
+ */
2491
+ postAgentRun: (args, options) => postAgentRun(transport, args, options),
2492
+ /**
2493
+ * Record the user's rating of one assistant message in a run.
2494
+ * POST /v1/agent/runs/{run_id}/feedback
2495
+ * Requires a publishable key with the `studio-embedded` scope.
2496
+ * Acts as the user its session token was minted for, so the token must name one.
2497
+ * @see {@link postAgentRunFeedback}
2498
+ */
2499
+ postAgentRunFeedback: (args, options) => postAgentRunFeedback(transport, args, options),
2500
+ /**
2501
+ * Send an input signal into a running agent run.
2502
+ * POST /v1/agent/runs/{run_id}/input
2503
+ * Requires a publishable key with the `studio-embedded` scope.
2504
+ * Acts as the user its session token was minted for, so the token must name one.
2505
+ * @see {@link postAgentRunInput}
2506
+ */
2507
+ postAgentRunInput: (args, options) => postAgentRunInput(transport, args, options)
2508
+ }
2509
+ },
2510
+ studio: {
2511
+ activities: {
2512
+ /**
2513
+ * List all activity categories and their activities.
2514
+ * GET /v1/activities
2515
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2516
+ * @see {@link getActivities}
2517
+ */
2518
+ getActivities: (options) => getActivities(transport, options)
2519
+ },
2520
+ collab: {
2521
+ /**
2522
+ * Stream one itinerary's collaboration session over SSE.
2523
+ * GET /v1/itineraries/{itinerary_id}/events
2524
+ * Requires a publishable key with the `studio-embedded` scope.
2525
+ * Acts as the user its session token was minted for, so the token must name one.
2526
+ * @see {@link getItineraryEvents}
2527
+ */
2528
+ getItineraryEvents: (args, options) => getItineraryEvents(transport, args, options),
2529
+ /**
2530
+ * Stream an organization's list events over SSE.
2531
+ * GET /v1/organizations/{organization_id}/events
2532
+ * Requires a publishable key with the `studio-embedded` scope.
2533
+ * Acts as the user its session token was minted for, so the token must name one.
2534
+ * @see {@link getOrganizationEvents}
2535
+ */
2536
+ getOrganizationEvents: (args, options) => getOrganizationEvents(transport, args, options),
2537
+ /**
2538
+ * Stream one zone's collaboration session over SSE.
2539
+ * GET /v1/zones/{zone_id}/events
2540
+ * Requires a publishable key with the `studio-embedded` scope.
2541
+ * Acts as the user its session token was minted for, so the token must name one.
2542
+ * @see {@link getZoneEvents}
2543
+ */
2544
+ getZoneEvents: (args, options) => getZoneEvents(transport, args, options),
2545
+ /**
2546
+ * Send a collaboration signal into an itinerary's session.
2547
+ * POST /v1/itineraries/{itinerary_id}/collab
2548
+ * Requires a publishable key with the `studio-embedded` scope.
2549
+ * Acts as the user its session token was minted for, so the token must name one.
2550
+ * @see {@link postItineraryCollab}
2551
+ */
2552
+ postItineraryCollab: (args, options) => postItineraryCollab(transport, args, options),
2553
+ /**
2554
+ * Send a collaboration signal into a zone's session.
2555
+ * POST /v1/zones/{zone_id}/collab
2556
+ * Requires a publishable key with the `studio-embedded` scope.
2557
+ * Acts as the user its session token was minted for, so the token must name one.
2558
+ * @see {@link postZoneCollab}
2559
+ */
2560
+ postZoneCollab: (args, options) => postZoneCollab(transport, args, options)
2561
+ },
2562
+ collections: {
2563
+ /**
2564
+ * Delete a collection.
2565
+ * DELETE /v1/collections/{collection_id}
2566
+ * Requires a publishable key with the `studio-embedded` scope.
2567
+ * Acts as the user its session token was minted for, so the token must name one.
2568
+ * @see {@link deleteCollection}
2569
+ */
2570
+ deleteCollection: (args, options) => deleteCollection(transport, args, options),
2571
+ /**
2572
+ * Remove an itinerary from a collection.
2573
+ * DELETE /v1/collections/{collection_id}/itineraries/{itinerary_id}
2574
+ * Requires a publishable key with the `studio-embedded` scope.
2575
+ * Acts as the user its session token was minted for, so the token must name one.
2576
+ * @see {@link deleteCollectionItinerary}
2577
+ */
2578
+ deleteCollectionItinerary: (args, options) => deleteCollectionItinerary(transport, args, options),
2579
+ /**
2580
+ * Remove the collection's share link.
2581
+ * DELETE /v1/collections/{collection_id}/share-link
2582
+ * Requires a publishable key with the `studio-embedded` scope.
2583
+ * Acts as the user its session token was minted for, so the token must name one.
2584
+ * @see {@link deleteCollectionShareLink}
2585
+ */
2586
+ deleteCollectionShareLink: (args, options) => deleteCollectionShareLink(transport, args, options),
2587
+ /**
2588
+ * Remove a zone from a collection.
2589
+ * DELETE /v1/collections/{collection_id}/zones/{zone_id}
2590
+ * Requires a publishable key with the `studio-embedded` scope.
2591
+ * Acts as the user its session token was minted for, so the token must name one.
2592
+ * @see {@link deleteCollectionZone}
2593
+ */
2594
+ deleteCollectionZone: (args, options) => deleteCollectionZone(transport, args, options),
2595
+ /**
2596
+ * Retrieve a single collection with its itineraries and zones.
2597
+ * GET /v1/collections/{collection_id}
2598
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2599
+ * @see {@link getCollection}
2600
+ */
2601
+ getCollection: (args, options) => getCollection(transport, args, options),
2602
+ /**
2603
+ * List the itineraries a collection contains.
2604
+ * GET /v1/collections/{collection_id}/itineraries
2605
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2606
+ * @see {@link getCollectionItineraries}
2607
+ */
2608
+ getCollectionItineraries: (args, options) => getCollectionItineraries(transport, args, options),
2609
+ /**
2610
+ * List collections.
2611
+ * GET /v1/collections
2612
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2613
+ * @see {@link getCollections}
2614
+ */
2615
+ getCollections: (args, options) => getCollections(transport, args, options),
2616
+ /**
2617
+ * Read the collection's share link.
2618
+ * GET /v1/collections/{collection_id}/share-link
2619
+ * Requires a publishable key with the `studio-embedded` scope.
2620
+ * Acts as the user its session token was minted for, so the token must name one.
2621
+ * @see {@link getCollectionShareLink}
2622
+ */
2623
+ getCollectionShareLink: (args, options) => getCollectionShareLink(transport, args, options),
2624
+ /**
2625
+ * List the zones a collection contains.
2626
+ * GET /v1/collections/{collection_id}/zones
2627
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2628
+ * @see {@link getCollectionZones}
2629
+ */
2630
+ getCollectionZones: (args, options) => getCollectionZones(transport, args, options),
2631
+ /**
2632
+ * Update an existing collection.
2633
+ * PATCH /v1/collections/{collection_id}
2634
+ * Requires a publishable key with the `studio-embedded` scope.
2635
+ * Acts as the user its session token was minted for, so the token must name one.
2636
+ * @see {@link patchCollection}
2637
+ */
2638
+ patchCollection: (args, options) => patchCollection(transport, args, options),
2639
+ /**
2640
+ * Set an itinerary's position within a collection.
2641
+ * PATCH /v1/collections/{collection_id}/itineraries/{itinerary_id}
2642
+ * Requires a publishable key with the `studio-embedded` scope.
2643
+ * Acts as the user its session token was minted for, so the token must name one.
2644
+ * @see {@link patchCollectionItinerary}
2645
+ */
2646
+ patchCollectionItinerary: (args, options) => patchCollectionItinerary(transport, args, options),
2647
+ /**
2648
+ * Create a new collection.
2649
+ * POST /v1/collections
2650
+ * Requires a publishable key with the `studio-embedded` scope.
2651
+ * Acts as the user its session token was minted for, so the token must name one.
2652
+ * @see {@link postCollection}
2653
+ */
2654
+ postCollection: (args, options) => postCollection(transport, args, options),
2655
+ /**
2656
+ * Add itineraries to a collection.
2657
+ * POST /v1/collections/{collection_id}/itineraries
2658
+ * Requires a publishable key with the `studio-embedded` scope.
2659
+ * Acts as the user its session token was minted for, so the token must name one.
2660
+ * @see {@link postCollectionItineraries}
2661
+ */
2662
+ postCollectionItineraries: (args, options) => postCollectionItineraries(transport, args, options),
2663
+ /**
2664
+ * Mint the collection's share link, or return the one it has.
2665
+ * POST /v1/collections/{collection_id}/share-link
2666
+ * Requires a publishable key with the `studio-embedded` scope.
2667
+ * Acts as the user its session token was minted for, so the token must name one.
2668
+ * @see {@link postCollectionShareLink}
2669
+ */
2670
+ postCollectionShareLink: (args, options) => postCollectionShareLink(transport, args, options),
2671
+ /**
2672
+ * Rotate the collection's share link.
2673
+ * POST /v1/collections/{collection_id}/share-link/rotate
2674
+ * Requires a publishable key with the `studio-embedded` scope.
2675
+ * Acts as the user its session token was minted for, so the token must name one.
2676
+ * @see {@link postCollectionShareLinkRotate}
2677
+ */
2678
+ postCollectionShareLinkRotate: (args, options) => postCollectionShareLinkRotate(transport, args, options),
2679
+ /**
2680
+ * Add zones to a collection.
2681
+ * POST /v1/collections/{collection_id}/zones
2682
+ * Requires a publishable key with the `studio-embedded` scope.
2683
+ * Acts as the user its session token was minted for, so the token must name one.
2684
+ * @see {@link postCollectionZones}
2685
+ */
2686
+ postCollectionZones: (args, options) => postCollectionZones(transport, args, options)
2687
+ },
2688
+ itineraries: {
2689
+ /**
2690
+ * Delete an itinerary.
2691
+ * DELETE /v1/itineraries/{itinerary_id}
2692
+ * Requires a publishable key with the `studio-embedded` scope.
2693
+ * Acts as the user its session token was minted for, so the token must name one.
2694
+ * @see {@link deleteItinerary}
2695
+ */
2696
+ deleteItinerary: (args, options) => deleteItinerary(transport, args, options),
2697
+ /**
2698
+ * Take the itinerary's publication down.
2699
+ * DELETE /v1/itineraries/{itinerary_id}/publication
2700
+ * Requires a publishable key with the `studio-embedded` scope.
2701
+ * Acts as the user its session token was minted for, so the token must name one.
2702
+ * @see {@link deleteItineraryPublication}
2703
+ */
2704
+ deleteItineraryPublication: (args, options) => deleteItineraryPublication(transport, args, options),
2705
+ /**
2706
+ * Delete a segment from an itinerary.
2707
+ * DELETE /v1/itineraries/{itinerary_id}/segments/{segment_id}
2708
+ * Requires a publishable key with the `studio-embedded` scope.
2709
+ * Acts as the user its session token was minted for, so the token must name one.
2710
+ * @see {@link deleteItinerarySegment}
2711
+ */
2712
+ deleteItinerarySegment: (args, options) => deleteItinerarySegment(transport, args, options),
2713
+ /**
2714
+ * Delete a segment group.
2715
+ * DELETE /v1/itineraries/{itinerary_id}/segment-groups/{group_id}
2716
+ * Requires a publishable key with the `studio-embedded` scope.
2717
+ * Acts as the user its session token was minted for, so the token must name one.
2718
+ * @see {@link deleteItinerarySegmentGroup}
2719
+ */
2720
+ deleteItinerarySegmentGroup: (args, options) => deleteItinerarySegmentGroup(transport, args, options),
2721
+ /**
2722
+ * Remove the itinerary's share link.
2723
+ * DELETE /v1/itineraries/{itinerary_id}/share-link
2724
+ * Requires a publishable key with the `studio-embedded` scope.
2725
+ * Acts as the user its session token was minted for, so the token must name one.
2726
+ * @see {@link deleteItineraryShareLink}
2727
+ */
2728
+ deleteItineraryShareLink: (args, options) => deleteItineraryShareLink(transport, args, options),
2729
+ /**
2730
+ * Delete a waypoint from an itinerary.
2731
+ * DELETE /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id}
2732
+ * Requires a publishable key with the `studio-embedded` scope.
2733
+ * Acts as the user its session token was minted for, so the token must name one.
2734
+ * @see {@link deleteItineraryWaypoint}
2735
+ */
2736
+ deleteItineraryWaypoint: (args, options) => deleteItineraryWaypoint(transport, args, options),
2737
+ /**
2738
+ * List the itineraries the credential reaches.
2739
+ * GET /v1/itineraries
2740
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2741
+ * @see {@link getItineraries}
2742
+ */
2743
+ getItineraries: (args, options) => getItineraries(transport, args, options),
2744
+ /**
2745
+ * Retrieve a single itinerary with its segments and waypoints.
2746
+ * GET /v1/itineraries/{itinerary_id}
2747
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2748
+ * @see {@link getItinerary}
2749
+ */
2750
+ getItinerary: (args, options) => getItinerary(transport, args, options),
2751
+ /**
2752
+ * Export an itinerary as a downloadable file.
2753
+ * GET /v1/itineraries/{itinerary_id}/export
2754
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2755
+ * @see {@link getItineraryExport}
2756
+ */
2757
+ getItineraryExport: (args, options) => getItineraryExport(transport, args, options),
2758
+ /**
2759
+ * Re-time an itinerary at a travel pace the caller names.
2760
+ * GET /v1/itineraries/{itinerary_id}/pace
2761
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2762
+ * @see {@link getItineraryPace}
2763
+ */
2764
+ getItineraryPace: (args, options) => getItineraryPace(transport, args, options),
2765
+ /**
2766
+ * Read the itinerary's share link.
2767
+ * GET /v1/itineraries/{itinerary_id}/share-link
2768
+ * Requires a publishable key with the `studio-embedded` scope.
2769
+ * Acts as the user its session token was minted for, so the token must name one.
2770
+ * @see {@link getItineraryShareLink}
2771
+ */
2772
+ getItineraryShareLink: (args, options) => getItineraryShareLink(transport, args, options),
2773
+ /**
2774
+ * Update an existing itinerary.
2775
+ * PATCH /v1/itineraries/{itinerary_id}
2776
+ * Requires a publishable key with the `studio-embedded` scope.
2777
+ * Acts as the user its session token was minted for, so the token must name one.
2778
+ * @see {@link patchItinerary}
2779
+ */
2780
+ patchItinerary: (args, options) => patchItinerary(transport, args, options),
2781
+ /**
2782
+ * Update an existing segment.
2783
+ * PATCH /v1/itineraries/{itinerary_id}/segments/{segment_id}
2784
+ * Requires a publishable key with the `studio-embedded` scope.
2785
+ * Acts as the user its session token was minted for, so the token must name one.
2786
+ * @see {@link patchItinerarySegment}
2787
+ */
2788
+ patchItinerarySegment: (args, options) => patchItinerarySegment(transport, args, options),
2789
+ /**
2790
+ * Update a segment group.
2791
+ * PATCH /v1/itineraries/{itinerary_id}/segment-groups/{group_id}
2792
+ * Requires a publishable key with the `studio-embedded` scope.
2793
+ * Acts as the user its session token was minted for, so the token must name one.
2794
+ * @see {@link patchItinerarySegmentGroup}
2795
+ */
2796
+ patchItinerarySegmentGroup: (args, options) => patchItinerarySegmentGroup(transport, args, options),
2797
+ /**
2798
+ * Update an existing waypoint.
2799
+ * PATCH /v1/itineraries/{itinerary_id}/waypoints/{waypoint_id}
2800
+ * Requires a publishable key with the `studio-embedded` scope.
2801
+ * Acts as the user its session token was minted for, so the token must name one.
2802
+ * @see {@link patchItineraryWaypoint}
2803
+ */
2804
+ patchItineraryWaypoint: (args, options) => patchItineraryWaypoint(transport, args, options),
2805
+ /**
2806
+ * Create a new itinerary.
2807
+ * POST /v1/itineraries
2808
+ * Requires a publishable key with the `studio-embedded` scope.
2809
+ * Acts as the user its session token was minted for, so the token must name one.
2810
+ * @see {@link postItinerary}
2811
+ */
2812
+ postItinerary: (args, options) => postItinerary(transport, args, options),
2813
+ /**
2814
+ * Duplicate an itinerary into the key's organization.
2815
+ * POST /v1/itineraries/{itinerary_id}/duplicate
2816
+ * Requires a publishable key with the `studio-embedded` scope.
2817
+ * Acts as the user its session token was minted for, so the token must name one.
2818
+ * @see {@link postItineraryDuplicate}
2819
+ */
2820
+ postItineraryDuplicate: (args, options) => postItineraryDuplicate(transport, args, options),
2821
+ /**
2822
+ * Confirm an itinerary import, persisting the reviewed draft.
2823
+ * POST /v1/itineraries/import
2824
+ * Requires a publishable key with the `studio-embedded` scope.
2825
+ * Acts as the user its session token was minted for, so the token must name one.
2826
+ * @see {@link postItineraryImport}
2827
+ */
2828
+ postItineraryImport: (args, options) => postItineraryImport(transport, args, options),
2829
+ /**
2830
+ * Preview an itinerary import without persisting it.
2831
+ * POST /v1/itineraries/preview
2832
+ * Requires a publishable key with the `studio-embedded` scope.
2833
+ * Acts as the user its session token was minted for, so the token must name one.
2834
+ * @see {@link postItineraryPreview}
2835
+ */
2836
+ postItineraryPreview: (args, options) => postItineraryPreview(transport, args, options),
2837
+ /**
2838
+ * Publish the itinerary's current draft.
2839
+ * POST /v1/itineraries/{itinerary_id}/publication
2840
+ * Requires a publishable key with the `studio-embedded` scope.
2841
+ * Acts as the user its session token was minted for, so the token must name one.
2842
+ * @see {@link postItineraryPublication}
2843
+ */
2844
+ postItineraryPublication: (args, options) => postItineraryPublication(transport, args, options),
2845
+ /**
2846
+ * Create a segment, at the end of the chain or before another.
2847
+ * POST /v1/itineraries/{itinerary_id}/segments
2848
+ * Requires a publishable key with the `studio-embedded` scope.
2849
+ * Acts as the user its session token was minted for, so the token must name one.
2850
+ * @see {@link postItinerarySegment}
2851
+ */
2852
+ postItinerarySegment: (args, options) => postItinerarySegment(transport, args, options),
2853
+ /**
2854
+ * Convert a segment between routed and freehand.
2855
+ * POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/convert
2856
+ * Requires a publishable key with the `studio-embedded` scope.
2857
+ * Acts as the user its session token was minted for, so the token must name one.
2858
+ * @see {@link postItinerarySegmentConvert}
2859
+ */
2860
+ postItinerarySegmentConvert: (args, options) => postItinerarySegmentConvert(transport, args, options),
2861
+ /**
2862
+ * Group a contiguous run of an itinerary's segments.
2863
+ * POST /v1/itineraries/{itinerary_id}/segment-groups
2864
+ * Requires a publishable key with the `studio-embedded` scope.
2865
+ * Acts as the user its session token was minted for, so the token must name one.
2866
+ * @see {@link postItinerarySegmentGroup}
2867
+ */
2868
+ postItinerarySegmentGroup: (args, options) => postItinerarySegmentGroup(transport, args, options),
2869
+ /**
2870
+ * Merge a segment with the one that follows it.
2871
+ * POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/merge
2872
+ * Requires a publishable key with the `studio-embedded` scope.
2873
+ * Acts as the user its session token was minted for, so the token must name one.
2874
+ * @see {@link postItinerarySegmentMerge}
2875
+ */
2876
+ postItinerarySegmentMerge: (args, options) => postItinerarySegmentMerge(transport, args, options),
2877
+ /**
2878
+ * Split a segment in two at a fraction of its length.
2879
+ * POST /v1/itineraries/{itinerary_id}/segments/{segment_id}/split
2880
+ * Requires a publishable key with the `studio-embedded` scope.
2881
+ * Acts as the user its session token was minted for, so the token must name one.
2882
+ * @see {@link postItinerarySegmentSplit}
2883
+ */
2884
+ postItinerarySegmentSplit: (args, options) => postItinerarySegmentSplit(transport, args, options),
2885
+ /**
2886
+ * Mint the itinerary's share link, or return the one it has.
2887
+ * POST /v1/itineraries/{itinerary_id}/share-link
2888
+ * Requires a publishable key with the `studio-embedded` scope.
2889
+ * Acts as the user its session token was minted for, so the token must name one.
2890
+ * @see {@link postItineraryShareLink}
2891
+ */
2892
+ postItineraryShareLink: (args, options) => postItineraryShareLink(transport, args, options),
2893
+ /**
2894
+ * Rotate the itinerary's share link.
2895
+ * POST /v1/itineraries/{itinerary_id}/share-link/rotate
2896
+ * Requires a publishable key with the `studio-embedded` scope.
2897
+ * Acts as the user its session token was minted for, so the token must name one.
2898
+ * @see {@link postItineraryShareLinkRotate}
2899
+ */
2900
+ postItineraryShareLinkRotate: (args, options) => postItineraryShareLinkRotate(transport, args, options),
2901
+ /**
2902
+ * Create a new waypoint within an itinerary.
2903
+ * POST /v1/itineraries/{itinerary_id}/waypoints
2904
+ * Requires a publishable key with the `studio-embedded` scope.
2905
+ * Acts as the user its session token was minted for, so the token must name one.
2906
+ * @see {@link postItineraryWaypoint}
2907
+ */
2908
+ postItineraryWaypoint: (args, options) => postItineraryWaypoint(transport, args, options)
2909
+ },
2910
+ layers: {
2911
+ /**
2912
+ * List terrains, overlays, and the zone layer.
2913
+ * GET /v1/layers
2914
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2915
+ * @see {@link getLayers}
2916
+ */
2917
+ getLayers: (args, options) => getLayers(transport, args, options)
2918
+ },
2919
+ organizations: {
2920
+ /**
2921
+ * Resolve the organization a publishable key belongs to.
2922
+ * POST /v1/organizations/lookup
2923
+ * Takes no credential.
2924
+ * @see {@link postOrganizationLookup}
2925
+ */
2926
+ postOrganizationLookup: (args, options) => postOrganizationLookup(transport, args, options)
2927
+ },
2928
+ zones: {
2929
+ /**
2930
+ * Delete a zone.
2931
+ * DELETE /v1/zones/{zone_id}
2932
+ * Requires a publishable key with the `studio-embedded` scope.
2933
+ * Acts as the user its session token was minted for, so the token must name one.
2934
+ * @see {@link deleteZone}
2935
+ */
2936
+ deleteZone: (args, options) => deleteZone(transport, args, options),
2937
+ /**
2938
+ * Take the zone's publication down.
2939
+ * DELETE /v1/zones/{zone_id}/publication
2940
+ * Requires a publishable key with the `studio-embedded` scope.
2941
+ * Acts as the user its session token was minted for, so the token must name one.
2942
+ * @see {@link deleteZonePublication}
2943
+ */
2944
+ deleteZonePublication: (args, options) => deleteZonePublication(transport, args, options),
2945
+ /**
2946
+ * Retrieve a single zone with its geometry.
2947
+ * GET /v1/zones/{zone_id}
2948
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2949
+ * @see {@link getZone}
2950
+ */
2951
+ getZone: (args, options) => getZone(transport, args, options),
2952
+ /**
2953
+ * List zones.
2954
+ * GET /v1/zones
2955
+ * Requires a publishable key with the `publishing` scope, or the `studio-embedded` scope that includes it.
2956
+ * @see {@link getZones}
2957
+ */
2958
+ getZones: (args, options) => getZones(transport, args, options),
2959
+ /**
2960
+ * Update an existing zone.
2961
+ * PATCH /v1/zones/{zone_id}
2962
+ * Requires a publishable key with the `studio-embedded` scope.
2963
+ * Acts as the user its session token was minted for, so the token must name one.
2964
+ * @see {@link patchZone}
2965
+ */
2966
+ patchZone: (args, options) => patchZone(transport, args, options),
2967
+ /**
2968
+ * Create a new zone.
2969
+ * POST /v1/zones
2970
+ * Requires a publishable key with the `studio-embedded` scope.
2971
+ * Acts as the user its session token was minted for, so the token must name one.
2972
+ * @see {@link postZone}
2973
+ */
2974
+ postZone: (args, options) => postZone(transport, args, options),
2975
+ /**
2976
+ * Publish the zone's current draft.
2977
+ * POST /v1/zones/{zone_id}/publication
2978
+ * Requires a publishable key with the `studio-embedded` scope.
2979
+ * Acts as the user its session token was minted for, so the token must name one.
2980
+ * @see {@link postZonePublication}
2981
+ */
2982
+ postZonePublication: (args, options) => postZonePublication(transport, args, options)
2983
+ }
2984
+ }
2985
+ });
2986
+
2987
+ // src/core/rules/errors.ts
2988
+ var MountayaError = class extends Error {
2989
+ name = "MountayaError";
2990
+ /**
2991
+ * The `Idempotency-Key` the call that raised this error fixed for its attempts, the caller's own
2992
+ * or the one the client drew for it, and undefined where it fixed none: a read, an operation
2993
+ * that declares no key, a call whose own arguments were refused, and a runtime with no
2994
+ * cryptographic random source. The key is fixed before the first attempt, so a call whose
2995
+ * credential its first attempt refused, or whose wait for a first session token ran out,
2996
+ * carries it too.
2997
+ *
2998
+ * A write that carried one may have been made whatever the error says: an answer that never
2999
+ * arrived, a 5xx and a body that broke off do not tell. Send the same call again with this key
3000
+ * as its `idempotencyKey`, never a new one: the API answers a key it has seen with the answer it
3001
+ * kept, or runs the write where it made none, so the write is made once. A new key is a new
3002
+ * write, made a second time where the first one landed.
3003
+ */
3004
+ idempotencyKey;
3005
+ // The constructor narrows the signature rather than adding behaviour: `Error`'s `message`
3006
+ // is optional and this family's is not. Dropping it makes
3007
+ // `new MountayaConfigurationError()` compile, which is a thrown value carrying nothing a
3008
+ // caller can read.
3009
+ /**
3010
+ * @param message - what went wrong and what to do about it, naming the call where there is one.
3011
+ * @param options - the standard error options, for the `cause` behind it, and the
3012
+ * `idempotencyKey` the call sent, where it sent one.
3013
+ */
3014
+ constructor(message, options) {
3015
+ super(message, options);
3016
+ this.idempotencyKey = options?.idempotencyKey;
3017
+ }
3018
+ };
3019
+ var MountayaConfigurationError = class extends MountayaError {
3020
+ name = "MountayaConfigurationError";
3021
+ };
3022
+ var describeType = (value) => {
3023
+ if (value === null || value === void 0) {
3024
+ return String(value);
3025
+ }
3026
+ const type = Array.isArray(value) ? "array" : typeof value;
3027
+ return /^[aeiou]/.test(type) ? `an ${type}` : `a ${type}`;
3028
+ };
3029
+ var describeValue = (value) => {
3030
+ if (typeof value === "string") {
3031
+ return JSON.stringify(value);
3032
+ }
3033
+ try {
3034
+ return String(value);
3035
+ } catch {
3036
+ return describeType(value);
3037
+ }
3038
+ };
3039
+ var refuseOption = (path, value, remedy, context) => new MountayaConfigurationError(
3040
+ `${`${context}: `}${path} is ${describeValue(value)}; ${remedy}`
3041
+ );
3042
+
3043
+ // src/core/rules/dates.ts
3044
+ var isoDate = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/;
3045
+ var ISO_DATE_MIN_LENGTH = 20;
3046
+ var ISO_DATE_SEPARATOR = 84;
3047
+ var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
3048
+ var isLeapYear = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
3049
+ var daysIn = (year, month) => month === 2 && isLeapYear(year) ? 29 : MONTH_DAYS[month - 1] ?? 0;
3050
+ var instantOf = (value) => {
3051
+ if (value.length < ISO_DATE_MIN_LENGTH || value.charCodeAt(10) !== ISO_DATE_SEPARATOR) {
3052
+ return void 0;
3053
+ }
3054
+ const fields = isoDate.exec(value);
3055
+ if (fields === null) {
3056
+ return void 0;
3057
+ }
3058
+ const field = (index) => Number(fields[index] ?? 0);
3059
+ const year = field(1);
3060
+ const month = field(2);
3061
+ const day = field(3);
3062
+ const named = 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;
3063
+ if (!named) {
3064
+ return void 0;
3065
+ }
3066
+ const instant = new Date(value);
3067
+ return Number.isNaN(instant.getTime()) ? void 0 : instant;
3068
+ };
3069
+
3070
+ // src/core/rules/nullMask.ts
3071
+ var isHolding = (mask) => Array.isArray(mask) && mask.length === 2 && mask[0] === true;
3072
+ var isVariants = (mask) => Array.isArray(mask) && mask.length === 2 && typeof mask[0] === "string";
3073
+ var isListMask = (mask) => Array.isArray(mask) && mask.length === 1;
3074
+ var isMembers = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3075
+ var withAbsentNulls = (value, mask) => {
3076
+ if (mask === void 0 || mask === true || isHolding(mask)) {
3077
+ return value;
3078
+ }
3079
+ if (isListMask(mask)) {
3080
+ if (!Array.isArray(value)) {
3081
+ return value;
3082
+ }
3083
+ let copy2;
3084
+ for (const [index, element] of value.entries()) {
3085
+ const written = withAbsentNulls(element, mask[0]);
3086
+ if (written !== element) {
3087
+ copy2 ??= [...value];
3088
+ copy2[index] = written;
3089
+ }
3090
+ }
3091
+ return copy2 ?? value;
3092
+ }
3093
+ if (!isMembers(value)) {
3094
+ return value;
3095
+ }
3096
+ if (isVariants(mask)) {
3097
+ const [discriminator, variants] = mask;
3098
+ const variant = value[discriminator];
3099
+ return typeof variant === "string" && Object.hasOwn(variants, variant) ? withAbsentNulls(value, variants[variant]) : value;
3100
+ }
3101
+ let copy;
3102
+ for (const [member, inner] of Object.entries(mask)) {
3103
+ if (!Object.hasOwn(value, member)) {
3104
+ if (inner === true || isHolding(inner)) {
3105
+ copy ??= { ...value };
3106
+ copy[member] = null;
3107
+ }
3108
+ continue;
3109
+ }
3110
+ const held = value[member];
3111
+ const written = withAbsentNulls(held, isHolding(inner) ? inner[1] : inner);
3112
+ if (written !== held) {
3113
+ copy ??= { ...value };
3114
+ copy[member] = written;
3115
+ }
3116
+ }
3117
+ return copy ?? value;
3118
+ };
3119
+
3120
+ // src/core/rules/nullMasks.gen.ts
3121
+ var localesNulls = { de: true, en: true, es: true, fr: true, it: true, ja: true, zh: true };
3122
+ var activityNulls = { locales: localesNulls };
3123
+ var aiProviderConfigNulls = { base_url: true };
3124
+ var billingPricingNulls = { unit_amount: true };
3125
+ var billingProductNulls = { prices: [billingPricingNulls] };
3126
+ var categoryActivitiesNulls = { children: [activityNulls], locales: localesNulls };
3127
+ var tileLegendNulls = { locales: localesNulls };
3128
+ var tileLayerNulls = { layout: true, legend: tileLegendNulls, paint: true };
3129
+ var tileSourceNulls = { layers: [tileLayerNulls] };
3130
+ var overlayNulls = { locales: localesNulls, sources: [tileSourceNulls] };
3131
+ var categoryOverlaysNulls = { children: [overlayNulls], locales: localesNulls };
3132
+ var collabCursorEventNulls = { position: true };
3133
+ var collabCursorSignalNulls = { position: true };
3134
+ var collabSelectionEventNulls = { selection: true };
3135
+ var collabSelectionSignalNulls = { selection: true };
3136
+ var collabSignalParamsNulls = ["type", { cursor: collabCursorSignalNulls, selection: collabSelectionSignalNulls }];
3137
+ var collabStreamEventNulls = ["type", { cursor: collabCursorEventNulls, selection: collabSelectionEventNulls }];
3138
+ var collectionNulls = { description: true, organization_id: true, sources: [tileSourceNulls] };
3139
+ var collectionEventObjectNulls = { description: true };
3140
+ var itineraryNulls = { ascent: true, description: true, distance: true, organization_id: true };
3141
+ var itineraryDirectionsStepNulls = { exit_number: true };
3142
+ var itineraryEventObjectNulls = { description: true };
3143
+ var proposedSegmentNulls = { recommendation_reason: true };
3144
+ var itineraryImportPreviewNulls = { segments: [proposedSegmentNulls] };
3145
+ var itinerarySegmentNulls = { altitude_max: true, altitude_min: true, ascent: true, color: true, descent: true, description: true, distance: true, duration: true, geojson: true, gradient_max: true, gradient_min: true, group_id: true, road_access_info: true, slope_info: true, speed: true, speed_info: true, start_at: true, steps: [true, [itineraryDirectionsStepNulls]], surface_info: true, trail_difficulty_info: true, way_type_info: true };
3146
+ var itinerarySegmentGroupNulls = { speed: true };
3147
+ var itineraryWaypointNulls = { color: true, contact: true, description: true, geojson: true, icon: true, media: true, name: true, properties: true, timing: true };
3148
+ var itineraryWaypointEventObjectNulls = { name: true };
3149
+ var itineraryWithDetailsNulls = { ascent: true, description: true, distance: true, groups: [itinerarySegmentGroupNulls], organization_id: true, published_at: true, segments: [itinerarySegmentNulls], waypoints: [itineraryWaypointNulls] };
3150
+ var terrainNulls = { locales: localesNulls };
3151
+ var layersNulls = { itineraries: overlayNulls, overlays: [categoryOverlaysNulls], terrains: [terrainNulls], zones: overlayNulls };
3152
+ var paginationMetadataNulls = { next_cursor: true };
3153
+ var listMetadataNulls = { pagination: paginationMetadataNulls };
3154
+ var notificationPreferenceNulls = { locked_reason: true };
3155
+ var notificationPreferencesNulls = { notifications: [notificationPreferenceNulls] };
3156
+ var subscriptionDiscountNulls = { ends_at: true };
3157
+ var organizationSubscriptionNulls = { discount: subscriptionDiscountNulls };
3158
+ var organizationSubscriptionSummaryNulls = { api: organizationSubscriptionNulls };
3159
+ var sessionNulls = { user_id: true };
3160
+ var webhookDeliveryNulls = { next_attempt_at: true };
3161
+ var webhookDeliveryTriggerNulls = { delivery_id: true };
3162
+ var webhookDeliveryWithAttemptsNulls = { next_attempt_at: true };
3163
+ var webhookEndpointNulls = { created_by: true, description: true, disabled_at: true, disabled_reason: true, failing_since: true };
3164
+ var webhookEndpointEventObjectNulls = { failing_since: true };
3165
+ var webhookEndpointWithSecretNulls = { created_by: true, description: true, disabled_at: true, disabled_reason: true, failing_since: true };
3166
+ var zoneEventObjectNulls = { description: true, end_at: true, start_at: true };
3167
+ var webhookEventObjectNulls = ["object", { collection: collectionEventObjectNulls, itinerary: itineraryEventObjectNulls, "itinerary.waypoint": itineraryWaypointEventObjectNulls, "organization.webhook_endpoint": webhookEndpointEventObjectNulls, zone: zoneEventObjectNulls }];
3168
+ var webhookEventDataNulls = { object: webhookEventObjectNulls };
3169
+ var webhookEventNulls = { data: webhookEventDataNulls, request: true };
3170
+ var webhookEventWithDeliveriesNulls = { data: webhookEventDataNulls, deliveries: [webhookDeliveryNulls], request: true };
3171
+ var webhookHealthDestinationNulls = { eventual_success_rate: true, first_attempt_success_rate: true, last_success_at: true };
3172
+ var webhookHealthFiguresNulls = { availability: true, dispatch_delay_p50_ms: true, dispatch_delay_p95_ms: true, dispatched_within_60s: true, eventual_success_rate: true, first_attempt_success_rate: true, response_time_p50_ms: true, response_time_p95_ms: true };
3173
+ var webhookHealthPointNulls = { availability: true, dispatch_delay_p50_ms: true, dispatch_delay_p95_ms: true, dispatched_within_60s: true, eventual_success_rate: true, first_attempt_success_rate: true, response_time_p50_ms: true, response_time_p95_ms: true };
3174
+ var webhookHealthNulls = { destinations: [webhookHealthDestinationNulls], series: [webhookHealthPointNulls], totals: webhookHealthFiguresNulls };
3175
+ var zoneNulls = { description: true, end_at: true, organization_id: true, published_at: true, source: true, start_at: true };
3176
+ var restSchemaNulls = {
3177
+ Activity: activityNulls,
3178
+ AiProviderConfig: aiProviderConfigNulls,
3179
+ BillingPricing: billingPricingNulls,
3180
+ BillingProduct: billingProductNulls,
3181
+ CategoryActivities: categoryActivitiesNulls,
3182
+ CategoryOverlays: categoryOverlaysNulls,
3183
+ CollabCursorEvent: collabCursorEventNulls,
3184
+ CollabCursorSignal: collabCursorSignalNulls,
3185
+ CollabSelectionEvent: collabSelectionEventNulls,
3186
+ CollabSelectionSignal: collabSelectionSignalNulls,
3187
+ CollabSignalParams: collabSignalParamsNulls,
3188
+ CollabStreamEvent: collabStreamEventNulls,
3189
+ Collection: collectionNulls,
3190
+ CollectionEventObject: collectionEventObjectNulls,
3191
+ Itinerary: itineraryNulls,
3192
+ ItineraryDirectionsStep: itineraryDirectionsStepNulls,
3193
+ ItineraryEventObject: itineraryEventObjectNulls,
3194
+ ItineraryImportPreview: itineraryImportPreviewNulls,
3195
+ ItinerarySegment: itinerarySegmentNulls,
3196
+ ItinerarySegmentGroup: itinerarySegmentGroupNulls,
3197
+ ItineraryWaypoint: itineraryWaypointNulls,
3198
+ ItineraryWaypointEventObject: itineraryWaypointEventObjectNulls,
3199
+ ItineraryWithDetails: itineraryWithDetailsNulls,
3200
+ Layers: layersNulls,
3201
+ ListMetadata: listMetadataNulls,
3202
+ Locales: localesNulls,
3203
+ NotificationPreference: notificationPreferenceNulls,
3204
+ NotificationPreferences: notificationPreferencesNulls,
3205
+ OrganizationSubscription: organizationSubscriptionNulls,
3206
+ OrganizationSubscriptionSummary: organizationSubscriptionSummaryNulls,
3207
+ Overlay: overlayNulls,
3208
+ PaginationMetadata: paginationMetadataNulls,
3209
+ ProposedSegment: proposedSegmentNulls,
3210
+ Session: sessionNulls,
3211
+ SubscriptionDiscount: subscriptionDiscountNulls,
3212
+ Terrain: terrainNulls,
3213
+ TileLayer: tileLayerNulls,
3214
+ TileLegend: tileLegendNulls,
3215
+ TileSource: tileSourceNulls,
3216
+ WebhookDelivery: webhookDeliveryNulls,
3217
+ WebhookDeliveryTrigger: webhookDeliveryTriggerNulls,
3218
+ WebhookDeliveryWithAttempts: webhookDeliveryWithAttemptsNulls,
3219
+ WebhookEndpoint: webhookEndpointNulls,
3220
+ WebhookEndpointEventObject: webhookEndpointEventObjectNulls,
3221
+ WebhookEndpointWithSecret: webhookEndpointWithSecretNulls,
3222
+ WebhookEvent: webhookEventNulls,
3223
+ WebhookEventData: webhookEventDataNulls,
3224
+ WebhookEventObject: webhookEventObjectNulls,
3225
+ WebhookEventWithDeliveries: webhookEventWithDeliveriesNulls,
3226
+ WebhookHealth: webhookHealthNulls,
3227
+ WebhookHealthDestination: webhookHealthDestinationNulls,
3228
+ WebhookHealthFigures: webhookHealthFiguresNulls,
3229
+ WebhookHealthPoint: webhookHealthPointNulls,
3230
+ Zone: zoneNulls,
3231
+ ZoneEventObject: zoneEventObjectNulls
3232
+ };
3233
+
3234
+ // src/core/rules/decode.ts
3235
+ var schemaDates = restSchemaDates;
3236
+ var schemaNulls = restSchemaNulls;
3237
+ var isList = (value) => Array.isArray(value);
3238
+ var decodedCopy = (value, mask) => {
3239
+ if (mask === true) {
3240
+ return typeof value === "string" ? instantOf(value) ?? value : value;
3241
+ }
3242
+ if (isList(mask)) {
3243
+ if (!isList(value)) {
3244
+ return value;
3245
+ }
3246
+ const [element] = mask;
3247
+ let copy2;
3248
+ for (const [index, member] of value.entries()) {
3249
+ const decoded = decodedCopy(member, element);
3250
+ if (decoded !== member) {
3251
+ copy2 ??= [...value];
3252
+ copy2[index] = decoded;
3253
+ }
3254
+ }
3255
+ return copy2 ?? value;
3256
+ }
3257
+ if (typeof value !== "object" || value === null || isList(value)) {
3258
+ return value;
3259
+ }
3260
+ let copy;
3261
+ for (const [field, fieldMask] of Object.entries(mask)) {
3262
+ if (Object.hasOwn(value, field)) {
3263
+ const current = Reflect.get(value, field);
3264
+ const decoded = decodedCopy(current, fieldMask);
3265
+ if (decoded !== current) {
3266
+ copy ??= { ...value };
3267
+ copy[field] = decoded;
3268
+ }
3269
+ }
3270
+ }
3271
+ return copy ?? value;
3272
+ };
3273
+ var decodeRestSchema = (schema, json) => (
3274
+ // The cast is this function's contract: the schema types the answer, and nothing is validated.
3275
+ withAbsentNulls(
3276
+ decodeSchemaInstants(schema, json),
3277
+ Object.hasOwn(schemaNulls, schema) ? schemaNulls[schema] : void 0
3278
+ )
3279
+ );
3280
+ var decodeSchemaInstants = (schema, json) => {
3281
+ const mask = schemaDates[schema];
3282
+ return mask === void 0 ? json : decodedCopy(json, mask);
3283
+ };
3284
+
3285
+ // src/webhooks/rules/constructWebhookEvent.ts
3286
+ var CONTEXT = "constructWebhookEvent";
3287
+ var DEFAULT_TOLERANCE_SECONDS = 300;
3288
+ var SECRET_PREFIX = "whsk_";
3289
+ var wholeSeconds = /^\d+$/;
3290
+ var LATEST_WRITTEN_SECONDS = 253402300799;
3291
+ var signedAt = (timestamp) => timestamp <= LATEST_WRITTEN_SECONDS ? new Date(timestamp * 1e3).toISOString() : `t=${timestamp}`;
3292
+ var MountayaWebhookSignatureError = class extends MountayaError {
3293
+ name = "MountayaWebhookSignatureError";
3294
+ /** Why the delivery was refused: see {@link WebhookSignatureFailure}. */
3295
+ reason;
3296
+ /**
3297
+ * @param message - what was refused, and what to do about it.
3298
+ * @param reason - why the delivery was refused.
3299
+ */
3300
+ constructor(message, reason) {
3301
+ super(message);
3302
+ this.reason = reason;
3303
+ }
3304
+ };
3305
+ var parseSignatureHeader = (header) => {
3306
+ const signatures = [];
3307
+ const timestamps = [];
3308
+ for (const element of header.split(",")) {
3309
+ const separator = element.indexOf("=");
3310
+ if (separator === -1) {
3311
+ return void 0;
3312
+ }
3313
+ const key = element.slice(0, separator).trim();
3314
+ const value = element.slice(separator + 1).trim();
3315
+ if (key === "t") {
3316
+ timestamps.push(value);
3317
+ } else if (key === "v1") {
3318
+ signatures.push(value);
3319
+ }
3320
+ }
3321
+ const [stated] = timestamps;
3322
+ if (timestamps.length !== 1 || stated === void 0 || !wholeSeconds.test(stated)) {
3323
+ return void 0;
3324
+ }
3325
+ const timestamp = Number(stated);
3326
+ if (!Number.isSafeInteger(timestamp) || signatures.length === 0) {
3327
+ return void 0;
3328
+ }
3329
+ return { signatures, stated, timestamp };
3330
+ };
3331
+ var subtleCrypto = () => {
3332
+ const runtime = globalThis;
3333
+ return runtime.crypto?.subtle;
3334
+ };
3335
+ var hexOf = (bytes) => Array.from(new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
3336
+ var equalInConstantTime = (candidate, expected) => {
3337
+ if (candidate.length !== expected.length) {
3338
+ return false;
3339
+ }
3340
+ let difference = 0;
3341
+ for (let index = 0; index < expected.length; index += 1) {
3342
+ difference |= candidate.charCodeAt(index) ^ expected.charCodeAt(index);
3343
+ }
3344
+ return difference === 0;
3345
+ };
3346
+ var signedBytes = (stated, body) => {
3347
+ const prefix = new TextEncoder().encode(`${stated}.`);
3348
+ const signed = new Uint8Array(prefix.length + body.length);
3349
+ signed.set(prefix);
3350
+ signed.set(body, prefix.length);
3351
+ return signed;
3352
+ };
3353
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3354
+ var envelopeOf = (body) => {
3355
+ 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.`;
3356
+ let parsed;
3357
+ try {
3358
+ parsed = JSON.parse(new TextDecoder().decode(body));
3359
+ } catch (cause) {
3360
+ throw new MountayaConfigurationError(refusal, { cause });
3361
+ }
3362
+ if (!isRecord(parsed)) {
3363
+ throw new MountayaConfigurationError(refusal);
3364
+ }
3365
+ return parsed;
3366
+ };
3367
+ var withPreviousAttributes = (event) => {
3368
+ if (!isRecord(event) || !isRecord(event.data) || !isRecord(event.data.previous_attributes)) {
3369
+ return event;
3370
+ }
3371
+ const held = event.data.previous_attributes;
3372
+ const decoded = decodeSchemaInstants("WebhookEventObject", held);
3373
+ return decoded === held ? event : { ...event, data: { ...event.data, previous_attributes: decoded } };
3374
+ };
3375
+ var millisecondsOf = (value) => {
3376
+ try {
3377
+ return Date.prototype.getTime.call(value);
3378
+ } catch {
3379
+ return void 0;
3380
+ }
3381
+ };
3382
+ var constructWebhookEvent = async (rawBody, signatureHeader, secret, options) => {
3383
+ if (typeof rawBody !== "string" && !(rawBody instanceof Uint8Array)) {
3384
+ throw new MountayaConfigurationError(
3385
+ `${CONTEXT}: rawBody is ${describeType(rawBody)}; pass the body exactly as it arrived, as a string or a Uint8Array, before any JSON parser reads it.`
3386
+ );
3387
+ }
3388
+ if (typeof secret !== "string" || !secret.startsWith(SECRET_PREFIX)) {
3389
+ throw new MountayaConfigurationError(
3390
+ `${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.`
3391
+ );
3392
+ }
3393
+ if (options !== void 0 && (typeof options !== "object" || options === null)) {
3394
+ throw refuseOption(
3395
+ "options",
3396
+ options,
3397
+ "pass an object such as { toleranceSeconds: 600 }, or leave it out for the defaults.",
3398
+ CONTEXT
3399
+ );
3400
+ }
3401
+ const toleranceSeconds = options?.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
3402
+ if (typeof toleranceSeconds !== "number" || !Number.isFinite(toleranceSeconds) || toleranceSeconds < 0) {
3403
+ throw refuseOption(
3404
+ "toleranceSeconds",
3405
+ toleranceSeconds,
3406
+ `pass a finite number of seconds from 0, or leave it out for ${DEFAULT_TOLERANCE_SECONDS}.`,
3407
+ CONTEXT
3408
+ );
3409
+ }
3410
+ const stated = options?.now;
3411
+ const statedMilliseconds = stated === void 0 ? void 0 : millisecondsOf(stated);
3412
+ if (stated !== void 0 && (statedMilliseconds === void 0 || !Number.isFinite(statedMilliseconds))) {
3413
+ throw refuseOption(
3414
+ "now",
3415
+ stated,
3416
+ "pass a Date that names an instant, or leave it out for the machine's wall clock.",
3417
+ CONTEXT
3418
+ );
3419
+ }
3420
+ const subtle = subtleCrypto();
3421
+ if (subtle === void 0) {
3422
+ throw new MountayaConfigurationError(
3423
+ `${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.`
3424
+ );
3425
+ }
3426
+ if (signatureHeader === null || signatureHeader === void 0 || signatureHeader.trim() === "") {
3427
+ throw new MountayaWebhookSignatureError(
3428
+ `${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.`,
3429
+ "missing-header"
3430
+ );
3431
+ }
3432
+ const header = parseSignatureHeader(signatureHeader);
3433
+ if (header === void 0) {
3434
+ throw new MountayaWebhookSignatureError(
3435
+ `${CONTEXT}: the Mountaya-Signature header ${JSON.stringify(signatureHeader)} is not t=<unix seconds>,v1=<signature>. Pass the header exactly as the request carries it.`,
3436
+ "malformed-header"
3437
+ );
3438
+ }
3439
+ const body = typeof rawBody === "string" ? new TextEncoder().encode(rawBody) : rawBody;
3440
+ const key = await subtle.importKey(
3441
+ "raw",
3442
+ new TextEncoder().encode(secret),
3443
+ { hash: "SHA-256", name: "HMAC" },
3444
+ false,
3445
+ ["sign"]
3446
+ );
3447
+ const expected = hexOf(await subtle.sign("HMAC", key, signedBytes(header.stated, body)));
3448
+ const verified = header.signatures.reduce(
3449
+ (found, candidate) => equalInConstantTime(candidate, expected) || found,
3450
+ false
3451
+ );
3452
+ if (!verified) {
3453
+ throw new MountayaWebhookSignatureError(
3454
+ `${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.`,
3455
+ "signature"
3456
+ );
3457
+ }
3458
+ const skew = Math.abs((statedMilliseconds ?? Date.now()) / 1e3 - header.timestamp);
3459
+ if (skew > toleranceSeconds) {
3460
+ throw new MountayaWebhookSignatureError(
3461
+ `${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.`,
3462
+ "timestamp"
3463
+ );
3464
+ }
3465
+ const event = withPreviousAttributes(decodeRestSchema("WebhookEvent", envelopeOf(body)));
3466
+ return event;
3467
+ };
3468
+
3469
+ // src/admin/rules/mountayaAdmin.ts
3470
+ var bound = /* @__PURE__ */ new WeakMap();
3471
+ var adminOperationsOf = (transport) => {
3472
+ const held = bound.get(transport);
3473
+ if (held !== void 0) {
3474
+ return held;
3475
+ }
3476
+ const table = bind(transport).admin;
3477
+ bound.set(transport, table);
3478
+ return table;
3479
+ };
3480
+ var MountayaAdmin = class {
3481
+ /** The organization's billing: its subscription, its payment methods, its details and invoices. */
3482
+ billing;
3483
+ /** The organization's invitations. */
3484
+ invitations;
3485
+ /** The organization's publishable keys. */
3486
+ keys;
3487
+ /** The organization's members. */
3488
+ members;
3489
+ /** The organizations themselves: their details, settings, usage and AI provider configuration. */
3490
+ organizations;
3491
+ /** Minting a session token for a publishable key. */
3492
+ sessions;
3493
+ /** The acting user's own memberships, invitations and preferences. */
3494
+ users;
3495
+ /** The organization's webhook endpoints, the events it was sent and their deliveries. */
3496
+ webhooks;
3497
+ /**
3498
+ * Binds the admin unit's operations to the transport of `mountaya`.
3499
+ *
3500
+ * @param mountaya The client whose transport the operations call through: a `Mountaya` of
3501
+ * `@mountaya/client` or of `@mountaya/client/browser`.
3502
+ */
3503
+ constructor(mountaya) {
3504
+ const operations = adminOperationsOf(mountaya.transport);
3505
+ this.billing = operations.billing;
3506
+ this.invitations = operations.invitations;
3507
+ this.keys = operations.keys;
3508
+ this.members = operations.members;
3509
+ this.organizations = operations.organizations;
3510
+ this.sessions = operations.sessions;
3511
+ this.users = operations.users;
3512
+ this.webhooks = operations.webhooks;
3513
+ }
3514
+ };
3515
+
3516
+ exports.MountayaAdmin = MountayaAdmin;
3517
+ exports.MountayaWebhookSignatureError = MountayaWebhookSignatureError;
3518
+ exports.constructWebhookEvent = constructWebhookEvent;
3519
+ exports.rest = adminOperations_gen_exports;
3520
+ //# sourceMappingURL=index.cjs.map
3521
+ //# sourceMappingURL=index.cjs.map