@gpt-platform/client 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1269,7 +1269,7 @@ function buildUserAgent(sdkVersion, appInfo) {
1269
1269
  }
1270
1270
 
1271
1271
  // src/version.ts
1272
- var SDK_VERSION = "0.7.0";
1272
+ var SDK_VERSION = "0.7.2";
1273
1273
  var DEFAULT_API_VERSION = "2026-03-11";
1274
1274
 
1275
1275
  // src/base-client.ts
@@ -2159,6 +2159,15 @@ var postAgentsImport = (options) => (options.client ?? client).post({
2159
2159
  ...options.headers
2160
2160
  }
2161
2161
  });
2162
+ var postUsersAuthPasswordResetRequest = (options) => (options.client ?? client).post({
2163
+ security: [{ scheme: "bearer", type: "http" }],
2164
+ url: "/users/auth/password-reset/request",
2165
+ ...options,
2166
+ headers: {
2167
+ "Content-Type": "application/vnd.api+json",
2168
+ ...options.headers
2169
+ }
2170
+ });
2162
2171
  var getExtractionBatchesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
2163
2172
  security: [{ scheme: "bearer", type: "http" }],
2164
2173
  url: "/extraction/batches/workspace/{workspace_id}",
@@ -2377,6 +2386,11 @@ var postCrmContacts = (options) => (options.client ?? client).post({
2377
2386
  ...options.headers
2378
2387
  }
2379
2388
  });
2389
+ var getMemoryDocumentSections = (options) => (options.client ?? client).get({
2390
+ security: [{ scheme: "bearer", type: "http" }],
2391
+ url: "/memory/document-sections",
2392
+ ...options
2393
+ });
2380
2394
  var deleteWebhookConfigsById = (options) => (options.client ?? client).delete({
2381
2395
  security: [{ scheme: "bearer", type: "http" }],
2382
2396
  url: "/webhook-configs/{id}",
@@ -2595,6 +2609,11 @@ var patchSupportTicketsByIdMerge = (options) => (options.client ?? client).patch
2595
2609
  ...options.headers
2596
2610
  }
2597
2611
  });
