@ptkl/sdk 0.3.1 → 0.8.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 +31 -18
- package/dist/index.esm.js +31 -18
- package/dist/{index.umd.js → index.iife.js} +36 -24
- 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/users.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17855,10 +17855,12 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17855
17855
|
// this potentially means that it is running as dev server in local
|
|
17856
17856
|
headers['X-Project-Env'] = "dev";
|
|
17857
17857
|
}
|
|
17858
|
+
}
|
|
17859
|
+
if (window) {
|
|
17858
17860
|
// @ts-ignore
|
|
17859
17861
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
17860
17862
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
17861
|
-
|
|
17863
|
+
// @ts-ignore
|
|
17862
17864
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
17863
17865
|
}
|
|
17864
17866
|
if (token) {
|
|
@@ -17977,6 +17979,9 @@ class Users extends PlatformBaseClient {
|
|
|
17977
17979
|
async delete(uuid) {
|
|
17978
17980
|
return await this.client.delete(`/v1/project/user/${uuid}`);
|
|
17979
17981
|
}
|
|
17982
|
+
async permissions() {
|
|
17983
|
+
return await this.client.delete(`/v1/user/role/permissions`);
|
|
17984
|
+
}
|
|
17980
17985
|
}
|
|
17981
17986
|
|
|
17982
17987
|
class Apps extends PlatformBaseClient {
|
|
@@ -18306,7 +18311,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
18306
18311
|
|
|
18307
18312
|
class Forge extends PlatformBaseClient {
|
|
18308
18313
|
async bundleUpload(buffer) {
|
|
18309
|
-
return await this.client.post(`/
|
|
18314
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
18310
18315
|
headers: {
|
|
18311
18316
|
'Content-Type': 'application/octet-stream',
|
|
18312
18317
|
'Content-Length': buffer.length
|
|
@@ -18314,7 +18319,13 @@ class Forge extends PlatformBaseClient {
|
|
|
18314
18319
|
});
|
|
18315
18320
|
}
|
|
18316
18321
|
async getWorkspaceApps() {
|
|
18317
|
-
return await this.client.get(`/
|
|
18322
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
18323
|
+
}
|
|
18324
|
+
async removeVersion(ref, version) {
|
|
18325
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
18326
|
+
}
|
|
18327
|
+
async list() {
|
|
18328
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
18318
18329
|
}
|
|
18319
18330
|
}
|
|
18320
18331
|
|
|
@@ -18409,6 +18420,8 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18409
18420
|
// @ts-ignore
|
|
18410
18421
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
18411
18422
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
18423
|
+
// @ts-ignore
|
|
18424
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
18412
18425
|
}
|
|
18413
18426
|
if (token) {
|
|
18414
18427
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -18430,10 +18443,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18430
18443
|
|
|
18431
18444
|
class Media extends IntegrationsBaseClient {
|
|
18432
18445
|
async list(data) {
|
|
18433
|
-
return this.request('POST', 'list', { data });
|
|
18446
|
+
return this.request('POST', 'media/list', { data });
|
|
18434
18447
|
}
|
|
18435
18448
|
async libraries() {
|
|
18436
|
-
return await this.requestv1("GET", "library/list");
|
|
18449
|
+
return await this.requestv1("GET", "media/library/list");
|
|
18437
18450
|
}
|
|
18438
18451
|
async upload(payload) {
|
|
18439
18452
|
let files = payload.files;
|
|
@@ -18456,7 +18469,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18456
18469
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
18457
18470
|
if (Object.keys(payload.metadata).length > 0)
|
|
18458
18471
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
18459
|
-
return await this.request("POST", "", {
|
|
18472
|
+
return await this.request("POST", "media/upload", {
|
|
18460
18473
|
data: formData,
|
|
18461
18474
|
headers: {
|
|
18462
18475
|
'Content-Type': 'multipart/form-data'
|
|
@@ -18465,10 +18478,10 @@ class Media extends IntegrationsBaseClient {
|
|
|
18465
18478
|
}
|
|
18466
18479
|
}
|
|
18467
18480
|
async delete(data) {
|
|
18468
|
-
return this.request('POST', 'delete', data);
|
|
18481
|
+
return this.request('POST', 'media/delete', data);
|
|
18469
18482
|
}
|
|
18470
18483
|
async uploadBase64(data) {
|
|
18471
|
-
return this.request('POST',
|
|
18484
|
+
return this.request('POST', `media/upload`, {
|
|
18472
18485
|
data,
|
|
18473
18486
|
headers: {
|
|
18474
18487
|
'Content-Type': 'application/json'
|
|
@@ -18476,7 +18489,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18476
18489
|
});
|
|
18477
18490
|
}
|
|
18478
18491
|
async getMedia(lib, key, encoding) {
|
|
18479
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
18492
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
18480
18493
|
params: {
|
|
18481
18494
|
encoding
|
|
18482
18495
|
},
|
|
@@ -18484,7 +18497,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
18484
18497
|
});
|
|
18485
18498
|
}
|
|
18486
18499
|
async download(lib, key) {
|
|
18487
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
18500
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
18488
18501
|
data: {
|
|
18489
18502
|
key
|
|
18490
18503
|
},
|
|
@@ -18492,13 +18505,13 @@ class Media extends IntegrationsBaseClient {
|
|
|
18492
18505
|
});
|
|
18493
18506
|
}
|
|
18494
18507
|
async getExifData(lib, key) {
|
|
18495
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
18508
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
18496
18509
|
}
|
|
18497
18510
|
async html2pdf(lib, data) {
|
|
18498
18511
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
18499
18512
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
18500
18513
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
18501
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
18514
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
18502
18515
|
data: {
|
|
18503
18516
|
output_pdf,
|
|
18504
18517
|
input_path,
|
|
@@ -18514,25 +18527,25 @@ class Media extends IntegrationsBaseClient {
|
|
|
18514
18527
|
});
|
|
18515
18528
|
}
|
|
18516
18529
|
async createDir(lib, path) {
|
|
18517
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
18530
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
18518
18531
|
}
|
|
18519
18532
|
async deleteDir(lib, path) {
|
|
18520
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
18533
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
18521
18534
|
}
|
|
18522
18535
|
async dirs(lib, data) {
|
|
18523
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
18536
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
18524
18537
|
}
|
|
18525
18538
|
async request(method, endpoint, params) {
|
|
18526
18539
|
return await this.client.request({
|
|
18527
18540
|
method: method,
|
|
18528
|
-
url: `/v2/
|
|
18541
|
+
url: `/v2/dms/${endpoint}`,
|
|
18529
18542
|
...params
|
|
18530
18543
|
});
|
|
18531
18544
|
}
|
|
18532
18545
|
async requestv1(method, endpoint, params) {
|
|
18533
18546
|
return await this.client.request({
|
|
18534
18547
|
method: method,
|
|
18535
|
-
url: `/v1/
|
|
18548
|
+
url: `/v1/dms/${endpoint}`,
|
|
18536
18549
|
...params
|
|
18537
18550
|
});
|
|
18538
18551
|
}
|
|
@@ -18589,7 +18602,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
18589
18602
|
getSerbiaUtilities() {
|
|
18590
18603
|
return this.getInterfaceOf('serbia-utilities');
|
|
18591
18604
|
}
|
|
18592
|
-
|
|
18605
|
+
getDMS() {
|
|
18593
18606
|
return this.getInterfaceOf('protokol-media');
|
|
18594
18607
|
}
|
|
18595
18608
|
getVPFR() {
|
package/dist/index.esm.js
CHANGED
|
@@ -45,10 +45,12 @@ class PlatformBaseClient extends BaseClient {
|
|
|
45
45
|
// this potentially means that it is running as dev server in local
|
|
46
46
|
headers['X-Project-Env'] = "dev";
|
|
47
47
|
}
|
|
48
|
+
}
|
|
49
|
+
if (window) {
|
|
48
50
|
// @ts-ignore
|
|
49
51
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
50
52
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
51
|
-
|
|
53
|
+
// @ts-ignore
|
|
52
54
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
53
55
|
}
|
|
54
56
|
if (token) {
|
|
@@ -167,6 +169,9 @@ class Users extends PlatformBaseClient {
|
|
|
167
169
|
async delete(uuid) {
|
|
168
170
|
return await this.client.delete(`/v1/project/user/${uuid}`);
|
|
169
171
|
}
|
|
172
|
+
async permissions() {
|
|
173
|
+
return await this.client.delete(`/v1/user/role/permissions`);
|
|
174
|
+
}
|
|
170
175
|
}
|
|
171
176
|
|
|
172
177
|
class Apps extends PlatformBaseClient {
|
|
@@ -496,7 +501,7 @@ class Workflow extends PlatformBaseClient {
|
|
|
496
501
|
|
|
497
502
|
class Forge extends PlatformBaseClient {
|
|
498
503
|
async bundleUpload(buffer) {
|
|
499
|
-
return await this.client.post(`/
|
|
504
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
500
505
|
headers: {
|
|
501
506
|
'Content-Type': 'application/octet-stream',
|
|
502
507
|
'Content-Length': buffer.length
|
|
@@ -504,7 +509,13 @@ class Forge extends PlatformBaseClient {
|
|
|
504
509
|
});
|
|
505
510
|
}
|
|
506
511
|
async getWorkspaceApps() {
|
|
507
|
-
return await this.client.get(`/
|
|
512
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
513
|
+
}
|
|
514
|
+
async removeVersion(ref, version) {
|
|
515
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
516
|
+
}
|
|
517
|
+
async list() {
|
|
518
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
508
519
|
}
|
|
509
520
|
}
|
|
510
521
|
|
|
@@ -599,6 +610,8 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
599
610
|
// @ts-ignore
|
|
600
611
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
601
612
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
613
|
+
// @ts-ignore
|
|
614
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
602
615
|
}
|
|
603
616
|
if (token) {
|
|
604
617
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -620,10 +633,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
620
633
|
|
|
621
634
|
class Media extends IntegrationsBaseClient {
|
|
622
635
|
async list(data) {
|
|
623
|
-
return this.request('POST', 'list', { data });
|
|
636
|
+
return this.request('POST', 'media/list', { data });
|
|
624
637
|
}
|
|
625
638
|
async libraries() {
|
|
626
|
-
return await this.requestv1("GET", "library/list");
|
|
639
|
+
return await this.requestv1("GET", "media/library/list");
|
|
627
640
|
}
|
|
628
641
|
async upload(payload) {
|
|
629
642
|
let files = payload.files;
|
|
@@ -646,7 +659,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
646
659
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
647
660
|
if (Object.keys(payload.metadata).length > 0)
|
|
648
661
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
649
|
-
return await this.request("POST", "", {
|
|
662
|
+
return await this.request("POST", "media/upload", {
|
|
650
663
|
data: formData,
|
|
651
664
|
headers: {
|
|
652
665
|
'Content-Type': 'multipart/form-data'
|
|
@@ -655,10 +668,10 @@ class Media extends IntegrationsBaseClient {
|
|
|
655
668
|
}
|
|
656
669
|
}
|
|
657
670
|
async delete(data) {
|
|
658
|
-
return this.request('POST', 'delete', data);
|
|
671
|
+
return this.request('POST', 'media/delete', data);
|
|
659
672
|
}
|
|
660
673
|
async uploadBase64(data) {
|
|
661
|
-
return this.request('POST',
|
|
674
|
+
return this.request('POST', `media/upload`, {
|
|
662
675
|
data,
|
|
663
676
|
headers: {
|
|
664
677
|
'Content-Type': 'application/json'
|
|
@@ -666,7 +679,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
666
679
|
});
|
|
667
680
|
}
|
|
668
681
|
async getMedia(lib, key, encoding) {
|
|
669
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
682
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
670
683
|
params: {
|
|
671
684
|
encoding
|
|
672
685
|
},
|
|
@@ -674,7 +687,7 @@ class Media extends IntegrationsBaseClient {
|
|
|
674
687
|
});
|
|
675
688
|
}
|
|
676
689
|
async download(lib, key) {
|
|
677
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
690
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
678
691
|
data: {
|
|
679
692
|
key
|
|
680
693
|
},
|
|
@@ -682,13 +695,13 @@ class Media extends IntegrationsBaseClient {
|
|
|
682
695
|
});
|
|
683
696
|
}
|
|
684
697
|
async getExifData(lib, key) {
|
|
685
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
698
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
686
699
|
}
|
|
687
700
|
async html2pdf(lib, data) {
|
|
688
701
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
689
702
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
690
703
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
691
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
704
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
692
705
|
data: {
|
|
693
706
|
output_pdf,
|
|
694
707
|
input_path,
|
|
@@ -704,25 +717,25 @@ class Media extends IntegrationsBaseClient {
|
|
|
704
717
|
});
|
|
705
718
|
}
|
|
706
719
|
async createDir(lib, path) {
|
|
707
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
720
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
708
721
|
}
|
|
709
722
|
async deleteDir(lib, path) {
|
|
710
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
723
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
711
724
|
}
|
|
712
725
|
async dirs(lib, data) {
|
|
713
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
726
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
714
727
|
}
|
|
715
728
|
async request(method, endpoint, params) {
|
|
716
729
|
return await this.client.request({
|
|
717
730
|
method: method,
|
|
718
|
-
url: `/v2/
|
|
731
|
+
url: `/v2/dms/${endpoint}`,
|
|
719
732
|
...params
|
|
720
733
|
});
|
|
721
734
|
}
|
|
722
735
|
async requestv1(method, endpoint, params) {
|
|
723
736
|
return await this.client.request({
|
|
724
737
|
method: method,
|
|
725
|
-
url: `/v1/
|
|
738
|
+
url: `/v1/dms/${endpoint}`,
|
|
726
739
|
...params
|
|
727
740
|
});
|
|
728
741
|
}
|
|
@@ -779,7 +792,7 @@ class Integrations extends IntegrationsBaseClient {
|
|
|
779
792
|
getSerbiaUtilities() {
|
|
780
793
|
return this.getInterfaceOf('serbia-utilities');
|
|
781
794
|
}
|
|
782
|
-
|
|
795
|
+
getDMS() {
|
|
783
796
|
return this.getInterfaceOf('protokol-media');
|
|
784
797
|
}
|
|
785
798
|
getVPFR() {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
(function (
|
|
2
|
-
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'axios'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ProtokolSDK = {}, global.axios));
|
|
5
|
-
})(this, (function (exports, axios) { 'use strict';
|
|
1
|
+
var ProtokolSDK = (function (exports, axios) {
|
|
2
|
+
'use strict';
|
|
6
3
|
|
|
7
4
|
class BaseClient {
|
|
8
5
|
constructor(client) {
|
|
@@ -49,10 +46,12 @@
|
|
|
49
46
|
// this potentially means that it is running as dev server in local
|
|
50
47
|
headers['X-Project-Env'] = "dev";
|
|
51
48
|
}
|
|
49
|
+
}
|
|
50
|
+
if (window) {
|
|
52
51
|
// @ts-ignore
|
|
53
52
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
54
53
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
55
|
-
|
|
54
|
+
// @ts-ignore
|
|
56
55
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
57
56
|
}
|
|
58
57
|
if (token) {
|
|
@@ -171,6 +170,9 @@
|
|
|
171
170
|
async delete(uuid) {
|
|
172
171
|
return await this.client.delete(`/v1/project/user/${uuid}`);
|
|
173
172
|
}
|
|
173
|
+
async permissions() {
|
|
174
|
+
return await this.client.delete(`/v1/user/role/permissions`);
|
|
175
|
+
}
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
class Apps extends PlatformBaseClient {
|
|
@@ -500,7 +502,7 @@
|
|
|
500
502
|
|
|
501
503
|
class Forge extends PlatformBaseClient {
|
|
502
504
|
async bundleUpload(buffer) {
|
|
503
|
-
return await this.client.post(`/
|
|
505
|
+
return await this.client.post(`/luma/appservice/v1/forge/upload`, buffer, {
|
|
504
506
|
headers: {
|
|
505
507
|
'Content-Type': 'application/octet-stream',
|
|
506
508
|
'Content-Length': buffer.length
|
|
@@ -508,7 +510,13 @@
|
|
|
508
510
|
});
|
|
509
511
|
}
|
|
510
512
|
async getWorkspaceApps() {
|
|
511
|
-
return await this.client.get(`/
|
|
513
|
+
return await this.client.get(`/luma/appservice/v1/forge/workspace`);
|
|
514
|
+
}
|
|
515
|
+
async removeVersion(ref, version) {
|
|
516
|
+
return await this.client.delete(`/luma/appservice/v1/forge/${ref}/version/${version}`);
|
|
517
|
+
}
|
|
518
|
+
async list() {
|
|
519
|
+
return await this.client.get(`/luma/appservice/v1/forge`);
|
|
512
520
|
}
|
|
513
521
|
}
|
|
514
522
|
|
|
@@ -603,6 +611,8 @@
|
|
|
603
611
|
// @ts-ignore
|
|
604
612
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
605
613
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
|
614
|
+
// @ts-ignore
|
|
615
|
+
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
606
616
|
}
|
|
607
617
|
if (token) {
|
|
608
618
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -624,10 +634,10 @@
|
|
|
624
634
|
|
|
625
635
|
class Media extends IntegrationsBaseClient {
|
|
626
636
|
async list(data) {
|
|
627
|
-
return this.request('POST', 'list', { data });
|
|
637
|
+
return this.request('POST', 'media/list', { data });
|
|
628
638
|
}
|
|
629
639
|
async libraries() {
|
|
630
|
-
return await this.requestv1("GET", "library/list");
|
|
640
|
+
return await this.requestv1("GET", "media/library/list");
|
|
631
641
|
}
|
|
632
642
|
async upload(payload) {
|
|
633
643
|
let files = payload.files;
|
|
@@ -650,7 +660,7 @@
|
|
|
650
660
|
formData.append('expiresAt', new Date(payload.expiresAt).toISOString());
|
|
651
661
|
if (Object.keys(payload.metadata).length > 0)
|
|
652
662
|
formData.append('metadata', JSON.stringify(payload.metadata));
|
|
653
|
-
return await this.request("POST", "", {
|
|
663
|
+
return await this.request("POST", "media/upload", {
|
|
654
664
|
data: formData,
|
|
655
665
|
headers: {
|
|
656
666
|
'Content-Type': 'multipart/form-data'
|
|
@@ -659,10 +669,10 @@
|
|
|
659
669
|
}
|
|
660
670
|
}
|
|
661
671
|
async delete(data) {
|
|
662
|
-
return this.request('POST', 'delete', data);
|
|
672
|
+
return this.request('POST', 'media/delete', data);
|
|
663
673
|
}
|
|
664
674
|
async uploadBase64(data) {
|
|
665
|
-
return this.request('POST',
|
|
675
|
+
return this.request('POST', `media/upload`, {
|
|
666
676
|
data,
|
|
667
677
|
headers: {
|
|
668
678
|
'Content-Type': 'application/json'
|
|
@@ -670,7 +680,7 @@
|
|
|
670
680
|
});
|
|
671
681
|
}
|
|
672
682
|
async getMedia(lib, key, encoding) {
|
|
673
|
-
return this.request('GET', `library/${lib}/get/${key}`, {
|
|
683
|
+
return this.request('GET', `media/library/${lib}/get/${key}`, {
|
|
674
684
|
params: {
|
|
675
685
|
encoding
|
|
676
686
|
},
|
|
@@ -678,7 +688,7 @@
|
|
|
678
688
|
});
|
|
679
689
|
}
|
|
680
690
|
async download(lib, key) {
|
|
681
|
-
return this.request('POST', `library/${lib}/download`, {
|
|
691
|
+
return this.request('POST', `media/library/${lib}/download`, {
|
|
682
692
|
data: {
|
|
683
693
|
key
|
|
684
694
|
},
|
|
@@ -686,13 +696,13 @@
|
|
|
686
696
|
});
|
|
687
697
|
}
|
|
688
698
|
async getExifData(lib, key) {
|
|
689
|
-
return this.request('GET', `library/${lib}/exif/${key}`);
|
|
699
|
+
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
690
700
|
}
|
|
691
701
|
async html2pdf(lib, data) {
|
|
692
702
|
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
693
703
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
694
704
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
695
|
-
return this.request('POST', `library/${lib}/html2pdf`, {
|
|
705
|
+
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
696
706
|
data: {
|
|
697
707
|
output_pdf,
|
|
698
708
|
input_path,
|
|
@@ -708,25 +718,25 @@
|
|
|
708
718
|
});
|
|
709
719
|
}
|
|
710
720
|
async createDir(lib, path) {
|
|
711
|
-
return this.request('POST', `library/${lib}/dir`, { data: { path } });
|
|
721
|
+
return this.request('POST', `media/library/${lib}/dir`, { data: { path } });
|
|
712
722
|
}
|
|
713
723
|
async deleteDir(lib, path) {
|
|
714
|
-
return this.request('POST', `library/${lib}/delete/dir`, { data: { path } });
|
|
724
|
+
return this.request('POST', `media/library/${lib}/delete/dir`, { data: { path } });
|
|
715
725
|
}
|
|
716
726
|
async dirs(lib, data) {
|
|
717
|
-
return await this.request("POST", `library/${lib}/dirs`, { data });
|
|
727
|
+
return await this.request("POST", `media/library/${lib}/dirs`, { data });
|
|
718
728
|
}
|
|
719
729
|
async request(method, endpoint, params) {
|
|
720
730
|
return await this.client.request({
|
|
721
731
|
method: method,
|
|
722
|
-
url: `/v2/
|
|
732
|
+
url: `/v2/dms/${endpoint}`,
|
|
723
733
|
...params
|
|
724
734
|
});
|
|
725
735
|
}
|
|
726
736
|
async requestv1(method, endpoint, params) {
|
|
727
737
|
return await this.client.request({
|
|
728
738
|
method: method,
|
|
729
|
-
url: `/v1/
|
|
739
|
+
url: `/v1/dms/${endpoint}`,
|
|
730
740
|
...params
|
|
731
741
|
});
|
|
732
742
|
}
|
|
@@ -783,7 +793,7 @@
|
|
|
783
793
|
getSerbiaUtilities() {
|
|
784
794
|
return this.getInterfaceOf('serbia-utilities');
|
|
785
795
|
}
|
|
786
|
-
|
|
796
|
+
getDMS() {
|
|
787
797
|
return this.getInterfaceOf('protokol-media');
|
|
788
798
|
}
|
|
789
799
|
getVPFR() {
|
|
@@ -823,4 +833,6 @@
|
|
|
823
833
|
|
|
824
834
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
825
835
|
|
|
826
|
-
|
|
836
|
+
return exports;
|
|
837
|
+
|
|
838
|
+
})({}, http);
|
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
|
}
|
|
@@ -2,4 +2,5 @@ import PlatformBaseClient from "./platformBaseClient";
|
|
|
2
2
|
export default class Users extends PlatformBaseClient {
|
|
3
3
|
invite(email: string, roles: string[]): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
4
|
delete(uuid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
permissions(): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
6
|
}
|