@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.d.mts +252 -7
- package/dist/index.d.ts +252 -7
- package/dist/index.js +241 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +241 -2
- package/dist/index.mjs.map +1 -1
- package/llms.txt +98 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1333,7 +1333,7 @@ function buildUserAgent(sdkVersion, appInfo) {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
|
|
1335
1335
|
// src/version.ts
|
|
1336
|
-
var SDK_VERSION = "0.7.
|
|
1336
|
+
var SDK_VERSION = "0.7.2";
|
|
1337
1337
|
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1338
1338
|
|
|
1339
1339
|
// src/base-client.ts
|
|
@@ -2223,6 +2223,15 @@ var postAgentsImport = (options) => (options.client ?? client).post({
|
|
|
2223
2223
|
...options.headers
|
|
2224
2224
|
}
|
|
2225
2225
|
});
|
|
2226
|
+
var postUsersAuthPasswordResetRequest = (options) => (options.client ?? client).post({
|
|
2227
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2228
|
+
url: "/users/auth/password-reset/request",
|
|
2229
|
+
...options,
|
|
2230
|
+
headers: {
|
|
2231
|
+
"Content-Type": "application/vnd.api+json",
|
|
2232
|
+
...options.headers
|
|
2233
|
+
}
|
|
2234
|
+
});
|
|
2226
2235
|
var getExtractionBatchesWorkspaceByWorkspaceId = (options) => (options.client ?? client).get({
|
|
2227
2236
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2228
2237
|
url: "/extraction/batches/workspace/{workspace_id}",
|
|
@@ -2441,6 +2450,11 @@ var postCrmContacts = (options) => (options.client ?? client).post({
|
|
|
2441
2450
|
...options.headers
|
|
2442
2451
|
}
|
|
2443
2452
|
});
|
|
2453
|
+
var getMemoryDocumentSections = (options) => (options.client ?? client).get({
|
|
2454
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2455
|
+
url: "/memory/document-sections",
|
|
2456
|
+
...options
|
|
2457
|
+
});
|
|
2444
2458
|
var deleteWebhookConfigsById = (options) => (options.client ?? client).delete({
|
|
2445
2459
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2446
2460
|
url: "/webhook-configs/{id}",
|
|
@@ -2659,6 +2673,11 @@ var patchSupportTicketsByIdMerge = (options) => (options.client ?? client).patch
|
|
|
2659
2673
|
...options.headers
|
|
2660
2674
|
}
|
|
2661
2675
|
});
|
|
2676
|
+
var getMemorySectionDocumentsById = (options) => (options.client ?? client).get({
|
|
2677
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2678
|
+
url: "/memory/section-documents/{id}",
|
|
2679
|
+
...options
|
|
2680
|
+
});
|
|
2662
2681
|
var deleteApiKeysById = (options) => (options.client ?? client).delete({
|
|
2663
2682
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2664
2683
|
url: "/api-keys/{id}",
|
|
@@ -2852,6 +2871,11 @@ var getEmailRecipientsEmailByOutboundEmailId = (options) => (options.client ?? c
|
|
|
2852
2871
|
url: "/email/recipients/email/{outbound_email_id}",
|
|
2853
2872
|
...options
|
|
2854
2873
|
});
|
|
2874
|
+
var getMemorySectionDocuments = (options) => (options.client ?? client).get({
|
|
2875
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2876
|
+
url: "/memory/section-documents",
|
|
2877
|
+
...options
|
|
2878
|
+
});
|
|
2855
2879
|
var patchStorageFilesByIdRestore = (options) => (options.client ?? client).patch({
|
|
2856
2880
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2857
2881
|
url: "/storage-files/{id}/restore",
|
|
@@ -3612,6 +3636,11 @@ var postInvitations = (options) => (options.client ?? client).post({
|
|
|
3612
3636
|
...options.headers
|
|
3613
3637
|
}
|
|
3614
3638
|
});
|
|
3639
|
+
var getCrmPipelineStagesPipelineByPipelineId = (options) => (options.client ?? client).get({
|
|
3640
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3641
|
+
url: "/crm/pipeline-stages/pipeline/{pipeline_id}",
|
|
3642
|
+
...options
|
|
3643
|
+
});
|
|
3615
3644
|
var patchThreadsByIdArchive = (options) => (options.client ?? client).patch({
|
|
3616
3645
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3617
3646
|
url: "/threads/{id}/archive",
|
|
@@ -4523,6 +4552,15 @@ var getCrmActivitiesById = (options) => (options.client ?? client).get({
|
|
|
4523
4552
|
url: "/crm/activities/{id}",
|
|
4524
4553
|
...options
|
|
4525
4554
|
});
|
|
4555
|
+
var patchCrmActivitiesById = (options) => (options.client ?? client).patch({
|
|
4556
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4557
|
+
url: "/crm/activities/{id}",
|
|
4558
|
+
...options,
|
|
4559
|
+
headers: {
|
|
4560
|
+
"Content-Type": "application/vnd.api+json",
|
|
4561
|
+
...options.headers
|
|
4562
|
+
}
|
|
4563
|
+
});
|
|
4526
4564
|
var postTrainingExamplesSearch = (options) => (options.client ?? client).post({
|
|
4527
4565
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4528
4566
|
url: "/training-examples/search",
|
|
@@ -5409,6 +5447,11 @@ var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client
|
|
|
5409
5447
|
url: "/extraction/documents/workspace/{workspace_id}",
|
|
5410
5448
|
...options
|
|
5411
5449
|
});
|
|
5450
|
+
var getMemoryDocumentSectionsById = (options) => (options.client ?? client).get({
|
|
5451
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5452
|
+
url: "/memory/document-sections/{id}",
|
|
5453
|
+
...options
|
|
5454
|
+
});
|
|
5412
5455
|
var getClinicalDeliveriesById = (options) => (options.client ?? client).get({
|
|
5413
5456
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5414
5457
|
url: "/clinical/deliveries/{id}",
|
|
@@ -5843,6 +5886,15 @@ var patchStorageFilesByIdTag = (options) => (options.client ?? client).patch({
|
|
|
5843
5886
|
...options.headers
|
|
5844
5887
|
}
|
|
5845
5888
|
});
|
|
5889
|
+
var patchCrmDealsByIdMoveStage = (options) => (options.client ?? client).patch({
|
|
5890
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5891
|
+
url: "/crm/deals/{id}/move-stage",
|
|
5892
|
+
...options,
|
|
5893
|
+
headers: {
|
|
5894
|
+
"Content-Type": "application/vnd.api+json",
|
|
5895
|
+
...options.headers
|
|
5896
|
+
}
|
|
5897
|
+
});
|
|
5846
5898
|
var getApiKeys = (options) => (options.client ?? client).get({
|
|
5847
5899
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5848
5900
|
url: "/api-keys",
|
|
@@ -14272,6 +14324,7 @@ function createCrmNamespace(rb) {
|
|
|
14272
14324
|
{
|
|
14273
14325
|
path: { workspace_id: workspaceId },
|
|
14274
14326
|
query: {
|
|
14327
|
+
...options?.name ? { name: options.name } : {},
|
|
14275
14328
|
...options?.status ? { status: options.status } : {},
|
|
14276
14329
|
...options?.filters ? { filters: options.filters } : {},
|
|
14277
14330
|
...options?.tags ? { tags: options.tags } : {},
|
|
@@ -14602,6 +14655,33 @@ function createCrmNamespace(rb) {
|
|
|
14602
14655
|
options
|
|
14603
14656
|
);
|
|
14604
14657
|
},
|
|
14658
|
+
/**
|
|
14659
|
+
* Move a deal to a different pipeline stage.
|
|
14660
|
+
*
|
|
14661
|
+
* @param id - The unique identifier of the deal to move.
|
|
14662
|
+
* @param attributes - Must include `stage_id` (the target stage).
|
|
14663
|
+
* @param options - Optional request-level overrides.
|
|
14664
|
+
* @returns A promise that resolves to the updated {@link CrmDeal}.
|
|
14665
|
+
*
|
|
14666
|
+
* @example
|
|
14667
|
+
* ```typescript
|
|
14668
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
14669
|
+
*
|
|
14670
|
+
* const deal = await client.crm.deals.moveStage('deal_abc123', {
|
|
14671
|
+
* stage_id: 'stage_closed_won',
|
|
14672
|
+
* });
|
|
14673
|
+
* ```
|
|
14674
|
+
*/
|
|
14675
|
+
moveStage: async (id, attributes, options) => {
|
|
14676
|
+
return rb.execute(
|
|
14677
|
+
patchCrmDealsByIdMoveStage,
|
|
14678
|
+
{
|
|
14679
|
+
path: { id },
|
|
14680
|
+
body: { data: { type: "crm_deal", id, attributes } }
|
|
14681
|
+
},
|
|
14682
|
+
options
|
|
14683
|
+
);
|
|
14684
|
+
},
|
|
14605
14685
|
/**
|
|
14606
14686
|
* Permanently delete a deal.
|
|
14607
14687
|
*
|
|
@@ -14712,6 +14792,33 @@ function createCrmNamespace(rb) {
|
|
|
14712
14792
|
options
|
|
14713
14793
|
);
|
|
14714
14794
|
},
|
|
14795
|
+
/**
|
|
14796
|
+
* Update an existing activity's attributes.
|
|
14797
|
+
*
|
|
14798
|
+
* @param id - The unique identifier of the activity to update.
|
|
14799
|
+
* @param attributes - Key/value map of attributes to change.
|
|
14800
|
+
* @param options - Optional request-level overrides.
|
|
14801
|
+
* @returns A promise that resolves to the updated {@link CrmActivity}.
|
|
14802
|
+
*
|
|
14803
|
+
* @example
|
|
14804
|
+
* ```typescript
|
|
14805
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
14806
|
+
*
|
|
14807
|
+
* const activity = await client.crm.activities.update('act_abc123', {
|
|
14808
|
+
* note: 'Updated notes from follow-up call.',
|
|
14809
|
+
* });
|
|
14810
|
+
* ```
|
|
14811
|
+
*/
|
|
14812
|
+
update: async (id, attributes, options) => {
|
|
14813
|
+
return rb.execute(
|
|
14814
|
+
patchCrmActivitiesById,
|
|
14815
|
+
{
|
|
14816
|
+
path: { id },
|
|
14817
|
+
body: { data: { id, type: "crm_activity", attributes } }
|
|
14818
|
+
},
|
|
14819
|
+
options
|
|
14820
|
+
);
|
|
14821
|
+
},
|
|
14715
14822
|
/**
|
|
14716
14823
|
* Permanently delete an activity.
|
|
14717
14824
|
*
|
|
@@ -14998,6 +15105,28 @@ function createCrmNamespace(rb) {
|
|
|
14998
15105
|
{ path: { id } },
|
|
14999
15106
|
options
|
|
15000
15107
|
);
|
|
15108
|
+
},
|
|
15109
|
+
/**
|
|
15110
|
+
* List all stages belonging to a specific pipeline.
|
|
15111
|
+
*
|
|
15112
|
+
* @param pipelineId - The ID of the pipeline whose stages to list.
|
|
15113
|
+
* @param options - Optional request-level overrides.
|
|
15114
|
+
* @returns A promise that resolves to an array of {@link CrmPipelineStage} records.
|
|
15115
|
+
*
|
|
15116
|
+
* @example
|
|
15117
|
+
* ```typescript
|
|
15118
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
15119
|
+
*
|
|
15120
|
+
* const stages = await client.crm.pipelineStages.listByPipeline('pipe_abc123');
|
|
15121
|
+
* stages.forEach((s) => console.log(s.attributes.name, s.attributes.order));
|
|
15122
|
+
* ```
|
|
15123
|
+
*/
|
|
15124
|
+
listByPipeline: async (pipelineId, options) => {
|
|
15125
|
+
return rb.execute(
|
|
15126
|
+
getCrmPipelineStagesPipelineByPipelineId,
|
|
15127
|
+
{ path: { pipeline_id: pipelineId } },
|
|
15128
|
+
options
|
|
15129
|
+
);
|
|
15001
15130
|
}
|
|
15002
15131
|
},
|
|
15003
15132
|
/**
|
|
@@ -19260,7 +19389,7 @@ function createIdentityNamespace(rb, baseUrl) {
|
|
|
19260
19389
|
requestPasswordReset: async (email, options) => {
|
|
19261
19390
|
RequestPasswordResetSchema.parse({ email });
|
|
19262
19391
|
return rb.execute(
|
|
19263
|
-
|
|
19392
|
+
postUsersAuthPasswordResetRequest,
|
|
19264
19393
|
{
|
|
19265
19394
|
body: {
|
|
19266
19395
|
data: { type: "user", attributes: { email } }
|
|
@@ -26482,6 +26611,115 @@ function createRolesNamespace(rb) {
|
|
|
26482
26611
|
};
|
|
26483
26612
|
}
|
|
26484
26613
|
|
|
26614
|
+
// src/namespaces/memory.ts
|
|
26615
|
+
function createMemoryNamespace(rb) {
|
|
26616
|
+
return {
|
|
26617
|
+
/**
|
|
26618
|
+
* Sub-namespace for section document operations.
|
|
26619
|
+
*
|
|
26620
|
+
* A section document represents an indexed source (extraction document,
|
|
26621
|
+
* crawler page, knowledge file, or direct upload). Each section document
|
|
26622
|
+
* contains metadata about the source and links to its document sections.
|
|
26623
|
+
*/
|
|
26624
|
+
sectionDocuments: {
|
|
26625
|
+
/**
|
|
26626
|
+
* Lists section documents in the current workspace.
|
|
26627
|
+
*
|
|
26628
|
+
* Returns paginated results sorted by creation date (newest first).
|
|
26629
|
+
*
|
|
26630
|
+
* @param params - Optional pagination parameters (`page[offset]`, `page[limit]`).
|
|
26631
|
+
* @param options - Optional request options such as custom headers or abort signal.
|
|
26632
|
+
* @returns A promise resolving to an array of section document records.
|
|
26633
|
+
*
|
|
26634
|
+
* @example
|
|
26635
|
+
* ```typescript
|
|
26636
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
26637
|
+
* const docs = await client.memory.sectionDocuments.list();
|
|
26638
|
+
* docs.forEach(d => console.log(d.attributes?.doc_path));
|
|
26639
|
+
* ```
|
|
26640
|
+
*/
|
|
26641
|
+
list: async (params, options) => {
|
|
26642
|
+
return rb.execute(
|
|
26643
|
+
getMemorySectionDocuments,
|
|
26644
|
+
buildPageQuery(params?.page, params?.pageSize),
|
|
26645
|
+
options
|
|
26646
|
+
);
|
|
26647
|
+
},
|
|
26648
|
+
/**
|
|
26649
|
+
* Retrieves a single section document by its unique identifier.
|
|
26650
|
+
*
|
|
26651
|
+
* @param id - The UUID of the section document.
|
|
26652
|
+
* @param options - Optional request options.
|
|
26653
|
+
* @returns A promise resolving to the section document record.
|
|
26654
|
+
*
|
|
26655
|
+
* @example
|
|
26656
|
+
* ```typescript
|
|
26657
|
+
* const doc = await client.memory.sectionDocuments.get('sd_01HXYZ...');
|
|
26658
|
+
* console.log(doc.attributes?.source_type, doc.attributes?.section_count);
|
|
26659
|
+
* ```
|
|
26660
|
+
*/
|
|
26661
|
+
get: async (id, options) => {
|
|
26662
|
+
return rb.execute(
|
|
26663
|
+
getMemorySectionDocumentsById,
|
|
26664
|
+
{ path: { id } },
|
|
26665
|
+
options
|
|
26666
|
+
);
|
|
26667
|
+
}
|
|
26668
|
+
},
|
|
26669
|
+
/**
|
|
26670
|
+
* Sub-namespace for document section operations.
|
|
26671
|
+
*
|
|
26672
|
+
* A document section represents one heading-delimited portion of an
|
|
26673
|
+
* indexed document. Sections have stable IDs that survive re-indexing,
|
|
26674
|
+
* enabling persistent cross-document references.
|
|
26675
|
+
*/
|
|
26676
|
+
documentSections: {
|
|
26677
|
+
/**
|
|
26678
|
+
* Lists document sections in the current workspace.
|
|
26679
|
+
*
|
|
26680
|
+
* Returns paginated results sorted by position within their documents.
|
|
26681
|
+
*
|
|
26682
|
+
* @param params - Optional pagination parameters.
|
|
26683
|
+
* @param options - Optional request options.
|
|
26684
|
+
* @returns A promise resolving to an array of document section records.
|
|
26685
|
+
*
|
|
26686
|
+
* @example
|
|
26687
|
+
* ```typescript
|
|
26688
|
+
* const sections = await client.memory.documentSections.list();
|
|
26689
|
+
* sections.forEach(s => console.log(s.attributes?.title, s.attributes?.level));
|
|
26690
|
+
* ```
|
|
26691
|
+
*/
|
|
26692
|
+
list: async (params, options) => {
|
|
26693
|
+
return rb.execute(
|
|
26694
|
+
getMemoryDocumentSections,
|
|
26695
|
+
buildPageQuery(params?.page, params?.pageSize),
|
|
26696
|
+
options
|
|
26697
|
+
);
|
|
26698
|
+
},
|
|
26699
|
+
/**
|
|
26700
|
+
* Retrieves a single document section by its unique identifier.
|
|
26701
|
+
*
|
|
26702
|
+
* @param id - The UUID of the document section.
|
|
26703
|
+
* @param options - Optional request options.
|
|
26704
|
+
* @returns A promise resolving to the document section record.
|
|
26705
|
+
*
|
|
26706
|
+
* @example
|
|
26707
|
+
* ```typescript
|
|
26708
|
+
* const section = await client.memory.documentSections.get('ds_01HXYZ...');
|
|
26709
|
+
* console.log(section.attributes?.title, section.attributes?.content_preview);
|
|
26710
|
+
* ```
|
|
26711
|
+
*/
|
|
26712
|
+
get: async (id, options) => {
|
|
26713
|
+
return rb.execute(
|
|
26714
|
+
getMemoryDocumentSectionsById,
|
|
26715
|
+
{ path: { id } },
|
|
26716
|
+
options
|
|
26717
|
+
);
|
|
26718
|
+
}
|
|
26719
|
+
}
|
|
26720
|
+
};
|
|
26721
|
+
}
|
|
26722
|
+
|
|
26485
26723
|
// src/namespaces/permissions.ts
|
|
26486
26724
|
function createPermissionsNamespace(rb) {
|
|
26487
26725
|
return {
|
|
@@ -27000,6 +27238,7 @@ var GptClient = class extends BaseClient {
|
|
|
27000
27238
|
this.accessGrants = createAccessGrantsNamespace(rb);
|
|
27001
27239
|
this.roles = createRolesNamespace(rb);
|
|
27002
27240
|
this.permissions = createPermissionsNamespace(rb);
|
|
27241
|
+
this.memory = createMemoryNamespace(rb);
|
|
27003
27242
|
}
|
|
27004
27243
|
/**
|
|
27005
27244
|
* Subscribe to SDK lifecycle events.
|