@gpt-platform/client 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6661 -4205
- package/dist/index.d.ts +6661 -4205
- package/dist/index.js +2255 -503
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2469 -718
- package/dist/index.mjs.map +1 -1
- package/llms.txt +360 -334
- package/package.json +1 -1
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.
|
|
1338
|
-
var DEFAULT_API_VERSION = "2026-03-
|
|
1341
|
+
var SDK_VERSION = "0.10.0";
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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: "
|
|
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: "
|
|
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
|
-
*
|
|
10733
|
-
*
|
|
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
|
-
*
|
|
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: "
|
|
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
|
-
*
|
|
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: "
|
|
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
|
|
10870
|
-
*
|
|
10871
|
-
*
|
|
10872
|
-
*
|
|
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
|
-
{
|
|
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
|
-
*
|
|
10888
|
-
*
|
|
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
|
-
*
|
|
10904
|
-
*
|
|
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: "
|
|
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
|
-
*
|
|
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: "
|
|
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
|
|
10983
|
-
*
|
|
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
|
-
{
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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: "
|
|
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: "
|
|
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
|
|
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.
|
|
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
|
-
{
|
|
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
|
-
*
|
|
11187
|
-
*
|
|
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
|
-
*
|
|
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: "
|
|
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
|
|
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: "
|
|
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
|
*
|
|
@@ -14124,7 +15011,7 @@ function createComplianceNamespace(rb) {
|
|
|
14124
15011
|
postBreachIncidents,
|
|
14125
15012
|
{
|
|
14126
15013
|
body: {
|
|
14127
|
-
data: { type: "
|
|
15014
|
+
data: { type: "breach-incident", attributes }
|
|
14128
15015
|
}
|
|
14129
15016
|
},
|
|
14130
15017
|
options
|
|
@@ -14158,7 +15045,7 @@ function createComplianceNamespace(rb) {
|
|
|
14158
15045
|
{
|
|
14159
15046
|
path: { id },
|
|
14160
15047
|
body: {
|
|
14161
|
-
data: { type: "
|
|
15048
|
+
data: { type: "breach-incident", id, attributes: { status } }
|
|
14162
15049
|
}
|
|
14163
15050
|
},
|
|
14164
15051
|
options
|
|
@@ -14322,7 +15209,7 @@ function createComplianceNamespace(rb) {
|
|
|
14322
15209
|
postConsentRecords,
|
|
14323
15210
|
{
|
|
14324
15211
|
body: {
|
|
14325
|
-
data: { type: "
|
|
15212
|
+
data: { type: "consent-record", attributes }
|
|
14326
15213
|
}
|
|
14327
15214
|
},
|
|
14328
15215
|
options
|
|
@@ -14355,7 +15242,7 @@ function createComplianceNamespace(rb) {
|
|
|
14355
15242
|
{
|
|
14356
15243
|
path: { id },
|
|
14357
15244
|
body: {
|
|
14358
|
-
data: { type: "
|
|
15245
|
+
data: { type: "consent-record", id, attributes: {} }
|
|
14359
15246
|
}
|
|
14360
15247
|
},
|
|
14361
15248
|
options
|
|
@@ -14440,7 +15327,7 @@ function createComplianceNamespace(rb) {
|
|
|
14440
15327
|
{
|
|
14441
15328
|
body: {
|
|
14442
15329
|
data: {
|
|
14443
|
-
type: "
|
|
15330
|
+
type: "data-protection-impact-assessment",
|
|
14444
15331
|
attributes
|
|
14445
15332
|
}
|
|
14446
15333
|
}
|
|
@@ -14476,7 +15363,7 @@ function createComplianceNamespace(rb) {
|
|
|
14476
15363
|
path: { id },
|
|
14477
15364
|
body: {
|
|
14478
15365
|
data: {
|
|
14479
|
-
type: "
|
|
15366
|
+
type: "data-protection-impact-assessment",
|
|
14480
15367
|
id,
|
|
14481
15368
|
attributes
|
|
14482
15369
|
}
|
|
@@ -14511,7 +15398,7 @@ function createComplianceNamespace(rb) {
|
|
|
14511
15398
|
path: { id },
|
|
14512
15399
|
body: {
|
|
14513
15400
|
data: {
|
|
14514
|
-
type: "
|
|
15401
|
+
type: "data-protection-impact-assessment",
|
|
14515
15402
|
id,
|
|
14516
15403
|
attributes: {}
|
|
14517
15404
|
}
|
|
@@ -14600,7 +15487,7 @@ function createComplianceNamespace(rb) {
|
|
|
14600
15487
|
postProcessingActivities,
|
|
14601
15488
|
{
|
|
14602
15489
|
body: {
|
|
14603
|
-
data: { type: "
|
|
15490
|
+
data: { type: "processing-activity", attributes }
|
|
14604
15491
|
}
|
|
14605
15492
|
},
|
|
14606
15493
|
options
|
|
@@ -14708,7 +15595,7 @@ function createComplianceNamespace(rb) {
|
|
|
14708
15595
|
postRetentionPolicies,
|
|
14709
15596
|
{
|
|
14710
15597
|
body: {
|
|
14711
|
-
data: { type: "
|
|
15598
|
+
data: { type: "retention-policy", attributes }
|
|
14712
15599
|
}
|
|
14713
15600
|
},
|
|
14714
15601
|
options
|
|
@@ -14739,7 +15626,7 @@ function createComplianceNamespace(rb) {
|
|
|
14739
15626
|
{
|
|
14740
15627
|
path: { id },
|
|
14741
15628
|
body: {
|
|
14742
|
-
data: { type: "
|
|
15629
|
+
data: { type: "retention-policy", id, attributes }
|
|
14743
15630
|
}
|
|
14744
15631
|
},
|
|
14745
15632
|
options
|
|
@@ -14850,7 +15737,7 @@ function createComplianceNamespace(rb) {
|
|
|
14850
15737
|
postDataSubjectRequests,
|
|
14851
15738
|
{
|
|
14852
15739
|
body: {
|
|
14853
|
-
data: { type: "
|
|
15740
|
+
data: { type: "data-subject-request", attributes }
|
|
14854
15741
|
}
|
|
14855
15742
|
},
|
|
14856
15743
|
options
|
|
@@ -14885,7 +15772,7 @@ function createComplianceNamespace(rb) {
|
|
|
14885
15772
|
path: { id },
|
|
14886
15773
|
body: {
|
|
14887
15774
|
data: {
|
|
14888
|
-
type: "
|
|
15775
|
+
type: "data-subject-request",
|
|
14889
15776
|
id,
|
|
14890
15777
|
attributes: { status }
|
|
14891
15778
|
}
|
|
@@ -14974,7 +15861,7 @@ function createComplianceNamespace(rb) {
|
|
|
14974
15861
|
create: async (attributes, options) => {
|
|
14975
15862
|
return rb.execute(
|
|
14976
15863
|
postLegalDocuments,
|
|
14977
|
-
{ body: { data: { type: "
|
|
15864
|
+
{ body: { data: { type: "legal-document", attributes } } },
|
|
14978
15865
|
options
|
|
14979
15866
|
);
|
|
14980
15867
|
},
|
|
@@ -15002,7 +15889,7 @@ function createComplianceNamespace(rb) {
|
|
|
15002
15889
|
patchLegalDocumentsById,
|
|
15003
15890
|
{
|
|
15004
15891
|
path: { id },
|
|
15005
|
-
body: { data: { type: "
|
|
15892
|
+
body: { data: { type: "legal-document", id, attributes } }
|
|
15006
15893
|
},
|
|
15007
15894
|
options
|
|
15008
15895
|
);
|
|
@@ -15103,7 +15990,7 @@ function createComplianceNamespace(rb) {
|
|
|
15103
15990
|
patchLegalDocumentsByIdPublish,
|
|
15104
15991
|
{
|
|
15105
15992
|
path: { id },
|
|
15106
|
-
body: { data: { type: "
|
|
15993
|
+
body: { data: { type: "legal-document", id, attributes: {} } }
|
|
15107
15994
|
},
|
|
15108
15995
|
options
|
|
15109
15996
|
);
|
|
@@ -15131,7 +16018,7 @@ function createComplianceNamespace(rb) {
|
|
|
15131
16018
|
patchLegalDocumentsByIdUnpublish,
|
|
15132
16019
|
{
|
|
15133
16020
|
path: { id },
|
|
15134
|
-
body: { data: { type: "
|
|
16021
|
+
body: { data: { type: "legal-document", id, attributes: {} } }
|
|
15135
16022
|
},
|
|
15136
16023
|
options
|
|
15137
16024
|
);
|
|
@@ -17238,7 +18125,7 @@ function createCommunicationNamespace(rb) {
|
|
|
17238
18125
|
create: async (attributes, options) => {
|
|
17239
18126
|
return rb.execute(
|
|
17240
18127
|
postNotificationMethods,
|
|
17241
|
-
{ body: { data: { type: "
|
|
18128
|
+
{ body: { data: { type: "notification-method", attributes } } },
|
|
17242
18129
|
options
|
|
17243
18130
|
);
|
|
17244
18131
|
},
|
|
@@ -17270,7 +18157,7 @@ function createCommunicationNamespace(rb) {
|
|
|
17270
18157
|
patchNotificationMethodsById,
|
|
17271
18158
|
{
|
|
17272
18159
|
path: { id },
|
|
17273
|
-
body: { data: { id, type: "
|
|
18160
|
+
body: { data: { id, type: "notification-method", attributes } }
|
|
17274
18161
|
},
|
|
17275
18162
|
options
|
|
17276
18163
|
);
|
|
@@ -17423,7 +18310,7 @@ function createCommunicationNamespace(rb) {
|
|
|
17423
18310
|
create: async (attributes, options) => {
|
|
17424
18311
|
return rb.execute(
|
|
17425
18312
|
postNotificationPreferences,
|
|
17426
|
-
{ body: { data: { type: "
|
|
18313
|
+
{ body: { data: { type: "notification-preference", attributes } } },
|
|
17427
18314
|
options
|
|
17428
18315
|
);
|
|
17429
18316
|
},
|
|
@@ -17457,7 +18344,7 @@ function createCommunicationNamespace(rb) {
|
|
|
17457
18344
|
{
|
|
17458
18345
|
path: { id },
|
|
17459
18346
|
body: {
|
|
17460
|
-
data: { id, type: "
|
|
18347
|
+
data: { id, type: "notification-preference", attributes }
|
|
17461
18348
|
}
|
|
17462
18349
|
},
|
|
17463
18350
|
options
|
|
@@ -17562,7 +18449,7 @@ function createConnectorsNamespace(rb) {
|
|
|
17562
18449
|
*/
|
|
17563
18450
|
create: async (attributes, options) => rb.execute(
|
|
17564
18451
|
postConnectors,
|
|
17565
|
-
{ body: { data: { type: "
|
|
18452
|
+
{ body: { data: { type: "connector-instance", attributes } } },
|
|
17566
18453
|
options
|
|
17567
18454
|
),
|
|
17568
18455
|
/**
|
|
@@ -17589,7 +18476,7 @@ function createConnectorsNamespace(rb) {
|
|
|
17589
18476
|
patchConnectorsById,
|
|
17590
18477
|
{
|
|
17591
18478
|
path: { id },
|
|
17592
|
-
body: { data: { type: "
|
|
18479
|
+
body: { data: { type: "connector-instance", id, attributes } }
|
|
17593
18480
|
},
|
|
17594
18481
|
options
|
|
17595
18482
|
),
|
|
@@ -17796,7 +18683,7 @@ function createConnectorsNamespace(rb) {
|
|
|
17796
18683
|
{
|
|
17797
18684
|
body: {
|
|
17798
18685
|
data: {
|
|
17799
|
-
type: "
|
|
18686
|
+
type: "connector-instance",
|
|
17800
18687
|
connector_type: connectorType,
|
|
17801
18688
|
workspace_id: workspaceId
|
|
17802
18689
|
}
|
|
@@ -17843,7 +18730,7 @@ function createConnectorsNamespace(rb) {
|
|
|
17843
18730
|
{
|
|
17844
18731
|
body: {
|
|
17845
18732
|
data: {
|
|
17846
|
-
type: "
|
|
18733
|
+
type: "connector-instance",
|
|
17847
18734
|
connector_type: connectorType,
|
|
17848
18735
|
code,
|
|
17849
18736
|
state,
|
|
@@ -17930,6 +18817,7 @@ function createConnectorsNamespace(rb) {
|
|
|
17930
18817
|
path: { id: connectorInstanceId },
|
|
17931
18818
|
body: {
|
|
17932
18819
|
data: {
|
|
18820
|
+
type: "connector-instance",
|
|
17933
18821
|
connector_id: connectorInstanceId,
|
|
17934
18822
|
workspace_id: params.workspace_id,
|
|
17935
18823
|
action_name: params.action_name,
|
|
@@ -18025,6 +18913,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18025
18913
|
path: { id: connectorInstanceId },
|
|
18026
18914
|
body: {
|
|
18027
18915
|
data: {
|
|
18916
|
+
type: "connector-instance",
|
|
18028
18917
|
connector_id: connectorInstanceId,
|
|
18029
18918
|
workspace_id: workspaceId,
|
|
18030
18919
|
query: params.query,
|
|
@@ -18069,6 +18958,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18069
18958
|
path: { id: connectorInstanceId },
|
|
18070
18959
|
body: {
|
|
18071
18960
|
data: {
|
|
18961
|
+
type: "connector-instance",
|
|
18072
18962
|
connector_id: connectorInstanceId,
|
|
18073
18963
|
workspace_id: workspaceId,
|
|
18074
18964
|
recipe_id: recipeId
|
|
@@ -18124,7 +19014,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18124
19014
|
{
|
|
18125
19015
|
body: {
|
|
18126
19016
|
data: {
|
|
18127
|
-
type: "
|
|
19017
|
+
type: "connector-instance",
|
|
18128
19018
|
connector_id: connectorId,
|
|
18129
19019
|
workspace_id: workspaceId,
|
|
18130
19020
|
email
|
|
@@ -18169,7 +19059,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18169
19059
|
{
|
|
18170
19060
|
body: {
|
|
18171
19061
|
data: {
|
|
18172
|
-
type: "
|
|
19062
|
+
type: "connector-instance",
|
|
18173
19063
|
connector_id: connectorId,
|
|
18174
19064
|
workspace_id: workspaceId,
|
|
18175
19065
|
...attrs
|
|
@@ -18209,7 +19099,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18209
19099
|
{
|
|
18210
19100
|
body: {
|
|
18211
19101
|
data: {
|
|
18212
|
-
type: "
|
|
19102
|
+
type: "connector-instance",
|
|
18213
19103
|
connector_id: connectorId,
|
|
18214
19104
|
workspace_id: workspaceId,
|
|
18215
19105
|
patient_id: patientId
|
|
@@ -18473,7 +19363,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18473
19363
|
{
|
|
18474
19364
|
body: {
|
|
18475
19365
|
data: {
|
|
18476
|
-
type: "
|
|
19366
|
+
type: "connector-instance",
|
|
18477
19367
|
connector_type: "fullscript",
|
|
18478
19368
|
workspace_id: workspaceId
|
|
18479
19369
|
}
|
|
@@ -18516,7 +19406,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18516
19406
|
{
|
|
18517
19407
|
body: {
|
|
18518
19408
|
data: {
|
|
18519
|
-
type: "
|
|
19409
|
+
type: "connector-instance",
|
|
18520
19410
|
connector_type: "fullscript",
|
|
18521
19411
|
code,
|
|
18522
19412
|
state,
|
|
@@ -18534,7 +19424,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18534
19424
|
/**
|
|
18535
19425
|
* Practice Better — clinical note push for linked PB contacts.
|
|
18536
19426
|
*
|
|
18537
|
-
* Requires an active `ConnectorInstance` with `connector_type: "
|
|
19427
|
+
* Requires an active `ConnectorInstance` with `connector_type: "practice-better"`
|
|
18538
19428
|
* and stored credentials. The contact must have an `integration_link` custom entity
|
|
18539
19429
|
* linking them to a PB client record.
|
|
18540
19430
|
*/
|
|
@@ -18567,6 +19457,7 @@ function createConnectorsNamespace(rb) {
|
|
|
18567
19457
|
path: { id: connectorInstanceId },
|
|
18568
19458
|
body: {
|
|
18569
19459
|
data: {
|
|
19460
|
+
type: "connector-instance",
|
|
18570
19461
|
connector_id: connectorInstanceId,
|
|
18571
19462
|
...params
|
|
18572
19463
|
}
|
|
@@ -18678,7 +19569,7 @@ function createCrawlerNamespace(rb) {
|
|
|
18678
19569
|
return rb.execute(
|
|
18679
19570
|
postCrawlerJobs,
|
|
18680
19571
|
{
|
|
18681
|
-
body: { data: { type: "
|
|
19572
|
+
body: { data: { type: "crawler-job", attributes } }
|
|
18682
19573
|
},
|
|
18683
19574
|
options
|
|
18684
19575
|
);
|
|
@@ -18820,7 +19711,7 @@ function createCrawlerNamespace(rb) {
|
|
|
18820
19711
|
return rb.execute(
|
|
18821
19712
|
postCrawlerSchedules,
|
|
18822
19713
|
{
|
|
18823
|
-
body: { data: { type: "
|
|
19714
|
+
body: { data: { type: "crawler-schedule", attributes } }
|
|
18824
19715
|
},
|
|
18825
19716
|
options
|
|
18826
19717
|
);
|
|
@@ -18859,7 +19750,7 @@ function createCrawlerNamespace(rb) {
|
|
|
18859
19750
|
patchCrawlerSchedulesById,
|
|
18860
19751
|
{
|
|
18861
19752
|
path: { id },
|
|
18862
|
-
body: { data: { id, type: "
|
|
19753
|
+
body: { data: { id, type: "crawler-schedule", attributes } }
|
|
18863
19754
|
},
|
|
18864
19755
|
options
|
|
18865
19756
|
);
|
|
@@ -19078,7 +19969,7 @@ function createCrmNamespace(rb) {
|
|
|
19078
19969
|
return rb.execute(
|
|
19079
19970
|
postCrmContacts,
|
|
19080
19971
|
{
|
|
19081
|
-
body: { data: { type: "
|
|
19972
|
+
body: { data: { type: "crm-contact", attributes } }
|
|
19082
19973
|
},
|
|
19083
19974
|
options
|
|
19084
19975
|
);
|
|
@@ -19109,7 +20000,7 @@ function createCrmNamespace(rb) {
|
|
|
19109
20000
|
patchCrmContactsById,
|
|
19110
20001
|
{
|
|
19111
20002
|
path: { id },
|
|
19112
|
-
body: { data: { id, type: "
|
|
20003
|
+
body: { data: { id, type: "crm-contact", attributes } }
|
|
19113
20004
|
},
|
|
19114
20005
|
options
|
|
19115
20006
|
);
|
|
@@ -19211,7 +20102,7 @@ function createCrmNamespace(rb) {
|
|
|
19211
20102
|
archive: async (id, options) => {
|
|
19212
20103
|
return rb.execute(
|
|
19213
20104
|
patchCrmContactsByIdArchive,
|
|
19214
|
-
{ path: { id }, body: { data: { type: "
|
|
20105
|
+
{ path: { id }, body: { data: { type: "crm-contact", id } } },
|
|
19215
20106
|
options
|
|
19216
20107
|
);
|
|
19217
20108
|
},
|
|
@@ -19332,7 +20223,7 @@ function createCrmNamespace(rb) {
|
|
|
19332
20223
|
return rb.execute(
|
|
19333
20224
|
postCrmCompanies,
|
|
19334
20225
|
{
|
|
19335
|
-
body: { data: { type: "
|
|
20226
|
+
body: { data: { type: "crm-company", attributes } }
|
|
19336
20227
|
},
|
|
19337
20228
|
options
|
|
19338
20229
|
);
|
|
@@ -19362,7 +20253,7 @@ function createCrmNamespace(rb) {
|
|
|
19362
20253
|
patchCrmCompaniesById,
|
|
19363
20254
|
{
|
|
19364
20255
|
path: { id },
|
|
19365
|
-
body: { data: { id, type: "
|
|
20256
|
+
body: { data: { id, type: "crm-company", attributes } }
|
|
19366
20257
|
},
|
|
19367
20258
|
options
|
|
19368
20259
|
);
|
|
@@ -19471,7 +20362,7 @@ function createCrmNamespace(rb) {
|
|
|
19471
20362
|
return rb.execute(
|
|
19472
20363
|
postCrmDeals,
|
|
19473
20364
|
{
|
|
19474
|
-
body: { data: { type: "
|
|
20365
|
+
body: { data: { type: "crm-deal", attributes } }
|
|
19475
20366
|
},
|
|
19476
20367
|
options
|
|
19477
20368
|
);
|
|
@@ -19503,7 +20394,7 @@ function createCrmNamespace(rb) {
|
|
|
19503
20394
|
patchCrmDealsById,
|
|
19504
20395
|
{
|
|
19505
20396
|
path: { id },
|
|
19506
|
-
body: { data: { id, type: "
|
|
20397
|
+
body: { data: { id, type: "crm-deal", attributes } }
|
|
19507
20398
|
},
|
|
19508
20399
|
options
|
|
19509
20400
|
);
|
|
@@ -19530,7 +20421,7 @@ function createCrmNamespace(rb) {
|
|
|
19530
20421
|
patchCrmDealsByIdMoveStage,
|
|
19531
20422
|
{
|
|
19532
20423
|
path: { id },
|
|
19533
|
-
body: { data: { type: "
|
|
20424
|
+
body: { data: { type: "crm-deal", id, attributes } }
|
|
19534
20425
|
},
|
|
19535
20426
|
options
|
|
19536
20427
|
);
|
|
@@ -19640,7 +20531,7 @@ function createCrmNamespace(rb) {
|
|
|
19640
20531
|
return rb.execute(
|
|
19641
20532
|
postCrmActivities,
|
|
19642
20533
|
{
|
|
19643
|
-
body: { data: { type: "
|
|
20534
|
+
body: { data: { type: "crm-activity", attributes } }
|
|
19644
20535
|
},
|
|
19645
20536
|
options
|
|
19646
20537
|
);
|
|
@@ -19667,7 +20558,7 @@ function createCrmNamespace(rb) {
|
|
|
19667
20558
|
patchCrmActivitiesById,
|
|
19668
20559
|
{
|
|
19669
20560
|
path: { id },
|
|
19670
|
-
body: { data: { id, type: "
|
|
20561
|
+
body: { data: { id, type: "crm-activity", attributes } }
|
|
19671
20562
|
},
|
|
19672
20563
|
options
|
|
19673
20564
|
);
|
|
@@ -19773,7 +20664,7 @@ function createCrmNamespace(rb) {
|
|
|
19773
20664
|
return rb.execute(
|
|
19774
20665
|
postCrmPipelines,
|
|
19775
20666
|
{
|
|
19776
|
-
body: { data: { type: "
|
|
20667
|
+
body: { data: { type: "crm-pipeline", attributes } }
|
|
19777
20668
|
},
|
|
19778
20669
|
options
|
|
19779
20670
|
);
|
|
@@ -19800,7 +20691,7 @@ function createCrmNamespace(rb) {
|
|
|
19800
20691
|
patchCrmPipelinesById,
|
|
19801
20692
|
{
|
|
19802
20693
|
path: { id },
|
|
19803
|
-
body: { data: { id, type: "
|
|
20694
|
+
body: { data: { id, type: "crm-pipeline", attributes } }
|
|
19804
20695
|
},
|
|
19805
20696
|
options
|
|
19806
20697
|
);
|
|
@@ -19905,7 +20796,7 @@ function createCrmNamespace(rb) {
|
|
|
19905
20796
|
return rb.execute(
|
|
19906
20797
|
postCrmPipelineStages,
|
|
19907
20798
|
{
|
|
19908
|
-
body: { data: { type: "
|
|
20799
|
+
body: { data: { type: "crm-pipeline-stage", attributes } }
|
|
19909
20800
|
},
|
|
19910
20801
|
options
|
|
19911
20802
|
);
|
|
@@ -19933,7 +20824,7 @@ function createCrmNamespace(rb) {
|
|
|
19933
20824
|
patchCrmPipelineStagesById,
|
|
19934
20825
|
{
|
|
19935
20826
|
path: { id },
|
|
19936
|
-
body: { data: { id, type: "
|
|
20827
|
+
body: { data: { id, type: "crm-pipeline-stage", attributes } }
|
|
19937
20828
|
},
|
|
19938
20829
|
options
|
|
19939
20830
|
);
|
|
@@ -20038,7 +20929,7 @@ function createCrmNamespace(rb) {
|
|
|
20038
20929
|
return rb.execute(
|
|
20039
20930
|
postCrmRelationshipTypes,
|
|
20040
20931
|
{
|
|
20041
|
-
body: { data: { type: "
|
|
20932
|
+
body: { data: { type: "crm-relationship-type", attributes } }
|
|
20042
20933
|
},
|
|
20043
20934
|
options
|
|
20044
20935
|
);
|
|
@@ -20065,7 +20956,7 @@ function createCrmNamespace(rb) {
|
|
|
20065
20956
|
patchCrmRelationshipTypesById,
|
|
20066
20957
|
{
|
|
20067
20958
|
path: { id },
|
|
20068
|
-
body: { data: { id, type: "
|
|
20959
|
+
body: { data: { id, type: "crm-relationship-type", attributes } }
|
|
20069
20960
|
},
|
|
20070
20961
|
options
|
|
20071
20962
|
);
|
|
@@ -20178,7 +21069,7 @@ function createCrmNamespace(rb) {
|
|
|
20178
21069
|
return rb.execute(
|
|
20179
21070
|
postCrmRelationships,
|
|
20180
21071
|
{
|
|
20181
|
-
body: { data: { type: "
|
|
21072
|
+
body: { data: { type: "crm-relationship", attributes } }
|
|
20182
21073
|
},
|
|
20183
21074
|
options
|
|
20184
21075
|
);
|
|
@@ -20292,7 +21183,7 @@ function createCrmNamespace(rb) {
|
|
|
20292
21183
|
return rb.execute(
|
|
20293
21184
|
postCrmCustomEntities,
|
|
20294
21185
|
{
|
|
20295
|
-
body: { data: { type: "
|
|
21186
|
+
body: { data: { type: "crm-custom-entity", attributes } }
|
|
20296
21187
|
},
|
|
20297
21188
|
options
|
|
20298
21189
|
);
|
|
@@ -20323,7 +21214,7 @@ function createCrmNamespace(rb) {
|
|
|
20323
21214
|
patchCrmCustomEntitiesById,
|
|
20324
21215
|
{
|
|
20325
21216
|
path: { id },
|
|
20326
|
-
body: { data: { id, type: "
|
|
21217
|
+
body: { data: { id, type: "crm-custom-entity", attributes } }
|
|
20327
21218
|
},
|
|
20328
21219
|
options
|
|
20329
21220
|
);
|
|
@@ -20618,7 +21509,7 @@ function createCrmNamespace(rb) {
|
|
|
20618
21509
|
{
|
|
20619
21510
|
body: {
|
|
20620
21511
|
data: {
|
|
20621
|
-
type: "
|
|
21512
|
+
type: "crm-data-export-job",
|
|
20622
21513
|
attributes: {
|
|
20623
21514
|
workspace_id: workspaceId,
|
|
20624
21515
|
entity_type: params.entityType,
|
|
@@ -20780,7 +21671,7 @@ function createCampaignsNamespace(rb) {
|
|
|
20780
21671
|
return rb.execute(
|
|
20781
21672
|
postEmailMarketingCampaigns,
|
|
20782
21673
|
{
|
|
20783
|
-
body: { data: { type: "
|
|
21674
|
+
body: { data: { type: "campaign", attributes } }
|
|
20784
21675
|
},
|
|
20785
21676
|
options
|
|
20786
21677
|
);
|
|
@@ -20812,7 +21703,7 @@ function createCampaignsNamespace(rb) {
|
|
|
20812
21703
|
{
|
|
20813
21704
|
path: { id },
|
|
20814
21705
|
body: {
|
|
20815
|
-
data: { id, type: "
|
|
21706
|
+
data: { id, type: "campaign", attributes }
|
|
20816
21707
|
}
|
|
20817
21708
|
},
|
|
20818
21709
|
options
|
|
@@ -20987,7 +21878,124 @@ function createCampaignsNamespace(rb) {
|
|
|
20987
21878
|
postEmailMarketingCampaignsByIdCreateFollowup,
|
|
20988
21879
|
{
|
|
20989
21880
|
path: { id },
|
|
20990
|
-
body: { data: { type: "
|
|
21881
|
+
body: { data: { type: "campaign", ...attributes } }
|
|
21882
|
+
},
|
|
21883
|
+
options
|
|
21884
|
+
);
|
|
21885
|
+
},
|
|
21886
|
+
/**
|
|
21887
|
+
* Import recipients from a CSV file stored in platform storage.
|
|
21888
|
+
*
|
|
21889
|
+
* @param id - The campaign ID to import recipients into.
|
|
21890
|
+
* @param attributes - Import configuration including `csv_storage_key`,
|
|
21891
|
+
* optional `column_mapping`, and `workspace_id`.
|
|
21892
|
+
* @param options - Optional request-level overrides.
|
|
21893
|
+
* @returns A promise resolving to the import job details.
|
|
21894
|
+
*
|
|
21895
|
+
* @example
|
|
21896
|
+
* ```typescript
|
|
21897
|
+
* const result = await client.campaigns.campaigns.importRecipients('camp_abc', {
|
|
21898
|
+
* csv_storage_key: 'uploads/recipients.csv',
|
|
21899
|
+
* workspace_id: 'ws_abc123',
|
|
21900
|
+
* });
|
|
21901
|
+
* console.log(result.job_id);
|
|
21902
|
+
* ```
|
|
21903
|
+
*/
|
|
21904
|
+
importRecipients: async (id, attributes, options) => {
|
|
21905
|
+
return rb.execute(
|
|
21906
|
+
postEmailMarketingCampaignsByIdImportRecipients,
|
|
21907
|
+
{
|
|
21908
|
+
path: { id },
|
|
21909
|
+
body: { data: { type: "campaign", attributes } }
|
|
21910
|
+
},
|
|
21911
|
+
options
|
|
21912
|
+
);
|
|
21913
|
+
},
|
|
21914
|
+
/**
|
|
21915
|
+
* Trigger AI-powered email generation for all campaign recipients.
|
|
21916
|
+
*
|
|
21917
|
+
* @param id - The campaign ID to generate emails for.
|
|
21918
|
+
* @param workspaceId - The workspace ID.
|
|
21919
|
+
* @param options - Optional request-level overrides.
|
|
21920
|
+
* @returns A promise resolving to the generation job details.
|
|
21921
|
+
*
|
|
21922
|
+
* @example
|
|
21923
|
+
* ```typescript
|
|
21924
|
+
* const result = await client.campaigns.campaigns.generateEmails('camp_abc', 'ws_abc123');
|
|
21925
|
+
* console.log(result.job_id);
|
|
21926
|
+
* ```
|
|
21927
|
+
*/
|
|
21928
|
+
generateEmails: async (id, workspaceId, options) => {
|
|
21929
|
+
return rb.execute(
|
|
21930
|
+
postEmailMarketingCampaignsByIdGenerateEmails,
|
|
21931
|
+
{
|
|
21932
|
+
path: { id },
|
|
21933
|
+
body: {
|
|
21934
|
+
data: {
|
|
21935
|
+
type: "campaign",
|
|
21936
|
+
attributes: { workspace_id: workspaceId }
|
|
21937
|
+
}
|
|
21938
|
+
}
|
|
21939
|
+
},
|
|
21940
|
+
options
|
|
21941
|
+
);
|
|
21942
|
+
},
|
|
21943
|
+
/**
|
|
21944
|
+
* Generate A/B test subject line variants using AI.
|
|
21945
|
+
*
|
|
21946
|
+
* @param id - The campaign ID to optimize subjects for.
|
|
21947
|
+
* @param attributes - Subject optimization parameters including
|
|
21948
|
+
* `original_subject`, `campaign_description`, and `audience_description`.
|
|
21949
|
+
* @param options - Optional request-level overrides.
|
|
21950
|
+
* @returns A promise resolving to the optimization result with variant suggestions.
|
|
21951
|
+
*
|
|
21952
|
+
* @example
|
|
21953
|
+
* ```typescript
|
|
21954
|
+
* const result = await client.campaigns.campaigns.optimizeSubjects('camp_abc', {
|
|
21955
|
+
* original_subject: 'Spring Sale!',
|
|
21956
|
+
* campaign_description: 'Seasonal discount promotion',
|
|
21957
|
+
* audience_description: 'Existing customers aged 25-45',
|
|
21958
|
+
* });
|
|
21959
|
+
* ```
|
|
21960
|
+
*/
|
|
21961
|
+
optimizeSubjects: async (id, attributes, options) => {
|
|
21962
|
+
return rb.execute(
|
|
21963
|
+
postEmailMarketingCampaignsByIdOptimizeSubjects,
|
|
21964
|
+
{
|
|
21965
|
+
path: { id },
|
|
21966
|
+
body: {
|
|
21967
|
+
data: { type: "campaign", attributes }
|
|
21968
|
+
}
|
|
21969
|
+
},
|
|
21970
|
+
options
|
|
21971
|
+
);
|
|
21972
|
+
},
|
|
21973
|
+
/**
|
|
21974
|
+
* Export campaign data (recipients, results, or analytics) as CSV.
|
|
21975
|
+
*
|
|
21976
|
+
* @param id - The campaign ID to export.
|
|
21977
|
+
* @param attributes - Export configuration including `workspace_id`,
|
|
21978
|
+
* optional `format` and `export_type`.
|
|
21979
|
+
* @param options - Optional request-level overrides.
|
|
21980
|
+
* @returns A promise resolving to the export job details.
|
|
21981
|
+
*
|
|
21982
|
+
* @example
|
|
21983
|
+
* ```typescript
|
|
21984
|
+
* const result = await client.campaigns.campaigns.export('camp_abc', {
|
|
21985
|
+
* workspace_id: 'ws_abc123',
|
|
21986
|
+
* export_type: 'recipients',
|
|
21987
|
+
* });
|
|
21988
|
+
* console.log(result.job_id);
|
|
21989
|
+
* ```
|
|
21990
|
+
*/
|
|
21991
|
+
export: async (id, attributes, options) => {
|
|
21992
|
+
return rb.execute(
|
|
21993
|
+
postEmailMarketingCampaignsByIdExport,
|
|
21994
|
+
{
|
|
21995
|
+
path: { id },
|
|
21996
|
+
body: {
|
|
21997
|
+
data: { type: "campaign", attributes }
|
|
21998
|
+
}
|
|
20991
21999
|
},
|
|
20992
22000
|
options
|
|
20993
22001
|
);
|
|
@@ -21258,7 +22266,7 @@ function createCampaignsNamespace(rb) {
|
|
|
21258
22266
|
{
|
|
21259
22267
|
path: { id },
|
|
21260
22268
|
body: {
|
|
21261
|
-
data: { id, type: "
|
|
22269
|
+
data: { id, type: "email-marketing-generated-email", attributes }
|
|
21262
22270
|
}
|
|
21263
22271
|
},
|
|
21264
22272
|
options
|
|
@@ -21290,6 +22298,68 @@ function createCampaignsNamespace(rb) {
|
|
|
21290
22298
|
{ path: { id }, body: {} },
|
|
21291
22299
|
options
|
|
21292
22300
|
);
|
|
22301
|
+
},
|
|
22302
|
+
/**
|
|
22303
|
+
* Reject an AI-generated email draft. The email will not be sent.
|
|
22304
|
+
*
|
|
22305
|
+
* @param id - The unique identifier of the generated email to reject.
|
|
22306
|
+
* @param options - Optional request-level overrides.
|
|
22307
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
|
|
22308
|
+
*
|
|
22309
|
+
* @example
|
|
22310
|
+
* ```typescript
|
|
22311
|
+
* const rejected = await client.campaigns.generatedEmails.reject('gen_abc123');
|
|
22312
|
+
* console.log(rejected.attributes.status); // 'rejected'
|
|
22313
|
+
* ```
|
|
22314
|
+
*/
|
|
22315
|
+
reject: async (id, options) => {
|
|
22316
|
+
return rb.execute(
|
|
22317
|
+
patchEmailMarketingGeneratedEmailsByIdReject,
|
|
22318
|
+
{ path: { id }, body: {} },
|
|
22319
|
+
options
|
|
22320
|
+
);
|
|
22321
|
+
},
|
|
22322
|
+
/**
|
|
22323
|
+
* Schedule a generated email for delivery at a specific time.
|
|
22324
|
+
*
|
|
22325
|
+
* @param id - The unique identifier of the generated email to schedule.
|
|
22326
|
+
* @param options - Optional request-level overrides.
|
|
22327
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingGeneratedEmail}.
|
|
22328
|
+
*
|
|
22329
|
+
* @example
|
|
22330
|
+
* ```typescript
|
|
22331
|
+
* const scheduled = await client.campaigns.generatedEmails.schedule('gen_abc123');
|
|
22332
|
+
* ```
|
|
22333
|
+
*/
|
|
22334
|
+
schedule: async (id, options) => {
|
|
22335
|
+
return rb.execute(
|
|
22336
|
+
patchEmailMarketingGeneratedEmailsByIdSchedule,
|
|
22337
|
+
{ path: { id }, body: {} },
|
|
22338
|
+
options
|
|
22339
|
+
);
|
|
22340
|
+
},
|
|
22341
|
+
/**
|
|
22342
|
+
* List all generated emails for a specific campaign.
|
|
22343
|
+
*
|
|
22344
|
+
* @param campaignId - The ID of the campaign whose generated emails to list.
|
|
22345
|
+
* @param options - Optional pagination controls and request-level overrides.
|
|
22346
|
+
* @returns A promise resolving to an array of {@link EmailMarketingGeneratedEmail}.
|
|
22347
|
+
*
|
|
22348
|
+
* @example
|
|
22349
|
+
* ```typescript
|
|
22350
|
+
* const emails = await client.campaigns.generatedEmails.listByCampaign('camp_abc');
|
|
22351
|
+
* console.log(`${emails.length} emails generated`);
|
|
22352
|
+
* ```
|
|
22353
|
+
*/
|
|
22354
|
+
listByCampaign: async (campaignId, options) => {
|
|
22355
|
+
return rb.execute(
|
|
22356
|
+
getEmailMarketingGeneratedEmailsCampaignByCampaignId,
|
|
22357
|
+
{
|
|
22358
|
+
path: { campaign_id: campaignId },
|
|
22359
|
+
...buildPageQuery(options?.page, options?.pageSize)
|
|
22360
|
+
},
|
|
22361
|
+
options
|
|
22362
|
+
);
|
|
21293
22363
|
}
|
|
21294
22364
|
},
|
|
21295
22365
|
/**
|
|
@@ -21351,7 +22421,7 @@ function createCampaignsNamespace(rb) {
|
|
|
21351
22421
|
{
|
|
21352
22422
|
path: { id },
|
|
21353
22423
|
body: {
|
|
21354
|
-
data: { id, type: "
|
|
22424
|
+
data: { id, type: "email-marketing-sender-profile", attributes }
|
|
21355
22425
|
}
|
|
21356
22426
|
},
|
|
21357
22427
|
options
|
|
@@ -21421,43 +22491,153 @@ function createCampaignsNamespace(rb) {
|
|
|
21421
22491
|
*/
|
|
21422
22492
|
sequences: {
|
|
21423
22493
|
/**
|
|
21424
|
-
*
|
|
22494
|
+
* Fetch a single sequence by its unique ID.
|
|
21425
22495
|
*
|
|
21426
|
-
*
|
|
21427
|
-
*
|
|
21428
|
-
*
|
|
22496
|
+
* @param id - The unique identifier of the sequence to retrieve.
|
|
22497
|
+
* @param options - Optional request-level overrides.
|
|
22498
|
+
* @returns A promise that resolves to the matching {@link EmailMarketingSequence}.
|
|
22499
|
+
*
|
|
22500
|
+
* @example
|
|
22501
|
+
* ```typescript
|
|
22502
|
+
* const sequence = await client.campaigns.sequences.get('seq_abc123');
|
|
22503
|
+
* console.log(sequence.attributes.name, sequence.attributes.status);
|
|
22504
|
+
* ```
|
|
22505
|
+
*/
|
|
22506
|
+
get: async (id, options) => {
|
|
22507
|
+
return rb.execute(
|
|
22508
|
+
getCampaignsSequencesById,
|
|
22509
|
+
{ path: { id } },
|
|
22510
|
+
options
|
|
22511
|
+
);
|
|
22512
|
+
},
|
|
22513
|
+
/**
|
|
22514
|
+
* Create a new email sequence.
|
|
21429
22515
|
*
|
|
21430
22516
|
* @param attributes - Key/value map of sequence attributes. Must include
|
|
21431
|
-
* `workspace_id` and `name`.
|
|
21432
|
-
* timed email in the drip.
|
|
22517
|
+
* `workspace_id` and `name`.
|
|
21433
22518
|
* @param options - Optional request-level overrides.
|
|
21434
22519
|
* @returns A promise that resolves to the newly created sequence resource.
|
|
21435
22520
|
*
|
|
21436
22521
|
* @example
|
|
21437
22522
|
* ```typescript
|
|
21438
|
-
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
21439
|
-
*
|
|
21440
22523
|
* const sequence = await client.campaigns.sequences.create({
|
|
21441
22524
|
* workspace_id: 'ws_abc123',
|
|
21442
22525
|
* 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
22526
|
* });
|
|
21449
|
-
* console.log(sequence);
|
|
21450
22527
|
* ```
|
|
21451
22528
|
*/
|
|
21452
22529
|
create: async (attributes, options) => {
|
|
21453
22530
|
return rb.execute(
|
|
21454
22531
|
postCampaignsSequences,
|
|
21455
22532
|
{
|
|
21456
|
-
body: { data: { type: "
|
|
22533
|
+
body: { data: { type: "email-marketing-sequence", attributes } }
|
|
21457
22534
|
},
|
|
21458
22535
|
options
|
|
21459
22536
|
);
|
|
21460
22537
|
},
|
|
22538
|
+
/**
|
|
22539
|
+
* Update an existing sequence's attributes (PATCH semantics).
|
|
22540
|
+
*
|
|
22541
|
+
* @param id - The unique identifier of the sequence to update.
|
|
22542
|
+
* @param attributes - Key/value map of attributes to change.
|
|
22543
|
+
* @param options - Optional request-level overrides.
|
|
22544
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
|
|
22545
|
+
*
|
|
22546
|
+
* @example
|
|
22547
|
+
* ```typescript
|
|
22548
|
+
* const updated = await client.campaigns.sequences.update('seq_abc', { name: 'Revised Drip' });
|
|
22549
|
+
* ```
|
|
22550
|
+
*/
|
|
22551
|
+
update: async (id, attributes, options) => {
|
|
22552
|
+
return rb.execute(
|
|
22553
|
+
patchCampaignsSequencesById,
|
|
22554
|
+
{
|
|
22555
|
+
path: { id },
|
|
22556
|
+
body: {
|
|
22557
|
+
data: { id, type: "email-marketing-sequence", attributes }
|
|
22558
|
+
}
|
|
22559
|
+
},
|
|
22560
|
+
options
|
|
22561
|
+
);
|
|
22562
|
+
},
|
|
22563
|
+
/**
|
|
22564
|
+
* Permanently delete a sequence.
|
|
22565
|
+
*
|
|
22566
|
+
* @param id - The unique identifier of the sequence to delete.
|
|
22567
|
+
* @param options - Optional request-level overrides.
|
|
22568
|
+
* @returns A promise that resolves to `true` on successful deletion.
|
|
22569
|
+
*
|
|
22570
|
+
* @example
|
|
22571
|
+
* ```typescript
|
|
22572
|
+
* await client.campaigns.sequences.delete('seq_abc123');
|
|
22573
|
+
* ```
|
|
22574
|
+
*/
|
|
22575
|
+
delete: async (id, options) => {
|
|
22576
|
+
return rb.executeDelete(
|
|
22577
|
+
deleteCampaignsSequencesById,
|
|
22578
|
+
{ path: { id } },
|
|
22579
|
+
options
|
|
22580
|
+
);
|
|
22581
|
+
},
|
|
22582
|
+
/**
|
|
22583
|
+
* Activate a sequence to start delivering emails to enrolled contacts.
|
|
22584
|
+
*
|
|
22585
|
+
* @param id - The unique identifier of the sequence to activate.
|
|
22586
|
+
* @param options - Optional request-level overrides.
|
|
22587
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
|
|
22588
|
+
*
|
|
22589
|
+
* @example
|
|
22590
|
+
* ```typescript
|
|
22591
|
+
* const active = await client.campaigns.sequences.activate('seq_abc123');
|
|
22592
|
+
* console.log(active.attributes.status); // 'active'
|
|
22593
|
+
* ```
|
|
22594
|
+
*/
|
|
22595
|
+
activate: async (id, options) => {
|
|
22596
|
+
return rb.execute(
|
|
22597
|
+
patchCampaignsSequencesByIdActivate,
|
|
22598
|
+
{ path: { id }, body: {} },
|
|
22599
|
+
options
|
|
22600
|
+
);
|
|
22601
|
+
},
|
|
22602
|
+
/**
|
|
22603
|
+
* Pause a running sequence, suspending all pending deliveries.
|
|
22604
|
+
*
|
|
22605
|
+
* @param id - The unique identifier of the sequence to pause.
|
|
22606
|
+
* @param options - Optional request-level overrides.
|
|
22607
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
|
|
22608
|
+
*
|
|
22609
|
+
* @example
|
|
22610
|
+
* ```typescript
|
|
22611
|
+
* const paused = await client.campaigns.sequences.pause('seq_abc123');
|
|
22612
|
+
* console.log(paused.attributes.status); // 'paused'
|
|
22613
|
+
* ```
|
|
22614
|
+
*/
|
|
22615
|
+
pause: async (id, options) => {
|
|
22616
|
+
return rb.execute(
|
|
22617
|
+
patchCampaignsSequencesByIdPause,
|
|
22618
|
+
{ path: { id }, body: {} },
|
|
22619
|
+
options
|
|
22620
|
+
);
|
|
22621
|
+
},
|
|
22622
|
+
/**
|
|
22623
|
+
* Mark a sequence as complete, finalizing all deliveries.
|
|
22624
|
+
*
|
|
22625
|
+
* @param id - The unique identifier of the sequence to complete.
|
|
22626
|
+
* @param options - Optional request-level overrides.
|
|
22627
|
+
* @returns A promise that resolves to the updated {@link EmailMarketingSequence}.
|
|
22628
|
+
*
|
|
22629
|
+
* @example
|
|
22630
|
+
* ```typescript
|
|
22631
|
+
* const completed = await client.campaigns.sequences.complete('seq_abc123');
|
|
22632
|
+
* ```
|
|
22633
|
+
*/
|
|
22634
|
+
complete: async (id, options) => {
|
|
22635
|
+
return rb.execute(
|
|
22636
|
+
patchCampaignsSequencesByIdComplete,
|
|
22637
|
+
{ path: { id }, body: {} },
|
|
22638
|
+
options
|
|
22639
|
+
);
|
|
22640
|
+
},
|
|
21461
22641
|
/**
|
|
21462
22642
|
* List all sequences for a workspace with optional pagination.
|
|
21463
22643
|
*
|
|
@@ -21511,6 +22691,137 @@ function createCampaignsNamespace(rb) {
|
|
|
21511
22691
|
options
|
|
21512
22692
|
);
|
|
21513
22693
|
}
|
|
22694
|
+
},
|
|
22695
|
+
/**
|
|
22696
|
+
* Recipients — campaign audience members.
|
|
22697
|
+
*
|
|
22698
|
+
* Each recipient represents one email address on a campaign's send list,
|
|
22699
|
+
* with optional merge fields for personalisation. Recipients are typically
|
|
22700
|
+
* imported via CSV.
|
|
22701
|
+
*/
|
|
22702
|
+
recipients: {
|
|
22703
|
+
/**
|
|
22704
|
+
* Fetch a single recipient by its unique ID.
|
|
22705
|
+
*
|
|
22706
|
+
* @param id - The unique identifier of the recipient.
|
|
22707
|
+
* @param options - Optional request-level overrides.
|
|
22708
|
+
* @returns A promise resolving to the recipient record.
|
|
22709
|
+
*
|
|
22710
|
+
* @example
|
|
22711
|
+
* ```typescript
|
|
22712
|
+
* const recipient = await client.campaigns.recipients.get('recip_abc123');
|
|
22713
|
+
* console.log(recipient.attributes.email);
|
|
22714
|
+
* ```
|
|
22715
|
+
*/
|
|
22716
|
+
get: async (id, options) => {
|
|
22717
|
+
return rb.execute(
|
|
22718
|
+
getCampaignsRecipientsById,
|
|
22719
|
+
{ path: { id } },
|
|
22720
|
+
options
|
|
22721
|
+
);
|
|
22722
|
+
},
|
|
22723
|
+
/**
|
|
22724
|
+
* List all recipients for a specific campaign.
|
|
22725
|
+
*
|
|
22726
|
+
* @param campaignId - The ID of the campaign whose recipients to list.
|
|
22727
|
+
* @param options - Optional pagination controls and request-level overrides.
|
|
22728
|
+
* @returns A promise resolving to an array of recipient records.
|
|
22729
|
+
*
|
|
22730
|
+
* @example
|
|
22731
|
+
* ```typescript
|
|
22732
|
+
* const recipients = await client.campaigns.recipients.listByCampaign('camp_abc');
|
|
22733
|
+
* console.log(`${recipients.length} recipients`);
|
|
22734
|
+
* ```
|
|
22735
|
+
*/
|
|
22736
|
+
listByCampaign: async (campaignId, options) => {
|
|
22737
|
+
return rb.execute(
|
|
22738
|
+
getCampaignsRecipientsCampaignByCampaignId,
|
|
22739
|
+
{
|
|
22740
|
+
path: { campaign_id: campaignId },
|
|
22741
|
+
...buildPageQuery(options?.page, options?.pageSize)
|
|
22742
|
+
},
|
|
22743
|
+
options
|
|
22744
|
+
);
|
|
22745
|
+
}
|
|
22746
|
+
},
|
|
22747
|
+
/**
|
|
22748
|
+
* Sequence Steps — individual steps within a drip sequence.
|
|
22749
|
+
*
|
|
22750
|
+
* Each step defines a timed email delivery within a sequence, with a
|
|
22751
|
+
* delay offset and template or inline content.
|
|
22752
|
+
*/
|
|
22753
|
+
sequenceSteps: {
|
|
22754
|
+
/**
|
|
22755
|
+
* Fetch a single sequence step by its unique ID.
|
|
22756
|
+
*
|
|
22757
|
+
* @param id - The unique identifier of the sequence step.
|
|
22758
|
+
* @param options - Optional request-level overrides.
|
|
22759
|
+
* @returns A promise resolving to the sequence step record.
|
|
22760
|
+
*
|
|
22761
|
+
* @example
|
|
22762
|
+
* ```typescript
|
|
22763
|
+
* const step = await client.campaigns.sequenceSteps.get('step_abc123');
|
|
22764
|
+
* ```
|
|
22765
|
+
*/
|
|
22766
|
+
get: async (id, options) => {
|
|
22767
|
+
return rb.execute(
|
|
22768
|
+
getCampaignsSequenceStepsById,
|
|
22769
|
+
{ path: { id } },
|
|
22770
|
+
options
|
|
22771
|
+
);
|
|
22772
|
+
},
|
|
22773
|
+
/**
|
|
22774
|
+
* Create a new step within a sequence.
|
|
22775
|
+
*
|
|
22776
|
+
* @param attributes - Step attributes including `sequence_id`.
|
|
22777
|
+
* @param options - Optional request-level overrides.
|
|
22778
|
+
* @returns A promise resolving to the newly created sequence step.
|
|
22779
|
+
*
|
|
22780
|
+
* @example
|
|
22781
|
+
* ```typescript
|
|
22782
|
+
* const step = await client.campaigns.sequenceSteps.create({
|
|
22783
|
+
* sequence_id: 'seq_abc123',
|
|
22784
|
+
* delay_days: 3,
|
|
22785
|
+
* template_id: 'tmpl_reminder',
|
|
22786
|
+
* });
|
|
22787
|
+
* ```
|
|
22788
|
+
*/
|
|
22789
|
+
create: async (attributes, options) => {
|
|
22790
|
+
return rb.execute(
|
|
22791
|
+
postCampaignsSequenceSteps,
|
|
22792
|
+
{
|
|
22793
|
+
body: {
|
|
22794
|
+
data: {
|
|
22795
|
+
type: "email-marketing-sequence-step",
|
|
22796
|
+
attributes
|
|
22797
|
+
}
|
|
22798
|
+
}
|
|
22799
|
+
},
|
|
22800
|
+
options
|
|
22801
|
+
);
|
|
22802
|
+
},
|
|
22803
|
+
/**
|
|
22804
|
+
* List all steps in a specific sequence.
|
|
22805
|
+
*
|
|
22806
|
+
* @param sequenceId - The ID of the sequence whose steps to list.
|
|
22807
|
+
* @param options - Optional pagination controls and request-level overrides.
|
|
22808
|
+
* @returns A promise resolving to an array of sequence step records.
|
|
22809
|
+
*
|
|
22810
|
+
* @example
|
|
22811
|
+
* ```typescript
|
|
22812
|
+
* const steps = await client.campaigns.sequenceSteps.listBySequence('seq_abc123');
|
|
22813
|
+
* ```
|
|
22814
|
+
*/
|
|
22815
|
+
listBySequence: async (sequenceId, options) => {
|
|
22816
|
+
return rb.execute(
|
|
22817
|
+
getCampaignsSequenceStepsSequenceBySequenceId,
|
|
22818
|
+
{
|
|
22819
|
+
path: { sequence_id: sequenceId },
|
|
22820
|
+
...buildPageQuery(options?.page, options?.pageSize)
|
|
22821
|
+
},
|
|
22822
|
+
options
|
|
22823
|
+
);
|
|
22824
|
+
}
|
|
21514
22825
|
}
|
|
21515
22826
|
};
|
|
21516
22827
|
}
|
|
@@ -21558,7 +22869,7 @@ function createEmailNamespace(rb) {
|
|
|
21558
22869
|
create: async (attributes, options) => {
|
|
21559
22870
|
return rb.execute(
|
|
21560
22871
|
postEmailOutboundEmails,
|
|
21561
|
-
{ body: { data: { type: "
|
|
22872
|
+
{ body: { data: { type: "email-outbound-email", attributes } } },
|
|
21562
22873
|
options
|
|
21563
22874
|
);
|
|
21564
22875
|
},
|
|
@@ -21589,7 +22900,7 @@ function createEmailNamespace(rb) {
|
|
|
21589
22900
|
composeWithAi: async (attributes, options) => {
|
|
21590
22901
|
return rb.execute(
|
|
21591
22902
|
postEmailOutboundEmailsComposeWithAi,
|
|
21592
|
-
{ body: { data: { type: "
|
|
22903
|
+
{ body: { data: { type: "email-outbound-email", attributes } } },
|
|
21593
22904
|
options
|
|
21594
22905
|
);
|
|
21595
22906
|
},
|
|
@@ -21619,7 +22930,7 @@ function createEmailNamespace(rb) {
|
|
|
21619
22930
|
patchEmailOutboundEmailsById,
|
|
21620
22931
|
{
|
|
21621
22932
|
path: { id },
|
|
21622
|
-
body: { data: { id, type: "
|
|
22933
|
+
body: { data: { id, type: "email-outbound-email", attributes } }
|
|
21623
22934
|
},
|
|
21624
22935
|
options
|
|
21625
22936
|
);
|
|
@@ -21674,7 +22985,7 @@ function createEmailNamespace(rb) {
|
|
|
21674
22985
|
patchEmailOutboundEmailsByIdSchedule,
|
|
21675
22986
|
{
|
|
21676
22987
|
path: { id },
|
|
21677
|
-
body: { data: { id, type: "
|
|
22988
|
+
body: { data: { id, type: "email-outbound-email", attributes } }
|
|
21678
22989
|
},
|
|
21679
22990
|
options
|
|
21680
22991
|
);
|
|
@@ -21751,7 +23062,11 @@ function createEmailNamespace(rb) {
|
|
|
21751
23062
|
create: async (attributes, options) => {
|
|
21752
23063
|
return rb.execute(
|
|
21753
23064
|
postEmailMarketingSenderProfiles,
|
|
21754
|
-
{
|
|
23065
|
+
{
|
|
23066
|
+
body: {
|
|
23067
|
+
data: { type: "email-marketing-sender-profile", attributes }
|
|
23068
|
+
}
|
|
23069
|
+
},
|
|
21755
23070
|
options
|
|
21756
23071
|
);
|
|
21757
23072
|
},
|
|
@@ -21782,7 +23097,9 @@ function createEmailNamespace(rb) {
|
|
|
21782
23097
|
patchEmailMarketingSenderProfilesById,
|
|
21783
23098
|
{
|
|
21784
23099
|
path: { id },
|
|
21785
|
-
body: {
|
|
23100
|
+
body: {
|
|
23101
|
+
data: { id, type: "email-marketing-sender-profile", attributes }
|
|
23102
|
+
}
|
|
21786
23103
|
},
|
|
21787
23104
|
options
|
|
21788
23105
|
);
|
|
@@ -21875,7 +23192,7 @@ function createEmailNamespace(rb) {
|
|
|
21875
23192
|
create: async (attributes, options) => {
|
|
21876
23193
|
return rb.execute(
|
|
21877
23194
|
postEmailRecipients,
|
|
21878
|
-
{ body: { data: { type: "
|
|
23195
|
+
{ body: { data: { type: "email-recipient", attributes } } },
|
|
21879
23196
|
options
|
|
21880
23197
|
);
|
|
21881
23198
|
},
|
|
@@ -21912,7 +23229,7 @@ function createEmailNamespace(rb) {
|
|
|
21912
23229
|
create: async (attributes, options) => {
|
|
21913
23230
|
return rb.execute(
|
|
21914
23231
|
postEmailInclusions,
|
|
21915
|
-
{ body: { data: { type: "
|
|
23232
|
+
{ body: { data: { type: "email-inclusion", attributes } } },
|
|
21916
23233
|
options
|
|
21917
23234
|
);
|
|
21918
23235
|
},
|
|
@@ -21922,7 +23239,7 @@ function createEmailNamespace(rb) {
|
|
|
21922
23239
|
patchEmailInclusionsById,
|
|
21923
23240
|
{
|
|
21924
23241
|
path: { id },
|
|
21925
|
-
body: { data: { id, type: "
|
|
23242
|
+
body: { data: { id, type: "email-inclusion", attributes } }
|
|
21926
23243
|
},
|
|
21927
23244
|
options
|
|
21928
23245
|
);
|
|
@@ -22273,7 +23590,7 @@ function createSupportNamespace(rb) {
|
|
|
22273
23590
|
postSupportTickets,
|
|
22274
23591
|
{
|
|
22275
23592
|
body: {
|
|
22276
|
-
data: { type: "
|
|
23593
|
+
data: { type: "support-ticket", attributes }
|
|
22277
23594
|
}
|
|
22278
23595
|
},
|
|
22279
23596
|
options
|
|
@@ -22309,7 +23626,7 @@ function createSupportNamespace(rb) {
|
|
|
22309
23626
|
{
|
|
22310
23627
|
path: { id },
|
|
22311
23628
|
body: {
|
|
22312
|
-
data: { type: "
|
|
23629
|
+
data: { type: "support-ticket", id, attributes }
|
|
22313
23630
|
}
|
|
22314
23631
|
},
|
|
22315
23632
|
options
|
|
@@ -22358,7 +23675,7 @@ function createSupportNamespace(rb) {
|
|
|
22358
23675
|
{
|
|
22359
23676
|
path: { id },
|
|
22360
23677
|
body: {
|
|
22361
|
-
data: { type: "
|
|
23678
|
+
data: { type: "support-ticket", id, attributes }
|
|
22362
23679
|
}
|
|
22363
23680
|
},
|
|
22364
23681
|
options
|
|
@@ -22386,7 +23703,7 @@ function createSupportNamespace(rb) {
|
|
|
22386
23703
|
{
|
|
22387
23704
|
path: { id },
|
|
22388
23705
|
body: {
|
|
22389
|
-
data: { type: "
|
|
23706
|
+
data: { type: "support-ticket", id, attributes }
|
|
22390
23707
|
}
|
|
22391
23708
|
},
|
|
22392
23709
|
options
|
|
@@ -22411,7 +23728,7 @@ function createSupportNamespace(rb) {
|
|
|
22411
23728
|
{
|
|
22412
23729
|
path: { id },
|
|
22413
23730
|
body: {
|
|
22414
|
-
data: { type: "
|
|
23731
|
+
data: { type: "support-ticket", id, attributes }
|
|
22415
23732
|
}
|
|
22416
23733
|
},
|
|
22417
23734
|
options
|
|
@@ -22436,7 +23753,7 @@ function createSupportNamespace(rb) {
|
|
|
22436
23753
|
{
|
|
22437
23754
|
path: { id },
|
|
22438
23755
|
body: {
|
|
22439
|
-
data: { type: "
|
|
23756
|
+
data: { type: "support-ticket", id, attributes }
|
|
22440
23757
|
}
|
|
22441
23758
|
},
|
|
22442
23759
|
options
|
|
@@ -22466,7 +23783,7 @@ function createSupportNamespace(rb) {
|
|
|
22466
23783
|
{
|
|
22467
23784
|
path: { id },
|
|
22468
23785
|
body: {
|
|
22469
|
-
data: { type: "
|
|
23786
|
+
data: { type: "support-ticket", id, attributes }
|
|
22470
23787
|
}
|
|
22471
23788
|
},
|
|
22472
23789
|
options
|
|
@@ -22505,7 +23822,7 @@ function createSupportNamespace(rb) {
|
|
|
22505
23822
|
{
|
|
22506
23823
|
body: {
|
|
22507
23824
|
data: {
|
|
22508
|
-
type: "
|
|
23825
|
+
type: "support-ticket-message",
|
|
22509
23826
|
attributes: { ...attributes, ticket_id: ticketId }
|
|
22510
23827
|
}
|
|
22511
23828
|
}
|
|
@@ -22571,7 +23888,7 @@ function createSupportNamespace(rb) {
|
|
|
22571
23888
|
postSupportTicketRatings,
|
|
22572
23889
|
{
|
|
22573
23890
|
body: {
|
|
22574
|
-
data: { type: "
|
|
23891
|
+
data: { type: "support-ticket-rating", attributes }
|
|
22575
23892
|
}
|
|
22576
23893
|
},
|
|
22577
23894
|
options
|
|
@@ -22639,7 +23956,7 @@ function createSupportNamespace(rb) {
|
|
|
22639
23956
|
postSupportTags,
|
|
22640
23957
|
{
|
|
22641
23958
|
body: {
|
|
22642
|
-
data: { type: "
|
|
23959
|
+
data: { type: "support-tag", attributes }
|
|
22643
23960
|
}
|
|
22644
23961
|
},
|
|
22645
23962
|
options
|
|
@@ -22854,7 +24171,7 @@ function createExtractionNamespace(rb) {
|
|
|
22854
24171
|
return rb.execute(
|
|
22855
24172
|
postDocumentsBulkDelete,
|
|
22856
24173
|
{
|
|
22857
|
-
body: { data: { type: "
|
|
24174
|
+
body: { data: { type: "operation-success", attributes: { ids } } }
|
|
22858
24175
|
},
|
|
22859
24176
|
options
|
|
22860
24177
|
);
|
|
@@ -22911,7 +24228,7 @@ function createExtractionNamespace(rb) {
|
|
|
22911
24228
|
{
|
|
22912
24229
|
body: {
|
|
22913
24230
|
data: {
|
|
22914
|
-
type: "
|
|
24231
|
+
type: "bulk-reprocess-result",
|
|
22915
24232
|
attributes: { document_ids: documentIds }
|
|
22916
24233
|
}
|
|
22917
24234
|
}
|
|
@@ -23003,7 +24320,7 @@ function createExtractionNamespace(rb) {
|
|
|
23003
24320
|
return rb.execute(
|
|
23004
24321
|
postExtractionDocumentsBeginUpload,
|
|
23005
24322
|
{
|
|
23006
|
-
body: { data: { type: "
|
|
24323
|
+
body: { data: { type: "extraction-document", attributes: attrs } }
|
|
23007
24324
|
},
|
|
23008
24325
|
options
|
|
23009
24326
|
);
|
|
@@ -23041,7 +24358,7 @@ function createExtractionNamespace(rb) {
|
|
|
23041
24358
|
postExtractionDocumentsFindOrBeginUpload,
|
|
23042
24359
|
{
|
|
23043
24360
|
body: {
|
|
23044
|
-
data: { type: "
|
|
24361
|
+
data: { type: "extraction-document", attributes: attrs || {} }
|
|
23045
24362
|
}
|
|
23046
24363
|
},
|
|
23047
24364
|
options
|
|
@@ -23152,7 +24469,7 @@ function createExtractionNamespace(rb) {
|
|
|
23152
24469
|
patchExtractionDocumentsByIdVerification,
|
|
23153
24470
|
{
|
|
23154
24471
|
path: { id },
|
|
23155
|
-
body: { data: { type: "
|
|
24472
|
+
body: { data: { type: "extraction-document", attributes: attrs } }
|
|
23156
24473
|
},
|
|
23157
24474
|
options
|
|
23158
24475
|
);
|
|
@@ -23273,7 +24590,7 @@ function createExtractionNamespace(rb) {
|
|
|
23273
24590
|
PresignedUploadSchema.parse(attrs);
|
|
23274
24591
|
return rb.execute(
|
|
23275
24592
|
postDocumentsPresignedUpload,
|
|
23276
|
-
{ body: { data: { type: "
|
|
24593
|
+
{ body: { data: { type: "presigned-url", attributes: attrs } } },
|
|
23277
24594
|
options
|
|
23278
24595
|
);
|
|
23279
24596
|
}
|
|
@@ -23377,7 +24694,7 @@ function createExtractionNamespace(rb) {
|
|
|
23377
24694
|
patchExtractionResultsById,
|
|
23378
24695
|
{
|
|
23379
24696
|
path: { id },
|
|
23380
|
-
body: { data: { id, type: "
|
|
24697
|
+
body: { data: { id, type: "extraction-result", attributes } }
|
|
23381
24698
|
},
|
|
23382
24699
|
options
|
|
23383
24700
|
);
|
|
@@ -23451,7 +24768,7 @@ function createExtractionNamespace(rb) {
|
|
|
23451
24768
|
patchExtractionResultsByIdRegenerate,
|
|
23452
24769
|
{
|
|
23453
24770
|
path: { id },
|
|
23454
|
-
body: { data: { type: "
|
|
24771
|
+
body: { data: { type: "extraction-result", attributes: attrs } }
|
|
23455
24772
|
},
|
|
23456
24773
|
options
|
|
23457
24774
|
);
|
|
@@ -23487,7 +24804,7 @@ function createExtractionNamespace(rb) {
|
|
|
23487
24804
|
patchExtractionResultsByIdSaveCorrections,
|
|
23488
24805
|
{
|
|
23489
24806
|
path: { id },
|
|
23490
|
-
body: { data: { type: "
|
|
24807
|
+
body: { data: { type: "extraction-result", attributes: attrs } }
|
|
23491
24808
|
},
|
|
23492
24809
|
options
|
|
23493
24810
|
);
|
|
@@ -23593,7 +24910,7 @@ function createExtractionNamespace(rb) {
|
|
|
23593
24910
|
create: async (attributes, options) => {
|
|
23594
24911
|
return rb.execute(
|
|
23595
24912
|
postExtractionBatches,
|
|
23596
|
-
{ body: { data: { type: "
|
|
24913
|
+
{ body: { data: { type: "extraction-batch", attributes } } },
|
|
23597
24914
|
options
|
|
23598
24915
|
);
|
|
23599
24916
|
},
|
|
@@ -23725,7 +25042,7 @@ function createExtractionNamespace(rb) {
|
|
|
23725
25042
|
postWorkspacesByWorkspaceIdExtractionExports,
|
|
23726
25043
|
{
|
|
23727
25044
|
path: { workspace_id: workspaceId },
|
|
23728
|
-
body: { data: { type: "
|
|
25045
|
+
body: { data: { type: "extraction-export", attributes: attrs } }
|
|
23729
25046
|
},
|
|
23730
25047
|
options
|
|
23731
25048
|
);
|
|
@@ -23783,7 +25100,7 @@ function createExtractionNamespace(rb) {
|
|
|
23783
25100
|
create: async (attrs, options) => {
|
|
23784
25101
|
return rb.execute(
|
|
23785
25102
|
postExtractionSchemaDiscoveries,
|
|
23786
|
-
{ body: { data: { type: "
|
|
25103
|
+
{ body: { data: { type: "schema-discovery", attributes: attrs } } },
|
|
23787
25104
|
options
|
|
23788
25105
|
);
|
|
23789
25106
|
},
|
|
@@ -23891,7 +25208,7 @@ function createExtractionNamespace(rb) {
|
|
|
23891
25208
|
FieldTemplateCreateSchema.parse(attrs);
|
|
23892
25209
|
return rb.execute(
|
|
23893
25210
|
postFieldTemplates,
|
|
23894
|
-
{ body: { data: { type: "
|
|
25211
|
+
{ body: { data: { type: "field-template", attributes: attrs } } },
|
|
23895
25212
|
options
|
|
23896
25213
|
);
|
|
23897
25214
|
},
|
|
@@ -23986,7 +25303,7 @@ function createExtractionNamespace(rb) {
|
|
|
23986
25303
|
{
|
|
23987
25304
|
path: { workspace_id: workspaceId, document_id: documentId },
|
|
23988
25305
|
body: {
|
|
23989
|
-
data: { type: "
|
|
25306
|
+
data: { type: "field-mapping-confirmation", attributes: attrs }
|
|
23990
25307
|
}
|
|
23991
25308
|
},
|
|
23992
25309
|
options
|
|
@@ -24116,8 +25433,8 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24116
25433
|
* first_name: "Jane",
|
|
24117
25434
|
* last_name: "Doe",
|
|
24118
25435
|
* legal_documents_accepted: [
|
|
24119
|
-
* { document_id: "uuid-of-terms-doc", document_type: "
|
|
24120
|
-
* { document_id: "uuid-of-privacy-doc", document_type: "
|
|
25436
|
+
* { document_id: "uuid-of-terms-doc", document_type: "terms-of-service", version: "2025-01-01" },
|
|
25437
|
+
* { document_id: "uuid-of-privacy-doc", document_type: "privacy-policy", version: "2025-01-01" },
|
|
24121
25438
|
* ],
|
|
24122
25439
|
* });
|
|
24123
25440
|
* ```
|
|
@@ -24480,7 +25797,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24480
25797
|
create: async (attributes, options) => {
|
|
24481
25798
|
return rb.execute(
|
|
24482
25799
|
postUserProfiles,
|
|
24483
|
-
{ body: { data: { type: "
|
|
25800
|
+
{ body: { data: { type: "user-profile", attributes } } },
|
|
24484
25801
|
options
|
|
24485
25802
|
);
|
|
24486
25803
|
},
|
|
@@ -24490,7 +25807,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24490
25807
|
patchUserProfilesById,
|
|
24491
25808
|
{
|
|
24492
25809
|
path: { id },
|
|
24493
|
-
body: { data: { id, type: "
|
|
25810
|
+
body: { data: { id, type: "user-profile", attributes } }
|
|
24494
25811
|
},
|
|
24495
25812
|
options
|
|
24496
25813
|
);
|
|
@@ -24527,7 +25844,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24527
25844
|
patchUserProfilesByIdAcceptTos,
|
|
24528
25845
|
{
|
|
24529
25846
|
path: { id },
|
|
24530
|
-
body: { data: { id, type: "
|
|
25847
|
+
body: { data: { id, type: "user-profile", attributes } }
|
|
24531
25848
|
},
|
|
24532
25849
|
options
|
|
24533
25850
|
);
|
|
@@ -24542,7 +25859,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24542
25859
|
patchUserProfilesByIdDismissWelcome,
|
|
24543
25860
|
{
|
|
24544
25861
|
path: { id },
|
|
24545
|
-
body: { data: { id, type: "
|
|
25862
|
+
body: { data: { id, type: "user-profile", attributes: {} } }
|
|
24546
25863
|
},
|
|
24547
25864
|
options
|
|
24548
25865
|
);
|
|
@@ -24557,7 +25874,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24557
25874
|
patchUserProfilesByIdDismissAnnouncement,
|
|
24558
25875
|
{
|
|
24559
25876
|
path: { id },
|
|
24560
|
-
body: { data: { id, type: "
|
|
25877
|
+
body: { data: { id, type: "user-profile", attributes: {} } }
|
|
24561
25878
|
},
|
|
24562
25879
|
options
|
|
24563
25880
|
);
|
|
@@ -24644,7 +25961,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24644
25961
|
update: async (id, attributes, options) => {
|
|
24645
25962
|
return rb.execute(
|
|
24646
25963
|
patchApiKeysById,
|
|
24647
|
-
{ path: { id }, body: { data: { id, type: "
|
|
25964
|
+
{ path: { id }, body: { data: { id, type: "api-key", attributes } } },
|
|
24648
25965
|
options
|
|
24649
25966
|
);
|
|
24650
25967
|
},
|
|
@@ -24653,7 +25970,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24653
25970
|
ApiKeyCreateSchema.parse({ name });
|
|
24654
25971
|
return rb.execute(
|
|
24655
25972
|
postApiKeys,
|
|
24656
|
-
{ body: { data: { type: "
|
|
25973
|
+
{ body: { data: { type: "api-key", attributes: { name } } } },
|
|
24657
25974
|
options
|
|
24658
25975
|
);
|
|
24659
25976
|
},
|
|
@@ -24700,7 +26017,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24700
26017
|
body: {
|
|
24701
26018
|
data: {
|
|
24702
26019
|
id,
|
|
24703
|
-
type: "
|
|
26020
|
+
type: "api-key",
|
|
24704
26021
|
attributes: {
|
|
24705
26022
|
credit_limit: creditLimit,
|
|
24706
26023
|
credit_limit_period: creditLimitPeriod
|
|
@@ -24747,7 +26064,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
24747
26064
|
patchApiKeysByIdResetPeriod,
|
|
24748
26065
|
{
|
|
24749
26066
|
path: { id },
|
|
24750
|
-
body: { data: { id, type: "
|
|
26067
|
+
body: { data: { id, type: "api-key", attributes: {} } }
|
|
24751
26068
|
},
|
|
24752
26069
|
options
|
|
24753
26070
|
);
|
|
@@ -26149,7 +27466,7 @@ function createPlatformNamespace(rb) {
|
|
|
26149
27466
|
create: async (attributes, options) => {
|
|
26150
27467
|
return rb.execute(
|
|
26151
27468
|
postBrandIdentities,
|
|
26152
|
-
{ body: { data: { type: "
|
|
27469
|
+
{ body: { data: { type: "brand-identity", attributes } } },
|
|
26153
27470
|
options
|
|
26154
27471
|
);
|
|
26155
27472
|
},
|
|
@@ -26175,7 +27492,7 @@ function createPlatformNamespace(rb) {
|
|
|
26175
27492
|
patchBrandIdentitiesById,
|
|
26176
27493
|
{
|
|
26177
27494
|
path: { id },
|
|
26178
|
-
body: { data: { id, type: "
|
|
27495
|
+
body: { data: { id, type: "brand-identity", attributes } }
|
|
26179
27496
|
},
|
|
26180
27497
|
options
|
|
26181
27498
|
);
|
|
@@ -26319,7 +27636,7 @@ function createPlatformNamespace(rb) {
|
|
|
26319
27636
|
patchBrandIdentitiesByIdSetDefault,
|
|
26320
27637
|
{
|
|
26321
27638
|
path: { id },
|
|
26322
|
-
body: { data: { id, type: "
|
|
27639
|
+
body: { data: { id, type: "brand-identity", attributes: {} } }
|
|
26323
27640
|
},
|
|
26324
27641
|
options
|
|
26325
27642
|
);
|
|
@@ -26346,7 +27663,7 @@ function createPlatformNamespace(rb) {
|
|
|
26346
27663
|
patchBrandIdentitiesByIdUnsetDefault,
|
|
26347
27664
|
{
|
|
26348
27665
|
path: { id },
|
|
26349
|
-
body: { data: { id, type: "
|
|
27666
|
+
body: { data: { id, type: "brand-identity", attributes: {} } }
|
|
26350
27667
|
},
|
|
26351
27668
|
options
|
|
26352
27669
|
);
|
|
@@ -26430,7 +27747,7 @@ function createPlatformNamespace(rb) {
|
|
|
26430
27747
|
create: async (attributes, options) => {
|
|
26431
27748
|
return rb.execute(
|
|
26432
27749
|
postPlatformTones,
|
|
26433
|
-
{ body: { data: { type: "
|
|
27750
|
+
{ body: { data: { type: "platform-tone", attributes } } },
|
|
26434
27751
|
options
|
|
26435
27752
|
);
|
|
26436
27753
|
},
|
|
@@ -26456,7 +27773,7 @@ function createPlatformNamespace(rb) {
|
|
|
26456
27773
|
patchPlatformTonesById,
|
|
26457
27774
|
{
|
|
26458
27775
|
path: { id },
|
|
26459
|
-
body: { data: { id, type: "
|
|
27776
|
+
body: { data: { id, type: "platform-tone", attributes } }
|
|
26460
27777
|
},
|
|
26461
27778
|
options
|
|
26462
27779
|
);
|
|
@@ -26717,6 +28034,69 @@ function createPortalNamespace(rb) {
|
|
|
26717
28034
|
};
|
|
26718
28035
|
}
|
|
26719
28036
|
|
|
28037
|
+
// src/namespaces/session-notes.ts
|
|
28038
|
+
function createSessionNotesNamespace(rb) {
|
|
28039
|
+
return {
|
|
28040
|
+
/**
|
|
28041
|
+
* Get the current version of a session note.
|
|
28042
|
+
*
|
|
28043
|
+
* Returns `null` if no note of this type exists for the event yet.
|
|
28044
|
+
*
|
|
28045
|
+
* @param eventId - The UUID of the scheduling event (session).
|
|
28046
|
+
* @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
|
|
28047
|
+
* @param workspaceId - The workspace UUID. Required for application-scoped API keys.
|
|
28048
|
+
* @param options - Optional request options.
|
|
28049
|
+
* @returns The `DataStoreRecord`, or `null` if not found.
|
|
28050
|
+
*/
|
|
28051
|
+
get: async (eventId, noteType, workspaceId, options) => {
|
|
28052
|
+
const results = await rb.execute(
|
|
28053
|
+
getDataStoreRecordsByNamespace,
|
|
28054
|
+
{
|
|
28055
|
+
query: {
|
|
28056
|
+
workspace_id: workspaceId,
|
|
28057
|
+
namespace: "sessions",
|
|
28058
|
+
"filter[record_key]": `${eventId}:${noteType}`
|
|
28059
|
+
}
|
|
28060
|
+
},
|
|
28061
|
+
options
|
|
28062
|
+
);
|
|
28063
|
+
return results.length > 0 ? results[0] ?? null : null;
|
|
28064
|
+
},
|
|
28065
|
+
/**
|
|
28066
|
+
* Create or update a session note (auto-versions on update).
|
|
28067
|
+
*
|
|
28068
|
+
* If the note does not exist, it is created. If it exists, its value
|
|
28069
|
+
* is replaced and the version counter is incremented.
|
|
28070
|
+
*
|
|
28071
|
+
* @param eventId - The UUID of the scheduling event (session).
|
|
28072
|
+
* @param noteType - The note type: `"adime"`, `"soap"`, `"goals"`, or `"email"`.
|
|
28073
|
+
* @param workspaceId - The workspace UUID. Required for application-scoped API keys.
|
|
28074
|
+
* @param value - The note content and optional metadata.
|
|
28075
|
+
* @param options - Optional request options.
|
|
28076
|
+
* @returns The upserted `DataStoreRecord`.
|
|
28077
|
+
*/
|
|
28078
|
+
upsert: async (eventId, noteType, workspaceId, value, options) => {
|
|
28079
|
+
return rb.execute(
|
|
28080
|
+
postDataStoreRecordsUpsert,
|
|
28081
|
+
{
|
|
28082
|
+
body: {
|
|
28083
|
+
data: {
|
|
28084
|
+
type: "data-store-record",
|
|
28085
|
+
attributes: {
|
|
28086
|
+
namespace: "sessions",
|
|
28087
|
+
record_key: `${eventId}:${noteType}`,
|
|
28088
|
+
workspace_id: workspaceId,
|
|
28089
|
+
value
|
|
28090
|
+
}
|
|
28091
|
+
}
|
|
28092
|
+
}
|
|
28093
|
+
},
|
|
28094
|
+
options
|
|
28095
|
+
);
|
|
28096
|
+
}
|
|
28097
|
+
};
|
|
28098
|
+
}
|
|
28099
|
+
|
|
26720
28100
|
// src/namespaces/scheduling.ts
|
|
26721
28101
|
function createSchedulingNamespace(rb) {
|
|
26722
28102
|
return {
|
|
@@ -26828,7 +28208,7 @@ function createSchedulingNamespace(rb) {
|
|
|
26828
28208
|
return rb.execute(
|
|
26829
28209
|
postSchedulingEventTypes,
|
|
26830
28210
|
{
|
|
26831
|
-
body: { data: { type: "
|
|
28211
|
+
body: { data: { type: "scheduling-event-type", attributes } }
|
|
26832
28212
|
},
|
|
26833
28213
|
options
|
|
26834
28214
|
);
|
|
@@ -26859,10 +28239,61 @@ function createSchedulingNamespace(rb) {
|
|
|
26859
28239
|
patchSchedulingEventTypesById,
|
|
26860
28240
|
{
|
|
26861
28241
|
path: { id },
|
|
26862
|
-
body: { data: { id, type: "
|
|
28242
|
+
body: { data: { id, type: "scheduling-event-type", attributes } }
|
|
26863
28243
|
},
|
|
26864
28244
|
options
|
|
26865
28245
|
);
|
|
28246
|
+
},
|
|
28247
|
+
/**
|
|
28248
|
+
* Archive an event type.
|
|
28249
|
+
*
|
|
28250
|
+
* Marks the event type as archived so it no longer appears in active
|
|
28251
|
+
* listings. Existing bookings against this event type are unaffected.
|
|
28252
|
+
*
|
|
28253
|
+
* @param id - The UUID of the event type to archive.
|
|
28254
|
+
* @param options - Optional request options.
|
|
28255
|
+
* @returns The archived `SchedulingEventType`.
|
|
28256
|
+
*
|
|
28257
|
+
* @example
|
|
28258
|
+
* ```typescript
|
|
28259
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
28260
|
+
* const archived = await client.scheduling.eventTypes.archive('et_abc123');
|
|
28261
|
+
* console.log(archived.attributes?.status); // 'archived'
|
|
28262
|
+
* ```
|
|
28263
|
+
*/
|
|
28264
|
+
archive: async (id, options) => {
|
|
28265
|
+
return rb.execute(
|
|
28266
|
+
patchSchedulingEventTypesByIdArchive,
|
|
28267
|
+
{ path: { id }, body: {} },
|
|
28268
|
+
options
|
|
28269
|
+
);
|
|
28270
|
+
},
|
|
28271
|
+
/**
|
|
28272
|
+
* Retrieve an event type by its public slug.
|
|
28273
|
+
*
|
|
28274
|
+
* Slugs are unique per workspace and used in public booking URLs.
|
|
28275
|
+
* This is the primary lookup method for external-facing booking pages.
|
|
28276
|
+
*
|
|
28277
|
+
* @param slug - The URL-safe slug of the event type.
|
|
28278
|
+
* @param workspaceId - The workspace that owns the event type.
|
|
28279
|
+
* @param options - Optional request options.
|
|
28280
|
+
* @returns The matching `SchedulingEventType`.
|
|
28281
|
+
*
|
|
28282
|
+
* @example
|
|
28283
|
+
* ```typescript
|
|
28284
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
28285
|
+
* const eventType = await client.scheduling.eventTypes.getBySlug(
|
|
28286
|
+
* '30min-consult', 'ws_abc123',
|
|
28287
|
+
* );
|
|
28288
|
+
* console.log(eventType.attributes?.name);
|
|
28289
|
+
* ```
|
|
28290
|
+
*/
|
|
28291
|
+
getBySlug: async (slug, workspaceId, options) => {
|
|
28292
|
+
return rb.execute(
|
|
28293
|
+
getSchedulingEventTypesBySlug,
|
|
28294
|
+
{ query: { slug, workspace_id: workspaceId } },
|
|
28295
|
+
options
|
|
28296
|
+
);
|
|
26866
28297
|
}
|
|
26867
28298
|
},
|
|
26868
28299
|
/**
|
|
@@ -26874,43 +28305,53 @@ function createSchedulingNamespace(rb) {
|
|
|
26874
28305
|
*/
|
|
26875
28306
|
events: {
|
|
26876
28307
|
/**
|
|
26877
|
-
* List scheduling events with optional pagination.
|
|
28308
|
+
* List scheduling events in a workspace with optional pagination.
|
|
26878
28309
|
*
|
|
28310
|
+
* @param workspaceId - The workspace to list events for.
|
|
26879
28311
|
* @param options - Optional page number, page size, and request options.
|
|
26880
28312
|
* @returns A page of `SchedulingEvent` records.
|
|
26881
28313
|
*
|
|
26882
28314
|
* @example
|
|
26883
28315
|
* ```typescript
|
|
26884
28316
|
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
26885
|
-
* const events = await client.scheduling.events.list({ pageSize: 25 });
|
|
28317
|
+
* const events = await client.scheduling.events.list(workspaceId, { pageSize: 25 });
|
|
26886
28318
|
* events.forEach(e => console.log(e.attributes?.title, e.attributes?.start_time));
|
|
26887
28319
|
* ```
|
|
26888
28320
|
*/
|
|
26889
|
-
list: async (options) => {
|
|
28321
|
+
list: async (workspaceId, options) => {
|
|
26890
28322
|
return rb.execute(
|
|
26891
28323
|
getSchedulingEvents,
|
|
26892
|
-
|
|
28324
|
+
{
|
|
28325
|
+
query: {
|
|
28326
|
+
workspace_id: workspaceId,
|
|
28327
|
+
...buildPageQuery(options?.page, options?.pageSize).query
|
|
28328
|
+
}
|
|
28329
|
+
},
|
|
26893
28330
|
options
|
|
26894
28331
|
);
|
|
26895
28332
|
},
|
|
26896
28333
|
/**
|
|
26897
|
-
* List all scheduling events, automatically paginating through every page.
|
|
28334
|
+
* List all scheduling events in a workspace, automatically paginating through every page.
|
|
26898
28335
|
*
|
|
28336
|
+
* @param workspaceId - The workspace to list events for.
|
|
26899
28337
|
* @param options - Optional request options.
|
|
26900
28338
|
* @returns All `SchedulingEvent` records as a flat array.
|
|
26901
28339
|
*
|
|
26902
28340
|
* @example
|
|
26903
28341
|
* ```typescript
|
|
26904
28342
|
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
26905
|
-
* const allEvents = await client.scheduling.events.listAll();
|
|
28343
|
+
* const allEvents = await client.scheduling.events.listAll(workspaceId);
|
|
26906
28344
|
* ```
|
|
26907
28345
|
*/
|
|
26908
|
-
listAll: async (options) => {
|
|
28346
|
+
listAll: async (workspaceId, options) => {
|
|
26909
28347
|
return paginateToArray(
|
|
26910
28348
|
rb.createPaginatedFetcher(
|
|
26911
28349
|
getSchedulingEvents,
|
|
26912
28350
|
(page, pageSize) => ({
|
|
26913
|
-
query: {
|
|
28351
|
+
query: {
|
|
28352
|
+
workspace_id: workspaceId,
|
|
28353
|
+
page: { number: page, size: pageSize }
|
|
28354
|
+
}
|
|
26914
28355
|
}),
|
|
26915
28356
|
options
|
|
26916
28357
|
)
|
|
@@ -26966,7 +28407,7 @@ function createSchedulingNamespace(rb) {
|
|
|
26966
28407
|
return rb.execute(
|
|
26967
28408
|
postSchedulingEvents,
|
|
26968
28409
|
{
|
|
26969
|
-
body: { data: { type: "
|
|
28410
|
+
body: { data: { type: "scheduling-event", attributes } }
|
|
26970
28411
|
},
|
|
26971
28412
|
options
|
|
26972
28413
|
);
|
|
@@ -26997,33 +28438,11 @@ function createSchedulingNamespace(rb) {
|
|
|
26997
28438
|
patchSchedulingEventsById,
|
|
26998
28439
|
{
|
|
26999
28440
|
path: { id },
|
|
27000
|
-
body: { data: { id, type: "
|
|
28441
|
+
body: { data: { id, type: "scheduling-event", attributes } }
|
|
27001
28442
|
},
|
|
27002
28443
|
options
|
|
27003
28444
|
);
|
|
27004
28445
|
},
|
|
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
28446
|
/**
|
|
27028
28447
|
* Cancel an event.
|
|
27029
28448
|
*
|
|
@@ -27044,7 +28463,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27044
28463
|
patchSchedulingEventsByIdCancel,
|
|
27045
28464
|
{
|
|
27046
28465
|
path: { id },
|
|
27047
|
-
body: attributes ? { data: { type: "
|
|
28466
|
+
body: attributes ? { data: { type: "scheduling-event", attributes } } : {}
|
|
27048
28467
|
},
|
|
27049
28468
|
options
|
|
27050
28469
|
);
|
|
@@ -27089,7 +28508,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27089
28508
|
patchSchedulingEventsByIdReschedule,
|
|
27090
28509
|
{
|
|
27091
28510
|
path: { id },
|
|
27092
|
-
body: { data: { type: "
|
|
28511
|
+
body: { data: { type: "scheduling-event", attributes } }
|
|
27093
28512
|
},
|
|
27094
28513
|
options
|
|
27095
28514
|
);
|
|
@@ -27125,6 +28544,28 @@ function createSchedulingNamespace(rb) {
|
|
|
27125
28544
|
options
|
|
27126
28545
|
);
|
|
27127
28546
|
},
|
|
28547
|
+
/**
|
|
28548
|
+
* List events that include a specific participant by email.
|
|
28549
|
+
*
|
|
28550
|
+
* Use this to retrieve all sessions for a client (e.g., all appointments
|
|
28551
|
+
* for a given patient). Filters events in the workspace where a Participant
|
|
28552
|
+
* record with the given email exists.
|
|
28553
|
+
*
|
|
28554
|
+
* @param email - The participant's email address to filter by.
|
|
28555
|
+
* @param workspaceId - The workspace to scope the query to.
|
|
28556
|
+
* @param options - Optional page number, page size, and request options.
|
|
28557
|
+
* @returns A flat array of `SchedulingEvent` records.
|
|
28558
|
+
*
|
|
28559
|
+
* @example
|
|
28560
|
+
* ```typescript
|
|
28561
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
28562
|
+
* const sessions = await client.scheduling.events.listByParticipant(
|
|
28563
|
+
* 'patient@example.com',
|
|
28564
|
+
* workspaceId,
|
|
28565
|
+
* );
|
|
28566
|
+
* sessions.forEach(s => console.log(s.attributes?.start_time, s.attributes?.status));
|
|
28567
|
+
* ```
|
|
28568
|
+
*/
|
|
27128
28569
|
listByParticipant: async (email, workspaceId, options) => {
|
|
27129
28570
|
return rb.execute(
|
|
27130
28571
|
getSchedulingEventsByParticipant,
|
|
@@ -27239,7 +28680,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27239
28680
|
return rb.execute(
|
|
27240
28681
|
postSchedulingParticipants,
|
|
27241
28682
|
{
|
|
27242
|
-
body: { data: { type: "
|
|
28683
|
+
body: { data: { type: "scheduling-participant", attributes } }
|
|
27243
28684
|
},
|
|
27244
28685
|
options
|
|
27245
28686
|
);
|
|
@@ -27270,7 +28711,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27270
28711
|
patchSchedulingParticipantsById,
|
|
27271
28712
|
{
|
|
27272
28713
|
path: { id },
|
|
27273
|
-
body: { data: { id, type: "
|
|
28714
|
+
body: { data: { id, type: "scheduling-participant", attributes } }
|
|
27274
28715
|
},
|
|
27275
28716
|
options
|
|
27276
28717
|
);
|
|
@@ -27295,7 +28736,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27295
28736
|
path: { id },
|
|
27296
28737
|
body: {
|
|
27297
28738
|
data: {
|
|
27298
|
-
type: "
|
|
28739
|
+
type: "scheduling-participant",
|
|
27299
28740
|
attributes: { status }
|
|
27300
28741
|
}
|
|
27301
28742
|
}
|
|
@@ -27437,7 +28878,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27437
28878
|
return rb.execute(
|
|
27438
28879
|
postSchedulingBookings,
|
|
27439
28880
|
{
|
|
27440
|
-
body: { data: { type: "
|
|
28881
|
+
body: { data: { type: "scheduling-booking", attributes } }
|
|
27441
28882
|
},
|
|
27442
28883
|
options
|
|
27443
28884
|
);
|
|
@@ -27494,7 +28935,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27494
28935
|
patchSchedulingBookingsByIdCancel,
|
|
27495
28936
|
{
|
|
27496
28937
|
path: { id },
|
|
27497
|
-
body: attributes ? { data: { type: "
|
|
28938
|
+
body: attributes ? { data: { type: "scheduling-booking", attributes } } : {}
|
|
27498
28939
|
},
|
|
27499
28940
|
options
|
|
27500
28941
|
);
|
|
@@ -27526,7 +28967,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27526
28967
|
patchSchedulingBookingsByIdReschedule,
|
|
27527
28968
|
{
|
|
27528
28969
|
path: { id },
|
|
27529
|
-
body: { data: { type: "
|
|
28970
|
+
body: { data: { type: "scheduling-booking", attributes } }
|
|
27530
28971
|
},
|
|
27531
28972
|
options
|
|
27532
28973
|
);
|
|
@@ -27551,6 +28992,33 @@ function createSchedulingNamespace(rb) {
|
|
|
27551
28992
|
{ path: { id }, body: {} },
|
|
27552
28993
|
options
|
|
27553
28994
|
);
|
|
28995
|
+
},
|
|
28996
|
+
/**
|
|
28997
|
+
* List bookings by booker email address.
|
|
28998
|
+
*
|
|
28999
|
+
* Returns all bookings associated with the given booker email,
|
|
29000
|
+
* regardless of status. Useful for lookup pages where a booker
|
|
29001
|
+
* wants to view or manage their appointments.
|
|
29002
|
+
*
|
|
29003
|
+
* @param email - The booker's email address.
|
|
29004
|
+
* @param options - Optional request options.
|
|
29005
|
+
* @returns An array of `SchedulingBooking` records for that booker.
|
|
29006
|
+
*
|
|
29007
|
+
* @example
|
|
29008
|
+
* ```typescript
|
|
29009
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
29010
|
+
* const bookings = await client.scheduling.bookings.listByBooker(
|
|
29011
|
+
* 'patient@example.com',
|
|
29012
|
+
* );
|
|
29013
|
+
* bookings.forEach(b => console.log(b.attributes?.start_time, b.attributes?.status));
|
|
29014
|
+
* ```
|
|
29015
|
+
*/
|
|
29016
|
+
listByBooker: async (email, options) => {
|
|
29017
|
+
return rb.execute(
|
|
29018
|
+
getSchedulingBookingsByBooker,
|
|
29019
|
+
{ query: { booker_email: email } },
|
|
29020
|
+
options
|
|
29021
|
+
);
|
|
27554
29022
|
}
|
|
27555
29023
|
},
|
|
27556
29024
|
/**
|
|
@@ -27657,7 +29125,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27657
29125
|
return rb.execute(
|
|
27658
29126
|
postSchedulingCalendarSyncs,
|
|
27659
29127
|
{
|
|
27660
|
-
body: { data: { type: "
|
|
29128
|
+
body: { data: { type: "scheduling-calendar-sync", attributes } }
|
|
27661
29129
|
},
|
|
27662
29130
|
options
|
|
27663
29131
|
);
|
|
@@ -27687,7 +29155,7 @@ function createSchedulingNamespace(rb) {
|
|
|
27687
29155
|
{
|
|
27688
29156
|
path: { id },
|
|
27689
29157
|
body: {
|
|
27690
|
-
data: { id, type: "
|
|
29158
|
+
data: { id, type: "scheduling-calendar-sync", attributes }
|
|
27691
29159
|
}
|
|
27692
29160
|
},
|
|
27693
29161
|
options
|
|
@@ -27767,91 +29235,8 @@ function createSchedulingNamespace(rb) {
|
|
|
27767
29235
|
);
|
|
27768
29236
|
}
|
|
27769
29237
|
},
|
|
27770
|
-
/**
|
|
27771
|
-
|
|
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
|
-
}
|
|
29238
|
+
/** Session Notes — clinical notes per appointment (Chartless-specific, backed by DataStore). */
|
|
29239
|
+
sessionNotes: createSessionNotesNamespace(rb)
|
|
27855
29240
|
};
|
|
27856
29241
|
}
|
|
27857
29242
|
|
|
@@ -28035,7 +29420,7 @@ function createSearchNamespace(rb) {
|
|
|
28035
29420
|
create: async (attributes, options) => {
|
|
28036
29421
|
return rb.execute(
|
|
28037
29422
|
postSearchSaved,
|
|
28038
|
-
{ body: { data: { type: "
|
|
29423
|
+
{ body: { data: { type: "saved-search", attributes } } },
|
|
28039
29424
|
options
|
|
28040
29425
|
);
|
|
28041
29426
|
},
|
|
@@ -28133,7 +29518,7 @@ function createStorageNamespace(rb) {
|
|
|
28133
29518
|
postDocumentsPresignedUpload,
|
|
28134
29519
|
{
|
|
28135
29520
|
body: {
|
|
28136
|
-
data: { type: "
|
|
29521
|
+
data: { type: "presigned-upload", attributes: attributes ?? {} }
|
|
28137
29522
|
}
|
|
28138
29523
|
},
|
|
28139
29524
|
options
|
|
@@ -28367,7 +29752,7 @@ function createStorageNamespace(rb) {
|
|
|
28367
29752
|
patchStorageFilesByIdArchive,
|
|
28368
29753
|
{
|
|
28369
29754
|
path: { id },
|
|
28370
|
-
body: { data: { id, type: "
|
|
29755
|
+
body: { data: { id, type: "storage-file" } }
|
|
28371
29756
|
},
|
|
28372
29757
|
options
|
|
28373
29758
|
);
|
|
@@ -28384,7 +29769,7 @@ function createStorageNamespace(rb) {
|
|
|
28384
29769
|
patchStorageFilesByIdRestore,
|
|
28385
29770
|
{
|
|
28386
29771
|
path: { id },
|
|
28387
|
-
body: { data: { id, type: "
|
|
29772
|
+
body: { data: { id, type: "storage-file" } }
|
|
28388
29773
|
},
|
|
28389
29774
|
options
|
|
28390
29775
|
);
|
|
@@ -28405,7 +29790,7 @@ function createStorageNamespace(rb) {
|
|
|
28405
29790
|
body: {
|
|
28406
29791
|
data: {
|
|
28407
29792
|
id,
|
|
28408
|
-
type: "
|
|
29793
|
+
type: "storage-file",
|
|
28409
29794
|
attributes: attributes ?? {}
|
|
28410
29795
|
}
|
|
28411
29796
|
}
|
|
@@ -28425,7 +29810,7 @@ function createStorageNamespace(rb) {
|
|
|
28425
29810
|
patchStorageFilesByIdSoftDelete,
|
|
28426
29811
|
{
|
|
28427
29812
|
path: { id },
|
|
28428
|
-
body: { data: { id, type: "
|
|
29813
|
+
body: { data: { id, type: "storage-file" } }
|
|
28429
29814
|
},
|
|
28430
29815
|
options
|
|
28431
29816
|
);
|
|
@@ -28444,7 +29829,7 @@ function createStorageNamespace(rb) {
|
|
|
28444
29829
|
{
|
|
28445
29830
|
path: { id },
|
|
28446
29831
|
body: {
|
|
28447
|
-
data: { id, type: "
|
|
29832
|
+
data: { id, type: "storage-file", attributes: { tags } }
|
|
28448
29833
|
}
|
|
28449
29834
|
},
|
|
28450
29835
|
options
|
|
@@ -28466,7 +29851,7 @@ function createStorageNamespace(rb) {
|
|
|
28466
29851
|
body: {
|
|
28467
29852
|
data: {
|
|
28468
29853
|
id,
|
|
28469
|
-
type: "
|
|
29854
|
+
type: "storage-file",
|
|
28470
29855
|
attributes: { new_metadata: newMetadata }
|
|
28471
29856
|
}
|
|
28472
29857
|
}
|
|
@@ -28688,6 +30073,40 @@ function createThreadsNamespace(rb) {
|
|
|
28688
30073
|
options
|
|
28689
30074
|
);
|
|
28690
30075
|
},
|
|
30076
|
+
/**
|
|
30077
|
+
* Merge metadata into the thread's existing metadata (shallow merge).
|
|
30078
|
+
*
|
|
30079
|
+
* Keys present in the input overwrite existing keys; keys not present are
|
|
30080
|
+
* preserved. Use `update({ metadata })` instead for full replacement.
|
|
30081
|
+
*
|
|
30082
|
+
* @param id - The UUID of the thread to update.
|
|
30083
|
+
* @param metadata - Key-value pairs to merge into existing metadata.
|
|
30084
|
+
* @param options - Optional request options.
|
|
30085
|
+
* @returns A promise that resolves to the updated `Thread`.
|
|
30086
|
+
*
|
|
30087
|
+
* @example
|
|
30088
|
+
* ```typescript
|
|
30089
|
+
* await client.threads.updateMetadata(threadId, {
|
|
30090
|
+
* pinned_context: { client_id: 'uuid', client_name: 'Sarah Johnson' },
|
|
30091
|
+
* });
|
|
30092
|
+
* ```
|
|
30093
|
+
*/
|
|
30094
|
+
updateMetadata: async (id, metadata, options) => {
|
|
30095
|
+
return rb.execute(
|
|
30096
|
+
patchThreadsByIdMetadata,
|
|
30097
|
+
{
|
|
30098
|
+
path: { id },
|
|
30099
|
+
body: {
|
|
30100
|
+
data: {
|
|
30101
|
+
id,
|
|
30102
|
+
type: "chat-thread",
|
|
30103
|
+
attributes: { metadata }
|
|
30104
|
+
}
|
|
30105
|
+
}
|
|
30106
|
+
},
|
|
30107
|
+
options
|
|
30108
|
+
);
|
|
30109
|
+
},
|
|
28691
30110
|
/**
|
|
28692
30111
|
* Generates an AI-produced summary of the thread's conversation history.
|
|
28693
30112
|
*
|
|
@@ -28699,12 +30118,12 @@ function createThreadsNamespace(rb) {
|
|
|
28699
30118
|
* @param id - The UUID of the thread to summarize.
|
|
28700
30119
|
* @param options - Optional request options.
|
|
28701
30120
|
* @returns A promise that resolves to the `Thread` object with the generated
|
|
28702
|
-
* summary populated in `attributes.
|
|
30121
|
+
* summary populated in `attributes.context_summary`.
|
|
28703
30122
|
*
|
|
28704
30123
|
* @example
|
|
28705
30124
|
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
28706
30125
|
* const thread = await client.threads.summarize('thr_01HXYZ...');
|
|
28707
|
-
* console.log(thread.attributes.
|
|
30126
|
+
* console.log(thread.attributes.context_summary);
|
|
28708
30127
|
*/
|
|
28709
30128
|
summarize: async (id, options) => {
|
|
28710
30129
|
return rb.execute(
|
|
@@ -28731,10 +30150,13 @@ function createThreadsNamespace(rb) {
|
|
|
28731
30150
|
* const fork = await client.threads.fork('thr_01HXYZ...');
|
|
28732
30151
|
* console.log(`Forked into new thread: ${fork.id}`);
|
|
28733
30152
|
*/
|
|
28734
|
-
fork: async (id, options) => {
|
|
30153
|
+
fork: async (id, title, options) => {
|
|
28735
30154
|
return rb.execute(
|
|
28736
30155
|
postThreadsByIdFork,
|
|
28737
|
-
{
|
|
30156
|
+
{
|
|
30157
|
+
path: { id },
|
|
30158
|
+
body: title ? { data: { type: "chat-thread", attributes: { title } } } : {}
|
|
30159
|
+
},
|
|
28738
30160
|
options
|
|
28739
30161
|
);
|
|
28740
30162
|
},
|
|
@@ -28747,20 +30169,22 @@ function createThreadsNamespace(rb) {
|
|
|
28747
30169
|
* via request options or query parameters.
|
|
28748
30170
|
*
|
|
28749
30171
|
* @param id - The UUID of the thread to export.
|
|
28750
|
-
* @param
|
|
28751
|
-
*
|
|
28752
|
-
* @returns A promise that resolves to the
|
|
28753
|
-
* payload available in `attributes.export`.
|
|
30172
|
+
* @param format - Export format: `'json'`, `'markdown'`, or `'text'`. Defaults to `'json'`.
|
|
30173
|
+
* @param options - Optional request options.
|
|
30174
|
+
* @returns A promise that resolves to the export payload.
|
|
28754
30175
|
*
|
|
28755
30176
|
* @example
|
|
28756
30177
|
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
28757
|
-
* const exported = await client.threads.export('thr_01HXYZ...');
|
|
28758
|
-
* console.log(exported.
|
|
30178
|
+
* const exported = await client.threads.export('thr_01HXYZ...', 'markdown');
|
|
30179
|
+
* console.log(exported.content);
|
|
28759
30180
|
*/
|
|
28760
|
-
export: async (id, options) => {
|
|
30181
|
+
export: async (id, format = "json", options) => {
|
|
28761
30182
|
return rb.execute(
|
|
28762
30183
|
postThreadsByIdExport,
|
|
28763
|
-
{
|
|
30184
|
+
{
|
|
30185
|
+
path: { id },
|
|
30186
|
+
body: { data: { type: "chat-thread", format } }
|
|
30187
|
+
},
|
|
28764
30188
|
options
|
|
28765
30189
|
);
|
|
28766
30190
|
},
|
|
@@ -28918,6 +30342,113 @@ function createThreadsNamespace(rb) {
|
|
|
28918
30342
|
options
|
|
28919
30343
|
);
|
|
28920
30344
|
},
|
|
30345
|
+
/**
|
|
30346
|
+
* Inserts a pre-generated message into a thread WITHOUT triggering AI inference.
|
|
30347
|
+
*
|
|
30348
|
+
* Use this to persist results from specialized agent executions (via
|
|
30349
|
+
* `sdk.agents.executions.start()`) back into a thread. The message is stored
|
|
30350
|
+
* with PII compliance scan and async vectorization, but no LLM call is made.
|
|
30351
|
+
*
|
|
30352
|
+
* @param threadId - The UUID of the thread to insert the message into.
|
|
30353
|
+
* @param content - The message content text.
|
|
30354
|
+
* @param attributes - Message attributes including `role` (typically `'assistant'`).
|
|
30355
|
+
* @param options - Optional request options.
|
|
30356
|
+
* @returns A promise resolving to the created `Message`.
|
|
30357
|
+
*
|
|
30358
|
+
* @example
|
|
30359
|
+
* ```typescript
|
|
30360
|
+
* const message = await client.threads.messages.insert(threadId, result.content, {
|
|
30361
|
+
* role: 'assistant',
|
|
30362
|
+
* metadata: { execution_id: execution.id, agent_id: agentId },
|
|
30363
|
+
* });
|
|
30364
|
+
* ```
|
|
30365
|
+
*/
|
|
30366
|
+
insert: async (threadId, content, attributes, options) => {
|
|
30367
|
+
return rb.execute(
|
|
30368
|
+
postMessages,
|
|
30369
|
+
{
|
|
30370
|
+
body: {
|
|
30371
|
+
data: {
|
|
30372
|
+
type: "chat-message",
|
|
30373
|
+
attributes: {
|
|
30374
|
+
...attributes,
|
|
30375
|
+
content,
|
|
30376
|
+
thread_id: threadId
|
|
30377
|
+
}
|
|
30378
|
+
}
|
|
30379
|
+
}
|
|
30380
|
+
},
|
|
30381
|
+
options
|
|
30382
|
+
);
|
|
30383
|
+
},
|
|
30384
|
+
/**
|
|
30385
|
+
* Submit thumbs up/down feedback on a message. Uses upsert — calling again
|
|
30386
|
+
* on the same message replaces the previous rating.
|
|
30387
|
+
*
|
|
30388
|
+
* @param messageId - The UUID of the message to rate.
|
|
30389
|
+
* @param rating - `'up'` or `'down'`.
|
|
30390
|
+
* @param comment - Optional comment explaining the rating.
|
|
30391
|
+
* @param options - Optional request options.
|
|
30392
|
+
* @returns A promise resolving to the created/updated `MessageFeedback`.
|
|
30393
|
+
*
|
|
30394
|
+
* @example
|
|
30395
|
+
* ```typescript
|
|
30396
|
+
* await client.threads.messages.rate(messageId, 'up');
|
|
30397
|
+
* await client.threads.messages.rate(messageId, 'down', 'Response was inaccurate');
|
|
30398
|
+
* ```
|
|
30399
|
+
*/
|
|
30400
|
+
rate: async (messageId, rating, comment, options) => {
|
|
30401
|
+
return rb.execute(
|
|
30402
|
+
postMessageFeedback,
|
|
30403
|
+
{
|
|
30404
|
+
body: {
|
|
30405
|
+
data: {
|
|
30406
|
+
type: "chat-message-feedback",
|
|
30407
|
+
attributes: {
|
|
30408
|
+
message_id: messageId,
|
|
30409
|
+
rating,
|
|
30410
|
+
...comment != null ? { comment } : {}
|
|
30411
|
+
}
|
|
30412
|
+
}
|
|
30413
|
+
}
|
|
30414
|
+
},
|
|
30415
|
+
options
|
|
30416
|
+
);
|
|
30417
|
+
},
|
|
30418
|
+
/**
|
|
30419
|
+
* Update an existing message's content, role, or metadata (PATCH semantics).
|
|
30420
|
+
*
|
|
30421
|
+
* Only the fields present in `attributes` are changed. Useful for attaching
|
|
30422
|
+
* metadata (e.g., execution_id, tool_call details) to a message after creation.
|
|
30423
|
+
*
|
|
30424
|
+
* @param messageId - The UUID of the message to update.
|
|
30425
|
+
* @param attributes - Fields to update.
|
|
30426
|
+
* @param options - Optional request options.
|
|
30427
|
+
* @returns A promise resolving to the updated `Message`.
|
|
30428
|
+
*
|
|
30429
|
+
* @example
|
|
30430
|
+
* ```typescript
|
|
30431
|
+
* await client.threads.messages.update(messageId, {
|
|
30432
|
+
* metadata: { execution_id: 'exec_123', reviewed: true },
|
|
30433
|
+
* });
|
|
30434
|
+
* ```
|
|
30435
|
+
*/
|
|
30436
|
+
update: async (messageId, attributes, options) => {
|
|
30437
|
+
return rb.execute(
|
|
30438
|
+
patchMessagesById,
|
|
30439
|
+
{
|
|
30440
|
+
path: { id: messageId },
|
|
30441
|
+
body: {
|
|
30442
|
+
data: {
|
|
30443
|
+
id: messageId,
|
|
30444
|
+
type: "chat-message",
|
|
30445
|
+
attributes
|
|
30446
|
+
}
|
|
30447
|
+
}
|
|
30448
|
+
},
|
|
30449
|
+
options
|
|
30450
|
+
);
|
|
30451
|
+
},
|
|
28921
30452
|
/**
|
|
28922
30453
|
* Sends a message to a thread and streams the AI response via Server-Sent Events (SSE).
|
|
28923
30454
|
*
|
|
@@ -28982,41 +30513,51 @@ function createThreadsNamespace(rb) {
|
|
|
28982
30513
|
},
|
|
28983
30514
|
/**
|
|
28984
30515
|
* Full-text substring search across message content.
|
|
30516
|
+
* Optionally filter to a specific thread.
|
|
28985
30517
|
*
|
|
28986
30518
|
* @param query - Substring to match against message content.
|
|
30519
|
+
* @param threadId - Optional thread UUID to scope the search.
|
|
28987
30520
|
* @param options - Optional request options.
|
|
28988
30521
|
* @returns A promise resolving to an array of matching `Message` objects.
|
|
28989
30522
|
*
|
|
28990
30523
|
* @example
|
|
28991
|
-
*
|
|
28992
|
-
*
|
|
30524
|
+
* ```typescript
|
|
30525
|
+
* // Search all messages
|
|
30526
|
+
* const all = await client.threads.messages.search('deadline');
|
|
30527
|
+
* // Search within a specific thread
|
|
30528
|
+
* const scoped = await client.threads.messages.search('deadline', threadId);
|
|
30529
|
+
* ```
|
|
28993
30530
|
*/
|
|
28994
|
-
search: async (query, options) => {
|
|
30531
|
+
search: async (query, threadId, options) => {
|
|
30532
|
+
const filter = { query };
|
|
30533
|
+
if (threadId) filter.thread_id = threadId;
|
|
28995
30534
|
return rb.execute(
|
|
28996
30535
|
getMessagesSearch,
|
|
28997
|
-
{ query: { filter
|
|
30536
|
+
{ query: { filter } },
|
|
28998
30537
|
options
|
|
28999
30538
|
);
|
|
29000
30539
|
},
|
|
29001
30540
|
/**
|
|
29002
30541
|
* 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.
|
|
30542
|
+
* Optionally filter to a specific thread.
|
|
29006
30543
|
*
|
|
29007
30544
|
* @param query - Natural-language query string to embed and search.
|
|
29008
30545
|
* @param limit - Maximum number of results (default: 10).
|
|
30546
|
+
* @param threadId - Optional thread UUID to scope the search.
|
|
29009
30547
|
* @param options - Optional request options.
|
|
29010
30548
|
* @returns A promise resolving to an array of semantically similar `Message` objects.
|
|
29011
30549
|
*
|
|
29012
30550
|
* @example
|
|
29013
|
-
*
|
|
29014
|
-
* const results = await client.threads.messages.semanticSearch('unpaid invoices', 5);
|
|
30551
|
+
* ```typescript
|
|
30552
|
+
* const results = await client.threads.messages.semanticSearch('unpaid invoices', 5, threadId);
|
|
30553
|
+
* ```
|
|
29015
30554
|
*/
|
|
29016
|
-
semanticSearch: async (query, limit = 10, options) => {
|
|
30555
|
+
semanticSearch: async (query, limit = 10, threadId, options) => {
|
|
30556
|
+
const filter = { query, limit };
|
|
30557
|
+
if (threadId) filter.thread_id = threadId;
|
|
29017
30558
|
return rb.execute(
|
|
29018
30559
|
getMessagesSemanticSearch,
|
|
29019
|
-
{ query: { filter
|
|
30560
|
+
{ query: { filter } },
|
|
29020
30561
|
options
|
|
29021
30562
|
);
|
|
29022
30563
|
}
|
|
@@ -29259,7 +30800,7 @@ function createTrainingNamespace(rb) {
|
|
|
29259
30800
|
create: async (attributes, options) => {
|
|
29260
30801
|
return rb.execute(
|
|
29261
30802
|
postTrainingExamplesBulkDelete,
|
|
29262
|
-
{ body: { data: { type: "
|
|
30803
|
+
{ body: { data: { type: "training-example", attributes } } },
|
|
29263
30804
|
options
|
|
29264
30805
|
);
|
|
29265
30806
|
},
|
|
@@ -29289,7 +30830,7 @@ function createTrainingNamespace(rb) {
|
|
|
29289
30830
|
patchTrainingExamplesById,
|
|
29290
30831
|
{
|
|
29291
30832
|
path: { id },
|
|
29292
|
-
body: { data: { id, type: "
|
|
30833
|
+
body: { data: { id, type: "training-example", attributes } }
|
|
29293
30834
|
},
|
|
29294
30835
|
options
|
|
29295
30836
|
);
|
|
@@ -29470,7 +31011,7 @@ function createTrainingNamespace(rb) {
|
|
|
29470
31011
|
create: async (attributes, options) => {
|
|
29471
31012
|
return rb.execute(
|
|
29472
31013
|
getTrainingSessionsAgentsByAgentIdSessions,
|
|
29473
|
-
{ body: { data: { type: "
|
|
31014
|
+
{ body: { data: { type: "training-session", attributes } } },
|
|
29474
31015
|
options
|
|
29475
31016
|
);
|
|
29476
31017
|
},
|
|
@@ -29520,7 +31061,7 @@ function createTrainingNamespace(rb) {
|
|
|
29520
31061
|
getTrainingSessionsAgentsByAgentIdSessions,
|
|
29521
31062
|
{
|
|
29522
31063
|
path: { agent_id: agentId },
|
|
29523
|
-
body: { data: { type: "
|
|
31064
|
+
body: { data: { type: "training-session", attributes } }
|
|
29524
31065
|
},
|
|
29525
31066
|
options
|
|
29526
31067
|
);
|
|
@@ -29581,6 +31122,11 @@ function createVoiceNamespace(rb) {
|
|
|
29581
31122
|
if (params?.modelSize) form.append("model_size", params.modelSize);
|
|
29582
31123
|
if (params?.phiMode) form.append("phi_mode", params.phiMode);
|
|
29583
31124
|
if (params?.phiKey) form.append("phi_key", params.phiKey);
|
|
31125
|
+
if (params?.enableDiarization) form.append("enable_diarization", "true");
|
|
31126
|
+
if (params?.numSpeakers != null)
|
|
31127
|
+
form.append("num_speakers", String(params.numSpeakers));
|
|
31128
|
+
if (params?.initialPrompt)
|
|
31129
|
+
form.append("initial_prompt", params.initialPrompt);
|
|
29584
31130
|
return rb.rawPostMultipart(
|
|
29585
31131
|
"/voice/transcribe",
|
|
29586
31132
|
form,
|
|
@@ -29618,9 +31164,18 @@ function createVoiceNamespace(rb) {
|
|
|
29618
31164
|
* ```
|
|
29619
31165
|
*/
|
|
29620
31166
|
list: async (options) => {
|
|
31167
|
+
const filters = {};
|
|
31168
|
+
if (options?.status) filters["filter[status]"] = options.status;
|
|
31169
|
+
if (options?.insertedAfter)
|
|
31170
|
+
filters["filter[inserted_after]"] = options.insertedAfter;
|
|
31171
|
+
if (options?.insertedBefore)
|
|
31172
|
+
filters["filter[inserted_before]"] = options.insertedBefore;
|
|
29621
31173
|
return rb.execute(
|
|
29622
31174
|
getVoiceSessions,
|
|
29623
|
-
|
|
31175
|
+
{
|
|
31176
|
+
...buildPageQuery(options?.page, options?.pageSize),
|
|
31177
|
+
query: filters
|
|
31178
|
+
},
|
|
29624
31179
|
options
|
|
29625
31180
|
);
|
|
29626
31181
|
},
|
|
@@ -29744,7 +31299,7 @@ function createVoiceNamespace(rb) {
|
|
|
29744
31299
|
{
|
|
29745
31300
|
body: {
|
|
29746
31301
|
data: {
|
|
29747
|
-
type: "
|
|
31302
|
+
type: "voice-session",
|
|
29748
31303
|
attributes: {
|
|
29749
31304
|
thread_id: params?.threadId,
|
|
29750
31305
|
blueprint_id: params?.blueprintId,
|
|
@@ -29785,7 +31340,7 @@ function createVoiceNamespace(rb) {
|
|
|
29785
31340
|
stop: async (id, options) => {
|
|
29786
31341
|
return rb.execute(
|
|
29787
31342
|
patchVoiceSessionsByIdStop,
|
|
29788
|
-
{ path: { id }, body: { data: { id, type: "
|
|
31343
|
+
{ path: { id }, body: { data: { id, type: "voice-session" } } },
|
|
29789
31344
|
options
|
|
29790
31345
|
);
|
|
29791
31346
|
},
|
|
@@ -29839,7 +31394,7 @@ function createVoiceNamespace(rb) {
|
|
|
29839
31394
|
body: {
|
|
29840
31395
|
data: {
|
|
29841
31396
|
id,
|
|
29842
|
-
type: "
|
|
31397
|
+
type: "voice-session",
|
|
29843
31398
|
attributes: {
|
|
29844
31399
|
blueprint_id: params?.blueprintId,
|
|
29845
31400
|
phi_mode: params?.phiMode,
|
|
@@ -30031,7 +31586,7 @@ function createVoiceNamespace(rb) {
|
|
|
30031
31586
|
{
|
|
30032
31587
|
body: {
|
|
30033
31588
|
data: {
|
|
30034
|
-
type: "
|
|
31589
|
+
type: "voice-transcription-result",
|
|
30035
31590
|
attributes
|
|
30036
31591
|
}
|
|
30037
31592
|
}
|
|
@@ -30068,7 +31623,7 @@ function createVoiceNamespace(rb) {
|
|
|
30068
31623
|
body: {
|
|
30069
31624
|
data: {
|
|
30070
31625
|
id,
|
|
30071
|
-
type: "
|
|
31626
|
+
type: "voice-transcription-result",
|
|
30072
31627
|
attributes
|
|
30073
31628
|
}
|
|
30074
31629
|
}
|
|
@@ -30099,6 +31654,197 @@ function createVoiceNamespace(rb) {
|
|
|
30099
31654
|
options
|
|
30100
31655
|
);
|
|
30101
31656
|
}
|
|
31657
|
+
},
|
|
31658
|
+
/**
|
|
31659
|
+
* Transcription jobs — progressive chunked transcription for long recordings.
|
|
31660
|
+
*
|
|
31661
|
+
* Designed for clinical recording sessions (30–60 minutes). The browser records
|
|
31662
|
+
* audio and uploads chunks every 2–3 minutes. Each chunk is transcribed
|
|
31663
|
+
* synchronously on upload. On finalize, chunks are assembled into a complete
|
|
31664
|
+
* diarized transcript.
|
|
31665
|
+
*
|
|
31666
|
+
* Typical flow:
|
|
31667
|
+
* 1. `create()` — start a new transcription job with config (language, diarization, etc.)
|
|
31668
|
+
* 2. `uploadChunk(jobId, audioBlob)` — upload each chunk as it's recorded
|
|
31669
|
+
* 3. `finalize(jobId)` — assemble all chunks and optionally trigger pipeline
|
|
31670
|
+
*
|
|
31671
|
+
* Subscribe to the `voice:{workspace_id}` WebSocket channel for real-time
|
|
31672
|
+
* progress events: `transcription:chunk_completed`, `transcription:job_completed`.
|
|
31673
|
+
*
|
|
31674
|
+
* @example
|
|
31675
|
+
* ```typescript
|
|
31676
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
31677
|
+
*
|
|
31678
|
+
* // Create job with medical vocabulary hints
|
|
31679
|
+
* const job = await client.voice.transcriptionJobs.create({
|
|
31680
|
+
* language: 'en',
|
|
31681
|
+
* modelSize: 'large',
|
|
31682
|
+
* enableDiarization: true,
|
|
31683
|
+
* numSpeakers: 2,
|
|
31684
|
+
* initialPrompt: 'albumin, HbA1c, Metformin, MCT oil, prealbumin',
|
|
31685
|
+
* });
|
|
31686
|
+
*
|
|
31687
|
+
* // Upload chunks as they're recorded (MediaRecorder ondataavailable)
|
|
31688
|
+
* mediaRecorder.ondataavailable = async (event) => {
|
|
31689
|
+
* if (event.data.size > 0) {
|
|
31690
|
+
* const result = await client.voice.transcriptionJobs.uploadChunk(
|
|
31691
|
+
* job.id!, event.data
|
|
31692
|
+
* );
|
|
31693
|
+
* console.log(`Chunk ${result.chunk_index}: ${result.text}`);
|
|
31694
|
+
* }
|
|
31695
|
+
* };
|
|
31696
|
+
*
|
|
31697
|
+
* // Finalize after recording stops
|
|
31698
|
+
* const transcript = await client.voice.transcriptionJobs.finalize(job.id!, {
|
|
31699
|
+
* blueprintId: 'bp_clinical_notes',
|
|
31700
|
+
* patientId: 'contact_abc123',
|
|
31701
|
+
* });
|
|
31702
|
+
* console.log(transcript.assembled_text);
|
|
31703
|
+
* ```
|
|
31704
|
+
*/
|
|
31705
|
+
transcriptionJobs: {
|
|
31706
|
+
/**
|
|
31707
|
+
* Create a new transcription job.
|
|
31708
|
+
*
|
|
31709
|
+
* @param params - Job configuration (language, model, diarization, vocabulary hints).
|
|
31710
|
+
* @param options - Optional request options.
|
|
31711
|
+
* @returns The created TranscriptionJob resource (JSON:API format).
|
|
31712
|
+
*/
|
|
31713
|
+
create: async (params, options) => {
|
|
31714
|
+
return rb.execute(
|
|
31715
|
+
postVoiceTranscriptionJobs,
|
|
31716
|
+
{
|
|
31717
|
+
body: {
|
|
31718
|
+
data: {
|
|
31719
|
+
type: "transcription-job",
|
|
31720
|
+
attributes: {
|
|
31721
|
+
language: params?.language,
|
|
31722
|
+
model_size: params?.modelSize,
|
|
31723
|
+
enable_diarization: params?.enableDiarization,
|
|
31724
|
+
num_speakers: params?.numSpeakers,
|
|
31725
|
+
initial_prompt: params?.initialPrompt,
|
|
31726
|
+
phi_mode: params?.phiMode,
|
|
31727
|
+
metadata: params?.metadata
|
|
31728
|
+
}
|
|
31729
|
+
}
|
|
31730
|
+
}
|
|
31731
|
+
},
|
|
31732
|
+
options
|
|
31733
|
+
);
|
|
31734
|
+
},
|
|
31735
|
+
/**
|
|
31736
|
+
* Get a transcription job by ID.
|
|
31737
|
+
*
|
|
31738
|
+
* @param id - The UUID of the transcription job.
|
|
31739
|
+
* @param options - Optional request options.
|
|
31740
|
+
* @returns The TranscriptionJob resource.
|
|
31741
|
+
*/
|
|
31742
|
+
get: async (id, options) => {
|
|
31743
|
+
return rb.execute(
|
|
31744
|
+
getVoiceTranscriptionJobsById,
|
|
31745
|
+
{ path: { id } },
|
|
31746
|
+
options
|
|
31747
|
+
);
|
|
31748
|
+
},
|
|
31749
|
+
/**
|
|
31750
|
+
* List transcription jobs for the current user.
|
|
31751
|
+
*
|
|
31752
|
+
* @param options - Optional pagination and request options.
|
|
31753
|
+
* @returns Array of TranscriptionJob resources.
|
|
31754
|
+
*/
|
|
31755
|
+
listMine: async (options) => {
|
|
31756
|
+
return rb.execute(
|
|
31757
|
+
getVoiceTranscriptionJobsMine,
|
|
31758
|
+
buildPageQuery(options?.page, options?.pageSize),
|
|
31759
|
+
options
|
|
31760
|
+
);
|
|
31761
|
+
},
|
|
31762
|
+
/**
|
|
31763
|
+
* List all transcription jobs accessible to the current actor.
|
|
31764
|
+
*
|
|
31765
|
+
* @param options - Optional pagination and request options.
|
|
31766
|
+
* @returns Array of TranscriptionJob resources.
|
|
31767
|
+
*/
|
|
31768
|
+
list: async (options) => {
|
|
31769
|
+
return rb.execute(
|
|
31770
|
+
getVoiceTranscriptionJobs,
|
|
31771
|
+
buildPageQuery(options?.page, options?.pageSize),
|
|
31772
|
+
options
|
|
31773
|
+
);
|
|
31774
|
+
},
|
|
31775
|
+
/**
|
|
31776
|
+
* List transcription jobs for a specific workspace.
|
|
31777
|
+
*
|
|
31778
|
+
* @param workspaceId - The UUID of the workspace.
|
|
31779
|
+
* @param options - Optional pagination and request options.
|
|
31780
|
+
* @returns Array of TranscriptionJob resources.
|
|
31781
|
+
*/
|
|
31782
|
+
listByWorkspace: async (workspaceId, options) => {
|
|
31783
|
+
return rb.execute(
|
|
31784
|
+
getVoiceTranscriptionJobsWorkspaceByWorkspaceId,
|
|
31785
|
+
{
|
|
31786
|
+
path: { workspace_id: workspaceId },
|
|
31787
|
+
...buildPageQuery(options?.page, options?.pageSize)
|
|
31788
|
+
},
|
|
31789
|
+
options
|
|
31790
|
+
);
|
|
31791
|
+
},
|
|
31792
|
+
/**
|
|
31793
|
+
* Upload and transcribe an audio chunk.
|
|
31794
|
+
*
|
|
31795
|
+
* The chunk is transcribed synchronously. For 2–3 minute chunks, expect
|
|
31796
|
+
* 10–20 seconds of processing time. The response includes the chunk's
|
|
31797
|
+
* transcript and segments (with speaker_id if diarization is enabled).
|
|
31798
|
+
*
|
|
31799
|
+
* @param jobId - The UUID of the transcription job.
|
|
31800
|
+
* @param audio - The audio chunk (File or Blob). Max 50 MB.
|
|
31801
|
+
* @param options - Optional request options.
|
|
31802
|
+
* @returns Chunk transcription result with text, segments, and timing.
|
|
31803
|
+
*/
|
|
31804
|
+
uploadChunk: async (jobId, audio, options) => {
|
|
31805
|
+
const form = new FormData();
|
|
31806
|
+
form.append("audio", audio);
|
|
31807
|
+
return rb.rawPostMultipart(
|
|
31808
|
+
`/voice/transcription-jobs/${jobId}/chunks`,
|
|
31809
|
+
form,
|
|
31810
|
+
options
|
|
31811
|
+
);
|
|
31812
|
+
},
|
|
31813
|
+
/**
|
|
31814
|
+
* Finalize a transcription job — assemble chunks into a complete transcript.
|
|
31815
|
+
*
|
|
31816
|
+
* Joins all chunk transcripts in order, offsets segment timestamps, and
|
|
31817
|
+
* reconciles speaker IDs across chunks. Optionally triggers a blueprint
|
|
31818
|
+
* pipeline (e.g., SOAP note generation) on the assembled transcript.
|
|
31819
|
+
*
|
|
31820
|
+
* @param jobId - The UUID of the transcription job to finalize.
|
|
31821
|
+
* @param params - Optional pipeline trigger parameters.
|
|
31822
|
+
* @param options - Optional request options.
|
|
31823
|
+
* @returns The assembled transcript with full text, segments, and timing.
|
|
31824
|
+
*/
|
|
31825
|
+
finalize: async (jobId, params, options) => {
|
|
31826
|
+
const body = {};
|
|
31827
|
+
if (params?.blueprintId) body.blueprint_id = params.blueprintId;
|
|
31828
|
+
if (params?.patientId) body.patient_id = params.patientId;
|
|
31829
|
+
return rb.rawPost(
|
|
31830
|
+
`/voice/transcription-jobs/${jobId}/finalize`,
|
|
31831
|
+
body,
|
|
31832
|
+
options
|
|
31833
|
+
);
|
|
31834
|
+
},
|
|
31835
|
+
/**
|
|
31836
|
+
* Delete a transcription job.
|
|
31837
|
+
*
|
|
31838
|
+
* @param id - The UUID of the transcription job to delete.
|
|
31839
|
+
* @param options - Optional request options.
|
|
31840
|
+
*/
|
|
31841
|
+
destroy: async (id, options) => {
|
|
31842
|
+
await rb.executeDelete(
|
|
31843
|
+
deleteVoiceTranscriptionJobsById,
|
|
31844
|
+
{ path: { id } },
|
|
31845
|
+
options
|
|
31846
|
+
);
|
|
31847
|
+
}
|
|
30102
31848
|
}
|
|
30103
31849
|
};
|
|
30104
31850
|
}
|
|
@@ -30670,7 +32416,7 @@ function createWatcherNamespace(rb) {
|
|
|
30670
32416
|
create: async (attributes, options) => {
|
|
30671
32417
|
return rb.execute(
|
|
30672
32418
|
postWatcherClaims,
|
|
30673
|
-
{ body: { data: { type: "
|
|
32419
|
+
{ body: { data: { type: "watcher-claim", attributes } } },
|
|
30674
32420
|
options
|
|
30675
32421
|
);
|
|
30676
32422
|
},
|
|
@@ -30702,7 +32448,7 @@ function createWatcherNamespace(rb) {
|
|
|
30702
32448
|
patchWatcherClaimsById,
|
|
30703
32449
|
{
|
|
30704
32450
|
path: { id },
|
|
30705
|
-
body: { data: { id, type: "
|
|
32451
|
+
body: { data: { id, type: "watcher-claim", attributes } }
|
|
30706
32452
|
},
|
|
30707
32453
|
options
|
|
30708
32454
|
);
|
|
@@ -30857,7 +32603,7 @@ function createWatcherNamespace(rb) {
|
|
|
30857
32603
|
create: async (attributes, options) => {
|
|
30858
32604
|
return rb.execute(
|
|
30859
32605
|
postWatcherEvents,
|
|
30860
|
-
{ body: { data: { type: "
|
|
32606
|
+
{ body: { data: { type: "watcher-event", attributes } } },
|
|
30861
32607
|
options
|
|
30862
32608
|
);
|
|
30863
32609
|
},
|
|
@@ -31021,7 +32767,7 @@ function createSocialNamespace(rb) {
|
|
|
31021
32767
|
postSocialAccounts,
|
|
31022
32768
|
{
|
|
31023
32769
|
body: {
|
|
31024
|
-
data: { type: "
|
|
32770
|
+
data: { type: "social-account", attributes }
|
|
31025
32771
|
}
|
|
31026
32772
|
},
|
|
31027
32773
|
options
|
|
@@ -31034,7 +32780,7 @@ function createSocialNamespace(rb) {
|
|
|
31034
32780
|
{
|
|
31035
32781
|
path: { id },
|
|
31036
32782
|
body: {
|
|
31037
|
-
data: { type: "
|
|
32783
|
+
data: { type: "social-account", id, attributes }
|
|
31038
32784
|
}
|
|
31039
32785
|
},
|
|
31040
32786
|
options
|
|
@@ -31051,7 +32797,7 @@ function createSocialNamespace(rb) {
|
|
|
31051
32797
|
{
|
|
31052
32798
|
path: { id },
|
|
31053
32799
|
body: {
|
|
31054
|
-
data: { type: "
|
|
32800
|
+
data: { type: "social-account", id, attributes: {} }
|
|
31055
32801
|
}
|
|
31056
32802
|
},
|
|
31057
32803
|
options
|
|
@@ -31064,7 +32810,7 @@ function createSocialNamespace(rb) {
|
|
|
31064
32810
|
{
|
|
31065
32811
|
path: { id },
|
|
31066
32812
|
body: {
|
|
31067
|
-
data: { type: "
|
|
32813
|
+
data: { type: "social-account", id, attributes: {} }
|
|
31068
32814
|
}
|
|
31069
32815
|
},
|
|
31070
32816
|
options
|
|
@@ -31077,7 +32823,7 @@ function createSocialNamespace(rb) {
|
|
|
31077
32823
|
{
|
|
31078
32824
|
path: { id },
|
|
31079
32825
|
body: {
|
|
31080
|
-
data: { type: "
|
|
32826
|
+
data: { type: "social-account", id, attributes: {} }
|
|
31081
32827
|
}
|
|
31082
32828
|
},
|
|
31083
32829
|
options
|
|
@@ -31092,7 +32838,7 @@ function createSocialNamespace(rb) {
|
|
|
31092
32838
|
postSocialPosts,
|
|
31093
32839
|
{
|
|
31094
32840
|
body: {
|
|
31095
|
-
data: { type: "
|
|
32841
|
+
data: { type: "social-post", attributes }
|
|
31096
32842
|
}
|
|
31097
32843
|
},
|
|
31098
32844
|
options
|
|
@@ -31109,7 +32855,7 @@ function createSocialNamespace(rb) {
|
|
|
31109
32855
|
{
|
|
31110
32856
|
path: { id },
|
|
31111
32857
|
body: {
|
|
31112
|
-
data: { type: "
|
|
32858
|
+
data: { type: "social-post", id, attributes }
|
|
31113
32859
|
}
|
|
31114
32860
|
},
|
|
31115
32861
|
options
|
|
@@ -31127,7 +32873,7 @@ function createSocialNamespace(rb) {
|
|
|
31127
32873
|
path: { id },
|
|
31128
32874
|
body: {
|
|
31129
32875
|
data: {
|
|
31130
|
-
type: "
|
|
32876
|
+
type: "social-post",
|
|
31131
32877
|
id,
|
|
31132
32878
|
attributes: { scheduled_at: scheduledAt }
|
|
31133
32879
|
}
|
|
@@ -31143,7 +32889,7 @@ function createSocialNamespace(rb) {
|
|
|
31143
32889
|
{
|
|
31144
32890
|
path: { id },
|
|
31145
32891
|
body: {
|
|
31146
|
-
data: { type: "
|
|
32892
|
+
data: { type: "social-post", id, attributes: {} }
|
|
31147
32893
|
}
|
|
31148
32894
|
},
|
|
31149
32895
|
options
|
|
@@ -31156,7 +32902,7 @@ function createSocialNamespace(rb) {
|
|
|
31156
32902
|
{
|
|
31157
32903
|
path: { id },
|
|
31158
32904
|
body: {
|
|
31159
|
-
data: { type: "
|
|
32905
|
+
data: { type: "social-post", id, attributes: {} }
|
|
31160
32906
|
}
|
|
31161
32907
|
},
|
|
31162
32908
|
options
|
|
@@ -31169,7 +32915,7 @@ function createSocialNamespace(rb) {
|
|
|
31169
32915
|
{
|
|
31170
32916
|
path: { id },
|
|
31171
32917
|
body: {
|
|
31172
|
-
data: { type: "
|
|
32918
|
+
data: { type: "social-post", id, attributes: {} }
|
|
31173
32919
|
}
|
|
31174
32920
|
},
|
|
31175
32921
|
options
|
|
@@ -31182,7 +32928,7 @@ function createSocialNamespace(rb) {
|
|
|
31182
32928
|
{
|
|
31183
32929
|
path: { id },
|
|
31184
32930
|
body: {
|
|
31185
|
-
data: { type: "
|
|
32931
|
+
data: { type: "social-post", id, attributes }
|
|
31186
32932
|
}
|
|
31187
32933
|
},
|
|
31188
32934
|
options
|
|
@@ -31272,7 +33018,7 @@ function createSocialNamespace(rb) {
|
|
|
31272
33018
|
postSocialCampaigns,
|
|
31273
33019
|
{
|
|
31274
33020
|
body: {
|
|
31275
|
-
data: { type: "
|
|
33021
|
+
data: { type: "social-campaign", attributes }
|
|
31276
33022
|
}
|
|
31277
33023
|
},
|
|
31278
33024
|
options
|
|
@@ -31285,7 +33031,7 @@ function createSocialNamespace(rb) {
|
|
|
31285
33031
|
{
|
|
31286
33032
|
path: { id },
|
|
31287
33033
|
body: {
|
|
31288
|
-
data: { type: "
|
|
33034
|
+
data: { type: "social-campaign", id, attributes }
|
|
31289
33035
|
}
|
|
31290
33036
|
},
|
|
31291
33037
|
options
|
|
@@ -31303,7 +33049,7 @@ function createSocialNamespace(rb) {
|
|
|
31303
33049
|
path: { id },
|
|
31304
33050
|
body: {
|
|
31305
33051
|
data: {
|
|
31306
|
-
type: "
|
|
33052
|
+
type: "social-campaign",
|
|
31307
33053
|
id,
|
|
31308
33054
|
attributes: { scheduled_at: scheduledAt }
|
|
31309
33055
|
}
|
|
@@ -31319,7 +33065,7 @@ function createSocialNamespace(rb) {
|
|
|
31319
33065
|
{
|
|
31320
33066
|
path: { id },
|
|
31321
33067
|
body: {
|
|
31322
|
-
data: { type: "
|
|
33068
|
+
data: { type: "social-campaign", id, attributes: {} }
|
|
31323
33069
|
}
|
|
31324
33070
|
},
|
|
31325
33071
|
options
|
|
@@ -31333,8 +33079,11 @@ function createSocialNamespace(rb) {
|
|
|
31333
33079
|
path: { id },
|
|
31334
33080
|
body: {
|
|
31335
33081
|
data: {
|
|
31336
|
-
|
|
31337
|
-
|
|
33082
|
+
type: "social-campaign",
|
|
33083
|
+
attributes: {
|
|
33084
|
+
campaign_id: id,
|
|
33085
|
+
workspace_id: workspaceId
|
|
33086
|
+
}
|
|
31338
33087
|
}
|
|
31339
33088
|
}
|
|
31340
33089
|
},
|
|
@@ -31349,9 +33098,12 @@ function createSocialNamespace(rb) {
|
|
|
31349
33098
|
path: { id },
|
|
31350
33099
|
body: {
|
|
31351
33100
|
data: {
|
|
31352
|
-
|
|
31353
|
-
|
|
31354
|
-
|
|
33101
|
+
type: "social-campaign",
|
|
33102
|
+
attributes: {
|
|
33103
|
+
campaign_id: id,
|
|
33104
|
+
workspace_id: workspaceId,
|
|
33105
|
+
social_account_id: socialAccountId
|
|
33106
|
+
}
|
|
31355
33107
|
}
|
|
31356
33108
|
}
|
|
31357
33109
|
},
|
|
@@ -32353,7 +34105,6 @@ var RequestBuilder = class {
|
|
|
32353
34105
|
const result = await this.requestWithRetry(
|
|
32354
34106
|
() => fn({
|
|
32355
34107
|
client: this.clientInstance,
|
|
32356
|
-
throwOnError: true,
|
|
32357
34108
|
headers,
|
|
32358
34109
|
...params,
|
|
32359
34110
|
...options?.signal && { signal: options.signal }
|
|
@@ -32932,6 +34683,7 @@ var Webhooks = class _Webhooks {
|
|
|
32932
34683
|
buildHeaders,
|
|
32933
34684
|
buildUserAgent,
|
|
32934
34685
|
collectStreamedMessage,
|
|
34686
|
+
createChannelsNamespace,
|
|
32935
34687
|
createImportsNamespace,
|
|
32936
34688
|
handleApiError,
|
|
32937
34689
|
isBrowserEnvironment,
|