@ptkl/sdk 1.10.0 → 1.12.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 +300 -66
- package/dist/index.0.9.js +57 -0
- package/dist/package.json +1 -1
- package/dist/v0.10/api/component.d.ts +7 -2
- package/dist/v0.10/api/forge.d.ts +9 -0
- package/dist/v0.10/api/index.d.ts +4 -0
- package/dist/v0.10/api/integrations/dms.d.ts +3 -1
- package/dist/v0.10/api/integrations/timber.d.ts +22 -0
- package/dist/v0.10/api/integrations.d.ts +2 -0
- package/dist/v0.10/api/kortex.d.ts +52 -0
- package/dist/v0.10/api/platform.d.ts +2 -0
- package/dist/v0.10/index.cjs.js +300 -66
- package/dist/v0.10/index.esm.js +299 -67
- package/dist/v0.10/types/component.d.ts +25 -1
- package/dist/v0.10/types/integrations.d.ts +6 -0
- package/dist/v0.10/types/kortex.d.ts +294 -0
- package/dist/v0.10/types/timber.d.ts +77 -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
|
@@ -113,73 +113,60 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
113
113
|
super();
|
|
114
114
|
this.ref = ref;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
dateTo: ctx.dateTo,
|
|
168
|
-
dateField: ctx.dateField,
|
|
169
|
-
};
|
|
170
|
-
if (ctx.only && ctx.only.length > 0) {
|
|
171
|
-
params.only = ctx.only;
|
|
172
|
-
}
|
|
173
|
-
if (Object.keys(ctx.$adv || []).length > 0) {
|
|
174
|
-
params.$adv = [(_a = ctx.$adv) !== null && _a !== void 0 ? _a : {}];
|
|
175
|
-
}
|
|
176
|
-
if (ctx.$aggregate && ctx.$aggregate.length > 0) {
|
|
177
|
-
params.$aggregate = ctx.$aggregate;
|
|
116
|
+
find(filters, opts) {
|
|
117
|
+
if (opts && opts.stream === true) {
|
|
118
|
+
let onMetaCallback = () => { };
|
|
119
|
+
let onDataCallback = () => { };
|
|
120
|
+
let onErrorCallback;
|
|
121
|
+
let onEndCallback;
|
|
122
|
+
let isFirstLine = true;
|
|
123
|
+
const chainable = {
|
|
124
|
+
onMeta: (callback) => {
|
|
125
|
+
onMetaCallback = callback;
|
|
126
|
+
return chainable;
|
|
127
|
+
},
|
|
128
|
+
onData: (callback) => {
|
|
129
|
+
onDataCallback = callback;
|
|
130
|
+
return chainable;
|
|
131
|
+
},
|
|
132
|
+
onError: (callback) => {
|
|
133
|
+
onErrorCallback = callback;
|
|
134
|
+
return chainable;
|
|
135
|
+
},
|
|
136
|
+
onEnd: (callback) => {
|
|
137
|
+
onEndCallback = callback;
|
|
138
|
+
return chainable;
|
|
139
|
+
},
|
|
140
|
+
stream: () => {
|
|
141
|
+
const body = this._buildFindBody(filters, opts);
|
|
142
|
+
const handler = {
|
|
143
|
+
onData: async (doc) => {
|
|
144
|
+
if (isFirstLine) {
|
|
145
|
+
isFirstLine = false;
|
|
146
|
+
const result = onMetaCallback(doc);
|
|
147
|
+
if (result instanceof Promise)
|
|
148
|
+
await result;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
const result = onDataCallback(doc);
|
|
152
|
+
if (result instanceof Promise)
|
|
153
|
+
await result;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
onError: onErrorCallback,
|
|
157
|
+
onEnd: onEndCallback,
|
|
158
|
+
};
|
|
159
|
+
return this._streamNDJSON(`/v4/system/component/${this.ref}/models/stream`, {
|
|
160
|
+
'Accept': 'application/x-ndjson',
|
|
161
|
+
'Content-Type': 'application/json',
|
|
162
|
+
'Accept-Language': (opts === null || opts === void 0 ? void 0 : opts.locale) || 'en_US',
|
|
163
|
+
}, handler, body);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return chainable;
|
|
178
167
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
options: opts
|
|
182
|
-
}, {
|
|
168
|
+
const body = this._buildFindBody(filters, opts);
|
|
169
|
+
return this.client.post(`/v4/system/component/${this.ref}/models`, body, {
|
|
183
170
|
headers: {
|
|
184
171
|
"Accept-Language": (opts === null || opts === void 0 ? void 0 : opts.locale) || "en_US",
|
|
185
172
|
}
|
|
@@ -208,6 +195,34 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
208
195
|
}
|
|
209
196
|
return null;
|
|
210
197
|
}
|
|
198
|
+
/** @private Build the POST body shared by `find` (streaming and non-streaming) */
|
|
199
|
+
_buildFindBody(filters, opts) {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
let ctx = { ...filters };
|
|
202
|
+
let offset = (_a = ctx.currentPage) !== null && _a !== void 0 ? _a : 0;
|
|
203
|
+
let limit = (ctx.perPage == null || ctx.perPage === -1) ? 10 : ctx.perPage;
|
|
204
|
+
let sortDesc = ctx.sortDesc ? -1 : 1;
|
|
205
|
+
if (ctx.filterOn === undefined)
|
|
206
|
+
ctx.filterOn = [];
|
|
207
|
+
const params = {
|
|
208
|
+
offset,
|
|
209
|
+
sortBy: ctx.sortBy,
|
|
210
|
+
sortDesc,
|
|
211
|
+
filter: ctx.filter,
|
|
212
|
+
filterOn: ctx.filterOn,
|
|
213
|
+
limit,
|
|
214
|
+
dateFrom: ctx.dateFrom,
|
|
215
|
+
dateTo: ctx.dateTo,
|
|
216
|
+
dateField: ctx.dateField,
|
|
217
|
+
};
|
|
218
|
+
if (ctx.only && ctx.only.length > 0)
|
|
219
|
+
params.only = ctx.only;
|
|
220
|
+
if (Object.keys(ctx.$adv || {}).length > 0)
|
|
221
|
+
params.$adv = [(_b = ctx.$adv) !== null && _b !== void 0 ? _b : {}];
|
|
222
|
+
if (ctx.$aggregate && ctx.$aggregate.length > 0)
|
|
223
|
+
params.$aggregate = ctx.$aggregate;
|
|
224
|
+
return { ...params, options: opts };
|
|
225
|
+
}
|
|
211
226
|
/**
|
|
212
227
|
* Get model by uuid
|
|
213
228
|
*
|
|
@@ -1274,6 +1289,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1274
1289
|
}
|
|
1275
1290
|
|
|
1276
1291
|
class Forge extends PlatformBaseClient {
|
|
1292
|
+
// --- Management (appservice) ---
|
|
1277
1293
|
async bundleUpload(buffer) {
|
|
1278
1294
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
1279
1295
|
headers: {
|
|
@@ -1291,6 +1307,170 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1291
1307
|
async list() {
|
|
1292
1308
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
1293
1309
|
}
|
|
1310
|
+
async listServices(ref) {
|
|
1311
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
1312
|
+
}
|
|
1313
|
+
// --- Variables ---
|
|
1314
|
+
async getVariables(ref) {
|
|
1315
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1316
|
+
}
|
|
1317
|
+
async updateVariables(ref, variables) {
|
|
1318
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
1319
|
+
}
|
|
1320
|
+
async addVariable(ref, key, value) {
|
|
1321
|
+
var _a;
|
|
1322
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
1323
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
1324
|
+
current[key] = value;
|
|
1325
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
1326
|
+
}
|
|
1327
|
+
// --- Service execution (forge-runtime) ---
|
|
1328
|
+
async callService(appUuid, serviceName, options) {
|
|
1329
|
+
var _a;
|
|
1330
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
1331
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
1332
|
+
: '';
|
|
1333
|
+
return await this.client.post(`/luma/forge-runtime/api/services/${appUuid}/${serviceName}${queryString}`, (_a = options === null || options === void 0 ? void 0 : options.body) !== null && _a !== void 0 ? _a : {}, (options === null || options === void 0 ? void 0 : options.headers) ? { headers: options.headers } : undefined);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
const BASE = '/luma/kortex/v1';
|
|
1338
|
+
class Kortex extends PlatformBaseClient {
|
|
1339
|
+
// ── Agents ──
|
|
1340
|
+
async createAgent(data) {
|
|
1341
|
+
return await this.client.post(`${BASE}/agents`, data);
|
|
1342
|
+
}
|
|
1343
|
+
async listAgents(params) {
|
|
1344
|
+
return await this.client.get(`${BASE}/agents`, { params });
|
|
1345
|
+
}
|
|
1346
|
+
async getAgent(uuid) {
|
|
1347
|
+
return await this.client.get(`${BASE}/agents/${uuid}`);
|
|
1348
|
+
}
|
|
1349
|
+
async updateAgent(uuid, data) {
|
|
1350
|
+
return await this.client.patch(`${BASE}/agents/${uuid}`, data);
|
|
1351
|
+
}
|
|
1352
|
+
async deleteAgent(uuid) {
|
|
1353
|
+
return await this.client.delete(`${BASE}/agents/${uuid}`);
|
|
1354
|
+
}
|
|
1355
|
+
async listAgentKnowledgeBases(agentUUID) {
|
|
1356
|
+
return await this.client.get(`${BASE}/agents/${agentUUID}/knowledge-bases`);
|
|
1357
|
+
}
|
|
1358
|
+
// ── Knowledge Bases ──
|
|
1359
|
+
async createKnowledgeBase(data) {
|
|
1360
|
+
return await this.client.post(`${BASE}/knowledge-bases`, data);
|
|
1361
|
+
}
|
|
1362
|
+
async listKnowledgeBases(params) {
|
|
1363
|
+
return await this.client.get(`${BASE}/knowledge-bases`, { params });
|
|
1364
|
+
}
|
|
1365
|
+
async getKnowledgeBase(uuid) {
|
|
1366
|
+
return await this.client.get(`${BASE}/knowledge-bases/${uuid}`);
|
|
1367
|
+
}
|
|
1368
|
+
async updateKnowledgeBase(uuid, data) {
|
|
1369
|
+
return await this.client.put(`${BASE}/knowledge-bases/${uuid}`, data);
|
|
1370
|
+
}
|
|
1371
|
+
async deleteKnowledgeBase(uuid) {
|
|
1372
|
+
return await this.client.delete(`${BASE}/knowledge-bases/${uuid}`);
|
|
1373
|
+
}
|
|
1374
|
+
// ── Documents ──
|
|
1375
|
+
async listDocuments(kbUUID, params) {
|
|
1376
|
+
return await this.client.get(`${BASE}/knowledge-bases/${kbUUID}/documents`, { params });
|
|
1377
|
+
}
|
|
1378
|
+
async uploadDocument(kbUUID, formData) {
|
|
1379
|
+
return await this.client.post(`${BASE}/knowledge-bases/${kbUUID}/documents`, formData, {
|
|
1380
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
1381
|
+
timeout: 120000,
|
|
1382
|
+
});
|
|
1383
|
+
}
|
|
1384
|
+
async getDocument(kbUUID, uuid) {
|
|
1385
|
+
return await this.client.get(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}`);
|
|
1386
|
+
}
|
|
1387
|
+
async deleteDocument(kbUUID, uuid) {
|
|
1388
|
+
return await this.client.delete(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}`);
|
|
1389
|
+
}
|
|
1390
|
+
async retryDocument(kbUUID, uuid) {
|
|
1391
|
+
return await this.client.post(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}/retry`);
|
|
1392
|
+
}
|
|
1393
|
+
// ── Conversations ──
|
|
1394
|
+
async createConversation(data) {
|
|
1395
|
+
return await this.client.post(`${BASE}/conversations`, data);
|
|
1396
|
+
}
|
|
1397
|
+
async listConversations(params) {
|
|
1398
|
+
return await this.client.get(`${BASE}/conversations`, { params });
|
|
1399
|
+
}
|
|
1400
|
+
async getConversation(uuid) {
|
|
1401
|
+
return await this.client.get(`${BASE}/conversations/${uuid}`);
|
|
1402
|
+
}
|
|
1403
|
+
async updateConversation(uuid, data) {
|
|
1404
|
+
return await this.client.put(`${BASE}/conversations/${uuid}`, data);
|
|
1405
|
+
}
|
|
1406
|
+
async deleteConversation(uuid) {
|
|
1407
|
+
return await this.client.delete(`${BASE}/conversations/${uuid}`);
|
|
1408
|
+
}
|
|
1409
|
+
async archiveConversation(uuid) {
|
|
1410
|
+
return await this.client.post(`${BASE}/conversations/${uuid}/archive`);
|
|
1411
|
+
}
|
|
1412
|
+
async unarchiveConversation(uuid) {
|
|
1413
|
+
return await this.client.post(`${BASE}/conversations/${uuid}/unarchive`);
|
|
1414
|
+
}
|
|
1415
|
+
async addParticipant(conversationUUID, data) {
|
|
1416
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/participants`, data);
|
|
1417
|
+
}
|
|
1418
|
+
async removeParticipant(conversationUUID, agentUUID) {
|
|
1419
|
+
return await this.client.delete(`${BASE}/conversations/${conversationUUID}/participants/${agentUUID}`);
|
|
1420
|
+
}
|
|
1421
|
+
// ── Messages / Completions ──
|
|
1422
|
+
async sendMessage(conversationUUID, data) {
|
|
1423
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages`, data);
|
|
1424
|
+
}
|
|
1425
|
+
async streamMessage(conversationUUID, data) {
|
|
1426
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages`, { ...data, stream: true }, {
|
|
1427
|
+
responseType: 'stream',
|
|
1428
|
+
timeout: 120000,
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
async listMessages(conversationUUID, params) {
|
|
1432
|
+
return await this.client.get(`${BASE}/conversations/${conversationUUID}/messages`, { params });
|
|
1433
|
+
}
|
|
1434
|
+
async injectMessage(conversationUUID, data) {
|
|
1435
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages/inject`, data);
|
|
1436
|
+
}
|
|
1437
|
+
// ── OCR ──
|
|
1438
|
+
async ocr(data) {
|
|
1439
|
+
return await this.client.post(`${BASE}/ocr`, data, { timeout: 120000 });
|
|
1440
|
+
}
|
|
1441
|
+
// ── User Access ──
|
|
1442
|
+
async createUserAccess(data) {
|
|
1443
|
+
return await this.client.post(`${BASE}/user-access`, data);
|
|
1444
|
+
}
|
|
1445
|
+
async listUserAccess(params) {
|
|
1446
|
+
return await this.client.get(`${BASE}/user-access`, { params });
|
|
1447
|
+
}
|
|
1448
|
+
async getUserAccess(uuid) {
|
|
1449
|
+
return await this.client.get(`${BASE}/user-access/${uuid}`);
|
|
1450
|
+
}
|
|
1451
|
+
async updateUserAccess(uuid, data) {
|
|
1452
|
+
return await this.client.patch(`${BASE}/user-access/${uuid}`, data);
|
|
1453
|
+
}
|
|
1454
|
+
async deleteUserAccess(uuid) {
|
|
1455
|
+
return await this.client.delete(`${BASE}/user-access/${uuid}`);
|
|
1456
|
+
}
|
|
1457
|
+
async getUserMonthlyUsage(uuid, params) {
|
|
1458
|
+
return await this.client.get(`${BASE}/user-access/${uuid}/usage`, { params });
|
|
1459
|
+
}
|
|
1460
|
+
async getUserUsageBreakdown(uuid) {
|
|
1461
|
+
return await this.client.get(`${BASE}/user-access/${uuid}/usage/breakdown`);
|
|
1462
|
+
}
|
|
1463
|
+
async getMyAccess() {
|
|
1464
|
+
return await this.client.get(`${BASE}/my-access`);
|
|
1465
|
+
}
|
|
1466
|
+
// ── Usage (Admin) ──
|
|
1467
|
+
async listUsage(params) {
|
|
1468
|
+
return await this.client.get(`${BASE}/usage`, { params });
|
|
1469
|
+
}
|
|
1470
|
+
// ── Tier ──
|
|
1471
|
+
async getTier() {
|
|
1472
|
+
return await this.client.get(`${BASE}/tier`);
|
|
1473
|
+
}
|
|
1294
1474
|
}
|
|
1295
1475
|
|
|
1296
1476
|
class Project extends PlatformBaseClient {
|
|
@@ -1517,6 +1697,9 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1517
1697
|
forge() {
|
|
1518
1698
|
return (new Forge()).setClient(this.client);
|
|
1519
1699
|
}
|
|
1700
|
+
kortex() {
|
|
1701
|
+
return (new Kortex()).setClient(this.client);
|
|
1702
|
+
}
|
|
1520
1703
|
component(ref) {
|
|
1521
1704
|
return (new Component(ref)).setClient(this.client);
|
|
1522
1705
|
}
|
|
@@ -1883,6 +2066,12 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
1883
2066
|
async generateDocument(payload) {
|
|
1884
2067
|
return this.requestv2('POST', 'documents/document/generate', { data: payload });
|
|
1885
2068
|
}
|
|
2069
|
+
async listDocumentRevisions(path) {
|
|
2070
|
+
return this.requestv2('GET', `documents/revisions/${path}`);
|
|
2071
|
+
}
|
|
2072
|
+
async getDocumentRevision(path, version) {
|
|
2073
|
+
return this.requestv2('GET', `documents/revision/${path}`, { params: { version } });
|
|
2074
|
+
}
|
|
1886
2075
|
async fillPdf(data) {
|
|
1887
2076
|
const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
|
|
1888
2077
|
const responseType = output_pdf ? 'arraybuffer' : 'json';
|
|
@@ -3429,6 +3618,45 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3429
3618
|
}
|
|
3430
3619
|
}
|
|
3431
3620
|
|
|
3621
|
+
class Timber extends IntegrationsBaseClient {
|
|
3622
|
+
async query(params = {}) {
|
|
3623
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
3624
|
+
params: this.normalizeParams(params),
|
|
3625
|
+
});
|
|
3626
|
+
return data;
|
|
3627
|
+
}
|
|
3628
|
+
async write(payload) {
|
|
3629
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
3630
|
+
return data;
|
|
3631
|
+
}
|
|
3632
|
+
async usage() {
|
|
3633
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
3634
|
+
return data;
|
|
3635
|
+
}
|
|
3636
|
+
async debug(message, payload) {
|
|
3637
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
3638
|
+
}
|
|
3639
|
+
async info(message, payload) {
|
|
3640
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
3641
|
+
}
|
|
3642
|
+
async warn(message, payload) {
|
|
3643
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
3644
|
+
}
|
|
3645
|
+
async error(message, payload) {
|
|
3646
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
3647
|
+
}
|
|
3648
|
+
normalizeParams(params) {
|
|
3649
|
+
const normalized = { ...params };
|
|
3650
|
+
if (params.from instanceof Date) {
|
|
3651
|
+
normalized.from = params.from.toISOString();
|
|
3652
|
+
}
|
|
3653
|
+
if (params.to instanceof Date) {
|
|
3654
|
+
normalized.to = params.to.toISOString();
|
|
3655
|
+
}
|
|
3656
|
+
return normalized;
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3432
3660
|
class Integrations extends IntegrationsBaseClient {
|
|
3433
3661
|
constructor(options) {
|
|
3434
3662
|
super(options);
|
|
@@ -3440,6 +3668,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3440
3668
|
'protokol-payments': new Payments().setClient(this.client),
|
|
3441
3669
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
3442
3670
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
3671
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
3443
3672
|
};
|
|
3444
3673
|
}
|
|
3445
3674
|
getDMS() {
|
|
@@ -3466,6 +3695,9 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3466
3695
|
getEcommerce() {
|
|
3467
3696
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
3468
3697
|
}
|
|
3698
|
+
getTimber() {
|
|
3699
|
+
return this.getInterfaceOf('protokol-timber');
|
|
3700
|
+
}
|
|
3469
3701
|
async list() {
|
|
3470
3702
|
const { data } = await this.client.get("/v1/integrations");
|
|
3471
3703
|
return data;
|
|
@@ -3652,6 +3884,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3652
3884
|
exports.Integration = Integrations;
|
|
3653
3885
|
exports.Integrations = Integrations;
|
|
3654
3886
|
exports.Invoicing = Invoicing;
|
|
3887
|
+
exports.Kortex = Kortex;
|
|
3655
3888
|
exports.Mail = Mail;
|
|
3656
3889
|
exports.NBS = NBS;
|
|
3657
3890
|
exports.PRN = PRN;
|
|
@@ -3663,6 +3896,7 @@ var ProtokolSDK010 = (function (exports, axios) {
|
|
|
3663
3896
|
exports.SerbiaMinFin = MinFin;
|
|
3664
3897
|
exports.System = System;
|
|
3665
3898
|
exports.Thunder = Thunder;
|
|
3899
|
+
exports.Timber = Timber;
|
|
3666
3900
|
exports.Users = Users;
|
|
3667
3901
|
exports.VPFR = VPFR;
|
|
3668
3902
|
exports.Workflow = Workflow;
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, StreamHandler, AggregateChainable, ComponentOptions, UpdateManyOptions, CreateManyOptions, Extension, Policy } from "../types/component";
|
|
1
|
+
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, StreamHandler, AggregateChainable, FindChainable, FindStreamMeta, FindStreamMetaCallback, ComponentOptions, UpdateManyOptions, CreateManyOptions, Extension, Policy } from "../types/component";
|
|
2
2
|
import PlatformBaseClient from "./platformBaseClient";
|
|
3
3
|
import { AxiosResponse } from "axios";
|
|
4
4
|
import type { ComponentModels, ComponentFunctions } from "../types/functions";
|
|
@@ -38,6 +38,9 @@ export default class Component<C extends string = string> extends PlatformBaseCl
|
|
|
38
38
|
* }
|
|
39
39
|
* )
|
|
40
40
|
**/
|
|
41
|
+
find(filters: FindParams, opts: FindOptions & {
|
|
42
|
+
stream: true;
|
|
43
|
+
}): FindChainable;
|
|
41
44
|
find(filters: FindParams, opts?: FindOptions): Promise<AxiosResponse<{
|
|
42
45
|
items: ComponentModel<C>[];
|
|
43
46
|
total: number;
|
|
@@ -58,6 +61,8 @@ export default class Component<C extends string = string> extends PlatformBaseCl
|
|
|
58
61
|
* })
|
|
59
62
|
**/
|
|
60
63
|
findOne(filter: FindAdvancedParams, opts?: FindOptions): Promise<ComponentModel<C> | null>;
|
|
64
|
+
/** @private Build the POST body shared by `find` (streaming and non-streaming) */
|
|
65
|
+
private _buildFindBody;
|
|
61
66
|
/**
|
|
62
67
|
* Get model by uuid
|
|
63
68
|
*
|
|
@@ -323,4 +328,4 @@ export default class Component<C extends string = string> extends PlatformBaseCl
|
|
|
323
328
|
*/
|
|
324
329
|
private _streamNDJSONNode;
|
|
325
330
|
}
|
|
326
|
-
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, StreamHandler, AggregateChainable, ComponentOptions, Extension, };
|
|
331
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, StreamHandler, AggregateChainable, FindChainable, FindStreamMeta, FindStreamMetaCallback, ComponentOptions, Extension, };
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { PlatformFunctions, PlatformFunction, FunctionInput, FunctionOutput, FunctionCallParams, ComponentModels, ComponentFunctions, ComponentModel, ComponentFunctionInput, ComponentFunctionOutput, } from '../types/functions';
|
|
2
2
|
export type { Settings, SettingsField, FieldRoles, FieldConstraints, Context, Preset, PresetContext, Filters, Extension, Policy, SetupData, Model, } from '../types/component';
|
|
3
3
|
export type { WorkflowModel, WorkflowSettings, WorkflowNode, WorkflowNodeConnection, WorkflowCreatePayload, WorkflowUpdatePayload, WorkflowListResponse, } from '../types/workflow';
|
|
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
|
+
export type { TimberActor, TimberActorType, TimberChanges, TimberEntry, TimberLevel, TimberQueryParams, TimberQueryResponse, TimberSource, TimberUsage, TimberWritePayload, TimberLogPayload, } from '../types/timber';
|
|
4
6
|
export { default as Component } from './component';
|
|
5
7
|
export { default as Platform } from './platform';
|
|
6
8
|
export { default as Functions } from './functions';
|
|
@@ -14,6 +16,7 @@ export { default as Sandbox } from './sandbox';
|
|
|
14
16
|
export { default as System } from './system';
|
|
15
17
|
export { default as Workflow } from './workflow';
|
|
16
18
|
export { default as Forge } from './forge';
|
|
19
|
+
export { default as Kortex } from './kortex';
|
|
17
20
|
export { default as Project } from './project';
|
|
18
21
|
export { default as Config } from './config';
|
|
19
22
|
export { default as Integrations } from './integrations';
|
|
@@ -28,3 +31,4 @@ export { default as NBS } from './integrations/serbia/nbs';
|
|
|
28
31
|
export { default as VPFR } from './integrations/serbia/minfin/vpfr';
|
|
29
32
|
export { default as Mail } from './integrations/mail';
|
|
30
33
|
export { default as Ecommerce } from './integrations/ecommerce';
|
|
34
|
+
export { default as Timber } from './integrations/timber';
|
|
@@ -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 } 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 } from "../../types/integrations";
|
|
4
4
|
/**
|
|
5
5
|
* Document Management System (DMS) API client
|
|
6
6
|
*
|
|
@@ -143,6 +143,8 @@ export default class DMS extends IntegrationsBaseClient {
|
|
|
143
143
|
restoreDocument(payload: DocumentRestorePayload): Promise<AxiosResponse<DocumentResponse>>;
|
|
144
144
|
createDocumentComment(payload: DocumentCommentPayload): Promise<AxiosResponse<any, any>>;
|
|
145
145
|
generateDocument(payload: DocumentGeneratePayload): Promise<AxiosResponse<DocumentGenerateResponse>>;
|
|
146
|
+
listDocumentRevisions(path: string): Promise<AxiosResponse<DocumentRevisionListResponse>>;
|
|
147
|
+
getDocumentRevision(path: string, version: string): Promise<AxiosResponse<DocumentResponse>>;
|
|
146
148
|
fillPdf(data: PDFFillOptions): Promise<AxiosResponse<any, any>>;
|
|
147
149
|
/**
|
|
148
150
|
* Convert data between different formats (JSON, CSV, Excel)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import IntegrationsBaseClient from "../integrationsBaseClient";
|
|
2
|
+
import { TimberLogPayload, TimberQueryParams, TimberQueryResponse, TimberUsage, TimberWritePayload } from "../../types/timber";
|
|
3
|
+
export default class Timber extends IntegrationsBaseClient {
|
|
4
|
+
query(params?: TimberQueryParams): Promise<TimberQueryResponse>;
|
|
5
|
+
write(payload: TimberWritePayload): Promise<{
|
|
6
|
+
accepted: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
usage(): Promise<TimberUsage>;
|
|
9
|
+
debug(message: string, payload?: TimberLogPayload): Promise<{
|
|
10
|
+
accepted: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
info(message: string, payload?: TimberLogPayload): Promise<{
|
|
13
|
+
accepted: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
warn(message: string, payload?: TimberLogPayload): Promise<{
|
|
16
|
+
accepted: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
error(message: string, payload?: TimberLogPayload): Promise<{
|
|
19
|
+
accepted: boolean;
|
|
20
|
+
}>;
|
|
21
|
+
private normalizeParams;
|
|
22
|
+
}
|