@gpt-platform/client 0.10.2 → 0.10.3

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
@@ -1339,7 +1339,7 @@ function buildUserAgent(sdkVersion, appInfo) {
1339
1339
  }
1340
1340
 
1341
1341
  // src/version.ts
1342
- var SDK_VERSION = "0.10.2";
1342
+ var SDK_VERSION = "0.10.3";
1343
1343
  var DEFAULT_API_VERSION = "2026-03-23";
1344
1344
 
1345
1345
  // src/base-client.ts
@@ -1971,6 +1971,11 @@ var getCatalogTaxonomyNodesTaxonomyByTaxonomyId = (options) => (options.client ?
1971
1971
  url: "/catalog/taxonomy-nodes/taxonomy/{taxonomy_id}",
1972
1972
  ...options
1973
1973
  });
1974
+ var getClinicalNotesByPatient = (options) => (options.client ?? client).get({
1975
+ security: [{ scheme: "bearer", type: "http" }],
1976
+ url: "/clinical/notes/by-patient",
1977
+ ...options
1978
+ });
1974
1979
  var getClinicalNotesByNoteIdVersionsById = (options) => (options.client ?? client).get({
1975
1980
  security: [{ scheme: "bearer", type: "http" }],
1976
1981
  url: "/clinical/notes/{note_id}/versions/{id}",
@@ -2177,6 +2182,11 @@ var postTenantsPersonal = (options) => (options.client ?? client).post({
2177
2182
  ...options.headers
2178
2183
  }
2179
2184
  });
2185
+ var getClinicalMealPlansByPatient = (options) => (options.client ?? client).get({
2186
+ security: [{ scheme: "bearer", type: "http" }],
2187
+ url: "/clinical/meal-plans/by-patient",
2188
+ ...options
2189
+ });
2180
2190
  var getEmailTrackingEventsById = (options) => (options.client ?? client).get({
2181
2191
  security: [{ scheme: "bearer", type: "http" }],
2182
2192
  url: "/email/tracking-events/{id}",
@@ -2978,6 +2988,11 @@ var patchSupportTicketsByIdMerge = (options) => (options.client ?? client).patch
2978
2988
  ...options.headers
2979
2989
  }
2980
2990
  });
2991
+ var getClinicalNotesByWorkspace = (options) => (options.client ?? client).get({
2992
+ security: [{ scheme: "bearer", type: "http" }],
2993
+ url: "/clinical/notes/by-workspace",
2994
+ ...options
2995
+ });
2981
2996
  var getMemorySectionDocumentsById = (options) => (options.client ?? client).get({
2982
2997
  security: [{ scheme: "bearer", type: "http" }],
2983
2998
  url: "/memory/section-documents/{id}",
@@ -12761,6 +12776,32 @@ function createClinicalNamespace(rb) {
12761
12776
  { query: params ?? {} },
12762
12777
  options
12763
12778
  ),
12779
+ /**
12780
+ * List all notes for a patient across all sessions.
12781
+ *
12782
+ * @param patientId - Patient UUID
12783
+ * @param params - Filter/pagination parameters
12784
+ * @param options - Request options
12785
+ * @returns Array of {@link ClinicalNote} records
12786
+ */
12787
+ listByPatient: async (patientId, params, options) => rb.execute(
12788
+ getClinicalNotesByPatient,
12789
+ { query: { patient_id: patientId, ...params } },
12790
+ options
12791
+ ),
12792
+ /**
12793
+ * List all notes in a workspace.
12794
+ *
12795
+ * @param workspaceId - Workspace UUID
12796
+ * @param params - Filter/pagination parameters
12797
+ * @param options - Request options
12798
+ * @returns Array of {@link ClinicalNote} records
12799
+ */
12800
+ listByWorkspace: async (workspaceId, params, options) => rb.execute(
12801
+ getClinicalNotesByWorkspace,
12802
+ { query: { workspace_id: workspaceId, ...params } },
12803
+ options
12804
+ ),
12764
12805
  /**
12765
12806
  * Get a single note by ID.
12766
12807
  *
@@ -13126,6 +13167,19 @@ function createClinicalNamespace(rb) {
13126
13167
  { query: params ?? {} },
13127
13168
  options
13128
13169
  ),
13170
+ /**
13171
+ * List all meal plans for a patient across all sessions.
13172
+ *
13173
+ * @param patientId - Patient UUID
13174
+ * @param params - Filter/pagination parameters
13175
+ * @param options - Request options
13176
+ * @returns Array of {@link ClinicalMealPlan} records
13177
+ */
13178
+ listByPatient: async (patientId, params, options) => rb.execute(
13179
+ getClinicalMealPlansByPatient,
13180
+ { query: { patient_id: patientId, ...params } },
13181
+ options
13182
+ ),
13129
13183
  /**
13130
13184
  * Get a single meal plan by ID.
13131
13185
  *
@@ -13142,6 +13196,8 @@ function createClinicalNamespace(rb) {
13142
13196
  * Create a new meal plan.
13143
13197
  *
13144
13198
  * @param attributes - Meal plan creation attributes. Must include `workspace_id`.
13199
+ * Provide `patient_id` directly, or `session_id` to auto-populate
13200
+ * `patient_id` from the session's patient.
13145
13201
  * @param options - Request options
13146
13202
  * @returns Created {@link ClinicalMealPlan} record
13147
13203
  */
@@ -13530,7 +13586,26 @@ function createClinicalNamespace(rb) {
13530
13586
  getClinicalClientSupplementsArchived,
13531
13587
  { query: params ?? {} },
13532
13588
  options
13533
- )
13589
+ ),
13590
+ /**
13591
+ * Create multiple supplements in a single request.
13592
+ *
13593
+ * @param attrs - Bulk creation attributes with workspace_id and supplements array
13594
+ * @param options - Request options
13595
+ * @returns Array of creation results with id and status per supplement
13596
+ *
13597
+ * @example
13598
+ * ```typescript
13599
+ * const results = await client.clinical.clientSupplements.bulkCreate({
13600
+ * workspace_id: 'ws_123',
13601
+ * supplements: [
13602
+ * { patient_id: 'pat_1', name: 'Vitamin D3', source: 'fullscript' },
13603
+ * { patient_id: 'pat_1', name: 'Omega-3', source: 'fullscript' },
13604
+ * ],
13605
+ * });
13606
+ * ```
13607
+ */
13608
+ bulkCreate: async (attrs, options) => rb.rawPost(`/clinical/client-supplements/bulk`, { data: attrs }, options).then((r) => r.data)
13534
13609
  },
