@gpt-platform/client 0.8.5 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -49,6 +49,7 @@ __export(index_exports, {
49
49
  buildHeaders: () => buildHeaders,
50
50
  buildUserAgent: () => buildUserAgent,
51
51
  collectStreamedMessage: () => collectStreamedMessage,
52
+ createImportsNamespace: () => createImportsNamespace,
52
53
  handleApiError: () => handleApiError,
53
54
  isBrowserEnvironment: () => isBrowserEnvironment,
54
55
  isSecureUrl: () => isSecureUrl,
@@ -1333,8 +1334,8 @@ function buildUserAgent(sdkVersion, appInfo) {
1333
1334
  }
1334
1335
 
1335
1336
  // src/version.ts
1336
- var SDK_VERSION = "0.8.5";
1337
- var DEFAULT_API_VERSION = "2026-03-19";
1337
+ var SDK_VERSION = "0.9.0";
1338
+ var DEFAULT_API_VERSION = "2026-03-21";
1338
1339
 
1339
1340
  // src/base-client.ts
1340
1341
  function generateUUID() {
@@ -1643,7 +1644,7 @@ function createAuditNamespace(rb) {
1643
1644
  * Fetch a paginated, time-sorted activity feed scoped to a tenant.
1644
1645
  *
1645
1646
  * Optionally filter by workspace, action type, actor, or date range.
1646
- * Results are sorted by `inserted_at` descending (most recent first).
1647
+ * Results are sorted by `created_at` descending (most recent first).
1647
1648
  *
1648
1649
  * @param params - Feed parameters. `tenantId` is required.
1649
1650
  * @param options - Optional request options.
@@ -1754,6 +1755,11 @@ var getSocialTrendingWatchesWorkspaceByWorkspaceId = (options) => (options.clien
1754
1755
  url: "/social/trending/watches/workspace/{workspace_id}",
1755
1756
  ...options
1756
1757
  });
1758
+ var getSocialTrendingHistoryRange = (options) => (options.client ?? client).get({
1759
+ security: [{ scheme: "bearer", type: "http" }],
1760
+ url: "/social/trending/history/range",
1761
+ ...options
1762
+ });
1757
1763
  var getAgentDeploymentsById = (options) => (options.client ?? client).get({
1758
1764
  security: [{ scheme: "bearer", type: "http" }],
1759
1765
  url: "/agent-deployments/{id}",
@@ -1834,6 +1840,15 @@ var postRiskAssessments = (options) => (options.client ?? client).post({
1834
1840
  ...options.headers
1835
1841
  }
1836
1842
  });
1843
+ var patchClinicalClientResourceAssignmentsByIdArchive = (options) => (options.client ?? client).patch({
1844
+ security: [{ scheme: "bearer", type: "http" }],
1845
+ url: "/clinical/client-resource-assignments/{id}/archive",
1846
+ ...options,
1847
+ headers: {
1848
+ "Content-Type": "application/vnd.api+json",
1849
+ ...options.headers
1850
+ }
1851
+ });
1837
1852
  var postCatalogTaxonomyNodes = (options) => (options.client ?? client).post({
1838
1853
  security: [{ scheme: "bearer", type: "http" }],
1839
1854
  url: "/catalog/taxonomy-nodes",
@@ -1938,11 +1953,6 @@ var getClinicalNotesByNoteIdVersionsById = (options) => (options.client ?? clien
1938
1953
  url: "/clinical/notes/{note_id}/versions/{id}",
1939
1954
  ...options
1940
1955
  });
1941
- var deleteClinicalMealPlansById = (options) => (options.client ?? client).delete({
1942
- security: [{ scheme: "bearer", type: "http" }],
1943
- url: "/clinical/meal-plans/{id}",
1944
- ...options
1945
- });
1946
1956
  var getClinicalMealPlansById = (options) => (options.client ?? client).get({
1947
1957
  security: [{ scheme: "bearer", type: "http" }],
1948
1958
  url: "/clinical/meal-plans/{id}",
@@ -2004,6 +2014,11 @@ var getApplicationsCurrent = (options) => (options.client ?? client).get({
2004
2014
  url: "/applications/current",
2005
2015
  ...options
2006
2016
  });
2017
+ var getClinicalPracticeResourcesArchived = (options) => (options.client ?? client).get({
2018
+ security: [{ scheme: "bearer", type: "http" }],
2019
+ url: "/clinical/practice-resources/archived",
2020
+ ...options
2021
+ });
2007
2022
  var patchTenantsByIdConvertToOrg = (options) => (options.client ?? client).patch({
2008
2023
  security: [{ scheme: "bearer", type: "http" }],
2009
2024
  url: "/tenants/{id}/convert-to-org",
@@ -2013,6 +2028,15 @@ var patchTenantsByIdConvertToOrg = (options) => (options.client ?? client).patch
2013
2028
  ...options.headers
2014
2029
  }
2015
2030
  });
2031
+ var patchClinicalHealthMetricsByIdRestore = (options) => (options.client ?? client).patch({
2032
+ security: [{ scheme: "bearer", type: "http" }],
2033
+ url: "/clinical/health-metrics/{id}/restore",
2034
+ ...options,
2035
+ headers: {
2036
+ "Content-Type": "application/vnd.api+json",
2037
+ ...options.headers
2038
+ }
2039
+ });
2016
2040
  var getBrandIdentitiesByTenantByTenantId = (options) => (options.client ?? client).get({
2017
2041
  security: [{ scheme: "bearer", type: "http" }],
2018
2042
  url: "/brand-identities/by-tenant/{tenant_id}",
@@ -2131,6 +2155,15 @@ var getCrawlerResults = (options) => (options.client ?? client).get({
2131
2155
  url: "/crawler/results",
2132
2156
  ...options
2133
2157
  });
2158
+ var patchClinicalNotesByIdArchive = (options) => (options.client ?? client).patch({
2159
+ security: [{ scheme: "bearer", type: "http" }],
2160
+ url: "/clinical/notes/{id}/archive",
2161
+ ...options,
2162
+ headers: {
2163
+ "Content-Type": "application/vnd.api+json",
2164
+ ...options.headers
2165
+ }
2166
+ });
2134
2167
  var getCrmExportsById = (options) => (options.client ?? client).get({
2135
2168
  security: [{ scheme: "bearer", type: "http" }],
2136
2169
  url: "/crm/exports/{id}",
@@ -2150,11 +2183,6 @@ var postBusinessAssociateAgreements = (options) => (options.client ?? client).po
2150
2183
  ...options.headers
2151
2184
  }
2152
2185
  });
2153
- var deleteClinicalPracticeResourcesById = (options) => (options.client ?? client).delete({
2154
- security: [{ scheme: "bearer", type: "http" }],
2155
- url: "/clinical/practice-resources/{id}",
2156
- ...options
2157
- });
2158
2186
  var getClinicalPracticeResourcesById = (options) => (options.client ?? client).get({
2159
2187
  security: [{ scheme: "bearer", type: "http" }],
2160
2188
  url: "/clinical/practice-resources/{id}",
@@ -2296,10 +2324,14 @@ var postClinicalNotes = (options) => (options.client ?? client).post({
2296
2324
  ...options.headers
2297
2325
  }
2298
2326
  });
2299
- var deleteClinicalClientGoalsById = (options) => (options.client ?? client).delete({
2327
+ var patchClinicalPracticeToolsCatalogByIdRestore = (options) => (options.client ?? client).patch({
2300
2328
  security: [{ scheme: "bearer", type: "http" }],
2301
- url: "/clinical/client-goals/{id}",
2302
- ...options
2329
+ url: "/clinical/practice-tools/catalog/{id}/restore",
2330
+ ...options,
2331
+ headers: {
2332
+ "Content-Type": "application/vnd.api+json",
2333
+ ...options.headers
2334
+ }
2303
2335
  });
2304
2336
  var getClinicalClientGoalsById = (options) => (options.client ?? client).get({
2305
2337
  security: [{ scheme: "bearer", type: "http" }],
@@ -2315,6 +2347,11 @@ var patchClinicalClientGoalsById = (options) => (options.client ?? client).patch
2315
2347
  ...options.headers
2316
2348
  }
2317
2349
  });
2350
+ var deleteClinicalGoalTemplatesByIdPermanent = (options) => (options.client ?? client).delete({
2351
+ security: [{ scheme: "bearer", type: "http" }],
2352
+ url: "/clinical/goal-templates/{id}/permanent",
2353
+ ...options
2354
+ });
2318
2355
  var postAgentsImport = (options) => (options.client ?? client).post({
2319
2356
  security: [{ scheme: "bearer", type: "http" }],
2320
2357
  url: "/agents/import",
@@ -2333,6 +2370,16 @@ var postUsersAuthPasswordResetRequest = (options) => (options.client ?? client).
2333
2370
  ...options.headers
2334
2371
  }
2335
2372
  });
2373
+ var getClinicalClientSupplementsArchived = (options) => (options.client ?? client).get({
2374
+ security: [{ scheme: "bearer", type: "http" }],
2375
+ url: "/clinical/client-supplements/archived",
2376
+ ...options
2377
+ });
2378
+ var getClinicalClientResourceAssignmentsArchived = (options) => (options.client ?? client).get({
2379
+ security: [{ scheme: "bearer", type: "http" }],
2380
+ url: "/clinical/client-resource-assignments/archived",
2381
+ ...options
2382
+ });
2336
2383
  var patchPolicyReviewSchedulesByIdMarkOverdue = (options) => (options.client ?? client).patch({
2337
2384
  security: [{ scheme: "bearer", type: "http" }],
2338
2385
  url: "/policy-review-schedules/{id}/mark-overdue",
@@ -2347,6 +2394,11 @@ var getExtractionBatchesWorkspaceByWorkspaceId = (options) => (options.client ??
2347
2394
  url: "/extraction/batches/workspace/{workspace_id}",
2348
2395
  ...options
2349
2396
  });
2397
+ var deleteClinicalPracticeResourcesByIdPermanent = (options) => (options.client ?? client).delete({
2398
+ security: [{ scheme: "bearer", type: "http" }],
2399
+ url: "/clinical/practice-resources/{id}/permanent",
2400
+ ...options
2401
+ });
2350
2402
  var patchUserProfilesByIdAcceptTos = (options) => (options.client ?? client).patch({
2351
2403
  security: [{ scheme: "bearer", type: "http" }],
2352
2404
  url: "/user-profiles/{id}/accept-tos",
@@ -2515,6 +2567,15 @@ var patchWorkspacesByIdAllocate = (options) => (options.client ?? client).patch(
2515
2567
  ...options.headers
2516
2568
  }
2517
2569
  });
2570
+ var patchClinicalPracticeResourcesCatalogByIdRestore = (options) => (options.client ?? client).patch({
2571
+ security: [{ scheme: "bearer", type: "http" }],
2572
+ url: "/clinical/practice-resources/catalog/{id}/restore",
2573
+ ...options,
2574
+ headers: {
2575
+ "Content-Type": "application/vnd.api+json",
2576
+ ...options.headers
2577
+ }
2578
+ });
2518
2579
  var patchInvitationsByIdRevoke = (options) => (options.client ?? client).patch({
2519
2580
  security: [{ scheme: "bearer", type: "http" }],
2520
2581
  url: "/invitations/{id}/revoke",
@@ -2579,6 +2640,15 @@ var getMemoryDocumentSections = (options) => (options.client ?? client).get({
2579
2640
  url: "/memory/document-sections",
2580
2641
  ...options
2581
2642
  });
2643
+ var patchClinicalPracticeToolsCatalogByIdArchive = (options) => (options.client ?? client).patch({
2644
+ security: [{ scheme: "bearer", type: "http" }],
2645
+ url: "/clinical/practice-tools/catalog/{id}/archive",
2646
+ ...options,
2647
+ headers: {
2648
+ "Content-Type": "application/vnd.api+json",
2649
+ ...options.headers
2650
+ }
2651
+ });
2582
2652
  var postConnectorsCredentialsByIdRefresh = (options) => (options.client ?? client).post({
2583
2653
  security: [{ scheme: "bearer", type: "http" }],
2584
2654
  url: "/connectors/credentials/{id}/refresh",
@@ -2681,6 +2751,15 @@ var postAgentsByIdRestoreVersion = (options) => (options.client ?? client).post(
2681
2751
  ...options.headers
2682
2752
  }
2683
2753
  });
2754
+ var patchClinicalGoalTemplatesCatalogByIdArchive = (options) => (options.client ?? client).patch({
2755
+ security: [{ scheme: "bearer", type: "http" }],
2756
+ url: "/clinical/goal-templates/catalog/{id}/archive",
2757
+ ...options,
2758
+ headers: {
2759
+ "Content-Type": "application/vnd.api+json",
2760
+ ...options.headers
2761
+ }
2762
+ });
2684
2763
  var getWorkspaceAgentConfigsById = (options) => (options.client ?? client).get({
2685
2764
  security: [{ scheme: "bearer", type: "http" }],
2686
2765
  url: "/workspace-agent-configs/{id}",
@@ -2695,6 +2774,15 @@ var patchWorkspaceAgentConfigsById = (options) => (options.client ?? client).pat
2695
2774
  ...options.headers
2696
2775
  }
2697
2776
  });
2777
+ var patchClinicalPracticeResourcesByIdArchive = (options) => (options.client ?? client).patch({
2778
+ security: [{ scheme: "bearer", type: "http" }],
2779
+ url: "/clinical/practice-resources/{id}/archive",
2780
+ ...options,
2781
+ headers: {
2782
+ "Content-Type": "application/vnd.api+json",
2783
+ ...options.headers
2784
+ }
2785
+ });
2698
2786
  var patchWalletAutoTopUp = (options) => (options.client ?? client).patch({
2699
2787
  security: [{ scheme: "bearer", type: "http" }],
2700
2788
  url: "/wallet/auto-top-up",
@@ -2999,6 +3087,15 @@ var getStorageFiles = (options) => (options.client ?? client).get({
2999
3087
  url: "/storage-files",
3000
3088
  ...options
3001
3089
  });
3090
+ var patchClinicalNotesByIdRestore = (options) => (options.client ?? client).patch({
3091
+ security: [{ scheme: "bearer", type: "http" }],
3092
+ url: "/clinical/notes/{id}/restore",
3093
+ ...options,
3094
+ headers: {
3095
+ "Content-Type": "application/vnd.api+json",
3096
+ ...options.headers
3097
+ }
3098
+ });
3002
3099
  var getSocialAccountsPlatformByPlatform = (options) => (options.client ?? client).get({
3003
3100
  security: [{ scheme: "bearer", type: "http" }],
3004
3101
  url: "/social/accounts/platform/{platform}",
@@ -3111,11 +3208,6 @@ var patchAmendmentRequestsByIdReview = (options) => (options.client ?? client).p
3111
3208
  ...options.headers
3112
3209
  }
3113
3210
  });
3114
- var deleteClinicalPracticeToolsById = (options) => (options.client ?? client).delete({
3115
- security: [{ scheme: "bearer", type: "http" }],
3116
- url: "/clinical/practice-tools/{id}",
3117
- ...options
3118
- });
3119
3211
  var getClinicalPracticeToolsById = (options) => (options.client ?? client).get({
3120
3212
  security: [{ scheme: "bearer", type: "http" }],
3121
3213
  url: "/clinical/practice-tools/{id}",
@@ -3224,11 +3316,29 @@ var patchRiskAssessmentsByIdStatus = (options) => (options.client ?? client).pat
3224
3316
  ...options.headers
3225
3317
  }
3226
3318
  });
3319
+ var patchClinicalClientGoalsByIdRestore = (options) => (options.client ?? client).patch({
3320
+ security: [{ scheme: "bearer", type: "http" }],
3321
+ url: "/clinical/client-goals/{id}/restore",
3322
+ ...options,
3323
+ headers: {
3324
+ "Content-Type": "application/vnd.api+json",
3325
+ ...options.headers
3326
+ }
3327
+ });
3227
3328
  var getPermissionsMeta = (options) => (options.client ?? client).get({
3228
3329
  security: [{ scheme: "bearer", type: "http" }],
3229
3330
  url: "/permissions/meta",
3230
3331
  ...options
3231
3332
  });
3333
+ var patchClinicalMealPlansByIdArchive = (options) => (options.client ?? client).patch({
3334
+ security: [{ scheme: "bearer", type: "http" }],
3335
+ url: "/clinical/meal-plans/{id}/archive",
3336
+ ...options,
3337
+ headers: {
3338
+ "Content-Type": "application/vnd.api+json",
3339
+ ...options.headers
3340
+ }
3341
+ });
3232
3342
  var getEmailMarketingGeneratedEmailsById = (options) => (options.client ?? client).get({
3233
3343
  security: [{ scheme: "bearer", type: "http" }],
3234
3344
  url: "/email-marketing/generated-emails/{id}",
@@ -3319,6 +3429,15 @@ var patchCatalogTaxonomiesById = (options) => (options.client ?? client).patch({
3319
3429
  ...options.headers
3320
3430
  }
3321
3431
  });
3432
+ var patchClinicalPracticeToolsByIdArchive = (options) => (options.client ?? client).patch({
3433
+ security: [{ scheme: "bearer", type: "http" }],
3434
+ url: "/clinical/practice-tools/{id}/archive",
3435
+ ...options,
3436
+ headers: {
3437
+ "Content-Type": "application/vnd.api+json",
3438
+ ...options.headers
3439
+ }
3440
+ });
3322
3441
  var deleteSocialTrendingWatchesById = (options) => (options.client ?? client).delete({
3323
3442
  security: [{ scheme: "bearer", type: "http" }],
3324
3443
  url: "/social/trending/watches/{id}",
@@ -3409,11 +3528,6 @@ var postContentGenerateHashtags = (options) => (options.client ?? client).post({
3409
3528
  ...options.headers
3410
3529
  }
3411
3530
  });
3412
- var deleteClinicalNotesById = (options) => (options.client ?? client).delete({
3413
- security: [{ scheme: "bearer", type: "http" }],
3414
- url: "/clinical/notes/{id}",
3415
- ...options
3416
- });
3417
3531
  var getClinicalNotesById = (options) => (options.client ?? client).get({
3418
3532
  security: [{ scheme: "bearer", type: "http" }],
3419
3533
  url: "/clinical/notes/{id}",
@@ -3478,6 +3592,15 @@ var patchBusinessAssociateAgreementsByIdTerminate = (options) => (options.client
3478
3592
  ...options.headers
3479
3593
  }
3480
3594
  });
3595
+ var patchClinicalPracticeResourcesByIdRestore = (options) => (options.client ?? client).patch({
3596
+ security: [{ scheme: "bearer", type: "http" }],
3597
+ url: "/clinical/practice-resources/{id}/restore",
3598
+ ...options,
3599
+ headers: {
3600
+ "Content-Type": "application/vnd.api+json",
3601
+ ...options.headers
3602
+ }
3603
+ });
3481
3604
  var postConnectorsByIdEdamamRecipesGet = (options) => (options.client ?? client).post({
3482
3605
  security: [{ scheme: "bearer", type: "http" }],
3483
3606
  url: "/connectors/{id}/edamam/recipes/get",
@@ -3567,6 +3690,15 @@ var patchExtractionResultsById = (options) => (options.client ?? client).patch({
3567
3690
  ...options.headers
3568
3691
  }
3569
3692
  });
3693
+ var postFeatureUsagesIncrement = (options) => (options.client ?? client).post({
3694
+ security: [{ scheme: "bearer", type: "http" }],
3695
+ url: "/feature-usages/increment",
3696
+ ...options,
3697
+ headers: {
3698
+ "Content-Type": "application/vnd.api+json",
3699
+ ...options.headers
3700
+ }
3701
+ });
3570
3702
  var postAgentsByIdValidate = (options) => (options.client ?? client).post({
3571
3703
  security: [{ scheme: "bearer", type: "http" }],
3572
3704
  url: "/agents/{id}/validate",
@@ -3581,6 +3713,11 @@ var getConnectorsCredentials = (options) => (options.client ?? client).get({
3581
3713
  url: "/connectors/credentials",
3582
3714
  ...options
3583
3715
  });
3716
+ var deleteClinicalMealPlansByIdPermanent = (options) => (options.client ?? client).delete({
3717
+ security: [{ scheme: "bearer", type: "http" }],
3718
+ url: "/clinical/meal-plans/{id}/permanent",
3719
+ ...options
3720
+ });
3584
3721
  var getAgentsByIdSchemaVersions = (options) => (options.client ?? client).get({
3585
3722
  security: [{ scheme: "bearer", type: "http" }],
3586
3723
  url: "/agents/{id}/schema-versions",
@@ -3703,6 +3840,16 @@ var getSchedulingBookingsById = (options) => (options.client ?? client).get({
3703
3840
  url: "/scheduling/bookings/{id}",
3704
3841
  ...options
3705
3842
  });
3843
+ var deleteClinicalClientGoalsByIdPermanent = (options) => (options.client ?? client).delete({
3844
+ security: [{ scheme: "bearer", type: "http" }],
3845
+ url: "/clinical/client-goals/{id}/permanent",
3846
+ ...options
3847
+ });
3848
+ var deleteClinicalGoalTemplatesCatalogByIdPermanent = (options) => (options.client ?? client).delete({
3849
+ security: [{ scheme: "bearer", type: "http" }],
3850
+ url: "/clinical/goal-templates/catalog/{id}/permanent",
3851
+ ...options
3852
+ });
3706
3853
  var patchVoiceSessionsByIdStop = (options) => (options.client ?? client).patch({
3707
3854
  security: [{ scheme: "bearer", type: "http" }],
3708
3855
  url: "/voice/sessions/{id}/stop",
@@ -3726,6 +3873,11 @@ var patchSocialPostsByIdCancel = (options) => (options.client ?? client).patch({
3726
3873
  ...options.headers
3727
3874
  }
3728
3875
  });
3876
+ var getClinicalGoalTemplatesCatalogArchived = (options) => (options.client ?? client).get({
3877
+ security: [{ scheme: "bearer", type: "http" }],
3878
+ url: "/clinical/goal-templates/catalog/archived",
3879
+ ...options
3880
+ });
3729
3881
  var patchSocialCampaignsByIdSchedule = (options) => (options.client ?? client).patch({
3730
3882
  security: [{ scheme: "bearer", type: "http" }],
3731
3883
  url: "/social/campaigns/{id}/schedule",
@@ -3781,6 +3933,15 @@ var patchEmailMarketingSenderProfilesByIdSetDefault = (options) => (options.clie
3781
3933
  ...options.headers
3782
3934
  }
3783
3935
  });
3936
+ var patchClinicalClientResourceAssignmentsByIdRestore = (options) => (options.client ?? client).patch({
3937
+ security: [{ scheme: "bearer", type: "http" }],
3938
+ url: "/clinical/client-resource-assignments/{id}/restore",
3939
+ ...options,
3940
+ headers: {
3941
+ "Content-Type": "application/vnd.api+json",
3942
+ ...options.headers
3943
+ }
3944
+ });
3784
3945
  var deleteSocialPostsById = (options) => (options.client ?? client).delete({
3785
3946
  security: [{ scheme: "bearer", type: "http" }],
3786
3947
  url: "/social/posts/{id}",
@@ -3830,6 +3991,15 @@ var getConsentRecordsById = (options) => (options.client ?? client).get({
3830
3991
  url: "/consent-records/{id}",
3831
3992
  ...options
3832
3993
  });
3994
+ var patchClinicalHealthMetricsByIdArchive = (options) => (options.client ?? client).patch({
3995
+ security: [{ scheme: "bearer", type: "http" }],
3996
+ url: "/clinical/health-metrics/{id}/archive",
3997
+ ...options,
3998
+ headers: {
3999
+ "Content-Type": "application/vnd.api+json",
4000
+ ...options.headers
4001
+ }
4002
+ });
3833
4003
  var getCrmExportsWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
3834
4004
  security: [{ scheme: "bearer", type: "http" }],
3835
4005
  url: "/crm/exports/workspace/{workspace_id}",
@@ -4039,6 +4209,11 @@ var getSocialPostsAccountBySocialAccountId = (options) => (options.client ?? cli
4039
4209
  url: "/social/posts/account/{social_account_id}",
4040
4210
  ...options
4041
4211
  });
4212
+ var deleteClinicalNotesByIdPermanent = (options) => (options.client ?? client).delete({
4213
+ security: [{ scheme: "bearer", type: "http" }],
4214
+ url: "/clinical/notes/{id}/permanent",
4215
+ ...options
4216
+ });
4042
4217
  var postConnectorsByIdEdamamRecipesSearch = (options) => (options.client ?? client).post({
4043
4218
  security: [{ scheme: "bearer", type: "http" }],
4044
4219
  url: "/connectors/{id}/edamam/recipes/search",
@@ -4053,11 +4228,6 @@ var getCrmPipelinesWorkspaceByWorkspaceId = (options) => (options.client ?? clie
4053
4228
  url: "/crm/pipelines/workspace/{workspace_id}",
4054
4229
  ...options
4055
4230
  });
4056
- var deleteClinicalClientResourceAssignmentsById = (options) => (options.client ?? client).delete({
4057
- security: [{ scheme: "bearer", type: "http" }],
4058
- url: "/clinical/client-resource-assignments/{id}",
4059
- ...options
4060
- });
4061
4231
  var getClinicalClientResourceAssignmentsById = (options) => (options.client ?? client).get({
4062
4232
  security: [{ scheme: "bearer", type: "http" }],
4063
4233
  url: "/clinical/client-resource-assignments/{id}",
@@ -4081,6 +4251,11 @@ var patchExtractionDocumentsByIdReprocess = (options) => (options.client ?? clie
4081
4251
  ...options.headers
4082
4252
  }
4083
4253
  });
4254
+ var getClinicalMealPlansArchived = (options) => (options.client ?? client).get({
4255
+ security: [{ scheme: "bearer", type: "http" }],
4256
+ url: "/clinical/meal-plans/archived",
4257
+ ...options
4258
+ });
4084
4259
  var deleteThreadsById = (options) => (options.client ?? client).delete({
4085
4260
  security: [{ scheme: "bearer", type: "http" }],
4086
4261
  url: "/threads/{id}",
@@ -4152,6 +4327,11 @@ var postWatcherClaims = (options) => (options.client ?? client).post({
4152
4327
  ...options.headers
4153
4328
  }
4154
4329
  });
4330
+ var deleteClinicalPracticeToolsCatalogByIdPermanent = (options) => (options.client ?? client).delete({
4331
+ security: [{ scheme: "bearer", type: "http" }],
4332
+ url: "/clinical/practice-tools/catalog/{id}/permanent",
4333
+ ...options
4334
+ });
4155
4335
  var getCrawlerJobs = (options) => (options.client ?? client).get({
4156
4336
  security: [{ scheme: "bearer", type: "http" }],
4157
4337
  url: "/crawler/jobs",
@@ -4260,6 +4440,11 @@ var getProcessingActivitiesById = (options) => (options.client ?? client).get({
4260
4440
  url: "/processing-activities/{id}",
4261
4441
  ...options
4262
4442
  });
4443
+ var deleteClinicalHealthMetricsByIdPermanent = (options) => (options.client ?? client).delete({
4444
+ security: [{ scheme: "bearer", type: "http" }],
4445
+ url: "/clinical/health-metrics/{id}/permanent",
4446
+ ...options
4447
+ });
4263
4448
  var postThreadsByIdExport = (options) => (options.client ?? client).post({
4264
4449
  security: [{ scheme: "bearer", type: "http" }],
4265
4450
  url: "/threads/{id}/export",
@@ -4479,11 +4664,6 @@ var postClinicalClientResourceAssignments = (options) => (options.client ?? clie
4479
4664
  ...options.headers
4480
4665
  }
4481
4666
  });
4482
- var deleteClinicalGoalTemplatesById = (options) => (options.client ?? client).delete({
4483
- security: [{ scheme: "bearer", type: "http" }],
4484
- url: "/clinical/goal-templates/{id}",
4485
- ...options
4486
- });
4487
4667
  var getClinicalGoalTemplatesById = (options) => (options.client ?? client).get({
4488
4668
  security: [{ scheme: "bearer", type: "http" }],
4489
4669
  url: "/clinical/goal-templates/{id}",
@@ -4615,15 +4795,6 @@ var postFieldTemplates = (options) => (options.client ?? client).post({
4615
4795
  ...options.headers
4616
4796
  }
4617
4797
  });
4618
- var patchSocialTrendingWatchesByIdMarkTriggered = (options) => (options.client ?? client).patch({
4619
- security: [{ scheme: "bearer", type: "http" }],
4620
- url: "/social/trending/watches/{id}/mark-triggered",
4621
- ...options,
4622
- headers: {
4623
- "Content-Type": "application/vnd.api+json",
4624
- ...options.headers
4625
- }
4626
- });
4627
4798
  var getClinicalPracticeResourcesCatalog = (options) => (options.client ?? client).get({
4628
4799
  security: [{ scheme: "bearer", type: "http" }],
4629
4800
  url: "/clinical/practice-resources/catalog",
@@ -4681,6 +4852,15 @@ var patchTenantsByIdReactivate = (options) => (options.client ?? client).patch({
4681
4852
  ...options.headers
4682
4853
  }
4683
4854
  });
4855
+ var patchClinicalGoalTemplatesCatalogByIdRestore = (options) => (options.client ?? client).patch({
4856
+ security: [{ scheme: "bearer", type: "http" }],
4857
+ url: "/clinical/goal-templates/catalog/{id}/restore",
4858
+ ...options,
4859
+ headers: {
4860
+ "Content-Type": "application/vnd.api+json",
4861
+ ...options.headers
4862
+ }
4863
+ });
4684
4864
  var getWorkspacesByWorkspaceIdExtractionExportsById = (options) => (options.client ?? client).get({
4685
4865
  security: [{ scheme: "bearer", type: "http" }],
4686
4866
  url: "/workspaces/{workspace_id}/extraction/exports/{id}",
@@ -4723,6 +4903,11 @@ var postDocumentsPresignedUpload = (options) => (options.client ?? client).post(
4723
4903
  ...options.headers
4724
4904
  }
4725
4905
  });
4906
+ var getClinicalHealthMetricsArchived = (options) => (options.client ?? client).get({
4907
+ security: [{ scheme: "bearer", type: "http" }],
4908
+ url: "/clinical/health-metrics/archived",
4909
+ ...options
4910
+ });
4726
4911
  var postPaymentMethodsTokenize = (options) => (options.client ?? client).post({
4727
4912
  security: [{ scheme: "bearer", type: "http" }],
4728
4913
  url: "/payment-methods/tokenize",
@@ -4820,11 +5005,6 @@ var postComplianceDocumentTemplatesClone = (options) => (options.client ?? clien
4820
5005
  ...options.headers
4821
5006
  }
4822
5007
  });
4823
- var deleteClinicalClientSupplementsById = (options) => (options.client ?? client).delete({
4824
- security: [{ scheme: "bearer", type: "http" }],
4825
- url: "/clinical/client-supplements/{id}",
4826
- ...options
4827
- });
4828
5008
  var getClinicalClientSupplementsById = (options) => (options.client ?? client).get({
4829
5009
  security: [{ scheme: "bearer", type: "http" }],
4830
5010
  url: "/clinical/client-supplements/{id}",
@@ -4929,6 +5109,11 @@ var getBreachNotificationsById = (options) => (options.client ?? client).get({
4929
5109
  url: "/breach-notifications/{id}",
4930
5110
  ...options
4931
5111
  });
5112
+ var deleteClinicalClientSupplementsByIdPermanent = (options) => (options.client ?? client).delete({
5113
+ security: [{ scheme: "bearer", type: "http" }],
5114
+ url: "/clinical/client-supplements/{id}/permanent",
5115
+ ...options
5116
+ });
4932
5117
  var patchStorageFilesByIdUpdateMetadata = (options) => (options.client ?? client).patch({
4933
5118
  security: [{ scheme: "bearer", type: "http" }],
4934
5119
  url: "/storage-files/{id}/update-metadata",
@@ -5000,6 +5185,15 @@ var getRiskAssessmentsById = (options) => (options.client ?? client).get({
5000
5185
  url: "/risk-assessments/{id}",
5001
5186
  ...options
5002
5187
  });
5188
+ var patchClinicalClientGoalsByIdArchive = (options) => (options.client ?? client).patch({
5189
+ security: [{ scheme: "bearer", type: "http" }],
5190
+ url: "/clinical/client-goals/{id}/archive",
5191
+ ...options,
5192
+ headers: {
5193
+ "Content-Type": "application/vnd.api+json",
5194
+ ...options.headers
5195
+ }
5196
+ });
5003
5197
  var getUserProfiles = (options) => (options.client ?? client).get({
5004
5198
  security: [{ scheme: "bearer", type: "http" }],
5005
5199
  url: "/user-profiles",
@@ -5284,6 +5478,11 @@ var getSocialPostsCampaignBySocialCampaignId = (options) => (options.client ?? c
5284
5478
  url: "/social/posts/campaign/{social_campaign_id}",
5285
5479
  ...options
5286
5480
  });
5481
+ var getClinicalPracticeToolsArchived = (options) => (options.client ?? client).get({
5482
+ security: [{ scheme: "bearer", type: "http" }],
5483
+ url: "/clinical/practice-tools/archived",
5484
+ ...options
5485
+ });
5287
5486
  var deleteDataTransferRecordsById = (options) => (options.client ?? client).delete({
5288
5487
  security: [{ scheme: "bearer", type: "http" }],
5289
5488
  url: "/data-transfer-records/{id}",
@@ -5294,6 +5493,11 @@ var getDataTransferRecordsById = (options) => (options.client ?? client).get({
5294
5493
  url: "/data-transfer-records/{id}",
5295
5494
  ...options
5296
5495
  });
5496
+ var deleteClinicalPracticeToolsByIdPermanent = (options) => (options.client ?? client).delete({
5497
+ security: [{ scheme: "bearer", type: "http" }],
5498
+ url: "/clinical/practice-tools/{id}/permanent",
5499
+ ...options
5500
+ });
5297
5501
  var patchAmendmentRequestsByIdApply = (options) => (options.client ?? client).patch({
5298
5502
  security: [{ scheme: "bearer", type: "http" }],
5299
5503
  url: "/amendment-requests/{id}/apply",
@@ -5363,6 +5567,15 @@ var patchSocialPostsByIdSeo = (options) => (options.client ?? client).patch({
5363
5567
  ...options.headers
5364
5568
  }
5365
5569
  });
5570
+ var patchClinicalGoalTemplatesByIdRestore = (options) => (options.client ?? client).patch({
5571
+ security: [{ scheme: "bearer", type: "http" }],
5572
+ url: "/clinical/goal-templates/{id}/restore",
5573
+ ...options,
5574
+ headers: {
5575
+ "Content-Type": "application/vnd.api+json",
5576
+ ...options.headers
5577
+ }
5578
+ });
5366
5579
  var postConnectorsOauthInitiate = (options) => (options.client ?? client).post({
5367
5580
  security: [{ scheme: "bearer", type: "http" }],
5368
5581
  url: "/connectors/oauth/initiate",
@@ -5465,6 +5678,11 @@ var patchSupportTicketsByIdClose = (options) => (options.client ?? client).patch
5465
5678
  ...options.headers
5466
5679
  }
5467
5680
  });
5681
+ var deleteClinicalClientResourceAssignmentsByIdPermanent = (options) => (options.client ?? client).delete({
5682
+ security: [{ scheme: "bearer", type: "http" }],
5683
+ url: "/clinical/client-resource-assignments/{id}/permanent",
5684
+ ...options
5685
+ });
5468
5686
  var getClinicalClientGoals = (options) => (options.client ?? client).get({
5469
5687
  security: [{ scheme: "bearer", type: "http" }],
5470
5688
  url: "/clinical/client-goals",
@@ -5526,6 +5744,11 @@ var patchEmailOutboundEmailsByIdCancelSchedule = (options) => (options.client ??
5526
5744
  ...options.headers
5527
5745
  }
5528
5746
  });
5747
+ var deleteClinicalPracticeResourcesCatalogByIdPermanent = (options) => (options.client ?? client).delete({
5748
+ security: [{ scheme: "bearer", type: "http" }],
5749
+ url: "/clinical/practice-resources/catalog/{id}/permanent",
5750
+ ...options
5751
+ });
5529
5752
  var postContentRefine = (options) => (options.client ?? client).post({
5530
5753
  security: [{ scheme: "bearer", type: "http" }],
5531
5754
  url: "/content/refine",
@@ -5577,6 +5800,15 @@ var getCampaignsSequencesWorkspaceByWorkspaceId = (options) => (options.client ?
5577
5800
  url: "/campaigns/sequences/workspace/{workspace_id}",
5578
5801
  ...options
5579
5802
  });
5803
+ var patchClinicalClientSupplementsByIdRestore = (options) => (options.client ?? client).patch({
5804
+ security: [{ scheme: "bearer", type: "http" }],
5805
+ url: "/clinical/client-supplements/{id}/restore",
5806
+ ...options,
5807
+ headers: {
5808
+ "Content-Type": "application/vnd.api+json",
5809
+ ...options.headers
5810
+ }
5811
+ });
5580
5812
  var patchUserProfilesByIdDismissAnnouncement = (options) => (options.client ?? client).patch({
5581
5813
  security: [{ scheme: "bearer", type: "http" }],
5582
5814
  url: "/user-profiles/{id}/dismiss-announcement",
@@ -5651,11 +5883,6 @@ var postUsersAuthLogin = (options) => (options.client ?? client).post({
5651
5883
  ...options.headers
5652
5884
  }
5653
5885
  });
5654
- var deleteClinicalHealthMetricsById = (options) => (options.client ?? client).delete({
5655
- security: [{ scheme: "bearer", type: "http" }],
5656
- url: "/clinical/health-metrics/{id}",
5657
- ...options
5658
- });
5659
5886
  var getClinicalHealthMetricsById = (options) => (options.client ?? client).get({
5660
5887
  security: [{ scheme: "bearer", type: "http" }],
5661
5888
  url: "/clinical/health-metrics/{id}",
@@ -5702,6 +5929,16 @@ var postAgentVersionComparisons = (options) => (options.client ?? client).post({
5702
5929
  ...options.headers
5703
5930
  }
5704
5931
  });
5932
+ var getClinicalClientGoalsArchived = (options) => (options.client ?? client).get({
5933
+ security: [{ scheme: "bearer", type: "http" }],
5934
+ url: "/clinical/client-goals/archived",
5935
+ ...options
5936
+ });
5937
+ var getClinicalPracticeResourcesCatalogArchived = (options) => (options.client ?? client).get({
5938
+ security: [{ scheme: "bearer", type: "http" }],
5939
+ url: "/clinical/practice-resources/catalog/archived",
5940
+ ...options
5941
+ });
5705
5942
  var getSchedulingBookings = (options) => (options.client ?? client).get({
5706
5943
  security: [{ scheme: "bearer", type: "http" }],
5707
5944
  url: "/scheduling/bookings",
@@ -5730,6 +5967,11 @@ var postSchedulingCalendarSyncs = (options) => (options.client ?? client).post({
5730
5967
  ...options.headers
5731
5968
  }
5732
5969
  });
5970
+ var getClinicalNotesArchived = (options) => (options.client ?? client).get({
5971
+ security: [{ scheme: "bearer", type: "http" }],
5972
+ url: "/clinical/notes/archived",
5973
+ ...options
5974
+ });
5733
5975
  var getWorkspacesMine = (options) => (options.client ?? client).get({
5734
5976
  security: [{ scheme: "bearer", type: "http" }],
5735
5977
  url: "/workspaces/mine",
@@ -5814,6 +6056,15 @@ var postUsersAuthConfirm = (options) => (options.client ?? client).post({
5814
6056
  ...options.headers
5815
6057
  }
5816
6058
  });
6059
+ var patchClinicalClientSupplementsByIdArchive = (options) => (options.client ?? client).patch({
6060
+ security: [{ scheme: "bearer", type: "http" }],
6061
+ url: "/clinical/client-supplements/{id}/archive",
6062
+ ...options,
6063
+ headers: {
6064
+ "Content-Type": "application/vnd.api+json",
6065
+ ...options.headers
6066
+ }
6067
+ });
5817
6068
  var postAgentsCloneForWorkspace = (options) => (options.client ?? client).post({
5818
6069
  security: [{ scheme: "bearer", type: "http" }],
5819
6070
  url: "/agents/clone-for-workspace",
@@ -6301,7 +6552,16 @@ var patchExtractionResultsByIdSaveCorrections = (options) => (options.client ??
6301
6552
  ...options.headers
6302
6553
  }
6303
6554
  });
6304
- var getConsentRecords = (options) => (options.client ?? client).get({
6555
+ var patchClinicalMealPlansByIdRestore = (options) => (options.client ?? client).patch({
6556
+ security: [{ scheme: "bearer", type: "http" }],
6557
+ url: "/clinical/meal-plans/{id}/restore",
6558
+ ...options,
6559
+ headers: {
6560
+ "Content-Type": "application/vnd.api+json",
6561
+ ...options.headers
6562
+ }
6563
+ });
6564
+ var getConsentRecords = (options) => (options.client ?? client).get({
6305
6565
  security: [{ scheme: "bearer", type: "http" }],
6306
6566
  url: "/consent-records",
6307
6567
  ...options
@@ -6456,6 +6716,15 @@ var postWatcherEvents = (options) => (options.client ?? client).post({
6456
6716
  ...options.headers
6457
6717
  }
6458
6718
  });
6719
+ var patchClinicalPracticeToolsByIdRestore = (options) => (options.client ?? client).patch({
6720
+ security: [{ scheme: "bearer", type: "http" }],
6721
+ url: "/clinical/practice-tools/{id}/restore",
6722
+ ...options,
6723
+ headers: {
6724
+ "Content-Type": "application/vnd.api+json",
6725
+ ...options.headers
6726
+ }
6727
+ });
6459
6728
  var getAgentsBySlugBySlug = (options) => (options.client ?? client).get({
6460
6729
  security: [{ scheme: "bearer", type: "http" }],
6461
6730
  url: "/agents/by-slug/{slug}",
@@ -6568,6 +6837,11 @@ var postAgentsByIdClone = (options) => (options.client ?? client).post({
6568
6837
  ...options.headers
6569
6838
  }
6570
6839
  });
6840
+ var getClinicalGoalTemplatesArchived = (options) => (options.client ?? client).get({
6841
+ security: [{ scheme: "bearer", type: "http" }],
6842
+ url: "/clinical/goal-templates/archived",
6843
+ ...options
6844
+ });
6571
6845
  var getLegalDocuments = (options) => (options.client ?? client).get({
6572
6846
  security: [{ scheme: "bearer", type: "http" }],
6573
6847
  url: "/legal-documents",
@@ -6601,6 +6875,15 @@ var getEmailInboundReceivedWorkspaceByWorkspaceId = (options) => (options.client
6601
6875
  url: "/email/inbound/received/workspace/{workspace_id}",
6602
6876
  ...options
6603
6877
  });
6878
+ var patchClinicalPracticeResourcesCatalogByIdArchive = (options) => (options.client ?? client).patch({
6879
+ security: [{ scheme: "bearer", type: "http" }],
6880
+ url: "/clinical/practice-resources/catalog/{id}/archive",
6881
+ ...options,
6882
+ headers: {
6883
+ "Content-Type": "application/vnd.api+json",
6884
+ ...options.headers
6885
+ }
6886
+ });
6604
6887
  var getInvitationsMe = (options) => (options.client ?? client).get({
6605
6888
  security: [{ scheme: "bearer", type: "http" }],
6606
6889
  url: "/invitations/me",
@@ -6625,6 +6908,15 @@ var postClinicalGoalTemplates = (options) => (options.client ?? client).post({
6625
6908
  ...options.headers
6626
6909
  }
6627
6910
  });
6911
+ var patchClinicalGoalTemplatesByIdArchive = (options) => (options.client ?? client).patch({
6912
+ security: [{ scheme: "bearer", type: "http" }],
6913
+ url: "/clinical/goal-templates/{id}/archive",
6914
+ ...options,
6915
+ headers: {
6916
+ "Content-Type": "application/vnd.api+json",
6917
+ ...options.headers
6918
+ }
6919
+ });
6628
6920
  var patchClinicalNotesByIdReject = (options) => (options.client ?? client).patch({
6629
6921
  security: [{ scheme: "bearer", type: "http" }],
6630
6922
  url: "/clinical/notes/{id}/reject",
@@ -6742,6 +7034,11 @@ var getWallet = (options) => (options.client ?? client).get({
6742
7034
  url: "/wallet",
6743
7035
  ...options
6744
7036
  });
7037
+ var getClinicalPracticeToolsCatalogArchived = (options) => (options.client ?? client).get({
7038
+ security: [{ scheme: "bearer", type: "http" }],
7039
+ url: "/clinical/practice-tools/catalog/archived",
7040
+ ...options
7041
+ });
6745
7042
  var deleteCrawlerSchedulesById = (options) => (options.client ?? client).delete({
6746
7043
  security: [{ scheme: "bearer", type: "http" }],
6747
7044
  url: "/crawler/schedules/{id}",
@@ -6831,6 +7128,11 @@ var getWorkspaceAgentConfigs = (options) => (options.client ?? client).get({
6831
7128
  url: "/workspace-agent-configs",
6832
7129
  ...options
6833
7130
  });
7131
+ var getThreadsMine = (options) => (options.client ?? client).get({
7132
+ security: [{ scheme: "bearer", type: "http" }],
7133
+ url: "/threads/mine",
7134
+ ...options
7135
+ });
6834
7136
  var getDisclosureLogsById = (options) => (options.client ?? client).get({
6835
7137
  security: [{ scheme: "bearer", type: "http" }],
6836
7138
  url: "/disclosure-logs/{id}",
@@ -8580,7 +8882,8 @@ function createAgentsNamespace(rb) {
8580
8882
  * @param agentId - The UUID of the agent to execute.
8581
8883
  * @param input - Input data for the agent (task description, documents, etc.).
8582
8884
  * @param opts - Additional execution options.
8583
- * @param opts.workspace_id - The workspace to execute in. Required for `sk_app_` key auth.
8885
+ * @param opts.workspace_id - The workspace to execute in. **Required** unless
8886
+ * `workspaceId` was set in the `GptClient` constructor config.
8584
8887
  * @param opts.model_id - Override model for this execution only (e.g., "anthropic/claude-sonnet-4").
8585
8888
  * Highest priority in the model resolution chain.
8586
8889
  * @returns The created execution record with status `pending`.
@@ -9084,7 +9387,7 @@ function createAiNamespace(rb) {
9084
9387
  {
9085
9388
  body: {
9086
9389
  data: {
9087
- type: "conversation",
9390
+ type: "chat-conversation",
9088
9391
  attributes: attributes ?? {}
9089
9392
  }
9090
9393
  }
@@ -9163,7 +9466,7 @@ function createAiNamespace(rb) {
9163
9466
  {
9164
9467
  body: {
9165
9468
  data: {
9166
- type: "ai-message",
9469
+ type: "chat-ai-message",
9167
9470
  ...body,
9168
9471
  conversation_id: conversationId
9169
9472
  }
@@ -10178,8 +10481,8 @@ function createBillingNamespace(rb) {
10178
10481
  /**
10179
10482
  * Feature usage records — per-tenant usage tracking for metered features.
10180
10483
  *
10181
- * Read-only access to usage records that track how many times each tenant
10182
- * has used a feature in the current billing cycle.
10484
+ * Access usage records that track how many times each tenant
10485
+ * has used a feature in the current billing cycle, and increment usage.
10183
10486
  */
10184
10487
  featureUsages: {
10185
10488
  /** List all feature usage records. */
@@ -10203,6 +10506,37 @@ function createBillingNamespace(rb) {
10203
10506
  options
10204
10507
  );
10205
10508
  return result.data ?? result;
10509
+ },
10510
+ /**
10511
+ * Increment usage for a feature by key.
10512
+ *
10513
+ * Checks feature gate, enforces limits, charges credits for credit_cost
10514
+ * features, and atomically increments the usage counter. Returns the
10515
+ * updated usage count and remaining allowance.
10516
+ *
10517
+ * @param featureKey - The feature definition key (e.g., "meal_plans", "clients")
10518
+ * @returns Object with `used` (current cycle count) and `remaining` (null if unlimited)
10519
+ *
10520
+ * @example
10521
+ * ```typescript
10522
+ * const result = await client.billing.featureUsages.increment("meal_plans");
10523
+ * console.log(`Used: ${result.used}, Remaining: ${result.remaining}`);
10524
+ * ```
10525
+ */
10526
+ increment: async (featureKey, options) => {
10527
+ const result = await rb.execute(
10528
+ postFeatureUsagesIncrement,
10529
+ {
10530
+ body: {
10531
+ data: {
10532
+ type: "feature-usage",
10533
+ attributes: { feature_key: featureKey }
10534
+ }
10535
+ }
10536
+ },
10537
+ options
10538
+ );
10539
+ return result.data;
10206
10540
  }
10207
10541
  },
10208
10542
  /**
@@ -11395,7 +11729,7 @@ function createClinicalNamespace(rb) {
11395
11729
  }
11396
11730
  },
11397
11731
  /**
11398
- * Manage clinical sessions (practitionerpatient encounters).
11732
+ * Manage clinical sessions (practitioner-patient encounters).
11399
11733
  */
11400
11734
  sessions: {
11401
11735
  /**
@@ -11564,13 +11898,76 @@ function createClinicalNamespace(rb) {
11564
11898
  options
11565
11899
  ),
11566
11900
  /**
11567
- * Delete a clinical note.
11901
+ * Archive (soft-delete) a note.
11568
11902
  *
11903
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
11904
+ * Use `permanentDelete()` for irreversible removal.
11569
11905
  * @param id - Note UUID
11570
11906
  * @param options - Request options
11571
- * @returns `true` on successful deletion
11907
+ * @returns Archived {@link ClinicalNote} record
11908
+ */
11909
+ delete: async (id, options) => rb.execute(
11910
+ patchClinicalNotesByIdArchive,
11911
+ {
11912
+ path: { id },
11913
+ body: { data: { type: "clinical-note", id, attributes: {} } }
11914
+ },
11915
+ options
11916
+ ),
11917
+ /**
11918
+ * Archive (soft-delete) a note.
11919
+ *
11920
+ * @param id - Note UUID
11921
+ * @param options - Request options
11922
+ * @returns Archived {@link ClinicalNote} record
11923
+ */
11924
+ archive: async (id, options) => rb.execute(
11925
+ patchClinicalNotesByIdArchive,
11926
+ {
11927
+ path: { id },
11928
+ body: { data: { type: "clinical-note", id, attributes: {} } }
11929
+ },
11930
+ options
11931
+ ),
11932
+ /**
11933
+ * Restore an archived note.
11934
+ *
11935
+ * @param id - Note UUID
11936
+ * @param options - Request options
11937
+ * @returns Restored {@link ClinicalNote} record
11938
+ */
11939
+ restore: async (id, options) => rb.execute(
11940
+ patchClinicalNotesByIdRestore,
11941
+ {
11942
+ path: { id },
11943
+ body: { data: { type: "clinical-note", id, attributes: {} } }
11944
+ },
11945
+ options
11946
+ ),
11947
+ /**
11948
+ * Permanently delete a note. Irreversible.
11949
+ *
11950
+ * @param id - Note UUID
11951
+ * @param options - Request options
11952
+ * @returns `true` on success
11953
+ */
11954
+ permanentDelete: async (id, options) => rb.executeDelete(
11955
+ deleteClinicalNotesByIdPermanent,
11956
+ { path: { id } },
11957
+ options
11958
+ ),
11959
+ /**
11960
+ * List archived (soft-deleted) notes.
11961
+ *
11962
+ * @param params - Filter/pagination parameters
11963
+ * @param options - Request options
11964
+ * @returns Array of archived {@link ClinicalNote} records
11572
11965
  */
11573
- delete: async (id, options) => rb.executeDelete(deleteClinicalNotesById, { path: { id } }, options),
11966
+ listArchived: async (params, options) => rb.execute(
11967
+ getClinicalNotesArchived,
11968
+ params ?? {},
11969
+ options
11970
+ ),
11574
11971
  /**
11575
11972
  * Approve a clinical note (HITL workflow).
11576
11973
  *
@@ -11732,16 +12129,81 @@ function createClinicalNamespace(rb) {
11732
12129
  options
11733
12130
  ),
11734
12131
  /**
11735
- * Delete a health metric entry.
12132
+ * Archive (soft-delete) a health metric.
11736
12133
  *
12134
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
12135
+ * Use `permanentDelete()` for irreversible removal.
11737
12136
  * @param id - HealthMetric UUID
11738
12137
  * @param options - Request options
11739
- * @returns `true` on successful deletion
12138
+ * @returns Archived {@link ClinicalHealthMetric} record
12139
+ */
12140
+ delete: async (id, options) => rb.execute(
12141
+ patchClinicalHealthMetricsByIdArchive,
12142
+ {
12143
+ path: { id },
12144
+ body: {
12145
+ data: { type: "clinical-health-metric", id, attributes: {} }
12146
+ }
12147
+ },
12148
+ options
12149
+ ),
12150
+ /**
12151
+ * Archive (soft-delete) a health metric.
12152
+ *
12153
+ * @param id - HealthMetric UUID
12154
+ * @param options - Request options
12155
+ * @returns Archived {@link ClinicalHealthMetric} record
12156
+ */
12157
+ archive: async (id, options) => rb.execute(
12158
+ patchClinicalHealthMetricsByIdArchive,
12159
+ {
12160
+ path: { id },
12161
+ body: {
12162
+ data: { type: "clinical-health-metric", id, attributes: {} }
12163
+ }
12164
+ },
12165
+ options
12166
+ ),
12167
+ /**
12168
+ * Restore an archived health metric.
12169
+ *
12170
+ * @param id - HealthMetric UUID
12171
+ * @param options - Request options
12172
+ * @returns Restored {@link ClinicalHealthMetric} record
12173
+ */
12174
+ restore: async (id, options) => rb.execute(
12175
+ patchClinicalHealthMetricsByIdRestore,
12176
+ {
12177
+ path: { id },
12178
+ body: {
12179
+ data: { type: "clinical-health-metric", id, attributes: {} }
12180
+ }
12181
+ },
12182
+ options
12183
+ ),
12184
+ /**
12185
+ * Permanently delete a health metric. Irreversible.
12186
+ *
12187
+ * @param id - HealthMetric UUID
12188
+ * @param options - Request options
12189
+ * @returns `true` on success
11740
12190
  */
11741
- delete: async (id, options) => rb.executeDelete(
11742
- deleteClinicalHealthMetricsById,
12191
+ permanentDelete: async (id, options) => rb.executeDelete(
12192
+ deleteClinicalHealthMetricsByIdPermanent,
11743
12193
  { path: { id } },
11744
12194
  options
12195
+ ),
12196
+ /**
12197
+ * List archived (soft-deleted) health metrics.
12198
+ *
12199
+ * @param params - Filter/pagination parameters
12200
+ * @param options - Request options
12201
+ * @returns Array of archived {@link ClinicalHealthMetric} records
12202
+ */
12203
+ listArchived: async (params, options) => rb.execute(
12204
+ getClinicalHealthMetricsArchived,
12205
+ params ?? {},
12206
+ options
11745
12207
  )
11746
12208
  },
11747
12209
  /**
@@ -11801,16 +12263,75 @@ function createClinicalNamespace(rb) {
11801
12263
  options
11802
12264
  ),
11803
12265
  /**
11804
- * Delete a meal plan.
12266
+ * Archive (soft-delete) a meal plan.
11805
12267
  *
12268
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
12269
+ * Use `permanentDelete()` for irreversible removal.
11806
12270
  * @param id - MealPlan UUID
11807
12271
  * @param options - Request options
11808
- * @returns `true` on successful deletion
12272
+ * @returns Archived {@link ClinicalMealPlan} record
12273
+ */
12274
+ delete: async (id, options) => rb.execute(
12275
+ patchClinicalMealPlansByIdArchive,
12276
+ {
12277
+ path: { id },
12278
+ body: { data: { type: "clinical-meal-plan", id, attributes: {} } }
12279
+ },
12280
+ options
12281
+ ),
12282
+ /**
12283
+ * Archive (soft-delete) a meal plan.
12284
+ *
12285
+ * @param id - MealPlan UUID
12286
+ * @param options - Request options
12287
+ * @returns Archived {@link ClinicalMealPlan} record
12288
+ */
12289
+ archive: async (id, options) => rb.execute(
12290
+ patchClinicalMealPlansByIdArchive,
12291
+ {
12292
+ path: { id },
12293
+ body: { data: { type: "clinical-meal-plan", id, attributes: {} } }
12294
+ },
12295
+ options
12296
+ ),
12297
+ /**
12298
+ * Restore an archived meal plan.
12299
+ *
12300
+ * @param id - MealPlan UUID
12301
+ * @param options - Request options
12302
+ * @returns Restored {@link ClinicalMealPlan} record
12303
+ */
12304
+ restore: async (id, options) => rb.execute(
12305
+ patchClinicalMealPlansByIdRestore,
12306
+ {
12307
+ path: { id },
12308
+ body: { data: { type: "clinical-meal-plan", id, attributes: {} } }
12309
+ },
12310
+ options
12311
+ ),
12312
+ /**
12313
+ * Permanently delete a meal plan. Irreversible.
12314
+ *
12315
+ * @param id - MealPlan UUID
12316
+ * @param options - Request options
12317
+ * @returns `true` on success
11809
12318
  */
11810
- delete: async (id, options) => rb.executeDelete(
11811
- deleteClinicalMealPlansById,
12319
+ permanentDelete: async (id, options) => rb.executeDelete(
12320
+ deleteClinicalMealPlansByIdPermanent,
11812
12321
  { path: { id } },
11813
12322
  options
12323
+ ),
12324
+ /**
12325
+ * List archived (soft-deleted) meal plans.
12326
+ *
12327
+ * @param params - Filter/pagination parameters
12328
+ * @param options - Request options
12329
+ * @returns Array of archived {@link ClinicalMealPlan} records
12330
+ */
12331
+ listArchived: async (params, options) => rb.execute(
12332
+ getClinicalMealPlansArchived,
12333
+ params ?? {},
12334
+ options
11814
12335
  )
11815
12336
  },
11816
12337
  /**
@@ -11870,17 +12391,82 @@ function createClinicalNamespace(rb) {
11870
12391
  options
11871
12392
  ),
11872
12393
  /**
11873
- * Delete a client goal.
12394
+ * Archive (soft-delete) a client goal.
11874
12395
  *
12396
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
12397
+ * Use `permanentDelete()` for irreversible removal.
11875
12398
  * @param id - ClientGoal UUID
11876
12399
  * @param options - Request options
11877
- * @returns `true` on successful deletion
12400
+ * @returns Archived {@link ClinicalClientGoal} record
12401
+ */
12402
+ delete: async (id, options) => rb.execute(
12403
+ patchClinicalClientGoalsByIdArchive,
12404
+ {
12405
+ path: { id },
12406
+ body: {
12407
+ data: { type: "clinical-client-goal", id, attributes: {} }
12408
+ }
12409
+ },
12410
+ options
12411
+ ),
12412
+ /**
12413
+ * Archive (soft-delete) a client goal.
12414
+ *
12415
+ * @param id - ClientGoal UUID
12416
+ * @param options - Request options
12417
+ * @returns Archived {@link ClinicalClientGoal} record
12418
+ */
12419
+ archive: async (id, options) => rb.execute(
12420
+ patchClinicalClientGoalsByIdArchive,
12421
+ {
12422
+ path: { id },
12423
+ body: {
12424
+ data: { type: "clinical-client-goal", id, attributes: {} }
12425
+ }
12426
+ },
12427
+ options
12428
+ ),
12429
+ /**
12430
+ * Restore an archived client goal.
12431
+ *
12432
+ * @param id - ClientGoal UUID
12433
+ * @param options - Request options
12434
+ * @returns Restored {@link ClinicalClientGoal} record
12435
+ */
12436
+ restore: async (id, options) => rb.execute(
12437
+ patchClinicalClientGoalsByIdRestore,
12438
+ {
12439
+ path: { id },
12440
+ body: {
12441
+ data: { type: "clinical-client-goal", id, attributes: {} }
12442
+ }
12443
+ },
12444
+ options
12445
+ ),
12446
+ /**
12447
+ * Permanently delete a client goal. Irreversible.
12448
+ *
12449
+ * @param id - ClientGoal UUID
12450
+ * @param options - Request options
12451
+ * @returns `true` on success
11878
12452
  */
11879
- delete: async (id, options) => rb.executeDelete(
11880
- deleteClinicalClientGoalsById,
12453
+ permanentDelete: async (id, options) => rb.executeDelete(
12454
+ deleteClinicalClientGoalsByIdPermanent,
11881
12455
  { path: { id } },
11882
12456
  options
11883
12457
  ),
12458
+ /**
12459
+ * List archived (soft-deleted) client goals.
12460
+ *
12461
+ * @param params - Filter/pagination parameters
12462
+ * @param options - Request options
12463
+ * @returns Array of archived {@link ClinicalClientGoal} records
12464
+ */
12465
+ listArchived: async (params, options) => rb.execute(
12466
+ getClinicalClientGoalsArchived,
12467
+ params ?? {},
12468
+ options
12469
+ ),
11884
12470
  /**
11885
12471
  * Batch reorder client goals by updating their positions.
11886
12472
  *
@@ -11965,38 +12551,103 @@ function createClinicalNamespace(rb) {
11965
12551
  options
11966
12552
  ),
11967
12553
  /**
11968
- * Delete a supplement prescription.
12554
+ * Archive (soft-delete) a supplement prescription.
11969
12555
  *
12556
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
12557
+ * Use `permanentDelete()` for irreversible removal.
11970
12558
  * @param id - ClientSupplement UUID
11971
12559
  * @param options - Request options
11972
- * @returns `true` on successful deletion
12560
+ * @returns Archived {@link ClinicalClientSupplement} record
11973
12561
  */
11974
- delete: async (id, options) => rb.executeDelete(
11975
- deleteClinicalClientSupplementsById,
11976
- { path: { id } },
12562
+ delete: async (id, options) => rb.execute(
12563
+ patchClinicalClientSupplementsByIdArchive,
12564
+ {
12565
+ path: { id },
12566
+ body: {
12567
+ data: { type: "clinical-client-supplement", id, attributes: {} }
12568
+ }
12569
+ },
11977
12570
  options
11978
- )
11979
- },
11980
- /**
11981
- * Manage clinical deliveries (care plan items sent to patients).
11982
- */
11983
- deliveries: {
12571
+ ),
11984
12572
  /**
11985
- * List deliveries, filtered by patient/workspace.
12573
+ * Archive (soft-delete) a supplement prescription.
11986
12574
  *
11987
- * @param params - Filter/pagination parameters
12575
+ * @param id - ClientSupplement UUID
11988
12576
  * @param options - Request options
11989
- * @returns Array of {@link ClinicalDelivery} records
12577
+ * @returns Archived {@link ClinicalClientSupplement} record
11990
12578
  */
11991
- list: async (params, options) => rb.execute(
11992
- getClinicalDeliveries,
11993
- params ?? {},
12579
+ archive: async (id, options) => rb.execute(
12580
+ patchClinicalClientSupplementsByIdArchive,
12581
+ {
12582
+ path: { id },
12583
+ body: {
12584
+ data: { type: "clinical-client-supplement", id, attributes: {} }
12585
+ }
12586
+ },
11994
12587
  options
11995
12588
  ),
11996
12589
  /**
11997
- * Get a single delivery by ID.
12590
+ * Restore an archived supplement prescription.
11998
12591
  *
11999
- * @param id - Delivery UUID
12592
+ * @param id - ClientSupplement UUID
12593
+ * @param options - Request options
12594
+ * @returns Restored {@link ClinicalClientSupplement} record
12595
+ */
12596
+ restore: async (id, options) => rb.execute(
12597
+ patchClinicalClientSupplementsByIdRestore,
12598
+ {
12599
+ path: { id },
12600
+ body: {
12601
+ data: { type: "clinical-client-supplement", id, attributes: {} }
12602
+ }
12603
+ },
12604
+ options
12605
+ ),
12606
+ /**
12607
+ * Permanently delete a supplement prescription. Irreversible.
12608
+ *
12609
+ * @param id - ClientSupplement UUID
12610
+ * @param options - Request options
12611
+ * @returns `true` on success
12612
+ */
12613
+ permanentDelete: async (id, options) => rb.executeDelete(
12614
+ deleteClinicalClientSupplementsByIdPermanent,
12615
+ { path: { id } },
12616
+ options
12617
+ ),
12618
+ /**
12619
+ * List archived (soft-deleted) supplement prescriptions.
12620
+ *
12621
+ * @param params - Filter/pagination parameters
12622
+ * @param options - Request options
12623
+ * @returns Array of archived {@link ClinicalClientSupplement} records
12624
+ */
12625
+ listArchived: async (params, options) => rb.execute(
12626
+ getClinicalClientSupplementsArchived,
12627
+ params ?? {},
12628
+ options
12629
+ )
12630
+ },
12631
+ /**
12632
+ * Manage clinical deliveries (care plan items sent to patients).
12633
+ */
12634
+ deliveries: {
12635
+ /**
12636
+ * List deliveries, filtered by patient/workspace.
12637
+ *
12638
+ * @param params - Filter/pagination parameters
12639
+ * @param options - Request options
12640
+ * @returns Array of {@link ClinicalDelivery} records
12641
+ */
12642
+ list: async (params, options) => rb.execute(
12643
+ getClinicalDeliveries,
12644
+ params ?? {},
12645
+ options
12646
+ ),
12647
+ /**
12648
+ * Get a single delivery by ID.
12649
+ *
12650
+ * @param id - Delivery UUID
12000
12651
  * @param options - Request options
12001
12652
  * @returns {@link ClinicalDelivery} record
12002
12653
  */
@@ -12096,17 +12747,82 @@ function createClinicalNamespace(rb) {
12096
12747
  options
12097
12748
  ),
12098
12749
  /**
12099
- * Delete a practice resource.
12750
+ * Archive (soft-delete) a practice resource.
12100
12751
  *
12752
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
12753
+ * Use `permanentDelete()` for irreversible removal.
12101
12754
  * @param id - PracticeResource UUID
12102
12755
  * @param options - Request options
12103
- * @returns `true` on successful deletion
12756
+ * @returns Archived {@link ClinicalPracticeResource} record
12104
12757
  */
12105
- delete: async (id, options) => rb.executeDelete(
12106
- deleteClinicalPracticeResourcesById,
12758
+ delete: async (id, options) => rb.execute(
12759
+ patchClinicalPracticeResourcesByIdArchive,
12760
+ {
12761
+ path: { id },
12762
+ body: {
12763
+ data: { type: "clinical-practice-resource", id, attributes: {} }
12764
+ }
12765
+ },
12766
+ options
12767
+ ),
12768
+ /**
12769
+ * Archive (soft-delete) a practice resource.
12770
+ *
12771
+ * @param id - PracticeResource UUID
12772
+ * @param options - Request options
12773
+ * @returns Archived {@link ClinicalPracticeResource} record
12774
+ */
12775
+ archive: async (id, options) => rb.execute(
12776
+ patchClinicalPracticeResourcesByIdArchive,
12777
+ {
12778
+ path: { id },
12779
+ body: {
12780
+ data: { type: "clinical-practice-resource", id, attributes: {} }
12781
+ }
12782
+ },
12783
+ options
12784
+ ),
12785
+ /**
12786
+ * Restore an archived practice resource.
12787
+ *
12788
+ * @param id - PracticeResource UUID
12789
+ * @param options - Request options
12790
+ * @returns Restored {@link ClinicalPracticeResource} record
12791
+ */
12792
+ restore: async (id, options) => rb.execute(
12793
+ patchClinicalPracticeResourcesByIdRestore,
12794
+ {
12795
+ path: { id },
12796
+ body: {
12797
+ data: { type: "clinical-practice-resource", id, attributes: {} }
12798
+ }
12799
+ },
12800
+ options
12801
+ ),
12802
+ /**
12803
+ * Permanently delete a practice resource. Irreversible.
12804
+ *
12805
+ * @param id - PracticeResource UUID
12806
+ * @param options - Request options
12807
+ * @returns `true` on success
12808
+ */
12809
+ permanentDelete: async (id, options) => rb.executeDelete(
12810
+ deleteClinicalPracticeResourcesByIdPermanent,
12107
12811
  { path: { id } },
12108
12812
  options
12109
12813
  ),
12814
+ /**
12815
+ * List archived (soft-deleted) practice resources.
12816
+ *
12817
+ * @param params - Filter/pagination parameters
12818
+ * @param options - Request options
12819
+ * @returns Array of archived {@link ClinicalPracticeResource} records
12820
+ */
12821
+ listArchived: async (params, options) => rb.execute(
12822
+ getClinicalPracticeResourcesArchived,
12823
+ params ?? {},
12824
+ options
12825
+ ),
12110
12826
  /**
12111
12827
  * List application-level catalog practice resources.
12112
12828
  *
@@ -12119,6 +12835,64 @@ function createClinicalNamespace(rb) {
12119
12835
  { query: params ?? {} },
12120
12836
  options
12121
12837
  ),
12838
+ /**
12839
+ * Archive (soft-delete) a catalog practice resource.
12840
+ *
12841
+ * @param id - PracticeResource UUID
12842
+ * @param options - Request options
12843
+ * @returns Archived {@link ClinicalPracticeResource} record
12844
+ */
12845
+ archiveCatalog: async (id, options) => rb.execute(
12846
+ patchClinicalPracticeResourcesCatalogByIdArchive,
12847
+ {
12848
+ path: { id },
12849
+ body: {
12850
+ data: { type: "clinical-practice-resource", id, attributes: {} }
12851
+ }
12852
+ },
12853
+ options
12854
+ ),
12855
+ /**
12856
+ * Restore an archived catalog practice resource.
12857
+ *
12858
+ * @param id - PracticeResource UUID
12859
+ * @param options - Request options
12860
+ * @returns Restored {@link ClinicalPracticeResource} record
12861
+ */
12862
+ restoreCatalog: async (id, options) => rb.execute(
12863
+ patchClinicalPracticeResourcesCatalogByIdRestore,
12864
+ {
12865
+ path: { id },
12866
+ body: {
12867
+ data: { type: "clinical-practice-resource", id, attributes: {} }
12868
+ }
12869
+ },
12870
+ options
12871
+ ),
12872
+ /**
12873
+ * Permanently delete a catalog practice resource. Irreversible.
12874
+ *
12875
+ * @param id - PracticeResource UUID
12876
+ * @param options - Request options
12877
+ * @returns `true` on success
12878
+ */
12879
+ permanentDeleteCatalog: async (id, options) => rb.executeDelete(
12880
+ deleteClinicalPracticeResourcesCatalogByIdPermanent,
12881
+ { path: { id } },
12882
+ options
12883
+ ),
12884
+ /**
12885
+ * List archived (soft-deleted) catalog practice resources.
12886
+ *
12887
+ * @param params - Filter/pagination parameters
12888
+ * @param options - Request options
12889
+ * @returns Array of archived {@link ClinicalPracticeResource} catalog records
12890
+ */
12891
+ listArchivedCatalog: async (params, options) => rb.execute(
12892
+ getClinicalPracticeResourcesCatalogArchived,
12893
+ params ?? {},
12894
+ options
12895
+ ),
12122
12896
  /**
12123
12897
  * List distinct practice resource categories in a workspace.
12124
12898
  *
@@ -12158,7 +12932,88 @@ function createClinicalNamespace(rb) {
12158
12932
  listCatalogCategories: async (options) => rb.rawGet(
12159
12933
  `/clinical/practice-resources/categories/catalog`,
12160
12934
  options
12161
- )
12935
+ ),
12936
+ tags: {
12937
+ rename: async (workspaceId, oldTag, newTag, options) => rb.rawPatch(
12938
+ `/clinical/practice-resources/tags/rename`,
12939
+ { workspace_id: workspaceId, old_tag: oldTag, new_tag: newTag },
12940
+ options
12941
+ ),
12942
+ delete: async (workspaceId, tag, options) => rb.rawDelete(
12943
+ `/clinical/practice-resources/tags/${encodeURIComponent(tag)}?workspace_id=${encodeURIComponent(workspaceId)}`,
12944
+ options
12945
+ ),
12946
+ merge: async (workspaceId, sourceTags, targetTag, options) => rb.rawPost(
12947
+ `/clinical/practice-resources/tags/merge`,
12948
+ {
12949
+ workspace_id: workspaceId,
12950
+ source_tags: sourceTags,
12951
+ target_tag: targetTag
12952
+ },
12953
+ options
12954
+ )
12955
+ },
12956
+ imports: {
12957
+ fromFile: async (workspaceId, file, options) => {
12958
+ const formData = new FormData();
12959
+ formData.append("file", file);
12960
+ formData.append("workspace_id", workspaceId);
12961
+ return rb.rawPostMultipart(
12962
+ `/clinical/practice-resources/imports/file`,
12963
+ formData,
12964
+ options
12965
+ );
12966
+ },
12967
+ fromUrl: async (workspaceId, url, options) => rb.rawPost(
12968
+ `/clinical/practice-resources/imports/url`,
12969
+ { workspace_id: workspaceId, url },
12970
+ options
12971
+ )
12972
+ },
12973
+ duplicates: {
12974
+ getStats: async (workspaceId, options) => rb.rawGet(
12975
+ `/clinical/practice-resources/duplicates?workspace_id=${encodeURIComponent(workspaceId)}`,
12976
+ options
12977
+ ),
12978
+ listGroups: async (workspaceId, opts, options) => {
12979
+ const qs = new URLSearchParams({ workspace_id: workspaceId });
12980
+ if (opts?.threshold !== void 0)
12981
+ qs.set("threshold", String(opts.threshold));
12982
+ if (opts?.limit !== void 0) qs.set("limit", String(opts.limit));
12983
+ return rb.rawGet(
12984
+ `/clinical/practice-resources/duplicates/groups?${qs.toString()}`,
12985
+ options
12986
+ );
12987
+ },
12988
+ resolve: async (workspaceId, groupId, keepId, options) => rb.rawPost(
12989
+ `/clinical/practice-resources/duplicates/resolve`,
12990
+ { workspace_id: workspaceId, group_id: groupId, keep_id: keepId },
12991
+ options
12992
+ )
12993
+ },
12994
+ /**
12995
+ * Search practice resources using semantic similarity.
12996
+ * Finds resources matching the query by meaning, not just keywords.
12997
+ *
12998
+ * @param workspaceId - The workspace to search in
12999
+ * @param params - Search parameters
13000
+ * @param params.query - Free-text search query
13001
+ * @param params.limit - Maximum results to return (default: 10)
13002
+ * @returns Array of matching practice resources with similarity scores
13003
+ *
13004
+ * @example
13005
+ * ```typescript
13006
+ * const results = await client.clinical.practiceResources.search(workspaceId, {
13007
+ * query: "diabetes management patient education",
13008
+ * limit: 5,
13009
+ * });
13010
+ * ```
13011
+ */
13012
+ search: async (workspaceId, params, options) => rb.rawPost(
13013
+ `/clinical/practice-resources/search`,
13014
+ { ...params, workspace_id: workspaceId },
13015
+ options
13016
+ ).then((r) => r.data)
12162
13017
  },
12163
13018
  /**
12164
13019
  * Manage practice-level assessment and therapeutic tools.
@@ -12217,17 +13072,82 @@ function createClinicalNamespace(rb) {
12217
13072
  options
12218
13073
  ),
12219
13074
  /**
12220
- * Delete a practice tool.
13075
+ * Archive (soft-delete) a practice tool.
12221
13076
  *
13077
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
13078
+ * Use `permanentDelete()` for irreversible removal.
12222
13079
  * @param id - PracticeTool UUID
12223
13080
  * @param options - Request options
12224
- * @returns `true` on successful deletion
13081
+ * @returns Archived {@link ClinicalPracticeTool} record
13082
+ */
13083
+ delete: async (id, options) => rb.execute(
13084
+ patchClinicalPracticeToolsByIdArchive,
13085
+ {
13086
+ path: { id },
13087
+ body: {
13088
+ data: { type: "clinical-practice-tool", id, attributes: {} }
13089
+ }
13090
+ },
13091
+ options
13092
+ ),
13093
+ /**
13094
+ * Archive (soft-delete) a practice tool.
13095
+ *
13096
+ * @param id - PracticeTool UUID
13097
+ * @param options - Request options
13098
+ * @returns Archived {@link ClinicalPracticeTool} record
13099
+ */
13100
+ archive: async (id, options) => rb.execute(
13101
+ patchClinicalPracticeToolsByIdArchive,
13102
+ {
13103
+ path: { id },
13104
+ body: {
13105
+ data: { type: "clinical-practice-tool", id, attributes: {} }
13106
+ }
13107
+ },
13108
+ options
13109
+ ),
13110
+ /**
13111
+ * Restore an archived practice tool.
13112
+ *
13113
+ * @param id - PracticeTool UUID
13114
+ * @param options - Request options
13115
+ * @returns Restored {@link ClinicalPracticeTool} record
13116
+ */
13117
+ restore: async (id, options) => rb.execute(
13118
+ patchClinicalPracticeToolsByIdRestore,
13119
+ {
13120
+ path: { id },
13121
+ body: {
13122
+ data: { type: "clinical-practice-tool", id, attributes: {} }
13123
+ }
13124
+ },
13125
+ options
13126
+ ),
13127
+ /**
13128
+ * Permanently delete a practice tool. Irreversible.
13129
+ *
13130
+ * @param id - PracticeTool UUID
13131
+ * @param options - Request options
13132
+ * @returns `true` on success
12225
13133
  */
12226
- delete: async (id, options) => rb.executeDelete(
12227
- deleteClinicalPracticeToolsById,
13134
+ permanentDelete: async (id, options) => rb.executeDelete(
13135
+ deleteClinicalPracticeToolsByIdPermanent,
12228
13136
  { path: { id } },
12229
13137
  options
12230
13138
  ),
13139
+ /**
13140
+ * List archived (soft-deleted) practice tools.
13141
+ *
13142
+ * @param params - Filter/pagination parameters
13143
+ * @param options - Request options
13144
+ * @returns Array of archived {@link ClinicalPracticeTool} records
13145
+ */
13146
+ listArchived: async (params, options) => rb.execute(
13147
+ getClinicalPracticeToolsArchived,
13148
+ params ?? {},
13149
+ options
13150
+ ),
12231
13151
  /**
12232
13152
  * List distinct practice tool categories in a workspace.
12233
13153
  *
@@ -12262,6 +13182,64 @@ function createClinicalNamespace(rb) {
12262
13182
  { query: params ?? {} },
12263
13183
  options
12264
13184
  ),
13185
+ /**
13186
+ * Archive (soft-delete) a catalog practice tool.
13187
+ *
13188
+ * @param id - PracticeTool UUID
13189
+ * @param options - Request options
13190
+ * @returns Archived {@link ClinicalPracticeTool} record
13191
+ */
13192
+ archiveCatalog: async (id, options) => rb.execute(
13193
+ patchClinicalPracticeToolsCatalogByIdArchive,
13194
+ {
13195
+ path: { id },
13196
+ body: {
13197
+ data: { type: "clinical-practice-tool", id, attributes: {} }
13198
+ }
13199
+ },
13200
+ options
13201
+ ),
13202
+ /**
13203
+ * Restore an archived catalog practice tool.
13204
+ *
13205
+ * @param id - PracticeTool UUID
13206
+ * @param options - Request options
13207
+ * @returns Restored {@link ClinicalPracticeTool} record
13208
+ */
13209
+ restoreCatalog: async (id, options) => rb.execute(
13210
+ patchClinicalPracticeToolsCatalogByIdRestore,
13211
+ {
13212
+ path: { id },
13213
+ body: {
13214
+ data: { type: "clinical-practice-tool", id, attributes: {} }
13215
+ }
13216
+ },
13217
+ options
13218
+ ),
13219
+ /**
13220
+ * Permanently delete a catalog practice tool. Irreversible.
13221
+ *
13222
+ * @param id - PracticeTool UUID
13223
+ * @param options - Request options
13224
+ * @returns `true` on success
13225
+ */
13226
+ permanentDeleteCatalog: async (id, options) => rb.executeDelete(
13227
+ deleteClinicalPracticeToolsCatalogByIdPermanent,
13228
+ { path: { id } },
13229
+ options
13230
+ ),
13231
+ /**
13232
+ * List archived (soft-deleted) catalog practice tools.
13233
+ *
13234
+ * @param params - Filter/pagination parameters
13235
+ * @param options - Request options
13236
+ * @returns Array of archived {@link ClinicalPracticeTool} catalog records
13237
+ */
13238
+ listArchivedCatalog: async (params, options) => rb.execute(
13239
+ getClinicalPracticeToolsCatalogArchived,
13240
+ params ?? {},
13241
+ options
13242
+ ),
12265
13243
  /**
12266
13244
  * List distinct catalog practice tool categories.
12267
13245
  *
@@ -12279,7 +13257,87 @@ function createClinicalNamespace(rb) {
12279
13257
  listCatalogCategories: async (options) => rb.rawGet(
12280
13258
  `/clinical/practice-tools/categories/catalog`,
12281
13259
  options
12282
- )
13260
+ ),
13261
+ tags: {
13262
+ rename: async (workspaceId, oldTag, newTag, options) => rb.rawPatch(
13263
+ `/clinical/practice-tools/tags/rename`,
13264
+ { workspace_id: workspaceId, old_tag: oldTag, new_tag: newTag },
13265
+ options
13266
+ ),
13267
+ delete: async (workspaceId, tag, options) => rb.rawDelete(
13268
+ `/clinical/practice-tools/tags/${encodeURIComponent(tag)}?workspace_id=${encodeURIComponent(workspaceId)}`,
13269
+ options
13270
+ ),
13271
+ merge: async (workspaceId, sourceTags, targetTag, options) => rb.rawPost(
13272
+ `/clinical/practice-tools/tags/merge`,
13273
+ {
13274
+ workspace_id: workspaceId,
13275
+ source_tags: sourceTags,
13276
+ target_tag: targetTag
13277
+ },
13278
+ options
13279
+ )
13280
+ },
13281
+ imports: {
13282
+ fromFile: async (workspaceId, file, options) => {
13283
+ const formData = new FormData();
13284
+ formData.append("file", file);
13285
+ formData.append("workspace_id", workspaceId);
13286
+ return rb.rawPostMultipart(
13287
+ `/clinical/practice-tools/imports/file`,
13288
+ formData,
13289
+ options
13290
+ );
13291
+ },
13292
+ fromUrl: async (workspaceId, url, options) => rb.rawPost(
13293
+ `/clinical/practice-tools/imports/url`,
13294
+ { workspace_id: workspaceId, url },
13295
+ options
13296
+ )
13297
+ },
13298
+ duplicates: {
13299
+ getStats: async (workspaceId, options) => rb.rawGet(
13300
+ `/clinical/practice-tools/duplicates?workspace_id=${encodeURIComponent(workspaceId)}`,
13301
+ options
13302
+ ),
13303
+ listGroups: async (workspaceId, opts, options) => {
13304
+ const qs = new URLSearchParams({ workspace_id: workspaceId });
13305
+ if (opts?.threshold !== void 0)
13306
+ qs.set("threshold", String(opts.threshold));
13307
+ if (opts?.limit !== void 0) qs.set("limit", String(opts.limit));
13308
+ return rb.rawGet(
13309
+ `/clinical/practice-tools/duplicates/groups?${qs.toString()}`,
13310
+ options
13311
+ );
13312
+ },
13313
+ resolve: async (workspaceId, groupId, keepId, options) => rb.rawPost(
13314
+ `/clinical/practice-tools/duplicates/resolve`,
13315
+ { workspace_id: workspaceId, group_id: groupId, keep_id: keepId },
13316
+ options
13317
+ )
13318
+ },
13319
+ /**
13320
+ * Search practice tools using semantic similarity.
13321
+ *
13322
+ * @param workspaceId - The workspace to search in
13323
+ * @param params - Search parameters
13324
+ * @param params.query - Free-text search query
13325
+ * @param params.limit - Maximum results to return (default: 10)
13326
+ * @returns Array of matching practice tools with similarity scores
13327
+ *
13328
+ * @example
13329
+ * ```typescript
13330
+ * const results = await client.clinical.practiceTools.search(workspaceId, {
13331
+ * query: "stress assessment screening tool",
13332
+ * limit: 5,
13333
+ * });
13334
+ * ```
13335
+ */
13336
+ search: async (workspaceId, params, options) => rb.rawPost(
13337
+ `/clinical/practice-tools/search`,
13338
+ { ...params, workspace_id: workspaceId },
13339
+ options
13340
+ ).then((r) => r.data)
12283
13341
  },
12284
13342
  /**
12285
13343
  * Manage assignments of practice resources to patients.
@@ -12349,16 +13407,93 @@ function createClinicalNamespace(rb) {
12349
13407
  options
12350
13408
  ),
12351
13409
  /**
12352
- * Delete a resource assignment.
13410
+ * Archive (soft-delete) a resource assignment.
12353
13411
  *
13412
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
13413
+ * Use `permanentDelete()` for irreversible removal.
12354
13414
  * @param id - ClientResourceAssignment UUID
12355
13415
  * @param options - Request options
12356
- * @returns `true` on successful deletion
13416
+ * @returns Archived {@link ClinicalClientResourceAssignment} record
13417
+ */
13418
+ delete: async (id, options) => rb.execute(
13419
+ patchClinicalClientResourceAssignmentsByIdArchive,
13420
+ {
13421
+ path: { id },
13422
+ body: {
13423
+ data: {
13424
+ type: "clinical-client-resource-assignment",
13425
+ id,
13426
+ attributes: {}
13427
+ }
13428
+ }
13429
+ },
13430
+ options
13431
+ ),
13432
+ /**
13433
+ * Archive (soft-delete) a resource assignment.
13434
+ *
13435
+ * @param id - ClientResourceAssignment UUID
13436
+ * @param options - Request options
13437
+ * @returns Archived {@link ClinicalClientResourceAssignment} record
13438
+ */
13439
+ archive: async (id, options) => rb.execute(
13440
+ patchClinicalClientResourceAssignmentsByIdArchive,
13441
+ {
13442
+ path: { id },
13443
+ body: {
13444
+ data: {
13445
+ type: "clinical-client-resource-assignment",
13446
+ id,
13447
+ attributes: {}
13448
+ }
13449
+ }
13450
+ },
13451
+ options
13452
+ ),
13453
+ /**
13454
+ * Restore an archived resource assignment.
13455
+ *
13456
+ * @param id - ClientResourceAssignment UUID
13457
+ * @param options - Request options
13458
+ * @returns Restored {@link ClinicalClientResourceAssignment} record
13459
+ */
13460
+ restore: async (id, options) => rb.execute(
13461
+ patchClinicalClientResourceAssignmentsByIdRestore,
13462
+ {
13463
+ path: { id },
13464
+ body: {
13465
+ data: {
13466
+ type: "clinical-client-resource-assignment",
13467
+ id,
13468
+ attributes: {}
13469
+ }
13470
+ }
13471
+ },
13472
+ options
13473
+ ),
13474
+ /**
13475
+ * Permanently delete a resource assignment. Irreversible.
13476
+ *
13477
+ * @param id - ClientResourceAssignment UUID
13478
+ * @param options - Request options
13479
+ * @returns `true` on success
12357
13480
  */
12358
- delete: async (id, options) => rb.executeDelete(
12359
- deleteClinicalClientResourceAssignmentsById,
13481
+ permanentDelete: async (id, options) => rb.executeDelete(
13482
+ deleteClinicalClientResourceAssignmentsByIdPermanent,
12360
13483
  { path: { id } },
12361
13484
  options
13485
+ ),
13486
+ /**
13487
+ * List archived (soft-deleted) resource assignments.
13488
+ *
13489
+ * @param params - Filter/pagination parameters
13490
+ * @param options - Request options
13491
+ * @returns Array of archived {@link ClinicalClientResourceAssignment} records
13492
+ */
13493
+ listArchived: async (params, options) => rb.execute(
13494
+ getClinicalClientResourceAssignmentsArchived,
13495
+ params ?? {},
13496
+ options
12362
13497
  )
12363
13498
  },
12364
13499
  /**
@@ -12491,72 +13626,195 @@ function createClinicalNamespace(rb) {
12491
13626
  * @param options - Request options
12492
13627
  * @returns Created {@link ClinicalGoalTemplate} record
12493
13628
  */
12494
- create: async (attributes, options) => rb.execute(
12495
- postClinicalGoalTemplates,
12496
- { body: { data: { type: "clinical-goal-template", attributes } } },
13629
+ create: async (attributes, options) => rb.execute(
13630
+ postClinicalGoalTemplates,
13631
+ { body: { data: { type: "clinical-goal-template", attributes } } },
13632
+ options
13633
+ ),
13634
+ /**
13635
+ * Create a personalized template from an existing one.
13636
+ *
13637
+ * Copies all fields from the source template, sets `created_by_id` to the
13638
+ * current actor, and sets `source_template_id` as a reference.
13639
+ *
13640
+ * @param attributes - Must include `workspace_id` and `source_template_id`
13641
+ * @param options - Request options
13642
+ * @returns Created {@link ClinicalGoalTemplate} record
13643
+ *
13644
+ * @example
13645
+ * ```typescript
13646
+ * const personal = await client.clinical.goalTemplates.createFromExisting({
13647
+ * workspace_id: "ws_123",
13648
+ * source_template_id: "tmpl_abc",
13649
+ * });
13650
+ * ```
13651
+ */
13652
+ createFromExisting: async (attributes, options) => rb.execute(
13653
+ postClinicalGoalTemplatesFromExisting,
13654
+ { body: { data: { type: "clinical-goal-template", attributes } } },
13655
+ options
13656
+ ),
13657
+ /**
13658
+ * Update a goal template.
13659
+ *
13660
+ * @param id - GoalTemplate UUID
13661
+ * @param attributes - Fields to update (PATCH semantics)
13662
+ * @param options - Request options
13663
+ * @returns Updated {@link ClinicalGoalTemplate} record
13664
+ */
13665
+ update: async (id, attributes, options) => rb.execute(
13666
+ patchClinicalGoalTemplatesById,
13667
+ {
13668
+ path: { id },
13669
+ body: { data: { type: "clinical-goal-template", id, attributes } }
13670
+ },
13671
+ options
13672
+ ),
13673
+ /**
13674
+ * Archive (soft-delete) a goal template.
13675
+ *
13676
+ * @deprecated Use `archive()` instead. Now performs soft-delete, not permanent deletion.
13677
+ * Use `permanentDelete()` for irreversible removal.
13678
+ * @param id - GoalTemplate UUID
13679
+ * @param options - Request options
13680
+ * @returns Archived {@link ClinicalGoalTemplate} record
13681
+ */
13682
+ delete: async (id, options) => rb.execute(
13683
+ patchClinicalGoalTemplatesByIdArchive,
13684
+ {
13685
+ path: { id },
13686
+ body: {
13687
+ data: { type: "clinical-goal-template", id, attributes: {} }
13688
+ }
13689
+ },
13690
+ options
13691
+ ),
13692
+ /**
13693
+ * Archive (soft-delete) a goal template.
13694
+ *
13695
+ * @param id - GoalTemplate UUID
13696
+ * @param options - Request options
13697
+ * @returns Archived {@link ClinicalGoalTemplate} record
13698
+ */
13699
+ archive: async (id, options) => rb.execute(
13700
+ patchClinicalGoalTemplatesByIdArchive,
13701
+ {
13702
+ path: { id },
13703
+ body: {
13704
+ data: { type: "clinical-goal-template", id, attributes: {} }
13705
+ }
13706
+ },
13707
+ options
13708
+ ),
13709
+ /**
13710
+ * Restore an archived goal template.
13711
+ *
13712
+ * @param id - GoalTemplate UUID
13713
+ * @param options - Request options
13714
+ * @returns Restored {@link ClinicalGoalTemplate} record
13715
+ */
13716
+ restore: async (id, options) => rb.execute(
13717
+ patchClinicalGoalTemplatesByIdRestore,
13718
+ {
13719
+ path: { id },
13720
+ body: {
13721
+ data: { type: "clinical-goal-template", id, attributes: {} }
13722
+ }
13723
+ },
13724
+ options
13725
+ ),
13726
+ /**
13727
+ * Permanently delete a goal template. Irreversible.
13728
+ *
13729
+ * @param id - GoalTemplate UUID
13730
+ * @param options - Request options
13731
+ * @returns `true` on success
13732
+ */
13733
+ permanentDelete: async (id, options) => rb.executeDelete(
13734
+ deleteClinicalGoalTemplatesByIdPermanent,
13735
+ { path: { id } },
13736
+ options
13737
+ ),
13738
+ /**
13739
+ * List archived (soft-deleted) goal templates.
13740
+ *
13741
+ * @param params - Filter/pagination parameters
13742
+ * @param options - Request options
13743
+ * @returns Array of archived {@link ClinicalGoalTemplate} records
13744
+ */
13745
+ listArchived: async (params, options) => rb.execute(
13746
+ getClinicalGoalTemplatesArchived,
13747
+ params ?? {},
13748
+ options
13749
+ ),
13750
+ /**
13751
+ * List application-level catalog goal templates.
13752
+ *
13753
+ * @param params - Optional filter/sort params. Application ID is resolved from the API key context.
13754
+ * @param options - Request options
13755
+ * @returns Array of {@link ClinicalGoalTemplate} catalog records
13756
+ */
13757
+ listCatalog: async (params, options) => rb.execute(
13758
+ getClinicalGoalTemplatesCatalog,
13759
+ { query: params ?? {} },
12497
13760
  options
12498
13761
  ),
12499
13762
  /**
12500
- * Create a personalized template from an existing one.
12501
- *
12502
- * Copies all fields from the source template, sets `created_by_id` to the
12503
- * current actor, and sets `source_template_id` as a reference.
13763
+ * Archive (soft-delete) a catalog goal template.
12504
13764
  *
12505
- * @param attributes - Must include `workspace_id` and `source_template_id`
13765
+ * @param id - GoalTemplate UUID
12506
13766
  * @param options - Request options
12507
- * @returns Created {@link ClinicalGoalTemplate} record
12508
- *
12509
- * @example
12510
- * ```typescript
12511
- * const personal = await client.clinical.goalTemplates.createFromExisting({
12512
- * workspace_id: "ws_123",
12513
- * source_template_id: "tmpl_abc",
12514
- * });
12515
- * ```
13767
+ * @returns Archived {@link ClinicalGoalTemplate} record
12516
13768
  */
12517
- createFromExisting: async (attributes, options) => rb.execute(
12518
- postClinicalGoalTemplatesFromExisting,
12519
- { body: { data: { type: "clinical-goal-template", attributes } } },
13769
+ archiveCatalog: async (id, options) => rb.execute(
13770
+ patchClinicalGoalTemplatesCatalogByIdArchive,
13771
+ {
13772
+ path: { id },
13773
+ body: {
13774
+ data: { type: "clinical-goal-template", id, attributes: {} }
13775
+ }
13776
+ },
12520
13777
  options
12521
13778
  ),
12522
13779
  /**
12523
- * Update a goal template.
13780
+ * Restore an archived catalog goal template.
12524
13781
  *
12525
13782
  * @param id - GoalTemplate UUID
12526
- * @param attributes - Fields to update (PATCH semantics)
12527
13783
  * @param options - Request options
12528
- * @returns Updated {@link ClinicalGoalTemplate} record
13784
+ * @returns Restored {@link ClinicalGoalTemplate} record
12529
13785
  */
12530
- update: async (id, attributes, options) => rb.execute(
12531
- patchClinicalGoalTemplatesById,
13786
+ restoreCatalog: async (id, options) => rb.execute(
13787
+ patchClinicalGoalTemplatesCatalogByIdRestore,
12532
13788
  {
12533
13789
  path: { id },
12534
- body: { data: { type: "clinical-goal-template", id, attributes } }
13790
+ body: {
13791
+ data: { type: "clinical-goal-template", id, attributes: {} }
13792
+ }
12535
13793
  },
12536
13794
  options
12537
13795
  ),
12538
13796
  /**
12539
- * Delete a goal template.
13797
+ * Permanently delete a catalog goal template. Irreversible.
12540
13798
  *
12541
13799
  * @param id - GoalTemplate UUID
12542
13800
  * @param options - Request options
12543
- * @returns `true` on successful deletion
13801
+ * @returns `true` on success
12544
13802
  */
12545
- delete: async (id, options) => rb.executeDelete(
12546
- deleteClinicalGoalTemplatesById,
13803
+ permanentDeleteCatalog: async (id, options) => rb.executeDelete(
13804
+ deleteClinicalGoalTemplatesCatalogByIdPermanent,
12547
13805
  { path: { id } },
12548
13806
  options
12549
13807
  ),
12550
13808
  /**
12551
- * List application-level catalog goal templates.
13809
+ * List archived (soft-deleted) catalog goal templates.
12552
13810
  *
12553
- * @param params - Optional filter/sort params. Application ID is resolved from the API key context.
13811
+ * @param params - Filter/pagination parameters
12554
13812
  * @param options - Request options
12555
- * @returns Array of {@link ClinicalGoalTemplate} catalog records
13813
+ * @returns Array of archived {@link ClinicalGoalTemplate} catalog records
12556
13814
  */
12557
- listCatalog: async (params, options) => rb.execute(
12558
- getClinicalGoalTemplatesCatalog,
12559
- { query: params ?? {} },
13815
+ listArchivedCatalog: async (params, options) => rb.execute(
13816
+ getClinicalGoalTemplatesCatalogArchived,
13817
+ params ?? {},
12560
13818
  options
12561
13819
  ),
12562
13820
  /**
@@ -12576,7 +13834,87 @@ function createClinicalNamespace(rb) {
12576
13834
  listCatalogCategories: async (options) => rb.rawGet(
12577
13835
  `/clinical/goal-templates/categories/catalog`,
12578
13836
  options
12579
- )
13837
+ ),
13838
+ tags: {
13839
+ rename: async (workspaceId, oldTag, newTag, options) => rb.rawPatch(
13840
+ `/clinical/goal-templates/tags/rename`,
13841
+ { workspace_id: workspaceId, old_tag: oldTag, new_tag: newTag },
13842
+ options
13843
+ ),
13844
+ delete: async (workspaceId, tag, options) => rb.rawDelete(
13845
+ `/clinical/goal-templates/tags/${encodeURIComponent(tag)}?workspace_id=${encodeURIComponent(workspaceId)}`,
13846
+ options
13847
+ ),
13848
+ merge: async (workspaceId, sourceTags, targetTag, options) => rb.rawPost(
13849
+ `/clinical/goal-templates/tags/merge`,
13850
+ {
13851
+ workspace_id: workspaceId,
13852
+ source_tags: sourceTags,
13853
+ target_tag: targetTag
13854
+ },
13855
+ options
13856
+ )
13857
+ },
13858
+ imports: {
13859
+ fromFile: async (workspaceId, file, options) => {
13860
+ const formData = new FormData();
13861
+ formData.append("file", file);
13862
+ formData.append("workspace_id", workspaceId);
13863
+ return rb.rawPostMultipart(
13864
+ `/clinical/goal-templates/imports/file`,
13865
+ formData,
13866
+ options
13867
+ );
13868
+ },
13869
+ fromUrl: async (workspaceId, url, options) => rb.rawPost(
13870
+ `/clinical/goal-templates/imports/url`,
13871
+ { workspace_id: workspaceId, url },
13872
+ options
13873
+ )
13874
+ },
13875
+ duplicates: {
13876
+ getStats: async (workspaceId, options) => rb.rawGet(
13877
+ `/clinical/goal-templates/duplicates?workspace_id=${encodeURIComponent(workspaceId)}`,
13878
+ options
13879
+ ),
13880
+ listGroups: async (workspaceId, opts, options) => {
13881
+ const qs = new URLSearchParams({ workspace_id: workspaceId });
13882
+ if (opts?.threshold !== void 0)
13883
+ qs.set("threshold", String(opts.threshold));
13884
+ if (opts?.limit !== void 0) qs.set("limit", String(opts.limit));
13885
+ return rb.rawGet(
13886
+ `/clinical/goal-templates/duplicates/groups?${qs.toString()}`,
13887
+ options
13888
+ );
13889
+ },
13890
+ resolve: async (workspaceId, groupId, keepId, options) => rb.rawPost(
13891
+ `/clinical/goal-templates/duplicates/resolve`,
13892
+ { workspace_id: workspaceId, group_id: groupId, keep_id: keepId },
13893
+ options
13894
+ )
13895
+ },
13896
+ /**
13897
+ * Search goal templates using semantic similarity.
13898
+ *
13899
+ * @param workspaceId - The workspace to search in
13900
+ * @param params - Search parameters
13901
+ * @param params.query - Free-text search query
13902
+ * @param params.limit - Maximum results to return (default: 10)
13903
+ * @returns Array of matching goal templates with similarity scores
13904
+ *
13905
+ * @example
13906
+ * ```typescript
13907
+ * const results = await client.clinical.goalTemplates.search(workspaceId, {
13908
+ * query: "improve sleep quality and duration",
13909
+ * limit: 5,
13910
+ * });
13911
+ * ```
13912
+ */
13913
+ search: async (workspaceId, params, options) => rb.rawPost(
13914
+ `/clinical/goal-templates/search`,
13915
+ { ...params, workspace_id: workspaceId },
13916
+ options
13917
+ ).then((r) => r.data)
12580
13918
  },
12581
13919
  /**
12582
13920
  * Recipe search via configured Edamam connector.
@@ -16755,131 +18093,353 @@ function createConnectorsNamespace(rb) {
16755
18093
  */
16756
18094
  fullscript: {
16757
18095
  /**
16758
- * Check whether a patient record exists in Fullscript by email address.
16759
- *
16760
- * Returns the patient object if found in the Fullscript account linked
16761
- * to the connector, or `null` if no patient with that email exists.
18096
+ * Check whether a patient record exists in Fullscript by email address.
18097
+ *
18098
+ * Returns the patient object if found in the Fullscript account linked
18099
+ * to the connector, or `null` if no patient with that email exists.
18100
+ *
18101
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18102
+ * @param workspaceId - UUID of the current workspace.
18103
+ * @param email - The patient's email address to look up.
18104
+ * @param options - Optional request options.
18105
+ * @returns A `FullscriptPatient` if found, or `null` if not found.
18106
+ *
18107
+ * @example
18108
+ * ```typescript
18109
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18110
+ * const patient = await client.connectors.fullscript.checkPatient(
18111
+ * 'ci_fs_123',
18112
+ * 'ws_abc123',
18113
+ * 'jane@example.com',
18114
+ * );
18115
+ * if (patient) {
18116
+ * console.log('Found:', patient.fullscript_id);
18117
+ * } else {
18118
+ * console.log('Patient not in Fullscript yet');
18119
+ * }
18120
+ * ```
18121
+ */
18122
+ checkPatient: async (connectorId, workspaceId, email, options) => rb.execute(
18123
+ postConnectorsFullscriptCheckPatient,
18124
+ {
18125
+ body: {
18126
+ data: {
18127
+ type: "connector_instance",
18128
+ connector_id: connectorId,
18129
+ workspace_id: workspaceId,
18130
+ email
18131
+ }
18132
+ }
18133
+ },
18134
+ options
18135
+ ),
18136
+ /**
18137
+ * Create a new patient record in Fullscript.
18138
+ *
18139
+ * Creates the patient in the Fullscript account linked to the connector
18140
+ * and returns the resulting patient object including the assigned
18141
+ * `fullscript_id`. Use this when a patient does not yet have a Fullscript
18142
+ * account (confirmed via `checkPatient`).
18143
+ *
18144
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18145
+ * @param workspaceId - UUID of the current workspace.
18146
+ * @param attrs - Patient attributes: `first_name`, `last_name`, `email`
18147
+ * (all required), and optional `date_of_birth` (ISO 8601 date string).
18148
+ * @param options - Optional request options.
18149
+ * @returns The newly created `FullscriptPatient`.
18150
+ *
18151
+ * @example
18152
+ * ```typescript
18153
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18154
+ * const patient = await client.connectors.fullscript.createPatient(
18155
+ * 'ci_fs_123',
18156
+ * 'ws_abc123',
18157
+ * {
18158
+ * first_name: 'Jane',
18159
+ * last_name: 'Smith',
18160
+ * email: 'jane@example.com',
18161
+ * date_of_birth: '1985-04-12',
18162
+ * },
18163
+ * );
18164
+ * console.log('Created Fullscript patient:', patient.fullscript_id);
18165
+ * ```
18166
+ */
18167
+ createPatient: async (connectorId, workspaceId, attrs, options) => rb.execute(
18168
+ postConnectorsFullscriptCreatePatient,
18169
+ {
18170
+ body: {
18171
+ data: {
18172
+ type: "connector_instance",
18173
+ connector_id: connectorId,
18174
+ workspace_id: workspaceId,
18175
+ ...attrs
18176
+ }
18177
+ }
18178
+ },
18179
+ options
18180
+ ),
18181
+ /**
18182
+ * Obtain a short-lived embed session grant for the Fullscript prescribing widget.
18183
+ *
18184
+ * The returned `token` is used to embed the Fullscript prescribing UI for a
18185
+ * specific patient within your application. Tokens are valid for 5–15 minutes
18186
+ * and are cached server-side for up to 2 minutes to avoid token proliferation
18187
+ * on repeated calls.
18188
+ *
18189
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18190
+ * @param workspaceId - UUID of the current workspace.
18191
+ * @param patientId - The Fullscript patient ID (from `FullscriptPatient.fullscript_id`).
18192
+ * @param options - Optional request options.
18193
+ * @returns A `FullscriptSessionGrant` with `token`, `expires_at`, and `patient_id`.
18194
+ *
18195
+ * @example
18196
+ * ```typescript
18197
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18198
+ * const grant = await client.connectors.fullscript.sessionGrant(
18199
+ * 'ci_fs_123',
18200
+ * 'ws_abc123',
18201
+ * 'fs_patient_456',
18202
+ * );
18203
+ * // Embed: `https://app.fullscript.com/embed?token=${grant.token}`
18204
+ * console.log('Token expires:', grant.expires_at);
18205
+ * ```
18206
+ */
18207
+ sessionGrant: async (connectorId, workspaceId, patientId, options) => rb.execute(
18208
+ postConnectorsFullscriptSessionGrant,
18209
+ {
18210
+ body: {
18211
+ data: {
18212
+ type: "connector_instance",
18213
+ connector_id: connectorId,
18214
+ workspace_id: workspaceId,
18215
+ patient_id: patientId
18216
+ }
18217
+ }
18218
+ },
18219
+ options
18220
+ ),
18221
+ // ── Treatment Plans ──
18222
+ /**
18223
+ * List treatment plans for a patient.
18224
+ * @param connectorId - The Fullscript connector instance ID
18225
+ * @param workspaceId - The workspace ID
18226
+ * @param patientId - The Fullscript patient ID
18227
+ * @returns Array of treatment plans
18228
+ */
18229
+ listTreatmentPlans: async (connectorId, workspaceId, patientId, options) => rb.rawPost(
18230
+ `/connectors/fullscript/treatment-plans/list`,
18231
+ {
18232
+ workspace_id: workspaceId,
18233
+ connector_id: connectorId,
18234
+ patient_id: patientId
18235
+ },
18236
+ options
18237
+ ).then((r) => r.data),
18238
+ /**
18239
+ * Get treatment plan details including recommendations.
18240
+ *
18241
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18242
+ * @param workspaceId - UUID of the current workspace.
18243
+ * @param treatmentPlanId - The Fullscript treatment plan ID.
18244
+ * @param options - Optional request options.
18245
+ * @returns The `FullscriptTreatmentPlan` with recommendation details.
18246
+ *
18247
+ * @example
18248
+ * ```typescript
18249
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18250
+ * const plan = await client.connectors.fullscript.getTreatmentPlan(
18251
+ * 'ci_fs_123',
18252
+ * 'ws_abc123',
18253
+ * 'tp_456',
18254
+ * );
18255
+ * console.log(plan.state, plan.recommendations);
18256
+ * ```
18257
+ */
18258
+ getTreatmentPlan: async (connectorId, workspaceId, treatmentPlanId, options) => rb.rawPost(
18259
+ `/connectors/fullscript/treatment-plans/get`,
18260
+ {
18261
+ workspace_id: workspaceId,
18262
+ connector_id: connectorId,
18263
+ treatment_plan_id: treatmentPlanId
18264
+ },
18265
+ options
18266
+ ).then((r) => r.data),
18267
+ /**
18268
+ * Cancel an active treatment plan.
18269
+ *
18270
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18271
+ * @param workspaceId - UUID of the current workspace.
18272
+ * @param treatmentPlanId - The Fullscript treatment plan ID to cancel.
18273
+ * @param options - Optional request options.
18274
+ * @returns The cancelled `FullscriptTreatmentPlan` with updated state.
18275
+ *
18276
+ * @example
18277
+ * ```typescript
18278
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18279
+ * const cancelled = await client.connectors.fullscript.cancelTreatmentPlan(
18280
+ * 'ci_fs_123',
18281
+ * 'ws_abc123',
18282
+ * 'tp_456',
18283
+ * );
18284
+ * console.log(cancelled.state); // "cancelled"
18285
+ * ```
18286
+ */
18287
+ cancelTreatmentPlan: async (connectorId, workspaceId, treatmentPlanId, options) => rb.rawPost(
18288
+ `/connectors/fullscript/treatment-plans/cancel`,
18289
+ {
18290
+ workspace_id: workspaceId,
18291
+ connector_id: connectorId,
18292
+ treatment_plan_id: treatmentPlanId
18293
+ },
18294
+ options
18295
+ ).then((r) => r.data),
18296
+ // ── Products ──
18297
+ /**
18298
+ * Search the Fullscript product catalog by keyword query.
18299
+ *
18300
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18301
+ * @param workspaceId - UUID of the current workspace.
18302
+ * @param query - Search keyword (e.g., `"vitamin D"`, `"omega 3"`).
18303
+ * @param options - Optional request options.
18304
+ * @returns An array of matching `FullscriptProduct` records.
18305
+ *
18306
+ * @example
18307
+ * ```typescript
18308
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18309
+ * const products = await client.connectors.fullscript.searchProducts(
18310
+ * 'ci_fs_123',
18311
+ * 'ws_abc123',
18312
+ * 'vitamin D',
18313
+ * );
18314
+ * products.forEach(p => console.log(p.name, p.brand));
18315
+ * ```
18316
+ */
18317
+ searchProducts: async (connectorId, workspaceId, query, options) => rb.rawPost(
18318
+ `/connectors/fullscript/products/search`,
18319
+ {
18320
+ workspace_id: workspaceId,
18321
+ connector_id: connectorId,
18322
+ query
18323
+ },
18324
+ options
18325
+ ).then((r) => r.data),
18326
+ /**
18327
+ * Get full product details from the Fullscript catalog by product ID.
16762
18328
  *
16763
18329
  * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
16764
18330
  * @param workspaceId - UUID of the current workspace.
16765
- * @param email - The patient's email address to look up.
18331
+ * @param productId - The Fullscript product ID.
16766
18332
  * @param options - Optional request options.
16767
- * @returns A `FullscriptPatient` if found, or `null` if not found.
18333
+ * @returns The `FullscriptProduct` with full details.
16768
18334
  *
16769
18335
  * @example
16770
18336
  * ```typescript
16771
18337
  * const client = new GptClient({ apiKey: 'sk_app_...' });
16772
- * const patient = await client.connectors.fullscript.checkPatient(
18338
+ * const product = await client.connectors.fullscript.getProduct(
16773
18339
  * 'ci_fs_123',
16774
18340
  * 'ws_abc123',
16775
- * 'jane@example.com',
18341
+ * 'prod_789',
16776
18342
  * );
16777
- * if (patient) {
16778
- * console.log('Found:', patient.fullscript_id);
16779
- * } else {
16780
- * console.log('Patient not in Fullscript yet');
16781
- * }
18343
+ * console.log(product.name, product.brand);
16782
18344
  * ```
16783
18345
  */
16784
- checkPatient: async (connectorId, workspaceId, email, options) => rb.execute(
16785
- postConnectorsFullscriptCheckPatient,
18346
+ getProduct: async (connectorId, workspaceId, productId, options) => rb.rawPost(
18347
+ `/connectors/fullscript/products/get`,
16786
18348
  {
16787
- body: {
16788
- data: {
16789
- type: "connector_instance",
16790
- connector_id: connectorId,
16791
- workspace_id: workspaceId,
16792
- email
16793
- }
16794
- }
18349
+ workspace_id: workspaceId,
18350
+ connector_id: connectorId,
18351
+ product_id: productId
16795
18352
  },
16796
18353
  options
16797
- ),
18354
+ ).then((r) => r.data),
16798
18355
  /**
16799
- * Create a new patient record in Fullscript.
16800
- *
16801
- * Creates the patient in the Fullscript account linked to the connector
16802
- * and returns the resulting patient object including the assigned
16803
- * `fullscript_id`. Use this when a patient does not yet have a Fullscript
16804
- * account (confirmed via `checkPatient`).
18356
+ * List similar products curated by Fullscript's health professionals.
16805
18357
  *
16806
18358
  * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
16807
18359
  * @param workspaceId - UUID of the current workspace.
16808
- * @param attrs - Patient attributes: `first_name`, `last_name`, `email`
16809
- * (all required), and optional `date_of_birth` (ISO 8601 date string).
18360
+ * @param productId - The Fullscript product ID to find similar products for.
16810
18361
  * @param options - Optional request options.
16811
- * @returns The newly created `FullscriptPatient`.
18362
+ * @returns An array of similar `FullscriptProduct` records.
16812
18363
  *
16813
18364
  * @example
16814
18365
  * ```typescript
16815
18366
  * const client = new GptClient({ apiKey: 'sk_app_...' });
16816
- * const patient = await client.connectors.fullscript.createPatient(
18367
+ * const similar = await client.connectors.fullscript.listSimilarProducts(
16817
18368
  * 'ci_fs_123',
16818
18369
  * 'ws_abc123',
16819
- * {
16820
- * first_name: 'Jane',
16821
- * last_name: 'Smith',
16822
- * email: 'jane@example.com',
16823
- * date_of_birth: '1985-04-12',
16824
- * },
18370
+ * 'prod_789',
16825
18371
  * );
16826
- * console.log('Created Fullscript patient:', patient.fullscript_id);
18372
+ * similar.forEach(p => console.log(p.name));
16827
18373
  * ```
16828
18374
  */
16829
- createPatient: async (connectorId, workspaceId, attrs, options) => rb.execute(
16830
- postConnectorsFullscriptCreatePatient,
18375
+ listSimilarProducts: async (connectorId, workspaceId, productId, options) => rb.rawPost(
18376
+ `/connectors/fullscript/products/similar`,
16831
18377
  {
16832
- body: {
16833
- data: {
16834
- type: "connector_instance",
16835
- connector_id: connectorId,
16836
- workspace_id: workspaceId,
16837
- ...attrs
16838
- }
16839
- }
18378
+ workspace_id: workspaceId,
18379
+ connector_id: connectorId,
18380
+ product_id: productId
16840
18381
  },
16841
18382
  options
16842
- ),
18383
+ ).then((r) => r.data),
18384
+ // ── Orders ──
16843
18385
  /**
16844
- * Obtain a short-lived embed session grant for the Fullscript prescribing widget.
16845
- *
16846
- * The returned `token` is used to embed the Fullscript prescribing UI for a
16847
- * specific patient within your application. Tokens are valid for 5–15 minutes
16848
- * and are cached server-side for up to 2 minutes to avoid token proliferation
16849
- * on repeated calls.
18386
+ * List all orders for a patient in Fullscript.
16850
18387
  *
16851
18388
  * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
16852
18389
  * @param workspaceId - UUID of the current workspace.
16853
- * @param patientId - The Fullscript patient ID (from `FullscriptPatient.fullscript_id`).
18390
+ * @param patientId - The Fullscript patient ID.
16854
18391
  * @param options - Optional request options.
16855
- * @returns A `FullscriptSessionGrant` with `token`, `expires_at`, and `patient_id`.
18392
+ * @returns An array of `FullscriptOrder` records for the patient.
16856
18393
  *
16857
18394
  * @example
16858
18395
  * ```typescript
16859
18396
  * const client = new GptClient({ apiKey: 'sk_app_...' });
16860
- * const grant = await client.connectors.fullscript.sessionGrant(
18397
+ * const orders = await client.connectors.fullscript.listPatientOrders(
16861
18398
  * 'ci_fs_123',
16862
18399
  * 'ws_abc123',
16863
18400
  * 'fs_patient_456',
16864
18401
  * );
16865
- * // Embed: `https://app.fullscript.com/embed?token=${grant.token}`
16866
- * console.log('Token expires:', grant.expires_at);
18402
+ * orders.forEach(o => console.log(o.id, o.payment_total));
16867
18403
  * ```
16868
18404
  */
16869
- sessionGrant: async (connectorId, workspaceId, patientId, options) => rb.execute(
16870
- postConnectorsFullscriptSessionGrant,
18405
+ listPatientOrders: async (connectorId, workspaceId, patientId, options) => rb.rawPost(
18406
+ `/connectors/fullscript/orders/list`,
16871
18407
  {
16872
- body: {
16873
- data: {
16874
- type: "connector_instance",
16875
- connector_id: connectorId,
16876
- workspace_id: workspaceId,
16877
- patient_id: patientId
16878
- }
16879
- }
18408
+ workspace_id: workspaceId,
18409
+ connector_id: connectorId,
18410
+ patient_id: patientId
16880
18411
  },
16881
18412
  options
16882
- ),
18413
+ ).then((r) => r.data),
18414
+ /**
18415
+ * Get order details from Fullscript by order ID.
18416
+ *
18417
+ * @param connectorId - UUID of the Fullscript `ConnectorInstance`.
18418
+ * @param workspaceId - UUID of the current workspace.
18419
+ * @param orderId - The Fullscript order ID.
18420
+ * @param options - Optional request options.
18421
+ * @returns The `FullscriptOrder` with line items and totals.
18422
+ *
18423
+ * @example
18424
+ * ```typescript
18425
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
18426
+ * const order = await client.connectors.fullscript.getOrder(
18427
+ * 'ci_fs_123',
18428
+ * 'ws_abc123',
18429
+ * 'ord_789',
18430
+ * );
18431
+ * console.log(order.payment_total, order.line_items);
18432
+ * ```
18433
+ */
18434
+ getOrder: async (connectorId, workspaceId, orderId, options) => rb.rawPost(
18435
+ `/connectors/fullscript/orders/get`,
18436
+ {
18437
+ workspace_id: workspaceId,
18438
+ connector_id: connectorId,
18439
+ order_id: orderId
18440
+ },
18441
+ options
18442
+ ).then((r) => r.data),
16883
18443
  /**
16884
18444
  * Fullscript-specific OAuth helpers.
16885
18445
  *
@@ -22467,6 +24027,9 @@ var ConfirmEmailSchema = import_zod2.z.object({
22467
24027
  email: import_zod2.z.string().email(),
22468
24028
  confirmation_token: import_zod2.z.string().min(1)
22469
24029
  });
24030
+ var RefreshTokenSchema = import_zod2.z.object({
24031
+ refresh_token: import_zod2.z.string().min(1)
24032
+ });
22470
24033
  var ResetPasswordWithTokenSchema = import_zod2.z.object({
22471
24034
  token: import_zod2.z.string().min(1),
22472
24035
  password: import_zod2.z.string().min(8),
@@ -22510,6 +24073,30 @@ function createIdentityNamespace(rb, baseUrl) {
22510
24073
  options
22511
24074
  );
22512
24075
  },
24076
+ /**
24077
+ * Exchange a refresh token for a new JWT + refresh token pair.
24078
+ *
24079
+ * The old refresh token is revoked on success (token rotation).
24080
+ * Use the new refresh token for subsequent refresh calls.
24081
+ *
24082
+ * @param refreshToken - The refresh token (srt_ prefix) from login or a previous refresh
24083
+ * @returns New token pair with rotated refresh token
24084
+ *
24085
+ * @example
24086
+ * ```typescript
24087
+ * const { token, refresh_token } = await client.identity.refresh(storedRefreshToken);
24088
+ * // Store the new refresh_token for next refresh
24089
+ * // Use token as the new Bearer token
24090
+ * ```
24091
+ */
24092
+ refresh: async (refreshToken, options) => {
24093
+ RefreshTokenSchema.parse({ refresh_token: refreshToken });
24094
+ return rb.rawPost(
24095
+ "/users/auth/refresh",
24096
+ { refresh_token: refreshToken },
24097
+ options
24098
+ );
24099
+ },
22513
24100
  /**
22514
24101
  * Register a new user account — returns the newly created user.
22515
24102
  * The session token is available as `result.token` (flattened from `data.attributes.token`).
@@ -24152,19 +25739,41 @@ function createPlatformNamespace(rb) {
24152
25739
  *
24153
25740
  * @example
24154
25741
  * ```typescript
24155
- * const client = new GptClient({ apiKey: 'sk_app_...' });
25742
+ * // Using workspace_id shorthand (recommended):
24156
25743
  * const invite = await client.platform.invitations.create({
24157
25744
  * email: 'new.clinician@hospital.org',
24158
25745
  * workspace_id: 'ws_abc123',
24159
25746
  * role: 'member',
24160
25747
  * });
24161
- * console.log('Invitation sent:', invite.id);
25748
+ *
25749
+ * // Using explicit scope_type + scope_id:
25750
+ * const invite2 = await client.platform.invitations.create({
25751
+ * email: 'admin@hospital.org',
25752
+ * scope_type: 'tenant',
25753
+ * scope_id: tenantId,
25754
+ * role: 'admin',
25755
+ * });
24162
25756
  * ```
24163
25757
  */
24164
25758
  create: async (attributes, options) => {
25759
+ const { workspace_id, tenant_id, ...rest } = attributes;
25760
+ let resolved = { ...rest };
25761
+ if (workspace_id && !resolved.scope_type) {
25762
+ resolved = {
25763
+ ...resolved,
25764
+ scope_type: "workspace",
25765
+ scope_id: workspace_id
25766
+ };
25767
+ } else if (tenant_id && !resolved.scope_type) {
25768
+ resolved = {
25769
+ ...resolved,
25770
+ scope_type: "tenant",
25771
+ scope_id: tenant_id
25772
+ };
25773
+ }
24165
25774
  return rb.execute(
24166
25775
  postInvitations,
24167
- { body: { data: { type: "invitation", attributes } } },
25776
+ { body: { data: { type: "invitation", attributes: resolved } } },
24168
25777
  options
24169
25778
  );
24170
25779
  },
@@ -26972,6 +28581,29 @@ function createThreadsNamespace(rb) {
26972
28581
  options
26973
28582
  );
26974
28583
  },
28584
+ /**
28585
+ * Lists only the calling user's threads within their current workspace.
28586
+ *
28587
+ * Unlike {@link list} which returns all threads in the workspace (for admin
28588
+ * visibility), `listMine` scopes results to threads owned by the
28589
+ * authenticated user. This is the recommended method for end-user UIs.
28590
+ *
28591
+ * @param options - Optional pagination and request options.
28592
+ * @returns A promise that resolves to an array of the user's `Thread` objects.
28593
+ *
28594
+ * @example
28595
+ * ```typescript
28596
+ * const myThreads = await client.threads.listMine();
28597
+ * myThreads.forEach(t => console.log(t.attributes.title));
28598
+ * ```
28599
+ */
28600
+ listMine: async (options) => {
28601
+ return rb.execute(
28602
+ getThreadsMine,
28603
+ buildPageQuery(options?.page, options?.pageSize),
28604
+ options
28605
+ );
28606
+ },
26975
28607
  /**
26976
28608
  * Fetches all threads in the workspace by transparently paginating through
26977
28609
  * every page until exhausted.
@@ -27023,7 +28655,7 @@ function createThreadsNamespace(rb) {
27023
28655
  create: async (attributes, options) => {
27024
28656
  return rb.execute(
27025
28657
  postThreads,
27026
- { body: { data: { type: "thread", attributes } } },
28658
+ { body: { data: { type: "chat-thread", attributes } } },
27027
28659
  options
27028
28660
  );
27029
28661
  },
@@ -27049,7 +28681,10 @@ function createThreadsNamespace(rb) {
27049
28681
  update: async (id, attributes, options) => {
27050
28682
  return rb.execute(
27051
28683
  patchThreadsById,
27052
- { path: { id }, body: { data: { id, type: "thread", attributes } } },
28684
+ {
28685
+ path: { id },
28686
+ body: { data: { id, type: "chat-thread", attributes } }
28687
+ },
27053
28688
  options
27054
28689
  );
27055
28690
  },
@@ -27209,7 +28844,7 @@ function createThreadsNamespace(rb) {
27209
28844
  * // Streaming
27210
28845
  * const stream = await client.threads.messages.stream('thr_01HXYZ...', { content: 'Hello!' });
27211
28846
  * for await (const chunk of stream) {
27212
- * process.stdout.write(chunk.delta ?? '');
28847
+ * if (chunk.type === 'token') process.stdout.write(chunk.content ?? '');
27213
28848
  * }
27214
28849
  */
27215
28850
  messages: {
@@ -27271,7 +28906,7 @@ function createThreadsNamespace(rb) {
27271
28906
  path: { id: threadId },
27272
28907
  body: {
27273
28908
  data: {
27274
- type: "thread",
28909
+ type: "chat-thread",
27275
28910
  content,
27276
28911
  ...rest,
27277
28912
  metadata: mergeWithBrowserContext(
@@ -27284,38 +28919,48 @@ function createThreadsNamespace(rb) {
27284
28919
  );
27285
28920
  },
27286
28921
  /**
27287
- * Sends a message to a thread and streams the AI response token-by-token
27288
- * via Server-Sent Events (SSE).
28922
+ * Sends a message to a thread and streams the AI response via Server-Sent Events (SSE).
28923
+ *
28924
+ * For agent-backed threads, the stream includes the full execution lifecycle:
28925
+ * - `token` — incremental LLM output tokens
28926
+ * - `tool_call` — agent is calling a tool (name + arguments)
28927
+ * - `tool_result` — tool execution completed (name + summary)
28928
+ * - `iteration_complete` — LLM loop iteration finished
28929
+ * - `approval_required` — human approval needed for a sensitive tool
28930
+ * - `done` — stream complete, includes metadata with execution_id
28931
+ * - `error` — stream error
27289
28932
  *
27290
- * Returns an `AsyncIterableIterator` that yields `StreamMessageChunk`
27291
- * objects as tokens are generated. Consume with a `for await` loop. The
27292
- * stream closes automatically when the assistant finishes generating its
27293
- * response.
28933
+ * For RAG threads (no agent), only `token`, `done`, and `error` are emitted.
27294
28934
  *
27295
28935
  * SSE security limits: 5-minute idle timeout, 10,000 chunk maximum,
27296
28936
  * 10 MB buffer size limit.
27297
28937
  *
27298
28938
  * @param threadId - The UUID of the thread to stream a message to.
27299
28939
  * @param body - The message payload, including at minimum `content` (string).
27300
- * Additional fields such as `role` or `metadata` are passed through.
27301
28940
  * @param options - Optional request options (e.g. custom headers, abort signal).
27302
28941
  * @param streamOptions - Optional streaming configuration (e.g. chunk timeout).
27303
28942
  * @returns A promise that resolves to an `AsyncIterableIterator<StreamMessageChunk>`.
27304
- * Each yielded chunk contains a `delta` string (the new token text) and
27305
- * optional event metadata.
27306
28943
  *
27307
28944
  * @example
27308
- * const client = new GptClient({ apiKey: 'sk_app_...' });
27309
- *
27310
- * const stream = await client.threads.messages.stream(
27311
- * 'thr_01HXYZ...',
27312
- * { content: 'Summarize the key clauses in this contract.' },
27313
- * );
27314
- *
27315
- * for await (const chunk of stream) {
27316
- * process.stdout.write(chunk.delta ?? '');
28945
+ * ```typescript
28946
+ * const stream = await client.threads.messages.stream(threadId, { content: 'Summarize the contract.' });
28947
+ * for await (const event of stream) {
28948
+ * switch (event.type) {
28949
+ * case 'token':
28950
+ * process.stdout.write(event.content ?? '');
28951
+ * break;
28952
+ * case 'tool_call':
28953
+ * console.log(`Tool: ${event.data.name}`, event.data.arguments);
28954
+ * break;
28955
+ * case 'tool_result':
28956
+ * console.log(`Result: ${event.data.summary}`);
28957
+ * break;
28958
+ * case 'done':
28959
+ * console.log('Complete', event.metadata);
28960
+ * break;
28961
+ * }
27317
28962
  * }
27318
- * console.log(); // newline after streaming completes
28963
+ * ```
27319
28964
  */
27320
28965
  stream: async (threadId, body, options, streamOptions) => {
27321
28966
  const { content, metadata, ...rest } = body;
@@ -27323,7 +28968,7 @@ function createThreadsNamespace(rb) {
27323
28968
  `/threads/${threadId}/messages/stream`,
27324
28969
  {
27325
28970
  data: {
27326
- type: "message",
28971
+ type: "chat-message",
27327
28972
  content,
27328
28973
  ...rest,
27329
28974
  metadata: mergeWithBrowserContext(
@@ -27406,7 +29051,7 @@ function createThreadsNamespace(rb) {
27406
29051
  postThreadsByIdComplete,
27407
29052
  {
27408
29053
  path: { id: threadId },
27409
- body: { data: { type: "thread" } }
29054
+ body: { data: { type: "chat-thread" } }
27410
29055
  },
27411
29056
  options
27412
29057
  );
@@ -27414,13 +29059,12 @@ function createThreadsNamespace(rb) {
27414
29059
  /**
27415
29060
  * Trigger AI inference on a thread and receive the response via Server-Sent Events.
27416
29061
  *
27417
- * Identical to {@link complete} in behavior but delivers the result as an SSE
27418
- * stream. The stream yields a single `StreamMessageChunk` with `done: true`
27419
- * when the AI response is ready.
29062
+ * For agent-backed threads (when execution bridge is enabled), this streams
29063
+ * the full execution lifecycle including `token`, `tool_call`, `tool_result`,
29064
+ * `iteration_complete`, `approval_required`, `done`, and `error` events.
27420
29065
  *
27421
- * Note: This endpoint delivers the full response as one event (not token-by-token).
27422
- * It gives the frontend a consistent SSE interface for uniform handling of both
27423
- * streaming and non-streaming completions.
29066
+ * For RAG threads or when the bridge is disabled, delivers the full response
29067
+ * as a single `done` event.
27424
29068
  *
27425
29069
  * @param threadId - The UUID of the thread to run AI completion on.
27426
29070
  * @param options - Optional request options (e.g. abort signal).
@@ -27429,11 +29073,19 @@ function createThreadsNamespace(rb) {
27429
29073
  *
27430
29074
  * @example
27431
29075
  * ```typescript
27432
- * const client = new GptClient({ apiKey: 'sk_app_...' });
27433
- *
27434
29076
  * const stream = await client.threads.completeStream('thr_01HXYZ...');
27435
- * for await (const chunk of stream) {
27436
- * if (chunk.type === 'done') console.log(`AI response: ${chunk.content}`);
29077
+ * for await (const event of stream) {
29078
+ * switch (event.type) {
29079
+ * case 'token':
29080
+ * process.stdout.write(event.content ?? '');
29081
+ * break;
29082
+ * case 'tool_call':
29083
+ * console.log(`Tool: ${event.data.name}`);
29084
+ * break;
29085
+ * case 'done':
29086
+ * console.log('Complete', event.metadata);
29087
+ * break;
29088
+ * }
27437
29089
  * }
27438
29090
  * ```
27439
29091
  */
@@ -29681,7 +31333,6 @@ function createSocialNamespace(rb) {
29681
31333
  path: { id },
29682
31334
  body: {
29683
31335
  data: {
29684
- type: "social_campaign",
29685
31336
  campaign_id: id,
29686
31337
  workspace_id: workspaceId
29687
31338
  }
@@ -29698,7 +31349,6 @@ function createSocialNamespace(rb) {
29698
31349
  path: { id },
29699
31350
  body: {
29700
31351
  data: {
29701
- type: "social_campaign",
29702
31352
  campaign_id: id,
29703
31353
  workspace_id: workspaceId,
29704
31354
  social_account_id: socialAccountId
@@ -29775,6 +31425,26 @@ function createSocialNamespace(rb) {
29775
31425
  options
29776
31426
  );
29777
31427
  },
31428
+ /**
31429
+ * List trending snapshots within a date range.
31430
+ * @param from - Start date (ISO 8601 string)
31431
+ * @param to - End date (ISO 8601 string)
31432
+ * @returns Array of TrendingSnapshot records in the range
31433
+ * @example
31434
+ * ```typescript
31435
+ * const snapshots = await client.social.trending.listByDateRange(
31436
+ * '2026-03-01T00:00:00Z',
31437
+ * '2026-03-21T23:59:59Z',
31438
+ * );
31439
+ * ```
31440
+ */
31441
+ listByDateRange: async (from, to, options) => {
31442
+ return rb.execute(
31443
+ getSocialTrendingHistoryRange,
31444
+ { query: { from, to } },
31445
+ options
31446
+ );
31447
+ },
29778
31448
  /** Trending snapshot items — individual content pieces within a snapshot. */
29779
31449
  items: {
29780
31450
  /** Get a single trending item by ID. */
@@ -29883,22 +31553,6 @@ function createSocialNamespace(rb) {
29883
31553
  { path: { id } },
29884
31554
  options
29885
31555
  );
29886
- },
29887
- /**
29888
- * Mark a watch as triggered (updates last_triggered_at).
29889
- * @param id - Watch UUID
29890
- */
29891
- markTriggered: async (id, options) => {
29892
- return rb.execute(
29893
- patchSocialTrendingWatchesByIdMarkTriggered,
29894
- {
29895
- path: { id },
29896
- body: {
29897
- data: { type: "trending-watch", id, attributes: {} }
29898
- }
29899
- },
29900
- options
29901
- );
29902
31556
  }
29903
31557
  }
29904
31558
  };
@@ -30328,6 +31982,235 @@ function createPermissionsNamespace(rb) {
30328
31982
  };
30329
31983
  }
30330
31984
 
31985
+ // src/namespaces/channels.ts
31986
+ function mapResponse(raw) {
31987
+ return {
31988
+ channelToken: raw.channel_token,
31989
+ expiresAt: raw.expires_at,
31990
+ channels: raw.channels,
31991
+ workspaceId: raw.workspace_id
31992
+ };
31993
+ }
31994
+ function createChannelsNamespace(rb) {
31995
+ return {
31996
+ /**
31997
+ * Exchange the current bearer token for a scoped channel token.
31998
+ *
31999
+ * The returned token is short-lived (5 minutes) and restricted to the
32000
+ * specified workspace and channel patterns. It cannot be used for REST
32001
+ * API calls.
32002
+ *
32003
+ * @param request - Workspace and channel scope
32004
+ * @param options - Request options (signal, etc.)
32005
+ * @returns Channel token response with token string and expiry
32006
+ *
32007
+ * @example
32008
+ * ```typescript
32009
+ * const { channelToken, expiresAt } = await client.channels.authorize({
32010
+ * workspaceId: "ws-uuid",
32011
+ * channels: ["crm", "scheduling", "clinical"],
32012
+ * });
32013
+ * ```
32014
+ */
32015
+ async authorize(request, options) {
32016
+ const raw = await rb.rawPost(
32017
+ "/channels/token",
32018
+ {
32019
+ workspace_id: request.workspaceId,
32020
+ channels: request.channels
32021
+ },
32022
+ options
32023
+ );
32024
+ return mapResponse(raw);
32025
+ },
32026
+ /**
32027
+ * Create a token manager that automatically refreshes the channel token
32028
+ * before it expires. Use with Phoenix.js Socket:
32029
+ *
32030
+ * ```typescript
32031
+ * const manager = await client.channels.createTokenManager({
32032
+ * workspaceId: "ws-uuid",
32033
+ * channels: ["chat_thread"],
32034
+ * });
32035
+ *
32036
+ * const socket = new Socket(socketUrl, {
32037
+ * params: () => ({ token: manager.getToken() }),
32038
+ * });
32039
+ * socket.connect();
32040
+ *
32041
+ * // On cleanup:
32042
+ * manager.destroy();
32043
+ * socket.disconnect();
32044
+ * ```
32045
+ *
32046
+ * @param options - Workspace, channels, and optional refresh buffer
32047
+ * @returns A SocketManager with getToken(), refresh(), and destroy()
32048
+ */
32049
+ async createTokenManager(options) {
32050
+ const refreshBuffer = options.refreshBufferMs ?? 6e4;
32051
+ let currentToken = "";
32052
+ let refreshTimer = null;
32053
+ let destroyed = false;
32054
+ const fetchToken = async () => {
32055
+ const raw = await rb.rawPost(
32056
+ "/channels/token",
32057
+ {
32058
+ workspace_id: options.workspaceId,
32059
+ channels: options.channels
32060
+ }
32061
+ );
32062
+ currentToken = raw.channel_token;
32063
+ if (!destroyed) {
32064
+ const expiresAt = new Date(raw.expires_at).getTime();
32065
+ const now = Date.now();
32066
+ const delay = Math.max(expiresAt - now - refreshBuffer, 1e3);
32067
+ if (refreshTimer) clearTimeout(refreshTimer);
32068
+ refreshTimer = setTimeout(() => {
32069
+ fetchToken().catch((err) => {
32070
+ console.warn("[gpt-platform] Channel token refresh failed:", err);
32071
+ if (options.onAuthError) {
32072
+ options.onAuthError(
32073
+ err instanceof Error ? err : new Error(String(err))
32074
+ );
32075
+ }
32076
+ });
32077
+ }, delay);
32078
+ }
32079
+ return currentToken;
32080
+ };
32081
+ await fetchToken();
32082
+ return {
32083
+ getToken: () => currentToken,
32084
+ refresh: fetchToken,
32085
+ destroy: () => {
32086
+ destroyed = true;
32087
+ if (refreshTimer) {
32088
+ clearTimeout(refreshTimer);
32089
+ refreshTimer = null;
32090
+ }
32091
+ }
32092
+ };
32093
+ }
32094
+ };
32095
+ }
32096
+
32097
+ // src/namespaces/imports.ts
32098
+ function createImportsNamespace(rb) {
32099
+ return {
32100
+ /**
32101
+ * List available import adapter types for the current application.
32102
+ * @returns Array of adapter metadata objects
32103
+ * @example
32104
+ * const adapters = await sdk.imports.listAdapters();
32105
+ * // [{ key: "clinical:goal", display_name: "Clinical Goals", ... }]
32106
+ */
32107
+ listAdapters: async (options) => rb.rawGet(`/imports/adapters`, options).then((r) => r.data),
32108
+ /**
32109
+ * Submit a JSON batch import.
32110
+ * @param params - adapter key, workspace_id, and rows array
32111
+ * @returns Import job with id and initial status
32112
+ * @example
32113
+ * const result = await sdk.imports.batch({
32114
+ * adapter: "clinical:goal",
32115
+ * workspace_id: "ws_123",
32116
+ * rows: [{ contact_id: "...", title: "Increase water intake", goal_type: "hydration" }]
32117
+ * });
32118
+ */
32119
+ batch: async (params, options) => rb.rawPost(
32120
+ `/imports/batch`,
32121
+ {
32122
+ adapter_key: params.adapter,
32123
+ workspace_id: params.workspace_id,
32124
+ rows: params.rows,
32125
+ metadata: params.metadata
32126
+ },
32127
+ options
32128
+ ),
32129
+ /**
32130
+ * Upload a CSV file for import.
32131
+ * @param file - CSV file (File or Blob)
32132
+ * @param params - adapter key and workspace_id
32133
+ * @returns Import job with id and initial status
32134
+ * @example
32135
+ * const result = await sdk.imports.upload(csvFile, {
32136
+ * adapter: "clinical:patient_bundle",
32137
+ * workspace_id: "ws_123"
32138
+ * });
32139
+ */
32140
+ upload: async (file, params, options) => {
32141
+ const formData = new FormData();
32142
+ formData.append("file", file);
32143
+ formData.append("adapter_key", params.adapter);
32144
+ formData.append("workspace_id", params.workspace_id);
32145
+ if (params.column_mapping)
32146
+ formData.append(
32147
+ "column_mapping",
32148
+ JSON.stringify(params.column_mapping)
32149
+ );
32150
+ if (params.metadata)
32151
+ formData.append("metadata", JSON.stringify(params.metadata));
32152
+ return rb.rawPostMultipart(`/imports/upload`, formData, options);
32153
+ },
32154
+ /**
32155
+ * List imports for a workspace with optional filters.
32156
+ * @param params - workspace_id required, adapter and status optional
32157
+ * @returns Paginated list of imports
32158
+ * @example
32159
+ * const imports = await sdk.imports.list({ workspace_id: "ws_123", adapter: "crm:contact" });
32160
+ */
32161
+ list: async (params, options) => rb.rawGet(
32162
+ `/imports?workspace_id=${params.workspace_id}${params.adapter ? `&adapter_key=${params.adapter}` : ""}${params.status ? `&status=${params.status}` : ""}${params.offset !== void 0 ? `&offset=${params.offset}` : ""}${params.limit !== void 0 ? `&limit=${params.limit}` : ""}`,
32163
+ options
32164
+ ),
32165
+ /**
32166
+ * Get a single import by ID.
32167
+ * @param id - Import UUID
32168
+ * @returns Full import record including error_report
32169
+ * @example
32170
+ * const imp = await sdk.imports.get("uuid-here");
32171
+ */
32172
+ get: async (id, options) => rb.rawGet(`/imports/${id}`, options).then((r) => r.data),
32173
+ /**
32174
+ * Get per-row outcomes for a chunked import.
32175
+ * @param importId - Import UUID
32176
+ * @param params - Pagination options
32177
+ * @returns Paginated list of row outcomes
32178
+ * @example
32179
+ * const rows = await sdk.imports.rows("uuid-here", { offset: 0, limit: 50 });
32180
+ */
32181
+ rows: async (importId, params, options) => rb.rawGet(
32182
+ `/imports/${importId}/rows${params?.offset !== void 0 ? `?offset=${params.offset}` : ""}${params?.limit !== void 0 ? `${params?.offset !== void 0 ? "&" : "?"}limit=${params.limit}` : ""}`,
32183
+ options
32184
+ ),
32185
+ /**
32186
+ * Confirm a validated import for commit.
32187
+ * @param id - Import UUID
32188
+ * @param params - workspace_id for authorization
32189
+ * @returns Updated import with status "committing"
32190
+ * @example
32191
+ * await sdk.imports.confirm("uuid-here", { workspace_id: "ws_123" });
32192
+ */
32193
+ confirm: async (id, params, options) => rb.rawPost(
32194
+ `/imports/${id}/confirm`,
32195
+ params,
32196
+ options
32197
+ ),
32198
+ /**
32199
+ * Cancel a validated import.
32200
+ * @param id - Import UUID
32201
+ * @param params - workspace_id for authorization
32202
+ * @returns Updated import with status "cancelled"
32203
+ * @example
32204
+ * await sdk.imports.cancel("uuid-here", { workspace_id: "ws_123" });
32205
+ */
32206
+ cancel: async (id, params, options) => rb.rawPost(
32207
+ `/imports/${id}/cancel`,
32208
+ params,
32209
+ options
32210
+ )
32211
+ };
32212
+ }
32213
+
30331
32214
  // src/streaming.ts
30332
32215
  var DEFAULT_STREAM_TIMEOUT = 3e5;
30333
32216
  var DEFAULT_MAX_CHUNKS = 1e4;
@@ -30418,10 +32301,16 @@ async function* streamMessage(response, options = {}) {
30418
32301
  async function collectStreamedMessage(stream) {
30419
32302
  let fullMessage = "";
30420
32303
  for await (const chunk of stream) {
30421
- if (chunk.type === "content" && chunk.content) {
32304
+ if ((chunk.type === "token" || chunk.type === "content") && "content" in chunk && chunk.content) {
30422
32305
  fullMessage += chunk.content;
30423
32306
  } else if (chunk.type === "error") {
30424
- throw new ServerError(chunk.error || "Stream error");
32307
+ const errorMsg = "error" in chunk ? chunk.error : "content" in chunk ? chunk.content : "Stream error";
32308
+ throw new ServerError(errorMsg || "Stream error");
32309
+ } else if (chunk.type === "done") {
32310
+ if ("content" in chunk && chunk.content) {
32311
+ fullMessage = chunk.content;
32312
+ }
32313
+ break;
30425
32314
  }
30426
32315
  }
30427
32316
  return fullMessage;
@@ -30809,6 +32698,8 @@ var GptClient = class extends BaseClient {
30809
32698
  this.roles = createRolesNamespace(rb);
30810
32699
  this.permissions = createPermissionsNamespace(rb);
30811
32700
  this.memory = createMemoryNamespace(rb);
32701
+ this.channels = createChannelsNamespace(rb);
32702
+ this.imports = createImportsNamespace(rb);
30812
32703
  }
30813
32704
  /**
30814
32705
  * Subscribe to SDK lifecycle events.
@@ -31041,6 +32932,7 @@ var Webhooks = class _Webhooks {
31041
32932
  buildHeaders,
31042
32933
  buildUserAgent,
31043
32934
  collectStreamedMessage,
32935
+ createImportsNamespace,
31044
32936
  handleApiError,
31045
32937
  isBrowserEnvironment,
31046
32938
  isSecureUrl,