@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.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.0";
1336
+ var SDK_VERSION = "0.8.2";
1337
1337
  var DEFAULT_API_VERSION = "2026-03-11";
1338
1338
 
1339
1339
  // src/base-client.ts
@@ -2558,11 +2558,6 @@ var postConnectorsCredentialsByIdRefresh = (options) => (options.client ?? clien
2558
2558
  ...options.headers
2559
2559
  }
2560
2560
  });
2561
- var deleteClinicalSupplementRecCacheById = (options) => (options.client ?? client).delete({
2562
- security: [{ scheme: "bearer", type: "http" }],
2563
- url: "/clinical/supplement-rec-cache/{id}",
2564
- ...options
2565
- });
2566
2561
  var getClinicalSupplementRecCacheById = (options) => (options.client ?? client).get({
2567
2562
  security: [{ scheme: "bearer", type: "http" }],
2568
2563
  url: "/clinical/supplement-rec-cache/{id}",
@@ -2679,6 +2674,11 @@ var patchWalletAutoTopUp = (options) => (options.client ?? client).patch({
2679
2674
  ...options.headers
2680
2675
  }
2681
2676
  });
2677
+ var getClinicalGoalTemplatesCategories = (options) => (options.client ?? client).get({
2678
+ security: [{ scheme: "bearer", type: "http" }],
2679
+ url: "/clinical/goal-templates/categories",
2680
+ ...options
2681
+ });
2682
2682
  var postTokens = (options) => (options.client ?? client).post({
2683
2683
  security: [{ scheme: "bearer", type: "http" }],
2684
2684
  url: "/tokens",
@@ -3067,6 +3067,11 @@ var patchSocialCampaignsByIdCancel = (options) => (options.client ?? client).pat
3067
3067
  ...options.headers
3068
3068
  }
3069
3069
  });
