@gpt-platform/admin 0.10.3 → 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.d.mts +2973 -947
- package/dist/index.d.ts +2973 -947
- package/dist/index.js +1630 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1630 -106
- package/dist/index.mjs.map +1 -1
- package/llms.txt +16 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -814,7 +814,7 @@ var createClient = (config = {}) => {
|
|
|
814
814
|
};
|
|
815
815
|
|
|
816
816
|
// src/version.ts
|
|
817
|
-
var SDK_VERSION = "0.10.
|
|
817
|
+
var SDK_VERSION = "0.10.5";
|
|
818
818
|
var DEFAULT_API_VERSION = "2026-03-23";
|
|
819
819
|
|
|
820
820
|
// src/base-client.ts
|
|
@@ -1276,6 +1276,31 @@ var RequestBuilder = class {
|
|
|
1276
1276
|
throw handleApiError(error);
|
|
1277
1277
|
}
|
|
1278
1278
|
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Execute a raw POST to a custom endpoint that returns flat JSON (no data wrapper).
|
|
1281
|
+
* Unlike rawPost (which unwraps data.data), this returns the response body directly.
|
|
1282
|
+
* Used for hand-written Phoenix controllers like DocumentsController.
|
|
1283
|
+
*/
|
|
1284
|
+
async rawPostDirect(url, body, options) {
|
|
1285
|
+
const headers = buildHeaders(this.getHeaders, options);
|
|
1286
|
+
try {
|
|
1287
|
+
const result = await this.requestWithRetry(
|
|
1288
|
+
() => this.clientInstance.post({
|
|
1289
|
+
url,
|
|
1290
|
+
headers,
|
|
1291
|
+
...body !== void 0 && { body },
|
|
1292
|
+
...options?.signal && { signal: options.signal }
|
|
1293
|
+
})
|
|
1294
|
+
);
|
|
1295
|
+
const { data, error } = result;
|
|
1296
|
+
if (error) {
|
|
1297
|
+
throw handleApiError(enrichError(error, result));
|
|
1298
|
+
}
|
|
1299
|
+
return data;
|
|
1300
|
+
} catch (error) {
|
|
1301
|
+
throw handleApiError(error);
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1279
1304
|
/**
|
|
1280
1305
|
* Execute a raw PATCH request to a custom (non-generated) endpoint.
|
|
1281
1306
|
* Used for endpoints implemented as custom Phoenix controllers.
|
|
@@ -1818,6 +1843,11 @@ var patchAdminClinicalGoalTemplatesCatalogByIdArchive = (options) => (options.cl
|
|
|
1818
1843
|
...options.headers
|
|
1819
1844
|
}
|
|
1820
1845
|
});
|
|
1846
|
+
var getAdminClinicalPatientsByIdMedications = (options) => (options.client ?? client).get({
|
|
1847
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1848
|
+
url: "/admin/clinical/patients/{id}/medications",
|
|
1849
|
+
...options
|
|
1850
|
+
});
|
|
1821
1851
|
var getAdminClinicalHealthMetricsBySession = (options) => (options.client ?? client).get({
|
|
1822
1852
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1823
1853
|
url: "/admin/clinical/health-metrics/by-session",
|
|
@@ -2103,6 +2133,11 @@ var patchAdminIsvCrmEntityTypesById = (options) => (options.client ?? client).pa
|
|
|
2103
2133
|
...options.headers
|
|
2104
2134
|
}
|
|
2105
2135
|
});
|
|
2136
|
+
var getAdminWorkspacesByWorkspaceIdTrainingAnalytics = (options) => (options.client ?? client).get({
|
|
2137
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2138
|
+
url: "/admin/workspaces/{workspace_id}/training/analytics",
|
|
2139
|
+
...options
|
|
2140
|
+
});
|
|
2106
2141
|
var getAdminClinicalMealPlansByPatient = (options) => (options.client ?? client).get({
|
|
2107
2142
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2108
2143
|
url: "/admin/clinical/meal-plans/by-patient",
|
|
@@ -2861,6 +2896,25 @@ var getAdminClinicalPracticeToolsCatalogArchived = (options) => (options.client
|
|
|
2861
2896
|
url: "/admin/clinical/practice-tools/catalog/archived",
|
|
2862
2897
|
...options
|
|
2863
2898
|
});
|
|
2899
|
+
var deleteAdminPostProcessingHooksById = (options) => (options.client ?? client).delete({
|
|
2900
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2901
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2902
|
+
...options
|
|
2903
|
+
});
|
|
2904
|
+
var getAdminPostProcessingHooksById = (options) => (options.client ?? client).get({
|
|
2905
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2906
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2907
|
+
...options
|
|
2908
|
+
});
|
|
2909
|
+
var patchAdminPostProcessingHooksById = (options) => (options.client ?? client).patch({
|
|
2910
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2911
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2912
|
+
...options,
|
|
2913
|
+
headers: {
|
|
2914
|
+
"Content-Type": "application/vnd.api+json",
|
|
2915
|
+
...options.headers
|
|
2916
|
+
}
|
|
2917
|
+
});
|
|
2864
2918
|
var getAdminVoiceRecordingsSessionBySessionId = (options) => (options.client ?? client).get({
|
|
2865
2919
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2866
2920
|
url: "/admin/voice/recordings/session/{session_id}",
|
|
@@ -3087,6 +3141,20 @@ var getAdminClinicalNotesByWorkspace = (options) => (options.client ?? client).g
|
|
|
3087
3141
|
url: "/admin/clinical/notes/by-workspace",
|
|
3088
3142
|
...options
|
|
3089
3143
|
});
|
|
3144
|
+
var getAdminClinicalClientMedications = (options) => (options.client ?? client).get({
|
|
3145
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3146
|
+
url: "/admin/clinical/client-medications",
|
|
3147
|
+
...options
|
|
3148
|
+
});
|
|
3149
|
+
var postAdminClinicalClientMedications = (options) => (options.client ?? client).post({
|
|
3150
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3151
|
+
url: "/admin/clinical/client-medications",
|
|
3152
|
+
...options,
|
|
3153
|
+
headers: {
|
|
3154
|
+
"Content-Type": "application/vnd.api+json",
|
|
3155
|
+
...options.headers
|
|
3156
|
+
}
|
|
3157
|
+
});
|
|
3090
3158
|
var deleteAdminCrmCustomEntitiesById = (options) => (options.client ?? client).delete({
|
|
3091
3159
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3092
3160
|
url: "/admin/crm/custom-entities/{id}",
|
|
@@ -3500,6 +3568,15 @@ var getAdminVoiceSessionsById = (options) => (options.client ?? client).get({
|
|
|
3500
3568
|
url: "/admin/voice/sessions/{id}",
|
|
3501
3569
|
...options
|
|
3502
3570
|
});
|
|
3571
|
+
var patchAdminClinicalClientMedicationsByIdRestore = (options) => (options.client ?? client).patch({
|
|
3572
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3573
|
+
url: "/admin/clinical/client-medications/{id}/restore",
|
|
3574
|
+
...options,
|
|
3575
|
+
headers: {
|
|
3576
|
+
"Content-Type": "application/vnd.api+json",
|
|
3577
|
+
...options.headers
|
|
3578
|
+
}
|
|
3579
|
+
});
|
|
3503
3580
|
var deleteAdminWebhookConfigsById = (options) => (options.client ?? client).delete({
|
|
3504
3581
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3505
3582
|
url: "/admin/webhook-configs/{id}",
|
|
@@ -3996,6 +4073,15 @@ var getAdminEmailMarketingTemplatesWorkspaceByWorkspaceId = (options) => (option
|
|
|
3996
4073
|
url: "/admin/email-marketing/templates/workspace/{workspace_id}",
|
|
3997
4074
|
...options
|
|
3998
4075
|
});
|
|
4076
|
+
var postAdminExtractionAgentsPredict = (options) => (options.client ?? client).post({
|
|
4077
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4078
|
+
url: "/admin/extraction/agents/predict",
|
|
4079
|
+
...options,
|
|
4080
|
+
headers: {
|
|
4081
|
+
"Content-Type": "application/vnd.api+json",
|
|
4082
|
+
...options.headers
|
|
4083
|
+
}
|
|
4084
|
+
});
|
|
3999
4085
|
var postAdminSocialCampaignsByIdGenerateMasterCopy = (options) => (options.client ?? client).post({
|
|
4000
4086
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4001
4087
|
url: "/admin/social/campaigns/{id}/generate-master-copy",
|
|
@@ -4173,6 +4259,11 @@ var patchAdminLegalDocumentsByIdUnpublish = (options) => (options.client ?? clie
|
|
|
4173
4259
|
...options.headers
|
|
4174
4260
|
}
|
|
4175
4261
|
});
|
|
4262
|
+
var getAdminExtractionAgents = (options) => (options.client ?? client).get({
|
|
4263
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4264
|
+
url: "/admin/extraction/agents",
|
|
4265
|
+
...options
|
|
4266
|
+
});
|
|
4176
4267
|
var getAdminWalletUsage = (options) => (options.client ?? client).get({
|
|
4177
4268
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4178
4269
|
url: "/admin/wallet/usage",
|
|
@@ -4805,6 +4896,11 @@ var getAdminAgentVersionRevisionsById = (options) => (options.client ?? client).
|
|
|
4805
4896
|
url: "/admin/agent-version-revisions/{id}",
|
|
4806
4897
|
...options
|
|
4807
4898
|
});
|
|
4899
|
+
var getAdminExtractionAgentsById = (options) => (options.client ?? client).get({
|
|
4900
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4901
|
+
url: "/admin/extraction/agents/{id}",
|
|
4902
|
+
...options
|
|
4903
|
+
});
|
|
4808
4904
|
var getAdminSchedulingEventsByDateRange = (options) => (options.client ?? client).get({
|
|
4809
4905
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4810
4906
|
url: "/admin/scheduling/events/by_date_range",
|
|
@@ -4825,6 +4921,11 @@ var getAdminAgentVersionRevisions = (options) => (options.client ?? client).get(
|
|
|
4825
4921
|
url: "/admin/agent-version-revisions",
|
|
4826
4922
|
...options
|
|
4827
4923
|
});
|
|
4924
|
+
var deleteAdminClinicalClientMedicationsByIdPermanent = (options) => (options.client ?? client).delete({
|
|
4925
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4926
|
+
url: "/admin/clinical/client-medications/{id}/permanent",
|
|
4927
|
+
...options
|
|
4928
|
+
});
|
|
4828
4929
|
var getAdminAgentTools = (options) => (options.client ?? client).get({
|
|
4829
4930
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4830
4931
|
url: "/admin/agent-tools",
|
|
@@ -4953,6 +5054,11 @@ var postAdminWebhookConfigs = (options) => (options.client ?? client).post({
|
|
|
4953
5054
|
...options.headers
|
|
4954
5055
|
}
|
|
4955
5056
|
});
|
|
5057
|
+
var getAdminWorkspacesAnalyticsBatch = (options) => (options.client ?? client).get({
|
|
5058
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5059
|
+
url: "/admin/workspaces/analytics-batch",
|
|
5060
|
+
...options
|
|
5061
|
+
});
|
|
4956
5062
|
var getAdminExtractionConfigEnums = (options) => (options.client ?? client).get({
|
|
4957
5063
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4958
5064
|
url: "/admin/extraction/config-enums",
|
|
@@ -5441,6 +5547,20 @@ var postAdminClinicalGoalTemplatesFromExisting = (options) => (options.client ??
|
|
|
5441
5547
|
...options.headers
|
|
5442
5548
|
}
|
|
5443
5549
|
});
|
|
5550
|
+
var getAdminClinicalClientMedicationsById = (options) => (options.client ?? client).get({
|
|
5551
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5552
|
+
url: "/admin/clinical/client-medications/{id}",
|
|
5553
|
+
...options
|
|
5554
|
+
});
|
|
5555
|
+
var patchAdminClinicalClientMedicationsById = (options) => (options.client ?? client).patch({
|
|
5556
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5557
|
+
url: "/admin/clinical/client-medications/{id}",
|
|
5558
|
+
...options,
|
|
5559
|
+
headers: {
|
|
5560
|
+
"Content-Type": "application/vnd.api+json",
|
|
5561
|
+
...options.headers
|
|
5562
|
+
}
|
|
5563
|
+
});
|
|
5444
5564
|
var getAdminThreadsStats = (options) => (options.client ?? client).get({
|
|
5445
5565
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5446
5566
|
url: "/admin/threads/stats",
|
|
@@ -5988,6 +6108,15 @@ var postAdminEmailMarketingTemplatesCompile = (options) => (options.client ?? cl
|
|
|
5988
6108
|
...options.headers
|
|
5989
6109
|
}
|
|
5990
6110
|
});
|
|
6111
|
+
var postAdminSocialCampaignsByIdPreviewAdaptations = (options) => (options.client ?? client).post({
|
|
6112
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6113
|
+
url: "/admin/social/campaigns/{id}/preview-adaptations",
|
|
6114
|
+
...options,
|
|
6115
|
+
headers: {
|
|
6116
|
+
"Content-Type": "application/vnd.api+json",
|
|
6117
|
+
...options.headers
|
|
6118
|
+
}
|
|
6119
|
+
});
|
|
5991
6120
|
var getAdminClinicalNotesArchived = (options) => (options.client ?? client).get({
|
|
5992
6121
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5993
6122
|
url: "/admin/clinical/notes/archived",
|
|
@@ -6607,6 +6736,20 @@ var patchAdminCrawlerSchedulesByIdEnable = (options) => (options.client ?? clien
|
|
|
6607
6736
|
...options.headers
|
|
6608
6737
|
}
|
|
6609
6738
|
});
|
|
6739
|
+
var getAdminPostProcessingHooks = (options) => (options.client ?? client).get({
|
|
6740
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6741
|
+
url: "/admin/post-processing-hooks",
|
|
6742
|
+
...options
|
|
6743
|
+
});
|
|
6744
|
+
var postAdminPostProcessingHooks = (options) => (options.client ?? client).post({
|
|
6745
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6746
|
+
url: "/admin/post-processing-hooks",
|
|
6747
|
+
...options,
|
|
6748
|
+
headers: {
|
|
6749
|
+
"Content-Type": "application/vnd.api+json",
|
|
6750
|
+
...options.headers
|
|
6751
|
+
}
|
|
6752
|
+
});
|
|
6610
6753
|
var postAdminAgentsByIdAnalyzeTraining = (options) => (options.client ?? client).post({
|
|
6611
6754
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6612
6755
|
url: "/admin/agents/{id}/analyze-training",
|
|
@@ -7228,6 +7371,20 @@ var getAdminClinicalPracticeToolsCategoriesCatalog = (options) => (options.clien
|
|
|
7228
7371
|
url: "/admin/clinical/practice-tools/categories/catalog",
|
|
7229
7372
|
...options
|
|
7230
7373
|
});
|
|
7374
|
+
var patchAdminClinicalClientMedicationsByIdArchive = (options) => (options.client ?? client).patch({
|
|
7375
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7376
|
+
url: "/admin/clinical/client-medications/{id}/archive",
|
|
7377
|
+
...options,
|
|
7378
|
+
headers: {
|
|
7379
|
+
"Content-Type": "application/vnd.api+json",
|
|
7380
|
+
...options.headers
|
|
7381
|
+
}
|
|
7382
|
+
});
|
|
7383
|
+
var getAdminClinicalClientMedicationsArchived = (options) => (options.client ?? client).get({
|
|
7384
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7385
|
+
url: "/admin/clinical/client-medications/archived",
|
|
7386
|
+
...options
|
|
7387
|
+
});
|
|
7231
7388
|
var getAdminVoiceRecordings = (options) => (options.client ?? client).get({
|
|
7232
7389
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7233
7390
|
url: "/admin/voice/recordings",
|
|
@@ -9756,6 +9913,21 @@ function createStorageNamespace(rb) {
|
|
|
9756
9913
|
{ query: { parent_id: parentId } },
|
|
9757
9914
|
options
|
|
9758
9915
|
);
|
|
9916
|
+
},
|
|
9917
|
+
/**
|
|
9918
|
+
* Generate a short-lived presigned download URL for a file.
|
|
9919
|
+
*
|
|
9920
|
+
* @param id - The UUID of the file to download.
|
|
9921
|
+
* @param params - Optional parameters (e.g., custom `expires_in` seconds).
|
|
9922
|
+
* @param options - Optional request options.
|
|
9923
|
+
* @returns A promise resolving to the presigned URL and its expiry.
|
|
9924
|
+
*/
|
|
9925
|
+
requestDownloadUrl: async (id, params, options) => {
|
|
9926
|
+
return rb.rawPostDirect(
|
|
9927
|
+
`/isv/storage-files/${id}/download-url`,
|
|
9928
|
+
params?.expires_in != null ? { data: { expires_in: params.expires_in } } : void 0,
|
|
9929
|
+
options
|
|
9930
|
+
);
|
|
9759
9931
|
}
|
|
9760
9932
|
},
|
|
9761
9933
|
/**
|
|
@@ -13344,6 +13516,32 @@ function createSocialNamespace(rb) {
|
|
|
13344
13516
|
},
|
|
13345
13517
|
options
|
|
13346
13518
|
);
|
|
13519
|
+
},
|
|
13520
|
+
/**
|
|
13521
|
+
* Preview adapted copy per platform without creating SocialPost records.
|
|
13522
|
+
*
|
|
13523
|
+
* Returns the AI-adapted text for each target platform so the user can
|
|
13524
|
+
* review before committing via `adaptForPlatforms`.
|
|
13525
|
+
*
|
|
13526
|
+
* @param id - Campaign UUID.
|
|
13527
|
+
* @param workspaceId - Workspace UUID.
|
|
13528
|
+
* @param options - Optional request options.
|
|
13529
|
+
* @returns `{ adaptations: [{ platform: string, content: string }] }`
|
|
13530
|
+
*/
|
|
13531
|
+
previewAdaptations: async (id, workspaceId, options) => {
|
|
13532
|
+
return rb.execute(
|
|
13533
|
+
postAdminSocialCampaignsByIdPreviewAdaptations,
|
|
13534
|
+
{
|
|
13535
|
+
path: { id },
|
|
13536
|
+
body: {
|
|
13537
|
+
data: {
|
|
13538
|
+
campaign_id: id,
|
|
13539
|
+
workspace_id: workspaceId
|
|
13540
|
+
}
|
|
13541
|
+
}
|
|
13542
|
+
},
|
|
13543
|
+
options
|
|
13544
|
+
);
|
|
13347
13545
|
}
|
|
13348
13546
|
},
|
|
13349
13547
|
/** Trending content discovery — snapshots, items, and watch alerts. */
|
|
@@ -13946,7 +14144,17 @@ function createExtractionNamespace(rb) {
|
|
|
13946
14144
|
return {
|
|
13947
14145
|
/** Document lifecycle — upload, process, review, train, bulk operations. */
|
|
13948
14146
|
documents: {
|
|
13949
|
-
/**
|
|
14147
|
+
/**
|
|
14148
|
+
* Lists all extraction documents across the platform.
|
|
14149
|
+
*
|
|
14150
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14151
|
+
* @returns An array of extraction document objects.
|
|
14152
|
+
*
|
|
14153
|
+
* @example
|
|
14154
|
+
* ```typescript
|
|
14155
|
+
* const docs = await admin.extraction.documents.list();
|
|
14156
|
+
* ```
|
|
14157
|
+
*/
|
|
13950
14158
|
list: async (options) => {
|
|
13951
14159
|
return rb.execute(
|
|
13952
14160
|
getAdminExtractionDocuments,
|
|
@@ -13954,7 +14162,19 @@ function createExtractionNamespace(rb) {
|
|
|
13954
14162
|
options
|
|
13955
14163
|
);
|
|
13956
14164
|
},
|
|
13957
|
-
/**
|
|
14165
|
+
/**
|
|
14166
|
+
* Retrieves a single extraction document by its unique identifier.
|
|
14167
|
+
*
|
|
14168
|
+
* @param id - The UUID of the document to retrieve.
|
|
14169
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14170
|
+
* @returns The matching extraction document object.
|
|
14171
|
+
*
|
|
14172
|
+
* @example
|
|
14173
|
+
* ```typescript
|
|
14174
|
+
* const doc = await admin.extraction.documents.get('doc-uuid');
|
|
14175
|
+
* console.log(doc.status, doc.filename);
|
|
14176
|
+
* ```
|
|
14177
|
+
*/
|
|
13958
14178
|
get: async (id, options) => {
|
|
13959
14179
|
return rb.execute(
|
|
13960
14180
|
getAdminExtractionDocumentsById,
|
|
@@ -13962,7 +14182,18 @@ function createExtractionNamespace(rb) {
|
|
|
13962
14182
|
options
|
|
13963
14183
|
);
|
|
13964
14184
|
},
|
|
13965
|
-
/**
|
|
14185
|
+
/**
|
|
14186
|
+
* Permanently deletes an extraction document and its associated results.
|
|
14187
|
+
*
|
|
14188
|
+
* @param id - The UUID of the document to delete.
|
|
14189
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14190
|
+
* @returns `true` when the deletion succeeds.
|
|
14191
|
+
*
|
|
14192
|
+
* @example
|
|
14193
|
+
* ```typescript
|
|
14194
|
+
* await admin.extraction.documents.delete('doc-uuid');
|
|
14195
|
+
* ```
|
|
14196
|
+
*/
|
|
13966
14197
|
delete: async (id, options) => {
|
|
13967
14198
|
return rb.executeDelete(
|
|
13968
14199
|
deleteAdminExtractionDocumentsById,
|
|
@@ -13970,7 +14201,19 @@ function createExtractionNamespace(rb) {
|
|
|
13970
14201
|
options
|
|
13971
14202
|
);
|
|
13972
14203
|
},
|
|
13973
|
-
/**
|
|
14204
|
+
/**
|
|
14205
|
+
* Retrieves the rendered view of a document, including page images and
|
|
14206
|
+
* overlay data for visual inspection.
|
|
14207
|
+
*
|
|
14208
|
+
* @param id - The UUID of the document.
|
|
14209
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14210
|
+
* @returns The document object with rendered view data.
|
|
14211
|
+
*
|
|
14212
|
+
* @example
|
|
14213
|
+
* ```typescript
|
|
14214
|
+
* const view = await admin.extraction.documents.view('doc-uuid');
|
|
14215
|
+
* ```
|
|
14216
|
+
*/
|
|
13974
14217
|
view: async (id, options) => {
|
|
13975
14218
|
return rb.execute(
|
|
13976
14219
|
getAdminExtractionDocumentsByIdView,
|
|
@@ -13978,7 +14221,20 @@ function createExtractionNamespace(rb) {
|
|
|
13978
14221
|
options
|
|
13979
14222
|
);
|
|
13980
14223
|
},
|
|
13981
|
-
/**
|
|
14224
|
+
/**
|
|
14225
|
+
* Retrieves the current processing status of a document, including
|
|
14226
|
+
* progress percentage and any error details.
|
|
14227
|
+
*
|
|
14228
|
+
* @param id - The UUID of the document.
|
|
14229
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14230
|
+
* @returns The document object with current status fields.
|
|
14231
|
+
*
|
|
14232
|
+
* @example
|
|
14233
|
+
* ```typescript
|
|
14234
|
+
* const { status, progress_percent } = await admin.extraction.documents.status('doc-uuid');
|
|
14235
|
+
* console.log(`Status: ${status} (${progress_percent}%)`);
|
|
14236
|
+
* ```
|
|
14237
|
+
*/
|
|
13982
14238
|
status: async (id, options) => {
|
|
13983
14239
|
return rb.execute(
|
|
13984
14240
|
getAdminExtractionDocumentsByIdStatus,
|
|
@@ -13986,7 +14242,22 @@ function createExtractionNamespace(rb) {
|
|
|
13986
14242
|
options
|
|
13987
14243
|
);
|
|
13988
14244
|
},
|
|
13989
|
-
/**
|
|
14245
|
+
/**
|
|
14246
|
+
* Updates the processing status of a document. Used by admin tooling to
|
|
14247
|
+
* manually transition a document between pipeline states.
|
|
14248
|
+
*
|
|
14249
|
+
* @param id - The UUID of the document to update.
|
|
14250
|
+
* @param attributes - The status attributes to set.
|
|
14251
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14252
|
+
* @returns The updated extraction document object.
|
|
14253
|
+
*
|
|
14254
|
+
* @example
|
|
14255
|
+
* ```typescript
|
|
14256
|
+
* const doc = await admin.extraction.documents.updateStatus('doc-uuid', {
|
|
14257
|
+
* status: 'completed',
|
|
14258
|
+
* });
|
|
14259
|
+
* ```
|
|
14260
|
+
*/
|
|
13990
14261
|
updateStatus: async (id, attributes, options) => {
|
|
13991
14262
|
return rb.execute(
|
|
13992
14263
|
patchAdminExtractionDocumentsByIdStatus,
|
|
@@ -13999,7 +14270,20 @@ function createExtractionNamespace(rb) {
|
|
|
13999
14270
|
options
|
|
14000
14271
|
);
|
|
14001
14272
|
},
|
|
14002
|
-
/**
|
|
14273
|
+
/**
|
|
14274
|
+
* Reprocesses a completed or failed document through the extraction
|
|
14275
|
+
* pipeline from scratch.
|
|
14276
|
+
*
|
|
14277
|
+
* @param id - The UUID of the document to reprocess.
|
|
14278
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14279
|
+
* @returns The document object with its new processing status.
|
|
14280
|
+
*
|
|
14281
|
+
* @example
|
|
14282
|
+
* ```typescript
|
|
14283
|
+
* const doc = await admin.extraction.documents.reprocess('doc-uuid');
|
|
14284
|
+
* console.log(`Reprocessing: ${doc.status}`);
|
|
14285
|
+
* ```
|
|
14286
|
+
*/
|
|
14003
14287
|
reprocess: async (id, options) => {
|
|
14004
14288
|
return rb.execute(
|
|
14005
14289
|
patchAdminExtractionDocumentsByIdReprocess,
|
|
@@ -14007,7 +14291,18 @@ function createExtractionNamespace(rb) {
|
|
|
14007
14291
|
options
|
|
14008
14292
|
);
|
|
14009
14293
|
},
|
|
14010
|
-
/**
|
|
14294
|
+
/**
|
|
14295
|
+
* Cancels a document that is currently queued or being processed.
|
|
14296
|
+
*
|
|
14297
|
+
* @param id - The UUID of the document to cancel.
|
|
14298
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14299
|
+
* @returns The document object with its updated (cancelled) status.
|
|
14300
|
+
*
|
|
14301
|
+
* @example
|
|
14302
|
+
* ```typescript
|
|
14303
|
+
* const doc = await admin.extraction.documents.cancel('doc-uuid');
|
|
14304
|
+
* ```
|
|
14305
|
+
*/
|
|
14011
14306
|
cancel: async (id, options) => {
|
|
14012
14307
|
return rb.execute(
|
|
14013
14308
|
patchAdminExtractionDocumentsByIdCancel,
|
|
@@ -14015,7 +14310,19 @@ function createExtractionNamespace(rb) {
|
|
|
14015
14310
|
options
|
|
14016
14311
|
);
|
|
14017
14312
|
},
|
|
14018
|
-
/**
|
|
14313
|
+
/**
|
|
14314
|
+
* Dismisses a document from the review queue without changing its
|
|
14315
|
+
* underlying data or verification status.
|
|
14316
|
+
*
|
|
14317
|
+
* @param id - The UUID of the document to dismiss.
|
|
14318
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14319
|
+
* @returns The updated extraction document object.
|
|
14320
|
+
*
|
|
14321
|
+
* @example
|
|
14322
|
+
* ```typescript
|
|
14323
|
+
* await admin.extraction.documents.dismiss('doc-uuid');
|
|
14324
|
+
* ```
|
|
14325
|
+
*/
|
|
14019
14326
|
dismiss: async (id, options) => {
|
|
14020
14327
|
return rb.execute(
|
|
14021
14328
|
patchAdminExtractionDocumentsByIdDismiss,
|
|
@@ -14023,7 +14330,19 @@ function createExtractionNamespace(rb) {
|
|
|
14023
14330
|
options
|
|
14024
14331
|
);
|
|
14025
14332
|
},
|
|
14026
|
-
/**
|
|
14333
|
+
/**
|
|
14334
|
+
* Excludes a document from the training dataset. Excluded documents are
|
|
14335
|
+
* not used when retraining extraction models.
|
|
14336
|
+
*
|
|
14337
|
+
* @param id - The UUID of the document to exclude.
|
|
14338
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14339
|
+
* @returns The updated extraction document object.
|
|
14340
|
+
*
|
|
14341
|
+
* @example
|
|
14342
|
+
* ```typescript
|
|
14343
|
+
* await admin.extraction.documents.exclude('doc-uuid');
|
|
14344
|
+
* ```
|
|
14345
|
+
*/
|
|
14027
14346
|
exclude: async (id, options) => {
|
|
14028
14347
|
return rb.execute(
|
|
14029
14348
|
patchAdminExtractionDocumentsByIdExclude,
|
|
@@ -14031,7 +14350,18 @@ function createExtractionNamespace(rb) {
|
|
|
14031
14350
|
options
|
|
14032
14351
|
);
|
|
14033
14352
|
},
|
|
14034
|
-
/**
|
|
14353
|
+
/**
|
|
14354
|
+
* Re-includes a previously excluded document in the training dataset.
|
|
14355
|
+
*
|
|
14356
|
+
* @param id - The UUID of the document to include.
|
|
14357
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14358
|
+
* @returns The updated extraction document object.
|
|
14359
|
+
*
|
|
14360
|
+
* @example
|
|
14361
|
+
* ```typescript
|
|
14362
|
+
* await admin.extraction.documents.include('doc-uuid');
|
|
14363
|
+
* ```
|
|
14364
|
+
*/
|
|
14035
14365
|
include: async (id, options) => {
|
|
14036
14366
|
return rb.execute(
|
|
14037
14367
|
patchAdminExtractionDocumentsByIdInclude,
|
|
@@ -14039,7 +14369,19 @@ function createExtractionNamespace(rb) {
|
|
|
14039
14369
|
options
|
|
14040
14370
|
);
|
|
14041
14371
|
},
|
|
14042
|
-
/**
|
|
14372
|
+
/**
|
|
14373
|
+
* Restores a soft-deleted (trashed) document back to active status.
|
|
14374
|
+
*
|
|
14375
|
+
* @param id - The UUID of the document to restore.
|
|
14376
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14377
|
+
* @returns The restored extraction document object.
|
|
14378
|
+
*
|
|
14379
|
+
* @example
|
|
14380
|
+
* ```typescript
|
|
14381
|
+
* const doc = await admin.extraction.documents.restore('doc-uuid');
|
|
14382
|
+
* console.log(`Restored: ${doc.filename}`);
|
|
14383
|
+
* ```
|
|
14384
|
+
*/
|
|
14043
14385
|
restore: async (id, options) => {
|
|
14044
14386
|
return rb.execute(
|
|
14045
14387
|
patchAdminExtractionDocumentsByIdRestore,
|
|
@@ -14047,7 +14389,23 @@ function createExtractionNamespace(rb) {
|
|
|
14047
14389
|
options
|
|
14048
14390
|
);
|
|
14049
14391
|
},
|
|
14050
|
-
/**
|
|
14392
|
+
/**
|
|
14393
|
+
* Updates the verification status of a document. Used during the human
|
|
14394
|
+
* review step to confirm or reject extracted data.
|
|
14395
|
+
*
|
|
14396
|
+
* @param id - The UUID of the document to update.
|
|
14397
|
+
* @param attributes - Verification attributes to set.
|
|
14398
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14399
|
+
* @returns The updated extraction document object.
|
|
14400
|
+
*
|
|
14401
|
+
* @example
|
|
14402
|
+
* ```typescript
|
|
14403
|
+
* const doc = await admin.extraction.documents.updateVerification('doc-uuid', {
|
|
14404
|
+
* verification_status: 'verified',
|
|
14405
|
+
* avg_confidence: 0.95,
|
|
14406
|
+
* });
|
|
14407
|
+
* ```
|
|
14408
|
+
*/
|
|
14051
14409
|
updateVerification: async (id, attributes, options) => {
|
|
14052
14410
|
return rb.execute(
|
|
14053
14411
|
patchAdminExtractionDocumentsByIdVerification,
|
|
@@ -14060,7 +14418,19 @@ function createExtractionNamespace(rb) {
|
|
|
14060
14418
|
options
|
|
14061
14419
|
);
|
|
14062
14420
|
},
|
|
14063
|
-
/**
|
|
14421
|
+
/**
|
|
14422
|
+
* Marks a document as trained, indicating its extraction results have been
|
|
14423
|
+
* incorporated into the model training set.
|
|
14424
|
+
*
|
|
14425
|
+
* @param id - The UUID of the document to mark as trained.
|
|
14426
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14427
|
+
* @returns The updated extraction document object.
|
|
14428
|
+
*
|
|
14429
|
+
* @example
|
|
14430
|
+
* ```typescript
|
|
14431
|
+
* await admin.extraction.documents.markTrained('doc-uuid');
|
|
14432
|
+
* ```
|
|
14433
|
+
*/
|
|
14064
14434
|
markTrained: async (id, options) => {
|
|
14065
14435
|
return rb.execute(
|
|
14066
14436
|
patchAdminExtractionDocumentsByIdMarkTrained,
|
|
@@ -14068,7 +14438,19 @@ function createExtractionNamespace(rb) {
|
|
|
14068
14438
|
options
|
|
14069
14439
|
);
|
|
14070
14440
|
},
|
|
14071
|
-
/**
|
|
14441
|
+
/**
|
|
14442
|
+
* Dismisses the training flag on a document without un-training it.
|
|
14443
|
+
* Useful for clearing training notifications in the review UI.
|
|
14444
|
+
*
|
|
14445
|
+
* @param id - The UUID of the document.
|
|
14446
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14447
|
+
* @returns The updated extraction document object.
|
|
14448
|
+
*
|
|
14449
|
+
* @example
|
|
14450
|
+
* ```typescript
|
|
14451
|
+
* await admin.extraction.documents.dismissTraining('doc-uuid');
|
|
14452
|
+
* ```
|
|
14453
|
+
*/
|
|
14072
14454
|
dismissTraining: async (id, options) => {
|
|
14073
14455
|
return rb.execute(
|
|
14074
14456
|
patchAdminExtractionDocumentsByIdDismissTraining,
|
|
@@ -14076,7 +14458,19 @@ function createExtractionNamespace(rb) {
|
|
|
14076
14458
|
options
|
|
14077
14459
|
);
|
|
14078
14460
|
},
|
|
14079
|
-
/**
|
|
14461
|
+
/**
|
|
14462
|
+
* Signals the server that a multi-part upload has completed and the
|
|
14463
|
+
* document is ready for processing.
|
|
14464
|
+
*
|
|
14465
|
+
* @param id - The UUID of the document whose upload is being finalized.
|
|
14466
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14467
|
+
* @returns The document object transitioned to processing state.
|
|
14468
|
+
*
|
|
14469
|
+
* @example
|
|
14470
|
+
* ```typescript
|
|
14471
|
+
* await admin.extraction.documents.finishUpload('doc-uuid');
|
|
14472
|
+
* ```
|
|
14473
|
+
*/
|
|
14080
14474
|
finishUpload: async (id, options) => {
|
|
14081
14475
|
return rb.execute(
|
|
14082
14476
|
patchAdminExtractionDocumentsByIdFinishUpload,
|
|
@@ -14084,31 +14478,82 @@ function createExtractionNamespace(rb) {
|
|
|
14084
14478
|
options
|
|
14085
14479
|
);
|
|
14086
14480
|
},
|
|
14087
|
-
/**
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14481
|
+
/**
|
|
14482
|
+
* Begins a new document upload and returns a presigned URL for direct
|
|
14483
|
+
* browser-to-storage upload.
|
|
14484
|
+
*
|
|
14485
|
+
* @param attributes - Upload attributes including the filename and optional metadata.
|
|
14486
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14487
|
+
* @returns A presigned URL object for uploading the file.
|
|
14488
|
+
*
|
|
14489
|
+
* @example
|
|
14490
|
+
* ```typescript
|
|
14491
|
+
* const presigned = await admin.extraction.documents.beginUpload({
|
|
14492
|
+
* filename: 'invoice-2026.pdf',
|
|
14493
|
+
* content_type: 'application/pdf',
|
|
14494
|
+
* agent_id: 'agent-uuid',
|
|
14495
|
+
* workspace_id: 'ws-uuid',
|
|
14496
|
+
* });
|
|
14497
|
+
* // Upload file to presigned.upload_url
|
|
14498
|
+
* ```
|
|
14499
|
+
*/
|
|
14500
|
+
beginUpload: async (attributes, options) => {
|
|
14501
|
+
return rb.execute(
|
|
14502
|
+
postAdminExtractionDocumentsBeginUpload,
|
|
14503
|
+
{
|
|
14504
|
+
body: {
|
|
14505
|
+
data: { type: "extraction-document", attributes }
|
|
14506
|
+
}
|
|
14095
14507
|
},
|
|
14096
14508
|
options
|
|
14097
14509
|
);
|
|
14098
14510
|
},
|
|
14099
|
-
/**
|
|
14511
|
+
/**
|
|
14512
|
+
* Finds an existing document by file hash (for deduplication) or begins a
|
|
14513
|
+
* new upload if no match is found.
|
|
14514
|
+
*
|
|
14515
|
+
* @param attributes - Attributes for finding or beginning the upload.
|
|
14516
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14517
|
+
* @returns A presigned URL object (or a reference to the existing document).
|
|
14518
|
+
*
|
|
14519
|
+
* @example
|
|
14520
|
+
* ```typescript
|
|
14521
|
+
* const result = await admin.extraction.documents.findOrBeginUpload({
|
|
14522
|
+
* file_hash: 'sha256:abc123...',
|
|
14523
|
+
* filename: 'invoice-2026.pdf',
|
|
14524
|
+
* content_type: 'application/pdf',
|
|
14525
|
+
* });
|
|
14526
|
+
* ```
|
|
14527
|
+
*/
|
|
14100
14528
|
findOrBeginUpload: async (attributes, options) => {
|
|
14101
14529
|
return rb.execute(
|
|
14102
14530
|
postAdminExtractionDocumentsFindOrBeginUpload,
|
|
14103
14531
|
{
|
|
14104
14532
|
body: {
|
|
14105
|
-
data: { type: "
|
|
14533
|
+
data: { type: "extraction-document", attributes }
|
|
14106
14534
|
}
|
|
14107
14535
|
},
|
|
14108
14536
|
options
|
|
14109
14537
|
);
|
|
14110
14538
|
},
|
|
14111
|
-
/**
|
|
14539
|
+
/**
|
|
14540
|
+
* Uploads a document directly in a single shot. The server handles storage
|
|
14541
|
+
* placement and immediately enqueues the document for processing.
|
|
14542
|
+
*
|
|
14543
|
+
* @param attributes - Upload attributes including filename and optional storage path.
|
|
14544
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14545
|
+
* @returns The created extraction document object.
|
|
14546
|
+
*
|
|
14547
|
+
* @example
|
|
14548
|
+
* ```typescript
|
|
14549
|
+
* const doc = await admin.extraction.documents.upload({
|
|
14550
|
+
* filename: 'contract.pdf',
|
|
14551
|
+
* content_type: 'application/pdf',
|
|
14552
|
+
* agent_id: 'agent-uuid',
|
|
14553
|
+
* workspace_id: 'ws-uuid',
|
|
14554
|
+
* });
|
|
14555
|
+
* ```
|
|
14556
|
+
*/
|
|
14112
14557
|
upload: async (attributes, options) => {
|
|
14113
14558
|
return rb.execute(
|
|
14114
14559
|
postAdminExtractionDocumentsUpload,
|
|
@@ -14120,7 +14565,22 @@ function createExtractionNamespace(rb) {
|
|
|
14120
14565
|
options
|
|
14121
14566
|
);
|
|
14122
14567
|
},
|
|
14123
|
-
/**
|
|
14568
|
+
/**
|
|
14569
|
+
* Reprocesses multiple documents in a single bulk operation.
|
|
14570
|
+
*
|
|
14571
|
+
* @param ids - An array of document UUIDs to reprocess.
|
|
14572
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14573
|
+
* @returns An operation success result with the count of enqueued documents.
|
|
14574
|
+
*
|
|
14575
|
+
* @example
|
|
14576
|
+
* ```typescript
|
|
14577
|
+
* const result = await admin.extraction.documents.bulkReprocess([
|
|
14578
|
+
* 'doc-uuid-1',
|
|
14579
|
+
* 'doc-uuid-2',
|
|
14580
|
+
* ]);
|
|
14581
|
+
* console.log(`Enqueued: ${result.enqueued_count}`);
|
|
14582
|
+
* ```
|
|
14583
|
+
*/
|
|
14124
14584
|
bulkReprocess: async (ids, options) => {
|
|
14125
14585
|
return rb.execute(
|
|
14126
14586
|
postAdminExtractionDocumentsBulkReprocess,
|
|
@@ -14128,30 +14588,67 @@ function createExtractionNamespace(rb) {
|
|
|
14128
14588
|
body: {
|
|
14129
14589
|
data: {
|
|
14130
14590
|
type: "bulk-reprocess-result",
|
|
14131
|
-
attributes: { ids }
|
|
14591
|
+
attributes: { document_ids: ids }
|
|
14132
14592
|
}
|
|
14133
14593
|
}
|
|
14134
14594
|
},
|
|
14135
14595
|
options
|
|
14136
14596
|
);
|
|
14137
14597
|
},
|
|
14138
|
-
/**
|
|
14598
|
+
/**
|
|
14599
|
+
* Permanently deletes multiple documents in a single bulk operation.
|
|
14600
|
+
*
|
|
14601
|
+
* @param ids - An array of document UUIDs to delete.
|
|
14602
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14603
|
+
* @returns An operation success result with the count of deleted documents.
|
|
14604
|
+
*
|
|
14605
|
+
* @example
|
|
14606
|
+
* ```typescript
|
|
14607
|
+
* const result = await admin.extraction.documents.bulkDelete([
|
|
14608
|
+
* 'doc-uuid-1',
|
|
14609
|
+
* 'doc-uuid-2',
|
|
14610
|
+
* ]);
|
|
14611
|
+
* console.log(`Deleted: ${result.deleted_count}`);
|
|
14612
|
+
* ```
|
|
14613
|
+
*/
|
|
14139
14614
|
bulkDelete: async (ids, options) => {
|
|
14140
14615
|
return rb.execute(
|
|
14141
14616
|
postAdminDocumentsBulkDelete,
|
|
14142
14617
|
{
|
|
14143
14618
|
body: {
|
|
14144
|
-
data: { type: "
|
|
14619
|
+
data: { type: "operation-success", attributes: { ids } }
|
|
14145
14620
|
}
|
|
14146
14621
|
},
|
|
14147
14622
|
options
|
|
14148
14623
|
);
|
|
14149
14624
|
},
|
|
14150
|
-
/**
|
|
14625
|
+
/**
|
|
14626
|
+
* Retrieves platform-wide document statistics including counts by status.
|
|
14627
|
+
*
|
|
14628
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14629
|
+
* @returns Aggregate document statistics.
|
|
14630
|
+
*
|
|
14631
|
+
* @example
|
|
14632
|
+
* ```typescript
|
|
14633
|
+
* const stats = await admin.extraction.documents.stats();
|
|
14634
|
+
* console.log(`Total: ${stats.total}, Failed: ${stats.failed}`);
|
|
14635
|
+
* ```
|
|
14636
|
+
*/
|
|
14151
14637
|
stats: async (options) => {
|
|
14152
14638
|
return rb.execute(getAdminDocumentsStats, {}, options);
|
|
14153
14639
|
},
|
|
14154
|
-
/**
|
|
14640
|
+
/**
|
|
14641
|
+
* Lists all extraction documents belonging to a specific workspace.
|
|
14642
|
+
*
|
|
14643
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14644
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14645
|
+
* @returns An array of extraction documents for the workspace.
|
|
14646
|
+
*
|
|
14647
|
+
* @example
|
|
14648
|
+
* ```typescript
|
|
14649
|
+
* const docs = await admin.extraction.documents.listByWorkspace('ws-uuid');
|
|
14650
|
+
* ```
|
|
14651
|
+
*/
|
|
14155
14652
|
listByWorkspace: async (workspaceId, options) => {
|
|
14156
14653
|
return rb.execute(
|
|
14157
14654
|
getAdminExtractionDocumentsWorkspaceByWorkspaceId,
|
|
@@ -14159,7 +14656,20 @@ function createExtractionNamespace(rb) {
|
|
|
14159
14656
|
options
|
|
14160
14657
|
);
|
|
14161
14658
|
},
|
|
14162
|
-
/**
|
|
14659
|
+
/**
|
|
14660
|
+
* Lists documents filtered by processing status within a workspace.
|
|
14661
|
+
*
|
|
14662
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14663
|
+
* @param status - The processing status to filter by (e.g. `"completed"`, `"failed"`).
|
|
14664
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14665
|
+
* @returns An array of extraction documents matching the status filter.
|
|
14666
|
+
*
|
|
14667
|
+
* @example
|
|
14668
|
+
* ```typescript
|
|
14669
|
+
* const failed = await admin.extraction.documents.listByStatus('ws-uuid', 'failed');
|
|
14670
|
+
* console.log(`${failed.length} failed documents`);
|
|
14671
|
+
* ```
|
|
14672
|
+
*/
|
|
14163
14673
|
listByStatus: async (workspaceId, status, options) => {
|
|
14164
14674
|
return rb.execute(
|
|
14165
14675
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdByStatusByStatus,
|
|
@@ -14167,7 +14677,20 @@ function createExtractionNamespace(rb) {
|
|
|
14167
14677
|
options
|
|
14168
14678
|
);
|
|
14169
14679
|
},
|
|
14170
|
-
/**
|
|
14680
|
+
/**
|
|
14681
|
+
* Returns the review queue for a workspace — documents awaiting human
|
|
14682
|
+
* verification of their extraction results.
|
|
14683
|
+
*
|
|
14684
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14685
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14686
|
+
* @returns An array of documents in the review queue.
|
|
14687
|
+
*
|
|
14688
|
+
* @example
|
|
14689
|
+
* ```typescript
|
|
14690
|
+
* const queue = await admin.extraction.documents.reviewQueue('ws-uuid');
|
|
14691
|
+
* console.log(`${queue.length} documents awaiting review`);
|
|
14692
|
+
* ```
|
|
14693
|
+
*/
|
|
14171
14694
|
reviewQueue: async (workspaceId, options) => {
|
|
14172
14695
|
return rb.execute(
|
|
14173
14696
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdReviewQueue,
|
|
@@ -14175,7 +14698,18 @@ function createExtractionNamespace(rb) {
|
|
|
14175
14698
|
options
|
|
14176
14699
|
);
|
|
14177
14700
|
},
|
|
14178
|
-
/**
|
|
14701
|
+
/**
|
|
14702
|
+
* Lists documents that have been marked as trained within a workspace.
|
|
14703
|
+
*
|
|
14704
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14705
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14706
|
+
* @returns An array of trained extraction documents.
|
|
14707
|
+
*
|
|
14708
|
+
* @example
|
|
14709
|
+
* ```typescript
|
|
14710
|
+
* const trained = await admin.extraction.documents.listTrained('ws-uuid');
|
|
14711
|
+
* ```
|
|
14712
|
+
*/
|
|
14179
14713
|
listTrained: async (workspaceId, options) => {
|
|
14180
14714
|
return rb.execute(
|
|
14181
14715
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdTrained,
|
|
@@ -14183,7 +14717,19 @@ function createExtractionNamespace(rb) {
|
|
|
14183
14717
|
options
|
|
14184
14718
|
);
|
|
14185
14719
|
},
|
|
14186
|
-
/**
|
|
14720
|
+
/**
|
|
14721
|
+
* Lists soft-deleted (trashed) documents for a workspace. These can be
|
|
14722
|
+
* restored via the `restore` method.
|
|
14723
|
+
*
|
|
14724
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14725
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14726
|
+
* @returns An array of trashed extraction documents.
|
|
14727
|
+
*
|
|
14728
|
+
* @example
|
|
14729
|
+
* ```typescript
|
|
14730
|
+
* const trashed = await admin.extraction.documents.listTrashed('ws-uuid');
|
|
14731
|
+
* ```
|
|
14732
|
+
*/
|
|
14187
14733
|
listTrashed: async (workspaceId, options) => {
|
|
14188
14734
|
return rb.execute(
|
|
14189
14735
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdTrashed,
|
|
@@ -14191,7 +14737,19 @@ function createExtractionNamespace(rb) {
|
|
|
14191
14737
|
options
|
|
14192
14738
|
);
|
|
14193
14739
|
},
|
|
14194
|
-
/**
|
|
14740
|
+
/**
|
|
14741
|
+
* Lists documents that have been excluded from the training dataset
|
|
14742
|
+
* within a workspace.
|
|
14743
|
+
*
|
|
14744
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14745
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14746
|
+
* @returns An array of excluded extraction documents.
|
|
14747
|
+
*
|
|
14748
|
+
* @example
|
|
14749
|
+
* ```typescript
|
|
14750
|
+
* const excluded = await admin.extraction.documents.listExcluded('ws-uuid');
|
|
14751
|
+
* ```
|
|
14752
|
+
*/
|
|
14195
14753
|
listExcluded: async (workspaceId, options) => {
|
|
14196
14754
|
return rb.execute(
|
|
14197
14755
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdExcluded,
|
|
@@ -14199,7 +14757,20 @@ function createExtractionNamespace(rb) {
|
|
|
14199
14757
|
options
|
|
14200
14758
|
);
|
|
14201
14759
|
},
|
|
14202
|
-
/**
|
|
14760
|
+
/**
|
|
14761
|
+
* Dismisses all trained-flagged documents in a workspace in one operation.
|
|
14762
|
+
* Useful for clearing training notifications after a batch review.
|
|
14763
|
+
*
|
|
14764
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14765
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14766
|
+
* @returns An operation success result with the dismissed count.
|
|
14767
|
+
*
|
|
14768
|
+
* @example
|
|
14769
|
+
* ```typescript
|
|
14770
|
+
* const result = await admin.extraction.documents.dismissAllTrained('ws-uuid');
|
|
14771
|
+
* console.log(`Dismissed ${result.dismissed_count} documents`);
|
|
14772
|
+
* ```
|
|
14773
|
+
*/
|
|
14203
14774
|
dismissAllTrained: async (workspaceId, options) => {
|
|
14204
14775
|
return rb.execute(
|
|
14205
14776
|
postAdminWorkspacesByWorkspaceIdExtractionDocumentsDismissAllTrained,
|
|
@@ -14213,7 +14784,17 @@ function createExtractionNamespace(rb) {
|
|
|
14213
14784
|
},
|
|
14214
14785
|
/** Extraction result management — CRUD, history, corrections, regeneration. */
|
|
14215
14786
|
results: {
|
|
14216
|
-
/**
|
|
14787
|
+
/**
|
|
14788
|
+
* Lists all extraction results across the platform.
|
|
14789
|
+
*
|
|
14790
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14791
|
+
* @returns An array of extraction result objects.
|
|
14792
|
+
*
|
|
14793
|
+
* @example
|
|
14794
|
+
* ```typescript
|
|
14795
|
+
* const results = await admin.extraction.results.list();
|
|
14796
|
+
* ```
|
|
14797
|
+
*/
|
|
14217
14798
|
list: async (options) => {
|
|
14218
14799
|
return rb.execute(
|
|
14219
14800
|
getAdminExtractionResults,
|
|
@@ -14221,7 +14802,19 @@ function createExtractionNamespace(rb) {
|
|
|
14221
14802
|
options
|
|
14222
14803
|
);
|
|
14223
14804
|
},
|
|
14224
|
-
/**
|
|
14805
|
+
/**
|
|
14806
|
+
* Retrieves a single extraction result by its unique identifier.
|
|
14807
|
+
*
|
|
14808
|
+
* @param id - The UUID of the extraction result.
|
|
14809
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14810
|
+
* @returns The matching extraction result object.
|
|
14811
|
+
*
|
|
14812
|
+
* @example
|
|
14813
|
+
* ```typescript
|
|
14814
|
+
* const result = await admin.extraction.results.get('result-uuid');
|
|
14815
|
+
* console.log(result.extracted_data);
|
|
14816
|
+
* ```
|
|
14817
|
+
*/
|
|
14225
14818
|
get: async (id, options) => {
|
|
14226
14819
|
return rb.execute(
|
|
14227
14820
|
getAdminExtractionResultsById,
|
|
@@ -14229,7 +14822,21 @@ function createExtractionNamespace(rb) {
|
|
|
14229
14822
|
options
|
|
14230
14823
|
);
|
|
14231
14824
|
},
|
|
14232
|
-
/**
|
|
14825
|
+
/**
|
|
14826
|
+
* Updates an extraction result's metadata (e.g. review status).
|
|
14827
|
+
*
|
|
14828
|
+
* @param id - The UUID of the extraction result to update.
|
|
14829
|
+
* @param attributes - The attributes to update.
|
|
14830
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14831
|
+
* @returns The updated extraction result object.
|
|
14832
|
+
*
|
|
14833
|
+
* @example
|
|
14834
|
+
* ```typescript
|
|
14835
|
+
* const result = await admin.extraction.results.update('result-uuid', {
|
|
14836
|
+
* review_status: 'approved',
|
|
14837
|
+
* });
|
|
14838
|
+
* ```
|
|
14839
|
+
*/
|
|
14233
14840
|
update: async (id, attributes, options) => {
|
|
14234
14841
|
return rb.execute(
|
|
14235
14842
|
patchAdminExtractionResultsById,
|
|
@@ -14242,7 +14849,18 @@ function createExtractionNamespace(rb) {
|
|
|
14242
14849
|
options
|
|
14243
14850
|
);
|
|
14244
14851
|
},
|
|
14245
|
-
/**
|
|
14852
|
+
/**
|
|
14853
|
+
* Permanently deletes an extraction result.
|
|
14854
|
+
*
|
|
14855
|
+
* @param id - The UUID of the extraction result to delete.
|
|
14856
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14857
|
+
* @returns `true` when the deletion succeeds.
|
|
14858
|
+
*
|
|
14859
|
+
* @example
|
|
14860
|
+
* ```typescript
|
|
14861
|
+
* await admin.extraction.results.delete('result-uuid');
|
|
14862
|
+
* ```
|
|
14863
|
+
*/
|
|
14246
14864
|
delete: async (id, options) => {
|
|
14247
14865
|
return rb.executeDelete(
|
|
14248
14866
|
deleteAdminExtractionResultsById,
|
|
@@ -14250,7 +14868,18 @@ function createExtractionNamespace(rb) {
|
|
|
14250
14868
|
options
|
|
14251
14869
|
);
|
|
14252
14870
|
},
|
|
14253
|
-
/**
|
|
14871
|
+
/**
|
|
14872
|
+
* Retrieves all extraction results for a specific document.
|
|
14873
|
+
*
|
|
14874
|
+
* @param documentId - The UUID of the parent document.
|
|
14875
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14876
|
+
* @returns An array of extraction results for the document.
|
|
14877
|
+
*
|
|
14878
|
+
* @example
|
|
14879
|
+
* ```typescript
|
|
14880
|
+
* const results = await admin.extraction.results.byDocument('doc-uuid');
|
|
14881
|
+
* ```
|
|
14882
|
+
*/
|
|
14254
14883
|
byDocument: async (documentId, options) => {
|
|
14255
14884
|
return rb.execute(
|
|
14256
14885
|
getAdminExtractionResultsDocumentByDocumentId,
|
|
@@ -14258,7 +14887,20 @@ function createExtractionNamespace(rb) {
|
|
|
14258
14887
|
options
|
|
14259
14888
|
);
|
|
14260
14889
|
},
|
|
14261
|
-
/**
|
|
14890
|
+
/**
|
|
14891
|
+
* Retrieves the version history of extraction results for a document,
|
|
14892
|
+
* showing how results have changed over reprocessing cycles.
|
|
14893
|
+
*
|
|
14894
|
+
* @param documentId - The UUID of the parent document.
|
|
14895
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14896
|
+
* @returns An array of historical extraction result versions.
|
|
14897
|
+
*
|
|
14898
|
+
* @example
|
|
14899
|
+
* ```typescript
|
|
14900
|
+
* const history = await admin.extraction.results.history('doc-uuid');
|
|
14901
|
+
* console.log(`${history.length} result versions`);
|
|
14902
|
+
* ```
|
|
14903
|
+
*/
|
|
14262
14904
|
history: async (documentId, options) => {
|
|
14263
14905
|
return rb.execute(
|
|
14264
14906
|
getAdminExtractionResultsDocumentByDocumentIdHistory,
|
|
@@ -14266,7 +14908,19 @@ function createExtractionNamespace(rb) {
|
|
|
14266
14908
|
options
|
|
14267
14909
|
);
|
|
14268
14910
|
},
|
|
14269
|
-
/**
|
|
14911
|
+
/**
|
|
14912
|
+
* Retrieves partial (in-progress) extraction results for a document that
|
|
14913
|
+
* is still being processed.
|
|
14914
|
+
*
|
|
14915
|
+
* @param documentId - The UUID of the parent document.
|
|
14916
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14917
|
+
* @returns An array of partial extraction results available so far.
|
|
14918
|
+
*
|
|
14919
|
+
* @example
|
|
14920
|
+
* ```typescript
|
|
14921
|
+
* const partial = await admin.extraction.results.partial('doc-uuid');
|
|
14922
|
+
* ```
|
|
14923
|
+
*/
|
|
14270
14924
|
partial: async (documentId, options) => {
|
|
14271
14925
|
return rb.execute(
|
|
14272
14926
|
getAdminExtractionResultsDocumentByDocumentIdPartial,
|
|
@@ -14274,7 +14928,23 @@ function createExtractionNamespace(rb) {
|
|
|
14274
14928
|
options
|
|
14275
14929
|
);
|
|
14276
14930
|
},
|
|
14277
|
-
/**
|
|
14931
|
+
/**
|
|
14932
|
+
* Regenerates an extraction result, optionally incorporating human
|
|
14933
|
+
* feedback or restricting which fields to retry.
|
|
14934
|
+
*
|
|
14935
|
+
* @param id - The UUID of the extraction result to regenerate.
|
|
14936
|
+
* @param attributes - Regeneration parameters (feedback, fields to retry).
|
|
14937
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14938
|
+
* @returns The regenerated extraction result object.
|
|
14939
|
+
*
|
|
14940
|
+
* @example
|
|
14941
|
+
* ```typescript
|
|
14942
|
+
* const result = await admin.extraction.results.regenerate('result-uuid', {
|
|
14943
|
+
* feedback: 'The date field was parsed incorrectly.',
|
|
14944
|
+
* fields_to_retry: ['invoice_date', 'due_date'],
|
|
14945
|
+
* });
|
|
14946
|
+
* ```
|
|
14947
|
+
*/
|
|
14278
14948
|
regenerate: async (id, attributes, options) => {
|
|
14279
14949
|
return rb.execute(
|
|
14280
14950
|
patchAdminExtractionResultsByIdRegenerate,
|
|
@@ -14287,7 +14957,25 @@ function createExtractionNamespace(rb) {
|
|
|
14287
14957
|
options
|
|
14288
14958
|
);
|
|
14289
14959
|
},
|
|
14290
|
-
/**
|
|
14960
|
+
/**
|
|
14961
|
+
* Saves manual corrections to an extraction result. The corrections are
|
|
14962
|
+
* stored alongside the original data and can be used for model training.
|
|
14963
|
+
*
|
|
14964
|
+
* @param id - The UUID of the extraction result to correct.
|
|
14965
|
+
* @param attributes - The corrections to save.
|
|
14966
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14967
|
+
* @returns The updated extraction result object with corrections applied.
|
|
14968
|
+
*
|
|
14969
|
+
* @example
|
|
14970
|
+
* ```typescript
|
|
14971
|
+
* const result = await admin.extraction.results.saveCorrections('result-uuid', {
|
|
14972
|
+
* corrections: [
|
|
14973
|
+
* { field: 'invoice_number', value: 'INV-2026-001' },
|
|
14974
|
+
* { field: 'total_amount', value: 1250.00 },
|
|
14975
|
+
* ],
|
|
14976
|
+
* });
|
|
14977
|
+
* ```
|
|
14978
|
+
*/
|
|
14291
14979
|
saveCorrections: async (id, attributes, options) => {
|
|
14292
14980
|
return rb.execute(
|
|
14293
14981
|
patchAdminExtractionResultsByIdSaveCorrections,
|
|
@@ -14300,7 +14988,18 @@ function createExtractionNamespace(rb) {
|
|
|
14300
14988
|
options
|
|
14301
14989
|
);
|
|
14302
14990
|
},
|
|
14303
|
-
/**
|
|
14991
|
+
/**
|
|
14992
|
+
* Lists all extraction results belonging to a specific workspace.
|
|
14993
|
+
*
|
|
14994
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14995
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14996
|
+
* @returns An array of extraction results for the workspace.
|
|
14997
|
+
*
|
|
14998
|
+
* @example
|
|
14999
|
+
* ```typescript
|
|
15000
|
+
* const results = await admin.extraction.results.listByWorkspace('ws-uuid');
|
|
15001
|
+
* ```
|
|
15002
|
+
*/
|
|
14304
15003
|
listByWorkspace: async (workspaceId, options) => {
|
|
14305
15004
|
return rb.execute(
|
|
14306
15005
|
getAdminExtractionResultsWorkspaceByWorkspaceId,
|
|
@@ -14311,7 +15010,19 @@ function createExtractionNamespace(rb) {
|
|
|
14311
15010
|
},
|
|
14312
15011
|
/** Batch upload management — create batches, get upload URLs. */
|
|
14313
15012
|
batches: {
|
|
14314
|
-
/**
|
|
15013
|
+
/**
|
|
15014
|
+
* Retrieves a single extraction batch by its unique identifier.
|
|
15015
|
+
*
|
|
15016
|
+
* @param id - The UUID of the batch.
|
|
15017
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15018
|
+
* @returns The matching extraction batch object.
|
|
15019
|
+
*
|
|
15020
|
+
* @example
|
|
15021
|
+
* ```typescript
|
|
15022
|
+
* const batch = await admin.extraction.batches.get('batch-uuid');
|
|
15023
|
+
* console.log(`Batch: ${batch.name}, ${batch.document_count} docs`);
|
|
15024
|
+
* ```
|
|
15025
|
+
*/
|
|
14315
15026
|
get: async (id, options) => {
|
|
14316
15027
|
return rb.execute(
|
|
14317
15028
|
getAdminExtractionBatchesById,
|
|
@@ -14319,7 +15030,18 @@ function createExtractionNamespace(rb) {
|
|
|
14319
15030
|
options
|
|
14320
15031
|
);
|
|
14321
15032
|
},
|
|
14322
|
-
/**
|
|
15033
|
+
/**
|
|
15034
|
+
* Permanently deletes an extraction batch.
|
|
15035
|
+
*
|
|
15036
|
+
* @param id - The UUID of the batch to delete.
|
|
15037
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15038
|
+
* @returns `true` when the deletion succeeds.
|
|
15039
|
+
*
|
|
15040
|
+
* @example
|
|
15041
|
+
* ```typescript
|
|
15042
|
+
* await admin.extraction.batches.delete('batch-uuid');
|
|
15043
|
+
* ```
|
|
15044
|
+
*/
|
|
14323
15045
|
delete: async (id, options) => {
|
|
14324
15046
|
return rb.executeDelete(
|
|
14325
15047
|
deleteAdminExtractionBatchesById,
|
|
@@ -14327,7 +15049,22 @@ function createExtractionNamespace(rb) {
|
|
|
14327
15049
|
options
|
|
14328
15050
|
);
|
|
14329
15051
|
},
|
|
14330
|
-
/**
|
|
15052
|
+
/**
|
|
15053
|
+
* Creates a new extraction batch for grouping document uploads.
|
|
15054
|
+
*
|
|
15055
|
+
* @param attributes - Batch creation attributes including workspace ID.
|
|
15056
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15057
|
+
* @returns The newly created extraction batch object.
|
|
15058
|
+
*
|
|
15059
|
+
* @example
|
|
15060
|
+
* ```typescript
|
|
15061
|
+
* const batch = await admin.extraction.batches.create({
|
|
15062
|
+
* name: 'Q1 Invoices',
|
|
15063
|
+
* workspace_id: 'ws-uuid',
|
|
15064
|
+
* agent_id: 'agent-uuid',
|
|
15065
|
+
* });
|
|
15066
|
+
* ```
|
|
15067
|
+
*/
|
|
14331
15068
|
create: async (attributes, options) => {
|
|
14332
15069
|
return rb.execute(
|
|
14333
15070
|
postAdminExtractionBatches,
|
|
@@ -14339,7 +15076,18 @@ function createExtractionNamespace(rb) {
|
|
|
14339
15076
|
options
|
|
14340
15077
|
);
|
|
14341
15078
|
},
|
|
14342
|
-
/**
|
|
15079
|
+
/**
|
|
15080
|
+
* Lists all extraction batches belonging to a specific workspace.
|
|
15081
|
+
*
|
|
15082
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15083
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15084
|
+
* @returns An array of extraction batches for the workspace.
|
|
15085
|
+
*
|
|
15086
|
+
* @example
|
|
15087
|
+
* ```typescript
|
|
15088
|
+
* const batches = await admin.extraction.batches.listByWorkspace('ws-uuid');
|
|
15089
|
+
* ```
|
|
15090
|
+
*/
|
|
14343
15091
|
listByWorkspace: async (workspaceId, options) => {
|
|
14344
15092
|
return rb.execute(
|
|
14345
15093
|
getAdminExtractionBatchesWorkspaceByWorkspaceId,
|
|
@@ -14347,7 +15095,24 @@ function createExtractionNamespace(rb) {
|
|
|
14347
15095
|
options
|
|
14348
15096
|
);
|
|
14349
15097
|
},
|
|
14350
|
-
/**
|
|
15098
|
+
/**
|
|
15099
|
+
* Retrieves presigned upload URLs for all documents in a batch, enabling
|
|
15100
|
+
* parallel direct-to-storage uploads.
|
|
15101
|
+
*
|
|
15102
|
+
* @param id - The UUID of the batch.
|
|
15103
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15104
|
+
* @returns An array of presigned URL objects, one per document slot.
|
|
15105
|
+
*
|
|
15106
|
+
* @example
|
|
15107
|
+
* ```typescript
|
|
15108
|
+
* const urls = await admin.extraction.batches.getUploadUrls('batch-uuid');
|
|
15109
|
+
* // Upload files in parallel to each presigned URL
|
|
15110
|
+
* await Promise.all(urls.map((u, i) => fetch(u.upload_url, {
|
|
15111
|
+
* method: 'PUT',
|
|
15112
|
+
* body: files[i],
|
|
15113
|
+
* })));
|
|
15114
|
+
* ```
|
|
15115
|
+
*/
|
|
14351
15116
|
getUploadUrls: async (id, options) => {
|
|
14352
15117
|
return rb.execute(
|
|
14353
15118
|
getAdminExtractionBatchesByIdUploadUrls,
|
|
@@ -14358,7 +15123,18 @@ function createExtractionNamespace(rb) {
|
|
|
14358
15123
|
},
|
|
14359
15124
|
/** Export management — create and retrieve data exports. */
|
|
14360
15125
|
exports: {
|
|
14361
|
-
/**
|
|
15126
|
+
/**
|
|
15127
|
+
* Lists all extraction exports for a workspace.
|
|
15128
|
+
*
|
|
15129
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15130
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15131
|
+
* @returns An array of extraction export objects.
|
|
15132
|
+
*
|
|
15133
|
+
* @example
|
|
15134
|
+
* ```typescript
|
|
15135
|
+
* const exports = await admin.extraction.exports.list('ws-uuid');
|
|
15136
|
+
* ```
|
|
15137
|
+
*/
|
|
14362
15138
|
list: async (workspaceId, options) => {
|
|
14363
15139
|
return rb.execute(
|
|
14364
15140
|
getAdminWorkspacesByWorkspaceIdExtractionExports,
|
|
@@ -14366,7 +15142,23 @@ function createExtractionNamespace(rb) {
|
|
|
14366
15142
|
options
|
|
14367
15143
|
);
|
|
14368
15144
|
},
|
|
14369
|
-
/**
|
|
15145
|
+
/**
|
|
15146
|
+
* Creates a new data export for a workspace in the specified format.
|
|
15147
|
+
*
|
|
15148
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15149
|
+
* @param attributes - Export creation attributes including format.
|
|
15150
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15151
|
+
* @returns The newly created extraction export object.
|
|
15152
|
+
*
|
|
15153
|
+
* @example
|
|
15154
|
+
* ```typescript
|
|
15155
|
+
* const exp = await admin.extraction.exports.create('ws-uuid', {
|
|
15156
|
+
* format: 'csv',
|
|
15157
|
+
* agent_id: 'agent-uuid',
|
|
15158
|
+
* });
|
|
15159
|
+
* console.log(`Export ${exp.id} created, status: ${exp.status}`);
|
|
15160
|
+
* ```
|
|
15161
|
+
*/
|
|
14370
15162
|
create: async (workspaceId, attributes, options) => {
|
|
14371
15163
|
return rb.execute(
|
|
14372
15164
|
postAdminWorkspacesByWorkspaceIdExtractionExports,
|
|
@@ -14379,7 +15171,23 @@ function createExtractionNamespace(rb) {
|
|
|
14379
15171
|
options
|
|
14380
15172
|
);
|
|
14381
15173
|
},
|
|
14382
|
-
/**
|
|
15174
|
+
/**
|
|
15175
|
+
* Retrieves a single extraction export by ID within a workspace.
|
|
15176
|
+
*
|
|
15177
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15178
|
+
* @param id - The UUID of the export to retrieve.
|
|
15179
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15180
|
+
* @returns The matching extraction export object, including download URL
|
|
15181
|
+
* when the export is complete.
|
|
15182
|
+
*
|
|
15183
|
+
* @example
|
|
15184
|
+
* ```typescript
|
|
15185
|
+
* const exp = await admin.extraction.exports.get('ws-uuid', 'export-uuid');
|
|
15186
|
+
* if (exp.status === 'completed') {
|
|
15187
|
+
* console.log(`Download: ${exp.download_url}`);
|
|
15188
|
+
* }
|
|
15189
|
+
* ```
|
|
15190
|
+
*/
|
|
14383
15191
|
get: async (workspaceId, id, options) => {
|
|
14384
15192
|
return rb.execute(
|
|
14385
15193
|
getAdminWorkspacesByWorkspaceIdExtractionExportsById,
|
|
@@ -14390,7 +15198,17 @@ function createExtractionNamespace(rb) {
|
|
|
14390
15198
|
},
|
|
14391
15199
|
/** Workflow management — configurable extraction pipelines. */
|
|
14392
15200
|
workflows: {
|
|
14393
|
-
/**
|
|
15201
|
+
/**
|
|
15202
|
+
* Lists all extraction workflows across the platform.
|
|
15203
|
+
*
|
|
15204
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15205
|
+
* @returns An array of extraction workflow objects.
|
|
15206
|
+
*
|
|
15207
|
+
* @example
|
|
15208
|
+
* ```typescript
|
|
15209
|
+
* const workflows = await admin.extraction.workflows.list();
|
|
15210
|
+
* ```
|
|
15211
|
+
*/
|
|
14394
15212
|
list: async (options) => {
|
|
14395
15213
|
return rb.execute(
|
|
14396
15214
|
getAdminExtractionWorkflows,
|
|
@@ -14398,7 +15216,21 @@ function createExtractionNamespace(rb) {
|
|
|
14398
15216
|
options
|
|
14399
15217
|
);
|
|
14400
15218
|
},
|
|
14401
|
-
/**
|
|
15219
|
+
/**
|
|
15220
|
+
* Creates a new extraction workflow with the specified configuration.
|
|
15221
|
+
*
|
|
15222
|
+
* @param attributes - Workflow creation attributes including name.
|
|
15223
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15224
|
+
* @returns The newly created extraction workflow object.
|
|
15225
|
+
*
|
|
15226
|
+
* @example
|
|
15227
|
+
* ```typescript
|
|
15228
|
+
* const workflow = await admin.extraction.workflows.create({
|
|
15229
|
+
* name: 'Invoice Processing',
|
|
15230
|
+
* workspace_id: 'ws-uuid',
|
|
15231
|
+
* });
|
|
15232
|
+
* ```
|
|
15233
|
+
*/
|
|
14402
15234
|
create: async (attributes, options) => {
|
|
14403
15235
|
return rb.execute(
|
|
14404
15236
|
postAdminExtractionWorkflows,
|
|
@@ -14410,7 +15242,18 @@ function createExtractionNamespace(rb) {
|
|
|
14410
15242
|
options
|
|
14411
15243
|
);
|
|
14412
15244
|
},
|
|
14413
|
-
/**
|
|
15245
|
+
/**
|
|
15246
|
+
* Retrieves a single extraction workflow by its unique identifier.
|
|
15247
|
+
*
|
|
15248
|
+
* @param id - The UUID of the workflow.
|
|
15249
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15250
|
+
* @returns The matching extraction workflow object.
|
|
15251
|
+
*
|
|
15252
|
+
* @example
|
|
15253
|
+
* ```typescript
|
|
15254
|
+
* const workflow = await admin.extraction.workflows.get('workflow-uuid');
|
|
15255
|
+
* ```
|
|
15256
|
+
*/
|
|
14414
15257
|
get: async (id, options) => {
|
|
14415
15258
|
return rb.execute(
|
|
14416
15259
|
getAdminExtractionWorkflowsById,
|
|
@@ -14418,7 +15261,21 @@ function createExtractionNamespace(rb) {
|
|
|
14418
15261
|
options
|
|
14419
15262
|
);
|
|
14420
15263
|
},
|
|
14421
|
-
/**
|
|
15264
|
+
/**
|
|
15265
|
+
* Updates an existing extraction workflow's configuration.
|
|
15266
|
+
*
|
|
15267
|
+
* @param id - The UUID of the workflow to update.
|
|
15268
|
+
* @param attributes - The attributes to update.
|
|
15269
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15270
|
+
* @returns The updated extraction workflow object.
|
|
15271
|
+
*
|
|
15272
|
+
* @example
|
|
15273
|
+
* ```typescript
|
|
15274
|
+
* const workflow = await admin.extraction.workflows.update('workflow-uuid', {
|
|
15275
|
+
* name: 'Updated Invoice Pipeline',
|
|
15276
|
+
* });
|
|
15277
|
+
* ```
|
|
15278
|
+
*/
|
|
14422
15279
|
update: async (id, attributes, options) => {
|
|
14423
15280
|
return rb.execute(
|
|
14424
15281
|
patchAdminExtractionWorkflowsById,
|
|
@@ -14431,7 +15288,18 @@ function createExtractionNamespace(rb) {
|
|
|
14431
15288
|
options
|
|
14432
15289
|
);
|
|
14433
15290
|
},
|
|
14434
|
-
/**
|
|
15291
|
+
/**
|
|
15292
|
+
* Permanently deletes an extraction workflow.
|
|
15293
|
+
*
|
|
15294
|
+
* @param id - The UUID of the workflow to delete.
|
|
15295
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15296
|
+
* @returns `true` when the deletion succeeds.
|
|
15297
|
+
*
|
|
15298
|
+
* @example
|
|
15299
|
+
* ```typescript
|
|
15300
|
+
* await admin.extraction.workflows.delete('workflow-uuid');
|
|
15301
|
+
* ```
|
|
15302
|
+
*/
|
|
14435
15303
|
delete: async (id, options) => {
|
|
14436
15304
|
return rb.executeDelete(
|
|
14437
15305
|
deleteAdminExtractionWorkflowsById,
|
|
@@ -14442,7 +15310,18 @@ function createExtractionNamespace(rb) {
|
|
|
14442
15310
|
},
|
|
14443
15311
|
/** Config enum management — dropdown and validation values. */
|
|
14444
15312
|
configEnums: {
|
|
14445
|
-
/**
|
|
15313
|
+
/**
|
|
15314
|
+
* Lists all config enums used for extraction field validation and
|
|
15315
|
+
* dropdown options.
|
|
15316
|
+
*
|
|
15317
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15318
|
+
* @returns An array of config enum objects.
|
|
15319
|
+
*
|
|
15320
|
+
* @example
|
|
15321
|
+
* ```typescript
|
|
15322
|
+
* const enums = await admin.extraction.configEnums.list();
|
|
15323
|
+
* ```
|
|
15324
|
+
*/
|
|
14446
15325
|
list: async (options) => {
|
|
14447
15326
|
return rb.execute(
|
|
14448
15327
|
getAdminExtractionConfigEnums,
|
|
@@ -14450,7 +15329,23 @@ function createExtractionNamespace(rb) {
|
|
|
14450
15329
|
options
|
|
14451
15330
|
);
|
|
14452
15331
|
},
|
|
14453
|
-
/**
|
|
15332
|
+
/**
|
|
15333
|
+
* Creates a new config enum value for use in extraction field dropdowns
|
|
15334
|
+
* and validation.
|
|
15335
|
+
*
|
|
15336
|
+
* @param attributes - Config enum creation attributes.
|
|
15337
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15338
|
+
* @returns The newly created config enum object.
|
|
15339
|
+
*
|
|
15340
|
+
* @example
|
|
15341
|
+
* ```typescript
|
|
15342
|
+
* const enumVal = await admin.extraction.configEnums.create({
|
|
15343
|
+
* type: 'document_category',
|
|
15344
|
+
* value: 'invoice',
|
|
15345
|
+
* label: 'Invoice',
|
|
15346
|
+
* });
|
|
15347
|
+
* ```
|
|
15348
|
+
*/
|
|
14454
15349
|
create: async (attributes, options) => {
|
|
14455
15350
|
return rb.execute(
|
|
14456
15351
|
postAdminExtractionConfigEnums,
|
|
@@ -14462,7 +15357,18 @@ function createExtractionNamespace(rb) {
|
|
|
14462
15357
|
options
|
|
14463
15358
|
);
|
|
14464
15359
|
},
|
|
14465
|
-
/**
|
|
15360
|
+
/**
|
|
15361
|
+
* Retrieves a single config enum by its unique identifier.
|
|
15362
|
+
*
|
|
15363
|
+
* @param id - The UUID of the config enum.
|
|
15364
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15365
|
+
* @returns The matching config enum object.
|
|
15366
|
+
*
|
|
15367
|
+
* @example
|
|
15368
|
+
* ```typescript
|
|
15369
|
+
* const enumVal = await admin.extraction.configEnums.get('enum-uuid');
|
|
15370
|
+
* ```
|
|
15371
|
+
*/
|
|
14466
15372
|
get: async (id, options) => {
|
|
14467
15373
|
return rb.execute(
|
|
14468
15374
|
getAdminExtractionConfigEnumsById,
|
|
@@ -14470,7 +15376,21 @@ function createExtractionNamespace(rb) {
|
|
|
14470
15376
|
options
|
|
14471
15377
|
);
|
|
14472
15378
|
},
|
|
14473
|
-
/**
|
|
15379
|
+
/**
|
|
15380
|
+
* Updates an existing config enum's label or other mutable attributes.
|
|
15381
|
+
*
|
|
15382
|
+
* @param id - The UUID of the config enum to update.
|
|
15383
|
+
* @param attributes - The attributes to update.
|
|
15384
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15385
|
+
* @returns The updated config enum object.
|
|
15386
|
+
*
|
|
15387
|
+
* @example
|
|
15388
|
+
* ```typescript
|
|
15389
|
+
* const enumVal = await admin.extraction.configEnums.update('enum-uuid', {
|
|
15390
|
+
* label: 'Updated Label',
|
|
15391
|
+
* });
|
|
15392
|
+
* ```
|
|
15393
|
+
*/
|
|
14474
15394
|
update: async (id, attributes, options) => {
|
|
14475
15395
|
return rb.execute(
|
|
14476
15396
|
patchAdminExtractionConfigEnumsById,
|
|
@@ -14486,7 +15406,23 @@ function createExtractionNamespace(rb) {
|
|
|
14486
15406
|
},
|
|
14487
15407
|
/** Schema discovery — AI-powered field schema detection. */
|
|
14488
15408
|
schemaDiscoveries: {
|
|
14489
|
-
/**
|
|
15409
|
+
/**
|
|
15410
|
+
* Runs schema discovery on documents to automatically detect extraction
|
|
15411
|
+
* field schemas using AI.
|
|
15412
|
+
*
|
|
15413
|
+
* @param attributes - Schema discovery attributes (document or workspace scope).
|
|
15414
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15415
|
+
* @returns The created schema discovery object with detected fields.
|
|
15416
|
+
*
|
|
15417
|
+
* @example
|
|
15418
|
+
* ```typescript
|
|
15419
|
+
* const discovery = await admin.extraction.schemaDiscoveries.create({
|
|
15420
|
+
* document_id: 'doc-uuid',
|
|
15421
|
+
* workspace_id: 'ws-uuid',
|
|
15422
|
+
* });
|
|
15423
|
+
* console.log(discovery.suggested_fields);
|
|
15424
|
+
* ```
|
|
15425
|
+
*/
|
|
14490
15426
|
create: async (attributes, options) => {
|
|
14491
15427
|
return rb.execute(
|
|
14492
15428
|
postAdminExtractionSchemaDiscoveries,
|
|
@@ -14498,7 +15434,18 @@ function createExtractionNamespace(rb) {
|
|
|
14498
15434
|
options
|
|
14499
15435
|
);
|
|
14500
15436
|
},
|
|
14501
|
-
/**
|
|
15437
|
+
/**
|
|
15438
|
+
* Retrieves a schema discovery result by its unique identifier.
|
|
15439
|
+
*
|
|
15440
|
+
* @param id - The UUID of the schema discovery.
|
|
15441
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15442
|
+
* @returns The matching schema discovery object.
|
|
15443
|
+
*
|
|
15444
|
+
* @example
|
|
15445
|
+
* ```typescript
|
|
15446
|
+
* const discovery = await admin.extraction.schemaDiscoveries.get('discovery-uuid');
|
|
15447
|
+
* ```
|
|
15448
|
+
*/
|
|
14502
15449
|
get: async (id, options) => {
|
|
14503
15450
|
return rb.execute(
|
|
14504
15451
|
getAdminExtractionSchemaDiscoveriesById,
|
|
@@ -14506,7 +15453,21 @@ function createExtractionNamespace(rb) {
|
|
|
14506
15453
|
options
|
|
14507
15454
|
);
|
|
14508
15455
|
},
|
|
14509
|
-
/**
|
|
15456
|
+
/**
|
|
15457
|
+
* Bootstraps schema discovery for a workspace, analyzing existing
|
|
15458
|
+
* documents to suggest an initial extraction schema.
|
|
15459
|
+
*
|
|
15460
|
+
* @param attributes - Bootstrap attributes (workspace scope).
|
|
15461
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15462
|
+
* @returns The bootstrapped schema discovery object.
|
|
15463
|
+
*
|
|
15464
|
+
* @example
|
|
15465
|
+
* ```typescript
|
|
15466
|
+
* const discovery = await admin.extraction.schemaDiscoveries.bootstrap({
|
|
15467
|
+
* workspace_id: 'ws-uuid',
|
|
15468
|
+
* });
|
|
15469
|
+
* ```
|
|
15470
|
+
*/
|
|
14510
15471
|
bootstrap: async (attributes, options) => {
|
|
14511
15472
|
return rb.execute(
|
|
14512
15473
|
postAdminExtractionSchemaDiscoveriesBootstrap,
|
|
@@ -14521,7 +15482,21 @@ function createExtractionNamespace(rb) {
|
|
|
14521
15482
|
},
|
|
14522
15483
|
/** Field mapping — document-to-schema field alignment. */
|
|
14523
15484
|
fieldMappings: {
|
|
14524
|
-
/**
|
|
15485
|
+
/**
|
|
15486
|
+
* Retrieves the current field mapping for a document within a workspace,
|
|
15487
|
+
* showing how extracted fields align with the schema.
|
|
15488
|
+
*
|
|
15489
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15490
|
+
* @param documentId - The UUID of the document.
|
|
15491
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15492
|
+
* @returns The field mapping result for the document.
|
|
15493
|
+
*
|
|
15494
|
+
* @example
|
|
15495
|
+
* ```typescript
|
|
15496
|
+
* const mapping = await admin.extraction.fieldMappings.get('ws-uuid', 'doc-uuid');
|
|
15497
|
+
* console.log(mapping.mappings);
|
|
15498
|
+
* ```
|
|
15499
|
+
*/
|
|
14525
15500
|
get: async (workspaceId, documentId, options) => {
|
|
14526
15501
|
return rb.execute(
|
|
14527
15502
|
getAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
@@ -14529,89 +15504,432 @@ function createExtractionNamespace(rb) {
|
|
|
14529
15504
|
options
|
|
14530
15505
|
);
|
|
14531
15506
|
},
|
|
14532
|
-
/**
|
|
15507
|
+
/**
|
|
15508
|
+
* Creates or updates the field mapping for a document, confirming how
|
|
15509
|
+
* extracted fields should map to schema fields.
|
|
15510
|
+
*
|
|
15511
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15512
|
+
* @param documentId - The UUID of the document.
|
|
15513
|
+
* @param attributes - The mapping attributes including confirmation and mappings.
|
|
15514
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15515
|
+
* @returns The created or updated field mapping result.
|
|
15516
|
+
*
|
|
15517
|
+
* @example
|
|
15518
|
+
* ```typescript
|
|
15519
|
+
* const mapping = await admin.extraction.fieldMappings.create(
|
|
15520
|
+
* 'ws-uuid',
|
|
15521
|
+
* 'doc-uuid',
|
|
15522
|
+
* {
|
|
15523
|
+
* confirmed: true,
|
|
15524
|
+
* mappings: [
|
|
15525
|
+
* { source: 'inv_num', target: 'invoice_number' },
|
|
15526
|
+
* { source: 'amt', target: 'total_amount' },
|
|
15527
|
+
* ],
|
|
15528
|
+
* },
|
|
15529
|
+
* );
|
|
15530
|
+
* ```
|
|
15531
|
+
*/
|
|
14533
15532
|
create: async (workspaceId, documentId, attributes, options) => {
|
|
14534
15533
|
return rb.execute(
|
|
14535
|
-
postAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
14536
|
-
{
|
|
14537
|
-
path: { workspace_id: workspaceId, document_id: documentId },
|
|
14538
|
-
body: {
|
|
14539
|
-
data: { type: "field-mapping-result", attributes }
|
|
14540
|
-
}
|
|
14541
|
-
},
|
|
15534
|
+
postAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
15535
|
+
{
|
|
15536
|
+
path: { workspace_id: workspaceId, document_id: documentId },
|
|
15537
|
+
body: {
|
|
15538
|
+
data: { type: "field-mapping-result", attributes }
|
|
15539
|
+
}
|
|
15540
|
+
},
|
|
15541
|
+
options
|
|
15542
|
+
);
|
|
15543
|
+
}
|
|
15544
|
+
},
|
|
15545
|
+
/** Shadow comparison results — primary vs shadow extractor quality metrics. */
|
|
15546
|
+
shadowComparisons: {
|
|
15547
|
+
/**
|
|
15548
|
+
* Lists all shadow comparison records across the platform.
|
|
15549
|
+
*
|
|
15550
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15551
|
+
* @returns An array of shadow comparison objects.
|
|
15552
|
+
*
|
|
15553
|
+
* @example
|
|
15554
|
+
* ```typescript
|
|
15555
|
+
* const comparisons = await admin.extraction.shadowComparisons.list();
|
|
15556
|
+
* ```
|
|
15557
|
+
*/
|
|
15558
|
+
list: async (options) => {
|
|
15559
|
+
return rb.execute(
|
|
15560
|
+
getAdminExtractionShadowComparisons,
|
|
15561
|
+
{},
|
|
15562
|
+
options
|
|
15563
|
+
);
|
|
15564
|
+
},
|
|
15565
|
+
/**
|
|
15566
|
+
* Retrieves a single shadow comparison by its unique identifier.
|
|
15567
|
+
*
|
|
15568
|
+
* @param id - The UUID of the shadow comparison.
|
|
15569
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15570
|
+
* @returns The matching shadow comparison object.
|
|
15571
|
+
*
|
|
15572
|
+
* @example
|
|
15573
|
+
* ```typescript
|
|
15574
|
+
* const comparison = await admin.extraction.shadowComparisons.get('comparison-uuid');
|
|
15575
|
+
* ```
|
|
15576
|
+
*/
|
|
15577
|
+
get: async (id, options) => {
|
|
15578
|
+
return rb.execute(
|
|
15579
|
+
getAdminExtractionShadowComparisonsById,
|
|
15580
|
+
{ path: { id } },
|
|
15581
|
+
options
|
|
15582
|
+
);
|
|
15583
|
+
},
|
|
15584
|
+
/**
|
|
15585
|
+
* Creates a new shadow comparison record to compare the output of the
|
|
15586
|
+
* primary extractor against a shadow extractor for quality evaluation.
|
|
15587
|
+
*
|
|
15588
|
+
* @param attributes - Shadow comparison creation attributes.
|
|
15589
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15590
|
+
* @returns The newly created shadow comparison object.
|
|
15591
|
+
*
|
|
15592
|
+
* @example
|
|
15593
|
+
* ```typescript
|
|
15594
|
+
* const comparison = await admin.extraction.shadowComparisons.create({
|
|
15595
|
+
* document_id: 'doc-uuid',
|
|
15596
|
+
* workspace_id: 'ws-uuid',
|
|
15597
|
+
* });
|
|
15598
|
+
* ```
|
|
15599
|
+
*/
|
|
15600
|
+
create: async (attributes, options) => {
|
|
15601
|
+
return rb.execute(
|
|
15602
|
+
postAdminExtractionShadowComparisons,
|
|
15603
|
+
{
|
|
15604
|
+
body: {
|
|
15605
|
+
data: { type: "shadow-comparison", attributes }
|
|
15606
|
+
}
|
|
15607
|
+
},
|
|
15608
|
+
options
|
|
15609
|
+
);
|
|
15610
|
+
},
|
|
15611
|
+
/**
|
|
15612
|
+
* Permanently deletes a shadow comparison record.
|
|
15613
|
+
*
|
|
15614
|
+
* @param id - The UUID of the shadow comparison to delete.
|
|
15615
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15616
|
+
* @returns `true` when the deletion succeeds.
|
|
15617
|
+
*
|
|
15618
|
+
* @example
|
|
15619
|
+
* ```typescript
|
|
15620
|
+
* await admin.extraction.shadowComparisons.delete('comparison-uuid');
|
|
15621
|
+
* ```
|
|
15622
|
+
*/
|
|
15623
|
+
delete: async (id, options) => {
|
|
15624
|
+
return rb.executeDelete(
|
|
15625
|
+
deleteAdminExtractionShadowComparisonsById,
|
|
15626
|
+
{ path: { id } },
|
|
15627
|
+
options
|
|
15628
|
+
);
|
|
15629
|
+
},
|
|
15630
|
+
/**
|
|
15631
|
+
* Retrieves the aggregated analysis report comparing primary vs shadow
|
|
15632
|
+
* extractor performance across all shadow comparison records.
|
|
15633
|
+
*
|
|
15634
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15635
|
+
* @returns An array of shadow comparison analysis results.
|
|
15636
|
+
*
|
|
15637
|
+
* @example
|
|
15638
|
+
* ```typescript
|
|
15639
|
+
* const analysis = await admin.extraction.shadowComparisons.analysis();
|
|
15640
|
+
* ```
|
|
15641
|
+
*/
|
|
15642
|
+
analysis: async (options) => {
|
|
15643
|
+
return rb.execute(
|
|
15644
|
+
getAdminExtractionShadowComparisonsAnalysis,
|
|
15645
|
+
{},
|
|
15646
|
+
options
|
|
15647
|
+
);
|
|
15648
|
+
}
|
|
15649
|
+
},
|
|
15650
|
+
/** Content analysis results — PII detection, OCR quality, entity extraction. */
|
|
15651
|
+
analyses: {
|
|
15652
|
+
/**
|
|
15653
|
+
* Lists all extraction analysis records across the platform, including
|
|
15654
|
+
* PII detection results and OCR quality metrics.
|
|
15655
|
+
*
|
|
15656
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15657
|
+
* @returns An array of extraction analysis objects.
|
|
15658
|
+
*
|
|
15659
|
+
* @example
|
|
15660
|
+
* ```typescript
|
|
15661
|
+
* const analyses = await admin.extraction.analyses.list();
|
|
15662
|
+
* ```
|
|
15663
|
+
*/
|
|
15664
|
+
list: async (options) => {
|
|
15665
|
+
return rb.execute(
|
|
15666
|
+
getAdminExtractionAnalyses,
|
|
15667
|
+
{},
|
|
15668
|
+
options
|
|
15669
|
+
);
|
|
15670
|
+
},
|
|
15671
|
+
/**
|
|
15672
|
+
* Retrieves a single extraction analysis by its unique identifier.
|
|
15673
|
+
*
|
|
15674
|
+
* @param id - The UUID of the extraction analysis.
|
|
15675
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15676
|
+
* @returns The matching extraction analysis object.
|
|
15677
|
+
*
|
|
15678
|
+
* @example
|
|
15679
|
+
* ```typescript
|
|
15680
|
+
* const analysis = await admin.extraction.analyses.get('analysis-uuid');
|
|
15681
|
+
* console.log(analysis.pii_detected, analysis.ocr_confidence);
|
|
15682
|
+
* ```
|
|
15683
|
+
*/
|
|
15684
|
+
get: async (id, options) => {
|
|
15685
|
+
return rb.execute(
|
|
15686
|
+
getAdminExtractionAnalysesById,
|
|
15687
|
+
{ path: { id } },
|
|
14542
15688
|
options
|
|
14543
15689
|
);
|
|
14544
15690
|
}
|
|
14545
15691
|
},
|
|
14546
|
-
/**
|
|
14547
|
-
|
|
14548
|
-
/**
|
|
15692
|
+
/** Post-processing hooks — configurable hooks that execute after extraction. */
|
|
15693
|
+
postProcessingHooks: {
|
|
15694
|
+
/**
|
|
15695
|
+
* Lists all post-processing hooks across the platform.
|
|
15696
|
+
*
|
|
15697
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15698
|
+
* @returns An array of post-processing hook objects.
|
|
15699
|
+
*
|
|
15700
|
+
* @example
|
|
15701
|
+
* ```typescript
|
|
15702
|
+
* const hooks = await admin.extraction.postProcessingHooks.list();
|
|
15703
|
+
* ```
|
|
15704
|
+
*/
|
|
14549
15705
|
list: async (options) => {
|
|
14550
15706
|
return rb.execute(
|
|
14551
|
-
|
|
15707
|
+
getAdminPostProcessingHooks,
|
|
14552
15708
|
{},
|
|
14553
15709
|
options
|
|
14554
15710
|
);
|
|
14555
15711
|
},
|
|
14556
|
-
/**
|
|
15712
|
+
/**
|
|
15713
|
+
* Retrieves a single post-processing hook by its unique identifier.
|
|
15714
|
+
*
|
|
15715
|
+
* @param id - The UUID of the hook.
|
|
15716
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15717
|
+
* @returns The matching post-processing hook object.
|
|
15718
|
+
*
|
|
15719
|
+
* @example
|
|
15720
|
+
* ```typescript
|
|
15721
|
+
* const hook = await admin.extraction.postProcessingHooks.get('hook-uuid');
|
|
15722
|
+
* ```
|
|
15723
|
+
*/
|
|
14557
15724
|
get: async (id, options) => {
|
|
14558
15725
|
return rb.execute(
|
|
14559
|
-
|
|
15726
|
+
getAdminPostProcessingHooksById,
|
|
14560
15727
|
{ path: { id } },
|
|
14561
15728
|
options
|
|
14562
15729
|
);
|
|
14563
15730
|
},
|
|
14564
|
-
/**
|
|
15731
|
+
/**
|
|
15732
|
+
* Creates a new post-processing hook for the extraction pipeline.
|
|
15733
|
+
*
|
|
15734
|
+
* @param attributes - Hook creation attributes including name, trigger, and type.
|
|
15735
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15736
|
+
* @returns The newly created post-processing hook object.
|
|
15737
|
+
*
|
|
15738
|
+
* @example
|
|
15739
|
+
* ```typescript
|
|
15740
|
+
* const hook = await admin.extraction.postProcessingHooks.create({
|
|
15741
|
+
* name: 'Notify on extraction',
|
|
15742
|
+
* trigger: 'after_extraction',
|
|
15743
|
+
* type: 'webhook',
|
|
15744
|
+
* config: { url: 'https://example.com/hook' },
|
|
15745
|
+
* workspace_id: 'ws-uuid',
|
|
15746
|
+
* });
|
|
15747
|
+
* ```
|
|
15748
|
+
*/
|
|
14565
15749
|
create: async (attributes, options) => {
|
|
14566
15750
|
return rb.execute(
|
|
14567
|
-
|
|
15751
|
+
postAdminPostProcessingHooks,
|
|
14568
15752
|
{
|
|
14569
15753
|
body: {
|
|
14570
|
-
data: { type: "
|
|
15754
|
+
data: { type: "post-processing-hook", attributes }
|
|
15755
|
+
}
|
|
15756
|
+
},
|
|
15757
|
+
options
|
|
15758
|
+
);
|
|
15759
|
+
},
|
|
15760
|
+
/**
|
|
15761
|
+
* Updates an existing post-processing hook's configuration.
|
|
15762
|
+
*
|
|
15763
|
+
* @param id - The UUID of the hook to update.
|
|
15764
|
+
* @param attributes - The attributes to update.
|
|
15765
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15766
|
+
* @returns The updated post-processing hook object.
|
|
15767
|
+
*
|
|
15768
|
+
* @example
|
|
15769
|
+
* ```typescript
|
|
15770
|
+
* const hook = await admin.extraction.postProcessingHooks.update('hook-uuid', {
|
|
15771
|
+
* enabled: false,
|
|
15772
|
+
* });
|
|
15773
|
+
* ```
|
|
15774
|
+
*/
|
|
15775
|
+
update: async (id, attributes, options) => {
|
|
15776
|
+
return rb.execute(
|
|
15777
|
+
patchAdminPostProcessingHooksById,
|
|
15778
|
+
{
|
|
15779
|
+
path: { id },
|
|
15780
|
+
body: {
|
|
15781
|
+
data: { id, type: "post-processing-hook", attributes }
|
|
14571
15782
|
}
|
|
14572
15783
|
},
|
|
14573
15784
|
options
|
|
14574
15785
|
);
|
|
14575
15786
|
},
|
|
14576
|
-
/**
|
|
15787
|
+
/**
|
|
15788
|
+
* Permanently deletes a post-processing hook.
|
|
15789
|
+
*
|
|
15790
|
+
* @param id - The UUID of the hook to delete.
|
|
15791
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15792
|
+
* @returns `true` when the deletion succeeds.
|
|
15793
|
+
*
|
|
15794
|
+
* @example
|
|
15795
|
+
* ```typescript
|
|
15796
|
+
* await admin.extraction.postProcessingHooks.delete('hook-uuid');
|
|
15797
|
+
* ```
|
|
15798
|
+
*/
|
|
14577
15799
|
delete: async (id, options) => {
|
|
14578
15800
|
return rb.executeDelete(
|
|
14579
|
-
|
|
15801
|
+
deleteAdminPostProcessingHooksById,
|
|
14580
15802
|
{ path: { id } },
|
|
14581
15803
|
options
|
|
14582
15804
|
);
|
|
15805
|
+
}
|
|
15806
|
+
},
|
|
15807
|
+
/** Training analytics — workspace-level extraction training metrics. */
|
|
15808
|
+
trainingAnalytics: {
|
|
15809
|
+
/**
|
|
15810
|
+
* Retrieves training analytics for a specific workspace, including
|
|
15811
|
+
* accuracy trends, correction counts, and low-confidence documents.
|
|
15812
|
+
*
|
|
15813
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15814
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15815
|
+
* @returns The training analytics object for the workspace.
|
|
15816
|
+
*
|
|
15817
|
+
* @example
|
|
15818
|
+
* ```typescript
|
|
15819
|
+
* const analytics = await admin.extraction.trainingAnalytics.forWorkspace('ws-uuid');
|
|
15820
|
+
* console.log(analytics.avg_confidence, analytics.total_examples);
|
|
15821
|
+
* ```
|
|
15822
|
+
*/
|
|
15823
|
+
forWorkspace: async (workspaceId, options) => {
|
|
15824
|
+
return rb.execute(
|
|
15825
|
+
getAdminWorkspacesByWorkspaceIdTrainingAnalytics,
|
|
15826
|
+
{ path: { workspace_id: workspaceId } },
|
|
15827
|
+
options
|
|
15828
|
+
);
|
|
14583
15829
|
},
|
|
14584
|
-
/**
|
|
14585
|
-
|
|
15830
|
+
/**
|
|
15831
|
+
* Retrieves training analytics for multiple workspaces in a single
|
|
15832
|
+
* request (max 50). Pass workspace IDs as a comma-separated string.
|
|
15833
|
+
*
|
|
15834
|
+
* @param workspaceIds - Comma-separated workspace UUIDs.
|
|
15835
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15836
|
+
* @returns An array of training analytics objects.
|
|
15837
|
+
*
|
|
15838
|
+
* @example
|
|
15839
|
+
* ```typescript
|
|
15840
|
+
* const batch = await admin.extraction.trainingAnalytics.batch('ws-1,ws-2,ws-3');
|
|
15841
|
+
* ```
|
|
15842
|
+
*/
|
|
15843
|
+
batch: async (workspaceIds, options) => {
|
|
14586
15844
|
return rb.execute(
|
|
14587
|
-
|
|
14588
|
-
{},
|
|
15845
|
+
getAdminWorkspacesAnalyticsBatch,
|
|
15846
|
+
{ query: { workspace_ids: workspaceIds } },
|
|
14589
15847
|
options
|
|
14590
15848
|
);
|
|
14591
15849
|
}
|
|
14592
15850
|
},
|
|
14593
|
-
/**
|
|
14594
|
-
|
|
14595
|
-
/**
|
|
15851
|
+
/** Extraction agents — list and predict best extraction agents for documents. */
|
|
15852
|
+
extractionAgents: {
|
|
15853
|
+
/**
|
|
15854
|
+
* Lists all available extraction agents (system agents tagged with
|
|
15855
|
+
* "extraction" category).
|
|
15856
|
+
*
|
|
15857
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15858
|
+
* @returns An array of extraction agent objects.
|
|
15859
|
+
*
|
|
15860
|
+
* @example
|
|
15861
|
+
* ```typescript
|
|
15862
|
+
* const agents = await admin.extraction.extractionAgents.list();
|
|
15863
|
+
* ```
|
|
15864
|
+
*/
|
|
14596
15865
|
list: async (options) => {
|
|
14597
15866
|
return rb.execute(
|
|
14598
|
-
|
|
15867
|
+
getAdminExtractionAgents,
|
|
14599
15868
|
{},
|
|
14600
15869
|
options
|
|
14601
15870
|
);
|
|
14602
15871
|
},
|
|
14603
|
-
/**
|
|
15872
|
+
/**
|
|
15873
|
+
* Retrieves a single extraction agent by its unique identifier.
|
|
15874
|
+
*
|
|
15875
|
+
* @param id - The UUID of the extraction agent.
|
|
15876
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15877
|
+
* @returns The matching extraction agent object.
|
|
15878
|
+
*
|
|
15879
|
+
* @example
|
|
15880
|
+
* ```typescript
|
|
15881
|
+
* const agent = await admin.extraction.extractionAgents.get('agent-uuid');
|
|
15882
|
+
* ```
|
|
15883
|
+
*/
|
|
14604
15884
|
get: async (id, options) => {
|
|
14605
15885
|
return rb.execute(
|
|
14606
|
-
|
|
15886
|
+
getAdminExtractionAgentsById,
|
|
14607
15887
|
{ path: { id } },
|
|
14608
15888
|
options
|
|
14609
15889
|
);
|
|
15890
|
+
},
|
|
15891
|
+
/**
|
|
15892
|
+
* Predicts the best extraction agent for a given document based on its
|
|
15893
|
+
* name, description, or file content.
|
|
15894
|
+
*
|
|
15895
|
+
* @param attributes - Prediction input attributes.
|
|
15896
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15897
|
+
* @returns A prediction result with recommended agents.
|
|
15898
|
+
*
|
|
15899
|
+
* @example
|
|
15900
|
+
* ```typescript
|
|
15901
|
+
* const prediction = await admin.extraction.extractionAgents.predict({
|
|
15902
|
+
* name: 'invoice.pdf',
|
|
15903
|
+
* description: 'Monthly vendor invoice',
|
|
15904
|
+
* file_content: 'Invoice #12345...',
|
|
15905
|
+
* });
|
|
15906
|
+
* ```
|
|
15907
|
+
*/
|
|
15908
|
+
predict: async (attributes, options) => {
|
|
15909
|
+
return rb.execute(
|
|
15910
|
+
postAdminExtractionAgentsPredict,
|
|
15911
|
+
{
|
|
15912
|
+
body: {
|
|
15913
|
+
data: { type: "extraction-agent", attributes }
|
|
15914
|
+
}
|
|
15915
|
+
},
|
|
15916
|
+
options
|
|
15917
|
+
);
|
|
14610
15918
|
}
|
|
14611
15919
|
},
|
|
14612
15920
|
/** Chunk-entity links — bridge between document chunks and knowledge graph entities. */
|
|
14613
15921
|
chunkEntityLinks: {
|
|
14614
|
-
/**
|
|
15922
|
+
/**
|
|
15923
|
+
* Lists all chunk-entity links across the platform.
|
|
15924
|
+
*
|
|
15925
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15926
|
+
* @returns An array of chunk-entity link objects.
|
|
15927
|
+
*
|
|
15928
|
+
* @example
|
|
15929
|
+
* ```typescript
|
|
15930
|
+
* const links = await admin.extraction.chunkEntityLinks.list();
|
|
15931
|
+
* ```
|
|
15932
|
+
*/
|
|
14615
15933
|
list: async (options) => {
|
|
14616
15934
|
return rb.execute(
|
|
14617
15935
|
getAdminExtractionChunkEntityLinks,
|
|
@@ -14619,7 +15937,18 @@ function createExtractionNamespace(rb) {
|
|
|
14619
15937
|
options
|
|
14620
15938
|
);
|
|
14621
15939
|
},
|
|
14622
|
-
/**
|
|
15940
|
+
/**
|
|
15941
|
+
* Retrieves a single chunk-entity link by its unique identifier.
|
|
15942
|
+
*
|
|
15943
|
+
* @param id - The UUID of the chunk-entity link.
|
|
15944
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15945
|
+
* @returns The matching chunk-entity link object.
|
|
15946
|
+
*
|
|
15947
|
+
* @example
|
|
15948
|
+
* ```typescript
|
|
15949
|
+
* const link = await admin.extraction.chunkEntityLinks.get('link-uuid');
|
|
15950
|
+
* ```
|
|
15951
|
+
*/
|
|
14623
15952
|
get: async (id, options) => {
|
|
14624
15953
|
return rb.execute(
|
|
14625
15954
|
getAdminExtractionChunkEntityLinksById,
|
|
@@ -14627,7 +15956,18 @@ function createExtractionNamespace(rb) {
|
|
|
14627
15956
|
options
|
|
14628
15957
|
);
|
|
14629
15958
|
},
|
|
14630
|
-
/**
|
|
15959
|
+
/**
|
|
15960
|
+
* Lists all chunk-entity links for a specific document.
|
|
15961
|
+
*
|
|
15962
|
+
* @param documentId - The UUID of the document.
|
|
15963
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15964
|
+
* @returns An array of chunk-entity links for the document.
|
|
15965
|
+
*
|
|
15966
|
+
* @example
|
|
15967
|
+
* ```typescript
|
|
15968
|
+
* const links = await admin.extraction.chunkEntityLinks.byDocument('doc-uuid');
|
|
15969
|
+
* ```
|
|
15970
|
+
*/
|
|
14631
15971
|
byDocument: async (documentId, options) => {
|
|
14632
15972
|
return rb.execute(
|
|
14633
15973
|
getAdminExtractionChunkEntityLinksDocumentByDocumentId,
|
|
@@ -14635,7 +15975,18 @@ function createExtractionNamespace(rb) {
|
|
|
14635
15975
|
options
|
|
14636
15976
|
);
|
|
14637
15977
|
},
|
|
14638
|
-
/**
|
|
15978
|
+
/**
|
|
15979
|
+
* Lists all chunk-entity links for a specific document chunk.
|
|
15980
|
+
*
|
|
15981
|
+
* @param documentChunkId - The UUID of the document chunk.
|
|
15982
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15983
|
+
* @returns An array of chunk-entity links for the chunk.
|
|
15984
|
+
*
|
|
15985
|
+
* @example
|
|
15986
|
+
* ```typescript
|
|
15987
|
+
* const links = await admin.extraction.chunkEntityLinks.byChunk('chunk-uuid');
|
|
15988
|
+
* ```
|
|
15989
|
+
*/
|
|
14639
15990
|
byChunk: async (documentChunkId, options) => {
|
|
14640
15991
|
return rb.execute(
|
|
14641
15992
|
getAdminExtractionChunkEntityLinksChunkByDocumentChunkId,
|
|
@@ -14643,7 +15994,18 @@ function createExtractionNamespace(rb) {
|
|
|
14643
15994
|
options
|
|
14644
15995
|
);
|
|
14645
15996
|
},
|
|
14646
|
-
/**
|
|
15997
|
+
/**
|
|
15998
|
+
* Lists all chunk-entity links for a specific knowledge graph entity.
|
|
15999
|
+
*
|
|
16000
|
+
* @param graphNodeId - The UUID of the graph node (entity).
|
|
16001
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
16002
|
+
* @returns An array of chunk-entity links for the entity.
|
|
16003
|
+
*
|
|
16004
|
+
* @example
|
|
16005
|
+
* ```typescript
|
|
16006
|
+
* const links = await admin.extraction.chunkEntityLinks.byEntity('node-uuid');
|
|
16007
|
+
* ```
|
|
16008
|
+
*/
|
|
14647
16009
|
byEntity: async (graphNodeId, options) => {
|
|
14648
16010
|
return rb.execute(
|
|
14649
16011
|
getAdminExtractionChunkEntityLinksEntityByGraphNodeId,
|
|
@@ -19282,6 +20644,12 @@ function createClinicalNamespace(rb) {
|
|
|
19282
20644
|
{ path: { id } },
|
|
19283
20645
|
options
|
|
19284
20646
|
),
|
|
20647
|
+
/** List medications for a patient. */
|
|
20648
|
+
medications: async (id, options) => rb.execute(
|
|
20649
|
+
getAdminClinicalPatientsByIdMedications,
|
|
20650
|
+
{ path: { id } },
|
|
20651
|
+
options
|
|
20652
|
+
),
|
|
19285
20653
|
/** List resource assignments for a patient. */
|
|
19286
20654
|
resourceAssignments: async (id, options) => rb.execute(
|
|
19287
20655
|
getAdminClinicalPatientsByIdResourceAssignments,
|
|
@@ -19983,6 +21351,96 @@ function createClinicalNamespace(rb) {
|
|
|
19983
21351
|
options
|
|
19984
21352
|
).then((r) => r.data)
|
|
19985
21353
|
},
|
|
21354
|
+
/**
|
|
21355
|
+
* Manage medication prescriptions for clinical patients.
|
|
21356
|
+
*/
|
|
21357
|
+
clientMedications: {
|
|
21358
|
+
/** List medication prescriptions. */
|
|
21359
|
+
list: async (params, options) => rb.execute(
|
|
21360
|
+
getAdminClinicalClientMedications,
|
|
21361
|
+
{ query: params ?? {} },
|
|
21362
|
+
options
|
|
21363
|
+
),
|
|
21364
|
+
/** Get a single medication prescription by ID. */
|
|
21365
|
+
get: async (id, options) => rb.execute(
|
|
21366
|
+
getAdminClinicalClientMedicationsById,
|
|
21367
|
+
{ path: { id } },
|
|
21368
|
+
options
|
|
21369
|
+
),
|
|
21370
|
+
/** Create a new medication prescription. */
|
|
21371
|
+
create: async (attributes, options) => rb.execute(
|
|
21372
|
+
postAdminClinicalClientMedications,
|
|
21373
|
+
{
|
|
21374
|
+
body: { data: { type: "clinical-client-medication", attributes } }
|
|
21375
|
+
},
|
|
21376
|
+
options
|
|
21377
|
+
),
|
|
21378
|
+
/** Update a medication prescription. */
|
|
21379
|
+
update: async (id, attributes, options) => rb.execute(
|
|
21380
|
+
patchAdminClinicalClientMedicationsById,
|
|
21381
|
+
{
|
|
21382
|
+
path: { id },
|
|
21383
|
+
body: {
|
|
21384
|
+
data: { type: "clinical-client-medication", id, attributes }
|
|
21385
|
+
}
|
|
21386
|
+
},
|
|
21387
|
+
options
|
|
21388
|
+
),
|
|
21389
|
+
/**
|
|
21390
|
+
* Delete (archive) a medication prescription.
|
|
21391
|
+
* @deprecated Use {@link archive} instead.
|
|
21392
|
+
*/
|
|
21393
|
+
delete: async (id, options) => rb.execute(
|
|
21394
|
+
patchAdminClinicalClientMedicationsByIdArchive,
|
|
21395
|
+
{
|
|
21396
|
+
path: { id },
|
|
21397
|
+
body: {
|
|
21398
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21399
|
+
}
|
|
21400
|
+
},
|
|
21401
|
+
options
|
|
21402
|
+
),
|
|
21403
|
+
/** Archive (soft-delete) a medication prescription. */
|
|
21404
|
+
archive: async (id, options) => rb.execute(
|
|
21405
|
+
patchAdminClinicalClientMedicationsByIdArchive,
|
|
21406
|
+
{
|
|
21407
|
+
path: { id },
|
|
21408
|
+
body: {
|
|
21409
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21410
|
+
}
|
|
21411
|
+
},
|
|
21412
|
+
options
|
|
21413
|
+
),
|
|
21414
|
+
/** Restore an archived medication prescription. */
|
|
21415
|
+
restore: async (id, options) => rb.execute(
|
|
21416
|
+
patchAdminClinicalClientMedicationsByIdRestore,
|
|
21417
|
+
{
|
|
21418
|
+
path: { id },
|
|
21419
|
+
body: {
|
|
21420
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21421
|
+
}
|
|
21422
|
+
},
|
|
21423
|
+
options
|
|
21424
|
+
),
|
|
21425
|
+
/** Permanently delete a medication prescription. Irreversible. */
|
|
21426
|
+
permanentDelete: async (id, options) => rb.executeDelete(
|
|
21427
|
+
deleteAdminClinicalClientMedicationsByIdPermanent,
|
|
21428
|
+
{ path: { id } },
|
|
21429
|
+
options
|
|
21430
|
+
),
|
|
21431
|
+
/** List archived (soft-deleted) medication prescriptions. */
|
|
21432
|
+
listArchived: async (params, options) => rb.execute(
|
|
21433
|
+
getAdminClinicalClientMedicationsArchived,
|
|
21434
|
+
{ query: params ?? {} },
|
|
21435
|
+
options
|
|
21436
|
+
),
|
|
21437
|
+
/** Create multiple medications in a single request. */
|
|
21438
|
+
bulkCreate: async (attrs, options) => rb.rawPost(
|
|
21439
|
+
`/admin/clinical/client-medications/bulk`,
|
|
21440
|
+
{ data: attrs },
|
|
21441
|
+
options
|
|
21442
|
+
).then((r) => r.data)
|
|
21443
|
+
},
|
|
19986
21444
|
/** View and update clinical delivery audit records. */
|
|
19987
21445
|
deliveries: {
|
|
19988
21446
|
/** List deliveries. */
|
|
@@ -21080,6 +22538,72 @@ function createImportsNamespace(rb) {
|
|
|
21080
22538
|
};
|
|
21081
22539
|
}
|
|
21082
22540
|
|
|
22541
|
+
// src/namespaces/documents.ts
|
|
22542
|
+
function createDocumentsNamespace(rb) {
|
|
22543
|
+
return {
|
|
22544
|
+
/**
|
|
22545
|
+
* Generate a PDF from HTML content and store it in platform Storage.
|
|
22546
|
+
*
|
|
22547
|
+
* Always pass `store: true` and `workspace_id` to get a JSON response with
|
|
22548
|
+
* a `storage_key`. Without `store: true`, the server returns raw
|
|
22549
|
+
* `application/pdf` binary which cannot be parsed as JSON by this SDK method.
|
|
22550
|
+
*
|
|
22551
|
+
* HTML input is capped at 2MB by the server.
|
|
22552
|
+
*
|
|
22553
|
+
* @param params - PDF generation parameters. Set `store: true` and provide
|
|
22554
|
+
* `workspace_id` for JSON response.
|
|
22555
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
22556
|
+
* @returns A storage key reference for the generated PDF.
|
|
22557
|
+
*
|
|
22558
|
+
* @example
|
|
22559
|
+
* ```typescript
|
|
22560
|
+
* const { storage_key } = await admin.documents.generatePdf({
|
|
22561
|
+
* html: '<html><body>Report</body></html>',
|
|
22562
|
+
* store: true,
|
|
22563
|
+
* workspace_id: 'ws-123',
|
|
22564
|
+
* });
|
|
22565
|
+
* ```
|
|
22566
|
+
*/
|
|
22567
|
+
generatePdf: async (params, options) => {
|
|
22568
|
+
return rb.rawPostDirect(
|
|
22569
|
+
"/isv/documents/pdf",
|
|
22570
|
+
params,
|
|
22571
|
+
options
|
|
22572
|
+
);
|
|
22573
|
+
},
|
|
22574
|
+
/**
|
|
22575
|
+
* Generate a PDF from HTML and email it as an attachment.
|
|
22576
|
+
*
|
|
22577
|
+
* The PDF is generated server-side and delivered via platform SMTP.
|
|
22578
|
+
* Optionally stores the PDF in platform Storage alongside the email delivery.
|
|
22579
|
+
*
|
|
22580
|
+
* If storage fails but the email succeeds, the response includes
|
|
22581
|
+
* `storage_error` with the failure reason (email is still delivered).
|
|
22582
|
+
*
|
|
22583
|
+
* @param params - Email report parameters.
|
|
22584
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
22585
|
+
* @returns Delivery status, optional storage key, and any storage error.
|
|
22586
|
+
*
|
|
22587
|
+
* @example
|
|
22588
|
+
* ```typescript
|
|
22589
|
+
* const result = await admin.documents.emailReport({
|
|
22590
|
+
* html: '<html><body><h1>Q1 Summary</h1></body></html>',
|
|
22591
|
+
* to: 'finance@company.com',
|
|
22592
|
+
* subject: 'Q1 Financial Summary',
|
|
22593
|
+
* });
|
|
22594
|
+
* console.log(result.sent); // true
|
|
22595
|
+
* ```
|
|
22596
|
+
*/
|
|
22597
|
+
emailReport: async (params, options) => {
|
|
22598
|
+
return rb.rawPostDirect(
|
|
22599
|
+
"/isv/documents/pdf/email",
|
|
22600
|
+
params,
|
|
22601
|
+
options
|
|
22602
|
+
);
|
|
22603
|
+
}
|
|
22604
|
+
};
|
|
22605
|
+
}
|
|
22606
|
+
|
|
21083
22607
|
// src/gpt-admin.ts
|
|
21084
22608
|
var GptAdmin = class extends BaseClient {
|
|
21085
22609
|
constructor(config) {
|
|
@@ -21096,7 +22620,7 @@ var GptAdmin = class extends BaseClient {
|
|
|
21096
22620
|
this.capabilities = createCapabilitiesNamespace(rb);
|
|
21097
22621
|
this.apiKeys = createApiKeysNamespace(rb);
|
|
21098
22622
|
this.extraction = createExtractionNamespace(rb);
|
|
21099
|
-
this.documents =
|
|
22623
|
+
this.documents = createDocumentsNamespace(rb);
|
|
21100
22624
|
this.executions = createExecutionsNamespace(rb);
|
|
21101
22625
|
this.storage = createStorageNamespace(rb);
|
|
21102
22626
|
this.users = createUsersNamespace(rb);
|