@applica-software-guru/persona-sdk 0.1.113 → 0.1.114
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/bundle.cjs.js +1 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.es.js +316 -274
- package/dist/bundle.es.js.map +1 -1
- package/dist/index.d.ts +75 -0
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/workflows/channels-api.ts +61 -0
- package/src/workflows/types.ts +45 -0
- package/src/workflows/workflows-api.ts +5 -0
- package/tests/channels-api.test.mjs +55 -0
package/dist/bundle.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var g = Object.defineProperty;
|
|
2
|
-
var y = (o, t,
|
|
3
|
-
var u = (o, t,
|
|
2
|
+
var y = (o, t, e) => t in o ? g(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
3
|
+
var u = (o, t, e) => y(o, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
class l extends Error {
|
|
5
|
-
constructor(
|
|
6
|
-
super(`API Error: ${
|
|
5
|
+
constructor(e, s) {
|
|
6
|
+
super(`API Error: ${e} - ${s}`);
|
|
7
7
|
u(this, "statusCode");
|
|
8
8
|
u(this, "body");
|
|
9
|
-
this.statusCode =
|
|
9
|
+
this.statusCode = e, this.body = s;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
class m {
|
|
@@ -21,10 +21,10 @@ class m {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
class c {
|
|
24
|
-
constructor(t,
|
|
24
|
+
constructor(t, e) {
|
|
25
25
|
u(this, "baseUrl");
|
|
26
26
|
u(this, "authProvider");
|
|
27
|
-
this.baseUrl = t, this.authProvider = typeof
|
|
27
|
+
this.baseUrl = t, this.authProvider = typeof e == "string" ? new m(e) : e;
|
|
28
28
|
}
|
|
29
29
|
getBaseUrl() {
|
|
30
30
|
return this.baseUrl;
|
|
@@ -32,117 +32,117 @@ class c {
|
|
|
32
32
|
getAuthProvider() {
|
|
33
33
|
return this.authProvider;
|
|
34
34
|
}
|
|
35
|
-
normalizePageParams(t,
|
|
35
|
+
normalizePageParams(t, e) {
|
|
36
36
|
return {
|
|
37
37
|
page: t === void 0 || t < 1 ? 1 : t,
|
|
38
|
-
size:
|
|
38
|
+
size: e === void 0 || e < 1 ? 20 : e
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
buildHeaders() {
|
|
42
42
|
const t = new Headers();
|
|
43
43
|
return t.set("Content-Type", "application/json"), this.authProvider.applyHeaders(t), t;
|
|
44
44
|
}
|
|
45
|
-
buildUrl(t,
|
|
46
|
-
const
|
|
47
|
-
return
|
|
48
|
-
n != null &&
|
|
49
|
-
}),
|
|
45
|
+
buildUrl(t, e) {
|
|
46
|
+
const s = new URL(this.baseUrl + t);
|
|
47
|
+
return e && Object.entries(e).forEach(([r, n]) => {
|
|
48
|
+
n != null && s.searchParams.set(r, String(n));
|
|
49
|
+
}), s.toString();
|
|
50
50
|
}
|
|
51
51
|
async handleResponse(t) {
|
|
52
52
|
if (!t.ok) {
|
|
53
|
-
const
|
|
54
|
-
throw new l(t.status,
|
|
53
|
+
const s = await t.text();
|
|
54
|
+
throw new l(t.status, s);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
return
|
|
56
|
+
const e = await t.text();
|
|
57
|
+
return e ? JSON.parse(e) : void 0;
|
|
58
58
|
}
|
|
59
|
-
async httpGet(t,
|
|
60
|
-
const
|
|
59
|
+
async httpGet(t, e) {
|
|
60
|
+
const s = await fetch(this.buildUrl(t, e), {
|
|
61
61
|
method: "GET",
|
|
62
62
|
headers: this.buildHeaders()
|
|
63
63
|
});
|
|
64
|
-
return this.handleResponse(
|
|
64
|
+
return this.handleResponse(s);
|
|
65
65
|
}
|
|
66
|
-
async httpPost(t,
|
|
67
|
-
const r = await fetch(this.buildUrl(t,
|
|
66
|
+
async httpPost(t, e, s) {
|
|
67
|
+
const r = await fetch(this.buildUrl(t, s), {
|
|
68
68
|
method: "POST",
|
|
69
69
|
headers: this.buildHeaders(),
|
|
70
|
-
body:
|
|
70
|
+
body: e ? JSON.stringify(e) : void 0
|
|
71
71
|
});
|
|
72
72
|
return this.handleResponse(r);
|
|
73
73
|
}
|
|
74
|
-
async httpPut(t,
|
|
75
|
-
const
|
|
74
|
+
async httpPut(t, e) {
|
|
75
|
+
const s = await fetch(this.baseUrl + t, {
|
|
76
76
|
method: "PUT",
|
|
77
77
|
headers: this.buildHeaders(),
|
|
78
|
-
body: JSON.stringify(
|
|
78
|
+
body: JSON.stringify(e)
|
|
79
79
|
});
|
|
80
|
-
return this.handleResponse(
|
|
80
|
+
return this.handleResponse(s);
|
|
81
81
|
}
|
|
82
|
-
async httpPatch(t,
|
|
83
|
-
const
|
|
82
|
+
async httpPatch(t, e) {
|
|
83
|
+
const s = await fetch(this.baseUrl + t, {
|
|
84
84
|
method: "PATCH",
|
|
85
85
|
headers: this.buildHeaders(),
|
|
86
|
-
body: JSON.stringify(
|
|
86
|
+
body: JSON.stringify(e)
|
|
87
87
|
});
|
|
88
|
-
return this.handleResponse(
|
|
88
|
+
return this.handleResponse(s);
|
|
89
89
|
}
|
|
90
90
|
async httpDelete(t) {
|
|
91
|
-
const
|
|
91
|
+
const e = await fetch(this.baseUrl + t, {
|
|
92
92
|
method: "DELETE",
|
|
93
93
|
headers: this.buildHeaders()
|
|
94
94
|
});
|
|
95
|
-
if (!
|
|
96
|
-
const
|
|
97
|
-
throw new l(
|
|
95
|
+
if (!e.ok) {
|
|
96
|
+
const s = await e.text();
|
|
97
|
+
throw new l(e.status, s);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
class w extends c {
|
|
102
|
-
constructor(
|
|
103
|
-
super(
|
|
102
|
+
constructor(e, s, r) {
|
|
103
|
+
super(e, s);
|
|
104
104
|
u(this, "billingBaseUrl");
|
|
105
|
-
this.billingBaseUrl = (r ||
|
|
105
|
+
this.billingBaseUrl = (r || e).replace(/\/$/, "");
|
|
106
106
|
}
|
|
107
|
-
async list(
|
|
108
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
109
|
-
return
|
|
107
|
+
async list(e, s, r) {
|
|
108
|
+
const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
|
|
109
|
+
return e && (i.keyword = e), this.httpGet("/projects", i);
|
|
110
110
|
}
|
|
111
|
-
async get(
|
|
112
|
-
return this.httpGet("/projects/" +
|
|
111
|
+
async get(e) {
|
|
112
|
+
return this.httpGet("/projects/" + e);
|
|
113
113
|
}
|
|
114
114
|
async getMine() {
|
|
115
115
|
return this.httpGet("/projects/mine");
|
|
116
116
|
}
|
|
117
|
-
async create(
|
|
118
|
-
return this.httpPost("/projects",
|
|
117
|
+
async create(e) {
|
|
118
|
+
return this.httpPost("/projects", e);
|
|
119
119
|
}
|
|
120
|
-
async update(
|
|
121
|
-
return this.httpPut("/projects/" +
|
|
120
|
+
async update(e) {
|
|
121
|
+
return this.httpPut("/projects/" + e.projectId, e);
|
|
122
122
|
}
|
|
123
|
-
async remove(
|
|
124
|
-
await this.httpDelete("/projects/" +
|
|
123
|
+
async remove(e) {
|
|
124
|
+
await this.httpDelete("/projects/" + e);
|
|
125
125
|
}
|
|
126
|
-
async duplicate(
|
|
127
|
-
return this.httpPost("/projects/" +
|
|
126
|
+
async duplicate(e, s) {
|
|
127
|
+
return this.httpPost("/projects/" + e + "/actions/duplicate", s);
|
|
128
128
|
}
|
|
129
|
-
async getSubscription(
|
|
130
|
-
return this.billingRequest("/projects/" +
|
|
129
|
+
async getSubscription(e) {
|
|
130
|
+
return this.billingRequest("/projects/" + e + "/subscription", "GET");
|
|
131
131
|
}
|
|
132
|
-
async changeSubscriptionPlan(
|
|
133
|
-
return this.billingRequest("/projects/" +
|
|
132
|
+
async changeSubscriptionPlan(e, s) {
|
|
133
|
+
return this.billingRequest("/projects/" + e + "/subscription/actions/change-plan", "POST", s);
|
|
134
134
|
}
|
|
135
|
-
async addSubscriptionCredits(
|
|
136
|
-
return this.billingRequest("/projects/" +
|
|
135
|
+
async addSubscriptionCredits(e, s) {
|
|
136
|
+
return this.billingRequest("/projects/" + e + "/subscription/actions/add-credits", "POST", s);
|
|
137
137
|
}
|
|
138
|
-
async setInfiniteCredits(
|
|
139
|
-
return this.billingRequest("/projects/" +
|
|
138
|
+
async setInfiniteCredits(e, s) {
|
|
139
|
+
return this.billingRequest("/projects/" + e + "/subscription/actions/set-infinite-credits", "POST", s);
|
|
140
140
|
}
|
|
141
|
-
async billingRequest(
|
|
141
|
+
async billingRequest(e, s, r) {
|
|
142
142
|
const n = new Headers();
|
|
143
143
|
n.set("Content-Type", "application/json"), this.getAuthProvider().applyHeaders(n);
|
|
144
|
-
const a = await fetch(this.billingBaseUrl +
|
|
145
|
-
method:
|
|
144
|
+
const a = await fetch(this.billingBaseUrl + e, {
|
|
145
|
+
method: s,
|
|
146
146
|
headers: n,
|
|
147
147
|
body: r ? JSON.stringify(r) : void 0
|
|
148
148
|
});
|
|
@@ -155,11 +155,11 @@ class w extends c {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
class P extends c {
|
|
158
|
-
constructor(t,
|
|
159
|
-
super(t,
|
|
158
|
+
constructor(t, e) {
|
|
159
|
+
super(t, e);
|
|
160
160
|
}
|
|
161
|
-
async list(t,
|
|
162
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
161
|
+
async list(t, e, s, r) {
|
|
162
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
163
163
|
return t && (i.keyword = t), this.httpGet("/agents", i);
|
|
164
164
|
}
|
|
165
165
|
async get(t) {
|
|
@@ -180,49 +180,49 @@ class P extends c {
|
|
|
180
180
|
async listRevisions(t) {
|
|
181
181
|
return this.httpGet("/agents/" + t + "/revisions");
|
|
182
182
|
}
|
|
183
|
-
async getRevision(t,
|
|
184
|
-
return this.httpGet("/agents/" + t + "/revisions/" +
|
|
183
|
+
async getRevision(t, e) {
|
|
184
|
+
return this.httpGet("/agents/" + t + "/revisions/" + e);
|
|
185
185
|
}
|
|
186
|
-
async rollback(t,
|
|
187
|
-
return this.httpPost("/agents/" + t + "/revisions/" +
|
|
186
|
+
async rollback(t, e) {
|
|
187
|
+
return this.httpPost("/agents/" + t + "/revisions/" + e + "/rollback", {});
|
|
188
188
|
}
|
|
189
|
-
async generateSystemInstructions(t,
|
|
190
|
-
const
|
|
191
|
-
return
|
|
189
|
+
async generateSystemInstructions(t, e) {
|
|
190
|
+
const s = { prompt: t };
|
|
191
|
+
return e && (s.sessionId = e), (await this.httpPost("/agents/system-instructions", s)).instructions;
|
|
192
192
|
}
|
|
193
193
|
async getArchitect() {
|
|
194
194
|
return this.httpGet("/agents/architect");
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
class b extends c {
|
|
198
|
-
constructor(
|
|
199
|
-
super(
|
|
198
|
+
constructor(e, s, r) {
|
|
199
|
+
super(e, s);
|
|
200
200
|
u(this, "knowledgeBaseId");
|
|
201
201
|
this.knowledgeBaseId = r;
|
|
202
202
|
}
|
|
203
|
-
async list(
|
|
204
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
205
|
-
return
|
|
203
|
+
async list(e, s, r) {
|
|
204
|
+
const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
|
|
205
|
+
return e && (i.keyword = e), this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents", i);
|
|
206
206
|
}
|
|
207
|
-
async upload(
|
|
208
|
-
return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents",
|
|
207
|
+
async upload(e) {
|
|
208
|
+
return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", e);
|
|
209
209
|
}
|
|
210
|
-
async get(
|
|
211
|
-
return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" +
|
|
210
|
+
async get(e) {
|
|
211
|
+
return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
|
|
212
212
|
}
|
|
213
|
-
async reprocess(
|
|
214
|
-
return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id:
|
|
213
|
+
async reprocess(e) {
|
|
214
|
+
return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id: e });
|
|
215
215
|
}
|
|
216
|
-
async remove(
|
|
217
|
-
await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" +
|
|
216
|
+
async remove(e) {
|
|
217
|
+
await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
class v extends c {
|
|
221
|
-
constructor(t,
|
|
222
|
-
super(t,
|
|
221
|
+
constructor(t, e) {
|
|
222
|
+
super(t, e);
|
|
223
223
|
}
|
|
224
|
-
async list(t,
|
|
225
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
224
|
+
async list(t, e, s, r) {
|
|
225
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
226
226
|
return t && (i.keyword = t), this.httpGet("/knowledge-bases", i);
|
|
227
227
|
}
|
|
228
228
|
async get(t) {
|
|
@@ -240,92 +240,130 @@ class v extends c {
|
|
|
240
240
|
documents(t) {
|
|
241
241
|
return new b(this.getBaseUrl(), this.getAuthProvider(), t);
|
|
242
242
|
}
|
|
243
|
-
async searchChunks(t,
|
|
244
|
-
return this.httpPost("/knowledge-bases/" + t + "/search",
|
|
243
|
+
async searchChunks(t, e) {
|
|
244
|
+
return this.httpPost("/knowledge-bases/" + t + "/search", e);
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
class f extends c {
|
|
248
|
-
constructor(t,
|
|
249
|
-
super(t,
|
|
248
|
+
constructor(t, e) {
|
|
249
|
+
super(t, e);
|
|
250
250
|
}
|
|
251
|
-
async list(t,
|
|
252
|
-
const { page: r, size: n } = this.normalizePageParams(
|
|
251
|
+
async list(t, e, s) {
|
|
252
|
+
const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
|
|
253
253
|
return this.httpGet("/workflows/" + t + "/executions", a);
|
|
254
254
|
}
|
|
255
|
-
async get(t,
|
|
256
|
-
return this.httpGet("/workflows/" + t + "/executions/" +
|
|
255
|
+
async get(t, e) {
|
|
256
|
+
return this.httpGet("/workflows/" + t + "/executions/" + e);
|
|
257
257
|
}
|
|
258
|
-
async run(t,
|
|
259
|
-
return this.httpPost("/workflows/" + t + "/executions",
|
|
258
|
+
async run(t, e) {
|
|
259
|
+
return this.httpPost("/workflows/" + t + "/executions", e);
|
|
260
260
|
}
|
|
261
|
-
async queue(t,
|
|
262
|
-
return this.httpPost("/workflows/" + t + "/executions/queue",
|
|
261
|
+
async queue(t, e) {
|
|
262
|
+
return this.httpPost("/workflows/" + t + "/executions/queue", e);
|
|
263
263
|
}
|
|
264
264
|
/** Runs across all workflows in the project (filter by status/workflow/date). */
|
|
265
265
|
async listRuns(t = {}) {
|
|
266
|
-
const { page:
|
|
266
|
+
const { page: e, size: s } = this.normalizePageParams(t.page, t.size), r = { page: e, size: s };
|
|
267
267
|
return t.status && (r.status = t.status), t.workflowId && (r.workflowId = t.workflowId), t.dateFrom && (r.dateFrom = t.dateFrom), t.dateTo && (r.dateTo = t.dateTo), this.httpGet("/executions", r);
|
|
268
268
|
}
|
|
269
269
|
/** Request cancellation of a running/waiting execution (cascades to sub-workflows). */
|
|
270
|
-
async cancel(t,
|
|
270
|
+
async cancel(t, e) {
|
|
271
271
|
return this.httpPost(
|
|
272
|
-
"/workflows/" + t + "/executions/" +
|
|
272
|
+
"/workflows/" + t + "/executions/" + e + "/cancel",
|
|
273
273
|
{}
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
/** Re-run an execution from a given node. mode: 'reuse_outputs' | 'fresh'. */
|
|
277
|
-
async rerun(t,
|
|
277
|
+
async rerun(t, e, s, r = "reuse_outputs") {
|
|
278
278
|
return this.httpPost(
|
|
279
|
-
"/workflows/" + t + "/executions/" +
|
|
280
|
-
{ fromNodeId:
|
|
279
|
+
"/workflows/" + t + "/executions/" + e + "/rerun",
|
|
280
|
+
{ fromNodeId: s, mode: r }
|
|
281
281
|
);
|
|
282
282
|
}
|
|
283
283
|
/** Execute a single node in isolation with the given inputs (debugging). */
|
|
284
|
-
async dryRunNode(t,
|
|
284
|
+
async dryRunNode(t, e, s = {}) {
|
|
285
285
|
return this.httpPost(
|
|
286
|
-
"/workflows/" + t + "/nodes/" +
|
|
287
|
-
{ inputs:
|
|
286
|
+
"/workflows/" + t + "/nodes/" + e + "/dry-run",
|
|
287
|
+
{ inputs: s }
|
|
288
288
|
);
|
|
289
289
|
}
|
|
290
290
|
/** Normalized action trace of an agent step (reasoning, tool calls, messages). */
|
|
291
|
-
async stepTrace(t,
|
|
291
|
+
async stepTrace(t, e, s, r, n) {
|
|
292
292
|
const { page: a, size: i } = this.normalizePageParams(r, n ?? 200);
|
|
293
293
|
return this.httpGet(
|
|
294
|
-
"/workflows/" + t + "/executions/" +
|
|
294
|
+
"/workflows/" + t + "/executions/" + e + "/steps/" + s + "/trace",
|
|
295
295
|
{ page: a, size: i }
|
|
296
296
|
);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
class
|
|
300
|
-
constructor(t,
|
|
301
|
-
super(t,
|
|
299
|
+
class k extends c {
|
|
300
|
+
constructor(t, e) {
|
|
301
|
+
super(t, e);
|
|
302
302
|
}
|
|
303
303
|
/** The project's human-task inbox. */
|
|
304
304
|
async list(t = {}) {
|
|
305
|
-
const { page:
|
|
305
|
+
const { page: e, size: s } = this.normalizePageParams(t.page, t.size ?? 50), r = { page: e, size: s };
|
|
306
306
|
return (t.status ?? "pending") && (r.status = t.status ?? "pending"), t.assignee && (r.assignee = t.assignee), t.workflowId && (r.workflowId = t.workflowId), t.executionId && (r.executionId = t.executionId), this.httpGet("/human-tasks", r);
|
|
307
307
|
}
|
|
308
308
|
/** Answer a pending human task, resuming the suspended workflow execution. */
|
|
309
|
-
async respond(t,
|
|
309
|
+
async respond(t, e, s) {
|
|
310
310
|
return this.httpPost("/human-tasks/" + t + "/respond", {
|
|
311
|
-
response:
|
|
312
|
-
respondedBy:
|
|
311
|
+
response: e,
|
|
312
|
+
respondedBy: s
|
|
313
313
|
});
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
class
|
|
317
|
-
constructor(t,
|
|
318
|
-
super(t,
|
|
316
|
+
class G extends c {
|
|
317
|
+
constructor(t, e) {
|
|
318
|
+
super(t, e);
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
/** The providers enabled on the server (e.g. the Telegram bot). */
|
|
321
|
+
async providers() {
|
|
322
|
+
return this.httpGet("/channels/providers");
|
|
323
|
+
}
|
|
324
|
+
/** The project's channels, with their setup status. */
|
|
325
|
+
async list() {
|
|
326
|
+
return this.httpGet("/channels");
|
|
327
|
+
}
|
|
328
|
+
/** One-shot deep link that links a group to the project. */
|
|
329
|
+
async createLink(t = "telegram") {
|
|
330
|
+
return this.httpPost("/channels/" + t + "/link-token");
|
|
331
|
+
}
|
|
332
|
+
async update(t, e) {
|
|
333
|
+
return this.httpPatch("/channels/" + t, e);
|
|
334
|
+
}
|
|
335
|
+
/** Re-checks the channel setup (the bot can still post in the group). */
|
|
336
|
+
async verify(t) {
|
|
337
|
+
return this.httpPost("/channels/" + t + "/verify");
|
|
338
|
+
}
|
|
339
|
+
async unlink(t) {
|
|
340
|
+
await this.httpDelete("/channels/" + t);
|
|
341
|
+
}
|
|
342
|
+
/** The caller's linked accounts. */
|
|
343
|
+
async myIdentities() {
|
|
344
|
+
return this.httpGet("/channels/identities/me");
|
|
345
|
+
}
|
|
346
|
+
/** One-shot deep link that links the caller's account. */
|
|
347
|
+
async createIdentityLink(t = "telegram") {
|
|
348
|
+
return this.httpPost("/channels/identities/" + t + "/link-token");
|
|
349
|
+
}
|
|
350
|
+
async unlinkIdentity(t = "telegram") {
|
|
351
|
+
await this.httpDelete("/channels/identities/me/" + t);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
class z extends c {
|
|
355
|
+
constructor(t, e) {
|
|
356
|
+
super(t, e);
|
|
357
|
+
}
|
|
358
|
+
async list(t, e, s, r) {
|
|
359
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
322
360
|
return t && (i.keyword = t), this.httpGet("/workflows", i);
|
|
323
361
|
}
|
|
324
362
|
async create(t) {
|
|
325
363
|
return this.httpPost("/workflows", t);
|
|
326
364
|
}
|
|
327
|
-
async update(t,
|
|
328
|
-
return
|
|
365
|
+
async update(t, e) {
|
|
366
|
+
return e.id = t, this.httpPut("/workflows/" + t, e);
|
|
329
367
|
}
|
|
330
368
|
async remove(t) {
|
|
331
369
|
await this.httpDelete("/workflows/" + t);
|
|
@@ -337,27 +375,30 @@ class k extends c {
|
|
|
337
375
|
return new f(this.getBaseUrl(), this.getAuthProvider());
|
|
338
376
|
}
|
|
339
377
|
humanTasks() {
|
|
378
|
+
return new k(this.getBaseUrl(), this.getAuthProvider());
|
|
379
|
+
}
|
|
380
|
+
channels() {
|
|
340
381
|
return new G(this.getBaseUrl(), this.getAuthProvider());
|
|
341
382
|
}
|
|
342
383
|
async listRevisions(t) {
|
|
343
384
|
return this.httpGet("/workflows/" + t + "/revisions");
|
|
344
385
|
}
|
|
345
|
-
async getRevision(t,
|
|
346
|
-
return this.httpGet("/workflows/" + t + "/revisions/" +
|
|
386
|
+
async getRevision(t, e) {
|
|
387
|
+
return this.httpGet("/workflows/" + t + "/revisions/" + e);
|
|
347
388
|
}
|
|
348
|
-
async rollback(t,
|
|
349
|
-
return this.httpPost("/workflows/" + t + "/revisions/" +
|
|
389
|
+
async rollback(t, e) {
|
|
390
|
+
return this.httpPost("/workflows/" + t + "/revisions/" + e + "/rollback", {});
|
|
350
391
|
}
|
|
351
392
|
}
|
|
352
|
-
class
|
|
353
|
-
constructor(t,
|
|
354
|
-
super(t,
|
|
393
|
+
class U extends c {
|
|
394
|
+
constructor(t, e) {
|
|
395
|
+
super(t, e);
|
|
355
396
|
}
|
|
356
|
-
async authorize(t,
|
|
357
|
-
return this.httpPost("/credentials/" + t + "/authorize",
|
|
397
|
+
async authorize(t, e) {
|
|
398
|
+
return this.httpPost("/credentials/" + t + "/authorize", e);
|
|
358
399
|
}
|
|
359
|
-
async handleOAuth2Callback(t,
|
|
360
|
-
const n = { code:
|
|
400
|
+
async handleOAuth2Callback(t, e, s, r) {
|
|
401
|
+
const n = { code: e, state: s };
|
|
361
402
|
return r && (n.scope = r), this.httpGet("/credentials/" + t + "/oauth2/callback", n);
|
|
362
403
|
}
|
|
363
404
|
async list() {
|
|
@@ -373,12 +414,12 @@ class z extends c {
|
|
|
373
414
|
await this.httpDelete("/credentials/all/" + t);
|
|
374
415
|
}
|
|
375
416
|
}
|
|
376
|
-
class
|
|
377
|
-
constructor(t,
|
|
378
|
-
super(t,
|
|
417
|
+
class x extends c {
|
|
418
|
+
constructor(t, e) {
|
|
419
|
+
super(t, e);
|
|
379
420
|
}
|
|
380
|
-
async list(t,
|
|
381
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
421
|
+
async list(t, e, s, r) {
|
|
422
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
382
423
|
return t && (i.keyword = t), this.httpGet("/features/templates", i);
|
|
383
424
|
}
|
|
384
425
|
async get(t) {
|
|
@@ -387,40 +428,40 @@ class U extends c {
|
|
|
387
428
|
async create(t) {
|
|
388
429
|
return this.httpPost("/features/templates", t);
|
|
389
430
|
}
|
|
390
|
-
async update(t,
|
|
391
|
-
return this.httpPut("/features/templates/" + t,
|
|
431
|
+
async update(t, e) {
|
|
432
|
+
return this.httpPut("/features/templates/" + t, e);
|
|
392
433
|
}
|
|
393
|
-
async patch(t,
|
|
394
|
-
return this.httpPatch("/features/templates/" + t,
|
|
434
|
+
async patch(t, e) {
|
|
435
|
+
return this.httpPatch("/features/templates/" + t, e);
|
|
395
436
|
}
|
|
396
437
|
async remove(t) {
|
|
397
438
|
await this.httpDelete("/features/templates/" + t);
|
|
398
439
|
}
|
|
399
|
-
async getMcpAvailableTools(t,
|
|
400
|
-
const
|
|
401
|
-
return this.httpPost("/features/templates/mcp/available-tools", t,
|
|
440
|
+
async getMcpAvailableTools(t, e) {
|
|
441
|
+
const s = e ? { credentialsId: e } : void 0;
|
|
442
|
+
return this.httpPost("/features/templates/mcp/available-tools", t, s);
|
|
402
443
|
}
|
|
403
444
|
}
|
|
404
|
-
class
|
|
405
|
-
constructor(t,
|
|
445
|
+
class S {
|
|
446
|
+
constructor(t, e) {
|
|
406
447
|
u(this, "baseUrl");
|
|
407
448
|
u(this, "auth");
|
|
408
|
-
this.baseUrl = t, this.auth =
|
|
449
|
+
this.baseUrl = t, this.auth = e;
|
|
409
450
|
}
|
|
410
451
|
templates() {
|
|
411
|
-
return new
|
|
452
|
+
return new x(this.baseUrl, this.auth);
|
|
412
453
|
}
|
|
413
454
|
}
|
|
414
|
-
class
|
|
415
|
-
constructor(t,
|
|
416
|
-
super(t,
|
|
455
|
+
class T extends c {
|
|
456
|
+
constructor(t, e) {
|
|
457
|
+
super(t, e);
|
|
417
458
|
}
|
|
418
|
-
async list(t,
|
|
419
|
-
const { page: r, size: n } = this.normalizePageParams(
|
|
459
|
+
async list(t, e, s) {
|
|
460
|
+
const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
|
|
420
461
|
return this.httpGet("/triggers/" + t + "/executions", a);
|
|
421
462
|
}
|
|
422
|
-
async execute(t,
|
|
423
|
-
return this.httpPost("/triggers/" + t + "/executions",
|
|
463
|
+
async execute(t, e) {
|
|
464
|
+
return this.httpPost("/triggers/" + t + "/executions", e);
|
|
424
465
|
}
|
|
425
466
|
async get(t) {
|
|
426
467
|
return this.httpGet("/triggers/executions/" + t);
|
|
@@ -429,19 +470,19 @@ class S extends c {
|
|
|
429
470
|
await this.httpDelete("/triggers/executions/" + t);
|
|
430
471
|
}
|
|
431
472
|
}
|
|
432
|
-
class
|
|
433
|
-
constructor(t,
|
|
434
|
-
super(t,
|
|
473
|
+
class A extends c {
|
|
474
|
+
constructor(t, e) {
|
|
475
|
+
super(t, e);
|
|
435
476
|
}
|
|
436
|
-
async list(t,
|
|
437
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
477
|
+
async list(t, e, s, r) {
|
|
478
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
438
479
|
return t && (i.keyword = t), this.httpGet("/triggers", i);
|
|
439
480
|
}
|
|
440
481
|
async create(t) {
|
|
441
482
|
return this.httpPost("/triggers", t);
|
|
442
483
|
}
|
|
443
|
-
async update(t,
|
|
444
|
-
return this.httpPut("/triggers/" + t,
|
|
484
|
+
async update(t, e) {
|
|
485
|
+
return this.httpPut("/triggers/" + t, e);
|
|
445
486
|
}
|
|
446
487
|
async remove(t) {
|
|
447
488
|
await this.httpDelete("/triggers/" + t);
|
|
@@ -450,15 +491,15 @@ class T extends c {
|
|
|
450
491
|
return this.httpGet("/triggers/" + t);
|
|
451
492
|
}
|
|
452
493
|
executions() {
|
|
453
|
-
return new
|
|
494
|
+
return new T(this.getBaseUrl(), this.getAuthProvider());
|
|
454
495
|
}
|
|
455
496
|
}
|
|
456
|
-
class
|
|
457
|
-
constructor(t,
|
|
458
|
-
super(t,
|
|
497
|
+
class C extends c {
|
|
498
|
+
constructor(t, e) {
|
|
499
|
+
super(t, e);
|
|
459
500
|
}
|
|
460
|
-
async list(t,
|
|
461
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
501
|
+
async list(t, e, s, r) {
|
|
502
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
|
|
462
503
|
return t && (i.keyword = t), this.httpGet("/service-prices", i);
|
|
463
504
|
}
|
|
464
505
|
async getStats(t = {}) {
|
|
@@ -470,20 +511,20 @@ class A extends c {
|
|
|
470
511
|
async create(t) {
|
|
471
512
|
return this.httpPost("/service-prices", t);
|
|
472
513
|
}
|
|
473
|
-
async update(t,
|
|
474
|
-
return this.httpPut("/service-prices/" + t,
|
|
514
|
+
async update(t, e) {
|
|
515
|
+
return this.httpPut("/service-prices/" + t, e);
|
|
475
516
|
}
|
|
476
517
|
async remove(t) {
|
|
477
518
|
await this.httpDelete("/service-prices/" + t);
|
|
478
519
|
}
|
|
479
520
|
}
|
|
480
|
-
class
|
|
481
|
-
constructor(t,
|
|
482
|
-
super(t,
|
|
521
|
+
class I extends c {
|
|
522
|
+
constructor(t, e) {
|
|
523
|
+
super(t, e);
|
|
483
524
|
}
|
|
484
|
-
async list(t,
|
|
485
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
486
|
-
return t && (i.projectId = t),
|
|
525
|
+
async list(t, e, s, r) {
|
|
526
|
+
const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
|
|
527
|
+
return t && (i.projectId = t), e && (i.keyword = e), this.httpGet("/markup-rules", i);
|
|
487
528
|
}
|
|
488
529
|
async get(t) {
|
|
489
530
|
return this.httpGet("/markup-rules/" + t);
|
|
@@ -491,20 +532,20 @@ class C extends c {
|
|
|
491
532
|
async create(t) {
|
|
492
533
|
return this.httpPost("/markup-rules", t);
|
|
493
534
|
}
|
|
494
|
-
async update(t,
|
|
495
|
-
return this.httpPut("/markup-rules/" + t,
|
|
535
|
+
async update(t, e) {
|
|
536
|
+
return this.httpPut("/markup-rules/" + t, e);
|
|
496
537
|
}
|
|
497
538
|
async remove(t) {
|
|
498
539
|
await this.httpDelete("/markup-rules/" + t);
|
|
499
540
|
}
|
|
500
541
|
}
|
|
501
|
-
class
|
|
502
|
-
constructor(t,
|
|
503
|
-
super(t,
|
|
542
|
+
class R extends c {
|
|
543
|
+
constructor(t, e) {
|
|
544
|
+
super(t, e);
|
|
504
545
|
}
|
|
505
|
-
async list(t,
|
|
506
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
507
|
-
return t && (i.projectId = t),
|
|
546
|
+
async list(t, e, s, r) {
|
|
547
|
+
const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
|
|
548
|
+
return t && (i.projectId = t), e && (i.keyword = e), this.httpGet("/providers", i);
|
|
508
549
|
}
|
|
509
550
|
async get(t) {
|
|
510
551
|
return this.httpGet("/providers/" + t);
|
|
@@ -512,8 +553,8 @@ class I extends c {
|
|
|
512
553
|
async create(t) {
|
|
513
554
|
return this.httpPost("/providers", t);
|
|
514
555
|
}
|
|
515
|
-
async update(t,
|
|
516
|
-
return this.httpPut("/providers/" + t,
|
|
556
|
+
async update(t, e) {
|
|
557
|
+
return this.httpPut("/providers/" + t, e);
|
|
517
558
|
}
|
|
518
559
|
async remove(t) {
|
|
519
560
|
await this.httpDelete("/providers/" + t);
|
|
@@ -532,13 +573,13 @@ class I extends c {
|
|
|
532
573
|
return this.httpGet("/provider-models", { provider: t });
|
|
533
574
|
}
|
|
534
575
|
}
|
|
535
|
-
class
|
|
536
|
-
constructor(t,
|
|
537
|
-
super(t,
|
|
576
|
+
class B extends c {
|
|
577
|
+
constructor(t, e) {
|
|
578
|
+
super(t, e);
|
|
538
579
|
}
|
|
539
|
-
async list(t,
|
|
580
|
+
async list(t, e, s, r, n, a) {
|
|
540
581
|
const { page: i, size: h } = this.normalizePageParams(n, a), p = { page: i, size: h };
|
|
541
|
-
return t && (p.keyword = t),
|
|
582
|
+
return t && (p.keyword = t), e && (p.status = e), s && (p.agentId = s), r && (p.userId = r), this.httpGet("/sessions", p);
|
|
542
583
|
}
|
|
543
584
|
async get(t) {
|
|
544
585
|
return this.httpGet("/sessions/" + t);
|
|
@@ -546,18 +587,18 @@ class R extends c {
|
|
|
546
587
|
async getUsage(t) {
|
|
547
588
|
return this.httpGet("/sessions/" + t + "/usage");
|
|
548
589
|
}
|
|
549
|
-
async generateMessage(t,
|
|
550
|
-
return this.httpPost("/sessions/" + t + "/messages",
|
|
590
|
+
async generateMessage(t, e) {
|
|
591
|
+
return this.httpPost("/sessions/" + t + "/messages", e);
|
|
551
592
|
}
|
|
552
|
-
async findMessages(t,
|
|
553
|
-
const { page: r, size: n } = this.normalizePageParams(
|
|
593
|
+
async findMessages(t, e, s) {
|
|
594
|
+
const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
|
|
554
595
|
return this.httpGet("/sessions/" + t + "/messages", a);
|
|
555
596
|
}
|
|
556
597
|
async remove(t) {
|
|
557
598
|
await this.httpDelete("/sessions/" + t);
|
|
558
599
|
}
|
|
559
|
-
async rename(t,
|
|
560
|
-
return this.httpPut("/sessions/" + t + "/name", { name:
|
|
600
|
+
async rename(t, e) {
|
|
601
|
+
return this.httpPut("/sessions/" + t + "/name", { name: e });
|
|
561
602
|
}
|
|
562
603
|
// ─── Agent Execution Lifecycle ────────────────────────────────
|
|
563
604
|
/**
|
|
@@ -578,19 +619,19 @@ class R extends c {
|
|
|
578
619
|
/**
|
|
579
620
|
* Steer a running agent execution by injecting an instruction.
|
|
580
621
|
*/
|
|
581
|
-
async steerExecution(t,
|
|
622
|
+
async steerExecution(t, e) {
|
|
582
623
|
return this.httpPost(
|
|
583
624
|
"/sessions/" + encodeURIComponent(t) + "/steer",
|
|
584
|
-
{ text:
|
|
625
|
+
{ text: e }
|
|
585
626
|
);
|
|
586
627
|
}
|
|
587
628
|
}
|
|
588
629
|
class E extends c {
|
|
589
|
-
constructor(t,
|
|
590
|
-
super(t,
|
|
630
|
+
constructor(t, e) {
|
|
631
|
+
super(t, e);
|
|
591
632
|
}
|
|
592
|
-
async list(t,
|
|
593
|
-
const { page: n, size: a } = this.normalizePageParams(
|
|
633
|
+
async list(t, e, s, r) {
|
|
634
|
+
const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a };
|
|
594
635
|
return t && (i.keyword = t), r && (i.status = r), this.httpGet("/missions", i);
|
|
595
636
|
}
|
|
596
637
|
async get(t) {
|
|
@@ -599,8 +640,8 @@ class E extends c {
|
|
|
599
640
|
async create(t) {
|
|
600
641
|
return this.httpPost("/missions", t);
|
|
601
642
|
}
|
|
602
|
-
async update(t,
|
|
603
|
-
return this.httpPut("/missions/" + t,
|
|
643
|
+
async update(t, e) {
|
|
644
|
+
return this.httpPut("/missions/" + t, e);
|
|
604
645
|
}
|
|
605
646
|
async remove(t) {
|
|
606
647
|
await this.httpDelete("/missions/" + t);
|
|
@@ -617,8 +658,8 @@ class E extends c {
|
|
|
617
658
|
async replan(t) {
|
|
618
659
|
return this.httpPost("/missions/" + t + "/replan");
|
|
619
660
|
}
|
|
620
|
-
async sendInstruction(t,
|
|
621
|
-
return this.httpPost("/missions/" + t + "/instructions", { instruction:
|
|
661
|
+
async sendInstruction(t, e) {
|
|
662
|
+
return this.httpPost("/missions/" + t + "/instructions", { instruction: e });
|
|
622
663
|
}
|
|
623
664
|
async stop(t) {
|
|
624
665
|
return this.httpPost("/missions/" + t + "/stop");
|
|
@@ -627,21 +668,21 @@ class E extends c {
|
|
|
627
668
|
return this.httpPost("/missions/" + t + "/continue");
|
|
628
669
|
}
|
|
629
670
|
}
|
|
630
|
-
class
|
|
631
|
-
constructor(t,
|
|
671
|
+
class j {
|
|
672
|
+
constructor(t, e) {
|
|
632
673
|
u(this, "baseUrl");
|
|
633
674
|
u(this, "authProvider");
|
|
634
|
-
this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider =
|
|
675
|
+
this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider = e ?? null;
|
|
635
676
|
}
|
|
636
677
|
buildHeaders() {
|
|
637
678
|
const t = new Headers();
|
|
638
679
|
return t.set("Content-Type", "application/json"), this.authProvider && (typeof this.authProvider == "string" ? t.set("x-persona-apikey", this.authProvider) : this.authProvider.applyHeaders(t)), t;
|
|
639
680
|
}
|
|
640
|
-
async request(t,
|
|
681
|
+
async request(t, e, s) {
|
|
641
682
|
const r = await fetch(this.baseUrl + t, {
|
|
642
|
-
method:
|
|
683
|
+
method: e,
|
|
643
684
|
headers: this.buildHeaders(),
|
|
644
|
-
body:
|
|
685
|
+
body: s ? JSON.stringify(s) : void 0
|
|
645
686
|
});
|
|
646
687
|
if (!r.ok) {
|
|
647
688
|
const a = await r.text();
|
|
@@ -653,8 +694,8 @@ class B {
|
|
|
653
694
|
async createCustomer(t) {
|
|
654
695
|
return this.request("/customers", "POST", t);
|
|
655
696
|
}
|
|
656
|
-
async updateCustomer(t,
|
|
657
|
-
return this.request("/customers/" + t, "PUT",
|
|
697
|
+
async updateCustomer(t, e) {
|
|
698
|
+
return this.request("/customers/" + t, "PUT", e);
|
|
658
699
|
}
|
|
659
700
|
async getCustomer(t) {
|
|
660
701
|
return this.request("/customers/" + t, "GET");
|
|
@@ -674,26 +715,26 @@ class B {
|
|
|
674
715
|
async getProjectSubscription(t) {
|
|
675
716
|
return this.request("/projects/" + t + "/subscription", "GET");
|
|
676
717
|
}
|
|
677
|
-
async changeProjectSubscriptionPlan(t,
|
|
678
|
-
return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST",
|
|
718
|
+
async changeProjectSubscriptionPlan(t, e) {
|
|
719
|
+
return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST", e);
|
|
679
720
|
}
|
|
680
|
-
async addProjectSubscriptionCredits(t,
|
|
681
|
-
return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST",
|
|
721
|
+
async addProjectSubscriptionCredits(t, e) {
|
|
722
|
+
return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST", e);
|
|
682
723
|
}
|
|
683
|
-
async beginUpgrade(t,
|
|
684
|
-
return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST",
|
|
724
|
+
async beginUpgrade(t, e) {
|
|
725
|
+
return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST", e);
|
|
685
726
|
}
|
|
686
|
-
async downgrade(t,
|
|
687
|
-
return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST",
|
|
727
|
+
async downgrade(t, e) {
|
|
728
|
+
return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST", e);
|
|
688
729
|
}
|
|
689
|
-
async mentorize(t,
|
|
690
|
-
return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST",
|
|
730
|
+
async mentorize(t, e) {
|
|
731
|
+
return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST", e);
|
|
691
732
|
}
|
|
692
|
-
async addCredits(t,
|
|
693
|
-
return this.request("/customers/" + t + "/subscription/credits", "POST", { credits:
|
|
733
|
+
async addCredits(t, e) {
|
|
734
|
+
return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: e });
|
|
694
735
|
}
|
|
695
|
-
async useCredits(t,
|
|
696
|
-
const i = { credits:
|
|
736
|
+
async useCredits(t, e, s, r, n, a) {
|
|
737
|
+
const i = { credits: e, services: s };
|
|
697
738
|
return r && (i.referenceId = r), n !== void 0 && (i.totalCost = n), a !== void 0 && (i.totalPrice = a), this.request("/customers/" + t + "/subscription/credits", "DELETE", i);
|
|
698
739
|
}
|
|
699
740
|
async getCredits(t) {
|
|
@@ -710,31 +751,31 @@ class B {
|
|
|
710
751
|
return !1;
|
|
711
752
|
}
|
|
712
753
|
}
|
|
713
|
-
async listInvoices(t,
|
|
754
|
+
async listInvoices(t, e, s) {
|
|
714
755
|
const r = [];
|
|
715
|
-
|
|
756
|
+
e && r.push("date_from=" + e), s && r.push("date_to=" + s);
|
|
716
757
|
const n = r.length > 0 ? "?" + r.join("&") : "";
|
|
717
758
|
return this.request("/customers/" + t + "/invoices" + n, "GET");
|
|
718
759
|
}
|
|
719
760
|
async cancelSubscription(t) {
|
|
720
761
|
return this.request("/customers/" + t + "/subscription/actions/cancel", "POST", {});
|
|
721
762
|
}
|
|
722
|
-
async getUsageStats(t,
|
|
763
|
+
async getUsageStats(t, e, s, r) {
|
|
723
764
|
const n = [];
|
|
724
|
-
|
|
765
|
+
e && n.push("date_from=" + encodeURIComponent(e)), s && n.push("date_to=" + encodeURIComponent(s)), r != null && r.length && r.forEach((i) => n.push("model=" + encodeURIComponent(i)));
|
|
725
766
|
const a = n.length > 0 ? "?" + n.join("&") : "";
|
|
726
767
|
return this.request("/projects/" + t + "/subscription/usage-stats" + a, "GET");
|
|
727
768
|
}
|
|
728
|
-
async listUsages(t,
|
|
769
|
+
async listUsages(t, e, s, r, n, a, i) {
|
|
729
770
|
const h = [];
|
|
730
|
-
|
|
771
|
+
e && h.push("date_from=" + encodeURIComponent(e)), s && h.push("date_to=" + encodeURIComponent(s)), r != null && r.length && r.forEach((d) => h.push("model=" + encodeURIComponent(d))), n && h.push("session_id=" + encodeURIComponent(n)), a !== void 0 && h.push("page=" + encodeURIComponent(String(a))), i !== void 0 && h.push("size=" + encodeURIComponent(String(i)));
|
|
731
772
|
const p = h.length > 0 ? "?" + h.join("&") : "";
|
|
732
773
|
return this.request("/projects/" + t + "/subscription/usages" + p, "GET");
|
|
733
774
|
}
|
|
734
775
|
}
|
|
735
|
-
class
|
|
736
|
-
constructor(t,
|
|
737
|
-
super(t,
|
|
776
|
+
class q extends c {
|
|
777
|
+
constructor(t, e) {
|
|
778
|
+
super(t, e);
|
|
738
779
|
}
|
|
739
780
|
async get(t) {
|
|
740
781
|
return this.httpGet("/values/" + t);
|
|
@@ -791,12 +832,12 @@ class j extends c {
|
|
|
791
832
|
return this.httpGet("/values/trigger-destination-types");
|
|
792
833
|
}
|
|
793
834
|
}
|
|
794
|
-
class
|
|
795
|
-
constructor(t,
|
|
835
|
+
class D {
|
|
836
|
+
constructor(t, e, s) {
|
|
796
837
|
u(this, "baseUrl");
|
|
797
838
|
u(this, "workflowsBaseUrl");
|
|
798
839
|
u(this, "billingBaseUrl");
|
|
799
|
-
this.baseUrl = t, this.workflowsBaseUrl =
|
|
840
|
+
this.baseUrl = t, this.workflowsBaseUrl = e, this.billingBaseUrl = s || "https://persona.applica.guru/billing";
|
|
800
841
|
}
|
|
801
842
|
projects(t) {
|
|
802
843
|
return new w(this.baseUrl, t, this.billingBaseUrl);
|
|
@@ -808,40 +849,40 @@ class O {
|
|
|
808
849
|
return new v(this.baseUrl, t);
|
|
809
850
|
}
|
|
810
851
|
workflows(t) {
|
|
811
|
-
return new
|
|
852
|
+
return new z(this.workflowsBaseUrl, t);
|
|
812
853
|
}
|
|
813
854
|
credentials(t) {
|
|
814
|
-
return new
|
|
855
|
+
return new U(this.baseUrl, t);
|
|
815
856
|
}
|
|
816
857
|
features(t) {
|
|
817
|
-
return new
|
|
858
|
+
return new S(this.baseUrl, t);
|
|
818
859
|
}
|
|
819
860
|
triggers(t) {
|
|
820
|
-
return new
|
|
861
|
+
return new A(this.baseUrl, t);
|
|
821
862
|
}
|
|
822
863
|
servicePrices(t) {
|
|
823
|
-
return new
|
|
864
|
+
return new C(this.baseUrl, t);
|
|
824
865
|
}
|
|
825
866
|
markupRules(t) {
|
|
826
|
-
return new
|
|
867
|
+
return new I(this.baseUrl, t);
|
|
827
868
|
}
|
|
828
869
|
providers(t) {
|
|
829
|
-
return new
|
|
870
|
+
return new R(this.baseUrl, t);
|
|
830
871
|
}
|
|
831
872
|
sessions(t) {
|
|
832
|
-
return new
|
|
873
|
+
return new B(this.baseUrl, t);
|
|
833
874
|
}
|
|
834
875
|
missions(t) {
|
|
835
876
|
return new E(this.baseUrl, t);
|
|
836
877
|
}
|
|
837
878
|
billing(t) {
|
|
838
|
-
return new
|
|
879
|
+
return new j(this.billingBaseUrl, t);
|
|
839
880
|
}
|
|
840
881
|
values(t) {
|
|
841
|
-
return new
|
|
882
|
+
return new q(this.baseUrl, t);
|
|
842
883
|
}
|
|
843
884
|
}
|
|
844
|
-
class
|
|
885
|
+
class H {
|
|
845
886
|
constructor(t) {
|
|
846
887
|
this.token = t;
|
|
847
888
|
}
|
|
@@ -856,25 +897,26 @@ export {
|
|
|
856
897
|
P as AgentsApi,
|
|
857
898
|
l as ApiException,
|
|
858
899
|
m as ApiKeyAuthenticationProvider,
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
U as
|
|
863
|
-
x as
|
|
864
|
-
|
|
900
|
+
H as BearerTokenAuthenticationProvider,
|
|
901
|
+
j as BillingClient,
|
|
902
|
+
G as ChannelsApi,
|
|
903
|
+
U as CredentialsApi,
|
|
904
|
+
x as FeatureTemplatesApi,
|
|
905
|
+
S as FeaturesApi,
|
|
906
|
+
k as HumanTasksApi,
|
|
865
907
|
b as KnowledgeBaseDocumentsApi,
|
|
866
908
|
v as KnowledgeBasesApi,
|
|
867
|
-
|
|
909
|
+
I as MarkupRulesApi,
|
|
868
910
|
E as MissionsApi,
|
|
869
|
-
|
|
911
|
+
D as PersonaSdk,
|
|
870
912
|
w as ProjectsApi,
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
913
|
+
R as ProvidersApi,
|
|
914
|
+
C as ServicePricesApi,
|
|
915
|
+
B as SessionsApi,
|
|
916
|
+
T as TriggerExecutionsApi,
|
|
917
|
+
A as TriggersApi,
|
|
918
|
+
q as ValuesApi,
|
|
877
919
|
f as WorkflowExecutionsApi,
|
|
878
|
-
|
|
920
|
+
z as WorkflowsApi
|
|
879
921
|
};
|
|
880
922
|
//# sourceMappingURL=bundle.es.js.map
|