@gpt-platform/client 0.6.3 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1269,7 +1269,7 @@ function buildUserAgent(sdkVersion, appInfo) {
1269
1269
  }
1270
1270
 
1271
1271
  // src/version.ts
1272
- var SDK_VERSION = "0.6.3";
1272
+ var SDK_VERSION = "0.7.1";
1273
1273
  var DEFAULT_API_VERSION = "2026-03-11";
1274
1274
 
1275
1275
  // src/base-client.ts
@@ -1730,6 +1730,20 @@ var getCrmRelationshipsById = (options) => (options.client ?? client).get({
1730
1730
  url: "/crm/relationships/{id}",
1731
1731
  ...options
1732
1732
  });
1733
+ var getClinicalSessions = (options) => (options.client ?? client).get({
1734
+ security: [{ scheme: "bearer", type: "http" }],
1735
+ url: "/clinical/sessions",
1736
+ ...options
1737
+ });
1738
+ var postClinicalSessions = (options) => (options.client ?? client).post({
1739
+ security: [{ scheme: "bearer", type: "http" }],
1740
+ url: "/clinical/sessions",
1741
+ ...options,
1742
+ headers: {
1743
+ "Content-Type": "application/vnd.api+json",
1744
+ ...options.headers
1745
+ }
1746
+ });
1733
1747
  var getWatcherEventsById = (options) => (options.client ?? client).get({
1734
1748
  security: [{ scheme: "bearer", type: "http" }],
1735
1749
  url: "/watcher/events/{id}",
@@ -1791,6 +1805,30 @@ var getCatalogTaxonomyNodesTaxonomyByTaxonomyId = (options) => (options.client ?
1791
1805
  url: "/catalog/taxonomy-nodes/taxonomy/{taxonomy_id}",
1792
1806
  ...options
1793
1807
  });
1808
+ var getClinicalNotesByNoteIdVersionsById = (options) => (options.client ?? client).get({
1809
+ security: [{ scheme: "bearer", type: "http" }],
1810
+ url: "/clinical/notes/{note_id}/versions/{id}",
1811
+ ...options
1812
+ });
1813
+ var deleteClinicalMealPlansById = (options) => (options.client ?? client).delete({
1814
+ security: [{ scheme: "bearer", type: "http" }],
1815
+ url: "/clinical/meal-plans/{id}",
1816
+ ...options
1817
+ });
1818
+ var getClinicalMealPlansById = (options) => (options.client ?? client).get({
1819
+ security: [{ scheme: "bearer", type: "http" }],
1820
+ url: "/clinical/meal-plans/{id}",
1821
+ ...options
1822
+ });
1823
+ var patchClinicalMealPlansById = (options) => (options.client ?? client).patch({
1824
+ security: [{ scheme: "bearer", type: "http" }],
1825
+ url: "/clinical/meal-plans/{id}",
1826
+ ...options,
1827
+ headers: {
1828
+ "Content-Type": "application/vnd.api+json",
1829
+ ...options.headers
1830
+ }
1831
+ });
1794
1832
  var deleteSocialAccountsById = (options) => (options.client ?? client).delete({
1795
1833
  security: [{ scheme: "bearer", type: "http" }],
1796
1834
  url: "/social/accounts/{id}",
@@ -1894,6 +1932,11 @@ var getAgentsByIdStats = (options) => (options.client ?? client).get({
1894
1932
  url: "/agents/{id}/stats",
1895
1933
  ...options
1896
1934
  });
1935
+ var getClinicalPatientsByIdHealthMetrics = (options) => (options.client ?? client).get({
1936
+ security: [{ scheme: "bearer", type: "http" }],
1937
+ url: "/clinical/patients/{id}/health_metrics",
1938
+ ...options
1939
+ });
1897
1940
  var patchCrmExportsByIdRefreshUrl = (options) => (options.client ?? client).patch({
1898
1941
  security: [{ scheme: "bearer", type: "http" }],
1899
1942
  url: "/crm/exports/{id}/refresh-url",
@@ -1937,6 +1980,25 @@ var getCrmExportsById = (options) => (options.client ?? client).get({
1937
1980
  url: "/crm/exports/{id}",
1938
1981
  ...options
1939
1982
  });
1983
+ var deleteClinicalPracticeResourcesById = (options) => (options.client ?? client).delete({
1984
+ security: [{ scheme: "bearer", type: "http" }],
1985
+ url: "/clinical/practice-resources/{id}",
1986
+ ...options
1987
+ });
1988
+ var getClinicalPracticeResourcesById = (options) => (options.client ?? client).get({
1989
+ security: [{ scheme: "bearer", type: "http" }],
1990
+ url: "/clinical/practice-resources/{id}",
1991
+ ...options
1992
+ });
1993
+ var patchClinicalPracticeResourcesById = (options) => (options.client ?? client).patch({
1994
+ security: [{ scheme: "bearer", type: "http" }],
1995
+ url: "/clinical/practice-resources/{id}",
1996
+ ...options,
1997
+ headers: {
1998
+ "Content-Type": "application/vnd.api+json",
1999
+ ...options.headers
2000
+ }
2001
+ });
1940
2002
  var patchSocialAccountsByIdDeactivate = (options) => (options.client ?? client).patch({
1941
2003
  security: [{ scheme: "bearer", type: "http" }],
1942
2004
  url: "/social/accounts/{id}/deactivate",
@@ -2055,6 +2117,39 @@ var postExtractionBatches = (options) => (options.client ?? client).post({
2055
2117
  ...options.headers
2056
2118
  }
2057
2119
  });
2120
+ var getClinicalNotes = (options) => (options.client ?? client).get({
2121
+ security: [{ scheme: "bearer", type: "http" }],
2122
+ url: "/clinical/notes",
2123
+ ...options
2124
+ });
2125
+ var postClinicalNotes = (options) => (options.client ?? client).post({
2126
+ security: [{ scheme: "bearer", type: "http" }],
2127
+ url: "/clinical/notes",
2128
+ ...options,
2129
+ headers: {
2130
+ "Content-Type": "application/vnd.api+json",
2131
+ ...options.headers
2132
+ }
2133
+ });
2134
+ var deleteClinicalClientGoalsById = (options) => (options.client ?? client).delete({
2135
+ security: [{ scheme: "bearer", type: "http" }],
2136
+ url: "/clinical/client-goals/{id}",
2137
+ ...options
2138
+ });
2139
+ var getClinicalClientGoalsById = (options) => (options.client ?? client).get({
2140
+ security: [{ scheme: "bearer", type: "http" }],
2141
+ url: "/clinical/client-goals/{id}",
2142
+ ...options
2143
+ });
2144
+ var patchClinicalClientGoalsById = (options) => (options.client ?? client).patch({
2145
+ security: [{ scheme: "bearer", type: "http" }],
2146
+ url: "/clinical/client-goals/{id}",
2147
+ ...options,
2148
+ headers: {
2149
+ "Content-Type": "application/vnd.api+json",
2150
+ ...options.headers
2151
+ }
2152
+ });
2058
2153
  var postAgentsImport = (options) => (options.client ?? client).post({
2059
2154
  security: [{ scheme: "bearer", type: "http" }],
2060
2155
  url: "/agents/import",
@@ -2120,6 +2215,15 @@ var postEmailOutboundEmailsComposeWithAi = (options) => (options.client ?? clien
2120
2215
  ...options.headers
2121
2216
  }
2122
2217
  });
2218
+ var postWebhookDeliveriesByIdRetry = (options) => (options.client ?? client).post({
2219
+ security: [{ scheme: "bearer", type: "http" }],
2220
+ url: "/webhook-deliveries/{id}/retry",
2221
+ ...options,
2222
+ headers: {
2223
+ "Content-Type": "application/vnd.api+json",
2224
+ ...options.headers
2225
+ }
2226
+ });
2123
2227
  var patchSocialPostsByIdPublish = (options) => (options.client ?? client).patch({
2124
2228
  security: [{ scheme: "bearer", type: "http" }],
2125
2229
  url: "/social/posts/{id}/publish",
@@ -2273,6 +2377,11 @@ var postCrmContacts = (options) => (options.client ?? client).post({
2273
2377
  ...options.headers
2274
2378
  }
2275
2379
  });
2380
+ var getMemoryDocumentSections = (options) => (options.client ?? client).get({
2381
+ security: [{ scheme: "bearer", type: "http" }],
2382
+ url: "/memory/document-sections",
2383
+ ...options
2384
+ });
2276
2385
  var deleteWebhookConfigsById = (options) => (options.client ?? client).delete({
2277
2386
  security: [{ scheme: "bearer", type: "http" }],
2278
2387
  url: "/webhook-configs/{id}",
@@ -2301,6 +2410,16 @@ var postConnectorsCredentialsByIdRefresh = (options) => (options.client ?? clien
2301
2410
  ...options.headers
2302
2411
  }
2303
2412
  });
2413
+ var deleteClinicalSupplementRecCacheById = (options) => (options.client ?? client).delete({
2414
+ security: [{ scheme: "bearer", type: "http" }],
2415
+ url: "/clinical/supplement-rec-cache/{id}",
2416
+ ...options
2417
+ });
2418
+ var getClinicalSupplementRecCacheById = (options) => (options.client ?? client).get({
2419
+ security: [{ scheme: "bearer", type: "http" }],
2420
+ url: "/clinical/supplement-rec-cache/{id}",
2421
+ ...options
2422
+ });
2304
2423
  var postWorkspacesByWorkspaceIdExtractionDocumentsDismissAllTrained = (options) => (options.client ?? client).post({
2305
2424
  security: [{ scheme: "bearer", type: "http" }],
2306
2425
  url: "/workspaces/{workspace_id}/extraction/documents/dismiss-all-trained",
@@ -2310,6 +2429,11 @@ var postWorkspacesByWorkspaceIdExtractionDocumentsDismissAllTrained = (options)
2310
2429
  ...options.headers
2311
2430
  }
2312
2431
  });
2432
+ var getClinicalSessionsByIdSessionNotes = (options) => (options.client ?? client).get({
2433
+ security: [{ scheme: "bearer", type: "http" }],
2434
+ url: "/clinical/sessions/{id}/session_notes",
2435
+ ...options
2436
+ });
2313
2437
  var postExtractionDocumentsFindOrBeginUpload = (options) => (options.client ?? client).post({
2314
2438
  security: [{ scheme: "bearer", type: "http" }],
2315
2439
  url: "/extraction/documents/find-or-begin-upload",
@@ -2342,6 +2466,11 @@ var postConfigs = (options) => (options.client ?? client).post({
2342
2466
  ...options.headers
2343
2467
  }
2344
2468
  });
2469
+ var getClinicalSupplementRecCache = (options) => (options.client ?? client).get({
2470
+ security: [{ scheme: "bearer", type: "http" }],
2471
+ url: "/clinical/supplement-rec-cache",
2472
+ ...options
2473
+ });
2345
2474
  var deleteCrmCustomEntitiesById = (options) => (options.client ?? client).delete({
2346
2475
  security: [{ scheme: "bearer", type: "http" }],
2347
2476
  url: "/crm/custom-entities/{id}",
@@ -2388,6 +2517,11 @@ var postTokens = (options) => (options.client ?? client).post({
2388
2517
  ...options.headers
2389
2518
  }
2390
2519
  });
2520
+ var getClinicalPatientsByIdSupplements = (options) => (options.client ?? client).get({
2521
+ security: [{ scheme: "bearer", type: "http" }],
2522
+ url: "/clinical/patients/{id}/supplements",
2523
+ ...options
2524
+ });
2391
2525
  var postAgentsByIdPublishVersion = (options) => (options.client ?? client).post({
2392
2526
  security: [{ scheme: "bearer", type: "http" }],
2393
2527
  url: "/agents/{id}/publish-version",
@@ -2466,6 +2600,11 @@ var patchSupportTicketsByIdMerge = (options) => (options.client ?? client).patch
2466
2600
  ...options.headers
2467
2601
  }
2468
2602
  });
2603
+ var getMemorySectionDocumentsById = (options) => (options.client ?? client).get({
2604
+ security: [{ scheme: "bearer", type: "http" }],
2605
+ url: "/memory/section-documents/{id}",
2606
+ ...options
2607
+ });
2469
2608
  var deleteApiKeysById = (options) => (options.client ?? client).delete({
2470
2609
  security: [{ scheme: "bearer", type: "http" }],
2471
2610
  url: "/api-keys/{id}",
@@ -2527,6 +2666,25 @@ var postCrmRelationshipTypes = (options) => (options.client ?? client).post({
2527
2666
  ...options.headers
2528
2667
  }
2529
2668
  });
2669
+ var deleteClinicalSessionsById = (options) => (options.client ?? client).delete({
2670
+ security: [{ scheme: "bearer", type: "http" }],
2671
+ url: "/clinical/sessions/{id}",
2672
+ ...options
2673
+ });
2674
+ var getClinicalSessionsById = (options) => (options.client ?? client).get({
2675
+ security: [{ scheme: "bearer", type: "http" }],
2676
+ url: "/clinical/sessions/{id}",
2677
+ ...options
2678
+ });
2679
+ var patchClinicalSessionsById = (options) => (options.client ?? client).patch({
2680
+ security: [{ scheme: "bearer", type: "http" }],
2681
+ url: "/clinical/sessions/{id}",
2682
+ ...options,
2683
+ headers: {
2684
+ "Content-Type": "application/vnd.api+json",
2685
+ ...options.headers
2686
+ }
2687
+ });
2530
2688
  var getAgentsUsage = (options) => (options.client ?? client).get({
2531
2689
  security: [{ scheme: "bearer", type: "http" }],
2532
2690
  url: "/agents/usage",
@@ -2640,6 +2798,11 @@ var getEmailRecipientsEmailByOutboundEmailId = (options) => (options.client ?? c
2640
2798
  url: "/email/recipients/email/{outbound_email_id}",
2641
2799
  ...options
2642
2800
  });
2801
+ var getMemorySectionDocuments = (options) => (options.client ?? client).get({
2802
+ security: [{ scheme: "bearer", type: "http" }],
2803
+ url: "/memory/section-documents",
2804
+ ...options
2805
+ });
2643
2806
  var patchStorageFilesByIdRestore = (options) => (options.client ?? client).patch({
2644
2807
  security: [{ scheme: "bearer", type: "http" }],
2645
2808
  url: "/storage-files/{id}/restore",
@@ -2658,6 +2821,25 @@ var patchSocialCampaignsByIdCancel = (options) => (options.client ?? client).pat
2658
2821
  ...options.headers
2659
2822
  }
2660
2823
  });
2824
+ var deleteClinicalPracticeToolsById = (options) => (options.client ?? client).delete({
2825
+ security: [{ scheme: "bearer", type: "http" }],
2826
+ url: "/clinical/practice-tools/{id}",
2827
+ ...options
2828
+ });
2829
+ var getClinicalPracticeToolsById = (options) => (options.client ?? client).get({
2830
+ security: [{ scheme: "bearer", type: "http" }],
2831
+ url: "/clinical/practice-tools/{id}",
2832
+ ...options
2833
+ });
2834
+ var patchClinicalPracticeToolsById = (options) => (options.client ?? client).patch({
2835
+ security: [{ scheme: "bearer", type: "http" }],
2836
+ url: "/clinical/practice-tools/{id}",
2837
+ ...options,
2838
+ headers: {
2839
+ "Content-Type": "application/vnd.api+json",
2840
+ ...options.headers
2841
+ }
2842
+ });
2661
2843
  var getFeatureUsagesById = (options) => (options.client ?? client).get({
2662
2844
  security: [{ scheme: "bearer", type: "http" }],
2663
2845
  url: "/feature-usages/{id}",
@@ -2672,6 +2854,11 @@ var patchSchedulingCalendarSyncsByIdPause = (options) => (options.client ?? clie
2672
2854
  ...options.headers
2673
2855
  }
2674
2856
  });
2857
+ var getWebhookConfigsStats = (options) => (options.client ?? client).get({
2858
+ security: [{ scheme: "bearer", type: "http" }],
2859
+ url: "/webhook-configs/stats",
2860
+ ...options
2861
+ });
2675
2862
  var getEmailMarketingCampaignsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2676
2863
  security: [{ scheme: "bearer", type: "http" }],
2677
2864
  url: "/email-marketing/campaigns/workspace/{workspace_id}",
@@ -2881,6 +3068,25 @@ var patchCrawlerJobsByIdCancel = (options) => (options.client ?? client).patch({
2881
3068
  ...options.headers
2882
3069
  }
2883
3070
  });
3071
+ var deleteClinicalNotesById = (options) => (options.client ?? client).delete({
3072
+ security: [{ scheme: "bearer", type: "http" }],
3073
+ url: "/clinical/notes/{id}",
3074
+ ...options
3075
+ });
3076
+ var getClinicalNotesById = (options) => (options.client ?? client).get({
3077
+ security: [{ scheme: "bearer", type: "http" }],
3078
+ url: "/clinical/notes/{id}",
3079
+ ...options
3080
+ });
3081
+ var patchClinicalNotesById = (options) => (options.client ?? client).patch({
3082
+ security: [{ scheme: "bearer", type: "http" }],
3083
+ url: "/clinical/notes/{id}",
3084
+ ...options,
3085
+ headers: {
3086
+ "Content-Type": "application/vnd.api+json",
3087
+ ...options.headers
3088
+ }
3089
+ });
2884
3090
  var patchSchedulingBookingsByIdConfirm = (options) => (options.client ?? client).patch({
2885
3091
  security: [{ scheme: "bearer", type: "http" }],
2886
3092
  url: "/scheduling/bookings/{id}/confirm",
@@ -2890,6 +3096,15 @@ var patchSchedulingBookingsByIdConfirm = (options) => (options.client ?? client)
2890
3096
  ...options.headers
2891
3097
  }
2892
3098
  });
3099
+ var patchClinicalNotesByIdApprove = (options) => (options.client ?? client).patch({
3100
+ security: [{ scheme: "bearer", type: "http" }],
3101
+ url: "/clinical/notes/{id}/approve",
3102
+ ...options,
3103
+ headers: {
3104
+ "Content-Type": "application/vnd.api+json",
3105
+ ...options.headers
3106
+ }
3107
+ });
2893
3108
  var postAgentVersionsByIdAddSystemField = (options) => (options.client ?? client).post({
2894
3109
  security: [{ scheme: "bearer", type: "http" }],
2895
3110
  url: "/agent-versions/{id}/add-system-field",
@@ -2931,6 +3146,11 @@ var patchEmailMarketingGeneratedEmailsByIdApprove = (options) => (options.client
2931
3146
  ...options.headers
2932
3147
  }
2933
3148
  });
3149
+ var getClinicalNotesByNoteIdVersions = (options) => (options.client ?? client).get({
3150
+ security: [{ scheme: "bearer", type: "http" }],
3151
+ url: "/clinical/notes/{note_id}/versions",
3152
+ ...options
3153
+ });
2934
3154
  var postSupportTickets = (options) => (options.client ?? client).post({
2935
3155
  security: [{ scheme: "bearer", type: "http" }],
2936
3156
  url: "/support/tickets",
@@ -3096,6 +3316,11 @@ var patchSchedulingParticipantsById = (options) => (options.client ?? client).pa
3096
3316
  ...options.headers
3097
3317
  }
3098
3318
  });
3319
+ var getClinicalSessionsByIdMealPlans = (options) => (options.client ?? client).get({
3320
+ security: [{ scheme: "bearer", type: "http" }],
3321
+ url: "/clinical/sessions/{id}/meal_plans",
3322
+ ...options
3323
+ });
3099
3324
  var postTenantsByIdCredit = (options) => (options.client ?? client).post({
3100
3325
  security: [{ scheme: "bearer", type: "http" }],
3101
3326
  url: "/tenants/{id}/credit",
@@ -3185,6 +3410,11 @@ var postSchedulingParticipants = (options) => (options.client ?? client).post({
3185
3410
  ...options.headers
3186
3411
  }
3187
3412
  });
3413
+ var getWebhookDeliveriesStats = (options) => (options.client ?? client).get({
3414
+ security: [{ scheme: "bearer", type: "http" }],
3415
+ url: "/webhook-deliveries/stats",
3416
+ ...options
3417
+ });
3188
3418
  var getNotificationLogsById = (options) => (options.client ?? client).get({
3189
3419
  security: [{ scheme: "bearer", type: "http" }],
3190
3420
  url: "/notification-logs/{id}",
@@ -3352,6 +3582,20 @@ var getSearchSemantic = (options) => (options.client ?? client).get({
3352
3582
  url: "/search/semantic",
3353
3583
  ...options
3354
3584
  });
3585
+ var getClinicalPracticeTools = (options) => (options.client ?? client).get({
3586
+ security: [{ scheme: "bearer", type: "http" }],
3587
+ url: "/clinical/practice-tools",
3588
+ ...options
3589
+ });
3590
+ var postClinicalPracticeTools = (options) => (options.client ?? client).post({
3591
+ security: [{ scheme: "bearer", type: "http" }],
3592
+ url: "/clinical/practice-tools",
3593
+ ...options,
3594
+ headers: {
3595
+ "Content-Type": "application/vnd.api+json",
3596
+ ...options.headers
3597
+ }
3598
+ });
3355
3599
  var patchCampaignsSequencesByIdResume = (options) => (options.client ?? client).patch({
3356
3600
  security: [{ scheme: "bearer", type: "http" }],
3357
3601
  url: "/campaigns/sequences/{id}/resume",
@@ -3441,6 +3685,25 @@ var getCrmPipelinesWorkspaceByWorkspaceId = (options) => (options.client ?? clie
3441
3685
  url: "/crm/pipelines/workspace/{workspace_id}",
3442
3686
  ...options
3443
3687
  });
3688
+ var deleteClinicalClientResourceAssignmentsById = (options) => (options.client ?? client).delete({
3689
+ security: [{ scheme: "bearer", type: "http" }],
3690
+ url: "/clinical/client-resource-assignments/{id}",
3691
+ ...options
3692
+ });
3693
+ var getClinicalClientResourceAssignmentsById = (options) => (options.client ?? client).get({
3694
+ security: [{ scheme: "bearer", type: "http" }],
3695
+ url: "/clinical/client-resource-assignments/{id}",
3696
+ ...options
3697
+ });
3698
+ var patchClinicalClientResourceAssignmentsById = (options) => (options.client ?? client).patch({
3699
+ security: [{ scheme: "bearer", type: "http" }],
3700
+ url: "/clinical/client-resource-assignments/{id}",
3701
+ ...options,
3702
+ headers: {
3703
+ "Content-Type": "application/vnd.api+json",
3704
+ ...options.headers
3705
+ }
3706
+ });
3444
3707
  var patchExtractionDocumentsByIdReprocess = (options) => (options.client ?? client).patch({
3445
3708
  security: [{ scheme: "bearer", type: "http" }],
3446
3709
  url: "/extraction/documents/{id}/reprocess",
@@ -3620,6 +3883,20 @@ var getSocialMetricsPostBySocialPostIdLatest = (options) => (options.client ?? c
3620
3883
  url: "/social/metrics/post/{social_post_id}/latest",
3621
3884
  ...options
3622
3885
  });
3886
+ var getClinicalDeliveries = (options) => (options.client ?? client).get({
3887
+ security: [{ scheme: "bearer", type: "http" }],
3888
+ url: "/clinical/deliveries",
3889
+ ...options
3890
+ });
3891
+ var postClinicalDeliveries = (options) => (options.client ?? client).post({
3892
+ security: [{ scheme: "bearer", type: "http" }],
3893
+ url: "/clinical/deliveries",
3894
+ ...options,
3895
+ headers: {
3896
+ "Content-Type": "application/vnd.api+json",
3897
+ ...options.headers
3898
+ }
3899
+ });
3623
3900
  var getDataSubjectRequests = (options) => (options.client ?? client).get({
3624
3901
  security: [{ scheme: "bearer", type: "http" }],
3625
3902
  url: "/data-subject-requests",
@@ -3662,6 +3939,11 @@ var getVoiceTranscriptionResultsSessionBySessionId = (options) => (options.clien
3662
3939
  url: "/voice/transcription-results/session/{session_id}",
3663
3940
  ...options
3664
3941
  });
3942
+ var getMessagesSearch = (options) => (options.client ?? client).get({
3943
+ security: [{ scheme: "bearer", type: "http" }],
3944
+ url: "/messages/search",
3945
+ ...options
3946
+ });
3665
3947
  var postAgentsByIdTeach = (options) => (options.client ?? client).post({
3666
3948
  security: [{ scheme: "bearer", type: "http" }],
3667
3949
  url: "/agents/{id}/teach",
@@ -3680,6 +3962,25 @@ var postSocialPosts = (options) => (options.client ?? client).post({
3680
3962
  ...options.headers
3681
3963
  }
3682
3964
  });
3965
+ var deleteClinicalPatientsById = (options) => (options.client ?? client).delete({
3966
+ security: [{ scheme: "bearer", type: "http" }],
3967
+ url: "/clinical/patients/{id}",
3968
+ ...options
3969
+ });
3970
+ var getClinicalPatientsById = (options) => (options.client ?? client).get({
3971
+ security: [{ scheme: "bearer", type: "http" }],
3972
+ url: "/clinical/patients/{id}",
3973
+ ...options
3974
+ });
3975
+ var patchClinicalPatientsById = (options) => (options.client ?? client).patch({
3976
+ security: [{ scheme: "bearer", type: "http" }],
3977
+ url: "/clinical/patients/{id}",
3978
+ ...options,
3979
+ headers: {
3980
+ "Content-Type": "application/vnd.api+json",
3981
+ ...options.headers
3982
+ }
3983
+ });
3683
3984
  var patchInvitationsByIdDecline = (options) => (options.client ?? client).patch({
3684
3985
  security: [{ scheme: "bearer", type: "http" }],
3685
3986
  url: "/invitations/{id}/decline",
@@ -3745,6 +4046,20 @@ var getDataSubjectRequestsById = (options) => (options.client ?? client).get({
3745
4046
  url: "/data-subject-requests/{id}",
3746
4047
  ...options
3747
4048
  });
4049
+ var getClinicalClientResourceAssignments = (options) => (options.client ?? client).get({
4050
+ security: [{ scheme: "bearer", type: "http" }],
4051
+ url: "/clinical/client-resource-assignments",
4052
+ ...options
4053
+ });
4054
+ var postClinicalClientResourceAssignments = (options) => (options.client ?? client).post({
4055
+ security: [{ scheme: "bearer", type: "http" }],
4056
+ url: "/clinical/client-resource-assignments",
4057
+ ...options,
4058
+ headers: {
4059
+ "Content-Type": "application/vnd.api+json",
4060
+ ...options.headers
4061
+ }
4062
+ });
3748
4063
  var postUsersRegisterIsv = (options) => (options.client ?? client).post({
3749
4064
  security: [{ scheme: "bearer", type: "http" }],
3750
4065
  url: "/users/register-isv",
@@ -4008,6 +4323,25 @@ var postSchedulingEventTypes = (options) => (options.client ?? client).post({
4008
4323
  ...options.headers
4009
4324
  }
4010
4325
  });
4326
+ var deleteClinicalClientSupplementsById = (options) => (options.client ?? client).delete({
4327
+ security: [{ scheme: "bearer", type: "http" }],
4328
+ url: "/clinical/client-supplements/{id}",
4329
+ ...options
4330
+ });
4331
+ var getClinicalClientSupplementsById = (options) => (options.client ?? client).get({
4332
+ security: [{ scheme: "bearer", type: "http" }],
4333
+ url: "/clinical/client-supplements/{id}",
4334
+ ...options
4335
+ });
4336
+ var patchClinicalClientSupplementsById = (options) => (options.client ?? client).patch({
4337
+ security: [{ scheme: "bearer", type: "http" }],
4338
+ url: "/clinical/client-supplements/{id}",
4339
+ ...options,
4340
+ headers: {
4341
+ "Content-Type": "application/vnd.api+json",
4342
+ ...options.headers
4343
+ }
4344
+ });
4011
4345
  var deleteCrmPipelinesById = (options) => (options.client ?? client).delete({
4012
4346
  security: [{ scheme: "bearer", type: "http" }],
4013
4347
  url: "/crm/pipelines/{id}",
@@ -4125,6 +4459,11 @@ var postTenantsByIdSchedulePurge = (options) => (options.client ?? client).post(
4125
4459
  ...options.headers
4126
4460
  }
4127
4461
  });
4462
+ var getMessagesSemanticSearch = (options) => (options.client ?? client).get({
4463
+ security: [{ scheme: "bearer", type: "http" }],
4464
+ url: "/messages/semantic-search",
4465
+ ...options
4466
+ });
4128
4467
  var deleteCrmActivitiesById = (options) => (options.client ?? client).delete({
4129
4468
  security: [{ scheme: "bearer", type: "http" }],
4130
4469
  url: "/crm/activities/{id}",
@@ -4308,6 +4647,20 @@ var patchUserProfilesByIdDismissWelcome = (options) => (options.client ?? client
4308
4647
  ...options.headers
4309
4648
  }
4310
4649
  });
4650
+ var getClinicalHealthMetrics = (options) => (options.client ?? client).get({
4651
+ security: [{ scheme: "bearer", type: "http" }],
4652
+ url: "/clinical/health-metrics",
4653
+ ...options
4654
+ });
4655
+ var postClinicalHealthMetrics = (options) => (options.client ?? client).post({
4656
+ security: [{ scheme: "bearer", type: "http" }],
4657
+ url: "/clinical/health-metrics",
4658
+ ...options,
4659
+ headers: {
4660
+ "Content-Type": "application/vnd.api+json",
4661
+ ...options.headers
4662
+ }
4663
+ });
4311
4664
  var patchWalletAddonsByAddonSlugCancel = (options) => (options.client ?? client).patch({
4312
4665
  security: [{ scheme: "bearer", type: "http" }],
4313
4666
  url: "/wallet/addons/{addon_slug}/cancel",
@@ -4345,6 +4698,20 @@ var patchEmailOutboundEmailsByIdSchedule = (options) => (options.client ?? clien
4345
4698
  ...options.headers
4346
4699
  }
4347
4700
  });
4701
+ var getClinicalPatients = (options) => (options.client ?? client).get({
4702
+ security: [{ scheme: "bearer", type: "http" }],
4703
+ url: "/clinical/patients",
4704
+ ...options
4705
+ });
4706
+ var postClinicalPatients = (options) => (options.client ?? client).post({
4707
+ security: [{ scheme: "bearer", type: "http" }],
4708
+ url: "/clinical/patients",
4709
+ ...options,
4710
+ headers: {
4711
+ "Content-Type": "application/vnd.api+json",
4712
+ ...options.headers
4713
+ }
4714
+ });
4348
4715
  var patchExtractionDocumentsByIdVerification = (options) => (options.client ?? client).patch({
4349
4716
  security: [{ scheme: "bearer", type: "http" }],
4350
4717
  url: "/extraction/documents/{id}/verification",
@@ -4373,6 +4740,11 @@ var getTransactions = (options) => (options.client ?? client).get({
4373
4740
  url: "/transactions",
4374
4741
  ...options
4375
4742
  });
4743
+ var getThreadsSearch = (options) => (options.client ?? client).get({
4744
+ security: [{ scheme: "bearer", type: "http" }],
4745
+ url: "/threads/search",
4746
+ ...options
4747
+ });
4376
4748
  var patchSocialAccountsByIdEnablePosting = (options) => (options.client ?? client).patch({
4377
4749
  security: [{ scheme: "bearer", type: "http" }],
4378
4750
  url: "/social/accounts/{id}/enable-posting",
@@ -4506,14 +4878,28 @@ var patchSupportTicketsByIdClose = (options) => (options.client ?? client).patch
4506
4878
  ...options.headers
4507
4879
  }
4508
4880
  });
4509
- var getWalletSeats = (options) => (options.client ?? client).get({
4881
+ var getClinicalClientGoals = (options) => (options.client ?? client).get({
4510
4882
  security: [{ scheme: "bearer", type: "http" }],
4511
- url: "/wallet/seats",
4883
+ url: "/clinical/client-goals",
4512
4884
  ...options
4513
4885
  });
4514
- var getPermissions = (options) => (options.client ?? client).get({
4886
+ var postClinicalClientGoals = (options) => (options.client ?? client).post({
4515
4887
  security: [{ scheme: "bearer", type: "http" }],
4516
- url: "/permissions",
4888
+ url: "/clinical/client-goals",
4889
+ ...options,
4890
+ headers: {
4891
+ "Content-Type": "application/vnd.api+json",
4892
+ ...options.headers
4893
+ }
4894
+ });
4895
+ var getWalletSeats = (options) => (options.client ?? client).get({
4896
+ security: [{ scheme: "bearer", type: "http" }],
4897
+ url: "/wallet/seats",
4898
+ ...options
4899
+ });
4900
+ var getPermissions = (options) => (options.client ?? client).get({
4901
+ security: [{ scheme: "bearer", type: "http" }],
4902
+ url: "/permissions",
4517
4903
  ...options
4518
4904
  });
4519
4905
  var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ?? client).patch({
@@ -4557,6 +4943,20 @@ var patchSchedulingEventsByIdReschedule = (options) => (options.client ?? client
4557
4943
  ...options.headers
4558
4944
  }
4559
4945
  });
4946
+ var getClinicalPracticeResources = (options) => (options.client ?? client).get({
4947
+ security: [{ scheme: "bearer", type: "http" }],
4948
+ url: "/clinical/practice-resources",
4949
+ ...options
4950
+ });
4951
+ var postClinicalPracticeResources = (options) => (options.client ?? client).post({
4952
+ security: [{ scheme: "bearer", type: "http" }],
4953
+ url: "/clinical/practice-resources",
4954
+ ...options,
4955
+ headers: {
4956
+ "Content-Type": "application/vnd.api+json",
4957
+ ...options.headers
4958
+ }
4959
+ });
4560
4960
  var getCampaignsSequencesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
4561
4961
  security: [{ scheme: "bearer", type: "http" }],
4562
4962
  url: "/campaigns/sequences/workspace/{workspace_id}",
@@ -4603,6 +5003,11 @@ var postEmailMarketingSenderProfiles = (options) => (options.client ?? client).p
4603
5003
  ...options.headers
4604
5004
  }
4605
5005
  });
5006
+ var getClinicalPatientsByIdResourceAssignments = (options) => (options.client ?? client).get({
5007
+ security: [{ scheme: "bearer", type: "http" }],
5008
+ url: "/clinical/patients/{id}/resource_assignments",
5009
+ ...options
5010
+ });
4606
5011
  var getWatcherClaimsById = (options) => (options.client ?? client).get({
4607
5012
  security: [{ scheme: "bearer", type: "http" }],
4608
5013
  url: "/watcher/claims/{id}",
@@ -4626,6 +5031,25 @@ var postUsersAuthLogin = (options) => (options.client ?? client).post({
4626
5031
  ...options.headers
4627
5032
  }
4628
5033
  });
5034
+ var deleteClinicalHealthMetricsById = (options) => (options.client ?? client).delete({
5035
+ security: [{ scheme: "bearer", type: "http" }],
5036
+ url: "/clinical/health-metrics/{id}",
5037
+ ...options
5038
+ });
5039
+ var getClinicalHealthMetricsById = (options) => (options.client ?? client).get({
5040
+ security: [{ scheme: "bearer", type: "http" }],
5041
+ url: "/clinical/health-metrics/{id}",
5042
+ ...options
5043
+ });
5044
+ var patchClinicalHealthMetricsById = (options) => (options.client ?? client).patch({
5045
+ security: [{ scheme: "bearer", type: "http" }],
5046
+ url: "/clinical/health-metrics/{id}",
5047
+ ...options,
5048
+ headers: {
5049
+ "Content-Type": "application/vnd.api+json",
5050
+ ...options.headers
5051
+ }
5052
+ });
4629
5053
  var getSocialMetricsPostBySocialPostId = (options) => (options.client ?? client).get({
4630
5054
  security: [{ scheme: "bearer", type: "http" }],
4631
5055
  url: "/social/metrics/post/{social_post_id}",
@@ -4728,6 +5152,20 @@ var patchExtractionResultsByIdRegenerate = (options) => (options.client ?? clien
4728
5152
  ...options.headers
4729
5153
  }
4730
5154
  });
5155
+ var getClinicalClientSupplements = (options) => (options.client ?? client).get({
5156
+ security: [{ scheme: "bearer", type: "http" }],
5157
+ url: "/clinical/client-supplements",
5158
+ ...options
5159
+ });
5160
+ var postClinicalClientSupplements = (options) => (options.client ?? client).post({
5161
+ security: [{ scheme: "bearer", type: "http" }],
5162
+ url: "/clinical/client-supplements",
5163
+ ...options,
5164
+ headers: {
5165
+ "Content-Type": "application/vnd.api+json",
5166
+ ...options.headers
5167
+ }
5168
+ });
4731
5169
  var postUsersAuthConfirm = (options) => (options.client ?? client).post({
4732
5170
  security: [{ scheme: "bearer", type: "http" }],
4733
5171
  url: "/users/auth/confirm",
@@ -4922,6 +5360,25 @@ var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client
4922
5360
  url: "/extraction/documents/workspace/{workspace_id}",
4923
5361
  ...options
4924
5362
  });
5363
+ var getMemoryDocumentSectionsById = (options) => (options.client ?? client).get({
5364
+ security: [{ scheme: "bearer", type: "http" }],
5365
+ url: "/memory/document-sections/{id}",
5366
+ ...options
5367
+ });
5368
+ var getClinicalDeliveriesById = (options) => (options.client ?? client).get({
5369
+ security: [{ scheme: "bearer", type: "http" }],
5370
+ url: "/clinical/deliveries/{id}",
5371
+ ...options
5372
+ });
5373
+ var patchClinicalDeliveriesById = (options) => (options.client ?? client).patch({
5374
+ security: [{ scheme: "bearer", type: "http" }],
5375
+ url: "/clinical/deliveries/{id}",
5376
+ ...options,
5377
+ headers: {
5378
+ "Content-Type": "application/vnd.api+json",
5379
+ ...options.headers
5380
+ }
5381
+ });
4925
5382
  var postUsersAuthMagicLinkRequest = (options) => (options.client ?? client).post({
4926
5383
  security: [{ scheme: "bearer", type: "http" }],
4927
5384
  url: "/users/auth/magic-link/request",
@@ -5123,6 +5580,20 @@ var getFeatureUsages = (options) => (options.client ?? client).get({
5123
5580
  url: "/feature-usages",
5124
5581
  ...options
5125
5582
  });
5583
+ var getClinicalMealPlans = (options) => (options.client ?? client).get({
5584
+ security: [{ scheme: "bearer", type: "http" }],
5585
+ url: "/clinical/meal-plans",
5586
+ ...options
5587
+ });
5588
+ var postClinicalMealPlans = (options) => (options.client ?? client).post({
5589
+ security: [{ scheme: "bearer", type: "http" }],
5590
+ url: "/clinical/meal-plans",
5591
+ ...options,
5592
+ headers: {
5593
+ "Content-Type": "application/vnd.api+json",
5594
+ ...options.headers
5595
+ }
5596
+ });
5126
5597
  var getAiMessages = (options) => (options.client ?? client).get({
5127
5598
  security: [{ scheme: "bearer", type: "http" }],
5128
5599
  url: "/ai/messages",
@@ -5300,11 +5771,25 @@ var getAgentVersionsByIdRevisions = (options) => (options.client ?? client).get(
5300
5771
  url: "/agent-versions/{id}/revisions",
5301
5772
  ...options
5302
5773
  });
5774
+ var patchClinicalNotesByIdReject = (options) => (options.client ?? client).patch({
5775
+ security: [{ scheme: "bearer", type: "http" }],
5776
+ url: "/clinical/notes/{id}/reject",
5777
+ ...options,
5778
+ headers: {
5779
+ "Content-Type": "application/vnd.api+json",
5780
+ ...options.headers
5781
+ }
5782
+ });
5303
5783
  var getLegalDocumentsForApplication = (options) => (options.client ?? client).get({
5304
5784
  security: [{ scheme: "bearer", type: "http" }],
5305
5785
  url: "/legal-documents/for-application",
5306
5786
  ...options
5307
5787
  });
5788
+ var getClinicalPatientsByIdGoals = (options) => (options.client ?? client).get({
5789
+ security: [{ scheme: "bearer", type: "http" }],
5790
+ url: "/clinical/patients/{id}/goals",
5791
+ ...options
5792
+ });
5308
5793
  var patchStorageFilesByIdTag = (options) => (options.client ?? client).patch({
5309
5794
  security: [{ scheme: "bearer", type: "http" }],
5310
5795
  url: "/storage-files/{id}/tag",
@@ -6662,7 +7147,7 @@ function createAgentsNamespace(rb) {
6662
7147
  *
6663
7148
  * @example
6664
7149
  * const sv = await client.agents.versions.schemaVersions.create('agt_01...', {
6665
- * fields: [{ name: 'amount', type: 'currency' }],
7150
+ * output_schema: { type: 'object', properties: { amount: { type: 'number' } } },
6666
7151
  * });
6667
7152
  */
6668
7153
  create: async (agentId, attributes, options) => {
@@ -6704,7 +7189,7 @@ function createAgentsNamespace(rb) {
6704
7189
  *
6705
7190
  * @example
6706
7191
  * await client.agents.versions.schemaVersions.update('agt_01...', 'ver_01...', {
6707
- * fields: [{ name: 'total', type: 'number' }],
7192
+ * output_schema: { type: 'object', properties: { total: { type: 'number' } } },
6708
7193
  * });
6709
7194
  */
6710
7195
  update: async (agentId, versionId, attributes, options) => {
@@ -7266,10 +7751,10 @@ function createAgentsNamespace(rb) {
7266
7751
  * @example
7267
7752
  * await client.agents.executions.approve('exec_01...');
7268
7753
  */
7269
- approve: async (id, options) => {
7754
+ approve: async (id, approvedData, options) => {
7270
7755
  return rb.rawPost(
7271
7756
  `/agent-executions/${id}/approve`,
7272
- void 0,
7757
+ approvedData !== void 0 ? { approved_data: approvedData } : void 0,
7273
7758
  options
7274
7759
  );
7275
7760
  },
@@ -9148,186 +9633,1286 @@ function createCatalogNamespace(rb) {
9148
9633
  );
9149
9634
  },
9150
9635
  /**
9151
- * Permanently delete a taxonomy and all of its nodes.
9152
- *
9153
- * @param id - The unique identifier of the taxonomy to delete.
9154
- * @param options - Optional request-level overrides.
9155
- * @returns A promise that resolves to `true` on successful deletion.
9636
+ * Permanently delete a taxonomy and all of its nodes.
9637
+ *
9638
+ * @param id - The unique identifier of the taxonomy to delete.
9639
+ * @param options - Optional request-level overrides.
9640
+ * @returns A promise that resolves to `true` on successful deletion.
9641
+ *
9642
+ * @example
9643
+ * ```typescript
9644
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9645
+ *
9646
+ * await client.catalog.taxonomies.delete('tax_abc123');
9647
+ * ```
9648
+ */
9649
+ delete: async (id, options) => {
9650
+ return rb.executeDelete(
9651
+ deleteCatalogTaxonomiesById,
9652
+ { path: { id } },
9653
+ options
9654
+ );
9655
+ }
9656
+ },
9657
+ /**
9658
+ * Taxonomy nodes — individual nodes within a taxonomy tree.
9659
+ *
9660
+ * Each node represents a single category (e.g. "T-Shirts") within a
9661
+ * taxonomy. Nodes can be nested to arbitrary depth by setting a
9662
+ * `parent_node_id`, forming the hierarchical tree. A node with no parent
9663
+ * is a root-level category.
9664
+ */
9665
+ taxonomyNodes: {
9666
+ /**
9667
+ * List all nodes that belong to a specific taxonomy.
9668
+ *
9669
+ * Returns the full flat list of nodes for the taxonomy. To reconstruct
9670
+ * the tree, group nodes by their `parent_node_id` field.
9671
+ *
9672
+ * @param taxonomyId - The ID of the taxonomy whose nodes to list.
9673
+ * @param options - Optional request-level overrides.
9674
+ * @returns A promise that resolves to an array of {@link CatalogTaxonomyNode} records.
9675
+ *
9676
+ * @example
9677
+ * ```typescript
9678
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9679
+ *
9680
+ * const nodes = await client.catalog.taxonomyNodes.listByTaxonomy('tax_abc123');
9681
+ * const roots = nodes.filter((n) => !n.attributes.parent_node_id);
9682
+ * console.log('Root categories:', roots.map((n) => n.attributes.name));
9683
+ * ```
9684
+ */
9685
+ listByTaxonomy: async (taxonomyId, options) => {
9686
+ return rb.execute(
9687
+ getCatalogTaxonomyNodesTaxonomyByTaxonomyId,
9688
+ { path: { taxonomy_id: taxonomyId } },
9689
+ options
9690
+ );
9691
+ },
9692
+ /**
9693
+ * Fetch a single taxonomy node by its unique ID.
9694
+ *
9695
+ * @param id - The unique identifier of the node to retrieve.
9696
+ * @param options - Optional request-level overrides.
9697
+ * @returns A promise that resolves to the matching {@link CatalogTaxonomyNode}.
9698
+ *
9699
+ * @example
9700
+ * ```typescript
9701
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9702
+ *
9703
+ * const node = await client.catalog.taxonomyNodes.get('node_abc123');
9704
+ * console.log(node.attributes.name, node.attributes.parent_node_id);
9705
+ * ```
9706
+ */
9707
+ get: async (id, options) => {
9708
+ return rb.execute(
9709
+ getCatalogTaxonomyNodesById,
9710
+ { path: { id } },
9711
+ options
9712
+ );
9713
+ },
9714
+ /**
9715
+ * Create a new node within a taxonomy.
9716
+ *
9717
+ * To create a root-level category, omit `parent_node_id`. To nest a
9718
+ * category under an existing node, include `parent_node_id` pointing to
9719
+ * the parent's ID.
9720
+ *
9721
+ * @param attributes - Key/value map of node attributes. Must include
9722
+ * `taxonomy_id` and `name`. Optionally include `parent_node_id` to
9723
+ * nest the node within the tree.
9724
+ * @param options - Optional request-level overrides.
9725
+ * @returns A promise that resolves to the newly created {@link CatalogTaxonomyNode}.
9726
+ *
9727
+ * @example
9728
+ * ```typescript
9729
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9730
+ *
9731
+ * // Create a root-level category
9732
+ * const clothing = await client.catalog.taxonomyNodes.create({
9733
+ * taxonomy_id: 'tax_abc123',
9734
+ * name: 'Clothing',
9735
+ * });
9736
+ *
9737
+ * // Create a child category under 'Clothing'
9738
+ * const tops = await client.catalog.taxonomyNodes.create({
9739
+ * taxonomy_id: 'tax_abc123',
9740
+ * name: 'Tops',
9741
+ * parent_node_id: clothing.id,
9742
+ * });
9743
+ * ```
9744
+ */
9745
+ create: async (attributes, options) => {
9746
+ return rb.execute(
9747
+ postCatalogTaxonomyNodes,
9748
+ {
9749
+ body: {
9750
+ data: { type: "catalog_taxonomy_node", attributes }
9751
+ }
9752
+ },
9753
+ options
9754
+ );
9755
+ },
9756
+ /**
9757
+ * Update an existing taxonomy node's attributes.
9758
+ *
9759
+ * Only the fields present in `attributes` are changed (PATCH semantics).
9760
+ * You can use this to rename a category or re-parent it within the tree
9761
+ * by changing `parent_node_id`.
9762
+ *
9763
+ * @param id - The unique identifier of the node to update.
9764
+ * @param attributes - Key/value map of attributes to change.
9765
+ * @param options - Optional request-level overrides.
9766
+ * @returns A promise that resolves to the updated {@link CatalogTaxonomyNode}.
9767
+ *
9768
+ * @example
9769
+ * ```typescript
9770
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9771
+ *
9772
+ * // Rename a category
9773
+ * const node = await client.catalog.taxonomyNodes.update('node_abc123', {
9774
+ * name: 'Apparel',
9775
+ * });
9776
+ * console.log(node.attributes.name); // 'Apparel'
9777
+ * ```
9778
+ */
9779
+ update: async (id, attributes, options) => {
9780
+ return rb.execute(
9781
+ patchCatalogTaxonomyNodesById,
9782
+ {
9783
+ path: { id },
9784
+ body: {
9785
+ data: { type: "catalog_taxonomy_node", id, attributes }
9786
+ }
9787
+ },
9788
+ options
9789
+ );
9790
+ },
9791
+ /**
9792
+ * Permanently delete a taxonomy node.
9793
+ *
9794
+ * If the node has child nodes, those children will also be removed
9795
+ * recursively. Ensure products are re-categorised before deleting a node
9796
+ * that has products assigned to it.
9797
+ *
9798
+ * @param id - The unique identifier of the node to delete.
9799
+ * @param options - Optional request-level overrides.
9800
+ * @returns A promise that resolves to `true` on successful deletion.
9801
+ *
9802
+ * @example
9803
+ * ```typescript
9804
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
9805
+ *
9806
+ * await client.catalog.taxonomyNodes.delete('node_abc123');
9807
+ * ```
9808
+ */
9809
+ delete: async (id, options) => {
9810
+ return rb.executeDelete(
9811
+ deleteCatalogTaxonomyNodesById,
9812
+ { path: { id } },
9813
+ options
9814
+ );
9815
+ }
9816
+ }
9817
+ };
9818
+ }
9819
+
9820
+ // src/namespaces/clinical.ts
9821
+ function createClinicalNamespace(rb) {
9822
+ return {
9823
+ /**
9824
+ * Manage clinical patients (end users of the platform's health service).
9825
+ */
9826
+ patients: {
9827
+ /**
9828
+ * List patients in a workspace.
9829
+ *
9830
+ * @param params - Filter/pagination parameters (must include `filter[workspace_id]`)
9831
+ * @param options - Request options
9832
+ * @returns Array of {@link ClinicalPatient} records
9833
+ *
9834
+ * @example
9835
+ * ```typescript
9836
+ * const patients = await client.clinical.patients.list({
9837
+ * filter: { workspace_id: 'ws_123' },
9838
+ * });
9839
+ * ```
9840
+ */
9841
+ list: async (params, options) => rb.execute(
9842
+ getClinicalPatients,
9843
+ params ?? {},
9844
+ options
9845
+ ),
9846
+ /**
9847
+ * Get a single patient by ID.
9848
+ *
9849
+ * @param id - Patient UUID
9850
+ * @param options - Request options
9851
+ * @returns {@link ClinicalPatient} record
9852
+ *
9853
+ * @example
9854
+ * ```typescript
9855
+ * const patient = await client.clinical.patients.get('pat_abc123');
9856
+ * ```
9857
+ */
9858
+ get: async (id, options) => rb.execute(
9859
+ getClinicalPatientsById,
9860
+ { path: { id } },
9861
+ options
9862
+ ),
9863
+ /**
9864
+ * Create a new clinical patient.
9865
+ *
9866
+ * @param attributes - Patient creation attributes. Must include `workspace_id`.
9867
+ * @param options - Request options
9868
+ * @returns Created {@link ClinicalPatient} record
9869
+ *
9870
+ * @example
9871
+ * ```typescript
9872
+ * const patient = await client.clinical.patients.create({
9873
+ * workspace_id: 'ws_123',
9874
+ * contact_id: 'contact_abc',
9875
+ * status: 'active',
9876
+ * });
9877
+ * ```
9878
+ */
9879
+ create: async (attributes, options) => rb.execute(
9880
+ postClinicalPatients,
9881
+ { body: { data: { type: "clinical-patient", attributes } } },
9882
+ options
9883
+ ),
9884
+ /**
9885
+ * Update a clinical patient.
9886
+ *
9887
+ * @param id - Patient UUID
9888
+ * @param attributes - Fields to update (PATCH semantics)
9889
+ * @param options - Request options
9890
+ * @returns Updated {@link ClinicalPatient} record
9891
+ *
9892
+ * @example
9893
+ * ```typescript
9894
+ * const updated = await client.clinical.patients.update('pat_abc123', {
9895
+ * status: 'inactive',
9896
+ * });
9897
+ * ```
9898
+ */
9899
+ update: async (id, attributes, options) => rb.execute(
9900
+ patchClinicalPatientsById,
9901
+ {
9902
+ path: { id },
9903
+ body: { data: { type: "clinical-patient", id, attributes } }
9904
+ },
9905
+ options
9906
+ ),
9907
+ /**
9908
+ * Delete a clinical patient.
9909
+ *
9910
+ * @param id - Patient UUID
9911
+ * @param options - Request options
9912
+ * @returns `true` on successful deletion
9913
+ *
9914
+ * @example
9915
+ * ```typescript
9916
+ * await client.clinical.patients.delete('pat_abc123');
9917
+ * ```
9918
+ */
9919
+ delete: async (id, options) => rb.executeDelete(deleteClinicalPatientsById, { path: { id } }, options),
9920
+ /**
9921
+ * List health metrics for a patient (related resource).
9922
+ *
9923
+ * @param patientId - Patient UUID
9924
+ * @param options - Request options
9925
+ * @returns Array of {@link ClinicalHealthMetric} records
9926
+ */
9927
+ healthMetrics: async (patientId, options) => rb.execute(
9928
+ getClinicalPatientsByIdHealthMetrics,
9929
+ { path: { id: patientId } },
9930
+ options
9931
+ ),
9932
+ /**
9933
+ * List goals for a patient (related resource).
9934
+ *
9935
+ * @param patientId - Patient UUID
9936
+ * @param options - Request options
9937
+ * @returns Array of {@link ClinicalClientGoal} records
9938
+ */
9939
+ goals: async (patientId, options) => rb.execute(
9940
+ getClinicalPatientsByIdGoals,
9941
+ { path: { id: patientId } },
9942
+ options
9943
+ ),
9944
+ /**
9945
+ * List supplements for a patient (related resource).
9946
+ *
9947
+ * @param patientId - Patient UUID
9948
+ * @param options - Request options
9949
+ * @returns Array of {@link ClinicalClientSupplement} records
9950
+ */
9951
+ supplements: async (patientId, options) => rb.execute(
9952
+ getClinicalPatientsByIdSupplements,
9953
+ { path: { id: patientId } },
9954
+ options
9955
+ ),
9956
+ /**
9957
+ * List resource assignments for a patient (related resource).
9958
+ *
9959
+ * @param patientId - Patient UUID
9960
+ * @param options - Request options
9961
+ * @returns Array of {@link ClinicalClientResourceAssignment} records
9962
+ */
9963
+ resourceAssignments: async (patientId, options) => rb.execute(
9964
+ getClinicalPatientsByIdResourceAssignments,
9965
+ { path: { id: patientId } },
9966
+ options
9967
+ ),
9968
+ /**
9969
+ * Get patient adherence summary for a given period.
9970
+ *
9971
+ * Returns goal completion rates and health metric tracking stats.
9972
+ *
9973
+ * @param patientId - Patient UUID
9974
+ * @param workspaceId - Workspace UUID (required)
9975
+ * @param days - Number of days to look back (default: 30, max: 365)
9976
+ * @param options - Request options
9977
+ * @returns {@link PatientAdherenceResponse} with goal and metric breakdowns
9978
+ *
9979
+ * @example
9980
+ * ```typescript
9981
+ * const adherence = await client.clinical.patients.getAdherence(
9982
+ * 'pat_abc123',
9983
+ * 'ws_123',
9984
+ * 30,
9985
+ * );
9986
+ * console.log(adherence.goals.completion_rate); // 0.75
9987
+ * ```
9988
+ */
9989
+ getAdherence: async (patientId, workspaceId, days, options) => {
9990
+ const qs = new URLSearchParams({ workspace_id: workspaceId });
9991
+ if (days !== void 0) qs.set("days", String(days));
9992
+ return rb.rawGet(
9993
+ `/clinical/patients/${patientId}/adherence?${qs.toString()}`,
9994
+ options
9995
+ );
9996
+ }
9997
+ },
9998
+ /**
9999
+ * Manage clinical sessions (practitioner–patient encounters).
10000
+ */
10001
+ sessions: {
10002
+ /**
10003
+ * List sessions in a workspace.
10004
+ *
10005
+ * @param params - Filter/pagination parameters
10006
+ * @param options - Request options
10007
+ * @returns Array of {@link ClinicalSession} records
10008
+ */
10009
+ list: async (params, options) => rb.execute(
10010
+ getClinicalSessions,
10011
+ params ?? {},
10012
+ options
10013
+ ),
10014
+ /**
10015
+ * Get a single session by ID.
10016
+ *
10017
+ * @param id - Session UUID
10018
+ * @param options - Request options
10019
+ * @returns {@link ClinicalSession} record
10020
+ */
10021
+ get: async (id, options) => rb.execute(
10022
+ getClinicalSessionsById,
10023
+ { path: { id } },
10024
+ options
10025
+ ),
10026
+ /**
10027
+ * Create a new clinical session.
10028
+ *
10029
+ * @param attributes - Session creation attributes. Must include `workspace_id` and `patient_id`.
10030
+ * @param options - Request options
10031
+ * @returns Created {@link ClinicalSession} record
10032
+ */
10033
+ create: async (attributes, options) => rb.execute(
10034
+ postClinicalSessions,
10035
+ { body: { data: { type: "clinical-session", attributes } } },
10036
+ options
10037
+ ),
10038
+ /**
10039
+ * Update a clinical session.
10040
+ *
10041
+ * @param id - Session UUID
10042
+ * @param attributes - Fields to update (PATCH semantics)
10043
+ * @param options - Request options
10044
+ * @returns Updated {@link ClinicalSession} record
10045
+ */
10046
+ update: async (id, attributes, options) => rb.execute(
10047
+ patchClinicalSessionsById,
10048
+ {
10049
+ path: { id },
10050
+ body: { data: { type: "clinical-session", id, attributes } }
10051
+ },
10052
+ options
10053
+ ),
10054
+ /**
10055
+ * Delete a clinical session.
10056
+ *
10057
+ * @param id - Session UUID
10058
+ * @param options - Request options
10059
+ * @returns `true` on successful deletion
10060
+ */
10061
+ delete: async (id, options) => rb.executeDelete(deleteClinicalSessionsById, { path: { id } }, options),
10062
+ /**
10063
+ * List notes for a session (related resource).
10064
+ *
10065
+ * @param sessionId - Session UUID
10066
+ * @param options - Request options
10067
+ * @returns Array of {@link ClinicalNote} records
10068
+ */
10069
+ notes: async (sessionId, options) => rb.execute(
10070
+ getClinicalSessionsByIdSessionNotes,
10071
+ { path: { id: sessionId } },
10072
+ options
10073
+ ),
10074
+ /**
10075
+ * List meal plans for a session (related resource).
10076
+ *
10077
+ * @param sessionId - Session UUID
10078
+ * @param options - Request options
10079
+ * @returns Array of {@link ClinicalMealPlan} records
10080
+ */
10081
+ mealPlans: async (sessionId, options) => rb.execute(
10082
+ getClinicalSessionsByIdMealPlans,
10083
+ { path: { id: sessionId } },
10084
+ options
10085
+ ),
10086
+ /**
10087
+ * Trigger the AI processing pipeline for a session.
10088
+ *
10089
+ * Processes the session transcript to extract clinical insights and generate notes.
10090
+ * Returns immediately with an execution ID; poll `client.agents.executions.get(id)` for results.
10091
+ *
10092
+ * @param sessionId - Session UUID
10093
+ * @param workspaceId - Workspace UUID
10094
+ * @param options - Request options
10095
+ * @returns {@link TriggerPipelineResponse} with execution_id (may be null if pipeline not configured)
10096
+ *
10097
+ * @example
10098
+ * ```typescript
10099
+ * const { execution_id } = await client.clinical.sessions.triggerPipeline(
10100
+ * 'sess_xyz',
10101
+ * 'ws_123',
10102
+ * );
10103
+ * ```
10104
+ */
10105
+ triggerPipeline: async (sessionId, workspaceId, options) => rb.rawPost(
10106
+ `/clinical/sessions/${sessionId}/trigger-pipeline`,
10107
+ { workspace_id: workspaceId },
10108
+ options
10109
+ )
10110
+ },
10111
+ /**
10112
+ * Manage clinical notes (SOAP notes, progress notes, AI-generated summaries).
10113
+ *
10114
+ * Notes support a HITL (Human-In-The-Loop) approval workflow: AI-generated
10115
+ * notes start with `status: "pending_review"` and must be approved or rejected
10116
+ * by a clinician before they are finalized.
10117
+ */
10118
+ notes: {
10119
+ /**
10120
+ * List notes, optionally filtered by patient or session.
10121
+ *
10122
+ * @param params - Filter/pagination parameters
10123
+ * @param options - Request options
10124
+ * @returns Array of {@link ClinicalNote} records
10125
+ */
10126
+ list: async (params, options) => rb.execute(getClinicalNotes, params ?? {}, options),
10127
+ /**
10128
+ * Get a single note by ID.
10129
+ *
10130
+ * @param id - Note UUID
10131
+ * @param options - Request options
10132
+ * @returns {@link ClinicalNote} record
10133
+ */
10134
+ get: async (id, options) => rb.execute(
10135
+ getClinicalNotesById,
10136
+ { path: { id } },
10137
+ options
10138
+ ),
10139
+ /**
10140
+ * Create a new clinical note.
10141
+ *
10142
+ * @param attributes - Note creation attributes. Must include `workspace_id`, `patient_id`, and `content`.
10143
+ * @param options - Request options
10144
+ * @returns Created {@link ClinicalNote} record
10145
+ */
10146
+ create: async (attributes, options) => rb.execute(
10147
+ postClinicalNotes,
10148
+ { body: { data: { type: "clinical-note", attributes } } },
10149
+ options
10150
+ ),
10151
+ /**
10152
+ * Update a clinical note.
10153
+ *
10154
+ * @param id - Note UUID
10155
+ * @param attributes - Fields to update (PATCH semantics)
10156
+ * @param options - Request options
10157
+ * @returns Updated {@link ClinicalNote} record
10158
+ */
10159
+ update: async (id, attributes, options) => rb.execute(
10160
+ patchClinicalNotesById,
10161
+ {
10162
+ path: { id },
10163
+ body: { data: { type: "clinical-note", id, attributes } }
10164
+ },
10165
+ options
10166
+ ),
10167
+ /**
10168
+ * Delete a clinical note.
10169
+ *
10170
+ * @param id - Note UUID
10171
+ * @param options - Request options
10172
+ * @returns `true` on successful deletion
10173
+ */
10174
+ delete: async (id, options) => rb.executeDelete(deleteClinicalNotesById, { path: { id } }, options),
10175
+ /**
10176
+ * Approve a clinical note (HITL workflow).
10177
+ *
10178
+ * Marks the note as clinician-reviewed and approved, transitioning it
10179
+ * to `status: "approved"`. Only notes in `pending_review` status can be approved.
10180
+ *
10181
+ * @param id - Note UUID
10182
+ * @param options - Request options
10183
+ * @returns Updated {@link ClinicalNote} record
10184
+ *
10185
+ * @example
10186
+ * ```typescript
10187
+ * const approved = await client.clinical.notes.approve('note_abc');
10188
+ * console.log(approved.attributes.status); // 'approved'
10189
+ * ```
10190
+ */
10191
+ approve: async (id, options) => rb.execute(
10192
+ patchClinicalNotesByIdApprove,
10193
+ { path: { id } },
10194
+ options
10195
+ ),
10196
+ /**
10197
+ * Reject a clinical note (HITL workflow).
10198
+ *
10199
+ * Marks the note as rejected, transitioning it to `status: "rejected"`.
10200
+ * Only notes in `pending_review` status can be rejected.
10201
+ *
10202
+ * @param id - Note UUID
10203
+ * @param options - Request options
10204
+ * @returns Updated {@link ClinicalNote} record
10205
+ *
10206
+ * @example
10207
+ * ```typescript
10208
+ * const rejected = await client.clinical.notes.reject('note_abc');
10209
+ * console.log(rejected.attributes.status); // 'rejected'
10210
+ * ```
10211
+ */
10212
+ reject: async (id, options) => rb.execute(
10213
+ patchClinicalNotesByIdReject,
10214
+ { path: { id } },
10215
+ options
10216
+ ),
10217
+ /**
10218
+ * List versions for a note (related resource).
10219
+ *
10220
+ * Each edit to an approved note creates a version record for audit purposes.
10221
+ *
10222
+ * @param noteId - Note UUID
10223
+ * @param options - Request options
10224
+ * @returns Array of {@link ClinicalNoteVersion} records
10225
+ */
10226
+ versions: async (noteId, options) => rb.execute(
10227
+ getClinicalNotesByNoteIdVersions,
10228
+ { path: { note_id: noteId } },
10229
+ options
10230
+ ),
10231
+ /**
10232
+ * Get a specific note version.
10233
+ *
10234
+ * @param noteId - Note UUID
10235
+ * @param versionId - NoteVersion UUID
10236
+ * @param options - Request options
10237
+ * @returns {@link ClinicalNoteVersion} record
10238
+ */
10239
+ getVersion: async (noteId, versionId, options) => rb.execute(
10240
+ getClinicalNotesByNoteIdVersionsById,
10241
+ { path: { note_id: noteId, id: versionId } },
10242
+ options
10243
+ )
10244
+ },
10245
+ /**
10246
+ * Manage clinical health metrics (weight, blood pressure, glucose, etc.).
10247
+ */
10248
+ healthMetrics: {
10249
+ /**
10250
+ * List health metrics, filtered by patient/workspace/date range.
10251
+ *
10252
+ * @param params - Filter/pagination parameters
10253
+ * @param options - Request options
10254
+ * @returns Array of {@link ClinicalHealthMetric} records
10255
+ */
10256
+ list: async (params, options) => rb.execute(
10257
+ getClinicalHealthMetrics,
10258
+ params ?? {},
10259
+ options
10260
+ ),
10261
+ /**
10262
+ * Get a single health metric by ID.
10263
+ *
10264
+ * @param id - HealthMetric UUID
10265
+ * @param options - Request options
10266
+ * @returns {@link ClinicalHealthMetric} record
10267
+ */
10268
+ get: async (id, options) => rb.execute(
10269
+ getClinicalHealthMetricsById,
10270
+ { path: { id } },
10271
+ options
10272
+ ),
10273
+ /**
10274
+ * Record a new health metric entry.
10275
+ *
10276
+ * @param attributes - Metric creation attributes. Must include `workspace_id`, `patient_id`,
10277
+ * `metric_category`, `metric_name`, and `value`.
10278
+ * @param options - Request options
10279
+ * @returns Created {@link ClinicalHealthMetric} record
10280
+ *
10281
+ * @example
10282
+ * ```typescript
10283
+ * const metric = await client.clinical.healthMetrics.create({
10284
+ * workspace_id: 'ws_123',
10285
+ * patient_id: 'pat_abc',
10286
+ * metric_category: 'vitals',
10287
+ * metric_name: 'weight_kg',
10288
+ * value: 82.5,
10289
+ * unit: 'kg',
10290
+ * });
10291
+ * ```
10292
+ */
10293
+ create: async (attributes, options) => rb.execute(
10294
+ postClinicalHealthMetrics,
10295
+ { body: { data: { type: "clinical-health-metric", attributes } } },
10296
+ options
10297
+ ),
10298
+ /**
10299
+ * Update a health metric entry.
10300
+ *
10301
+ * @param id - HealthMetric UUID
10302
+ * @param attributes - Fields to update (PATCH semantics)
10303
+ * @param options - Request options
10304
+ * @returns Updated {@link ClinicalHealthMetric} record
10305
+ */
10306
+ update: async (id, attributes, options) => rb.execute(
10307
+ patchClinicalHealthMetricsById,
10308
+ {
10309
+ path: { id },
10310
+ body: { data: { type: "clinical-health-metric", id, attributes } }
10311
+ },
10312
+ options
10313
+ ),
10314
+ /**
10315
+ * Delete a health metric entry.
10316
+ *
10317
+ * @param id - HealthMetric UUID
10318
+ * @param options - Request options
10319
+ * @returns `true` on successful deletion
10320
+ */
10321
+ delete: async (id, options) => rb.executeDelete(
10322
+ deleteClinicalHealthMetricsById,
10323
+ { path: { id } },
10324
+ options
10325
+ )
10326
+ },
10327
+ /**
10328
+ * Manage meal plans for clinical patients.
10329
+ */
10330
+ mealPlans: {
10331
+ /**
10332
+ * List meal plans, filtered by patient/workspace.
10333
+ *
10334
+ * @param params - Filter/pagination parameters
10335
+ * @param options - Request options
10336
+ * @returns Array of {@link ClinicalMealPlan} records
10337
+ */
10338
+ list: async (params, options) => rb.execute(
10339
+ getClinicalMealPlans,
10340
+ params ?? {},
10341
+ options
10342
+ ),
10343
+ /**
10344
+ * Get a single meal plan by ID.
10345
+ *
10346
+ * @param id - MealPlan UUID
10347
+ * @param options - Request options
10348
+ * @returns {@link ClinicalMealPlan} record
10349
+ */
10350
+ get: async (id, options) => rb.execute(
10351
+ getClinicalMealPlansById,
10352
+ { path: { id } },
10353
+ options
10354
+ ),
10355
+ /**
10356
+ * Create a new meal plan.
10357
+ *
10358
+ * @param attributes - Meal plan creation attributes. Must include `workspace_id`, `patient_id`, and `title`.
10359
+ * @param options - Request options
10360
+ * @returns Created {@link ClinicalMealPlan} record
10361
+ */
10362
+ create: async (attributes, options) => rb.execute(
10363
+ postClinicalMealPlans,
10364
+ { body: { data: { type: "clinical-meal-plan", attributes } } },
10365
+ options
10366
+ ),
10367
+ /**
10368
+ * Update a meal plan.
10369
+ *
10370
+ * @param id - MealPlan UUID
10371
+ * @param attributes - Fields to update (PATCH semantics)
10372
+ * @param options - Request options
10373
+ * @returns Updated {@link ClinicalMealPlan} record
10374
+ */
10375
+ update: async (id, attributes, options) => rb.execute(
10376
+ patchClinicalMealPlansById,
10377
+ {
10378
+ path: { id },
10379
+ body: { data: { type: "clinical-meal-plan", id, attributes } }
10380
+ },
10381
+ options
10382
+ ),
10383
+ /**
10384
+ * Delete a meal plan.
10385
+ *
10386
+ * @param id - MealPlan UUID
10387
+ * @param options - Request options
10388
+ * @returns `true` on successful deletion
10389
+ */
10390
+ delete: async (id, options) => rb.executeDelete(
10391
+ deleteClinicalMealPlansById,
10392
+ { path: { id } },
10393
+ options
10394
+ )
10395
+ },
10396
+ /**
10397
+ * Manage client goals (therapeutic targets and wellness milestones).
10398
+ */
10399
+ clientGoals: {
10400
+ /**
10401
+ * List client goals, filtered by patient/workspace.
10402
+ *
10403
+ * @param params - Filter/pagination parameters
10404
+ * @param options - Request options
10405
+ * @returns Array of {@link ClinicalClientGoal} records
10406
+ */
10407
+ list: async (params, options) => rb.execute(
10408
+ getClinicalClientGoals,
10409
+ params ?? {},
10410
+ options
10411
+ ),
10412
+ /**
10413
+ * Get a single client goal by ID.
10414
+ *
10415
+ * @param id - ClientGoal UUID
10416
+ * @param options - Request options
10417
+ * @returns {@link ClinicalClientGoal} record
10418
+ */
10419
+ get: async (id, options) => rb.execute(
10420
+ getClinicalClientGoalsById,
10421
+ { path: { id } },
10422
+ options
10423
+ ),
10424
+ /**
10425
+ * Create a new client goal.
10426
+ *
10427
+ * @param attributes - Goal creation attributes. Must include `workspace_id`, `patient_id`, and `title`.
10428
+ * @param options - Request options
10429
+ * @returns Created {@link ClinicalClientGoal} record
10430
+ */
10431
+ create: async (attributes, options) => rb.execute(
10432
+ postClinicalClientGoals,
10433
+ { body: { data: { type: "clinical-client-goal", attributes } } },
10434
+ options
10435
+ ),
10436
+ /**
10437
+ * Update a client goal.
10438
+ *
10439
+ * @param id - ClientGoal UUID
10440
+ * @param attributes - Fields to update (PATCH semantics)
10441
+ * @param options - Request options
10442
+ * @returns Updated {@link ClinicalClientGoal} record
10443
+ */
10444
+ update: async (id, attributes, options) => rb.execute(
10445
+ patchClinicalClientGoalsById,
10446
+ {
10447
+ path: { id },
10448
+ body: { data: { type: "clinical-client-goal", id, attributes } }
10449
+ },
10450
+ options
10451
+ ),
10452
+ /**
10453
+ * Delete a client goal.
10454
+ *
10455
+ * @param id - ClientGoal UUID
10456
+ * @param options - Request options
10457
+ * @returns `true` on successful deletion
10458
+ */
10459
+ delete: async (id, options) => rb.executeDelete(
10460
+ deleteClinicalClientGoalsById,
10461
+ { path: { id } },
10462
+ options
10463
+ )
10464
+ },
10465
+ /**
10466
+ * Manage supplement prescriptions for clinical patients.
10467
+ */
10468
+ clientSupplements: {
10469
+ /**
10470
+ * List supplement prescriptions, filtered by patient/workspace.
10471
+ *
10472
+ * @param params - Filter/pagination parameters
10473
+ * @param options - Request options
10474
+ * @returns Array of {@link ClinicalClientSupplement} records
10475
+ */
10476
+ list: async (params, options) => rb.execute(
10477
+ getClinicalClientSupplements,
10478
+ params ?? {},
10479
+ options
10480
+ ),
10481
+ /**
10482
+ * Get a single supplement prescription by ID.
10483
+ *
10484
+ * @param id - ClientSupplement UUID
10485
+ * @param options - Request options
10486
+ * @returns {@link ClinicalClientSupplement} record
10487
+ */
10488
+ get: async (id, options) => rb.execute(
10489
+ getClinicalClientSupplementsById,
10490
+ { path: { id } },
10491
+ options
10492
+ ),
10493
+ /**
10494
+ * Create a new supplement prescription.
10495
+ *
10496
+ * @param attributes - Supplement creation attributes. Must include `workspace_id`,
10497
+ * `patient_id`, and `supplement_name`.
10498
+ * @param options - Request options
10499
+ * @returns Created {@link ClinicalClientSupplement} record
10500
+ */
10501
+ create: async (attributes, options) => rb.execute(
10502
+ postClinicalClientSupplements,
10503
+ {
10504
+ body: { data: { type: "clinical-client-supplement", attributes } }
10505
+ },
10506
+ options
10507
+ ),
10508
+ /**
10509
+ * Update a supplement prescription.
10510
+ *
10511
+ * @param id - ClientSupplement UUID
10512
+ * @param attributes - Fields to update (PATCH semantics)
10513
+ * @param options - Request options
10514
+ * @returns Updated {@link ClinicalClientSupplement} record
10515
+ */
10516
+ update: async (id, attributes, options) => rb.execute(
10517
+ patchClinicalClientSupplementsById,
10518
+ {
10519
+ path: { id },
10520
+ body: {
10521
+ data: { type: "clinical-client-supplement", id, attributes }
10522
+ }
10523
+ },
10524
+ options
10525
+ ),
10526
+ /**
10527
+ * Delete a supplement prescription.
10528
+ *
10529
+ * @param id - ClientSupplement UUID
10530
+ * @param options - Request options
10531
+ * @returns `true` on successful deletion
10532
+ */
10533
+ delete: async (id, options) => rb.executeDelete(
10534
+ deleteClinicalClientSupplementsById,
10535
+ { path: { id } },
10536
+ options
10537
+ )
10538
+ },
10539
+ /**
10540
+ * Manage clinical deliveries (care plan items sent to patients).
10541
+ */
10542
+ deliveries: {
10543
+ /**
10544
+ * List deliveries, filtered by patient/workspace.
10545
+ *
10546
+ * @param params - Filter/pagination parameters
10547
+ * @param options - Request options
10548
+ * @returns Array of {@link ClinicalDelivery} records
10549
+ */
10550
+ list: async (params, options) => rb.execute(
10551
+ getClinicalDeliveries,
10552
+ params ?? {},
10553
+ options
10554
+ ),
10555
+ /**
10556
+ * Get a single delivery by ID.
10557
+ *
10558
+ * @param id - Delivery UUID
10559
+ * @param options - Request options
10560
+ * @returns {@link ClinicalDelivery} record
10561
+ */
10562
+ get: async (id, options) => rb.execute(
10563
+ getClinicalDeliveriesById,
10564
+ { path: { id } },
10565
+ options
10566
+ ),
10567
+ /**
10568
+ * Create a new delivery.
10569
+ *
10570
+ * @param attributes - Delivery creation attributes. Must include `workspace_id`,
10571
+ * `patient_id`, and `delivery_type`.
10572
+ * @param options - Request options
10573
+ * @returns Created {@link ClinicalDelivery} record
10574
+ */
10575
+ create: async (attributes, options) => rb.execute(
10576
+ postClinicalDeliveries,
10577
+ { body: { data: { type: "clinical-delivery", attributes } } },
10578
+ options
10579
+ ),
10580
+ /**
10581
+ * Update a delivery (e.g., change status to `delivered`).
10582
+ *
10583
+ * @param id - Delivery UUID
10584
+ * @param attributes - Fields to update (PATCH semantics)
10585
+ * @param options - Request options
10586
+ * @returns Updated {@link ClinicalDelivery} record
10587
+ */
10588
+ update: async (id, attributes, options) => rb.execute(
10589
+ patchClinicalDeliveriesById,
10590
+ {
10591
+ path: { id },
10592
+ body: { data: { type: "clinical-delivery", id, attributes } }
10593
+ },
10594
+ options
10595
+ )
10596
+ },
10597
+ /**
10598
+ * Manage practice-level educational resources.
10599
+ */
10600
+ practiceResources: {
10601
+ /**
10602
+ * List practice resources in a workspace.
10603
+ *
10604
+ * @param params - Filter/pagination parameters
10605
+ * @param options - Request options
10606
+ * @returns Array of {@link ClinicalPracticeResource} records
10607
+ */
10608
+ list: async (params, options) => rb.execute(
10609
+ getClinicalPracticeResources,
10610
+ params ?? {},
10611
+ options
10612
+ ),
10613
+ /**
10614
+ * Get a single practice resource by ID.
10615
+ *
10616
+ * @param id - PracticeResource UUID
10617
+ * @param options - Request options
10618
+ * @returns {@link ClinicalPracticeResource} record
10619
+ */
10620
+ get: async (id, options) => rb.execute(
10621
+ getClinicalPracticeResourcesById,
10622
+ { path: { id } },
10623
+ options
10624
+ ),
10625
+ /**
10626
+ * Create a new practice resource.
10627
+ *
10628
+ * @param attributes - Resource creation attributes. Must include `workspace_id` and `title`.
10629
+ * @param options - Request options
10630
+ * @returns Created {@link ClinicalPracticeResource} record
10631
+ */
10632
+ create: async (attributes, options) => rb.execute(
10633
+ postClinicalPracticeResources,
10634
+ {
10635
+ body: { data: { type: "clinical-practice-resource", attributes } }
10636
+ },
10637
+ options
10638
+ ),
10639
+ /**
10640
+ * Update a practice resource.
10641
+ *
10642
+ * @param id - PracticeResource UUID
10643
+ * @param attributes - Fields to update (PATCH semantics)
10644
+ * @param options - Request options
10645
+ * @returns Updated {@link ClinicalPracticeResource} record
10646
+ */
10647
+ update: async (id, attributes, options) => rb.execute(
10648
+ patchClinicalPracticeResourcesById,
10649
+ {
10650
+ path: { id },
10651
+ body: {
10652
+ data: { type: "clinical-practice-resource", id, attributes }
10653
+ }
10654
+ },
10655
+ options
10656
+ ),
10657
+ /**
10658
+ * Delete a practice resource.
9156
10659
  *
9157
- * @example
9158
- * ```typescript
9159
- * const client = new GptClient({ apiKey: 'sk_app_...' });
9160
- *
9161
- * await client.catalog.taxonomies.delete('tax_abc123');
9162
- * ```
10660
+ * @param id - PracticeResource UUID
10661
+ * @param options - Request options
10662
+ * @returns `true` on successful deletion
9163
10663
  */
9164
- delete: async (id, options) => {
9165
- return rb.executeDelete(
9166
- deleteCatalogTaxonomiesById,
9167
- { path: { id } },
9168
- options
9169
- );
9170
- }
10664
+ delete: async (id, options) => rb.executeDelete(
10665
+ deleteClinicalPracticeResourcesById,
10666
+ { path: { id } },
10667
+ options
10668
+ )
9171
10669
  },
9172
10670
  /**
9173
- * Taxonomy nodes individual nodes within a taxonomy tree.
9174
- *
9175
- * Each node represents a single category (e.g. "T-Shirts") within a
9176
- * taxonomy. Nodes can be nested to arbitrary depth by setting a
9177
- * `parent_node_id`, forming the hierarchical tree. A node with no parent
9178
- * is a root-level category.
10671
+ * Manage practice-level assessment and therapeutic tools.
9179
10672
  */
9180
- taxonomyNodes: {
10673
+ practiceTools: {
9181
10674
  /**
9182
- * List all nodes that belong to a specific taxonomy.
10675
+ * List practice tools in a workspace.
9183
10676
  *
9184
- * Returns the full flat list of nodes for the taxonomy. To reconstruct
9185
- * the tree, group nodes by their `parent_node_id` field.
10677
+ * @param params - Filter/pagination parameters
10678
+ * @param options - Request options
10679
+ * @returns Array of {@link ClinicalPracticeTool} records
10680
+ */
10681
+ list: async (params, options) => rb.execute(
10682
+ getClinicalPracticeTools,
10683
+ params ?? {},
10684
+ options
10685
+ ),
10686
+ /**
10687
+ * Get a single practice tool by ID.
9186
10688
  *
9187
- * @param taxonomyId - The ID of the taxonomy whose nodes to list.
9188
- * @param options - Optional request-level overrides.
9189
- * @returns A promise that resolves to an array of {@link CatalogTaxonomyNode} records.
10689
+ * @param id - PracticeTool UUID
10690
+ * @param options - Request options
10691
+ * @returns {@link ClinicalPracticeTool} record
10692
+ */
10693
+ get: async (id, options) => rb.execute(
10694
+ getClinicalPracticeToolsById,
10695
+ { path: { id } },
10696
+ options
10697
+ ),
10698
+ /**
10699
+ * Create a new practice tool.
9190
10700
  *
9191
- * @example
9192
- * ```typescript
9193
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10701
+ * @param attributes - Tool creation attributes. Must include `workspace_id` and `name`.
10702
+ * @param options - Request options
10703
+ * @returns Created {@link ClinicalPracticeTool} record
10704
+ */
10705
+ create: async (attributes, options) => rb.execute(
10706
+ postClinicalPracticeTools,
10707
+ { body: { data: { type: "clinical-practice-tool", attributes } } },
10708
+ options
10709
+ ),
10710
+ /**
10711
+ * Update a practice tool.
9194
10712
  *
9195
- * const nodes = await client.catalog.taxonomyNodes.listByTaxonomy('tax_abc123');
9196
- * const roots = nodes.filter((n) => !n.attributes.parent_node_id);
9197
- * console.log('Root categories:', roots.map((n) => n.attributes.name));
9198
- * ```
10713
+ * @param id - PracticeTool UUID
10714
+ * @param attributes - Fields to update (PATCH semantics)
10715
+ * @param options - Request options
10716
+ * @returns Updated {@link ClinicalPracticeTool} record
9199
10717
  */
9200
- listByTaxonomy: async (taxonomyId, options) => {
9201
- return rb.execute(
9202
- getCatalogTaxonomyNodesTaxonomyByTaxonomyId,
9203
- { path: { taxonomy_id: taxonomyId } },
9204
- options
9205
- );
9206
- },
10718
+ update: async (id, attributes, options) => rb.execute(
10719
+ patchClinicalPracticeToolsById,
10720
+ {
10721
+ path: { id },
10722
+ body: { data: { type: "clinical-practice-tool", id, attributes } }
10723
+ },
10724
+ options
10725
+ ),
9207
10726
  /**
9208
- * Fetch a single taxonomy node by its unique ID.
10727
+ * Delete a practice tool.
9209
10728
  *
9210
- * @param id - The unique identifier of the node to retrieve.
9211
- * @param options - Optional request-level overrides.
9212
- * @returns A promise that resolves to the matching {@link CatalogTaxonomyNode}.
10729
+ * @param id - PracticeTool UUID
10730
+ * @param options - Request options
10731
+ * @returns `true` on successful deletion
10732
+ */
10733
+ delete: async (id, options) => rb.executeDelete(
10734
+ deleteClinicalPracticeToolsById,
10735
+ { path: { id } },
10736
+ options
10737
+ )
10738
+ },
10739
+ /**
10740
+ * Manage assignments of practice resources to patients.
10741
+ */
10742
+ clientResourceAssignments: {
10743
+ /**
10744
+ * List resource assignments, filtered by patient/workspace.
9213
10745
  *
9214
- * @example
9215
- * ```typescript
9216
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10746
+ * @param params - Filter/pagination parameters
10747
+ * @param options - Request options
10748
+ * @returns Array of {@link ClinicalClientResourceAssignment} records
10749
+ */
10750
+ list: async (params, options) => rb.execute(
10751
+ getClinicalClientResourceAssignments,
10752
+ params ?? {},
10753
+ options
10754
+ ),
10755
+ /**
10756
+ * Get a single resource assignment by ID.
9217
10757
  *
9218
- * const node = await client.catalog.taxonomyNodes.get('node_abc123');
9219
- * console.log(node.attributes.name, node.attributes.parent_node_id);
9220
- * ```
10758
+ * @param id - ClientResourceAssignment UUID
10759
+ * @param options - Request options
10760
+ * @returns {@link ClinicalClientResourceAssignment} record
9221
10761
  */
9222
- get: async (id, options) => {
9223
- return rb.execute(
9224
- getCatalogTaxonomyNodesById,
9225
- { path: { id } },
9226
- options
9227
- );
9228
- },
10762
+ get: async (id, options) => rb.execute(
10763
+ getClinicalClientResourceAssignmentsById,
10764
+ { path: { id } },
10765
+ options
10766
+ ),
9229
10767
  /**
9230
- * Create a new node within a taxonomy.
10768
+ * Assign a practice resource to a patient.
9231
10769
  *
9232
- * To create a root-level category, omit `parent_node_id`. To nest a
9233
- * category under an existing node, include `parent_node_id` pointing to
9234
- * the parent's ID.
10770
+ * @param attributes - Assignment creation attributes. Must include `workspace_id`,
10771
+ * `patient_id`, and `resource_id`.
10772
+ * @param options - Request options
10773
+ * @returns Created {@link ClinicalClientResourceAssignment} record
10774
+ */
10775
+ create: async (attributes, options) => rb.execute(
10776
+ postClinicalClientResourceAssignments,
10777
+ {
10778
+ body: {
10779
+ data: { type: "clinical-client-resource-assignment", attributes }
10780
+ }
10781
+ },
10782
+ options
10783
+ ),
10784
+ /**
10785
+ * Update a resource assignment (e.g., mark as completed).
9235
10786
  *
9236
- * @param attributes - Key/value map of node attributes. Must include
9237
- * `taxonomy_id` and `name`. Optionally include `parent_node_id` to
9238
- * nest the node within the tree.
9239
- * @param options - Optional request-level overrides.
9240
- * @returns A promise that resolves to the newly created {@link CatalogTaxonomyNode}.
10787
+ * @param id - ClientResourceAssignment UUID
10788
+ * @param attributes - Fields to update (PATCH semantics)
10789
+ * @param options - Request options
10790
+ * @returns Updated {@link ClinicalClientResourceAssignment} record
10791
+ */
10792
+ update: async (id, attributes, options) => rb.execute(
10793
+ patchClinicalClientResourceAssignmentsById,
10794
+ {
10795
+ path: { id },
10796
+ body: {
10797
+ data: {
10798
+ type: "clinical-client-resource-assignment",
10799
+ id,
10800
+ attributes
10801
+ }
10802
+ }
10803
+ },
10804
+ options
10805
+ ),
10806
+ /**
10807
+ * Delete a resource assignment.
9241
10808
  *
9242
- * @example
9243
- * ```typescript
9244
- * const client = new GptClient({ apiKey: 'sk_app_...' });
10809
+ * @param id - ClientResourceAssignment UUID
10810
+ * @param options - Request options
10811
+ * @returns `true` on successful deletion
10812
+ */
10813
+ delete: async (id, options) => rb.executeDelete(
10814
+ deleteClinicalClientResourceAssignmentsById,
10815
+ { path: { id } },
10816
+ options
10817
+ )
10818
+ },
10819
+ /**
10820
+ * Read-only access to the AI-generated supplement recommendation cache.
10821
+ *
10822
+ * This resource is server-managed — entries are created and updated
10823
+ * exclusively by the AI post-session pipeline. Direct create/update
10824
+ * operations are not supported.
10825
+ */
10826
+ supplementRecCache: {
10827
+ /**
10828
+ * List supplement recommendation cache entries, filtered by patient/workspace.
9245
10829
  *
9246
- * // Create a root-level category
9247
- * const clothing = await client.catalog.taxonomyNodes.create({
9248
- * taxonomy_id: 'tax_abc123',
9249
- * name: 'Clothing',
9250
- * });
10830
+ * @param params - Filter/pagination parameters
10831
+ * @param options - Request options
10832
+ * @returns Array of {@link ClinicalSupplementRecCache} records
10833
+ */
10834
+ list: async (params, options) => rb.execute(
10835
+ getClinicalSupplementRecCache,
10836
+ params ?? {},
10837
+ options
10838
+ ),
10839
+ /**
10840
+ * Get a single supplement recommendation cache entry by ID.
9251
10841
  *
9252
- * // Create a child category under 'Clothing'
9253
- * const tops = await client.catalog.taxonomyNodes.create({
9254
- * taxonomy_id: 'tax_abc123',
9255
- * name: 'Tops',
9256
- * parent_node_id: clothing.id,
9257
- * });
9258
- * ```
10842
+ * @param id - SupplementRecCache UUID
10843
+ * @param options - Request options
10844
+ * @returns {@link ClinicalSupplementRecCache} record
9259
10845
  */
9260
- create: async (attributes, options) => {
9261
- return rb.execute(
9262
- postCatalogTaxonomyNodes,
9263
- {
9264
- body: {
9265
- data: { type: "catalog_taxonomy_node", attributes }
9266
- }
9267
- },
9268
- options
9269
- );
9270
- },
10846
+ get: async (id, options) => rb.execute(
10847
+ getClinicalSupplementRecCacheById,
10848
+ { path: { id } },
10849
+ options
10850
+ ),
9271
10851
  /**
9272
- * Update an existing taxonomy node's attributes.
10852
+ * Generate supplement recommendations for a patient via the AI pipeline.
9273
10853
  *
9274
- * Only the fields present in `attributes` are changed (PATCH semantics).
9275
- * You can use this to rename a category or re-parent it within the tree
9276
- * by changing `parent_node_id`.
10854
+ * Returns immediately with an execution ID; poll executions for results.
10855
+ * The AI pipeline populates the supplement recommendation cache entries
10856
+ * once the execution completes.
9277
10857
  *
9278
- * @param id - The unique identifier of the node to update.
9279
- * @param attributes - Key/value map of attributes to change.
9280
- * @param options - Optional request-level overrides.
9281
- * @returns A promise that resolves to the updated {@link CatalogTaxonomyNode}.
10858
+ * @param patientId - Patient UUID
10859
+ * @param sessionId - Session UUID to base recommendations on
10860
+ * @param workspaceId - Workspace UUID
10861
+ * @param options - Request options
10862
+ * @returns {@link GenerateSupplementRecsResponse} with execution_id
9282
10863
  *
9283
10864
  * @example
9284
10865
  * ```typescript
9285
- * const client = new GptClient({ apiKey: 'sk_app_...' });
9286
- *
9287
- * // Rename a category
9288
- * const node = await client.catalog.taxonomyNodes.update('node_abc123', {
9289
- * name: 'Apparel',
9290
- * });
9291
- * console.log(node.attributes.name); // 'Apparel'
10866
+ * const { execution_id } = await client.clinical.supplementRecCache.generate(
10867
+ * 'pat_abc123',
10868
+ * 'sess_xyz',
10869
+ * 'ws_123',
10870
+ * );
9292
10871
  * ```
9293
10872
  */
9294
- update: async (id, attributes, options) => {
9295
- return rb.execute(
9296
- patchCatalogTaxonomyNodesById,
9297
- {
9298
- path: { id },
9299
- body: {
9300
- data: { type: "catalog_taxonomy_node", id, attributes }
9301
- }
9302
- },
9303
- options
9304
- );
9305
- },
10873
+ generate: async (patientId, sessionId, workspaceId, options) => rb.rawPost(
10874
+ `/clinical/patients/${patientId}/supplement-recommendations/generate`,
10875
+ { session_id: sessionId, workspace_id: workspaceId },
10876
+ options
10877
+ ),
9306
10878
  /**
9307
- * Permanently delete a taxonomy node.
10879
+ * Delete a supplement recommendation cache entry.
9308
10880
  *
9309
- * If the node has child nodes, those children will also be removed
9310
- * recursively. Ensure products are re-categorised before deleting a node
9311
- * that has products assigned to it.
10881
+ * @param id - SupplementRecCache UUID
10882
+ * @param options - Request options
10883
+ * @returns `true` on successful deletion
10884
+ */
10885
+ delete: async (id, options) => rb.executeDelete(
10886
+ deleteClinicalSupplementRecCacheById,
10887
+ { path: { id } },
10888
+ options
10889
+ )
10890
+ },
10891
+ /**
10892
+ * Recipe search via configured Edamam connector.
10893
+ */
10894
+ recipes: {
10895
+ /**
10896
+ * Search recipes using a connected Edamam API integration.
9312
10897
  *
9313
- * @param id - The unique identifier of the node to delete.
9314
- * @param options - Optional request-level overrides.
9315
- * @returns A promise that resolves to `true` on successful deletion.
10898
+ * Requires an Edamam connector to be configured in the workspace.
10899
+ * Returns raw Edamam API response data.
10900
+ *
10901
+ * @param params - Search parameters. Must include `query`, `connector_id`, and `workspace_id`.
10902
+ * @param options - Request options
10903
+ * @returns Edamam API search results
9316
10904
  *
9317
10905
  * @example
9318
10906
  * ```typescript
9319
- * const client = new GptClient({ apiKey: 'sk_app_...' });
9320
- *
9321
- * await client.catalog.taxonomyNodes.delete('node_abc123');
10907
+ * const results = await client.clinical.recipes.search({
10908
+ * query: 'high protein lunch',
10909
+ * connector_id: 'conn_edamam_123',
10910
+ * workspace_id: 'ws_123',
10911
+ * diet: 'high-protein',
10912
+ * });
9322
10913
  * ```
9323
10914
  */
9324
- delete: async (id, options) => {
9325
- return rb.executeDelete(
9326
- deleteCatalogTaxonomyNodesById,
9327
- { path: { id } },
9328
- options
9329
- );
9330
- }
10915
+ search: async (params, options) => rb.rawPost(`/clinical/recipes/search`, params, options)
9331
10916
  }
9332
10917
  };
9333
10918
  }
@@ -21711,6 +23296,46 @@ function createThreadsNamespace(rb) {
21711
23296
  options,
21712
23297
  streamOptions
21713
23298
  );
23299
+ },
23300
+ /**
23301
+ * Full-text substring search across message content.
23302
+ *
23303
+ * @param query - Substring to match against message content.
23304
+ * @param options - Optional request options.
23305
+ * @returns A promise resolving to an array of matching `Message` objects.
23306
+ *
23307
+ * @example
23308
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
23309
+ * const results = await client.threads.messages.search('deadline');
23310
+ */
23311
+ search: async (query, options) => {
23312
+ return rb.execute(
23313
+ getMessagesSearch,
23314
+ { query: { filter: { query } } },
23315
+ options
23316
+ );
23317
+ },
23318
+ /**
23319
+ * Vector similarity search across messages using a generated embedding.
23320
+ *
23321
+ * Returns messages ranked by cosine similarity (threshold > 0.6).
23322
+ * Requires embeddings to have been generated via the async vectorization pipeline.
23323
+ *
23324
+ * @param query - Natural-language query string to embed and search.
23325
+ * @param limit - Maximum number of results (default: 10).
23326
+ * @param options - Optional request options.
23327
+ * @returns A promise resolving to an array of semantically similar `Message` objects.
23328
+ *
23329
+ * @example
23330
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
23331
+ * const results = await client.threads.messages.semanticSearch('unpaid invoices', 5);
23332
+ */
23333
+ semanticSearch: async (query, limit = 10, options) => {
23334
+ return rb.execute(
23335
+ getMessagesSemanticSearch,
23336
+ { query: { filter: { query, limit } } },
23337
+ options
23338
+ );
21714
23339
  }
21715
23340
  },
21716
23341
  /**
@@ -21781,6 +23406,26 @@ function createThreadsNamespace(rb) {
21781
23406
  options,
21782
23407
  streamOptions
21783
23408
  );
23409
+ },
23410
+ /**
23411
+ * Full-text search threads by title or context summary.
23412
+ *
23413
+ * @param query - The search query string.
23414
+ * @param options - Optional request options.
23415
+ * @returns A promise resolving to an array of matching `Thread` objects.
23416
+ *
23417
+ * @example
23418
+ * ```typescript
23419
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
23420
+ * const results = await client.threads.search('invoice review');
23421
+ * ```
23422
+ */
23423
+ search: async (query, options) => {
23424
+ return rb.execute(
23425
+ getThreadsSearch,
23426
+ { query: { filter: { query } } },
23427
+ options
23428
+ );
21784
23429
  }
21785
23430
  };
21786
23431
  }
@@ -24393,8 +26038,52 @@ function createWebhooksNamespace(rb) {
24393
26038
  { path: { id }, body: {} },
24394
26039
  options
24395
26040
  );
26041
+ },
26042
+ /**
26043
+ * Returns aggregated statistics across all webhook configurations.
26044
+ *
26045
+ * Provides counts of total, enabled, and disabled configs along with
26046
+ * the overall delivery success rate. Useful for monitoring webhook
26047
+ * health at a glance.
26048
+ *
26049
+ * @param options - Optional request options.
26050
+ * @returns An object containing webhook config statistics.
26051
+ *
26052
+ * @example
26053
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
26054
+ * const stats = await client.webhooks.configs.stats();
26055
+ * console.log(`Total: ${stats.total}, Enabled: ${stats.enabled}`);
26056
+ */
26057
+ stats: async (options) => {
26058
+ return rb.execute(
26059
+ getWebhookConfigsStats,
26060
+ {},
26061
+ options
26062
+ );
24396
26063
  }
24397
26064
  },
26065
+ /**
26066
+ * Lists all available webhook event types supported by the platform.
26067
+ *
26068
+ * Returns the complete event catalog. Use this to discover which event
26069
+ * types exist, understand their payload shape, and validate the `events`
26070
+ * array when registering or updating webhook configs. The endpoint does
26071
+ * not require authentication.
26072
+ *
26073
+ * @param options - Optional request options.
26074
+ * @returns A promise that resolves to an array of event type descriptors,
26075
+ * each with `type` (the event name string), `description`, and
26076
+ * `data_object` (the resource type the payload describes).
26077
+ *
26078
+ * @example
26079
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
26080
+ * const types = await client.webhooks.listEventTypes();
26081
+ * console.log(types.map(t => t.type));
26082
+ * // ['agent.execution.completed', 'document.processed', ...]
26083
+ */
26084
+ listEventTypes: async (options) => {
26085
+ return rb.rawGet("/webhook-event-types", options);
26086
+ },
24398
26087
  /**
24399
26088
  * Sub-namespace for inspecting and retrying webhook delivery records.
24400
26089
  *
@@ -24462,53 +26151,26 @@ function createWebhooksNamespace(rb) {
24462
26151
  );
24463
26152
  },
24464
26153
  /**
24465
- * Creates a new webhook delivery record manually.
24466
- *
24467
- * In most cases delivery records are created automatically by the platform
24468
- * when events are dispatched. This lower-level method is provided for
24469
- * advanced use cases such as re-importing delivery history or triggering
24470
- * synthetic deliveries in testing environments.
24471
- *
24472
- * @param attributes - Delivery attributes including at minimum
24473
- * `webhook_config_id` and `event_type`.
24474
- * @param options - Optional request options.
24475
- * @returns A promise that resolves to the created `WebhookDelivery` object.
24476
- *
24477
- * @example
24478
- * const client = new GptClient({ apiKey: 'sk_app_...' });
24479
- * const delivery = await client.webhooks.deliveries.create({
24480
- * webhook_config_id: 'whc_01HXYZ...',
24481
- * event_type: 'agent.execution.completed',
24482
- * });
24483
- */
24484
- create: async (attributes, options) => {
24485
- return rb.execute(
24486
- postWebhookDeliveriesBulkRetry,
24487
- { body: { data: { type: "webhook_delivery", attributes } } },
24488
- options
24489
- );
24490
- },
24491
- /**
24492
- * Retries a specific failed webhook delivery.
26154
+ * Retries a specific failed webhook delivery by its ID.
24493
26155
  *
24494
26156
  * Triggers a new HTTP POST attempt to the webhook endpoint using the
24495
26157
  * original event payload. The delivery record is updated with the result
24496
26158
  * of the retry attempt.
24497
26159
  *
24498
- * @param options - Optional request options. Pass the delivery ID via
24499
- * request parameters to target a specific failed delivery.
26160
+ * @param id - The UUID of the webhook delivery record to retry.
26161
+ * @param options - Optional request options.
24500
26162
  * @returns A promise that resolves to the updated `WebhookDelivery` object
24501
26163
  * after the retry attempt.
24502
26164
  *
24503
26165
  * @example
24504
26166
  * const client = new GptClient({ apiKey: 'sk_app_...' });
24505
- * const retried = await client.webhooks.deliveries.retry();
26167
+ * const retried = await client.webhooks.deliveries.retry('wdl_01HXYZ...');
24506
26168
  * console.log(`Retry status: ${retried.attributes.response_status}`);
24507
26169
  */
24508
- retry: async (options) => {
26170
+ retry: async (id, options) => {
24509
26171
  return rb.execute(
24510
- postWebhookDeliveriesBulkRetry,
24511
- {},
26172
+ postWebhookDeliveriesByIdRetry,
26173
+ { path: { id }, body: {} },
24512
26174
  options
24513
26175
  );
24514
26176
  },
@@ -24559,6 +26221,27 @@ function createWebhooksNamespace(rb) {
24559
26221
  { path: { id } },
24560
26222
  options
24561
26223
  );
26224
+ },
26225
+ /**
26226
+ * Returns aggregate delivery counts by status.
26227
+ *
26228
+ * Provides total, delivered, failed, and retrying counts. Useful for
26229
+ * monitoring dashboards and health checks.
26230
+ *
26231
+ * @param options - Optional request options.
26232
+ * @returns An object with `total`, `delivered`, `failed`, and `retrying` counts.
26233
+ *
26234
+ * @example
26235
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
26236
+ * const stats = await client.webhooks.deliveries.stats();
26237
+ * console.log(`Failed deliveries: ${stats.failed}`);
26238
+ */
26239
+ stats: async (options) => {
26240
+ return rb.execute(
26241
+ getWebhookDeliveriesStats,
26242
+ {},
26243
+ options
26244
+ );
24562
26245
  }
24563
26246
  }
24564
26247
  };
@@ -24615,6 +26298,327 @@ function createPipelinesNamespace(rb) {
24615
26298
  };
24616
26299
  }
24617
26300
 
26301
+ // src/namespaces/access-grants.ts
26302
+ function createAccessGrantsNamespace(rb) {
26303
+ return {
26304
+ /**
26305
+ * List access grants for the authenticated user's workspace.
26306
+ *
26307
+ * @param params - Optional filter parameters (subject_id, object_id, object_type, relation)
26308
+ * @returns Paginated list of access grants
26309
+ * @example
26310
+ * const grants = await client.accessGrants.list({ object_id: workspaceId });
26311
+ */
26312
+ async list(params) {
26313
+ const query = params ? `?${new URLSearchParams(params).toString()}` : "";
26314
+ return rb.rawGet(`/access-grants${query}`);
26315
+ },
26316
+ /**
26317
+ * Get a single access grant by ID.
26318
+ *
26319
+ * @param id - AccessGrant UUID
26320
+ * @returns The access grant record
26321
+ * @example
26322
+ * const grant = await client.accessGrants.get("grant-uuid");
26323
+ */
26324
+ async get(id) {
26325
+ return rb.rawGet(`/access-grants/${id}`);
26326
+ },
26327
+ /**
26328
+ * Create a new access grant, giving a subject a relation to an object.
26329
+ *
26330
+ * @param attrs - Grant attributes (subject_type, subject_id, relation, object_type, object_id)
26331
+ * @returns The created access grant
26332
+ * @example
26333
+ * const grant = await client.accessGrants.create({
26334
+ * data: {
26335
+ * type: "access-grant",
26336
+ * attributes: {
26337
+ * subject_type: "user",
26338
+ * subject_id: "user-uuid",
26339
+ * relation: "workspace_editor",
26340
+ * object_type: "workspace",
26341
+ * object_id: "workspace-uuid",
26342
+ * },
26343
+ * },
26344
+ * });
26345
+ */
26346
+ async create(attrs) {
26347
+ return rb.rawPost(`/access-grants`, attrs);
26348
+ },
26349
+ /**
26350
+ * Update an existing access grant (relation, custom_permissions, expires_at).
26351
+ *
26352
+ * @param id - AccessGrant UUID
26353
+ * @param attrs - Attributes to update
26354
+ * @returns The updated access grant
26355
+ * @example
26356
+ * const updated = await client.accessGrants.update("grant-uuid", { data: { ... } });
26357
+ */
26358
+ async update(id, attrs) {
26359
+ return rb.rawPatch(`/access-grants/${id}`, attrs);
26360
+ },
26361
+ /**
26362
+ * Revoke (delete) an access grant.
26363
+ *
26364
+ * @param id - AccessGrant UUID
26365
+ * @example
26366
+ * await client.accessGrants.revoke("grant-uuid");
26367
+ */
26368
+ async revoke(id) {
26369
+ return rb.rawDelete(`/access-grants/${id}`);
26370
+ }
26371
+ };
26372
+ }
26373
+
26374
+ // src/namespaces/roles.ts
26375
+ function createRolesNamespace(rb) {
26376
+ return {
26377
+ /**
26378
+ * List roles available in the current context (system defaults + application roles).
26379
+ *
26380
+ * @param params - Optional filter parameters
26381
+ * @returns Paginated list of roles
26382
+ * @example
26383
+ * const roles = await client.roles.list();
26384
+ */
26385
+ async list(params) {
26386
+ const query = params ? `?${new URLSearchParams(params).toString()}` : "";
26387
+ return rb.rawGet(`/roles${query}`);
26388
+ },
26389
+ /**
26390
+ * Get a single role by ID.
26391
+ *
26392
+ * @param id - Role UUID
26393
+ * @returns The role record
26394
+ * @example
26395
+ * const role = await client.roles.get("role-uuid");
26396
+ */
26397
+ async get(id) {
26398
+ return rb.rawGet(`/roles/${id}`);
26399
+ },
26400
+ /**
26401
+ * Create a new custom role (permission bundle) for the application.
26402
+ *
26403
+ * @param attrs - Role attributes (name, description, permissions, application_id)
26404
+ * @returns The created role
26405
+ * @example
26406
+ * const role = await client.roles.create({
26407
+ * data: {
26408
+ * type: "role",
26409
+ * attributes: { name: "Content Editor", permissions: ["extract:document:read:all"] },
26410
+ * },
26411
+ * });
26412
+ */
26413
+ async create(attrs) {
26414
+ return rb.rawPost(`/roles`, attrs);
26415
+ },
26416
+ /**
26417
+ * Update a role's name, description, or permissions.
26418
+ *
26419
+ * @param id - Role UUID
26420
+ * @param attrs - Attributes to update
26421
+ * @returns The updated role
26422
+ * @example
26423
+ * const updated = await client.roles.update("role-uuid", { data: { ... } });
26424
+ */
26425
+ async update(id, attrs) {
26426
+ return rb.rawPatch(`/roles/${id}`, attrs);
26427
+ },
26428
+ /**
26429
+ * Delete a custom role. System default roles cannot be deleted.
26430
+ *
26431
+ * @param id - Role UUID
26432
+ * @example
26433
+ * await client.roles.delete("role-uuid");
26434
+ */
26435
+ async delete(id) {
26436
+ return rb.rawDelete(`/roles/${id}`);
26437
+ }
26438
+ };
26439
+ }
26440
+
26441
+ // src/namespaces/memory.ts
26442
+ function createMemoryNamespace(rb) {
26443
+ return {
26444
+ /**
26445
+ * Sub-namespace for section document operations.
26446
+ *
26447
+ * A section document represents an indexed source (extraction document,
26448
+ * crawler page, knowledge file, or direct upload). Each section document
26449
+ * contains metadata about the source and links to its document sections.
26450
+ */
26451
+ sectionDocuments: {
26452
+ /**
26453
+ * Lists section documents in the current workspace.
26454
+ *
26455
+ * Returns paginated results sorted by creation date (newest first).
26456
+ *
26457
+ * @param params - Optional pagination parameters (`page[offset]`, `page[limit]`).
26458
+ * @param options - Optional request options such as custom headers or abort signal.
26459
+ * @returns A promise resolving to an array of section document records.
26460
+ *
26461
+ * @example
26462
+ * ```typescript
26463
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
26464
+ * const docs = await client.memory.sectionDocuments.list();
26465
+ * docs.forEach(d => console.log(d.attributes?.doc_path));
26466
+ * ```
26467
+ */
26468
+ list: async (params, options) => {
26469
+ return rb.execute(
26470
+ getMemorySectionDocuments,
26471
+ buildPageQuery(params?.page, params?.pageSize),
26472
+ options
26473
+ );
26474
+ },
26475
+ /**
26476
+ * Retrieves a single section document by its unique identifier.
26477
+ *
26478
+ * @param id - The UUID of the section document.
26479
+ * @param options - Optional request options.
26480
+ * @returns A promise resolving to the section document record.
26481
+ *
26482
+ * @example
26483
+ * ```typescript
26484
+ * const doc = await client.memory.sectionDocuments.get('sd_01HXYZ...');
26485
+ * console.log(doc.attributes?.source_type, doc.attributes?.section_count);
26486
+ * ```
26487
+ */
26488
+ get: async (id, options) => {
26489
+ return rb.execute(
26490
+ getMemorySectionDocumentsById,
26491
+ { path: { id } },
26492
+ options
26493
+ );
26494
+ }
26495
+ },
26496
+ /**
26497
+ * Sub-namespace for document section operations.
26498
+ *
26499
+ * A document section represents one heading-delimited portion of an
26500
+ * indexed document. Sections have stable IDs that survive re-indexing,
26501
+ * enabling persistent cross-document references.
26502
+ */
26503
+ documentSections: {
26504
+ /**
26505
+ * Lists document sections in the current workspace.
26506
+ *
26507
+ * Returns paginated results sorted by position within their documents.
26508
+ *
26509
+ * @param params - Optional pagination parameters.
26510
+ * @param options - Optional request options.
26511
+ * @returns A promise resolving to an array of document section records.
26512
+ *
26513
+ * @example
26514
+ * ```typescript
26515
+ * const sections = await client.memory.documentSections.list();
26516
+ * sections.forEach(s => console.log(s.attributes?.title, s.attributes?.level));
26517
+ * ```
26518
+ */
26519
+ list: async (params, options) => {
26520
+ return rb.execute(
26521
+ getMemoryDocumentSections,
26522
+ buildPageQuery(params?.page, params?.pageSize),
26523
+ options
26524
+ );
26525
+ },
26526
+ /**
26527
+ * Retrieves a single document section by its unique identifier.
26528
+ *
26529
+ * @param id - The UUID of the document section.
26530
+ * @param options - Optional request options.
26531
+ * @returns A promise resolving to the document section record.
26532
+ *
26533
+ * @example
26534
+ * ```typescript
26535
+ * const section = await client.memory.documentSections.get('ds_01HXYZ...');
26536
+ * console.log(section.attributes?.title, section.attributes?.content_preview);
26537
+ * ```
26538
+ */
26539
+ get: async (id, options) => {
26540
+ return rb.execute(
26541
+ getMemoryDocumentSectionsById,
26542
+ { path: { id } },
26543
+ options
26544
+ );
26545
+ }
26546
+ }
26547
+ };
26548
+ }
26549
+
26550
+ // src/namespaces/permissions.ts
26551
+ function createPermissionsNamespace(rb) {
26552
+ return {
26553
+ /**
26554
+ * List all registered platform permissions.
26555
+ *
26556
+ * Optionally filter by `app`, `context`, or `category` query params.
26557
+ *
26558
+ * @param params - Optional filter parameters (app, context, category)
26559
+ * @returns List of permissions
26560
+ * @example
26561
+ * const perms = await client.permissions.list({ context: "workspace" });
26562
+ */
26563
+ async list(params) {
26564
+ const query = params ? `?${new URLSearchParams(params).toString()}` : "";
26565
+ return rb.rawGet(`/permissions${query}`);
26566
+ },
26567
+ /**
26568
+ * Get a single permission by its ID string (e.g., "extract:document:read:all").
26569
+ *
26570
+ * @param id - Permission ID string
26571
+ * @returns The permission record
26572
+ * @example
26573
+ * const perm = await client.permissions.get("extract:document:read:all");
26574
+ */
26575
+ async get(id) {
26576
+ return rb.rawGet(
26577
+ `/permissions/${encodeURIComponent(id)}`
26578
+ );
26579
+ },
26580
+ /**
26581
+ * Get permission system metadata (version, apps, scopes, categories, cache TTL).
26582
+ *
26583
+ * @returns Permission system metadata
26584
+ * @example
26585
+ * const meta = await client.permissions.meta();
26586
+ */
26587
+ async meta() {
26588
+ return rb.rawGet(`/permissions/meta`);
26589
+ },
26590
+ /**
26591
+ * List permission presets (pre-defined role bundles).
26592
+ *
26593
+ * Optionally filter by `context` (tenant, workspace) or `app`.
26594
+ *
26595
+ * @param params - Optional filter parameters (context, app)
26596
+ * @returns List of permission presets
26597
+ * @example
26598
+ * const presets = await client.permissions.listPresets({ context: "workspace" });
26599
+ */
26600
+ async listPresets(params) {
26601
+ const query = params ? `?${new URLSearchParams(params).toString()}` : "";
26602
+ return rb.rawGet(
26603
+ `/permissions/presets${query}`
26604
+ );
26605
+ },
26606
+ /**
26607
+ * Get a single permission preset by its composite ID (e.g., "workspace:org:admin").
26608
+ *
26609
+ * @param id - Preset composite ID
26610
+ * @returns The permission preset
26611
+ * @example
26612
+ * const preset = await client.permissions.getPreset("workspace:org:admin");
26613
+ */
26614
+ async getPreset(id) {
26615
+ return rb.rawGet(
26616
+ `/permissions/presets/${encodeURIComponent(id)}`
26617
+ );
26618
+ }
26619
+ };
26620
+ }
26621
+
24618
26622
  // src/streaming.ts
24619
26623
  var DEFAULT_STREAM_TIMEOUT = 3e5;
24620
26624
  var DEFAULT_MAX_CHUNKS = 1e4;
@@ -24858,6 +26862,25 @@ var RequestBuilder = class {
24858
26862
  throw handleApiError(error);
24859
26863
  }
24860
26864
  }
26865
+ /**
26866
+ * Execute a raw PATCH request to a custom (non-generated) endpoint.
26867
+ */
26868
+ async rawPatch(url, body, options) {
26869
+ const headers = buildHeaders(this.getHeaders, options);
26870
+ try {
26871
+ const { data } = await this.requestWithRetry(
26872
+ () => this.clientInstance.patch({
26873
+ url,
26874
+ headers,
26875
+ ...body !== void 0 && { body },
26876
+ ...options?.signal && { signal: options.signal }
26877
+ })
26878
+ );
26879
+ return this.unwrap(data?.data);
26880
+ } catch (error) {
26881
+ throw handleApiError(error);
26882
+ }
26883
+ }
24861
26884
  /**
24862
26885
  * Execute a raw DELETE request to a custom (non-generated) endpoint.
24863
26886
  */
@@ -25013,6 +27036,7 @@ var GptClient = class extends BaseClient {
25013
27036
  this.ai = createAiNamespace(rb);
25014
27037
  this.billing = createBillingNamespace(rb);
25015
27038
  this.catalog = createCatalogNamespace(rb);
27039
+ this.clinical = createClinicalNamespace(rb);
25016
27040
  this.compliance = createComplianceNamespace(rb);
25017
27041
  this.communication = createCommunicationNamespace(rb);
25018
27042
  this.connectors = createConnectorsNamespace(rb);
@@ -25038,6 +27062,10 @@ var GptClient = class extends BaseClient {
25038
27062
  this.models = createModelsNamespace(rb);
25039
27063
  this.crmClusters = createCrmClustersNamespace(rb);
25040
27064
  this.pipelines = createPipelinesNamespace(rb);
27065
+ this.accessGrants = createAccessGrantsNamespace(rb);
27066
+ this.roles = createRolesNamespace(rb);
27067
+ this.permissions = createPermissionsNamespace(rb);
27068
+ this.memory = createMemoryNamespace(rb);
25041
27069
  }
25042
27070
  /**
25043
27071
  * Subscribe to SDK lifecycle events.