@lowdefy/operators 3.23.0 → 4.0.0-alpha.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/common/change_case.js +114 -160
- package/dist/common/index.js +39 -54
- package/dist/common/mql.js +93 -102
- 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 +18 -20
- package/dist/node/diff.js +30 -47
- package/dist/node/index.js +6 -14
- package/dist/nodeParser.js +83 -146
- package/dist/runClass.js +57 -82
- package/dist/runInstance.js +60 -84
- package/dist/web/format.js +15 -37
- package/dist/web/index.js +17 -21
- package/dist/web/js.js +10 -30
- package/dist/webParser.js +99 -157
- package/package.json +16 -15
- package/dist/common/_index.js +0 -45
- package/dist/common/and.js +0 -39
- package/dist/common/args.js +0 -46
- package/dist/common/array.js +0 -170
- package/dist/common/date.js +0 -75
- package/dist/common/divide.js +0 -51
- package/dist/common/eq.js +0 -43
- package/dist/common/event.js +0 -46
- package/dist/common/function.js +0 -78
- package/dist/common/get.js +0 -61
- package/dist/common/global.js +0 -50
- package/dist/common/gt.js +0 -43
- package/dist/common/gte.js +0 -43
- package/dist/common/if.js +0 -41
- package/dist/common/if_none.js +0 -47
- package/dist/common/input.js +0 -50
- package/dist/common/json.js +0 -64
- package/dist/common/log.js +0 -33
- package/dist/common/lt.js +0 -43
- package/dist/common/lte.js +0 -43
- package/dist/common/math.js +0 -210
- package/dist/common/ne.js +0 -43
- package/dist/common/not.js +0 -31
- package/dist/common/number.js +0 -125
- package/dist/common/nunjucks.js +0 -60
- package/dist/common/object.js +0 -118
- package/dist/common/operator.js +0 -49
- package/dist/common/or.js +0 -39
- package/dist/common/product.js +0 -45
- package/dist/common/random.js +0 -132
- package/dist/common/regex.js +0 -65
- package/dist/common/state.js +0 -50
- package/dist/common/string.js +0 -188
- package/dist/common/subtract.js +0 -47
- package/dist/common/sum.js +0 -45
- package/dist/common/switch.js +0 -49
- package/dist/common/type.js +0 -82
- package/dist/common/uri.js +0 -67
- package/dist/common/url_query.js +0 -50
- package/dist/common/user.js +0 -50
- package/dist/getFromOtherContext.js +0 -96
- package/dist/node/base64.js +0 -69
- package/dist/node/hash.js +0 -100
- package/dist/node/secret.js +0 -54
- package/dist/web/actions.js +0 -46
- package/dist/web/base64.js +0 -67
- package/dist/web/event_log.js +0 -50
- package/dist/web/list_contexts.js +0 -31
- package/dist/web/location.js +0 -74
- package/dist/web/media.js +0 -90
- package/dist/web/menu.js +0 -43
- package/dist/web/request.js +0 -56
- package/dist/web/request_details.js +0 -50
package/dist/common/switch.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
/*
|
|
11
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
12
|
-
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
you may not use this file except in compliance with the License.
|
|
15
|
-
You may obtain a copy of the License at
|
|
16
|
-
|
|
17
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
See the License for the specific language governing permissions and
|
|
23
|
-
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _switch(_ref) {
|
|
26
|
-
var {
|
|
27
|
-
location,
|
|
28
|
-
params
|
|
29
|
-
} = _ref;
|
|
30
|
-
|
|
31
|
-
if (!_helpers.type.isArray(params.branches)) {
|
|
32
|
-
throw new Error("Operator Error: switch takes an array type as input for the branches. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
for (var branch of params.branches) {
|
|
36
|
-
if (!_helpers.type.isBoolean(branch.if)) {
|
|
37
|
-
throw new Error("Operator Error: switch takes a boolean type for parameter test. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (branch.if === true) {
|
|
41
|
-
return branch.then;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return params.default;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
var _default = _switch;
|
|
49
|
-
exports.default = _default;
|
package/dist/common/type.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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
|
-
/*
|
|
11
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
12
|
-
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
you may not use this file except in compliance with the License.
|
|
15
|
-
You may obtain a copy of the License at
|
|
16
|
-
|
|
17
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
See the License for the specific language governing permissions and
|
|
23
|
-
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function _type(_ref) {
|
|
26
|
-
var {
|
|
27
|
-
location,
|
|
28
|
-
params,
|
|
29
|
-
state
|
|
30
|
-
} = _ref;
|
|
31
|
-
var typeName = _helpers.type.isObject(params) ? params.type : params;
|
|
32
|
-
|
|
33
|
-
if (!_helpers.type.isString(typeName)) {
|
|
34
|
-
throw new Error("Operator Error: _type.type must be a string. Received: ".concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var on = Object.prototype.hasOwnProperty.call(params, 'on') ? params.on : (0, _helpers.get)(state, (0, _helpers.get)(params, 'key', {
|
|
38
|
-
default: location
|
|
39
|
-
}));
|
|
40
|
-
|
|
41
|
-
switch (typeName) {
|
|
42
|
-
case 'string':
|
|
43
|
-
return _helpers.type.isString(on);
|
|
44
|
-
|
|
45
|
-
case 'array':
|
|
46
|
-
return _helpers.type.isArray(on);
|
|
47
|
-
|
|
48
|
-
case 'date':
|
|
49
|
-
return _helpers.type.isDate(on);
|
|
50
|
-
// Testing for date is problematic due to stringify
|
|
51
|
-
|
|
52
|
-
case 'object':
|
|
53
|
-
return _helpers.type.isObject(on);
|
|
54
|
-
|
|
55
|
-
case 'boolean':
|
|
56
|
-
return _helpers.type.isBoolean(on);
|
|
57
|
-
|
|
58
|
-
case 'number':
|
|
59
|
-
return _helpers.type.isNumber(on);
|
|
60
|
-
|
|
61
|
-
case 'integer':
|
|
62
|
-
return _helpers.type.isInt(on);
|
|
63
|
-
|
|
64
|
-
case 'null':
|
|
65
|
-
return _helpers.type.isNull(on);
|
|
66
|
-
|
|
67
|
-
case 'undefined':
|
|
68
|
-
return _helpers.type.isUndefined(on);
|
|
69
|
-
|
|
70
|
-
case 'none':
|
|
71
|
-
return _helpers.type.isNone(on);
|
|
72
|
-
|
|
73
|
-
case 'primitive':
|
|
74
|
-
return _helpers.type.isPrimitive(on);
|
|
75
|
-
|
|
76
|
-
default:
|
|
77
|
-
throw new Error("Operator Error: \"".concat(typeName, "\" is not a valid _type test. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var _default = _type;
|
|
82
|
-
exports.default = _default;
|
package/dist/common/uri.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
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
|
-
/*
|
|
13
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
14
|
-
|
|
15
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
function decode(input) {
|
|
28
|
-
return decodeURIComponent(input);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function encode(input) {
|
|
32
|
-
return encodeURIComponent(input);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var functions = {
|
|
36
|
-
encode,
|
|
37
|
-
decode
|
|
38
|
-
};
|
|
39
|
-
var meta = {
|
|
40
|
-
encode: {
|
|
41
|
-
singleArg: true,
|
|
42
|
-
validTypes: ['string']
|
|
43
|
-
},
|
|
44
|
-
decode: {
|
|
45
|
-
singleArg: true,
|
|
46
|
-
validTypes: ['string']
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
function _uri(_ref) {
|
|
51
|
-
var {
|
|
52
|
-
params,
|
|
53
|
-
location,
|
|
54
|
-
methodName
|
|
55
|
-
} = _ref;
|
|
56
|
-
return (0, _runClass.default)({
|
|
57
|
-
functions,
|
|
58
|
-
location,
|
|
59
|
-
meta,
|
|
60
|
-
methodName,
|
|
61
|
-
operator: '_uri',
|
|
62
|
-
params
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
var _default = _uri;
|
|
67
|
-
exports.default = _default;
|
package/dist/common/url_query.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _getFromObject = _interopRequireDefault(require("../getFromObject"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
14
|
-
|
|
15
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
function _url_query(_ref) {
|
|
28
|
-
var {
|
|
29
|
-
arrayIndices,
|
|
30
|
-
context,
|
|
31
|
-
contexts,
|
|
32
|
-
env,
|
|
33
|
-
location,
|
|
34
|
-
params,
|
|
35
|
-
urlQuery
|
|
36
|
-
} = _ref;
|
|
37
|
-
return (0, _getFromObject.default)({
|
|
38
|
-
arrayIndices,
|
|
39
|
-
context,
|
|
40
|
-
contexts,
|
|
41
|
-
env,
|
|
42
|
-
location,
|
|
43
|
-
object: urlQuery,
|
|
44
|
-
operator: '_url_query',
|
|
45
|
-
params
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var _default = _url_query;
|
|
50
|
-
exports.default = _default;
|
package/dist/common/user.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _getFromObject = _interopRequireDefault(require("../getFromObject"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
14
|
-
|
|
15
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
function _user(_ref) {
|
|
28
|
-
var {
|
|
29
|
-
arrayIndices,
|
|
30
|
-
context,
|
|
31
|
-
contexts,
|
|
32
|
-
env,
|
|
33
|
-
location,
|
|
34
|
-
params,
|
|
35
|
-
user
|
|
36
|
-
} = _ref;
|
|
37
|
-
return (0, _getFromObject.default)({
|
|
38
|
-
arrayIndices,
|
|
39
|
-
context,
|
|
40
|
-
contexts,
|
|
41
|
-
env,
|
|
42
|
-
location,
|
|
43
|
-
object: user,
|
|
44
|
-
operator: '_user',
|
|
45
|
-
params
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var _default = _user;
|
|
50
|
-
exports.default = _default;
|
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
/*
|
|
11
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
12
|
-
|
|
13
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
you may not use this file except in compliance with the License.
|
|
15
|
-
You may obtain a copy of the License at
|
|
16
|
-
|
|
17
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
|
|
19
|
-
Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
See the License for the specific language governing permissions and
|
|
23
|
-
limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
function addListener(_ref) {
|
|
26
|
-
var {
|
|
27
|
-
context,
|
|
28
|
-
targetContext
|
|
29
|
-
} = _ref;
|
|
30
|
-
|
|
31
|
-
if (context.id === targetContext.id) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
targetContext.updateListeners.add(context.id);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getFromOtherContext(_ref2) {
|
|
39
|
-
var {
|
|
40
|
-
params,
|
|
41
|
-
context,
|
|
42
|
-
contexts,
|
|
43
|
-
arrayIndices,
|
|
44
|
-
operator,
|
|
45
|
-
location
|
|
46
|
-
} = _ref2;
|
|
47
|
-
var {
|
|
48
|
-
contextId
|
|
49
|
-
} = params;
|
|
50
|
-
|
|
51
|
-
if (!_helpers.type.isString(contextId)) {
|
|
52
|
-
throw new Error("Operator Error: ".concat(operator, ".contextId must be of type string. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
var contextKeys = {
|
|
56
|
-
_event_log: 'eventLog',
|
|
57
|
-
_state: 'state',
|
|
58
|
-
_input: "lowdefy.inputs.".concat(contextId),
|
|
59
|
-
_global: 'lowdefy.lowdefyGlobal',
|
|
60
|
-
_request_details: 'requests',
|
|
61
|
-
_mutation_details: 'mutations',
|
|
62
|
-
_url_query: 'lowdefy.urlQuery'
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
if (_helpers.type.isUndefined(contextKeys[operator])) {
|
|
66
|
-
throw new Error("Operator Error: Cannot use ".concat(operator, " to get from another context. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var targetContext = contexts[contextId];
|
|
70
|
-
|
|
71
|
-
if (!_helpers.type.isObject(targetContext)) {
|
|
72
|
-
throw new Error("Operator Error: Context ".concat(contextId, " not found. Received: ").concat(JSON.stringify(params), " at ").concat(location, "."));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
addListener({
|
|
76
|
-
context,
|
|
77
|
-
targetContext
|
|
78
|
-
});
|
|
79
|
-
var object = (0, _helpers.get)(targetContext, contextKeys[operator]);
|
|
80
|
-
if (params.all === true) return object;
|
|
81
|
-
|
|
82
|
-
if (_helpers.type.isString(params.key)) {
|
|
83
|
-
return (0, _helpers.get)(object, (0, _helpers.applyArrayIndices)(arrayIndices, params.key), {
|
|
84
|
-
default: (0, _helpers.get)(params, 'default', {
|
|
85
|
-
default: null,
|
|
86
|
-
copy: true
|
|
87
|
-
}),
|
|
88
|
-
copy: true
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return object;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var _default = getFromOtherContext;
|
|
96
|
-
exports.default = _default;
|
package/dist/node/base64.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
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
|
-
/*
|
|
13
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
14
|
-
|
|
15
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
function decode(input) {
|
|
28
|
-
var buff = Buffer.from(input, 'base64');
|
|
29
|
-
return buff.toString('utf8');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function encode(input) {
|
|
33
|
-
var buff = Buffer.from(input, 'utf8');
|
|
34
|
-
return buff.toString('base64');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var functions = {
|
|
38
|
-
encode,
|
|
39
|
-
decode
|
|
40
|
-
};
|
|
41
|
-
var meta = {
|
|
42
|
-
encode: {
|
|
43
|
-
singleArg: true,
|
|
44
|
-
validTypes: ['string']
|
|
45
|
-
},
|
|
46
|
-
decode: {
|
|
47
|
-
singleArg: true,
|
|
48
|
-
validTypes: ['string']
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function _base64(_ref) {
|
|
53
|
-
var {
|
|
54
|
-
params,
|
|
55
|
-
location,
|
|
56
|
-
methodName
|
|
57
|
-
} = _ref;
|
|
58
|
-
return (0, _runClass.default)({
|
|
59
|
-
functions,
|
|
60
|
-
location,
|
|
61
|
-
meta,
|
|
62
|
-
methodName,
|
|
63
|
-
operator: '_base64',
|
|
64
|
-
params
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
var _default = _base64;
|
|
69
|
-
exports.default = _default;
|
package/dist/node/hash.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
/*
|
|
15
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
16
|
-
|
|
17
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
-
you may not use this file except in compliance with the License.
|
|
19
|
-
You may obtain a copy of the License at
|
|
20
|
-
|
|
21
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
-
|
|
23
|
-
Unless required by applicable law or agreed to in writing, software
|
|
24
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
-
See the License for the specific language governing permissions and
|
|
27
|
-
limitations under the License.
|
|
28
|
-
*/
|
|
29
|
-
function hash(algorithm, data) {
|
|
30
|
-
return _crypto.default.createHash(algorithm).update(data).digest('hex');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function md5(data) {
|
|
34
|
-
return hash('md5', data);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function sha1(data) {
|
|
38
|
-
return hash('sha1', data);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function sha256(data) {
|
|
42
|
-
return hash('sha256', data);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function sha512(data) {
|
|
46
|
-
return hash('sha512', data);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function ripemd160(data) {
|
|
50
|
-
return hash('ripemd160', data);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var functions = {
|
|
54
|
-
md5,
|
|
55
|
-
sha1,
|
|
56
|
-
sha256,
|
|
57
|
-
sha512,
|
|
58
|
-
ripemd160
|
|
59
|
-
};
|
|
60
|
-
var meta = {
|
|
61
|
-
md5: {
|
|
62
|
-
validTypes: ['string'],
|
|
63
|
-
singleArg: true
|
|
64
|
-
},
|
|
65
|
-
sha1: {
|
|
66
|
-
validTypes: ['string'],
|
|
67
|
-
singleArg: true
|
|
68
|
-
},
|
|
69
|
-
sha256: {
|
|
70
|
-
validTypes: ['string'],
|
|
71
|
-
singleArg: true
|
|
72
|
-
},
|
|
73
|
-
sha512: {
|
|
74
|
-
validTypes: ['string'],
|
|
75
|
-
singleArg: true
|
|
76
|
-
},
|
|
77
|
-
ripemd160: {
|
|
78
|
-
validTypes: ['string'],
|
|
79
|
-
singleArg: true
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
function _hash(_ref) {
|
|
84
|
-
var {
|
|
85
|
-
params,
|
|
86
|
-
location,
|
|
87
|
-
methodName
|
|
88
|
-
} = _ref;
|
|
89
|
-
return (0, _runClass.default)({
|
|
90
|
-
functions,
|
|
91
|
-
location,
|
|
92
|
-
meta,
|
|
93
|
-
methodName,
|
|
94
|
-
operator: '_hash',
|
|
95
|
-
params
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var _default = _hash;
|
|
100
|
-
exports.default = _default;
|
package/dist/node/secret.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _getFromObject = _interopRequireDefault(require("../getFromObject"));
|
|
9
|
-
|
|
10
|
-
var _excluded = ["OPENID_CLIENT_SECRET", "JWT_SECRET"];
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
|
|
20
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
21
|
-
|
|
22
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
23
|
-
|
|
24
|
-
function _secret(_ref) {
|
|
25
|
-
var {
|
|
26
|
-
env,
|
|
27
|
-
location,
|
|
28
|
-
params,
|
|
29
|
-
secrets = {}
|
|
30
|
-
} = _ref;
|
|
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
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
var _default = _secret;
|
|
54
|
-
exports.default = _default;
|
package/dist/web/actions.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _getFromObject = _interopRequireDefault(require("../getFromObject"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
14
|
-
|
|
15
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
-
you may not use this file except in compliance with the License.
|
|
17
|
-
You may obtain a copy of the License at
|
|
18
|
-
|
|
19
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
-
|
|
21
|
-
Unless required by applicable law or agreed to in writing, software
|
|
22
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
-
See the License for the specific language governing permissions and
|
|
25
|
-
limitations under the License.
|
|
26
|
-
*/
|
|
27
|
-
function _actions(_ref) {
|
|
28
|
-
var {
|
|
29
|
-
actions,
|
|
30
|
-
arrayIndices,
|
|
31
|
-
env,
|
|
32
|
-
location,
|
|
33
|
-
params
|
|
34
|
-
} = _ref;
|
|
35
|
-
return (0, _getFromObject.default)({
|
|
36
|
-
arrayIndices,
|
|
37
|
-
env,
|
|
38
|
-
location,
|
|
39
|
-
object: actions,
|
|
40
|
-
operator: '_actions',
|
|
41
|
-
params
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var _default = _actions;
|
|
46
|
-
exports.default = _default;
|