2612
+ var getMemorySectionDocumentsById = (options) => (options.client ?? client).get({
2613
+ security: [{ scheme: "bearer", type: "http" }],
2614
+ url: "/memory/section-documents/{id}",
2615
+ ...options
2616
+ });
2598
2617
  var deleteApiKeysById = (options) => (options.client ?? client).delete({
2599
2618
  security: [{ scheme: "bearer", type: "http" }],
2600
2619
  url: "/api-keys/{id}",
@@ -2788,6 +2807,11 @@ var getEmailRecipientsEmailByOutboundEmailId = (options) => (options.client ?? c
2788
2807
  url: "/email/recipients/email/{outbound_email_id}",
2789
2808
  ...options
2790
2809
  });
2810
+ var getMemorySectionDocuments = (options) => (options.client ?? client).get({
2811
+ security: [{ scheme: "bearer", type: "http" }],
2812
+ url: "/memory/section-documents",
2813
+ ...options
2814
+ });
2791
2815
  var patchStorageFilesByIdRestore = (options) => (options.client ?? client).patch({
2792
2816
  security: [{ scheme: "bearer", type: "http" }],
2793
2817
  url: "/storage-files/{id}/restore",
@@ -3548,6 +3572,11 @@ var postInvitations = (options) => (options.client ?? client).post({
3548
3572
  ...options.headers
3549
3573
  }
3550
3574
  });
3575
+ var getCrmPipelineStagesPipelineByPipelineId = (options) => (options.client ?? client).get({
3576
+ security: [{ scheme: "bearer", type: "http" }],
3577
+ url: "/crm/pipeline-stages/pipeline/{pipeline_id}",
3578
+ ...options
3579
+ });
3551
3580
  var patchThreadsByIdArchive = (options) => (options.client ?? client).patch({
3552
3581
  security: [{ scheme: "bearer", type: "http" }],
3553
3582
  url: "/threads/{id}/archive",
@@ -4459,6 +4488,15 @@ var getCrmActivitiesById = (options) => (options.client ?? client).get({
4459
4488
  url: "/crm/activities/{id}",
4460
4489
  ...options
4461
4490
  });
4491
+ var patchCrmActivitiesById = (options) => (options.client ?? client).patch({
4492
+ security: [{ scheme: "bearer", type: "http" }],
4493
+ url: "/crm/activities/{id}",
4494
+ ...options,
4495
+ headers: {
4496
+ "Content-Type": "application/vnd.api+json",
4497
+ ...options.headers
4498
+ }
4499
+ });
4462
4500
  var postTrainingExamplesSearch = (options) => (options.client ?? client).post({
4463
4501
  security: [{ scheme: "bearer", type: "http" }],
4464
4502
  url: "/training-examples/search",
@@ -5345,6 +5383,11 @@ var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client
5345
5383
  url: "/extraction/documents/workspace/{workspace_id}",
5346
5384
  ...options
5347
5385
  });
5386
+ var getMemoryDocumentSectionsById = (options) => (options.client ?? client).get({
5387
+ security: [{ scheme: "bearer", type: "http" }],
5388
+ url: "/memory/document-sections/{id}",
5389
+ ...options
5390
+ });
5348
5391
  var getClinicalDeliveriesById = (options) => (options.client ?? client).get({
5349
5392
  security: [{ scheme: "bearer", type: "http" }],
5350
5393
  url: "/clinical/deliveries/{id}",
@@ -5779,6 +5822,15 @@ var patchStorageFilesByIdTag = (options) => (options.client ?? client).patch({
5779
5822
  ...options.headers
5780
5823
  }
5781
5824
  });
5825
+ var patchCrmDealsByIdMoveStage = (options) => (options.client ?? client).patch({
5826
+ security: [{ scheme: "bearer", type: "http" }],
5827
+ url: "/crm/deals/{id}/move-stage",
5828
+ ...options,
5829
+ headers: {
5830
+ "Content-Type": "application/vnd.api+json",
5831
+ ...options.headers
5832
+ }
5833
+ });
5782
5834
  var getApiKeys = (options) => (options.client ?? client).get({
5783
5835
  security: [{ scheme: "bearer", type: "http" }],
5784
5836
  url: "/api-keys",
@@ -14208,6 +14260,7 @@ function createCrmNamespace(rb) {
14208
14260
  {
14209
14261
  path: { workspace_id: workspaceId },
14210
14262
  query: {
14263
+ ...options?.name ? { name: options.name } : {},
14211
14264
  ...options?.status ? { status: options.status } : {},
14212
14265
  ...options?.filters ? { filters: options.filters } : {},
14213
14266
  ...options?.tags ? { tags: options.tags } : {},
@@ -14538,6 +14591,33 @@ function createCrmNamespace(rb) {
14538
14591
  options
14539
14592
  );
14540
14593
  },
14594
+ /**
14595
+ * Move a deal to a different pipeline stage.
14596
+ *
14597
+ * @param id - The unique identifier of the deal to move.
14598
+ * @param attributes - Must include `stage_id` (the target stage).
14599
+ * @param options - Optional request-level overrides.
14600
+ * @returns A promise that resolves to the updated {@link CrmDeal}.
14601
+ *
14602
+ * @example
14603
+ * ```typescript
14604
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
14605
+ *
14606
+ * const deal = await client.crm.deals.moveStage('deal_abc123', {
14607
+ * stage_id: 'stage_closed_won',
14608
+ * });
14609
+ * ```
14610
+ */
14611
+ moveStage: async (id, attributes, options) => {
14612
+ return rb.execute(
14613
+ patchCrmDealsByIdMoveStage,
14614
+ {
14615
+ path: { id },
14616
+ body: { data: { type: "crm_deal", id, attributes } }
14617
+ },
14618
+ options
14619
+ );
14620
+ },
14541
14621
  /**
14542
14622
  * Permanently delete a deal.
14543
14623
  *
@@ -14648,6 +14728,33 @@ function createCrmNamespace(rb) {
14648
14728
  options
14649
14729
  );
14650
14730
  },
14731
+ /**
14732
+ * Update an existing activity's attributes.
14733
+ *
14734
+ * @param id - The unique identifier of the activity to update.
14735
+ * @param attributes - Key/value map of attributes to change.
14736
+ * @param options - Optional request-level overrides.
14737
+ * @returns A promise that resolves to the updated {@link CrmActivity}.
14738
+ *
14739
+ * @example
14740
+ * ```typescript
14741
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
14742
+ *
14743
+ * const activity = await client.crm.activities.update('act_abc123', {
14744
+ * note: 'Updated notes from follow-up call.',
14745
+ * });
14746
+ * ```
14747
+ */
14748
+ update: async (id, attributes, options) => {
14749
+ return rb.execute(
14750
+ patchCrmActivitiesById,
14751
+ {
14752
+ path: { id },
14753
+ body: { data: { id, type: "crm_activity", attributes } }
14754
+ },
14755
+ options
14756
+ );
14757
+ },
14651
14758
  /**
14652
14759
  * Permanently delete an activity.
14653
14760
  *
@@ -14934,6 +15041,28 @@ function createCrmNamespace(rb) {
14934
15041
  { path: { id } },
14935
15042
  options
14936
15043
  );
15044
+ },
15045
+ /**
15046
+ * List all stages belonging to a specific pipeline.
15047
+ *
15048
+ * @param pipelineId - The ID of the pipeline whose stages to list.
15049
+ * @param options - Optional request-level overrides.
15050
+ * @returns A promise that resolves to an array of {@link CrmPipelineStage} records.
15051
+ *
15052
+ * @example
15053
+ * ```typescript
15054
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
15055
+ *
15056
+ * const stages = await client.crm.pipelineStages.listByPipeline('pipe_abc123');
15057
+ * stages.forEach((s) => console.log(s.attributes.name, s.attributes.order));
15058
+ * ```
15059
+ */
15060
+ listByPipeline: async (pipelineId, options) => {
15061
+ return rb.execute(
15062
+ getCrmPipelineStagesPipelineByPipelineId,
15063
+ { path: { pipeline_id: pipelineId } },
15064
+ options
15065
+ );
14937
15066
  }
14938
15067
  },
14939
15068
  /**
@@ -19196,7 +19325,7 @@ function createIdentityNamespace(rb, baseUrl) {
19196
19325
  requestPasswordReset: async (email, options) => {
19197
19326
  RequestPasswordResetSchema.parse({ email });
19198
19327
  return rb.execute(
19199
- patchUsersAuthResetPassword,
19328
+ postUsersAuthPasswordResetRequest,
19200
19329
  {
19201
19330
  body: {
19202
19331
  data: { type: "user", attributes: { email } }
@@ -26418,6 +26547,115 @@ function createRolesNamespace(rb) {
26418
26547
  };
26419
26548
  }
26420
26549
 
26550
+ // src/namespaces/memory.ts
26551
+ function createMemoryNamespace(rb) {
26552
+ return {
26553
+ /**
26554
+ * Sub-namespace for section document operations.
26555
+ *
26556
+ * A section document represents an indexed source (extraction document,
26557
+ * crawler page, knowledge file, or direct upload). Each section document
26558
+ * contains metadata about the source and links to its document sections.
26559
+ */
26560
+ sectionDocuments: {
26561
+ /**
26562
+ * Lists section documents in the current workspace.
26563
+ *
26564
+ * Returns paginated results sorted by creation date (newest first).
26565
+ *
26566
+ * @param params - Optional pagination parameters (`page[offset]`, `page[limit]`).
26567
+ * @param options - Optional request options such as custom headers or abort signal.
26568
+ * @returns A promise resolving to an array of section document records.
26569
+ *
26570
+ * @example
26571
+ * ```typescript
26572
+ * const client = new GptClient({ apiKey: 'sk_app_...' });
26573
+ * const docs = await client.memory.sectionDocuments.list();
26574
+ * docs.forEach(d => console.log(d.attributes?.doc_path));
26575
+ * ```
26576
+ */
26577
+ list: async (params, options) => {
26578
+ return rb.execute(
26579
+ getMemorySectionDocuments,
26580
+ buildPageQuery(params?.page, params?.pageSize),
26581
+ options
26582
+ );
26583
+ },
26584
+ /**
26585
+ * Retrieves a single section document by its unique identifier.
26586
+ *
26587
+ * @param id - The UUID of the section document.
26588
+ * @param options - Optional request options.
26589
+ * @returns A promise resolving to the section document record.
26590
+ *
26591
+ * @example
26592
+ * ```typescript
26593
+ * const doc = await client.memory.sectionDocuments.get('sd_01HXYZ...');
26594
+ * console.log(doc.attributes?.source_type, doc.attributes?.section_count);
26595
+ * ```
26596
+ */
26597
+ get: async (id, options) => {
26598
+ return rb.execute(
26599
+ getMemorySectionDocumentsById,
26600
+ { path: { id } },
26601
+ options
26602
+ );
26603
+ }
26604
+ },
26605
+ /**
26606
+ * Sub-namespace for document section operations.
26607
+ *
26608
+ * A document section represents one heading-delimited portion of an
26609
+ * indexed document. Sections have stable IDs that survive re-indexing,
26610
+ * enabling persistent cross-document references.
26611
+ */
26612
+ documentSections: {
26613
+ /**
26614
+ * Lists document sections in the current workspace.
26615
+ *
26616
+ * Returns paginated results sorted by position within their documents.
26617
+ *
26618
+ * @param params - Optional pagination parameters.
26619
+ * @param options - Optional request options.
26620
+ * @returns A promise resolving to an array of document section records.
26621
+ *
26622
+ * @example
26623
+ * ```typescript
26624
+ * const sections = await client.memory.documentSections.list();
26625
+ * sections.forEach(s => console.log(s.attributes?.title, s.attributes?.level));
26626
+ * ```
26627
+ */
26628
+ list: async (params, options) => {
26629
+ return rb.execute(
26630
+ getMemoryDocumentSections,
26631
+ buildPageQuery(params?.page, params?.pageSize),
26632
+ options
26633
+ );
26634
+ },
26635
+ /**
26636
+ * Retrieves a single document section by its unique identifier.
26637
+ *
26638
+ * @param id - The UUID of the document section.
26639
+ * @param options - Optional request options.
26640
+ * @returns A promise resolving to the document section record.
26641
+ *
26642
+ * @example
26643
+ * ```typescript
26644
+ * const section = await client.memory.documentSections.get('ds_01HXYZ...');
26645
+ * console.log(section.attributes?.title, section.attributes?.content_preview);
26646
+ * ```
26647
+ */
26648
+ get: async (id, options) => {
26649
+ return rb.execute(
26650
+ getMemoryDocumentSectionsById,
26651
+ { path: { id } },
26652
+ options
26653
+ );
26654
+ }
26655
+ }
26656
+ };
26657
+ }
26658
+
26421
26659
  // src/namespaces/permissions.ts
26422
26660
  function createPermissionsNamespace(rb) {
26423
26661
  return {
@@ -26936,6 +27174,7 @@ var GptClient = class extends BaseClient {
26936
27174
  this.accessGrants = createAccessGrantsNamespace(rb);
26937
27175
  this.roles = createRolesNamespace(rb);
26938
27176
  this.permissions = createPermissionsNamespace(rb);
27177
+ this.memory = createMemoryNamespace(rb);
26939
27178
  }
26940
27179
  /**
26941
27180
  * Subscribe to SDK lifecycle events.