@gpt-platform/client 0.9.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -49,6 +49,7 @@ __export(index_exports, {
49
49
  buildHeaders: () => buildHeaders,
50
50
  buildUserAgent: () => buildUserAgent,
51
51
  collectStreamedMessage: () => collectStreamedMessage,
52
+ createChannelsNamespace: () => createChannelsNamespace,
52
53
  createImportsNamespace: () => createImportsNamespace,
53
54
  handleApiError: () => handleApiError,
54
55
  isBrowserEnvironment: () => isBrowserEnvironment,
@@ -1020,6 +1021,9 @@ function handleApiError(error) {
1020
1021
  const parsed = parseInt(firstError.status, 10);
1021
1022
  if (!isNaN(parsed)) statusCode = parsed;
1022
1023
  }
1024
+ } else if (typeof body === "object" && body !== null && "errors" in body && typeof body.errors === "object" && !Array.isArray(body.errors)) {
1025
+ const errObj = body.errors;
1026
+ message = errObj.detail || errObj.title || message;
1023
1027
  } else if (typeof body === "object" && body !== null && "message" in body && typeof body.message === "string") {
1024
1028
  message = body.message;
1025
1029
  } else if (typeof body === "string") {
@@ -1334,8 +1338,8 @@ function buildUserAgent(sdkVersion, appInfo) {
1334
1338
  }
1335
1339
 
1336
1340
  // src/version.ts
1337
- var SDK_VERSION = "0.9.0";
1338
- var DEFAULT_API_VERSION = "2026-03-21";
1341
+ var SDK_VERSION = "0.10.1";
1342
+ var DEFAULT_API_VERSION = "2026-03-23";
1339
1343
 
1340
1344
  // src/base-client.ts
1341
1345
  function generateUUID() {
@@ -1858,6 +1862,15 @@ var postCatalogTaxonomyNodes = (options) => (options.client ?? client).post({
1858
1862
  ...options.headers
1859
1863
  }
1860
1864
  });
1865
+ var postCampaignsSequenceSteps = (options) => (options.client ?? client).post({
1866
+ security: [{ scheme: "bearer", type: "http" }],
1867
+ url: "/campaigns/sequence-steps",
1868
+ ...options,
1869
+ headers: {
1870
+ "Content-Type": "application/vnd.api+json",
1871
+ ...options.headers
1872
+ }
1873
+ });
1861
1874
  var deleteCrmRelationshipsById = (options) => (options.client ?? client).delete({
1862
1875
  security: [{ scheme: "bearer", type: "http" }],
1863
1876
  url: "/crm/relationships/{id}",
@@ -1882,6 +1895,15 @@ var postClinicalSessions = (options) => (options.client ?? client).post({
1882
1895
  ...options.headers
1883
1896
  }
1884
1897
  });
1898
+ var postMessageFeedback = (options) => (options.client ?? client).post({
1899
+ security: [{ scheme: "bearer", type: "http" }],
1900
+ url: "/message-feedback",
1901
+ ...options,
1902
+ headers: {
1903
+ "Content-Type": "application/vnd.api+json",
1904
+ ...options.headers
1905
+ }
1906
+ });
1885
1907
  var getWatcherEventsById = (options) => (options.client ?? client).get({
1886
1908
  security: [{ scheme: "bearer", type: "http" }],
1887
1909
  url: "/watcher/events/{id}",
@@ -1967,6 +1989,11 @@ var patchClinicalMealPlansById = (options) => (options.client ?? client).patch({
1967
1989
  ...options.headers
1968
1990
  }
1969
1991
  });
1992
+ var getCampaignsSequenceStepsSequenceBySequenceId = (options) => (options.client ?? client).get({
1993
+ security: [{ scheme: "bearer", type: "http" }],
1994
+ url: "/campaigns/sequence-steps/sequence/{sequence_id}",
1995
+ ...options
1996
+ });
1970
1997
  var deleteSocialAccountsById = (options) => (options.client ?? client).delete({
1971
1998
  security: [{ scheme: "bearer", type: "http" }],
1972
1999
  url: "/social/accounts/{id}",
@@ -2042,6 +2069,11 @@ var getBrandIdentitiesByTenantByTenantId = (options) => (options.client ?? clien
2042
2069
  url: "/brand-identities/by-tenant/{tenant_id}",
2043
2070
  ...options
2044
2071
  });
2072
+ var getCatalogOptionTypesApplicationByApplicationId = (options) => (options.client ?? client).get({
2073
+ security: [{ scheme: "bearer", type: "http" }],
2074
+ url: "/catalog/option-types/application/{application_id}",
2075
+ ...options
2076
+ });
2045
2077
  var postInvitationsAcceptByToken = (options) => (options.client ?? client).post({
2046
2078
  security: [{ scheme: "bearer", type: "http" }],
2047
2079
  url: "/invitations/accept-by-token",
@@ -2051,6 +2083,15 @@ var postInvitationsAcceptByToken = (options) => (options.client ?? client).post(
2051
2083
  ...options.headers
2052
2084
  }
2053
2085
  });
2086
+ var postCatalogPriceListEntries = (options) => (options.client ?? client).post({
2087
+ security: [{ scheme: "bearer", type: "http" }],
2088
+ url: "/catalog/price-list-entries",
2089
+ ...options,
2090
+ headers: {
2091
+ "Content-Type": "application/vnd.api+json",
2092
+ ...options.headers
2093
+ }
2094
+ });
2054
2095
  var postSocialCampaignsByIdAdaptForPlatforms = (options) => (options.client ?? client).post({
2055
2096
  security: [{ scheme: "bearer", type: "http" }],
2056
2097
  url: "/social/campaigns/{id}/adapt-for-platforms",
@@ -2093,6 +2134,15 @@ var getAgentVersionsByIdMetrics = (options) => (options.client ?? client).get({
2093
2134
  url: "/agent-versions/{id}/metrics",
2094
2135
  ...options
2095
2136
  });
2137
+ var patchCampaignsSequencesByIdPause = (options) => (options.client ?? client).patch({
2138
+ security: [{ scheme: "bearer", type: "http" }],
2139
+ url: "/campaigns/sequences/{id}/pause",
2140
+ ...options,
2141
+ headers: {
2142
+ "Content-Type": "application/vnd.api+json",
2143
+ ...options.headers
2144
+ }
2145
+ });
2096
2146
  var getAgentsByIdStats = (options) => (options.client ?? client).get({
2097
2147
  security: [{ scheme: "bearer", type: "http" }],
2098
2148
  url: "/agents/{id}/stats",
@@ -2206,6 +2256,11 @@ var patchSocialAccountsByIdDeactivate = (options) => (options.client ?? client).
2206
2256
  ...options.headers
2207
2257
  }
2208
2258
  });
2259
+ var getClinicalSessionsByPatient = (options) => (options.client ?? client).get({
2260
+ security: [{ scheme: "bearer", type: "http" }],
2261
+ url: "/clinical/sessions/by-patient",
2262
+ ...options
2263
+ });
2209
2264
  var deleteCrmDealsById = (options) => (options.client ?? client).delete({
2210
2265
  security: [{ scheme: "bearer", type: "http" }],
2211
2266
  url: "/crm/deals/{id}",
@@ -3255,6 +3310,25 @@ var patchSchedulingBookingsByIdCancel = (options) => (options.client ?? client).
3255
3310
  ...options.headers
3256
3311
  }
3257
3312
  });
3313
+ var deleteCatalogOptionTypesById = (options) => (options.client ?? client).delete({
3314
+ security: [{ scheme: "bearer", type: "http" }],
3315
+ url: "/catalog/option-types/{id}",
3316
+ ...options
3317
+ });
3318
+ var getCatalogOptionTypesById = (options) => (options.client ?? client).get({
3319
+ security: [{ scheme: "bearer", type: "http" }],
3320
+ url: "/catalog/option-types/{id}",
3321
+ ...options
3322
+ });
3323
+ var patchCatalogOptionTypesById = (options) => (options.client ?? client).patch({
3324
+ security: [{ scheme: "bearer", type: "http" }],
3325
+ url: "/catalog/option-types/{id}",
3326
+ ...options,
3327
+ headers: {
3328
+ "Content-Type": "application/vnd.api+json",
3329
+ ...options.headers
3330
+ }
3331
+ });
3258
3332
  var deleteNotificationMethodsById = (options) => (options.client ?? client).delete({
3259
3333
  security: [{ scheme: "bearer", type: "http" }],
3260
3334
  url: "/notification-methods/{id}",
@@ -3330,6 +3404,53 @@ var getPermissionsMeta = (options) => (options.client ?? client).get({
3330
3404
  url: "/permissions/meta",
3331
3405
  ...options
3332
3406
  });
3407
+ var postCatalogPriceLists = (options) => (options.client ?? client).post({
3408
+ security: [{ scheme: "bearer", type: "http" }],
3409
+ url: "/catalog/price-lists",
3410
+ ...options,
3411
+ headers: {
3412
+ "Content-Type": "application/vnd.api+json",
3413
+ ...options.headers
3414
+ }
3415
+ });
3416
+ var deleteCatalogViewsById = (options) => (options.client ?? client).delete({
3417
+ security: [{ scheme: "bearer", type: "http" }],
3418
+ url: "/catalog/views/{id}",
3419
+ ...options
3420
+ });
3421
+ var getCatalogViewsById = (options) => (options.client ?? client).get({
3422
+ security: [{ scheme: "bearer", type: "http" }],
3423
+ url: "/catalog/views/{id}",
3424
+ ...options
3425
+ });
3426
+ var patchCatalogViewsById = (options) => (options.client ?? client).patch({
3427
+ security: [{ scheme: "bearer", type: "http" }],
3428
+ url: "/catalog/views/{id}",
3429
+ ...options,
3430
+ headers: {
3431
+ "Content-Type": "application/vnd.api+json",
3432
+ ...options.headers
3433
+ }
3434
+ });
3435
+ var deleteCatalogOptionValuesById = (options) => (options.client ?? client).delete({
3436
+ security: [{ scheme: "bearer", type: "http" }],
3437
+ url: "/catalog/option-values/{id}",
3438
+ ...options
3439
+ });
3440
+ var getCatalogOptionValuesById = (options) => (options.client ?? client).get({
3441
+ security: [{ scheme: "bearer", type: "http" }],
3442
+ url: "/catalog/option-values/{id}",
3443
+ ...options
3444
+ });
3445
+ var patchCatalogOptionValuesById = (options) => (options.client ?? client).patch({
3446
+ security: [{ scheme: "bearer", type: "http" }],
3447
+ url: "/catalog/option-values/{id}",
3448
+ ...options,
3449
+ headers: {
3450
+ "Content-Type": "application/vnd.api+json",
3451
+ ...options.headers
3452
+ }
3453
+ });
3333
3454
  var patchClinicalMealPlansByIdArchive = (options) => (options.client ?? client).patch({
3334
3455
  security: [{ scheme: "bearer", type: "http" }],
3335
3456
  url: "/clinical/meal-plans/{id}/archive",
@@ -3438,6 +3559,15 @@ var patchClinicalPracticeToolsByIdArchive = (options) => (options.client ?? clie
3438
3559
  ...options.headers
3439
3560
  }
3440
3561
  });
3562
+ var postCatalogViews = (options) => (options.client ?? client).post({
3563
+ security: [{ scheme: "bearer", type: "http" }],
3564
+ url: "/catalog/views",
3565
+ ...options,
3566
+ headers: {
3567
+ "Content-Type": "application/vnd.api+json",
3568
+ ...options.headers
3569
+ }
3570
+ });
3441
3571
  var deleteSocialTrendingWatchesById = (options) => (options.client ?? client).delete({
3442
3572
  security: [{ scheme: "bearer", type: "http" }],
3443
3573
  url: "/social/trending/watches/{id}",
@@ -3457,6 +3587,15 @@ var patchSocialTrendingWatchesById = (options) => (options.client ?? client).pat
3457
3587
  ...options.headers
3458
3588
  }
3459
3589
  });
3590
+ var patchSchedulingEventTypesByIdArchive = (options) => (options.client ?? client).patch({
3591
+ security: [{ scheme: "bearer", type: "http" }],
3592
+ url: "/scheduling/event-types/{id}/archive",
3593
+ ...options,
3594
+ headers: {
3595
+ "Content-Type": "application/vnd.api+json",
3596
+ ...options.headers
3597
+ }
3598
+ });
3460
3599
  var getSocialMetricsCampaignBySocialCampaignId = (options) => (options.client ?? client).get({
3461
3600
  security: [{ scheme: "bearer", type: "http" }],
3462
3601
  url: "/social/metrics/campaign/{social_campaign_id}",
@@ -3592,6 +3731,11 @@ var patchBusinessAssociateAgreementsByIdTerminate = (options) => (options.client
3592
3731
  ...options.headers
3593
3732
  }
3594
3733
  });
3734
+ var getVoiceTranscriptionJobsMine = (options) => (options.client ?? client).get({
3735
+ security: [{ scheme: "bearer", type: "http" }],
3736
+ url: "/voice/transcription-jobs/mine",
3737
+ ...options
3738
+ });
3595
3739
  var patchClinicalPracticeResourcesByIdRestore = (options) => (options.client ?? client).patch({
3596
3740
  security: [{ scheme: "bearer", type: "http" }],
3597
3741
  url: "/clinical/practice-resources/{id}/restore",
@@ -3642,6 +3786,15 @@ var patchInvitationsByIdAccept = (options) => (options.client ?? client).patch({
3642
3786
  ...options.headers
3643
3787
  }
3644
3788
  });
3789
+ var patchThreadsByIdMetadata = (options) => (options.client ?? client).patch({
3790
+ security: [{ scheme: "bearer", type: "http" }],
3791
+ url: "/threads/{id}/metadata",
3792
+ ...options,
3793
+ headers: {
3794
+ "Content-Type": "application/vnd.api+json",
3795
+ ...options.headers
3796
+ }
3797
+ });
3645
3798
  var getCreditPackagesById = (options) => (options.client ?? client).get({
3646
3799
  security: [{ scheme: "bearer", type: "http" }],
3647
3800
  url: "/credit-packages/{id}",
@@ -3840,6 +3993,15 @@ var getSchedulingBookingsById = (options) => (options.client ?? client).get({
3840
3993
  url: "/scheduling/bookings/{id}",
3841
3994
  ...options
3842
3995
  });
3996
+ var postEmailMarketingCampaignsByIdGenerateEmails = (options) => (options.client ?? client).post({
3997
+ security: [{ scheme: "bearer", type: "http" }],
3998
+ url: "/email-marketing/campaigns/{id}/generate-emails",
3999
+ ...options,
4000
+ headers: {
4001
+ "Content-Type": "application/vnd.api+json",
4002
+ ...options.headers
4003
+ }
4004
+ });
3843
4005
  var deleteClinicalClientGoalsByIdPermanent = (options) => (options.client ?? client).delete({
3844
4006
  security: [{ scheme: "bearer", type: "http" }],
3845
4007
  url: "/clinical/client-goals/{id}/permanent",
@@ -3901,6 +4063,11 @@ var postSchedulingParticipants = (options) => (options.client ?? client).post({
3901
4063
  ...options.headers
3902
4064
  }
3903
4065
  });
4066
+ var getCatalogPriceListEntriesPriceListByPriceListId = (options) => (options.client ?? client).get({
4067
+ security: [{ scheme: "bearer", type: "http" }],
4068
+ url: "/catalog/price-list-entries/price-list/{price_list_id}",
4069
+ ...options
4070
+ });
3904
4071
  var getNotificationLogsById = (options) => (options.client ?? client).get({
3905
4072
  security: [{ scheme: "bearer", type: "http" }],
3906
4073
  url: "/notification-logs/{id}",
@@ -4000,6 +4167,15 @@ var patchClinicalHealthMetricsByIdArchive = (options) => (options.client ?? clie
4000
4167
  ...options.headers
4001
4168
  }
4002
4169
  });
4170
+ var postEmailMarketingCampaignsByIdImportRecipients = (options) => (options.client ?? client).post({
4171
+ security: [{ scheme: "bearer", type: "http" }],
4172
+ url: "/email-marketing/campaigns/{id}/import-recipients",
4173
+ ...options,
4174
+ headers: {
4175
+ "Content-Type": "application/vnd.api+json",
4176
+ ...options.headers
4177
+ }
4178
+ });
4003
4179
  var getCrmExportsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4004
4180
  security: [{ scheme: "bearer", type: "http" }],
4005
4181
  url: "/crm/exports/workspace/{workspace_id}",
@@ -4010,6 +4186,11 @@ var getTrainingSessionsAgentsByAgentIdSessions = (options) => (options.client ??
4010
4186
  url: "/training-sessions/agents/{agent_id}/sessions",
4011
4187
  ...options
4012
4188
  });
4189
+ var getCatalogViewsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4190
+ security: [{ scheme: "bearer", type: "http" }],
4191
+ url: "/catalog/views/workspace/{workspace_id}",
4192
+ ...options
4193
+ });
4013
4194
  var patchLegalDocumentsByIdPublish = (options) => (options.client ?? client).patch({
4014
4195
  security: [{ scheme: "bearer", type: "http" }],
4015
4196
  url: "/legal-documents/{id}/publish",
@@ -4044,6 +4225,20 @@ var getCatalogProductsWorkspaceByWorkspaceId = (options) => (options.client ?? c
4044
4225
  url: "/catalog/products/workspace/{workspace_id}",
4045
4226
  ...options
4046
4227
  });
4228
+ var getVoiceTranscriptionJobs = (options) => (options.client ?? client).get({
4229
+ security: [{ scheme: "bearer", type: "http" }],
4230
+ url: "/voice/transcription-jobs",
4231
+ ...options
4232
+ });
4233
+ var postVoiceTranscriptionJobs = (options) => (options.client ?? client).post({
4234
+ security: [{ scheme: "bearer", type: "http" }],
4235
+ url: "/voice/transcription-jobs",
4236
+ ...options,
4237
+ headers: {
4238
+ "Content-Type": "application/vnd.api+json",
4239
+ ...options.headers
4240
+ }
4241
+ });
4047
4242
  var deleteVoiceSessionsById = (options) => (options.client ?? client).delete({
4048
4243
  security: [{ scheme: "bearer", type: "http" }],
4049
4244
  url: "/voice/sessions/{id}",
@@ -4068,6 +4263,11 @@ var postEphiAssets = (options) => (options.client ?? client).post({
4068
4263
  ...options.headers
4069
4264
  }
4070
4265
  });
4266
+ var getEmailMarketingGeneratedEmailsCampaignByCampaignId = (options) => (options.client ?? client).get({
4267
+ security: [{ scheme: "bearer", type: "http" }],
4268
+ url: "/email-marketing/generated-emails/campaign/{campaign_id}",
4269
+ ...options
4270
+ });
4071
4271
  var getVoiceSessions = (options) => (options.client ?? client).get({
4072
4272
  security: [{ scheme: "bearer", type: "http" }],
4073
4273
  url: "/voice/sessions",
@@ -4134,6 +4334,15 @@ var postClinicalPracticeTools = (options) => (options.client ?? client).post({
4134
4334
  ...options.headers
4135
4335
  }
4136
4336
  });
4337
+ var postMessages = (options) => (options.client ?? client).post({
4338
+ security: [{ scheme: "bearer", type: "http" }],
4339
+ url: "/messages",
4340
+ ...options,
4341
+ headers: {
4342
+ "Content-Type": "application/vnd.api+json",
4343
+ ...options.headers
4344
+ }
4345
+ });
4137
4346
  var patchCampaignsSequencesByIdResume = (options) => (options.client ?? client).patch({
4138
4347
  security: [{ scheme: "bearer", type: "http" }],
4139
4348
  url: "/campaigns/sequences/{id}/resume",
@@ -4454,6 +4663,15 @@ var postThreadsByIdExport = (options) => (options.client ?? client).post({
4454
4663
  ...options.headers
4455
4664
  }
4456
4665
  });
4666
+ var patchEmailMarketingGeneratedEmailsByIdReject = (options) => (options.client ?? client).patch({
4667
+ security: [{ scheme: "bearer", type: "http" }],
4668
+ url: "/email-marketing/generated-emails/{id}/reject",
4669
+ ...options,
4670
+ headers: {
4671
+ "Content-Type": "application/vnd.api+json",
4672
+ ...options.headers
4673
+ }
4674
+ });
4457
4675
  var getVoiceTranscriptionResults = (options) => (options.client ?? client).get({
4458
4676
  security: [{ scheme: "bearer", type: "http" }],
4459
4677
  url: "/voice/transcription-results",
@@ -5043,6 +5261,20 @@ var getPlansById = (options) => (options.client ?? client).get({
5043
5261
  url: "/plans/{id}",
5044
5262
  ...options
5045
5263
  });
5264
+ var deleteCatalogPriceListEntriesById = (options) => (options.client ?? client).delete({
5265
+ security: [{ scheme: "bearer", type: "http" }],
5266
+ url: "/catalog/price-list-entries/{id}",
5267
+ ...options
5268
+ });
5269
+ var patchCatalogPriceListEntriesById = (options) => (options.client ?? client).patch({
5270
+ security: [{ scheme: "bearer", type: "http" }],
5271
+ url: "/catalog/price-list-entries/{id}",
5272
+ ...options,
5273
+ headers: {
5274
+ "Content-Type": "application/vnd.api+json",
5275
+ ...options.headers
5276
+ }
5277
+ });
5046
5278
  var deleteUserProfilesById = (options) => (options.client ?? client).delete({
5047
5279
  security: [{ scheme: "bearer", type: "http" }],
5048
5280
  url: "/user-profiles/{id}",
@@ -5517,6 +5749,24 @@ var getTransactions = (options) => (options.client ?? client).get({
5517
5749
  url: "/transactions",
5518
5750
  ...options
5519
5751
  });
5752
+ var patchCampaignsSequencesByIdActivate = (options) => (options.client ?? client).patch({
5753
+ security: [{ scheme: "bearer", type: "http" }],
5754
+ url: "/campaigns/sequences/{id}/activate",
5755
+ ...options,
5756
+ headers: {
5757
+ "Content-Type": "application/vnd.api+json",
5758
+ ...options.headers
5759
+ }
5760
+ });
5761
+ var postEmailMarketingCampaignsByIdExport = (options) => (options.client ?? client).post({
5762
+ security: [{ scheme: "bearer", type: "http" }],
5763
+ url: "/email-marketing/campaigns/{id}/export",
5764
+ ...options,
5765
+ headers: {
5766
+ "Content-Type": "application/vnd.api+json",
5767
+ ...options.headers
5768
+ }
5769
+ });
5520
5770
  var postContentGenerateImagePrompt = (options) => (options.client ?? client).post({
5521
5771
  security: [{ scheme: "bearer", type: "http" }],
5522
5772
  url: "/content/generate-image-prompt",
@@ -5599,6 +5849,25 @@ var postSearchSavedByIdRun = (options) => (options.client ?? client).post({
5599
5849
  ...options.headers
5600
5850
  }
5601
5851
  });
5852
+ var deleteCatalogPriceListsById = (options) => (options.client ?? client).delete({
5853
+ security: [{ scheme: "bearer", type: "http" }],
5854
+ url: "/catalog/price-lists/{id}",
5855
+ ...options
5856
+ });
5857
+ var getCatalogPriceListsById = (options) => (options.client ?? client).get({
5858
+ security: [{ scheme: "bearer", type: "http" }],
5859
+ url: "/catalog/price-lists/{id}",
5860
+ ...options
5861
+ });
5862
+ var patchCatalogPriceListsById = (options) => (options.client ?? client).patch({
5863
+ security: [{ scheme: "bearer", type: "http" }],
5864
+ url: "/catalog/price-lists/{id}",
5865
+ ...options,
5866
+ headers: {
5867
+ "Content-Type": "application/vnd.api+json",
5868
+ ...options.headers
5869
+ }
5870
+ });
5602
5871
  var patchWalletPlan = (options) => (options.client ?? client).patch({
5603
5872
  security: [{ scheme: "bearer", type: "http" }],
5604
5873
  url: "/wallet/plan",
@@ -5697,6 +5966,11 @@ var postClinicalClientGoals = (options) => (options.client ?? client).post({
5697
5966
  ...options.headers
5698
5967
  }
5699
5968
  });
5969
+ var getCampaignsSequenceStepsById = (options) => (options.client ?? client).get({
5970
+ security: [{ scheme: "bearer", type: "http" }],
5971
+ url: "/campaigns/sequence-steps/{id}",
5972
+ ...options
5973
+ });
5700
5974
  var getBreachNotificationArtifacts = (options) => (options.client ?? client).get({
5701
5975
  security: [{ scheme: "bearer", type: "http" }],
5702
5976
  url: "/breach-notification-artifacts",
@@ -5781,6 +6055,15 @@ var patchSchedulingEventsByIdReschedule = (options) => (options.client ?? client
5781
6055
  ...options.headers
5782
6056
  }
5783
6057
  });
6058
+ var postCatalogOptionValues = (options) => (options.client ?? client).post({
6059
+ security: [{ scheme: "bearer", type: "http" }],
6060
+ url: "/catalog/option-values",
6061
+ ...options,
6062
+ headers: {
6063
+ "Content-Type": "application/vnd.api+json",
6064
+ ...options.headers
6065
+ }
6066
+ });
5784
6067
  var getClinicalPracticeResources = (options) => (options.client ?? client).get({
5785
6068
  security: [{ scheme: "bearer", type: "http" }],
5786
6069
  url: "/clinical/practice-resources",
@@ -5800,6 +6083,11 @@ var getCampaignsSequencesWorkspaceByWorkspaceId = (options) => (options.client ?
5800
6083
  url: "/campaigns/sequences/workspace/{workspace_id}",
5801
6084
  ...options
5802
6085
  });
6086
+ var getCampaignsRecipientsCampaignByCampaignId = (options) => (options.client ?? client).get({
6087
+ security: [{ scheme: "bearer", type: "http" }],
6088
+ url: "/campaigns/recipients/campaign/{campaign_id}",
6089
+ ...options
6090
+ });
5803
6091
  var patchClinicalClientSupplementsByIdRestore = (options) => (options.client ?? client).patch({
5804
6092
  security: [{ scheme: "bearer", type: "http" }],
5805
6093
  url: "/clinical/client-supplements/{id}/restore",
@@ -5953,6 +6241,15 @@ var postSchedulingBookings = (options) => (options.client ?? client).post({
5953
6241
  ...options.headers
5954
6242
  }
5955
6243
  });
6244
+ var postCatalogOptionTypes = (options) => (options.client ?? client).post({
6245
+ security: [{ scheme: "bearer", type: "http" }],
6246
+ url: "/catalog/option-types",
6247
+ ...options,
6248
+ headers: {
6249
+ "Content-Type": "application/vnd.api+json",
6250
+ ...options.headers
6251
+ }
6252
+ });
5956
6253
  var getSchedulingCalendarSyncs = (options) => (options.client ?? client).get({
5957
6254
  security: [{ scheme: "bearer", type: "http" }],
5958
6255
  url: "/scheduling/calendar-syncs",
@@ -6143,6 +6440,20 @@ var patchWalletPlanCancel = (options) => (options.client ?? client).patch({
6143
6440
  ...options.headers
6144
6441
  }
6145
6442
  });
6443
+ var getSchedulingEventTypesBySlug = (options) => (options.client ?? client).get({
6444
+ security: [{ scheme: "bearer", type: "http" }],
6445
+ url: "/scheduling/event-types/by-slug",
6446
+ ...options
6447
+ });
6448
+ var postEmailMarketingCampaignsByIdOptimizeSubjects = (options) => (options.client ?? client).post({
6449
+ security: [{ scheme: "bearer", type: "http" }],
6450
+ url: "/email-marketing/campaigns/{id}/optimize-subjects",
6451
+ ...options,
6452
+ headers: {
6453
+ "Content-Type": "application/vnd.api+json",
6454
+ ...options.headers
6455
+ }
6456
+ });
6146
6457
  var getTenantsByTenantIdDocumentStats = (options) => (options.client ?? client).get({
6147
6458
  security: [{ scheme: "bearer", type: "http" }],
6148
6459
  url: "/tenants/{tenant_id}/document_stats",
@@ -6375,6 +6686,21 @@ var patchTenantsById = (options) => (options.client ?? client).patch({
6375
6686
  ...options.headers
6376
6687
  }
6377
6688
  });
6689
+ var deleteVoiceTranscriptionJobsById = (options) => (options.client ?? client).delete({
6690
+ security: [{ scheme: "bearer", type: "http" }],
6691
+ url: "/voice/transcription-jobs/{id}",
6692
+ ...options
6693
+ });
6694
+ var getVoiceTranscriptionJobsById = (options) => (options.client ?? client).get({
6695
+ security: [{ scheme: "bearer", type: "http" }],
6696
+ url: "/voice/transcription-jobs/{id}",
6697
+ ...options
6698
+ });
6699
+ var getSchedulingBookingsByBooker = (options) => (options.client ?? client).get({
6700
+ security: [{ scheme: "bearer", type: "http" }],
6701
+ url: "/scheduling/bookings/by-booker",
6702
+ ...options
6703
+ });
6378
6704
  var getPlans = (options) => (options.client ?? client).get({
6379
6705
  security: [{ scheme: "bearer", type: "http" }],
6380
6706
  url: "/plans",
@@ -6426,6 +6752,11 @@ var postContentEditImage = (options) => (options.client ?? client).post({
6426
6752
  ...options.headers
6427
6753
  }
6428
6754
  });
6755
+ var getCatalogPriceListsApplicationByApplicationId = (options) => (options.client ?? client).get({
6756
+ security: [{ scheme: "bearer", type: "http" }],
6757
+ url: "/catalog/price-lists/application/{application_id}",
6758
+ ...options
6759
+ });
6429
6760
  var postEmailRecipients = (options) => (options.client ?? client).post({
6430
6761
  security: [{ scheme: "bearer", type: "http" }],
6431
6762
  url: "/email/recipients",
@@ -6514,6 +6845,25 @@ var getDataStoreRecordsByNamespace = (options) => (options.client ?? client).get
6514
6845
  url: "/data_store/records/by_namespace",
6515
6846
  ...options
6516
6847
  });
6848
+ var deleteCampaignsSequencesById = (options) => (options.client ?? client).delete({
6849
+ security: [{ scheme: "bearer", type: "http" }],
6850
+ url: "/campaigns/sequences/{id}",
6851
+ ...options
6852
+ });
6853
+ var getCampaignsSequencesById = (options) => (options.client ?? client).get({
6854
+ security: [{ scheme: "bearer", type: "http" }],
6855
+ url: "/campaigns/sequences/{id}",
6856
+ ...options
6857
+ });
6858
+ var patchCampaignsSequencesById = (options) => (options.client ?? client).patch({
6859
+ security: [{ scheme: "bearer", type: "http" }],
6860
+ url: "/campaigns/sequences/{id}",
6861
+ ...options,
6862
+ headers: {
6863
+ "Content-Type": "application/vnd.api+json",
6864
+ ...options.headers
6865
+ }
6866
+ });
6517
6867
  var patchCrawlerSchedulesByIdEnable = (options) => (options.client ?? client).patch({
6518
6868
  security: [{ scheme: "bearer", type: "http" }],
6519
6869
  url: "/crawler/schedules/{id}/enable",
@@ -6543,6 +6893,11 @@ var getApiKeysActive = (options) => (options.client ?? client).get({
6543
6893
  url: "/api-keys/active",
6544
6894
  ...options
6545
6895
  });
6896
+ var getCatalogOptionValuesOptionTypeByOptionTypeId = (options) => (options.client ?? client).get({
6897
+ security: [{ scheme: "bearer", type: "http" }],
6898
+ url: "/catalog/option-values/option-type/{option_type_id}",
6899
+ ...options
6900
+ });
6546
6901
  var patchExtractionResultsByIdSaveCorrections = (options) => (options.client ?? client).patch({
6547
6902
  security: [{ scheme: "bearer", type: "http" }],
6548
6903
  url: "/extraction/results/{id}/save-corrections",
@@ -6917,6 +7272,15 @@ var patchClinicalGoalTemplatesByIdArchive = (options) => (options.client ?? clie
6917
7272
  ...options.headers
6918
7273
  }
6919
7274
  });
7275
+ var patchEmailMarketingGeneratedEmailsByIdSchedule = (options) => (options.client ?? client).patch({
7276
+ security: [{ scheme: "bearer", type: "http" }],
7277
+ url: "/email-marketing/generated-emails/{id}/schedule",
7278
+ ...options,
7279
+ headers: {
7280
+ "Content-Type": "application/vnd.api+json",
7281
+ ...options.headers
7282
+ }
7283
+ });
6920
7284
  var patchClinicalNotesByIdReject = (options) => (options.client ?? client).patch({
6921
7285
  security: [{ scheme: "bearer", type: "http" }],
6922
7286
  url: "/clinical/notes/{id}/reject",
@@ -7072,6 +7436,15 @@ var patchComplianceDocumentTemplatesById = (options) => (options.client ?? clien
7072
7436
  ...options.headers
7073
7437
  }
7074
7438
  });
7439
+ var patchMessagesById = (options) => (options.client ?? client).patch({
7440
+ security: [{ scheme: "bearer", type: "http" }],
7441
+ url: "/messages/{id}",
7442
+ ...options,
7443
+ headers: {
7444
+ "Content-Type": "application/vnd.api+json",
7445
+ ...options.headers
7446
+ }
7447
+ });
7075
7448
  var postCrmDeals = (options) => (options.client ?? client).post({
7076
7449
  security: [{ scheme: "bearer", type: "http" }],
7077
7450
  url: "/crm/deals",
@@ -7099,6 +7472,15 @@ var patchDataSubjectRequestsByIdStatus = (options) => (options.client ?? client)
7099
7472
  ...options.headers
7100
7473
  }
7101
7474
  });
7475
+ var patchCampaignsSequencesByIdComplete = (options) => (options.client ?? client).patch({
7476
+ security: [{ scheme: "bearer", type: "http" }],
7477
+ url: "/campaigns/sequences/{id}/complete",
7478
+ ...options,
7479
+ headers: {
7480
+ "Content-Type": "application/vnd.api+json",
7481
+ ...options.headers
7482
+ }
7483
+ });
7102
7484
  var getCrmActivitiesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
7103
7485
  security: [{ scheme: "bearer", type: "http" }],
7104
7486
  url: "/crm/activities/workspace/{workspace_id}",
@@ -7212,6 +7594,11 @@ var patchBusinessAssociateAgreementsByIdSign = (options) => (options.client ?? c
7212
7594
  ...options.headers
7213
7595
  }
7214
7596
  });
7597
+ var getCampaignsRecipientsById = (options) => (options.client ?? client).get({
7598
+ security: [{ scheme: "bearer", type: "http" }],
7599
+ url: "/campaigns/recipients/{id}",
7600
+ ...options
7601
+ });
7215
7602
  var getComplianceDocumentTemplates = (options) => (options.client ?? client).get({
7216
7603
  security: [{ scheme: "bearer", type: "http" }],
7217
7604
  url: "/compliance-document-templates",
@@ -7320,6 +7707,11 @@ var getAgentVersionRevisions = (options) => (options.client ?? client).get({
7320
7707
  url: "/agent-version-revisions",
7321
7708
  ...options
7322
7709
  });
7710
+ var getVoiceTranscriptionJobsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
7711
+ security: [{ scheme: "bearer", type: "http" }],
7712
+ url: "/voice/transcription-jobs/workspace/{workspace_id}",
7713
+ ...options
7714
+ });
7323
7715
  var postTrainingExamplesBulkDelete = (options) => (options.client ?? client).post({
7324
7716
  security: [{ scheme: "bearer", type: "http" }],
7325
7717
  url: "/training-examples/bulk-delete",
@@ -8039,7 +8431,7 @@ function createAgentsNamespace(rb) {
8039
8431
  createTestResult: async (attributes, options) => {
8040
8432
  return rb.execute(
8041
8433
  postAgentTestResults,
8042
- { body: { data: { type: "agent_test_result", attributes } } },
8434
+ { body: { data: { type: "agent-test-result", attributes } } },
8043
8435
  options
8044
8436
  );
8045
8437
  },
@@ -8165,7 +8557,7 @@ function createAgentsNamespace(rb) {
8165
8557
  create: async (attributes, options) => {
8166
8558
  return rb.execute(
8167
8559
  postAgentVersions,
8168
- { body: { data: { type: "agent_version", attributes } } },
8560
+ { body: { data: { type: "agent-version", attributes } } },
8169
8561
  options
8170
8562
  );
8171
8563
  },
@@ -8194,7 +8586,7 @@ function createAgentsNamespace(rb) {
8194
8586
  path: { id },
8195
8587
  body: {
8196
8588
  data: {
8197
- type: "agent_version",
8589
+ type: "agent-version",
8198
8590
  attributes: { system_field_name: fieldName }
8199
8591
  }
8200
8592
  }
@@ -8226,7 +8618,7 @@ function createAgentsNamespace(rb) {
8226
8618
  path: { id },
8227
8619
  body: {
8228
8620
  data: {
8229
- type: "agent_version",
8621
+ type: "agent-version",
8230
8622
  attributes: { system_field_name: fieldName }
8231
8623
  }
8232
8624
  }
@@ -8261,7 +8653,7 @@ function createAgentsNamespace(rb) {
8261
8653
  path: { id },
8262
8654
  body: {
8263
8655
  data: {
8264
- type: "agent_version",
8656
+ type: "agent-version",
8265
8657
  attributes: { system_field_names: fieldNames }
8266
8658
  }
8267
8659
  }
@@ -8359,7 +8751,7 @@ function createAgentsNamespace(rb) {
8359
8751
  {
8360
8752
  body: {
8361
8753
  data: {
8362
- type: "agent_version_comparison",
8754
+ type: "agent-version-comparison",
8363
8755
  attributes: {
8364
8756
  version_a_id: versionAId,
8365
8757
  version_b_id: versionBId
@@ -8412,7 +8804,7 @@ function createAgentsNamespace(rb) {
8412
8804
  postAgentsByIdSchemaVersions,
8413
8805
  {
8414
8806
  path: { id: agentId },
8415
- body: { data: { type: "agent_version", attributes } }
8807
+ body: { data: { type: "agent-version", attributes } }
8416
8808
  },
8417
8809
  options
8418
8810
  );
@@ -8454,7 +8846,7 @@ function createAgentsNamespace(rb) {
8454
8846
  patchAgentsByIdSchemaVersionsByVersionId,
8455
8847
  {
8456
8848
  path: { id: agentId, version_id: versionId },
8457
- body: { data: { type: "agent_version", attributes } }
8849
+ body: { data: { type: "agent-version", attributes } }
8458
8850
  },
8459
8851
  options
8460
8852
  );
@@ -8584,7 +8976,7 @@ function createAgentsNamespace(rb) {
8584
8976
  create: async (attributes, options) => {
8585
8977
  return rb.execute(
8586
8978
  postTrainingExamples,
8587
- { body: { data: { type: "training_example", attributes } } },
8979
+ { body: { data: { type: "training-example", attributes } } },
8588
8980
  options
8589
8981
  );
8590
8982
  },
@@ -8612,7 +9004,7 @@ function createAgentsNamespace(rb) {
8612
9004
  patchTrainingExamplesById,
8613
9005
  {
8614
9006
  path: { id },
8615
- body: { data: { id, type: "training_example", attributes } }
9007
+ body: { data: { id, type: "training-example", attributes } }
8616
9008
  },
8617
9009
  options
8618
9010
  );
@@ -8636,7 +9028,7 @@ function createAgentsNamespace(rb) {
8636
9028
  {
8637
9029
  body: {
8638
9030
  data: examples.map((attrs) => ({
8639
- type: "training_example",
9031
+ type: "training-example",
8640
9032
  attributes: attrs
8641
9033
  }))
8642
9034
  }
@@ -8658,7 +9050,7 @@ function createAgentsNamespace(rb) {
8658
9050
  return rb.execute(
8659
9051
  postTrainingExamplesBulkDelete,
8660
9052
  {
8661
- body: { data: ids.map((id) => ({ type: "training_example", id })) }
9053
+ body: { data: ids.map((id) => ({ type: "training-example", id })) }
8662
9054
  },
8663
9055
  options
8664
9056
  );
@@ -8679,7 +9071,7 @@ function createAgentsNamespace(rb) {
8679
9071
  {
8680
9072
  body: {
8681
9073
  data: {
8682
- type: "training_example",
9074
+ type: "training-example",
8683
9075
  attributes: { query }
8684
9076
  }
8685
9077
  }
@@ -8836,7 +9228,7 @@ function createAgentsNamespace(rb) {
8836
9228
  create: async (attributes, options) => {
8837
9229
  return rb.execute(
8838
9230
  postFieldTemplates,
8839
- { body: { data: { type: "field_template", attributes } } },
9231
+ { body: { data: { type: "field-template", attributes } } },
8840
9232
  options
8841
9233
  );
8842
9234
  },
@@ -9553,7 +9945,7 @@ function createAiNamespace(rb) {
9553
9945
  postAiGraphNodes,
9554
9946
  {
9555
9947
  body: {
9556
- data: { type: "graph_node", attributes }
9948
+ data: { type: "graph-node", attributes }
9557
9949
  }
9558
9950
  },
9559
9951
  options
@@ -9665,7 +10057,7 @@ function createBillingNamespace(rb) {
9665
10057
  body: {
9666
10058
  data: {
9667
10059
  id: walletId,
9668
- type: "wallet",
10060
+ type: "wallet-public",
9669
10061
  attributes: { plan_slug: planSlug }
9670
10062
  }
9671
10063
  }
@@ -9692,7 +10084,9 @@ function createBillingNamespace(rb) {
9692
10084
  }
9693
10085
  return rb.execute(
9694
10086
  patchWalletCredits,
9695
- { body: { data: { id: walletId, type: "wallet", attributes } } },
10087
+ {
10088
+ body: { data: { id: walletId, type: "wallet-public", attributes } }
10089
+ },
9696
10090
  options
9697
10091
  );
9698
10092
  },
@@ -9716,7 +10110,9 @@ function createBillingNamespace(rb) {
9716
10110
  attributes.package_id = opts.packageId;
9717
10111
  return rb.execute(
9718
10112
  patchWalletAutoTopUp,
9719
- { body: { data: { id: walletId, type: "wallet", attributes } } },
10113
+ {
10114
+ body: { data: { id: walletId, type: "wallet-public", attributes } }
10115
+ },
9720
10116
  options
9721
10117
  );
9722
10118
  },
@@ -9784,7 +10180,7 @@ function createBillingNamespace(rb) {
9784
10180
  patchWalletAddons,
9785
10181
  {
9786
10182
  body: {
9787
- data: { type: "wallet", attributes }
10183
+ data: { type: "wallet-public", attributes }
9788
10184
  }
9789
10185
  },
9790
10186
  options
@@ -9839,7 +10235,7 @@ function createBillingNamespace(rb) {
9839
10235
  body: {
9840
10236
  data: {
9841
10237
  id: walletId,
9842
- type: "wallet",
10238
+ type: "wallet-public",
9843
10239
  attributes: { immediate }
9844
10240
  }
9845
10241
  }
@@ -9870,7 +10266,7 @@ function createBillingNamespace(rb) {
9870
10266
  patchWalletPaymentRetry,
9871
10267
  {
9872
10268
  body: {
9873
- data: { id: walletId, type: "wallet", attributes: {} }
10269
+ data: { id: walletId, type: "wallet-public", attributes: {} }
9874
10270
  }
9875
10271
  },
9876
10272
  options
@@ -10450,7 +10846,7 @@ function createBillingNamespace(rb) {
10450
10846
  postFeatureDefinitions,
10451
10847
  {
10452
10848
  body: {
10453
- data: { type: "feature_definition", attributes: attrs }
10849
+ data: { type: "feature-definition", attributes: attrs }
10454
10850
  }
10455
10851
  },
10456
10852
  options
@@ -10463,7 +10859,7 @@ function createBillingNamespace(rb) {
10463
10859
  {
10464
10860
  path: { id },
10465
10861
  body: {
10466
- data: { id, type: "feature_definition", attributes: attrs }
10862
+ data: { id, type: "feature-definition", attributes: attrs }
10467
10863
  }
10468
10864
  },
10469
10865
  options
@@ -10684,14 +11080,10 @@ function createCatalogNamespace(rb) {
10684
11080
  *
10685
11081
  * @example
10686
11082
  * ```typescript
10687
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10688
- *
10689
- * // First page of 20 products
10690
11083
  * const products = await client.catalog.products.list('ws_abc123', {
10691
11084
  * page: 1,
10692
11085
  * pageSize: 20,
10693
11086
  * });
10694
- * console.log(products.map((p) => p.id));
10695
11087
  * ```
10696
11088
  */
10697
11089
  list: async (workspaceId, options) => {
@@ -10713,8 +11105,6 @@ function createCatalogNamespace(rb) {
10713
11105
  *
10714
11106
  * @example
10715
11107
  * ```typescript
10716
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10717
- *
10718
11108
  * const product = await client.catalog.products.get('prod_abc123');
10719
11109
  * console.log(product.attributes.name);
10720
11110
  * ```
@@ -10729,26 +11119,21 @@ function createCatalogNamespace(rb) {
10729
11119
  /**
10730
11120
  * Create a new product in the catalog.
10731
11121
  *
10732
- * Supply all required and optional product attributes in the `attributes`
10733
- * map. At minimum you should include a name, workspace association, and
10734
- * any pricing or inventory fields required by your schema.
10735
- *
10736
- * @param attributes - Key/value map of product attributes to persist.
10737
- * Must include at minimum `workspace_id` and `name`.
11122
+ * @param attributes - Product attributes. Must include `workspace_id` and `name`.
11123
+ * `base_price` is a decimal string (e.g. `'29.99'`).
10738
11124
  * @param options - Optional request-level overrides.
10739
11125
  * @returns A promise that resolves to the newly created {@link CatalogProduct}.
10740
11126
  *
10741
11127
  * @example
10742
11128
  * ```typescript
10743
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10744
- *
10745
11129
  * const product = await client.catalog.products.create({
10746
11130
  * workspace_id: 'ws_abc123',
10747
11131
  * name: 'Classic Tote Bag',
10748
11132
  * description: 'Durable canvas tote in multiple colors.',
10749
- * price_cents: 2999,
11133
+ * base_price: '29.99',
11134
+ * currency: 'USD',
11135
+ * sku: 'TOTE-001',
10750
11136
  * });
10751
- * console.log(product.id); // 'prod_...'
10752
11137
  * ```
10753
11138
  */
10754
11139
  create: async (attributes, options) => {
@@ -10756,17 +11141,14 @@ function createCatalogNamespace(rb) {
10756
11141
  postCatalogProducts,
10757
11142
  {
10758
11143
  body: {
10759
- data: { type: "catalog_product", attributes }
11144
+ data: { type: "catalog-product", attributes }
10760
11145
  }
10761
11146
  },
10762
11147
  options
10763
11148
  );
10764
11149
  },
10765
11150
  /**
10766
- * Update an existing product's attributes.
10767
- *
10768
- * Only the fields present in `attributes` are updated; omitted fields
10769
- * retain their current values (PATCH semantics).
11151
+ * Update an existing product's attributes (PATCH semantics).
10770
11152
  *
10771
11153
  * @param id - The unique identifier of the product to update.
10772
11154
  * @param attributes - Key/value map of attributes to change.
@@ -10775,13 +11157,10 @@ function createCatalogNamespace(rb) {
10775
11157
  *
10776
11158
  * @example
10777
11159
  * ```typescript
10778
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10779
- *
10780
11160
  * const updated = await client.catalog.products.update('prod_abc123', {
10781
- * price_cents: 3499,
11161
+ * base_price: '34.99',
10782
11162
  * description: 'Now available in a wider colour range.',
10783
11163
  * });
10784
- * console.log(updated.attributes.price_cents); // 3499
10785
11164
  * ```
10786
11165
  */
10787
11166
  update: async (id, attributes, options) => {
@@ -10790,7 +11169,7 @@ function createCatalogNamespace(rb) {
10790
11169
  {
10791
11170
  path: { id },
10792
11171
  body: {
10793
- data: { type: "catalog_product", id, attributes }
11172
+ data: { type: "catalog-product", id, attributes }
10794
11173
  }
10795
11174
  },
10796
11175
  options
@@ -10799,19 +11178,13 @@ function createCatalogNamespace(rb) {
10799
11178
  /**
10800
11179
  * Permanently delete a product from the catalog.
10801
11180
  *
10802
- * This operation is destructive and cannot be undone. All variants
10803
- * associated with the product will also be removed.
10804
- *
10805
11181
  * @param id - The unique identifier of the product to delete.
10806
11182
  * @param options - Optional request-level overrides.
10807
11183
  * @returns A promise that resolves to `true` on successful deletion.
10808
11184
  *
10809
11185
  * @example
10810
11186
  * ```typescript
10811
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10812
- *
10813
11187
  * await client.catalog.products.delete('prod_abc123');
10814
- * // Product and its variants are now gone
10815
11188
  * ```
10816
11189
  */
10817
11190
  delete: async (id, options) => {
@@ -10827,9 +11200,6 @@ function createCatalogNamespace(rb) {
10827
11200
  *
10828
11201
  * A variant represents a specific, purchasable version of a product
10829
11202
  * differentiated by one or more options such as size, colour, or material.
10830
- * Every variant belongs to exactly one parent product. Common use cases:
10831
- * - A t-shirt product with variants for S / M / L in red / blue
10832
- * - A subscription product with monthly and annual billing variants
10833
11203
  */
10834
11204
  variants: {
10835
11205
  /**
@@ -10841,8 +11211,6 @@ function createCatalogNamespace(rb) {
10841
11211
  *
10842
11212
  * @example
10843
11213
  * ```typescript
10844
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10845
- *
10846
11214
  * const variant = await client.catalog.variants.get('var_abc123');
10847
11215
  * console.log(variant.attributes.sku);
10848
11216
  * ```
@@ -10857,55 +11225,44 @@ function createCatalogNamespace(rb) {
10857
11225
  /**
10858
11226
  * List all variants that belong to a specific product.
10859
11227
  *
10860
- * Use this to enumerate the full set of purchasable SKUs for a product
10861
- * before presenting them in a storefront or admin UI.
10862
- *
10863
11228
  * @param productId - The ID of the parent product whose variants to list.
10864
- * @param options - Optional request-level overrides.
11229
+ * @param options - Optional pagination and request-level overrides.
10865
11230
  * @returns A promise that resolves to an array of {@link CatalogProductVariant} records.
10866
11231
  *
10867
11232
  * @example
10868
11233
  * ```typescript
10869
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10870
- *
10871
- * const variants = await client.catalog.variants.listByProduct('prod_abc123');
10872
- * for (const v of variants) {
10873
- * console.log(v.attributes.sku, v.attributes.price_cents);
10874
- * }
11234
+ * const variants = await client.catalog.variants.listByProduct('prod_abc123', {
11235
+ * page: 1,
11236
+ * pageSize: 50,
11237
+ * });
10875
11238
  * ```
10876
11239
  */
10877
11240
  listByProduct: async (productId, options) => {
10878
11241
  return rb.execute(
10879
11242
  getCatalogProductVariantsProductByProductId,
10880
- { path: { product_id: productId } },
11243
+ {
11244
+ path: { product_id: productId },
11245
+ ...buildPageQuery(options?.page, options?.pageSize)
11246
+ },
10881
11247
  options
10882
11248
  );
10883
11249
  },
10884
11250
  /**
10885
11251
  * Create a new variant for a product.
10886
11252
  *
10887
- * The `attributes` map must include the `product_id` linking the variant
10888
- * to its parent product, along with any distinguishing option values
10889
- * (e.g. `size`, `color`) and pricing/inventory fields.
10890
- *
10891
- * @param attributes - Key/value map of variant attributes. Must include
10892
- * `product_id` to associate the variant with a product.
11253
+ * @param attributes - Variant attributes. Must include `product_id`.
11254
+ * `price_override` is a decimal string (e.g. `'34.99'`).
10893
11255
  * @param options - Optional request-level overrides.
10894
11256
  * @returns A promise that resolves to the newly created {@link CatalogProductVariant}.
10895
11257
  *
10896
11258
  * @example
10897
11259
  * ```typescript
10898
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10899
- *
10900
11260
  * const variant = await client.catalog.variants.create({
10901
11261
  * product_id: 'prod_abc123',
10902
11262
  * sku: 'TOTE-RED-M',
10903
- * color: 'red',
10904
- * size: 'M',
10905
- * price_cents: 2999,
10906
- * inventory_quantity: 50,
11263
+ * price_override: '34.99',
11264
+ * status: 'active',
10907
11265
  * });
10908
- * console.log(variant.id); // 'var_...'
10909
11266
  * ```
10910
11267
  */
10911
11268
  create: async (attributes, options) => {
@@ -10913,17 +11270,14 @@ function createCatalogNamespace(rb) {
10913
11270
  postCatalogProductVariants,
10914
11271
  {
10915
11272
  body: {
10916
- data: { type: "catalog_product_variant", attributes }
11273
+ data: { type: "catalog-product-variant", attributes }
10917
11274
  }
10918
11275
  },
10919
11276
  options
10920
11277
  );
10921
11278
  },
10922
11279
  /**
10923
- * Update an existing product variant's attributes.
10924
- *
10925
- * Only the fields present in `attributes` are changed; all other fields
10926
- * retain their current values (PATCH semantics).
11280
+ * Update an existing product variant's attributes (PATCH semantics).
10927
11281
  *
10928
11282
  * @param id - The unique identifier of the variant to update.
10929
11283
  * @param attributes - Key/value map of attributes to change.
@@ -10932,13 +11286,9 @@ function createCatalogNamespace(rb) {
10932
11286
  *
10933
11287
  * @example
10934
11288
  * ```typescript
10935
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10936
- *
10937
- * // Restock a variant
10938
11289
  * const variant = await client.catalog.variants.update('var_abc123', {
10939
- * inventory_quantity: 100,
11290
+ * price_override: '39.99',
10940
11291
  * });
10941
- * console.log(variant.attributes.inventory_quantity); // 100
10942
11292
  * ```
10943
11293
  */
10944
11294
  update: async (id, attributes, options) => {
@@ -10947,7 +11297,7 @@ function createCatalogNamespace(rb) {
10947
11297
  {
10948
11298
  path: { id },
10949
11299
  body: {
10950
- data: { type: "catalog_product_variant", id, attributes }
11300
+ data: { type: "catalog-product-variant", id, attributes }
10951
11301
  }
10952
11302
  },
10953
11303
  options
@@ -10962,8 +11312,6 @@ function createCatalogNamespace(rb) {
10962
11312
  *
10963
11313
  * @example
10964
11314
  * ```typescript
10965
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10966
- *
10967
11315
  * await client.catalog.variants.delete('var_abc123');
10968
11316
  * ```
10969
11317
  */
@@ -10975,41 +11323,274 @@ function createCatalogNamespace(rb) {
10975
11323
  );
10976
11324
  }
10977
11325
  },
11326
+ /**
11327
+ * Option Types — product option definitions (e.g. Size, Color).
11328
+ *
11329
+ * Option types are application-scoped definitions for variant differentiation.
11330
+ * Each option type has option values (e.g. Size has S, M, L, XL).
11331
+ */
11332
+ optionTypes: {
11333
+ /**
11334
+ * List all option types defined for an application.
11335
+ *
11336
+ * @param applicationId - The ID of the application whose option types to list.
11337
+ * @param options - Optional pagination and request-level overrides.
11338
+ * @returns A promise that resolves to an array of {@link CatalogOptionType} records.
11339
+ *
11340
+ * @example
11341
+ * ```typescript
11342
+ * const types = await client.catalog.optionTypes.listByApplication('app_abc');
11343
+ * ```
11344
+ */
11345
+ listByApplication: async (applicationId, options) => {
11346
+ return rb.execute(
11347
+ getCatalogOptionTypesApplicationByApplicationId,
11348
+ {
11349
+ path: { application_id: applicationId },
11350
+ ...buildPageQuery(options?.page, options?.pageSize)
11351
+ },
11352
+ options
11353
+ );
11354
+ },
11355
+ /**
11356
+ * Fetch a single option type by its unique ID.
11357
+ *
11358
+ * @param id - The unique identifier of the option type.
11359
+ * @param options - Optional request-level overrides.
11360
+ * @returns A promise that resolves to the matching {@link CatalogOptionType}.
11361
+ *
11362
+ * @example
11363
+ * ```typescript
11364
+ * const optionType = await client.catalog.optionTypes.get('ot_abc123');
11365
+ * ```
11366
+ */
11367
+ get: async (id, options) => {
11368
+ return rb.execute(
11369
+ getCatalogOptionTypesById,
11370
+ { path: { id } },
11371
+ options
11372
+ );
11373
+ },
11374
+ /**
11375
+ * Create a new option type for an application.
11376
+ *
11377
+ * @param attributes - Option type attributes. Must include `application_id` and `name`.
11378
+ * @param options - Optional request-level overrides.
11379
+ * @returns A promise that resolves to the newly created {@link CatalogOptionType}.
11380
+ *
11381
+ * @example
11382
+ * ```typescript
11383
+ * const sizeType = await client.catalog.optionTypes.create({
11384
+ * application_id: 'app_abc',
11385
+ * name: 'size',
11386
+ * display_name: 'Size',
11387
+ * });
11388
+ * ```
11389
+ */
11390
+ create: async (attributes, options) => {
11391
+ return rb.execute(
11392
+ postCatalogOptionTypes,
11393
+ {
11394
+ body: {
11395
+ data: { type: "catalog-option-type", attributes }
11396
+ }
11397
+ },
11398
+ options
11399
+ );
11400
+ },
11401
+ /**
11402
+ * Update an existing option type (PATCH semantics).
11403
+ *
11404
+ * @param id - The unique identifier of the option type to update.
11405
+ * @param attributes - Key/value map of attributes to change.
11406
+ * @param options - Optional request-level overrides.
11407
+ * @returns A promise that resolves to the updated {@link CatalogOptionType}.
11408
+ *
11409
+ * @example
11410
+ * ```typescript
11411
+ * const updated = await client.catalog.optionTypes.update('ot_abc123', {
11412
+ * display_name: 'Shoe Size',
11413
+ * });
11414
+ * ```
11415
+ */
11416
+ update: async (id, attributes, options) => {
11417
+ return rb.execute(
11418
+ patchCatalogOptionTypesById,
11419
+ {
11420
+ path: { id },
11421
+ body: {
11422
+ data: { type: "catalog-option-type", id, attributes }
11423
+ }
11424
+ },
11425
+ options
11426
+ );
11427
+ },
11428
+ /**
11429
+ * Permanently delete an option type.
11430
+ *
11431
+ * @param id - The unique identifier of the option type to delete.
11432
+ * @param options - Optional request-level overrides.
11433
+ * @returns A promise that resolves to `true` on successful deletion.
11434
+ *
11435
+ * @example
11436
+ * ```typescript
11437
+ * await client.catalog.optionTypes.delete('ot_abc123');
11438
+ * ```
11439
+ */
11440
+ delete: async (id, options) => {
11441
+ return rb.executeDelete(
11442
+ deleteCatalogOptionTypesById,
11443
+ { path: { id } },
11444
+ options
11445
+ );
11446
+ }
11447
+ },
11448
+ /**
11449
+ * Option Values — individual values within an option type (e.g. "Small", "Red").
11450
+ */
11451
+ optionValues: {
11452
+ /**
11453
+ * List all option values for an option type.
11454
+ *
11455
+ * @param optionTypeId - The ID of the option type whose values to list.
11456
+ * @param options - Optional pagination and request-level overrides.
11457
+ * @returns A promise that resolves to an array of {@link CatalogOptionValue} records.
11458
+ *
11459
+ * @example
11460
+ * ```typescript
11461
+ * const values = await client.catalog.optionValues.listByOptionType('ot_abc123');
11462
+ * ```
11463
+ */
11464
+ listByOptionType: async (optionTypeId, options) => {
11465
+ return rb.execute(
11466
+ getCatalogOptionValuesOptionTypeByOptionTypeId,
11467
+ {
11468
+ path: { option_type_id: optionTypeId },
11469
+ ...buildPageQuery(options?.page, options?.pageSize)
11470
+ },
11471
+ options
11472
+ );
11473
+ },
11474
+ /**
11475
+ * Fetch a single option value by its unique ID.
11476
+ *
11477
+ * @param id - The unique identifier of the option value.
11478
+ * @param options - Optional request-level overrides.
11479
+ * @returns A promise that resolves to the matching {@link CatalogOptionValue}.
11480
+ *
11481
+ * @example
11482
+ * ```typescript
11483
+ * const value = await client.catalog.optionValues.get('ov_abc123');
11484
+ * ```
11485
+ */
11486
+ get: async (id, options) => {
11487
+ return rb.execute(
11488
+ getCatalogOptionValuesById,
11489
+ { path: { id } },
11490
+ options
11491
+ );
11492
+ },
11493
+ /**
11494
+ * Create a new option value within an option type.
11495
+ *
11496
+ * @param attributes - Option value attributes. Must include `option_type_id` and `name`.
11497
+ * @param options - Optional request-level overrides.
11498
+ * @returns A promise that resolves to the newly created {@link CatalogOptionValue}.
11499
+ *
11500
+ * @example
11501
+ * ```typescript
11502
+ * const small = await client.catalog.optionValues.create({
11503
+ * option_type_id: 'ot_abc123',
11504
+ * name: 'small',
11505
+ * display_name: 'S',
11506
+ * });
11507
+ * ```
11508
+ */
11509
+ create: async (attributes, options) => {
11510
+ return rb.execute(
11511
+ postCatalogOptionValues,
11512
+ {
11513
+ body: {
11514
+ data: { type: "catalog-option-value", attributes }
11515
+ }
11516
+ },
11517
+ options
11518
+ );
11519
+ },
11520
+ /**
11521
+ * Update an existing option value (PATCH semantics).
11522
+ *
11523
+ * @param id - The unique identifier of the option value to update.
11524
+ * @param attributes - Key/value map of attributes to change.
11525
+ * @param options - Optional request-level overrides.
11526
+ * @returns A promise that resolves to the updated {@link CatalogOptionValue}.
11527
+ *
11528
+ * @example
11529
+ * ```typescript
11530
+ * const updated = await client.catalog.optionValues.update('ov_abc123', {
11531
+ * display_name: 'Small (S)',
11532
+ * });
11533
+ * ```
11534
+ */
11535
+ update: async (id, attributes, options) => {
11536
+ return rb.execute(
11537
+ patchCatalogOptionValuesById,
11538
+ {
11539
+ path: { id },
11540
+ body: {
11541
+ data: { type: "catalog-option-value", id, attributes }
11542
+ }
11543
+ },
11544
+ options
11545
+ );
11546
+ },
11547
+ /**
11548
+ * Permanently delete an option value.
11549
+ *
11550
+ * @param id - The unique identifier of the option value to delete.
11551
+ * @param options - Optional request-level overrides.
11552
+ * @returns A promise that resolves to `true` on successful deletion.
11553
+ *
11554
+ * @example
11555
+ * ```typescript
11556
+ * await client.catalog.optionValues.delete('ov_abc123');
11557
+ * ```
11558
+ */
11559
+ delete: async (id, options) => {
11560
+ return rb.executeDelete(
11561
+ deleteCatalogOptionValuesById,
11562
+ { path: { id } },
11563
+ options
11564
+ );
11565
+ }
11566
+ },
10978
11567
  /**
10979
11568
  * Taxonomies — product classification trees.
10980
11569
  *
10981
11570
  * A taxonomy is a named hierarchical category system scoped to an
10982
- * application (not a workspace). For example, an e-commerce application
10983
- * might have a "Product Categories" taxonomy with a tree of nodes such as
10984
- * Clothing > Tops > T-Shirts. Taxonomies are the containers; individual
10985
- * categories within them are managed via {@link taxonomyNodes}.
11571
+ * application. Taxonomies are the containers; individual categories
11572
+ * within them are managed via {@link taxonomyNodes}.
10986
11573
  */
10987
11574
  taxonomies: {
10988
11575
  /**
10989
11576
  * List all taxonomies defined for an application.
10990
11577
  *
10991
- * Taxonomies are application-scoped rather than workspace-scoped because
10992
- * the same classification structure typically applies across all of an
10993
- * ISV's customer workspaces.
10994
- *
10995
11578
  * @param applicationId - The ID of the application whose taxonomies to list.
10996
- * @param options - Optional request-level overrides.
11579
+ * @param options - Optional pagination and request-level overrides.
10997
11580
  * @returns A promise that resolves to an array of {@link CatalogTaxonomy} records.
10998
11581
  *
10999
11582
  * @example
11000
11583
  * ```typescript
11001
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11002
- *
11003
11584
  * const taxonomies = await client.catalog.taxonomies.listByApplication('app_abc123');
11004
- * for (const t of taxonomies) {
11005
- * console.log(t.id, t.attributes.name);
11006
- * }
11007
11585
  * ```
11008
11586
  */
11009
11587
  listByApplication: async (applicationId, options) => {
11010
11588
  return rb.execute(
11011
11589
  getCatalogTaxonomiesApplicationByApplicationId,
11012
- { path: { application_id: applicationId } },
11590
+ {
11591
+ path: { application_id: applicationId },
11592
+ ...buildPageQuery(options?.page, options?.pageSize)
11593
+ },
11013
11594
  options
11014
11595
  );
11015
11596
  },
@@ -11022,10 +11603,7 @@ function createCatalogNamespace(rb) {
11022
11603
  *
11023
11604
  * @example
11024
11605
  * ```typescript
11025
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11026
- *
11027
11606
  * const taxonomy = await client.catalog.taxonomies.get('tax_abc123');
11028
- * console.log(taxonomy.attributes.name); // 'Product Categories'
11029
11607
  * ```
11030
11608
  */
11031
11609
  get: async (id, options) => {
@@ -11038,24 +11616,18 @@ function createCatalogNamespace(rb) {
11038
11616
  /**
11039
11617
  * Create a new taxonomy for an application.
11040
11618
  *
11041
- * After creating a taxonomy, use {@link taxonomyNodes.create} to populate
11042
- * its tree with category nodes.
11043
- *
11044
- * @param attributes - Key/value map of taxonomy attributes. Must include
11045
- * `application_id` and a `name` for the taxonomy.
11619
+ * @param attributes - Taxonomy attributes. Must include `application_id` and `name`.
11046
11620
  * @param options - Optional request-level overrides.
11047
11621
  * @returns A promise that resolves to the newly created {@link CatalogTaxonomy}.
11048
11622
  *
11049
11623
  * @example
11050
11624
  * ```typescript
11051
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11052
- *
11053
11625
  * const taxonomy = await client.catalog.taxonomies.create({
11054
11626
  * application_id: 'app_abc123',
11055
11627
  * name: 'Product Categories',
11056
- * description: 'Top-level classification for all products.',
11628
+ * is_hierarchical: true,
11629
+ * max_depth: 5,
11057
11630
  * });
11058
- * console.log(taxonomy.id); // 'tax_...'
11059
11631
  * ```
11060
11632
  */
11061
11633
  create: async (attributes, options) => {
@@ -11063,16 +11635,14 @@ function createCatalogNamespace(rb) {
11063
11635
  postCatalogTaxonomies,
11064
11636
  {
11065
11637
  body: {
11066
- data: { type: "catalog_taxonomy", attributes }
11638
+ data: { type: "catalog-taxonomy", attributes }
11067
11639
  }
11068
11640
  },
11069
11641
  options
11070
11642
  );
11071
11643
  },
11072
11644
  /**
11073
- * Update an existing taxonomy's attributes.
11074
- *
11075
- * Only the fields present in `attributes` are changed (PATCH semantics).
11645
+ * Update an existing taxonomy's attributes (PATCH semantics).
11076
11646
  *
11077
11647
  * @param id - The unique identifier of the taxonomy to update.
11078
11648
  * @param attributes - Key/value map of attributes to change.
@@ -11081,12 +11651,9 @@ function createCatalogNamespace(rb) {
11081
11651
  *
11082
11652
  * @example
11083
11653
  * ```typescript
11084
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11085
- *
11086
11654
  * const taxonomy = await client.catalog.taxonomies.update('tax_abc123', {
11087
11655
  * name: 'Catalog Categories',
11088
11656
  * });
11089
- * console.log(taxonomy.attributes.name); // 'Catalog Categories'
11090
11657
  * ```
11091
11658
  */
11092
11659
  update: async (id, attributes, options) => {
@@ -11095,7 +11662,7 @@ function createCatalogNamespace(rb) {
11095
11662
  {
11096
11663
  path: { id },
11097
11664
  body: {
11098
- data: { type: "catalog_taxonomy", id, attributes }
11665
+ data: { type: "catalog-taxonomy", id, attributes }
11099
11666
  }
11100
11667
  },
11101
11668
  options
@@ -11110,8 +11677,6 @@ function createCatalogNamespace(rb) {
11110
11677
  *
11111
11678
  * @example
11112
11679
  * ```typescript
11113
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11114
- *
11115
11680
  * await client.catalog.taxonomies.delete('tax_abc123');
11116
11681
  * ```
11117
11682
  */
@@ -11127,34 +11692,29 @@ function createCatalogNamespace(rb) {
11127
11692
  * Taxonomy nodes — individual nodes within a taxonomy tree.
11128
11693
  *
11129
11694
  * Each node represents a single category (e.g. "T-Shirts") within a
11130
- * taxonomy. Nodes can be nested to arbitrary depth by setting a
11131
- * `parent_node_id`, forming the hierarchical tree. A node with no parent
11132
- * is a root-level category.
11695
+ * taxonomy. Nodes can be nested by setting `parent_id`.
11133
11696
  */
11134
11697
  taxonomyNodes: {
11135
11698
  /**
11136
11699
  * List all nodes that belong to a specific taxonomy.
11137
11700
  *
11138
- * Returns the full flat list of nodes for the taxonomy. To reconstruct
11139
- * the tree, group nodes by their `parent_node_id` field.
11140
- *
11141
11701
  * @param taxonomyId - The ID of the taxonomy whose nodes to list.
11142
- * @param options - Optional request-level overrides.
11702
+ * @param options - Optional pagination and request-level overrides.
11143
11703
  * @returns A promise that resolves to an array of {@link CatalogTaxonomyNode} records.
11144
11704
  *
11145
11705
  * @example
11146
11706
  * ```typescript
11147
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11148
- *
11149
11707
  * const nodes = await client.catalog.taxonomyNodes.listByTaxonomy('tax_abc123');
11150
- * const roots = nodes.filter((n) => !n.attributes.parent_node_id);
11151
- * console.log('Root categories:', roots.map((n) => n.attributes.name));
11708
+ * const roots = nodes.filter((n) => !n.attributes.parent_id);
11152
11709
  * ```
11153
11710
  */
11154
11711
  listByTaxonomy: async (taxonomyId, options) => {
11155
11712
  return rb.execute(
11156
11713
  getCatalogTaxonomyNodesTaxonomyByTaxonomyId,
11157
- { path: { taxonomy_id: taxonomyId } },
11714
+ {
11715
+ path: { taxonomy_id: taxonomyId },
11716
+ ...buildPageQuery(options?.page, options?.pageSize)
11717
+ },
11158
11718
  options
11159
11719
  );
11160
11720
  },
@@ -11167,10 +11727,7 @@ function createCatalogNamespace(rb) {
11167
11727
  *
11168
11728
  * @example
11169
11729
  * ```typescript
11170
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11171
- *
11172
11730
  * const node = await client.catalog.taxonomyNodes.get('node_abc123');
11173
- * console.log(node.attributes.name, node.attributes.parent_node_id);
11174
11731
  * ```
11175
11732
  */
11176
11733
  get: async (id, options) => {
@@ -11183,31 +11740,17 @@ function createCatalogNamespace(rb) {
11183
11740
  /**
11184
11741
  * Create a new node within a taxonomy.
11185
11742
  *
11186
- * To create a root-level category, omit `parent_node_id`. To nest a
11187
- * category under an existing node, include `parent_node_id` pointing to
11188
- * the parent's ID.
11189
- *
11190
- * @param attributes - Key/value map of node attributes. Must include
11191
- * `taxonomy_id` and `name`. Optionally include `parent_node_id` to
11192
- * nest the node within the tree.
11743
+ * @param attributes - Node attributes. Must include `taxonomy_id` and `name`.
11744
+ * Set `parent_id` to nest under an existing node.
11193
11745
  * @param options - Optional request-level overrides.
11194
11746
  * @returns A promise that resolves to the newly created {@link CatalogTaxonomyNode}.
11195
11747
  *
11196
11748
  * @example
11197
11749
  * ```typescript
11198
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11199
- *
11200
- * // Create a root-level category
11201
- * const clothing = await client.catalog.taxonomyNodes.create({
11202
- * taxonomy_id: 'tax_abc123',
11203
- * name: 'Clothing',
11204
- * });
11205
- *
11206
- * // Create a child category under 'Clothing'
11207
11750
  * const tops = await client.catalog.taxonomyNodes.create({
11208
11751
  * taxonomy_id: 'tax_abc123',
11209
11752
  * name: 'Tops',
11210
- * parent_node_id: clothing.id,
11753
+ * parent_id: clothing.id,
11211
11754
  * });
11212
11755
  * ```
11213
11756
  */
@@ -11216,18 +11759,14 @@ function createCatalogNamespace(rb) {
11216
11759
  postCatalogTaxonomyNodes,
11217
11760
  {
11218
11761
  body: {
11219
- data: { type: "catalog_taxonomy_node", attributes }
11762
+ data: { type: "catalog-taxonomy-node", attributes }
11220
11763
  }
11221
11764
  },
11222
11765
  options
11223
11766
  );
11224
11767
  },
11225
11768
  /**
11226
- * Update an existing taxonomy node's attributes.
11227
- *
11228
- * Only the fields present in `attributes` are changed (PATCH semantics).
11229
- * You can use this to rename a category or re-parent it within the tree
11230
- * by changing `parent_node_id`.
11769
+ * Update an existing taxonomy node (PATCH semantics).
11231
11770
  *
11232
11771
  * @param id - The unique identifier of the node to update.
11233
11772
  * @param attributes - Key/value map of attributes to change.
@@ -11236,13 +11775,9 @@ function createCatalogNamespace(rb) {
11236
11775
  *
11237
11776
  * @example
11238
11777
  * ```typescript
11239
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11240
- *
11241
- * // Rename a category
11242
11778
  * const node = await client.catalog.taxonomyNodes.update('node_abc123', {
11243
11779
  * name: 'Apparel',
11244
11780
  * });
11245
- * console.log(node.attributes.name); // 'Apparel'
11246
11781
  * ```
11247
11782
  */
11248
11783
  update: async (id, attributes, options) => {
@@ -11251,7 +11786,7 @@ function createCatalogNamespace(rb) {
11251
11786
  {
11252
11787
  path: { id },
11253
11788
  body: {
11254
- data: { type: "catalog_taxonomy_node", id, attributes }
11789
+ data: { type: "catalog-taxonomy-node", id, attributes }
11255
11790
  }
11256
11791
  },
11257
11792
  options
@@ -11260,18 +11795,12 @@ function createCatalogNamespace(rb) {
11260
11795
  /**
11261
11796
  * Permanently delete a taxonomy node.
11262
11797
  *
11263
- * If the node has child nodes, those children will also be removed
11264
- * recursively. Ensure products are re-categorised before deleting a node
11265
- * that has products assigned to it.
11266
- *
11267
11798
  * @param id - The unique identifier of the node to delete.
11268
11799
  * @param options - Optional request-level overrides.
11269
11800
  * @returns A promise that resolves to `true` on successful deletion.
11270
11801
  *
11271
11802
  * @example
11272
11803
  * ```typescript
11273
- * const client = new GptClient({ apiKey: 'sk_app_...' });
11274
- *
11275
11804
  * await client.catalog.taxonomyNodes.delete('node_abc123');
11276
11805
  * ```
11277
11806
  */
@@ -11282,6 +11811,352 @@ function createCatalogNamespace(rb) {
11282
11811
  options
11283
11812
  );
11284
11813
  }
11814
+ },
11815
+ /**
11816
+ * Catalog Views — composable, rule-based product lenses.
11817
+ *
11818
+ * Views filter and sort products for specific channels or use cases.
11819
+ */
11820
+ views: {
11821
+ /**
11822
+ * List all catalog views in a workspace.
11823
+ *
11824
+ * @param workspaceId - The ID of the workspace whose views to list.
11825
+ * @param options - Optional pagination and request-level overrides.
11826
+ * @returns A promise that resolves to an array of {@link CatalogView} records.
11827
+ *
11828
+ * @example
11829
+ * ```typescript
11830
+ * const views = await client.catalog.views.listByWorkspace('ws_abc123');
11831
+ * ```
11832
+ */
11833
+ listByWorkspace: async (workspaceId, options) => {
11834
+ return rb.execute(
11835
+ getCatalogViewsWorkspaceByWorkspaceId,
11836
+ {
11837
+ path: { workspace_id: workspaceId },
11838
+ ...buildPageQuery(options?.page, options?.pageSize)
11839
+ },
11840
+ options
11841
+ );
11842
+ },
11843
+ /**
11844
+ * Fetch a single catalog view by its unique ID.
11845
+ *
11846
+ * @param id - The unique identifier of the view.
11847
+ * @param options - Optional request-level overrides.
11848
+ * @returns A promise that resolves to the matching {@link CatalogView}.
11849
+ *
11850
+ * @example
11851
+ * ```typescript
11852
+ * const view = await client.catalog.views.get('cv_abc123');
11853
+ * ```
11854
+ */
11855
+ get: async (id, options) => {
11856
+ return rb.execute(
11857
+ getCatalogViewsById,
11858
+ { path: { id } },
11859
+ options
11860
+ );
11861
+ },
11862
+ /**
11863
+ * Create a new catalog view.
11864
+ *
11865
+ * @param attributes - View attributes. Must include `workspace_id` and `name`.
11866
+ * @param options - Optional request-level overrides.
11867
+ * @returns A promise that resolves to the newly created {@link CatalogView}.
11868
+ *
11869
+ * @example
11870
+ * ```typescript
11871
+ * const view = await client.catalog.views.create({
11872
+ * workspace_id: 'ws_abc123',
11873
+ * name: 'Featured Products',
11874
+ * channel_target: 'web',
11875
+ * max_items: 20,
11876
+ * });
11877
+ * ```
11878
+ */
11879
+ create: async (attributes, options) => {
11880
+ return rb.execute(
11881
+ postCatalogViews,
11882
+ {
11883
+ body: {
11884
+ data: { type: "catalog-view", attributes }
11885
+ }
11886
+ },
11887
+ options
11888
+ );
11889
+ },
11890
+ /**
11891
+ * Update an existing catalog view (PATCH semantics).
11892
+ *
11893
+ * @param id - The unique identifier of the view to update.
11894
+ * @param attributes - Key/value map of attributes to change.
11895
+ * @param options - Optional request-level overrides.
11896
+ * @returns A promise that resolves to the updated {@link CatalogView}.
11897
+ *
11898
+ * @example
11899
+ * ```typescript
11900
+ * const view = await client.catalog.views.update('cv_abc123', {
11901
+ * max_items: 50,
11902
+ * });
11903
+ * ```
11904
+ */
11905
+ update: async (id, attributes, options) => {
11906
+ return rb.execute(
11907
+ patchCatalogViewsById,
11908
+ {
11909
+ path: { id },
11910
+ body: {
11911
+ data: { type: "catalog-view", id, attributes }
11912
+ }
11913
+ },
11914
+ options
11915
+ );
11916
+ },
11917
+ /**
11918
+ * Permanently delete a catalog view.
11919
+ *
11920
+ * @param id - The unique identifier of the view to delete.
11921
+ * @param options - Optional request-level overrides.
11922
+ * @returns A promise that resolves to `true` on successful deletion.
11923
+ *
11924
+ * @example
11925
+ * ```typescript
11926
+ * await client.catalog.views.delete('cv_abc123');
11927
+ * ```
11928
+ */
11929
+ delete: async (id, options) => {
11930
+ return rb.executeDelete(
11931
+ deleteCatalogViewsById,
11932
+ { path: { id } },
11933
+ options
11934
+ );
11935
+ }
11936
+ },
11937
+ /**
11938
+ * Price Lists — named price configurations.
11939
+ *
11940
+ * Price lists are application-scoped and define pricing for products/variants
11941
+ * with fixed, percentage, or tiered strategies.
11942
+ */
11943
+ priceLists: {
11944
+ /**
11945
+ * List all price lists for an application.
11946
+ *
11947
+ * @param applicationId - The ID of the application whose price lists to list.
11948
+ * @param options - Optional pagination and request-level overrides.
11949
+ * @returns A promise that resolves to an array of {@link CatalogPriceList} records.
11950
+ *
11951
+ * @example
11952
+ * ```typescript
11953
+ * const lists = await client.catalog.priceLists.listByApplication('app_abc');
11954
+ * ```
11955
+ */
11956
+ listByApplication: async (applicationId, options) => {
11957
+ return rb.execute(
11958
+ getCatalogPriceListsApplicationByApplicationId,
11959
+ {
11960
+ path: { application_id: applicationId },
11961
+ ...buildPageQuery(options?.page, options?.pageSize)
11962
+ },
11963
+ options
11964
+ );
11965
+ },
11966
+ /**
11967
+ * Fetch a single price list by its unique ID.
11968
+ *
11969
+ * @param id - The unique identifier of the price list.
11970
+ * @param options - Optional request-level overrides.
11971
+ * @returns A promise that resolves to the matching {@link CatalogPriceList}.
11972
+ *
11973
+ * @example
11974
+ * ```typescript
11975
+ * const list = await client.catalog.priceLists.get('pl_abc123');
11976
+ * ```
11977
+ */
11978
+ get: async (id, options) => {
11979
+ return rb.execute(
11980
+ getCatalogPriceListsById,
11981
+ { path: { id } },
11982
+ options
11983
+ );
11984
+ },
11985
+ /**
11986
+ * Create a new price list for an application.
11987
+ *
11988
+ * @param attributes - Price list attributes. Must include `application_id` and `name`.
11989
+ * @param options - Optional request-level overrides.
11990
+ * @returns A promise that resolves to the newly created {@link CatalogPriceList}.
11991
+ *
11992
+ * @example
11993
+ * ```typescript
11994
+ * const list = await client.catalog.priceLists.create({
11995
+ * application_id: 'app_abc',
11996
+ * name: 'Wholesale Pricing',
11997
+ * currency: 'USD',
11998
+ * });
11999
+ * ```
12000
+ */
12001
+ create: async (attributes, options) => {
12002
+ return rb.execute(
12003
+ postCatalogPriceLists,
12004
+ {
12005
+ body: {
12006
+ data: { type: "catalog-price-list", attributes }
12007
+ }
12008
+ },
12009
+ options
12010
+ );
12011
+ },
12012
+ /**
12013
+ * Update an existing price list (PATCH semantics).
12014
+ *
12015
+ * @param id - The unique identifier of the price list to update.
12016
+ * @param attributes - Key/value map of attributes to change.
12017
+ * @param options - Optional request-level overrides.
12018
+ * @returns A promise that resolves to the updated {@link CatalogPriceList}.
12019
+ *
12020
+ * @example
12021
+ * ```typescript
12022
+ * const list = await client.catalog.priceLists.update('pl_abc123', {
12023
+ * name: 'VIP Pricing',
12024
+ * });
12025
+ * ```
12026
+ */
12027
+ update: async (id, attributes, options) => {
12028
+ return rb.execute(
12029
+ patchCatalogPriceListsById,
12030
+ {
12031
+ path: { id },
12032
+ body: {
12033
+ data: { type: "catalog-price-list", id, attributes }
12034
+ }
12035
+ },
12036
+ options
12037
+ );
12038
+ },
12039
+ /**
12040
+ * Permanently delete a price list.
12041
+ *
12042
+ * @param id - The unique identifier of the price list to delete.
12043
+ * @param options - Optional request-level overrides.
12044
+ * @returns A promise that resolves to `true` on successful deletion.
12045
+ *
12046
+ * @example
12047
+ * ```typescript
12048
+ * await client.catalog.priceLists.delete('pl_abc123');
12049
+ * ```
12050
+ */
12051
+ delete: async (id, options) => {
12052
+ return rb.executeDelete(
12053
+ deleteCatalogPriceListsById,
12054
+ { path: { id } },
12055
+ options
12056
+ );
12057
+ }
12058
+ },
12059
+ /**
12060
+ * Price List Entries — individual pricing rules within a price list.
12061
+ */
12062
+ priceListEntries: {
12063
+ /**
12064
+ * List all entries in a price list.
12065
+ *
12066
+ * @param priceListId - The ID of the price list whose entries to list.
12067
+ * @param options - Optional pagination and request-level overrides.
12068
+ * @returns A promise that resolves to an array of {@link CatalogPriceListEntry} records.
12069
+ *
12070
+ * @example
12071
+ * ```typescript
12072
+ * const entries = await client.catalog.priceListEntries.listByPriceList('pl_abc');
12073
+ * ```
12074
+ */
12075
+ listByPriceList: async (priceListId, options) => {
12076
+ return rb.execute(
12077
+ getCatalogPriceListEntriesPriceListByPriceListId,
12078
+ {
12079
+ path: { price_list_id: priceListId },
12080
+ ...buildPageQuery(options?.page, options?.pageSize)
12081
+ },
12082
+ options
12083
+ );
12084
+ },
12085
+ /**
12086
+ * Create a new entry in a price list.
12087
+ *
12088
+ * @param attributes - Entry attributes. Must include `price_list_id` and `price`.
12089
+ * Include either `product_id` or `variant_id` to target pricing.
12090
+ * @param options - Optional request-level overrides.
12091
+ * @returns A promise that resolves to the newly created {@link CatalogPriceListEntry}.
12092
+ *
12093
+ * @example
12094
+ * ```typescript
12095
+ * const entry = await client.catalog.priceListEntries.create({
12096
+ * price_list_id: 'pl_abc',
12097
+ * product_id: 'prod_xyz',
12098
+ * price: '24.99',
12099
+ * strategy: 'fixed',
12100
+ * });
12101
+ * ```
12102
+ */
12103
+ create: async (attributes, options) => {
12104
+ return rb.execute(
12105
+ postCatalogPriceListEntries,
12106
+ {
12107
+ body: {
12108
+ data: { type: "catalog-price-list-entry", attributes }
12109
+ }
12110
+ },
12111
+ options
12112
+ );
12113
+ },
12114
+ /**
12115
+ * Update an existing price list entry (PATCH semantics).
12116
+ *
12117
+ * @param id - The unique identifier of the entry to update.
12118
+ * @param attributes - Key/value map of attributes to change.
12119
+ * @param options - Optional request-level overrides.
12120
+ * @returns A promise that resolves to the updated {@link CatalogPriceListEntry}.
12121
+ *
12122
+ * @example
12123
+ * ```typescript
12124
+ * const entry = await client.catalog.priceListEntries.update('ple_abc', {
12125
+ * price: '19.99',
12126
+ * });
12127
+ * ```
12128
+ */
12129
+ update: async (id, attributes, options) => {
12130
+ return rb.execute(
12131
+ patchCatalogPriceListEntriesById,
12132
+ {
12133
+ path: { id },
12134
+ body: {
12135
+ data: { type: "catalog-price-list-entry", id, attributes }
12136
+ }
12137
+ },
12138
+ options
12139
+ );
12140
+ },
12141
+ /**
12142
+ * Permanently delete a price list entry.
12143
+ *
12144
+ * @param id - The unique identifier of the entry to delete.
12145
+ * @param options - Optional request-level overrides.
12146
+ * @returns A promise that resolves to `true` on successful deletion.
12147
+ *
12148
+ * @example
12149
+ * ```typescript
12150
+ * await client.catalog.priceListEntries.delete('ple_abc');
12151
+ * ```
12152
+ */
12153
+ delete: async (id, options) => {
12154
+ return rb.executeDelete(
12155
+ deleteCatalogPriceListEntriesById,
12156
+ { path: { id } },
12157
+ options
12158
+ );
12159
+ }
11285
12160
  }
11286
12161
  };
11287
12162
  }
@@ -11744,6 +12619,18 @@ function createClinicalNamespace(rb) {
11744
12619
  params ?? {},
11745
12620
  options
11746
12621
  ),
12622
+ /**
12623
+ * List sessions for a specific patient.
12624
+ *
12625
+ * @param params - Must include `patient_id`. Optional filter/pagination parameters.
12626
+ * @param options - Request options
12627
+ * @returns Array of {@link ClinicalSession} records
12628
+ */
12629
+ listByPatient: async (params, options) => rb.execute(
12630
+ getClinicalSessionsByPatient,
12631
+ { query: params },
12632
+ options
12633
+ ),
11747
12634
  /**
11748
12635
  * Get a single session by ID.
11749
12636
  *
@@ -11824,20 +12711,32 @@ function createClinicalNamespace(rb) {
11824
12711
  *
11825
12712
  * @param sessionId - Session UUID
11826
12713
  * @param workspaceId - Workspace UUID
12714
+ * @param triggerOptions - Optional pipeline targeting (pipeline_slug)
11827
12715
  * @param options - Request options
11828
12716
  * @returns {@link TriggerPipelineResponse} with execution_id (may be null if pipeline not configured)
11829
12717
  *
11830
12718
  * @example
11831
12719
  * ```typescript
12720
+ * // Default pipeline (post-session-documentation)
11832
12721
  * const { execution_id } = await client.clinical.sessions.triggerPipeline(
11833
12722
  * 'sess_xyz',
11834
12723
  * 'ws_123',
11835
12724
  * );
12725
+ *
12726
+ * // Specific pipeline by slug
12727
+ * const { execution_id: eid } = await client.clinical.sessions.triggerPipeline(
12728
+ * 'sess_xyz',
12729
+ * 'ws_123',
12730
+ * { pipeline_slug: 'chartless-quick-goals-update' },
12731
+ * );
11836
12732
  * ```
11837
12733
  */
11838
- triggerPipeline: async (sessionId, workspaceId, options) => rb.rawPost(
12734
+ triggerPipeline: async (sessionId, workspaceId, triggerOptions, options) => rb.rawPost(
11839
12735
  `/clinical/sessions/${sessionId}/trigger-pipeline`,
11840
- { workspace_id: workspaceId },
12736
+ {
12737
+ workspace_id: workspaceId,
12738
+ ...triggerOptions?.pipeline_slug ? { pipeline_slug: triggerOptions.pipeline_slug } : {}
12739
+ },
11841
12740
  options
11842
12741
  )
11843
12742
  },
@@ -14124,7 +15023,7 @@ function createComplianceNamespace(rb) {
14124
15023
  postBreachIncidents,
14125
15024
  {
14126
15025
  body: {
14127
- data: { type: "breach_incident", attributes }
15026
+ data: { type: "breach-incident", attributes }
14128
15027
  }
14129
15028
  },
14130
15029
  options
@@ -14158,7 +15057,7 @@ function createComplianceNamespace(rb) {
14158
15057
  {
14159
15058
  path: { id },
14160
15059
  body: {
14161
- data: { type: "breach_incident", id, attributes: { status } }
15060
+ data: { type: "breach-incident", id, attributes: { status } }
14162
15061
  }
14163
15062
  },
14164
15063
  options
@@ -14322,7 +15221,7 @@ function createComplianceNamespace(rb) {
14322
15221
  postConsentRecords,
14323
15222
  {
14324
15223
  body: {
14325
- data: { type: "consent_record", attributes }
15224
+ data: { type: "consent-record", attributes }
14326
15225
  }
14327
15226
  },
14328
15227
  options
@@ -14355,7 +15254,7 @@ function createComplianceNamespace(rb) {
14355
15254
  {
14356
15255
  path: { id },
14357
15256
  body: {
14358
- data: { type: "consent_record", id, attributes: {} }
15257
+ data: { type: "consent-record", id, attributes: {} }
14359
15258
  }
14360
15259
  },
14361
15260
  options
@@ -14440,7 +15339,7 @@ function createComplianceNamespace(rb) {
14440
15339
  {
14441
15340
  body: {
14442
15341
  data: {
14443
- type: "data_protection_impact_assessment",
15342
+ type: "data-protection-impact-assessment",
14444
15343
  attributes
14445
15344
  }
14446
15345
  }
@@ -14476,7 +15375,7 @@ function createComplianceNamespace(rb) {
14476
15375
  path: { id },
14477
15376
  body: {
14478
15377
  data: {
14479
- type: "data_protection_impact_assessment",
15378
+ type: "data-protection-impact-assessment",
14480
15379
  id,
14481
15380
  attributes
14482
15381
  }
@@ -14511,7 +15410,7 @@ function createComplianceNamespace(rb) {
14511
15410
  path: { id },
14512
15411
  body: {
14513
15412
  data: {
14514
- type: "data_protection_impact_assessment",
15413
+ type: "data-protection-impact-assessment",
14515
15414
  id,
14516
15415
  attributes: {}
14517
15416
  }
@@ -14600,7 +15499,7 @@ function createComplianceNamespace(rb) {
14600
15499
  postProcessingActivities,
14601
15500
  {
14602
15501
  body: {
14603
- data: { type: "processing_activity", attributes }
15502
+ data: { type: "processing-activity", attributes }
14604
15503
  }
14605
15504
  },
14606
15505
  options
@@ -14708,7 +15607,7 @@ function createComplianceNamespace(rb) {
14708
15607
  postRetentionPolicies,
14709
15608
  {
14710
15609
  body: {
14711
- data: { type: "retention_policy", attributes }
15610
+ data: { type: "retention-policy", attributes }
14712
15611
  }
14713
15612
  },
14714
15613
  options
@@ -14739,7 +15638,7 @@ function createComplianceNamespace(rb) {
14739
15638
  {
14740
15639
  path: { id },
14741
15640
  body: {
14742
- data: { type: "retention_policy", id, attributes }
15641
+ data: { type: "retention-policy", id, attributes }
14743
15642
  }
14744
15643
  },
14745
15644
  options
@@ -14850,7 +15749,7 @@ function createComplianceNamespace(rb) {
14850
15749
  postDataSubjectRequests,
14851
15750
  {
14852
15751
  body: {
14853
- data: { type: "data_subject_request", attributes }
15752
+ data: { type: "data-subject-request", attributes }
14854
15753
  }
14855
15754
  },
14856
15755
  options
@@ -14885,7 +15784,7 @@ function createComplianceNamespace(rb) {
14885
15784
  path: { id },
14886
15785
  body: {
14887
15786
  data: {
14888
- type: "data_subject_request",
15787
+ type: "data-subject-request",
14889
15788
  id,
14890
15789
  attributes: { status }
14891
15790
  }
@@ -14974,7 +15873,7 @@ function createComplianceNamespace(rb) {
14974
15873
  create: async (attributes, options) => {
14975
15874
  return rb.execute(
14976
15875
  postLegalDocuments,
14977
- { body: { data: { type: "legal_document", attributes } } },
15876
+ { body: { data: { type: "legal-document", attributes } } },
14978
15877
  options
14979
15878
  );
14980
15879
  },
@@ -15002,7 +15901,7 @@ function createComplianceNamespace(rb) {
15002
15901
  patchLegalDocumentsById,
15003
15902
  {
15004
15903
  path: { id },
15005
- body: { data: { type: "legal_document", id, attributes } }
15904
+ body: { data: { type: "legal-document", id, attributes } }
15006
15905
  },
15007
15906
  options
15008
15907
  );
@@ -15103,7 +16002,7 @@ function createComplianceNamespace(rb) {
15103
16002
  patchLegalDocumentsByIdPublish,
15104
16003
  {
15105
16004
  path: { id },
15106
- body: { data: { type: "legal_document", id, attributes: {} } }
16005
+ body: { data: { type: "legal-document", id, attributes: {} } }
15107
16006
  },
15108
16007
  options
15109
16008
  );
@@ -15131,7 +16030,7 @@ function createComplianceNamespace(rb) {
15131
16030
  patchLegalDocumentsByIdUnpublish,
15132
16031
  {
15133
16032
  path: { id },
15134
- body: { data: { type: "legal_document", id, attributes: {} } }
16033
+ body: { data: { type: "legal-document", id, attributes: {} } }
15135
16034
  },
15136
16035
  options
15137
16036
  );
@@ -17238,7 +18137,7 @@ function createCommunicationNamespace(rb) {
17238
18137
  create: async (attributes, options) => {
17239
18138
  return rb.execute(
17240
18139
  postNotificationMethods,
17241
- { body: { data: { type: "notification_method", attributes } } },
18140
+ { body: { data: { type: "notification-method", attributes } } },
17242
18141
  options
17243
18142
  );
17244
18143
  },
@@ -17270,7 +18169,7 @@ function createCommunicationNamespace(rb) {
17270
18169
  patchNotificationMethodsById,
17271
18170
  {
17272
18171
  path: { id },
17273
- body: { data: { id, type: "notification_method", attributes } }
18172
+ body: { data: { id, type: "notification-method", attributes } }
17274
18173
  },
17275
18174
  options
17276
18175
  );
@@ -17423,7 +18322,7 @@ function createCommunicationNamespace(rb) {
17423
18322
  create: async (attributes, options) => {
17424
18323
  return rb.execute(
17425
18324
  postNotificationPreferences,
17426
- { body: { data: { type: "notification_preference", attributes } } },
18325
+ { body: { data: { type: "notification-preference", attributes } } },
17427
18326
  options
17428
18327
  );
17429
18328
  },
@@ -17457,7 +18356,7 @@ function createCommunicationNamespace(rb) {
17457
18356
  {
17458
18357
  path: { id },
17459
18358
  body: {
17460
- data: { id, type: "notification_preference", attributes }
18359
+ data: { id, type: "notification-preference", attributes }
17461
18360
  }
17462
18361
  },
17463
18362
  options
@@ -17562,7 +18461,7 @@ function createConnectorsNamespace(rb) {
17562
18461
  */
17563
18462
  create: async (attributes, options) => rb.execute(
17564
18463
  postConnectors,
17565
- { body: { data: { type: "connector_instance", attributes } } },
18464
+ { body: { data: { type: "connector-instance", attributes } } },
17566
18465
  options
17567
18466
  ),
17568
18467
  /**
@@ -17589,7 +18488,7 @@ function createConnectorsNamespace(rb) {
17589
18488
  patchConnectorsById,
17590
18489
  {
17591
18490
  path: { id },
17592
- body: { data: { type: "connector_instance", id, attributes } }
18491
+ body: { data: { type: "connector-instance", id, attributes } }
17593
18492
  },
17594
18493
  options
17595
18494
  ),
@@ -17796,7 +18695,7 @@ function createConnectorsNamespace(rb) {
17796
18695
  {
17797
18696
  body: {
17798
18697
  data: {
17799
- type: "connector_instance",
18698
+ type: "connector-instance",
17800
18699
  connector_type: connectorType,
17801
18700
  workspace_id: workspaceId
17802
18701
  }
@@ -17843,7 +18742,7 @@ function createConnectorsNamespace(rb) {
17843
18742
  {
17844
18743
  body: {
17845
18744
  data: {
17846
- type: "connector_instance",
18745
+ type: "connector-instance",
17847
18746
  connector_type: connectorType,
17848
18747
  code,
17849
18748
  state,
@@ -17930,6 +18829,7 @@ function createConnectorsNamespace(rb) {
17930
18829
  path: { id: connectorInstanceId },
17931
18830
  body: {
17932
18831
  data: {
18832
+ type: "connector-instance",
17933
18833
  connector_id: connectorInstanceId,
17934
18834
  workspace_id: params.workspace_id,
17935
18835
  action_name: params.action_name,
@@ -18025,6 +18925,7 @@ function createConnectorsNamespace(rb) {
18025
18925
  path: { id: connectorInstanceId },
18026
18926
  body: {
18027
18927
  data: {
18928
+ type: "connector-instance",
18028
18929
  connector_id: connectorInstanceId,
18029
18930
  workspace_id: workspaceId,
18030
18931
  query: params.query,
@@ -18069,6 +18970,7 @@ function createConnectorsNamespace(rb) {
18069
18970
  path: { id: connectorInstanceId },
18070
18971
  body: {
18071
18972
  data: {
18973
+ type: "connector-instance",
18072
18974
  connector_id: connectorInstanceId,
18073
18975
  workspace_id: workspaceId,
18074
18976
  recipe_id: recipeId
@@ -18124,7 +19026,7 @@ function createConnectorsNamespace(rb) {
18124
19026
  {
18125
19027
  body: {
18126
19028
  data: {
18127
- type: "connector_instance",
19029
+ type: "connector-instance",
18128
19030
  connector_id: connectorId,
18129
19031
  workspace_id: workspaceId,
18130
19032
  email
@@ -18169,7 +19071,7 @@ function createConnectorsNamespace(rb) {
18169
19071
  {
18170
19072
  body: {
18171
19073
  data: {
18172
- type: "connector_instance",
19074
+ type: "connector-instance",
18173
19075
  connector_id: connectorId,
18174
19076
  workspace_id: workspaceId,
18175
19077
  ...attrs
@@ -18209,7 +19111,7 @@ function createConnectorsNamespace(rb) {
18209
19111
  {
18210
19112
  body: {
18211
19113
  data: {
18212
- type: "connector_instance",
19114
+ type: "connector-instance",
18213
19115
  connector_id: connectorId,
18214
19116
  workspace_id: workspaceId,
18215
19117
  patient_id: patientId
@@ -18473,7 +19375,7 @@ function createConnectorsNamespace(rb) {
18473
19375
  {
18474
19376
  body: {
18475
19377
  data: {
18476
- type: "connector_instance",
19378
+ type: "connector-instance",
18477
19379
  connector_type: "fullscript",
18478
19380
  workspace_id: workspaceId
18479
19381
  }
@@ -18516,7 +19418,7 @@ function createConnectorsNamespace(rb) {
18516
19418
  {
18517
19419
  body: {
18518
19420
  data: {
18519
- type: "connector_instance",
19421
+ type: "connector-instance",
18520
19422
  connector_type: "fullscript",
18521
19423
  code,
18522
19424
  state,
@@ -18534,7 +19436,7 @@ function createConnectorsNamespace(rb) {
18534
19436
  /**
18535
19437
  * Practice Better — clinical note push for linked PB contacts.
18536
19438
  *
18537
- * Requires an active `ConnectorInstance` with `connector_type: "practice_better"`
19439
+ * Requires an active `ConnectorInstance` with `connector_type: "practice-better"`
18538
19440
  * and stored credentials. The contact must have an `integration_link` custom entity
18539
19441
  * linking them to a PB client record.
18540
19442
  */
@@ -18567,6 +19469,7 @@ function createConnectorsNamespace(rb) {
18567
19469
  path: { id: connectorInstanceId },
18568
19470
  body: {
18569
19471
  data: {
19472
+ type: "connector-instance",
18570
19473
  connector_id: connectorInstanceId,
18571
19474
  ...params
18572
19475
  }
@@ -18678,7 +19581,7 @@ function createCrawlerNamespace(rb) {
18678
19581
  return rb.execute(
18679
19582
  postCrawlerJobs,
18680
19583
  {
18681
- body: { data: { type: "crawler_crawl_job", attributes } }
19584
+ body: { data: { type: "crawler-job", attributes } }
18682
19585
  },
18683
19586
  options
18684
19587
  );
@@ -18820,7 +19723,7 @@ function createCrawlerNamespace(rb) {
18820
19723
  return rb.execute(
18821
19724
  postCrawlerSchedules,
18822
19725
  {
18823
- body: { data: { type: "crawler_crawl_schedule", attributes } }
19726
+ body: { data: { type: "crawler-schedule", attributes } }
18824
19727
  },
18825
19728
  options
18826
19729
  );
@@ -18859,7 +19762,7 @@ function createCrawlerNamespace(rb) {
18859
19762
  patchCrawlerSchedulesById,
18860
19763
  {
18861
19764
  path: { id },
18862
- body: { data: { id, type: "crawler_crawl_schedule", attributes } }
19765
+ body: { data: { id, type: "crawler-schedule", attributes } }
18863
19766
  },
18864
19767
  options
18865
19768
  );
@@ -19078,7 +19981,7 @@ function createCrmNamespace(rb) {
19078
19981
  return rb.execute(
19079
19982
  postCrmContacts,
19080
19983
  {
19081
- body: { data: { type: "crm_contact", attributes } }
19984
+ body: { data: { type: "crm-contact", attributes } }
19082
19985
  },
19083
19986
  options
19084
19987
  );
@@ -19109,7 +20012,7 @@ function createCrmNamespace(rb) {
19109
20012
  patchCrmContactsById,
19110
20013
  {
19111
20014
  path: { id },
19112
- body: { data: { id, type: "crm_contact", attributes } }
20015
+ body: { data: { id, type: "crm-contact", attributes } }
19113
20016
  },
19114
20017
  options
19115
20018
  );
@@ -19211,7 +20114,7 @@ function createCrmNamespace(rb) {
19211
20114
  archive: async (id, options) => {
19212
20115
  return rb.execute(
19213
20116
  patchCrmContactsByIdArchive,
19214
- { path: { id }, body: { data: { type: "crm_contact", id } } },
20117
+ { path: { id }, body: { data: { type: "crm-contact", id } } },
19215
20118
  options
19216
20119
  );
19217
20120
  },
@@ -19332,7 +20235,7 @@ function createCrmNamespace(rb) {
19332
20235
  return rb.execute(
19333
20236
  postCrmCompanies,
19334
20237
  {
19335
- body: { data: { type: "crm_company", attributes } }
20238
+ body: { data: { type: "crm-company", attributes } }
19336
20239
  },
19337
20240
  options
19338
20241
  );
@@ -19362,7 +20265,7 @@ function createCrmNamespace(rb) {
19362
20265
  patchCrmCompaniesById,
19363
20266
  {
19364
20267
  path: { id },
19365
- body: { data: { id, type: "crm_company", attributes } }
20268
+ body: { data: { id, type: "crm-company", attributes } }
19366
20269
  },
19367
20270
  options
19368
20271
  );
@@ -19471,7 +20374,7 @@ function createCrmNamespace(rb) {
19471
20374
  return rb.execute(
19472
20375
  postCrmDeals,
19473
20376
  {
19474
- body: { data: { type: "crm_deal", attributes } }
20377
+ body: { data: { type: "crm-deal", attributes } }
19475
20378
  },
19476
20379
  options
19477
20380
  );
@@ -19503,7 +20406,7 @@ function createCrmNamespace(rb) {
19503
20406
  patchCrmDealsById,
19504
20407
  {
19505
20408
  path: { id },
19506
- body: { data: { id, type: "crm_deal", attributes } }
20409
+ body: { data: { id, type: "crm-deal", attributes } }
19507
20410
  },
19508
20411
  options
19509
20412
  );
@@ -19530,7 +20433,7 @@ function createCrmNamespace(rb) {
19530
20433
  patchCrmDealsByIdMoveStage,
19531
20434
  {
19532
20435
  path: { id },
19533
- body: { data: { type: "crm_deal", id, attributes } }
20436
+ body: { data: { type: "crm-deal", id, attributes } }
19534
20437
  },
19535
20438
  options
19536
20439
  );
@@ -19640,7 +20543,7 @@ function createCrmNamespace(rb) {
19640
20543
  return rb.execute(
19641
20544
  postCrmActivities,
19642
20545
  {
19643
- body: { data: { type: "crm_activity", attributes } }
20546
+ body: { data: { type: "crm-activity", attributes } }
19644
20547
  },
19645
20548
  options
19646
20549
  );
@@ -19667,7 +20570,7 @@ function createCrmNamespace(rb) {
19667
20570
  patchCrmActivitiesById,
19668
20571
  {
19669
20572
  path: { id },
19670
- body: { data: { id, type: "crm_activity", attributes } }
20573
+ body: { data: { id, type: "crm-activity", attributes } }
19671
20574
  },
19672
20575
  options
19673
20576
  );
@@ -19773,7 +20676,7 @@ function createCrmNamespace(rb) {
19773
20676
  return rb.execute(
19774
20677
  postCrmPipelines,
19775
20678
  {
19776
- body: { data: { type: "crm_pipeline", attributes } }
20679
+ body: { data: { type: "crm-pipeline", attributes } }
19777
20680
  },
19778
20681
  options
19779
20682
  );
@@ -19800,7 +20703,7 @@ function createCrmNamespace(rb) {
19800
20703
  patchCrmPipelinesById,
19801
20704
  {
19802
20705
  path: { id },
19803
- body: { data: { id, type: "crm_pipeline", attributes } }
20706
+ body: { data: { id, type: "crm-pipeline", attributes } }
19804
20707
  },
19805
20708
  options
19806
20709
  );
@@ -19905,7 +20808,7 @@ function createCrmNamespace(rb) {
19905
20808
  return rb.execute(
19906
20809
  postCrmPipelineStages,
19907
20810
  {
19908
- body: { data: { type: "crm_pipeline_stage", attributes } }
20811
+ body: { data: { type: "crm-pipeline-stage", attributes } }
19909
20812
  },
19910
20813
  options
19911
20814
  );
@@ -19933,7 +20836,7 @@ function createCrmNamespace(rb) {
19933
20836
  patchCrmPipelineStagesById,
19934
20837
  {
19935
20838
  path: { id },
19936
- body: { data: { id, type: "crm_pipeline_stage", attributes } }
20839
+ body: { data: { id, type: "crm-pipeline-stage", attributes } }
19937
20840
  },
19938
20841
  options
19939
20842
  );
@@ -20038,7 +20941,7 @@ function createCrmNamespace(rb) {
20038
20941
  return rb.execute(
20039
20942
  postCrmRelationshipTypes,
20040
20943
  {
20041
- body: { data: { type: "crm_relationship_type", attributes } }
20944
+ body: { data: { type: "crm-relationship-type", attributes } }
20042
20945
  },
20043
20946
  options
20044
20947
  );
@@ -20065,7 +20968,7 @@ function createCrmNamespace(rb) {
20065
20968
  patchCrmRelationshipTypesById,
20066
20969
  {
20067
20970
  path: { id },
20068
- body: { data: { id, type: "crm_relationship_type", attributes } }
20971
+ body: { data: { id, type: "crm-relationship-type", attributes } }
20069
20972
  },
20070
20973
  options
20071
20974
  );
@@ -20178,7 +21081,7 @@ function createCrmNamespace(rb) {
20178
21081
  return rb.execute(
20179
21082
  postCrmRelationships,
20180
21083
  {
20181
- body: { data: { type: "crm_relationship", attributes } }
21084
+ body: { data: { type: "crm-relationship", attributes } }
20182
21085
  },
20183
21086
  options
20184
21087
  );
@@ -20292,7 +21195,7 @@ function createCrmNamespace(rb) {
20292
21195
  return rb.execute(
20293
21196
  postCrmCustomEntities,
20294
21197
  {
20295
- body: { data: { type: "crm_custom_entity", attributes } }
21198
+ body: { data: { type: "crm-custom-entity", attributes } }
20296
21199
  },
20297
21200
  options
20298
21201
  );
@@ -20323,7 +21226,7 @@ function createCrmNamespace(rb) {
20323
21226
  patchCrmCustomEntitiesById,
20324
21227
  {
20325
21228
  path: { id },
20326
- body: { data: { id, type: "crm_custom_entity", attributes } }
21229
+ body: { data: { id, type: "crm-custom-entity", attributes } }
20327
21230
  },
20328
21231
  options
20329
21232
  );
@@ -20618,7 +21521,7 @@ function createCrmNamespace(rb) {
20618
21521
  {
20619
21522
  body: {
20620
21523
  data: {
20621
- type: "crm_data_export_job",
21524
+ type: "crm-data-export-job",
20622
21525
  attributes: {
20623
21526
  workspace_id: workspaceId,
20624
21527
  entity_type: params.entityType,
@@ -20780,7 +21683,7 @@ function createCampaignsNamespace(rb) {
20780
21683
  return rb.execute(
20781
21684
  postEmailMarketingCampaigns,
20782
21685
  {
20783
- body: { data: { type: "email_marketing_campaign", attributes } }
21686
+ body: { data: { type: "campaign", attributes } }
20784
21687
  },
20785
21688
  options
20786
21689
  );
@@ -20812,7 +21715,7 @@ function createCampaignsNamespace(rb) {
20812
21715
  {
20813
21716
  path: { id },
20814
21717
  body: {
20815
- data: { id, type: "email_marketing_campaign", attributes }
21718
+ data: { id, type: "campaign", attributes }
20816
21719
  }
20817
21720
  },
20818
21721
  options
@@ -20987,7 +21890,124 @@ function createCampaignsNamespace(rb) {
20987
21890
  postEmailMarketingCampaignsByIdCreateFollowup,
20988
21891
  {
20989
21892
  path: { id },
20990
- body: { data: { type: "email_marketing_campaign", ...attributes } }
21893
+ body: { data: { type: "campaign", ...attributes } }
21894
+ },
21895
+ options
21896
+ );
21897
+ },
21898
+ /**
21899
+ * Import recipients from a CSV file stored in platform storage.
21900
+ *
21901
+ * @param id - The campaign ID to import recipients into.
21902
+ * @param attributes - Import configuration including `csv_storage_key`,
21903
+ * optional `column_mapping`, and `workspace_id`.
21904
+ * @param options - Optional request-level overrides.
21905
+ * @returns A promise resolving to the import job details.
21906
+ *
21907
+ * @example
21908
+ * ```typescript
21909
+ * const result = await client.campaigns.campaigns.importRecipients('camp_abc', {
21910
+ * csv_storage_key: 'uploads/recipients.csv',
21911
+ * workspace_id: 'ws_abc123',
21912
+ * });
21913
+ * console.log(result.job_id);
21914
+ * ```
21915
+ */
21916
+ importRecipients: async (id, attributes, options) => {
21917
+ return rb.execute(
21918
+ postEmailMarketingCampaignsByIdImportRecipients,
21919
+ {
21920
+ path: { id },
21921
+ body: { data: { type: "campaign", attributes } }
21922
+ },
21923
+ options
21924
+ );
21925
+ },
21926
+ /**
21927
+ * Trigger AI-powered email generation for all campaign recipients.
21928
+ *
21929
+ * @param id - The campaign ID to generate emails for.
21930
+ * @param workspaceId - The workspace ID.
21931
+ * @param options - Optional request-level overrides.
21932
+ * @returns A promise resolving to the generation job details.
21933
+ *
21934
+ * @example
21935
+ * ```typescript
21936
+ * const result = await client.campaigns.campaigns.generateEmails('camp_abc', 'ws_abc123');
21937
+ * console.log(result.job_id);
21938
+ * ```
21939
+ */
21940
+ generateEmails: async (id, workspaceId, options) => {
21941
+ return rb.execute(
21942
+ postEmailMarketingCampaignsByIdGenerateEmails,
21943
+ {
21944
+ path: { id },
21945
+ body: {
21946
+ data: {
21947
+ type: "campaign",
21948
+ attributes: { workspace_id: workspaceId }
21949
+ }
21950
+ }
21951
+ },
21952
+ options
21953
+ );
21954
+ },
21955
+ /**
21956
+ * Generate A/B test subject line variants using AI.
21957
+ *
21958
+ * @param id - The campaign ID to optimize subjects for.
21959
+ * @param attributes - Subject optimization parameters including
21960
+ * `original_subject`, `campaign_description`, and `audience_description`.
21961
+ * @param options - Optional request-level overrides.
21962
+ * @returns A promise resolving to the optimization result with variant suggestions.
21963
+ *
21964
+ * @example
21965
+ * ```typescript
21966
+ * const result = await client.campaigns.campaigns.optimizeSubjects('camp_abc', {
21967
+ * original_subject: 'Spring Sale!',
21968
+ * campaign_description: 'Seasonal discount promotion',
21969
+ * audience_description: 'Existing customers aged 25-45',
21970
+ * });
21971
+ * ```
21972
+ */
21973
+ optimizeSubjects: async (id, attributes, options) => {
21974
+ return rb.execute(
21975
+ postEmailMarketingCampaignsByIdOptimizeSubjects,
21976
+ {
21977
+ path: { id },
21978
+ body: {
21979
+ data: { type: "campaign", attributes }
21980
+ }
21981
+ },
21982
+ options
21983
+ );
21984
+ },
21985
+ /**
21986
+ * Export campaign data (recipients, results, or analytics) as CSV.
21987
+ *
21988
+ * @param id - The campaign ID to export.
21989
+ * @param attributes - Export configuration including `workspace_id`,
21990
+ * optional `format` and `export_type`.
21991
+ * @param options - Optional request-level overrides.
21992
+ * @returns A promise resolving to the export job details.
21993
+ *
21994
+ * @example
21995
+ * ```typescript
21996
+ * const result = await client.campaigns.campaigns.export('camp_abc', {
21997
+ * workspace_id: 'ws_abc123',
21998
+ * export_type: 'recipients',
21999
+ * });
22000
+ * console.log(result.job_id);
22001
+ * ```
22002
+ */
22003
+ export: async (id, attributes, options) => {
22004
+ return rb.execute(
22005
+ postEmailMarketingCampaignsByIdExport,
22006
+ {
22007
+ path: { id },
22008
+ body: {
22009
+ data: { type: "campaign", attributes }
22010
+ }
20991
22011
  },
20992
22012
  options
20993
22013
  );
@@ -21258,7 +22278,7 @@ function createCampaignsNamespace(rb) {
21258
22278
  {
21259
22279
  path: { id },
21260
22280
  body: {
21261
- data: { id, type: "email_marketing_generated_email", attributes }
22281
+ data: { id, type: "email-marketing-generated-email", attributes }
21262
22282
  }
21263
22283
  },
21264
22284
  options
@@ -21290,6 +22310,68 @@ function createCampaignsNamespace(rb) {
21290
22310
  { path: { id }, body: {} },
21291
22311
  options
21292
22312
  );
22313
+ },
22314
+ /**
22315
+ * Reject an AI-generated email draft. The email will not be sent.
22316
+ *
22317
+ * @param id - The unique identifier of the generated email to reject.
22318
+ * @param options - Optional request-level overrides.
22319
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
22320
+ *
22321
+ * @example
22322
+ * ```typescript
22323
+ * const rejected = await client.campaigns.generatedEmails.reject('gen_abc123');
22324
+ * console.log(rejected.attributes.status); // 'rejected'
22325
+ * ```
22326
+ */
22327
+ reject: async (id, options) => {
22328
+ return rb.execute(
22329
+ patchEmailMarketingGeneratedEmailsByIdReject,
22330
+ { path: { id }, body: {} },
22331
+ options
22332
+ );
22333
+ },
22334
+ /**
22335
+ * Schedule a generated email for delivery at a specific time.
22336
+ *
22337
+ * @param id - The unique identifier of the generated email to schedule.
22338
+ * @param options - Optional request-level overrides.
22339
+ * @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
22340
+ *
22341
+ * @example
22342
+ * ```typescript
22343
+ * const scheduled = await client.campaigns.generatedEmails.schedule('gen_abc123');
22344
+ * ```
22345
+ */
22346
+ schedule: async (id, options) => {
22347
+ return rb.execute(
22348
+ patchEmailMarketingGeneratedEmailsByIdSchedule,
22349
+ { path: { id }, body: {} },
22350
+ options
22351
+ );
22352
+ },
22353
+ /**
22354
+ * List all generated emails for a specific campaign.
22355
+ *
22356
+ * @param campaignId - The ID of the campaign whose generated emails to list.
22357
+ * @param options - Optional pagination controls and request-level overrides.
22358
+ * @returns A promise resolving to an array of {@link EmailMarketingGeneratedEmail}.
22359
+ *
22360
+ * @example
22361
+ * ```typescript
22362
+ * const emails = await client.campaigns.generatedEmails.listByCampaign('camp_abc');
22363
+ * console.log(`${emails.length} emails generated`);
22364
+ * ```
22365
+ */
22366
+ listByCampaign: async (campaignId, options) => {
22367
+ return rb.execute(
22368
+ getEmailMarketingGeneratedEmailsCampaignByCampaignId,
22369
+ {
22370
+ path: { campaign_id: campaignId },
22371
+ ...buildPageQuery(options?.page, options?.pageSize)
22372
+ },
22373
+ options
22374
+ );
21293
22375
  }
21294
22376
  },
21295
22377
  /**
@@ -21351,7 +22433,7 @@ function createCampaignsNamespace(rb) {
21351
22433
  {
21352
22434
  path: { id },
21353
22435
  body: {
21354
- data: { id, type: "email_sender_profile", attributes }
22436
+ data: { id, type: "email-marketing-sender-profile", attributes }
21355
22437
  }
21356
22438
  },
21357
22439
  options
@@ -21421,43 +22503,153 @@ function createCampaignsNamespace(rb) {
21421
22503
  */
21422
22504
  sequences: {
21423
22505
  /**
21424
- * Create a new email sequence.
22506
+ * Fetch a single sequence by its unique ID.
21425
22507
  *
21426
- * Define the sequence steps (each with a delay and email content) in
21427
- * the `attributes` map. Contacts are enrolled into the sequence
21428
- * separately after creation.
22508
+ * @param id - The unique identifier of the sequence to retrieve.
22509
+ * @param options - Optional request-level overrides.
22510
+ * @returns A promise that resolves to the matching {@link EmailMarketingSequence}.
22511
+ *
22512
+ * @example
22513
+ * ```typescript
22514
+ * const sequence = await client.campaigns.sequences.get('seq_abc123');
22515
+ * console.log(sequence.attributes.name, sequence.attributes.status);
22516
+ * ```
22517
+ */
22518
+ get: async (id, options) => {
22519
+ return rb.execute(
22520
+ getCampaignsSequencesById,
22521
+ { path: { id } },
22522
+ options
22523
+ );
22524
+ },
22525
+ /**
22526
+ * Create a new email sequence.
21429
22527
  *
21430
22528
  * @param attributes - Key/value map of sequence attributes. Must include
21431
- * `workspace_id` and `name`. Include a `steps` array describing each
21432
- * timed email in the drip.
22529
+ * `workspace_id` and `name`.
21433
22530
  * @param options - Optional request-level overrides.
21434
22531
  * @returns A promise that resolves to the newly created sequence resource.
21435
22532
  *
21436
22533
  * @example
21437
22534
  * ```typescript
21438
- * const client = new GptClient({ apiKey: 'sk_app_...' });
21439
- *
21440
22535
  * const sequence = await client.campaigns.sequences.create({
21441
22536
  * workspace_id: 'ws_abc123',
21442
22537
  * name: 'New User Onboarding',
21443
- * steps: [
21444
- * { delay_days: 0, template_id: 'tmpl_welcome' },
21445
- * { delay_days: 3, template_id: 'tmpl_getting_started' },
21446
- * { delay_days: 7, template_id: 'tmpl_tips' },
21447
- * ],
21448
22538
  * });
21449
- * console.log(sequence);
21450
22539
  * ```
21451
22540
  */
21452
22541
  create: async (attributes, options) => {
21453
22542
  return rb.execute(
21454
22543
  postCampaignsSequences,
21455
22544
  {
21456
- body: { data: { type: "email_marketing_sequence", attributes } }
22545
+ body: { data: { type: "email-marketing-sequence", attributes } }
21457
22546
  },
21458
22547
  options
21459
22548
  );
21460
22549
  },
22550
+ /**
22551
+ * Update an existing sequence's attributes (PATCH semantics).
22552
+ *
22553
+ * @param id - The unique identifier of the sequence to update.
22554
+ * @param attributes - Key/value map of attributes to change.
22555
+ * @param options - Optional request-level overrides.
22556
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
22557
+ *
22558
+ * @example
22559
+ * ```typescript
22560
+ * const updated = await client.campaigns.sequences.update('seq_abc', { name: 'Revised Drip' });
22561
+ * ```
22562
+ */
22563
+ update: async (id, attributes, options) => {
22564
+ return rb.execute(
22565
+ patchCampaignsSequencesById,
22566
+ {
22567
+ path: { id },
22568
+ body: {
22569
+ data: { id, type: "email-marketing-sequence", attributes }
22570
+ }
22571
+ },
22572
+ options
22573
+ );
22574
+ },
22575
+ /**
22576
+ * Permanently delete a sequence.
22577
+ *
22578
+ * @param id - The unique identifier of the sequence to delete.
22579
+ * @param options - Optional request-level overrides.
22580
+ * @returns A promise that resolves to `true` on successful deletion.
22581
+ *
22582
+ * @example
22583
+ * ```typescript
22584
+ * await client.campaigns.sequences.delete('seq_abc123');
22585
+ * ```
22586
+ */
22587
+ delete: async (id, options) => {
22588
+ return rb.executeDelete(
22589
+ deleteCampaignsSequencesById,
22590
+ { path: { id } },
22591
+ options
22592
+ );
22593
+ },
22594
+ /**
22595
+ * Activate a sequence to start delivering emails to enrolled contacts.
22596
+ *
22597
+ * @param id - The unique identifier of the sequence to activate.
22598
+ * @param options - Optional request-level overrides.
22599
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
22600
+ *
22601
+ * @example
22602
+ * ```typescript
22603
+ * const active = await client.campaigns.sequences.activate('seq_abc123');
22604
+ * console.log(active.attributes.status); // 'active'
22605
+ * ```
22606
+ */
22607
+ activate: async (id, options) => {
22608
+ return rb.execute(
22609
+ patchCampaignsSequencesByIdActivate,
22610
+ { path: { id }, body: {} },
22611
+ options
22612
+ );
22613
+ },
22614
+ /**
22615
+ * Pause a running sequence, suspending all pending deliveries.
22616
+ *
22617
+ * @param id - The unique identifier of the sequence to pause.
22618
+ * @param options - Optional request-level overrides.
22619
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
22620
+ *
22621
+ * @example
22622
+ * ```typescript
22623
+ * const paused = await client.campaigns.sequences.pause('seq_abc123');
22624
+ * console.log(paused.attributes.status); // 'paused'
22625
+ * ```
22626
+ */
22627
+ pause: async (id, options) => {
22628
+ return rb.execute(
22629
+ patchCampaignsSequencesByIdPause,
22630
+ { path: { id }, body: {} },
22631
+ options
22632
+ );
22633
+ },
22634
+ /**
22635
+ * Mark a sequence as complete, finalizing all deliveries.
22636
+ *
22637
+ * @param id - The unique identifier of the sequence to complete.
22638
+ * @param options - Optional request-level overrides.
22639
+ * @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
22640
+ *
22641
+ * @example
22642
+ * ```typescript
22643
+ * const completed = await client.campaigns.sequences.complete('seq_abc123');
22644
+ * ```
22645
+ */
22646
+ complete: async (id, options) => {
22647
+ return rb.execute(
22648
+ patchCampaignsSequencesByIdComplete,
22649
+ { path: { id }, body: {} },
22650
+ options
22651
+ );
22652
+ },
21461
22653
  /**
21462
22654
  * List all sequences for a workspace with optional pagination.
21463
22655
  *
@@ -21511,6 +22703,137 @@ function createCampaignsNamespace(rb) {
21511
22703
  options
21512
22704
  );
21513
22705
  }
22706
+ },
22707
+ /**
22708
+ * Recipients — campaign audience members.
22709
+ *
22710
+ * Each recipient represents one email address on a campaign's send list,
22711
+ * with optional merge fields for personalisation. Recipients are typically
22712
+ * imported via CSV.
22713
+ */
22714
+ recipients: {
22715
+ /**
22716
+ * Fetch a single recipient by its unique ID.
22717
+ *
22718
+ * @param id - The unique identifier of the recipient.
22719
+ * @param options - Optional request-level overrides.
22720
+ * @returns A promise resolving to the recipient record.
22721
+ *
22722
+ * @example
22723
+ * ```typescript
22724
+ * const recipient = await client.campaigns.recipients.get('recip_abc123');
22725
+ * console.log(recipient.attributes.email);
22726
+ * ```
22727
+ */
22728
+ get: async (id, options) => {
22729
+ return rb.execute(
22730
+ getCampaignsRecipientsById,
22731
+ { path: { id } },
22732
+ options
22733
+ );
22734
+ },
22735
+ /**
22736
+ * List all recipients for a specific campaign.
22737
+ *
22738
+ * @param campaignId - The ID of the campaign whose recipients to list.
22739
+ * @param options - Optional pagination controls and request-level overrides.
22740
+ * @returns A promise resolving to an array of recipient records.
22741
+ *
22742
+ * @example
22743
+ * ```typescript
22744
+ * const recipients = await client.campaigns.recipients.listByCampaign('camp_abc');
22745
+ * console.log(`${recipients.length} recipients`);
22746
+ * ```
22747
+ */
22748
+ listByCampaign: async (campaignId, options) => {
22749
+ return rb.execute(
22750
+ getCampaignsRecipientsCampaignByCampaignId,
22751
+ {
22752
+ path: { campaign_id: campaignId },
22753
+ ...buildPageQuery(options?.page, options?.pageSize)
22754
+ },
22755
+ options
22756
+ );
22757
+ }
22758
+ },
22759
+ /**
22760
+ * Sequence Steps — individual steps within a drip sequence.
22761
+ *
22762
+ * Each step defines a timed email delivery within a sequence, with a
22763
+ * delay offset and template or inline content.
22764
+ */
22765
+ sequenceSteps: {
22766
+ /**
22767
+ * Fetch a single sequence step by its unique ID.
22768
+ *
22769
+ * @param id - The unique identifier of the sequence step.
22770
+ * @param options - Optional request-level overrides.
22771
+ * @returns A promise resolving to the sequence step record.
22772
+ *
22773
+ * @example
22774
+ * ```typescript
22775
+ * const step = await client.campaigns.sequenceSteps.get('step_abc123');
22776
+ * ```
22777
+ */
22778
+ get: async (id, options) => {
22779
+ return rb.execute(
22780
+ getCampaignsSequenceStepsById,
22781
+ { path: { id } },
22782
+ options
22783
+ );
22784
+ },
22785
+ /**
22786
+ * Create a new step within a sequence.
22787
+ *
22788
+ * @param attributes - Step attributes including `sequence_id`.
22789
+ * @param options - Optional request-level overrides.
22790
+ * @returns A promise resolving to the newly created sequence step.
22791
+ *
22792
+ * @example
22793
+ * ```typescript
22794
+ * const step = await client.campaigns.sequenceSteps.create({
22795
+ * sequence_id: 'seq_abc123',
22796
+ * delay_days: 3,
22797
+ * template_id: 'tmpl_reminder',
22798
+ * });
22799
+ * ```
22800
+ */
22801
+ create: async (attributes, options) => {
22802
+ return rb.execute(
22803
+ postCampaignsSequenceSteps,
22804
+ {
22805
+ body: {
22806
+ data: {
22807
+ type: "email-marketing-sequence-step",
22808
+ attributes
22809
+ }
22810
+ }
22811
+ },
22812
+ options
22813
+ );
22814
+ },
22815
+ /**
22816
+ * List all steps in a specific sequence.
22817
+ *
22818
+ * @param sequenceId - The ID of the sequence whose steps to list.
22819
+ * @param options - Optional pagination controls and request-level overrides.
22820
+ * @returns A promise resolving to an array of sequence step records.
22821
+ *
22822
+ * @example
22823
+ * ```typescript
22824
+ * const steps = await client.campaigns.sequenceSteps.listBySequence('seq_abc123');
22825
+ * ```
22826
+ */
22827
+ listBySequence: async (sequenceId, options) => {
22828
+ return rb.execute(
22829
+ getCampaignsSequenceStepsSequenceBySequenceId,
22830
+ {
22831
+ path: { sequence_id: sequenceId },
22832
+ ...buildPageQuery(options?.page, options?.pageSize)
22833
+ },
22834
+ options
22835
+ );
22836
+ }
21514
22837
  }
21515
22838
  };
21516
22839
  }
@@ -21558,7 +22881,7 @@ function createEmailNamespace(rb) {
21558
22881
  create: async (attributes, options) => {
21559
22882
  return rb.execute(
21560
22883
  postEmailOutboundEmails,
21561
- { body: { data: { type: "email_outbound_email", attributes } } },
22884
+ { body: { data: { type: "email-outbound-email", attributes } } },
21562
22885
  options
21563
22886
  );
21564
22887
  },
@@ -21589,7 +22912,7 @@ function createEmailNamespace(rb) {
21589
22912
  composeWithAi: async (attributes, options) => {
21590
22913
  return rb.execute(
21591
22914
  postEmailOutboundEmailsComposeWithAi,
21592
- { body: { data: { type: "email_outbound_email", attributes } } },
22915
+ { body: { data: { type: "email-outbound-email", attributes } } },
21593
22916
  options
21594
22917
  );
21595
22918
  },
@@ -21619,7 +22942,7 @@ function createEmailNamespace(rb) {
21619
22942
  patchEmailOutboundEmailsById,
21620
22943
  {
21621
22944
  path: { id },
21622
- body: { data: { id, type: "email_outbound_email", attributes } }
22945
+ body: { data: { id, type: "email-outbound-email", attributes } }
21623
22946
  },
21624
22947
  options
21625
22948
  );
@@ -21674,7 +22997,7 @@ function createEmailNamespace(rb) {
21674
22997
  patchEmailOutboundEmailsByIdSchedule,
21675
22998
  {
21676
22999
  path: { id },
21677
- body: { data: { id, type: "email_outbound_email", attributes } }
23000
+ body: { data: { id, type: "email-outbound-email", attributes } }
21678
23001
  },
21679
23002
  options
21680
23003
  );
@@ -21751,7 +23074,11 @@ function createEmailNamespace(rb) {
21751
23074
  create: async (attributes, options) => {
21752
23075
  return rb.execute(
21753
23076
  postEmailMarketingSenderProfiles,
21754
- { body: { data: { type: "email_sender_profile", attributes } } },
23077
+ {
23078
+ body: {
23079
+ data: { type: "email-marketing-sender-profile", attributes }
23080
+ }
23081
+ },
21755
23082
  options
21756
23083
  );
21757
23084
  },
@@ -21782,7 +23109,9 @@ function createEmailNamespace(rb) {
21782
23109
  patchEmailMarketingSenderProfilesById,
21783
23110
  {
21784
23111
  path: { id },
21785
- body: { data: { id, type: "email_sender_profile", attributes } }
23112
+ body: {
23113
+ data: { id, type: "email-marketing-sender-profile", attributes }
23114
+ }
21786
23115
  },
21787
23116
  options
21788
23117
  );
@@ -21875,7 +23204,7 @@ function createEmailNamespace(rb) {
21875
23204
  create: async (attributes, options) => {
21876
23205
  return rb.execute(
21877
23206
  postEmailRecipients,
21878
- { body: { data: { type: "email_recipient", attributes } } },
23207
+ { body: { data: { type: "email-recipient", attributes } } },
21879
23208
  options
21880
23209
  );
21881
23210
  },
@@ -21912,7 +23241,7 @@ function createEmailNamespace(rb) {
21912
23241
  create: async (attributes, options) => {
21913
23242
  return rb.execute(
21914
23243
  postEmailInclusions,
21915
- { body: { data: { type: "email_inclusion", attributes } } },
23244
+ { body: { data: { type: "email-inclusion", attributes } } },
21916
23245
  options
21917
23246
  );
21918
23247
  },
@@ -21922,7 +23251,7 @@ function createEmailNamespace(rb) {
21922
23251
  patchEmailInclusionsById,
21923
23252
  {
21924
23253
  path: { id },
21925
- body: { data: { id, type: "email_inclusion", attributes } }
23254
+ body: { data: { id, type: "email-inclusion", attributes } }
21926
23255
  },
21927
23256
  options
21928
23257
  );
@@ -22273,7 +23602,7 @@ function createSupportNamespace(rb) {
22273
23602
  postSupportTickets,
22274
23603
  {
22275
23604
  body: {
22276
- data: { type: "support_ticket", attributes }
23605
+ data: { type: "support-ticket", attributes }
22277
23606
  }
22278
23607
  },
22279
23608
  options
@@ -22309,7 +23638,7 @@ function createSupportNamespace(rb) {
22309
23638
  {
22310
23639
  path: { id },
22311
23640
  body: {
22312
- data: { type: "support_ticket", id, attributes }
23641
+ data: { type: "support-ticket", id, attributes }
22313
23642
  }
22314
23643
  },
22315
23644
  options
@@ -22358,7 +23687,7 @@ function createSupportNamespace(rb) {
22358
23687
  {
22359
23688
  path: { id },
22360
23689
  body: {
22361
- data: { type: "support_ticket", id, attributes }
23690
+ data: { type: "support-ticket", id, attributes }
22362
23691
  }
22363
23692
  },
22364
23693
  options
@@ -22386,7 +23715,7 @@ function createSupportNamespace(rb) {
22386
23715
  {
22387
23716
  path: { id },
22388
23717
  body: {
22389
- data: { type: "support_ticket", id, attributes }
23718
+ data: { type: "support-ticket", id, attributes }
22390
23719
  }
22391
23720
  },
22392
23721
  options
@@ -22411,7 +23740,7 @@ function createSupportNamespace(rb) {
22411
23740
  {
22412
23741
  path: { id },
22413
23742
  body: {
22414
- data: { type: "support_ticket", id, attributes }
23743
+ data: { type: "support-ticket", id, attributes }
22415
23744
  }
22416
23745
  },
22417
23746
  options
@@ -22436,7 +23765,7 @@ function createSupportNamespace(rb) {
22436
23765
  {
22437
23766
  path: { id },
22438
23767
  body: {
22439
- data: { type: "support_ticket", id, attributes }
23768
+ data: { type: "support-ticket", id, attributes }
22440
23769
  }
22441
23770
  },
22442
23771
  options
@@ -22466,7 +23795,7 @@ function createSupportNamespace(rb) {
22466
23795
  {
22467
23796
  path: { id },
22468
23797
  body: {
22469
- data: { type: "support_ticket", id, attributes }
23798
+ data: { type: "support-ticket", id, attributes }
22470
23799
  }
22471
23800
  },
22472
23801
  options
@@ -22505,7 +23834,7 @@ function createSupportNamespace(rb) {
22505
23834
  {
22506
23835
  body: {
22507
23836
  data: {
22508
- type: "support_ticket_message",
23837
+ type: "support-ticket-message",
22509
23838
  attributes: { ...attributes, ticket_id: ticketId }
22510
23839
  }
22511
23840
  }
@@ -22571,7 +23900,7 @@ function createSupportNamespace(rb) {
22571
23900
  postSupportTicketRatings,
22572
23901
  {
22573
23902
  body: {
22574
- data: { type: "support_ticket_rating", attributes }
23903
+ data: { type: "support-ticket-rating", attributes }
22575
23904
  }
22576
23905
  },
22577
23906
  options
@@ -22639,7 +23968,7 @@ function createSupportNamespace(rb) {
22639
23968
  postSupportTags,
22640
23969
  {
22641
23970
  body: {
22642
- data: { type: "support_tag", attributes }
23971
+ data: { type: "support-tag", attributes }
22643
23972
  }
22644
23973
  },
22645
23974
  options
@@ -22854,7 +24183,7 @@ function createExtractionNamespace(rb) {
22854
24183
  return rb.execute(
22855
24184
  postDocumentsBulkDelete,
22856
24185
  {
22857
- body: { data: { type: "operation_success", attributes: { ids } } }
24186
+ body: { data: { type: "operation-success", attributes: { ids } } }
22858
24187
  },
22859
24188
  options
22860
24189
  );
@@ -22911,7 +24240,7 @@ function createExtractionNamespace(rb) {
22911
24240
  {
22912
24241
  body: {
22913
24242
  data: {
22914
- type: "bulk_reprocess_result",
24243
+ type: "bulk-reprocess-result",
22915
24244
  attributes: { document_ids: documentIds }
22916
24245
  }
22917
24246
  }
@@ -23003,7 +24332,7 @@ function createExtractionNamespace(rb) {
23003
24332
  return rb.execute(
23004
24333
  postExtractionDocumentsBeginUpload,
23005
24334
  {
23006
- body: { data: { type: "extraction_document", attributes: attrs } }
24335
+ body: { data: { type: "extraction-document", attributes: attrs } }
23007
24336
  },
23008
24337
  options
23009
24338
  );
@@ -23041,7 +24370,7 @@ function createExtractionNamespace(rb) {
23041
24370
  postExtractionDocumentsFindOrBeginUpload,
23042
24371
  {
23043
24372
  body: {
23044
- data: { type: "extraction_document", attributes: attrs || {} }
24373
+ data: { type: "extraction-document", attributes: attrs || {} }
23045
24374
  }
23046
24375
  },
23047
24376
  options
@@ -23152,7 +24481,7 @@ function createExtractionNamespace(rb) {
23152
24481
  patchExtractionDocumentsByIdVerification,
23153
24482
  {
23154
24483
  path: { id },
23155
- body: { data: { type: "extraction_document", attributes: attrs } }
24484
+ body: { data: { type: "extraction-document", attributes: attrs } }
23156
24485
  },
23157
24486
  options
23158
24487
  );
@@ -23273,7 +24602,7 @@ function createExtractionNamespace(rb) {
23273
24602
  PresignedUploadSchema.parse(attrs);
23274
24603
  return rb.execute(
23275
24604
  postDocumentsPresignedUpload,
23276
- { body: { data: { type: "presigned_url", attributes: attrs } } },
24605
+ { body: { data: { type: "presigned-url", attributes: attrs } } },
23277
24606
  options
23278
24607
  );
23279
24608
  }
@@ -23377,7 +24706,7 @@ function createExtractionNamespace(rb) {
23377
24706
  patchExtractionResultsById,
23378
24707
  {
23379
24708
  path: { id },
23380
- body: { data: { id, type: "extraction_result", attributes } }
24709
+ body: { data: { id, type: "extraction-result", attributes } }
23381
24710
  },
23382
24711
  options
23383
24712
  );
@@ -23451,7 +24780,7 @@ function createExtractionNamespace(rb) {
23451
24780
  patchExtractionResultsByIdRegenerate,
23452
24781
  {
23453
24782
  path: { id },
23454
- body: { data: { type: "extraction_result", attributes: attrs } }
24783
+ body: { data: { type: "extraction-result", attributes: attrs } }
23455
24784
  },
23456
24785
  options
23457
24786
  );
@@ -23487,7 +24816,7 @@ function createExtractionNamespace(rb) {
23487
24816
  patchExtractionResultsByIdSaveCorrections,
23488
24817
  {
23489
24818
  path: { id },
23490
- body: { data: { type: "extraction_result", attributes: attrs } }
24819
+ body: { data: { type: "extraction-result", attributes: attrs } }
23491
24820
  },
23492
24821
  options
23493
24822
  );
@@ -23593,7 +24922,7 @@ function createExtractionNamespace(rb) {
23593
24922
  create: async (attributes, options) => {
23594
24923
  return rb.execute(
23595
24924
  postExtractionBatches,
23596
- { body: { data: { type: "extraction_batch", attributes } } },
24925
+ { body: { data: { type: "extraction-batch", attributes } } },
23597
24926
  options
23598
24927
  );
23599
24928
  },
@@ -23725,7 +25054,7 @@ function createExtractionNamespace(rb) {
23725
25054
  postWorkspacesByWorkspaceIdExtractionExports,
23726
25055
  {
23727
25056
  path: { workspace_id: workspaceId },
23728
- body: { data: { type: "extraction_export", attributes: attrs } }
25057
+ body: { data: { type: "extraction-export", attributes: attrs } }
23729
25058
  },
23730
25059
  options
23731
25060
  );
@@ -23783,7 +25112,7 @@ function createExtractionNamespace(rb) {
23783
25112
  create: async (attrs, options) => {
23784
25113
  return rb.execute(
23785
25114
  postExtractionSchemaDiscoveries,
23786
- { body: { data: { type: "schema_discovery", attributes: attrs } } },
25115
+ { body: { data: { type: "schema-discovery", attributes: attrs } } },
23787
25116
  options
23788
25117
  );
23789
25118
  },
@@ -23891,7 +25220,7 @@ function createExtractionNamespace(rb) {
23891
25220
  FieldTemplateCreateSchema.parse(attrs);
23892
25221
  return rb.execute(
23893
25222
  postFieldTemplates,
23894
- { body: { data: { type: "field_template", attributes: attrs } } },
25223
+ { body: { data: { type: "field-template", attributes: attrs } } },
23895
25224
  options
23896
25225
  );
23897
25226
  },
@@ -23986,7 +25315,7 @@ function createExtractionNamespace(rb) {
23986
25315
  {
23987
25316
  path: { workspace_id: workspaceId, document_id: documentId },
23988
25317
  body: {
23989
- data: { type: "field_mapping_confirmation", attributes: attrs }
25318
+ data: { type: "field-mapping-confirmation", attributes: attrs }
23990
25319
  }
23991
25320
  },
23992
25321
  options
@@ -24116,8 +25445,8 @@ function createIdentityNamespace(rb, baseUrl) {
24116
25445
  * first_name: "Jane",
24117
25446
  * last_name: "Doe",
24118
25447
  * legal_documents_accepted: [
24119
- * { document_id: "uuid-of-terms-doc", document_type: "terms_of_service", version: "2025-01-01" },
24120
- * { document_id: "uuid-of-privacy-doc", document_type: "privacy_policy", version: "2025-01-01" },
25448
+ * { document_id: "uuid-of-terms-doc", document_type: "terms-of-service", version: "2025-01-01" },
25449
+ * { document_id: "uuid-of-privacy-doc", document_type: "privacy-policy", version: "2025-01-01" },
24121
25450
  * ],
24122
25451
  * });
24123
25452
  * ```
@@ -24480,7 +25809,7 @@ function createIdentityNamespace(rb, baseUrl) {
24480
25809
  create: async (attributes, options) => {
24481
25810
  return rb.execute(
24482
25811
  postUserProfiles,
24483
- { body: { data: { type: "user_profile", attributes } } },
25812
+ { body: { data: { type: "user-profile", attributes } } },
24484
25813
  options
24485
25814
  );
24486
25815
  },
@@ -24490,7 +25819,7 @@ function createIdentityNamespace(rb, baseUrl) {
24490
25819
  patchUserProfilesById,
24491
25820
  {
24492
25821
  path: { id },
24493
- body: { data: { id, type: "user_profile", attributes } }
25822
+ body: { data: { id, type: "user-profile", attributes } }
24494
25823
  },
24495
25824
  options
24496
25825
  );
@@ -24527,7 +25856,7 @@ function createIdentityNamespace(rb, baseUrl) {
24527
25856
  patchUserProfilesByIdAcceptTos,
24528
25857
  {
24529
25858
  path: { id },
24530
- body: { data: { id, type: "user_profile", attributes } }
25859
+ body: { data: { id, type: "user-profile", attributes } }
24531
25860
  },
24532
25861
  options
24533
25862
  );
@@ -24542,7 +25871,7 @@ function createIdentityNamespace(rb, baseUrl) {
24542
25871
  patchUserProfilesByIdDismissWelcome,
24543
25872
  {
24544
25873
  path: { id },
24545
- body: { data: { id, type: "user_profile", attributes: {} } }
25874
+ body: { data: { id, type: "user-profile", attributes: {} } }
24546
25875
  },
24547
25876
  options
24548
25877
  );
@@ -24557,7 +25886,7 @@ function createIdentityNamespace(rb, baseUrl) {
24557
25886
  patchUserProfilesByIdDismissAnnouncement,
24558
25887
  {
24559
25888
  path: { id },
24560
- body: { data: { id, type: "user_profile", attributes: {} } }
25889
+ body: { data: { id, type: "user-profile", attributes: {} } }
24561
25890
  },
24562
25891
  options
24563
25892
  );
@@ -24644,7 +25973,7 @@ function createIdentityNamespace(rb, baseUrl) {
24644
25973
  update: async (id, attributes, options) => {
24645
25974
  return rb.execute(
24646
25975
  patchApiKeysById,
24647
- { path: { id }, body: { data: { id, type: "api_key", attributes } } },
25976
+ { path: { id }, body: { data: { id, type: "api-key", attributes } } },
24648
25977
  options
24649
25978
  );
24650
25979
  },
@@ -24653,7 +25982,7 @@ function createIdentityNamespace(rb, baseUrl) {
24653
25982
  ApiKeyCreateSchema.parse({ name });
24654
25983
  return rb.execute(
24655
25984
  postApiKeys,
24656
- { body: { data: { type: "api_key", attributes: { name } } } },
25985
+ { body: { data: { type: "api-key", attributes: { name } } } },
24657
25986
  options
24658
25987
  );
24659
25988
  },
@@ -24700,7 +26029,7 @@ function createIdentityNamespace(rb, baseUrl) {
24700
26029
  body: {
24701
26030
  data: {
24702
26031
  id,
24703
- type: "api_key",
26032
+ type: "api-key",
24704
26033
  attributes: {
24705
26034
  credit_limit: creditLimit,
24706
26035
  credit_limit_period: creditLimitPeriod
@@ -24747,7 +26076,7 @@ function createIdentityNamespace(rb, baseUrl) {
24747
26076
  patchApiKeysByIdResetPeriod,
24748
26077
  {
24749
26078
  path: { id },
24750
- body: { data: { id, type: "api_key", attributes: {} } }
26079
+ body: { data: { id, type: "api-key", attributes: {} } }
24751
26080
  },
24752
26081
  options
24753
26082
  );
@@ -26149,7 +27478,7 @@ function createPlatformNamespace(rb) {
26149
27478
  create: async (attributes, options) => {
26150
27479
  return rb.execute(
26151
27480
  postBrandIdentities,
26152
- { body: { data: { type: "brand_identity", attributes } } },
27481
+ { body: { data: { type: "brand-identity", attributes } } },
26153
27482
  options
26154
27483
  );
26155
27484
  },
@@ -26175,7 +27504,7 @@ function createPlatformNamespace(rb) {
26175
27504
  patchBrandIdentitiesById,
26176
27505
  {
26177
27506
  path: { id },
26178
- body: { data: { id, type: "brand_identity", attributes } }
27507
+ body: { data: { id, type: "brand-identity", attributes } }
26179
27508
  },
26180
27509
  options
26181
27510
  );
@@ -26319,7 +27648,7 @@ function createPlatformNamespace(rb) {
26319
27648
  patchBrandIdentitiesByIdSetDefault,
26320
27649
  {
26321
27650
  path: { id },
26322
- body: { data: { id, type: "brand_identity", attributes: {} } }
27651
+ body: { data: { id, type: "brand-identity", attributes: {} } }
26323
27652
  },
26324
27653
  options
26325
27654
  );
@@ -26346,7 +27675,7 @@ function createPlatformNamespace(rb) {
26346
27675
  patchBrandIdentitiesByIdUnsetDefault,
26347
27676
  {
26348
27677
  path: { id },
26349
- body: { data: { id, type: "brand_identity", attributes: {} } }
27678
+ body: { data: { id, type: "brand-identity", attributes: {} } }
26350
27679
  },
26351
27680
  options
26352
27681
  );
@@ -26430,7 +27759,7 @@ function createPlatformNamespace(rb) {
26430
27759
  create: async (attributes, options) => {
26431
27760
  return rb.execute(
26432
27761
  postPlatformTones,
26433
- { body: { data: { type: "platform_tone", attributes } } },
27762
+ { body: { data: { type: "platform-tone", attributes } } },
26434
27763
  options
26435
27764
  );
26436
27765
  },
@@ -26456,7 +27785,7 @@ function createPlatformNamespace(rb) {
26456
27785
  patchPlatformTonesById,
26457
27786
  {
26458
27787
  path: { id },
26459
- body: { data: { id, type: "platform_tone", attributes } }
27788
+ body: { data: { id, type: "platform-tone", attributes } }
26460
27789
  },
26461
27790
  options
26462
27791
  );
@@ -26717,6 +28046,69 @@ function createPortalNamespace(rb) {
26717
28046
  };
26718
28047
  }
26719
28048
 
28049
+ // src/namespaces/session-notes.ts
28050
+ function createSessionNotesNamespace(rb) {
28051
+ return {
28052
+ /**
28053
+ * Get the current version of a session note.
28054
+ *
28055
+ * Returns `null` if no note of this type exists for the event yet.
28056
+ *
28057
+ * @param eventId - The UUID of the scheduling event (session).
28058
+ * @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
28059
+ * @param workspaceId - The workspace UUID. Required for application-scoped API keys.
28060
+ * @param options - Optional request options.
28061
+ * @returns The `DataStoreRecord`, or `null` if not found.
28062
+ */
28063
+ get: async (eventId, noteType, workspaceId, options) => {
28064
+ const results = await rb.execute(
28065
+ getDataStoreRecordsByNamespace,
28066
+ {
28067
+ query: {
28068
+ workspace_id: workspaceId,
28069
+ namespace: "sessions",
28070
+ "filter[record_key]": `${eventId}:${noteType}`
28071
+ }
28072
+ },
28073
+ options
28074
+ );
28075
+ return results.length > 0 ? results[0] ?? null : null;
28076
+ },
28077
+ /**
28078
+ * Create or update a session note (auto-versions on update).
28079
+ *
28080
+ * If the note does not exist, it is created. If it exists, its value
28081
+ * is replaced and the version counter is incremented.
28082
+ *
28083
+ * @param eventId - The UUID of the scheduling event (session).
28084
+ * @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
28085
+ * @param workspaceId - The workspace UUID. Required for application-scoped API keys.
28086
+ * @param value - The note content and optional metadata.
28087
+ * @param options - Optional request options.
28088
+ * @returns The upserted `DataStoreRecord`.
28089
+ */
28090
+ upsert: async (eventId, noteType, workspaceId, value, options) => {
28091
+ return rb.execute(
28092
+ postDataStoreRecordsUpsert,
28093
+ {
28094
+ body: {
28095
+ data: {
28096
+ type: "data-store-record",
28097
+ attributes: {
28098
+ namespace: "sessions",
28099
+ record_key: `${eventId}:${noteType}`,
28100
+ workspace_id: workspaceId,
28101
+ value
28102
+ }
28103
+ }
28104
+ }
28105
+ },
28106
+ options
28107
+ );
28108
+ }
28109
+ };
28110
+ }
28111
+
26720
28112
  // src/namespaces/scheduling.ts
26721
28113
  function createSchedulingNamespace(rb) {
26722
28114
  return {
@@ -26828,7 +28220,7 @@ function createSchedulingNamespace(rb) {
26828
28220
  return rb.execute(
26829
28221
  postSchedulingEventTypes,
26830
28222
  {
26831
- body: { data: { type: "scheduling_event_type", attributes } }
28223
+ body: { data: { type: "scheduling-event-type", attributes } }
26832
28224
  },
26833
28225
  options
26834
28226
  );
@@ -26859,10 +28251,61 @@ function createSchedulingNamespace(rb) {
26859
28251
  patchSchedulingEventTypesById,
26860
28252
  {
26861
28253
  path: { id },
26862
- body: { data: { id, type: "scheduling_event_type", attributes } }
28254
+ body: { data: { id, type: "scheduling-event-type", attributes } }
26863
28255
  },
26864
28256
  options
26865
28257
  );
28258
+ },
28259
+ /**
28260
+ * Archive an event type.
28261
+ *
28262
+ * Marks the event type as archived so it no longer appears in active
28263
+ * listings. Existing bookings against this event type are unaffected.
28264
+ *
28265
+ * @param id - The UUID of the event type to archive.
28266
+ * @param options - Optional request options.
28267
+ * @returns The archived `SchedulingEventType`.
28268
+ *
28269
+ * @example
28270
+ * ```typescript
28271
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
28272
+ * const archived = await client.scheduling.eventTypes.archive('et_abc123');
28273
+ * console.log(archived.attributes?.status); // 'archived'
28274
+ * ```
28275
+ */
28276
+ archive: async (id, options) => {
28277
+ return rb.execute(
28278
+ patchSchedulingEventTypesByIdArchive,
28279
+ { path: { id }, body: {} },
28280
+ options
28281
+ );
28282
+ },
28283
+ /**
28284
+ * Retrieve an event type by its public slug.
28285
+ *
28286
+ * Slugs are unique per workspace and used in public booking URLs.
28287
+ * This is the primary lookup method for external-facing booking pages.
28288
+ *
28289
+ * @param slug - The URL-safe slug of the event type.
28290
+ * @param workspaceId - The workspace that owns the event type.
28291
+ * @param options - Optional request options.
28292
+ * @returns The matching `SchedulingEventType`.
28293
+ *
28294
+ * @example
28295
+ * ```typescript
28296
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
28297
+ * const eventType = await client.scheduling.eventTypes.getBySlug(
28298
+ * '30min-consult', 'ws_abc123',
28299
+ * );
28300
+ * console.log(eventType.attributes?.name);
28301
+ * ```
28302
+ */
28303
+ getBySlug: async (slug, workspaceId, options) => {
28304
+ return rb.execute(
28305
+ getSchedulingEventTypesBySlug,
28306
+ { query: { slug, workspace_id: workspaceId } },
28307
+ options
28308
+ );
26866
28309
  }
26867
28310
  },
26868
28311
  /**
@@ -26874,43 +28317,53 @@ function createSchedulingNamespace(rb) {
26874
28317
  */
26875
28318
  events: {
26876
28319
  /**
26877
- * List scheduling events with optional pagination.
28320
+ * List scheduling events in a workspace with optional pagination.
26878
28321
  *
28322
+ * @param workspaceId - The workspace to list events for.
26879
28323
  * @param options - Optional page number, page size, and request options.
26880
28324
  * @returns A page of `SchedulingEvent` records.
26881
28325
  *
26882
28326
  * @example
26883
28327
  * ```typescript
26884
28328
  * const client = new GptClient({ apiKey: 'sk_app_...' });
26885
- * const events = await client.scheduling.events.list({ pageSize: 25 });
28329
+ * const events = await client.scheduling.events.list(workspaceId, { pageSize: 25 });
26886
28330
  * events.forEach(e => console.log(e.attributes?.title, e.attributes?.start_time));
26887
28331
  * ```
26888
28332
  */
26889
- list: async (options) => {
28333
+ list: async (workspaceId, options) => {
26890
28334
  return rb.execute(
26891
28335
  getSchedulingEvents,
26892
- buildPageQuery(options?.page, options?.pageSize),
28336
+ {
28337
+ query: {
28338
+ workspace_id: workspaceId,
28339
+ ...buildPageQuery(options?.page, options?.pageSize).query
28340
+ }
28341
+ },
26893
28342
  options
26894
28343
  );
26895
28344
  },
26896
28345
  /**
26897
- * List all scheduling events, automatically paginating through every page.
28346
+ * List all scheduling events in a workspace, automatically paginating through every page.
26898
28347
  *
28348
+ * @param workspaceId - The workspace to list events for.
26899
28349
  * @param options - Optional request options.
26900
28350
  * @returns All `SchedulingEvent` records as a flat array.
26901
28351
  *
26902
28352
  * @example
26903
28353
  * ```typescript
26904
28354
  * const client = new GptClient({ apiKey: 'sk_app_...' });
26905
- * const allEvents = await client.scheduling.events.listAll();
28355
+ * const allEvents = await client.scheduling.events.listAll(workspaceId);
26906
28356
  * ```
26907
28357
  */
26908
- listAll: async (options) => {
28358
+ listAll: async (workspaceId, options) => {
26909
28359
  return paginateToArray(
26910
28360
  rb.createPaginatedFetcher(
26911
28361
  getSchedulingEvents,
26912
28362
  (page, pageSize) => ({
26913
- query: { page: { number: page, size: pageSize } }
28363
+ query: {
28364
+ workspace_id: workspaceId,
28365
+ page: { number: page, size: pageSize }
28366
+ }
26914
28367
  }),
26915
28368
  options
26916
28369
  )
@@ -26966,7 +28419,7 @@ function createSchedulingNamespace(rb) {
26966
28419
  return rb.execute(
26967
28420
  postSchedulingEvents,
26968
28421
  {
26969
- body: { data: { type: "scheduling_event", attributes } }
28422
+ body: { data: { type: "scheduling-event", attributes } }
26970
28423
  },
26971
28424
  options
26972
28425
  );
@@ -26997,33 +28450,11 @@ function createSchedulingNamespace(rb) {
26997
28450
  patchSchedulingEventsById,
26998
28451
  {
26999
28452
  path: { id },
27000
- body: { data: { id, type: "scheduling_event", attributes } }
28453
+ body: { data: { id, type: "scheduling-event", attributes } }
27001
28454
  },
27002
28455
  options
27003
28456
  );
27004
28457
  },
27005
- /**
27006
- * List events that include a specific participant by email.
27007
- *
27008
- * Use this to retrieve all sessions for a client (e.g., all appointments
27009
- * for a given patient). Filters events in the workspace where a Participant
27010
- * record with the given email exists.
27011
- *
27012
- * @param email - The participant's email address to filter by.
27013
- * @param workspaceId - The workspace to scope the query to.
27014
- * @param options - Optional page number, page size, and request options.
27015
- * @returns A flat array of `SchedulingEvent` records.
27016
- *
27017
- * @example
27018
- * ```typescript
27019
- * const client = new GptClient({ apiKey: 'sk_app_...' });
27020
- * const sessions = await client.scheduling.events.listByParticipant(
27021
- * 'patient@example.com',
27022
- * workspaceId,
27023
- * );
27024
- * sessions.forEach(s => console.log(s.attributes?.start_time, s.attributes?.status));
27025
- * ```
27026
- */
27027
28458
  /**
27028
28459
  * Cancel an event.
27029
28460
  *
@@ -27044,7 +28475,7 @@ function createSchedulingNamespace(rb) {
27044
28475
  patchSchedulingEventsByIdCancel,
27045
28476
  {
27046
28477
  path: { id },
27047
- body: attributes ? { data: { type: "scheduling_event", attributes } } : {}
28478
+ body: attributes ? { data: { type: "scheduling-event", attributes } } : {}
27048
28479
  },
27049
28480
  options
27050
28481
  );
@@ -27089,7 +28520,7 @@ function createSchedulingNamespace(rb) {
27089
28520
  patchSchedulingEventsByIdReschedule,
27090
28521
  {
27091
28522
  path: { id },
27092
- body: { data: { type: "scheduling_event", attributes } }
28523
+ body: { data: { type: "scheduling-event", attributes } }
27093
28524
  },
27094
28525
  options
27095
28526
  );
@@ -27125,6 +28556,28 @@ function createSchedulingNamespace(rb) {
27125
28556
  options
27126
28557
  );
27127
28558
  },
28559
+ /**
28560
+ * List events that include a specific participant by email.
28561
+ *
28562
+ * Use this to retrieve all sessions for a client (e.g., all appointments
28563
+ * for a given patient). Filters events in the workspace where a Participant
28564
+ * record with the given email exists.
28565
+ *
28566
+ * @param email - The participant's email address to filter by.
28567
+ * @param workspaceId - The workspace to scope the query to.
28568
+ * @param options - Optional page number, page size, and request options.
28569
+ * @returns A flat array of `SchedulingEvent` records.
28570
+ *
28571
+ * @example
28572
+ * ```typescript
28573
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
28574
+ * const sessions = await client.scheduling.events.listByParticipant(
28575
+ * 'patient@example.com',
28576
+ * workspaceId,
28577
+ * );
28578
+ * sessions.forEach(s => console.log(s.attributes?.start_time, s.attributes?.status));
28579
+ * ```
28580
+ */
27128
28581
  listByParticipant: async (email, workspaceId, options) => {
27129
28582
  return rb.execute(
27130
28583
  getSchedulingEventsByParticipant,
@@ -27239,7 +28692,7 @@ function createSchedulingNamespace(rb) {
27239
28692
  return rb.execute(
27240
28693
  postSchedulingParticipants,
27241
28694
  {
27242
- body: { data: { type: "scheduling_participant", attributes } }
28695
+ body: { data: { type: "scheduling-participant", attributes } }
27243
28696
  },
27244
28697
  options
27245
28698
  );
@@ -27270,7 +28723,7 @@ function createSchedulingNamespace(rb) {
27270
28723
  patchSchedulingParticipantsById,
27271
28724
  {
27272
28725
  path: { id },
27273
- body: { data: { id, type: "scheduling_participant", attributes } }
28726
+ body: { data: { id, type: "scheduling-participant", attributes } }
27274
28727
  },
27275
28728
  options
27276
28729
  );
@@ -27295,7 +28748,7 @@ function createSchedulingNamespace(rb) {
27295
28748
  path: { id },
27296
28749
  body: {
27297
28750
  data: {
27298
- type: "scheduling_participant",
28751
+ type: "scheduling-participant",
27299
28752
  attributes: { status }
27300
28753
  }
27301
28754
  }
@@ -27437,7 +28890,7 @@ function createSchedulingNamespace(rb) {
27437
28890
  return rb.execute(
27438
28891
  postSchedulingBookings,
27439
28892
  {
27440
- body: { data: { type: "scheduling_booking", attributes } }
28893
+ body: { data: { type: "scheduling-booking", attributes } }
27441
28894
  },
27442
28895
  options
27443
28896
  );
@@ -27494,7 +28947,7 @@ function createSchedulingNamespace(rb) {
27494
28947
  patchSchedulingBookingsByIdCancel,
27495
28948
  {
27496
28949
  path: { id },
27497
- body: attributes ? { data: { type: "scheduling_booking", attributes } } : {}
28950
+ body: attributes ? { data: { type: "scheduling-booking", attributes } } : {}
27498
28951
  },
27499
28952
  options
27500
28953
  );
@@ -27526,7 +28979,7 @@ function createSchedulingNamespace(rb) {
27526
28979
  patchSchedulingBookingsByIdReschedule,
27527
28980
  {
27528
28981
  path: { id },
27529
- body: { data: { type: "scheduling_booking", attributes } }
28982
+ body: { data: { type: "scheduling-booking", attributes } }
27530
28983
  },
27531
28984
  options
27532
28985
  );
@@ -27551,6 +29004,33 @@ function createSchedulingNamespace(rb) {
27551
29004
  { path: { id }, body: {} },
27552
29005
  options
27553
29006
  );
29007
+ },
29008
+ /**
29009
+ * List bookings by booker email address.
29010
+ *
29011
+ * Returns all bookings associated with the given booker email,
29012
+ * regardless of status. Useful for lookup pages where a booker
29013
+ * wants to view or manage their appointments.
29014
+ *
29015
+ * @param email - The booker's email address.
29016
+ * @param options - Optional request options.
29017
+ * @returns An array of `SchedulingBooking` records for that booker.
29018
+ *
29019
+ * @example
29020
+ * ```typescript
29021
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
29022
+ * const bookings = await client.scheduling.bookings.listByBooker(
29023
+ * 'patient@example.com',
29024
+ * );
29025
+ * bookings.forEach(b => console.log(b.attributes?.start_time, b.attributes?.status));
29026
+ * ```
29027
+ */
29028
+ listByBooker: async (email, options) => {
29029
+ return rb.execute(
29030
+ getSchedulingBookingsByBooker,
29031
+ { query: { booker_email: email } },
29032
+ options
29033
+ );
27554
29034
  }
27555
29035
  },
27556
29036
  /**
@@ -27657,7 +29137,7 @@ function createSchedulingNamespace(rb) {
27657
29137
  return rb.execute(
27658
29138
  postSchedulingCalendarSyncs,
27659
29139
  {
27660
- body: { data: { type: "scheduling_calendar_sync", attributes } }
29140
+ body: { data: { type: "scheduling-calendar-sync", attributes } }
27661
29141
  },
27662
29142
  options
27663
29143
  );
@@ -27687,7 +29167,7 @@ function createSchedulingNamespace(rb) {
27687
29167
  {
27688
29168
  path: { id },
27689
29169
  body: {
27690
- data: { id, type: "scheduling_calendar_sync", attributes }
29170
+ data: { id, type: "scheduling-calendar-sync", attributes }
27691
29171
  }
27692
29172
  },
27693
29173
  options
@@ -27767,91 +29247,8 @@ function createSchedulingNamespace(rb) {
27767
29247
  );
27768
29248
  }
27769
29249
  },
27770
- /**
27771
- * Session Notes — clinical notes per appointment, stored in DataStore.
27772
- *
27773
- * Notes are keyed by `{eventId}:{noteType}` under the `sessions` namespace.
27774
- * Each event supports up to 4 note types: `adime`, `soap`, `goals`, `email`.
27775
- *
27776
- * Notes are versioned automatically by DataStore — each `upsert` increments
27777
- * the version counter. Full version history retrieval requires a future
27778
- * DataStore enhancement.
27779
- *
27780
- * @example
27781
- * ```typescript
27782
- * const client = new GptClient({ apiKey: 'sk_app_...' });
27783
- *
27784
- * // Read an ADIME note
27785
- * const note = await client.scheduling.sessionNotes.get(sessionId, 'adime');
27786
- * console.log(note?.attributes?.value?.content);
27787
- *
27788
- * // Write/update a SOAP note
27789
- * await client.scheduling.sessionNotes.upsert(sessionId, 'soap', {
27790
- * content: 'S: Patient reports...',
27791
- * reviewed_by_user_id: currentUserId,
27792
- * reviewed_at: new Date().toISOString(),
27793
- * });
27794
- * ```
27795
- */
27796
- sessionNotes: {
27797
- /**
27798
- * Get the current version of a session note.
27799
- *
27800
- * Returns `null` if no note of this type exists for the event yet.
27801
- *
27802
- * @param eventId - The UUID of the scheduling event (session).
27803
- * @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
27804
- * @param workspaceId - The workspace UUID. Required for application-scoped API keys.
27805
- * @param options - Optional request options.
27806
- * @returns The `DataStoreRecord`, or `null` if not found.
27807
- */
27808
- get: async (eventId, noteType, workspaceId, options) => {
27809
- const results = await rb.execute(
27810
- getDataStoreRecordsByNamespace,
27811
- {
27812
- query: {
27813
- workspace_id: workspaceId,
27814
- namespace: "sessions",
27815
- "filter[record_key]": `${eventId}:${noteType}`
27816
- }
27817
- },
27818
- options
27819
- );
27820
- return results.length > 0 ? results[0] ?? null : null;
27821
- },
27822
- /**
27823
- * Create or update a session note (auto-versions on update).
27824
- *
27825
- * If the note does not exist, it is created. If it exists, its value
27826
- * is replaced and the version counter is incremented.
27827
- *
27828
- * @param eventId - The UUID of the scheduling event (session).
27829
- * @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
27830
- * @param workspaceId - The workspace UUID. Required for application-scoped API keys.
27831
- * @param value - The note content and optional metadata.
27832
- * @param options - Optional request options.
27833
- * @returns The upserted `DataStoreRecord`.
27834
- */
27835
- upsert: async (eventId, noteType, workspaceId, value, options) => {
27836
- return rb.execute(
27837
- postDataStoreRecordsUpsert,
27838
- {
27839
- body: {
27840
- data: {
27841
- type: "data_store_record",
27842
- attributes: {
27843
- namespace: "sessions",
27844
- record_key: `${eventId}:${noteType}`,
27845
- workspace_id: workspaceId,
27846
- value
27847
- }
27848
- }
27849
- }
27850
- },
27851
- options
27852
- );
27853
- }
27854
- }
29250
+ /** Session Notes — clinical notes per appointment (Chartless-specific, backed by DataStore). */
29251
+ sessionNotes: createSessionNotesNamespace(rb)
27855
29252
  };
27856
29253
  }
27857
29254
 
@@ -28035,7 +29432,7 @@ function createSearchNamespace(rb) {
28035
29432
  create: async (attributes, options) => {
28036
29433
  return rb.execute(
28037
29434
  postSearchSaved,
28038
- { body: { data: { type: "saved_search", attributes } } },
29435
+ { body: { data: { type: "saved-search", attributes } } },
28039
29436
  options
28040
29437
  );
28041
29438
  },
@@ -28133,7 +29530,7 @@ function createStorageNamespace(rb) {
28133
29530
  postDocumentsPresignedUpload,
28134
29531
  {
28135
29532
  body: {
28136
- data: { type: "presigned_upload", attributes: attributes ?? {} }
29533
+ data: { type: "presigned-upload", attributes: attributes ?? {} }
28137
29534
  }
28138
29535
  },
28139
29536
  options
@@ -28367,7 +29764,7 @@ function createStorageNamespace(rb) {
28367
29764
  patchStorageFilesByIdArchive,
28368
29765
  {
28369
29766
  path: { id },
28370
- body: { data: { id, type: "storage_file" } }
29767
+ body: { data: { id, type: "storage-file" } }
28371
29768
  },
28372
29769
  options
28373
29770
  );
@@ -28384,7 +29781,7 @@ function createStorageNamespace(rb) {
28384
29781
  patchStorageFilesByIdRestore,
28385
29782
  {
28386
29783
  path: { id },
28387
- body: { data: { id, type: "storage_file" } }
29784
+ body: { data: { id, type: "storage-file" } }
28388
29785
  },
28389
29786
  options
28390
29787
  );
@@ -28405,7 +29802,7 @@ function createStorageNamespace(rb) {
28405
29802
  body: {
28406
29803
  data: {
28407
29804
  id,
28408
- type: "storage_file",
29805
+ type: "storage-file",
28409
29806
  attributes: attributes ?? {}
28410
29807
  }
28411
29808
  }
@@ -28425,7 +29822,7 @@ function createStorageNamespace(rb) {
28425
29822
  patchStorageFilesByIdSoftDelete,
28426
29823
  {
28427
29824
  path: { id },
28428
- body: { data: { id, type: "storage_file" } }
29825
+ body: { data: { id, type: "storage-file" } }
28429
29826
  },
28430
29827
  options
28431
29828
  );
@@ -28444,7 +29841,7 @@ function createStorageNamespace(rb) {
28444
29841
  {
28445
29842
  path: { id },
28446
29843
  body: {
28447
- data: { id, type: "storage_file", attributes: { tags } }
29844
+ data: { id, type: "storage-file", attributes: { tags } }
28448
29845
  }
28449
29846
  },
28450
29847
  options
@@ -28466,7 +29863,7 @@ function createStorageNamespace(rb) {
28466
29863
  body: {
28467
29864
  data: {
28468
29865
  id,
28469
- type: "storage_file",
29866
+ type: "storage-file",
28470
29867
  attributes: { new_metadata: newMetadata }
28471
29868
  }
28472
29869
  }
@@ -28688,6 +30085,40 @@ function createThreadsNamespace(rb) {
28688
30085
  options
28689
30086
  );
28690
30087
  },
30088
+ /**
30089
+ * Merge metadata into the thread's existing metadata (shallow merge).
30090
+ *
30091
+ * Keys present in the input overwrite existing keys; keys not present are
30092
+ * preserved. Use `update({ metadata })` instead for full replacement.
30093
+ *
30094
+ * @param id - The UUID of the thread to update.
30095
+ * @param metadata - Key-value pairs to merge into existing metadata.
30096
+ * @param options - Optional request options.
30097
+ * @returns A promise that resolves to the updated `Thread`.
30098
+ *
30099
+ * @example
30100
+ * ```typescript
30101
+ * await client.threads.updateMetadata(threadId, {
30102
+ * pinned_context: { client_id: 'uuid', client_name: 'Sarah Johnson' },
30103
+ * });
30104
+ * ```
30105
+ */
30106
+ updateMetadata: async (id, metadata, options) => {
30107
+ return rb.execute(
30108
+ patchThreadsByIdMetadata,
30109
+ {
30110
+ path: { id },
30111
+ body: {
30112
+ data: {
30113
+ id,
30114
+ type: "chat-thread",
30115
+ attributes: { metadata }
30116
+ }
30117
+ }
30118
+ },
30119
+ options
30120
+ );
30121
+ },
28691
30122
  /**
28692
30123
  * Generates an AI-produced summary of the thread's conversation history.
28693
30124
  *
@@ -28699,12 +30130,12 @@ function createThreadsNamespace(rb) {
28699
30130
  * @param id - The UUID of the thread to summarize.
28700
30131
  * @param options - Optional request options.
28701
30132
  * @returns A promise that resolves to the `Thread` object with the generated
28702
- * summary populated in `attributes.summary`.
30133
+ * summary populated in `attributes.context_summary`.
28703
30134
  *
28704
30135
  * @example
28705
30136
  * const client = new GptClient({ apiKey: 'sk_app_...' });
28706
30137
  * const thread = await client.threads.summarize('thr_01HXYZ...');
28707
- * console.log(thread.attributes.summary);
30138
+ * console.log(thread.attributes.context_summary);
28708
30139
  */
28709
30140
  summarize: async (id, options) => {
28710
30141
  return rb.execute(
@@ -28731,10 +30162,13 @@ function createThreadsNamespace(rb) {
28731
30162
  * const fork = await client.threads.fork('thr_01HXYZ...');
28732
30163
  * console.log(`Forked into new thread: ${fork.id}`);
28733
30164
  */
28734
- fork: async (id, options) => {
30165
+ fork: async (id, title, options) => {
28735
30166
  return rb.execute(
28736
30167
  postThreadsByIdFork,
28737
- { path: { id }, body: {} },
30168
+ {
30169
+ path: { id },
30170
+ body: title ? { data: { type: "chat-thread", attributes: { title } } } : {}
30171
+ },
28738
30172
  options
28739
30173
  );
28740
30174
  },
@@ -28747,20 +30181,22 @@ function createThreadsNamespace(rb) {
28747
30181
  * via request options or query parameters.
28748
30182
  *
28749
30183
  * @param id - The UUID of the thread to export.
28750
- * @param options - Optional request options. Pass a `format` parameter
28751
- * (e.g. `'json'`, `'markdown'`, `'text'`) to control the output format.
28752
- * @returns A promise that resolves to the `Thread` object with the export
28753
- * payload available in `attributes.export`.
30184
+ * @param format - Export format: `'json'`, `'markdown'`, or `'text'`. Defaults to `'json'`.
30185
+ * @param options - Optional request options.
30186
+ * @returns A promise that resolves to the export payload.
28754
30187
  *
28755
30188
  * @example
28756
30189
  * const client = new GptClient({ apiKey: 'sk_app_...' });
28757
- * const exported = await client.threads.export('thr_01HXYZ...');
28758
- * console.log(exported.attributes.export); // Markdown or JSON string
30190
+ * const exported = await client.threads.export('thr_01HXYZ...', 'markdown');
30191
+ * console.log(exported.content);
28759
30192
  */
28760
- export: async (id, options) => {
30193
+ export: async (id, format = "json", options) => {
28761
30194
  return rb.execute(
28762
30195
  postThreadsByIdExport,
28763
- { path: { id }, body: {} },
30196
+ {
30197
+ path: { id },
30198
+ body: { data: { type: "chat-thread", format } }
30199
+ },
28764
30200
  options
28765
30201
  );
28766
30202
  },
@@ -28918,6 +30354,113 @@ function createThreadsNamespace(rb) {
28918
30354
  options
28919
30355
  );
28920
30356
  },
30357
+ /**
30358
+ * Inserts a pre-generated message into a thread WITHOUT triggering AI inference.
30359
+ *
30360
+ * Use this to persist results from specialized agent executions (via
30361
+ * `sdk.agents.executions.start()`) back into a thread. The message is stored
30362
+ * with PII compliance scan and async vectorization, but no LLM call is made.
30363
+ *
30364
+ * @param threadId - The UUID of the thread to insert the message into.
30365
+ * @param content - The message content text.
30366
+ * @param attributes - Message attributes including `role` (typically `'assistant'`).
30367
+ * @param options - Optional request options.
30368
+ * @returns A promise resolving to the created `Message`.
30369
+ *
30370
+ * @example
30371
+ * ```typescript
30372
+ * const message = await client.threads.messages.insert(threadId, result.content, {
30373
+ * role: 'assistant',
30374
+ * metadata: { execution_id: execution.id, agent_id: agentId },
30375
+ * });
30376
+ * ```
30377
+ */
30378
+ insert: async (threadId, content, attributes, options) => {
30379
+ return rb.execute(
30380
+ postMessages,
30381
+ {
30382
+ body: {
30383
+ data: {
30384
+ type: "chat-message",
30385
+ attributes: {
30386
+ ...attributes,
30387
+ content,
30388
+ thread_id: threadId
30389
+ }
30390
+ }
30391
+ }
30392
+ },
30393
+ options
30394
+ );
30395
+ },
30396
+ /**
30397
+ * Submit thumbs up/down feedback on a message. Uses upsert — calling again
30398
+ * on the same message replaces the previous rating.
30399
+ *
30400
+ * @param messageId - The UUID of the message to rate.
30401
+ * @param rating - `'up'` or `'down'`.
30402
+ * @param comment - Optional comment explaining the rating.
30403
+ * @param options - Optional request options.
30404
+ * @returns A promise resolving to the created/updated `MessageFeedback`.
30405
+ *
30406
+ * @example
30407
+ * ```typescript
30408
+ * await client.threads.messages.rate(messageId, 'up');
30409
+ * await client.threads.messages.rate(messageId, 'down', 'Response was inaccurate');
30410
+ * ```
30411
+ */
30412
+ rate: async (messageId, rating, comment, options) => {
30413
+ return rb.execute(
30414
+ postMessageFeedback,
30415
+ {
30416
+ body: {
30417
+ data: {
30418
+ type: "chat-message-feedback",
30419
+ attributes: {
30420
+ message_id: messageId,
30421
+ rating,
30422
+ ...comment != null ? { comment } : {}
30423
+ }
30424
+ }
30425
+ }
30426
+ },
30427
+ options
30428
+ );
30429
+ },
30430
+ /**
30431
+ * Update an existing message's content, role, or metadata (PATCH semantics).
30432
+ *
30433
+ * Only the fields present in `attributes` are changed. Useful for attaching
30434
+ * metadata (e.g., execution_id, tool_call details) to a message after creation.
30435
+ *
30436
+ * @param messageId - The UUID of the message to update.
30437
+ * @param attributes - Fields to update.
30438
+ * @param options - Optional request options.
30439
+ * @returns A promise resolving to the updated `Message`.
30440
+ *
30441
+ * @example
30442
+ * ```typescript
30443
+ * await client.threads.messages.update(messageId, {
30444
+ * metadata: { execution_id: 'exec_123', reviewed: true },
30445
+ * });
30446
+ * ```
30447
+ */
30448
+ update: async (messageId, attributes, options) => {
30449
+ return rb.execute(
30450
+ patchMessagesById,
30451
+ {
30452
+ path: { id: messageId },
30453
+ body: {
30454
+ data: {
30455
+ id: messageId,
30456
+ type: "chat-message",
30457
+ attributes
30458
+ }
30459
+ }
30460
+ },
30461
+ options
30462
+ );
30463
+ },
28921
30464
  /**
28922
30465
  * Sends a message to a thread and streams the AI response via Server-Sent Events (SSE).
28923
30466
  *
@@ -28982,41 +30525,51 @@ function createThreadsNamespace(rb) {
28982
30525
  },
28983
30526
  /**
28984
30527
  * Full-text substring search across message content.
30528
+ * Optionally filter to a specific thread.
28985
30529
  *
28986
30530
  * @param query - Substring to match against message content.
30531
+ * @param threadId - Optional thread UUID to scope the search.
28987
30532
  * @param options - Optional request options.
28988
30533
  * @returns A promise resolving to an array of matching `Message` objects.
28989
30534
  *
28990
30535
  * @example
28991
- * const client = new GptClient({ apiKey: 'sk_app_...' });
28992
- * const results = await client.threads.messages.search('deadline');
30536
+ * ```typescript
30537
+ * // Search all messages
30538
+ * const all = await client.threads.messages.search('deadline');
30539
+ * // Search within a specific thread
30540
+ * const scoped = await client.threads.messages.search('deadline', threadId);
30541
+ * ```
28993
30542
  */
28994
- search: async (query, options) => {
30543
+ search: async (query, threadId, options) => {
30544
+ const filter = { query };
30545
+ if (threadId) filter.thread_id = threadId;
28995
30546
  return rb.execute(
28996
30547
  getMessagesSearch,
28997
- { query: { filter: { query } } },
30548
+ { query: { filter } },
28998
30549
  options
28999
30550
  );
29000
30551
  },
29001
30552
  /**
29002
30553
  * Vector similarity search across messages using a generated embedding.
29003
- *
29004
- * Returns messages ranked by cosine similarity (threshold > 0.6).
29005
- * Requires embeddings to have been generated via the async vectorization pipeline.
30554
+ * Optionally filter to a specific thread.
29006
30555
  *
29007
30556
  * @param query - Natural-language query string to embed and search.
29008
30557
  * @param limit - Maximum number of results (default: 10).
30558
+ * @param threadId - Optional thread UUID to scope the search.
29009
30559
  * @param options - Optional request options.
29010
30560
  * @returns A promise resolving to an array of semantically similar `Message` objects.
29011
30561
  *
29012
30562
  * @example
29013
- * const client = new GptClient({ apiKey: 'sk_app_...' });
29014
- * const results = await client.threads.messages.semanticSearch('unpaid invoices', 5);
30563
+ * ```typescript
30564
+ * const results = await client.threads.messages.semanticSearch('unpaid invoices', 5, threadId);
30565
+ * ```
29015
30566
  */
29016
- semanticSearch: async (query, limit = 10, options) => {
30567
+ semanticSearch: async (query, limit = 10, threadId, options) => {
30568
+ const filter = { query, limit };
30569
+ if (threadId) filter.thread_id = threadId;
29017
30570
  return rb.execute(
29018
30571
  getMessagesSemanticSearch,
29019
- { query: { filter: { query, limit } } },
30572
+ { query: { filter } },
29020
30573
  options
29021
30574
  );
29022
30575
  }
@@ -29259,7 +30812,7 @@ function createTrainingNamespace(rb) {
29259
30812
  create: async (attributes, options) => {
29260
30813
  return rb.execute(
29261
30814
  postTrainingExamplesBulkDelete,
29262
- { body: { data: { type: "training_example", attributes } } },
30815
+ { body: { data: { type: "training-example", attributes } } },
29263
30816
  options
29264
30817
  );
29265
30818
  },
@@ -29289,7 +30842,7 @@ function createTrainingNamespace(rb) {
29289
30842
  patchTrainingExamplesById,
29290
30843
  {
29291
30844
  path: { id },
29292
- body: { data: { id, type: "training_example", attributes } }
30845
+ body: { data: { id, type: "training-example", attributes } }
29293
30846
  },
29294
30847
  options
29295
30848
  );
@@ -29470,7 +31023,7 @@ function createTrainingNamespace(rb) {
29470
31023
  create: async (attributes, options) => {
29471
31024
  return rb.execute(
29472
31025
  getTrainingSessionsAgentsByAgentIdSessions,
29473
- { body: { data: { type: "training_session", attributes } } },
31026
+ { body: { data: { type: "training-session", attributes } } },
29474
31027
  options
29475
31028
  );
29476
31029
  },
@@ -29520,7 +31073,7 @@ function createTrainingNamespace(rb) {
29520
31073
  getTrainingSessionsAgentsByAgentIdSessions,
29521
31074
  {
29522
31075
  path: { agent_id: agentId },
29523
- body: { data: { type: "training_session", attributes } }
31076
+ body: { data: { type: "training-session", attributes } }
29524
31077
  },
29525
31078
  options
29526
31079
  );
@@ -29581,6 +31134,11 @@ function createVoiceNamespace(rb) {
29581
31134
  if (params?.modelSize) form.append("model_size", params.modelSize);
29582
31135
  if (params?.phiMode) form.append("phi_mode", params.phiMode);
29583
31136
  if (params?.phiKey) form.append("phi_key", params.phiKey);
31137
+ if (params?.enableDiarization) form.append("enable_diarization", "true");
31138
+ if (params?.numSpeakers != null)
31139
+ form.append("num_speakers", String(params.numSpeakers));
31140
+ if (params?.initialPrompt)
31141
+ form.append("initial_prompt", params.initialPrompt);
29584
31142
  return rb.rawPostMultipart(
29585
31143
  "/voice/transcribe",
29586
31144
  form,
@@ -29618,9 +31176,18 @@ function createVoiceNamespace(rb) {
29618
31176
  * ```
29619
31177
  */
29620
31178
  list: async (options) => {
31179
+ const filters = {};
31180
+ if (options?.status) filters["filter[status]"] = options.status;
31181
+ if (options?.insertedAfter)
31182
+ filters["filter[inserted_after]"] = options.insertedAfter;
31183
+ if (options?.insertedBefore)
31184
+ filters["filter[inserted_before]"] = options.insertedBefore;
29621
31185
  return rb.execute(
29622
31186
  getVoiceSessions,
29623
- buildPageQuery(options?.page, options?.pageSize),
31187
+ {
31188
+ ...buildPageQuery(options?.page, options?.pageSize),
31189
+ query: filters
31190
+ },
29624
31191
  options
29625
31192
  );
29626
31193
  },
@@ -29744,7 +31311,7 @@ function createVoiceNamespace(rb) {
29744
31311
  {
29745
31312
  body: {
29746
31313
  data: {
29747
- type: "voice_session",
31314
+ type: "voice-session",
29748
31315
  attributes: {
29749
31316
  thread_id: params?.threadId,
29750
31317
  blueprint_id: params?.blueprintId,
@@ -29785,7 +31352,7 @@ function createVoiceNamespace(rb) {
29785
31352
  stop: async (id, options) => {
29786
31353
  return rb.execute(
29787
31354
  patchVoiceSessionsByIdStop,
29788
- { path: { id }, body: { data: { id, type: "voice_session" } } },
31355
+ { path: { id }, body: { data: { id, type: "voice-session" } } },
29789
31356
  options
29790
31357
  );
29791
31358
  },
@@ -29839,7 +31406,7 @@ function createVoiceNamespace(rb) {
29839
31406
  body: {
29840
31407
  data: {
29841
31408
  id,
29842
- type: "voice_session",
31409
+ type: "voice-session",
29843
31410
  attributes: {
29844
31411
  blueprint_id: params?.blueprintId,
29845
31412
  phi_mode: params?.phiMode,
@@ -30031,7 +31598,7 @@ function createVoiceNamespace(rb) {
30031
31598
  {
30032
31599
  body: {
30033
31600
  data: {
30034
- type: "voice_transcription_result",
31601
+ type: "voice-transcription-result",
30035
31602
  attributes
30036
31603
  }
30037
31604
  }
@@ -30068,7 +31635,7 @@ function createVoiceNamespace(rb) {
30068
31635
  body: {
30069
31636
  data: {
30070
31637
  id,
30071
- type: "voice_transcription_result",
31638
+ type: "voice-transcription-result",
30072
31639
  attributes
30073
31640
  }
30074
31641
  }
@@ -30099,6 +31666,197 @@ function createVoiceNamespace(rb) {
30099
31666
  options
30100
31667
  );
30101
31668
  }
31669
+ },
31670
+ /**
31671
+ * Transcription jobs — progressive chunked transcription for long recordings.
31672
+ *
31673
+ * Designed for clinical recording sessions (30–60 minutes). The browser records
31674
+ * audio and uploads chunks every 2–3 minutes. Each chunk is transcribed
31675
+ * synchronously on upload. On finalize, chunks are assembled into a complete
31676
+ * diarized transcript.
31677
+ *
31678
+ * Typical flow:
31679
+ * 1. `create()` — start a new transcription job with config (language, diarization, etc.)
31680
+ * 2. `uploadChunk(jobId, audioBlob)` — upload each chunk as it's recorded
31681
+ * 3. `finalize(jobId)` — assemble all chunks and optionally trigger pipeline
31682
+ *
31683
+ * Subscribe to the `voice:{workspace_id}` WebSocket channel for real-time
31684
+ * progress events: `transcription:chunk_completed`, `transcription:job_completed`.
31685
+ *
31686
+ * @example
31687
+ * ```typescript
31688
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
31689
+ *
31690
+ * // Create job with medical vocabulary hints
31691
+ * const job = await client.voice.transcriptionJobs.create({
31692
+ * language: 'en',
31693
+ * modelSize: 'large',
31694
+ * enableDiarization: true,
31695
+ * numSpeakers: 2,
31696
+ * initialPrompt: 'albumin, HbA1c, Metformin, MCT oil, prealbumin',
31697
+ * });
31698
+ *
31699
+ * // Upload chunks as they're recorded (MediaRecorder ondataavailable)
31700
+ * mediaRecorder.ondataavailable = async (event) => {
31701
+ * if (event.data.size > 0) {
31702
+ * const result = await client.voice.transcriptionJobs.uploadChunk(
31703
+ * job.id!, event.data
31704
+ * );
31705
+ * console.log(`Chunk ${result.chunk_index}: ${result.text}`);
31706
+ * }
31707
+ * };
31708
+ *
31709
+ * // Finalize after recording stops
31710
+ * const transcript = await client.voice.transcriptionJobs.finalize(job.id!, {
31711
+ * blueprintId: 'bp_clinical_notes',
31712
+ * patientId: 'contact_abc123',
31713
+ * });
31714
+ * console.log(transcript.assembled_text);
31715
+ * ```
31716
+ */
31717
+ transcriptionJobs: {
31718
+ /**
31719
+ * Create a new transcription job.
31720
+ *
31721
+ * @param params - Job configuration (language, model, diarization, vocabulary hints).
31722
+ * @param options - Optional request options.
31723
+ * @returns The created TranscriptionJob resource (JSON:API format).
31724
+ */
31725
+ create: async (params, options) => {
31726
+ return rb.execute(
31727
+ postVoiceTranscriptionJobs,
31728
+ {
31729
+ body: {
31730
+ data: {
31731
+ type: "transcription-job",
31732
+ attributes: {
31733
+ language: params?.language,
31734
+ model_size: params?.modelSize,
31735
+ enable_diarization: params?.enableDiarization,
31736
+ num_speakers: params?.numSpeakers,
31737
+ initial_prompt: params?.initialPrompt,
31738
+ phi_mode: params?.phiMode,
31739
+ metadata: params?.metadata
31740
+ }
31741
+ }
31742
+ }
31743
+ },
31744
+ options
31745
+ );
31746
+ },
31747
+ /**
31748
+ * Get a transcription job by ID.
31749
+ *
31750
+ * @param id - The UUID of the transcription job.
31751
+ * @param options - Optional request options.
31752
+ * @returns The TranscriptionJob resource.
31753
+ */
31754
+ get: async (id, options) => {
31755
+ return rb.execute(
31756
+ getVoiceTranscriptionJobsById,
31757
+ { path: { id } },
31758
+ options
31759
+ );
31760
+ },
31761
+ /**
31762
+ * List transcription jobs for the current user.
31763
+ *
31764
+ * @param options - Optional pagination and request options.
31765
+ * @returns Array of TranscriptionJob resources.
31766
+ */
31767
+ listMine: async (options) => {
31768
+ return rb.execute(
31769
+ getVoiceTranscriptionJobsMine,
31770
+ buildPageQuery(options?.page, options?.pageSize),
31771
+ options
31772
+ );
31773
+ },
31774
+ /**
31775
+ * List all transcription jobs accessible to the current actor.
31776
+ *
31777
+ * @param options - Optional pagination and request options.
31778
+ * @returns Array of TranscriptionJob resources.
31779
+ */
31780
+ list: async (options) => {
31781
+ return rb.execute(
31782
+ getVoiceTranscriptionJobs,
31783
+ buildPageQuery(options?.page, options?.pageSize),
31784
+ options
31785
+ );
31786
+ },
31787
+ /**
31788
+ * List transcription jobs for a specific workspace.
31789
+ *
31790
+ * @param workspaceId - The UUID of the workspace.
31791
+ * @param options - Optional pagination and request options.
31792
+ * @returns Array of TranscriptionJob resources.
31793
+ */
31794
+ listByWorkspace: async (workspaceId, options) => {
31795
+ return rb.execute(
31796
+ getVoiceTranscriptionJobsWorkspaceByWorkspaceId,
31797
+ {
31798
+ path: { workspace_id: workspaceId },
31799
+ ...buildPageQuery(options?.page, options?.pageSize)
31800
+ },
31801
+ options
31802
+ );
31803
+ },
31804
+ /**
31805
+ * Upload and transcribe an audio chunk.
31806
+ *
31807
+ * The chunk is transcribed synchronously. For 2–3 minute chunks, expect
31808
+ * 10–20 seconds of processing time. The response includes the chunk's
31809
+ * transcript and segments (with speaker_id if diarization is enabled).
31810
+ *
31811
+ * @param jobId - The UUID of the transcription job.
31812
+ * @param audio - The audio chunk (File or Blob). Max 50 MB.
31813
+ * @param options - Optional request options.
31814
+ * @returns Chunk transcription result with text, segments, and timing.
31815
+ */
31816
+ uploadChunk: async (jobId, audio, options) => {
31817
+ const form = new FormData();
31818
+ form.append("audio", audio);
31819
+ return rb.rawPostMultipart(
31820
+ `/voice/transcription-jobs/${jobId}/chunks`,
31821
+ form,
31822
+ options
31823
+ );
31824
+ },
31825
+ /**
31826
+ * Finalize a transcription job — assemble chunks into a complete transcript.
31827
+ *
31828
+ * Joins all chunk transcripts in order, offsets segment timestamps, and
31829
+ * reconciles speaker IDs across chunks. Optionally triggers a blueprint
31830
+ * pipeline (e.g., SOAP note generation) on the assembled transcript.
31831
+ *
31832
+ * @param jobId - The UUID of the transcription job to finalize.
31833
+ * @param params - Optional pipeline trigger parameters.
31834
+ * @param options - Optional request options.
31835
+ * @returns The assembled transcript with full text, segments, and timing.
31836
+ */
31837
+ finalize: async (jobId, params, options) => {
31838
+ const body = {};
31839
+ if (params?.blueprintId) body.blueprint_id = params.blueprintId;
31840
+ if (params?.patientId) body.patient_id = params.patientId;
31841
+ return rb.rawPost(
31842
+ `/voice/transcription-jobs/${jobId}/finalize`,
31843
+ body,
31844
+ options
31845
+ );
31846
+ },
31847
+ /**
31848
+ * Delete a transcription job.
31849
+ *
31850
+ * @param id - The UUID of the transcription job to delete.
31851
+ * @param options - Optional request options.
31852
+ */
31853
+ destroy: async (id, options) => {
31854
+ await rb.executeDelete(
31855
+ deleteVoiceTranscriptionJobsById,
31856
+ { path: { id } },
31857
+ options
31858
+ );
31859
+ }
30102
31860
  }
30103
31861
  };
30104
31862
  }
@@ -30670,7 +32428,7 @@ function createWatcherNamespace(rb) {
30670
32428
  create: async (attributes, options) => {
30671
32429
  return rb.execute(
30672
32430
  postWatcherClaims,
30673
- { body: { data: { type: "watcher_claim", attributes } } },
32431
+ { body: { data: { type: "watcher-claim", attributes } } },
30674
32432
  options
30675
32433
  );
30676
32434
  },
@@ -30702,7 +32460,7 @@ function createWatcherNamespace(rb) {
30702
32460
  patchWatcherClaimsById,
30703
32461
  {
30704
32462
  path: { id },
30705
- body: { data: { id, type: "watcher_claim", attributes } }
32463
+ body: { data: { id, type: "watcher-claim", attributes } }
30706
32464
  },
30707
32465
  options
30708
32466
  );
@@ -30857,7 +32615,7 @@ function createWatcherNamespace(rb) {
30857
32615
  create: async (attributes, options) => {
30858
32616
  return rb.execute(
30859
32617
  postWatcherEvents,
30860
- { body: { data: { type: "watcher_event", attributes } } },
32618
+ { body: { data: { type: "watcher-event", attributes } } },
30861
32619
  options
30862
32620
  );
30863
32621
  },
@@ -31021,7 +32779,7 @@ function createSocialNamespace(rb) {
31021
32779
  postSocialAccounts,
31022
32780
  {
31023
32781
  body: {
31024
- data: { type: "social_account", attributes }
32782
+ data: { type: "social-account", attributes }
31025
32783
  }
31026
32784
  },
31027
32785
  options
@@ -31034,7 +32792,7 @@ function createSocialNamespace(rb) {
31034
32792
  {
31035
32793
  path: { id },
31036
32794
  body: {
31037
- data: { type: "social_account", id, attributes }
32795
+ data: { type: "social-account", id, attributes }
31038
32796
  }
31039
32797
  },
31040
32798
  options
@@ -31051,7 +32809,7 @@ function createSocialNamespace(rb) {
31051
32809
  {
31052
32810
  path: { id },
31053
32811
  body: {
31054
- data: { type: "social_account", id, attributes: {} }
32812
+ data: { type: "social-account", id, attributes: {} }
31055
32813
  }
31056
32814
  },
31057
32815
  options
@@ -31064,7 +32822,7 @@ function createSocialNamespace(rb) {
31064
32822
  {
31065
32823
  path: { id },
31066
32824
  body: {
31067
- data: { type: "social_account", id, attributes: {} }
32825
+ data: { type: "social-account", id, attributes: {} }
31068
32826
  }
31069
32827
  },
31070
32828
  options
@@ -31077,7 +32835,7 @@ function createSocialNamespace(rb) {
31077
32835
  {
31078
32836
  path: { id },
31079
32837
  body: {
31080
- data: { type: "social_account", id, attributes: {} }
32838
+ data: { type: "social-account", id, attributes: {} }
31081
32839
  }
31082
32840
  },
31083
32841
  options
@@ -31092,7 +32850,7 @@ function createSocialNamespace(rb) {
31092
32850
  postSocialPosts,
31093
32851
  {
31094
32852
  body: {
31095
- data: { type: "social_post", attributes }
32853
+ data: { type: "social-post", attributes }
31096
32854
  }
31097
32855
  },
31098
32856
  options
@@ -31109,7 +32867,7 @@ function createSocialNamespace(rb) {
31109
32867
  {
31110
32868
  path: { id },
31111
32869
  body: {
31112
- data: { type: "social_post", id, attributes }
32870
+ data: { type: "social-post", id, attributes }
31113
32871
  }
31114
32872
  },
31115
32873
  options
@@ -31127,7 +32885,7 @@ function createSocialNamespace(rb) {
31127
32885
  path: { id },
31128
32886
  body: {
31129
32887
  data: {
31130
- type: "social_post",
32888
+ type: "social-post",
31131
32889
  id,
31132
32890
  attributes: { scheduled_at: scheduledAt }
31133
32891
  }
@@ -31143,7 +32901,7 @@ function createSocialNamespace(rb) {
31143
32901
  {
31144
32902
  path: { id },
31145
32903
  body: {
31146
- data: { type: "social_post", id, attributes: {} }
32904
+ data: { type: "social-post", id, attributes: {} }
31147
32905
  }
31148
32906
  },
31149
32907
  options
@@ -31156,7 +32914,7 @@ function createSocialNamespace(rb) {
31156
32914
  {
31157
32915
  path: { id },
31158
32916
  body: {
31159
- data: { type: "social_post", id, attributes: {} }
32917
+ data: { type: "social-post", id, attributes: {} }
31160
32918
  }
31161
32919
  },
31162
32920
  options
@@ -31169,7 +32927,7 @@ function createSocialNamespace(rb) {
31169
32927
  {
31170
32928
  path: { id },
31171
32929
  body: {
31172
- data: { type: "social_post", id, attributes: {} }
32930
+ data: { type: "social-post", id, attributes: {} }
31173
32931
  }
31174
32932
  },
31175
32933
  options
@@ -31182,7 +32940,7 @@ function createSocialNamespace(rb) {
31182
32940
  {
31183
32941
  path: { id },
31184
32942
  body: {
31185
- data: { type: "social_post", id, attributes }
32943
+ data: { type: "social-post", id, attributes }
31186
32944
  }
31187
32945
  },
31188
32946
  options
@@ -31266,13 +33024,17 @@ function createSocialNamespace(rb) {
31266
33024
  get: async (id, options) => {
31267
33025
  return rb.execute(getSocialCampaignsById, { path: { id } }, options);
31268
33026
  },
31269
- /** Create a new social campaign. */
33027
+ /**
33028
+ * Create a new social campaign.
33029
+ * Workspace is resolved from the authenticated user's context — do NOT
33030
+ * pass `workspace_id` in attributes.
33031
+ */
31270
33032
  create: async (attributes, options) => {
31271
33033
  return rb.execute(
31272
33034
  postSocialCampaigns,
31273
33035
  {
31274
33036
  body: {
31275
- data: { type: "social_campaign", attributes }
33037
+ data: { type: "social-campaign", attributes }
31276
33038
  }
31277
33039
  },
31278
33040
  options
@@ -31285,7 +33047,7 @@ function createSocialNamespace(rb) {
31285
33047
  {
31286
33048
  path: { id },
31287
33049
  body: {
31288
- data: { type: "social_campaign", id, attributes }
33050
+ data: { type: "social-campaign", id, attributes }
31289
33051
  }
31290
33052
  },
31291
33053
  options
@@ -31303,7 +33065,7 @@ function createSocialNamespace(rb) {
31303
33065
  path: { id },
31304
33066
  body: {
31305
33067
  data: {
31306
- type: "social_campaign",
33068
+ type: "social-campaign",
31307
33069
  id,
31308
33070
  attributes: { scheduled_at: scheduledAt }
31309
33071
  }
@@ -31319,7 +33081,7 @@ function createSocialNamespace(rb) {
31319
33081
  {
31320
33082
  path: { id },
31321
33083
  body: {
31322
- data: { type: "social_campaign", id, attributes: {} }
33084
+ data: { type: "social-campaign", id, attributes: {} }
31323
33085
  }
31324
33086
  },
31325
33087
  options
@@ -32353,7 +34115,6 @@ var RequestBuilder = class {
32353
34115
  const result = await this.requestWithRetry(
32354
34116
  () => fn({
32355
34117
  client: this.clientInstance,
32356
- throwOnError: true,
32357
34118
  headers,
32358
34119
  ...params,
32359
34120
  ...options?.signal && { signal: options.signal }
@@ -32932,6 +34693,7 @@ var Webhooks = class _Webhooks {
32932
34693
  buildHeaders,
32933
34694
  buildUserAgent,
32934
34695
  collectStreamedMessage,
34696
+ createChannelsNamespace,
32935
34697
  createImportsNamespace,
32936
34698
  handleApiError,
32937
34699
  isBrowserEnvironment,