@lowdefy/operators-js 4.5.1 → 4.6.0
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.js +1 -1
- package/dist/operators/build/env.js +2 -1
- package/dist/operators/build/env.schema.js +61 -0
- package/dist/operators/client/_index.js +2 -1
- package/dist/operators/client/actions.js +2 -1
- package/dist/operators/client/actions.schema.js +61 -0
- package/dist/operators/client/api.js +4 -3
- package/dist/operators/client/api.schema.js +21 -0
- package/dist/operators/client/base64.js +2 -1
- package/dist/operators/client/base64.schema.js +21 -0
- package/dist/operators/client/event.js +2 -1
- package/dist/operators/client/event.schema.js +61 -0
- package/dist/operators/client/event_log.js +2 -1
- package/dist/operators/client/event_log.schema.js +61 -0
- package/dist/operators/client/global.js +2 -1
- package/dist/operators/client/global.schema.js +61 -0
- package/dist/operators/client/index.schema.js +22 -0
- package/dist/operators/client/input.js +2 -1
- package/dist/operators/client/input.schema.js +61 -0
- package/dist/operators/client/js.js +9 -3
- package/dist/operators/client/js.schema.js +21 -0
- package/dist/operators/client/location.js +4 -3
- package/dist/operators/client/location.schema.js +35 -0
- package/dist/operators/client/media.js +3 -2
- package/dist/operators/client/media.schema.js +59 -0
- package/dist/operators/client/menu.js +2 -1
- package/dist/operators/client/menu.schema.js +54 -0
- package/dist/operators/client/request.js +4 -3
- package/dist/operators/client/request.schema.js +21 -0
- package/dist/operators/client/request_details.js +2 -1
- package/dist/operators/client/request_details.schema.js +61 -0
- package/dist/operators/client/url_query.js +3 -2
- package/dist/operators/client/url_query.schema.js +61 -0
- package/dist/operators/server/base64.js +2 -1
- package/dist/operators/server/base64.schema.js +21 -0
- package/dist/operators/server/hash.js +2 -1
- package/dist/operators/server/hash.schema.js +21 -0
- package/dist/operators/server/item.js +2 -1
- package/dist/operators/server/item.schema.js +61 -0
- package/dist/operators/server/js.js +8 -2
- package/dist/operators/server/js.schema.js +21 -0
- package/dist/operators/server/payload.js +2 -1
- package/dist/operators/server/payload.schema.js +61 -0
- package/dist/operators/server/secret.js +3 -2
- package/dist/operators/server/secret.schema.js +50 -0
- package/dist/operators/server/step.js +2 -1
- package/dist/operators/server/step.schema.js +61 -0
- package/dist/operators/shared/and.js +4 -3
- package/dist/operators/shared/and.schema.js +21 -0
- package/dist/operators/shared/args.js +2 -1
- package/dist/operators/shared/args.schema.js +61 -0
- package/dist/operators/shared/array.js +2 -1
- package/dist/operators/shared/array.schema.js +20 -0
- package/dist/operators/shared/date.js +59 -28
- package/dist/operators/shared/date.schema.js +20 -0
- package/dist/operators/shared/divide.js +7 -6
- package/dist/operators/shared/divide.schema.js +26 -0
- package/dist/operators/shared/eq.js +5 -4
- package/dist/operators/shared/eq.schema.js +23 -0
- package/dist/operators/shared/function.js +3 -2
- package/dist/operators/shared/function.schema.js +20 -0
- package/dist/operators/shared/get.js +4 -3
- package/dist/operators/shared/get.schema.js +40 -0
- package/dist/operators/shared/gt.js +5 -4
- package/dist/operators/shared/gt.schema.js +23 -0
- package/dist/operators/shared/gte.js +5 -4
- package/dist/operators/shared/gte.schema.js +23 -0
- package/dist/operators/shared/if.js +4 -3
- package/dist/operators/shared/if.schema.js +36 -0
- package/dist/operators/shared/if_none.js +5 -4
- package/dist/operators/shared/if_none.schema.js +23 -0
- package/dist/operators/shared/intl.js +2 -1
- package/dist/operators/shared/intl.schema.js +20 -0
- package/dist/operators/shared/json.js +2 -1
- package/dist/operators/shared/json.schema.js +20 -0
- package/dist/operators/shared/log.js +2 -1
- package/dist/operators/shared/log.schema.js +20 -0
- package/dist/operators/shared/lt.js +5 -4
- package/dist/operators/shared/lt.schema.js +23 -0
- package/dist/operators/shared/lte.js +5 -4
- package/dist/operators/shared/lte.schema.js +23 -0
- package/dist/operators/shared/math.js +5 -2
- package/dist/operators/shared/math.schema.js +20 -0
- package/dist/operators/shared/ne.js +5 -4
- package/dist/operators/shared/ne.schema.js +23 -0
- package/dist/operators/shared/not.js +2 -1
- package/dist/operators/shared/not.schema.js +21 -0
- package/dist/operators/shared/number.js +2 -1
- package/dist/operators/shared/number.schema.js +20 -0
- package/dist/operators/shared/object.js +2 -1
- package/dist/operators/shared/object.schema.js +20 -0
- package/dist/operators/shared/operator.js +6 -5
- package/dist/operators/shared/operator.schema.js +33 -0
- package/dist/operators/shared/or.js +4 -3
- package/dist/operators/shared/or.schema.js +21 -0
- package/dist/operators/shared/product.js +4 -3
- package/dist/operators/shared/product.schema.js +24 -0
- package/dist/operators/shared/random.js +14 -18
- package/dist/operators/shared/random.schema.js +60 -0
- package/dist/operators/shared/regex.js +8 -6
- package/dist/operators/shared/regex.schema.js +50 -0
- package/dist/operators/shared/state.js +2 -1
- package/dist/operators/shared/state.schema.js +61 -0
- package/dist/operators/shared/string.js +2 -1
- package/dist/operators/shared/string.schema.js +20 -0
- package/dist/operators/shared/subtract.js +6 -5
- package/dist/operators/shared/subtract.schema.js +26 -0
- package/dist/operators/shared/sum.js +4 -3
- package/dist/operators/shared/sum.schema.js +24 -0
- package/dist/operators/shared/switch.js +5 -4
- package/dist/operators/shared/switch.schema.js +49 -0
- package/dist/operators/shared/type.js +4 -3
- package/dist/operators/shared/type.schema.js +71 -0
- package/dist/operators/shared/uri.js +2 -1
- package/dist/operators/shared/uri.schema.js +21 -0
- package/dist/operators/shared/user.js +2 -1
- package/dist/operators/shared/user.schema.js +61 -0
- package/dist/operatorsBuild.js +1 -1
- package/dist/operatorsClient.js +1 -1
- package/dist/operatorsServer.js +1 -1
- package/dist/schemas.js +74 -0
- package/dist/types.js +1 -1
- package/package.json +4 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
16
|
function _secret({ location, params, secrets = {} }) {
|
|
17
17
|
if (params === true || params.all) {
|
|
18
|
-
throw new Error(`
|
|
18
|
+
throw new Error(`Getting all secrets is not allowed.`);
|
|
19
19
|
}
|
|
20
20
|
// Filter out OpenID Connect and JSON web token secrets
|
|
21
21
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -29,4 +29,5 @@ function _secret({ location, params, secrets = {} }) {
|
|
|
29
29
|
params
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
_secret.dynamic = true;
|
|
32
33
|
export default _secret;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Dot-notation path to value in secrets object.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'integer',
|
|
25
|
+
description: 'Index to access in secrets object.'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
key: {
|
|
31
|
+
oneOf: [
|
|
32
|
+
{
|
|
33
|
+
type: 'string',
|
|
34
|
+
description: 'Dot-notation path to value in secrets object.'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'integer',
|
|
38
|
+
description: 'Index to access in secrets object.'
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
default: {
|
|
43
|
+
description: 'Default value if key does not exist.'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
additionalProperties: false
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -21,4 +21,5 @@ function _step({ location, params, steps }) {
|
|
|
21
21
|
params
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
_step.dynamic = true;
|
|
24
25
|
export default _step;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Dot-notation path to value in steps object.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'integer',
|
|
25
|
+
description: 'Index to access in steps object.'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
enum: [
|
|
30
|
+
true
|
|
31
|
+
],
|
|
32
|
+
description: 'Return all steps data.'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
key: {
|
|
38
|
+
oneOf: [
|
|
39
|
+
{
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Dot-notation path to value in steps object.'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'integer',
|
|
45
|
+
description: 'Index to access in steps object.'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
default: {
|
|
50
|
+
description: 'Default value if key does not exist.'
|
|
51
|
+
},
|
|
52
|
+
all: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Return all steps data.'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
additionalProperties: false
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function _and({ params
|
|
16
|
+
function _and({ params }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
|
-
throw new Error(`
|
|
18
|
+
throw new Error(`_and takes an array type.`);
|
|
19
19
|
}
|
|
20
20
|
return !!params.reduce((acc, el)=>acc && el, true);
|
|
21
21
|
}
|
|
22
|
+
_and.dynamic = false;
|
|
22
23
|
export default _and;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
description: 'Array of values. Returns true if all values are truthy.'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,4 +22,5 @@ function _args({ args, arrayIndices, location, params }) {
|
|
|
22
22
|
params
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
_args.dynamic = false;
|
|
25
26
|
export default _args;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
oneOf: [
|
|
19
|
+
{
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: 'Dot-notation path to value in args.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'integer',
|
|
25
|
+
description: 'Index to access in args.'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'boolean',
|
|
29
|
+
enum: [
|
|
30
|
+
true
|
|
31
|
+
],
|
|
32
|
+
description: 'Return all args.'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
key: {
|
|
38
|
+
oneOf: [
|
|
39
|
+
{
|
|
40
|
+
type: 'string',
|
|
41
|
+
description: 'Dot-notation path to value in args.'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'integer',
|
|
45
|
+
description: 'Index to access in args.'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
default: {
|
|
50
|
+
description: 'Default value if key does not exist.'
|
|
51
|
+
},
|
|
52
|
+
all: {
|
|
53
|
+
type: 'boolean',
|
|
54
|
+
description: 'Return all args.'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
additionalProperties: false
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -260,4 +260,5 @@ function _array({ params, location, methodName }) {
|
|
|
260
260
|
instanceType: 'array'
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
|
+
_array.dynamic = false;
|
|
263
264
|
export default _array;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
description: 'Array method params. Accepts array positional args or object with named args depending on method.'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -38,13 +38,16 @@ const prep = (args)=>{
|
|
|
38
38
|
return args;
|
|
39
39
|
};
|
|
40
40
|
const meta = {
|
|
41
|
+
// Methods that use prep (default to current date when null) are marked dynamic
|
|
42
|
+
// to prevent build-time evaluation freezing the date
|
|
41
43
|
getDate: {
|
|
42
44
|
singleArg: true,
|
|
43
45
|
prep,
|
|
44
46
|
validTypes: [
|
|
45
47
|
'date',
|
|
46
48
|
'null'
|
|
47
|
-
]
|
|
49
|
+
],
|
|
50
|
+
dynamic: true
|
|
48
51
|
},
|
|
49
52
|
getDay: {
|
|
50
53
|
singleArg: true,
|
|
@@ -52,7 +55,8 @@ const meta = {
|
|
|
52
55
|
validTypes: [
|
|
53
56
|
'date',
|
|
54
57
|
'null'
|
|
55
|
-
]
|
|
58
|
+
],
|
|
59
|
+
dynamic: true
|
|
56
60
|
},
|
|
57
61
|
getFullYear: {
|
|
58
62
|
singleArg: true,
|
|
@@ -60,7 +64,8 @@ const meta = {
|
|
|
60
64
|
validTypes: [
|
|
61
65
|
'date',
|
|
62
66
|
'null'
|
|
63
|
-
]
|
|
67
|
+
],
|
|
68
|
+
dynamic: true
|
|
64
69
|
},
|
|
65
70
|
getHours: {
|
|
66
71
|
singleArg: true,
|
|
@@ -68,7 +73,8 @@ const meta = {
|
|
|
68
73
|
validTypes: [
|
|
69
74
|
'date',
|
|
70
75
|
'null'
|
|
71
|
-
]
|
|
76
|
+
],
|
|
77
|
+
dynamic: true
|
|
72
78
|
},
|
|
73
79
|
getMilliseconds: {
|
|
74
80
|
singleArg: true,
|
|
@@ -76,7 +82,8 @@ const meta = {
|
|
|
76
82
|
validTypes: [
|
|
77
83
|
'date',
|
|
78
84
|
'null'
|
|
79
|
-
]
|
|
85
|
+
],
|
|
86
|
+
dynamic: true
|
|
80
87
|
},
|
|
81
88
|
getMinutes: {
|
|
82
89
|
singleArg: true,
|
|
@@ -84,7 +91,8 @@ const meta = {
|
|
|
84
91
|
validTypes: [
|
|
85
92
|
'date',
|
|
86
93
|
'null'
|
|
87
|
-
]
|
|
94
|
+
],
|
|
95
|
+
dynamic: true
|
|
88
96
|
},
|
|
89
97
|
getMonth: {
|
|
90
98
|
singleArg: true,
|
|
@@ -92,7 +100,8 @@ const meta = {
|
|
|
92
100
|
validTypes: [
|
|
93
101
|
'date',
|
|
94
102
|
'null'
|
|
95
|
-
]
|
|
103
|
+
],
|
|
104
|
+
dynamic: true
|
|
96
105
|
},
|
|
97
106
|
getSeconds: {
|
|
98
107
|
singleArg: true,
|
|
@@ -100,7 +109,8 @@ const meta = {
|
|
|
100
109
|
validTypes: [
|
|
101
110
|
'date',
|
|
102
111
|
'null'
|
|
103
|
-
]
|
|
112
|
+
],
|
|
113
|
+
dynamic: true
|
|
104
114
|
},
|
|
105
115
|
getTime: {
|
|
106
116
|
singleArg: true,
|
|
@@ -108,7 +118,8 @@ const meta = {
|
|
|
108
118
|
validTypes: [
|
|
109
119
|
'date',
|
|
110
120
|
'null'
|
|
111
|
-
]
|
|
121
|
+
],
|
|
122
|
+
dynamic: true
|
|
112
123
|
},
|
|
113
124
|
getTimezoneOffset: {
|
|
114
125
|
singleArg: true,
|
|
@@ -116,7 +127,8 @@ const meta = {
|
|
|
116
127
|
validTypes: [
|
|
117
128
|
'date',
|
|
118
129
|
'null'
|
|
119
|
-
]
|
|
130
|
+
],
|
|
131
|
+
dynamic: true
|
|
120
132
|
},
|
|
121
133
|
getUTCDate: {
|
|
122
134
|
singleArg: true,
|
|
@@ -124,7 +136,8 @@ const meta = {
|
|
|
124
136
|
validTypes: [
|
|
125
137
|
'date',
|
|
126
138
|
'null'
|
|
127
|
-
]
|
|
139
|
+
],
|
|
140
|
+
dynamic: true
|
|
128
141
|
},
|
|
129
142
|
getUTCDay: {
|
|
130
143
|
singleArg: true,
|
|
@@ -132,7 +145,8 @@ const meta = {
|
|
|
132
145
|
validTypes: [
|
|
133
146
|
'date',
|
|
134
147
|
'null'
|
|
135
|
-
]
|
|
148
|
+
],
|
|
149
|
+
dynamic: true
|
|
136
150
|
},
|
|
137
151
|
getUTCFullYear: {
|
|
138
152
|
singleArg: true,
|
|
@@ -140,7 +154,8 @@ const meta = {
|
|
|
140
154
|
validTypes: [
|
|
141
155
|
'date',
|
|
142
156
|
'null'
|
|
143
|
-
]
|
|
157
|
+
],
|
|
158
|
+
dynamic: true
|
|
144
159
|
},
|
|
145
160
|
getUTCHours: {
|
|
146
161
|
singleArg: true,
|
|
@@ -148,7 +163,8 @@ const meta = {
|
|
|
148
163
|
validTypes: [
|
|
149
164
|
'date',
|
|
150
165
|
'null'
|
|
151
|
-
]
|
|
166
|
+
],
|
|
167
|
+
dynamic: true
|
|
152
168
|
},
|
|
153
169
|
getUTCMilliseconds: {
|
|
154
170
|
singleArg: true,
|
|
@@ -156,7 +172,8 @@ const meta = {
|
|
|
156
172
|
validTypes: [
|
|
157
173
|
'date',
|
|
158
174
|
'null'
|
|
159
|
-
]
|
|
175
|
+
],
|
|
176
|
+
dynamic: true
|
|
160
177
|
},
|
|
161
178
|
getUTCMinutes: {
|
|
162
179
|
singleArg: true,
|
|
@@ -164,7 +181,8 @@ const meta = {
|
|
|
164
181
|
validTypes: [
|
|
165
182
|
'date',
|
|
166
183
|
'null'
|
|
167
|
-
]
|
|
184
|
+
],
|
|
185
|
+
dynamic: true
|
|
168
186
|
},
|
|
169
187
|
getUTCMonth: {
|
|
170
188
|
singleArg: true,
|
|
@@ -172,7 +190,8 @@ const meta = {
|
|
|
172
190
|
validTypes: [
|
|
173
191
|
'date',
|
|
174
192
|
'null'
|
|
175
|
-
]
|
|
193
|
+
],
|
|
194
|
+
dynamic: true
|
|
176
195
|
},
|
|
177
196
|
getUTCSeconds: {
|
|
178
197
|
singleArg: true,
|
|
@@ -180,10 +199,12 @@ const meta = {
|
|
|
180
199
|
validTypes: [
|
|
181
200
|
'date',
|
|
182
201
|
'null'
|
|
183
|
-
]
|
|
202
|
+
],
|
|
203
|
+
dynamic: true
|
|
184
204
|
},
|
|
185
205
|
now: {
|
|
186
|
-
noArgs: true
|
|
206
|
+
noArgs: true,
|
|
207
|
+
dynamic: true
|
|
187
208
|
},
|
|
188
209
|
parse: {
|
|
189
210
|
singleArg: true,
|
|
@@ -191,7 +212,8 @@ const meta = {
|
|
|
191
212
|
validTypes: [
|
|
192
213
|
'string',
|
|
193
214
|
'null'
|
|
194
|
-
]
|
|
215
|
+
],
|
|
216
|
+
dynamic: true
|
|
195
217
|
},
|
|
196
218
|
setDate: {
|
|
197
219
|
namedArgs: [
|
|
@@ -349,7 +371,8 @@ const meta = {
|
|
|
349
371
|
validTypes: [
|
|
350
372
|
'date',
|
|
351
373
|
'null'
|
|
352
|
-
]
|
|
374
|
+
],
|
|
375
|
+
dynamic: true
|
|
353
376
|
},
|
|
354
377
|
toISOString: {
|
|
355
378
|
singleArg: true,
|
|
@@ -357,7 +380,8 @@ const meta = {
|
|
|
357
380
|
validTypes: [
|
|
358
381
|
'date',
|
|
359
382
|
'null'
|
|
360
|
-
]
|
|
383
|
+
],
|
|
384
|
+
dynamic: true
|
|
361
385
|
},
|
|
362
386
|
toJSON: {
|
|
363
387
|
singleArg: true,
|
|
@@ -365,7 +389,8 @@ const meta = {
|
|
|
365
389
|
validTypes: [
|
|
366
390
|
'date',
|
|
367
391
|
'null'
|
|
368
|
-
]
|
|
392
|
+
],
|
|
393
|
+
dynamic: true
|
|
369
394
|
},
|
|
370
395
|
toString: {
|
|
371
396
|
singleArg: true,
|
|
@@ -373,7 +398,8 @@ const meta = {
|
|
|
373
398
|
validTypes: [
|
|
374
399
|
'date',
|
|
375
400
|
'null'
|
|
376
|
-
]
|
|
401
|
+
],
|
|
402
|
+
dynamic: true
|
|
377
403
|
},
|
|
378
404
|
toTimeString: {
|
|
379
405
|
singleArg: true,
|
|
@@ -381,7 +407,8 @@ const meta = {
|
|
|
381
407
|
validTypes: [
|
|
382
408
|
'date',
|
|
383
409
|
'null'
|
|
384
|
-
]
|
|
410
|
+
],
|
|
411
|
+
dynamic: true
|
|
385
412
|
},
|
|
386
413
|
toUTCString: {
|
|
387
414
|
singleArg: true,
|
|
@@ -389,7 +416,8 @@ const meta = {
|
|
|
389
416
|
validTypes: [
|
|
390
417
|
'date',
|
|
391
418
|
'null'
|
|
392
|
-
]
|
|
419
|
+
],
|
|
420
|
+
dynamic: true
|
|
393
421
|
},
|
|
394
422
|
UTC: {
|
|
395
423
|
namedArgs: [
|
|
@@ -411,7 +439,8 @@ const meta = {
|
|
|
411
439
|
validTypes: [
|
|
412
440
|
'date',
|
|
413
441
|
'null'
|
|
414
|
-
]
|
|
442
|
+
],
|
|
443
|
+
dynamic: true
|
|
415
444
|
},
|
|
416
445
|
__default: {
|
|
417
446
|
singleArg: true,
|
|
@@ -446,4 +475,6 @@ function _date({ params, location, methodName }) {
|
|
|
446
475
|
instanceType: 'date'
|
|
447
476
|
});
|
|
448
477
|
}
|
|
478
|
+
_date.dynamic = false;
|
|
479
|
+
_date.meta = meta;
|
|
449
480
|
export default _date;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
description: 'Date method params. Accepts a date string/number, or array/object with named args depending on method.'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function _divide({ params
|
|
16
|
+
function _divide({ params }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
|
-
throw new Error(`
|
|
18
|
+
throw new Error(`_divide takes an array type as input.`);
|
|
19
19
|
}
|
|
20
20
|
if (params.length !== 2) {
|
|
21
|
-
throw new Error(`
|
|
21
|
+
throw new Error(`_divide takes an array of length 2 as input.`);
|
|
22
22
|
}
|
|
23
23
|
if (!type.isNumber(params[0]) || !type.isNumber(params[1])) {
|
|
24
|
-
throw new Error(`
|
|
24
|
+
throw new Error(`_divide takes an array of 2 numbers.`);
|
|
25
25
|
}
|
|
26
26
|
if (params[1] === 0) {
|
|
27
|
-
throw new Error(`
|
|
27
|
+
throw new Error(`_divide by zero not allowed.`);
|
|
28
28
|
}
|
|
29
29
|
return params[0] / params[1];
|
|
30
30
|
}
|
|
31
|
+
_divide.dynamic = false;
|
|
31
32
|
export default _divide;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 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
|
+
*/ export default {
|
|
16
|
+
type: 'object',
|
|
17
|
+
params: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: {
|
|
20
|
+
type: 'number'
|
|
21
|
+
},
|
|
22
|
+
minItems: 2,
|
|
23
|
+
maxItems: 2,
|
|
24
|
+
description: 'Array of two numbers. Returns the first divided by the second.'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
-
function _eq({ params
|
|
16
|
+
function _eq({ params }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
|
-
throw new Error(`
|
|
18
|
+
throw new Error(`_eq takes an array type as input.`);
|
|
19
19
|
}
|
|
20
20
|
if (params.length !== 2) {
|
|
21
|
-
throw new Error(`
|
|
21
|
+
throw new Error(`_eq takes an array of length 2 as input.`);
|
|
22
22
|
}
|
|
23
23
|
return params[0] === params[1];
|
|
24
24
|
}
|
|
25
|
+
_eq.dynamic = false;
|
|
25
26
|
export default _eq;
|