13535
13610
  /**
13536
13611
  * Manage clinical deliveries (care plan items sent to patients).
@@ -14844,7 +14919,11 @@ function createClinicalNamespace(rb) {
14844
14919
  * });
14845
14920
  * ```
14846
14921
  */
14847
- search: async (params, options) => rb.rawPost(`/clinical/recipes/search`, params, options)
14922
+ search: async (params, options) => rb.rawPost(
14923
+ `/clinical/recipes/search`,
14924
+ params,
14925
+ options
14926
+ )
14848
14927
  }
14849
14928
  };
14850
14929
  }
@@ -18466,7 +18545,10 @@ function createConnectorsNamespace(rb) {
18466
18545
  */
18467
18546
  create: async (attributes, options) => rb.execute(
18468
18547
  postConnectors,
18469
- { body: { data: { type: "connector-instance", attributes } } },
18548
+ {
18549
+ body: { data: { type: "connector-instance", attributes } },
18550
+ query: { workspace_id: attributes.workspace_id }
18551
+ },
18470
18552
  options
18471
18553
  ),
18472
18554
  /**
@@ -18588,7 +18670,6 @@ function createConnectorsNamespace(rb) {
18588
18670
  path: { id },
18589
18671
  body: {
18590
18672
  data: {
18591
- type: "credential",
18592
18673
  workspace_id: workspaceId
18593
18674
  }
18594
18675
  }
@@ -18621,10 +18702,7 @@ function createConnectorsNamespace(rb) {
18621
18702
  postConnectorsCredentialsUpsert,
18622
18703
  {
18623
18704
  body: {
18624
- data: {
18625
- type: "credential",
18626
- ...attributes
18627
- }
18705
+ data: attributes
18628
18706
  }
18629
18707
  },
18630
18708
  options
@@ -18653,7 +18731,6 @@ function createConnectorsNamespace(rb) {
18653
18731
  {
18654
18732
  body: {
18655
18733
  data: {
18656
- type: "credential",
18657
18734
  workspace_id: workspaceId,
18658
18735
  connector_type: connectorType,
18659
18736
  scope_level: scopeLevel
@@ -19136,9 +19213,11 @@ function createConnectorsNamespace(rb) {
19136
19213
  listTreatmentPlans: async (connectorId, workspaceId, patientId, options) => rb.rawPost(
19137
19214
  `/connectors/fullscript/treatment-plans/list`,
19138
19215
  {
19139
- workspace_id: workspaceId,
19140
- connector_id: connectorId,
19141
- patient_id: patientId
19216
+ data: {
19217
+ workspace_id: workspaceId,
19218
+ connector_id: connectorId,
19219
+ patient_id: patientId
19220
+ }
19142
19221
  },
19143
19222
  options
19144
19223
  ).then((r) => r.data),
@@ -19165,9 +19244,11 @@ function createConnectorsNamespace(rb) {
19165
19244
  getTreatmentPlan: async (connectorId, workspaceId, treatmentPlanId, options) => rb.rawPost(
19166
19245
  `/connectors/fullscript/treatment-plans/get`,
19167
19246
  {
19168
- workspace_id: workspaceId,
19169
- connector_id: connectorId,
19170
- treatment_plan_id: treatmentPlanId
19247
+ data: {
19248
+ workspace_id: workspaceId,
19249
+ connector_id: connectorId,
19250
+ treatment_plan_id: treatmentPlanId
19251
+ }
19171
19252
  },
19172
19253
  options
19173
19254
  ).then((r) => r.data),
@@ -19194,13 +19275,81 @@ function createConnectorsNamespace(rb) {
19194
19275
  cancelTreatmentPlan: async (connectorId, workspaceId, treatmentPlanId, options) => rb.rawPost(
19195
19276
  `/connectors/fullscript/treatment-plans/cancel`,
19196
19277
  {
19197
- workspace_id: workspaceId,
19198
- connector_id: connectorId,
19199
- treatment_plan_id: treatmentPlanId
19278
+ data: {
19279
+ workspace_id: workspaceId,
19280
+ connector_id: connectorId,
19281
+ treatment_plan_id: treatmentPlanId
19282
+ }
19283
+ },
19284
+ options
19285
+ ).then((r) => r.data),
19286
+ /**
19287
+ * Create a treatment plan in Fullscript with product recommendations.
19288
+ *
19289
+ * @param connectorId - The Fullscript connector instance ID
19290
+ * @param workspaceId - The workspace ID
19291
+ * @param attrs - Treatment plan creation attributes
19292
+ * @param options - Optional request options.
19293
+ * @returns The created {@link FullscriptTreatmentPlan}.
19294
+ *
19295
+ * @example
19296
+ * ```typescript
19297
+ * const plan = await client.connectors.fullscript.createTreatmentPlan(
19298
+ * 'ci_fs_123',
19299
+ * 'ws_abc123',
19300
+ * {
19301
+ * patient_id: 'fs_pat_456',
19302
+ * recommendations: [{ product_id: 'prod_1', dosage: '1 cap daily' }],
19303
+ * send_invitation: true,
19304
+ * message: 'Please take as directed',
19305
+ * },
19306
+ * );
19307
+ * ```
19308
+ */
19309
+ createTreatmentPlan: async (connectorId, workspaceId, attrs, options) => rb.rawPost(
19310
+ `/connectors/fullscript/treatment-plans/create`,
19311
+ {
19312
+ data: {
19313
+ workspace_id: workspaceId,
19314
+ connector_id: connectorId,
19315
+ patient_id: attrs.patient_id,
19316
+ recommendations: attrs.recommendations,
19317
+ send_invitation: attrs.send_invitation,
19318
+ message: attrs.message
19319
+ }
19200
19320
  },
19201
19321
  options
19202
19322
  ).then((r) => r.data),
19203
19323
  // ── Products ──
19324
+ /**
19325
+ * Match AI-generated supplement names to Fullscript products.
19326
+ *
19327
+ * @param connectorId - The Fullscript connector instance ID
19328
+ * @param workspaceId - The workspace ID
19329
+ * @param queries - Array of product match queries
19330
+ * @param options - Optional request options.
19331
+ * @returns Array of {@link ProductMatchResult} with matched products per query.
19332
+ *
19333
+ * @example
19334
+ * ```typescript
19335
+ * const results = await client.connectors.fullscript.matchProducts(
19336
+ * 'ci_fs_123',
19337
+ * 'ws_abc123',
19338
+ * [{ name: 'Vitamin D3 2000 IU', form: 'capsule' }],
19339
+ * );
19340
+ * ```
19341
+ */
19342
+ matchProducts: async (connectorId, workspaceId, queries, options) => rb.rawPost(
19343
+ `/connectors/fullscript/products/match`,
19344
+ {
19345
+ data: {
19346
+ workspace_id: workspaceId,
19347
+ connector_id: connectorId,
19348
+ queries
19349
+ }
19350
+ },
19351
+ options
19352
+ ).then((r) => r.data),
19204
19353
  /**
19205
19354
  * Search the Fullscript product catalog by keyword query.
19206
19355
  *
@@ -19224,9 +19373,11 @@ function createConnectorsNamespace(rb) {
19224
19373
  searchProducts: async (connectorId, workspaceId, query, options) => rb.rawPost(
19225
19374
  `/connectors/fullscript/products/search`,
19226
19375
  {
19227
- workspace_id: workspaceId,
19228
- connector_id: connectorId,
19229
- query
19376
+ data: {
19377
+ workspace_id: workspaceId,
19378
+ connector_id: connectorId,
19379
+ query
19380
+ }
19230
19381
  },
19231
19382
  options
19232
19383
  ).then((r) => r.data),
@@ -19253,9 +19404,11 @@ function createConnectorsNamespace(rb) {
19253
19404
  getProduct: async (connectorId, workspaceId, productId, options) => rb.rawPost(
19254
19405
  `/connectors/fullscript/products/get`,
19255
19406
  {
19256
- workspace_id: workspaceId,
19257
- connector_id: connectorId,
19258
- product_id: productId
19407
+ data: {
19408
+ workspace_id: workspaceId,
19409
+ connector_id: connectorId,
19410
+ product_id: productId
19411
+ }
19259
19412
  },
19260
19413
  options
19261
19414
  ).then((r) => r.data),
@@ -19282,9 +19435,11 @@ function createConnectorsNamespace(rb) {
19282
19435
  listSimilarProducts: async (connectorId, workspaceId, productId, options) => rb.rawPost(
19283
19436
  `/connectors/fullscript/products/similar`,
19284
19437
  {
19285
- workspace_id: workspaceId,
19286
- connector_id: connectorId,
19287
- product_id: productId
19438
+ data: {
19439
+ workspace_id: workspaceId,
19440
+ connector_id: connectorId,
19441
+ product_id: productId
19442
+ }
19288
19443
  },
19289
19444
  options
19290
19445
  ).then((r) => r.data),
@@ -19312,9 +19467,11 @@ function createConnectorsNamespace(rb) {
19312
19467
  listPatientOrders: async (connectorId, workspaceId, patientId, options) => rb.rawPost(
19313
19468
  `/connectors/fullscript/orders/list`,
19314
19469
  {
19315
- workspace_id: workspaceId,
19316
- connector_id: connectorId,
19317
- patient_id: patientId
19470
+ data: {
19471
+ workspace_id: workspaceId,
19472
+ connector_id: connectorId,
19473
+ patient_id: patientId
19474
+ }
19318
19475
  },
19319
19476
  options
19320
19477
  ).then((r) => r.data),
@@ -19341,9 +19498,11 @@ function createConnectorsNamespace(rb) {
19341
19498
  getOrder: async (connectorId, workspaceId, orderId, options) => rb.rawPost(
19342
19499
  `/connectors/fullscript/orders/get`,
19343
19500
  {
19344
- workspace_id: workspaceId,
19345
- connector_id: connectorId,
19346
- order_id: orderId
19501
+ data: {
19502
+ workspace_id: workspaceId,
19503
+ connector_id: connectorId,
19504
+ order_id: orderId
19505
+ }
19347
19506
  },
19348
19507
  options
19349
19508
  ).then((r) => r.data),
@@ -33031,13 +33190,16 @@ function createSocialNamespace(rb) {
33031
33190
  },
33032
33191
  /**
33033
33192
  * Create a new social campaign.
33034
- * Workspace is resolved from the authenticated user's context — do NOT
33035
- * pass `workspace_id` in attributes.
33193
+ *
33194
+ * @param workspaceId - Workspace ID (passed as query parameter for tenant resolution).
33195
+ * @param attributes - Campaign attributes (name, content_brief, etc.).
33196
+ * @param options - Optional request-level overrides.
33036
33197
  */
33037
- create: async (attributes, options) => {
33198
+ create: async (workspaceId, attributes, options) => {
33038
33199
  return rb.execute(
33039
33200
  postSocialCampaigns,
33040
33201
  {
33202
+ query: { workspace_id: workspaceId },
33041
33203
  body: {
33042
33204
  data: { type: "social-campaign", attributes }
33043
33205
  }