@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.js
CHANGED
|
@@ -855,7 +855,7 @@ var createClient = (config = {}) => {
|
|
|
855
855
|
};
|
|
856
856
|
|
|
857
857
|
// src/version.ts
|
|
858
|
-
var SDK_VERSION = "0.10.
|
|
858
|
+
var SDK_VERSION = "0.10.5";
|
|
859
859
|
var DEFAULT_API_VERSION = "2026-03-23";
|
|
860
860
|
|
|
861
861
|
// src/base-client.ts
|
|
@@ -1317,6 +1317,31 @@ var RequestBuilder = class {
|
|
|
1317
1317
|
throw handleApiError(error);
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Execute a raw POST to a custom endpoint that returns flat JSON (no data wrapper).
|
|
1322
|
+
* Unlike rawPost (which unwraps data.data), this returns the response body directly.
|
|
1323
|
+
* Used for hand-written Phoenix controllers like DocumentsController.
|
|
1324
|
+
*/
|
|
1325
|
+
async rawPostDirect(url, body, options) {
|
|
1326
|
+
const headers = buildHeaders(this.getHeaders, options);
|
|
1327
|
+
try {
|
|
1328
|
+
const result = await this.requestWithRetry(
|
|
1329
|
+
() => this.clientInstance.post({
|
|
1330
|
+
url,
|
|
1331
|
+
headers,
|
|
1332
|
+
...body !== void 0 && { body },
|
|
1333
|
+
...options?.signal && { signal: options.signal }
|
|
1334
|
+
})
|
|
1335
|
+
);
|
|
1336
|
+
const { data, error } = result;
|
|
1337
|
+
if (error) {
|
|
1338
|
+
throw handleApiError(enrichError(error, result));
|
|
1339
|
+
}
|
|
1340
|
+
return data;
|
|
1341
|
+
} catch (error) {
|
|
1342
|
+
throw handleApiError(error);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1320
1345
|
/**
|
|
1321
1346
|
* Execute a raw PATCH request to a custom (non-generated) endpoint.
|
|
1322
1347
|
* Used for endpoints implemented as custom Phoenix controllers.
|
|
@@ -1859,6 +1884,11 @@ var patchAdminClinicalGoalTemplatesCatalogByIdArchive = (options) => (options.cl
|
|
|
1859
1884
|
...options.headers
|
|
1860
1885
|
}
|
|
1861
1886
|
});
|
|
1887
|
+
var getAdminClinicalPatientsByIdMedications = (options) => (options.client ?? client).get({
|
|
1888
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
1889
|
+
url: "/admin/clinical/patients/{id}/medications",
|
|
1890
|
+
...options
|
|
1891
|
+
});
|
|
1862
1892
|
var getAdminClinicalHealthMetricsBySession = (options) => (options.client ?? client).get({
|
|
1863
1893
|
security: [{ scheme: "bearer", type: "http" }],
|
|
1864
1894
|
url: "/admin/clinical/health-metrics/by-session",
|
|
@@ -2144,6 +2174,11 @@ var patchAdminIsvCrmEntityTypesById = (options) => (options.client ?? client).pa
|
|
|
2144
2174
|
...options.headers
|
|
2145
2175
|
}
|
|
2146
2176
|
});
|
|
2177
|
+
var getAdminWorkspacesByWorkspaceIdTrainingAnalytics = (options) => (options.client ?? client).get({
|
|
2178
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2179
|
+
url: "/admin/workspaces/{workspace_id}/training/analytics",
|
|
2180
|
+
...options
|
|
2181
|
+
});
|
|
2147
2182
|
var getAdminClinicalMealPlansByPatient = (options) => (options.client ?? client).get({
|
|
2148
2183
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2149
2184
|
url: "/admin/clinical/meal-plans/by-patient",
|
|
@@ -2902,6 +2937,25 @@ var getAdminClinicalPracticeToolsCatalogArchived = (options) => (options.client
|
|
|
2902
2937
|
url: "/admin/clinical/practice-tools/catalog/archived",
|
|
2903
2938
|
...options
|
|
2904
2939
|
});
|
|
2940
|
+
var deleteAdminPostProcessingHooksById = (options) => (options.client ?? client).delete({
|
|
2941
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2942
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2943
|
+
...options
|
|
2944
|
+
});
|
|
2945
|
+
var getAdminPostProcessingHooksById = (options) => (options.client ?? client).get({
|
|
2946
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2947
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2948
|
+
...options
|
|
2949
|
+
});
|
|
2950
|
+
var patchAdminPostProcessingHooksById = (options) => (options.client ?? client).patch({
|
|
2951
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
2952
|
+
url: "/admin/post-processing-hooks/{id}",
|
|
2953
|
+
...options,
|
|
2954
|
+
headers: {
|
|
2955
|
+
"Content-Type": "application/vnd.api+json",
|
|
2956
|
+
...options.headers
|
|
2957
|
+
}
|
|
2958
|
+
});
|
|
2905
2959
|
var getAdminVoiceRecordingsSessionBySessionId = (options) => (options.client ?? client).get({
|
|
2906
2960
|
security: [{ scheme: "bearer", type: "http" }],
|
|
2907
2961
|
url: "/admin/voice/recordings/session/{session_id}",
|
|
@@ -3128,6 +3182,20 @@ var getAdminClinicalNotesByWorkspace = (options) => (options.client ?? client).g
|
|
|
3128
3182
|
url: "/admin/clinical/notes/by-workspace",
|
|
3129
3183
|
...options
|
|
3130
3184
|
});
|
|
3185
|
+
var getAdminClinicalClientMedications = (options) => (options.client ?? client).get({
|
|
3186
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3187
|
+
url: "/admin/clinical/client-medications",
|
|
3188
|
+
...options
|
|
3189
|
+
});
|
|
3190
|
+
var postAdminClinicalClientMedications = (options) => (options.client ?? client).post({
|
|
3191
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3192
|
+
url: "/admin/clinical/client-medications",
|
|
3193
|
+
...options,
|
|
3194
|
+
headers: {
|
|
3195
|
+
"Content-Type": "application/vnd.api+json",
|
|
3196
|
+
...options.headers
|
|
3197
|
+
}
|
|
3198
|
+
});
|
|
3131
3199
|
var deleteAdminCrmCustomEntitiesById = (options) => (options.client ?? client).delete({
|
|
3132
3200
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3133
3201
|
url: "/admin/crm/custom-entities/{id}",
|
|
@@ -3541,6 +3609,15 @@ var getAdminVoiceSessionsById = (options) => (options.client ?? client).get({
|
|
|
3541
3609
|
url: "/admin/voice/sessions/{id}",
|
|
3542
3610
|
...options
|
|
3543
3611
|
});
|
|
3612
|
+
var patchAdminClinicalClientMedicationsByIdRestore = (options) => (options.client ?? client).patch({
|
|
3613
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
3614
|
+
url: "/admin/clinical/client-medications/{id}/restore",
|
|
3615
|
+
...options,
|
|
3616
|
+
headers: {
|
|
3617
|
+
"Content-Type": "application/vnd.api+json",
|
|
3618
|
+
...options.headers
|
|
3619
|
+
}
|
|
3620
|
+
});
|
|
3544
3621
|
var deleteAdminWebhookConfigsById = (options) => (options.client ?? client).delete({
|
|
3545
3622
|
security: [{ scheme: "bearer", type: "http" }],
|
|
3546
3623
|
url: "/admin/webhook-configs/{id}",
|
|
@@ -4037,6 +4114,15 @@ var getAdminEmailMarketingTemplatesWorkspaceByWorkspaceId = (options) => (option
|
|
|
4037
4114
|
url: "/admin/email-marketing/templates/workspace/{workspace_id}",
|
|
4038
4115
|
...options
|
|
4039
4116
|
});
|
|
4117
|
+
var postAdminExtractionAgentsPredict = (options) => (options.client ?? client).post({
|
|
4118
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4119
|
+
url: "/admin/extraction/agents/predict",
|
|
4120
|
+
...options,
|
|
4121
|
+
headers: {
|
|
4122
|
+
"Content-Type": "application/vnd.api+json",
|
|
4123
|
+
...options.headers
|
|
4124
|
+
}
|
|
4125
|
+
});
|
|
4040
4126
|
var postAdminSocialCampaignsByIdGenerateMasterCopy = (options) => (options.client ?? client).post({
|
|
4041
4127
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4042
4128
|
url: "/admin/social/campaigns/{id}/generate-master-copy",
|
|
@@ -4214,6 +4300,11 @@ var patchAdminLegalDocumentsByIdUnpublish = (options) => (options.client ?? clie
|
|
|
4214
4300
|
...options.headers
|
|
4215
4301
|
}
|
|
4216
4302
|
});
|
|
4303
|
+
var getAdminExtractionAgents = (options) => (options.client ?? client).get({
|
|
4304
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4305
|
+
url: "/admin/extraction/agents",
|
|
4306
|
+
...options
|
|
4307
|
+
});
|
|
4217
4308
|
var getAdminWalletUsage = (options) => (options.client ?? client).get({
|
|
4218
4309
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4219
4310
|
url: "/admin/wallet/usage",
|
|
@@ -4846,6 +4937,11 @@ var getAdminAgentVersionRevisionsById = (options) => (options.client ?? client).
|
|
|
4846
4937
|
url: "/admin/agent-version-revisions/{id}",
|
|
4847
4938
|
...options
|
|
4848
4939
|
});
|
|
4940
|
+
var getAdminExtractionAgentsById = (options) => (options.client ?? client).get({
|
|
4941
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4942
|
+
url: "/admin/extraction/agents/{id}",
|
|
4943
|
+
...options
|
|
4944
|
+
});
|
|
4849
4945
|
var getAdminSchedulingEventsByDateRange = (options) => (options.client ?? client).get({
|
|
4850
4946
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4851
4947
|
url: "/admin/scheduling/events/by_date_range",
|
|
@@ -4866,6 +4962,11 @@ var getAdminAgentVersionRevisions = (options) => (options.client ?? client).get(
|
|
|
4866
4962
|
url: "/admin/agent-version-revisions",
|
|
4867
4963
|
...options
|
|
4868
4964
|
});
|
|
4965
|
+
var deleteAdminClinicalClientMedicationsByIdPermanent = (options) => (options.client ?? client).delete({
|
|
4966
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
4967
|
+
url: "/admin/clinical/client-medications/{id}/permanent",
|
|
4968
|
+
...options
|
|
4969
|
+
});
|
|
4869
4970
|
var getAdminAgentTools = (options) => (options.client ?? client).get({
|
|
4870
4971
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4871
4972
|
url: "/admin/agent-tools",
|
|
@@ -4994,6 +5095,11 @@ var postAdminWebhookConfigs = (options) => (options.client ?? client).post({
|
|
|
4994
5095
|
...options.headers
|
|
4995
5096
|
}
|
|
4996
5097
|
});
|
|
5098
|
+
var getAdminWorkspacesAnalyticsBatch = (options) => (options.client ?? client).get({
|
|
5099
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5100
|
+
url: "/admin/workspaces/analytics-batch",
|
|
5101
|
+
...options
|
|
5102
|
+
});
|
|
4997
5103
|
var getAdminExtractionConfigEnums = (options) => (options.client ?? client).get({
|
|
4998
5104
|
security: [{ scheme: "bearer", type: "http" }],
|
|
4999
5105
|
url: "/admin/extraction/config-enums",
|
|
@@ -5482,6 +5588,20 @@ var postAdminClinicalGoalTemplatesFromExisting = (options) => (options.client ??
|
|
|
5482
5588
|
...options.headers
|
|
5483
5589
|
}
|
|
5484
5590
|
});
|
|
5591
|
+
var getAdminClinicalClientMedicationsById = (options) => (options.client ?? client).get({
|
|
5592
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5593
|
+
url: "/admin/clinical/client-medications/{id}",
|
|
5594
|
+
...options
|
|
5595
|
+
});
|
|
5596
|
+
var patchAdminClinicalClientMedicationsById = (options) => (options.client ?? client).patch({
|
|
5597
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
5598
|
+
url: "/admin/clinical/client-medications/{id}",
|
|
5599
|
+
...options,
|
|
5600
|
+
headers: {
|
|
5601
|
+
"Content-Type": "application/vnd.api+json",
|
|
5602
|
+
...options.headers
|
|
5603
|
+
}
|
|
5604
|
+
});
|
|
5485
5605
|
var getAdminThreadsStats = (options) => (options.client ?? client).get({
|
|
5486
5606
|
security: [{ scheme: "bearer", type: "http" }],
|
|
5487
5607
|
url: "/admin/threads/stats",
|
|
@@ -6029,6 +6149,15 @@ var postAdminEmailMarketingTemplatesCompile = (options) => (options.client ?? cl
|
|
|
6029
6149
|
...options.headers
|
|
6030
6150
|
}
|
|
6031
6151
|
});
|
|
6152
|
+
var postAdminSocialCampaignsByIdPreviewAdaptations = (options) => (options.client ?? client).post({
|
|
6153
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6154
|
+
url: "/admin/social/campaigns/{id}/preview-adaptations",
|
|
6155
|
+
...options,
|
|
6156
|
+
headers: {
|
|
6157
|
+
"Content-Type": "application/vnd.api+json",
|
|
6158
|
+
...options.headers
|
|
6159
|
+
}
|
|
6160
|
+
});
|
|
6032
6161
|
var getAdminClinicalNotesArchived = (options) => (options.client ?? client).get({
|
|
6033
6162
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6034
6163
|
url: "/admin/clinical/notes/archived",
|
|
@@ -6648,6 +6777,20 @@ var patchAdminCrawlerSchedulesByIdEnable = (options) => (options.client ?? clien
|
|
|
6648
6777
|
...options.headers
|
|
6649
6778
|
}
|
|
6650
6779
|
});
|
|
6780
|
+
var getAdminPostProcessingHooks = (options) => (options.client ?? client).get({
|
|
6781
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6782
|
+
url: "/admin/post-processing-hooks",
|
|
6783
|
+
...options
|
|
6784
|
+
});
|
|
6785
|
+
var postAdminPostProcessingHooks = (options) => (options.client ?? client).post({
|
|
6786
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
6787
|
+
url: "/admin/post-processing-hooks",
|
|
6788
|
+
...options,
|
|
6789
|
+
headers: {
|
|
6790
|
+
"Content-Type": "application/vnd.api+json",
|
|
6791
|
+
...options.headers
|
|
6792
|
+
}
|
|
6793
|
+
});
|
|
6651
6794
|
var postAdminAgentsByIdAnalyzeTraining = (options) => (options.client ?? client).post({
|
|
6652
6795
|
security: [{ scheme: "bearer", type: "http" }],
|
|
6653
6796
|
url: "/admin/agents/{id}/analyze-training",
|
|
@@ -7269,6 +7412,20 @@ var getAdminClinicalPracticeToolsCategoriesCatalog = (options) => (options.clien
|
|
|
7269
7412
|
url: "/admin/clinical/practice-tools/categories/catalog",
|
|
7270
7413
|
...options
|
|
7271
7414
|
});
|
|
7415
|
+
var patchAdminClinicalClientMedicationsByIdArchive = (options) => (options.client ?? client).patch({
|
|
7416
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7417
|
+
url: "/admin/clinical/client-medications/{id}/archive",
|
|
7418
|
+
...options,
|
|
7419
|
+
headers: {
|
|
7420
|
+
"Content-Type": "application/vnd.api+json",
|
|
7421
|
+
...options.headers
|
|
7422
|
+
}
|
|
7423
|
+
});
|
|
7424
|
+
var getAdminClinicalClientMedicationsArchived = (options) => (options.client ?? client).get({
|
|
7425
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
7426
|
+
url: "/admin/clinical/client-medications/archived",
|
|
7427
|
+
...options
|
|
7428
|
+
});
|
|
7272
7429
|
var getAdminVoiceRecordings = (options) => (options.client ?? client).get({
|
|
7273
7430
|
security: [{ scheme: "bearer", type: "http" }],
|
|
7274
7431
|
url: "/admin/voice/recordings",
|
|
@@ -9797,6 +9954,21 @@ function createStorageNamespace(rb) {
|
|
|
9797
9954
|
{ query: { parent_id: parentId } },
|
|
9798
9955
|
options
|
|
9799
9956
|
);
|
|
9957
|
+
},
|
|
9958
|
+
/**
|
|
9959
|
+
* Generate a short-lived presigned download URL for a file.
|
|
9960
|
+
*
|
|
9961
|
+
* @param id - The UUID of the file to download.
|
|
9962
|
+
* @param params - Optional parameters (e.g., custom `expires_in` seconds).
|
|
9963
|
+
* @param options - Optional request options.
|
|
9964
|
+
* @returns A promise resolving to the presigned URL and its expiry.
|
|
9965
|
+
*/
|
|
9966
|
+
requestDownloadUrl: async (id, params, options) => {
|
|
9967
|
+
return rb.rawPostDirect(
|
|
9968
|
+
`/isv/storage-files/${id}/download-url`,
|
|
9969
|
+
params?.expires_in != null ? { data: { expires_in: params.expires_in } } : void 0,
|
|
9970
|
+
options
|
|
9971
|
+
);
|
|
9800
9972
|
}
|
|
9801
9973
|
},
|
|
9802
9974
|
/**
|
|
@@ -13385,6 +13557,32 @@ function createSocialNamespace(rb) {
|
|
|
13385
13557
|
},
|
|
13386
13558
|
options
|
|
13387
13559
|
);
|
|
13560
|
+
},
|
|
13561
|
+
/**
|
|
13562
|
+
* Preview adapted copy per platform without creating SocialPost records.
|
|
13563
|
+
*
|
|
13564
|
+
* Returns the AI-adapted text for each target platform so the user can
|
|
13565
|
+
* review before committing via `adaptForPlatforms`.
|
|
13566
|
+
*
|
|
13567
|
+
* @param id - Campaign UUID.
|
|
13568
|
+
* @param workspaceId - Workspace UUID.
|
|
13569
|
+
* @param options - Optional request options.
|
|
13570
|
+
* @returns `{ adaptations: [{ platform: string, content: string }] }`
|
|
13571
|
+
*/
|
|
13572
|
+
previewAdaptations: async (id, workspaceId, options) => {
|
|
13573
|
+
return rb.execute(
|
|
13574
|
+
postAdminSocialCampaignsByIdPreviewAdaptations,
|
|
13575
|
+
{
|
|
13576
|
+
path: { id },
|
|
13577
|
+
body: {
|
|
13578
|
+
data: {
|
|
13579
|
+
campaign_id: id,
|
|
13580
|
+
workspace_id: workspaceId
|
|
13581
|
+
}
|
|
13582
|
+
}
|
|
13583
|
+
},
|
|
13584
|
+
options
|
|
13585
|
+
);
|
|
13388
13586
|
}
|
|
13389
13587
|
},
|
|
13390
13588
|
/** Trending content discovery — snapshots, items, and watch alerts. */
|
|
@@ -13987,7 +14185,17 @@ function createExtractionNamespace(rb) {
|
|
|
13987
14185
|
return {
|
|
13988
14186
|
/** Document lifecycle — upload, process, review, train, bulk operations. */
|
|
13989
14187
|
documents: {
|
|
13990
|
-
/**
|
|
14188
|
+
/**
|
|
14189
|
+
* Lists all extraction documents across the platform.
|
|
14190
|
+
*
|
|
14191
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14192
|
+
* @returns An array of extraction document objects.
|
|
14193
|
+
*
|
|
14194
|
+
* @example
|
|
14195
|
+
* ```typescript
|
|
14196
|
+
* const docs = await admin.extraction.documents.list();
|
|
14197
|
+
* ```
|
|
14198
|
+
*/
|
|
13991
14199
|
list: async (options) => {
|
|
13992
14200
|
return rb.execute(
|
|
13993
14201
|
getAdminExtractionDocuments,
|
|
@@ -13995,7 +14203,19 @@ function createExtractionNamespace(rb) {
|
|
|
13995
14203
|
options
|
|
13996
14204
|
);
|
|
13997
14205
|
},
|
|
13998
|
-
/**
|
|
14206
|
+
/**
|
|
14207
|
+
* Retrieves a single extraction document by its unique identifier.
|
|
14208
|
+
*
|
|
14209
|
+
* @param id - The UUID of the document to retrieve.
|
|
14210
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14211
|
+
* @returns The matching extraction document object.
|
|
14212
|
+
*
|
|
14213
|
+
* @example
|
|
14214
|
+
* ```typescript
|
|
14215
|
+
* const doc = await admin.extraction.documents.get('doc-uuid');
|
|
14216
|
+
* console.log(doc.status, doc.filename);
|
|
14217
|
+
* ```
|
|
14218
|
+
*/
|
|
13999
14219
|
get: async (id, options) => {
|
|
14000
14220
|
return rb.execute(
|
|
14001
14221
|
getAdminExtractionDocumentsById,
|
|
@@ -14003,7 +14223,18 @@ function createExtractionNamespace(rb) {
|
|
|
14003
14223
|
options
|
|
14004
14224
|
);
|
|
14005
14225
|
},
|
|
14006
|
-
/**
|
|
14226
|
+
/**
|
|
14227
|
+
* Permanently deletes an extraction document and its associated results.
|
|
14228
|
+
*
|
|
14229
|
+
* @param id - The UUID of the document to delete.
|
|
14230
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14231
|
+
* @returns `true` when the deletion succeeds.
|
|
14232
|
+
*
|
|
14233
|
+
* @example
|
|
14234
|
+
* ```typescript
|
|
14235
|
+
* await admin.extraction.documents.delete('doc-uuid');
|
|
14236
|
+
* ```
|
|
14237
|
+
*/
|
|
14007
14238
|
delete: async (id, options) => {
|
|
14008
14239
|
return rb.executeDelete(
|
|
14009
14240
|
deleteAdminExtractionDocumentsById,
|
|
@@ -14011,7 +14242,19 @@ function createExtractionNamespace(rb) {
|
|
|
14011
14242
|
options
|
|
14012
14243
|
);
|
|
14013
14244
|
},
|
|
14014
|
-
/**
|
|
14245
|
+
/**
|
|
14246
|
+
* Retrieves the rendered view of a document, including page images and
|
|
14247
|
+
* overlay data for visual inspection.
|
|
14248
|
+
*
|
|
14249
|
+
* @param id - The UUID of the document.
|
|
14250
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14251
|
+
* @returns The document object with rendered view data.
|
|
14252
|
+
*
|
|
14253
|
+
* @example
|
|
14254
|
+
* ```typescript
|
|
14255
|
+
* const view = await admin.extraction.documents.view('doc-uuid');
|
|
14256
|
+
* ```
|
|
14257
|
+
*/
|
|
14015
14258
|
view: async (id, options) => {
|
|
14016
14259
|
return rb.execute(
|
|
14017
14260
|
getAdminExtractionDocumentsByIdView,
|
|
@@ -14019,7 +14262,20 @@ function createExtractionNamespace(rb) {
|
|
|
14019
14262
|
options
|
|
14020
14263
|
);
|
|
14021
14264
|
},
|
|
14022
|
-
/**
|
|
14265
|
+
/**
|
|
14266
|
+
* Retrieves the current processing status of a document, including
|
|
14267
|
+
* progress percentage and any error details.
|
|
14268
|
+
*
|
|
14269
|
+
* @param id - The UUID of the document.
|
|
14270
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14271
|
+
* @returns The document object with current status fields.
|
|
14272
|
+
*
|
|
14273
|
+
* @example
|
|
14274
|
+
* ```typescript
|
|
14275
|
+
* const { status, progress_percent } = await admin.extraction.documents.status('doc-uuid');
|
|
14276
|
+
* console.log(`Status: ${status} (${progress_percent}%)`);
|
|
14277
|
+
* ```
|
|
14278
|
+
*/
|
|
14023
14279
|
status: async (id, options) => {
|
|
14024
14280
|
return rb.execute(
|
|
14025
14281
|
getAdminExtractionDocumentsByIdStatus,
|
|
@@ -14027,7 +14283,22 @@ function createExtractionNamespace(rb) {
|
|
|
14027
14283
|
options
|
|
14028
14284
|
);
|
|
14029
14285
|
},
|
|
14030
|
-
/**
|
|
14286
|
+
/**
|
|
14287
|
+
* Updates the processing status of a document. Used by admin tooling to
|
|
14288
|
+
* manually transition a document between pipeline states.
|
|
14289
|
+
*
|
|
14290
|
+
* @param id - The UUID of the document to update.
|
|
14291
|
+
* @param attributes - The status attributes to set.
|
|
14292
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14293
|
+
* @returns The updated extraction document object.
|
|
14294
|
+
*
|
|
14295
|
+
* @example
|
|
14296
|
+
* ```typescript
|
|
14297
|
+
* const doc = await admin.extraction.documents.updateStatus('doc-uuid', {
|
|
14298
|
+
* status: 'completed',
|
|
14299
|
+
* });
|
|
14300
|
+
* ```
|
|
14301
|
+
*/
|
|
14031
14302
|
updateStatus: async (id, attributes, options) => {
|
|
14032
14303
|
return rb.execute(
|
|
14033
14304
|
patchAdminExtractionDocumentsByIdStatus,
|
|
@@ -14040,7 +14311,20 @@ function createExtractionNamespace(rb) {
|
|
|
14040
14311
|
options
|
|
14041
14312
|
);
|
|
14042
14313
|
},
|
|
14043
|
-
/**
|
|
14314
|
+
/**
|
|
14315
|
+
* Reprocesses a completed or failed document through the extraction
|
|
14316
|
+
* pipeline from scratch.
|
|
14317
|
+
*
|
|
14318
|
+
* @param id - The UUID of the document to reprocess.
|
|
14319
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14320
|
+
* @returns The document object with its new processing status.
|
|
14321
|
+
*
|
|
14322
|
+
* @example
|
|
14323
|
+
* ```typescript
|
|
14324
|
+
* const doc = await admin.extraction.documents.reprocess('doc-uuid');
|
|
14325
|
+
* console.log(`Reprocessing: ${doc.status}`);
|
|
14326
|
+
* ```
|
|
14327
|
+
*/
|
|
14044
14328
|
reprocess: async (id, options) => {
|
|
14045
14329
|
return rb.execute(
|
|
14046
14330
|
patchAdminExtractionDocumentsByIdReprocess,
|
|
@@ -14048,7 +14332,18 @@ function createExtractionNamespace(rb) {
|
|
|
14048
14332
|
options
|
|
14049
14333
|
);
|
|
14050
14334
|
},
|
|
14051
|
-
/**
|
|
14335
|
+
/**
|
|
14336
|
+
* Cancels a document that is currently queued or being processed.
|
|
14337
|
+
*
|
|
14338
|
+
* @param id - The UUID of the document to cancel.
|
|
14339
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14340
|
+
* @returns The document object with its updated (cancelled) status.
|
|
14341
|
+
*
|
|
14342
|
+
* @example
|
|
14343
|
+
* ```typescript
|
|
14344
|
+
* const doc = await admin.extraction.documents.cancel('doc-uuid');
|
|
14345
|
+
* ```
|
|
14346
|
+
*/
|
|
14052
14347
|
cancel: async (id, options) => {
|
|
14053
14348
|
return rb.execute(
|
|
14054
14349
|
patchAdminExtractionDocumentsByIdCancel,
|
|
@@ -14056,7 +14351,19 @@ function createExtractionNamespace(rb) {
|
|
|
14056
14351
|
options
|
|
14057
14352
|
);
|
|
14058
14353
|
},
|
|
14059
|
-
/**
|
|
14354
|
+
/**
|
|
14355
|
+
* Dismisses a document from the review queue without changing its
|
|
14356
|
+
* underlying data or verification status.
|
|
14357
|
+
*
|
|
14358
|
+
* @param id - The UUID of the document to dismiss.
|
|
14359
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14360
|
+
* @returns The updated extraction document object.
|
|
14361
|
+
*
|
|
14362
|
+
* @example
|
|
14363
|
+
* ```typescript
|
|
14364
|
+
* await admin.extraction.documents.dismiss('doc-uuid');
|
|
14365
|
+
* ```
|
|
14366
|
+
*/
|
|
14060
14367
|
dismiss: async (id, options) => {
|
|
14061
14368
|
return rb.execute(
|
|
14062
14369
|
patchAdminExtractionDocumentsByIdDismiss,
|
|
@@ -14064,7 +14371,19 @@ function createExtractionNamespace(rb) {
|
|
|
14064
14371
|
options
|
|
14065
14372
|
);
|
|
14066
14373
|
},
|
|
14067
|
-
/**
|
|
14374
|
+
/**
|
|
14375
|
+
* Excludes a document from the training dataset. Excluded documents are
|
|
14376
|
+
* not used when retraining extraction models.
|
|
14377
|
+
*
|
|
14378
|
+
* @param id - The UUID of the document to exclude.
|
|
14379
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14380
|
+
* @returns The updated extraction document object.
|
|
14381
|
+
*
|
|
14382
|
+
* @example
|
|
14383
|
+
* ```typescript
|
|
14384
|
+
* await admin.extraction.documents.exclude('doc-uuid');
|
|
14385
|
+
* ```
|
|
14386
|
+
*/
|
|
14068
14387
|
exclude: async (id, options) => {
|
|
14069
14388
|
return rb.execute(
|
|
14070
14389
|
patchAdminExtractionDocumentsByIdExclude,
|
|
@@ -14072,7 +14391,18 @@ function createExtractionNamespace(rb) {
|
|
|
14072
14391
|
options
|
|
14073
14392
|
);
|
|
14074
14393
|
},
|
|
14075
|
-
/**
|
|
14394
|
+
/**
|
|
14395
|
+
* Re-includes a previously excluded document in the training dataset.
|
|
14396
|
+
*
|
|
14397
|
+
* @param id - The UUID of the document to include.
|
|
14398
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14399
|
+
* @returns The updated extraction document object.
|
|
14400
|
+
*
|
|
14401
|
+
* @example
|
|
14402
|
+
* ```typescript
|
|
14403
|
+
* await admin.extraction.documents.include('doc-uuid');
|
|
14404
|
+
* ```
|
|
14405
|
+
*/
|
|
14076
14406
|
include: async (id, options) => {
|
|
14077
14407
|
return rb.execute(
|
|
14078
14408
|
patchAdminExtractionDocumentsByIdInclude,
|
|
@@ -14080,7 +14410,19 @@ function createExtractionNamespace(rb) {
|
|
|
14080
14410
|
options
|
|
14081
14411
|
);
|
|
14082
14412
|
},
|
|
14083
|
-
/**
|
|
14413
|
+
/**
|
|
14414
|
+
* Restores a soft-deleted (trashed) document back to active status.
|
|
14415
|
+
*
|
|
14416
|
+
* @param id - The UUID of the document to restore.
|
|
14417
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14418
|
+
* @returns The restored extraction document object.
|
|
14419
|
+
*
|
|
14420
|
+
* @example
|
|
14421
|
+
* ```typescript
|
|
14422
|
+
* const doc = await admin.extraction.documents.restore('doc-uuid');
|
|
14423
|
+
* console.log(`Restored: ${doc.filename}`);
|
|
14424
|
+
* ```
|
|
14425
|
+
*/
|
|
14084
14426
|
restore: async (id, options) => {
|
|
14085
14427
|
return rb.execute(
|
|
14086
14428
|
patchAdminExtractionDocumentsByIdRestore,
|
|
@@ -14088,7 +14430,23 @@ function createExtractionNamespace(rb) {
|
|
|
14088
14430
|
options
|
|
14089
14431
|
);
|
|
14090
14432
|
},
|
|
14091
|
-
/**
|
|
14433
|
+
/**
|
|
14434
|
+
* Updates the verification status of a document. Used during the human
|
|
14435
|
+
* review step to confirm or reject extracted data.
|
|
14436
|
+
*
|
|
14437
|
+
* @param id - The UUID of the document to update.
|
|
14438
|
+
* @param attributes - Verification attributes to set.
|
|
14439
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14440
|
+
* @returns The updated extraction document object.
|
|
14441
|
+
*
|
|
14442
|
+
* @example
|
|
14443
|
+
* ```typescript
|
|
14444
|
+
* const doc = await admin.extraction.documents.updateVerification('doc-uuid', {
|
|
14445
|
+
* verification_status: 'verified',
|
|
14446
|
+
* avg_confidence: 0.95,
|
|
14447
|
+
* });
|
|
14448
|
+
* ```
|
|
14449
|
+
*/
|
|
14092
14450
|
updateVerification: async (id, attributes, options) => {
|
|
14093
14451
|
return rb.execute(
|
|
14094
14452
|
patchAdminExtractionDocumentsByIdVerification,
|
|
@@ -14101,7 +14459,19 @@ function createExtractionNamespace(rb) {
|
|
|
14101
14459
|
options
|
|
14102
14460
|
);
|
|
14103
14461
|
},
|
|
14104
|
-
/**
|
|
14462
|
+
/**
|
|
14463
|
+
* Marks a document as trained, indicating its extraction results have been
|
|
14464
|
+
* incorporated into the model training set.
|
|
14465
|
+
*
|
|
14466
|
+
* @param id - The UUID of the document to mark as trained.
|
|
14467
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14468
|
+
* @returns The updated extraction document object.
|
|
14469
|
+
*
|
|
14470
|
+
* @example
|
|
14471
|
+
* ```typescript
|
|
14472
|
+
* await admin.extraction.documents.markTrained('doc-uuid');
|
|
14473
|
+
* ```
|
|
14474
|
+
*/
|
|
14105
14475
|
markTrained: async (id, options) => {
|
|
14106
14476
|
return rb.execute(
|
|
14107
14477
|
patchAdminExtractionDocumentsByIdMarkTrained,
|
|
@@ -14109,7 +14479,19 @@ function createExtractionNamespace(rb) {
|
|
|
14109
14479
|
options
|
|
14110
14480
|
);
|
|
14111
14481
|
},
|
|
14112
|
-
/**
|
|
14482
|
+
/**
|
|
14483
|
+
* Dismisses the training flag on a document without un-training it.
|
|
14484
|
+
* Useful for clearing training notifications in the review UI.
|
|
14485
|
+
*
|
|
14486
|
+
* @param id - The UUID of the document.
|
|
14487
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14488
|
+
* @returns The updated extraction document object.
|
|
14489
|
+
*
|
|
14490
|
+
* @example
|
|
14491
|
+
* ```typescript
|
|
14492
|
+
* await admin.extraction.documents.dismissTraining('doc-uuid');
|
|
14493
|
+
* ```
|
|
14494
|
+
*/
|
|
14113
14495
|
dismissTraining: async (id, options) => {
|
|
14114
14496
|
return rb.execute(
|
|
14115
14497
|
patchAdminExtractionDocumentsByIdDismissTraining,
|
|
@@ -14117,7 +14499,19 @@ function createExtractionNamespace(rb) {
|
|
|
14117
14499
|
options
|
|
14118
14500
|
);
|
|
14119
14501
|
},
|
|
14120
|
-
/**
|
|
14502
|
+
/**
|
|
14503
|
+
* Signals the server that a multi-part upload has completed and the
|
|
14504
|
+
* document is ready for processing.
|
|
14505
|
+
*
|
|
14506
|
+
* @param id - The UUID of the document whose upload is being finalized.
|
|
14507
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14508
|
+
* @returns The document object transitioned to processing state.
|
|
14509
|
+
*
|
|
14510
|
+
* @example
|
|
14511
|
+
* ```typescript
|
|
14512
|
+
* await admin.extraction.documents.finishUpload('doc-uuid');
|
|
14513
|
+
* ```
|
|
14514
|
+
*/
|
|
14121
14515
|
finishUpload: async (id, options) => {
|
|
14122
14516
|
return rb.execute(
|
|
14123
14517
|
patchAdminExtractionDocumentsByIdFinishUpload,
|
|
@@ -14125,31 +14519,82 @@ function createExtractionNamespace(rb) {
|
|
|
14125
14519
|
options
|
|
14126
14520
|
);
|
|
14127
14521
|
},
|
|
14128
|
-
/**
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14135
|
-
|
|
14522
|
+
/**
|
|
14523
|
+
* Begins a new document upload and returns a presigned URL for direct
|
|
14524
|
+
* browser-to-storage upload.
|
|
14525
|
+
*
|
|
14526
|
+
* @param attributes - Upload attributes including the filename and optional metadata.
|
|
14527
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14528
|
+
* @returns A presigned URL object for uploading the file.
|
|
14529
|
+
*
|
|
14530
|
+
* @example
|
|
14531
|
+
* ```typescript
|
|
14532
|
+
* const presigned = await admin.extraction.documents.beginUpload({
|
|
14533
|
+
* filename: 'invoice-2026.pdf',
|
|
14534
|
+
* content_type: 'application/pdf',
|
|
14535
|
+
* agent_id: 'agent-uuid',
|
|
14536
|
+
* workspace_id: 'ws-uuid',
|
|
14537
|
+
* });
|
|
14538
|
+
* // Upload file to presigned.upload_url
|
|
14539
|
+
* ```
|
|
14540
|
+
*/
|
|
14541
|
+
beginUpload: async (attributes, options) => {
|
|
14542
|
+
return rb.execute(
|
|
14543
|
+
postAdminExtractionDocumentsBeginUpload,
|
|
14544
|
+
{
|
|
14545
|
+
body: {
|
|
14546
|
+
data: { type: "extraction-document", attributes }
|
|
14547
|
+
}
|
|
14136
14548
|
},
|
|
14137
14549
|
options
|
|
14138
14550
|
);
|
|
14139
14551
|
},
|
|
14140
|
-
/**
|
|
14552
|
+
/**
|
|
14553
|
+
* Finds an existing document by file hash (for deduplication) or begins a
|
|
14554
|
+
* new upload if no match is found.
|
|
14555
|
+
*
|
|
14556
|
+
* @param attributes - Attributes for finding or beginning the upload.
|
|
14557
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14558
|
+
* @returns A presigned URL object (or a reference to the existing document).
|
|
14559
|
+
*
|
|
14560
|
+
* @example
|
|
14561
|
+
* ```typescript
|
|
14562
|
+
* const result = await admin.extraction.documents.findOrBeginUpload({
|
|
14563
|
+
* file_hash: 'sha256:abc123...',
|
|
14564
|
+
* filename: 'invoice-2026.pdf',
|
|
14565
|
+
* content_type: 'application/pdf',
|
|
14566
|
+
* });
|
|
14567
|
+
* ```
|
|
14568
|
+
*/
|
|
14141
14569
|
findOrBeginUpload: async (attributes, options) => {
|
|
14142
14570
|
return rb.execute(
|
|
14143
14571
|
postAdminExtractionDocumentsFindOrBeginUpload,
|
|
14144
14572
|
{
|
|
14145
14573
|
body: {
|
|
14146
|
-
data: { type: "
|
|
14574
|
+
data: { type: "extraction-document", attributes }
|
|
14147
14575
|
}
|
|
14148
14576
|
},
|
|
14149
14577
|
options
|
|
14150
14578
|
);
|
|
14151
14579
|
},
|
|
14152
|
-
/**
|
|
14580
|
+
/**
|
|
14581
|
+
* Uploads a document directly in a single shot. The server handles storage
|
|
14582
|
+
* placement and immediately enqueues the document for processing.
|
|
14583
|
+
*
|
|
14584
|
+
* @param attributes - Upload attributes including filename and optional storage path.
|
|
14585
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14586
|
+
* @returns The created extraction document object.
|
|
14587
|
+
*
|
|
14588
|
+
* @example
|
|
14589
|
+
* ```typescript
|
|
14590
|
+
* const doc = await admin.extraction.documents.upload({
|
|
14591
|
+
* filename: 'contract.pdf',
|
|
14592
|
+
* content_type: 'application/pdf',
|
|
14593
|
+
* agent_id: 'agent-uuid',
|
|
14594
|
+
* workspace_id: 'ws-uuid',
|
|
14595
|
+
* });
|
|
14596
|
+
* ```
|
|
14597
|
+
*/
|
|
14153
14598
|
upload: async (attributes, options) => {
|
|
14154
14599
|
return rb.execute(
|
|
14155
14600
|
postAdminExtractionDocumentsUpload,
|
|
@@ -14161,7 +14606,22 @@ function createExtractionNamespace(rb) {
|
|
|
14161
14606
|
options
|
|
14162
14607
|
);
|
|
14163
14608
|
},
|
|
14164
|
-
/**
|
|
14609
|
+
/**
|
|
14610
|
+
* Reprocesses multiple documents in a single bulk operation.
|
|
14611
|
+
*
|
|
14612
|
+
* @param ids - An array of document UUIDs to reprocess.
|
|
14613
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14614
|
+
* @returns An operation success result with the count of enqueued documents.
|
|
14615
|
+
*
|
|
14616
|
+
* @example
|
|
14617
|
+
* ```typescript
|
|
14618
|
+
* const result = await admin.extraction.documents.bulkReprocess([
|
|
14619
|
+
* 'doc-uuid-1',
|
|
14620
|
+
* 'doc-uuid-2',
|
|
14621
|
+
* ]);
|
|
14622
|
+
* console.log(`Enqueued: ${result.enqueued_count}`);
|
|
14623
|
+
* ```
|
|
14624
|
+
*/
|
|
14165
14625
|
bulkReprocess: async (ids, options) => {
|
|
14166
14626
|
return rb.execute(
|
|
14167
14627
|
postAdminExtractionDocumentsBulkReprocess,
|
|
@@ -14169,30 +14629,67 @@ function createExtractionNamespace(rb) {
|
|
|
14169
14629
|
body: {
|
|
14170
14630
|
data: {
|
|
14171
14631
|
type: "bulk-reprocess-result",
|
|
14172
|
-
attributes: { ids }
|
|
14632
|
+
attributes: { document_ids: ids }
|
|
14173
14633
|
}
|
|
14174
14634
|
}
|
|
14175
14635
|
},
|
|
14176
14636
|
options
|
|
14177
14637
|
);
|
|
14178
14638
|
},
|
|
14179
|
-
/**
|
|
14639
|
+
/**
|
|
14640
|
+
* Permanently deletes multiple documents in a single bulk operation.
|
|
14641
|
+
*
|
|
14642
|
+
* @param ids - An array of document UUIDs to delete.
|
|
14643
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14644
|
+
* @returns An operation success result with the count of deleted documents.
|
|
14645
|
+
*
|
|
14646
|
+
* @example
|
|
14647
|
+
* ```typescript
|
|
14648
|
+
* const result = await admin.extraction.documents.bulkDelete([
|
|
14649
|
+
* 'doc-uuid-1',
|
|
14650
|
+
* 'doc-uuid-2',
|
|
14651
|
+
* ]);
|
|
14652
|
+
* console.log(`Deleted: ${result.deleted_count}`);
|
|
14653
|
+
* ```
|
|
14654
|
+
*/
|
|
14180
14655
|
bulkDelete: async (ids, options) => {
|
|
14181
14656
|
return rb.execute(
|
|
14182
14657
|
postAdminDocumentsBulkDelete,
|
|
14183
14658
|
{
|
|
14184
14659
|
body: {
|
|
14185
|
-
data: { type: "
|
|
14660
|
+
data: { type: "operation-success", attributes: { ids } }
|
|
14186
14661
|
}
|
|
14187
14662
|
},
|
|
14188
14663
|
options
|
|
14189
14664
|
);
|
|
14190
14665
|
},
|
|
14191
|
-
/**
|
|
14666
|
+
/**
|
|
14667
|
+
* Retrieves platform-wide document statistics including counts by status.
|
|
14668
|
+
*
|
|
14669
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14670
|
+
* @returns Aggregate document statistics.
|
|
14671
|
+
*
|
|
14672
|
+
* @example
|
|
14673
|
+
* ```typescript
|
|
14674
|
+
* const stats = await admin.extraction.documents.stats();
|
|
14675
|
+
* console.log(`Total: ${stats.total}, Failed: ${stats.failed}`);
|
|
14676
|
+
* ```
|
|
14677
|
+
*/
|
|
14192
14678
|
stats: async (options) => {
|
|
14193
14679
|
return rb.execute(getAdminDocumentsStats, {}, options);
|
|
14194
14680
|
},
|
|
14195
|
-
/**
|
|
14681
|
+
/**
|
|
14682
|
+
* Lists all extraction documents belonging to a specific workspace.
|
|
14683
|
+
*
|
|
14684
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14685
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14686
|
+
* @returns An array of extraction documents for the workspace.
|
|
14687
|
+
*
|
|
14688
|
+
* @example
|
|
14689
|
+
* ```typescript
|
|
14690
|
+
* const docs = await admin.extraction.documents.listByWorkspace('ws-uuid');
|
|
14691
|
+
* ```
|
|
14692
|
+
*/
|
|
14196
14693
|
listByWorkspace: async (workspaceId, options) => {
|
|
14197
14694
|
return rb.execute(
|
|
14198
14695
|
getAdminExtractionDocumentsWorkspaceByWorkspaceId,
|
|
@@ -14200,7 +14697,20 @@ function createExtractionNamespace(rb) {
|
|
|
14200
14697
|
options
|
|
14201
14698
|
);
|
|
14202
14699
|
},
|
|
14203
|
-
/**
|
|
14700
|
+
/**
|
|
14701
|
+
* Lists documents filtered by processing status within a workspace.
|
|
14702
|
+
*
|
|
14703
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14704
|
+
* @param status - The processing status to filter by (e.g. `"completed"`, `"failed"`).
|
|
14705
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14706
|
+
* @returns An array of extraction documents matching the status filter.
|
|
14707
|
+
*
|
|
14708
|
+
* @example
|
|
14709
|
+
* ```typescript
|
|
14710
|
+
* const failed = await admin.extraction.documents.listByStatus('ws-uuid', 'failed');
|
|
14711
|
+
* console.log(`${failed.length} failed documents`);
|
|
14712
|
+
* ```
|
|
14713
|
+
*/
|
|
14204
14714
|
listByStatus: async (workspaceId, status, options) => {
|
|
14205
14715
|
return rb.execute(
|
|
14206
14716
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdByStatusByStatus,
|
|
@@ -14208,7 +14718,20 @@ function createExtractionNamespace(rb) {
|
|
|
14208
14718
|
options
|
|
14209
14719
|
);
|
|
14210
14720
|
},
|
|
14211
|
-
/**
|
|
14721
|
+
/**
|
|
14722
|
+
* Returns the review queue for a workspace — documents awaiting human
|
|
14723
|
+
* verification of their extraction results.
|
|
14724
|
+
*
|
|
14725
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14726
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14727
|
+
* @returns An array of documents in the review queue.
|
|
14728
|
+
*
|
|
14729
|
+
* @example
|
|
14730
|
+
* ```typescript
|
|
14731
|
+
* const queue = await admin.extraction.documents.reviewQueue('ws-uuid');
|
|
14732
|
+
* console.log(`${queue.length} documents awaiting review`);
|
|
14733
|
+
* ```
|
|
14734
|
+
*/
|
|
14212
14735
|
reviewQueue: async (workspaceId, options) => {
|
|
14213
14736
|
return rb.execute(
|
|
14214
14737
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdReviewQueue,
|
|
@@ -14216,7 +14739,18 @@ function createExtractionNamespace(rb) {
|
|
|
14216
14739
|
options
|
|
14217
14740
|
);
|
|
14218
14741
|
},
|
|
14219
|
-
/**
|
|
14742
|
+
/**
|
|
14743
|
+
* Lists documents that have been marked as trained within a workspace.
|
|
14744
|
+
*
|
|
14745
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14746
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14747
|
+
* @returns An array of trained extraction documents.
|
|
14748
|
+
*
|
|
14749
|
+
* @example
|
|
14750
|
+
* ```typescript
|
|
14751
|
+
* const trained = await admin.extraction.documents.listTrained('ws-uuid');
|
|
14752
|
+
* ```
|
|
14753
|
+
*/
|
|
14220
14754
|
listTrained: async (workspaceId, options) => {
|
|
14221
14755
|
return rb.execute(
|
|
14222
14756
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdTrained,
|
|
@@ -14224,7 +14758,19 @@ function createExtractionNamespace(rb) {
|
|
|
14224
14758
|
options
|
|
14225
14759
|
);
|
|
14226
14760
|
},
|
|
14227
|
-
/**
|
|
14761
|
+
/**
|
|
14762
|
+
* Lists soft-deleted (trashed) documents for a workspace. These can be
|
|
14763
|
+
* restored via the `restore` method.
|
|
14764
|
+
*
|
|
14765
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14766
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14767
|
+
* @returns An array of trashed extraction documents.
|
|
14768
|
+
*
|
|
14769
|
+
* @example
|
|
14770
|
+
* ```typescript
|
|
14771
|
+
* const trashed = await admin.extraction.documents.listTrashed('ws-uuid');
|
|
14772
|
+
* ```
|
|
14773
|
+
*/
|
|
14228
14774
|
listTrashed: async (workspaceId, options) => {
|
|
14229
14775
|
return rb.execute(
|
|
14230
14776
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdTrashed,
|
|
@@ -14232,7 +14778,19 @@ function createExtractionNamespace(rb) {
|
|
|
14232
14778
|
options
|
|
14233
14779
|
);
|
|
14234
14780
|
},
|
|
14235
|
-
/**
|
|
14781
|
+
/**
|
|
14782
|
+
* Lists documents that have been excluded from the training dataset
|
|
14783
|
+
* within a workspace.
|
|
14784
|
+
*
|
|
14785
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14786
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14787
|
+
* @returns An array of excluded extraction documents.
|
|
14788
|
+
*
|
|
14789
|
+
* @example
|
|
14790
|
+
* ```typescript
|
|
14791
|
+
* const excluded = await admin.extraction.documents.listExcluded('ws-uuid');
|
|
14792
|
+
* ```
|
|
14793
|
+
*/
|
|
14236
14794
|
listExcluded: async (workspaceId, options) => {
|
|
14237
14795
|
return rb.execute(
|
|
14238
14796
|
getAdminExtractionDocumentsWorkspaceByWorkspaceIdExcluded,
|
|
@@ -14240,7 +14798,20 @@ function createExtractionNamespace(rb) {
|
|
|
14240
14798
|
options
|
|
14241
14799
|
);
|
|
14242
14800
|
},
|
|
14243
|
-
/**
|
|
14801
|
+
/**
|
|
14802
|
+
* Dismisses all trained-flagged documents in a workspace in one operation.
|
|
14803
|
+
* Useful for clearing training notifications after a batch review.
|
|
14804
|
+
*
|
|
14805
|
+
* @param workspaceId - The UUID of the workspace.
|
|
14806
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14807
|
+
* @returns An operation success result with the dismissed count.
|
|
14808
|
+
*
|
|
14809
|
+
* @example
|
|
14810
|
+
* ```typescript
|
|
14811
|
+
* const result = await admin.extraction.documents.dismissAllTrained('ws-uuid');
|
|
14812
|
+
* console.log(`Dismissed ${result.dismissed_count} documents`);
|
|
14813
|
+
* ```
|
|
14814
|
+
*/
|
|
14244
14815
|
dismissAllTrained: async (workspaceId, options) => {
|
|
14245
14816
|
return rb.execute(
|
|
14246
14817
|
postAdminWorkspacesByWorkspaceIdExtractionDocumentsDismissAllTrained,
|
|
@@ -14254,7 +14825,17 @@ function createExtractionNamespace(rb) {
|
|
|
14254
14825
|
},
|
|
14255
14826
|
/** Extraction result management — CRUD, history, corrections, regeneration. */
|
|
14256
14827
|
results: {
|
|
14257
|
-
/**
|
|
14828
|
+
/**
|
|
14829
|
+
* Lists all extraction results across the platform.
|
|
14830
|
+
*
|
|
14831
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14832
|
+
* @returns An array of extraction result objects.
|
|
14833
|
+
*
|
|
14834
|
+
* @example
|
|
14835
|
+
* ```typescript
|
|
14836
|
+
* const results = await admin.extraction.results.list();
|
|
14837
|
+
* ```
|
|
14838
|
+
*/
|
|
14258
14839
|
list: async (options) => {
|
|
14259
14840
|
return rb.execute(
|
|
14260
14841
|
getAdminExtractionResults,
|
|
@@ -14262,7 +14843,19 @@ function createExtractionNamespace(rb) {
|
|
|
14262
14843
|
options
|
|
14263
14844
|
);
|
|
14264
14845
|
},
|
|
14265
|
-
/**
|
|
14846
|
+
/**
|
|
14847
|
+
* Retrieves a single extraction result by its unique identifier.
|
|
14848
|
+
*
|
|
14849
|
+
* @param id - The UUID of the extraction result.
|
|
14850
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14851
|
+
* @returns The matching extraction result object.
|
|
14852
|
+
*
|
|
14853
|
+
* @example
|
|
14854
|
+
* ```typescript
|
|
14855
|
+
* const result = await admin.extraction.results.get('result-uuid');
|
|
14856
|
+
* console.log(result.extracted_data);
|
|
14857
|
+
* ```
|
|
14858
|
+
*/
|
|
14266
14859
|
get: async (id, options) => {
|
|
14267
14860
|
return rb.execute(
|
|
14268
14861
|
getAdminExtractionResultsById,
|
|
@@ -14270,7 +14863,21 @@ function createExtractionNamespace(rb) {
|
|
|
14270
14863
|
options
|
|
14271
14864
|
);
|
|
14272
14865
|
},
|
|
14273
|
-
/**
|
|
14866
|
+
/**
|
|
14867
|
+
* Updates an extraction result's metadata (e.g. review status).
|
|
14868
|
+
*
|
|
14869
|
+
* @param id - The UUID of the extraction result to update.
|
|
14870
|
+
* @param attributes - The attributes to update.
|
|
14871
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14872
|
+
* @returns The updated extraction result object.
|
|
14873
|
+
*
|
|
14874
|
+
* @example
|
|
14875
|
+
* ```typescript
|
|
14876
|
+
* const result = await admin.extraction.results.update('result-uuid', {
|
|
14877
|
+
* review_status: 'approved',
|
|
14878
|
+
* });
|
|
14879
|
+
* ```
|
|
14880
|
+
*/
|
|
14274
14881
|
update: async (id, attributes, options) => {
|
|
14275
14882
|
return rb.execute(
|
|
14276
14883
|
patchAdminExtractionResultsById,
|
|
@@ -14283,7 +14890,18 @@ function createExtractionNamespace(rb) {
|
|
|
14283
14890
|
options
|
|
14284
14891
|
);
|
|
14285
14892
|
},
|
|
14286
|
-
/**
|
|
14893
|
+
/**
|
|
14894
|
+
* Permanently deletes an extraction result.
|
|
14895
|
+
*
|
|
14896
|
+
* @param id - The UUID of the extraction result to delete.
|
|
14897
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14898
|
+
* @returns `true` when the deletion succeeds.
|
|
14899
|
+
*
|
|
14900
|
+
* @example
|
|
14901
|
+
* ```typescript
|
|
14902
|
+
* await admin.extraction.results.delete('result-uuid');
|
|
14903
|
+
* ```
|
|
14904
|
+
*/
|
|
14287
14905
|
delete: async (id, options) => {
|
|
14288
14906
|
return rb.executeDelete(
|
|
14289
14907
|
deleteAdminExtractionResultsById,
|
|
@@ -14291,7 +14909,18 @@ function createExtractionNamespace(rb) {
|
|
|
14291
14909
|
options
|
|
14292
14910
|
);
|
|
14293
14911
|
},
|
|
14294
|
-
/**
|
|
14912
|
+
/**
|
|
14913
|
+
* Retrieves all extraction results for a specific document.
|
|
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 extraction results for the document.
|
|
14918
|
+
*
|
|
14919
|
+
* @example
|
|
14920
|
+
* ```typescript
|
|
14921
|
+
* const results = await admin.extraction.results.byDocument('doc-uuid');
|
|
14922
|
+
* ```
|
|
14923
|
+
*/
|
|
14295
14924
|
byDocument: async (documentId, options) => {
|
|
14296
14925
|
return rb.execute(
|
|
14297
14926
|
getAdminExtractionResultsDocumentByDocumentId,
|
|
@@ -14299,7 +14928,20 @@ function createExtractionNamespace(rb) {
|
|
|
14299
14928
|
options
|
|
14300
14929
|
);
|
|
14301
14930
|
},
|
|
14302
|
-
/**
|
|
14931
|
+
/**
|
|
14932
|
+
* Retrieves the version history of extraction results for a document,
|
|
14933
|
+
* showing how results have changed over reprocessing cycles.
|
|
14934
|
+
*
|
|
14935
|
+
* @param documentId - The UUID of the parent document.
|
|
14936
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14937
|
+
* @returns An array of historical extraction result versions.
|
|
14938
|
+
*
|
|
14939
|
+
* @example
|
|
14940
|
+
* ```typescript
|
|
14941
|
+
* const history = await admin.extraction.results.history('doc-uuid');
|
|
14942
|
+
* console.log(`${history.length} result versions`);
|
|
14943
|
+
* ```
|
|
14944
|
+
*/
|
|
14303
14945
|
history: async (documentId, options) => {
|
|
14304
14946
|
return rb.execute(
|
|
14305
14947
|
getAdminExtractionResultsDocumentByDocumentIdHistory,
|
|
@@ -14307,7 +14949,19 @@ function createExtractionNamespace(rb) {
|
|
|
14307
14949
|
options
|
|
14308
14950
|
);
|
|
14309
14951
|
},
|
|
14310
|
-
/**
|
|
14952
|
+
/**
|
|
14953
|
+
* Retrieves partial (in-progress) extraction results for a document that
|
|
14954
|
+
* is still being processed.
|
|
14955
|
+
*
|
|
14956
|
+
* @param documentId - The UUID of the parent document.
|
|
14957
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14958
|
+
* @returns An array of partial extraction results available so far.
|
|
14959
|
+
*
|
|
14960
|
+
* @example
|
|
14961
|
+
* ```typescript
|
|
14962
|
+
* const partial = await admin.extraction.results.partial('doc-uuid');
|
|
14963
|
+
* ```
|
|
14964
|
+
*/
|
|
14311
14965
|
partial: async (documentId, options) => {
|
|
14312
14966
|
return rb.execute(
|
|
14313
14967
|
getAdminExtractionResultsDocumentByDocumentIdPartial,
|
|
@@ -14315,7 +14969,23 @@ function createExtractionNamespace(rb) {
|
|
|
14315
14969
|
options
|
|
14316
14970
|
);
|
|
14317
14971
|
},
|
|
14318
|
-
/**
|
|
14972
|
+
/**
|
|
14973
|
+
* Regenerates an extraction result, optionally incorporating human
|
|
14974
|
+
* feedback or restricting which fields to retry.
|
|
14975
|
+
*
|
|
14976
|
+
* @param id - The UUID of the extraction result to regenerate.
|
|
14977
|
+
* @param attributes - Regeneration parameters (feedback, fields to retry).
|
|
14978
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
14979
|
+
* @returns The regenerated extraction result object.
|
|
14980
|
+
*
|
|
14981
|
+
* @example
|
|
14982
|
+
* ```typescript
|
|
14983
|
+
* const result = await admin.extraction.results.regenerate('result-uuid', {
|
|
14984
|
+
* feedback: 'The date field was parsed incorrectly.',
|
|
14985
|
+
* fields_to_retry: ['invoice_date', 'due_date'],
|
|
14986
|
+
* });
|
|
14987
|
+
* ```
|
|
14988
|
+
*/
|
|
14319
14989
|
regenerate: async (id, attributes, options) => {
|
|
14320
14990
|
return rb.execute(
|
|
14321
14991
|
patchAdminExtractionResultsByIdRegenerate,
|
|
@@ -14328,7 +14998,25 @@ function createExtractionNamespace(rb) {
|
|
|
14328
14998
|
options
|
|
14329
14999
|
);
|
|
14330
15000
|
},
|
|
14331
|
-
/**
|
|
15001
|
+
/**
|
|
15002
|
+
* Saves manual corrections to an extraction result. The corrections are
|
|
15003
|
+
* stored alongside the original data and can be used for model training.
|
|
15004
|
+
*
|
|
15005
|
+
* @param id - The UUID of the extraction result to correct.
|
|
15006
|
+
* @param attributes - The corrections to save.
|
|
15007
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15008
|
+
* @returns The updated extraction result object with corrections applied.
|
|
15009
|
+
*
|
|
15010
|
+
* @example
|
|
15011
|
+
* ```typescript
|
|
15012
|
+
* const result = await admin.extraction.results.saveCorrections('result-uuid', {
|
|
15013
|
+
* corrections: [
|
|
15014
|
+
* { field: 'invoice_number', value: 'INV-2026-001' },
|
|
15015
|
+
* { field: 'total_amount', value: 1250.00 },
|
|
15016
|
+
* ],
|
|
15017
|
+
* });
|
|
15018
|
+
* ```
|
|
15019
|
+
*/
|
|
14332
15020
|
saveCorrections: async (id, attributes, options) => {
|
|
14333
15021
|
return rb.execute(
|
|
14334
15022
|
patchAdminExtractionResultsByIdSaveCorrections,
|
|
@@ -14341,7 +15029,18 @@ function createExtractionNamespace(rb) {
|
|
|
14341
15029
|
options
|
|
14342
15030
|
);
|
|
14343
15031
|
},
|
|
14344
|
-
/**
|
|
15032
|
+
/**
|
|
15033
|
+
* Lists all extraction results belonging to a specific workspace.
|
|
15034
|
+
*
|
|
15035
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15036
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15037
|
+
* @returns An array of extraction results for the workspace.
|
|
15038
|
+
*
|
|
15039
|
+
* @example
|
|
15040
|
+
* ```typescript
|
|
15041
|
+
* const results = await admin.extraction.results.listByWorkspace('ws-uuid');
|
|
15042
|
+
* ```
|
|
15043
|
+
*/
|
|
14345
15044
|
listByWorkspace: async (workspaceId, options) => {
|
|
14346
15045
|
return rb.execute(
|
|
14347
15046
|
getAdminExtractionResultsWorkspaceByWorkspaceId,
|
|
@@ -14352,7 +15051,19 @@ function createExtractionNamespace(rb) {
|
|
|
14352
15051
|
},
|
|
14353
15052
|
/** Batch upload management — create batches, get upload URLs. */
|
|
14354
15053
|
batches: {
|
|
14355
|
-
/**
|
|
15054
|
+
/**
|
|
15055
|
+
* Retrieves a single extraction batch by its unique identifier.
|
|
15056
|
+
*
|
|
15057
|
+
* @param id - The UUID of the batch.
|
|
15058
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15059
|
+
* @returns The matching extraction batch object.
|
|
15060
|
+
*
|
|
15061
|
+
* @example
|
|
15062
|
+
* ```typescript
|
|
15063
|
+
* const batch = await admin.extraction.batches.get('batch-uuid');
|
|
15064
|
+
* console.log(`Batch: ${batch.name}, ${batch.document_count} docs`);
|
|
15065
|
+
* ```
|
|
15066
|
+
*/
|
|
14356
15067
|
get: async (id, options) => {
|
|
14357
15068
|
return rb.execute(
|
|
14358
15069
|
getAdminExtractionBatchesById,
|
|
@@ -14360,7 +15071,18 @@ function createExtractionNamespace(rb) {
|
|
|
14360
15071
|
options
|
|
14361
15072
|
);
|
|
14362
15073
|
},
|
|
14363
|
-
/**
|
|
15074
|
+
/**
|
|
15075
|
+
* Permanently deletes an extraction batch.
|
|
15076
|
+
*
|
|
15077
|
+
* @param id - The UUID of the batch to delete.
|
|
15078
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15079
|
+
* @returns `true` when the deletion succeeds.
|
|
15080
|
+
*
|
|
15081
|
+
* @example
|
|
15082
|
+
* ```typescript
|
|
15083
|
+
* await admin.extraction.batches.delete('batch-uuid');
|
|
15084
|
+
* ```
|
|
15085
|
+
*/
|
|
14364
15086
|
delete: async (id, options) => {
|
|
14365
15087
|
return rb.executeDelete(
|
|
14366
15088
|
deleteAdminExtractionBatchesById,
|
|
@@ -14368,7 +15090,22 @@ function createExtractionNamespace(rb) {
|
|
|
14368
15090
|
options
|
|
14369
15091
|
);
|
|
14370
15092
|
},
|
|
14371
|
-
/**
|
|
15093
|
+
/**
|
|
15094
|
+
* Creates a new extraction batch for grouping document uploads.
|
|
15095
|
+
*
|
|
15096
|
+
* @param attributes - Batch creation attributes including workspace ID.
|
|
15097
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15098
|
+
* @returns The newly created extraction batch object.
|
|
15099
|
+
*
|
|
15100
|
+
* @example
|
|
15101
|
+
* ```typescript
|
|
15102
|
+
* const batch = await admin.extraction.batches.create({
|
|
15103
|
+
* name: 'Q1 Invoices',
|
|
15104
|
+
* workspace_id: 'ws-uuid',
|
|
15105
|
+
* agent_id: 'agent-uuid',
|
|
15106
|
+
* });
|
|
15107
|
+
* ```
|
|
15108
|
+
*/
|
|
14372
15109
|
create: async (attributes, options) => {
|
|
14373
15110
|
return rb.execute(
|
|
14374
15111
|
postAdminExtractionBatches,
|
|
@@ -14380,7 +15117,18 @@ function createExtractionNamespace(rb) {
|
|
|
14380
15117
|
options
|
|
14381
15118
|
);
|
|
14382
15119
|
},
|
|
14383
|
-
/**
|
|
15120
|
+
/**
|
|
15121
|
+
* Lists all extraction batches belonging to a specific workspace.
|
|
15122
|
+
*
|
|
15123
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15124
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15125
|
+
* @returns An array of extraction batches for the workspace.
|
|
15126
|
+
*
|
|
15127
|
+
* @example
|
|
15128
|
+
* ```typescript
|
|
15129
|
+
* const batches = await admin.extraction.batches.listByWorkspace('ws-uuid');
|
|
15130
|
+
* ```
|
|
15131
|
+
*/
|
|
14384
15132
|
listByWorkspace: async (workspaceId, options) => {
|
|
14385
15133
|
return rb.execute(
|
|
14386
15134
|
getAdminExtractionBatchesWorkspaceByWorkspaceId,
|
|
@@ -14388,7 +15136,24 @@ function createExtractionNamespace(rb) {
|
|
|
14388
15136
|
options
|
|
14389
15137
|
);
|
|
14390
15138
|
},
|
|
14391
|
-
/**
|
|
15139
|
+
/**
|
|
15140
|
+
* Retrieves presigned upload URLs for all documents in a batch, enabling
|
|
15141
|
+
* parallel direct-to-storage uploads.
|
|
15142
|
+
*
|
|
15143
|
+
* @param id - The UUID of the batch.
|
|
15144
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15145
|
+
* @returns An array of presigned URL objects, one per document slot.
|
|
15146
|
+
*
|
|
15147
|
+
* @example
|
|
15148
|
+
* ```typescript
|
|
15149
|
+
* const urls = await admin.extraction.batches.getUploadUrls('batch-uuid');
|
|
15150
|
+
* // Upload files in parallel to each presigned URL
|
|
15151
|
+
* await Promise.all(urls.map((u, i) => fetch(u.upload_url, {
|
|
15152
|
+
* method: 'PUT',
|
|
15153
|
+
* body: files[i],
|
|
15154
|
+
* })));
|
|
15155
|
+
* ```
|
|
15156
|
+
*/
|
|
14392
15157
|
getUploadUrls: async (id, options) => {
|
|
14393
15158
|
return rb.execute(
|
|
14394
15159
|
getAdminExtractionBatchesByIdUploadUrls,
|
|
@@ -14399,7 +15164,18 @@ function createExtractionNamespace(rb) {
|
|
|
14399
15164
|
},
|
|
14400
15165
|
/** Export management — create and retrieve data exports. */
|
|
14401
15166
|
exports: {
|
|
14402
|
-
/**
|
|
15167
|
+
/**
|
|
15168
|
+
* Lists all extraction exports for a workspace.
|
|
15169
|
+
*
|
|
15170
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15171
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15172
|
+
* @returns An array of extraction export objects.
|
|
15173
|
+
*
|
|
15174
|
+
* @example
|
|
15175
|
+
* ```typescript
|
|
15176
|
+
* const exports = await admin.extraction.exports.list('ws-uuid');
|
|
15177
|
+
* ```
|
|
15178
|
+
*/
|
|
14403
15179
|
list: async (workspaceId, options) => {
|
|
14404
15180
|
return rb.execute(
|
|
14405
15181
|
getAdminWorkspacesByWorkspaceIdExtractionExports,
|
|
@@ -14407,7 +15183,23 @@ function createExtractionNamespace(rb) {
|
|
|
14407
15183
|
options
|
|
14408
15184
|
);
|
|
14409
15185
|
},
|
|
14410
|
-
/**
|
|
15186
|
+
/**
|
|
15187
|
+
* Creates a new data export for a workspace in the specified format.
|
|
15188
|
+
*
|
|
15189
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15190
|
+
* @param attributes - Export creation attributes including format.
|
|
15191
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15192
|
+
* @returns The newly created extraction export object.
|
|
15193
|
+
*
|
|
15194
|
+
* @example
|
|
15195
|
+
* ```typescript
|
|
15196
|
+
* const exp = await admin.extraction.exports.create('ws-uuid', {
|
|
15197
|
+
* format: 'csv',
|
|
15198
|
+
* agent_id: 'agent-uuid',
|
|
15199
|
+
* });
|
|
15200
|
+
* console.log(`Export ${exp.id} created, status: ${exp.status}`);
|
|
15201
|
+
* ```
|
|
15202
|
+
*/
|
|
14411
15203
|
create: async (workspaceId, attributes, options) => {
|
|
14412
15204
|
return rb.execute(
|
|
14413
15205
|
postAdminWorkspacesByWorkspaceIdExtractionExports,
|
|
@@ -14420,7 +15212,23 @@ function createExtractionNamespace(rb) {
|
|
|
14420
15212
|
options
|
|
14421
15213
|
);
|
|
14422
15214
|
},
|
|
14423
|
-
/**
|
|
15215
|
+
/**
|
|
15216
|
+
* Retrieves a single extraction export by ID within a workspace.
|
|
15217
|
+
*
|
|
15218
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15219
|
+
* @param id - The UUID of the export to retrieve.
|
|
15220
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15221
|
+
* @returns The matching extraction export object, including download URL
|
|
15222
|
+
* when the export is complete.
|
|
15223
|
+
*
|
|
15224
|
+
* @example
|
|
15225
|
+
* ```typescript
|
|
15226
|
+
* const exp = await admin.extraction.exports.get('ws-uuid', 'export-uuid');
|
|
15227
|
+
* if (exp.status === 'completed') {
|
|
15228
|
+
* console.log(`Download: ${exp.download_url}`);
|
|
15229
|
+
* }
|
|
15230
|
+
* ```
|
|
15231
|
+
*/
|
|
14424
15232
|
get: async (workspaceId, id, options) => {
|
|
14425
15233
|
return rb.execute(
|
|
14426
15234
|
getAdminWorkspacesByWorkspaceIdExtractionExportsById,
|
|
@@ -14431,7 +15239,17 @@ function createExtractionNamespace(rb) {
|
|
|
14431
15239
|
},
|
|
14432
15240
|
/** Workflow management — configurable extraction pipelines. */
|
|
14433
15241
|
workflows: {
|
|
14434
|
-
/**
|
|
15242
|
+
/**
|
|
15243
|
+
* Lists all extraction workflows across the platform.
|
|
15244
|
+
*
|
|
15245
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15246
|
+
* @returns An array of extraction workflow objects.
|
|
15247
|
+
*
|
|
15248
|
+
* @example
|
|
15249
|
+
* ```typescript
|
|
15250
|
+
* const workflows = await admin.extraction.workflows.list();
|
|
15251
|
+
* ```
|
|
15252
|
+
*/
|
|
14435
15253
|
list: async (options) => {
|
|
14436
15254
|
return rb.execute(
|
|
14437
15255
|
getAdminExtractionWorkflows,
|
|
@@ -14439,7 +15257,21 @@ function createExtractionNamespace(rb) {
|
|
|
14439
15257
|
options
|
|
14440
15258
|
);
|
|
14441
15259
|
},
|
|
14442
|
-
/**
|
|
15260
|
+
/**
|
|
15261
|
+
* Creates a new extraction workflow with the specified configuration.
|
|
15262
|
+
*
|
|
15263
|
+
* @param attributes - Workflow creation attributes including name.
|
|
15264
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15265
|
+
* @returns The newly created extraction workflow object.
|
|
15266
|
+
*
|
|
15267
|
+
* @example
|
|
15268
|
+
* ```typescript
|
|
15269
|
+
* const workflow = await admin.extraction.workflows.create({
|
|
15270
|
+
* name: 'Invoice Processing',
|
|
15271
|
+
* workspace_id: 'ws-uuid',
|
|
15272
|
+
* });
|
|
15273
|
+
* ```
|
|
15274
|
+
*/
|
|
14443
15275
|
create: async (attributes, options) => {
|
|
14444
15276
|
return rb.execute(
|
|
14445
15277
|
postAdminExtractionWorkflows,
|
|
@@ -14451,7 +15283,18 @@ function createExtractionNamespace(rb) {
|
|
|
14451
15283
|
options
|
|
14452
15284
|
);
|
|
14453
15285
|
},
|
|
14454
|
-
/**
|
|
15286
|
+
/**
|
|
15287
|
+
* Retrieves a single extraction workflow by its unique identifier.
|
|
15288
|
+
*
|
|
15289
|
+
* @param id - The UUID of the workflow.
|
|
15290
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15291
|
+
* @returns The matching extraction workflow object.
|
|
15292
|
+
*
|
|
15293
|
+
* @example
|
|
15294
|
+
* ```typescript
|
|
15295
|
+
* const workflow = await admin.extraction.workflows.get('workflow-uuid');
|
|
15296
|
+
* ```
|
|
15297
|
+
*/
|
|
14455
15298
|
get: async (id, options) => {
|
|
14456
15299
|
return rb.execute(
|
|
14457
15300
|
getAdminExtractionWorkflowsById,
|
|
@@ -14459,7 +15302,21 @@ function createExtractionNamespace(rb) {
|
|
|
14459
15302
|
options
|
|
14460
15303
|
);
|
|
14461
15304
|
},
|
|
14462
|
-
/**
|
|
15305
|
+
/**
|
|
15306
|
+
* Updates an existing extraction workflow's configuration.
|
|
15307
|
+
*
|
|
15308
|
+
* @param id - The UUID of the workflow to update.
|
|
15309
|
+
* @param attributes - The attributes to update.
|
|
15310
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15311
|
+
* @returns The updated extraction workflow object.
|
|
15312
|
+
*
|
|
15313
|
+
* @example
|
|
15314
|
+
* ```typescript
|
|
15315
|
+
* const workflow = await admin.extraction.workflows.update('workflow-uuid', {
|
|
15316
|
+
* name: 'Updated Invoice Pipeline',
|
|
15317
|
+
* });
|
|
15318
|
+
* ```
|
|
15319
|
+
*/
|
|
14463
15320
|
update: async (id, attributes, options) => {
|
|
14464
15321
|
return rb.execute(
|
|
14465
15322
|
patchAdminExtractionWorkflowsById,
|
|
@@ -14472,7 +15329,18 @@ function createExtractionNamespace(rb) {
|
|
|
14472
15329
|
options
|
|
14473
15330
|
);
|
|
14474
15331
|
},
|
|
14475
|
-
/**
|
|
15332
|
+
/**
|
|
15333
|
+
* Permanently deletes an extraction workflow.
|
|
15334
|
+
*
|
|
15335
|
+
* @param id - The UUID of the workflow to delete.
|
|
15336
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15337
|
+
* @returns `true` when the deletion succeeds.
|
|
15338
|
+
*
|
|
15339
|
+
* @example
|
|
15340
|
+
* ```typescript
|
|
15341
|
+
* await admin.extraction.workflows.delete('workflow-uuid');
|
|
15342
|
+
* ```
|
|
15343
|
+
*/
|
|
14476
15344
|
delete: async (id, options) => {
|
|
14477
15345
|
return rb.executeDelete(
|
|
14478
15346
|
deleteAdminExtractionWorkflowsById,
|
|
@@ -14483,7 +15351,18 @@ function createExtractionNamespace(rb) {
|
|
|
14483
15351
|
},
|
|
14484
15352
|
/** Config enum management — dropdown and validation values. */
|
|
14485
15353
|
configEnums: {
|
|
14486
|
-
/**
|
|
15354
|
+
/**
|
|
15355
|
+
* Lists all config enums used for extraction field validation and
|
|
15356
|
+
* dropdown options.
|
|
15357
|
+
*
|
|
15358
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15359
|
+
* @returns An array of config enum objects.
|
|
15360
|
+
*
|
|
15361
|
+
* @example
|
|
15362
|
+
* ```typescript
|
|
15363
|
+
* const enums = await admin.extraction.configEnums.list();
|
|
15364
|
+
* ```
|
|
15365
|
+
*/
|
|
14487
15366
|
list: async (options) => {
|
|
14488
15367
|
return rb.execute(
|
|
14489
15368
|
getAdminExtractionConfigEnums,
|
|
@@ -14491,7 +15370,23 @@ function createExtractionNamespace(rb) {
|
|
|
14491
15370
|
options
|
|
14492
15371
|
);
|
|
14493
15372
|
},
|
|
14494
|
-
/**
|
|
15373
|
+
/**
|
|
15374
|
+
* Creates a new config enum value for use in extraction field dropdowns
|
|
15375
|
+
* and validation.
|
|
15376
|
+
*
|
|
15377
|
+
* @param attributes - Config enum creation attributes.
|
|
15378
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15379
|
+
* @returns The newly created config enum object.
|
|
15380
|
+
*
|
|
15381
|
+
* @example
|
|
15382
|
+
* ```typescript
|
|
15383
|
+
* const enumVal = await admin.extraction.configEnums.create({
|
|
15384
|
+
* type: 'document_category',
|
|
15385
|
+
* value: 'invoice',
|
|
15386
|
+
* label: 'Invoice',
|
|
15387
|
+
* });
|
|
15388
|
+
* ```
|
|
15389
|
+
*/
|
|
14495
15390
|
create: async (attributes, options) => {
|
|
14496
15391
|
return rb.execute(
|
|
14497
15392
|
postAdminExtractionConfigEnums,
|
|
@@ -14503,7 +15398,18 @@ function createExtractionNamespace(rb) {
|
|
|
14503
15398
|
options
|
|
14504
15399
|
);
|
|
14505
15400
|
},
|
|
14506
|
-
/**
|
|
15401
|
+
/**
|
|
15402
|
+
* Retrieves a single config enum by its unique identifier.
|
|
15403
|
+
*
|
|
15404
|
+
* @param id - The UUID of the config enum.
|
|
15405
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15406
|
+
* @returns The matching config enum object.
|
|
15407
|
+
*
|
|
15408
|
+
* @example
|
|
15409
|
+
* ```typescript
|
|
15410
|
+
* const enumVal = await admin.extraction.configEnums.get('enum-uuid');
|
|
15411
|
+
* ```
|
|
15412
|
+
*/
|
|
14507
15413
|
get: async (id, options) => {
|
|
14508
15414
|
return rb.execute(
|
|
14509
15415
|
getAdminExtractionConfigEnumsById,
|
|
@@ -14511,7 +15417,21 @@ function createExtractionNamespace(rb) {
|
|
|
14511
15417
|
options
|
|
14512
15418
|
);
|
|
14513
15419
|
},
|
|
14514
|
-
/**
|
|
15420
|
+
/**
|
|
15421
|
+
* Updates an existing config enum's label or other mutable attributes.
|
|
15422
|
+
*
|
|
15423
|
+
* @param id - The UUID of the config enum to update.
|
|
15424
|
+
* @param attributes - The attributes to update.
|
|
15425
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15426
|
+
* @returns The updated config enum object.
|
|
15427
|
+
*
|
|
15428
|
+
* @example
|
|
15429
|
+
* ```typescript
|
|
15430
|
+
* const enumVal = await admin.extraction.configEnums.update('enum-uuid', {
|
|
15431
|
+
* label: 'Updated Label',
|
|
15432
|
+
* });
|
|
15433
|
+
* ```
|
|
15434
|
+
*/
|
|
14515
15435
|
update: async (id, attributes, options) => {
|
|
14516
15436
|
return rb.execute(
|
|
14517
15437
|
patchAdminExtractionConfigEnumsById,
|
|
@@ -14527,7 +15447,23 @@ function createExtractionNamespace(rb) {
|
|
|
14527
15447
|
},
|
|
14528
15448
|
/** Schema discovery — AI-powered field schema detection. */
|
|
14529
15449
|
schemaDiscoveries: {
|
|
14530
|
-
/**
|
|
15450
|
+
/**
|
|
15451
|
+
* Runs schema discovery on documents to automatically detect extraction
|
|
15452
|
+
* field schemas using AI.
|
|
15453
|
+
*
|
|
15454
|
+
* @param attributes - Schema discovery attributes (document or workspace scope).
|
|
15455
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15456
|
+
* @returns The created schema discovery object with detected fields.
|
|
15457
|
+
*
|
|
15458
|
+
* @example
|
|
15459
|
+
* ```typescript
|
|
15460
|
+
* const discovery = await admin.extraction.schemaDiscoveries.create({
|
|
15461
|
+
* document_id: 'doc-uuid',
|
|
15462
|
+
* workspace_id: 'ws-uuid',
|
|
15463
|
+
* });
|
|
15464
|
+
* console.log(discovery.suggested_fields);
|
|
15465
|
+
* ```
|
|
15466
|
+
*/
|
|
14531
15467
|
create: async (attributes, options) => {
|
|
14532
15468
|
return rb.execute(
|
|
14533
15469
|
postAdminExtractionSchemaDiscoveries,
|
|
@@ -14539,7 +15475,18 @@ function createExtractionNamespace(rb) {
|
|
|
14539
15475
|
options
|
|
14540
15476
|
);
|
|
14541
15477
|
},
|
|
14542
|
-
/**
|
|
15478
|
+
/**
|
|
15479
|
+
* Retrieves a schema discovery result by its unique identifier.
|
|
15480
|
+
*
|
|
15481
|
+
* @param id - The UUID of the schema discovery.
|
|
15482
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15483
|
+
* @returns The matching schema discovery object.
|
|
15484
|
+
*
|
|
15485
|
+
* @example
|
|
15486
|
+
* ```typescript
|
|
15487
|
+
* const discovery = await admin.extraction.schemaDiscoveries.get('discovery-uuid');
|
|
15488
|
+
* ```
|
|
15489
|
+
*/
|
|
14543
15490
|
get: async (id, options) => {
|
|
14544
15491
|
return rb.execute(
|
|
14545
15492
|
getAdminExtractionSchemaDiscoveriesById,
|
|
@@ -14547,7 +15494,21 @@ function createExtractionNamespace(rb) {
|
|
|
14547
15494
|
options
|
|
14548
15495
|
);
|
|
14549
15496
|
},
|
|
14550
|
-
/**
|
|
15497
|
+
/**
|
|
15498
|
+
* Bootstraps schema discovery for a workspace, analyzing existing
|
|
15499
|
+
* documents to suggest an initial extraction schema.
|
|
15500
|
+
*
|
|
15501
|
+
* @param attributes - Bootstrap attributes (workspace scope).
|
|
15502
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15503
|
+
* @returns The bootstrapped schema discovery object.
|
|
15504
|
+
*
|
|
15505
|
+
* @example
|
|
15506
|
+
* ```typescript
|
|
15507
|
+
* const discovery = await admin.extraction.schemaDiscoveries.bootstrap({
|
|
15508
|
+
* workspace_id: 'ws-uuid',
|
|
15509
|
+
* });
|
|
15510
|
+
* ```
|
|
15511
|
+
*/
|
|
14551
15512
|
bootstrap: async (attributes, options) => {
|
|
14552
15513
|
return rb.execute(
|
|
14553
15514
|
postAdminExtractionSchemaDiscoveriesBootstrap,
|
|
@@ -14562,7 +15523,21 @@ function createExtractionNamespace(rb) {
|
|
|
14562
15523
|
},
|
|
14563
15524
|
/** Field mapping — document-to-schema field alignment. */
|
|
14564
15525
|
fieldMappings: {
|
|
14565
|
-
/**
|
|
15526
|
+
/**
|
|
15527
|
+
* Retrieves the current field mapping for a document within a workspace,
|
|
15528
|
+
* showing how extracted fields align with the schema.
|
|
15529
|
+
*
|
|
15530
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15531
|
+
* @param documentId - The UUID of the document.
|
|
15532
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15533
|
+
* @returns The field mapping result for the document.
|
|
15534
|
+
*
|
|
15535
|
+
* @example
|
|
15536
|
+
* ```typescript
|
|
15537
|
+
* const mapping = await admin.extraction.fieldMappings.get('ws-uuid', 'doc-uuid');
|
|
15538
|
+
* console.log(mapping.mappings);
|
|
15539
|
+
* ```
|
|
15540
|
+
*/
|
|
14566
15541
|
get: async (workspaceId, documentId, options) => {
|
|
14567
15542
|
return rb.execute(
|
|
14568
15543
|
getAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
@@ -14570,89 +15545,432 @@ function createExtractionNamespace(rb) {
|
|
|
14570
15545
|
options
|
|
14571
15546
|
);
|
|
14572
15547
|
},
|
|
14573
|
-
/**
|
|
15548
|
+
/**
|
|
15549
|
+
* Creates or updates the field mapping for a document, confirming how
|
|
15550
|
+
* extracted fields should map to schema fields.
|
|
15551
|
+
*
|
|
15552
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15553
|
+
* @param documentId - The UUID of the document.
|
|
15554
|
+
* @param attributes - The mapping attributes including confirmation and mappings.
|
|
15555
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15556
|
+
* @returns The created or updated field mapping result.
|
|
15557
|
+
*
|
|
15558
|
+
* @example
|
|
15559
|
+
* ```typescript
|
|
15560
|
+
* const mapping = await admin.extraction.fieldMappings.create(
|
|
15561
|
+
* 'ws-uuid',
|
|
15562
|
+
* 'doc-uuid',
|
|
15563
|
+
* {
|
|
15564
|
+
* confirmed: true,
|
|
15565
|
+
* mappings: [
|
|
15566
|
+
* { source: 'inv_num', target: 'invoice_number' },
|
|
15567
|
+
* { source: 'amt', target: 'total_amount' },
|
|
15568
|
+
* ],
|
|
15569
|
+
* },
|
|
15570
|
+
* );
|
|
15571
|
+
* ```
|
|
15572
|
+
*/
|
|
14574
15573
|
create: async (workspaceId, documentId, attributes, options) => {
|
|
14575
15574
|
return rb.execute(
|
|
14576
|
-
postAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
14577
|
-
{
|
|
14578
|
-
path: { workspace_id: workspaceId, document_id: documentId },
|
|
14579
|
-
body: {
|
|
14580
|
-
data: { type: "field-mapping-result", attributes }
|
|
14581
|
-
}
|
|
14582
|
-
},
|
|
15575
|
+
postAdminWorkspacesByWorkspaceIdExtractionByDocumentIdMapping,
|
|
15576
|
+
{
|
|
15577
|
+
path: { workspace_id: workspaceId, document_id: documentId },
|
|
15578
|
+
body: {
|
|
15579
|
+
data: { type: "field-mapping-result", attributes }
|
|
15580
|
+
}
|
|
15581
|
+
},
|
|
15582
|
+
options
|
|
15583
|
+
);
|
|
15584
|
+
}
|
|
15585
|
+
},
|
|
15586
|
+
/** Shadow comparison results — primary vs shadow extractor quality metrics. */
|
|
15587
|
+
shadowComparisons: {
|
|
15588
|
+
/**
|
|
15589
|
+
* Lists all shadow comparison records across the platform.
|
|
15590
|
+
*
|
|
15591
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15592
|
+
* @returns An array of shadow comparison objects.
|
|
15593
|
+
*
|
|
15594
|
+
* @example
|
|
15595
|
+
* ```typescript
|
|
15596
|
+
* const comparisons = await admin.extraction.shadowComparisons.list();
|
|
15597
|
+
* ```
|
|
15598
|
+
*/
|
|
15599
|
+
list: async (options) => {
|
|
15600
|
+
return rb.execute(
|
|
15601
|
+
getAdminExtractionShadowComparisons,
|
|
15602
|
+
{},
|
|
15603
|
+
options
|
|
15604
|
+
);
|
|
15605
|
+
},
|
|
15606
|
+
/**
|
|
15607
|
+
* Retrieves a single shadow comparison by its unique identifier.
|
|
15608
|
+
*
|
|
15609
|
+
* @param id - The UUID of the shadow comparison.
|
|
15610
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15611
|
+
* @returns The matching shadow comparison object.
|
|
15612
|
+
*
|
|
15613
|
+
* @example
|
|
15614
|
+
* ```typescript
|
|
15615
|
+
* const comparison = await admin.extraction.shadowComparisons.get('comparison-uuid');
|
|
15616
|
+
* ```
|
|
15617
|
+
*/
|
|
15618
|
+
get: async (id, options) => {
|
|
15619
|
+
return rb.execute(
|
|
15620
|
+
getAdminExtractionShadowComparisonsById,
|
|
15621
|
+
{ path: { id } },
|
|
15622
|
+
options
|
|
15623
|
+
);
|
|
15624
|
+
},
|
|
15625
|
+
/**
|
|
15626
|
+
* Creates a new shadow comparison record to compare the output of the
|
|
15627
|
+
* primary extractor against a shadow extractor for quality evaluation.
|
|
15628
|
+
*
|
|
15629
|
+
* @param attributes - Shadow comparison creation attributes.
|
|
15630
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15631
|
+
* @returns The newly created shadow comparison object.
|
|
15632
|
+
*
|
|
15633
|
+
* @example
|
|
15634
|
+
* ```typescript
|
|
15635
|
+
* const comparison = await admin.extraction.shadowComparisons.create({
|
|
15636
|
+
* document_id: 'doc-uuid',
|
|
15637
|
+
* workspace_id: 'ws-uuid',
|
|
15638
|
+
* });
|
|
15639
|
+
* ```
|
|
15640
|
+
*/
|
|
15641
|
+
create: async (attributes, options) => {
|
|
15642
|
+
return rb.execute(
|
|
15643
|
+
postAdminExtractionShadowComparisons,
|
|
15644
|
+
{
|
|
15645
|
+
body: {
|
|
15646
|
+
data: { type: "shadow-comparison", attributes }
|
|
15647
|
+
}
|
|
15648
|
+
},
|
|
15649
|
+
options
|
|
15650
|
+
);
|
|
15651
|
+
},
|
|
15652
|
+
/**
|
|
15653
|
+
* Permanently deletes a shadow comparison record.
|
|
15654
|
+
*
|
|
15655
|
+
* @param id - The UUID of the shadow comparison to delete.
|
|
15656
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15657
|
+
* @returns `true` when the deletion succeeds.
|
|
15658
|
+
*
|
|
15659
|
+
* @example
|
|
15660
|
+
* ```typescript
|
|
15661
|
+
* await admin.extraction.shadowComparisons.delete('comparison-uuid');
|
|
15662
|
+
* ```
|
|
15663
|
+
*/
|
|
15664
|
+
delete: async (id, options) => {
|
|
15665
|
+
return rb.executeDelete(
|
|
15666
|
+
deleteAdminExtractionShadowComparisonsById,
|
|
15667
|
+
{ path: { id } },
|
|
15668
|
+
options
|
|
15669
|
+
);
|
|
15670
|
+
},
|
|
15671
|
+
/**
|
|
15672
|
+
* Retrieves the aggregated analysis report comparing primary vs shadow
|
|
15673
|
+
* extractor performance across all shadow comparison records.
|
|
15674
|
+
*
|
|
15675
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15676
|
+
* @returns An array of shadow comparison analysis results.
|
|
15677
|
+
*
|
|
15678
|
+
* @example
|
|
15679
|
+
* ```typescript
|
|
15680
|
+
* const analysis = await admin.extraction.shadowComparisons.analysis();
|
|
15681
|
+
* ```
|
|
15682
|
+
*/
|
|
15683
|
+
analysis: async (options) => {
|
|
15684
|
+
return rb.execute(
|
|
15685
|
+
getAdminExtractionShadowComparisonsAnalysis,
|
|
15686
|
+
{},
|
|
15687
|
+
options
|
|
15688
|
+
);
|
|
15689
|
+
}
|
|
15690
|
+
},
|
|
15691
|
+
/** Content analysis results — PII detection, OCR quality, entity extraction. */
|
|
15692
|
+
analyses: {
|
|
15693
|
+
/**
|
|
15694
|
+
* Lists all extraction analysis records across the platform, including
|
|
15695
|
+
* PII detection results and OCR quality metrics.
|
|
15696
|
+
*
|
|
15697
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15698
|
+
* @returns An array of extraction analysis objects.
|
|
15699
|
+
*
|
|
15700
|
+
* @example
|
|
15701
|
+
* ```typescript
|
|
15702
|
+
* const analyses = await admin.extraction.analyses.list();
|
|
15703
|
+
* ```
|
|
15704
|
+
*/
|
|
15705
|
+
list: async (options) => {
|
|
15706
|
+
return rb.execute(
|
|
15707
|
+
getAdminExtractionAnalyses,
|
|
15708
|
+
{},
|
|
15709
|
+
options
|
|
15710
|
+
);
|
|
15711
|
+
},
|
|
15712
|
+
/**
|
|
15713
|
+
* Retrieves a single extraction analysis by its unique identifier.
|
|
15714
|
+
*
|
|
15715
|
+
* @param id - The UUID of the extraction analysis.
|
|
15716
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15717
|
+
* @returns The matching extraction analysis object.
|
|
15718
|
+
*
|
|
15719
|
+
* @example
|
|
15720
|
+
* ```typescript
|
|
15721
|
+
* const analysis = await admin.extraction.analyses.get('analysis-uuid');
|
|
15722
|
+
* console.log(analysis.pii_detected, analysis.ocr_confidence);
|
|
15723
|
+
* ```
|
|
15724
|
+
*/
|
|
15725
|
+
get: async (id, options) => {
|
|
15726
|
+
return rb.execute(
|
|
15727
|
+
getAdminExtractionAnalysesById,
|
|
15728
|
+
{ path: { id } },
|
|
14583
15729
|
options
|
|
14584
15730
|
);
|
|
14585
15731
|
}
|
|
14586
15732
|
},
|
|
14587
|
-
/**
|
|
14588
|
-
|
|
14589
|
-
/**
|
|
15733
|
+
/** Post-processing hooks — configurable hooks that execute after extraction. */
|
|
15734
|
+
postProcessingHooks: {
|
|
15735
|
+
/**
|
|
15736
|
+
* Lists all post-processing hooks across the platform.
|
|
15737
|
+
*
|
|
15738
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15739
|
+
* @returns An array of post-processing hook objects.
|
|
15740
|
+
*
|
|
15741
|
+
* @example
|
|
15742
|
+
* ```typescript
|
|
15743
|
+
* const hooks = await admin.extraction.postProcessingHooks.list();
|
|
15744
|
+
* ```
|
|
15745
|
+
*/
|
|
14590
15746
|
list: async (options) => {
|
|
14591
15747
|
return rb.execute(
|
|
14592
|
-
|
|
15748
|
+
getAdminPostProcessingHooks,
|
|
14593
15749
|
{},
|
|
14594
15750
|
options
|
|
14595
15751
|
);
|
|
14596
15752
|
},
|
|
14597
|
-
/**
|
|
15753
|
+
/**
|
|
15754
|
+
* Retrieves a single post-processing hook by its unique identifier.
|
|
15755
|
+
*
|
|
15756
|
+
* @param id - The UUID of the hook.
|
|
15757
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15758
|
+
* @returns The matching post-processing hook object.
|
|
15759
|
+
*
|
|
15760
|
+
* @example
|
|
15761
|
+
* ```typescript
|
|
15762
|
+
* const hook = await admin.extraction.postProcessingHooks.get('hook-uuid');
|
|
15763
|
+
* ```
|
|
15764
|
+
*/
|
|
14598
15765
|
get: async (id, options) => {
|
|
14599
15766
|
return rb.execute(
|
|
14600
|
-
|
|
15767
|
+
getAdminPostProcessingHooksById,
|
|
14601
15768
|
{ path: { id } },
|
|
14602
15769
|
options
|
|
14603
15770
|
);
|
|
14604
15771
|
},
|
|
14605
|
-
/**
|
|
15772
|
+
/**
|
|
15773
|
+
* Creates a new post-processing hook for the extraction pipeline.
|
|
15774
|
+
*
|
|
15775
|
+
* @param attributes - Hook creation attributes including name, trigger, and type.
|
|
15776
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15777
|
+
* @returns The newly created post-processing hook object.
|
|
15778
|
+
*
|
|
15779
|
+
* @example
|
|
15780
|
+
* ```typescript
|
|
15781
|
+
* const hook = await admin.extraction.postProcessingHooks.create({
|
|
15782
|
+
* name: 'Notify on extraction',
|
|
15783
|
+
* trigger: 'after_extraction',
|
|
15784
|
+
* type: 'webhook',
|
|
15785
|
+
* config: { url: 'https://example.com/hook' },
|
|
15786
|
+
* workspace_id: 'ws-uuid',
|
|
15787
|
+
* });
|
|
15788
|
+
* ```
|
|
15789
|
+
*/
|
|
14606
15790
|
create: async (attributes, options) => {
|
|
14607
15791
|
return rb.execute(
|
|
14608
|
-
|
|
15792
|
+
postAdminPostProcessingHooks,
|
|
14609
15793
|
{
|
|
14610
15794
|
body: {
|
|
14611
|
-
data: { type: "
|
|
15795
|
+
data: { type: "post-processing-hook", attributes }
|
|
15796
|
+
}
|
|
15797
|
+
},
|
|
15798
|
+
options
|
|
15799
|
+
);
|
|
15800
|
+
},
|
|
15801
|
+
/**
|
|
15802
|
+
* Updates an existing post-processing hook's configuration.
|
|
15803
|
+
*
|
|
15804
|
+
* @param id - The UUID of the hook to update.
|
|
15805
|
+
* @param attributes - The attributes to update.
|
|
15806
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15807
|
+
* @returns The updated post-processing hook object.
|
|
15808
|
+
*
|
|
15809
|
+
* @example
|
|
15810
|
+
* ```typescript
|
|
15811
|
+
* const hook = await admin.extraction.postProcessingHooks.update('hook-uuid', {
|
|
15812
|
+
* enabled: false,
|
|
15813
|
+
* });
|
|
15814
|
+
* ```
|
|
15815
|
+
*/
|
|
15816
|
+
update: async (id, attributes, options) => {
|
|
15817
|
+
return rb.execute(
|
|
15818
|
+
patchAdminPostProcessingHooksById,
|
|
15819
|
+
{
|
|
15820
|
+
path: { id },
|
|
15821
|
+
body: {
|
|
15822
|
+
data: { id, type: "post-processing-hook", attributes }
|
|
14612
15823
|
}
|
|
14613
15824
|
},
|
|
14614
15825
|
options
|
|
14615
15826
|
);
|
|
14616
15827
|
},
|
|
14617
|
-
/**
|
|
15828
|
+
/**
|
|
15829
|
+
* Permanently deletes a post-processing hook.
|
|
15830
|
+
*
|
|
15831
|
+
* @param id - The UUID of the hook to delete.
|
|
15832
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15833
|
+
* @returns `true` when the deletion succeeds.
|
|
15834
|
+
*
|
|
15835
|
+
* @example
|
|
15836
|
+
* ```typescript
|
|
15837
|
+
* await admin.extraction.postProcessingHooks.delete('hook-uuid');
|
|
15838
|
+
* ```
|
|
15839
|
+
*/
|
|
14618
15840
|
delete: async (id, options) => {
|
|
14619
15841
|
return rb.executeDelete(
|
|
14620
|
-
|
|
15842
|
+
deleteAdminPostProcessingHooksById,
|
|
14621
15843
|
{ path: { id } },
|
|
14622
15844
|
options
|
|
14623
15845
|
);
|
|
15846
|
+
}
|
|
15847
|
+
},
|
|
15848
|
+
/** Training analytics — workspace-level extraction training metrics. */
|
|
15849
|
+
trainingAnalytics: {
|
|
15850
|
+
/**
|
|
15851
|
+
* Retrieves training analytics for a specific workspace, including
|
|
15852
|
+
* accuracy trends, correction counts, and low-confidence documents.
|
|
15853
|
+
*
|
|
15854
|
+
* @param workspaceId - The UUID of the workspace.
|
|
15855
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15856
|
+
* @returns The training analytics object for the workspace.
|
|
15857
|
+
*
|
|
15858
|
+
* @example
|
|
15859
|
+
* ```typescript
|
|
15860
|
+
* const analytics = await admin.extraction.trainingAnalytics.forWorkspace('ws-uuid');
|
|
15861
|
+
* console.log(analytics.avg_confidence, analytics.total_examples);
|
|
15862
|
+
* ```
|
|
15863
|
+
*/
|
|
15864
|
+
forWorkspace: async (workspaceId, options) => {
|
|
15865
|
+
return rb.execute(
|
|
15866
|
+
getAdminWorkspacesByWorkspaceIdTrainingAnalytics,
|
|
15867
|
+
{ path: { workspace_id: workspaceId } },
|
|
15868
|
+
options
|
|
15869
|
+
);
|
|
14624
15870
|
},
|
|
14625
|
-
/**
|
|
14626
|
-
|
|
15871
|
+
/**
|
|
15872
|
+
* Retrieves training analytics for multiple workspaces in a single
|
|
15873
|
+
* request (max 50). Pass workspace IDs as a comma-separated string.
|
|
15874
|
+
*
|
|
15875
|
+
* @param workspaceIds - Comma-separated workspace UUIDs.
|
|
15876
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15877
|
+
* @returns An array of training analytics objects.
|
|
15878
|
+
*
|
|
15879
|
+
* @example
|
|
15880
|
+
* ```typescript
|
|
15881
|
+
* const batch = await admin.extraction.trainingAnalytics.batch('ws-1,ws-2,ws-3');
|
|
15882
|
+
* ```
|
|
15883
|
+
*/
|
|
15884
|
+
batch: async (workspaceIds, options) => {
|
|
14627
15885
|
return rb.execute(
|
|
14628
|
-
|
|
14629
|
-
{},
|
|
15886
|
+
getAdminWorkspacesAnalyticsBatch,
|
|
15887
|
+
{ query: { workspace_ids: workspaceIds } },
|
|
14630
15888
|
options
|
|
14631
15889
|
);
|
|
14632
15890
|
}
|
|
14633
15891
|
},
|
|
14634
|
-
/**
|
|
14635
|
-
|
|
14636
|
-
/**
|
|
15892
|
+
/** Extraction agents — list and predict best extraction agents for documents. */
|
|
15893
|
+
extractionAgents: {
|
|
15894
|
+
/**
|
|
15895
|
+
* Lists all available extraction agents (system agents tagged with
|
|
15896
|
+
* "extraction" category).
|
|
15897
|
+
*
|
|
15898
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15899
|
+
* @returns An array of extraction agent objects.
|
|
15900
|
+
*
|
|
15901
|
+
* @example
|
|
15902
|
+
* ```typescript
|
|
15903
|
+
* const agents = await admin.extraction.extractionAgents.list();
|
|
15904
|
+
* ```
|
|
15905
|
+
*/
|
|
14637
15906
|
list: async (options) => {
|
|
14638
15907
|
return rb.execute(
|
|
14639
|
-
|
|
15908
|
+
getAdminExtractionAgents,
|
|
14640
15909
|
{},
|
|
14641
15910
|
options
|
|
14642
15911
|
);
|
|
14643
15912
|
},
|
|
14644
|
-
/**
|
|
15913
|
+
/**
|
|
15914
|
+
* Retrieves a single extraction agent by its unique identifier.
|
|
15915
|
+
*
|
|
15916
|
+
* @param id - The UUID of the extraction agent.
|
|
15917
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15918
|
+
* @returns The matching extraction agent object.
|
|
15919
|
+
*
|
|
15920
|
+
* @example
|
|
15921
|
+
* ```typescript
|
|
15922
|
+
* const agent = await admin.extraction.extractionAgents.get('agent-uuid');
|
|
15923
|
+
* ```
|
|
15924
|
+
*/
|
|
14645
15925
|
get: async (id, options) => {
|
|
14646
15926
|
return rb.execute(
|
|
14647
|
-
|
|
15927
|
+
getAdminExtractionAgentsById,
|
|
14648
15928
|
{ path: { id } },
|
|
14649
15929
|
options
|
|
14650
15930
|
);
|
|
15931
|
+
},
|
|
15932
|
+
/**
|
|
15933
|
+
* Predicts the best extraction agent for a given document based on its
|
|
15934
|
+
* name, description, or file content.
|
|
15935
|
+
*
|
|
15936
|
+
* @param attributes - Prediction input attributes.
|
|
15937
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15938
|
+
* @returns A prediction result with recommended agents.
|
|
15939
|
+
*
|
|
15940
|
+
* @example
|
|
15941
|
+
* ```typescript
|
|
15942
|
+
* const prediction = await admin.extraction.extractionAgents.predict({
|
|
15943
|
+
* name: 'invoice.pdf',
|
|
15944
|
+
* description: 'Monthly vendor invoice',
|
|
15945
|
+
* file_content: 'Invoice #12345...',
|
|
15946
|
+
* });
|
|
15947
|
+
* ```
|
|
15948
|
+
*/
|
|
15949
|
+
predict: async (attributes, options) => {
|
|
15950
|
+
return rb.execute(
|
|
15951
|
+
postAdminExtractionAgentsPredict,
|
|
15952
|
+
{
|
|
15953
|
+
body: {
|
|
15954
|
+
data: { type: "extraction-agent", attributes }
|
|
15955
|
+
}
|
|
15956
|
+
},
|
|
15957
|
+
options
|
|
15958
|
+
);
|
|
14651
15959
|
}
|
|
14652
15960
|
},
|
|
14653
15961
|
/** Chunk-entity links — bridge between document chunks and knowledge graph entities. */
|
|
14654
15962
|
chunkEntityLinks: {
|
|
14655
|
-
/**
|
|
15963
|
+
/**
|
|
15964
|
+
* Lists all chunk-entity links across the platform.
|
|
15965
|
+
*
|
|
15966
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15967
|
+
* @returns An array of chunk-entity link objects.
|
|
15968
|
+
*
|
|
15969
|
+
* @example
|
|
15970
|
+
* ```typescript
|
|
15971
|
+
* const links = await admin.extraction.chunkEntityLinks.list();
|
|
15972
|
+
* ```
|
|
15973
|
+
*/
|
|
14656
15974
|
list: async (options) => {
|
|
14657
15975
|
return rb.execute(
|
|
14658
15976
|
getAdminExtractionChunkEntityLinks,
|
|
@@ -14660,7 +15978,18 @@ function createExtractionNamespace(rb) {
|
|
|
14660
15978
|
options
|
|
14661
15979
|
);
|
|
14662
15980
|
},
|
|
14663
|
-
/**
|
|
15981
|
+
/**
|
|
15982
|
+
* Retrieves a single chunk-entity link by its unique identifier.
|
|
15983
|
+
*
|
|
15984
|
+
* @param id - The UUID of the chunk-entity link.
|
|
15985
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
15986
|
+
* @returns The matching chunk-entity link object.
|
|
15987
|
+
*
|
|
15988
|
+
* @example
|
|
15989
|
+
* ```typescript
|
|
15990
|
+
* const link = await admin.extraction.chunkEntityLinks.get('link-uuid');
|
|
15991
|
+
* ```
|
|
15992
|
+
*/
|
|
14664
15993
|
get: async (id, options) => {
|
|
14665
15994
|
return rb.execute(
|
|
14666
15995
|
getAdminExtractionChunkEntityLinksById,
|
|
@@ -14668,7 +15997,18 @@ function createExtractionNamespace(rb) {
|
|
|
14668
15997
|
options
|
|
14669
15998
|
);
|
|
14670
15999
|
},
|
|
14671
|
-
/**
|
|
16000
|
+
/**
|
|
16001
|
+
* Lists all chunk-entity links for a specific document.
|
|
16002
|
+
*
|
|
16003
|
+
* @param documentId - The UUID of the document.
|
|
16004
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
16005
|
+
* @returns An array of chunk-entity links for the document.
|
|
16006
|
+
*
|
|
16007
|
+
* @example
|
|
16008
|
+
* ```typescript
|
|
16009
|
+
* const links = await admin.extraction.chunkEntityLinks.byDocument('doc-uuid');
|
|
16010
|
+
* ```
|
|
16011
|
+
*/
|
|
14672
16012
|
byDocument: async (documentId, options) => {
|
|
14673
16013
|
return rb.execute(
|
|
14674
16014
|
getAdminExtractionChunkEntityLinksDocumentByDocumentId,
|
|
@@ -14676,7 +16016,18 @@ function createExtractionNamespace(rb) {
|
|
|
14676
16016
|
options
|
|
14677
16017
|
);
|
|
14678
16018
|
},
|
|
14679
|
-
/**
|
|
16019
|
+
/**
|
|
16020
|
+
* Lists all chunk-entity links for a specific document chunk.
|
|
16021
|
+
*
|
|
16022
|
+
* @param documentChunkId - The UUID of the document chunk.
|
|
16023
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
16024
|
+
* @returns An array of chunk-entity links for the chunk.
|
|
16025
|
+
*
|
|
16026
|
+
* @example
|
|
16027
|
+
* ```typescript
|
|
16028
|
+
* const links = await admin.extraction.chunkEntityLinks.byChunk('chunk-uuid');
|
|
16029
|
+
* ```
|
|
16030
|
+
*/
|
|
14680
16031
|
byChunk: async (documentChunkId, options) => {
|
|
14681
16032
|
return rb.execute(
|
|
14682
16033
|
getAdminExtractionChunkEntityLinksChunkByDocumentChunkId,
|
|
@@ -14684,7 +16035,18 @@ function createExtractionNamespace(rb) {
|
|
|
14684
16035
|
options
|
|
14685
16036
|
);
|
|
14686
16037
|
},
|
|
14687
|
-
/**
|
|
16038
|
+
/**
|
|
16039
|
+
* Lists all chunk-entity links for a specific knowledge graph entity.
|
|
16040
|
+
*
|
|
16041
|
+
* @param graphNodeId - The UUID of the graph node (entity).
|
|
16042
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
16043
|
+
* @returns An array of chunk-entity links for the entity.
|
|
16044
|
+
*
|
|
16045
|
+
* @example
|
|
16046
|
+
* ```typescript
|
|
16047
|
+
* const links = await admin.extraction.chunkEntityLinks.byEntity('node-uuid');
|
|
16048
|
+
* ```
|
|
16049
|
+
*/
|
|
14688
16050
|
byEntity: async (graphNodeId, options) => {
|
|
14689
16051
|
return rb.execute(
|
|
14690
16052
|
getAdminExtractionChunkEntityLinksEntityByGraphNodeId,
|
|
@@ -19323,6 +20685,12 @@ function createClinicalNamespace(rb) {
|
|
|
19323
20685
|
{ path: { id } },
|
|
19324
20686
|
options
|
|
19325
20687
|
),
|
|
20688
|
+
/** List medications for a patient. */
|
|
20689
|
+
medications: async (id, options) => rb.execute(
|
|
20690
|
+
getAdminClinicalPatientsByIdMedications,
|
|
20691
|
+
{ path: { id } },
|
|
20692
|
+
options
|
|
20693
|
+
),
|
|
19326
20694
|
/** List resource assignments for a patient. */
|
|
19327
20695
|
resourceAssignments: async (id, options) => rb.execute(
|
|
19328
20696
|
getAdminClinicalPatientsByIdResourceAssignments,
|
|
@@ -20024,6 +21392,96 @@ function createClinicalNamespace(rb) {
|
|
|
20024
21392
|
options
|
|
20025
21393
|
).then((r) => r.data)
|
|
20026
21394
|
},
|
|
21395
|
+
/**
|
|
21396
|
+
* Manage medication prescriptions for clinical patients.
|
|
21397
|
+
*/
|
|
21398
|
+
clientMedications: {
|
|
21399
|
+
/** List medication prescriptions. */
|
|
21400
|
+
list: async (params, options) => rb.execute(
|
|
21401
|
+
getAdminClinicalClientMedications,
|
|
21402
|
+
{ query: params ?? {} },
|
|
21403
|
+
options
|
|
21404
|
+
),
|
|
21405
|
+
/** Get a single medication prescription by ID. */
|
|
21406
|
+
get: async (id, options) => rb.execute(
|
|
21407
|
+
getAdminClinicalClientMedicationsById,
|
|
21408
|
+
{ path: { id } },
|
|
21409
|
+
options
|
|
21410
|
+
),
|
|
21411
|
+
/** Create a new medication prescription. */
|
|
21412
|
+
create: async (attributes, options) => rb.execute(
|
|
21413
|
+
postAdminClinicalClientMedications,
|
|
21414
|
+
{
|
|
21415
|
+
body: { data: { type: "clinical-client-medication", attributes } }
|
|
21416
|
+
},
|
|
21417
|
+
options
|
|
21418
|
+
),
|
|
21419
|
+
/** Update a medication prescription. */
|
|
21420
|
+
update: async (id, attributes, options) => rb.execute(
|
|
21421
|
+
patchAdminClinicalClientMedicationsById,
|
|
21422
|
+
{
|
|
21423
|
+
path: { id },
|
|
21424
|
+
body: {
|
|
21425
|
+
data: { type: "clinical-client-medication", id, attributes }
|
|
21426
|
+
}
|
|
21427
|
+
},
|
|
21428
|
+
options
|
|
21429
|
+
),
|
|
21430
|
+
/**
|
|
21431
|
+
* Delete (archive) a medication prescription.
|
|
21432
|
+
* @deprecated Use {@link archive} instead.
|
|
21433
|
+
*/
|
|
21434
|
+
delete: async (id, options) => rb.execute(
|
|
21435
|
+
patchAdminClinicalClientMedicationsByIdArchive,
|
|
21436
|
+
{
|
|
21437
|
+
path: { id },
|
|
21438
|
+
body: {
|
|
21439
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21440
|
+
}
|
|
21441
|
+
},
|
|
21442
|
+
options
|
|
21443
|
+
),
|
|
21444
|
+
/** Archive (soft-delete) a medication prescription. */
|
|
21445
|
+
archive: async (id, options) => rb.execute(
|
|
21446
|
+
patchAdminClinicalClientMedicationsByIdArchive,
|
|
21447
|
+
{
|
|
21448
|
+
path: { id },
|
|
21449
|
+
body: {
|
|
21450
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21451
|
+
}
|
|
21452
|
+
},
|
|
21453
|
+
options
|
|
21454
|
+
),
|
|
21455
|
+
/** Restore an archived medication prescription. */
|
|
21456
|
+
restore: async (id, options) => rb.execute(
|
|
21457
|
+
patchAdminClinicalClientMedicationsByIdRestore,
|
|
21458
|
+
{
|
|
21459
|
+
path: { id },
|
|
21460
|
+
body: {
|
|
21461
|
+
data: { type: "clinical-client-medication", id, attributes: {} }
|
|
21462
|
+
}
|
|
21463
|
+
},
|
|
21464
|
+
options
|
|
21465
|
+
),
|
|
21466
|
+
/** Permanently delete a medication prescription. Irreversible. */
|
|
21467
|
+
permanentDelete: async (id, options) => rb.executeDelete(
|
|
21468
|
+
deleteAdminClinicalClientMedicationsByIdPermanent,
|
|
21469
|
+
{ path: { id } },
|
|
21470
|
+
options
|
|
21471
|
+
),
|
|
21472
|
+
/** List archived (soft-deleted) medication prescriptions. */
|
|
21473
|
+
listArchived: async (params, options) => rb.execute(
|
|
21474
|
+
getAdminClinicalClientMedicationsArchived,
|
|
21475
|
+
{ query: params ?? {} },
|
|
21476
|
+
options
|
|
21477
|
+
),
|
|
21478
|
+
/** Create multiple medications in a single request. */
|
|
21479
|
+
bulkCreate: async (attrs, options) => rb.rawPost(
|
|
21480
|
+
`/admin/clinical/client-medications/bulk`,
|
|
21481
|
+
{ data: attrs },
|
|
21482
|
+
options
|
|
21483
|
+
).then((r) => r.data)
|
|
21484
|
+
},
|
|
20027
21485
|
/** View and update clinical delivery audit records. */
|
|
20028
21486
|
deliveries: {
|
|
20029
21487
|
/** List deliveries. */
|
|
@@ -21121,6 +22579,72 @@ function createImportsNamespace(rb) {
|
|
|
21121
22579
|
};
|
|
21122
22580
|
}
|
|
21123
22581
|
|
|
22582
|
+
// src/namespaces/documents.ts
|
|
22583
|
+
function createDocumentsNamespace(rb) {
|
|
22584
|
+
return {
|
|
22585
|
+
/**
|
|
22586
|
+
* Generate a PDF from HTML content and store it in platform Storage.
|
|
22587
|
+
*
|
|
22588
|
+
* Always pass `store: true` and `workspace_id` to get a JSON response with
|
|
22589
|
+
* a `storage_key`. Without `store: true`, the server returns raw
|
|
22590
|
+
* `application/pdf` binary which cannot be parsed as JSON by this SDK method.
|
|
22591
|
+
*
|
|
22592
|
+
* HTML input is capped at 2MB by the server.
|
|
22593
|
+
*
|
|
22594
|
+
* @param params - PDF generation parameters. Set `store: true` and provide
|
|
22595
|
+
* `workspace_id` for JSON response.
|
|
22596
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
22597
|
+
* @returns A storage key reference for the generated PDF.
|
|
22598
|
+
*
|
|
22599
|
+
* @example
|
|
22600
|
+
* ```typescript
|
|
22601
|
+
* const { storage_key } = await admin.documents.generatePdf({
|
|
22602
|
+
* html: '<html><body>Report</body></html>',
|
|
22603
|
+
* store: true,
|
|
22604
|
+
* workspace_id: 'ws-123',
|
|
22605
|
+
* });
|
|
22606
|
+
* ```
|
|
22607
|
+
*/
|
|
22608
|
+
generatePdf: async (params, options) => {
|
|
22609
|
+
return rb.rawPostDirect(
|
|
22610
|
+
"/isv/documents/pdf",
|
|
22611
|
+
params,
|
|
22612
|
+
options
|
|
22613
|
+
);
|
|
22614
|
+
},
|
|
22615
|
+
/**
|
|
22616
|
+
* Generate a PDF from HTML and email it as an attachment.
|
|
22617
|
+
*
|
|
22618
|
+
* The PDF is generated server-side and delivered via platform SMTP.
|
|
22619
|
+
* Optionally stores the PDF in platform Storage alongside the email delivery.
|
|
22620
|
+
*
|
|
22621
|
+
* If storage fails but the email succeeds, the response includes
|
|
22622
|
+
* `storage_error` with the failure reason (email is still delivered).
|
|
22623
|
+
*
|
|
22624
|
+
* @param params - Email report parameters.
|
|
22625
|
+
* @param options - Optional request options (abort signal, custom headers).
|
|
22626
|
+
* @returns Delivery status, optional storage key, and any storage error.
|
|
22627
|
+
*
|
|
22628
|
+
* @example
|
|
22629
|
+
* ```typescript
|
|
22630
|
+
* const result = await admin.documents.emailReport({
|
|
22631
|
+
* html: '<html><body><h1>Q1 Summary</h1></body></html>',
|
|
22632
|
+
* to: 'finance@company.com',
|
|
22633
|
+
* subject: 'Q1 Financial Summary',
|
|
22634
|
+
* });
|
|
22635
|
+
* console.log(result.sent); // true
|
|
22636
|
+
* ```
|
|
22637
|
+
*/
|
|
22638
|
+
emailReport: async (params, options) => {
|
|
22639
|
+
return rb.rawPostDirect(
|
|
22640
|
+
"/isv/documents/pdf/email",
|
|
22641
|
+
params,
|
|
22642
|
+
options
|
|
22643
|
+
);
|
|
22644
|
+
}
|
|
22645
|
+
};
|
|
22646
|
+
}
|
|
22647
|
+
|
|
21124
22648
|
// src/gpt-admin.ts
|
|
21125
22649
|
var GptAdmin = class extends BaseClient {
|
|
21126
22650
|
constructor(config) {
|
|
@@ -21137,7 +22661,7 @@ var GptAdmin = class extends BaseClient {
|
|
|
21137
22661
|
this.capabilities = createCapabilitiesNamespace(rb);
|
|
21138
22662
|
this.apiKeys = createApiKeysNamespace(rb);
|
|
21139
22663
|
this.extraction = createExtractionNamespace(rb);
|
|
21140
|
-
this.documents =
|
|
22664
|
+
this.documents = createDocumentsNamespace(rb);
|
|
21141
22665
|
this.executions = createExecutionsNamespace(rb);
|
|
21142
22666
|
this.storage = createStorageNamespace(rb);
|
|
21143
22667
|
this.users = createUsersNamespace(rb);
|