@gpt-platform/client 0.7.0 → 0.7.1
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 +248 -7
- package/dist/index.d.ts +248 -7
- package/dist/index.js +131 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +131 -1
- package/dist/index.mjs.map +1 -1
- 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.1";
|
|
1337
1337
|
var DEFAULT_API_VERSION = "2026-03-11";
|
|
1338
1338
|
|
|
1339
1339
|
// src/base-client.ts
|
|
@@ -2441,6 +2441,11 @@ var postCrmContacts = (options) => (options.client ?? client).post({
|
|
|
2441
2441
|
...options.headers
|
|
2442
2442
|
}
|
|
2443
2443
|
});
|
|
2444
|
+
var getMemoryDocumentSections = (options) => (options.client ?? client).get({
|
|
2445
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2446
|
+
url: "/memory/document-sections",
|
|
2447
|
+
...options
|
|
2448
|
+
});
|
|
2444
2449
|
var deleteWebhookConfigsById = (options) => (options.client ?? client).delete({
|
|
2445
2450
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2446
2451
|
url: "/webhook-configs/{id}",
|
|
@@ -2659,6 +2664,11 @@ var patchSupportTicketsByIdMerge = (options) => (options.client ?? client).patch
|
|
|
2659
2664
|
...options.headers
|
|
2660
2665
|
}
|
|
2661
2666
|
});
|
|
2667
|
+
var getMemorySectionDocumentsById = (options) => (options.client ?? client).get({
|
|
2668
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2669
|
+
url: "/memory/section-documents/{id}",
|
|
2670
|
+
...options
|
|
2671
|
+
});
|
|
2662
2672
|
var deleteApiKeysById = (options) => (options.client ?? client).delete({
|
|
2663
2673
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2664
2674
|
url: "/api-keys/{id}",
|
|
@@ -2852,6 +2862,11 @@ var getEmailRecipientsEmailByOutboundEmailId = (options) => (options.client ?? c
|
|
|
2852
2862
|
url: "/email/recipients/email/{outbound_email_id}",
|
|
2853
2863
|
...options
|
|
2854
2864
|
});
|
|
2865
|
+
var getMemorySectionDocuments = (options) => (options.client ?? client).get({
|
|
2866
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2867
|
+
url: "/memory/section-documents",
|
|
2868
|
+
...options
|
|
2869
|
+
});
|
|
2855
2870
|
var patchStorageFilesByIdRestore = (options) => (options.client ?? client).patch({
|
|
2856
2871
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2857
2872
|
url: "/storage-files/{id}/restore",
|
|
@@ -5409,6 +5424,11 @@ var getExtractionDocumentsWorkspaceByWorkspaceId = (options) => (options.client
|
|
|
5409
5424
|
url: "/extraction/documents/workspace/{workspace_id}",
|
|
5410
5425
|
...options
|
|
5411
5426
|
});
|
|
5427
|
+
var getMemoryDocumentSectionsById = (options) => (options.client ?? client).get({
|
|
5428
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5429
|
+
url: "/memory/document-sections/{id}",
|
|
5430
|
+
...options
|
|
5431
|
+
});
|
|
5412
5432
|
var getClinicalDeliveriesById = (options) => (options.client ?? client).get({
|
|
5413
5433
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5414
5434
|
url: "/clinical/deliveries/{id}",
|
|
@@ -26482,6 +26502,115 @@ function createRolesNamespace(rb) {
|
|
|
26482
26502
|
};
|
|
26483
26503
|
}
|
|
26484
26504
|
|
|
26505
|
+
// src/namespaces/memory.ts
|
|
26506
|
+
function createMemoryNamespace(rb) {
|
|
26507
|
+
return {
|
|
26508
|
+
/**
|
|
26509
|
+
* Sub-namespace for section document operations.
|
|
26510
|
+
*
|
|
26511
|
+
* A section document represents an indexed source (extraction document,
|
|
26512
|
+
* crawler page, knowledge file, or direct upload). Each section document
|
|
26513
|
+
* contains metadata about the source and links to its document sections.
|
|
26514
|
+
*/
|
|
26515
|
+
sectionDocuments: {
|
|
26516
|
+
/**
|
|
26517
|
+
* Lists section documents in the current workspace.
|
|
26518
|
+
*
|
|
26519
|
+
* Returns paginated results sorted by creation date (newest first).
|
|
26520
|
+
*
|
|
26521
|
+
* @param params - Optional pagination parameters (`page[offset]`, `page[limit]`).
|
|
26522
|
+
* @param options - Optional request options such as custom headers or abort signal.
|
|
26523
|
+
* @returns A promise resolving to an array of section document records.
|
|
26524
|
+
*
|
|
26525
|
+
* @example
|
|
26526
|
+
* ```typescript
|
|
26527
|
+
* const client = new GptClient({ apiKey: 'sk_app_...' });
|
|
26528
|
+
* const docs = await client.memory.sectionDocuments.list();
|
|
26529
|
+
* docs.forEach(d => console.log(d.attributes?.doc_path));
|
|
26530
|
+
* ```
|
|
26531
|
+
*/
|
|
26532
|
+
list: async (params, options) => {
|
|
26533
|
+
return rb.execute(
|
|
26534
|
+
getMemorySectionDocuments,
|
|
26535
|
+
buildPageQuery(params?.page, params?.pageSize),
|
|
26536
|
+
options
|
|
26537
|
+
);
|
|
26538
|
+
},
|
|
26539
|
+
/**
|
|
26540
|
+
* Retrieves a single section document by its unique identifier.
|
|
26541
|
+
*
|
|
26542
|
+
* @param id - The UUID of the section document.
|
|
26543
|
+
* @param options - Optional request options.
|
|
26544
|
+
* @returns A promise resolving to the section document record.
|
|
26545
|
+
*
|
|
26546
|
+
* @example
|
|
26547
|
+
* ```typescript
|
|
26548
|
+
* const doc = await client.memory.sectionDocuments.get('sd_01HXYZ...');
|
|
26549
|
+
* console.log(doc.attributes?.source_type, doc.attributes?.section_count);
|
|
26550
|
+
* ```
|
|
26551
|
+
*/
|
|
26552
|
+
get: async (id, options) => {
|
|
26553
|
+
return rb.execute(
|
|
26554
|
+
getMemorySectionDocumentsById,
|
|
26555
|
+
{ path: { id } },
|
|
26556
|
+
options
|
|
26557
|
+
);
|
|
26558
|
+
}
|
|
26559
|
+
},
|
|
26560
|
+
/**
|
|
26561
|
+
* Sub-namespace for document section operations.
|
|
26562
|
+
*
|
|
26563
|
+
* A document section represents one heading-delimited portion of an
|
|
26564
|
+
* indexed document. Sections have stable IDs that survive re-indexing,
|
|
26565
|
+
* enabling persistent cross-document references.
|
|
26566
|
+
*/
|
|
26567
|
+
documentSections: {
|
|
26568
|
+
/**
|
|
26569
|
+
* Lists document sections in the current workspace.
|
|
26570
|
+
*
|
|
26571
|
+
* Returns paginated results sorted by position within their documents.
|
|
26572
|
+
*
|
|
26573
|
+
* @param params - Optional pagination parameters.
|
|
26574
|
+
* @param options - Optional request options.
|
|
26575
|
+
* @returns A promise resolving to an array of document section records.
|
|
26576
|
+
*
|
|
26577
|
+
* @example
|
|
26578
|
+
* ```typescript
|
|
26579
|
+
* const sections = await client.memory.documentSections.list();
|
|
26580
|
+
* sections.forEach(s => console.log(s.attributes?.title, s.attributes?.level));
|
|
26581
|
+
* ```
|
|
26582
|
+
*/
|
|
26583
|
+
list: async (params, options) => {
|
|
26584
|
+
return rb.execute(
|
|
26585
|
+
getMemoryDocumentSections,
|
|
26586
|
+
buildPageQuery(params?.page, params?.pageSize),
|
|
26587
|
+
options
|
|
26588
|
+
);
|
|
26589
|
+
},
|
|
26590
|
+
/**
|
|
26591
|
+
* Retrieves a single document section by its unique identifier.
|
|
26592
|
+
*
|
|
26593
|
+
* @param id - The UUID of the document section.
|
|
26594
|
+
* @param options - Optional request options.
|
|
26595
|
+
* @returns A promise resolving to the document section record.
|
|
26596
|
+
*
|
|
26597
|
+
* @example
|
|
26598
|
+
* ```typescript
|
|
26599
|
+
* const section = await client.memory.documentSections.get('ds_01HXYZ...');
|
|
26600
|
+
* console.log(section.attributes?.title, section.attributes?.content_preview);
|
|
26601
|
+
* ```
|
|
26602
|
+
*/
|
|
26603
|
+
get: async (id, options) => {
|
|
26604
|
+
return rb.execute(
|
|
26605
|
+
getMemoryDocumentSectionsById,
|
|
26606
|
+
{ path: { id } },
|
|
26607
|
+
options
|
|
26608
|
+
);
|
|
26609
|
+
}
|
|
26610
|
+
}
|
|
26611
|
+
};
|
|
26612
|
+
}
|
|
26613
|
+
|
|
26485
26614
|
// src/namespaces/permissions.ts
|
|
26486
26615
|
function createPermissionsNamespace(rb) {
|
|
26487
26616
|
return {
|
|
@@ -27000,6 +27129,7 @@ var GptClient = class extends BaseClient {
|
|
|
27000
27129
|
this.accessGrants = createAccessGrantsNamespace(rb);
|
|
27001
27130
|
this.roles = createRolesNamespace(rb);
|
|
27002
27131
|
this.permissions = createPermissionsNamespace(rb);
|
|
27132
|
+
this.memory = createMemoryNamespace(rb);
|
|
27003
27133
|
}
|
|
27004
27134
|
/**
|
|
27005
27135
|
* Subscribe to SDK lifecycle events.
|