@gpt-platform/client 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.0";
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,6 +4257,35 @@ var ApiKeyAllocateSchema = z2.object({
4047
4257
  amount: z2.number().positive(),
4048
4258
  description: z2.string().min(1)
4049
4259
  });
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
+ });
4050
4289
  function createIdentityNamespace(rb) {
4051
4290
  return {
4052
4291
  /** Login with email and password — returns a token object */
@@ -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
  },
@@ -4518,12 +4868,440 @@ function createPlatformNamespace(rb) {
4518
4868
  options
4519
4869
  );
4520
4870
  }
4521
- }
4522
- };
4523
- }
4524
-
4525
- // src/namespaces/search.ts
4526
- function createSearchNamespace(rb) {
4871
+ },
4872
+ workspaceMembers: {
4873
+ /** List members of a workspace */
4874
+ list: async (workspaceId, options) => {
4875
+ return rb.execute(
4876
+ getWorkspaceMemberships,
4877
+ {
4878
+ query: {
4879
+ filter: { workspace_id: workspaceId },
4880
+ ...buildPageQuery(options?.page, options?.pageSize)?.query
4881
+ }
4882
+ },
4883
+ options
4884
+ );
4885
+ },
4886
+ /** Get a specific workspace member by workspace and user ID */
4887
+ get: async (workspaceId, memberId, options) => {
4888
+ return rb.rawGet(
4889
+ `/workspace-memberships/${workspaceId}/${memberId}`,
4890
+ options
4891
+ );
4892
+ },
4893
+ /** Add a user to a workspace */
4894
+ create: async (workspaceId, attrs, options) => {
4895
+ return rb.execute(
4896
+ postWorkspaceMemberships,
4897
+ {
4898
+ body: {
4899
+ data: {
4900
+ type: "workspace-membership",
4901
+ attributes: { workspace_id: workspaceId, ...attrs }
4902
+ }
4903
+ }
4904
+ },
4905
+ options
4906
+ );
4907
+ },
4908
+ /** Update workspace member permissions or role */
4909
+ update: async (workspaceId, memberId, attrs, options) => {
4910
+ return rb.execute(
4911
+ patchWorkspaceMembershipsByWorkspaceIdByUserId,
4912
+ {
4913
+ path: { workspace_id: workspaceId, user_id: memberId },
4914
+ body: {
4915
+ data: {
4916
+ id: memberId,
4917
+ type: "workspace-membership",
4918
+ attributes: attrs
4919
+ }
4920
+ }
4921
+ },
4922
+ options
4923
+ );
4924
+ },
4925
+ /** Update workspace member profile attributes (G9) */
4926
+ updateProfile: async (workspaceId, memberId, profileAttrs, options) => {
4927
+ return rb.rawPost(
4928
+ `/workspace-memberships/${workspaceId}/${memberId}/profile`,
4929
+ { data: { attributes: { profile_attributes: profileAttrs } } },
4930
+ options
4931
+ );
4932
+ },
4933
+ /** Remove a user from a workspace */
4934
+ remove: async (workspaceId, memberId, options) => {
4935
+ return rb.executeDelete(
4936
+ deleteWorkspaceMembershipsByWorkspaceIdByUserId,
4937
+ { path: { workspace_id: workspaceId, user_id: memberId } },
4938
+ options
4939
+ );
4940
+ }
4941
+ }
4942
+ };
4943
+ }
4944
+
4945
+ // src/namespaces/scheduling.ts
4946
+ function createSchedulingNamespace(rb) {
4947
+ return {
4948
+ /**
4949
+ * Event Types — templates for bookable events
4950
+ */
4951
+ eventTypes: {
4952
+ /** List event types with optional pagination */
4953
+ list: async (options) => {
4954
+ return rb.execute(
4955
+ getSchedulingEventTypes,
4956
+ buildPageQuery(options?.page, options?.pageSize),
4957
+ options
4958
+ );
4959
+ },
4960
+ /** List all event types with automatic pagination */
4961
+ listAll: async (options) => {
4962
+ return paginateToArray(
4963
+ rb.createPaginatedFetcher(
4964
+ getSchedulingEventTypes,
4965
+ (page, pageSize) => ({
4966
+ query: { page: { number: page, size: pageSize } }
4967
+ }),
4968
+ options
4969
+ )
4970
+ );
4971
+ },
4972
+ /** Get an event type by ID */
4973
+ get: async (id, options) => {
4974
+ return rb.execute(
4975
+ getSchedulingEventTypesById,
4976
+ { path: { id } },
4977
+ options
4978
+ );
4979
+ },
4980
+ /**
4981
+ * Create a new event type.
4982
+ * @example
4983
+ * ```typescript
4984
+ * const client = new GptClient({ apiKey: 'sk_tenant_...' });
4985
+ * const eventType = await client.scheduling.eventTypes.create({
4986
+ * name: '30-Minute Consultation',
4987
+ * slug: '30min-consult',
4988
+ * duration_minutes: 30,
4989
+ * location_type: 'video',
4990
+ * });
4991
+ * ```
4992
+ */
4993
+ create: async (attributes, options) => {
4994
+ return rb.execute(
4995
+ postSchedulingEventTypes,
4996
+ {
4997
+ body: { data: { type: "scheduling_event_type", attributes } }
4998
+ },
4999
+ options
5000
+ );
5001
+ },
5002
+ /** Update an event type */
5003
+ update: async (id, attributes, options) => {
5004
+ return rb.execute(
5005
+ patchSchedulingEventTypesById,
5006
+ {
5007
+ path: { id },
5008
+ body: { data: { id, type: "scheduling_event_type", attributes } }
5009
+ },
5010
+ options
5011
+ );
5012
+ }
5013
+ },
5014
+ /**
5015
+ * Events — scheduled occurrences
5016
+ */
5017
+ events: {
5018
+ /** List events with optional pagination */
5019
+ list: async (options) => {
5020
+ return rb.execute(
5021
+ getSchedulingEvents,
5022
+ buildPageQuery(options?.page, options?.pageSize),
5023
+ options
5024
+ );
5025
+ },
5026
+ /** List all events with automatic pagination */
5027
+ listAll: async (options) => {
5028
+ return paginateToArray(
5029
+ rb.createPaginatedFetcher(
5030
+ getSchedulingEvents,
5031
+ (page, pageSize) => ({
5032
+ query: { page: { number: page, size: pageSize } }
5033
+ }),
5034
+ options
5035
+ )
5036
+ );
5037
+ },
5038
+ /** Get an event by ID */
5039
+ get: async (id, options) => {
5040
+ return rb.execute(
5041
+ getSchedulingEventsById,
5042
+ { path: { id } },
5043
+ options
5044
+ );
5045
+ },
5046
+ /**
5047
+ * Create an internal event directly.
5048
+ * Use for meetings between known users in the workspace.
5049
+ */
5050
+ create: async (attributes, options) => {
5051
+ return rb.execute(
5052
+ postSchedulingEvents,
5053
+ {
5054
+ body: { data: { type: "scheduling_event", attributes } }
5055
+ },
5056
+ options
5057
+ );
5058
+ },
5059
+ /** Update an event */
5060
+ update: async (id, attributes, options) => {
5061
+ return rb.execute(
5062
+ patchSchedulingEventsById,
5063
+ {
5064
+ path: { id },
5065
+ body: { data: { id, type: "scheduling_event", attributes } }
5066
+ },
5067
+ options
5068
+ );
5069
+ }
5070
+ },
5071
+ /**
5072
+ * Participants — people attending events
5073
+ */
5074
+ participants: {
5075
+ /** List participants with optional pagination */
5076
+ list: async (options) => {
5077
+ return rb.execute(
5078
+ getSchedulingParticipants,
5079
+ buildPageQuery(options?.page, options?.pageSize),
5080
+ options
5081
+ );
5082
+ },
5083
+ /** List all participants with automatic pagination */
5084
+ listAll: async (options) => {
5085
+ return paginateToArray(
5086
+ rb.createPaginatedFetcher(
5087
+ getSchedulingParticipants,
5088
+ (page, pageSize) => ({
5089
+ query: { page: { number: page, size: pageSize } }
5090
+ }),
5091
+ options
5092
+ )
5093
+ );
5094
+ },
5095
+ /** Get a participant by ID */
5096
+ get: async (id, options) => {
5097
+ return rb.execute(
5098
+ getSchedulingParticipantsById,
5099
+ { path: { id } },
5100
+ options
5101
+ );
5102
+ },
5103
+ /** Add a participant to an event */
5104
+ create: async (attributes, options) => {
5105
+ return rb.execute(
5106
+ postSchedulingParticipants,
5107
+ {
5108
+ body: { data: { type: "scheduling_participant", attributes } }
5109
+ },
5110
+ options
5111
+ );
5112
+ },
5113
+ /** Update a participant (e.g., confirm attendance, respond to invite) */
5114
+ update: async (id, attributes, options) => {
5115
+ return rb.execute(
5116
+ patchSchedulingParticipantsById,
5117
+ {
5118
+ path: { id },
5119
+ body: { data: { id, type: "scheduling_participant", attributes } }
5120
+ },
5121
+ options
5122
+ );
5123
+ }
5124
+ },
5125
+ /**
5126
+ * Bookings — external party requests for appointments
5127
+ */
5128
+ bookings: {
5129
+ /** List bookings with optional pagination */
5130
+ list: async (options) => {
5131
+ return rb.execute(
5132
+ getSchedulingBookings,
5133
+ buildPageQuery(options?.page, options?.pageSize),
5134
+ options
5135
+ );
5136
+ },
5137
+ /** List all bookings with automatic pagination */
5138
+ listAll: async (options) => {
5139
+ return paginateToArray(
5140
+ rb.createPaginatedFetcher(
5141
+ getSchedulingBookings,
5142
+ (page, pageSize) => ({
5143
+ query: { page: { number: page, size: pageSize } }
5144
+ }),
5145
+ options
5146
+ )
5147
+ );
5148
+ },
5149
+ /** Get a booking by ID */
5150
+ get: async (id, options) => {
5151
+ return rb.execute(
5152
+ getSchedulingBookingsById,
5153
+ { path: { id } },
5154
+ options
5155
+ );
5156
+ },
5157
+ /**
5158
+ * Create a booking request.
5159
+ * Use when someone outside the platform requests an appointment.
5160
+ * @example
5161
+ * ```typescript
5162
+ * const booking = await client.scheduling.bookings.create({
5163
+ * event_type_id: 'event_123',
5164
+ * start_time: '2025-03-01T10:00:00Z',
5165
+ * booker_name: 'John Doe',
5166
+ * booker_email: 'john@example.com',
5167
+ * });
5168
+ * ```
5169
+ */
5170
+ create: async (attributes, options) => {
5171
+ return rb.execute(
5172
+ postSchedulingBookings,
5173
+ {
5174
+ body: { data: { type: "scheduling_booking", attributes } }
5175
+ },
5176
+ options
5177
+ );
5178
+ },
5179
+ /**
5180
+ * Confirm a pending booking.
5181
+ * For EventTypes with requires_approval=true.
5182
+ */
5183
+ confirm: async (id, options) => {
5184
+ return rb.execute(
5185
+ patchSchedulingBookingsSchedulingBookingsByIdConfirm,
5186
+ { path: { id }, body: {} },
5187
+ options
5188
+ );
5189
+ },
5190
+ /**
5191
+ * Cancel or reject a booking.
5192
+ */
5193
+ cancel: async (id, attributes, options) => {
5194
+ return rb.execute(
5195
+ patchSchedulingBookingsSchedulingBookingsByIdCancel,
5196
+ {
5197
+ path: { id },
5198
+ body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5199
+ },
5200
+ options
5201
+ );
5202
+ },
5203
+ /**
5204
+ * Reschedule a booking to a new time.
5205
+ */
5206
+ reschedule: async (id, attributes, options) => {
5207
+ return rb.execute(
5208
+ patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5209
+ {
5210
+ path: { id },
5211
+ body: { data: { type: "scheduling_booking", attributes } }
5212
+ },
5213
+ options
5214
+ );
5215
+ }
5216
+ },
5217
+ /**
5218
+ * Calendar Syncs — external calendar integrations
5219
+ */
5220
+ calendarSyncs: {
5221
+ /** List calendar syncs with optional pagination */
5222
+ list: async (options) => {
5223
+ return rb.execute(
5224
+ getSchedulingCalendarSyncs,
5225
+ buildPageQuery(options?.page, options?.pageSize),
5226
+ options
5227
+ );
5228
+ },
5229
+ /** List all calendar syncs with automatic pagination */
5230
+ listAll: async (options) => {
5231
+ return paginateToArray(
5232
+ rb.createPaginatedFetcher(
5233
+ getSchedulingCalendarSyncs,
5234
+ (page, pageSize) => ({
5235
+ query: { page: { number: page, size: pageSize } }
5236
+ }),
5237
+ options
5238
+ )
5239
+ );
5240
+ },
5241
+ /** Get a calendar sync by ID */
5242
+ get: async (id, options) => {
5243
+ return rb.execute(
5244
+ getSchedulingCalendarSyncsById,
5245
+ { path: { id } },
5246
+ options
5247
+ );
5248
+ },
5249
+ /**
5250
+ * Create a calendar sync.
5251
+ * For bi-directional sync with external calendars (Google, Outlook).
5252
+ */
5253
+ create: async (attributes, options) => {
5254
+ return rb.execute(
5255
+ postSchedulingCalendarSyncs,
5256
+ {
5257
+ body: { data: { type: "scheduling_calendar_sync", attributes } }
5258
+ },
5259
+ options
5260
+ );
5261
+ },
5262
+ /** Update a calendar sync */
5263
+ update: async (id, attributes, options) => {
5264
+ return rb.execute(
5265
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5266
+ {
5267
+ path: { id },
5268
+ body: {
5269
+ data: { id, type: "scheduling_calendar_sync", attributes }
5270
+ }
5271
+ },
5272
+ options
5273
+ );
5274
+ },
5275
+ /** Delete a calendar sync */
5276
+ delete: async (id, options) => {
5277
+ return rb.executeDelete(
5278
+ deleteSchedulingCalendarSyncsSchedulingCalendarSyncsById,
5279
+ { path: { id } },
5280
+ options
5281
+ );
5282
+ },
5283
+ /** Pause a calendar sync (stops pushing/pulling) */
5284
+ pause: async (id, options) => {
5285
+ return rb.execute(
5286
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5287
+ { path: { id }, body: {} },
5288
+ options
5289
+ );
5290
+ },
5291
+ /** Resume a paused calendar sync */
5292
+ resume: async (id, options) => {
5293
+ return rb.execute(
5294
+ patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5295
+ { path: { id }, body: {} },
5296
+ options
5297
+ );
5298
+ }
5299
+ }
5300
+ };
5301
+ }
5302
+
5303
+ // src/namespaces/search.ts
5304
+ function createSearchNamespace(rb) {
4527
5305
  return {
4528
5306
  /** Full-text search query */
4529
5307
  query: async (query, options) => {
@@ -4588,29 +5366,15 @@ function createStorageNamespace(rb) {
4588
5366
  /** Generate a presigned upload URL for direct-to-storage uploads */
4589
5367
  signUpload: async (attributes, options) => {
4590
5368
  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,
5369
+ postDocumentsPresignedUpload,
4602
5370
  {
4603
- body: { data: { type: "signed_url", attributes: attributes ?? {} } }
5371
+ body: {
5372
+ data: { type: "presigned_upload", attributes: attributes ?? {} }
5373
+ }
4604
5374
  },
4605
5375
  options
4606
5376
  );
4607
5377
  },
4608
- objects: {
4609
- /** List storage objects */
4610
- list: async (options) => {
4611
- return rb.execute(getObjects, {}, options);
4612
- }
4613
- },
4614
5378
  buckets: {
4615
5379
  list: async (options) => {
4616
5380
  return rb.execute(
@@ -4772,20 +5536,20 @@ function createThreadsNamespace(rb) {
4772
5536
  };
4773
5537
  }
4774
5538
 
4775
- // src/namespaces/webhooks-ns.ts
4776
- function createWebhooksNamespace(rb) {
5539
+ // src/namespaces/training.ts
5540
+ function createTrainingNamespace(rb) {
4777
5541
  return {
4778
- configs: {
5542
+ examples: {
4779
5543
  delete: async (id, options) => {
4780
5544
  return rb.executeDelete(
4781
- deleteWebhookConfigsById,
5545
+ deleteTrainingExamplesById,
4782
5546
  { path: { id } },
4783
5547
  options
4784
5548
  );
4785
5549
  },
4786
5550
  list: async (options) => {
4787
5551
  return rb.execute(
4788
- getWebhookConfigs,
5552
+ getTrainingExamples,
4789
5553
  buildPageQuery(options?.page, options?.pageSize),
4790
5554
  options
4791
5555
  );
@@ -4793,7 +5557,7 @@ function createWebhooksNamespace(rb) {
4793
5557
  listAll: async (options) => {
4794
5558
  return paginateToArray(
4795
5559
  rb.createPaginatedFetcher(
4796
- getWebhookConfigs,
5560
+ getTrainingExamples,
4797
5561
  (page, pageSize) => ({
4798
5562
  query: { page: { number: page, size: pageSize } }
4799
5563
  }),
@@ -4801,112 +5565,257 @@ function createWebhooksNamespace(rb) {
4801
5565
  )
4802
5566
  );
4803
5567
  },
5568
+ get: async (id, options) => {
5569
+ return rb.execute(
5570
+ getTrainingExamplesById,
5571
+ { path: { id } },
5572
+ options
5573
+ );
5574
+ },
4804
5575
  create: async (attributes, options) => {
4805
5576
  return rb.execute(
4806
- postWebhookConfigs,
4807
- { body: { data: { type: "webhook_config", attributes } } },
5577
+ postTrainingExamplesBulkDelete,
5578
+ { body: { data: { type: "training_example", attributes } } },
4808
5579
  options
4809
5580
  );
4810
5581
  },
4811
5582
  update: async (id, attributes, options) => {
4812
5583
  return rb.execute(
4813
- patchWebhookConfigsById,
5584
+ patchTrainingExamplesById,
4814
5585
  {
4815
5586
  path: { id },
4816
- body: { data: { id, type: "webhook_config", attributes } }
5587
+ body: { data: { id, type: "training_example", attributes } }
4817
5588
  },
4818
5589
  options
4819
5590
  );
4820
5591
  },
4821
- test: async (id, options) => {
5592
+ bulkCreate: async (options) => {
4822
5593
  return rb.execute(
4823
- postWebhookConfigsByIdTest,
4824
- { path: { id }, body: {} },
5594
+ postTrainingExamplesBulkDelete,
5595
+ {},
4825
5596
  options
4826
5597
  );
4827
5598
  },
4828
- bulkEnable: async (options) => {
5599
+ bulkDestroy: async (options) => {
4829
5600
  return rb.execute(
4830
- postWebhookConfigsBulkEnable,
5601
+ postTrainingExamplesBulkDelete,
4831
5602
  {},
4832
5603
  options
4833
5604
  );
4834
5605
  },
4835
- bulkDisable: async (options) => {
5606
+ searchByVector: async (options) => {
4836
5607
  return rb.execute(
4837
- postWebhookConfigsBulkDisable,
5608
+ postTrainingExamplesBulkDelete,
4838
5609
  {},
4839
5610
  options
4840
5611
  );
4841
- },
4842
- /** Replay historical events to this webhook */
4843
- replay: async (id, options) => {
5612
+ }
5613
+ },
5614
+ sessions: {
5615
+ listAgentsSessions: async (options) => {
4844
5616
  return rb.execute(
4845
- postWebhookConfigsByIdReplay,
4846
- { path: { id }, body: {} },
5617
+ getTrainingSessionsAgentsByAgentIdSessions,
5618
+ buildPageQuery(options?.page, options?.pageSize),
4847
5619
  options
4848
5620
  );
4849
5621
  },
5622
+ listAllAgentsSessions: async (options) => {
5623
+ return paginateToArray(
5624
+ rb.createPaginatedFetcher(
5625
+ getTrainingSessionsAgentsByAgentIdSessions,
5626
+ (page, pageSize) => ({
5627
+ query: { page: { number: page, size: pageSize } }
5628
+ }),
5629
+ options
5630
+ )
5631
+ );
5632
+ },
4850
5633
  get: async (id, options) => {
4851
5634
  return rb.execute(
4852
- getWebhookConfigsById,
5635
+ getTrainingSessionsById,
4853
5636
  { path: { id } },
4854
5637
  options
4855
5638
  );
4856
5639
  },
4857
- /** Rotate the signing secret for a webhook config */
4858
- rotateSecret: async (id, options) => {
5640
+ create: async (attributes, options) => {
4859
5641
  return rb.execute(
4860
- patchWebhookConfigsByIdRotateSecret,
4861
- { path: { id }, body: {} },
5642
+ getTrainingSessionsAgentsByAgentIdSessions,
5643
+ { body: { data: { type: "training_session", attributes } } },
5644
+ options
5645
+ );
5646
+ },
5647
+ delete: async (id, options) => {
5648
+ return rb.executeDelete(
5649
+ deleteTrainingSessionsById,
5650
+ { path: { id } },
5651
+ options
5652
+ );
5653
+ },
5654
+ update: async (agentId, attributes, options) => {
5655
+ return rb.execute(
5656
+ getTrainingSessionsAgentsByAgentIdSessions,
5657
+ {
5658
+ path: { agent_id: agentId },
5659
+ body: { data: { type: "training_session", attributes } }
5660
+ },
4862
5661
  options
4863
5662
  );
4864
5663
  }
5664
+ }
5665
+ };
5666
+ }
5667
+
5668
+ // src/namespaces/voice.ts
5669
+ function createVoiceNamespace(rb) {
5670
+ return {
5671
+ /**
5672
+ * Transcribe an audio file via the voice transcription endpoint.
5673
+ * Accepts File or Blob. Supported formats: mp3, ogg, wav, m4a, webm, flac, aac.
5674
+ *
5675
+ * @param audio - Audio file to transcribe (max 200 MB)
5676
+ * @param params - Optional transcription parameters
5677
+ * @param options - Request options (signal, headers, etc.)
5678
+ */
5679
+ transcribe: async (audio, params, options) => {
5680
+ const form = new FormData();
5681
+ form.append("audio", audio);
5682
+ if (params?.language) form.append("language", params.language);
5683
+ if (params?.modelSize) form.append("model_size", params.modelSize);
5684
+ if (params?.phiMode) form.append("phi_mode", params.phiMode);
5685
+ if (params?.phiKey) form.append("phi_key", params.phiKey);
5686
+ return rb.rawPostMultipart(
5687
+ "/voice/transcribe",
5688
+ form,
5689
+ options
5690
+ );
4865
5691
  },
4866
- deliveries: {
5692
+ /**
5693
+ * Sessions — voice session management
5694
+ */
5695
+ sessions: {
5696
+ /** List voice sessions with pagination */
4867
5697
  list: async (options) => {
4868
5698
  return rb.execute(
4869
- getWebhookDeliveries,
5699
+ getVoiceSessions,
4870
5700
  buildPageQuery(options?.page, options?.pageSize),
4871
5701
  options
4872
5702
  );
4873
5703
  },
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
- )
5704
+ /** Get a session by ID */
5705
+ get: async (id, options) => {
5706
+ return rb.execute(
5707
+ getVoiceSessionsById,
5708
+ { path: { id } },
5709
+ options
4883
5710
  );
4884
5711
  },
4885
- create: async (attributes, options) => {
5712
+ /** List my voice sessions */
5713
+ listMine: async (options) => {
4886
5714
  return rb.execute(
4887
- postWebhookDeliveriesBulkRetry,
4888
- { body: { data: { type: "webhook_delivery", attributes } } },
5715
+ getVoiceSessionsMine,
5716
+ buildPageQuery(options?.page, options?.pageSize),
4889
5717
  options
4890
5718
  );
4891
5719
  },
4892
- retry: async (options) => {
5720
+ /** List sessions by workspace */
5721
+ listByWorkspace: async (workspaceId, options) => {
4893
5722
  return rb.execute(
4894
- postWebhookDeliveriesBulkRetry,
4895
- {},
5723
+ getVoiceSessionsWorkspaceByWorkspaceId,
5724
+ {
5725
+ path: { workspace_id: workspaceId },
5726
+ ...buildPageQuery(options?.page, options?.pageSize)
5727
+ },
4896
5728
  options
4897
5729
  );
4898
5730
  },
4899
- bulkRetry: async (options) => {
5731
+ /**
5732
+ * Start a new voice session with LiveKit room provisioning.
5733
+ *
5734
+ * @param params - Session parameters
5735
+ * @param params.phiKey - AES-256 encryption key for PHI (Protected Health
5736
+ * Information), encoded as Base64 (32 raw bytes). Required when
5737
+ * `phiMode` is `"tokenize_encrypt"`.
5738
+ * @param options - Request options
5739
+ *
5740
+ * @remarks
5741
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5742
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5743
+ * - Do not log, store in `localStorage`, or include in error reports.
5744
+ * - Treat it with the same care as a password or private key.
5745
+ * - The server never persists this key; it is used only within the
5746
+ * lifetime of the request.
5747
+ */
5748
+ start: async (params, options) => {
4900
5749
  return rb.execute(
4901
- postWebhookDeliveriesBulkRetry,
4902
- {},
5750
+ postVoiceSessions,
5751
+ {
5752
+ body: {
5753
+ data: {
5754
+ type: "voice_session",
5755
+ attributes: {
5756
+ thread_id: params?.threadId,
5757
+ blueprint_id: params?.blueprintId,
5758
+ blueprint_mode: params?.blueprintMode,
5759
+ phi_mode: params?.phiMode,
5760
+ phi_key: params?.phiKey,
5761
+ patient_id: params?.patientId
5762
+ }
5763
+ }
5764
+ }
5765
+ },
4903
5766
  options
4904
5767
  );
4905
5768
  },
4906
- get: async (id, options) => {
5769
+ /** End a voice session and release the LiveKit room */
5770
+ stop: async (id, options) => {
4907
5771
  return rb.execute(
4908
- getWebhookDeliveriesById,
4909
- { path: { id } },
5772
+ patchVoiceSessionsByIdStop,
5773
+ { path: { id }, body: { data: { id, type: "voice_session" } } },
5774
+ options
5775
+ );
5776
+ },
5777
+ /**
5778
+ * Dispatch the accumulated session transcript to the blueprint or chat
5779
+ * pipeline. The transcript may contain PHI (Protected Health Information)
5780
+ * depending on the session's `phiMode`.
5781
+ *
5782
+ * @param id - Voice session ID
5783
+ * @param params - Finalization parameters
5784
+ * @param params.phiKey - AES-256 encryption key for PHI, encoded as
5785
+ * Base64 (32 raw bytes). Overrides the key supplied at session start.
5786
+ * Required when `phiMode` is `"tokenize_encrypt"`.
5787
+ * @param options - Request options
5788
+ *
5789
+ * @remarks
5790
+ * **Security — transcript PHI:** The finalized transcript submitted to
5791
+ * this endpoint may contain Protected Health Information. Ensure the
5792
+ * request is made over HTTPS only.
5793
+ *
5794
+ * **Security — `phiKey`:** This value is a sensitive encryption key.
5795
+ * - Transmitted over HTTPS only — never send over plain HTTP.
5796
+ * - Do not log, store in `localStorage`, or include in error reports.
5797
+ * - Treat it with the same care as a password or private key.
5798
+ * - The server never persists this key; it is used only within the
5799
+ * lifetime of the request.
5800
+ */
5801
+ finalize: async (id, params, options) => {
5802
+ return rb.execute(
5803
+ patchVoiceSessionsByIdFinalize,
5804
+ {
5805
+ path: { id },
5806
+ body: {
5807
+ data: {
5808
+ id,
5809
+ type: "voice_session",
5810
+ attributes: {
5811
+ blueprint_id: params?.blueprintId,
5812
+ phi_mode: params?.phiMode,
5813
+ phi_key: params?.phiKey,
5814
+ patient_id: params?.patientId
5815
+ }
5816
+ }
5817
+ }
5818
+ },
4910
5819
  options
4911
5820
  );
4912
5821
  }
@@ -4914,26 +5823,21 @@ function createWebhooksNamespace(rb) {
4914
5823
  };
4915
5824
  }
4916
5825
 
4917
- // src/namespaces/scheduling.ts
4918
- function createSchedulingNamespace(rb) {
5826
+ // src/namespaces/watcher.ts
5827
+ function createWatcherNamespace(rb) {
4919
5828
  return {
4920
- /**
4921
- * Event Types — templates for bookable events
4922
- */
4923
- eventTypes: {
4924
- /** List event types with optional pagination */
5829
+ claims: {
4925
5830
  list: async (options) => {
4926
5831
  return rb.execute(
4927
- getSchedulingEventTypes,
5832
+ getWatcherClaims,
4928
5833
  buildPageQuery(options?.page, options?.pageSize),
4929
5834
  options
4930
5835
  );
4931
5836
  },
4932
- /** List all event types with automatic pagination */
4933
5837
  listAll: async (options) => {
4934
5838
  return paginateToArray(
4935
5839
  rb.createPaginatedFetcher(
4936
- getSchedulingEventTypes,
5840
+ getWatcherClaims,
4937
5841
  (page, pageSize) => ({
4938
5842
  query: { page: { number: page, size: pageSize } }
4939
5843
  }),
@@ -4941,65 +5845,68 @@ function createSchedulingNamespace(rb) {
4941
5845
  )
4942
5846
  );
4943
5847
  },
4944
- /** Get an event type by ID */
4945
- get: async (id, options) => {
4946
- return rb.execute(
4947
- getSchedulingEventTypesById,
4948
- { path: { id } },
4949
- options
4950
- );
5848
+ claim: async (options) => {
5849
+ return rb.execute(postWatcherClaims, {}, options);
4951
5850
  },
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
5851
  create: async (attributes, options) => {
4966
5852
  return rb.execute(
4967
- postSchedulingEventTypes,
4968
- {
4969
- body: { data: { type: "scheduling_event_type", attributes } }
4970
- },
5853
+ postWatcherClaims,
5854
+ { body: { data: { type: "watcher_claim", attributes } } },
4971
5855
  options
4972
5856
  );
4973
5857
  },
4974
- /** Update an event type */
4975
5858
  update: async (id, attributes, options) => {
4976
5859
  return rb.execute(
4977
- patchSchedulingEventTypesById,
5860
+ patchWatcherClaimsById,
4978
5861
  {
4979
5862
  path: { id },
4980
- body: { data: { id, type: "scheduling_event_type", attributes } }
5863
+ body: { data: { id, type: "watcher_claim", attributes } }
4981
5864
  },
4982
5865
  options
4983
5866
  );
5867
+ },
5868
+ delete: async (id, options) => {
5869
+ return rb.executeDelete(
5870
+ getWatcherClaimsById,
5871
+ { path: { id } },
5872
+ options
5873
+ );
5874
+ },
5875
+ /** Register a completed claim for a document (used by ProcessDocument worker) */
5876
+ registerCompleted: async (options) => {
5877
+ return rb.execute(postWatcherClaims, {}, options);
5878
+ },
5879
+ /** Get ingestion status for a workspace */
5880
+ readStatus: async (options) => {
5881
+ return rb.execute(postWatcherClaims, {}, options);
5882
+ },
5883
+ get: async (id, options) => {
5884
+ return rb.execute(
5885
+ getWatcherClaimsById,
5886
+ { path: { id } },
5887
+ options
5888
+ );
4984
5889
  }
4985
5890
  },
4986
- /**
4987
- * Events — scheduled occurrences
4988
- */
4989
5891
  events: {
4990
- /** List events with optional pagination */
5892
+ create: async (attributes, options) => {
5893
+ return rb.execute(
5894
+ postWatcherEvents,
5895
+ { body: { data: { type: "watcher_event", attributes } } },
5896
+ options
5897
+ );
5898
+ },
4991
5899
  list: async (options) => {
4992
5900
  return rb.execute(
4993
- getSchedulingEvents,
5901
+ getWatcherEvents,
4994
5902
  buildPageQuery(options?.page, options?.pageSize),
4995
5903
  options
4996
5904
  );
4997
5905
  },
4998
- /** List all events with automatic pagination */
4999
5906
  listAll: async (options) => {
5000
5907
  return paginateToArray(
5001
5908
  rb.createPaginatedFetcher(
5002
- getSchedulingEvents,
5909
+ getWatcherEvents,
5003
5910
  (page, pageSize) => ({
5004
5911
  query: { page: { number: page, size: pageSize } }
5005
5912
  }),
@@ -5007,56 +5914,46 @@ function createSchedulingNamespace(rb) {
5007
5914
  )
5008
5915
  );
5009
5916
  },
5010
- /** Get an event by ID */
5917
+ delete: async (options) => {
5918
+ return rb.executeDelete(getWatcherEvents, { path: {} }, options);
5919
+ },
5920
+ /** Create multiple events in batch */
5921
+ batchCreate: async (options) => {
5922
+ return rb.execute(postWatcherEvents, {}, options);
5923
+ },
5011
5924
  get: async (id, options) => {
5012
5925
  return rb.execute(
5013
- getSchedulingEventsById,
5926
+ getWatcherEventsById,
5014
5927
  { path: { id } },
5015
5928
  options
5016
5929
  );
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
- },
5930
+ }
5931
+ }
5932
+ };
5933
+ }
5934
+
5935
+ // src/namespaces/webhooks-ns.ts
5936
+ function createWebhooksNamespace(rb) {
5937
+ return {
5938
+ configs: {
5939
+ delete: async (id, options) => {
5940
+ return rb.executeDelete(
5941
+ deleteWebhookConfigsById,
5942
+ { path: { id } },
5028
5943
  options
5029
5944
  );
5030
5945
  },
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
5946
  list: async (options) => {
5049
5947
  return rb.execute(
5050
- getSchedulingParticipants,
5948
+ getWebhookConfigs,
5051
5949
  buildPageQuery(options?.page, options?.pageSize),
5052
5950
  options
5053
5951
  );
5054
5952
  },
5055
- /** List all participants with automatic pagination */
5056
5953
  listAll: async (options) => {
5057
5954
  return paginateToArray(
5058
5955
  rb.createPaginatedFetcher(
5059
- getSchedulingParticipants,
5956
+ getWebhookConfigs,
5060
5957
  (page, pageSize) => ({
5061
5958
  query: { page: { number: page, size: pageSize } }
5062
5959
  }),
@@ -5064,145 +5961,80 @@ function createSchedulingNamespace(rb) {
5064
5961
  )
5065
5962
  );
5066
5963
  },
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
5964
  create: async (attributes, options) => {
5077
5965
  return rb.execute(
5078
- postSchedulingParticipants,
5079
- {
5080
- body: { data: { type: "scheduling_participant", attributes } }
5081
- },
5966
+ postWebhookConfigs,
5967
+ { body: { data: { type: "webhook_config", attributes } } },
5082
5968
  options
5083
5969
  );
5084
5970
  },
5085
- /** Update a participant (e.g., confirm attendance, respond to invite) */
5086
5971
  update: async (id, attributes, options) => {
5087
5972
  return rb.execute(
5088
- patchSchedulingParticipantsById,
5973
+ patchWebhookConfigsById,
5089
5974
  {
5090
5975
  path: { id },
5091
- body: { data: { id, type: "scheduling_participant", attributes } }
5976
+ body: { data: { id, type: "webhook_config", attributes } }
5092
5977
  },
5093
5978
  options
5094
5979
  );
5095
- }
5096
- },
5097
- /**
5098
- * Bookings — external party requests for appointments
5099
- */
5100
- bookings: {
5101
- /** List bookings with optional pagination */
5102
- list: async (options) => {
5980
+ },
5981
+ test: async (id, options) => {
5103
5982
  return rb.execute(
5104
- getSchedulingBookings,
5105
- buildPageQuery(options?.page, options?.pageSize),
5983
+ postWebhookConfigsByIdTest,
5984
+ { path: { id }, body: {} },
5106
5985
  options
5107
5986
  );
5108
5987
  },
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) => {
5988
+ bulkEnable: async (options) => {
5123
5989
  return rb.execute(
5124
- getSchedulingBookingsById,
5125
- { path: { id } },
5990
+ postWebhookConfigsBulkEnable,
5991
+ {},
5126
5992
  options
5127
5993
  );
5128
5994
  },
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) => {
5995
+ bulkDisable: async (options) => {
5143
5996
  return rb.execute(
5144
- postSchedulingBookings,
5145
- {
5146
- body: { data: { type: "scheduling_booking", attributes } }
5147
- },
5997
+ postWebhookConfigsBulkDisable,
5998
+ {},
5148
5999
  options
5149
6000
  );
5150
6001
  },
5151
- /**
5152
- * Confirm a pending booking.
5153
- * For EventTypes with requires_approval=true.
5154
- */
5155
- confirm: async (id, options) => {
6002
+ /** Replay historical events to this webhook */
6003
+ replay: async (id, options) => {
5156
6004
  return rb.execute(
5157
- patchSchedulingBookingsSchedulingBookingsByIdConfirm,
6005
+ postWebhookConfigsByIdReplay,
5158
6006
  { path: { id }, body: {} },
5159
6007
  options
5160
6008
  );
5161
6009
  },
5162
- /**
5163
- * Cancel or reject a booking.
5164
- */
5165
- cancel: async (id, attributes, options) => {
6010
+ get: async (id, options) => {
5166
6011
  return rb.execute(
5167
- patchSchedulingBookingsSchedulingBookingsByIdCancel,
5168
- {
5169
- path: { id },
5170
- body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
5171
- },
6012
+ getWebhookConfigsById,
6013
+ { path: { id } },
5172
6014
  options
5173
6015
  );
5174
6016
  },
5175
- /**
5176
- * Reschedule a booking to a new time.
5177
- */
5178
- reschedule: async (id, attributes, options) => {
6017
+ /** Rotate the signing secret for a webhook config */
6018
+ rotateSecret: async (id, options) => {
5179
6019
  return rb.execute(
5180
- patchSchedulingBookingsSchedulingBookingsByIdReschedule,
5181
- {
5182
- path: { id },
5183
- body: { data: { type: "scheduling_booking", attributes } }
5184
- },
6020
+ patchWebhookConfigsByIdRotateSecret,
6021
+ { path: { id }, body: {} },
5185
6022
  options
5186
6023
  );
5187
6024
  }
5188
6025
  },
5189
- /**
5190
- * Calendar Syncs — external calendar integrations
5191
- */
5192
- calendarSyncs: {
5193
- /** List calendar syncs with optional pagination */
6026
+ deliveries: {
5194
6027
  list: async (options) => {
5195
6028
  return rb.execute(
5196
- getSchedulingCalendarSyncs,
6029
+ getWebhookDeliveries,
5197
6030
  buildPageQuery(options?.page, options?.pageSize),
5198
6031
  options
5199
6032
  );
5200
6033
  },
5201
- /** List all calendar syncs with automatic pagination */
5202
6034
  listAll: async (options) => {
5203
6035
  return paginateToArray(
5204
6036
  rb.createPaginatedFetcher(
5205
- getSchedulingCalendarSyncs,
6037
+ getWebhookDeliveries,
5206
6038
  (page, pageSize) => ({
5207
6039
  query: { page: { number: page, size: pageSize } }
5208
6040
  }),
@@ -5210,61 +6042,31 @@ function createSchedulingNamespace(rb) {
5210
6042
  )
5211
6043
  );
5212
6044
  },
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
6045
  create: async (attributes, options) => {
5226
6046
  return rb.execute(
5227
- postSchedulingCalendarSyncs,
5228
- {
5229
- body: { data: { type: "scheduling_calendar_sync", attributes } }
5230
- },
6047
+ postWebhookDeliveriesBulkRetry,
6048
+ { body: { data: { type: "webhook_delivery", attributes } } },
5231
6049
  options
5232
6050
  );
5233
6051
  },
5234
- /** Update a calendar sync */
5235
- update: async (id, attributes, options) => {
6052
+ retry: async (options) => {
5236
6053
  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 } },
6054
+ postWebhookDeliveriesBulkRetry,
6055
+ {},
5252
6056
  options
5253
6057
  );
5254
6058
  },
5255
- /** Pause a calendar sync (stops pushing/pulling) */
5256
- pause: async (id, options) => {
6059
+ bulkRetry: async (options) => {
5257
6060
  return rb.execute(
5258
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdPause,
5259
- { path: { id }, body: {} },
6061
+ postWebhookDeliveriesBulkRetry,
6062
+ {},
5260
6063
  options
5261
6064
  );
5262
6065
  },
5263
- /** Resume a paused calendar sync */
5264
- resume: async (id, options) => {
6066
+ get: async (id, options) => {
5265
6067
  return rb.execute(
5266
- patchSchedulingCalendarSyncsSchedulingCalendarSyncsByIdResume,
5267
- { path: { id }, body: {} },
6068
+ getWebhookDeliveriesById,
6069
+ { path: { id } },
5268
6070
  options
5269
6071
  );
5270
6072
  }
@@ -5452,6 +6254,30 @@ var RequestBuilder = class {
5452
6254
  throw handleApiError(error);
5453
6255
  }
5454
6256
  }
6257
+ /**
6258
+ * Execute a raw multipart/form-data POST request.
6259
+ * Used for file upload endpoints (custom Phoenix controllers).
6260
+ * Content-Type is omitted from headers so the browser sets the correct
6261
+ * multipart boundary automatically from the FormData body.
6262
+ */
6263
+ async rawPostMultipart(url, body, options) {
6264
+ const headers = buildHeaders(this.getHeaders, options);
6265
+ delete headers["Content-Type"];
6266
+ delete headers["content-type"];
6267
+ try {
6268
+ const { data } = await this.requestWithRetry(
6269
+ () => this.clientInstance.post({
6270
+ url,
6271
+ headers,
6272
+ body,
6273
+ ...options?.signal && { signal: options.signal }
6274
+ })
6275
+ );
6276
+ return this.unwrap(data?.data);
6277
+ } catch (error) {
6278
+ throw handleApiError(error);
6279
+ }
6280
+ }
5455
6281
  /**
5456
6282
  * Execute a raw POST request to a custom (non-generated) endpoint.
5457
6283
  * Used for endpoints implemented as custom Phoenix controllers.
@@ -5611,11 +6437,14 @@ var GptClient = class extends BaseClient {
5611
6437
  this.extraction = createExtractionNamespace(rb);
5612
6438
  this.identity = createIdentityNamespace(rb);
5613
6439
  this.platform = createPlatformNamespace(rb);
6440
+ this.scheduling = createSchedulingNamespace(rb);
5614
6441
  this.search = createSearchNamespace(rb);
5615
6442
  this.storage = createStorageNamespace(rb);
5616
6443
  this.threads = createThreadsNamespace(rb);
6444
+ this.training = createTrainingNamespace(rb);
6445
+ this.voice = createVoiceNamespace(rb);
6446
+ this.watcher = createWatcherNamespace(rb);
5617
6447
  this.webhooks = createWebhooksNamespace(rb);
5618
- this.scheduling = createSchedulingNamespace(rb);
5619
6448
  }
5620
6449
  /**
5621
6450
  * Subscribe to SDK lifecycle events.