@lowdefy/operators 3.22.0 → 4.0.0-alpha.1
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/common/and.js +8 -24
- package/dist/common/args.js +10 -31
- package/dist/common/array.js +244 -153
- package/dist/common/change_case.js +114 -160
- package/dist/common/date.js +33 -54
- package/dist/common/divide.js +16 -36
- package/dist/common/eq.js +10 -28
- package/dist/common/function.js +27 -59
- package/dist/common/get.js +21 -46
- package/dist/common/gt.js +10 -28
- package/dist/common/gte.js +10 -28
- package/dist/common/if.js +9 -26
- package/dist/common/if_none.js +13 -32
- package/dist/common/index.js +39 -53
- package/dist/common/json.js +53 -57
- package/dist/common/log.js +5 -18
- package/dist/common/lt.js +10 -28
- package/dist/common/lte.js +10 -28
- package/dist/common/math.js +255 -194
- package/dist/common/mql.js +93 -102
- package/dist/common/ne.js +10 -28
- package/dist/common/not.js +3 -16
- package/dist/common/number.js +130 -108
- package/dist/common/nunjucks.js +24 -44
- package/dist/common/object.js +89 -98
- package/dist/common/operator.js +33 -44
- package/dist/common/or.js +8 -24
- package/dist/common/product.js +11 -29
- package/dist/common/random.js +74 -109
- package/dist/common/regex.js +26 -49
- package/dist/common/string.js +270 -171
- package/dist/common/subtract.js +13 -32
- package/dist/common/sum.js +11 -29
- package/dist/common/switch.js +30 -0
- package/dist/common/type.js +36 -67
- package/dist/common/uri.js +29 -46
- package/dist/common/user.js +10 -35
- package/dist/common/uuid.js +48 -59
- package/dist/common/yaml.js +56 -63
- package/dist/getFromArray.js +22 -44
- package/dist/getFromObject.js +25 -70
- package/dist/index.js +14 -20
- package/dist/node/base64.js +31 -48
- package/dist/node/diff.js +30 -47
- package/dist/node/hash.js +55 -71
- package/dist/node/index.js +6 -14
- package/dist/{web/list_contexts.js → node/payload.js} +9 -16
- package/dist/node/secret.js +32 -53
- package/dist/nodeParser.js +95 -146
- package/dist/runClass.js +57 -82
- package/dist/runInstance.js +60 -84
- package/dist/web/_index.js +25 -0
- package/dist/web/actions.js +10 -31
- package/dist/web/base64.js +29 -46
- package/dist/{common/_index.js → web/event.js} +10 -30
- package/dist/web/event_log.js +10 -35
- package/dist/web/format.js +15 -37
- package/dist/web/global.js +25 -0
- package/dist/web/index.js +17 -21
- package/dist/{common/event.js → web/input.js} +10 -31
- package/dist/web/js.js +10 -30
- package/dist/web/location.js +44 -59
- package/dist/web/media.js +46 -75
- package/dist/web/menu.js +10 -28
- package/dist/web/request.js +19 -40
- package/dist/web/request_details.js +10 -35
- package/dist/web/state.js +25 -0
- package/dist/web/url_query.js +25 -0
- package/dist/webParser.js +115 -157
- package/package.json +16 -15
- package/dist/common/global.js +0 -50
- package/dist/common/input.js +0 -50
- package/dist/common/state.js +0 -50
- package/dist/common/url_query.js +0 -50
- package/dist/getFromOtherContext.js +0 -96
package/dist/getFromObject.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("@lowdefy/helpers");
|
|
9
|
-
|
|
10
|
-
var _getFromOtherContext = _interopRequireDefault(require("./getFromOtherContext"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
1
|
/*
|
|
15
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
16
3
|
|
|
@@ -25,63 +12,31 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
13
|
See the License for the specific language governing permissions and
|
|
27
14
|
limitations under the License.
|
|
28
|
-
*/
|
|
29
|
-
function getFromObject(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
env
|
|
39
|
-
} = _ref;
|
|
40
|
-
if (params === true) params = {
|
|
41
|
-
all: true
|
|
42
|
-
};
|
|
43
|
-
if (_helpers.type.isString(params) || _helpers.type.isInt(params)) params = {
|
|
44
|
-
key: params
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
if (!_helpers.type.isObject(params)) {
|
|
48
|
-
throw new Error("Operator Error: ".concat(operator, " params must be of type string, integer, boolean or object. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (params.key === null) return (0, _helpers.get)(params, 'default', {
|
|
52
|
-
default: null,
|
|
53
|
-
copy: true
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
if (params.contextId) {
|
|
57
|
-
if (env === 'node') {
|
|
58
|
-
throw new Error("Operator Error: Accessing a context using contextId is only available in a client environment. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
15
|
+
*/ import { applyArrayIndices, get, serializer, type } from '@lowdefy/helpers';
|
|
16
|
+
function getFromObject({ params , object , arrayIndices , operator , location }) {
|
|
17
|
+
if (params === true) params = {
|
|
18
|
+
all: true
|
|
19
|
+
};
|
|
20
|
+
if (type.isString(params) || type.isInt(params)) params = {
|
|
21
|
+
key: params
|
|
22
|
+
};
|
|
23
|
+
if (!type.isObject(params)) {
|
|
24
|
+
throw new Error(`Operator Error: ${operator} params must be of type string, integer, boolean or object. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
59
25
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
26
|
+
if (params.key === null) return get(params, 'default', {
|
|
27
|
+
default: null,
|
|
28
|
+
copy: true
|
|
29
|
+
});
|
|
30
|
+
if (params.all === true) return serializer.copy(object);
|
|
31
|
+
if (!type.isString(params.key) && !type.isInt(params.key)) {
|
|
32
|
+
throw new Error(`Operator Error: ${operator}.key must be of type string or integer. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
33
|
+
}
|
|
34
|
+
return get(object, applyArrayIndices(arrayIndices, params.key), {
|
|
35
|
+
default: get(params, 'default', {
|
|
36
|
+
default: null,
|
|
37
|
+
copy: true
|
|
38
|
+
}),
|
|
39
|
+
copy: true
|
|
68
40
|
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (params.all === true) return _helpers.serializer.copy(object);
|
|
72
|
-
|
|
73
|
-
if (!_helpers.type.isString(params.key) && !_helpers.type.isInt(params.key)) {
|
|
74
|
-
throw new Error("Operator Error: ".concat(operator, ".key must be of type string or integer. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return (0, _helpers.get)(object, (0, _helpers.applyArrayIndices)(arrayIndices, params.key), {
|
|
78
|
-
default: (0, _helpers.get)(params, 'default', {
|
|
79
|
-
default: null,
|
|
80
|
-
copy: true
|
|
81
|
-
}),
|
|
82
|
-
copy: true
|
|
83
|
-
});
|
|
84
41
|
}
|
|
85
|
-
|
|
86
|
-
var _default = getFromObject;
|
|
87
|
-
exports.default = _default;
|
|
42
|
+
export default getFromObject;
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2021 Lowdefy, Inc
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "NodeParser", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _nodeParser.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "WebParser", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _webParser.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
18
7
|
|
|
19
|
-
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
9
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import NodeParser from './nodeParser.js';
|
|
16
|
+
import WebParser from './webParser.js';
|
|
17
|
+
export { NodeParser, WebParser };
|
package/dist/node/base64.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _runClass = _interopRequireDefault(require("../runClass"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
1
|
/*
|
|
13
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
14
3
|
|
|
@@ -23,47 +12,41 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
23
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
13
|
See the License for the specific language governing permissions and
|
|
25
14
|
limitations under the License.
|
|
26
|
-
*/
|
|
15
|
+
*/ import runClass from '../runClass.js';
|
|
27
16
|
function decode(input) {
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
const buff = Buffer.from(input, 'base64');
|
|
18
|
+
return buff.toString('utf8');
|
|
30
19
|
}
|
|
31
|
-
|
|
32
20
|
function encode(input) {
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
const buff = Buffer.from(input, 'utf8');
|
|
22
|
+
return buff.toString('base64');
|
|
35
23
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
decode
|
|
24
|
+
const functions = {
|
|
25
|
+
encode,
|
|
26
|
+
decode
|
|
40
27
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
28
|
+
const meta = {
|
|
29
|
+
encode: {
|
|
30
|
+
singleArg: true,
|
|
31
|
+
validTypes: [
|
|
32
|
+
'string'
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
decode: {
|
|
36
|
+
singleArg: true,
|
|
37
|
+
validTypes: [
|
|
38
|
+
'string'
|
|
39
|
+
]
|
|
40
|
+
}
|
|
50
41
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
location,
|
|
61
|
-
meta,
|
|
62
|
-
methodName,
|
|
63
|
-
operator: '_base64',
|
|
64
|
-
params
|
|
65
|
-
});
|
|
42
|
+
function _base64({ params , location , methodName }) {
|
|
43
|
+
return runClass({
|
|
44
|
+
functions,
|
|
45
|
+
location,
|
|
46
|
+
meta,
|
|
47
|
+
methodName,
|
|
48
|
+
operator: '_base64',
|
|
49
|
+
params
|
|
50
|
+
});
|
|
66
51
|
}
|
|
67
|
-
|
|
68
|
-
var _default = _base64;
|
|
69
|
-
exports.default = _default;
|
|
52
|
+
export default _base64;
|
package/dist/node/diff.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _deepDiff = require("deep-diff");
|
|
9
|
-
|
|
10
|
-
var _runClass = _interopRequireDefault(require("../runClass"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
1
|
/*
|
|
15
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
16
3
|
|
|
@@ -25,42 +12,38 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
13
|
See the License for the specific language governing permissions and
|
|
27
14
|
limitations under the License.
|
|
28
|
-
*/
|
|
15
|
+
*/ import { diff } from 'deep-diff';
|
|
16
|
+
import runClass from '../runClass.js';
|
|
29
17
|
function deep(lhs, rhs) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return result;
|
|
18
|
+
const result = diff(lhs, rhs);
|
|
19
|
+
if (!result) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
37
23
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
deep
|
|
24
|
+
const functions = {
|
|
25
|
+
deep
|
|
41
26
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
const meta = {
|
|
28
|
+
deep: {
|
|
29
|
+
namedArgs: [
|
|
30
|
+
'lhs',
|
|
31
|
+
'rhs'
|
|
32
|
+
],
|
|
33
|
+
validTypes: [
|
|
34
|
+
'object',
|
|
35
|
+
'array'
|
|
36
|
+
]
|
|
37
|
+
}
|
|
47
38
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
location,
|
|
58
|
-
meta,
|
|
59
|
-
methodName,
|
|
60
|
-
operator: '_diff',
|
|
61
|
-
params
|
|
62
|
-
});
|
|
39
|
+
function _diff({ params , location , methodName }) {
|
|
40
|
+
return runClass({
|
|
41
|
+
functions,
|
|
42
|
+
location,
|
|
43
|
+
meta,
|
|
44
|
+
methodName,
|
|
45
|
+
operator: '_diff',
|
|
46
|
+
params
|
|
47
|
+
});
|
|
63
48
|
}
|
|
64
|
-
|
|
65
|
-
var _default = _diff;
|
|
66
|
-
exports.default = _default;
|
|
49
|
+
export default _diff;
|
package/dist/node/hash.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _crypto = _interopRequireDefault(require("crypto"));
|
|
9
|
-
|
|
10
|
-
var _runClass = _interopRequireDefault(require("../runClass"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
1
|
/*
|
|
15
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
16
3
|
|
|
@@ -25,76 +12,73 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
25
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
13
|
See the License for the specific language governing permissions and
|
|
27
14
|
limitations under the License.
|
|
28
|
-
*/
|
|
15
|
+
*/ import crypto from 'crypto';
|
|
16
|
+
import runClass from '../runClass.js';
|
|
29
17
|
function hash(algorithm, data) {
|
|
30
|
-
|
|
18
|
+
return crypto.createHash(algorithm).update(data).digest('hex');
|
|
31
19
|
}
|
|
32
|
-
|
|
33
20
|
function md5(data) {
|
|
34
|
-
|
|
21
|
+
return hash('md5', data);
|
|
35
22
|
}
|
|
36
|
-
|
|
37
23
|
function sha1(data) {
|
|
38
|
-
|
|
24
|
+
return hash('sha1', data);
|
|
39
25
|
}
|
|
40
|
-
|
|
41
26
|
function sha256(data) {
|
|
42
|
-
|
|
27
|
+
return hash('sha256', data);
|
|
43
28
|
}
|
|
44
|
-
|
|
45
29
|
function sha512(data) {
|
|
46
|
-
|
|
30
|
+
return hash('sha512', data);
|
|
47
31
|
}
|
|
48
|
-
|
|
49
32
|
function ripemd160(data) {
|
|
50
|
-
|
|
33
|
+
return hash('ripemd160', data);
|
|
51
34
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ripemd160
|
|
35
|
+
const functions = {
|
|
36
|
+
md5,
|
|
37
|
+
sha1,
|
|
38
|
+
sha256,
|
|
39
|
+
sha512,
|
|
40
|
+
ripemd160
|
|
59
41
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
42
|
+
const meta = {
|
|
43
|
+
md5: {
|
|
44
|
+
validTypes: [
|
|
45
|
+
'string'
|
|
46
|
+
],
|
|
47
|
+
singleArg: true
|
|
48
|
+
},
|
|
49
|
+
sha1: {
|
|
50
|
+
validTypes: [
|
|
51
|
+
'string'
|
|
52
|
+
],
|
|
53
|
+
singleArg: true
|
|
54
|
+
},
|
|
55
|
+
sha256: {
|
|
56
|
+
validTypes: [
|
|
57
|
+
'string'
|
|
58
|
+
],
|
|
59
|
+
singleArg: true
|
|
60
|
+
},
|
|
61
|
+
sha512: {
|
|
62
|
+
validTypes: [
|
|
63
|
+
'string'
|
|
64
|
+
],
|
|
65
|
+
singleArg: true
|
|
66
|
+
},
|
|
67
|
+
ripemd160: {
|
|
68
|
+
validTypes: [
|
|
69
|
+
'string'
|
|
70
|
+
],
|
|
71
|
+
singleArg: true
|
|
72
|
+
}
|
|
81
73
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
location,
|
|
92
|
-
meta,
|
|
93
|
-
methodName,
|
|
94
|
-
operator: '_hash',
|
|
95
|
-
params
|
|
96
|
-
});
|
|
74
|
+
function _hash({ params , location , methodName }) {
|
|
75
|
+
return runClass({
|
|
76
|
+
functions,
|
|
77
|
+
location,
|
|
78
|
+
meta,
|
|
79
|
+
methodName,
|
|
80
|
+
operator: '_hash',
|
|
81
|
+
params
|
|
82
|
+
});
|
|
97
83
|
}
|
|
98
|
-
|
|
99
|
-
var _default = _hash;
|
|
100
|
-
exports.default = _default;
|
|
84
|
+
export default _hash;
|
package/dist/node/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
1
|
/*
|
|
9
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
10
3
|
|
|
@@ -19,11 +12,10 @@ exports.default = void 0;
|
|
|
19
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
13
|
See the License for the specific language governing permissions and
|
|
21
14
|
limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
*/ export default {
|
|
16
|
+
_base64: 'node/base64',
|
|
17
|
+
_diff: 'node/diff',
|
|
18
|
+
_hash: 'node/hash',
|
|
19
|
+
_payload: 'node/payload',
|
|
20
|
+
_secret: 'node/secret'
|
|
28
21
|
};
|
|
29
|
-
exports.default = _default;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
1
|
/*
|
|
9
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
10
3
|
|
|
@@ -19,13 +12,13 @@ exports.default = void 0;
|
|
|
19
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
13
|
See the License for the specific language governing permissions and
|
|
21
14
|
limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
*/ import getFromObject from '../getFromObject.js';
|
|
16
|
+
function _payload({ location , params , payload }) {
|
|
17
|
+
return getFromObject({
|
|
18
|
+
location,
|
|
19
|
+
object: payload,
|
|
20
|
+
operator: '_payload',
|
|
21
|
+
params
|
|
22
|
+
});
|
|
28
23
|
}
|
|
29
|
-
|
|
30
|
-
var _default = _list_contexts;
|
|
31
|
-
exports.default = _default;
|
|
24
|
+
export default _payload;
|
package/dist/node/secret.js
CHANGED
|
@@ -1,54 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (params === true || params.all) {
|
|
33
|
-
throw new Error("Operator Error: Getting all secrets is not allowed. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
34
|
-
} // Filter out OpenID Connect and JSON web token secrets
|
|
35
|
-
// eslint-disable-next-line no-unused-vars
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var {
|
|
39
|
-
OPENID_CLIENT_SECRET,
|
|
40
|
-
JWT_SECRET
|
|
41
|
-
} = secrets,
|
|
42
|
-
rest = _objectWithoutProperties(secrets, _excluded);
|
|
43
|
-
|
|
44
|
-
return (0, _getFromObject.default)({
|
|
45
|
-
env,
|
|
46
|
-
location,
|
|
47
|
-
object: _objectSpread({}, rest),
|
|
48
|
-
operator: '_secret',
|
|
49
|
-
params
|
|
50
|
-
});
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import getFromObject from '../getFromObject.js';
|
|
16
|
+
function _secret({ location , params , secrets ={
|
|
17
|
+
} }) {
|
|
18
|
+
if (params === true || params.all) {
|
|
19
|
+
throw new Error(`Operator Error: Getting all secrets is not allowed. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
20
|
+
}
|
|
21
|
+
// Filter out OpenID Connect and JSON web token secrets
|
|
22
|
+
// eslint-disable-next-line no-unused-vars
|
|
23
|
+
const { OPENID_CLIENT_SECRET , JWT_SECRET , ...rest } = secrets;
|
|
24
|
+
return getFromObject({
|
|
25
|
+
location,
|
|
26
|
+
object: {
|
|
27
|
+
...rest
|
|
28
|
+
},
|
|
29
|
+
operator: '_secret',
|
|
30
|
+
params
|
|
31
|
+
});
|
|
51
32
|
}
|
|
52
|
-
|
|
53
|
-
var _default = _secret;
|
|
54
|
-
exports.default = _default;
|
|
33
|
+
export default _secret;
|