@ptkl/sdk 0.8.2 → 0.8.3
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 +17 -4
- package/dist/index.esm.js +17 -4
- package/dist/index.iife.js +17 -4
- package/dist/package.json +1 -1
- package/dist/types/api/component.d.ts +9 -1
- package/dist/types/types/component.d.ts +4 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17856,13 +17856,11 @@ class PlatformBaseClient extends BaseClient {
|
|
|
17856
17856
|
headers['X-Project-Env'] = "dev";
|
|
17857
17857
|
}
|
|
17858
17858
|
}
|
|
17859
|
-
if (window) {
|
|
17859
|
+
if (typeof window !== "undefined") {
|
|
17860
17860
|
// @ts-ignore
|
|
17861
17861
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
17862
17862
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
17863
17863
|
// @ts-ignore
|
|
17864
|
-
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
17865
|
-
// @ts-ignore
|
|
17866
17864
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
17867
17865
|
}
|
|
17868
17866
|
if (token) {
|
|
@@ -18151,6 +18149,21 @@ class Component extends PlatformBaseClient {
|
|
|
18151
18149
|
});
|
|
18152
18150
|
return responseData;
|
|
18153
18151
|
}
|
|
18152
|
+
/**
|
|
18153
|
+
* Modify models by filters
|
|
18154
|
+
*
|
|
18155
|
+
* @param data
|
|
18156
|
+
* @param options
|
|
18157
|
+
* @returns
|
|
18158
|
+
*/
|
|
18159
|
+
async modify(filters, data, options) {
|
|
18160
|
+
const { data: responseData } = await this.client.patch(`/v3/system/component/${this.ref}/modify/model`, {
|
|
18161
|
+
filters,
|
|
18162
|
+
data,
|
|
18163
|
+
options,
|
|
18164
|
+
});
|
|
18165
|
+
return responseData;
|
|
18166
|
+
}
|
|
18154
18167
|
/**
|
|
18155
18168
|
* Concurrent update model by uuid
|
|
18156
18169
|
*
|
|
@@ -18420,7 +18433,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
18420
18433
|
headers['X-Project-Env'] = "dev";
|
|
18421
18434
|
}
|
|
18422
18435
|
}
|
|
18423
|
-
if (window) {
|
|
18436
|
+
if (typeof window !== "undefined") {
|
|
18424
18437
|
// @ts-ignore
|
|
18425
18438
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
18426
18439
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
package/dist/index.esm.js
CHANGED
|
@@ -46,13 +46,11 @@ class PlatformBaseClient extends BaseClient {
|
|
|
46
46
|
headers['X-Project-Env'] = "dev";
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
if (window) {
|
|
49
|
+
if (typeof window !== "undefined") {
|
|
50
50
|
// @ts-ignore
|
|
51
51
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
52
52
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
53
53
|
// @ts-ignore
|
|
54
|
-
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
55
|
-
// @ts-ignore
|
|
56
54
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
57
55
|
}
|
|
58
56
|
if (token) {
|
|
@@ -341,6 +339,21 @@ class Component extends PlatformBaseClient {
|
|
|
341
339
|
});
|
|
342
340
|
return responseData;
|
|
343
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Modify models by filters
|
|
344
|
+
*
|
|
345
|
+
* @param data
|
|
346
|
+
* @param options
|
|
347
|
+
* @returns
|
|
348
|
+
*/
|
|
349
|
+
async modify(filters, data, options) {
|
|
350
|
+
const { data: responseData } = await this.client.patch(`/v3/system/component/${this.ref}/modify/model`, {
|
|
351
|
+
filters,
|
|
352
|
+
data,
|
|
353
|
+
options,
|
|
354
|
+
});
|
|
355
|
+
return responseData;
|
|
356
|
+
}
|
|
344
357
|
/**
|
|
345
358
|
* Concurrent update model by uuid
|
|
346
359
|
*
|
|
@@ -610,7 +623,7 @@ class IntegrationsBaseClient extends BaseClient {
|
|
|
610
623
|
headers['X-Project-Env'] = "dev";
|
|
611
624
|
}
|
|
612
625
|
}
|
|
613
|
-
if (window) {
|
|
626
|
+
if (typeof window !== "undefined") {
|
|
614
627
|
// @ts-ignore
|
|
615
628
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
616
629
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
package/dist/index.iife.js
CHANGED
|
@@ -47,13 +47,11 @@ var ProtokolSDK = (function (exports, axios) {
|
|
|
47
47
|
headers['X-Project-Env'] = "dev";
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
if (window) {
|
|
50
|
+
if (typeof window !== "undefined") {
|
|
51
51
|
// @ts-ignore
|
|
52
52
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
53
53
|
host = (_b = __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.API_HOST) !== null && _b !== undefined ? _b : host;
|
|
54
54
|
// @ts-ignore
|
|
55
|
-
token = token !== null && token !== undefined ? token : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_API_TOKEN;
|
|
56
|
-
// @ts-ignore
|
|
57
55
|
env = env !== null && env !== undefined ? env : __global_env__ === null || __global_env__ === undefined ? undefined : __global_env__.PROJECT_ENV;
|
|
58
56
|
}
|
|
59
57
|
if (token) {
|
|
@@ -342,6 +340,21 @@ var ProtokolSDK = (function (exports, axios) {
|
|
|
342
340
|
});
|
|
343
341
|
return responseData;
|
|
344
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Modify models by filters
|
|
345
|
+
*
|
|
346
|
+
* @param data
|
|
347
|
+
* @param options
|
|
348
|
+
* @returns
|
|
349
|
+
*/
|
|
350
|
+
async modify(filters, data, options) {
|
|
351
|
+
const { data: responseData } = await this.client.patch(`/v3/system/component/${this.ref}/modify/model`, {
|
|
352
|
+
filters,
|
|
353
|
+
data,
|
|
354
|
+
options,
|
|
355
|
+
});
|
|
356
|
+
return responseData;
|
|
357
|
+
}
|
|
345
358
|
/**
|
|
346
359
|
* Concurrent update model by uuid
|
|
347
360
|
*
|
|
@@ -611,7 +624,7 @@ var ProtokolSDK = (function (exports, axios) {
|
|
|
611
624
|
headers['X-Project-Env'] = "dev";
|
|
612
625
|
}
|
|
613
626
|
}
|
|
614
|
-
if (window) {
|
|
627
|
+
if (typeof window !== "undefined") {
|
|
615
628
|
// @ts-ignore
|
|
616
629
|
const __global_env__ = window === null || window === undefined ? undefined : window.__ENV_VARIABLES__;
|
|
617
630
|
host = (_b = __global_env__.INTEGRATION_API) !== null && _b !== undefined ? _b : host;
|
package/dist/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions } from "src/types/component";
|
|
1
|
+
import { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions } from "src/types/component";
|
|
2
2
|
import PlatformBaseClient from "./platformBaseClient";
|
|
3
3
|
export default class Component extends PlatformBaseClient {
|
|
4
4
|
private ref;
|
|
@@ -62,6 +62,14 @@ export default class Component extends PlatformBaseClient {
|
|
|
62
62
|
* @returns
|
|
63
63
|
*/
|
|
64
64
|
updateMany(data: Record<string, any>[], options: UpdateOptions): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Modify models by filters
|
|
67
|
+
*
|
|
68
|
+
* @param data
|
|
69
|
+
* @param options
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
modify(filters: Record<string, any>, data: Record<string, any>, options: ModifyOptions): Promise<any>;
|
|
65
73
|
/**
|
|
66
74
|
* Concurrent update model by uuid
|
|
67
75
|
*
|
|
@@ -44,4 +44,7 @@ type Model = {
|
|
|
44
44
|
type UpdateOptions = {
|
|
45
45
|
force_update_protected_fields: boolean;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
type ModifyOptions = {
|
|
48
|
+
upsert: boolean;
|
|
49
|
+
};
|
|
50
|
+
export { FindParams, FindOptions, FindResponse, FindAdvancedParams, FindAggregateParams, Model, UpdateOptions, ModifyOptions, };
|