@ptkl/sdk 0.9.3 → 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 +32 -10
- package/dist/index.esm.js +32 -10
- package/dist/index.iife.js +32 -10
- package/dist/package.json +1 -1
- package/dist/types/api/functions.d.ts +4 -4
- package/dist/types/api/roles.d.ts +2 -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,11 +17873,15 @@ 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,
|
|
17876
17882
|
headers: {
|
|
17877
17883
|
...headers,
|
|
17884
|
+
'Content-Type': 'application/json',
|
|
17878
17885
|
},
|
|
17879
17886
|
withCredentials: true,
|
|
17880
17887
|
});
|
|
@@ -17904,7 +17911,7 @@ class Functions extends PlatformBaseClient {
|
|
|
17904
17911
|
* @returns - Function result
|
|
17905
17912
|
*
|
|
17906
17913
|
* @example
|
|
17907
|
-
* const result = await platform.function().run("myFunction", {
|
|
17914
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
17908
17915
|
*/
|
|
17909
17916
|
async run(id, d) {
|
|
17910
17917
|
const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
|
|
@@ -17928,9 +17935,12 @@ class Roles extends PlatformBaseClient {
|
|
|
17928
17935
|
async list() {
|
|
17929
17936
|
return await this.client.get(`/v1/user/role/list`);
|
|
17930
17937
|
}
|
|
17931
|
-
async
|
|
17938
|
+
async availablePermissions() {
|
|
17932
17939
|
return await this.client.get(`/v1/user/permissions/list`);
|
|
17933
17940
|
}
|
|
17941
|
+
async permissions() {
|
|
17942
|
+
return await this.client.get(`/v1/user/role/permissions`);
|
|
17943
|
+
}
|
|
17934
17944
|
async edit(permissions, workspaces, level, uuid) {
|
|
17935
17945
|
return await this.client.post(`/v1/user/role/edit/${uuid}`, { permissions, workspaces, level });
|
|
17936
17946
|
}
|
|
@@ -18004,7 +18014,11 @@ class Apps extends PlatformBaseClient {
|
|
|
18004
18014
|
}
|
|
18005
18015
|
async upload(formData) {
|
|
18006
18016
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
18007
|
-
timeout: 60000
|
|
18017
|
+
timeout: 60000,
|
|
18018
|
+
headers: {
|
|
18019
|
+
// set form data headers
|
|
18020
|
+
'Content-Type': 'multipart/form-data'
|
|
18021
|
+
}
|
|
18008
18022
|
});
|
|
18009
18023
|
}
|
|
18010
18024
|
}
|
|
@@ -18200,13 +18214,15 @@ class Component extends PlatformBaseClient {
|
|
|
18200
18214
|
});
|
|
18201
18215
|
}
|
|
18202
18216
|
async workflow(event, input) {
|
|
18203
|
-
return await this.client.post(`/
|
|
18217
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
18204
18218
|
event,
|
|
18205
18219
|
input
|
|
18206
18220
|
});
|
|
18207
18221
|
}
|
|
18208
18222
|
async function(name, input) {
|
|
18209
|
-
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`,
|
|
18223
|
+
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`, {
|
|
18224
|
+
data: input
|
|
18225
|
+
});
|
|
18210
18226
|
}
|
|
18211
18227
|
}
|
|
18212
18228
|
|
|
@@ -18402,9 +18418,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18402
18418
|
var _a, _b;
|
|
18403
18419
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
18404
18420
|
let headers = {};
|
|
18421
|
+
var project_uuid = null;
|
|
18405
18422
|
if (isBrowser) {
|
|
18406
|
-
if (
|
|
18407
|
-
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";
|
|
18408
18425
|
}
|
|
18409
18426
|
else {
|
|
18410
18427
|
// this potentially means that it is running as dev server in local
|
|
@@ -18419,6 +18436,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18419
18436
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
18420
18437
|
// @ts-ignore
|
|
18421
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;
|
|
18422
18440
|
}
|
|
18423
18441
|
if (token) {
|
|
18424
18442
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -18426,6 +18444,9 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18426
18444
|
if (env) {
|
|
18427
18445
|
headers['X-Project-Env'] = env;
|
|
18428
18446
|
}
|
|
18447
|
+
if (project_uuid) {
|
|
18448
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
18449
|
+
}
|
|
18429
18450
|
const client = axios.create({
|
|
18430
18451
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
18431
18452
|
timeout: 15000,
|
|
@@ -18505,7 +18526,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
18505
18526
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
18506
18527
|
}
|
|
18507
18528
|
async html2pdf(lib, data) {
|
|
18508
|
-
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;
|
|
18509
18530
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
18510
18531
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
18511
18532
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -18515,6 +18536,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
18515
18536
|
output_path,
|
|
18516
18537
|
input_html,
|
|
18517
18538
|
output_file_name,
|
|
18539
|
+
output_type,
|
|
18518
18540
|
data: templateData
|
|
18519
18541
|
},
|
|
18520
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,11 +63,15 @@ 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,
|
|
66
72
|
headers: {
|
|
67
73
|
...headers,
|
|
74
|
+
'Content-Type': 'application/json',
|
|
68
75
|
},
|
|
69
76
|
withCredentials: true,
|
|
70
77
|
});
|
|
@@ -94,7 +101,7 @@ class Functions extends PlatformBaseClient {
|
|
|
94
101
|
* @returns - Function result
|
|
95
102
|
*
|
|
96
103
|
* @example
|
|
97
|
-
* const result = await platform.function().run("myFunction", {
|
|
104
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
98
105
|
*/
|
|
99
106
|
async run(id, d) {
|
|
100
107
|
const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
|
|
@@ -118,9 +125,12 @@ class Roles extends PlatformBaseClient {
|
|
|
118
125
|
async list() {
|
|
119
126
|
return await this.client.get(`/v1/user/role/list`);
|
|
120
127
|
}
|
|
121
|
-
async
|
|
128
|
+
async availablePermissions() {
|
|
122
129
|
return await this.client.get(`/v1/user/permissions/list`);
|
|
123
130
|
}
|
|
131
|
+
async permissions() {
|
|
132
|
+
return await this.client.get(`/v1/user/role/permissions`);
|
|
133
|
+
}
|
|
124
134
|
async edit(permissions, workspaces, level, uuid) {
|
|
125
135
|
return await this.client.post(`/v1/user/role/edit/${uuid}`, { permissions, workspaces, level });
|
|
126
136
|
}
|
|
@@ -194,7 +204,11 @@ class Apps extends PlatformBaseClient {
|
|
|
194
204
|
}
|
|
195
205
|
async upload(formData) {
|
|
196
206
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
197
|
-
timeout: 60000
|
|
207
|
+
timeout: 60000,
|
|
208
|
+
headers: {
|
|
209
|
+
// set form data headers
|
|
210
|
+
'Content-Type': 'multipart/form-data'
|
|
211
|
+
}
|
|
198
212
|
});
|
|
199
213
|
}
|
|
200
214
|
}
|
|
@@ -390,13 +404,15 @@ class Component extends PlatformBaseClient {
|
|
|
390
404
|
});
|
|
391
405
|
}
|
|
392
406
|
async workflow(event, input) {
|
|
393
|
-
return await this.client.post(`/
|
|
407
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
394
408
|
event,
|
|
395
409
|
input
|
|
396
410
|
});
|
|
397
411
|
}
|
|
398
412
|
async function(name, input) {
|
|
399
|
-
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`,
|
|
413
|
+
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`, {
|
|
414
|
+
data: input
|
|
415
|
+
});
|
|
400
416
|
}
|
|
401
417
|
}
|
|
402
418
|
|
|
@@ -592,9 +608,10 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
592
608
|
var _a, _b;
|
|
593
609
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
594
610
|
let headers = {};
|
|
611
|
+
var project_uuid = null;
|
|
595
612
|
if (isBrowser) {
|
|
596
|
-
if (
|
|
597
|
-
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";
|
|
598
615
|
}
|
|
599
616
|
else {
|
|
600
617
|
// this potentially means that it is running as dev server in local
|
|
@@ -609,6 +626,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
609
626
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
610
627
|
// @ts-ignore
|
|
611
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;
|
|
612
630
|
}
|
|
613
631
|
if (token) {
|
|
614
632
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -616,6 +634,9 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
616
634
|
if (env) {
|
|
617
635
|
headers['X-Project-Env'] = env;
|
|
618
636
|
}
|
|
637
|
+
if (project_uuid) {
|
|
638
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
639
|
+
}
|
|
619
640
|
const client = axios.create({
|
|
620
641
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
621
642
|
timeout: 15000,
|
|
@@ -695,7 +716,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
695
716
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
696
717
|
}
|
|
697
718
|
async html2pdf(lib, data) {
|
|
698
|
-
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;
|
|
699
720
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
700
721
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
701
722
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -705,6 +726,7 @@ class DMS extends IntegrationsBaseClient {
|
|
|
705
726
|
output_path,
|
|
706
727
|
input_html,
|
|
707
728
|
output_file_name,
|
|
729
|
+
output_type,
|
|
708
730
|
data: templateData
|
|
709
731
|
},
|
|
710
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,11 +64,15 @@ 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,
|
|
67
73
|
headers: {
|
|
68
74
|
...headers,
|
|
75
|
+
'Content-Type': 'application/json',
|
|
69
76
|
},
|
|
70
77
|
withCredentials: true,
|
|
71
78
|
});
|
|
@@ -95,7 +102,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
95
102
|
* @returns - Function result
|
|
96
103
|
*
|
|
97
104
|
* @example
|
|
98
|
-
* const result = await platform.function().run("myFunction", {
|
|
105
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
99
106
|
*/
|
|
100
107
|
async run(id, d) {
|
|
101
108
|
const { data } = await this.client.post(`/v1/system/function/run/${id}`, d.input, {
|
|
@@ -119,9 +126,12 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
119
126
|
async list() {
|
|
120
127
|
return await this.client.get(`/v1/user/role/list`);
|
|
121
128
|
}
|
|
122
|
-
async
|
|
129
|
+
async availablePermissions() {
|
|
123
130
|
return await this.client.get(`/v1/user/permissions/list`);
|
|
124
131
|
}
|
|
132
|
+
async permissions() {
|
|
133
|
+
return await this.client.get(`/v1/user/role/permissions`);
|
|
134
|
+
}
|
|
125
135
|
async edit(permissions, workspaces, level, uuid) {
|
|
126
136
|
return await this.client.post(`/v1/user/role/edit/${uuid}`, { permissions, workspaces, level });
|
|
127
137
|
}
|
|
@@ -195,7 +205,11 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
195
205
|
}
|
|
196
206
|
async upload(formData) {
|
|
197
207
|
return await this.client.post(`/v3/system/gateway/app-service/${this.appType}/upload`, formData, {
|
|
198
|
-
timeout: 60000
|
|
208
|
+
timeout: 60000,
|
|
209
|
+
headers: {
|
|
210
|
+
// set form data headers
|
|
211
|
+
'Content-Type': 'multipart/form-data'
|
|
212
|
+
}
|
|
199
213
|
});
|
|
200
214
|
}
|
|
201
215
|
}
|
|
@@ -391,13 +405,15 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
391
405
|
});
|
|
392
406
|
}
|
|
393
407
|
async workflow(event, input) {
|
|
394
|
-
return await this.client.post(`/
|
|
408
|
+
return await this.client.post(`/v3/system/component/${this.ref}/workflow/event`, {
|
|
395
409
|
event,
|
|
396
410
|
input
|
|
397
411
|
});
|
|
398
412
|
}
|
|
399
413
|
async function(name, input) {
|
|
400
|
-
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`,
|
|
414
|
+
return await this.client.post(`/v3/system/component/${this.ref}/function/${name}`, {
|
|
415
|
+
data: input
|
|
416
|
+
});
|
|
401
417
|
}
|
|
402
418
|
}
|
|
403
419
|
|
|
@@ -593,9 +609,10 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
593
609
|
var _a, _b;
|
|
594
610
|
let { env = null, token, host, } = options !== null && options !== undefined ? options : {};
|
|
595
611
|
let headers = {};
|
|
612
|
+
var project_uuid = null;
|
|
596
613
|
if (isBrowser) {
|
|
597
|
-
if (
|
|
598
|
-
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";
|
|
599
616
|
}
|
|
600
617
|
else {
|
|
601
618
|
// this potentially means that it is running as dev server in local
|
|
@@ -610,6 +627,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
610
627
|
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
611
628
|
// @ts-ignore
|
|
612
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;
|
|
613
631
|
}
|
|
614
632
|
if (token) {
|
|
615
633
|
headers['Authorization'] = `Bearer ${token}`;
|
|
@@ -617,6 +635,9 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
617
635
|
if (env) {
|
|
618
636
|
headers['X-Project-Env'] = env;
|
|
619
637
|
}
|
|
638
|
+
if (project_uuid) {
|
|
639
|
+
headers['X-Project-Uuid'] = project_uuid;
|
|
640
|
+
}
|
|
620
641
|
const client = axios.create({
|
|
621
642
|
baseURL: host !== null && host !== undefined ? host : "https://lemon.protokol.io/luma/integrations",
|
|
622
643
|
timeout: 15000,
|
|
@@ -696,7 +717,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
696
717
|
return this.request('GET', `media/library/${lib}/exif/${key}`);
|
|
697
718
|
}
|
|
698
719
|
async html2pdf(lib, data) {
|
|
699
|
-
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;
|
|
700
721
|
const type = output_pdf ? 'arraybuffer' : 'json';
|
|
701
722
|
const contentType = output_pdf ? 'application/pdf' : 'application/json';
|
|
702
723
|
return this.request('POST', `media/library/${lib}/html2pdf`, {
|
|
@@ -706,6 +727,7 @@ var ProtokolSDK09 = (function (exports, axios) {
|
|
|
706
727
|
output_path,
|
|
707
728
|
input_html,
|
|
708
729
|
output_file_name,
|
|
730
|
+
output_type,
|
|
709
731
|
data: templateData
|
|
710
732
|
},
|
|
711
733
|
headers: {
|
package/dist/package.json
CHANGED
|
@@ -12,12 +12,12 @@ export default class Functions extends PlatformBaseClient {
|
|
|
12
12
|
* @returns - Function result
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* const result = await platform.function().run("myFunction", {
|
|
15
|
+
* const result = await platform.function().run("myFunction", {input: { foo: "bar" }})
|
|
16
16
|
*/
|
|
17
17
|
run(id: string, d: {
|
|
18
|
-
input?: any
|
|
19
|
-
query?:
|
|
20
|
-
headers?:
|
|
18
|
+
input?: Record<string, any>;
|
|
19
|
+
query?: Record<string, string>;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
21
|
}): Promise<any>;
|
|
22
22
|
generateSignature(ref: string, env: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
23
23
|
}
|
|
@@ -3,6 +3,7 @@ export default class Roles extends PlatformBaseClient {
|
|
|
3
3
|
create(role: any): Promise<any>;
|
|
4
4
|
delete(uuid: string): Promise<any>;
|
|
5
5
|
list(): Promise<any>;
|
|
6
|
-
|
|
6
|
+
availablePermissions(): Promise<any>;
|
|
7
|
+
permissions(): Promise<any>;
|
|
7
8
|
edit(permissions: string[], workspaces: string[], level: number, uuid: string): Promise<any>;
|
|
8
9
|
}
|