@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
|
@@ -7,6 +7,7 @@ import Payments from "./integrations/payments";
|
|
|
7
7
|
import Minimax from "./integrations/minimax";
|
|
8
8
|
import NBS from "./integrations/serbia/nbs";
|
|
9
9
|
import Ecommerce from "./integrations/ecommerce";
|
|
10
|
+
import Timber from "./integrations/timber";
|
|
10
11
|
export default class Integrations extends IntegrationsBaseClient {
|
|
11
12
|
private integrations;
|
|
12
13
|
constructor(options?: {
|
|
@@ -22,6 +23,7 @@ export default class Integrations extends IntegrationsBaseClient {
|
|
|
22
23
|
getNBS(): NBS;
|
|
23
24
|
getSerbiaMinFin(): MinFin;
|
|
24
25
|
getEcommerce(): Ecommerce;
|
|
26
|
+
getTimber(): Timber;
|
|
25
27
|
list(): Promise<any>;
|
|
26
28
|
isInstalled(id: string): Promise<boolean>;
|
|
27
29
|
isActive(id: string): Promise<boolean>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AxiosResponse } from 'axios';
|
|
2
|
+
import PlatformBaseClient from "./platformBaseClient";
|
|
3
|
+
import { PagedResponse, PaginationParams, Agent, AgentCreatePayload, AgentUpdatePayload, KnowledgeBase, KnowledgeBaseCreatePayload, KnowledgeBaseUpdatePayload, Document, Conversation, ConversationCreatePayload, ConversationUpdatePayload, ParticipantAddPayload, Message, SendMessagePayload, InjectMessagePayload, OCRPayload, OCRResult, UserAccess, UserAccessCreatePayload, UserAccessUpdatePayload, UserMonthlyUsage, UserUsageBreakdown, MyAccess, AggregatedUsage, Tier } from '../types/kortex';
|
|
4
|
+
export default class Kortex extends PlatformBaseClient {
|
|
5
|
+
createAgent(data: AgentCreatePayload): Promise<AxiosResponse<Agent>>;
|
|
6
|
+
listAgents(params?: PaginationParams): Promise<AxiosResponse<PagedResponse<Agent>>>;
|
|
7
|
+
getAgent(uuid: string): Promise<AxiosResponse<Agent>>;
|
|
8
|
+
updateAgent(uuid: string, data: AgentUpdatePayload): Promise<AxiosResponse<Agent>>;
|
|
9
|
+
deleteAgent(uuid: string): Promise<AxiosResponse<void>>;
|
|
10
|
+
listAgentKnowledgeBases(agentUUID: string): Promise<AxiosResponse<KnowledgeBase[]>>;
|
|
11
|
+
createKnowledgeBase(data: KnowledgeBaseCreatePayload): Promise<AxiosResponse<KnowledgeBase>>;
|
|
12
|
+
listKnowledgeBases(params?: PaginationParams): Promise<AxiosResponse<PagedResponse<KnowledgeBase>>>;
|
|
13
|
+
getKnowledgeBase(uuid: string): Promise<AxiosResponse<KnowledgeBase>>;
|
|
14
|
+
updateKnowledgeBase(uuid: string, data: KnowledgeBaseUpdatePayload): Promise<AxiosResponse<KnowledgeBase>>;
|
|
15
|
+
deleteKnowledgeBase(uuid: string): Promise<AxiosResponse<void>>;
|
|
16
|
+
listDocuments(kbUUID: string, params?: PaginationParams): Promise<AxiosResponse<PagedResponse<Document>>>;
|
|
17
|
+
uploadDocument(kbUUID: string, formData: FormData): Promise<AxiosResponse<Document>>;
|
|
18
|
+
getDocument(kbUUID: string, uuid: string): Promise<AxiosResponse<Document>>;
|
|
19
|
+
deleteDocument(kbUUID: string, uuid: string): Promise<AxiosResponse<void>>;
|
|
20
|
+
retryDocument(kbUUID: string, uuid: string): Promise<AxiosResponse<void>>;
|
|
21
|
+
createConversation(data: ConversationCreatePayload): Promise<AxiosResponse<Conversation>>;
|
|
22
|
+
listConversations(params?: PaginationParams & {
|
|
23
|
+
all_users?: boolean;
|
|
24
|
+
archived?: boolean;
|
|
25
|
+
}): Promise<AxiosResponse<PagedResponse<Conversation>>>;
|
|
26
|
+
getConversation(uuid: string): Promise<AxiosResponse<Conversation>>;
|
|
27
|
+
updateConversation(uuid: string, data: ConversationUpdatePayload): Promise<AxiosResponse<Conversation>>;
|
|
28
|
+
deleteConversation(uuid: string): Promise<AxiosResponse<void>>;
|
|
29
|
+
archiveConversation(uuid: string): Promise<AxiosResponse<void>>;
|
|
30
|
+
unarchiveConversation(uuid: string): Promise<AxiosResponse<void>>;
|
|
31
|
+
addParticipant(conversationUUID: string, data: ParticipantAddPayload): Promise<AxiosResponse<any>>;
|
|
32
|
+
removeParticipant(conversationUUID: string, agentUUID: string): Promise<AxiosResponse<void>>;
|
|
33
|
+
sendMessage(conversationUUID: string, data: SendMessagePayload): Promise<AxiosResponse<Message>>;
|
|
34
|
+
streamMessage(conversationUUID: string, data: SendMessagePayload): Promise<AxiosResponse<ReadableStream>>;
|
|
35
|
+
listMessages(conversationUUID: string, params?: PaginationParams): Promise<AxiosResponse<PagedResponse<Message>>>;
|
|
36
|
+
injectMessage(conversationUUID: string, data: InjectMessagePayload): Promise<AxiosResponse<Message>>;
|
|
37
|
+
ocr(data: OCRPayload): Promise<AxiosResponse<OCRResult>>;
|
|
38
|
+
createUserAccess(data: UserAccessCreatePayload): Promise<AxiosResponse<UserAccess>>;
|
|
39
|
+
listUserAccess(params?: PaginationParams): Promise<AxiosResponse<PagedResponse<UserAccess>>>;
|
|
40
|
+
getUserAccess(uuid: string): Promise<AxiosResponse<UserAccess>>;
|
|
41
|
+
updateUserAccess(uuid: string, data: UserAccessUpdatePayload): Promise<AxiosResponse<UserAccess>>;
|
|
42
|
+
deleteUserAccess(uuid: string): Promise<AxiosResponse<void>>;
|
|
43
|
+
getUserMonthlyUsage(uuid: string, params?: {
|
|
44
|
+
month?: string;
|
|
45
|
+
}): Promise<AxiosResponse<UserMonthlyUsage>>;
|
|
46
|
+
getUserUsageBreakdown(uuid: string): Promise<AxiosResponse<UserUsageBreakdown>>;
|
|
47
|
+
getMyAccess(): Promise<AxiosResponse<MyAccess>>;
|
|
48
|
+
listUsage(params?: PaginationParams & {
|
|
49
|
+
month?: string;
|
|
50
|
+
}): Promise<AxiosResponse<PagedResponse<AggregatedUsage>>>;
|
|
51
|
+
getTier(): Promise<AxiosResponse<Tier>>;
|
|
52
|
+
}
|
|
@@ -11,6 +11,7 @@ import Sandbox from "./sandbox";
|
|
|
11
11
|
import System from "./system";
|
|
12
12
|
import Workflow from "./workflow";
|
|
13
13
|
import Forge from "./forge";
|
|
14
|
+
import Kortex from "./kortex";
|
|
14
15
|
import Project from "./project";
|
|
15
16
|
import Config from "./config";
|
|
16
17
|
import PlatformBaseClient from "./platformBaseClient";
|
|
@@ -22,6 +23,7 @@ export default class Platform extends PlatformBaseClient {
|
|
|
22
23
|
user(): Users;
|
|
23
24
|
app(appType: string): Apps;
|
|
24
25
|
forge(): Forge;
|
|
26
|
+
kortex(): Kortex;
|
|
25
27
|
component<C extends string>(ref: C): Component<C>;
|
|
26
28
|
componentUtils(): ComponentUtils;
|
|
27
29
|
ratchet(): Ratchet;
|
package/dist/v0.10/index.cjs.js
CHANGED
|
@@ -19079,73 +19079,60 @@ class Component extends PlatformBaseClient {
|
|
|
19079
19079
|
super();
|
|
19080
19080
|
this.ref = ref;
|
|
19081
19081
|
}
|
|
19082
|
-
|
|
19083
|
-
|
|
19084
|
-
|
|
19085
|
-
|
|
19086
|
-
|
|
19087
|
-
|
|
19088
|
-
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
dateTo: ctx.dateTo,
|
|
19134
|
-
dateField: ctx.dateField,
|
|
19135
|
-
};
|
|
19136
|
-
if (ctx.only && ctx.only.length > 0) {
|
|
19137
|
-
params.only = ctx.only;
|
|
19138
|
-
}
|
|
19139
|
-
if (Object.keys(ctx.$adv || []).length > 0) {
|
|
19140
|
-
params.$adv = [(_a = ctx.$adv) !== null && _a !== void 0 ? _a : {}];
|
|
19141
|
-
}
|
|
19142
|
-
if (ctx.$aggregate && ctx.$aggregate.length > 0) {
|
|
19143
|
-
params.$aggregate = ctx.$aggregate;
|
|
19082
|
+
find(filters, opts) {
|
|
19083
|
+
if (opts && opts.stream === true) {
|
|
19084
|
+
let onMetaCallback = () => { };
|
|
19085
|
+
let onDataCallback = () => { };
|
|
19086
|
+
let onErrorCallback;
|
|
19087
|
+
let onEndCallback;
|
|
19088
|
+
let isFirstLine = true;
|
|
19089
|
+
const chainable = {
|
|
19090
|
+
onMeta: (callback) => {
|
|
19091
|
+
onMetaCallback = callback;
|
|
19092
|
+
return chainable;
|
|
19093
|
+
},
|
|
19094
|
+
onData: (callback) => {
|
|
19095
|
+
onDataCallback = callback;
|
|
19096
|
+
return chainable;
|
|
19097
|
+
},
|
|
19098
|
+
onError: (callback) => {
|
|
19099
|
+
onErrorCallback = callback;
|
|
19100
|
+
return chainable;
|
|
19101
|
+
},
|
|
19102
|
+
onEnd: (callback) => {
|
|
19103
|
+
onEndCallback = callback;
|
|
19104
|
+
return chainable;
|
|
19105
|
+
},
|
|
19106
|
+
stream: () => {
|
|
19107
|
+
const body = this._buildFindBody(filters, opts);
|
|
19108
|
+
const handler = {
|
|
19109
|
+
onData: async (doc) => {
|
|
19110
|
+
if (isFirstLine) {
|
|
19111
|
+
isFirstLine = false;
|
|
19112
|
+
const result = onMetaCallback(doc);
|
|
19113
|
+
if (result instanceof Promise)
|
|
19114
|
+
await result;
|
|
19115
|
+
}
|
|
19116
|
+
else {
|
|
19117
|
+
const result = onDataCallback(doc);
|
|
19118
|
+
if (result instanceof Promise)
|
|
19119
|
+
await result;
|
|
19120
|
+
}
|
|
19121
|
+
},
|
|
19122
|
+
onError: onErrorCallback,
|
|
19123
|
+
onEnd: onEndCallback,
|
|
19124
|
+
};
|
|
19125
|
+
return this._streamNDJSON(`/v4/system/component/${this.ref}/models/stream`, {
|
|
19126
|
+
'Accept': 'application/x-ndjson',
|
|
19127
|
+
'Content-Type': 'application/json',
|
|
19128
|
+
'Accept-Language': (opts === null || opts === void 0 ? void 0 : opts.locale) || 'en_US',
|
|
19129
|
+
}, handler, body);
|
|
19130
|
+
}
|
|
19131
|
+
};
|
|
19132
|
+
return chainable;
|
|
19144
19133
|
}
|
|
19145
|
-
|
|
19146
|
-
|
|
19147
|
-
options: opts
|
|
19148
|
-
}, {
|
|
19134
|
+
const body = this._buildFindBody(filters, opts);
|
|
19135
|
+
return this.client.post(`/v4/system/component/${this.ref}/models`, body, {
|
|
19149
19136
|
headers: {
|
|
19150
19137
|
"Accept-Language": (opts === null || opts === void 0 ? void 0 : opts.locale) || "en_US",
|
|
19151
19138
|
}
|
|
@@ -19174,6 +19161,34 @@ class Component extends PlatformBaseClient {
|
|
|
19174
19161
|
}
|
|
19175
19162
|
return null;
|
|
19176
19163
|
}
|
|
19164
|
+
/** @private Build the POST body shared by `find` (streaming and non-streaming) */
|
|
19165
|
+
_buildFindBody(filters, opts) {
|
|
19166
|
+
var _a, _b;
|
|
19167
|
+
let ctx = { ...filters };
|
|
19168
|
+
let offset = (_a = ctx.currentPage) !== null && _a !== void 0 ? _a : 0;
|
|
19169
|
+
let limit = (ctx.perPage == null || ctx.perPage === -1) ? 10 : ctx.perPage;
|
|
19170
|
+
let sortDesc = ctx.sortDesc ? -1 : 1;
|
|
19171
|
+
if (ctx.filterOn === undefined)
|
|
19172
|
+
ctx.filterOn = [];
|
|
19173
|
+
const params = {
|
|
19174
|
+
offset,
|
|
19175
|
+
sortBy: ctx.sortBy,
|
|
19176
|
+
sortDesc,
|
|
19177
|
+
filter: ctx.filter,
|
|
19178
|
+
filterOn: ctx.filterOn,
|
|
19179
|
+
limit,
|
|
19180
|
+
dateFrom: ctx.dateFrom,
|
|
19181
|
+
dateTo: ctx.dateTo,
|
|
19182
|
+
dateField: ctx.dateField,
|
|
19183
|
+
};
|
|
19184
|
+
if (ctx.only && ctx.only.length > 0)
|
|
19185
|
+
params.only = ctx.only;
|
|
19186
|
+
if (Object.keys(ctx.$adv || {}).length > 0)
|
|
19187
|
+
params.$adv = [(_b = ctx.$adv) !== null && _b !== void 0 ? _b : {}];
|
|
19188
|
+
if (ctx.$aggregate && ctx.$aggregate.length > 0)
|
|
19189
|
+
params.$aggregate = ctx.$aggregate;
|
|
19190
|
+
return { ...params, options: opts };
|
|
19191
|
+
}
|
|
19177
19192
|
/**
|
|
19178
19193
|
* Get model by uuid
|
|
19179
19194
|
*
|
|
@@ -20240,6 +20255,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
20240
20255
|
}
|
|
20241
20256
|
|
|
20242
20257
|
class Forge extends PlatformBaseClient {
|
|
20258
|
+
// --- Management (appservice) ---
|
|
20243
20259
|
async bundleUpload(buffer) {
|
|
20244
20260
|
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
20245
20261
|
headers: {
|
|
@@ -20257,6 +20273,170 @@ class Forge extends PlatformBaseClient {
|
|
|
20257
20273
|
async list() {
|
|
20258
20274
|
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
20259
20275
|
}
|
|
20276
|
+
async listServices(ref) {
|
|
20277
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/services`);
|
|
20278
|
+
}
|
|
20279
|
+
// --- Variables ---
|
|
20280
|
+
async getVariables(ref) {
|
|
20281
|
+
return await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20282
|
+
}
|
|
20283
|
+
async updateVariables(ref, variables) {
|
|
20284
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, variables);
|
|
20285
|
+
}
|
|
20286
|
+
async addVariable(ref, key, value) {
|
|
20287
|
+
var _a;
|
|
20288
|
+
const resp = await this.client.get(`/luma/appservice/v1/forge/${ref}/variables`);
|
|
20289
|
+
const current = (_a = resp.data) !== null && _a !== void 0 ? _a : {};
|
|
20290
|
+
current[key] = value;
|
|
20291
|
+
return await this.client.patch(`/luma/appservice/v1/forge/${ref}/variables`, current);
|
|
20292
|
+
}
|
|
20293
|
+
// --- Service execution (forge-runtime) ---
|
|
20294
|
+
async callService(appUuid, serviceName, options) {
|
|
20295
|
+
var _a;
|
|
20296
|
+
const queryString = (options === null || options === void 0 ? void 0 : options.query)
|
|
20297
|
+
? '?' + new URLSearchParams(options.query).toString()
|
|
20298
|
+
: '';
|
|
20299
|
+
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);
|
|
20300
|
+
}
|
|
20301
|
+
}
|
|
20302
|
+
|
|
20303
|
+
const BASE = '/luma/kortex/v1';
|
|
20304
|
+
class Kortex extends PlatformBaseClient {
|
|
20305
|
+
// ── Agents ──
|
|
20306
|
+
async createAgent(data) {
|
|
20307
|
+
return await this.client.post(`${BASE}/agents`, data);
|
|
20308
|
+
}
|
|
20309
|
+
async listAgents(params) {
|
|
20310
|
+
return await this.client.get(`${BASE}/agents`, { params });
|
|
20311
|
+
}
|
|
20312
|
+
async getAgent(uuid) {
|
|
20313
|
+
return await this.client.get(`${BASE}/agents/${uuid}`);
|
|
20314
|
+
}
|
|
20315
|
+
async updateAgent(uuid, data) {
|
|
20316
|
+
return await this.client.patch(`${BASE}/agents/${uuid}`, data);
|
|
20317
|
+
}
|
|
20318
|
+
async deleteAgent(uuid) {
|
|
20319
|
+
return await this.client.delete(`${BASE}/agents/${uuid}`);
|
|
20320
|
+
}
|
|
20321
|
+
async listAgentKnowledgeBases(agentUUID) {
|
|
20322
|
+
return await this.client.get(`${BASE}/agents/${agentUUID}/knowledge-bases`);
|
|
20323
|
+
}
|
|
20324
|
+
// ── Knowledge Bases ──
|
|
20325
|
+
async createKnowledgeBase(data) {
|
|
20326
|
+
return await this.client.post(`${BASE}/knowledge-bases`, data);
|
|
20327
|
+
}
|
|
20328
|
+
async listKnowledgeBases(params) {
|
|
20329
|
+
return await this.client.get(`${BASE}/knowledge-bases`, { params });
|
|
20330
|
+
}
|
|
20331
|
+
async getKnowledgeBase(uuid) {
|
|
20332
|
+
return await this.client.get(`${BASE}/knowledge-bases/${uuid}`);
|
|
20333
|
+
}
|
|
20334
|
+
async updateKnowledgeBase(uuid, data) {
|
|
20335
|
+
return await this.client.put(`${BASE}/knowledge-bases/${uuid}`, data);
|
|
20336
|
+
}
|
|
20337
|
+
async deleteKnowledgeBase(uuid) {
|
|
20338
|
+
return await this.client.delete(`${BASE}/knowledge-bases/${uuid}`);
|
|
20339
|
+
}
|
|
20340
|
+
// ── Documents ──
|
|
20341
|
+
async listDocuments(kbUUID, params) {
|
|
20342
|
+
return await this.client.get(`${BASE}/knowledge-bases/${kbUUID}/documents`, { params });
|
|
20343
|
+
}
|
|
20344
|
+
async uploadDocument(kbUUID, formData) {
|
|
20345
|
+
return await this.client.post(`${BASE}/knowledge-bases/${kbUUID}/documents`, formData, {
|
|
20346
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
20347
|
+
timeout: 120000,
|
|
20348
|
+
});
|
|
20349
|
+
}
|
|
20350
|
+
async getDocument(kbUUID, uuid) {
|
|
20351
|
+
return await this.client.get(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}`);
|
|
20352
|
+
}
|
|
20353
|
+
async deleteDocument(kbUUID, uuid) {
|
|
20354
|
+
return await this.client.delete(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}`);
|
|
20355
|
+
}
|
|
20356
|
+
async retryDocument(kbUUID, uuid) {
|
|
20357
|
+
return await this.client.post(`${BASE}/knowledge-bases/${kbUUID}/documents/${uuid}/retry`);
|
|
20358
|
+
}
|
|
20359
|
+
// ── Conversations ──
|
|
20360
|
+
async createConversation(data) {
|
|
20361
|
+
return await this.client.post(`${BASE}/conversations`, data);
|
|
20362
|
+
}
|
|
20363
|
+
async listConversations(params) {
|
|
20364
|
+
return await this.client.get(`${BASE}/conversations`, { params });
|
|
20365
|
+
}
|
|
20366
|
+
async getConversation(uuid) {
|
|
20367
|
+
return await this.client.get(`${BASE}/conversations/${uuid}`);
|
|
20368
|
+
}
|
|
20369
|
+
async updateConversation(uuid, data) {
|
|
20370
|
+
return await this.client.put(`${BASE}/conversations/${uuid}`, data);
|
|
20371
|
+
}
|
|
20372
|
+
async deleteConversation(uuid) {
|
|
20373
|
+
return await this.client.delete(`${BASE}/conversations/${uuid}`);
|
|
20374
|
+
}
|
|
20375
|
+
async archiveConversation(uuid) {
|
|
20376
|
+
return await this.client.post(`${BASE}/conversations/${uuid}/archive`);
|
|
20377
|
+
}
|
|
20378
|
+
async unarchiveConversation(uuid) {
|
|
20379
|
+
return await this.client.post(`${BASE}/conversations/${uuid}/unarchive`);
|
|
20380
|
+
}
|
|
20381
|
+
async addParticipant(conversationUUID, data) {
|
|
20382
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/participants`, data);
|
|
20383
|
+
}
|
|
20384
|
+
async removeParticipant(conversationUUID, agentUUID) {
|
|
20385
|
+
return await this.client.delete(`${BASE}/conversations/${conversationUUID}/participants/${agentUUID}`);
|
|
20386
|
+
}
|
|
20387
|
+
// ── Messages / Completions ──
|
|
20388
|
+
async sendMessage(conversationUUID, data) {
|
|
20389
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages`, data);
|
|
20390
|
+
}
|
|
20391
|
+
async streamMessage(conversationUUID, data) {
|
|
20392
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages`, { ...data, stream: true }, {
|
|
20393
|
+
responseType: 'stream',
|
|
20394
|
+
timeout: 120000,
|
|
20395
|
+
});
|
|
20396
|
+
}
|
|
20397
|
+
async listMessages(conversationUUID, params) {
|
|
20398
|
+
return await this.client.get(`${BASE}/conversations/${conversationUUID}/messages`, { params });
|
|
20399
|
+
}
|
|
20400
|
+
async injectMessage(conversationUUID, data) {
|
|
20401
|
+
return await this.client.post(`${BASE}/conversations/${conversationUUID}/messages/inject`, data);
|
|
20402
|
+
}
|
|
20403
|
+
// ── OCR ──
|
|
20404
|
+
async ocr(data) {
|
|
20405
|
+
return await this.client.post(`${BASE}/ocr`, data, { timeout: 120000 });
|
|
20406
|
+
}
|
|
20407
|
+
// ── User Access ──
|
|
20408
|
+
async createUserAccess(data) {
|
|
20409
|
+
return await this.client.post(`${BASE}/user-access`, data);
|
|
20410
|
+
}
|
|
20411
|
+
async listUserAccess(params) {
|
|
20412
|
+
return await this.client.get(`${BASE}/user-access`, { params });
|
|
20413
|
+
}
|
|
20414
|
+
async getUserAccess(uuid) {
|
|
20415
|
+
return await this.client.get(`${BASE}/user-access/${uuid}`);
|
|
20416
|
+
}
|
|
20417
|
+
async updateUserAccess(uuid, data) {
|
|
20418
|
+
return await this.client.patch(`${BASE}/user-access/${uuid}`, data);
|
|
20419
|
+
}
|
|
20420
|
+
async deleteUserAccess(uuid) {
|
|
20421
|
+
return await this.client.delete(`${BASE}/user-access/${uuid}`);
|
|
20422
|
+
}
|
|
20423
|
+
async getUserMonthlyUsage(uuid, params) {
|
|
20424
|
+
return await this.client.get(`${BASE}/user-access/${uuid}/usage`, { params });
|
|
20425
|
+
}
|
|
20426
|
+
async getUserUsageBreakdown(uuid) {
|
|
20427
|
+
return await this.client.get(`${BASE}/user-access/${uuid}/usage/breakdown`);
|
|
20428
|
+
}
|
|
20429
|
+
async getMyAccess() {
|
|
20430
|
+
return await this.client.get(`${BASE}/my-access`);
|
|
20431
|
+
}
|
|
20432
|
+
// ── Usage (Admin) ──
|
|
20433
|
+
async listUsage(params) {
|
|
20434
|
+
return await this.client.get(`${BASE}/usage`, { params });
|
|
20435
|
+
}
|
|
20436
|
+
// ── Tier ──
|
|
20437
|
+
async getTier() {
|
|
20438
|
+
return await this.client.get(`${BASE}/tier`);
|
|
20439
|
+
}
|
|
20260
20440
|
}
|
|
20261
20441
|
|
|
20262
20442
|
class Project extends PlatformBaseClient {
|
|
@@ -20483,6 +20663,9 @@ class Platform extends PlatformBaseClient {
|
|
|
20483
20663
|
forge() {
|
|
20484
20664
|
return (new Forge()).setClient(this.client);
|
|
20485
20665
|
}
|
|
20666
|
+
kortex() {
|
|
20667
|
+
return (new Kortex()).setClient(this.client);
|
|
20668
|
+
}
|
|
20486
20669
|
component(ref) {
|
|
20487
20670
|
return (new Component(ref)).setClient(this.client);
|
|
20488
20671
|
}
|
|
@@ -20849,6 +21032,12 @@ class DMS extends IntegrationsBaseClient {
|
|
|
20849
21032
|
async generateDocument(payload) {
|
|
20850
21033
|
return this.requestv2('POST', 'documents/document/generate', { data: payload });
|
|
20851
21034
|
}
|
|
21035
|
+
async listDocumentRevisions(path) {
|
|
21036
|
+
return this.requestv2('GET', `documents/revisions/${path}`);
|
|
21037
|
+
}
|
|
21038
|
+
async getDocumentRevision(path, version) {
|
|
21039
|
+
return this.requestv2('GET', `documents/revision/${path}`, { params: { version } });
|
|
21040
|
+
}
|
|
20852
21041
|
async fillPdf(data) {
|
|
20853
21042
|
const { input_path, output_path, output_pdf = false, output_type, output_file_name, replace, form_data, forms } = data;
|
|
20854
21043
|
const responseType = output_pdf ? 'arraybuffer' : 'json';
|
|
@@ -22395,6 +22584,45 @@ class Ecommerce extends IntegrationsBaseClient {
|
|
|
22395
22584
|
}
|
|
22396
22585
|
}
|
|
22397
22586
|
|
|
22587
|
+
class Timber extends IntegrationsBaseClient {
|
|
22588
|
+
async query(params = {}) {
|
|
22589
|
+
const { data } = await this.client.get("/v1/timber/logs", {
|
|
22590
|
+
params: this.normalizeParams(params),
|
|
22591
|
+
});
|
|
22592
|
+
return data;
|
|
22593
|
+
}
|
|
22594
|
+
async write(payload) {
|
|
22595
|
+
const { data } = await this.client.post("/v1/timber/logs", payload);
|
|
22596
|
+
return data;
|
|
22597
|
+
}
|
|
22598
|
+
async usage() {
|
|
22599
|
+
const { data } = await this.client.get("/v1/timber/usage");
|
|
22600
|
+
return data;
|
|
22601
|
+
}
|
|
22602
|
+
async debug(message, payload) {
|
|
22603
|
+
return this.write({ ...payload, message, level: 'debug' });
|
|
22604
|
+
}
|
|
22605
|
+
async info(message, payload) {
|
|
22606
|
+
return this.write({ ...payload, message, level: 'info' });
|
|
22607
|
+
}
|
|
22608
|
+
async warn(message, payload) {
|
|
22609
|
+
return this.write({ ...payload, message, level: 'warn' });
|
|
22610
|
+
}
|
|
22611
|
+
async error(message, payload) {
|
|
22612
|
+
return this.write({ ...payload, message, level: 'error' });
|
|
22613
|
+
}
|
|
22614
|
+
normalizeParams(params) {
|
|
22615
|
+
const normalized = { ...params };
|
|
22616
|
+
if (params.from instanceof Date) {
|
|
22617
|
+
normalized.from = params.from.toISOString();
|
|
22618
|
+
}
|
|
22619
|
+
if (params.to instanceof Date) {
|
|
22620
|
+
normalized.to = params.to.toISOString();
|
|
22621
|
+
}
|
|
22622
|
+
return normalized;
|
|
22623
|
+
}
|
|
22624
|
+
}
|
|
22625
|
+
|
|
22398
22626
|
class Integrations extends IntegrationsBaseClient {
|
|
22399
22627
|
constructor(options) {
|
|
22400
22628
|
super(options);
|
|
@@ -22406,6 +22634,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
22406
22634
|
'protokol-payments': new Payments().setClient(this.client),
|
|
22407
22635
|
'protokol-minimax': new Minimax().setClient(this.client),
|
|
22408
22636
|
'protokol-ecommerce': new Ecommerce().setClient(this.client),
|
|
22637
|
+
'protokol-timber': new Timber().setClient(this.client),
|
|
22409
22638
|
};
|
|
22410
22639
|
}
|
|
22411
22640
|
getDMS() {
|
|
@@ -22432,6 +22661,9 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
22432
22661
|
getEcommerce() {
|
|
22433
22662
|
return this.getInterfaceOf('protokol-ecommerce');
|
|
22434
22663
|
}
|
|
22664
|
+
getTimber() {
|
|
22665
|
+
return this.getInterfaceOf('protokol-timber');
|
|
22666
|
+
}
|
|
22435
22667
|
async list() {
|
|
22436
22668
|
const { data } = await this.client.get("/v1/integrations");
|
|
22437
22669
|
return data;
|
|
@@ -22618,6 +22850,7 @@ exports.Functions = Functions;
|
|
|
22618
22850
|
exports.Integration = Integrations;
|
|
22619
22851
|
exports.Integrations = Integrations;
|
|
22620
22852
|
exports.Invoicing = Invoicing;
|
|
22853
|
+
exports.Kortex = Kortex;
|
|
22621
22854
|
exports.Mail = Mail;
|
|
22622
22855
|
exports.NBS = NBS;
|
|
22623
22856
|
exports.PRN = PRN;
|
|
@@ -22629,6 +22862,7 @@ exports.Sandbox = Sandbox;
|
|
|
22629
22862
|
exports.SerbiaMinFin = MinFin;
|
|
22630
22863
|
exports.System = System;
|
|
22631
22864
|
exports.Thunder = Thunder;
|
|
22865
|
+
exports.Timber = Timber;
|
|
22632
22866
|
exports.Users = Users;
|
|
22633
22867
|
exports.VPFR = VPFR;
|
|
22634
22868
|
exports.Workflow = Workflow;
|