@ptkl/sdk 1.11.0 → 1.13.0
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.0.10.js +156 -0
- package/dist/index.0.9.js +57 -0
- package/dist/package.json +1 -1
- package/dist/v0.10/api/component.d.ts +1 -0
- package/dist/v0.10/api/forge.d.ts +9 -0
- package/dist/v0.10/api/index.d.ts +3 -0
- package/dist/v0.10/api/integrations/dms.d.ts +54 -1
- package/dist/v0.10/api/satellites.d.ts +17 -0
- package/dist/v0.10/index.cjs.js +156 -0
- package/dist/v0.10/index.esm.js +156 -1
- package/dist/v0.10/types/integrations.d.ts +97 -0
- package/dist/v0.10/types/satellites.d.ts +100 -0
- package/dist/v0.9/api/forge.d.ts +3 -0
- package/dist/v0.9/api/index.d.ts +2 -0
- package/dist/v0.9/api/integrations/timber.d.ts +22 -0
- package/dist/v0.9/api/integrations.d.ts +2 -0
- package/dist/v0.9/index.cjs.js +57 -0
- package/dist/v0.9/index.esm.js +57 -1
- package/dist/v0.9/types/integrations/timber.d.ts +77 -0
- package/package.json +1 -1
package/dist/index.0.10.js
CHANGED
|
@@ -345,6 +345,11 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
345
345
|
async delete(uuid) {
|
|
346
346
|
return await this.client.delete(`/v4/system/component/${this.ref}/model/${uuid}`);
|
|
347
347
|
}
|
|
348
|
+
async deleteMany(uuids) {
|
|
349
|
+
return await this.client.delete(`/v4/system/component/${this.ref}/models/bulk`, {
|
|
350
|
+
data: uuids,
|
|
351
|
+
});
|
|
352
|
+
}
|
|
348
353
|
/**
|
|
349
354
|
* Execute aggregate pipeline with optional streaming support
|
|
350
355
|
*
|
|
@@ -1289,6 +1294,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1289
1294
|
}
|
|
1290
1295
|
|
|
1291
1296
|
class Forge extends PlatformBaseClient {
|
|
1297
|
+
// --- Management (appservice) ---
|
|
1292
1298
|
async bundleUpload(buffer) {
|
|
1293
1299
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
1294
1300
|
headers: {
|
|
@@ -1306,6 +1312,36 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1306
1312
|
async list() {
|
|
1307
1313
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
1308
1314
|
}
|
|
1315
|
+
async listServices(ref) {
|
|
1316
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
1317
|
+
}
|
|
1318
|
+
// --- Variables ---
|
|
1319
|
+
async getVariables(ref) {
|
|
1320
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1321
|
+
}
|
|
1322
|
+
async updateVariables(ref, variables) {
|
|
1323
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
1324
|
+
}
|
|
1325
|
+
async addVariable(ref, key, value) {
|
|
1326
|
+
var _a;
|
|
1327
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1328
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
1329
|
+
current[key] = value;
|
|
1330
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
1331
|
+
}
|
|
1332
|
+
// --- Service execution (forge-runtime) ---
|
|
1333
|
+
async callService(appUuid, serviceName, options) {
|
|
1334
|
+
var _a, _b, _c;
|
|
1335
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
1336
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
1337
|
+
: '';
|
|
1338
|
+
// @ts-ignore
|
|
1339
|
+
const devServiceUrl = isBrowser && ((_a = window.__ENV_VARIABLES__) === null || _a === void 0 ? void 0 : _a.FORGE_DEV_SERVICE_URL);
|
|
1340
|
+
if (devServiceUrl) {
|
|
1341
|
+
return axios.post(`${devServiceUrl}/${serviceName}${queryString}`, (_b = options === null || options === void 0 ? void 0 : options.body) !== null && _b !== void 0 ? _b : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
1342
|
+
}
|
|
1343
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_c = options === null || options === void 0 ? void 0 : options.body) !== null && _c !== void 0 ? _c : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
1344
|
+
}
|
|
1309
1345
|
}
|
|
1310
1346
|
|
|
1311
1347
|
const BASE = '/luma/kortex/v1';
|
|
@@ -2515,6 +2551,72 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
2515
2551
|
}
|
|
2516
2552
|
});
|
|
2517
2553
|
}
|
|
2554
|
+
// ===================================================================
|
|
2555
|
+
// Text Extraction
|
|
2556
|
+
// ===================================================================
|
|
2557
|
+
/**
|
|
2558
|
+
* Extract text from any document format
|
|
2559
|
+
*
|
|
2560
|
+
* Supports PDF, DOCX, XLSX, PPTX, ODT, RTF, EPUB, CSV, images, and 40+ other formats.
|
|
2561
|
+
* Provide either a DMS file path or base64-encoded file data.
|
|
2562
|
+
*
|
|
2563
|
+
* @param payload - File path or base64 data to extract text from
|
|
2564
|
+
* @returns Extracted text content and character count
|
|
2565
|
+
*
|
|
2566
|
+
* @example
|
|
2567
|
+
* ```typescript
|
|
2568
|
+
* // From a DMS file path
|
|
2569
|
+
* const result = await dms.extractText({ input_path: 'uploads/contract.pdf' });
|
|
2570
|
+
* console.log(result.data.text);
|
|
2571
|
+
* console.log(result.data.char_count);
|
|
2572
|
+
*
|
|
2573
|
+
* // From base64 data
|
|
2574
|
+
* const result = await dms.extractText({
|
|
2575
|
+
* file_data: 'data:application/pdf;base64,...',
|
|
2576
|
+
* file_name: 'invoice.pdf'
|
|
2577
|
+
* });
|
|
2578
|
+
* ```
|
|
2579
|
+
*/
|
|
2580
|
+
async extractText(payload) {
|
|
2581
|
+
return this.request('POST', 'media/extract-text', { data: payload });
|
|
2582
|
+
}
|
|
2583
|
+
// ===================================================================
|
|
2584
|
+
// OCR Extraction
|
|
2585
|
+
// ===================================================================
|
|
2586
|
+
/**
|
|
2587
|
+
* Run OCR extraction on an image using a saved model
|
|
2588
|
+
*
|
|
2589
|
+
* Crops each labeled region from the image and runs OCR to extract text.
|
|
2590
|
+
* Returns structured key-value results.
|
|
2591
|
+
*
|
|
2592
|
+
* @param payload - Model UUID, image (base64 or DMS key), and optional document boundary
|
|
2593
|
+
* @returns Extraction results as label-text pairs
|
|
2594
|
+
*
|
|
2595
|
+
* @example
|
|
2596
|
+
* ```typescript
|
|
2597
|
+
* // From a DMS file
|
|
2598
|
+
* const result = await dms.ocrExtract({
|
|
2599
|
+
* model_uuid: 'model-uuid',
|
|
2600
|
+
* image_key: 'uploads/scan.jpg',
|
|
2601
|
+
* document_boundary: { x: 0.05, y: 0.08, width: 0.9, height: 0.85 }
|
|
2602
|
+
* });
|
|
2603
|
+
*
|
|
2604
|
+
* console.log(result.data.results);
|
|
2605
|
+
* // { name: "John Smith", date_of_birth: "01.01.1990", id_number: "123456789" }
|
|
2606
|
+
*
|
|
2607
|
+
* // From base64
|
|
2608
|
+
* const result = await dms.ocrExtract({
|
|
2609
|
+
* model_uuid: 'model-uuid',
|
|
2610
|
+
* image: 'data:image/jpeg;base64,...'
|
|
2611
|
+
* });
|
|
2612
|
+
* ```
|
|
2613
|
+
*/
|
|
2614
|
+
async ocrExtract(payload) {
|
|
2615
|
+
return this.request('POST', 'media/ocr/extract', {
|
|
2616
|
+
data: payload,
|
|
2617
|
+
timeout: 120000
|
|
2618
|
+
});
|
|
2619
|
+
}
|
|
2518
2620
|
async request(method, endpoint, params) {
|
|
2519
2621
|
return await this.client.request({
|
|
2520
2622
|
method: method,
|
|
@@ -3694,6 +3796,59 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3694
3796
|
}
|
|
3695
3797
|
}
|
|
3696
3798
|
|
|
3799
|
+
class Satellites extends IntegrationsBaseClient {
|
|
3800
|
+
async list() {
|
|
3801
|
+
const { data } = await this.client.get('/satellites/templates');
|
|
3802
|
+
return data;
|
|
3803
|
+
}
|
|
3804
|
+
async create(payload) {
|
|
3805
|
+
const { data } = await this.client.post('/satellites/templates', payload.template);
|
|
3806
|
+
if (payload.schema) {
|
|
3807
|
+
await this.createVersion(data.id, payload.schema);
|
|
3808
|
+
}
|
|
3809
|
+
return data;
|
|
3810
|
+
}
|
|
3811
|
+
async get(id) {
|
|
3812
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}`);
|
|
3813
|
+
return data;
|
|
3814
|
+
}
|
|
3815
|
+
async delete(id) {
|
|
3816
|
+
const { data } = await this.client.delete(`/satellites/templates/${encodeURIComponent(id)}`);
|
|
3817
|
+
return data;
|
|
3818
|
+
}
|
|
3819
|
+
async createVersion(id, payload) {
|
|
3820
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/versions`, payload);
|
|
3821
|
+
return data;
|
|
3822
|
+
}
|
|
3823
|
+
async versions(id) {
|
|
3824
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/versions`);
|
|
3825
|
+
return data;
|
|
3826
|
+
}
|
|
3827
|
+
async deploy(id, payload) {
|
|
3828
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/deploy`, payload);
|
|
3829
|
+
return data;
|
|
3830
|
+
}
|
|
3831
|
+
async rollback(id, payload) {
|
|
3832
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/rollback`, payload);
|
|
3833
|
+
return data;
|
|
3834
|
+
}
|
|
3835
|
+
async permissions(id) {
|
|
3836
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/permissions`);
|
|
3837
|
+
return data;
|
|
3838
|
+
}
|
|
3839
|
+
async logs(id, params = {}) {
|
|
3840
|
+
const since = params.since instanceof Date ? params.since.toISOString() : params.since;
|
|
3841
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/logs`, {
|
|
3842
|
+
params: since ? { since } : undefined,
|
|
3843
|
+
});
|
|
3844
|
+
return data;
|
|
3845
|
+
}
|
|
3846
|
+
async execute(id, command, payload = {}) {
|
|
3847
|
+
const { data } = await this.client.post(`/satellites/${encodeURIComponent(id)}/commands/${encodeURIComponent(command)}/execute`, payload);
|
|
3848
|
+
return data;
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
|
|
3697
3852
|
// PRN — Protokol Resource Name
|
|
3698
3853
|
//
|
|
3699
3854
|
// Format:
|
|
@@ -3867,6 +4022,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3867
4022
|
exports.Project = Project;
|
|
3868
4023
|
exports.Ratchet = Ratchet;
|
|
3869
4024
|
exports.Sandbox = Sandbox;
|
|
4025
|
+
exports.Satellites = Satellites;
|
|
3870
4026
|
exports.SerbiaMinFin = MinFin;
|
|
3871
4027
|
exports.System = System;
|
|
3872
4028
|
exports.Thunder = Thunder;
|
package/dist/index.0.9.js
CHANGED
|
@@ -984,6 +984,19 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
984
984
|
async list() {
|
|
985
985
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
986
986
|
}
|
|
987
|
+
async getVariables(ref) {
|
|
988
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
989
|
+
}
|
|
990
|
+
async updateVariables(ref, variables) {
|
|
991
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
992
|
+
}
|
|
993
|
+
async addVariable(ref, key, value) {
|
|
994
|
+
var _a;
|
|
995
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
996
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
997
|
+
current[key] = value;
|
|
998
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
999
|
+
}
|
|
987
1000
|
}
|
|
988
1001
|
|
|
989
1002
|
class Project extends PlatformBaseClient {
|
|
@@ -2970,6 +2983,45 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
2970
2983
|
}
|
|
2971
2984
|
}
|
|
2972
2985
|
|
|
2986
|
+
class Timber extends IntegrationsBaseClient {
|
|
2987
|
+
async query(params = {}) {
|
|
2988
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
2989
|
+
params: this.normalizeParams(params),
|
|
2990
|
+
});
|
|
2991
|
+
return data;
|
|
2992
|
+
}
|
|
2993
|
+
async write(payload) {
|
|
2994
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
2995
|
+
return data;
|
|
2996
|
+
}
|
|
2997
|
+
async usage() {
|
|
2998
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
2999
|
+
return data;
|
|
3000
|
+
}
|
|
3001
|
+
async debug(message, payload) {
|
|
3002
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
3003
|
+
}
|
|
3004
|
+
async info(message, payload) {
|
|
3005
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
3006
|
+
}
|
|
3007
|
+
async warn(message, payload) {
|
|
3008
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
3009
|
+
}
|
|
3010
|
+
async error(message, payload) {
|
|
3011
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
3012
|
+
}
|
|
3013
|
+
normalizeParams(params) {
|
|
3014
|
+
const normalized = { ...params };
|
|
3015
|
+
if (params.from instanceof Date) {
|
|
3016
|
+
normalized.from = params.from.toISOString();
|
|
3017
|
+
}
|
|
3018
|
+
if (params.to instanceof Date) {
|
|
3019
|
+
normalized.to = params.to.toISOString();
|
|
3020
|
+
}
|
|
3021
|
+
return normalized;
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
|
|
2973
3025
|
// import integrations
|
|
2974
3026
|
class Integrations extends IntegrationsBaseClient {
|
|
2975
3027
|
constructor(options) {
|
|
@@ -2983,6 +3035,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
2983
3035
|
'protokol-payments': new Payments().setClient(this.client),
|
|
2984
3036
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
2985
3037
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
3038
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
2986
3039
|
};
|
|
2987
3040
|
}
|
|
2988
3041
|
getSerbiaUtilities() {
|
|
@@ -3009,6 +3062,9 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
3009
3062
|
getEcommerce() {
|
|
3010
3063
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
3011
3064
|
}
|
|
3065
|
+
getTimber() {
|
|
3066
|
+
return this.getInterfaceOf('protokol-timber');
|
|
3067
|
+
}
|
|
3012
3068
|
async list() {
|
|
3013
3069
|
const { data } = await this.client.get("/v1/integrations");
|
|
3014
3070
|
return data;
|
|
@@ -3184,6 +3240,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
3184
3240
|
exports.SerbiaUtil = SerbiaUtil;
|
|
3185
3241
|
exports.System = System;
|
|
3186
3242
|
exports.Thunder = Thunder;
|
|
3243
|
+
exports.Timber = Timber;
|
|
3187
3244
|
exports.Users = Users;
|
|
3188
3245
|
exports.VPFR = VPFR;
|
|
3189
3246
|
exports.Workflow = Workflow;
|
package/dist/package.json
CHANGED
|
@@ -152,6 +152,7 @@ export default class Component<C extends string = string> extends PlatformBaseCl
|
|
|
152
152
|
concurrentUpdate(uuid: string, version: number, data: Record<string, any>, options?: UpdateOptions): Promise<AxiosResponse<any, any>>;
|
|
153
153
|
create(model: C extends keyof ComponentModels ? Partial<ComponentModels[C]> & Record<string, any> : Record<string, any>): Promise<ComponentModel<C>>;
|
|
154
154
|
delete(uuid: string): Promise<AxiosResponse<any, any>>;
|
|
155
|
+
deleteMany(uuids: string[]): Promise<AxiosResponse<any, any>>;
|
|
155
156
|
/**
|
|
156
157
|
* Execute aggregate pipeline with optional streaming support
|
|
157
158
|
*
|
|
@@ -4,4 +4,13 @@ export default class Forge extends PlatformBaseClient {
|
|
|
4
4
|
getWorkspaceApps(): Promise<any>;
|
|
5
5
|
removeVersion(ref: string, version: string): Promise<any>;
|
|
6
6
|
list(): Promise<any>;
|
|
7
|
+
listServices(ref: string): Promise<any>;
|
|
8
|
+
getVariables(ref: string): Promise<any>;
|
|
9
|
+
updateVariables(ref: string, variables: Record<string, any>): Promise<any>;
|
|
10
|
+
addVariable(ref: string, key: string, value: any): Promise<any>;
|
|
11
|
+
callService(appUuid: string, serviceName: string, options?: {
|
|
12
|
+
body?: any;
|
|
13
|
+
query?: Record<string, string>;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}): Promise<any>;
|
|
7
16
|
}
|
|
@@ -3,6 +3,7 @@ export type { Settings, SettingsField, FieldRoles, FieldConstraints, Context, Pr
|
|
|
3
3
|
export type { WorkflowModel, WorkflowSettings, WorkflowNode, WorkflowNodeConnection, WorkflowCreatePayload, WorkflowUpdatePayload, WorkflowListResponse, } from '../types/workflow';
|
|
4
4
|
export type { PagedResponse as KortexPagedResponse, PaginationParams as KortexPaginationParams, RAGConfig, LLMSettings, Agent, AgentCreatePayload, AgentUpdatePayload, ChunkingStrategy, KnowledgeBase, KnowledgeBaseCreatePayload, KnowledgeBaseUpdatePayload, Document as KortexDocument, Participant, TokenUsage, ToolCall, RAGSource, Message as KortexMessage, Conversation, ConversationCreatePayload, ConversationUpdatePayload, ParticipantAddPayload, ToolResultPayload, PageContext, SendMessagePayload, InjectMessagePayload, OCRPayload, OCRResult, UserAccess, UserAccessCreatePayload, UserAccessUpdatePayload, TopUpPayload, UserMonthlyUsage, UserUsageBreakdown, MyAccess, AggregatedUsage, Tier, KortexWorkflowMessage, KortexWorkflowPayload, KortexWorkflowResult, } from '../types/kortex';
|
|
5
5
|
export type { TimberActor, TimberActorType, TimberChanges, TimberEntry, TimberLevel, TimberQueryParams, TimberQueryResponse, TimberSource, TimberUsage, TimberWritePayload, TimberLogPayload, } from '../types/timber';
|
|
6
|
+
export type { SatelliteAuthConfig, SatelliteAuthType, SatelliteCommandExecutePayload, SatelliteCommandExecuteResponse, SatelliteCreatePayload, SatelliteDeployPayload, SatelliteEnv, SatelliteJsonRpcCommand, SatelliteLocaleText, SatelliteLogsParams, SatellitePermission, SatellitePermissionExport, SatelliteSchemaPayload, SatelliteSchemaVersion, SatelliteTemplate, SatelliteTemplatePayload, SatelliteWorkflowNode, SatelliteWorkflowNodeField, } from '../types/satellites';
|
|
6
7
|
export { default as Component } from './component';
|
|
7
8
|
export { default as Platform } from './platform';
|
|
8
9
|
export { default as Functions } from './functions';
|
|
@@ -21,11 +22,13 @@ export { default as Project } from './project';
|
|
|
21
22
|
export { default as Config } from './config';
|
|
22
23
|
export { default as Integrations } from './integrations';
|
|
23
24
|
export { default as Integration } from './integrations';
|
|
25
|
+
export { default as Satellites } from './satellites';
|
|
24
26
|
export { PRN, parsePRN } from '../util/prn';
|
|
25
27
|
export type { ParsedPRN } from '../util/prn';
|
|
26
28
|
export { default as Payments } from './integrations/payments';
|
|
27
29
|
export { default as Invoicing } from './integrations/invoicing';
|
|
28
30
|
export { default as DMS } from './integrations/dms';
|
|
31
|
+
export type { ExtractTextPayload, ExtractTextResult, OCRBoundaryRect, OCRExtractPayload, OCRExtractResult, } from '../types/integrations';
|
|
29
32
|
export { default as SerbiaMinFin } from './integrations/serbia/minfin';
|
|
30
33
|
export { default as NBS } from './integrations/serbia/nbs';
|
|
31
34
|
export { default as VPFR } from './integrations/serbia/minfin/vpfr';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
2
|
import { AxiosResponse } from "axios";
|
|
3
|
-
import { PDFFillOptions, DataConversionParams, DataValidationParams, DataInfoParams, DataInfo, DataValidationResult, ConversionOptions, HTML2PDFOptions, PDF2HTMLOptions, MediaUploadPayload, MediaUploadBase64Payload, DocumentListParams, DocumentListResponse, DocumentCreatePayload, DocumentUpdatePayload, DocumentRestorePayload, DocumentCommentPayload, DocumentResponse, DocumentGeneratePayload, DocumentGenerateResponse, DocumentRevisionListResponse } from "../../types/integrations";
|
|
3
|
+
import { PDFFillOptions, DataConversionParams, DataValidationParams, DataInfoParams, DataInfo, DataValidationResult, ConversionOptions, HTML2PDFOptions, PDF2HTMLOptions, MediaUploadPayload, MediaUploadBase64Payload, DocumentListParams, DocumentListResponse, DocumentCreatePayload, DocumentUpdatePayload, DocumentRestorePayload, DocumentCommentPayload, DocumentResponse, DocumentGeneratePayload, DocumentGenerateResponse, DocumentRevisionListResponse, ExtractTextPayload, ExtractTextResult, OCRExtractPayload, OCRExtractResult } from "../../types/integrations";
|
|
4
4
|
/**
|
|
5
5
|
* Document Management System (DMS) API client
|
|
6
6
|
*
|
|
@@ -457,6 +457,59 @@ export default class DMS extends IntegrationsBaseClient {
|
|
|
457
457
|
* ```
|
|
458
458
|
*/
|
|
459
459
|
excelToCsv(excelData: Blob | ArrayBuffer, options?: ConversionOptions): Promise<AxiosResponse<string>>;
|
|
460
|
+
/**
|
|
461
|
+
* Extract text from any document format
|
|
462
|
+
*
|
|
463
|
+
* Supports PDF, DOCX, XLSX, PPTX, ODT, RTF, EPUB, CSV, images, and 40+ other formats.
|
|
464
|
+
* Provide either a DMS file path or base64-encoded file data.
|
|
465
|
+
*
|
|
466
|
+
* @param payload - File path or base64 data to extract text from
|
|
467
|
+
* @returns Extracted text content and character count
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```typescript
|
|
471
|
+
* // From a DMS file path
|
|
472
|
+
* const result = await dms.extractText({ input_path: 'uploads/contract.pdf' });
|
|
473
|
+
* console.log(result.data.text);
|
|
474
|
+
* console.log(result.data.char_count);
|
|
475
|
+
*
|
|
476
|
+
* // From base64 data
|
|
477
|
+
* const result = await dms.extractText({
|
|
478
|
+
* file_data: 'data:application/pdf;base64,...',
|
|
479
|
+
* file_name: 'invoice.pdf'
|
|
480
|
+
* });
|
|
481
|
+
* ```
|
|
482
|
+
*/
|
|
483
|
+
extractText(payload: ExtractTextPayload): Promise<AxiosResponse<ExtractTextResult>>;
|
|
484
|
+
/**
|
|
485
|
+
* Run OCR extraction on an image using a saved model
|
|
486
|
+
*
|
|
487
|
+
* Crops each labeled region from the image and runs OCR to extract text.
|
|
488
|
+
* Returns structured key-value results.
|
|
489
|
+
*
|
|
490
|
+
* @param payload - Model UUID, image (base64 or DMS key), and optional document boundary
|
|
491
|
+
* @returns Extraction results as label-text pairs
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
* ```typescript
|
|
495
|
+
* // From a DMS file
|
|
496
|
+
* const result = await dms.ocrExtract({
|
|
497
|
+
* model_uuid: 'model-uuid',
|
|
498
|
+
* image_key: 'uploads/scan.jpg',
|
|
499
|
+
* document_boundary: { x: 0.05, y: 0.08, width: 0.9, height: 0.85 }
|
|
500
|
+
* });
|
|
501
|
+
*
|
|
502
|
+
* console.log(result.data.results);
|
|
503
|
+
* // { name: "John Smith", date_of_birth: "01.01.1990", id_number: "123456789" }
|
|
504
|
+
*
|
|
505
|
+
* // From base64
|
|
506
|
+
* const result = await dms.ocrExtract({
|
|
507
|
+
* model_uuid: 'model-uuid',
|
|
508
|
+
* image: 'data:image/jpeg;base64,...'
|
|
509
|
+
* });
|
|
510
|
+
* ```
|
|
511
|
+
*/
|
|
512
|
+
ocrExtract(payload: OCRExtractPayload): Promise<AxiosResponse<OCRExtractResult>>;
|
|
460
513
|
request(method: string, endpoint: string, params?: any): Promise<AxiosResponse<any, any>>;
|
|
461
514
|
requestv2(method: string, endpoint: string, params?: any): Promise<AxiosResponse<any, any>>;
|
|
462
515
|
requestv1(method: string, endpoint: string, params?: any): Promise<AxiosResponse<any, any>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import IntegrationsBaseClient from './integrationsBaseClient';
|
|
2
|
+
import type { SatelliteCommandExecutePayload, SatelliteCommandExecuteResponse, SatelliteCreatePayload, SatelliteDeployPayload, SatelliteLogsParams, SatellitePermissionExport, SatelliteSchemaPayload, SatelliteSchemaVersion, SatelliteTemplate } from '../types/satellites';
|
|
3
|
+
export default class Satellites extends IntegrationsBaseClient {
|
|
4
|
+
list(): Promise<SatelliteTemplate[]>;
|
|
5
|
+
create(payload: SatelliteCreatePayload): Promise<SatelliteTemplate>;
|
|
6
|
+
get(id: string): Promise<SatelliteTemplate>;
|
|
7
|
+
delete(id: string): Promise<{
|
|
8
|
+
deleted: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
createVersion(id: string, payload: SatelliteSchemaPayload): Promise<SatelliteSchemaVersion>;
|
|
11
|
+
versions(id: string): Promise<SatelliteSchemaVersion[]>;
|
|
12
|
+
deploy(id: string, payload: SatelliteDeployPayload): Promise<SatelliteTemplate>;
|
|
13
|
+
rollback(id: string, payload: SatelliteDeployPayload): Promise<SatelliteTemplate>;
|
|
14
|
+
permissions(id: string): Promise<SatellitePermissionExport[]>;
|
|
15
|
+
logs(id: string, params?: SatelliteLogsParams): Promise<any>;
|
|
16
|
+
execute<T = any>(id: string, command: string, payload?: SatelliteCommandExecutePayload): Promise<SatelliteCommandExecuteResponse<T>>;
|
|
17
|
+
}
|
package/dist/v0.10/index.cjs.js
CHANGED
|
@@ -19311,6 +19311,11 @@ class Component extends PlatformBaseClient {
|
|
|
19311
19311
|
async delete(uuid) {
|
|
19312
19312
|
return await this.client.delete(`/v4/system/component/${this.ref}/model/${uuid}`);
|
|
19313
19313
|
}
|
|
19314
|
+
async deleteMany(uuids) {
|
|
19315
|
+
return await this.client.delete(`/v4/system/component/${this.ref}/models/bulk`, {
|
|
19316
|
+
data: uuids,
|
|
19317
|
+
});
|
|
19318
|
+
}
|
|
19314
19319
|
/**
|
|
19315
19320
|
* Execute aggregate pipeline with optional streaming support
|
|
19316
19321
|
*
|
|
@@ -20255,6 +20260,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
20255
20260
|
}
|
|
20256
20261
|
|
|
20257
20262
|
class Forge extends PlatformBaseClient {
|
|
20263
|
+
// --- Management (appservice) ---
|
|
20258
20264
|
async bundleUpload(buffer) {
|
|
20259
20265
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
20260
20266
|
headers: {
|
|
@@ -20272,6 +20278,36 @@ class Forge extends PlatformBaseClient {
|
|
|
20272
20278
|
async list() {
|
|
20273
20279
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
20274
20280
|
}
|
|
20281
|
+
async listServices(ref) {
|
|
20282
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
20283
|
+
}
|
|
20284
|
+
// --- Variables ---
|
|
20285
|
+
async getVariables(ref) {
|
|
20286
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20287
|
+
}
|
|
20288
|
+
async updateVariables(ref, variables) {
|
|
20289
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
20290
|
+
}
|
|
20291
|
+
async addVariable(ref, key, value) {
|
|
20292
|
+
var _a;
|
|
20293
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20294
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
20295
|
+
current[key] = value;
|
|
20296
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
20297
|
+
}
|
|
20298
|
+
// --- Service execution (forge-runtime) ---
|
|
20299
|
+
async callService(appUuid, serviceName, options) {
|
|
20300
|
+
var _a, _b, _c;
|
|
20301
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
20302
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
20303
|
+
: '';
|
|
20304
|
+
// @ts-ignore
|
|
20305
|
+
const devServiceUrl = isBrowser && ((_a = window.__ENV_VARIABLES__) === null || _a === void 0 ? void 0 : _a.FORGE_DEV_SERVICE_URL);
|
|
20306
|
+
if (devServiceUrl) {
|
|
20307
|
+
return axios.post(`${devServiceUrl}/${serviceName}${queryString}`, (_b = options === null || options === void 0 ? void 0 : options.body) !== null && _b !== void 0 ? _b : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
20308
|
+
}
|
|
20309
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_c = options === null || options === void 0 ? void 0 : options.body) !== null && _c !== void 0 ? _c : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
20310
|
+
}
|
|
20275
20311
|
}
|
|
20276
20312
|
|
|
20277
20313
|
const BASE = '/luma/kortex/v1';
|
|
@@ -21481,6 +21517,72 @@ class DMS extends IntegrationsBaseClient {
|
|
|
21481
21517
|
}
|
|
21482
21518
|
});
|
|
21483
21519
|
}
|
|
21520
|
+
// ===================================================================
|
|
21521
|
+
// Text Extraction
|
|
21522
|
+
// ===================================================================
|
|
21523
|
+
/**
|
|
21524
|
+
* Extract text from any document format
|
|
21525
|
+
*
|
|
21526
|
+
* Supports PDF, DOCX, XLSX, PPTX, ODT, RTF, EPUB, CSV, images, and 40+ other formats.
|
|
21527
|
+
* Provide either a DMS file path or base64-encoded file data.
|
|
21528
|
+
*
|
|
21529
|
+
* @param payload - File path or base64 data to extract text from
|
|
21530
|
+
* @returns Extracted text content and character count
|
|
21531
|
+
*
|
|
21532
|
+
* @example
|
|
21533
|
+
* ```typescript
|
|
21534
|
+
* // From a DMS file path
|
|
21535
|
+
* const result = await dms.extractText({ input_path: 'uploads/contract.pdf' });
|
|
21536
|
+
* console.log(result.data.text);
|
|
21537
|
+
* console.log(result.data.char_count);
|
|
21538
|
+
*
|
|
21539
|
+
* // From base64 data
|
|
21540
|
+
* const result = await dms.extractText({
|
|
21541
|
+
* file_data: 'data:application/pdf;base64,...',
|
|
21542
|
+
* file_name: 'invoice.pdf'
|
|
21543
|
+
* });
|
|
21544
|
+
* ```
|
|
21545
|
+
*/
|
|
21546
|
+
async extractText(payload) {
|
|
21547
|
+
return this.request('POST', 'media/extract-text', { data: payload });
|
|
21548
|
+
}
|
|
21549
|
+
// ===================================================================
|
|
21550
|
+
// OCR Extraction
|
|
21551
|
+
// ===================================================================
|
|
21552
|
+
/**
|
|
21553
|
+
* Run OCR extraction on an image using a saved model
|
|
21554
|
+
*
|
|
21555
|
+
* Crops each labeled region from the image and runs OCR to extract text.
|
|
21556
|
+
* Returns structured key-value results.
|
|
21557
|
+
*
|
|
21558
|
+
* @param payload - Model UUID, image (base64 or DMS key), and optional document boundary
|
|
21559
|
+
* @returns Extraction results as label-text pairs
|
|
21560
|
+
*
|
|
21561
|
+
* @example
|
|
21562
|
+
* ```typescript
|
|
21563
|
+
* // From a DMS file
|
|
21564
|
+
* const result = await dms.ocrExtract({
|
|
21565
|
+
* model_uuid: 'model-uuid',
|
|
21566
|
+
* image_key: 'uploads/scan.jpg',
|
|
21567
|
+
* document_boundary: { x: 0.05, y: 0.08, width: 0.9, height: 0.85 }
|
|
21568
|
+
* });
|
|
21569
|
+
*
|
|
21570
|
+
* console.log(result.data.results);
|
|
21571
|
+
* // { name: "John Smith", date_of_birth: "01.01.1990", id_number: "123456789" }
|
|
21572
|
+
*
|
|
21573
|
+
* // From base64
|
|
21574
|
+
* const result = await dms.ocrExtract({
|
|
21575
|
+
* model_uuid: 'model-uuid',
|
|
21576
|
+
* image: 'data:image/jpeg;base64,...'
|
|
21577
|
+
* });
|
|
21578
|
+
* ```
|
|
21579
|
+
*/
|
|
21580
|
+
async ocrExtract(payload) {
|
|
21581
|
+
return this.request('POST', 'media/ocr/extract', {
|
|
21582
|
+
data: payload,
|
|
21583
|
+
timeout: 120000
|
|
21584
|
+
});
|
|
21585
|
+
}
|
|
21484
21586
|
async request(method, endpoint, params) {
|
|
21485
21587
|
return await this.client.request({
|
|
21486
21588
|
method: method,
|
|
@@ -22660,6 +22762,59 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
22660
22762
|
}
|
|
22661
22763
|
}
|
|
22662
22764
|
|
|
22765
|
+
class Satellites extends IntegrationsBaseClient {
|
|
22766
|
+
async list() {
|
|
22767
|
+
const { data } = await this.client.get('/satellites/templates');
|
|
22768
|
+
return data;
|
|
22769
|
+
}
|
|
22770
|
+
async create(payload) {
|
|
22771
|
+
const { data } = await this.client.post('/satellites/templates', payload.template);
|
|
22772
|
+
if (payload.schema) {
|
|
22773
|
+
await this.createVersion(data.id, payload.schema);
|
|
22774
|
+
}
|
|
22775
|
+
return data;
|
|
22776
|
+
}
|
|
22777
|
+
async get(id) {
|
|
22778
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}`);
|
|
22779
|
+
return data;
|
|
22780
|
+
}
|
|
22781
|
+
async delete(id) {
|
|
22782
|
+
const { data } = await this.client.delete(`/satellites/templates/${encodeURIComponent(id)}`);
|
|
22783
|
+
return data;
|
|
22784
|
+
}
|
|
22785
|
+
async createVersion(id, payload) {
|
|
22786
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/versions`, payload);
|
|
22787
|
+
return data;
|
|
22788
|
+
}
|
|
22789
|
+
async versions(id) {
|
|
22790
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/versions`);
|
|
22791
|
+
return data;
|
|
22792
|
+
}
|
|
22793
|
+
async deploy(id, payload) {
|
|
22794
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/deploy`, payload);
|
|
22795
|
+
return data;
|
|
22796
|
+
}
|
|
22797
|
+
async rollback(id, payload) {
|
|
22798
|
+
const { data } = await this.client.post(`/satellites/templates/${encodeURIComponent(id)}/rollback`, payload);
|
|
22799
|
+
return data;
|
|
22800
|
+
}
|
|
22801
|
+
async permissions(id) {
|
|
22802
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/permissions`);
|
|
22803
|
+
return data;
|
|
22804
|
+
}
|
|
22805
|
+
async logs(id, params = {}) {
|
|
22806
|
+
const since = params.since instanceof Date ? params.since.toISOString() : params.since;
|
|
22807
|
+
const { data } = await this.client.get(`/satellites/templates/${encodeURIComponent(id)}/logs`, {
|
|
22808
|
+
params: since ? { since } : undefined,
|
|
22809
|
+
});
|
|
22810
|
+
return data;
|
|
22811
|
+
}
|
|
22812
|
+
async execute(id, command, payload = {}) {
|
|
22813
|
+
const { data } = await this.client.post(`/satellites/${encodeURIComponent(id)}/commands/${encodeURIComponent(command)}/execute`, payload);
|
|
22814
|
+
return data;
|
|
22815
|
+
}
|
|
22816
|
+
}
|
|
22817
|
+
|
|
22663
22818
|
// PRN — Protokol Resource Name
|
|
22664
22819
|
//
|
|
22665
22820
|
// Format:
|
|
@@ -22833,6 +22988,7 @@ exports.Platform = Platform;
|
|
|
22833
22988
|
exports.Project = Project;
|
|
22834
22989
|
exports.Ratchet = Ratchet;
|
|
22835
22990
|
exports.Sandbox = Sandbox;
|
|
22991
|
+
exports.Satellites = Satellites;
|
|
22836
22992
|
exports.SerbiaMinFin = MinFin;
|
|
22837
22993
|
exports.System = System;
|
|
22838
22994
|
exports.Thunder = Thunder;
|