@gpt-platform/client 0.8.0 → 0.8.2
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 +634 -13
- package/dist/index.d.ts +634 -13
- package/dist/index.js +623 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +623 -21
- package/dist/index.mjs.map +1 -1
- package/llms.txt +49 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1269,7 +1269,7 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1269
1269
|
}
|
|
1270
1270
|
|
|
1271
1271
|
// src/version.ts
|
|
1272
|
-
var SDK_VERSION = "0.8.
|
|
1272
|
+
var SDK_VERSION = "0.8.2";
|
|
1273
1273
|
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1274
1274
|
|
|
1275
1275
|
// src/base-client.ts
|
|
@@ -2494,11 +2494,6 @@ var postConnectorsCredentialsByIdRefresh = (options) => (options.client ?? clien
|
|
|
2494
2494
|
...options.headers
|
|
2495
2495
|
}
|
|
2496
2496
|
});
|
|
2497
|
-
var deleteClinicalSupplementRecCacheById = (options) => (options.client ?? client).delete({
|
|
2498
|
-
security: [{ scheme: "bearer", type: "http" }],
|
|
2499
|
-
url: "/clinical/supplement-rec-cache/{id}",
|
|
2500
|
-
...options
|
|
2501
|
-
});
|
|
2502
2497
|
var getClinicalSupplementRecCacheById = (options) => (options.client ?? client).get({
|
|
2503
2498
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2504
2499
|
url: "/clinical/supplement-rec-cache/{id}",
|
|
@@ -2615,6 +2610,11 @@ var patchWalletAutoTopUp = (options) => (options.client ?? client).patch({
|
|
|
2615
2610
|
...options.headers
|
|
2616
2611
|
}
|
|
2617
2612
|
});
|
|
2613
|
+
var getClinicalGoalTemplatesCategories = (options) => (options.client ?? client).get({
|
|
2614
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2615
|
+
url: "/clinical/goal-templates/categories",
|
|
2616
|
+
...options
|
|
2617
|
+
});
|
|
2618
2618
|
var postTokens = (options) => (options.client ?? client).post({
|
|
2619
2619
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2620
2620
|
url: "/tokens",
|
|
@@ -3003,6 +3003,11 @@ var patchSocialCampaignsByIdCancel = (options) => (options.client ?? client).pat
|
|
|
3003
3003
|
...options.headers
|
|
3004
3004
|
}
|
|
3005
3005
|
});
|
|
3006
|
+
var getClinicalGoalTemplatesMine = (options) => (options.client ?? client).get({
|
|
3007
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3008
|
+
url: "/clinical/goal-templates/mine",
|
|
3009
|
+
...options
|
|
3010
|
+
});
|
|
3006
3011
|
var patchAmendmentRequestsByIdReview = (options) => (options.client ?? client).patch({
|
|
3007
3012
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3008
3013
|
url: "/amendment-requests/{id}/review",
|
|
@@ -3301,6 +3306,15 @@ var patchCrawlerJobsByIdCancel = (options) => (options.client ?? client).patch({
|
|
|
3301
3306
|
...options.headers
|
|
3302
3307
|
}
|
|
3303
3308
|
});
|
|
3309
|
+
var postContentGenerateHashtags = (options) => (options.client ?? client).post({
|
|
3310
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3311
|
+
url: "/content/generate-hashtags",
|
|
3312
|
+
...options,
|
|
3313
|
+
headers: {
|
|
3314
|
+
"Content-Type": "application/vnd.api+json",
|
|
3315
|
+
...options.headers
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3304
3318
|
var deleteClinicalNotesById = (options) => (options.client ?? client).delete({
|
|
3305
3319
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3306
3320
|
url: "/clinical/notes/{id}",
|
|
@@ -3529,6 +3543,15 @@ var patchEmailInboundAddressesByIdRotateToken = (options) => (options.client ??
|
|
|
3529
3543
|
...options.headers
|
|
3530
3544
|
}
|
|
3531
3545
|
});
|
|
3546
|
+
var postContentSeoEnrich = (options) => (options.client ?? client).post({
|
|
3547
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3548
|
+
url: "/content/seo-enrich",
|
|
3549
|
+
...options,
|
|
3550
|
+
headers: {
|
|
3551
|
+
"Content-Type": "application/vnd.api+json",
|
|
3552
|
+
...options.headers
|
|
3553
|
+
}
|
|
3554
|
+
});
|
|
3532
3555
|
var deleteSchedulingParticipantsById = (options) => (options.client ?? client).delete({
|
|
3533
3556
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3534
3557
|
url: "/scheduling/participants/{id}",
|
|
@@ -4105,6 +4128,15 @@ var postRoles = (options) => (options.client ?? client).post({
|
|
|
4105
4128
|
...options.headers
|
|
4106
4129
|
}
|
|
4107
4130
|
});
|
|
4131
|
+
var postContentGenerateText = (options) => (options.client ?? client).post({
|
|
4132
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4133
|
+
url: "/content/generate-text",
|
|
4134
|
+
...options,
|
|
4135
|
+
headers: {
|
|
4136
|
+
"Content-Type": "application/vnd.api+json",
|
|
4137
|
+
...options.headers
|
|
4138
|
+
}
|
|
4139
|
+
});
|
|
4108
4140
|
var getComplianceRequirementCompletions = (options) => (options.client ?? client).get({
|
|
4109
4141
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4110
4142
|
url: "/compliance-requirement-completions",
|
|
@@ -4236,6 +4268,15 @@ var postSocialPosts = (options) => (options.client ?? client).post({
|
|
|
4236
4268
|
...options.headers
|
|
4237
4269
|
}
|
|
4238
4270
|
});
|
|
4271
|
+
var postContentShorten = (options) => (options.client ?? client).post({
|
|
4272
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4273
|
+
url: "/content/shorten",
|
|
4274
|
+
...options,
|
|
4275
|
+
headers: {
|
|
4276
|
+
"Content-Type": "application/vnd.api+json",
|
|
4277
|
+
...options.headers
|
|
4278
|
+
}
|
|
4279
|
+
});
|
|
4239
4280
|
var deleteClinicalPatientsById = (options) => (options.client ?? client).delete({
|
|
4240
4281
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4241
4282
|
url: "/clinical/patients/{id}",
|
|
@@ -4339,6 +4380,25 @@ var postClinicalClientResourceAssignments = (options) => (options.client ?? clie
|
|
|
4339
4380
|
...options.headers
|
|
4340
4381
|
}
|
|
4341
4382
|
});
|
|
4383
|
+
var deleteClinicalGoalTemplatesById = (options) => (options.client ?? client).delete({
|
|
4384
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4385
|
+
url: "/clinical/goal-templates/{id}",
|
|
4386
|
+
...options
|
|
4387
|
+
});
|
|
4388
|
+
var getClinicalGoalTemplatesById = (options) => (options.client ?? client).get({
|
|
4389
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4390
|
+
url: "/clinical/goal-templates/{id}",
|
|
4391
|
+
...options
|
|
4392
|
+
});
|
|
4393
|
+
var patchClinicalGoalTemplatesById = (options) => (options.client ?? client).patch({
|
|
4394
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4395
|
+
url: "/clinical/goal-templates/{id}",
|
|
4396
|
+
...options,
|
|
4397
|
+
headers: {
|
|
4398
|
+
"Content-Type": "application/vnd.api+json",
|
|
4399
|
+
...options.headers
|
|
4400
|
+
}
|
|
4401
|
+
});
|
|
4342
4402
|
var postUsersRegisterIsv = (options) => (options.client ?? client).post({
|
|
4343
4403
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4344
4404
|
url: "/users/register-isv",
|
|
@@ -4465,6 +4525,11 @@ var patchSocialTrendingWatchesByIdMarkTriggered = (options) => (options.client ?
|
|
|
4465
4525
|
...options.headers
|
|
4466
4526
|
}
|
|
4467
4527
|
});
|
|
4528
|
+
var getClinicalPracticeResourcesCatalog = (options) => (options.client ?? client).get({
|
|
4529
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4530
|
+
url: "/clinical/practice-resources/catalog",
|
|
4531
|
+
...options
|
|
4532
|
+
});
|
|
4468
4533
|
var postAgentsByIdSchemaVersionsByVersionIdActivate = (options) => (options.client ?? client).post({
|
|
4469
4534
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4470
4535
|
url: "/agents/{id}/schema-versions/{version_id}/activate",
|
|
@@ -4532,6 +4597,15 @@ var getUserProfilesMe = (options) => (options.client ?? client).get({
|
|
|
4532
4597
|
url: "/user-profiles/me",
|
|
4533
4598
|
...options
|
|
4534
4599
|
});
|
|
4600
|
+
var postContentSuggestTopics = (options) => (options.client ?? client).post({
|
|
4601
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4602
|
+
url: "/content/suggest-topics",
|
|
4603
|
+
...options,
|
|
4604
|
+
headers: {
|
|
4605
|
+
"Content-Type": "application/vnd.api+json",
|
|
4606
|
+
...options.headers
|
|
4607
|
+
}
|
|
4608
|
+
});
|
|
4535
4609
|
var postDocumentsPresignedUpload = (options) => (options.client ?? client).post({
|
|
4536
4610
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4537
4611
|
url: "/documents/presigned-upload",
|
|
@@ -4893,6 +4967,15 @@ var getAgentsByIdUsage = (options) => (options.client ?? client).get({
|
|
|
4893
4967
|
url: "/agents/{id}/usage",
|
|
4894
4968
|
...options
|
|
4895
4969
|
});
|
|
4970
|
+
var postClinicalGoalTemplatesFromExisting = (options) => (options.client ?? client).post({
|
|
4971
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4972
|
+
url: "/clinical/goal-templates/from-existing",
|
|
4973
|
+
...options,
|
|
4974
|
+
headers: {
|
|
4975
|
+
"Content-Type": "application/vnd.api+json",
|
|
4976
|
+
...options.headers
|
|
4977
|
+
}
|
|
4978
|
+
});
|
|
4896
4979
|
var getAiConversations = (options) => (options.client ?? client).get({
|
|
4897
4980
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4898
4981
|
url: "/ai/conversations",
|
|
@@ -5113,6 +5196,15 @@ var getTransactions = (options) => (options.client ?? client).get({
|
|
|
5113
5196
|
url: "/transactions",
|
|
5114
5197
|
...options
|
|
5115
5198
|
});
|
|
5199
|
+
var postContentGenerateImagePrompt = (options) => (options.client ?? client).post({
|
|
5200
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5201
|
+
url: "/content/generate-image-prompt",
|
|
5202
|
+
...options,
|
|
5203
|
+
headers: {
|
|
5204
|
+
"Content-Type": "application/vnd.api+json",
|
|
5205
|
+
...options.headers
|
|
5206
|
+
}
|
|
5207
|
+
});
|
|
5116
5208
|
var postSocialTrendingHistory = (options) => (options.client ?? client).post({
|
|
5117
5209
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5118
5210
|
url: "/social/trending/history",
|
|
@@ -5317,6 +5409,15 @@ var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ??
|
|
|
5317
5409
|
...options.headers
|
|
5318
5410
|
}
|
|
5319
5411
|
});
|
|
5412
|
+
var postContentRefine = (options) => (options.client ?? client).post({
|
|
5413
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5414
|
+
url: "/content/refine",
|
|
5415
|
+
...options,
|
|
5416
|
+
headers: {
|
|
5417
|
+
"Content-Type": "application/vnd.api+json",
|
|
5418
|
+
...options.headers
|
|
5419
|
+
}
|
|
5420
|
+
});
|
|
5320
5421
|
var getLegalDocumentsByLocale = (options) => (options.client ?? client).get({
|
|
5321
5422
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5322
5423
|
url: "/legal-documents/by-locale",
|
|
@@ -5619,6 +5720,15 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
|
|
|
5619
5720
|
...options.headers
|
|
5620
5721
|
}
|
|
5621
5722
|
});
|
|
5723
|
+
var postContentRewriteTone = (options) => (options.client ?? client).post({
|
|
5724
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5725
|
+
url: "/content/rewrite-tone",
|
|
5726
|
+
...options,
|
|
5727
|
+
headers: {
|
|
5728
|
+
"Content-Type": "application/vnd.api+json",
|
|
5729
|
+
...options.headers
|
|
5730
|
+
}
|
|
5731
|
+
});
|
|
5622
5732
|
var patchStorageFilesByIdSoftDelete = (options) => (options.client ?? client).patch({
|
|
5623
5733
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5624
5734
|
url: "/storage-files/{id}/soft-delete",
|
|
@@ -5647,6 +5757,15 @@ var patchConnectorsById = (options) => (options.client ?? client).patch({
|
|
|
5647
5757
|
...options.headers
|
|
5648
5758
|
}
|
|
5649
5759
|
});
|
|
5760
|
+
var postContentGenerateImage = (options) => (options.client ?? client).post({
|
|
5761
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5762
|
+
url: "/content/generate-image",
|
|
5763
|
+
...options,
|
|
5764
|
+
headers: {
|
|
5765
|
+
"Content-Type": "application/vnd.api+json",
|
|
5766
|
+
...options.headers
|
|
5767
|
+
}
|
|
5768
|
+
});
|
|
5650
5769
|
var patchWalletPlanCancel = (options) => (options.client ?? client).patch({
|
|
5651
5770
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5652
5771
|
url: "/wallet/plan/cancel",
|
|
@@ -5935,6 +6054,15 @@ var postSchedulingEvents = (options) => (options.client ?? client).post({
|
|
|
5935
6054
|
...options.headers
|
|
5936
6055
|
}
|
|
5937
6056
|
});
|
|
6057
|
+
var postContentEditImage = (options) => (options.client ?? client).post({
|
|
6058
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6059
|
+
url: "/content/edit-image",
|
|
6060
|
+
...options,
|
|
6061
|
+
headers: {
|
|
6062
|
+
"Content-Type": "application/vnd.api+json",
|
|
6063
|
+
...options.headers
|
|
6064
|
+
}
|
|
6065
|
+
});
|
|
5938
6066
|
var postEmailRecipients = (options) => (options.client ?? client).post({
|
|
5939
6067
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5940
6068
|
url: "/email/recipients",
|
|
@@ -6136,6 +6264,11 @@ var getSocialTrendingItemsById = (options) => (options.client ?? client).get({
|
|
|
6136
6264
|
url: "/social/trending/items/{id}",
|
|
6137
6265
|
...options
|
|
6138
6266
|
});
|
|
6267
|
+
var getClinicalPracticeToolsCatalog = (options) => (options.client ?? client).get({
|
|
6268
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6269
|
+
url: "/clinical/practice-tools/catalog",
|
|
6270
|
+
...options
|
|
6271
|
+
});
|
|
6139
6272
|
var postUsersAuthResendConfirmation = (options) => (options.client ?? client).post({
|
|
6140
6273
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6141
6274
|
url: "/users/auth/resend-confirmation",
|
|
@@ -6361,6 +6494,20 @@ var getAgentVersionsByIdRevisions = (options) => (options.client ?? client).get(
|
|
|
6361
6494
|
url: "/agent-versions/{id}/revisions",
|
|
6362
6495
|
...options
|
|
6363
6496
|
});
|
|
6497
|
+
var getClinicalGoalTemplates = (options) => (options.client ?? client).get({
|
|
6498
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6499
|
+
url: "/clinical/goal-templates",
|
|
6500
|
+
...options
|
|
6501
|
+
});
|
|
6502
|
+
var postClinicalGoalTemplates = (options) => (options.client ?? client).post({
|
|
6503
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6504
|
+
url: "/clinical/goal-templates",
|
|
6505
|
+
...options,
|
|
6506
|
+
headers: {
|
|
6507
|
+
"Content-Type": "application/vnd.api+json",
|
|
6508
|
+
...options.headers
|
|
6509
|
+
}
|
|
6510
|
+
});
|
|
6364
6511
|
var patchClinicalNotesByIdReject = (options) => (options.client ?? client).patch({
|
|
6365
6512
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6366
6513
|
url: "/clinical/notes/{id}/reject",
|
|
@@ -6711,6 +6858,11 @@ var postEmailInboundAddresses = (options) => (options.client ?? client).post({
|
|
|
6711
6858
|
...options.headers
|
|
6712
6859
|
}
|
|
6713
6860
|
});
|
|
6861
|
+
var getClinicalGoalTemplatesCatalog = (options) => (options.client ?? client).get({
|
|
6862
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6863
|
+
url: "/clinical/goal-templates/catalog",
|
|
6864
|
+
...options
|
|
6865
|
+
});
|
|
6714
6866
|
var deleteExtractionBatchesById = (options) => (options.client ?? client).delete({
|
|
6715
6867
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6716
6868
|
url: "/extraction/batches/{id}",
|
|
@@ -10617,6 +10769,249 @@ function createCatalogNamespace(rb) {
|
|
|
10617
10769
|
};
|
|
10618
10770
|
}
|
|
10619
10771
|
|
|
10772
|
+
// src/namespaces/content.ts
|
|
10773
|
+
function createContentNamespace(rb) {
|
|
10774
|
+
return {
|
|
10775
|
+
/**
|
|
10776
|
+
* Generate text from a prompt, optionally informed by brand identity.
|
|
10777
|
+
* @param attributes - { prompt, workspace_id, brand_identity_id?, task? }
|
|
10778
|
+
* @returns { text: string }
|
|
10779
|
+
* @example
|
|
10780
|
+
* ```typescript
|
|
10781
|
+
* const result = await client.content.generateText({
|
|
10782
|
+
* prompt: "Write about AI analytics",
|
|
10783
|
+
* workspace_id: "ws_abc",
|
|
10784
|
+
* });
|
|
10785
|
+
* ```
|
|
10786
|
+
*/
|
|
10787
|
+
generateText: async (attributes, options) => {
|
|
10788
|
+
return rb.execute(
|
|
10789
|
+
postContentGenerateText,
|
|
10790
|
+
{
|
|
10791
|
+
body: {
|
|
10792
|
+
data: { type: "content-generation", attributes }
|
|
10793
|
+
}
|
|
10794
|
+
},
|
|
10795
|
+
options
|
|
10796
|
+
);
|
|
10797
|
+
},
|
|
10798
|
+
/**
|
|
10799
|
+
* Generate an image from a text prompt via Gemini.
|
|
10800
|
+
* @param attributes - { prompt, workspace_id, style? }
|
|
10801
|
+
* @returns { url: string, provider: string }
|
|
10802
|
+
* @example
|
|
10803
|
+
* ```typescript
|
|
10804
|
+
* const result = await client.content.generateImage({
|
|
10805
|
+
* prompt: "A futuristic city skyline",
|
|
10806
|
+
* workspace_id: "ws_abc",
|
|
10807
|
+
* });
|
|
10808
|
+
* ```
|
|
10809
|
+
*/
|
|
10810
|
+
generateImage: async (attributes, options) => {
|
|
10811
|
+
return rb.execute(
|
|
10812
|
+
postContentGenerateImage,
|
|
10813
|
+
{
|
|
10814
|
+
body: {
|
|
10815
|
+
data: { type: "content-generation", attributes }
|
|
10816
|
+
}
|
|
10817
|
+
},
|
|
10818
|
+
options
|
|
10819
|
+
);
|
|
10820
|
+
},
|
|
10821
|
+
/**
|
|
10822
|
+
* Edit an existing image using natural language instructions.
|
|
10823
|
+
* @param attributes - { image_url, instructions, workspace_id }
|
|
10824
|
+
* @returns { url: string, provider: string }
|
|
10825
|
+
* @example
|
|
10826
|
+
* ```typescript
|
|
10827
|
+
* const result = await client.content.editImage({
|
|
10828
|
+
* image_url: "https://example.com/photo.png",
|
|
10829
|
+
* instructions: "Remove the background",
|
|
10830
|
+
* workspace_id: "ws_abc",
|
|
10831
|
+
* });
|
|
10832
|
+
* ```
|
|
10833
|
+
*/
|
|
10834
|
+
editImage: async (attributes, options) => {
|
|
10835
|
+
return rb.execute(
|
|
10836
|
+
postContentEditImage,
|
|
10837
|
+
{
|
|
10838
|
+
body: {
|
|
10839
|
+
data: { type: "content-generation", attributes }
|
|
10840
|
+
}
|
|
10841
|
+
},
|
|
10842
|
+
options
|
|
10843
|
+
);
|
|
10844
|
+
},
|
|
10845
|
+
/**
|
|
10846
|
+
* Rewrite text in a different tone.
|
|
10847
|
+
* @param attributes - { text, target_tone, workspace_id, max_length? }
|
|
10848
|
+
* @returns { rewritten_text: string }
|
|
10849
|
+
* @example
|
|
10850
|
+
* ```typescript
|
|
10851
|
+
* const result = await client.content.rewriteTone({
|
|
10852
|
+
* text: "We are pleased to announce our new product.",
|
|
10853
|
+
* target_tone: "casual",
|
|
10854
|
+
* workspace_id: "ws_abc",
|
|
10855
|
+
* });
|
|
10856
|
+
* ```
|
|
10857
|
+
*/
|
|
10858
|
+
rewriteTone: async (attributes, options) => {
|
|
10859
|
+
return rb.execute(
|
|
10860
|
+
postContentRewriteTone,
|
|
10861
|
+
{
|
|
10862
|
+
body: {
|
|
10863
|
+
data: { type: "content-generation", attributes }
|
|
10864
|
+
}
|
|
10865
|
+
},
|
|
10866
|
+
options
|
|
10867
|
+
);
|
|
10868
|
+
},
|
|
10869
|
+
/**
|
|
10870
|
+
* Shorten text to a target character count.
|
|
10871
|
+
* @param attributes - { text, max_chars, workspace_id, platform? }
|
|
10872
|
+
* @returns { shortened_text: string }
|
|
10873
|
+
* @example
|
|
10874
|
+
* ```typescript
|
|
10875
|
+
* const result = await client.content.shorten({
|
|
10876
|
+
* text: "This is a long piece of content that needs shortening.",
|
|
10877
|
+
* max_chars: 280,
|
|
10878
|
+
* workspace_id: "ws_abc",
|
|
10879
|
+
* });
|
|
10880
|
+
* ```
|
|
10881
|
+
*/
|
|
10882
|
+
shorten: async (attributes, options) => {
|
|
10883
|
+
return rb.execute(
|
|
10884
|
+
postContentShorten,
|
|
10885
|
+
{
|
|
10886
|
+
body: {
|
|
10887
|
+
data: { type: "content-generation", attributes }
|
|
10888
|
+
}
|
|
10889
|
+
},
|
|
10890
|
+
options
|
|
10891
|
+
);
|
|
10892
|
+
},
|
|
10893
|
+
/**
|
|
10894
|
+
* Refine text based on freeform instructions.
|
|
10895
|
+
* @param attributes - { text, instructions, workspace_id }
|
|
10896
|
+
* @returns { refined_text: string }
|
|
10897
|
+
* @example
|
|
10898
|
+
* ```typescript
|
|
10899
|
+
* const result = await client.content.refine({
|
|
10900
|
+
* text: "Draft blog post content here.",
|
|
10901
|
+
* instructions: "Make it more engaging and add a call to action",
|
|
10902
|
+
* workspace_id: "ws_abc",
|
|
10903
|
+
* });
|
|
10904
|
+
* ```
|
|
10905
|
+
*/
|
|
10906
|
+
refine: async (attributes, options) => {
|
|
10907
|
+
return rb.execute(
|
|
10908
|
+
postContentRefine,
|
|
10909
|
+
{
|
|
10910
|
+
body: {
|
|
10911
|
+
data: { type: "content-generation", attributes }
|
|
10912
|
+
}
|
|
10913
|
+
},
|
|
10914
|
+
options
|
|
10915
|
+
);
|
|
10916
|
+
},
|
|
10917
|
+
/**
|
|
10918
|
+
* Suggest content topics based on industry and audience.
|
|
10919
|
+
* @param attributes - { workspace_id, industry?, brand_identity_id?, count? }
|
|
10920
|
+
* @returns { suggestions: string }
|
|
10921
|
+
* @example
|
|
10922
|
+
* ```typescript
|
|
10923
|
+
* const result = await client.content.suggestTopics({
|
|
10924
|
+
* workspace_id: "ws_abc",
|
|
10925
|
+
* industry: "fintech",
|
|
10926
|
+
* count: 5,
|
|
10927
|
+
* });
|
|
10928
|
+
* ```
|
|
10929
|
+
*/
|
|
10930
|
+
suggestTopics: async (attributes, options) => {
|
|
10931
|
+
return rb.execute(
|
|
10932
|
+
postContentSuggestTopics,
|
|
10933
|
+
{
|
|
10934
|
+
body: {
|
|
10935
|
+
data: { type: "content-generation", attributes }
|
|
10936
|
+
}
|
|
10937
|
+
},
|
|
10938
|
+
options
|
|
10939
|
+
);
|
|
10940
|
+
},
|
|
10941
|
+
/**
|
|
10942
|
+
* Generate an image generation prompt from marketing copy.
|
|
10943
|
+
* @param attributes - { marketing_copy, workspace_id, style? }
|
|
10944
|
+
* @returns { image_prompt: string }
|
|
10945
|
+
* @example
|
|
10946
|
+
* ```typescript
|
|
10947
|
+
* const result = await client.content.generateImagePrompt({
|
|
10948
|
+
* marketing_copy: "Launch your brand into the future",
|
|
10949
|
+
* workspace_id: "ws_abc",
|
|
10950
|
+
* });
|
|
10951
|
+
* ```
|
|
10952
|
+
*/
|
|
10953
|
+
generateImagePrompt: async (attributes, options) => {
|
|
10954
|
+
return rb.execute(
|
|
10955
|
+
postContentGenerateImagePrompt,
|
|
10956
|
+
{
|
|
10957
|
+
body: {
|
|
10958
|
+
data: { type: "content-generation", attributes }
|
|
10959
|
+
}
|
|
10960
|
+
},
|
|
10961
|
+
options
|
|
10962
|
+
);
|
|
10963
|
+
},
|
|
10964
|
+
/**
|
|
10965
|
+
* Generate scored hashtags for content.
|
|
10966
|
+
* @param attributes - { text, platform, workspace_id, industry?, count? }
|
|
10967
|
+
* @returns { hashtags: Array<{ tag: string, score: number }> }
|
|
10968
|
+
* @example
|
|
10969
|
+
* ```typescript
|
|
10970
|
+
* const result = await client.content.generateHashtags({
|
|
10971
|
+
* text: "Check out our new AI-powered analytics tool",
|
|
10972
|
+
* platform: "instagram",
|
|
10973
|
+
* workspace_id: "ws_abc",
|
|
10974
|
+
* });
|
|
10975
|
+
* ```
|
|
10976
|
+
*/
|
|
10977
|
+
generateHashtags: async (attributes, options) => {
|
|
10978
|
+
return rb.execute(
|
|
10979
|
+
postContentGenerateHashtags,
|
|
10980
|
+
{
|
|
10981
|
+
body: {
|
|
10982
|
+
data: { type: "content-generation", attributes }
|
|
10983
|
+
}
|
|
10984
|
+
},
|
|
10985
|
+
options
|
|
10986
|
+
);
|
|
10987
|
+
},
|
|
10988
|
+
/**
|
|
10989
|
+
* Analyze content for SEO optimization against target keywords.
|
|
10990
|
+
* @param attributes - { text, target_keywords, workspace_id }
|
|
10991
|
+
* @returns { analysis: { keyword_coverage, suggestions, seo_score } }
|
|
10992
|
+
* @example
|
|
10993
|
+
* ```typescript
|
|
10994
|
+
* const result = await client.content.seoEnrich({
|
|
10995
|
+
* text: "Our product helps businesses grow",
|
|
10996
|
+
* target_keywords: ["growth", "business", "scale"],
|
|
10997
|
+
* workspace_id: "ws_abc",
|
|
10998
|
+
* });
|
|
10999
|
+
* ```
|
|
11000
|
+
*/
|
|
11001
|
+
seoEnrich: async (attributes, options) => {
|
|
11002
|
+
return rb.execute(
|
|
11003
|
+
postContentSeoEnrich,
|
|
11004
|
+
{
|
|
11005
|
+
body: {
|
|
11006
|
+
data: { type: "content-generation", attributes }
|
|
11007
|
+
}
|
|
11008
|
+
},
|
|
11009
|
+
options
|
|
11010
|
+
);
|
|
11011
|
+
}
|
|
11012
|
+
};
|
|
11013
|
+
}
|
|
11014
|
+
|
|
10620
11015
|
// src/namespaces/clinical.ts
|
|
10621
11016
|
function createClinicalNamespace(rb) {
|
|
10622
11017
|
return {
|
|
@@ -10717,6 +11112,27 @@ function createClinicalNamespace(rb) {
|
|
|
10717
11112
|
* ```
|
|
10718
11113
|
*/
|
|
10719
11114
|
delete: async (id, options) => rb.executeDelete(deleteClinicalPatientsById, { path: { id } }, options),
|
|
11115
|
+
/**
|
|
11116
|
+
* Look up a patient by their CRM Contact ID.
|
|
11117
|
+
*
|
|
11118
|
+
* Most ISV apps work with CRM Contact IDs, not Clinical Patient UUIDs.
|
|
11119
|
+
* Use this to resolve the patient record for a given contact.
|
|
11120
|
+
*
|
|
11121
|
+
* @param contactId - CRM Contact UUID
|
|
11122
|
+
* @param options - Request options
|
|
11123
|
+
* @returns {@link ClinicalPatient} record linked to the contact
|
|
11124
|
+
* @throws {@link NotFoundError} if no patient exists for the contact
|
|
11125
|
+
*
|
|
11126
|
+
* @example
|
|
11127
|
+
* ```typescript
|
|
11128
|
+
* const patient = await client.clinical.patients.getByContact('c7da2056-...');
|
|
11129
|
+
* console.log(patient.id); // Clinical Patient UUID
|
|
11130
|
+
* ```
|
|
11131
|
+
*/
|
|
11132
|
+
getByContact: async (contactId, options) => rb.rawGet(
|
|
11133
|
+
`/clinical/patients/by-contact/${contactId}`,
|
|
11134
|
+
options
|
|
11135
|
+
),
|
|
10720
11136
|
/**
|
|
10721
11137
|
* List health metrics for a patient (related resource).
|
|
10722
11138
|
*
|
|
@@ -11486,6 +11902,18 @@ function createClinicalNamespace(rb) {
|
|
|
11486
11902
|
deleteClinicalPracticeResourcesById,
|
|
11487
11903
|
{ path: { id } },
|
|
11488
11904
|
options
|
|
11905
|
+
),
|
|
11906
|
+
/**
|
|
11907
|
+
* List application-level catalog practice resources.
|
|
11908
|
+
*
|
|
11909
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
11910
|
+
* @param options - Request options
|
|
11911
|
+
* @returns Array of {@link ClinicalPracticeResource} catalog records
|
|
11912
|
+
*/
|
|
11913
|
+
listCatalog: async (params, options) => rb.execute(
|
|
11914
|
+
getClinicalPracticeResourcesCatalog,
|
|
11915
|
+
{ query: params ?? {} },
|
|
11916
|
+
options
|
|
11489
11917
|
)
|
|
11490
11918
|
},
|
|
11491
11919
|
/**
|
|
@@ -11501,7 +11929,7 @@ function createClinicalNamespace(rb) {
|
|
|
11501
11929
|
*/
|
|
11502
11930
|
list: async (params, options) => rb.execute(
|
|
11503
11931
|
getClinicalPracticeTools,
|
|
11504
|
-
{
|
|
11932
|
+
{ query: params },
|
|
11505
11933
|
options
|
|
11506
11934
|
),
|
|
11507
11935
|
/**
|
|
@@ -11577,6 +12005,18 @@ function createClinicalNamespace(rb) {
|
|
|
11577
12005
|
listCategories: async (params, options) => rb.rawGet(
|
|
11578
12006
|
`/clinical/practice-tools/categories?workspace_id=${encodeURIComponent(params.workspace_id)}`,
|
|
11579
12007
|
options
|
|
12008
|
+
),
|
|
12009
|
+
/**
|
|
12010
|
+
* List application-level catalog practice tools.
|
|
12011
|
+
*
|
|
12012
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
12013
|
+
* @param options - Request options
|
|
12014
|
+
* @returns Array of {@link ClinicalPracticeTool} catalog records
|
|
12015
|
+
*/
|
|
12016
|
+
listCatalog: async (params, options) => rb.execute(
|
|
12017
|
+
getClinicalPracticeToolsCatalog,
|
|
12018
|
+
{ query: params ?? {} },
|
|
12019
|
+
options
|
|
11580
12020
|
)
|
|
11581
12021
|
},
|
|
11582
12022
|
/**
|
|
@@ -11717,18 +12157,145 @@ function createClinicalNamespace(rb) {
|
|
|
11717
12157
|
`/clinical/patients/${patientId}/supplement-recommendations/generate`,
|
|
11718
12158
|
{ session_id: sessionId, workspace_id: workspaceId },
|
|
11719
12159
|
options
|
|
12160
|
+
)
|
|
12161
|
+
},
|
|
12162
|
+
/**
|
|
12163
|
+
* Manage reusable clinical goal templates.
|
|
12164
|
+
*
|
|
12165
|
+
* Templates are workspace-scoped patterns that practitioners can personalize
|
|
12166
|
+
* and instantiate as ClientGoals.
|
|
12167
|
+
*/
|
|
12168
|
+
goalTemplates: {
|
|
12169
|
+
/**
|
|
12170
|
+
* List goal templates in a workspace.
|
|
12171
|
+
*
|
|
12172
|
+
* @param params - Must include `workspace_id`
|
|
12173
|
+
* @param options - Request options
|
|
12174
|
+
* @returns Array of {@link ClinicalGoalTemplate} records
|
|
12175
|
+
*
|
|
12176
|
+
* @example
|
|
12177
|
+
* ```typescript
|
|
12178
|
+
* const templates = await client.clinical.goalTemplates.list({
|
|
12179
|
+
* workspace_id: "ws_123",
|
|
12180
|
+
* filter: { category: "nutrition" },
|
|
12181
|
+
* });
|
|
12182
|
+
* ```
|
|
12183
|
+
*/
|
|
12184
|
+
list: async (params, options) => rb.execute(
|
|
12185
|
+
getClinicalGoalTemplates,
|
|
12186
|
+
{ query: params },
|
|
12187
|
+
options
|
|
11720
12188
|
),
|
|
11721
12189
|
/**
|
|
11722
|
-
*
|
|
12190
|
+
* List practitioner's personal templates.
|
|
11723
12191
|
*
|
|
11724
|
-
* @param
|
|
12192
|
+
* @param params - Must include `created_by_id`
|
|
12193
|
+
* @param options - Request options
|
|
12194
|
+
* @returns Array of {@link ClinicalGoalTemplate} records
|
|
12195
|
+
*/
|
|
12196
|
+
listMine: async (params, options) => rb.execute(
|
|
12197
|
+
getClinicalGoalTemplatesMine,
|
|
12198
|
+
{ query: params },
|
|
12199
|
+
options
|
|
12200
|
+
),
|
|
12201
|
+
/**
|
|
12202
|
+
* List distinct goal template categories with counts.
|
|
12203
|
+
*
|
|
12204
|
+
* @param params - Must include `workspace_id`
|
|
12205
|
+
* @param options - Request options
|
|
12206
|
+
* @returns Array of {@link ClinicalGoalTemplateCategory} records
|
|
12207
|
+
*/
|
|
12208
|
+
listCategories: async (params, options) => rb.execute(
|
|
12209
|
+
getClinicalGoalTemplatesCategories,
|
|
12210
|
+
{ query: params },
|
|
12211
|
+
options
|
|
12212
|
+
),
|
|
12213
|
+
/**
|
|
12214
|
+
* Get a single goal template by ID.
|
|
12215
|
+
*
|
|
12216
|
+
* @param id - GoalTemplate UUID
|
|
12217
|
+
* @param options - Request options
|
|
12218
|
+
* @returns {@link ClinicalGoalTemplate} record
|
|
12219
|
+
*/
|
|
12220
|
+
get: async (id, options) => rb.execute(
|
|
12221
|
+
getClinicalGoalTemplatesById,
|
|
12222
|
+
{ path: { id } },
|
|
12223
|
+
options
|
|
12224
|
+
),
|
|
12225
|
+
/**
|
|
12226
|
+
* Create a new goal template.
|
|
12227
|
+
*
|
|
12228
|
+
* @param attributes - Template creation attributes. Must include `workspace_id`, `goal_type`, and `title`.
|
|
12229
|
+
* @param options - Request options
|
|
12230
|
+
* @returns Created {@link ClinicalGoalTemplate} record
|
|
12231
|
+
*/
|
|
12232
|
+
create: async (attributes, options) => rb.execute(
|
|
12233
|
+
postClinicalGoalTemplates,
|
|
12234
|
+
{ body: { data: { type: "clinical-goal-template", attributes } } },
|
|
12235
|
+
options
|
|
12236
|
+
),
|
|
12237
|
+
/**
|
|
12238
|
+
* Create a personalized template from an existing one.
|
|
12239
|
+
*
|
|
12240
|
+
* Copies all fields from the source template, sets `created_by_id` to the
|
|
12241
|
+
* current actor, and sets `source_template_id` as a reference.
|
|
12242
|
+
*
|
|
12243
|
+
* @param attributes - Must include `workspace_id` and `source_template_id`
|
|
12244
|
+
* @param options - Request options
|
|
12245
|
+
* @returns Created {@link ClinicalGoalTemplate} record
|
|
12246
|
+
*
|
|
12247
|
+
* @example
|
|
12248
|
+
* ```typescript
|
|
12249
|
+
* const personal = await client.clinical.goalTemplates.createFromExisting({
|
|
12250
|
+
* workspace_id: "ws_123",
|
|
12251
|
+
* source_template_id: "tmpl_abc",
|
|
12252
|
+
* });
|
|
12253
|
+
* ```
|
|
12254
|
+
*/
|
|
12255
|
+
createFromExisting: async (attributes, options) => rb.execute(
|
|
12256
|
+
postClinicalGoalTemplatesFromExisting,
|
|
12257
|
+
{ body: { data: { type: "clinical-goal-template", attributes } } },
|
|
12258
|
+
options
|
|
12259
|
+
),
|
|
12260
|
+
/**
|
|
12261
|
+
* Update a goal template.
|
|
12262
|
+
*
|
|
12263
|
+
* @param id - GoalTemplate UUID
|
|
12264
|
+
* @param attributes - Fields to update (PATCH semantics)
|
|
12265
|
+
* @param options - Request options
|
|
12266
|
+
* @returns Updated {@link ClinicalGoalTemplate} record
|
|
12267
|
+
*/
|
|
12268
|
+
update: async (id, attributes, options) => rb.execute(
|
|
12269
|
+
patchClinicalGoalTemplatesById,
|
|
12270
|
+
{
|
|
12271
|
+
path: { id },
|
|
12272
|
+
body: { data: { type: "clinical-goal-template", id, attributes } }
|
|
12273
|
+
},
|
|
12274
|
+
options
|
|
12275
|
+
),
|
|
12276
|
+
/**
|
|
12277
|
+
* Delete a goal template.
|
|
12278
|
+
*
|
|
12279
|
+
* @param id - GoalTemplate UUID
|
|
11725
12280
|
* @param options - Request options
|
|
11726
12281
|
* @returns `true` on successful deletion
|
|
11727
12282
|
*/
|
|
11728
12283
|
delete: async (id, options) => rb.executeDelete(
|
|
11729
|
-
|
|
12284
|
+
deleteClinicalGoalTemplatesById,
|
|
11730
12285
|
{ path: { id } },
|
|
11731
12286
|
options
|
|
12287
|
+
),
|
|
12288
|
+
/**
|
|
12289
|
+
* List application-level catalog goal templates.
|
|
12290
|
+
*
|
|
12291
|
+
* @param params - Optional filter/sort params. Application ID is resolved from the API key context.
|
|
12292
|
+
* @param options - Request options
|
|
12293
|
+
* @returns Array of {@link ClinicalGoalTemplate} catalog records
|
|
12294
|
+
*/
|
|
12295
|
+
listCatalog: async (params, options) => rb.execute(
|
|
12296
|
+
getClinicalGoalTemplatesCatalog,
|
|
12297
|
+
{ query: params ?? {} },
|
|
12298
|
+
options
|
|
11732
12299
|
)
|
|
11733
12300
|
},
|
|
11734
12301
|
/**
|
|
@@ -29479,6 +30046,15 @@ function buildHeaders(getHeaders, options) {
|
|
|
29479
30046
|
}
|
|
29480
30047
|
return headers;
|
|
29481
30048
|
}
|
|
30049
|
+
function enrichError(error, result) {
|
|
30050
|
+
if (typeof error === "object" && error !== null && typeof result === "object" && result !== null) {
|
|
30051
|
+
const res = result.response;
|
|
30052
|
+
if (res && typeof res === "object" && "status" in res) {
|
|
30053
|
+
error.statusCode = res.status;
|
|
30054
|
+
}
|
|
30055
|
+
}
|
|
30056
|
+
return error;
|
|
30057
|
+
}
|
|
29482
30058
|
var RequestBuilder = class {
|
|
29483
30059
|
constructor(clientInstance, getHeaders, unwrap, requestWithRetry) {
|
|
29484
30060
|
this.clientInstance = clientInstance;
|
|
@@ -29493,7 +30069,7 @@ var RequestBuilder = class {
|
|
|
29493
30069
|
async execute(fn, params, options) {
|
|
29494
30070
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29495
30071
|
try {
|
|
29496
|
-
const
|
|
30072
|
+
const result = await this.requestWithRetry(
|
|
29497
30073
|
() => fn({
|
|
29498
30074
|
client: this.clientInstance,
|
|
29499
30075
|
throwOnError: true,
|
|
@@ -29502,9 +30078,9 @@ var RequestBuilder = class {
|
|
|
29502
30078
|
...options?.signal && { signal: options.signal }
|
|
29503
30079
|
})
|
|
29504
30080
|
);
|
|
29505
|
-
const { data, error } =
|
|
30081
|
+
const { data, error } = result;
|
|
29506
30082
|
if (error) {
|
|
29507
|
-
throw error;
|
|
30083
|
+
throw enrichError(error, result);
|
|
29508
30084
|
}
|
|
29509
30085
|
const innerData = data?.data;
|
|
29510
30086
|
return this.unwrap(innerData);
|
|
@@ -29538,13 +30114,17 @@ var RequestBuilder = class {
|
|
|
29538
30114
|
async rawGet(url, options) {
|
|
29539
30115
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29540
30116
|
try {
|
|
29541
|
-
const
|
|
30117
|
+
const result = await this.requestWithRetry(
|
|
29542
30118
|
() => this.clientInstance.get({
|
|
29543
30119
|
url,
|
|
29544
30120
|
headers,
|
|
29545
30121
|
...options?.signal && { signal: options.signal }
|
|
29546
30122
|
})
|
|
29547
30123
|
);
|
|
30124
|
+
const { data, error } = result;
|
|
30125
|
+
if (error) {
|
|
30126
|
+
throw handleApiError(enrichError(error, result));
|
|
30127
|
+
}
|
|
29548
30128
|
return this.unwrap(data?.data);
|
|
29549
30129
|
} catch (error) {
|
|
29550
30130
|
throw handleApiError(error);
|
|
@@ -29559,7 +30139,7 @@ var RequestBuilder = class {
|
|
|
29559
30139
|
async rawPostMultipart(url, body, options) {
|
|
29560
30140
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29561
30141
|
headers["Content-Type"] = null;
|
|
29562
|
-
const
|
|
30142
|
+
const result = await this.requestWithRetry(
|
|
29563
30143
|
() => this.clientInstance.post({
|
|
29564
30144
|
url,
|
|
29565
30145
|
headers,
|
|
@@ -29568,8 +30148,9 @@ var RequestBuilder = class {
|
|
|
29568
30148
|
...options?.signal && { signal: options.signal }
|
|
29569
30149
|
})
|
|
29570
30150
|
);
|
|
30151
|
+
const { data, error } = result;
|
|
29571
30152
|
if (error) {
|
|
29572
|
-
throw handleApiError(error);
|
|
30153
|
+
throw handleApiError(enrichError(error, result));
|
|
29573
30154
|
}
|
|
29574
30155
|
return data;
|
|
29575
30156
|
}
|
|
@@ -29580,7 +30161,7 @@ var RequestBuilder = class {
|
|
|
29580
30161
|
async rawPost(url, body, options) {
|
|
29581
30162
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29582
30163
|
try {
|
|
29583
|
-
const
|
|
30164
|
+
const result = await this.requestWithRetry(
|
|
29584
30165
|
() => this.clientInstance.post({
|
|
29585
30166
|
url,
|
|
29586
30167
|
headers,
|
|
@@ -29588,6 +30169,10 @@ var RequestBuilder = class {
|
|
|
29588
30169
|
...options?.signal && { signal: options.signal }
|
|
29589
30170
|
})
|
|
29590
30171
|
);
|
|
30172
|
+
const { data, error } = result;
|
|
30173
|
+
if (error) {
|
|
30174
|
+
throw handleApiError(enrichError(error, result));
|
|
30175
|
+
}
|
|
29591
30176
|
return this.unwrap(data?.data);
|
|
29592
30177
|
} catch (error) {
|
|
29593
30178
|
throw handleApiError(error);
|
|
@@ -29599,7 +30184,7 @@ var RequestBuilder = class {
|
|
|
29599
30184
|
async rawPut(url, body, options) {
|
|
29600
30185
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29601
30186
|
try {
|
|
29602
|
-
const
|
|
30187
|
+
const result = await this.requestWithRetry(
|
|
29603
30188
|
() => this.clientInstance.put({
|
|
29604
30189
|
url,
|
|
29605
30190
|
headers,
|
|
@@ -29607,6 +30192,10 @@ var RequestBuilder = class {
|
|
|
29607
30192
|
...options?.signal && { signal: options.signal }
|
|
29608
30193
|
})
|
|
29609
30194
|
);
|
|
30195
|
+
const { data, error } = result;
|
|
30196
|
+
if (error) {
|
|
30197
|
+
throw handleApiError(enrichError(error, result));
|
|
30198
|
+
}
|
|
29610
30199
|
return this.unwrap(data?.data);
|
|
29611
30200
|
} catch (error) {
|
|
29612
30201
|
throw handleApiError(error);
|
|
@@ -29618,7 +30207,7 @@ var RequestBuilder = class {
|
|
|
29618
30207
|
async rawPatch(url, body, options) {
|
|
29619
30208
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29620
30209
|
try {
|
|
29621
|
-
const
|
|
30210
|
+
const result = await this.requestWithRetry(
|
|
29622
30211
|
() => this.clientInstance.patch({
|
|
29623
30212
|
url,
|
|
29624
30213
|
headers,
|
|
@@ -29626,6 +30215,10 @@ var RequestBuilder = class {
|
|
|
29626
30215
|
...options?.signal && { signal: options.signal }
|
|
29627
30216
|
})
|
|
29628
30217
|
);
|
|
30218
|
+
const { data, error } = result;
|
|
30219
|
+
if (error) {
|
|
30220
|
+
throw handleApiError(enrichError(error, result));
|
|
30221
|
+
}
|
|
29629
30222
|
return this.unwrap(data?.data);
|
|
29630
30223
|
} catch (error) {
|
|
29631
30224
|
throw handleApiError(error);
|
|
@@ -29637,13 +30230,17 @@ var RequestBuilder = class {
|
|
|
29637
30230
|
async rawDelete(url, options) {
|
|
29638
30231
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29639
30232
|
try {
|
|
29640
|
-
const
|
|
30233
|
+
const result = await this.requestWithRetry(
|
|
29641
30234
|
() => this.clientInstance.delete({
|
|
29642
30235
|
url,
|
|
29643
30236
|
headers,
|
|
29644
30237
|
...options?.signal && { signal: options.signal }
|
|
29645
30238
|
})
|
|
29646
30239
|
);
|
|
30240
|
+
const { data, error } = result;
|
|
30241
|
+
if (error) {
|
|
30242
|
+
throw handleApiError(enrichError(error, result));
|
|
30243
|
+
}
|
|
29647
30244
|
return this.unwrap(data?.data);
|
|
29648
30245
|
} catch (error) {
|
|
29649
30246
|
throw handleApiError(error);
|
|
@@ -29661,7 +30258,7 @@ var RequestBuilder = class {
|
|
|
29661
30258
|
createPaginatedFetcher(fn, queryBuilder, options) {
|
|
29662
30259
|
return async (page, pageSize) => {
|
|
29663
30260
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29664
|
-
const
|
|
30261
|
+
const result = await this.requestWithRetry(
|
|
29665
30262
|
() => fn({
|
|
29666
30263
|
client: this.clientInstance,
|
|
29667
30264
|
headers,
|
|
@@ -29669,6 +30266,10 @@ var RequestBuilder = class {
|
|
|
29669
30266
|
...queryBuilder(page, pageSize)
|
|
29670
30267
|
})
|
|
29671
30268
|
);
|
|
30269
|
+
const { data, error } = result;
|
|
30270
|
+
if (error) {
|
|
30271
|
+
throw handleApiError(enrichError(error, result));
|
|
30272
|
+
}
|
|
29672
30273
|
const envelope = data;
|
|
29673
30274
|
const items = this.unwrap(envelope.data) || [];
|
|
29674
30275
|
return { data: items, links: envelope.links };
|
|
@@ -29786,6 +30387,7 @@ var GptClient = class extends BaseClient {
|
|
|
29786
30387
|
this.ai = createAiNamespace(rb);
|
|
29787
30388
|
this.billing = createBillingNamespace(rb);
|
|
29788
30389
|
this.catalog = createCatalogNamespace(rb);
|
|
30390
|
+
this.content = createContentNamespace(rb);
|
|
29789
30391
|
this.clinical = createClinicalNamespace(rb);
|
|
29790
30392
|
this.compliance = createComplianceNamespace(rb);
|
|
29791
30393
|
this.communication = createCommunicationNamespace(rb);
|