@gpt-platform/client 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1284,9 +1284,11 @@ function buildUserAgent(sdkVersion, appInfo) {
1284
1284
  return ua;
1285
1285
  }
1286
1286
 
1287
+ // src/version.ts
1288
+ var SDK_VERSION = "0.2.1";
1289
+ var DEFAULT_API_VERSION = "2026-02-25";
1290
+
1287
1291
  // src/base-client.ts
1288
- var DEFAULT_API_VERSION = "2025-12-03";
1289
- var SDK_VERSION = "0.1.4";
1290
1292
  function generateUUID() {
1291
1293
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
1292
1294
  return crypto.randomUUID();
@@ -1392,7 +1394,9 @@ var BaseClient = class {
1392
1394
  "Accept",
1393
1395
  `application/vnd.api+json; version=${this.apiVersion}`
1394
1396
  );
1395
- req.headers.set("Content-Type", "application/vnd.api+json");
1397
+ if (!req.headers.get("Content-Type")?.startsWith("multipart/")) {
1398
+ req.headers.set("Content-Type", "application/vnd.api+json");
1399
+ }
1396
1400
  if (typeof process !== "undefined") {
1397
1401
  req.headers.set("User-Agent", userAgent);
1398
1402
  }
@@ -1598,6 +1602,11 @@ var postThreads = (options) => (options.client ?? client).post({
1598
1602
  ...options.headers
1599
1603
  }
1600
1604
  });
