@ptkl/sdk 0.9.4 → 0.9.5
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 +23 -7
- package/dist/index.esm.js +23 -7
- package/dist/index.iife.js +23 -7
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17847,9 +17847,11 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17847
17847
|
var _a, _b;
|
|
17848
17848
|
let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
|
|
17849
17849
|
let headers = {};
|
|
17850
|
+
var project_uuid = null;
|
|
17850
17851
|
if (isBrowser) {
|
|
17851
|
-
|
|
17852
|
-
|
|
17852
|
+
console.log("DEBUG", sessionStorage.getItem('protokol_context'));
|
|
17853
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
17854
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
17853
17855
|
}
|
|
17854
17856
|
else {
|
|
17855
17857
|
// this potentially means that it is running as dev server in local
|
|
@@ -17863,6 +17865,7 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17863
17865
|
// @ts-ignore
|
|
17864
17866
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
17865
17867
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
17868
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
17866
17869
|
}
|
|
17867
17870
|
if (token) {
|
|
17868
17871
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -17870,6 +17873,9 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17870
17873
|
if (env) {
|
|
17871
17874
|
headers['X-Project-Env'] = env;
|
|
17872
17875
|
}
|
|
17876
|
+
if (project_uuid) {
|
|
17877
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
17878
|
+
}
|
|
17873
17879
|
const client = axios.create({
|
|
17874
17880
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io",
|
|
17875
17881
|
timeout: 15000,
|
|
@@ -18008,7 +18014,11 @@ class Apps extends PlatformBaseClient {
|
|
|
18008
18014
|
}
|
|
18009
18015
|
async upload(formData) {
|
|
18010
18016
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
18011
|
-
timeout: 60000
|
|
18017
|
+
timeout: 60000,
|
|
18018
|
+
headers: {
|
|
18019
|
+
// set form data headers
|
|
18020
|
+
'Content-Type': 'multipart/form-data'
|
|
18021
|
+
}
|
|
18012
18022
|
});
|
|
18013
18023
|
}
|
|
18014
18024
|
}
|
|
@@ -18204,7 +18214,7 @@ class Component extends PlatformBaseClient {
|
|
|
18204
18214
|
});
|
|
18205
18215
|
}
|
|
18206
18216
|
async workflow(event, input) {
|
|
18207
|
-
return await this.client.post(`/
|
|
18217
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
18208
18218
|
event,
|
|
18209
18219
|
input
|
|
18210
18220
|
});
|
|
@@ -18408,9 +18418,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18408
18418
|
var _a, _b;
|
|
18409
18419
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
18410
18420
|
let headers = {};
|
|
18421
|
+
var project_uuid = null;
|
|
18411
18422
|
if (isBrowser) {
|
|
18412
|
-
if (
|
|
18413
|
-
headers['X-Project-Env'] = (_a =
|
|
18423
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
18424
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
18414
18425
|
}
|
|
18415
18426
|
else {
|
|
18416
18427
|
// this potentially means that it is running as dev server in local
|
|
@@ -18425,6 +18436,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18425
18436
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
18426
18437
|
// @ts-ignore
|
|
18427
18438
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
18439
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
18428
18440
|
}
|
|
18429
18441
|
if (token) {
|
|
18430
18442
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -18432,6 +18444,9 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18432
18444
|
if (env) {
|
|
18433
18445
|
headers['X-Project-Env'] = env;
|
|
18434
18446
|
}
|
|
18447
|
+
if (project_uuid) {
|
|
18448
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
18449
|
+
}
|
|
18435
18450
|
const client = axios.create({
|
|
18436
18451
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
18437
18452
|
timeout: 15000,
|
|
@@ -18511,7 +18526,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
18511
18526
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
18512
18527
|
}
|
|
18513
18528
|
async html2pdf(lib, data) {
|
|
18514
|
-
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
18529
|
+
const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
|
|
18515
18530
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
18516
18531
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
18517
18532
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -18521,6 +18536,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
18521
18536
|
output_path,
|
|
18522
18537
|
input_html,
|
|
18523
18538
|
output_file_name,
|
|
18539
|
+
output_type,
|
|
18524
18540
|
data: templateData
|
|
18525
18541
|
},
|
|
18526
18542
|
headers: {
|
package/dist/index.esm.js
CHANGED
|
@@ -37,9 +37,11 @@ class PlatformBaseClient extends BaseClient {
|
|
|
37
37
|
var _a, _b;
|
|
38
38
|
let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
|
|
39
39
|
let headers = {};
|
|
40
|
+
var project_uuid = null;
|
|
40
41
|
if (isBrowser) {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
console.log("DEBUG", sessionStorage.getItem('protokol_context'));
|
|
43
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
44
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
43
45
|
}
|
|
44
46
|
else {
|
|
45
47
|
// this potentially means that it is running as dev server in local
|
|
@@ -53,6 +55,7 @@ class PlatformBaseClient extends BaseClient {
|
|
|
53
55
|
// @ts-ignore
|
|
54
56
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
55
57
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
58
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
56
59
|
}
|
|
57
60
|
if (token) {
|
|
58
61
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -60,6 +63,9 @@ class PlatformBaseClient extends BaseClient {
|
|
|
60
63
|
if (env) {
|
|
61
64
|
headers['X-Project-Env'] = env;
|
|
62
65
|
}
|
|
66
|
+
if (project_uuid) {
|
|
67
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
68
|
+
}
|
|
63
69
|
const client = axios.create({
|
|
64
70
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io",
|
|
65
71
|
timeout: 15000,
|
|
@@ -198,7 +204,11 @@ class Apps extends PlatformBaseClient {
|
|
|
198
204
|
}
|
|
199
205
|
async upload(formData) {
|
|
200
206
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
201
|
-
timeout: 60000
|
|
207
|
+
timeout: 60000,
|
|
208
|
+
headers: {
|
|
209
|
+
// set form data headers
|
|
210
|
+
'Content-Type': 'multipart/form-data'
|
|
211
|
+
}
|
|
202
212
|
});
|
|
203
213
|
}
|
|
204
214
|
}
|
|
@@ -394,7 +404,7 @@ class Component extends PlatformBaseClient {
|
|
|
394
404
|
});
|
|
395
405
|
}
|
|
396
406
|
async workflow(event, input) {
|
|
397
|
-
return await this.client.post(`/
|
|
407
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
398
408
|
event,
|
|
399
409
|
input
|
|
400
410
|
});
|
|
@@ -598,9 +608,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
598
608
|
var _a, _b;
|
|
599
609
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
600
610
|
let headers = {};
|
|
611
|
+
var project_uuid = null;
|
|
601
612
|
if (isBrowser) {
|
|
602
|
-
if (
|
|
603
|
-
headers['X-Project-Env'] = (_a =
|
|
613
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
614
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
604
615
|
}
|
|
605
616
|
else {
|
|
606
617
|
// this potentially means that it is running as dev server in local
|
|
@@ -615,6 +626,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
615
626
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
616
627
|
// @ts-ignore
|
|
617
628
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
629
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
618
630
|
}
|
|
619
631
|
if (token) {
|
|
620
632
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -622,6 +634,9 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
622
634
|
if (env) {
|
|
623
635
|
headers['X-Project-Env'] = env;
|
|
624
636
|
}
|
|
637
|
+
if (project_uuid) {
|
|
638
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
639
|
+
}
|
|
625
640
|
const client = axios.create({
|
|
626
641
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
627
642
|
timeout: 15000,
|
|
@@ -701,7 +716,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
701
716
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
702
717
|
}
|
|
703
718
|
async html2pdf(lib, data) {
|
|
704
|
-
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
719
|
+
const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
|
|
705
720
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
706
721
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
707
722
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -711,6 +726,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
711
726
|
output_path,
|
|
712
727
|
input_html,
|
|
713
728
|
output_file_name,
|
|
729
|
+
output_type,
|
|
714
730
|
data: templateData
|
|
715
731
|
},
|
|
716
732
|
headers: {
|
package/dist/index.iife.js
CHANGED
|
@@ -38,9 +38,11 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
38
38
|
var _a, _b;
|
|
39
39
|
let { env = null, token = null, host = null, } = options !== null && options !== undefined ? options : {};
|
|
40
40
|
let headers = {};
|
|
41
|
+
var project_uuid = null;
|
|
41
42
|
if (isBrowser) {
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
console.log("DEBUG", sessionStorage.getItem('protokol_context'));
|
|
44
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
45
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
44
46
|
}
|
|
45
47
|
else {
|
|
46
48
|
// this potentially means that it is running as dev server in local
|
|
@@ -54,6 +56,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
54
56
|
// @ts-ignore
|
|
55
57
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
56
58
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
59
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
57
60
|
}
|
|
58
61
|
if (token) {
|
|
59
62
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -61,6 +64,9 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
61
64
|
if (env) {
|
|
62
65
|
headers['X-Project-Env'] = env;
|
|
63
66
|
}
|
|
67
|
+
if (project_uuid) {
|
|
68
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
69
|
+
}
|
|
64
70
|
const client = axios.create({
|
|
65
71
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io",
|
|
66
72
|
timeout: 15000,
|
|
@@ -199,7 +205,11 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
199
205
|
}
|
|
200
206
|
async upload(formData) {
|
|
201
207
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
202
|
-
timeout: 60000
|
|
208
|
+
timeout: 60000,
|
|
209
|
+
headers: {
|
|
210
|
+
// set form data headers
|
|
211
|
+
'Content-Type': 'multipart/form-data'
|
|
212
|
+
}
|
|
203
213
|
});
|
|
204
214
|
}
|
|
205
215
|
}
|
|
@@ -395,7 +405,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
395
405
|
});
|
|
396
406
|
}
|
|
397
407
|
async workflow(event, input) {
|
|
398
|
-
return await this.client.post(`/
|
|
408
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
399
409
|
event,
|
|
400
410
|
input
|
|
401
411
|
});
|
|
@@ -599,9 +609,10 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
599
609
|
var _a, _b;
|
|
600
610
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
601
611
|
let headers = {};
|
|
612
|
+
var project_uuid = null;
|
|
602
613
|
if (isBrowser) {
|
|
603
|
-
if (
|
|
604
|
-
headers['X-Project-Env'] = (_a =
|
|
614
|
+
if (sessionStorage.getItem('protokol_context') == "forge") {
|
|
615
|
+
headers['X-Project-Env'] = (_a = sessionStorage.getItem('forge_app_env')) !== null && _a !== undefined ? _a : "dev";
|
|
605
616
|
}
|
|
606
617
|
else {
|
|
607
618
|
// this potentially means that it is running as dev server in local
|
|
@@ -616,6 +627,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
616
627
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
617
628
|
// @ts-ignore
|
|
618
629
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
630
|
+
project_uuid = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_UUID;
|
|
619
631
|
}
|
|
620
632
|
if (token) {
|
|
621
633
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -623,6 +635,9 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
623
635
|
if (env) {
|
|
624
636
|
headers['X-Project-Env'] = env;
|
|
625
637
|
}
|
|
638
|
+
if (project_uuid) {
|
|
639
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
640
|
+
}
|
|
626
641
|
const client = axios.create({
|
|
627
642
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
628
643
|
timeout: 15000,
|
|
@@ -702,7 +717,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
702
717
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
703
718
|
}
|
|
704
719
|
async html2pdf(lib, data) {
|
|
705
|
-
const { output_pdf = false, input_path, input_html, output_path, output_file_name, data: templateData } = data;
|
|
720
|
+
const { output_pdf = false, input_path, input_html, output_path, output_file_name, output_type, data: templateData } = data;
|
|
706
721
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
707
722
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
708
723
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -712,6 +727,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
712
727
|
output_path,
|
|
713
728
|
input_html,
|
|
714
729
|
output_file_name,
|
|
730
|
+
output_type,
|
|
715
731
|
data: templateData
|
|
716
732
|
},
|
|
717
733
|
headers: {
|
package/dist/package.json
CHANGED