@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.mjs CHANGED
@@ -1223,9 +1223,11 @@ function buildUserAgent(sdkVersion, appInfo) {
1223
1223
  return ua;
1224
1224
  }
1225
1225
 
1226
+ // src/version.ts
1227
+ var SDK_VERSION = "0.2.1";
1228
+ var DEFAULT_API_VERSION = "2026-02-25";
1229
+
1226
1230
  // src/base-client.ts
1227
- var DEFAULT_API_VERSION = "2025-12-03";
1228
- var SDK_VERSION = "0.1.4";
1229
1231
  function generateUUID() {
1230
1232
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
1231
1233
  return crypto.randomUUID();
@@ -1331,7 +1333,9 @@ var BaseClient = class {
1331
1333
  "Accept",
1332
1334
  `application/vnd.api+json; version=${this.apiVersion}`
1333
1335
  );
1334
- req.headers.set("Content-Type", "application/vnd.api+json");
1336
+ if (!req.headers.get("Content-Type")?.startsWith("multipart/")) {
1337
+ req.headers.set("Content-Type", "application/vnd.api+json");
1338
+ }
1335
1339
  if (typeof process !== "undefined") {
1336
1340
  req.headers.set("User-Agent", userAgent);
1337
1341
  }
@@ -1537,6 +1541,11 @@ var postThreads = (options) => (options.client ?? client).post({
1537
1541
  ...options.headers
1538
1542
  }
1539
1543
  });