1605
+ var getVoiceSessionsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
1606
+ security: [{ scheme: "bearer", type: "http" }],
1607
+ url: "/voice/sessions/workspace/{workspace_id}",
1608
+ ...options
1609
+ });
1601
1610
  var patchExtractionDocumentsByIdCancel = (options) => (options.client ?? client).patch({
1602
1611
  security: [{ scheme: "bearer", type: "http" }],
1603
1612
  url: "/extraction/documents/{id}/cancel",
@@ -1617,6 +1626,11 @@ var getAgentVersionsById = (options) => (options.client ?? client).get({
1617
1626
  url: "/agent-versions/{id}",
1618
1627
  ...options
1619
1628
  });
1629
+ var getWatcherEventsById = (options) => (options.client ?? client).get({
1630
+ security: [{ scheme: "bearer", type: "http" }],
1631
+ url: "/watcher/events/{id}",
1632
+ ...options
1633
+ });
1620
1634
  var patchApiKeysByIdRevoke = (options) => (options.client ?? client).patch({
1621
1635
  security: [{ scheme: "bearer", type: "http" }],
1622
1636
  url: "/api-keys/{id}/revoke",
@@ -1682,11 +1696,30 @@ var patchExtractionDocumentsByIdDismiss = (options) => (options.client ?? client
1682
1696
  ...options.headers
1683
1697
  }
1684
1698
  });
1699
+ var postUsersAuthResetPasswordRequest = (options) => (options.client ?? client).post({
1700
+ security: [{ scheme: "bearer", type: "http" }],
1701
+ url: "/users/auth/reset-password/request",
1702
+ ...options,
1703
+ headers: {
1704
+ "Content-Type": "application/vnd.api+json",
1705
+ ...options.headers
1706
+ }
1707
+ });
1685
1708
  var getSearchIndexes = (options) => (options.client ?? client).get({
1686
1709
  security: [{ scheme: "bearer", type: "http" }],
1687
1710
  url: "/search/indexes",
1688
1711
  ...options
1689
1712
  });
1713
+ var deleteTrainingSessionsById = (options) => (options.client ?? client).delete({
1714
+ security: [{ scheme: "bearer", type: "http" }],
1715
+ url: "/training-sessions/{id}",
1716
+ ...options
1717
+ });
1718
+ var getTrainingSessionsById = (options) => (options.client ?? client).get({
1719
+ security: [{ scheme: "bearer", type: "http" }],
1720
+ url: "/training-sessions/{id}",
1721
+ ...options
1722
+ });
1690
1723
  var postAgentsByIdAnalyzeTraining = (options) => (options.client ?? client).post({
1691
1724
  security: [{ scheme: "bearer", type: "http" }],
1692
1725
  url: "/agents/{id}/analyze-training",
@@ -1701,9 +1734,9 @@ var postWebhookConfigsByIdTest = (options) => (options.client ?? client).post({
1701
1734
  ...options.headers
1702
1735
  }
1703
1736
  });
1704
- var postStorageSignDownload = (options) => (options.client ?? client).post({
1737
+ var patchUsersAuthPasswordChange = (options) => (options.client ?? client).patch({
1705
1738
  security: [{ scheme: "bearer", type: "http" }],
1706
- url: "/storage/sign-download",
1739
+ url: "/users/auth/password/change",
1707
1740
  ...options,
1708
1741
  headers: {
1709
1742
  "Content-Type": "application/vnd.api+json",
@@ -1793,6 +1826,20 @@ var postAgentsByIdPublishVersion = (options) => (options.client ?? client).post(
1793
1826
  ...options.headers
1794
1827
  }
1795
1828
  });
1829
+ var getVoiceSessionsMine = (options) => (options.client ?? client).get({
1830
+ security: [{ scheme: "bearer", type: "http" }],
1831
+ url: "/voice/sessions/mine",
1832
+ ...options
1833
+ });
1834
+ var postUsersAuthMagicLinkLogin = (options) => (options.client ?? client).post({
1835
+ security: [{ scheme: "bearer", type: "http" }],
1836
+ url: "/users/auth/magic-link/login",
1837
+ ...options,
1838
+ headers: {
1839
+ "Content-Type": "application/vnd.api+json",
1840
+ ...options.headers
1841
+ }
1842
+ });
1796
1843
  var deleteApiKeysById = (options) => (options.client ?? client).delete({
1797
1844
  security: [{ scheme: "bearer", type: "http" }],
1798
1845
  url: "/api-keys/{id}",
@@ -1812,6 +1859,15 @@ var patchApiKeysById = (options) => (options.client ?? client).patch({
1812
1859
  ...options.headers
1813
1860
  }
1814
1861
  });
1862
+ var patchUsersAuthResetPassword = (options) => (options.client ?? client).patch({
1863
+ security: [{ scheme: "bearer", type: "http" }],
1864
+ url: "/users/auth/reset-password",
1865
+ ...options,
1866
+ headers: {
1867
+ "Content-Type": "application/vnd.api+json",
1868
+ ...options.headers
1869
+ }
1870
+ });
1815
1871
  var getSchedulingCalendarSyncsById = (options) => (options.client ?? client).get({
1816
1872
  security: [{ scheme: "bearer", type: "http" }],
1817
1873
  url: "/scheduling/calendar-syncs/{id}",
@@ -2043,6 +2099,15 @@ var getWebhookDeliveriesById = (options) => (options.client ?? client).get({
2043
2099
  url: "/webhook-deliveries/{id}",
2044
2100
  ...options
2045
2101
  });
2102
+ var patchVoiceSessionsByIdStop = (options) => (options.client ?? client).patch({
2103
+ security: [{ scheme: "bearer", type: "http" }],
2104
+ url: "/voice/sessions/{id}/stop",
2105
+ ...options,
2106
+ headers: {
2107
+ "Content-Type": "application/vnd.api+json",
2108
+ ...options.headers
2109
+ }
2110
+ });
2046
2111
  var getSchedulingParticipants = (options) => (options.client ?? client).get({
2047
2112
  security: [{ scheme: "bearer", type: "http" }],
2048
2113
  url: "/scheduling/participants",
@@ -2071,11 +2136,35 @@ var patchExtractionDocumentsByIdFinishUpload = (options) => (options.client ?? c
2071
2136
  ...options.headers
2072
2137
  }
2073
2138
  });
2139
+ var getTrainingSessionsAgentsByAgentIdSessions = (options) => (options.client ?? client).get({
2140
+ security: [{ scheme: "bearer", type: "http" }],
2141
+ url: "/training-sessions/agents/{agent_id}/sessions",
2142
+ ...options
2143
+ });
2074
2144
  var getSearch = (options) => (options.client ?? client).get({
2075
2145
  security: [{ scheme: "bearer", type: "http" }],
2076
2146
  url: "/search",
2077
2147
  ...options
2078
2148
  });
2149
+ var getVoiceSessionsById = (options) => (options.client ?? client).get({
2150
+ security: [{ scheme: "bearer", type: "http" }],
2151
+ url: "/voice/sessions/{id}",
2152
+ ...options
2153
+ });
2154
+ var getVoiceSessions = (options) => (options.client ?? client).get({
2155
+ security: [{ scheme: "bearer", type: "http" }],
2156
+ url: "/voice/sessions",
2157
+ ...options
2158
+ });
2159
+ var postVoiceSessions = (options) => (options.client ?? client).post({
2160
+ security: [{ scheme: "bearer", type: "http" }],
2161
+ url: "/voice/sessions",
2162
+ ...options,
2163
+ headers: {
2164
+ "Content-Type": "application/vnd.api+json",
2165
+ ...options.headers
2166
+ }
2167
+ });
2079
2168
  var postInvitations = (options) => (options.client ?? client).post({
2080
2169
  security: [{ scheme: "bearer", type: "http" }],
2081
2170
  url: "/invitations",
@@ -2183,6 +2272,20 @@ var patchNotificationPreferencesById = (options) => (options.client ?? client).p
2183
2272
  ...options.headers
2184
2273
  }
2185
2274
  });
2275
+ var getWatcherClaims = (options) => (options.client ?? client).get({
2276
+ security: [{ scheme: "bearer", type: "http" }],
2277
+ url: "/watcher/claims",
2278
+ ...options
2279
+ });
2280
+ var postWatcherClaims = (options) => (options.client ?? client).post({
2281
+ security: [{ scheme: "bearer", type: "http" }],
2282
+ url: "/watcher/claims",
2283
+ ...options,
2284
+ headers: {
2285
+ "Content-Type": "application/vnd.api+json",
2286
+ ...options.headers
2287
+ }
2288
+ });
2186
2289
  var patchSchedulingBookingsSchedulingBookingsByIdReschedule = (options) => (options.client ?? client).patch({
2187
2290
  security: [{ scheme: "bearer", type: "http" }],
2188
2291
  url: "/scheduling/bookings/scheduling/bookings/{id}/reschedule",
@@ -2192,6 +2295,15 @@ var patchSchedulingBookingsSchedulingBookingsByIdReschedule = (options) => (opti
2192
2295
  ...options.headers
2193
2296
  }
2194
2297
  });
2298
+ var patchVoiceSessionsByIdFinalize = (options) => (options.client ?? client).patch({
2299
+ security: [{ scheme: "bearer", type: "http" }],
2300
+ url: "/voice/sessions/{id}/finalize",
2301
+ ...options,
2302
+ headers: {
2303
+ "Content-Type": "application/vnd.api+json",
2304
+ ...options.headers
2305
+ }
2306
+ });
2195
2307
  var postThreadsByIdExport = (options) => (options.client ?? client).post({
2196
2308
  security: [{ scheme: "bearer", type: "http" }],
2197
2309
  url: "/threads/{id}/export",
@@ -2479,15 +2591,6 @@ var patchThreadsByIdUnarchive = (options) => (options.client ?? client).patch({
2479
2591
  ...options.headers
2480
2592
  }
2481
2593
  });
2482
- var postStorageSignUpload = (options) => (options.client ?? client).post({
2483
- security: [{ scheme: "bearer", type: "http" }],
2484
- url: "/storage/sign-upload",
2485
- ...options,
2486
- headers: {
2487
- "Content-Type": "application/vnd.api+json",
2488
- ...options.headers
2489
- }
2490
- });
2491
2594
  var getAiConversations = (options) => (options.client ?? client).get({
2492
2595
  security: [{ scheme: "bearer", type: "http" }],
2493
2596
  url: "/ai/conversations",
@@ -2594,6 +2697,20 @@ var postWebhookDeliveriesBulkRetry = (options) => (options.client ?? client).pos
2594
2697
  ...options.headers
2595
2698
  }
2596
2699
  });
2700
+ var getWatcherClaimsById = (options) => (options.client ?? client).get({
2701
+ security: [{ scheme: "bearer", type: "http" }],
2702
+ url: "/watcher/claims/{id}",
2703
+ ...options
2704
+ });
2705
+ var patchWatcherClaimsById = (options) => (options.client ?? client).patch({
2706
+ security: [{ scheme: "bearer", type: "http" }],
2707
+ url: "/watcher/claims/{id}",
2708
+ ...options,
2709
+ headers: {
2710
+ "Content-Type": "application/vnd.api+json",
2711
+ ...options.headers
2712
+ }
2713
+ });
2597
2714
  var postUsersAuthLogin = (options) => (options.client ?? client).post({
2598
2715
  security: [{ scheme: "bearer", type: "http" }],
2599
2716
  url: "/users/auth/login",
@@ -2663,6 +2780,15 @@ var patchExtractionResultsByIdRegenerate = (options) => (options.client ?? clien
2663
2780
  ...options.headers
2664
2781
  }
2665
2782
  });
2783
+ var postUsersAuthConfirm = (options) => (options.client ?? client).post({
2784
+ security: [{ scheme: "bearer", type: "http" }],
2785
+ url: "/users/auth/confirm",
2786
+ ...options,
2787
+ headers: {
2788
+ "Content-Type": "application/vnd.api+json",
2789
+ ...options.headers
2790
+ }
2791
+ });
2666
2792
  var getSchedulingEventsById = (options) => (options.client ?? client).get({
2667
2793
  security: [{ scheme: "bearer", type: "http" }],
2668
2794
  url: "/scheduling/events/{id}",
@@ -2677,6 +2803,20 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
2677
2803
  ...options.headers
2678
2804
  }
2679
2805
  });
2806
+ var getWorkspaceMemberships = (options) => (options.client ?? client).get({
2807
+ security: [{ scheme: "bearer", type: "http" }],
2808
+ url: "/workspace-memberships",
2809
+ ...options
2810
+ });
2811
+ var postWorkspaceMemberships = (options) => (options.client ?? client).post({
2812
+ security: [{ scheme: "bearer", type: "http" }],
2813
+ url: "/workspace-memberships",
2814
+ ...options,
2815
+ headers: {
2816
+ "Content-Type": "application/vnd.api+json",
2817
+ ...options.headers
2818
+ }
2819
+ });
2680
2820
  var getTenantsByTenantIdDocumentStats = (options) => (options.client ?? client).get({
2681
2821
  security: [{ scheme: "bearer", type: "http" }],
2682
2822
  url: "/tenants/{tenant_id}/document_stats",
@@ -2767,6 +2907,15 @@ var patchApplicationsByIdAllocateCredits = (options) => (options.client ?? clien
2767
2907
  ...options.headers
2768
2908
  }
2769
2909
  });
2910
+ var postUsersAuthMagicLinkRequest = (options) => (options.client ?? client).post({
2911
+ security: [{ scheme: "bearer", type: "http" }],
2912
+ url: "/users/auth/magic-link/request",
2913
+ ...options,
2914
+ headers: {
2915
+ "Content-Type": "application/vnd.api+json",
2916
+ ...options.headers
2917
+ }
2918
+ });
2770
2919
  var getExtractionResultsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2771
2920
  security: [{ scheme: "bearer", type: "http" }],
2772
2921
  url: "/extraction/results/workspace/{workspace_id}",
@@ -2870,6 +3019,20 @@ var postAiMessages = (options) => (options.client ?? client).post({
2870
3019
  ...options.headers
2871
3020
  }
2872
3021
  });
3022
+ var getWatcherEvents = (options) => (options.client ?? client).get({
3023
+ security: [{ scheme: "bearer", type: "http" }],
3024
+ url: "/watcher/events",
3025
+ ...options
3026
+ });
3027
+ var postWatcherEvents = (options) => (options.client ?? client).post({
3028
+ security: [{ scheme: "bearer", type: "http" }],
3029
+ url: "/watcher/events",
3030
+ ...options,
3031
+ headers: {
3032
+ "Content-Type": "application/vnd.api+json",
3033
+ ...options.headers
3034
+ }
3035
+ });
2873
3036
  var postAgentVersionsByIdSetSystemFields = (options) => (options.client ?? client).post({
2874
3037
  security: [{ scheme: "bearer", type: "http" }],
2875
3038
  url: "/agent-versions/{id}/set-system-fields",
@@ -2997,6 +3160,29 @@ var postWorkspacesByWorkspaceIdExtractionExports = (options) => (options.client
2997
3160
  ...options.headers
2998
3161
  }
2999
3162
  });
3163
+ var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
3164
+ security: [{ scheme: "bearer", type: "http" }],
3165
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
3166
+ ...options
3167
+ });
3168
+ var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
3169
+ security: [{ scheme: "bearer", type: "http" }],
3170
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
3171
+ ...options,
3172
+ headers: {
3173
+ "Content-Type": "application/vnd.api+json",
3174
+ ...options.headers
3175
+ }
3176
+ });
3177
+ var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
3178
+ security: [{ scheme: "bearer", type: "http" }],
3179
+ url: "/training-examples/bulk-delete",
3180
+ ...options,
3181
+ headers: {
3182
+ "Content-Type": "application/vnd.api+json",
3183
+ ...options.headers
3184
+ }
3185
+ });
3000
3186
  var getCreditPackages = (options) => (options.client ?? client).get({
3001
3187
  security: [{ scheme: "bearer", type: "http" }],
3002
3188
  url: "/credit-packages",
@@ -3007,11 +3193,6 @@ var getUsers = (options) => (options.client ?? client).get({
3007
3193
  url: "/users",
3008
3194
  ...options
3009
3195
  });
3010
- var getObjects = (options) => (options.client ?? client).get({
3011
- security: [{ scheme: "bearer", type: "http" }],
3012
- url: "/objects",
3013
- ...options
3014
- });
3015
3196
 
3016
3197
  // src/pagination.ts
3017
3198
  var DEFAULT_MAX_PAGES = 500;
@@ -3957,6 +4138,35 @@ function createExtractionNamespace(rb) {
3957
4138
  },
3958
4139
  options
3959
4140
  );
4141
+ },
4142
+ /**
4143
+ * Query rows in an ExtractionResult server-side.
4144
+ *
4145
+ * Applies AttributeFilter predicates against the `rows` JSONB array
4146
+ * using a PostgreSQL lateral join. Suitable for datasets with 10K+ rows.
4147
+ * Empty `filters` array returns all rows (paginated by `limit`/`offset`).
4148
+ *
4149
+ * @example
4150
+ * const result = await client.extraction.results.query(resultId, {
4151
+ * filters: [
4152
+ * { field: 'wellness_score', op: 'gt', value: 75 },
4153
+ * { field: 'enrolled', op: 'eq', value: 'true' },
4154
+ * ],
4155
+ * limit: 100,
4156
+ * offset: 0,
4157
+ * });
4158
+ * console.log(`${result.filtered} of ${result.total} rows match`);
4159
+ */
4160
+ query: async (resultId, params, options) => {
4161
+ return rb.rawPost(
4162
+ `/extraction/results/${resultId}/query`,
4163
+ {
4164
+ filters: params.filters,
4165
+ limit: params.limit,
4166
+ offset: params.offset
4167
+ },
4168
+ options
4169
+ );
3960
4170
  }
