@ptkl/sdk 0.3.0 → 0.4.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.cjs.js +75 -18
- package/dist/index.esm.js +75 -19
- package/dist/index.umd.js +75 -18
- package/dist/package.json +1 -1
- package/dist/types/api/forge.d.ts +2 -0
- package/dist/types/api/integrations.d.ts +1 -1
- package/dist/types/api/platform.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17858,7 +17858,7 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17858
17858
|
// @ts-ignore
|
|
17859
17859
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
17860
17860
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
17861
|
-
|
|
17861
|
+
// @ts-ignore
|
|
17862
17862
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
17863
17863
|
}
|
|
17864
17864
|
if (token) {
|
|
@@ -18214,6 +18214,51 @@ class ComponentUtils extends PlatformBaseClient {
|
|
|
18214
18214
|
}
|
|
18215
18215
|
}
|
|
18216
18216
|
|
|
18217
|
+
class Thunder extends PlatformBaseClient {
|
|
18218
|
+
async read(type, filters, flag, options) {
|
|
18219
|
+
const { data } = await this.client.post("/v3/system/thunder", {
|
|
18220
|
+
type,
|
|
18221
|
+
filters,
|
|
18222
|
+
flag,
|
|
18223
|
+
options,
|
|
18224
|
+
});
|
|
18225
|
+
return data;
|
|
18226
|
+
}
|
|
18227
|
+
async write(type, filters, d, flag) {
|
|
18228
|
+
const { data } = await this.client.put("/v3/system/thunder", {
|
|
18229
|
+
type,
|
|
18230
|
+
filters,
|
|
18231
|
+
flag,
|
|
18232
|
+
data: d,
|
|
18233
|
+
});
|
|
18234
|
+
return data;
|
|
18235
|
+
}
|
|
18236
|
+
async operation(name, filters, data) {
|
|
18237
|
+
return await this.write(name, filters, data, "Operation");
|
|
18238
|
+
}
|
|
18239
|
+
async find(name, filters) {
|
|
18240
|
+
return await this.read(name, filters, "Find");
|
|
18241
|
+
}
|
|
18242
|
+
async findOne(name, filters) {
|
|
18243
|
+
return await this.read(name, filters, "FindOne");
|
|
18244
|
+
}
|
|
18245
|
+
async paginate(name, filters, options) {
|
|
18246
|
+
return await this.read(name, filters, "Paginate", options);
|
|
18247
|
+
}
|
|
18248
|
+
async upsert(name, filters, data) {
|
|
18249
|
+
return await this.write(name, filters, data, "Upsert");
|
|
18250
|
+
}
|
|
18251
|
+
async insertOne(name, data) {
|
|
18252
|
+
return await this.write(name, {}, data, "InsertOne");
|
|
18253
|
+
}
|
|
18254
|
+
async updateOne(name, filters, data) {
|
|
18255
|
+
return await this.write(name, filters, data, "UpdateOne");
|
|
18256
|
+
}
|
|
18257
|
+
async delete(name, filters) {
|
|
18258
|
+
return await this.write(name, filters, {}, "Delete");
|
|
18259
|
+
}
|
|
18260
|
+
}
|
|
18261
|
+
|
|
18217
18262
|
class Ratchet extends PlatformBaseClient {
|
|
18218
18263
|
async query(name, params) {
|
|
18219
18264
|
let res = await this.client.post('/v1/ratchet/query', {
|
|
@@ -18261,7 +18306,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
18261
18306
|
|
|
18262
18307
|
class Forge extends PlatformBaseClient {
|
|
18263
18308
|
async bundleUpload(buffer) {
|
|
18264
|
-
return await this.client.post(`/
|
|
18309
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
18265
18310
|
headers: {
|
|
18266
18311
|
'Content-Type': 'application/octet-stream',
|
|
18267
18312
|
'Content-Length': buffer.length
|
|
@@ -18269,7 +18314,13 @@ class Forge extends PlatformBaseClient {
|
|
|
18269
18314
|
});
|
|
18270
18315
|
}
|
|
18271
18316
|
async getWorkspaceApps() {
|
|
18272
|
-
return await this.client.get(`/
|
|
18317
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
18318
|
+
}
|
|
18319
|
+
async removeVersion(ref, version) {
|
|
18320
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
18321
|
+
}
|
|
18322
|
+
async list() {
|
|
18323
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
18273
18324
|
}
|
|
18274
18325
|
}
|
|
18275
18326
|
|
|
@@ -18318,6 +18369,9 @@ class Platform extends PlatformBaseClient {
|
|
|
18318
18369
|
workflow() {
|
|
18319
18370
|
return (new Workflow()).setClient(this.client);
|
|
18320
18371
|
}
|
|
18372
|
+
thunder() {
|
|
18373
|
+
return (new Thunder()).setClient(this.client);
|
|
18374
|
+
}
|
|
18321
18375
|
}
|
|
18322
18376
|
|
|
18323
18377
|
class Invoicing extends PlatformBaseClient {
|
|
@@ -18361,6 +18415,8 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18361
18415
|
// @ts-ignore
|
|
18362
18416
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
18363
18417
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
18418
|
+
// @ts-ignore
|
|
18419
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
18364
18420
|
}
|
|
18365
18421
|
if (token) {
|
|
18366
18422
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -18382,10 +18438,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18382
18438
|
|
|
18383
18439
|
class Media extends IntegrationsBaseClient {
|
|
18384
18440
|
async list(data) {
|
|
18385
|
-
return this.request('POST', 'list', { data });
|
|
18441
|
+
return this.request('POST', 'media/list', { data });
|
|
18386
18442
|
}
|
|
18387
18443
|
async libraries() {
|
|
18388
|
-
return await this.requestv1("GET", "library/list");
|
|
18444
|
+
return await this.requestv1("GET", "media/library/list");
|
|
18389
18445
|
}
|
|
18390
18446
|
async upload(payload) {
|
|
18391
18447
|
let files = payload.files;
|
|
@@ -18408,7 +18464,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18408
18464
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
18409
18465
|
if (Object.keys(payload.metadata).length > 0)
|
|
18410
18466
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
18411
|
-
return await this.request("POST", "", {
|
|
18467
|
+
return await this.request("POST", "media/upload", {
|
|
18412
18468
|
data: formData,
|
|
18413
18469
|
headers: {
|
|
18414
18470
|
'Content-Type': 'multipart/form-data'
|
|
@@ -18417,10 +18473,10 @@ class Media extends IntegrationsBaseClient {
|
|
|
18417
18473
|
}
|
|
18418
18474
|
}
|
|
18419
18475
|
async delete(data) {
|
|
18420
|
-
return this.request('POST', 'delete', data);
|
|
18476
|
+
return this.request('POST', 'media/delete', data);
|
|
18421
18477
|
}
|
|
18422
18478
|
async uploadBase64(data) {
|
|
18423
|
-
return this.request('POST',
|
|
18479
|
+
return this.request('POST', `media/upload`, {
|
|
18424
18480
|
data,
|
|
18425
18481
|
headers: {
|
|
18426
18482
|
'Content-Type': 'application/json'
|
|
@@ -18428,7 +18484,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18428
18484
|
});
|
|
18429
18485
|
}
|
|
18430
18486
|
async getMedia(lib, key, encoding) {
|
|
18431
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
18487
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
18432
18488
|
params: {
|
|
18433
18489
|
encoding
|
|
18434
18490
|
},
|
|
@@ -18436,7 +18492,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18436
18492
|
});
|
|
18437
18493
|
}
|
|
18438
18494
|
async download(lib, key) {
|
|
18439
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
18495
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
18440
18496
|
data: {
|
|
18441
18497
|
key
|
|
18442
18498
|
},
|
|
@@ -18444,13 +18500,13 @@ class Media extends IntegrationsBaseClient {
|
|
|
18444
18500
|
});
|
|
18445
18501
|
}
|
|
18446
18502
|
async getExifData(lib, key) {
|
|
18447
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
18503
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
18448
18504
|
}
|
|
18449
18505
|
async html2pdf(lib, data) {
|
|
18450
18506
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
18451
18507
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
18452
18508
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
18453
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
18509
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
18454
18510
|
data: {
|
|
18455
18511
|
output_pdf,
|
|
18456
18512
|
input_path,
|
|
@@ -18466,25 +18522,25 @@ class Media extends IntegrationsBaseClient {
|
|
|
18466
18522
|
});
|
|
18467
18523
|
}
|
|
18468
18524
|
async createDir(lib, path) {
|
|
18469
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
18525
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
18470
18526
|
}
|
|
18471
18527
|
async deleteDir(lib, path) {
|
|
18472
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
18528
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
18473
18529
|
}
|
|
18474
18530
|
async dirs(lib, data) {
|
|
18475
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
18531
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
18476
18532
|
}
|
|
18477
18533
|
async request(method, endpoint, params) {
|
|
18478
18534
|
return await this.client.request({
|
|
18479
18535
|
method: method,
|
|
18480
|
-
url: `/v2/
|
|
18536
|
+
url: `/v2/dms/${endpoint}`,
|
|
18481
18537
|
...params
|
|
18482
18538
|
});
|
|
18483
18539
|
}
|
|
18484
18540
|
async requestv1(method, endpoint, params) {
|
|
18485
18541
|
return await this.client.request({
|
|
18486
18542
|
method: method,
|
|
18487
|
-
url: `/v1/
|
|
18543
|
+
url: `/v1/dms/${endpoint}`,
|
|
18488
18544
|
...params
|
|
18489
18545
|
});
|
|
18490
18546
|
}
|
|
@@ -18541,7 +18597,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
18541
18597
|
getSerbiaUtilities() {
|
|
18542
18598
|
return this.getInterfaceOf('serbia-utilities');
|
|
18543
18599
|
}
|
|
18544
|
-
|
|
18600
|
+
getDMS() {
|
|
18545
18601
|
return this.getInterfaceOf('protokol-media');
|
|
18546
18602
|
}
|
|
18547
18603
|
getVPFR() {
|
|
@@ -18574,6 +18630,7 @@ exports.Ratchet = Ratchet;
|
|
|
18574
18630
|
exports.Roles = Roles;
|
|
18575
18631
|
exports.Sandbox = Sandbox;
|
|
18576
18632
|
exports.System = System;
|
|
18633
|
+
exports.Thunder = Thunder;
|
|
18577
18634
|
exports.Users = Users;
|
|
18578
18635
|
exports.Workflow = Workflow;
|
|
18579
18636
|
exports.default = Platform;
|
package/dist/index.esm.js
CHANGED
|
@@ -48,7 +48,7 @@ class PlatformBaseClient extends BaseClient {
|
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
50
50
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
51
|
-
|
|
51
|
+
// @ts-ignore
|
|
52
52
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
53
53
|
}
|
|
54
54
|
if (token) {
|
|
@@ -404,6 +404,51 @@ class ComponentUtils extends PlatformBaseClient {
|
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
+
class Thunder extends PlatformBaseClient {
|
|
408
|
+
async read(type, filters, flag, options) {
|
|
409
|
+
const { data } = await this.client.post("/v3/system/thunder", {
|
|
410
|
+
type,
|
|
411
|
+
filters,
|
|
412
|
+
flag,
|
|
413
|
+
options,
|
|
414
|
+
});
|
|
415
|
+
return data;
|
|
416
|
+
}
|
|
417
|
+
async write(type, filters, d, flag) {
|
|
418
|
+
const { data } = await this.client.put("/v3/system/thunder", {
|
|
419
|
+
type,
|
|
420
|
+
filters,
|
|
421
|
+
flag,
|
|
422
|
+
data: d,
|
|
423
|
+
});
|
|
424
|
+
return data;
|
|
425
|
+
}
|
|
426
|
+
async operation(name, filters, data) {
|
|
427
|
+
return await this.write(name, filters, data, "Operation");
|
|
428
|
+
}
|
|
429
|
+
async find(name, filters) {
|
|
430
|
+
return await this.read(name, filters, "Find");
|
|
431
|
+
}
|
|
432
|
+
async findOne(name, filters) {
|
|
433
|
+
return await this.read(name, filters, "FindOne");
|
|
434
|
+
}
|
|
435
|
+
async paginate(name, filters, options) {
|
|
436
|
+
return await this.read(name, filters, "Paginate", options);
|
|
437
|
+
}
|
|
438
|
+
async upsert(name, filters, data) {
|
|
439
|
+
return await this.write(name, filters, data, "Upsert");
|
|
440
|
+
}
|
|
441
|
+
async insertOne(name, data) {
|
|
442
|
+
return await this.write(name, {}, data, "InsertOne");
|
|
443
|
+
}
|
|
444
|
+
async updateOne(name, filters, data) {
|
|
445
|
+
return await this.write(name, filters, data, "UpdateOne");
|
|
446
|
+
}
|
|
447
|
+
async delete(name, filters) {
|
|
448
|
+
return await this.write(name, filters, {}, "Delete");
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
407
452
|
class Ratchet extends PlatformBaseClient {
|
|
408
453
|
async query(name, params) {
|
|
409
454
|
let res = await this.client.post('/v1/ratchet/query', {
|
|
@@ -451,7 +496,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
451
496
|
|
|
452
497
|
class Forge extends PlatformBaseClient {
|
|
453
498
|
async bundleUpload(buffer) {
|
|
454
|
-
return await this.client.post(`/
|
|
499
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
455
500
|
headers: {
|
|
456
501
|
'Content-Type': 'application/octet-stream',
|
|
457
502
|
'Content-Length': buffer.length
|
|
@@ -459,7 +504,13 @@ class Forge extends PlatformBaseClient {
|
|
|
459
504
|
});
|
|
460
505
|
}
|
|
461
506
|
async getWorkspaceApps() {
|
|
462
|
-
return await this.client.get(`/
|
|
507
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
508
|
+
}
|
|
509
|
+
async removeVersion(ref, version) {
|
|
510
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
511
|
+
}
|
|
512
|
+
async list() {
|
|
513
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
463
514
|
}
|
|
464
515
|
}
|
|
465
516
|
|
|
@@ -508,6 +559,9 @@ class Platform extends PlatformBaseClient {
|
|
|
508
559
|
workflow() {
|
|
509
560
|
return (new Workflow()).setClient(this.client);
|
|
510
561
|
}
|
|
562
|
+
thunder() {
|
|
563
|
+
return (new Thunder()).setClient(this.client);
|
|
564
|
+
}
|
|
511
565
|
}
|
|
512
566
|
|
|
513
567
|
class Invoicing extends PlatformBaseClient {
|
|
@@ -551,6 +605,8 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
551
605
|
// @ts-ignore
|
|
552
606
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
553
607
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
608
|
+
// @ts-ignore
|
|
609
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
554
610
|
}
|
|
555
611
|
if (token) {
|
|
556
612
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -572,10 +628,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
572
628
|
|
|
573
629
|
class Media extends IntegrationsBaseClient {
|
|
574
630
|
async list(data) {
|
|
575
|
-
return this.request('POST', 'list', { data });
|
|
631
|
+
return this.request('POST', 'media/list', { data });
|
|
576
632
|
}
|
|
577
633
|
async libraries() {
|
|
578
|
-
return await this.requestv1("GET", "library/list");
|
|
634
|
+
return await this.requestv1("GET", "media/library/list");
|
|
579
635
|
}
|
|
580
636
|
async upload(payload) {
|
|
581
637
|
let files = payload.files;
|
|
@@ -598,7 +654,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
598
654
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
599
655
|
if (Object.keys(payload.metadata).length > 0)
|
|
600
656
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
601
|
-
return await this.request("POST", "", {
|
|
657
|
+
return await this.request("POST", "media/upload", {
|
|
602
658
|
data: formData,
|
|
603
659
|
headers: {
|
|
604
660
|
'Content-Type': 'multipart/form-data'
|
|
@@ -607,10 +663,10 @@ class Media extends IntegrationsBaseClient {
|
|
|
607
663
|
}
|
|
608
664
|
}
|
|
609
665
|
async delete(data) {
|
|
610
|
-
return this.request('POST', 'delete', data);
|
|
666
|
+
return this.request('POST', 'media/delete', data);
|
|
611
667
|
}
|
|
612
668
|
async uploadBase64(data) {
|
|
613
|
-
return this.request('POST',
|
|
669
|
+
return this.request('POST', `media/upload`, {
|
|
614
670
|
data,
|
|
615
671
|
headers: {
|
|
616
672
|
'Content-Type': 'application/json'
|
|
@@ -618,7 +674,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
618
674
|
});
|
|
619
675
|
}
|
|
620
676
|
async getMedia(lib, key, encoding) {
|
|
621
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
677
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
622
678
|
params: {
|
|
623
679
|
encoding
|
|
624
680
|
},
|
|
@@ -626,7 +682,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
626
682
|
});
|
|
627
683
|
}
|
|
628
684
|
async download(lib, key) {
|
|
629
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
685
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
630
686
|
data: {
|
|
631
687
|
key
|
|
632
688
|
},
|
|
@@ -634,13 +690,13 @@ class Media extends IntegrationsBaseClient {
|
|
|
634
690
|
});
|
|
635
691
|
}
|
|
636
692
|
async getExifData(lib, key) {
|
|
637
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
693
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
638
694
|
}
|
|
639
695
|
async html2pdf(lib, data) {
|
|
640
696
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
641
697
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
642
698
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
643
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
699
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
644
700
|
data: {
|
|
645
701
|
output_pdf,
|
|
646
702
|
input_path,
|
|
@@ -656,25 +712,25 @@ class Media extends IntegrationsBaseClient {
|
|
|
656
712
|
});
|
|
657
713
|
}
|
|
658
714
|
async createDir(lib, path) {
|
|
659
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
715
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
660
716
|
}
|
|
661
717
|
async deleteDir(lib, path) {
|
|
662
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
718
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
663
719
|
}
|
|
664
720
|
async dirs(lib, data) {
|
|
665
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
721
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
666
722
|
}
|
|
667
723
|
async request(method, endpoint, params) {
|
|
668
724
|
return await this.client.request({
|
|
669
725
|
method: method,
|
|
670
|
-
url: `/v2/
|
|
726
|
+
url: `/v2/dms/${endpoint}`,
|
|
671
727
|
...params
|
|
672
728
|
});
|
|
673
729
|
}
|
|
674
730
|
async requestv1(method, endpoint, params) {
|
|
675
731
|
return await this.client.request({
|
|
676
732
|
method: method,
|
|
677
|
-
url: `/v1/
|
|
733
|
+
url: `/v1/dms/${endpoint}`,
|
|
678
734
|
...params
|
|
679
735
|
});
|
|
680
736
|
}
|
|
@@ -731,7 +787,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
731
787
|
getSerbiaUtilities() {
|
|
732
788
|
return this.getInterfaceOf('serbia-utilities');
|
|
733
789
|
}
|
|
734
|
-
|
|
790
|
+
getDMS() {
|
|
735
791
|
return this.getInterfaceOf('protokol-media');
|
|
736
792
|
}
|
|
737
793
|
getVPFR() {
|
|
@@ -754,4 +810,4 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
754
810
|
}
|
|
755
811
|
}
|
|
756
812
|
|
|
757
|
-
export { APIUser, Apps, Component, ComponentUtils, Functions, Integrations as Integration, Ratchet, Roles, Sandbox, System, Users, Workflow, Platform as default };
|
|
813
|
+
export { APIUser, Apps, Component, ComponentUtils, Functions, Integrations as Integration, Ratchet, Roles, Sandbox, System, Thunder, Users, Workflow, Platform as default };
|
package/dist/index.umd.js
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
// @ts-ignore
|
|
53
53
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
54
54
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
55
|
-
|
|
55
|
+
// @ts-ignore
|
|
56
56
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
57
57
|
}
|
|
58
58
|
if (token) {
|
|
@@ -408,6 +408,51 @@
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
class Thunder extends PlatformBaseClient {
|
|
412
|
+
async read(type, filters, flag, options) {
|
|
413
|
+
const { data } = await this.client.post("/v3/system/thunder", {
|
|
414
|
+
type,
|
|
415
|
+
filters,
|
|
416
|
+
flag,
|
|
417
|
+
options,
|
|
418
|
+
});
|
|
419
|
+
return data;
|
|
420
|
+
}
|
|
421
|
+
async write(type, filters, d, flag) {
|
|
422
|
+
const { data } = await this.client.put("/v3/system/thunder", {
|
|
423
|
+
type,
|
|
424
|
+
filters,
|
|
425
|
+
flag,
|
|
426
|
+
data: d,
|
|
427
|
+
});
|
|
428
|
+
return data;
|
|
429
|
+
}
|
|
430
|
+
async operation(name, filters, data) {
|
|
431
|
+
return await this.write(name, filters, data, "Operation");
|
|
432
|
+
}
|
|
433
|
+
async find(name, filters) {
|
|
434
|
+
return await this.read(name, filters, "Find");
|
|
435
|
+
}
|
|
436
|
+
async findOne(name, filters) {
|
|
437
|
+
return await this.read(name, filters, "FindOne");
|
|
438
|
+
}
|
|
439
|
+
async paginate(name, filters, options) {
|
|
440
|
+
return await this.read(name, filters, "Paginate", options);
|
|
441
|
+
}
|
|
442
|
+
async upsert(name, filters, data) {
|
|
443
|
+
return await this.write(name, filters, data, "Upsert");
|
|
444
|
+
}
|
|
445
|
+
async insertOne(name, data) {
|
|
446
|
+
return await this.write(name, {}, data, "InsertOne");
|
|
447
|
+
}
|
|
448
|
+
async updateOne(name, filters, data) {
|
|
449
|
+
return await this.write(name, filters, data, "UpdateOne");
|
|
450
|
+
}
|
|
451
|
+
async delete(name, filters) {
|
|
452
|
+
return await this.write(name, filters, {}, "Delete");
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
411
456
|
class Ratchet extends PlatformBaseClient {
|
|
412
457
|
async query(name, params) {
|
|
413
458
|
let res = await this.client.post('/v1/ratchet/query', {
|
|
@@ -455,7 +500,7 @@
|
|
|
455
500
|
|
|
456
501
|
class Forge extends PlatformBaseClient {
|
|
457
502
|
async bundleUpload(buffer) {
|
|
458
|
-
return await this.client.post(`/
|
|
503
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
459
504
|
headers: {
|
|
460
505
|
'Content-Type': 'application/octet-stream',
|
|
461
506
|
'Content-Length': buffer.length
|
|
@@ -463,7 +508,13 @@
|
|
|
463
508
|
});
|
|
464
509
|
}
|
|
465
510
|
async getWorkspaceApps() {
|
|
466
|
-
return await this.client.get(`/
|
|
511
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
512
|
+
}
|
|
513
|
+
async removeVersion(ref, version) {
|
|
514
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
515
|
+
}
|
|
516
|
+
async list() {
|
|
517
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
467
518
|
}
|
|
468
519
|
}
|
|
469
520
|
|
|
@@ -512,6 +563,9 @@
|
|
|
512
563
|
workflow() {
|
|
513
564
|
return (new Workflow()).setClient(this.client);
|
|
514
565
|
}
|
|
566
|
+
thunder() {
|
|
567
|
+
return (new Thunder()).setClient(this.client);
|
|
568
|
+
}
|
|
515
569
|
}
|
|
516
570
|
|
|
517
571
|
class Invoicing extends PlatformBaseClient {
|
|
@@ -555,6 +609,8 @@
|
|
|
555
609
|
// @ts-ignore
|
|
556
610
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
557
611
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
612
|
+
// @ts-ignore
|
|
613
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
558
614
|
}
|
|
559
615
|
if (token) {
|
|
560
616
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -576,10 +632,10 @@
|
|
|
576
632
|
|
|
577
633
|
class Media extends IntegrationsBaseClient {
|
|
578
634
|
async list(data) {
|
|
579
|
-
return this.request('POST', 'list', { data });
|
|
635
|
+
return this.request('POST', 'media/list', { data });
|
|
580
636
|
}
|
|
581
637
|
async libraries() {
|
|
582
|
-
return await this.requestv1("GET", "library/list");
|
|
638
|
+
return await this.requestv1("GET", "media/library/list");
|
|
583
639
|
}
|
|
584
640
|
async upload(payload) {
|
|
585
641
|
let files = payload.files;
|
|
@@ -602,7 +658,7 @@
|
|
|
602
658
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
603
659
|
if (Object.keys(payload.metadata).length > 0)
|
|
604
660
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
605
|
-
return await this.request("POST", "", {
|
|
661
|
+
return await this.request("POST", "media/upload", {
|
|
606
662
|
data: formData,
|
|
607
663
|
headers: {
|
|
608
664
|
'Content-Type': 'multipart/form-data'
|
|
@@ -611,10 +667,10 @@
|
|
|
611
667
|
}
|
|
612
668
|
}
|
|
613
669
|
async delete(data) {
|
|
614
|
-
return this.request('POST', 'delete', data);
|
|
670
|
+
return this.request('POST', 'media/delete', data);
|
|
615
671
|
}
|
|
616
672
|
async uploadBase64(data) {
|
|
617
|
-
return this.request('POST',
|
|
673
|
+
return this.request('POST', `media/upload`, {
|
|
618
674
|
data,
|
|
619
675
|
headers: {
|
|
620
676
|
'Content-Type': 'application/json'
|
|
@@ -622,7 +678,7 @@
|
|
|
622
678
|
});
|
|
623
679
|
}
|
|
624
680
|
async getMedia(lib, key, encoding) {
|
|
625
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
681
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
626
682
|
params: {
|
|
627
683
|
encoding
|
|
628
684
|
},
|
|
@@ -630,7 +686,7 @@
|
|
|
630
686
|
});
|
|
631
687
|
}
|
|
632
688
|
async download(lib, key) {
|
|
633
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
689
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
634
690
|
data: {
|
|
635
691
|
key
|
|
636
692
|
},
|
|
@@ -638,13 +694,13 @@
|
|
|
638
694
|
});
|
|
639
695
|
}
|
|
640
696
|
async getExifData(lib, key) {
|
|
641
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
697
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
642
698
|
}
|
|
643
699
|
async html2pdf(lib, data) {
|
|
644
700
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
645
701
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
646
702
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
647
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
703
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
648
704
|
data: {
|
|
649
705
|
output_pdf,
|
|
650
706
|
input_path,
|
|
@@ -660,25 +716,25 @@
|
|
|
660
716
|
});
|
|
661
717
|
}
|
|
662
718
|
async createDir(lib, path) {
|
|
663
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
719
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
664
720
|
}
|
|
665
721
|
async deleteDir(lib, path) {
|
|
666
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
722
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
667
723
|
}
|
|
668
724
|
async dirs(lib, data) {
|
|
669
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
725
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
670
726
|
}
|
|
671
727
|
async request(method, endpoint, params) {
|
|
672
728
|
return await this.client.request({
|
|
673
729
|
method: method,
|
|
674
|
-
url: `/v2/
|
|
730
|
+
url: `/v2/dms/${endpoint}`,
|
|
675
731
|
...params
|
|
676
732
|
});
|
|
677
733
|
}
|
|
678
734
|
async requestv1(method, endpoint, params) {
|
|
679
735
|
return await this.client.request({
|
|
680
736
|
method: method,
|
|
681
|
-
url: `/v1/
|
|
737
|
+
url: `/v1/dms/${endpoint}`,
|
|
682
738
|
...params
|
|
683
739
|
});
|
|
684
740
|
}
|
|
@@ -735,7 +791,7 @@
|
|
|
735
791
|
getSerbiaUtilities() {
|
|
736
792
|
return this.getInterfaceOf('serbia-utilities');
|
|
737
793
|
}
|
|
738
|
-
|
|
794
|
+
getDMS() {
|
|
739
795
|
return this.getInterfaceOf('protokol-media');
|
|
740
796
|
}
|
|
741
797
|
getVPFR() {
|
|
@@ -768,6 +824,7 @@
|
|
|
768
824
|
exports.Roles = Roles;
|
|
769
825
|
exports.Sandbox = Sandbox;
|
|
770
826
|
exports.System = System;
|
|
827
|
+
exports.Thunder = Thunder;
|
|
771
828
|
exports.Users = Users;
|
|
772
829
|
exports.Workflow = Workflow;
|
|
773
830
|
exports.default = Platform;
|
package/dist/package.json
CHANGED
|
@@ -2,4 +2,6 @@ import PlatformBaseClient from "./platformBaseClient";
|
|
|
2
2
|
export default class Forge extends PlatformBaseClient {
|
|
3
3
|
bundleUpload(buffer: Buffer): Promise<any>;
|
|
4
4
|
getWorkspaceApps(): Promise<any>;
|
|
5
|
+
removeVersion(ref: string, version: string): Promise<any>;
|
|
6
|
+
list(): Promise<any>;
|
|
5
7
|
}
|
|
@@ -6,6 +6,7 @@ import Users from "./users";
|
|
|
6
6
|
import Apps from "./apps";
|
|
7
7
|
import Component from "./component";
|
|
8
8
|
import ComponentUtils from "./componentUtils";
|
|
9
|
+
import Thunder from "./thunder";
|
|
9
10
|
import Ratchet from "./ratchet";
|
|
10
11
|
import Sandbox from "./sandbox";
|
|
11
12
|
import System from "./system";
|
|
@@ -27,4 +28,5 @@ export default class Platform extends PlatformBaseClient {
|
|
|
27
28
|
sandbox(): Sandbox;
|
|
28
29
|
system(): System;
|
|
29
30
|
workflow(): Workflow;
|
|
31
|
+
thunder(): Thunder;
|
|
30
32
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export { default as Roles } from './api/roles';
|
|
|
11
11
|
export { default as Apps } from './api/apps';
|
|
12
12
|
export { default as Workflow } from './api/workflow';
|
|
13
13
|
export { default as ComponentUtils } from './api/componentUtils';
|
|
14
|
+
export { default as Thunder } from './api/thunder';
|
|
14
15
|
export default Platform;
|