1544
+ var getVoiceSessionsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
1545
+ security: [{ scheme: "bearer", type: "http" }],
1546
+ url: "/voice/sessions/workspace/{workspace_id}",
1547
+ ...options
1548
+ });
1540
1549
  var patchExtractionDocumentsByIdCancel = (options) => (options.client ?? client).patch({
1541
1550
  security: [{ scheme: "bearer", type: "http" }],
1542
1551
  url: "/extraction/documents/{id}/cancel",
@@ -1556,6 +1565,11 @@ var getAgentVersionsById = (options) => (options.client ?? client).get({
1556
1565
  url: "/agent-versions/{id}",
1557
1566
  ...options
1558
1567
  });
1568
+ var getWatcherEventsById = (options) => (options.client ?? client).get({
1569
+ security: [{ scheme: "bearer", type: "http" }],
1570
+ url: "/watcher/events/{id}",
1571
+ ...options
1572
+ });
1559
1573
  var patchApiKeysByIdRevoke = (options) => (options.client ?? client).patch({
1560
1574
  security: [{ scheme: "bearer", type: "http" }],
1561
1575
  url: "/api-keys/{id}/revoke",
@@ -1621,11 +1635,30 @@ var patchExtractionDocumentsByIdDismiss = (options) => (options.client ?? client
1621
1635
  ...options.headers
1622
1636
  }
1623
1637
  });
1638
+ var postUsersAuthResetPasswordRequest = (options) => (options.client ?? client).post({
1639
+ security: [{ scheme: "bearer", type: "http" }],
1640
+ url: "/users/auth/reset-password/request",
1641
+ ...options,
1642
+ headers: {
1643
+ "Content-Type": "application/vnd.api+json",
1644
+ ...options.headers
1645
+ }
1646
+ });
1624
1647
  var getSearchIndexes = (options) => (options.client ?? client).get({
1625
1648
  security: [{ scheme: "bearer", type: "http" }],
1626
1649
  url: "/search/indexes",
1627
1650
  ...options
1628
1651
  });
1652
+ var deleteTrainingSessionsById = (options) => (options.client ?? client).delete({
1653
+ security: [{ scheme: "bearer", type: "http" }],
1654
+ url: "/training-sessions/{id}",
1655
+ ...options
1656
+ });
1657
+ var getTrainingSessionsById = (options) => (options.client ?? client).get({
1658
+ security: [{ scheme: "bearer", type: "http" }],
1659
+ url: "/training-sessions/{id}",
1660
+ ...options
1661
+ });
1629
1662
  var postAgentsByIdAnalyzeTraining = (options) => (options.client ?? client).post({
1630
1663
  security: [{ scheme: "bearer", type: "http" }],
1631
1664
  url: "/agents/{id}/analyze-training",
@@ -1640,9 +1673,9 @@ var postWebhookConfigsByIdTest = (options) => (options.client ?? client).post({
1640
1673
  ...options.headers
1641
1674
  }
1642
1675
  });
1643
- var postStorageSignDownload = (options) => (options.client ?? client).post({
1676
+ var patchUsersAuthPasswordChange = (options) => (options.client ?? client).patch({
1644
1677
  security: [{ scheme: "bearer", type: "http" }],
1645
- url: "/storage/sign-download",
1678
+ url: "/users/auth/password/change",
1646
1679
  ...options,
1647
1680
  headers: {
1648
1681
  "Content-Type": "application/vnd.api+json",
@@ -1732,6 +1765,20 @@ var postAgentsByIdPublishVersion = (options) => (options.client ?? client).post(
1732
1765
  ...options.headers
1733
1766
  }
1734
1767
  });
1768
+ var getVoiceSessionsMine = (options) => (options.client ?? client).get({
1769
+ security: [{ scheme: "bearer", type: "http" }],
1770
+ url: "/voice/sessions/mine",
1771
+ ...options
1772
+ });
1773
+ var postUsersAuthMagicLinkLogin = (options) => (options.client ?? client).post({
1774
+ security: [{ scheme: "bearer", type: "http" }],
1775
+ url: "/users/auth/magic-link/login",
1776
+ ...options,
1777
+ headers: {
1778
+ "Content-Type": "application/vnd.api+json",
1779
+ ...options.headers
1780
+ }
1781
+ });
1735
1782
  var deleteApiKeysById = (options) => (options.client ?? client).delete({
1736
1783
  security: [{ scheme: "bearer", type: "http" }],
1737
1784
  url: "/api-keys/{id}",
@@ -1751,6 +1798,15 @@ var patchApiKeysById = (options) => (options.client ?? client).patch({
1751
1798
  ...options.headers
1752
1799
  }
1753
1800
  });
1801
+ var patchUsersAuthResetPassword = (options) => (options.client ?? client).patch({
1802
+ security: [{ scheme: "bearer", type: "http" }],
1803
+ url: "/users/auth/reset-password",
1804
+ ...options,
1805
+ headers: {
1806
+ "Content-Type": "application/vnd.api+json",
1807
+ ...options.headers
1808
+ }
1809
+ });
1754
1810
  var getSchedulingCalendarSyncsById = (options) => (options.client ?? client).get({
1755
1811
  security: [{ scheme: "bearer", type: "http" }],
1756
1812
  url: "/scheduling/calendar-syncs/{id}",
@@ -1982,6 +2038,15 @@ var getWebhookDeliveriesById = (options) => (options.client ?? client).get({
1982
2038
  url: "/webhook-deliveries/{id}",
1983
2039
  ...options
1984
2040
  });
2041
+ var patchVoiceSessionsByIdStop = (options) => (options.client ?? client).patch({
2042
+ security: [{ scheme: "bearer", type: "http" }],
2043
+ url: "/voice/sessions/{id}/stop",
2044
+ ...options,
2045
+ headers: {
2046
+ "Content-Type": "application/vnd.api+json",
2047
+ ...options.headers
2048
+ }
2049
+ });
1985
2050
  var getSchedulingParticipants = (options) => (options.client ?? client).get({
1986
2051
  security: [{ scheme: "bearer", type: "http" }],
1987
2052
  url: "/scheduling/participants",
@@ -2010,11 +2075,35 @@ var patchExtractionDocumentsByIdFinishUpload = (options) => (options.client ?? c
2010
2075
  ...options.headers
2011
2076
  }
2012
2077
  });
2078
+ var getTrainingSessionsAgentsByAgentIdSessions = (options) => (options.client ?? client).get({
2079
+ security: [{ scheme: "bearer", type: "http" }],
2080
+ url: "/training-sessions/agents/{agent_id}/sessions",
2081
+ ...options
2082
+ });
2013
2083
  var getSearch = (options) => (options.client ?? client).get({
2014
2084
  security: [{ scheme: "bearer", type: "http" }],
2015
2085
  url: "/search",
2016
2086
  ...options
2017
2087
  });
2088
+ var getVoiceSessionsById = (options) => (options.client ?? client).get({
2089
+ security: [{ scheme: "bearer", type: "http" }],
2090
+ url: "/voice/sessions/{id}",
2091
+ ...options
2092
+ });
2093
+ var getVoiceSessions = (options) => (options.client ?? client).get({
2094
+ security: [{ scheme: "bearer", type: "http" }],
2095
+ url: "/voice/sessions",
2096
+ ...options
2097
+ });
2098
+ var postVoiceSessions = (options) => (options.client ?? client).post({
2099
+ security: [{ scheme: "bearer", type: "http" }],
2100
+ url: "/voice/sessions",
2101
+ ...options,
2102
+ headers: {
2103
+ "Content-Type": "application/vnd.api+json",
2104
+ ...options.headers
2105
+ }
2106
+ });
2018
2107
  var postInvitations = (options) => (options.client ?? client).post({
2019
2108
  security: [{ scheme: "bearer", type: "http" }],
2020
2109
  url: "/invitations",
@@ -2122,6 +2211,20 @@ var patchNotificationPreferencesById = (options) => (options.client ?? client).p
2122
2211
  ...options.headers
2123
2212
  }
2124
2213
  });
2214
+ var getWatcherClaims = (options) => (options.client ?? client).get({
2215
+ security: [{ scheme: "bearer", type: "http" }],
2216
+ url: "/watcher/claims",
2217
+ ...options
2218
+ });
2219
+ var postWatcherClaims = (options) => (options.client ?? client).post({
2220
+ security: [{ scheme: "bearer", type: "http" }],
2221
+ url: "/watcher/claims",
2222
+ ...options,
2223
+ headers: {
2224
+ "Content-Type": "application/vnd.api+json",
2225
+ ...options.headers
2226
+ }
2227
+ });
2125
2228
  var patchSchedulingBookingsSchedulingBookingsByIdReschedule = (options) => (options.client ?? client).patch({
2126
2229
  security: [{ scheme: "bearer", type: "http" }],
2127
2230
  url: "/scheduling/bookings/scheduling/bookings/{id}/reschedule",
@@ -2131,6 +2234,15 @@ var patchSchedulingBookingsSchedulingBookingsByIdReschedule = (options) => (opti
2131
2234
  ...options.headers
2132
2235
  }
2133
2236
  });
2237
+ var patchVoiceSessionsByIdFinalize = (options) => (options.client ?? client).patch({
2238
+ security: [{ scheme: "bearer", type: "http" }],
2239
+ url: "/voice/sessions/{id}/finalize",
2240
+ ...options,
2241
+ headers: {
2242
+ "Content-Type": "application/vnd.api+json",
2243
+ ...options.headers
2244
+ }
2245
+ });
2134
2246
  var postThreadsByIdExport = (options) => (options.client ?? client).post({
2135
2247
  security: [{ scheme: "bearer", type: "http" }],
2136
2248
  url: "/threads/{id}/export",
@@ -2418,15 +2530,6 @@ var patchThreadsByIdUnarchive = (options) => (options.client ?? client).patch({
2418
2530
  ...options.headers
2419
2531
  }
2420
2532
  });
2421
- var postStorageSignUpload = (options) => (options.client ?? client).post({
2422
- security: [{ scheme: "bearer", type: "http" }],
2423
- url: "/storage/sign-upload",
2424
- ...options,
2425
- headers: {
2426
- "Content-Type": "application/vnd.api+json",
2427
- ...options.headers
2428
- }
2429
- });
2430
2533
  var getAiConversations = (options) => (options.client ?? client).get({
2431
2534
  security: [{ scheme: "bearer", type: "http" }],
2432
2535
  url: "/ai/conversations",
@@ -2533,6 +2636,20 @@ var postWebhookDeliveriesBulkRetry = (options) => (options.client ?? client).pos
2533
2636
  ...options.headers
2534
2637
  }
2535
2638
  });
2639
+ var getWatcherClaimsById = (options) => (options.client ?? client).get({
2640
+ security: [{ scheme: "bearer", type: "http" }],
2641
+ url: "/watcher/claims/{id}",
2642
+ ...options
2643
+ });
2644
+ var patchWatcherClaimsById = (options) => (options.client ?? client).patch({
2645
+ security: [{ scheme: "bearer", type: "http" }],
2646
+ url: "/watcher/claims/{id}",
2647
+ ...options,
2648
+ headers: {
2649
+ "Content-Type": "application/vnd.api+json",
2650
+ ...options.headers
2651
+ }
2652
+ });
2536
2653
  var postUsersAuthLogin = (options) => (options.client ?? client).post({
2537
2654
  security: [{ scheme: "bearer", type: "http" }],
2538
2655
  url: "/users/auth/login",
@@ -2602,6 +2719,15 @@ var patchExtractionResultsByIdRegenerate = (options) => (options.client ?? clien
2602
2719
  ...options.headers
2603
2720
  }
2604
2721
  });
2722
+ var postUsersAuthConfirm = (options) => (options.client ?? client).post({
2723
+ security: [{ scheme: "bearer", type: "http" }],
2724
+ url: "/users/auth/confirm",
2725
+ ...options,
2726
+ headers: {
2727
+ "Content-Type": "application/vnd.api+json",
2728
+ ...options.headers
2729
+ }
2730
+ });
2605
2731
  var getSchedulingEventsById = (options) => (options.client ?? client).get({
2606
2732
  security: [{ scheme: "bearer", type: "http" }],
2607
2733
  url: "/scheduling/events/{id}",
@@ -2616,6 +2742,20 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
2616
2742
  ...options.headers
2617
2743
  }
2618
2744
  });
2745
+ var getWorkspaceMemberships = (options) => (options.client ?? client).get({
2746
+ security: [{ scheme: "bearer", type: "http" }],
2747
+ url: "/workspace-memberships",
2748
+ ...options
2749
+ });
2750
+ var postWorkspaceMemberships = (options) => (options.client ?? client).post({
2751
+ security: [{ scheme: "bearer", type: "http" }],
2752
+ url: "/workspace-memberships",
2753
+ ...options,
2754
+ headers: {
2755
+ "Content-Type": "application/vnd.api+json",
2756
+ ...options.headers
2757
+ }
2758
+ });
2619
2759
  var getTenantsByTenantIdDocumentStats = (options) => (options.client ?? client).get({
2620
2760
  security: [{ scheme: "bearer", type: "http" }],
2621
2761
  url: "/tenants/{tenant_id}/document_stats",
@@ -2706,6 +2846,15 @@ var patchApplicationsByIdAllocateCredits = (options) => (options.client ?? clien
2706
2846
  ...options.headers
2707
2847
  }
2708
2848
  });
2849
+ var postUsersAuthMagicLinkRequest = (options) => (options.client ?? client).post({
2850
+ security: [{ scheme: "bearer", type: "http" }],
2851
+ url: "/users/auth/magic-link/request",
2852
+ ...options,
2853
+ headers: {
2854
+ "Content-Type": "application/vnd.api+json",
2855
+ ...options.headers
2856
+ }
2857
+ });
2709
2858
  var getExtractionResultsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2710
2859
  security: [{ scheme: "bearer", type: "http" }],
2711
2860
  url: "/extraction/results/workspace/{workspace_id}",
@@ -2809,6 +2958,20 @@ var postAiMessages = (options) => (options.client ?? client).post({
2809
2958
  ...options.headers
2810
2959
  }
2811
2960
  });
2961
+ var getWatcherEvents = (options) => (options.client ?? client).get({
2962
+ security: [{ scheme: "bearer", type: "http" }],
2963
+ url: "/watcher/events",
2964
+ ...options
2965
+ });
2966
+ var postWatcherEvents = (options) => (options.client ?? client).post({
2967
+ security: [{ scheme: "bearer", type: "http" }],
2968
+ url: "/watcher/events",
2969
+ ...options,
2970
+ headers: {
2971
+ "Content-Type": "application/vnd.api+json",
2972
+ ...options.headers
2973
+ }
2974
+ });
2812
2975
  var postAgentVersionsByIdSetSystemFields = (options) => (options.client ?? client).post({
2813
2976
  security: [{ scheme: "bearer", type: "http" }],
2814
2977
  url: "/agent-versions/{id}/set-system-fields",
@@ -2936,6 +3099,29 @@ var postWorkspacesByWorkspaceIdExtractionExports = (options) => (options.client
2936
3099
  ...options.headers
2937
3100
  }
2938
3101
  });
3102
+ var deleteWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).delete({
3103
+ security: [{ scheme: "bearer", type: "http" }],
3104
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
3105
+ ...options
3106
+ });
3107
+ var patchWorkspaceMembershipsByWorkspaceIdByUserId = (options) => (options.client ?? client).patch({
3108
+ security: [{ scheme: "bearer", type: "http" }],
3109
+ url: "/workspace-memberships/{workspace_id}/{user_id}",
3110
+ ...options,
3111
+ headers: {
3112
+ "Content-Type": "application/vnd.api+json",
3113
+ ...options.headers
3114
+ }
3115
+ });
3116
+ var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
3117
+ security: [{ scheme: "bearer", type: "http" }],
3118
+ url: "/training-examples/bulk-delete",
3119
+ ...options,
3120
+ headers: {
3121
+ "Content-Type": "application/vnd.api+json",
3122
+ ...options.headers
3123
+ }
3124
+ });
2939
3125
  var getCreditPackages = (options) => (options.client ?? client).get({
2940
3126
  security: [{ scheme: "bearer", type: "http" }],
2941
3127
  url: "/credit-packages",
@@ -2946,11 +3132,6 @@ var getUsers = (options) => (options.client ?? client).get({
2946
3132
  url: "/users",
2947
3133
  ...options
2948
3134
  });
2949
- var getObjects = (options) => (options.client ?? client).get({
2950
- security: [{ scheme: "bearer", type: "http" }],
2951
- url: "/objects",
2952
- ...options
2953
- });
2954
3135
 
2955
3136
  // src/pagination.ts
2956
3137
  var DEFAULT_MAX_PAGES = 500;
@@ -3896,6 +4077,35 @@ function createExtractionNamespace(rb) {
3896
4077
  },
3897
4078
  options
3898
4079
  );
4080
+ },
4081
+ /**
4082
+ * Query rows in an ExtractionResult server-side.
4083
+ *
4084
+ * Applies AttributeFilter predicates against the `rows` JSONB array
4085
+ * using a PostgreSQL lateral join. Suitable for datasets with 10K+ rows.
4086
+ * Empty `filters` array returns all rows (paginated by `limit`/`offset`).
4087
+ *
4088
+ * @example
4089
+ * const result = await client.extraction.results.query(resultId, {
4090
+ * filters: [
4091
+ * { field: 'wellness_score', op: 'gt', value: 75 },
4092
+ * { field: 'enrolled', op: 'eq', value: 'true' },
4093
+ * ],
4094
+ * limit: 100,
4095
+ * offset: 0,
4096
+ * });
4097
+ * console.log(`${result.filtered} of ${result.total} rows match`);
4098
+ */
4099
+ query: async (resultId, params, options) => {
4100
+ return rb.rawPost(
4101
+ `/extraction/results/${resultId}/query`,
4102
+ {
4103
+ filters: params.filters,
4104
+ limit: params.limit,
4105
+ offset: params.offset
4106
+ },
4107
+ options
4108
+ );
3899
4109
  }
3900
4110
  },
3901
4111
  batches: {
@@ -4047,7 +4257,36 @@ var ApiKeyAllocateSchema = z2.object({
4047
4257
  amount: z2.number().positive(),
4048
4258
  description: z2.string().min(1)
4049
4259
  });
4050
- function createIdentityNamespace(rb) {
4260
+ var MagicLinkRequestSchema = z2.object({
4261
+ email: z2.string().email()
4262
+ });
4263
+ var RequestPasswordResetSchema = z2.object({
4264
+ email: z2.string().email()
4265
+ });
4266
+ var MagicLinkLoginSchema = z2.object({
4267
+ token: z2.string().min(1)
4268
+ });
4269
+ var ConfirmEmailSchema = z2.object({
4270
+ email: z2.string().email(),
4271
+ confirmation_token: z2.string().min(1)
4272
+ });
4273
+ var ResetPasswordWithTokenSchema = z2.object({
4274
+ token: z2.string().min(1),
4275
+ password: z2.string().min(8),
4276
+ password_confirmation: z2.string().min(8)
4277
+ }).refine((data) => data.password === data.password_confirmation, {
4278
+ message: "Passwords do not match",
4279
+ path: ["password_confirmation"]
4280
+ });
4281
+ var ChangePasswordSchema = z2.object({
4282
+ current_password: z2.string().min(1),
4283
+ password: z2.string().min(8),
4284
+ password_confirmation: z2.string().min(8)
4285
+ }).refine((data) => data.password === data.password_confirmation, {
4286
+ message: "Passwords do not match",
4287
+ path: ["password_confirmation"]
4288
+ });
4289
+ function createIdentityNamespace(rb, baseUrl) {
4051
4290
  return {
4052
4291
  /** Login with email and password — returns a token object */
4053
4292
  login: async (email, password, options) => {
@@ -4126,6 +4365,117 @@ function createIdentityNamespace(rb) {
4126
4365
  resendConfirmation: async (options) => {
4127
4366
  return rb.execute(postUsersAuthResendConfirmation, {}, options);
4128
4367
  },
4368
+ /** Confirm an email address using the token from the confirmation email */
4369
+ confirmEmail: async (email, confirmationToken, options) => {
4370
+ ConfirmEmailSchema.parse({
4371
+ email,
4372
+ confirmation_token: confirmationToken
4373
+ });
4374
+ return rb.execute(
4375
+ postUsersAuthConfirm,
4376
+ {
4377
+ body: {
4378
+ data: {
4379
+ type: "user",
4380
+ attributes: { email, confirmation_token: confirmationToken }
4381
+ }
4382
+ }
4383
+ },
4384
+ options
4385
+ );
4386
+ },
4387
+ /** Request a magic link sign-in email */
4388
+ requestMagicLink: async (email, options) => {
4389
+ MagicLinkRequestSchema.parse({ email });
4390
+ return rb.execute(
4391
+ postUsersAuthMagicLinkRequest,
4392
+ {
4393
+ body: {
4394
+ data: { type: "user", attributes: { email } }
4395
+ }
4396
+ },
4397
+ options
4398
+ );
4399
+ },
4400
+ /**
4401
+ * Request a password reset email — always returns success to prevent email enumeration.
4402
+ * The user will receive an email with a reset token if the account exists.
4403
+ */
4404
+ requestPasswordReset: async (email, options) => {
4405
+ RequestPasswordResetSchema.parse({ email });
4406
+ return rb.execute(
4407
+ postUsersAuthResetPasswordRequest,
4408
+ {
4409
+ body: {
4410
+ data: { type: "user", attributes: { email } }
4411
+ }
4412
+ },
4413
+ options
4414
+ );
4415
+ },
4416
+ /** Sign in using a token from a magic link email */
4417
+ signInWithMagicLink: async (token, options) => {
4418
+ MagicLinkLoginSchema.parse({ token });
4419
+ return rb.execute(
4420
+ postUsersAuthMagicLinkLogin,
4421
+ {
4422
+ body: {
4423
+ data: { type: "user", attributes: { token } }
4424
+ }
4425
+ },
4426
+ options
4427
+ );
4428
+ },
4429
+ /** Reset a password using the token from a password reset email */
4430
+ resetPasswordWithToken: async (token, password, passwordConfirmation, options) => {
4431
+ ResetPasswordWithTokenSchema.parse({
4432
+ token,
4433
+ password,
4434
+ password_confirmation: passwordConfirmation
4435
+ });
4436
+ return rb.execute(
4437
+ patchUsersAuthResetPassword,
4438
+ {
4439
+ body: {
4440
+ data: {
4441
+ id: "",
4442
+ type: "user",
4443
+ attributes: {
4444
+ token,
4445
+ password,
4446
+ password_confirmation: passwordConfirmation
4447
+ }
4448
+ }
4449
+ }
4450
+ },
4451
+ options
4452
+ );
4453
+ },
4454
+ /** Change password for the currently authenticated user */
4455
+ changePassword: async (currentPassword, password, passwordConfirmation, options) => {
4456
+ ChangePasswordSchema.parse({
4457
+ current_password: currentPassword,
4458
+ password,
4459
+ password_confirmation: passwordConfirmation
4460
+ });
4461
+ return rb.execute(
4462
+ patchUsersAuthPasswordChange,
4463
+ {
4464
+ body: {
4465
+ data: {
4466
+ id: "",
4467
+ type: "user",
4468
+ attributes: {
4469
+ current_password: currentPassword,
4470
+ password,
4471
+ password_confirmation: passwordConfirmation
4472
+ }
4473
+ }
4474
+ }
4475
+ },
4476
+ options
4477
+ );
4478
+ },
4129
4479
  delete: async (id, options) => {
4130
4480
  return rb.executeDelete(deleteUsersById, { path: { id } }, options);
4131
4481
  },
@@ -4189,12 +4539,64 @@ function createIdentityNamespace(rb) {
4189
4539
  );
4190
4540
  }
4191
4541
  },
4192
- apiKeys: {
4193
- list: async (options) => {
4194
- return rb.execute(
4195
- getApiKeys,
4196
- buildPageQuery(options?.page, options?.pageSize),
4197
- options
4542
+ /**
4543
+ * Social OAuth sign-in (Google, GitHub, Microsoft).
4544
+ *
4545
+ * This is a browser-redirect flow — the backend redirects the user's browser
4546
+ * to the provider, then back to your `redirectUrl` with `?token=JWT` appended.
4547
+ *
4548
+ * @example
4549
+ * ```typescript
4550
+ * // Get the URL and redirect manually
4551
+ * const url = client.identity.oauth.getAuthorizationUrl('google', {
4552
+ * appId: 'your-app-id',
4553
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4554
+ * });
4555
+ * window.location.href = url;
4556
+ *
4557
+ * // Or use the convenience helper (browser only)
4558
+ * client.identity.oauth.signIn('google', {
4559
+ * appId: 'your-app-id',
4560
+ * redirectUrl: 'https://yourapp.com/auth/callback',
4561
+ * });
4562
+ *
4563
+ * // On your callback page, extract the token:
4564
+ * const token = new URLSearchParams(window.location.search).get('token');
4565
+ * ```
4566
+ */
4567
+ oauth: {
4568
+ /**
4569
+ * Build the authorization URL for the given OAuth provider.
4570
+ * Navigate the user's browser to this URL to begin the sign-in flow.
4571
+ */
4572
+ getAuthorizationUrl(provider, options) {
4573
+ const base = (baseUrl ?? "").replace(/\/$/, "");
4574
+ const params = { app_id: options.appId };
4575
+ if (options.redirectUrl) params["redirect_url"] = options.redirectUrl;
4576
+ return `${base}/oauth/${provider}?${new URLSearchParams(params).toString()}`;
4577
+ },
4578
+ /**
4579
+ * Redirect the browser to the OAuth sign-in page for the given provider.
4580
+ * Only works in browser environments (sets `window.location.href`).
4581
+ *
4582
+ * After the user authenticates, they are redirected back to `redirectUrl`
4583
+ * with a `?token=JWT` query parameter containing their session token.
4584
+ */
4585
+ signIn(provider, options) {
4586
+ if (typeof window === "undefined") {
4587
+ throw new Error(
4588
+ "identity.oauth.signIn() requires a browser environment. Use identity.oauth.getAuthorizationUrl() to get the URL and redirect manually."
4589
+ );
4590
+ }
4591
+ window.location.href = this.getAuthorizationUrl(provider, options);
4592
+ }
4593
+ },
4594
+ apiKeys: {
4595
+ list: async (options) => {
4596
+ return rb.execute(
4597
+ getApiKeys,
4598
+ buildPageQuery(options?.page, options?.pageSize),
4599
+ options
4198
4600
  );
4199
4601
  },
4200
4602
  listAll: async (options) => {
@@ -4485,15 +4887,402 @@ function createPlatformNamespace(rb) {
4485
4887
  },
4486
4888
  listMe: async (options) => {
4487
4889
  return rb.execute(
4488
- getInvitationsMe,
4890
+ getInvitationsMe,
4891
+ buildPageQuery(options?.page, options?.pageSize),
4892
+ options
4893
+ );
4894
+ },
4895
+ listAllMe: async (options) => {
4896
+ return paginateToArray(
4897
+ rb.createPaginatedFetcher(
4898
+ getInvitationsMe,
4899
+ (page, pageSize) => ({
4900
+ query: { page: { number: page, size: pageSize } }
4901
+ }),
4902
+ options
4903
+ )
4904
+ );
4905
+ },
4906
+ create: async (attributes, options) => {
4907
+ return rb.execute(
4908
+ postInvitations,
4909
+ { body: { data: { type: "invitation", attributes } } },
4910
+ options
4911
+ );
4912
+ },
4913
+ update: async (id, attributes, options) => {
4914
+ return rb.execute(
4915
+ patchInvitationsByIdDecline,
4916
+ {
4917
+ path: { id },
4918
+ body: { data: { id, type: "invitation", attributes } }
4919
+ },
4920
+ options
4921
+ );
4922
+ }
4923
+ },
4924
+ workspaceMembers: {
4925
+ /** List members of a workspace */
4926
+ list: async (workspaceId, options) => {
4927
+ return rb.execute(
4928
+ getWorkspaceMemberships,
4929
+ {
4930
+ query: {
4931
+ filter: { workspace_id: workspaceId },
4932
+ ...buildPageQuery(options?.page, options?.pageSize)?.query
4933
+ }
4934
+ },
4935
+ options
4936
+ );
4937
+ },
4938
+ /** Get a specific workspace member by workspace and user ID */
4939
+ get: async (workspaceId, memberId, options) => {
4940
+ return rb.rawGet(
4941
+ `/workspace-memberships/${workspaceId}/${memberId}`,
4942
+ options
4943
+ );
4944
+ },
4945
+ /** Add a user to a workspace */
4946
+ create: async (workspaceId, attrs, options) => {
4947
+ return rb.execute(
4948
+ postWorkspaceMemberships,
4949
+ {
4950
+ body: {
4951
+ data: {
4952
+ type: "workspace-membership",
4953
+ attributes: { workspace_id: workspaceId, ...attrs }
4954
+ }
4955
+ }
4956
+ },
4957
+ options
4958
+ );
4959
+ },
4960
+ /** Update workspace member permissions or role */
4961
+ update: async (workspaceId, memberId, attrs, options) => {
4962
+ return rb.execute(
4963
+ patchWorkspaceMembershipsByWorkspaceIdByUserId,
4964
+ {
4965
+ path: { workspace_id: workspaceId, user_id: memberId },
4966
+ body: {
4967
+ data: {
4968
+ id: memberId,
4969
+ type: "workspace-membership",
4970
+ attributes: attrs
4971
+ }
4972
+ }
4973
+ },
4974
+ options
4975
+ );
4976
+ },
4977
+ /** Update workspace member profile attributes (G9) */
4978
+ updateProfile: async (workspaceId, memberId, profileAttrs, options) => {
4979
+ return rb.rawPost(
4980
+ `/workspace-memberships/${workspaceId}/${memberId}/profile`,
4981
+ { data: { attributes: { profile_attributes: profileAttrs } } },
4982
+ options
4983
+ );
4984
+ },
4985
+ /** Remove a user from a workspace */
4986
+ remove: async (workspaceId, memberId, options) => {
4987
+ return rb.executeDelete(
4988
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId,
4989
+ { path: { workspace_id: workspaceId, user_id: memberId } },
4990
+ options
4991
+ );
4992
+ }
4993
+ }
4994
+ };
4995
+ }
4996
+
4997
+ // src/namespaces/scheduling.ts
4998
+ function createSchedulingNamespace(rb) {
4999
+ return {
5000
+ /**
5001
+ * Event Types — templates for bookable events
5002
+ */
5003
+ eventTypes: {
5004
+ /** List event types with optional pagination */
5005
+ list: async (options) => {
5006
+ return rb.execute(
5007
+ getSchedulingEventTypes,
5008
+ buildPageQuery(options?.page, options?.pageSize),
5009
+ options
5010
+ );
5011
+ },
5012
+ /** List all event types with automatic pagination */
5013
+ listAll: async (options) => {
5014
+ return paginateToArray(
5015
+ rb.createPaginatedFetcher(
5016
+ getSchedulingEventTypes,
5017
+ (page, pageSize) => ({
5018
+ query: { page: { number: page, size: pageSize } }
5019
+ }),
5020
+ options
5021
+ )
5022
+ );
5023
+ },
5024
+ /** Get an event type by ID */
5025
+ get: async (id, options) => {
5026
+ return rb.execute(
5027
+ getSchedulingEventTypesById,
5028
+ { path: { id } },
5029
+ options
5030
+ );
5031
+ },
5032
+ /**
5033
+ * Create a new event type.
5034
+ * @example
5035
+ * ```typescript
5036
+ * const client = new GptClient({ apiKey: 'sk_tenant_...' });
5037
+ * const eventType = await client.scheduling.eventTypes.create({
5038
+ * name: '30-Minute Consultation',
5039
+ * slug: '30min-consult',
5040
+ * duration_minutes: 30,
5041
+ * location_type: 'video',
5042
+ * });
5043
+ * ```
5044
+ */
5045
+ create: async (attributes, options) => {
5046
+ return rb.execute(
5047
+ postSchedulingEventTypes,
5048
+ {
5049
+ body: { data: { type: "scheduling_event_type", attributes } }
5050
+ },
5051
+ options
5052
+ );
5053
+ },
5054
+ /** Update an event type */
5055
+ update: async (id, attributes, options) => {
5056
+ return rb.execute(
5057
+ patchSchedulingEventTypesById,
5058
+ {
5059
+ path: { id },
5060
+ body: { data: { id, type: "scheduling_event_type", attributes } }
5061
+ },
5062
+ options
5063
+ );
5064
+ }
5065
+ },
5066
+ /**
5067
+ * Events — scheduled occurrences
5068
+ */
5069
+ events: {
5070
+ /** List events with optional pagination */
5071
+ list: async (options) => {
5072
+ return rb.execute(
5073
+ getSchedulingEvents,
5074
+ buildPageQuery(options?.page, options?.pageSize),
5075
+ options
5076
+ );
5077
+ },
5078
+ /** List all events with automatic pagination */
5079
+ listAll: async (options) => {
5080
+ return paginateToArray(
5081
+ rb.createPaginatedFetcher(
5082
+ getSchedulingEvents,
5083
+ (page, pageSize) => ({
5084
+ query: { page: { number: page, size: pageSize } }
5085
+ }),
5086
+ options
5087
+ )
5088
+ );
5089
+ },
5090
+ /** Get an event by ID */
5091
+ get: async (id, options) => {
5092
+ return rb.execute(
5093
+ getSchedulingEventsById,
5094
+ { path: { id } },
5095
+ options
5096
+ );
5097
+ },
5098
+ /**
5099
+ * Create an internal event directly.
5100
+ * Use for meetings between known users in the workspace.
5101
+ */
5102
+ create: async (attributes, options) => {
5103
+ return rb.execute(
5104
+ postSchedulingEvents,
5105
+ {
5106
+ body: { data: { type: "scheduling_event", attributes } }
5107
+ },
5108
+ options
5109
+ );
5110
+ },
5111
+ /** Update an event */
5112
+ update: async (id, attributes, options) => {
5113
+ return rb.execute(
5114
+ patchSchedulingEventsById,
5115
+ {
5116
+ path: { id },
5117
+ body: { data: { id, type: "scheduling_event", attributes } }
5118
+ },
5119
+ options
5120
+ );
5121
+ }
5122
+ },
5123
+ /**
5124
+ * Participants — people attending events
5125
+ */
5126
+ participants: {
5127
+ /** List participants with optional pagination */
5128
+ list: async (options) => {
5129
+ return rb.execute(
5130
+ getSchedulingParticipants,
5131
+ buildPageQuery(options?.page, options?.pageSize),
5132
+ options
5133
+ );
5134
+ },
5135
+ /** List all participants with automatic pagination */
5136
+ listAll: async (options) => {
5137
+ return paginateToArray(
5138
+ rb.createPaginatedFetcher(
5139
+ getSchedulingParticipants,
5140
+ (page, pageSize) => ({
5141
+ query: { page: { number: page, size: pageSize } }
5142
+ }),
5143
+ options
5144
+ )
5145
+ );
5146
+ },
5147
+ /** Get a participant by ID */
5148
+ get: async (id, options) => {
5149
+ return rb.execute(
5150
+ getSchedulingParticipantsById,
5151
+ { path: { id } },
5152
+ options
5153
+ );
5154
+ },
5155
+ /** Add a participant to an event */
5156
+ create: async (attributes, options) => {
5157
+ return rb.execute(
5158
+ postSchedulingParticipants,
5159
+ {
5160
+ body: { data: { type: "scheduling_participant", attributes } }
5161
+ },
5162
+ options
5163
+ );
5164
+ },
5165
+ /** Update a participant (e.g., confirm attendance, respond to invite) */
5166
+ update: async (id, attributes, options) => {
5167
+ return rb.execute(
5168
+ patchSchedulingParticipantsById,
5169
+ {
5170
+ path: { id },
5171
+ body: { data: { id, type: "scheduling_participant", attributes } }
5172
+ },
5173
+ options
5174
+ );
5175
+ }
5176
+ },
5177
+ /**
5178
+ * Bookings — external party requests for appointments
5179
+ */
5180
+ bookings: {
5181
+ /** List bookings with optional pagination */
5182
+ list: async (options) => {
5183
+ return rb.execute(
5184
+ getSchedulingBookings,
5185
+ buildPageQuery(options?.page, options?.pageSize),
5186
+ options
5187
+ );
5188
+ },
5189
+ /** List all bookings with automatic pagination */
5190
+ listAll: async (options) => {
5191
+ return paginateToArray(
5192
+ rb.createPaginatedFetcher(
5193
+ getSchedulingBookings,
5194
+ (page, pageSize) => ({
5195
+ query: { page: { number: page, size: pageSize } }
5196
+ }),
5197
+ options
5198
+ )
5199
+ );
5200
+ },
5201
+ /** Get a booking by ID */
5202
+ get: async (id, options) => {
5203
+ return rb.execute(
5204
+ getSchedulingBookingsById,
5205
+ { path: { id } },
5206
+ options
5207
+ );
5208
+ },
5209
+ /**
5210
+ * Create a booking request.
5211
+ * Use when someone outside the platform requests an appointment.
5212
+ * @example
5213
+ * ```typescript
5214
+ * const booking = await client.scheduling.bookings.create({
5215
+ * event_type_id: 'event_123',
5216
+ * start_time: '2025-03-01T10:00:00Z',
5217
+ * booker_name: 'John Doe',
5218
+ * booker_email: 'john@example.com',
5219
+ * });
5220
+ * ```
5221
+ */
5222
+ create: async (attributes, options) => {
5223
+ return rb.execute(
5224
+ postSchedulingBookings,
5225
+ {
5226
+ body: { data: { type: "scheduling_booking", attributes } }
5227
+ },
5228
+ options
5229
+ );
5230
+ },
5231
+ /**
5232
+ * Confirm a pending booking.
5233
+ * For EventTypes with requires_approval=true.
5234
+ */
5235
+ confirm: async (id, options) => {
5236
+ return rb.execute(
5237
+ patchSchedulingBookingsSchedulingBookingsByIdConfirm,
5238
+ { path: { id }, body: {} },
5239
+ options
5240
+ );
5241
+ },
5242
+ /**
5243
+ * Cancel or reject a booking.
5244
+ */
5245
+ cancel: async (id, attributes, options) => {
5246
+ return rb.execute(
5247
+ patchSchedulingBookingsSchedulingBookingsByIdCancel,
5248
+ {
5249
+ path: { id },
5250
+ body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5251
+ },
5252
+ options
5253
+ );
5254
+ },
5255
+ /**
5256
+ * Reschedule a booking to a new time.
5257
+ */
5258
+ reschedule: async (id, attributes, options) => {
5259
+ return rb.execute(
5260
+ patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5261
+ {
5262
+ path: { id },
5263
+ body: { data: { type: "scheduling_booking", attributes } }
5264
+ },
5265
+ options
5266
+ );
5267
+ }
5268
+ },
5269
+ /**
5270
+ * Calendar Syncs — external calendar integrations
5271
+ */
5272
+ calendarSyncs: {
5273
+ /** List calendar syncs with optional pagination */
5274
+ list: async (options) => {
5275
+ return rb.execute(
5276
+ getSchedulingCalendarSyncs,
4489
5277
  buildPageQuery(options?.page, options?.pageSize),
4490
5278
  options
4491
5279
  );
4492
5280
  },
4493
- listAllMe: async (options) => {
5281
+ /** List all calendar syncs with automatic pagination */
5282
+ listAll: async (options) => {
4494
5283
  return paginateToArray(
4495
5284
  rb.createPaginatedFetcher(
4496
- getInvitationsMe,
5285
+ getSchedulingCalendarSyncs,
4497
5286
  (page, pageSize) => ({
4498
5287
  query: { page: { number: page, size: pageSize } }
4499
5288
  }),
@@ -4501,22 +5290,63 @@ function createPlatformNamespace(rb) {
4501
5290
  )
4502
5291
  );
4503
5292
  },
5293
+ /** Get a calendar sync by ID */
5294
+ get: async (id, options) => {
5295
+ return rb.execute(
5296
+ getSchedulingCalendarSyncsById,
5297
+ { path: { id } },
5298
+ options
5299
+ );
5300
+ },
5301
+ /**
5302
+ * Create a calendar sync.
5303
+ * For bi-directional sync with external calendars (Google, Outlook).
5304
+ */
4504
5305
  create: async (attributes, options) => {
4505
5306
  return rb.execute(
4506
- postInvitations,
4507
- { body: { data: { type: "invitation", attributes } } },
5307
+ postSchedulingCalendarSyncs,
5308
+ {
5309
+ body: { data: { type: "scheduling_calendar_sync", attributes } }
5310
+ },
4508
5311
  options
4509
5312
  );
4510
5313
  },
5314
+ /** Update a calendar sync */
4511
5315
  update: async (id, attributes, options) => {
4512
5316
  return rb.execute(
4513
- patchInvitationsByIdDecline,
5317
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsById,
4514
5318
  {
4515
5319
  path: { id },
4516
- body: { data: { id, type: "invitation", attributes } }
5320
+ body: {
5321
+ data: { id, type: "scheduling_calendar_sync", attributes }
5322
+ }
4517
5323
  },
4518
5324
  options
4519
5325
  );
5326
+ },
5327
+ /** Delete a calendar sync */
5328
+ delete: async (id, options) => {
5329
+ return rb.executeDelete(
5330
+ deleteSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5331
+ { path: { id } },
5332
+ options
5333
+ );
5334
+ },
5335
+ /** Pause a calendar sync (stops pushing/pulling) */
5336
+ pause: async (id, options) => {
5337
+ return rb.execute(
5338
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5339
+ { path: { id }, body: {} },
5340
+ options
5341
+ );
5342
+ },
5343
+ /** Resume a paused calendar sync */
5344
+ resume: async (id, options) => {
5345
+ return rb.execute(
5346
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5347
+ { path: { id }, body: {} },
5348
+ options
5349
+ );
4520
5350
  }
4521
5351
  }
4522
5352
  };
@@ -4588,29 +5418,15 @@ function createStorageNamespace(rb) {
4588
5418
  /** Generate a presigned upload URL for direct-to-storage uploads */
4589
5419
  signUpload: async (attributes, options) => {
4590
5420
  return rb.execute(
4591
- postStorageSignUpload,
4592
- {
4593
- body: { data: { type: "signed_url", attributes: attributes ?? {} } }
4594
- },
4595
- options
4596
- );
4597
- },
4598
- /** Generate a presigned download URL for accessing stored objects */
4599
- signDownload: async (attributes, options) => {
4600
- return rb.execute(
4601
- postStorageSignDownload,
5421
+ postDocumentsPresignedUpload,
4602
5422
  {
4603
- body: { data: { type: "signed_url", attributes: attributes ?? {} } }
5423
+ body: {
5424
+ data: { type: "presigned_upload", attributes: attributes ?? {} }
5425
+ }
4604
5426
  },
4605
5427
  options
4606
5428
  );
4607
5429
  },
4608
- objects: {
4609
- /** List storage objects */
4610
- list: async (options) => {
4611
- return rb.execute(getObjects, {}, options);
4612
- }
4613
- },
4614
5430
  buckets: {
4615
5431
  list: async (options) => {
4616
5432
  return rb.execute(
@@ -4772,20 +5588,20 @@ function createThreadsNamespace(rb) {
4772
5588
  };
4773
5589
  }
4774
5590
 
4775
- // src/namespaces/webhooks-ns.ts
4776
- function createWebhooksNamespace(rb) {
5591
+ // src/namespaces/training.ts
5592
+ function createTrainingNamespace(rb) {
4777
5593
  return {
4778
- configs: {
5594
+ examples: {
4779
5595
  delete: async (id, options) => {
4780
5596
  return rb.executeDelete(
4781
- deleteWebhookConfigsById,
5597
+ deleteTrainingExamplesById,
4782
5598
  { path: { id } },
4783
5599
  options
4784
5600
  );
4785
5601
  },
4786
5602
  list: async (options) => {
4787
5603
  return rb.execute(
4788
- getWebhookConfigs,
5604
+ getTrainingExamples,
4789
5605
  buildPageQuery(options?.page, options?.pageSize),
4790
5606
  options
4791
5607
  );
@@ -4793,7 +5609,7 @@ function createWebhooksNamespace(rb) {
4793
5609
  listAll: async (options) => {
4794
5610
  return paginateToArray(
4795
5611
  rb.createPaginatedFetcher(
4796
- getWebhookConfigs,
5612
+ getTrainingExamples,
4797
5613
  (page, pageSize) => ({
4798
5614
  query: { page: { number: page, size: pageSize } }
4799
5615
  }),
@@ -4801,112 +5617,257 @@ function createWebhooksNamespace(rb) {
4801
5617
  )
4802
5618
  );
4803
5619
  },
5620
+ get: async (id, options) => {
5621
+ return rb.execute(
5622
+ getTrainingExamplesById,
5623
+ { path: { id } },
5624
+ options
5625
+ );
5626
+ },
4804
5627
  create: async (attributes, options) => {
4805
5628
  return rb.execute(
4806
- postWebhookConfigs,
4807
- { body: { data: { type: "webhook_config", attributes } } },
5629
+ postTrainingExamplesBulkDelete,
5630
+ { body: { data: { type: "training_example", attributes } } },
4808
5631
  options
4809
5632
  );
4810
5633
  },
4811
5634
  update: async (id, attributes, options) => {
4812
5635
  return rb.execute(
4813
- patchWebhookConfigsById,
5636
+ patchTrainingExamplesById,
4814
5637
  {
4815
5638
  path: { id },
4816
- body: { data: { id, type: "webhook_config", attributes } }
5639
+ body: { data: { id, type: "training_example", attributes } }
4817
5640
  },
4818
5641
  options
4819
5642
  );
4820
5643
  },
4821
- test: async (id, options) => {
5644
+ bulkCreate: async (options) => {
4822
5645
  return rb.execute(
4823
- postWebhookConfigsByIdTest,
4824
- { path: { id }, body: {} },
5646
+ postTrainingExamplesBulkDelete,
5647
+ {},
4825
5648
  options
4826
5649
  );
4827
5650
  },
4828
- bulkEnable: async (options) => {
5651
+ bulkDestroy: async (options) => {
4829
5652
  return rb.execute(
4830
- postWebhookConfigsBulkEnable,
5653
+ postTrainingExamplesBulkDelete,
4831
5654
  {},
4832
5655
  options
4833
5656
  );
4834
5657
  },
4835
- bulkDisable: async (options) => {
5658
+ searchByVector: async (options) => {
4836
5659
  return rb.execute(
4837
- postWebhookConfigsBulkDisable,
5660
+ postTrainingExamplesBulkDelete,
4838
5661
  {},
4839
5662
  options
4840
5663
  );
4841
- },
4842
- /** Replay historical events to this webhook */
4843
- replay: async (id, options) => {
5664
+ }
5665
+ },
5666
+ sessions: {
5667
+ listAgentsSessions: async (options) => {
4844
5668
  return rb.execute(
4845
- postWebhookConfigsByIdReplay,
4846
- { path: { id }, body: {} },
5669
+ getTrainingSessionsAgentsByAgentIdSessions,
5670
+ buildPageQuery(options?.page, options?.pageSize),
4847
5671
  options
4848
5672
  );
4849
5673
  },
5674
+ listAllAgentsSessions: async (options) => {
5675
+ return paginateToArray(
5676
+ rb.createPaginatedFetcher(
5677
+ getTrainingSessionsAgentsByAgentIdSessions,
5678
+ (page, pageSize) => ({
5679
+ query: { page: { number: page, size: pageSize } }
5680
+ }),
5681
+ options
5682
+ )
5683
+ );
5684
+ },
4850
5685
  get: async (id, options) => {
4851
5686
  return rb.execute(
4852
- getWebhookConfigsById,
5687
+ getTrainingSessionsById,
4853
5688
  { path: { id } },
4854
5689
  options
4855
5690
  );
4856
5691
  },
4857
- /** Rotate the signing secret for a webhook config */
4858
- rotateSecret: async (id, options) => {
5692
+ create: async (attributes, options) => {
4859
5693
  return rb.execute(
4860
- patchWebhookConfigsByIdRotateSecret,
4861
- { path: { id }, body: {} },
5694
+ getTrainingSessionsAgentsByAgentIdSessions,
5695
+ { body: { data: { type: "training_session", attributes } } },
5696
+ options
5697
+ );
5698
+ },
5699
+ delete: async (id, options) => {
5700
+ return rb.executeDelete(
5701
+ deleteTrainingSessionsById,
5702
+ { path: { id } },
5703
+ options
5704
+ );
5705
+ },
5706
+ update: async (agentId, attributes, options) => {
5707
+ return rb.execute(
5708
+ getTrainingSessionsAgentsByAgentIdSessions,
5709
+ {
5710
+ path: { agent_id: agentId },
5711
+ body: { data: { type: "training_session", attributes } }
5712
+ },
4862
5713
  options
4863
5714
  );
4864
5715
  }
5716
+ }
5717
+ };
5718
+ }
5719
+
5720
+ // src/namespaces/voice.ts
5721
+ function createVoiceNamespace(rb) {
5722
+ return {
5723
+ /**
5724
+ * Transcribe an audio file via the voice transcription endpoint.
5725
+ * Accepts File or Blob. Supported formats: mp3, ogg, wav, m4a, webm, flac, aac.
5726
+ *
5727
+ * @param audio - Audio file to transcribe (max 200 MB)
5728
+ * @param params - Optional transcription parameters
5729
+ * @param options - Request options (signal, headers, etc.)
5730
+ */
5731
+ transcribe: async (audio, params, options) => {
5732
+ const form = new FormData();
5733
+ form.append("audio", audio);
5734
+ if (params?.language) form.append("language", params.language);
5735
+ if (params?.modelSize) form.append("model_size", params.modelSize);
5736
+ if (params?.phiMode) form.append("phi_mode", params.phiMode);
5737
+ if (params?.phiKey) form.append("phi_key", params.phiKey);
5738
+ return rb.rawPostMultipart(
5739
+ "/voice/transcribe",
5740
+ form,
5741
+ options
5742
+ );
4865
5743
  },
4866
- deliveries: {
5744
+ /**
5745
+ * Sessions — voice session management
5746
+ */
5747
+ sessions: {
5748
+ /** List voice sessions with pagination */
4867
5749
  list: async (options) => {
4868
5750
  return rb.execute(
4869
- getWebhookDeliveries,
5751
+ getVoiceSessions,
4870
5752
  buildPageQuery(options?.page, options?.pageSize),
4871
5753
  options
4872
5754
  );
4873
5755
  },
4874
- listAll: async (options) => {
4875
- return paginateToArray(
4876
- rb.createPaginatedFetcher(
4877
- getWebhookDeliveries,
4878
- (page, pageSize) => ({
4879
- query: { page: { number: page, size: pageSize } }
4880
- }),
4881
- options
4882
- )
5756
+ /** Get a session by ID */
5757
+ get: async (id, options) => {
5758
+ return rb.execute(
5759
+ getVoiceSessionsById,
5760
+ { path: { id } },
5761
+ options
4883
5762
  );
4884
5763
  },
4885
- create: async (attributes, options) => {
5764
+ /** List my voice sessions */
5765
+ listMine: async (options) => {
4886
5766
  return rb.execute(
4887
- postWebhookDeliveriesBulkRetry,
4888
- { body: { data: { type: "webhook_delivery", attributes } } },
5767
+ getVoiceSessionsMine,
5768
+ buildPageQuery(options?.page, options?.pageSize),
4889
5769
  options
4890
5770
  );
4891
5771
  },
4892
- retry: async (options) => {
5772
+ /** List sessions by workspace */
5773
+ listByWorkspace: async (workspaceId, options) => {
4893
5774
  return rb.execute(
4894
- postWebhookDeliveriesBulkRetry,
4895
- {},
5775
+ getVoiceSessionsWorkspaceByWorkspaceId,
5776
+ {
5777
+ path: { workspace_id: workspaceId },
5778
+ ...buildPageQuery(options?.page, options?.pageSize)
5779
+ },
4896
5780
  options
4897
5781
  );
4898
5782
  },
4899
- bulkRetry: async (options) => {
5783
+ /**
5784
+ * Start a new voice session with LiveKit room provisioning.
5785
+ *
5786
+ * @param params - Session parameters
5787
+ * @param params.phiKey - AES-256 encryption key for PHI (Protected Health
5788
+ * Information), encoded as Base64 (32 raw bytes). Required when
5789
+ * `phiMode` is `"tokenize_encrypt"`.
5790
+ * @param options - Request options
5791
+ *
5792
+ * @remarks
5793
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5794
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5795
+ * - Do not log, store in `localStorage`, or include in error reports.
5796
+ * - Treat it with the same care as a password or private key.
5797
+ * - The server never persists this key; it is used only within the
5798
+ * lifetime of the request.
5799
+ */
5800
+ start: async (params, options) => {
4900
5801
  return rb.execute(
4901
- postWebhookDeliveriesBulkRetry,
4902
- {},
5802
+ postVoiceSessions,
5803
+ {
5804
+ body: {
5805
+ data: {
5806
+ type: "voice_session",
5807
+ attributes: {
5808
+ thread_id: params?.threadId,
5809
+ blueprint_id: params?.blueprintId,
5810
+ blueprint_mode: params?.blueprintMode,
5811
+ phi_mode: params?.phiMode,
5812
+ phi_key: params?.phiKey,
5813
+ patient_id: params?.patientId
5814
+ }
5815
+ }
5816
+ }
5817
+ },
4903
5818
  options
4904
5819
  );
4905
5820
  },
4906
- get: async (id, options) => {
5821
+ /** End a voice session and release the LiveKit room */
5822
+ stop: async (id, options) => {
4907
5823
  return rb.execute(
4908
- getWebhookDeliveriesById,
4909
- { path: { id } },
5824
+ patchVoiceSessionsByIdStop,
5825
+ { path: { id }, body: { data: { id, type: "voice_session" } } },
5826
+ options
5827
+ );
5828
+ },
5829
+ /**
5830
+ * Dispatch the accumulated session transcript to the blueprint or chat
5831
+ * pipeline. The transcript may contain PHI (Protected Health Information)
5832
+ * depending on the session's `phiMode`.
5833
+ *
5834
+ * @param id - Voice session ID
5835
+ * @param params - Finalization parameters
5836
+ * @param params.phiKey - AES-256 encryption key for PHI, encoded as
5837
+ * Base64 (32 raw bytes). Overrides the key supplied at session start.
5838
+ * Required when `phiMode` is `"tokenize_encrypt"`.
5839
+ * @param options - Request options
5840
+ *
5841
+ * @remarks
5842
+ * **Security — transcript PHI:** The finalized transcript submitted to
5843
+ * this endpoint may contain Protected Health Information. Ensure the
5844
+ * request is made over HTTPS only.
5845
+ *
5846
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5847
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5848
+ * - Do not log, store in `localStorage`, or include in error reports.
5849
+ * - Treat it with the same care as a password or private key.
5850
+ * - The server never persists this key; it is used only within the
5851
+ * lifetime of the request.
5852
+ */
5853
+ finalize: async (id, params, options) => {
5854
+ return rb.execute(
5855
+ patchVoiceSessionsByIdFinalize,
5856
+ {
5857
+ path: { id },
5858
+ body: {
5859
+ data: {
5860
+ id,
5861
+ type: "voice_session",
5862
+ attributes: {
5863
+ blueprint_id: params?.blueprintId,
5864
+ phi_mode: params?.phiMode,
5865
+ phi_key: params?.phiKey,
5866
+ patient_id: params?.patientId
5867
+ }
5868
+ }
5869
+ }
5870
+ },
4910
5871
  options
4911
5872
  );
4912
5873
  }
@@ -4914,26 +5875,21 @@ function createWebhooksNamespace(rb) {
4914
5875
  };
4915
5876
  }
4916
5877
 
4917
- // src/namespaces/scheduling.ts
4918
- function createSchedulingNamespace(rb) {
5878
+ // src/namespaces/watcher.ts
5879
+ function createWatcherNamespace(rb) {
4919
5880
  return {
4920
- /**
4921
- * Event Types — templates for bookable events
4922
- */
4923
- eventTypes: {
4924
- /** List event types with optional pagination */
5881
+ claims: {
4925
5882
  list: async (options) => {
4926
5883
  return rb.execute(
4927
- getSchedulingEventTypes,
5884
+ getWatcherClaims,
4928
5885
  buildPageQuery(options?.page, options?.pageSize),
4929
5886
  options
4930
5887
  );
4931
5888
  },
4932
- /** List all event types with automatic pagination */
4933
5889
  listAll: async (options) => {
4934
5890
  return paginateToArray(
4935
5891
  rb.createPaginatedFetcher(
4936
- getSchedulingEventTypes,
5892
+ getWatcherClaims,
4937
5893
  (page, pageSize) => ({
4938
5894
  query: { page: { number: page, size: pageSize } }
4939
5895
  }),
@@ -4941,65 +5897,68 @@ function createSchedulingNamespace(rb) {
4941
5897
  )
4942
5898
  );
4943
5899
  },
4944
- /** Get an event type by ID */
4945
- get: async (id, options) => {
4946
- return rb.execute(
4947
- getSchedulingEventTypesById,
4948
- { path: { id } },
4949
- options
4950
- );
5900
+ claim: async (options) => {
5901
+ return rb.execute(postWatcherClaims, {}, options);
4951
5902
  },
4952
- /**
4953
- * Create a new event type.
4954
- * @example
4955
- * ```typescript
4956
- * const client = new GptClient({ apiKey: 'sk_tenant_...' });
4957
- * const eventType = await client.scheduling.eventTypes.create({
4958
- * name: '30-Minute Consultation',
4959
- * slug: '30min-consult',
4960
- * duration_minutes: 30,
4961
- * location_type: 'video',
4962
- * });
4963
- * ```
4964
- */
4965
5903
  create: async (attributes, options) => {
4966
5904
  return rb.execute(
4967
- postSchedulingEventTypes,
4968
- {
4969
- body: { data: { type: "scheduling_event_type", attributes } }
4970
- },
5905
+ postWatcherClaims,
5906
+ { body: { data: { type: "watcher_claim", attributes } } },
4971
5907
  options
4972
5908
  );
4973
5909
  },
4974
- /** Update an event type */
4975
5910
  update: async (id, attributes, options) => {
4976
5911
  return rb.execute(
4977
- patchSchedulingEventTypesById,
5912
+ patchWatcherClaimsById,
4978
5913
  {
4979
5914
  path: { id },
4980
- body: { data: { id, type: "scheduling_event_type", attributes } }
5915
+ body: { data: { id, type: "watcher_claim", attributes } }
4981
5916
  },
4982
5917
  options
4983
5918
  );
5919
+ },
5920
+ delete: async (id, options) => {
5921
+ return rb.executeDelete(
5922
+ getWatcherClaimsById,
5923
+ { path: { id } },
5924
+ options
5925
+ );
5926
+ },
5927
+ /** Register a completed claim for a document (used by ProcessDocument worker) */
5928
+ registerCompleted: async (options) => {
5929
+ return rb.execute(postWatcherClaims, {}, options);
5930
+ },
5931
+ /** Get ingestion status for a workspace */
5932
+ readStatus: async (options) => {
5933
+ return rb.execute(postWatcherClaims, {}, options);
5934
+ },
5935
+ get: async (id, options) => {
5936
+ return rb.execute(
5937
+ getWatcherClaimsById,
5938
+ { path: { id } },
5939
+ options
5940
+ );
4984
5941
  }
4985
5942
  },
4986
- /**
4987
- * Events — scheduled occurrences
4988
- */
4989
5943
  events: {
4990
- /** List events with optional pagination */
5944
+ create: async (attributes, options) => {
5945
+ return rb.execute(
5946
+ postWatcherEvents,
5947
+ { body: { data: { type: "watcher_event", attributes } } },
5948
+ options
5949
+ );
5950
+ },
4991
5951
  list: async (options) => {
4992
5952
  return rb.execute(
4993
- getSchedulingEvents,
5953
+ getWatcherEvents,
4994
5954
  buildPageQuery(options?.page, options?.pageSize),
4995
5955
  options
4996
5956
  );
4997
5957
  },
4998
- /** List all events with automatic pagination */
4999
5958
  listAll: async (options) => {
5000
5959
  return paginateToArray(
5001
5960
  rb.createPaginatedFetcher(
5002
- getSchedulingEvents,
5961
+ getWatcherEvents,
5003
5962
  (page, pageSize) => ({
5004
5963
  query: { page: { number: page, size: pageSize } }
5005
5964
  }),
@@ -5007,56 +5966,46 @@ function createSchedulingNamespace(rb) {
5007
5966
  )
5008
5967
  );
5009
5968
  },
5010
- /** Get an event by ID */
5969
+ delete: async (options) => {
5970
+ return rb.executeDelete(getWatcherEvents, { path: {} }, options);
5971
+ },
5972
+ /** Create multiple events in batch */
5973
+ batchCreate: async (options) => {
5974
+ return rb.execute(postWatcherEvents, {}, options);
5975
+ },
5011
5976
  get: async (id, options) => {
5012
5977
  return rb.execute(
5013
- getSchedulingEventsById,
5978
+ getWatcherEventsById,
5014
5979
  { path: { id } },
5015
5980
  options
5016
5981
  );
5017
- },
5018
- /**
5019
- * Create an internal event directly.
5020
- * Use for meetings between known users in the workspace.
5021
- */
5022
- create: async (attributes, options) => {
5023
- return rb.execute(
5024
- postSchedulingEvents,
5025
- {
5026
- body: { data: { type: "scheduling_event", attributes } }
5027
- },
5982
+ }
5983
+ }
5984
+ };
5985
+ }
5986
+
5987
+ // src/namespaces/webhooks-ns.ts
5988
+ function createWebhooksNamespace(rb) {
5989
+ return {
5990
+ configs: {
5991
+ delete: async (id, options) => {
5992
+ return rb.executeDelete(
5993
+ deleteWebhookConfigsById,
5994
+ { path: { id } },
5028
5995
  options
5029
5996
  );
5030
5997
  },
5031
- /** Update an event */
5032
- update: async (id, attributes, options) => {
5033
- return rb.execute(
5034
- patchSchedulingEventsById,
5035
- {
5036
- path: { id },
5037
- body: { data: { id, type: "scheduling_event", attributes } }
5038
- },
5039
- options
5040
- );
5041
- }
5042
- },
5043
- /**
5044
- * Participants — people attending events
5045
- */
5046
- participants: {
5047
- /** List participants with optional pagination */
5048
5998
  list: async (options) => {
5049
5999
  return rb.execute(
5050
- getSchedulingParticipants,
6000
+ getWebhookConfigs,
5051
6001
  buildPageQuery(options?.page, options?.pageSize),
5052
6002
  options
5053
6003
  );
5054
6004
  },
5055
- /** List all participants with automatic pagination */
5056
6005
  listAll: async (options) => {
5057
6006
  return paginateToArray(
5058
6007
  rb.createPaginatedFetcher(
5059
- getSchedulingParticipants,
6008
+ getWebhookConfigs,
5060
6009
  (page, pageSize) => ({
5061
6010
  query: { page: { number: page, size: pageSize } }
5062
6011
  }),
@@ -5064,145 +6013,80 @@ function createSchedulingNamespace(rb) {
5064
6013
  )
5065
6014
  );
5066
6015
  },
5067
- /** Get a participant by ID */
5068
- get: async (id, options) => {
5069
- return rb.execute(
5070
- getSchedulingParticipantsById,
5071
- { path: { id } },
5072
- options
5073
- );
5074
- },
5075
- /** Add a participant to an event */
5076
6016
  create: async (attributes, options) => {
5077
6017
  return rb.execute(
5078
- postSchedulingParticipants,
5079
- {
5080
- body: { data: { type: "scheduling_participant", attributes } }
5081
- },
6018
+ postWebhookConfigs,
6019
+ { body: { data: { type: "webhook_config", attributes } } },
5082
6020
  options
5083
6021
  );
5084
6022
  },
5085
- /** Update a participant (e.g., confirm attendance, respond to invite) */
5086
6023
  update: async (id, attributes, options) => {
5087
6024
  return rb.execute(
5088
- patchSchedulingParticipantsById,
6025
+ patchWebhookConfigsById,
5089
6026
  {
5090
6027
  path: { id },
5091
- body: { data: { id, type: "scheduling_participant", attributes } }
6028
+ body: { data: { id, type: "webhook_config", attributes } }
5092
6029
  },
5093
6030
  options
5094
6031
  );
5095
- }
5096
- },
5097
- /**
5098
- * Bookings — external party requests for appointments
5099
- */
5100
- bookings: {
5101
- /** List bookings with optional pagination */
5102
- list: async (options) => {
6032
+ },
6033
+ test: async (id, options) => {
5103
6034
  return rb.execute(
5104
- getSchedulingBookings,
5105
- buildPageQuery(options?.page, options?.pageSize),
6035
+ postWebhookConfigsByIdTest,
6036
+ { path: { id }, body: {} },
5106
6037
  options
5107
6038
  );
5108
6039
  },
5109
- /** List all bookings with automatic pagination */
5110
- listAll: async (options) => {
5111
- return paginateToArray(
5112
- rb.createPaginatedFetcher(
5113
- getSchedulingBookings,
5114
- (page, pageSize) => ({
5115
- query: { page: { number: page, size: pageSize } }
5116
- }),
5117
- options
5118
- )
5119
- );
5120
- },
5121
- /** Get a booking by ID */
5122
- get: async (id, options) => {
6040
+ bulkEnable: async (options) => {
5123
6041
  return rb.execute(
5124
- getSchedulingBookingsById,
5125
- { path: { id } },
6042
+ postWebhookConfigsBulkEnable,
6043
+ {},
5126
6044
  options
5127
6045
  );
5128
6046
  },
5129
- /**
5130
- * Create a booking request.
5131
- * Use when someone outside the platform requests an appointment.
5132
- * @example
5133
- * ```typescript
5134
- * const booking = await client.scheduling.bookings.create({
5135
- * event_type_id: 'event_123',
5136
- * start_time: '2025-03-01T10:00:00Z',
5137
- * booker_name: 'John Doe',
5138
- * booker_email: 'john@example.com',
5139
- * });
5140
- * ```
5141
- */
5142
- create: async (attributes, options) => {
6047
+ bulkDisable: async (options) => {
5143
6048
  return rb.execute(
5144
- postSchedulingBookings,
5145
- {
5146
- body: { data: { type: "scheduling_booking", attributes } }
5147
- },
6049
+ postWebhookConfigsBulkDisable,
6050
+ {},
5148
6051
  options
5149
6052
  );
5150
6053
  },
5151
- /**
5152
- * Confirm a pending booking.
5153
- * For EventTypes with requires_approval=true.
5154
- */
5155
- confirm: async (id, options) => {
6054
+ /** Replay historical events to this webhook */
6055
+ replay: async (id, options) => {
5156
6056
  return rb.execute(
5157
- patchSchedulingBookingsSchedulingBookingsByIdConfirm,
6057
+ postWebhookConfigsByIdReplay,
5158
6058
  { path: { id }, body: {} },
5159
6059
  options
5160
6060
  );
5161
6061
  },
5162
- /**
5163
- * Cancel or reject a booking.
5164
- */
5165
- cancel: async (id, attributes, options) => {
6062
+ get: async (id, options) => {
5166
6063
  return rb.execute(
5167
- patchSchedulingBookingsSchedulingBookingsByIdCancel,
5168
- {
5169
- path: { id },
5170
- body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5171
- },
6064
+ getWebhookConfigsById,
6065
+ { path: { id } },
5172
6066
  options
5173
6067
  );
5174
6068
  },
5175
- /**
5176
- * Reschedule a booking to a new time.
5177
- */
5178
- reschedule: async (id, attributes, options) => {
6069
+ /** Rotate the signing secret for a webhook config */
6070
+ rotateSecret: async (id, options) => {
5179
6071
  return rb.execute(
5180
- patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5181
- {
5182
- path: { id },
5183
- body: { data: { type: "scheduling_booking", attributes } }
5184
- },
6072
+ patchWebhookConfigsByIdRotateSecret,
6073
+ { path: { id }, body: {} },
5185
6074
  options
5186
6075
  );
5187
6076
  }
5188
6077
  },
5189
- /**
5190
- * Calendar Syncs — external calendar integrations
5191
- */
5192
- calendarSyncs: {
5193
- /** List calendar syncs with optional pagination */
6078
+ deliveries: {
5194
6079
  list: async (options) => {
5195
6080
  return rb.execute(
5196
- getSchedulingCalendarSyncs,
6081
+ getWebhookDeliveries,
5197
6082
  buildPageQuery(options?.page, options?.pageSize),
5198
6083
  options
5199
6084
  );
5200
6085
  },
5201
- /** List all calendar syncs with automatic pagination */
5202
6086
  listAll: async (options) => {
5203
6087
  return paginateToArray(
5204
6088
  rb.createPaginatedFetcher(
5205
- getSchedulingCalendarSyncs,
6089
+ getWebhookDeliveries,
5206
6090
  (page, pageSize) => ({
5207
6091
  query: { page: { number: page, size: pageSize } }
5208
6092
  }),
@@ -5210,61 +6094,31 @@ function createSchedulingNamespace(rb) {
5210
6094
  )
5211
6095
  );
5212
6096
  },
5213
- /** Get a calendar sync by ID */
5214
- get: async (id, options) => {
5215
- return rb.execute(
5216
- getSchedulingCalendarSyncsById,
5217
- { path: { id } },
5218
- options
5219
- );
5220
- },
5221
- /**
5222
- * Create a calendar sync.
5223
- * For bi-directional sync with external calendars (Google, Outlook).
5224
- */
5225
6097
  create: async (attributes, options) => {
5226
6098
  return rb.execute(
5227
- postSchedulingCalendarSyncs,
5228
- {
5229
- body: { data: { type: "scheduling_calendar_sync", attributes } }
5230
- },
6099
+ postWebhookDeliveriesBulkRetry,
6100
+ { body: { data: { type: "webhook_delivery", attributes } } },
5231
6101
  options
5232
6102
  );
5233
6103
  },
5234
- /** Update a calendar sync */
5235
- update: async (id, attributes, options) => {
6104
+ retry: async (options) => {
5236
6105
  return rb.execute(
5237
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5238
- {
5239
- path: { id },
5240
- body: {
5241
- data: { id, type: "scheduling_calendar_sync", attributes }
5242
- }
5243
- },
5244
- options
5245
- );
5246
- },
5247
- /** Delete a calendar sync */
5248
- delete: async (id, options) => {
5249
- return rb.executeDelete(
5250
- deleteSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5251
- { path: { id } },
6106
+ postWebhookDeliveriesBulkRetry,
6107
+ {},
5252
6108
  options
5253
6109
  );
5254
6110
  },
5255
- /** Pause a calendar sync (stops pushing/pulling) */
5256
- pause: async (id, options) => {
6111
+ bulkRetry: async (options) => {
5257
6112
  return rb.execute(
5258
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5259
- { path: { id }, body: {} },
6113
+ postWebhookDeliveriesBulkRetry,
6114
+ {},
5260
6115
  options
5261
6116
  );
5262
6117
  },
5263
- /** Resume a paused calendar sync */
5264
- resume: async (id, options) => {
6118
+ get: async (id, options) => {
5265
6119
  return rb.execute(
5266
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5267
- { path: { id }, body: {} },
6120
+ getWebhookDeliveriesById,
6121
+ { path: { id } },
5268
6122
  options
5269
6123
  );
5270
6124
  }
@@ -5452,6 +6306,30 @@ var RequestBuilder = class {
5452
6306
  throw handleApiError(error);
5453
6307
  }
5454
6308
  }
6309
+ /**
6310
+ * Execute a raw multipart/form-data POST request.
6311
+ * Used for file upload endpoints (custom Phoenix controllers).
6312
+ * Content-Type is omitted from headers so the browser sets the correct
6313
+ * multipart boundary automatically from the FormData body.
6314
+ */
6315
+ async rawPostMultipart(url, body, options) {
6316
+ const headers = buildHeaders(this.getHeaders, options);
6317
+ delete headers["Content-Type"];
6318
+ delete headers["content-type"];
6319
+ try {
6320
+ const { data } = await this.requestWithRetry(
6321
+ () => this.clientInstance.post({
6322
+ url,
6323
+ headers,
6324
+ body,
6325
+ ...options?.signal && { signal: options.signal }
6326
+ })
6327
+ );
6328
+ return this.unwrap(data?.data);
6329
+ } catch (error) {
6330
+ throw handleApiError(error);
6331
+ }
6332
+ }
5455
6333
  /**
5456
6334
  * Execute a raw POST request to a custom (non-generated) endpoint.
5457
6335
  * Used for endpoints implemented as custom Phoenix controllers.
@@ -5609,13 +6487,16 @@ var GptClient = class extends BaseClient {
5609
6487
  this.billing = createBillingNamespace(rb);
5610
6488
  this.communication = createCommunicationNamespace(rb);
5611
6489
  this.extraction = createExtractionNamespace(rb);
5612
- this.identity = createIdentityNamespace(rb);
6490
+ this.identity = createIdentityNamespace(rb, this.config?.baseUrl);
5613
6491
  this.platform = createPlatformNamespace(rb);
6492
+ this.scheduling = createSchedulingNamespace(rb);
5614
6493
  this.search = createSearchNamespace(rb);
5615
6494
  this.storage = createStorageNamespace(rb);
5616
6495
  this.threads = createThreadsNamespace(rb);
6496
+ this.training = createTrainingNamespace(rb);
6497
+ this.voice = createVoiceNamespace(rb);
6498
+ this.watcher = createWatcherNamespace(rb);
5617
6499
  this.webhooks = createWebhooksNamespace(rb);
5618
- this.scheduling = createSchedulingNamespace(rb);
5619
6500
  }
5620
6501
  /**
5621
6502
  * Subscribe to SDK lifecycle events.