3961
4171
  },
3962
4172
  batches: {
@@ -4108,7 +4318,36 @@ var ApiKeyAllocateSchema = import_zod2.z.object({
4108
4318
  amount: import_zod2.z.number().positive(),
4109
4319
  description: import_zod2.z.string().min(1)
4110
4320
  });
4111
- function createIdentityNamespace(rb) {
4321
+ var MagicLinkRequestSchema = import_zod2.z.object({
4322
+ email: import_zod2.z.string().email()
4323
+ });
4324
+ var RequestPasswordResetSchema = import_zod2.z.object({
4325
+ email: import_zod2.z.string().email()
4326
+ });
4327
+ var MagicLinkLoginSchema = import_zod2.z.object({
4328
+ token: import_zod2.z.string().min(1)
4329
+ });
4330
+ var ConfirmEmailSchema = import_zod2.z.object({
4331
+ email: import_zod2.z.string().email(),
4332
+ confirmation_token: import_zod2.z.string().min(1)
4333
+ });
4334
+ var ResetPasswordWithTokenSchema = import_zod2.z.object({
4335
+ token: import_zod2.z.string().min(1),
4336
+ password: import_zod2.z.string().min(8),
4337
+ password_confirmation: import_zod2.z.string().min(8)
4338
+ }).refine((data) => data.password === data.password_confirmation, {
4339
+ message: "Passwords do not match",
4340
+ path: ["password_confirmation"]
4341
+ });
4342
+ var ChangePasswordSchema = import_zod2.z.object({
4343
+ current_password: import_zod2.z.string().min(1),
4344
+ password: import_zod2.z.string().min(8),
4345
+ password_confirmation: import_zod2.z.string().min(8)
4346
+ }).refine((data) => data.password === data.password_confirmation, {
4347
+ message: "Passwords do not match",
4348
+ path: ["password_confirmation"]
4349
+ });
4350
+ function createIdentityNamespace(rb, baseUrl) {
4112
4351
  return {
4113
4352
  /** Login with email and password — returns a token object */
4114
4353
  login: async (email, password, options) => {
@@ -4187,6 +4426,117 @@ function createIdentityNamespace(rb) {
4187
4426
  resendConfirmation: async (options) => {
4188
4427
  return rb.execute(postUsersAuthResendConfirmation, {}, options);
4189
4428
  },
4429
+ /** Confirm an email address using the token from the confirmation email */
4430
+ confirmEmail: async (email, confirmationToken, options) => {
4431
+ ConfirmEmailSchema.parse({
4432
+ email,
4433
+ confirmation_token: confirmationToken
4434
+ });
4435
+ return rb.execute(
4436
+ postUsersAuthConfirm,
4437
+ {
4438
+ body: {
4439
+ data: {
4440
+ type: "user",
4441
+ attributes: { email, confirmation_token: confirmationToken }
4442
+ }
4443
+ }
4444
+ },
4445
+ options
4446
+ );
4447
+ },
4448
+ /** Request a magic link sign-in email */
4449
+ requestMagicLink: async (email, options) => {
4450
+ MagicLinkRequestSchema.parse({ email });
4451
+ return rb.execute(
4452
+ postUsersAuthMagicLinkRequest,
4453
+ {
4454
+ body: {
4455
+ data: { type: "user", attributes: { email } }
4456
+ }
4457
+ },
4458
+ options
4459
+ );
4460
+ },
4461
+ /**
4462
+ * Request a password reset email — always returns success to prevent email enumeration.
4463
+ * The user will receive an email with a reset token if the account exists.
4464
+ */
4465
+ requestPasswordReset: async (email, options) => {
4466
+ RequestPasswordResetSchema.parse({ email });
4467
+ return rb.execute(
4468
+ postUsersAuthResetPasswordRequest,
4469
+ {
4470
+ body: {
4471
+ data: { type: "user", attributes: { email } }
4472
+ }
4473
+ },
4474
+ options
4475
+ );
4476
+ },
4477
+ /** Sign in using a token from a magic link email */
4478
+ signInWithMagicLink: async (token, options) => {
4479
+ MagicLinkLoginSchema.parse({ token });
4480
+ return rb.execute(
4481
+ postUsersAuthMagicLinkLogin,
4482
+ {
4483
+ body: {
4484
+ data: { type: "user", attributes: { token } }
4485
+ }
4486
+ },
4487
+ options
4488
+ );
4489
+ },
4490
+ /** Reset a password using the token from a password reset email */
4491
+ resetPasswordWithToken: async (token, password, passwordConfirmation, options) => {
4492
+ ResetPasswordWithTokenSchema.parse({
4493
+ token,
4494
+ password,
4495
+ password_confirmation: passwordConfirmation
4496
+ });
4497
+ return rb.execute(
4498
+ patchUsersAuthResetPassword,
4499
+ {
4500
+ body: {
4501
+ data: {
4502
+ id: "",
4503
+ type: "user",
4504
+ attributes: {
4505
+ token,
4506
+ password,
4507
+ password_confirmation: passwordConfirmation
4508
+ }
4509
+ }
4510
+ }
4511
+ },
4512
+ options
4513
+ );
4514
+ },
4515
+ /** Change password for the currently authenticated user */
4516
+ changePassword: async (currentPassword, password, passwordConfirmation, options) => {
4517
+ ChangePasswordSchema.parse({
4518
+ current_password: currentPassword,
4519
+ password,
4520
+ password_confirmation: passwordConfirmation
4521
+ });
4522
+ return rb.execute(
4523
+ patchUsersAuthPasswordChange,
4524
+ {
4525
+ body: {
4526
+ data: {
4527
+ id: "",
4528
+ type: "user",
4529
+ attributes: {
4530
+ current_password: currentPassword,
4531
+ password,
4532
+ password_confirmation: passwordConfirmation
4533
+ }
4534
+ }
4535
+ }
4536
+ },
4537
+ options
4538
+ );
4539
+ },
4190
4540
  delete: async (id, options) => {
4191
4541
  return rb.executeDelete(deleteUsersById, { path: { id } }, options);
4192
4542
  },
@@ -4250,12 +4600,64 @@ function createIdentityNamespace(rb) {
4250
4600
  );
4251
4601
  }
4252
4602
  },
4253
- apiKeys: {
4254
- list: async (options) => {
4255
- return rb.execute(
4256
- getApiKeys,
4257
- buildPageQuery(options?.page, options?.pageSize),
4258
- options
4603
+ /**
4604
+ * Social OAuth sign-in (Google, GitHub, Microsoft).
4605
+ *
4606
+ * This is a browser-redirect flow — the backend redirects the user's browser
4607
+ * to the provider, then back to your `redirectUrl` with `?token=JWT` appended.
4608
+ *
4609
+ * @example
4610
+ * ```typescript
4611
+ * // Get the URL and redirect manually
4612
+ * const url = client.identity.oauth.getAuthorizationUrl('google', {
4613
+ * appId: 'your-app-id',
4614
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4615
+ * });
4616
+ * window.location.href = url;
4617
+ *
4618
+ * // Or use the convenience helper (browser only)
4619
+ * client.identity.oauth.signIn('google', {
4620
+ * appId: 'your-app-id',
4621
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4622
+ * });
4623
+ *
4624
+ * // On your callback page, extract the token:
4625
+ * const token = new URLSearchParams(window.location.search).get('token');
4626
+ * ```
4627
+ */
4628
+ oauth: {
4629
+ /**
4630
+ * Build the authorization URL for the given OAuth provider.
4631
+ * Navigate the user's browser to this URL to begin the sign-in flow.
4632
+ */
4633
+ getAuthorizationUrl(provider, options) {
4634
+ const base = (baseUrl ?? "").replace(/\/$/, "");
4635
+ const params = { app_id: options.appId };
4636
+ if (options.redirectUrl) params["redirect_url"] = options.redirectUrl;
4637
+ return `${base}/oauth/${provider}?${new URLSearchParams(params).toString()}`;
4638
+ },
4639
+ /**
4640
+ * Redirect the browser to the OAuth sign-in page for the given provider.
4641
+ * Only works in browser environments (sets `window.location.href`).
4642
+ *
4643
+ * After the user authenticates, they are redirected back to `redirectUrl`
4644
+ * with a `?token=JWT` query parameter containing their session token.
4645
+ */
4646
+ signIn(provider, options) {
4647
+ if (typeof window === "undefined") {
4648
+ throw new Error(
4649
+ "identity.oauth.signIn() requires a browser environment. Use identity.oauth.getAuthorizationUrl() to get the URL and redirect manually."
4650
+ );
4651
+ }
4652
+ window.location.href = this.getAuthorizationUrl(provider, options);
4653
+ }
4654
+ },
4655
+ apiKeys: {
4656
+ list: async (options) => {
4657
+ return rb.execute(
4658
+ getApiKeys,
4659
+ buildPageQuery(options?.page, options?.pageSize),
4660
+ options
4259
4661
  );
4260
4662
  },
4261
4663
  listAll: async (options) => {
@@ -4546,15 +4948,402 @@ function createPlatformNamespace(rb) {
4546
4948
  },
4547
4949
  listMe: async (options) => {
4548
4950
  return rb.execute(
4549
- getInvitationsMe,
4951
+ getInvitationsMe,
4952
+ buildPageQuery(options?.page, options?.pageSize),
4953
+ options
4954
+ );
4955
+ },
4956
+ listAllMe: async (options) => {
4957
+ return paginateToArray(
4958
+ rb.createPaginatedFetcher(
4959
+ getInvitationsMe,
4960
+ (page, pageSize) => ({
4961
+ query: { page: { number: page, size: pageSize } }
4962
+ }),
4963
+ options
4964
+ )
4965
+ );
4966
+ },
4967
+ create: async (attributes, options) => {
4968
+ return rb.execute(
4969
+ postInvitations,
4970
+ { body: { data: { type: "invitation", attributes } } },
4971
+ options
4972
+ );
4973
+ },
4974
+ update: async (id, attributes, options) => {
4975
+ return rb.execute(
4976
+ patchInvitationsByIdDecline,
4977
+ {
4978
+ path: { id },
4979
+ body: { data: { id, type: "invitation", attributes } }
4980
+ },
4981
+ options
4982
+ );
4983
+ }
4984
+ },
4985
+ workspaceMembers: {
4986
+ /** List members of a workspace */
4987
+ list: async (workspaceId, options) => {
4988
+ return rb.execute(
4989
+ getWorkspaceMemberships,
4990
+ {
4991
+ query: {
4992
+ filter: { workspace_id: workspaceId },
4993
+ ...buildPageQuery(options?.page, options?.pageSize)?.query
4994
+ }
4995
+ },
4996
+ options
4997
+ );
4998
+ },
4999
+ /** Get a specific workspace member by workspace and user ID */
5000
+ get: async (workspaceId, memberId, options) => {
5001
+ return rb.rawGet(
5002
+ `/workspace-memberships/${workspaceId}/${memberId}`,
5003
+ options
5004
+ );
5005
+ },
5006
+ /** Add a user to a workspace */
5007
+ create: async (workspaceId, attrs, options) => {
5008
+ return rb.execute(
5009
+ postWorkspaceMemberships,
5010
+ {
5011
+ body: {
5012
+ data: {
5013
+ type: "workspace-membership",
5014
+ attributes: { workspace_id: workspaceId, ...attrs }
5015
+ }
5016
+ }
5017
+ },
5018
+ options
5019
+ );
5020
+ },
5021
+ /** Update workspace member permissions or role */
5022
+ update: async (workspaceId, memberId, attrs, options) => {
5023
+ return rb.execute(
5024
+ patchWorkspaceMembershipsByWorkspaceIdByUserId,
5025
+ {
5026
+ path: { workspace_id: workspaceId, user_id: memberId },
5027
+ body: {
5028
+ data: {
5029
+ id: memberId,
5030
+ type: "workspace-membership",
5031
+ attributes: attrs
5032
+ }
5033
+ }
5034
+ },
5035
+ options
5036
+ );
5037
+ },
5038
+ /** Update workspace member profile attributes (G9) */
5039
+ updateProfile: async (workspaceId, memberId, profileAttrs, options) => {
5040
+ return rb.rawPost(
5041
+ `/workspace-memberships/${workspaceId}/${memberId}/profile`,
5042
+ { data: { attributes: { profile_attributes: profileAttrs } } },
5043
+ options
5044
+ );
5045
+ },
5046
+ /** Remove a user from a workspace */
5047
+ remove: async (workspaceId, memberId, options) => {
5048
+ return rb.executeDelete(
5049
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId,
5050
+ { path: { workspace_id: workspaceId, user_id: memberId } },
5051
+ options
5052
+ );
5053
+ }
5054
+ }
5055
+ };
5056
+ }
5057
+
5058
+ // src/namespaces/scheduling.ts
5059
+ function createSchedulingNamespace(rb) {
5060
+ return {
5061
+ /**
5062
+ * Event Types — templates for bookable events
5063
+ */
5064
+ eventTypes: {
5065
+ /** List event types with optional pagination */
5066
+ list: async (options) => {
5067
+ return rb.execute(
5068
+ getSchedulingEventTypes,
5069
+ buildPageQuery(options?.page, options?.pageSize),
5070
+ options
5071
+ );
5072
+ },
5073
+ /** List all event types with automatic pagination */
5074
+ listAll: async (options) => {
5075
+ return paginateToArray(
5076
+ rb.createPaginatedFetcher(
5077
+ getSchedulingEventTypes,
5078
+ (page, pageSize) => ({
5079
+ query: { page: { number: page, size: pageSize } }
5080
+ }),
5081
+ options
5082
+ )
5083
+ );
5084
+ },
5085
+ /** Get an event type by ID */
5086
+ get: async (id, options) => {
5087
+ return rb.execute(
5088
+ getSchedulingEventTypesById,
5089
+ { path: { id } },
5090
+ options
5091
+ );
5092
+ },
5093
+ /**
5094
+ * Create a new event type.
5095
+ * @example
5096
+ * ```typescript
5097
+ * const client = new GptClient({ apiKey: 'sk_tenant_...' });
5098
+ * const eventType = await client.scheduling.eventTypes.create({
5099
+ * name: '30-Minute Consultation',
5100
+ * slug: '30min-consult',
5101
+ * duration_minutes: 30,
5102
+ * location_type: 'video',
5103
+ * });
5104
+ * ```
5105
+ */
5106
+ create: async (attributes, options) => {
5107
+ return rb.execute(
5108
+ postSchedulingEventTypes,
5109
+ {
5110
+ body: { data: { type: "scheduling_event_type", attributes } }
5111
+ },
5112
+ options
5113
+ );
5114
+ },
5115
+ /** Update an event type */
5116
+ update: async (id, attributes, options) => {
5117
+ return rb.execute(
5118
+ patchSchedulingEventTypesById,
5119
+ {
5120
+ path: { id },
5121
+ body: { data: { id, type: "scheduling_event_type", attributes } }
5122
+ },
5123
+ options
5124
+ );
5125
+ }
5126
+ },
5127
+ /**
5128
+ * Events — scheduled occurrences
5129
+ */
5130
+ events: {
5131
+ /** List events with optional pagination */
5132
+ list: async (options) => {
5133
+ return rb.execute(
5134
+ getSchedulingEvents,
5135
+ buildPageQuery(options?.page, options?.pageSize),
5136
+ options
5137
+ );
5138
+ },
5139
+ /** List all events with automatic pagination */
5140
+ listAll: async (options) => {
5141
+ return paginateToArray(
5142
+ rb.createPaginatedFetcher(
5143
+ getSchedulingEvents,
5144
+ (page, pageSize) => ({
5145
+ query: { page: { number: page, size: pageSize } }
5146
+ }),
5147
+ options
5148
+ )
5149
+ );
5150
+ },
5151
+ /** Get an event by ID */
5152
+ get: async (id, options) => {
5153
+ return rb.execute(
5154
+ getSchedulingEventsById,
5155
+ { path: { id } },
5156
+ options
5157
+ );
5158
+ },
5159
+ /**
5160
+ * Create an internal event directly.
5161
+ * Use for meetings between known users in the workspace.
5162
+ */
5163
+ create: async (attributes, options) => {
5164
+ return rb.execute(
5165
+ postSchedulingEvents,
5166
+ {
5167
+ body: { data: { type: "scheduling_event", attributes } }
5168
+ },
5169
+ options
5170
+ );
5171
+ },
5172
+ /** Update an event */
5173
+ update: async (id, attributes, options) => {
5174
+ return rb.execute(
5175
+ patchSchedulingEventsById,
5176
+ {
5177
+ path: { id },
5178
+ body: { data: { id, type: "scheduling_event", attributes } }
5179
+ },
5180
+ options
5181
+ );
5182
+ }
5183
+ },
5184
+ /**
5185
+ * Participants — people attending events
5186
+ */
5187
+ participants: {
5188
+ /** List participants with optional pagination */
5189
+ list: async (options) => {
5190
+ return rb.execute(
5191
+ getSchedulingParticipants,
5192
+ buildPageQuery(options?.page, options?.pageSize),
5193
+ options
5194
+ );
5195
+ },
5196
+ /** List all participants with automatic pagination */
5197
+ listAll: async (options) => {
5198
+ return paginateToArray(
5199
+ rb.createPaginatedFetcher(
5200
+ getSchedulingParticipants,
5201
+ (page, pageSize) => ({
5202
+ query: { page: { number: page, size: pageSize } }
5203
+ }),
5204
+ options
5205
+ )
5206
+ );
5207
+ },
5208
+ /** Get a participant by ID */
5209
+ get: async (id, options) => {
5210
+ return rb.execute(
5211
+ getSchedulingParticipantsById,
5212
+ { path: { id } },
5213
+ options
5214
+ );
5215
+ },
5216
+ /** Add a participant to an event */
5217
+ create: async (attributes, options) => {
5218
+ return rb.execute(
5219
+ postSchedulingParticipants,
5220
+ {
5221
+ body: { data: { type: "scheduling_participant", attributes } }
5222
+ },
5223
+ options
5224
+ );
5225
+ },
5226
+ /** Update a participant (e.g., confirm attendance, respond to invite) */
5227
+ update: async (id, attributes, options) => {
5228
+ return rb.execute(
5229
+ patchSchedulingParticipantsById,
5230
+ {
5231
+ path: { id },
5232
+ body: { data: { id, type: "scheduling_participant", attributes } }
5233
+ },
5234
+ options
5235
+ );
5236
+ }
5237
+ },
5238
+ /**
5239
+ * Bookings — external party requests for appointments
5240
+ */
5241
+ bookings: {
5242
+ /** List bookings with optional pagination */
5243
+ list: async (options) => {
5244
+ return rb.execute(
5245
+ getSchedulingBookings,
5246
+ buildPageQuery(options?.page, options?.pageSize),
5247
+ options
5248
+ );
5249
+ },
5250
+ /** List all bookings with automatic pagination */
5251
+ listAll: async (options) => {
5252
+ return paginateToArray(
5253
+ rb.createPaginatedFetcher(
5254
+ getSchedulingBookings,
5255
+ (page, pageSize) => ({
5256
+ query: { page: { number: page, size: pageSize } }
5257
+ }),
5258
+ options
5259
+ )
5260
+ );
5261
+ },
5262
+ /** Get a booking by ID */
5263
+ get: async (id, options) => {
5264
+ return rb.execute(
5265
+ getSchedulingBookingsById,
5266
+ { path: { id } },
5267
+ options
5268
+ );
5269
+ },
5270
+ /**
5271
+ * Create a booking request.
5272
+ * Use when someone outside the platform requests an appointment.
5273
+ * @example
5274
+ * ```typescript
5275
+ * const booking = await client.scheduling.bookings.create({
5276
+ * event_type_id: 'event_123',
5277
+ * start_time: '2025-03-01T10:00:00Z',
5278
+ * booker_name: 'John Doe',
5279
+ * booker_email: 'john@example.com',
5280
+ * });
5281
+ * ```
5282
+ */
5283
+ create: async (attributes, options) => {
5284
+ return rb.execute(
5285
+ postSchedulingBookings,
5286
+ {
5287
+ body: { data: { type: "scheduling_booking", attributes } }
5288
+ },
5289
+ options
5290
+ );
5291
+ },
5292
+ /**
5293
+ * Confirm a pending booking.
5294
+ * For EventTypes with requires_approval=true.
5295
+ */
5296
+ confirm: async (id, options) => {
5297
+ return rb.execute(
5298
+ patchSchedulingBookingsSchedulingBookingsByIdConfirm,
5299
+ { path: { id }, body: {} },
5300
+ options
5301
+ );
5302
+ },
5303
+ /**
5304
+ * Cancel or reject a booking.
5305
+ */
5306
+ cancel: async (id, attributes, options) => {
5307
+ return rb.execute(
5308
+ patchSchedulingBookingsSchedulingBookingsByIdCancel,
5309
+ {
5310
+ path: { id },
5311
+ body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5312
+ },
5313
+ options
5314
+ );
5315
+ },
5316
+ /**
5317
+ * Reschedule a booking to a new time.
5318
+ */
5319
+ reschedule: async (id, attributes, options) => {
5320
+ return rb.execute(
5321
+ patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5322
+ {
5323
+ path: { id },
5324
+ body: { data: { type: "scheduling_booking", attributes } }
5325
+ },
5326
+ options
5327
+ );
5328
+ }
5329
+ },
5330
+ /**
5331
+ * Calendar Syncs — external calendar integrations
5332
+ */
5333
+ calendarSyncs: {
5334
+ /** List calendar syncs with optional pagination */
5335
+ list: async (options) => {
5336
+ return rb.execute(
5337
+ getSchedulingCalendarSyncs,
4550
5338
  buildPageQuery(options?.page, options?.pageSize),
4551
5339
  options
4552
5340
  );
4553
5341
  },
4554
- listAllMe: async (options) => {
5342
+ /** List all calendar syncs with automatic pagination */
5343
+ listAll: async (options) => {
4555
5344
  return paginateToArray(
4556
5345
  rb.createPaginatedFetcher(
4557
- getInvitationsMe,
5346
+ getSchedulingCalendarSyncs,
4558
5347
  (page, pageSize) => ({
4559
5348
  query: { page: { number: page, size: pageSize } }
4560
5349
  }),
@@ -4562,22 +5351,63 @@ function createPlatformNamespace(rb) {
4562
5351
  )
4563
5352
  );
4564
5353
  },
5354
+ /** Get a calendar sync by ID */
5355
+ get: async (id, options) => {
5356
+ return rb.execute(
5357
+ getSchedulingCalendarSyncsById,
5358
+ { path: { id } },
5359
+ options
5360
+ );
5361
+ },
5362
+ /**
5363
+ * Create a calendar sync.
5364
+ * For bi-directional sync with external calendars (Google, Outlook).
5365
+ */
4565
5366
  create: async (attributes, options) => {
4566
5367
  return rb.execute(
4567
- postInvitations,
4568
- { body: { data: { type: "invitation", attributes } } },
5368
+ postSchedulingCalendarSyncs,
5369
+ {
5370
+ body: { data: { type: "scheduling_calendar_sync", attributes } }
5371
+ },
4569
5372
  options
4570
5373
  );
4571
5374
  },
5375
+ /** Update a calendar sync */
4572
5376
  update: async (id, attributes, options) => {
4573
5377
  return rb.execute(
4574
- patchInvitationsByIdDecline,
5378
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsById,
4575
5379
  {
4576
5380
  path: { id },
4577
- body: { data: { id, type: "invitation", attributes } }
5381
+ body: {
5382
+ data: { id, type: "scheduling_calendar_sync", attributes }
5383
+ }
4578
5384
  },
4579
5385
  options
4580
5386
  );
5387
+ },
5388
+ /** Delete a calendar sync */
5389
+ delete: async (id, options) => {
5390
+ return rb.executeDelete(
5391
+ deleteSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5392
+ { path: { id } },
5393
+ options
5394
+ );
5395
+ },
5396
+ /** Pause a calendar sync (stops pushing/pulling) */
5397
+ pause: async (id, options) => {
5398
+ return rb.execute(
5399
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5400
+ { path: { id }, body: {} },
5401
+ options
5402
+ );
5403
+ },
5404
+ /** Resume a paused calendar sync */
5405
+ resume: async (id, options) => {
5406
+ return rb.execute(
5407
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5408
+ { path: { id }, body: {} },
5409
+ options
5410
+ );
4581
5411
  }
4582
5412
  }
4583
5413
  };
@@ -4649,29 +5479,15 @@ function createStorageNamespace(rb) {
4649
5479
  /** Generate a presigned upload URL for direct-to-storage uploads */
4650
5480
  signUpload: async (attributes, options) => {
4651
5481
  return rb.execute(
4652
- postStorageSignUpload,
4653
- {
4654
- body: { data: { type: "signed_url", attributes: attributes ?? {} } }
4655
- },
4656
- options
4657
- );
4658
- },
4659
- /** Generate a presigned download URL for accessing stored objects */
4660
- signDownload: async (attributes, options) => {
4661
- return rb.execute(
4662
- postStorageSignDownload,
5482
+ postDocumentsPresignedUpload,
4663
5483
  {
4664
- body: { data: { type: "signed_url", attributes: attributes ?? {} } }
5484
+ body: {
5485
+ data: { type: "presigned_upload", attributes: attributes ?? {} }
5486
+ }
4665
5487
  },
4666
5488
  options
4667
5489
  );
4668
5490
  },
4669
- objects: {
4670
- /** List storage objects */
4671
- list: async (options) => {
4672
- return rb.execute(getObjects, {}, options);
4673
- }
4674
- },
4675
5491
  buckets: {
4676
5492
  list: async (options) => {
4677
5493
  return rb.execute(
@@ -4833,20 +5649,20 @@ function createThreadsNamespace(rb) {
4833
5649
  };
4834
5650
  }
4835
5651
 
4836
- // src/namespaces/webhooks-ns.ts
4837
- function createWebhooksNamespace(rb) {
5652
+ // src/namespaces/training.ts
5653
+ function createTrainingNamespace(rb) {
4838
5654
  return {
4839
- configs: {
5655
+ examples: {
4840
5656
  delete: async (id, options) => {
4841
5657
  return rb.executeDelete(
4842
- deleteWebhookConfigsById,
5658
+ deleteTrainingExamplesById,
4843
5659
  { path: { id } },
4844
5660
  options
4845
5661
  );
4846
5662
  },
4847
5663
  list: async (options) => {
4848
5664
  return rb.execute(
4849
- getWebhookConfigs,
5665
+ getTrainingExamples,
4850
5666
  buildPageQuery(options?.page, options?.pageSize),
4851
5667
  options
4852
5668
  );
@@ -4854,7 +5670,7 @@ function createWebhooksNamespace(rb) {
4854
5670
  listAll: async (options) => {
4855
5671
  return paginateToArray(
4856
5672
  rb.createPaginatedFetcher(
4857
- getWebhookConfigs,
5673
+ getTrainingExamples,
4858
5674
  (page, pageSize) => ({
4859
5675
  query: { page: { number: page, size: pageSize } }
4860
5676
  }),
@@ -4862,112 +5678,257 @@ function createWebhooksNamespace(rb) {
4862
5678
  )
4863
5679
  );
4864
5680
  },
5681
+ get: async (id, options) => {
5682
+ return rb.execute(
5683
+ getTrainingExamplesById,
5684
+ { path: { id } },
5685
+ options
5686
+ );
5687
+ },
4865
5688
  create: async (attributes, options) => {
4866
5689
  return rb.execute(
4867
- postWebhookConfigs,
4868
- { body: { data: { type: "webhook_config", attributes } } },
5690
+ postTrainingExamplesBulkDelete,
5691
+ { body: { data: { type: "training_example", attributes } } },
4869
5692
  options
4870
5693
  );
4871
5694
  },
4872
5695
  update: async (id, attributes, options) => {
4873
5696
  return rb.execute(
4874
- patchWebhookConfigsById,
5697
+ patchTrainingExamplesById,
4875
5698
  {
4876
5699
  path: { id },
4877
- body: { data: { id, type: "webhook_config", attributes } }
5700
+ body: { data: { id, type: "training_example", attributes } }
4878
5701
  },
4879
5702
  options
4880
5703
  );
4881
5704
  },
4882
- test: async (id, options) => {
5705
+ bulkCreate: async (options) => {
4883
5706
  return rb.execute(
4884
- postWebhookConfigsByIdTest,
4885
- { path: { id }, body: {} },
5707
+ postTrainingExamplesBulkDelete,
5708
+ {},
4886
5709
  options
4887
5710
  );
4888
5711
  },
4889
- bulkEnable: async (options) => {
5712
+ bulkDestroy: async (options) => {
4890
5713
  return rb.execute(
4891
- postWebhookConfigsBulkEnable,
5714
+ postTrainingExamplesBulkDelete,
4892
5715
  {},
4893
5716
  options
4894
5717
  );
4895
5718
  },
4896
- bulkDisable: async (options) => {
5719
+ searchByVector: async (options) => {
4897
5720
  return rb.execute(
4898
- postWebhookConfigsBulkDisable,
5721
+ postTrainingExamplesBulkDelete,
4899
5722
  {},
4900
5723
  options
4901
5724
  );
4902
- },
4903
- /** Replay historical events to this webhook */
4904
- replay: async (id, options) => {
5725
+ }
5726
+ },
5727
+ sessions: {
5728
+ listAgentsSessions: async (options) => {
4905
5729
  return rb.execute(
4906
- postWebhookConfigsByIdReplay,
4907
- { path: { id }, body: {} },
5730
+ getTrainingSessionsAgentsByAgentIdSessions,
5731
+ buildPageQuery(options?.page, options?.pageSize),
4908
5732
  options
4909
5733
  );
4910
5734
  },
5735
+ listAllAgentsSessions: async (options) => {
5736
+ return paginateToArray(
5737
+ rb.createPaginatedFetcher(
5738
+ getTrainingSessionsAgentsByAgentIdSessions,
5739
+ (page, pageSize) => ({
5740
+ query: { page: { number: page, size: pageSize } }
5741
+ }),
5742
+ options
5743
+ )
5744
+ );
5745
+ },
4911
5746
  get: async (id, options) => {
4912
5747
  return rb.execute(
4913
- getWebhookConfigsById,
5748
+ getTrainingSessionsById,
4914
5749
  { path: { id } },
4915
5750
  options
4916
5751
  );
4917
5752
  },
4918
- /** Rotate the signing secret for a webhook config */
4919
- rotateSecret: async (id, options) => {
5753
+ create: async (attributes, options) => {
4920
5754
  return rb.execute(
4921
- patchWebhookConfigsByIdRotateSecret,
4922
- { path: { id }, body: {} },
5755
+ getTrainingSessionsAgentsByAgentIdSessions,
5756
+ { body: { data: { type: "training_session", attributes } } },
5757
+ options
5758
+ );
5759
+ },
5760
+ delete: async (id, options) => {
5761
+ return rb.executeDelete(
5762
+ deleteTrainingSessionsById,
5763
+ { path: { id } },
5764
+ options
5765
+ );
5766
+ },
5767
+ update: async (agentId, attributes, options) => {
5768
+ return rb.execute(
5769
+ getTrainingSessionsAgentsByAgentIdSessions,
5770
+ {
5771
+ path: { agent_id: agentId },
5772
+ body: { data: { type: "training_session", attributes } }
5773
+ },
4923
5774
  options
4924
5775
  );
4925
5776
  }
5777
+ }
5778
+ };
5779
+ }
5780
+
5781
+ // src/namespaces/voice.ts
5782
+ function createVoiceNamespace(rb) {
5783
+ return {
5784
+ /**
5785
+ * Transcribe an audio file via the voice transcription endpoint.
5786
+ * Accepts File or Blob. Supported formats: mp3, ogg, wav, m4a, webm, flac, aac.
5787
+ *
5788
+ * @param audio - Audio file to transcribe (max 200 MB)
5789
+ * @param params - Optional transcription parameters
5790
+ * @param options - Request options (signal, headers, etc.)
5791
+ */
5792
+ transcribe: async (audio, params, options) => {
5793
+ const form = new FormData();
5794
+ form.append("audio", audio);
5795
+ if (params?.language) form.append("language", params.language);
5796
+ if (params?.modelSize) form.append("model_size", params.modelSize);
5797
+ if (params?.phiMode) form.append("phi_mode", params.phiMode);
5798
+ if (params?.phiKey) form.append("phi_key", params.phiKey);
5799
+ return rb.rawPostMultipart(
5800
+ "/voice/transcribe",
5801
+ form,
5802
+ options
5803
+ );
4926
5804
  },
4927
- deliveries: {
5805
+ /**
5806
+ * Sessions — voice session management
5807
+ */
5808
+ sessions: {
5809
+ /** List voice sessions with pagination */
4928
5810
  list: async (options) => {
4929
5811
  return rb.execute(
4930
- getWebhookDeliveries,
5812
+ getVoiceSessions,
4931
5813
  buildPageQuery(options?.page, options?.pageSize),
4932
5814
  options
4933
5815
  );
4934
5816
  },
4935
- listAll: async (options) => {
4936
- return paginateToArray(
4937
- rb.createPaginatedFetcher(
4938
- getWebhookDeliveries,
4939
- (page, pageSize) => ({
4940
- query: { page: { number: page, size: pageSize } }
4941
- }),
4942
- options
4943
- )
5817
+ /** Get a session by ID */
5818
+ get: async (id, options) => {
5819
+ return rb.execute(
5820
+ getVoiceSessionsById,
5821
+ { path: { id } },
5822
+ options
4944
5823
  );
4945
5824
  },
4946
- create: async (attributes, options) => {
5825
+ /** List my voice sessions */
5826
+ listMine: async (options) => {
4947
5827
  return rb.execute(
4948
- postWebhookDeliveriesBulkRetry,
4949
- { body: { data: { type: "webhook_delivery", attributes } } },
5828
+ getVoiceSessionsMine,
5829
+ buildPageQuery(options?.page, options?.pageSize),
4950
5830
  options
4951
5831
  );
4952
5832
  },
4953
- retry: async (options) => {
5833
+ /** List sessions by workspace */
5834
+ listByWorkspace: async (workspaceId, options) => {
4954
5835
  return rb.execute(
4955
- postWebhookDeliveriesBulkRetry,
4956
- {},
5836
+ getVoiceSessionsWorkspaceByWorkspaceId,
5837
+ {
5838
+ path: { workspace_id: workspaceId },
5839
+ ...buildPageQuery(options?.page, options?.pageSize)
5840
+ },
4957
5841
  options
4958
5842
  );
4959
5843
  },
4960
- bulkRetry: async (options) => {
5844
+ /**
5845
+ * Start a new voice session with LiveKit room provisioning.
5846
+ *
5847
+ * @param params - Session parameters
5848
+ * @param params.phiKey - AES-256 encryption key for PHI (Protected Health
5849
+ * Information), encoded as Base64 (32 raw bytes). Required when
5850
+ * `phiMode` is `"tokenize_encrypt"`.
5851
+ * @param options - Request options
5852
+ *
5853
+ * @remarks
5854
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5855
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5856
+ * - Do not log, store in `localStorage`, or include in error reports.
5857
+ * - Treat it with the same care as a password or private key.
5858
+ * - The server never persists this key; it is used only within the
5859
+ * lifetime of the request.
5860
+ */
5861
+ start: async (params, options) => {
4961
5862
  return rb.execute(
4962
- postWebhookDeliveriesBulkRetry,
4963
- {},
5863
+ postVoiceSessions,
5864
+ {
5865
+ body: {
5866
+ data: {
5867
+ type: "voice_session",
5868
+ attributes: {
5869
+ thread_id: params?.threadId,
5870
+ blueprint_id: params?.blueprintId,
5871
+ blueprint_mode: params?.blueprintMode,
5872
+ phi_mode: params?.phiMode,
5873
+ phi_key: params?.phiKey,
5874
+ patient_id: params?.patientId
5875
+ }
5876
+ }
5877
+ }
5878
+ },
4964
5879
  options
4965
5880
  );
4966
5881
  },
4967
- get: async (id, options) => {
5882
+ /** End a voice session and release the LiveKit room */
5883
+ stop: async (id, options) => {
4968
5884
  return rb.execute(
4969
- getWebhookDeliveriesById,
4970
- { path: { id } },
5885
+ patchVoiceSessionsByIdStop,
5886
+ { path: { id }, body: { data: { id, type: "voice_session" } } },
5887
+ options
5888
+ );
5889
+ },
5890
+ /**
5891
+ * Dispatch the accumulated session transcript to the blueprint or chat
5892
+ * pipeline. The transcript may contain PHI (Protected Health Information)
5893
+ * depending on the session's `phiMode`.
5894
+ *
5895
+ * @param id - Voice session ID
5896
+ * @param params - Finalization parameters
5897
+ * @param params.phiKey - AES-256 encryption key for PHI, encoded as
5898
+ * Base64 (32 raw bytes). Overrides the key supplied at session start.
5899
+ * Required when `phiMode` is `"tokenize_encrypt"`.
5900
+ * @param options - Request options
5901
+ *
5902
+ * @remarks
5903
+ * **Security — transcript PHI:** The finalized transcript submitted to
5904
+ * this endpoint may contain Protected Health Information. Ensure the
5905
+ * request is made over HTTPS only.
5906
+ *
5907
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5908
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5909
+ * - Do not log, store in `localStorage`, or include in error reports.
5910
+ * - Treat it with the same care as a password or private key.
5911
+ * - The server never persists this key; it is used only within the
5912
+ * lifetime of the request.
5913
+ */
5914
+ finalize: async (id, params, options) => {
5915
+ return rb.execute(
5916
+ patchVoiceSessionsByIdFinalize,
5917
+ {
5918
+ path: { id },
5919
+ body: {
5920
+ data: {
5921
+ id,
5922
+ type: "voice_session",
5923
+ attributes: {
5924
+ blueprint_id: params?.blueprintId,
5925
+ phi_mode: params?.phiMode,
5926
+ phi_key: params?.phiKey,
5927
+ patient_id: params?.patientId
5928
+ }
5929
+ }
5930
+ }
5931
+ },
4971
5932
  options
4972
5933
  );
4973
5934
  }
@@ -4975,26 +5936,21 @@ function createWebhooksNamespace(rb) {
4975
5936
  };
4976
5937
  }
4977
5938
 
4978
- // src/namespaces/scheduling.ts
4979
- function createSchedulingNamespace(rb) {
5939
+ // src/namespaces/watcher.ts
5940
+ function createWatcherNamespace(rb) {
4980
5941
  return {
4981
- /**
4982
- * Event Types — templates for bookable events
4983
- */
4984
- eventTypes: {
4985
- /** List event types with optional pagination */
5942
+ claims: {
4986
5943
  list: async (options) => {
4987
5944
  return rb.execute(
4988
- getSchedulingEventTypes,
5945
+ getWatcherClaims,
4989
5946
  buildPageQuery(options?.page, options?.pageSize),
4990
5947
  options
4991
5948
  );
4992
5949
  },
4993
- /** List all event types with automatic pagination */
4994
5950
  listAll: async (options) => {
4995
5951
  return paginateToArray(
4996
5952
  rb.createPaginatedFetcher(
4997
- getSchedulingEventTypes,
5953
+ getWatcherClaims,
4998
5954
  (page, pageSize) => ({
4999
5955
  query: { page: { number: page, size: pageSize } }
5000
5956
  }),
@@ -5002,65 +5958,68 @@ function createSchedulingNamespace(rb) {
5002
5958
  )
5003
5959
  );
5004
5960
  },
5005
- /** Get an event type by ID */
5006
- get: async (id, options) => {
5007
- return rb.execute(
5008
- getSchedulingEventTypesById,
5009
- { path: { id } },
5010
- options
5011
- );
5961
+ claim: async (options) => {
5962
+ return rb.execute(postWatcherClaims, {}, options);
5012
5963
  },
5013
- /**
5014
- * Create a new event type.
5015
- * @example
5016
- * ```typescript
5017
- * const client = new GptClient({ apiKey: 'sk_tenant_...' });
5018
- * const eventType = await client.scheduling.eventTypes.create({
5019
- * name: '30-Minute Consultation',
5020
- * slug: '30min-consult',
5021
- * duration_minutes: 30,
5022
- * location_type: 'video',
5023
- * });
5024
- * ```
5025
- */
5026
5964
  create: async (attributes, options) => {
5027
5965
  return rb.execute(
5028
- postSchedulingEventTypes,
5029
- {
5030
- body: { data: { type: "scheduling_event_type", attributes } }
5031
- },
5966
+ postWatcherClaims,
5967
+ { body: { data: { type: "watcher_claim", attributes } } },
5032
5968
  options
5033
5969
  );
5034
5970
  },
5035
- /** Update an event type */
5036
5971
  update: async (id, attributes, options) => {
5037
5972
  return rb.execute(
5038
- patchSchedulingEventTypesById,
5973
+ patchWatcherClaimsById,
5039
5974
  {
5040
5975
  path: { id },
5041
- body: { data: { id, type: "scheduling_event_type", attributes } }
5976
+ body: { data: { id, type: "watcher_claim", attributes } }
5042
5977
  },
5043
5978
  options
5044
5979
  );
5980
+ },
5981
+ delete: async (id, options) => {
5982
+ return rb.executeDelete(
5983
+ getWatcherClaimsById,
5984
+ { path: { id } },
5985
+ options
5986
+ );
5987
+ },
5988
+ /** Register a completed claim for a document (used by ProcessDocument worker) */
5989
+ registerCompleted: async (options) => {
5990
+ return rb.execute(postWatcherClaims, {}, options);
5991
+ },
5992
+ /** Get ingestion status for a workspace */
5993
+ readStatus: async (options) => {
5994
+ return rb.execute(postWatcherClaims, {}, options);
5995
+ },
5996
+ get: async (id, options) => {
5997
+ return rb.execute(
5998
+ getWatcherClaimsById,
5999
+ { path: { id } },
6000
+ options
6001
+ );
5045
6002
  }
5046
6003
  },
5047
- /**
5048
- * Events — scheduled occurrences
5049
- */
5050
6004
  events: {
5051
- /** List events with optional pagination */
6005
+ create: async (attributes, options) => {
6006
+ return rb.execute(
6007
+ postWatcherEvents,
6008
+ { body: { data: { type: "watcher_event", attributes } } },
6009
+ options
6010
+ );
6011
+ },
5052
6012
  list: async (options) => {
5053
6013
  return rb.execute(
5054
- getSchedulingEvents,
6014
+ getWatcherEvents,
5055
6015
  buildPageQuery(options?.page, options?.pageSize),
5056
6016
  options
5057
6017
  );
5058
6018
  },
5059
- /** List all events with automatic pagination */
5060
6019
  listAll: async (options) => {
5061
6020
  return paginateToArray(
5062
6021
  rb.createPaginatedFetcher(
5063
- getSchedulingEvents,
6022
+ getWatcherEvents,
5064
6023
  (page, pageSize) => ({
5065
6024
  query: { page: { number: page, size: pageSize } }
5066
6025
  }),
@@ -5068,56 +6027,46 @@ function createSchedulingNamespace(rb) {
5068
6027
  )
5069
6028
  );
5070
6029
  },
5071
- /** Get an event by ID */
6030
+ delete: async (options) => {
6031
+ return rb.executeDelete(getWatcherEvents, { path: {} }, options);
6032
+ },
6033
+ /** Create multiple events in batch */
6034
+ batchCreate: async (options) => {
6035
+ return rb.execute(postWatcherEvents, {}, options);
6036
+ },
5072
6037
  get: async (id, options) => {
5073
6038
  return rb.execute(
5074
- getSchedulingEventsById,
6039
+ getWatcherEventsById,
5075
6040
  { path: { id } },
5076
6041
  options
5077
6042
  );
5078
- },
5079
- /**
5080
- * Create an internal event directly.
5081
- * Use for meetings between known users in the workspace.
5082
- */
5083
- create: async (attributes, options) => {
5084
- return rb.execute(
5085
- postSchedulingEvents,
5086
- {
5087
- body: { data: { type: "scheduling_event", attributes } }
5088
- },
6043
+ }
6044
+ }
6045
+ };
6046
+ }
6047
+
6048
+ // src/namespaces/webhooks-ns.ts
6049
+ function createWebhooksNamespace(rb) {
6050
+ return {
6051
+ configs: {
6052
+ delete: async (id, options) => {
6053
+ return rb.executeDelete(
6054
+ deleteWebhookConfigsById,
6055
+ { path: { id } },
5089
6056
  options
5090
6057
  );
5091
6058
  },
5092
- /** Update an event */
5093
- update: async (id, attributes, options) => {
5094
- return rb.execute(
5095
- patchSchedulingEventsById,
5096
- {
5097
- path: { id },
5098
- body: { data: { id, type: "scheduling_event", attributes } }
5099
- },
5100
- options
5101
- );
5102
- }
5103
- },
5104
- /**
5105
- * Participants — people attending events
5106
- */
5107
- participants: {
5108
- /** List participants with optional pagination */
5109
6059
  list: async (options) => {
5110
6060
  return rb.execute(
5111
- getSchedulingParticipants,
6061
+ getWebhookConfigs,
5112
6062
  buildPageQuery(options?.page, options?.pageSize),
5113
6063
  options
5114
6064
  );
5115
6065
  },
5116
- /** List all participants with automatic pagination */
5117
6066
  listAll: async (options) => {
5118
6067
  return paginateToArray(
5119
6068
  rb.createPaginatedFetcher(
5120
- getSchedulingParticipants,
6069
+ getWebhookConfigs,
5121
6070
  (page, pageSize) => ({
5122
6071
  query: { page: { number: page, size: pageSize } }
5123
6072
  }),
@@ -5125,145 +6074,80 @@ function createSchedulingNamespace(rb) {
5125
6074
  )
5126
6075
  );
5127
6076
  },
5128
- /** Get a participant by ID */
5129
- get: async (id, options) => {
5130
- return rb.execute(
5131
- getSchedulingParticipantsById,
5132
- { path: { id } },
5133
- options
5134
- );
5135
- },
5136
- /** Add a participant to an event */
5137
6077
  create: async (attributes, options) => {
5138
6078
  return rb.execute(
5139
- postSchedulingParticipants,
5140
- {
5141
- body: { data: { type: "scheduling_participant", attributes } }
5142
- },
6079
+ postWebhookConfigs,
6080
+ { body: { data: { type: "webhook_config", attributes } } },
5143
6081
  options
5144
6082
  );
5145
6083
  },
5146
- /** Update a participant (e.g., confirm attendance, respond to invite) */
5147
6084
  update: async (id, attributes, options) => {
5148
6085
  return rb.execute(
5149
- patchSchedulingParticipantsById,
6086
+ patchWebhookConfigsById,
5150
6087
  {
5151
6088
  path: { id },
5152
- body: { data: { id, type: "scheduling_participant", attributes } }
6089
+ body: { data: { id, type: "webhook_config", attributes } }
5153
6090
  },
5154
6091
  options
5155
6092
  );
5156
- }
5157
- },
5158
- /**
5159
- * Bookings — external party requests for appointments
5160
- */
5161
- bookings: {
5162
- /** List bookings with optional pagination */
5163
- list: async (options) => {
6093
+ },
6094
+ test: async (id, options) => {
5164
6095
  return rb.execute(
5165
- getSchedulingBookings,
5166
- buildPageQuery(options?.page, options?.pageSize),
6096
+ postWebhookConfigsByIdTest,
6097
+ { path: { id }, body: {} },
5167
6098
  options
5168
6099
  );
5169
6100
  },
5170
- /** List all bookings with automatic pagination */
5171
- listAll: async (options) => {
5172
- return paginateToArray(
5173
- rb.createPaginatedFetcher(
5174
- getSchedulingBookings,
5175
- (page, pageSize) => ({
5176
- query: { page: { number: page, size: pageSize } }
5177
- }),
5178
- options
5179
- )
5180
- );
5181
- },
5182
- /** Get a booking by ID */
5183
- get: async (id, options) => {
6101
+ bulkEnable: async (options) => {
5184
6102
  return rb.execute(
5185
- getSchedulingBookingsById,
5186
- { path: { id } },
6103
+ postWebhookConfigsBulkEnable,
6104
+ {},
5187
6105
  options
5188
6106
  );
5189
6107
  },
5190
- /**
5191
- * Create a booking request.
5192
- * Use when someone outside the platform requests an appointment.
5193
- * @example
5194
- * ```typescript
5195
- * const booking = await client.scheduling.bookings.create({
5196
- * event_type_id: 'event_123',
5197
- * start_time: '2025-03-01T10:00:00Z',
5198
- * booker_name: 'John Doe',
5199
- * booker_email: 'john@example.com',
5200
- * });
5201
- * ```
5202
- */
5203
- create: async (attributes, options) => {
6108
+ bulkDisable: async (options) => {
5204
6109
  return rb.execute(
5205
- postSchedulingBookings,
5206
- {
5207
- body: { data: { type: "scheduling_booking", attributes } }
5208
- },
6110
+ postWebhookConfigsBulkDisable,
6111
+ {},
5209
6112
  options
5210
6113
  );
5211
6114
  },
5212
- /**
5213
- * Confirm a pending booking.
5214
- * For EventTypes with requires_approval=true.
5215
- */
5216
- confirm: async (id, options) => {
6115
+ /** Replay historical events to this webhook */
6116
+ replay: async (id, options) => {
5217
6117
  return rb.execute(
5218
- patchSchedulingBookingsSchedulingBookingsByIdConfirm,
6118
+ postWebhookConfigsByIdReplay,
5219
6119
  { path: { id }, body: {} },
5220
6120
  options
5221
6121
  );
5222
6122
  },
5223
- /**
5224
- * Cancel or reject a booking.
5225
- */
5226
- cancel: async (id, attributes, options) => {
6123
+ get: async (id, options) => {
5227
6124
  return rb.execute(
5228
- patchSchedulingBookingsSchedulingBookingsByIdCancel,
5229
- {
5230
- path: { id },
5231
- body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5232
- },
6125
+ getWebhookConfigsById,
6126
+ { path: { id } },
5233
6127
  options
5234
6128
  );
5235
6129
  },
5236
- /**
5237
- * Reschedule a booking to a new time.
5238
- */
5239
- reschedule: async (id, attributes, options) => {
6130
+ /** Rotate the signing secret for a webhook config */
6131
+ rotateSecret: async (id, options) => {
5240
6132
  return rb.execute(
5241
- patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5242
- {
5243
- path: { id },
5244
- body: { data: { type: "scheduling_booking", attributes } }
5245
- },
6133
+ patchWebhookConfigsByIdRotateSecret,
6134
+ { path: { id }, body: {} },
5246
6135
  options
5247
6136
  );
5248
6137
  }
5249
6138
  },
5250
- /**
5251
- * Calendar Syncs — external calendar integrations
5252
- */
5253
- calendarSyncs: {
5254
- /** List calendar syncs with optional pagination */
6139
+ deliveries: {
5255
6140
  list: async (options) => {
5256
6141
  return rb.execute(
5257
- getSchedulingCalendarSyncs,
6142
+ getWebhookDeliveries,
5258
6143
  buildPageQuery(options?.page, options?.pageSize),
5259
6144
  options
5260
6145
  );
5261
6146
  },
5262
- /** List all calendar syncs with automatic pagination */
5263
6147
  listAll: async (options) => {
5264
6148
  return paginateToArray(
5265
6149
  rb.createPaginatedFetcher(
5266
- getSchedulingCalendarSyncs,
6150
+ getWebhookDeliveries,
5267
6151
  (page, pageSize) => ({
5268
6152
  query: { page: { number: page, size: pageSize } }
5269
6153
  }),
@@ -5271,61 +6155,31 @@ function createSchedulingNamespace(rb) {
5271
6155
  )
5272
6156
  );
5273
6157
  },
5274
- /** Get a calendar sync by ID */
5275
- get: async (id, options) => {
5276
- return rb.execute(
5277
- getSchedulingCalendarSyncsById,
5278
- { path: { id } },
5279
- options
5280
- );
5281
- },
5282
- /**
5283
- * Create a calendar sync.
5284
- * For bi-directional sync with external calendars (Google, Outlook).
5285
- */
5286
6158
  create: async (attributes, options) => {
5287
6159
  return rb.execute(
5288
- postSchedulingCalendarSyncs,
5289
- {
5290
- body: { data: { type: "scheduling_calendar_sync", attributes } }
5291
- },
6160
+ postWebhookDeliveriesBulkRetry,
6161
+ { body: { data: { type: "webhook_delivery", attributes } } },
5292
6162
  options
5293
6163
  );
5294
6164
  },
5295
- /** Update a calendar sync */
5296
- update: async (id, attributes, options) => {
6165
+ retry: async (options) => {
5297
6166
  return rb.execute(
5298
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5299
- {
5300
- path: { id },
5301
- body: {
5302
- data: { id, type: "scheduling_calendar_sync", attributes }
5303
- }
5304
- },
5305
- options
5306
- );
5307
- },
5308
- /** Delete a calendar sync */
5309
- delete: async (id, options) => {
5310
- return rb.executeDelete(
5311
- deleteSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5312
- { path: { id } },
6167
+ postWebhookDeliveriesBulkRetry,
6168
+ {},
5313
6169
  options
5314
6170
  );
5315
6171
  },
5316
- /** Pause a calendar sync (stops pushing/pulling) */
5317
- pause: async (id, options) => {
6172
+ bulkRetry: async (options) => {
5318
6173
  return rb.execute(
5319
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5320
- { path: { id }, body: {} },
6174
+ postWebhookDeliveriesBulkRetry,
6175
+ {},
5321
6176
  options
5322
6177
  );
5323
6178
  },
5324
- /** Resume a paused calendar sync */
5325
- resume: async (id, options) => {
6179
+ get: async (id, options) => {
5326
6180
  return rb.execute(
5327
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5328
- { path: { id }, body: {} },
6181
+ getWebhookDeliveriesById,
6182
+ { path: { id } },
5329
6183
  options
5330
6184
  );
5331
6185
  }
@@ -5513,6 +6367,30 @@ var RequestBuilder = class {
5513
6367
  throw handleApiError(error);
5514
6368
  }
5515
6369
  }
6370
+ /**
6371
+ * Execute a raw multipart/form-data POST request.
6372
+ * Used for file upload endpoints (custom Phoenix controllers).
6373
+ * Content-Type is omitted from headers so the browser sets the correct
6374
+ * multipart boundary automatically from the FormData body.
6375
+ */
6376
+ async rawPostMultipart(url, body, options) {
6377
+ const headers = buildHeaders(this.getHeaders, options);
6378
+ delete headers["Content-Type"];
6379
+ delete headers["content-type"];
6380
+ try {
6381
+ const { data } = await this.requestWithRetry(
6382
+ () => this.clientInstance.post({
6383
+ url,
6384
+ headers,
6385
+ body,
6386
+ ...options?.signal && { signal: options.signal }
6387
+ })
6388
+ );
6389
+ return this.unwrap(data?.data);
6390
+ } catch (error) {
6391
+ throw handleApiError(error);
6392
+ }
6393
+ }
5516
6394
  /**
5517
6395
  * Execute a raw POST request to a custom (non-generated) endpoint.
5518
6396
  * Used for endpoints implemented as custom Phoenix controllers.
@@ -5670,13 +6548,16 @@ var GptClient = class extends BaseClient {
5670
6548
  this.billing = createBillingNamespace(rb);
5671
6549
  this.communication = createCommunicationNamespace(rb);
5672
6550
  this.extraction = createExtractionNamespace(rb);
5673
- this.identity = createIdentityNamespace(rb);
6551
+ this.identity = createIdentityNamespace(rb, this.config?.baseUrl);
5674
6552
  this.platform = createPlatformNamespace(rb);
6553
+ this.scheduling = createSchedulingNamespace(rb);
5675
6554
  this.search = createSearchNamespace(rb);
5676
6555
  this.storage = createStorageNamespace(rb);
5677
6556
  this.threads = createThreadsNamespace(rb);
6557
+ this.training = createTrainingNamespace(rb);
6558
+ this.voice = createVoiceNamespace(rb);
6559
+ this.watcher = createWatcherNamespace(rb);
5678
6560
  this.webhooks = createWebhooksNamespace(rb);
5679
- this.scheduling = createSchedulingNamespace(rb);
5680
6561
  }
5681
6562
  /**
5682
6563
  * Subscribe to SDK lifecycle events.