@gpt-platform/client 0.8.1 → 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 +80 -5
- package/dist/index.d.ts +80 -5
- package/dist/index.js +401 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +401 -12
- package/dist/index.mjs.map +1 -1
- package/llms.txt +18 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1333,7 +1333,7 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
1335
|
// src/version.ts
|
|
1336
|
-
var SDK_VERSION = "0.8.
|
|
1336
|
+
var SDK_VERSION = "0.8.2";
|
|
1337
1337
|
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1338
1338
|
|
|
1339
1339
|
// src/base-client.ts
|
|
@@ -3370,6 +3370,15 @@ var patchCrawlerJobsByIdCancel = (options) => (options.client ?? client).patch({
|
|
|
3370
3370
|
...options.headers
|
|
3371
3371
|
}
|
|
3372
3372
|
});
|
|
3373
|
+
var postContentGenerateHashtags = (options) => (options.client ?? client).post({
|
|
3374
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3375
|
+
url: "/content/generate-hashtags",
|
|
3376
|
+
...options,
|
|
3377
|
+
headers: {
|
|
3378
|
+
"Content-Type": "application/vnd.api+json",
|
|
3379
|
+
...options.headers
|
|
3380
|
+
}
|
|
3381
|
+
});
|
|
3373
3382
|
var deleteClinicalNotesById = (options) => (options.client ?? client).delete({
|
|
3374
3383
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3375
3384
|
url: "/clinical/notes/{id}",
|
|
@@ -3598,6 +3607,15 @@ var patchEmailInboundAddressesByIdRotateToken = (options) => (options.client ??
|
|
|
3598
3607
|
...options.headers
|
|
3599
3608
|
}
|
|
3600
3609
|
});
|
|
3610
|
+
var postContentSeoEnrich = (options) => (options.client ?? client).post({
|
|
3611
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3612
|
+
url: "/content/seo-enrich",
|
|
3613
|
+
...options,
|
|
3614
|
+
headers: {
|
|
3615
|
+
"Content-Type": "application/vnd.api+json",
|
|
3616
|
+
...options.headers
|
|
3617
|
+
}
|
|
3618
|
+
});
|
|
3601
3619
|
var deleteSchedulingParticipantsById = (options) => (options.client ?? client).delete({
|
|
3602
3620
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3603
3621
|
url: "/scheduling/participants/{id}",
|
|
@@ -4174,6 +4192,15 @@ var postRoles = (options) => (options.client ?? client).post({
|
|
|
4174
4192
|
...options.headers
|
|
4175
4193
|
}
|
|
4176
4194
|
});
|
|
4195
|
+
var postContentGenerateText = (options) => (options.client ?? client).post({
|
|
4196
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4197
|
+
url: "/content/generate-text",
|
|
4198
|
+
...options,
|
|
4199
|
+
headers: {
|
|
4200
|
+
"Content-Type": "application/vnd.api+json",
|
|
4201
|
+
...options.headers
|
|
4202
|
+
}
|
|
4203
|
+
});
|
|
4177
4204
|
var getComplianceRequirementCompletions = (options) => (options.client ?? client).get({
|
|
4178
4205
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4179
4206
|
url: "/compliance-requirement-completions",
|
|
@@ -4305,6 +4332,15 @@ var postSocialPosts = (options) => (options.client ?? client).post({
|
|
|
4305
4332
|
...options.headers
|
|
4306
4333
|
}
|
|
4307
4334
|
});
|
|
4335
|
+
var postContentShorten = (options) => (options.client ?? client).post({
|
|
4336
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4337
|
+
url: "/content/shorten",
|
|
4338
|
+
...options,
|
|
4339
|
+
headers: {
|
|
4340
|
+
"Content-Type": "application/vnd.api+json",
|
|
4341
|
+
...options.headers
|
|
4342
|
+
}
|
|
4343
|
+
});
|
|
4308
4344
|
var deleteClinicalPatientsById = (options) => (options.client ?? client).delete({
|
|
4309
4345
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4310
4346
|
url: "/clinical/patients/{id}",
|
|
@@ -4625,6 +4661,15 @@ var getUserProfilesMe = (options) => (options.client ?? client).get({
|
|
|
4625
4661
|
url: "/user-profiles/me",
|
|
4626
4662
|
...options
|
|
4627
4663
|
});
|
|
4664
|
+
var postContentSuggestTopics = (options) => (options.client ?? client).post({
|
|
4665
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4666
|
+
url: "/content/suggest-topics",
|
|
4667
|
+
...options,
|
|
4668
|
+
headers: {
|
|
4669
|
+
"Content-Type": "application/vnd.api+json",
|
|
4670
|
+
...options.headers
|
|
4671
|
+
}
|
|
4672
|
+
});
|
|
4628
4673
|
var postDocumentsPresignedUpload = (options) => (options.client ?? client).post({
|
|
4629
4674
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4630
4675
|
url: "/documents/presigned-upload",
|
|
@@ -5215,6 +5260,15 @@ var getTransactions = (options) => (options.client ?? client).get({
|
|
|
5215
5260
|
url: "/transactions",
|
|
5216
5261
|
...options
|
|
5217
5262
|
});
|
|
5263
|
+
var postContentGenerateImagePrompt = (options) => (options.client ?? client).post({
|
|
5264
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5265
|
+
url: "/content/generate-image-prompt",
|
|
5266
|
+
...options,
|
|
5267
|
+
headers: {
|
|
5268
|
+
"Content-Type": "application/vnd.api+json",
|
|
5269
|
+
...options.headers
|
|
5270
|
+
}
|
|
5271
|
+
});
|
|
5218
5272
|
var postSocialTrendingHistory = (options) => (options.client ?? client).post({
|
|
5219
5273
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5220
5274
|
url: "/social/trending/history",
|
|
@@ -5419,6 +5473,15 @@ var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ??
|
|
|
5419
5473
|
...options.headers
|
|
5420
5474
|
}
|
|
5421
5475
|
});
|
|
5476
|
+
var postContentRefine = (options) => (options.client ?? client).post({
|
|
5477
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5478
|
+
url: "/content/refine",
|
|
5479
|
+
...options,
|
|
5480
|
+
headers: {
|
|
5481
|
+
"Content-Type": "application/vnd.api+json",
|
|
5482
|
+
...options.headers
|
|
5483
|
+
}
|
|
5484
|
+
});
|
|
5422
5485
|
var getLegalDocumentsByLocale = (options) => (options.client ?? client).get({
|
|
5423
5486
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5424
5487
|
url: "/legal-documents/by-locale",
|
|
@@ -5721,6 +5784,15 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
|
|
|
5721
5784
|
...options.headers
|
|
5722
5785
|
}
|
|
5723
5786
|
});
|
|
5787
|
+
var postContentRewriteTone = (options) => (options.client ?? client).post({
|
|
5788
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5789
|
+
url: "/content/rewrite-tone",
|
|
5790
|
+
...options,
|
|
5791
|
+
headers: {
|
|
5792
|
+
"Content-Type": "application/vnd.api+json",
|
|
5793
|
+
...options.headers
|
|
5794
|
+
}
|
|
5795
|
+
});
|
|
5724
5796
|
var patchStorageFilesByIdSoftDelete = (options) => (options.client ?? client).patch({
|
|
5725
5797
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5726
5798
|
url: "/storage-files/{id}/soft-delete",
|
|
@@ -5749,6 +5821,15 @@ var patchConnectorsById = (options) => (options.client ?? client).patch({
|
|
|
5749
5821
|
...options.headers
|
|
5750
5822
|
}
|
|
5751
5823
|
});
|
|
5824
|
+
var postContentGenerateImage = (options) => (options.client ?? client).post({
|
|
5825
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5826
|
+
url: "/content/generate-image",
|
|
5827
|
+
...options,
|
|
5828
|
+
headers: {
|
|
5829
|
+
"Content-Type": "application/vnd.api+json",
|
|
5830
|
+
...options.headers
|
|
5831
|
+
}
|
|
5832
|
+
});
|
|
5752
5833
|
var patchWalletPlanCancel = (options) => (options.client ?? client).patch({
|
|
5753
5834
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5754
5835
|
url: "/wallet/plan/cancel",
|
|
@@ -6037,6 +6118,15 @@ var postSchedulingEvents = (options) => (options.client ?? client).post({
|
|
|
6037
6118
|
...options.headers
|
|
6038
6119
|
}
|
|
6039
6120
|
});
|
|
6121
|
+
var postContentEditImage = (options) => (options.client ?? client).post({
|
|
6122
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6123
|
+
url: "/content/edit-image",
|
|
6124
|
+
...options,
|
|
6125
|
+
headers: {
|
|
6126
|
+
"Content-Type": "application/vnd.api+json",
|
|
6127
|
+
...options.headers
|
|
6128
|
+
}
|
|
6129
|
+
});
|
|
6040
6130
|
var postEmailRecipients = (options) => (options.client ?? client).post({
|
|
6041
6131
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6042
6132
|
url: "/email/recipients",
|
|
@@ -10743,6 +10833,249 @@ function createCatalogNamespace(rb) {
|
|
|
10743
10833
|
};
|
|
10744
10834
|
}
|
|
10745
10835
|
|
|
10836
|
+
// src/namespaces/content.ts
|
|
10837
|
+
function createContentNamespace(rb) {
|
|
10838
|
+
return {
|
|
10839
|
+
/**
|
|
10840
|
+
* Generate text from a prompt, optionally informed by brand identity.
|
|
10841
|
+
* @param attributes - { prompt, workspace_id, brand_identity_id?, task? }
|
|
10842
|
+
* @returns { text: string }
|
|
10843
|
+
* @example
|
|
10844
|
+
* ```typescript
|
|
10845
|
+
* const result = await client.content.generateText({
|
|
10846
|
+
* prompt: "Write about AI analytics",
|
|
10847
|
+
* workspace_id: "ws_abc",
|
|
10848
|
+
* });
|
|
10849
|
+
* ```
|
|
10850
|
+
*/
|
|
10851
|
+
generateText: async (attributes, options) => {
|
|
10852
|
+
return rb.execute(
|
|
10853
|
+
postContentGenerateText,
|
|
10854
|
+
{
|
|
10855
|
+
body: {
|
|
10856
|
+
data: { type: "content-generation", attributes }
|
|
10857
|
+
}
|
|
10858
|
+
},
|
|
10859
|
+
options
|
|
10860
|
+
);
|
|
10861
|
+
},
|
|
10862
|
+
/**
|
|
10863
|
+
* Generate an image from a text prompt via Gemini.
|
|
10864
|
+
* @param attributes - { prompt, workspace_id, style? }
|
|
10865
|
+
* @returns { url: string, provider: string }
|
|
10866
|
+
* @example
|
|
10867
|
+
* ```typescript
|
|
10868
|
+
* const result = await client.content.generateImage({
|
|
10869
|
+
* prompt: "A futuristic city skyline",
|
|
10870
|
+
* workspace_id: "ws_abc",
|
|
10871
|
+
* });
|
|
10872
|
+
* ```
|
|
10873
|
+
*/
|
|
10874
|
+
generateImage: async (attributes, options) => {
|
|
10875
|
+
return rb.execute(
|
|
10876
|
+
postContentGenerateImage,
|
|
10877
|
+
{
|
|
10878
|
+
body: {
|
|
10879
|
+
data: { type: "content-generation", attributes }
|
|
10880
|
+
}
|
|
10881
|
+
},
|
|
10882
|
+
options
|
|
10883
|
+
);
|
|
10884
|
+
},
|
|
10885
|
+
/**
|
|
10886
|
+
* Edit an existing image using natural language instructions.
|
|
10887
|
+
* @param attributes - { image_url, instructions, workspace_id }
|
|
10888
|
+
* @returns { url: string, provider: string }
|
|
10889
|
+
* @example
|
|
10890
|
+
* ```typescript
|
|
10891
|
+
* const result = await client.content.editImage({
|
|
10892
|
+
* image_url: "https://example.com/photo.png",
|
|
10893
|
+
* instructions: "Remove the background",
|
|
10894
|
+
* workspace_id: "ws_abc",
|
|
10895
|
+
* });
|
|
10896
|
+
* ```
|
|
10897
|
+
*/
|
|
10898
|
+
editImage: async (attributes, options) => {
|
|
10899
|
+
return rb.execute(
|
|
10900
|
+
postContentEditImage,
|
|
10901
|
+
{
|
|
10902
|
+
body: {
|
|
10903
|
+
data: { type: "content-generation", attributes }
|
|
10904
|
+
}
|
|
10905
|
+
},
|
|
10906
|
+
options
|
|
10907
|
+
);
|
|
10908
|
+
},
|
|
10909
|
+
/**
|
|
10910
|
+
* Rewrite text in a different tone.
|
|
10911
|
+
* @param attributes - { text, target_tone, workspace_id, max_length? }
|
|
10912
|
+
* @returns { rewritten_text: string }
|
|
10913
|
+
* @example
|
|
10914
|
+
* ```typescript
|
|
10915
|
+
* const result = await client.content.rewriteTone({
|
|
10916
|
+
* text: "We are pleased to announce our new product.",
|
|
10917
|
+
* target_tone: "casual",
|
|
10918
|
+
* workspace_id: "ws_abc",
|
|
10919
|
+
* });
|
|
10920
|
+
* ```
|
|
10921
|
+
*/
|
|
10922
|
+
rewriteTone: async (attributes, options) => {
|
|
10923
|
+
return rb.execute(
|
|
10924
|
+
postContentRewriteTone,
|
|
10925
|
+
{
|
|
10926
|
+
body: {
|
|
10927
|
+
data: { type: "content-generation", attributes }
|
|
10928
|
+
}
|
|
10929
|
+
},
|
|
10930
|
+
options
|
|
10931
|
+
);
|
|
10932
|
+
},
|
|
10933
|
+
/**
|
|
10934
|
+
* Shorten text to a target character count.
|
|
10935
|
+
* @param attributes - { text, max_chars, workspace_id, platform? }
|
|
10936
|
+
* @returns { shortened_text: string }
|
|
10937
|
+
* @example
|
|
10938
|
+
* ```typescript
|
|
10939
|
+
* const result = await client.content.shorten({
|
|
10940
|
+
* text: "This is a long piece of content that needs shortening.",
|
|
10941
|
+
* max_chars: 280,
|
|
10942
|
+
* workspace_id: "ws_abc",
|
|
10943
|
+
* });
|
|
10944
|
+
* ```
|
|
10945
|
+
*/
|
|
10946
|
+
shorten: async (attributes, options) => {
|
|
10947
|
+
return rb.execute(
|
|
10948
|
+
postContentShorten,
|
|
10949
|
+
{
|
|
10950
|
+
body: {
|
|
10951
|
+
data: { type: "content-generation", attributes }
|
|
10952
|
+
}
|
|
10953
|
+
},
|
|
10954
|
+
options
|
|
10955
|
+
);
|
|
10956
|
+
},
|
|
10957
|
+
/**
|
|
10958
|
+
* Refine text based on freeform instructions.
|
|
10959
|
+
* @param attributes - { text, instructions, workspace_id }
|
|
10960
|
+
* @returns { refined_text: string }
|
|
10961
|
+
* @example
|
|
10962
|
+
* ```typescript
|
|
10963
|
+
* const result = await client.content.refine({
|
|
10964
|
+
* text: "Draft blog post content here.",
|
|
10965
|
+
* instructions: "Make it more engaging and add a call to action",
|
|
10966
|
+
* workspace_id: "ws_abc",
|
|
10967
|
+
* });
|
|
10968
|
+
* ```
|
|
10969
|
+
*/
|
|
10970
|
+
refine: async (attributes, options) => {
|
|
10971
|
+
return rb.execute(
|
|
10972
|
+
postContentRefine,
|
|
10973
|
+
{
|
|
10974
|
+
body: {
|
|
10975
|
+
data: { type: "content-generation", attributes }
|
|
10976
|
+
}
|
|
10977
|
+
},
|
|
10978
|
+
options
|
|
10979
|
+
);
|
|
10980
|
+
},
|
|
10981
|
+
/**
|
|
10982
|
+
* Suggest content topics based on industry and audience.
|
|
10983
|
+
* @param attributes - { workspace_id, industry?, brand_identity_id?, count? }
|
|
10984
|
+
* @returns { suggestions: string }
|
|
10985
|
+
* @example
|
|
10986
|
+
* ```typescript
|
|
10987
|
+
* const result = await client.content.suggestTopics({
|
|
10988
|
+
* workspace_id: "ws_abc",
|
|
10989
|
+
* industry: "fintech",
|
|
10990
|
+
* count: 5,
|
|
10991
|
+
* });
|
|
10992
|
+
* ```
|
|
10993
|
+
*/
|
|
10994
|
+
suggestTopics: async (attributes, options) => {
|
|
10995
|
+
return rb.execute(
|
|
10996
|
+
postContentSuggestTopics,
|
|
10997
|
+
{
|
|
10998
|
+
body: {
|
|
10999
|
+
data: { type: "content-generation", attributes }
|
|
11000
|
+
}
|
|
11001
|
+
},
|
|
11002
|
+
options
|
|
11003
|
+
);
|
|
11004
|
+
},
|
|
11005
|
+
/**
|
|
11006
|
+
* Generate an image generation prompt from marketing copy.
|
|
11007
|
+
* @param attributes - { marketing_copy, workspace_id, style? }
|
|
11008
|
+
* @returns { image_prompt: string }
|
|
11009
|
+
* @example
|
|
11010
|
+
* ```typescript
|
|
11011
|
+
* const result = await client.content.generateImagePrompt({
|
|
11012
|
+
* marketing_copy: "Launch your brand into the future",
|
|
11013
|
+
* workspace_id: "ws_abc",
|
|
11014
|
+
* });
|
|
11015
|
+
* ```
|
|
11016
|
+
*/
|
|
11017
|
+
generateImagePrompt: async (attributes, options) => {
|
|
11018
|
+
return rb.execute(
|
|
11019
|
+
postContentGenerateImagePrompt,
|
|
11020
|
+
{
|
|
11021
|
+
body: {
|
|
11022
|
+
data: { type: "content-generation", attributes }
|
|
11023
|
+
}
|
|
11024
|
+
},
|
|
11025
|
+
options
|
|
11026
|
+
);
|
|
11027
|
+
},
|
|
11028
|
+
/**
|
|
11029
|
+
* Generate scored hashtags for content.
|
|
11030
|
+
* @param attributes - { text, platform, workspace_id, industry?, count? }
|
|
11031
|
+
* @returns { hashtags: Array<{ tag: string, score: number }> }
|
|
11032
|
+
* @example
|
|
11033
|
+
* ```typescript
|
|
11034
|
+
* const result = await client.content.generateHashtags({
|
|
11035
|
+
* text: "Check out our new AI-powered analytics tool",
|
|
11036
|
+
* platform: "instagram",
|
|
11037
|
+
* workspace_id: "ws_abc",
|
|
11038
|
+
* });
|
|
11039
|
+
* ```
|
|
11040
|
+
*/
|
|
11041
|
+
generateHashtags: async (attributes, options) => {
|
|
11042
|
+
return rb.execute(
|
|
11043
|
+
postContentGenerateHashtags,
|
|
11044
|
+
{
|
|
11045
|
+
body: {
|
|
11046
|
+
data: { type: "content-generation", attributes }
|
|
11047
|
+
}
|
|
11048
|
+
},
|
|
11049
|
+
options
|
|
11050
|
+
);
|
|
11051
|
+
},
|
|
11052
|
+
/**
|
|
11053
|
+
* Analyze content for SEO optimization against target keywords.
|
|
11054
|
+
* @param attributes - { text, target_keywords, workspace_id }
|
|
11055
|
+
* @returns { analysis: { keyword_coverage, suggestions, seo_score } }
|
|
11056
|
+
* @example
|
|
11057
|
+
* ```typescript
|
|
11058
|
+
* const result = await client.content.seoEnrich({
|
|
11059
|
+
* text: "Our product helps businesses grow",
|
|
11060
|
+
* target_keywords: ["growth", "business", "scale"],
|
|
11061
|
+
* workspace_id: "ws_abc",
|
|
11062
|
+
* });
|
|
11063
|
+
* ```
|
|
11064
|
+
*/
|
|
11065
|
+
seoEnrich: async (attributes, options) => {
|
|
11066
|
+
return rb.execute(
|
|
11067
|
+
postContentSeoEnrich,
|
|
11068
|
+
{
|
|
11069
|
+
body: {
|
|
11070
|
+
data: { type: "content-generation", attributes }
|
|
11071
|
+
}
|
|
11072
|
+
},
|
|
11073
|
+
options
|
|
11074
|
+
);
|
|
11075
|
+
}
|
|
11076
|
+
};
|
|
11077
|
+
}
|
|
11078
|
+
|
|
10746
11079
|
// src/namespaces/clinical.ts
|
|
10747
11080
|
function createClinicalNamespace(rb) {
|
|
10748
11081
|
return {
|
|
@@ -10843,6 +11176,27 @@ function createClinicalNamespace(rb) {
|
|
|
10843
11176
|
* ```
|
|
10844
11177
|
*/
|
|
10845
11178
|
delete: async (id, options) => rb.executeDelete(deleteClinicalPatientsById, { path: { id } }, options),
|
|
11179
|
+
/**
|
|
11180
|
+
* Look up a patient by their CRM Contact ID.
|
|
11181
|
+
*
|
|
11182
|
+
* Most ISV apps work with CRM Contact IDs, not Clinical Patient UUIDs.
|
|
11183
|
+
* Use this to resolve the patient record for a given contact.
|
|
11184
|
+
*
|
|
11185
|
+
* @param contactId - CRM Contact UUID
|
|
11186
|
+
* @param options - Request options
|
|
11187
|
+
* @returns {@link ClinicalPatient} record linked to the contact
|
|
11188
|
+
* @throws {@link NotFoundError} if no patient exists for the contact
|
|
11189
|
+
*
|
|
11190
|
+
* @example
|
|
11191
|
+
* ```typescript
|
|
11192
|
+
* const patient = await client.clinical.patients.getByContact('c7da2056-...');
|
|
11193
|
+
* console.log(patient.id); // Clinical Patient UUID
|
|
11194
|
+
* ```
|
|
11195
|
+
*/
|
|
11196
|
+
getByContact: async (contactId, options) => rb.rawGet(
|
|
11197
|
+
`/clinical/patients/by-contact/${contactId}`,
|
|
11198
|
+
options
|
|
11199
|
+
),
|
|
10846
11200
|
/**
|
|
10847
11201
|
* List health metrics for a patient (related resource).
|
|
10848
11202
|
*
|
|
@@ -29756,6 +30110,15 @@ function buildHeaders(getHeaders, options) {
|
|
|
29756
30110
|
}
|
|
29757
30111
|
return headers;
|
|
29758
30112
|
}
|
|
30113
|
+
function enrichError(error, result) {
|
|
30114
|
+
if (typeof error === "object" && error !== null && typeof result === "object" && result !== null) {
|
|
30115
|
+
const res = result.response;
|
|
30116
|
+
if (res && typeof res === "object" && "status" in res) {
|
|
30117
|
+
error.statusCode = res.status;
|
|
30118
|
+
}
|
|
30119
|
+
}
|
|
30120
|
+
return error;
|
|
30121
|
+
}
|
|
29759
30122
|
var RequestBuilder = class {
|
|
29760
30123
|
constructor(clientInstance, getHeaders, unwrap, requestWithRetry) {
|
|
29761
30124
|
this.clientInstance = clientInstance;
|
|
@@ -29770,7 +30133,7 @@ var RequestBuilder = class {
|
|
|
29770
30133
|
async execute(fn, params, options) {
|
|
29771
30134
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29772
30135
|
try {
|
|
29773
|
-
const
|
|
30136
|
+
const result = await this.requestWithRetry(
|
|
29774
30137
|
() => fn({
|
|
29775
30138
|
client: this.clientInstance,
|
|
29776
30139
|
throwOnError: true,
|
|
@@ -29779,9 +30142,9 @@ var RequestBuilder = class {
|
|
|
29779
30142
|
...options?.signal && { signal: options.signal }
|
|
29780
30143
|
})
|
|
29781
30144
|
);
|
|
29782
|
-
const { data, error } =
|
|
30145
|
+
const { data, error } = result;
|
|
29783
30146
|
if (error) {
|
|
29784
|
-
throw error;
|
|
30147
|
+
throw enrichError(error, result);
|
|
29785
30148
|
}
|
|
29786
30149
|
const innerData = data?.data;
|
|
29787
30150
|
return this.unwrap(innerData);
|
|
@@ -29815,13 +30178,17 @@ var RequestBuilder = class {
|
|
|
29815
30178
|
async rawGet(url, options) {
|
|
29816
30179
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29817
30180
|
try {
|
|
29818
|
-
const
|
|
30181
|
+
const result = await this.requestWithRetry(
|
|
29819
30182
|
() => this.clientInstance.get({
|
|
29820
30183
|
url,
|
|
29821
30184
|
headers,
|
|
29822
30185
|
...options?.signal && { signal: options.signal }
|
|
29823
30186
|
})
|
|
29824
30187
|
);
|
|
30188
|
+
const { data, error } = result;
|
|
30189
|
+
if (error) {
|
|
30190
|
+
throw handleApiError(enrichError(error, result));
|
|
30191
|
+
}
|
|
29825
30192
|
return this.unwrap(data?.data);
|
|
29826
30193
|
} catch (error) {
|
|
29827
30194
|
throw handleApiError(error);
|
|
@@ -29836,7 +30203,7 @@ var RequestBuilder = class {
|
|
|
29836
30203
|
async rawPostMultipart(url, body, options) {
|
|
29837
30204
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29838
30205
|
headers["Content-Type"] = null;
|
|
29839
|
-
const
|
|
30206
|
+
const result = await this.requestWithRetry(
|
|
29840
30207
|
() => this.clientInstance.post({
|
|
29841
30208
|
url,
|
|
29842
30209
|
headers,
|
|
@@ -29845,8 +30212,9 @@ var RequestBuilder = class {
|
|
|
29845
30212
|
...options?.signal && { signal: options.signal }
|
|
29846
30213
|
})
|
|
29847
30214
|
);
|
|
30215
|
+
const { data, error } = result;
|
|
29848
30216
|
if (error) {
|
|
29849
|
-
throw handleApiError(error);
|
|
30217
|
+
throw handleApiError(enrichError(error, result));
|
|
29850
30218
|
}
|
|
29851
30219
|
return data;
|
|
29852
30220
|
}
|
|
@@ -29857,7 +30225,7 @@ var RequestBuilder = class {
|
|
|
29857
30225
|
async rawPost(url, body, options) {
|
|
29858
30226
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29859
30227
|
try {
|
|
29860
|
-
const
|
|
30228
|
+
const result = await this.requestWithRetry(
|
|
29861
30229
|
() => this.clientInstance.post({
|
|
29862
30230
|
url,
|
|
29863
30231
|
headers,
|
|
@@ -29865,6 +30233,10 @@ var RequestBuilder = class {
|
|
|
29865
30233
|
...options?.signal && { signal: options.signal }
|
|
29866
30234
|
})
|
|
29867
30235
|
);
|
|
30236
|
+
const { data, error } = result;
|
|
30237
|
+
if (error) {
|
|
30238
|
+
throw handleApiError(enrichError(error, result));
|
|
30239
|
+
}
|
|
29868
30240
|
return this.unwrap(data?.data);
|
|
29869
30241
|
} catch (error) {
|
|
29870
30242
|
throw handleApiError(error);
|
|
@@ -29876,7 +30248,7 @@ var RequestBuilder = class {
|
|
|
29876
30248
|
async rawPut(url, body, options) {
|
|
29877
30249
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29878
30250
|
try {
|
|
29879
|
-
const
|
|
30251
|
+
const result = await this.requestWithRetry(
|
|
29880
30252
|
() => this.clientInstance.put({
|
|
29881
30253
|
url,
|
|
29882
30254
|
headers,
|
|
@@ -29884,6 +30256,10 @@ var RequestBuilder = class {
|
|
|
29884
30256
|
...options?.signal && { signal: options.signal }
|
|
29885
30257
|
})
|
|
29886
30258
|
);
|
|
30259
|
+
const { data, error } = result;
|
|
30260
|
+
if (error) {
|
|
30261
|
+
throw handleApiError(enrichError(error, result));
|
|
30262
|
+
}
|
|
29887
30263
|
return this.unwrap(data?.data);
|
|
29888
30264
|
} catch (error) {
|
|
29889
30265
|
throw handleApiError(error);
|
|
@@ -29895,7 +30271,7 @@ var RequestBuilder = class {
|
|
|
29895
30271
|
async rawPatch(url, body, options) {
|
|
29896
30272
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29897
30273
|
try {
|
|
29898
|
-
const
|
|
30274
|
+
const result = await this.requestWithRetry(
|
|
29899
30275
|
() => this.clientInstance.patch({
|
|
29900
30276
|
url,
|
|
29901
30277
|
headers,
|
|
@@ -29903,6 +30279,10 @@ var RequestBuilder = class {
|
|
|
29903
30279
|
...options?.signal && { signal: options.signal }
|
|
29904
30280
|
})
|
|
29905
30281
|
);
|
|
30282
|
+
const { data, error } = result;
|
|
30283
|
+
if (error) {
|
|
30284
|
+
throw handleApiError(enrichError(error, result));
|
|
30285
|
+
}
|
|
29906
30286
|
return this.unwrap(data?.data);
|
|
29907
30287
|
} catch (error) {
|
|
29908
30288
|
throw handleApiError(error);
|
|
@@ -29914,13 +30294,17 @@ var RequestBuilder = class {
|
|
|
29914
30294
|
async rawDelete(url, options) {
|
|
29915
30295
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29916
30296
|
try {
|
|
29917
|
-
const
|
|
30297
|
+
const result = await this.requestWithRetry(
|
|
29918
30298
|
() => this.clientInstance.delete({
|
|
29919
30299
|
url,
|
|
29920
30300
|
headers,
|
|
29921
30301
|
...options?.signal && { signal: options.signal }
|
|
29922
30302
|
})
|
|
29923
30303
|
);
|
|
30304
|
+
const { data, error } = result;
|
|
30305
|
+
if (error) {
|
|
30306
|
+
throw handleApiError(enrichError(error, result));
|
|
30307
|
+
}
|
|
29924
30308
|
return this.unwrap(data?.data);
|
|
29925
30309
|
} catch (error) {
|
|
29926
30310
|
throw handleApiError(error);
|
|
@@ -29938,7 +30322,7 @@ var RequestBuilder = class {
|
|
|
29938
30322
|
createPaginatedFetcher(fn, queryBuilder, options) {
|
|
29939
30323
|
return async (page, pageSize) => {
|
|
29940
30324
|
const headers = buildHeaders(this.getHeaders, options);
|
|
29941
|
-
const
|
|
30325
|
+
const result = await this.requestWithRetry(
|
|
29942
30326
|
() => fn({
|
|
29943
30327
|
client: this.clientInstance,
|
|
29944
30328
|
headers,
|
|
@@ -29946,6 +30330,10 @@ var RequestBuilder = class {
|
|
|
29946
30330
|
...queryBuilder(page, pageSize)
|
|
29947
30331
|
})
|
|
29948
30332
|
);
|
|
30333
|
+
const { data, error } = result;
|
|
30334
|
+
if (error) {
|
|
30335
|
+
throw handleApiError(enrichError(error, result));
|
|
30336
|
+
}
|
|
29949
30337
|
const envelope = data;
|
|
29950
30338
|
const items = this.unwrap(envelope.data) || [];
|
|
29951
30339
|
return { data: items, links: envelope.links };
|
|
@@ -30063,6 +30451,7 @@ var GptClient = class extends BaseClient {
|
|
|
30063
30451
|
this.ai = createAiNamespace(rb);
|
|
30064
30452
|
this.billing = createBillingNamespace(rb);
|
|
30065
30453
|
this.catalog = createCatalogNamespace(rb);
|
|
30454
|
+
this.content = createContentNamespace(rb);
|
|
30066
30455
|
this.clinical = createClinicalNamespace(rb);
|
|
30067
30456
|
this.compliance = createComplianceNamespace(rb);
|
|
30068
30457
|
this.communication = createCommunicationNamespace(rb);
|