@gpt-platform/client 0.10.4 → 0.10.5

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.4";
1342
+ var SDK_VERSION = "0.10.5";
1343
1343
  var DEFAULT_API_VERSION = "2026-03-23";
1344
1344
 
1345
1345
  // src/base-client.ts
@@ -2305,6 +2305,11 @@ var getSupportTagsWorkspaceByWorkspaceId = (options) => (options.client ?? clien
2305
2305
  url: "/support/tags/workspace/{workspace_id}",
2306
2306
  ...options
2307
2307
  });
2308
+ var getClinicalPatientsByIdMedications = (options) => (options.client ?? client).get({
2309
+ security: [{ scheme: "bearer", type: "http" }],
2310
+ url: "/clinical/patients/{id}/medications",
2311
+ ...options
2312
+ });
2308
2313
  var getSearchIndexes = (options) => (options.client ?? client).get({
2309
2314
  security: [{ scheme: "bearer", type: "http" }],
2310
2315
  url: "/search/indexes",
@@ -5091,6 +5096,11 @@ var getAuditLogs = (options) => (options.client ?? client).get({
5091
5096
  url: "/audit-logs",
5092
5097
  ...options
5093
5098
  });
5099
+ var getClinicalClientMedicationsArchived = (options) => (options.client ?? client).get({
5100
+ security: [{ scheme: "bearer", type: "http" }],
5101
+ url: "/clinical/client-medications/archived",
5102
+ ...options
5103
+ });
5094
5104
  var getEmailInclusionsEmailByOutboundEmailId = (options) => (options.client ?? client).get({
5095
5105
  security: [{ scheme: "bearer", type: "http" }],
5096
5106
  url: "/email/inclusions/email/{outbound_email_id}",
@@ -5685,6 +5695,15 @@ var patchApplicationsById = (options) => (options.client ?? client).patch({
5685
5695
  ...options.headers
5686
5696
  }
5687
5697
  });
5698
+ var patchClinicalClientMedicationsByIdRestore = (options) => (options.client ?? client).patch({
5699
+ security: [{ scheme: "bearer", type: "http" }],
5700
+ url: "/clinical/client-medications/{id}/restore",
5701
+ ...options,
5702
+ headers: {
5703
+ "Content-Type": "application/vnd.api+json",
5704
+ ...options.headers
5705
+ }
5706
+ });
5688
5707
  var patchEmailOutboundEmailsByIdSchedule = (options) => (options.client ?? client).patch({
5689
5708
  security: [{ scheme: "bearer", type: "http" }],
5690
5709
  url: "/email/outbound-emails/{id}/schedule",
@@ -6429,6 +6448,15 @@ var postContentRewriteTone = (options) => (options.client ?? client).post({
6429
6448
  ...options.headers
6430
6449
  }
6431
6450
  });
6451
+ var patchClinicalClientMedicationsByIdArchive = (options) => (options.client ?? client).patch({
6452
+ security: [{ scheme: "bearer", type: "http" }],
6453
+ url: "/clinical/client-medications/{id}/archive",
6454
+ ...options,
6455
+ headers: {
6456
+ "Content-Type": "application/vnd.api+json",
6457
+ ...options.headers
6458
+ }
6459
+ });
6432
6460
  var patchStorageFilesByIdSoftDelete = (options) => (options.client ?? client).patch({
6433
6461
  security: [{ scheme: "bearer", type: "http" }],
6434
6462
  url: "/storage-files/{id}/soft-delete",
@@ -6741,6 +6769,20 @@ var getPlans = (options) => (options.client ?? client).get({
6741
6769
  url: "/plans",
6742
6770
  ...options
6743
6771
  });
6772
+ var getClinicalClientMedications = (options) => (options.client ?? client).get({
6773
+ security: [{ scheme: "bearer", type: "http" }],
6774
+ url: "/clinical/client-medications",
6775
+ ...options
6776
+ });
6777
+ var postClinicalClientMedications = (options) => (options.client ?? client).post({
6778
+ security: [{ scheme: "bearer", type: "http" }],
6779
+ url: "/clinical/client-medications",
6780
+ ...options,
6781
+ headers: {
6782
+ "Content-Type": "application/vnd.api+json",
6783
+ ...options.headers
6784
+ }
6785
+ });
6744
6786
  var postCrmActivities = (options) => (options.client ?? client).post({
6745
6787
  security: [{ scheme: "bearer", type: "http" }],
6746
6788
  url: "/crm/activities",
@@ -6838,6 +6880,20 @@ var patchSchedulingParticipantsByIdRespond = (options) => (options.client ?? cli
6838
6880
  ...options.headers
6839
6881
  }
6840
6882
  });
6883
+ var getClinicalClientMedicationsById = (options) => (options.client ?? client).get({
6884
+ security: [{ scheme: "bearer", type: "http" }],
6885
+ url: "/clinical/client-medications/{id}",
6886
+ ...options
6887
+ });
6888
+ var patchClinicalClientMedicationsById = (options) => (options.client ?? client).patch({
6889
+ security: [{ scheme: "bearer", type: "http" }],
6890
+ url: "/clinical/client-medications/{id}",
6891
+ ...options,
6892
+ headers: {
6893
+ "Content-Type": "application/vnd.api+json",
6894
+ ...options.headers
6895
+ }
6896
+ });
6841
6897
  var postAgentsByIdTest = (options) => (options.client ?? client).post({
6842
6898
  security: [{ scheme: "bearer", type: "http" }],
6843
6899
  url: "/agents/{id}/test",
@@ -7264,6 +7320,11 @@ var postEmailInclusions = (options) => (options.client ?? client).post({
7264
7320
  ...options.headers
7265
7321
  }
7266
7322
  });
7323
+ var deleteClinicalClientMedicationsByIdPermanent = (options) => (options.client ?? client).delete({
7324
+ security: [{ scheme: "bearer", type: "http" }],
7325
+ url: "/clinical/client-medications/{id}/permanent",
7326
+ ...options
7327
+ });
7267
7328
  var getAccessLogs = (options) => (options.client ?? client).get({
7268
7329
  security: [{ scheme: "bearer", type: "http" }],
7269
7330
  url: "/access-logs",
@@ -12610,6 +12671,18 @@ function createClinicalNamespace(rb) {
12610
12671
  { path: { id: patientId } },
12611
12672
  options
12612
12673
  ),
12674
+ /**
12675
+ * List medications for a patient (related resource).
12676
+ *
12677
+ * @param patientId - Patient UUID or CRM Contact UUID
12678
+ * @param options - Request options
12679
+ * @returns Array of {@link ClinicalClientMedication} records
12680
+ */
12681
+ medications: async (patientId, options) => rb.execute(
12682
+ getClinicalPatientsByIdMedications,
12683
+ { path: { id: patientId } },
12684
+ options
12685
+ ),
12613
12686
  /**
12614
12687
  * List resource assignments for a patient (related resource).
12615
12688
  *
@@ -13640,6 +13713,163 @@ function createClinicalNamespace(rb) {
13640
13713
  */
13641
13714
  bulkCreate: async (attrs, options) => rb.rawPost(`/clinical/client-supplements/bulk`, { data: attrs }, options).then((r) => r.data)
13642
13715
  },
13716
+ /**
13717
+ * Manage medication prescriptions for clinical patients.
13718
+ */
13719
+ clientMedications: {
13720
+ /**
13721
+ * List medication prescriptions, filtered by patient/workspace.
13722
+ *
13723
+ * @param params - Filter/pagination parameters
13724
+ * @param options - Request options
13725
+ * @returns Array of {@link ClinicalClientMedication} records
13726
+ */
13727
+ list: async (params, options) => rb.execute(
13728
+ getClinicalClientMedications,
13729
+ { query: params ?? {} },
13730
+ options
13731
+ ),
13732
+ /**
13733
+ * Get a single medication prescription by ID.
13734
+ *
13735
+ * @param id - ClientMedication UUID
13736
+ * @param options - Request options
13737
+ * @returns {@link ClinicalClientMedication} record
13738
+ */
13739
+ get: async (id, options) => rb.execute(
13740
+ getClinicalClientMedicationsById,
13741
+ { path: { id } },
13742
+ options
13743
+ ),
13744
+ /**
13745
+ * Create a new medication prescription.
13746
+ *
13747
+ * @param attributes - Medication creation attributes. Must include `workspace_id`,
13748
+ * `patient_id`, and `name`.
13749
+ * @param options - Request options
13750
+ * @returns Created {@link ClinicalClientMedication} record
13751
+ */
13752
+ create: async (attributes, options) => rb.execute(
13753
+ postClinicalClientMedications,
13754
+ {
13755
+ body: { data: { type: "clinical-client-medication", attributes } }
13756
+ },
13757
+ options
13758
+ ),
13759
+ /**
13760
+ * Update a medication prescription.
13761
+ *
13762
+ * @param id - ClientMedication UUID
13763
+ * @param attributes - Fields to update (PATCH semantics)
13764
+ * @param options - Request options
13765
+ * @returns Updated {@link ClinicalClientMedication} record
13766
+ */
13767
+ update: async (id, attributes, options) => rb.execute(
13768
+ patchClinicalClientMedicationsById,
13769
+ {
13770
+ path: { id },
13771
+ body: {
13772
+ data: { type: "clinical-client-medication", id, attributes }
13773
+ }
13774
+ },
13775
+ options
13776
+ ),
13777
+ /**
13778
+ * Delete (archive) a medication prescription.
13779
+ *
13780
+ * @deprecated Use {@link archive} instead.
13781
+ * @param id - ClientMedication UUID
13782
+ * @param options - Request options
13783
+ * @returns Archived {@link ClinicalClientMedication} record
13784
+ */
13785
+ delete: async (id, options) => rb.execute(
13786
+ patchClinicalClientMedicationsByIdArchive,
13787
+ {
13788
+ path: { id },
13789
+ body: {
13790
+ data: { type: "clinical-client-medication", id, attributes: {} }
13791
+ }
13792
+ },
13793
+ options
13794
+ ),
13795
+ /**
13796
+ * Archive (soft-delete) a medication prescription.
13797
+ *
13798
+ * @param id - ClientMedication UUID
13799
+ * @param options - Request options
13800
+ * @returns Archived {@link ClinicalClientMedication} record
13801
+ */
13802
+ archive: async (id, options) => rb.execute(
13803
+ patchClinicalClientMedicationsByIdArchive,
13804
+ {
13805
+ path: { id },
13806
+ body: {
13807
+ data: { type: "clinical-client-medication", id, attributes: {} }
13808
+ }
13809
+ },
13810
+ options
13811
+ ),
13812
+ /**
13813
+ * Restore an archived medication prescription.
13814
+ *
13815
+ * @param id - ClientMedication UUID
13816
+ * @param options - Request options
13817
+ * @returns Restored {@link ClinicalClientMedication} record
13818
+ */
13819
+ restore: async (id, options) => rb.execute(
13820
+ patchClinicalClientMedicationsByIdRestore,
13821
+ {
13822
+ path: { id },
13823
+ body: {
13824
+ data: { type: "clinical-client-medication", id, attributes: {} }
13825
+ }
13826
+ },
13827
+ options
13828
+ ),
13829
+ /**
13830
+ * Permanently delete a medication prescription. Irreversible.
13831
+ *
13832
+ * @param id - ClientMedication UUID
13833
+ * @param options - Request options
13834
+ * @returns `true` on success
13835
+ */
13836
+ permanentDelete: async (id, options) => rb.executeDelete(
13837
+ deleteClinicalClientMedicationsByIdPermanent,
13838
+ { path: { id } },
13839
+ options
13840
+ ),
13841
+ /**
13842
+ * List archived (soft-deleted) medication prescriptions.
13843
+ *
13844
+ * @param params - Filter/pagination parameters
13845
+ * @param options - Request options
13846
+ * @returns Array of archived {@link ClinicalClientMedication} records
13847
+ */
13848
+ listArchived: async (params, options) => rb.execute(
13849
+ getClinicalClientMedicationsArchived,
13850
+ { query: params ?? {} },
13851
+ options
13852
+ ),
13853
+ /**
13854
+ * Create multiple medications in a single request.
13855
+ *
13856
+ * @param attrs - Bulk creation attributes with workspace_id and medications array
13857
+ * @param options - Request options
13858
+ * @returns Array of creation results with id and status per medication
13859
+ *
13860
+ * @example
13861
+ * ```typescript
13862
+ * const results = await client.clinical.clientMedications.bulkCreate({
13863
+ * workspace_id: 'ws_123',
13864
+ * medications: [
13865
+ * { patient_id: 'pat_1', name: 'Metformin', source: 'ehr_import' },
13866
+ * { patient_id: 'pat_1', name: 'Lisinopril', source: 'ehr_import' },
13867
+ * ],
13868
+ * });
13869
+ * ```
13870
+ */
13871
+ bulkCreate: async (attrs, options) => rb.rawPost(`/clinical/client-medications/bulk`, { data: attrs }, options).then((r) => r.data)
13872
+ },
13643
13873
  /**
13644
13874
  * Manage clinical deliveries (care plan items sent to patients).
13645
13875
  */
@@ -33805,28 +34035,251 @@ function createCrmClustersNamespace(rb) {
33805
34035
  };
33806
34036
  }
33807
34037
 
34038
+ // src/namespaces/pipeline-executions.ts
34039
+ function createPipelineExecutionsNamespace(rb) {
34040
+ return {
34041
+ /**
34042
+ * Get a pipeline execution by ID.
34043
+ *
34044
+ * @param id - Execution UUID.
34045
+ * @param options - Optional request options.
34046
+ * @returns PipelineExecution resource.
34047
+ */
34048
+ async get(id, options) {
34049
+ return rb.rawGet(
34050
+ `/pipeline-executions/${id}`,
34051
+ options
34052
+ );
34053
+ },
34054
+ /**
34055
+ * List pipeline executions for a workspace.
34056
+ *
34057
+ * @param workspaceId - Workspace UUID to filter by.
34058
+ * @param filters - Optional filters (status, pipeline_id).
34059
+ * @param options - Optional request options.
34060
+ * @returns Array of PipelineExecution resources.
34061
+ */
34062
+ async list(workspaceId, filters, options) {
34063
+ const params = new URLSearchParams({ workspace_id: workspaceId });
34064
+ if (filters?.status) params.set("filter[status]", filters.status);
34065
+ if (filters?.pipeline_id)
34066
+ params.set("filter[pipeline_id]", filters.pipeline_id);
34067
+ return rb.rawGet(
34068
+ `/pipeline-executions?${params.toString()}`,
34069
+ options
34070
+ );
34071
+ },
34072
+ /**
34073
+ * List pipeline executions for a specific pipeline.
34074
+ *
34075
+ * @param pipelineId - Pipeline UUID to filter by.
34076
+ * @param options - Optional request options.
34077
+ * @returns Array of PipelineExecution resources for this pipeline.
34078
+ */
34079
+ async listByPipeline(pipelineId, options) {
34080
+ return rb.rawGet(
34081
+ `/pipeline-executions/by-pipeline/${pipelineId}`,
34082
+ options
34083
+ );
34084
+ },
34085
+ /**
34086
+ * Approve the current HITL checkpoint. Pipeline resumes execution.
34087
+ * Only valid when status === "awaiting_approval".
34088
+ *
34089
+ * @param id - Execution UUID.
34090
+ * @param options - Optional request options.
34091
+ * @returns Updated PipelineExecution resource.
34092
+ */
34093
+ async approve(id, options) {
34094
+ return rb.rawPatch(
34095
+ `/pipeline-executions/${id}/approve`,
34096
+ {
34097
+ data: { type: "pipeline-execution", id, attributes: {} }
34098
+ },
34099
+ {
34100
+ ...options,
34101
+ headers: {
34102
+ "Content-Type": "application/vnd.api+json",
34103
+ ...options?.headers
34104
+ }
34105
+ }
34106
+ );
34107
+ },
34108
+ /**
34109
+ * Reject the current HITL checkpoint. Pipeline halts permanently.
34110
+ * Only valid when status === "awaiting_approval".
34111
+ *
34112
+ * @param id - Execution UUID.
34113
+ * @param options - Optional request options.
34114
+ * @returns Updated PipelineExecution resource.
34115
+ */
34116
+ async reject(id, options) {
34117
+ return rb.rawPatch(
34118
+ `/pipeline-executions/${id}/reject`,
34119
+ {
34120
+ data: { type: "pipeline-execution", id, attributes: {} }
34121
+ },
34122
+ {
34123
+ ...options,
34124
+ headers: {
34125
+ "Content-Type": "application/vnd.api+json",
34126
+ ...options?.headers
34127
+ }
34128
+ }
34129
+ );
34130
+ },
34131
+ /**
34132
+ * Edit checkpoint data before approving.
34133
+ * Corrected values flow into downstream pipeline nodes.
34134
+ * Only valid when status === "awaiting_approval".
34135
+ *
34136
+ * @param id - Execution UUID.
34137
+ * @param attributes - Checkpoint data updates.
34138
+ * @param options - Optional request options.
34139
+ * @returns Updated PipelineExecution resource.
34140
+ */
34141
+ async updateCheckpoint(id, attributes, options) {
34142
+ return rb.rawPatch(
34143
+ `/pipeline-executions/${id}/checkpoint`,
34144
+ {
34145
+ data: { type: "pipeline-execution", id, attributes }
34146
+ },
34147
+ {
34148
+ ...options,
34149
+ headers: {
34150
+ "Content-Type": "application/vnd.api+json",
34151
+ ...options?.headers
34152
+ }
34153
+ }
34154
+ );
34155
+ },
34156
+ /**
34157
+ * Set the checkpoint note. Replaces any existing note.
34158
+ * Only valid when status === "awaiting_approval".
34159
+ *
34160
+ * @param id - Execution UUID.
34161
+ * @param note - Note text.
34162
+ * @param options - Optional request options.
34163
+ * @returns Updated PipelineExecution resource.
34164
+ */
34165
+ async addNote(id, note, options) {
34166
+ return rb.rawPatch(
34167
+ `/pipeline-executions/${id}/note`,
34168
+ {
34169
+ data: {
34170
+ type: "pipeline-execution",
34171
+ id,
34172
+ attributes: { checkpoint_notes: note }
34173
+ }
34174
+ },
34175
+ {
34176
+ ...options,
34177
+ headers: {
34178
+ "Content-Type": "application/vnd.api+json",
34179
+ ...options?.headers
34180
+ }
34181
+ }
34182
+ );
34183
+ },
34184
+ /**
34185
+ * Request AI refinement of a specific checkpoint node.
34186
+ * The AI re-runs the node with the given instruction and updates checkpoint_data.
34187
+ * Only valid when status === "awaiting_approval".
34188
+ *
34189
+ * @param id - Execution UUID.
34190
+ * @param nodeId - The pipeline node ID to refine.
34191
+ * @param instruction - Natural language instruction for refinement.
34192
+ * @param options - Optional request options.
34193
+ * @returns Updated PipelineExecution resource.
34194
+ */
34195
+ async aiRefine(id, nodeId, instruction, options) {
34196
+ return rb.rawPatch(
34197
+ `/pipeline-executions/${id}/refine`,
34198
+ {
34199
+ data: {
34200
+ type: "pipeline-execution",
34201
+ id,
34202
+ attributes: { node_id: nodeId, instruction }
34203
+ }
34204
+ },
34205
+ {
34206
+ ...options,
34207
+ headers: {
34208
+ "Content-Type": "application/vnd.api+json",
34209
+ ...options?.headers
34210
+ }
34211
+ }
34212
+ );
34213
+ }
34214
+ };
34215
+ }
34216
+
33808
34217
  // src/namespaces/pipelines.ts
33809
34218
  function createPipelinesNamespace(rb) {
33810
34219
  return {
34220
+ /**
34221
+ * List available pipelines.
34222
+ *
34223
+ * @param options - Optional request options.
34224
+ * @returns Array of Pipeline resources.
34225
+ */
34226
+ async list(options) {
34227
+ return rb.rawGet(`/pipelines`, options);
34228
+ },
34229
+ /**
34230
+ * Get a pipeline by ID.
34231
+ *
34232
+ * @param id - Pipeline UUID.
34233
+ * @param options - Optional request options.
34234
+ * @returns Pipeline resource.
34235
+ */
34236
+ async get(id, options) {
34237
+ return rb.rawGet(`/pipelines/${id}`, options);
34238
+ },
34239
+ /**
34240
+ * Get a pipeline by its system slug.
34241
+ *
34242
+ * @param slug - Pipeline system_slug.
34243
+ * @param options - Optional request options.
34244
+ * @returns Pipeline resource.
34245
+ */
34246
+ async getBySlug(slug, options) {
34247
+ return rb.rawGet(`/pipelines/by-slug/${slug}`, options);
34248
+ },
33811
34249
  /**
33812
34250
  * Trigger pipeline execution.
33813
34251
  *
33814
34252
  * @param id - Pipeline UUID.
33815
- * @param attributes - Execution parameters including workspace_id and input.
34253
+ * @param attributes - Execution parameters including workspace_id and optional input.
33816
34254
  * @param options - Optional request options.
33817
- * @returns Pipeline execution result map.
34255
+ * @returns Trigger response with execution_id and status.
33818
34256
  */
33819
34257
  async trigger(id, attributes, options) {
33820
- return rb.rawPost(
34258
+ return rb.rawPostDirect(
33821
34259
  `/pipelines/${id}/trigger`,
33822
34260
  {
33823
- data: {
33824
- type: "pipeline",
33825
- attributes: {
33826
- pipeline_id: id,
33827
- ...attributes
33828
- }
33829
- }
34261
+ workspace_id: attributes.workspace_id,
34262
+ ...attributes.input ? { input: attributes.input } : {}
34263
+ },
34264
+ options
34265
+ );
34266
+ },
34267
+ /**
34268
+ * Validate pipeline can execute without running it (dry-run).
34269
+ *
34270
+ * Checks: nodes exist, agents are resolvable, graph is valid, permissions OK.
34271
+ * Use this for onboarding validation or pre-flight checks.
34272
+ *
34273
+ * @param id - Pipeline UUID.
34274
+ * @param attributes - Validation parameters including workspace_id.
34275
+ * @param options - Optional request options.
34276
+ * @returns Validation result with validity flag and diagnostic info.
34277
+ */
34278
+ async dryRun(id, attributes, options) {
34279
+ return rb.rawPostDirect(
34280
+ `/pipelines/${id}/dry-run`,
34281
+ {
34282
+ workspace_id: attributes.workspace_id
33830
34283
  },
33831
34284
  options
33832
34285
  );
@@ -34891,6 +35344,7 @@ var GptClient = class extends BaseClient {
34891
35344
  this.projects = createProjectsNamespace(rb);
34892
35345
  this.models = createModelsNamespace(rb);
34893
35346
  this.crmClusters = createCrmClustersNamespace(rb);
35347
+ this.pipelineExecutions = createPipelineExecutionsNamespace(rb);
34894
35348
  this.pipelines = createPipelinesNamespace(rb);
34895
35349
  this.accessGrants = createAccessGrantsNamespace(rb);
34896
35350
  this.roles = createRolesNamespace(rb);