3070
+ var getClinicalGoalTemplatesMine = (options) => (options.client ?? client).get({
3071
+ security: [{ scheme: "bearer", type: "http" }],
3072
+ url: "/clinical/goal-templates/mine",
3073
+ ...options
3074
+ });
3070
3075
  var patchAmendmentRequestsByIdReview = (options) => (options.client ?? client).patch({
3071
3076
  security: [{ scheme: "bearer", type: "http" }],
3072
3077
  url: "/amendment-requests/{id}/review",
@@ -3365,6 +3370,15 @@ var patchCrawlerJobsByIdCancel = (options) => (options.client ?? client).patch({
3365
3370
  ...options.headers
3366
3371
  }
3367
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
+ });
3368
3382
  var deleteClinicalNotesById = (options) => (options.client ?? client).delete({
3369
3383
  security: [{ scheme: "bearer", type: "http" }],
3370
3384
  url: "/clinical/notes/{id}",
@@ -3593,6 +3607,15 @@ var patchEmailInboundAddressesByIdRotateToken = (options) => (options.client ??
3593
3607
  ...options.headers
3594
3608
  }
3595
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
+ });
3596
3619
  var deleteSchedulingParticipantsById = (options) => (options.client ?? client).delete({
3597
3620
  security: [{ scheme: "bearer", type: "http" }],
3598
3621
  url: "/scheduling/participants/{id}",
@@ -4169,6 +4192,15 @@ var postRoles = (options) => (options.client ?? client).post({
4169
4192
  ...options.headers
4170
4193
  }
4171
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
+ });
4172
4204
  var getComplianceRequirementCompletions = (options) => (options.client ?? client).get({
4173
4205
  security: [{ scheme: "bearer", type: "http" }],
4174
4206
  url: "/compliance-requirement-completions",
@@ -4300,6 +4332,15 @@ var postSocialPosts = (options) => (options.client ?? client).post({
4300
4332
  ...options.headers
4301
4333
  }
4302
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
+ });
4303
4344
  var deleteClinicalPatientsById = (options) => (options.client ?? client).delete({
4304
4345
  security: [{ scheme: "bearer", type: "http" }],
4305
4346
  url: "/clinical/patients/{id}",
@@ -4403,6 +4444,25 @@ var postClinicalClientResourceAssignments = (options) => (options.client ?? clie
4403
4444
  ...options.headers
4404
4445
  }
4405
4446
  });
4447
+ var deleteClinicalGoalTemplatesById = (options) => (options.client ?? client).delete({
4448
+ security: [{ scheme: "bearer", type: "http" }],
4449
+ url: "/clinical/goal-templates/{id}",
4450
+ ...options
4451
+ });
4452
+ var getClinicalGoalTemplatesById = (options) => (options.client ?? client).get({
4453
+ security: [{ scheme: "bearer", type: "http" }],
4454
+ url: "/clinical/goal-templates/{id}",
4455
+ ...options
4456
+ });
4457
+ var patchClinicalGoalTemplatesById = (options) => (options.client ?? client).patch({
4458
+ security: [{ scheme: "bearer", type: "http" }],
4459
+ url: "/clinical/goal-templates/{id}",
4460
+ ...options,
4461
+ headers: {
4462
+ "Content-Type": "application/vnd.api+json",
4463
+ ...options.headers
4464
+ }
4465
+ });
4406
4466
  var postUsersRegisterIsv = (options) => (options.client ?? client).post({
4407
4467
  security: [{ scheme: "bearer", type: "http" }],
4408
4468
  url: "/users/register-isv",
@@ -4529,6 +4589,11 @@ var patchSocialTrendingWatchesByIdMarkTriggered = (options) => (options.client ?
4529
4589
  ...options.headers
4530
4590
  }
4531
4591
  });
4592
+ var getClinicalPracticeResourcesCatalog = (options) => (options.client ?? client).get({
4593
+ security: [{ scheme: "bearer", type: "http" }],
4594
+ url: "/clinical/practice-resources/catalog",
4595
+ ...options
4596
+ });
4532
4597
  var postAgentsByIdSchemaVersionsByVersionIdActivate = (options) => (options.client ?? client).post({
4533
4598
  security: [{ scheme: "bearer", type: "http" }],
4534
4599
  url: "/agents/{id}/schema-versions/{version_id}/activate",
@@ -4596,6 +4661,15 @@ var getUserProfilesMe = (options) => (options.client ?? client).get({
4596
4661
  url: "/user-profiles/me",
4597
4662
  ...options
4598
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
+ });
4599
4673
  var postDocumentsPresignedUpload = (options) => (options.client ?? client).post({
4600
4674
  security: [{ scheme: "bearer", type: "http" }],
4601
4675
  url: "/documents/presigned-upload",
@@ -4957,6 +5031,15 @@ var getAgentsByIdUsage = (options) => (options.client ?? client).get({
4957
5031
  url: "/agents/{id}/usage",
4958
5032
  ...options
4959
5033
  });
5034
+ var postClinicalGoalTemplatesFromExisting = (options) => (options.client ?? client).post({
5035
+ security: [{ scheme: "bearer", type: "http" }],
5036
+ url: "/clinical/goal-templates/from-existing",
5037
+ ...options,
5038
+ headers: {
5039
+ "Content-Type": "application/vnd.api+json",
5040
+ ...options.headers
5041
+ }
5042
+ });
4960
5043
  var getAiConversations = (options) => (options.client ?? client).get({
4961
5044
  security: [{ scheme: "bearer", type: "http" }],
4962
5045
  url: "/ai/conversations",
@@ -5177,6 +5260,15 @@ var getTransactions = (options) => (options.client ?? client).get({
5177
5260
  url: "/transactions",
5178
5261
  ...options
5179
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
+ });
5180
5272
  var postSocialTrendingHistory = (options) => (options.client ?? client).post({
5181
5273
  security: [{ scheme: "bearer", type: "http" }],
5182
5274
  url: "/social/trending/history",
@@ -5381,6 +5473,15 @@ var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ??
5381
5473
  ...options.headers
5382
5474
  }
5383
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
+ });
5384
5485
  var getLegalDocumentsByLocale = (options) => (options.client ?? client).get({
5385
5486
  security: [{ scheme: "bearer", type: "http" }],
5386
5487
  url: "/legal-documents/by-locale",
@@ -5683,6 +5784,15 @@ var patchSchedulingEventsById = (options) => (options.client ?? client).patch({
5683
5784
  ...options.headers
5684
5785
  }
5685
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
+ });
5686
5796
  var patchStorageFilesByIdSoftDelete = (options) => (options.client ?? client).patch({
5687
5797
  security: [{ scheme: "bearer", type: "http" }],
5688
5798
  url: "/storage-files/{id}/soft-delete",
@@ -5711,6 +5821,15 @@ var patchConnectorsById = (options) => (options.client ?? client).patch({
5711
5821
  ...options.headers
5712
5822
  }
5713
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
+ });
5714
5833
  var patchWalletPlanCancel = (options) => (options.client ?? client).patch({
5715
5834
  security: [{ scheme: "bearer", type: "http" }],
5716
5835
  url: "/wallet/plan/cancel",
@@ -5999,6 +6118,15 @@ var postSchedulingEvents = (options) => (options.client ?? client).post({
5999
6118
  ...options.headers
6000
6119
  }
6001
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
+ });
6002
6130
  var postEmailRecipients = (options) => (options.client ?? client).post({
6003
6131
  security: [{ scheme: "bearer", type: "http" }],
6004
6132
  url: "/email/recipients",
@@ -6200,6 +6328,11 @@ var getSocialTrendingItemsById = (options) => (options.client ?? client).get({
6200
6328
  url: "/social/trending/items/{id}",
6201
6329
  ...options
6202
6330
  });
6331
+ var getClinicalPracticeToolsCatalog = (options) => (options.client ?? client).get({
6332
+ security: [{ scheme: "bearer", type: "http" }],
6333
+ url: "/clinical/practice-tools/catalog",
6334
+ ...options
6335
+ });
6203
6336
  var postUsersAuthResendConfirmation = (options) => (options.client ?? client).post({
6204
6337
  security: [{ scheme: "bearer", type: "http" }],
6205
6338
  url: "/users/auth/resend-confirmation",
@@ -6425,6 +6558,20 @@ var getAgentVersionsByIdRevisions = (options) => (options.client ?? client).get(
6425
6558
  url: "/agent-versions/{id}/revisions",
6426
6559
  ...options
6427
6560
  });
6561
+ var getClinicalGoalTemplates = (options) => (options.client ?? client).get({
6562
+ security: [{ scheme: "bearer", type: "http" }],
6563
+ url: "/clinical/goal-templates",
6564
+ ...options
6565
+ });
6566
+ var postClinicalGoalTemplates = (options) => (options.client ?? client).post({
6567
+ security: [{ scheme: "bearer", type: "http" }],
6568
+ url: "/clinical/goal-templates",
6569
+ ...options,
6570
+ headers: {
6571
+ "Content-Type": "application/vnd.api+json",
6572
+ ...options.headers
6573
+ }
6574
+ });
6428
6575
  var patchClinicalNotesByIdReject = (options) => (options.client ?? client).patch({
6429
6576
  security: [{ scheme: "bearer", type: "http" }],
6430
6577
  url: "/clinical/notes/{id}/reject",
@@ -6775,6 +6922,11 @@ var postEmailInboundAddresses = (options) => (options.client ?? client).post({
6775
6922
  ...options.headers
6776
6923
  }
6777
6924
  });
6925
+ var getClinicalGoalTemplatesCatalog = (options) => (options.client ?? client).get({
6926
+ security: [{ scheme: "bearer", type: "http" }],
6927
+ url: "/clinical/goal-templates/catalog",
6928
+ ...options
6929
+ });
6778
6930
  var deleteExtractionBatchesById = (options) => (options.client ?? client).delete({
6779
6931
  security: [{ scheme: "bearer", type: "http" }],
6780
6932
  url: "/extraction/batches/{id}",
@@ -10681,6 +10833,249 @@ function createCatalogNamespace(rb) {
10681
10833
  };
10682
10834
  }
10683
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
+
10684
11079
  // src/namespaces/clinical.ts
10685
11080
  function createClinicalNamespace(rb) {
10686
11081
  return {
@@ -10781,6 +11176,27 @@ function createClinicalNamespace(rb) {
10781
11176
  * ```
10782
11177
  */
10783
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
+ ),
10784
11200
  /**
10785
11201
  * List health metrics for a patient (related resource).
10786
11202
  *
@@ -11550,6 +11966,18 @@ function createClinicalNamespace(rb) {
11550
11966
  deleteClinicalPracticeResourcesById,
11551
11967
  { path: { id } },
11552
11968
  options
11969
+ ),
11970
+ /**
11971
+ * List application-level catalog practice resources.
11972
+ *
11973
+ * @param params - Optional filter/sort params. Application ID is resolved from the API key context.
11974
+ * @param options - Request options
11975
+ * @returns Array of {@link ClinicalPracticeResource} catalog records
11976
+ */
11977
+ listCatalog: async (params, options) => rb.execute(
11978
+ getClinicalPracticeResourcesCatalog,
11979
+ { query: params ?? {} },
11980
+ options
11553
11981
  )
11554
11982
  },
11555
11983
  /**
@@ -11565,7 +11993,7 @@ function createClinicalNamespace(rb) {
11565
11993
  */
11566
11994
  list: async (params, options) => rb.execute(
11567
11995
  getClinicalPracticeTools,
11568
- { ...params },
11996
+ { query: params },
11569
11997
  options
11570
11998
  ),
11571
11999
  /**
@@ -11641,6 +12069,18 @@ function createClinicalNamespace(rb) {
11641
12069
  listCategories: async (params, options) => rb.rawGet(
11642
12070
  `/clinical/practice-tools/categories?workspace_id=${encodeURIComponent(params.workspace_id)}`,
11643
12071
  options
12072
+ ),
12073
+ /**
12074
+ * List application-level catalog practice tools.
12075
+ *
12076
+ * @param params - Optional filter/sort params. Application ID is resolved from the API key context.
12077
+ * @param options - Request options
12078
+ * @returns Array of {@link ClinicalPracticeTool} catalog records
12079
+ */
12080
+ listCatalog: async (params, options) => rb.execute(
12081
+ getClinicalPracticeToolsCatalog,
12082
+ { query: params ?? {} },
12083
+ options
11644
12084
  )
11645
12085
  },
11646
12086
  /**
@@ -11781,18 +12221,145 @@ function createClinicalNamespace(rb) {
11781
12221
  `/clinical/patients/${patientId}/supplement-recommendations/generate`,
11782
12222
  { session_id: sessionId, workspace_id: workspaceId },
11783
12223
  options
12224
+ )
12225
+ },
12226
+ /**
12227
+ * Manage reusable clinical goal templates.
12228
+ *
12229
+ * Templates are workspace-scoped patterns that practitioners can personalize
12230
+ * and instantiate as ClientGoals.
12231
+ */
12232
+ goalTemplates: {
12233
+ /**
12234
+ * List goal templates in a workspace.
12235
+ *
12236
+ * @param params - Must include `workspace_id`
12237
+ * @param options - Request options
12238
+ * @returns Array of {@link ClinicalGoalTemplate} records
12239
+ *
12240
+ * @example
12241
+ * ```typescript
12242
+ * const templates = await client.clinical.goalTemplates.list({
12243
+ * workspace_id: "ws_123",
12244
+ * filter: { category: "nutrition" },
12245
+ * });
12246
+ * ```
12247
+ */
12248
+ list: async (params, options) => rb.execute(
12249
+ getClinicalGoalTemplates,
12250
+ { query: params },
12251
+ options
11784
12252
  ),
11785
12253
  /**
11786
- * Delete a supplement recommendation cache entry.
12254
+ * List practitioner's personal templates.
11787
12255
  *
11788
- * @param id - SupplementRecCache UUID
12256
+ * @param params - Must include `created_by_id`
12257
+ * @param options - Request options
12258
+ * @returns Array of {@link ClinicalGoalTemplate} records
12259
+ */
12260
+ listMine: async (params, options) => rb.execute(
12261
+ getClinicalGoalTemplatesMine,
12262
+ { query: params },
12263
+ options
12264
+ ),
12265
+ /**
12266
+ * List distinct goal template categories with counts.
12267
+ *
12268
+ * @param params - Must include `workspace_id`
12269
+ * @param options - Request options
12270
+ * @returns Array of {@link ClinicalGoalTemplateCategory} records
12271
+ */
12272
+ listCategories: async (params, options) => rb.execute(
12273
+ getClinicalGoalTemplatesCategories,
12274
+ { query: params },
12275
+ options
12276
+ ),
12277
+ /**
12278
+ * Get a single goal template by ID.
12279
+ *
12280
+ * @param id - GoalTemplate UUID
12281
+ * @param options - Request options
12282
+ * @returns {@link ClinicalGoalTemplate} record
12283
+ */
12284
+ get: async (id, options) => rb.execute(
12285
+ getClinicalGoalTemplatesById,
12286
+ { path: { id } },
12287
+ options
12288
+ ),
12289
+ /**
12290
+ * Create a new goal template.
12291
+ *
12292
+ * @param attributes - Template creation attributes. Must include `workspace_id`, `goal_type`, and `title`.
12293
+ * @param options - Request options
12294
+ * @returns Created {@link ClinicalGoalTemplate} record
12295
+ */
12296
+ create: async (attributes, options) => rb.execute(
12297
+ postClinicalGoalTemplates,
12298
+ { body: { data: { type: "clinical-goal-template", attributes } } },
12299
+ options
12300
+ ),
12301
+ /**
12302
+ * Create a personalized template from an existing one.
12303
+ *
12304
+ * Copies all fields from the source template, sets `created_by_id` to the
12305
+ * current actor, and sets `source_template_id` as a reference.
12306
+ *
12307
+ * @param attributes - Must include `workspace_id` and `source_template_id`
12308
+ * @param options - Request options
12309
+ * @returns Created {@link ClinicalGoalTemplate} record
12310
+ *
12311
+ * @example
12312
+ * ```typescript
12313
+ * const personal = await client.clinical.goalTemplates.createFromExisting({
12314
+ * workspace_id: "ws_123",
12315
+ * source_template_id: "tmpl_abc",
12316
+ * });
12317
+ * ```
12318
+ */
12319
+ createFromExisting: async (attributes, options) => rb.execute(
12320
+ postClinicalGoalTemplatesFromExisting,
12321
+ { body: { data: { type: "clinical-goal-template", attributes } } },
12322
+ options
12323
+ ),
12324
+ /**
12325
+ * Update a goal template.
12326
+ *
12327
+ * @param id - GoalTemplate UUID
12328
+ * @param attributes - Fields to update (PATCH semantics)
12329
+ * @param options - Request options
12330
+ * @returns Updated {@link ClinicalGoalTemplate} record
12331
+ */
12332
+ update: async (id, attributes, options) => rb.execute(
12333
+ patchClinicalGoalTemplatesById,
12334
+ {
12335
+ path: { id },
12336
+ body: { data: { type: "clinical-goal-template", id, attributes } }
12337
+ },
12338
+ options
12339
+ ),
12340
+ /**
12341
+ * Delete a goal template.
12342
+ *
12343
+ * @param id - GoalTemplate UUID
11789
12344
  * @param options - Request options
11790
12345
  * @returns `true` on successful deletion
11791
12346
  */
11792
12347
  delete: async (id, options) => rb.executeDelete(
11793
- deleteClinicalSupplementRecCacheById,
12348
+ deleteClinicalGoalTemplatesById,
11794
12349
  { path: { id } },
11795
12350
  options
12351
+ ),
12352
+ /**
12353
+ * List application-level catalog goal templates.
12354
+ *
12355
+ * @param params - Optional filter/sort params. Application ID is resolved from the API key context.
12356
+ * @param options - Request options
12357
+ * @returns Array of {@link ClinicalGoalTemplate} catalog records
12358
+ */
12359
+ listCatalog: async (params, options) => rb.execute(
12360
+ getClinicalGoalTemplatesCatalog,
12361
+ { query: params ?? {} },
12362
+ options
11796
12363
  )
11797
12364
  },
11798
12365
  /**
@@ -29543,6 +30110,15 @@ function buildHeaders(getHeaders, options) {
29543
30110
  }
29544
30111
  return headers;
29545
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
+ }
29546
30122
  var RequestBuilder = class {
29547
30123
  constructor(clientInstance, getHeaders, unwrap, requestWithRetry) {
29548
30124
  this.clientInstance = clientInstance;
@@ -29557,7 +30133,7 @@ var RequestBuilder = class {
29557
30133
  async execute(fn, params, options) {
29558
30134
  const headers = buildHeaders(this.getHeaders, options);
29559
30135
  try {
29560
- const response = await this.requestWithRetry(
30136
+ const result = await this.requestWithRetry(
29561
30137
  () => fn({
29562
30138
  client: this.clientInstance,
29563
30139
  throwOnError: true,
@@ -29566,9 +30142,9 @@ var RequestBuilder = class {
29566
30142
  ...options?.signal && { signal: options.signal }
29567
30143
  })
29568
30144
  );
29569
- const { data, error } = response;
30145
+ const { data, error } = result;
29570
30146
  if (error) {
29571
- throw error;
30147
+ throw enrichError(error, result);
29572
30148
  }
29573
30149
  const innerData = data?.data;
29574
30150
  return this.unwrap(innerData);
@@ -29602,13 +30178,17 @@ var RequestBuilder = class {
29602
30178
  async rawGet(url, options) {
29603
30179
  const headers = buildHeaders(this.getHeaders, options);
29604
30180
  try {
29605
- const { data } = await this.requestWithRetry(
30181
+ const result = await this.requestWithRetry(
29606
30182
  () => this.clientInstance.get({
29607
30183
  url,
29608
30184
  headers,
29609
30185
  ...options?.signal && { signal: options.signal }
29610
30186
  })
29611
30187
  );
30188
+ const { data, error } = result;
30189
+ if (error) {
30190
+ throw handleApiError(enrichError(error, result));
30191
+ }
29612
30192
  return this.unwrap(data?.data);
29613
30193
  } catch (error) {
29614
30194
  throw handleApiError(error);
@@ -29623,7 +30203,7 @@ var RequestBuilder = class {
29623
30203
  async rawPostMultipart(url, body, options) {
29624
30204
  const headers = buildHeaders(this.getHeaders, options);
29625
30205
  headers["Content-Type"] = null;
29626
- const { data, error } = await this.requestWithRetry(
30206
+ const result = await this.requestWithRetry(
29627
30207
  () => this.clientInstance.post({
29628
30208
  url,
29629
30209
  headers,
@@ -29632,8 +30212,9 @@ var RequestBuilder = class {
29632
30212
  ...options?.signal && { signal: options.signal }
29633
30213
  })
29634
30214
  );
30215
+ const { data, error } = result;
29635
30216
  if (error) {
29636
- throw handleApiError(error);
30217
+ throw handleApiError(enrichError(error, result));
29637
30218
  }
29638
30219
  return data;
29639
30220
  }
@@ -29644,7 +30225,7 @@ var RequestBuilder = class {
29644
30225
  async rawPost(url, body, options) {
29645
30226
  const headers = buildHeaders(this.getHeaders, options);
29646
30227
  try {
29647
- const { data } = await this.requestWithRetry(
30228
+ const result = await this.requestWithRetry(
29648
30229
  () => this.clientInstance.post({
29649
30230
  url,
29650
30231
  headers,
@@ -29652,6 +30233,10 @@ var RequestBuilder = class {
29652
30233
  ...options?.signal && { signal: options.signal }
29653
30234
  })
29654
30235
  );
30236
+ const { data, error } = result;
30237
+ if (error) {
30238
+ throw handleApiError(enrichError(error, result));
30239
+ }
29655
30240
  return this.unwrap(data?.data);
29656
30241
  } catch (error) {
29657
30242
  throw handleApiError(error);
@@ -29663,7 +30248,7 @@ var RequestBuilder = class {
29663
30248
  async rawPut(url, body, options) {
29664
30249
  const headers = buildHeaders(this.getHeaders, options);
29665
30250
  try {
29666
- const { data } = await this.requestWithRetry(
30251
+ const result = await this.requestWithRetry(
29667
30252
  () => this.clientInstance.put({
29668
30253
  url,
29669
30254
  headers,
@@ -29671,6 +30256,10 @@ var RequestBuilder = class {
29671
30256
  ...options?.signal && { signal: options.signal }
29672
30257
  })
29673
30258
  );
30259
+ const { data, error } = result;
30260
+ if (error) {
30261
+ throw handleApiError(enrichError(error, result));
30262
+ }
29674
30263
  return this.unwrap(data?.data);
29675
30264
  } catch (error) {
29676
30265
  throw handleApiError(error);
@@ -29682,7 +30271,7 @@ var RequestBuilder = class {
29682
30271
  async rawPatch(url, body, options) {
29683
30272
  const headers = buildHeaders(this.getHeaders, options);
29684
30273
  try {
29685
- const { data } = await this.requestWithRetry(
30274
+ const result = await this.requestWithRetry(
29686
30275
  () => this.clientInstance.patch({
29687
30276
  url,
29688
30277
  headers,
@@ -29690,6 +30279,10 @@ var RequestBuilder = class {
29690
30279
  ...options?.signal && { signal: options.signal }
29691
30280
  })
29692
30281
  );
30282
+ const { data, error } = result;
30283
+ if (error) {
30284
+ throw handleApiError(enrichError(error, result));
30285
+ }
29693
30286
  return this.unwrap(data?.data);
29694
30287
  } catch (error) {
29695
30288
  throw handleApiError(error);
@@ -29701,13 +30294,17 @@ var RequestBuilder = class {
29701
30294
  async rawDelete(url, options) {
29702
30295
  const headers = buildHeaders(this.getHeaders, options);
29703
30296
  try {
29704
- const { data } = await this.requestWithRetry(
30297
+ const result = await this.requestWithRetry(
29705
30298
  () => this.clientInstance.delete({
29706
30299
  url,
29707
30300
  headers,
29708
30301
  ...options?.signal && { signal: options.signal }
29709
30302
  })
29710
30303
  );
30304
+ const { data, error } = result;
30305
+ if (error) {
30306
+ throw handleApiError(enrichError(error, result));
30307
+ }
29711
30308
  return this.unwrap(data?.data);
29712
30309
  } catch (error) {
29713
30310
  throw handleApiError(error);
@@ -29725,7 +30322,7 @@ var RequestBuilder = class {
29725
30322
  createPaginatedFetcher(fn, queryBuilder, options) {
29726
30323
  return async (page, pageSize) => {
29727
30324
  const headers = buildHeaders(this.getHeaders, options);
29728
- const { data } = await this.requestWithRetry(
30325
+ const result = await this.requestWithRetry(
29729
30326
  () => fn({
29730
30327
  client: this.clientInstance,
29731
30328
  headers,
@@ -29733,6 +30330,10 @@ var RequestBuilder = class {
29733
30330
  ...queryBuilder(page, pageSize)
29734
30331
  })
29735
30332
  );
30333
+ const { data, error } = result;
30334
+ if (error) {
30335
+ throw handleApiError(enrichError(error, result));
30336
+ }
29736
30337
  const envelope = data;
29737
30338
  const items = this.unwrap(envelope.data) || [];
29738
30339
  return { data: items, links: envelope.links };
@@ -29850,6 +30451,7 @@ var GptClient = class extends BaseClient {
29850
30451
  this.ai = createAiNamespace(rb);
29851
30452
  this.billing = createBillingNamespace(rb);
29852
30453
  this.catalog = createCatalogNamespace(rb);
30454
+ this.content = createContentNamespace(rb);
29853
30455
  this.clinical = createClinicalNamespace(rb);
29854
30456
  this.compliance = createComplianceNamespace(rb);
29855
30457
  this.communication = createCommunicationNamespace(rb);