@lowdefy/operators-js 4.5.2 → 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.
Files changed (123) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/operators/build/env.js +2 -1
  3. package/dist/operators/build/env.schema.js +61 -0
  4. package/dist/operators/client/_index.js +2 -1
  5. package/dist/operators/client/actions.js +2 -1
  6. package/dist/operators/client/actions.schema.js +61 -0
  7. package/dist/operators/client/api.js +4 -3
  8. package/dist/operators/client/api.schema.js +21 -0
  9. package/dist/operators/client/base64.js +2 -1
  10. package/dist/operators/client/base64.schema.js +21 -0
  11. package/dist/operators/client/event.js +2 -1
  12. package/dist/operators/client/event.schema.js +61 -0
  13. package/dist/operators/client/event_log.js +2 -1
  14. package/dist/operators/client/event_log.schema.js +61 -0
  15. package/dist/operators/client/global.js +2 -1
  16. package/dist/operators/client/global.schema.js +61 -0
  17. package/dist/operators/client/index.schema.js +22 -0
  18. package/dist/operators/client/input.js +2 -1
  19. package/dist/operators/client/input.schema.js +61 -0
  20. package/dist/operators/client/js.js +9 -3
  21. package/dist/operators/client/js.schema.js +21 -0
  22. package/dist/operators/client/location.js +4 -3
  23. package/dist/operators/client/location.schema.js +35 -0
  24. package/dist/operators/client/media.js +3 -2
  25. package/dist/operators/client/media.schema.js +59 -0
  26. package/dist/operators/client/menu.js +2 -1
  27. package/dist/operators/client/menu.schema.js +54 -0
  28. package/dist/operators/client/request.js +4 -3
  29. package/dist/operators/client/request.schema.js +21 -0
  30. package/dist/operators/client/request_details.js +2 -1
  31. package/dist/operators/client/request_details.schema.js +61 -0
  32. package/dist/operators/client/url_query.js +3 -2
  33. package/dist/operators/client/url_query.schema.js +61 -0
  34. package/dist/operators/server/base64.js +2 -1
  35. package/dist/operators/server/base64.schema.js +21 -0
  36. package/dist/operators/server/hash.js +2 -1
  37. package/dist/operators/server/hash.schema.js +21 -0
  38. package/dist/operators/server/item.js +2 -1
  39. package/dist/operators/server/item.schema.js +61 -0
  40. package/dist/operators/server/js.js +8 -2
  41. package/dist/operators/server/js.schema.js +21 -0
  42. package/dist/operators/server/payload.js +2 -1
  43. package/dist/operators/server/payload.schema.js +61 -0
  44. package/dist/operators/server/secret.js +3 -2
  45. package/dist/operators/server/secret.schema.js +50 -0
  46. package/dist/operators/server/step.js +2 -1
  47. package/dist/operators/server/step.schema.js +61 -0
  48. package/dist/operators/shared/and.js +4 -3
  49. package/dist/operators/shared/and.schema.js +21 -0
  50. package/dist/operators/shared/args.js +2 -1
  51. package/dist/operators/shared/args.schema.js +61 -0
  52. package/dist/operators/shared/array.js +2 -1
  53. package/dist/operators/shared/array.schema.js +20 -0
  54. package/dist/operators/shared/date.js +59 -28
  55. package/dist/operators/shared/date.schema.js +20 -0
  56. package/dist/operators/shared/divide.js +7 -6
  57. package/dist/operators/shared/divide.schema.js +26 -0
  58. package/dist/operators/shared/eq.js +5 -4
  59. package/dist/operators/shared/eq.schema.js +23 -0
  60. package/dist/operators/shared/function.js +3 -2
  61. package/dist/operators/shared/function.schema.js +20 -0
  62. package/dist/operators/shared/get.js +4 -3
  63. package/dist/operators/shared/get.schema.js +40 -0
  64. package/dist/operators/shared/gt.js +5 -4
  65. package/dist/operators/shared/gt.schema.js +23 -0
  66. package/dist/operators/shared/gte.js +5 -4
  67. package/dist/operators/shared/gte.schema.js +23 -0
  68. package/dist/operators/shared/if.js +4 -3
  69. package/dist/operators/shared/if.schema.js +36 -0
  70. package/dist/operators/shared/if_none.js +5 -4
  71. package/dist/operators/shared/if_none.schema.js +23 -0
  72. package/dist/operators/shared/intl.js +2 -1
  73. package/dist/operators/shared/intl.schema.js +20 -0
  74. package/dist/operators/shared/json.js +2 -1
  75. package/dist/operators/shared/json.schema.js +20 -0
  76. package/dist/operators/shared/log.js +2 -1
  77. package/dist/operators/shared/log.schema.js +20 -0
  78. package/dist/operators/shared/lt.js +5 -4
  79. package/dist/operators/shared/lt.schema.js +23 -0
  80. package/dist/operators/shared/lte.js +5 -4
  81. package/dist/operators/shared/lte.schema.js +23 -0
  82. package/dist/operators/shared/math.js +5 -2
  83. package/dist/operators/shared/math.schema.js +20 -0
  84. package/dist/operators/shared/ne.js +5 -4
  85. package/dist/operators/shared/ne.schema.js +23 -0
  86. package/dist/operators/shared/not.js +2 -1
  87. package/dist/operators/shared/not.schema.js +21 -0
  88. package/dist/operators/shared/number.js +2 -1
  89. package/dist/operators/shared/number.schema.js +20 -0
  90. package/dist/operators/shared/object.js +2 -1
  91. package/dist/operators/shared/object.schema.js +20 -0
  92. package/dist/operators/shared/operator.js +6 -5
  93. package/dist/operators/shared/operator.schema.js +33 -0
  94. package/dist/operators/shared/or.js +4 -3
  95. package/dist/operators/shared/or.schema.js +21 -0
  96. package/dist/operators/shared/product.js +4 -3
  97. package/dist/operators/shared/product.schema.js +24 -0
  98. package/dist/operators/shared/random.js +14 -18
  99. package/dist/operators/shared/random.schema.js +60 -0
  100. package/dist/operators/shared/regex.js +8 -6
  101. package/dist/operators/shared/regex.schema.js +50 -0
  102. package/dist/operators/shared/state.js +2 -1
  103. package/dist/operators/shared/state.schema.js +61 -0
  104. package/dist/operators/shared/string.js +2 -1
  105. package/dist/operators/shared/string.schema.js +20 -0
  106. package/dist/operators/shared/subtract.js +6 -5
  107. package/dist/operators/shared/subtract.schema.js +26 -0
  108. package/dist/operators/shared/sum.js +4 -3
  109. package/dist/operators/shared/sum.schema.js +24 -0
  110. package/dist/operators/shared/switch.js +5 -4
  111. package/dist/operators/shared/switch.schema.js +49 -0
  112. package/dist/operators/shared/type.js +4 -3
  113. package/dist/operators/shared/type.schema.js +71 -0
  114. package/dist/operators/shared/uri.js +2 -1
  115. package/dist/operators/shared/uri.schema.js +21 -0
  116. package/dist/operators/shared/user.js +2 -1
  117. package/dist/operators/shared/user.schema.js +61 -0
  118. package/dist/operatorsBuild.js +1 -1
  119. package/dist/operatorsClient.js +1 -1
  120. package/dist/operatorsServer.js +1 -1
  121. package/dist/schemas.js +74 -0
  122. package/dist/types.js +1 -1
  123. package/package.json +4 -3
@@ -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: 'boolean',
19
+ description: 'Boolean value to negate.'
20
+ }
21
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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.
@@ -143,4 +143,5 @@ function _number({ params, location, methodName }) {
143
143
  params
144
144
  });
145
145
  }
146
+ _number.dynamic = false;
146
147
  export default _number;
@@ -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: 'Number method params. Accepts a single value or array/object with named args depending on method.'
19
+ }
20
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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.
@@ -126,4 +126,5 @@ function _object({ params, location, methodName }) {
126
126
  params
127
127
  });
128
128
  }
129
+ _object.dynamic = false;
129
130
  export default _object;
@@ -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: 'Object 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-2024 Lowdefy, Inc
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.
@@ -16,13 +16,13 @@
16
16
  function _operator(options) {
17
17
  const { operators, params, location } = options;
18
18
  if (!type.isString(params.name)) {
19
- throw new Error(`Operator Error: _operator.name must be a valid operator name as string. Received: ${JSON.stringify(params)} at ${location}.`);
19
+ throw new Error(`_operator.name must be a valid operator name as string.`);
20
20
  }
21
21
  if (params.name === '_operator') {
22
- throw new Error(`Operator Error: _operator.name cannot be set to _operator to infinite avoid loop reference. Received: ${JSON.stringify(params)} at ${location}.`);
22
+ throw new Error(`_operator.name cannot be set to _operator to avoid infinite loop reference.`);
23
23
  }
24
24
  if (params.name.includes('experimental')) {
25
- throw new Error(`Operator Error: Experimental operators cannot be used with _operator. Received: ${JSON.stringify(params)} at ${location}.`);
25
+ throw new Error(`Experimental operators cannot be used with _operator.`);
26
26
  }
27
27
  const [operator, methodName] = params.name.split('.');
28
28
  if (Object.prototype.hasOwnProperty.call(operators, operator)) {
@@ -33,6 +33,7 @@ function _operator(options) {
33
33
  methodName
34
34
  });
35
35
  }
36
- throw new Error(`Operator Error: _operator - Invalid operator name. Received: ${JSON.stringify(params)} at ${location}.`);
36
+ throw new Error(`_operator - Invalid operator name.`);
37
37
  }
38
+ _operator.dynamic = true;
38
39
  export default _operator;
@@ -0,0 +1,33 @@
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: 'object',
19
+ required: [
20
+ 'name'
21
+ ],
22
+ properties: {
23
+ name: {
24
+ type: 'string',
25
+ description: 'Name of the operator to call (e.g. "_sum", "_string.concat").'
26
+ },
27
+ params: {
28
+ description: 'Params to pass to the operator.'
29
+ }
30
+ },
31
+ additionalProperties: false
32
+ }
33
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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 _or({ location, params }) {
16
+ function _or({ params }) {
17
17
  if (!type.isArray(params)) {
18
- throw new Error(`Operator Error: _or takes an array type. Received: ${JSON.stringify(params)} at ${location}.`);
18
+ throw new Error(`_or takes an array type.`);
19
19
  }
20
20
  return !!params.reduce((acc, el)=>acc || el, false);
21
21
  }
22
+ _or.dynamic = false;
22
23
  export default _or;
@@ -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 any value is truthy.'
20
+ }
21
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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,9 +13,9 @@
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 _product({ params, location }) {
16
+ function _product({ params }) {
17
17
  if (!type.isArray(params)) {
18
- throw new Error(`Operator Error: _product takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
18
+ throw new Error(`_product takes an array type as input.`);
19
19
  }
20
20
  return params.reduce((accumulator, value)=>{
21
21
  if (type.isNumber(value)) {
@@ -24,4 +24,5 @@ function _product({ params, location }) {
24
24
  return accumulator;
25
25
  }, 1);
26
26
  }
27
+ _product.dynamic = false;
27
28
  export default _product;
@@ -0,0 +1,24 @@
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
+ description: 'Array of numbers to multiply.'
23
+ }
24
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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.
@@ -30,17 +30,17 @@ function getRandomInt(min, max) {
30
30
  function getRandomFloat(min, max) {
31
31
  return Math.random() * (Math.ceil(max) - Math.floor(min)) + Math.floor(min);
32
32
  }
33
- function evaluateDefaultNumber({ key, defaultValue, params, location }) {
33
+ function evaluateDefaultNumber({ key, defaultValue, params }) {
34
34
  if (type.isUndefined(params[key])) {
35
35
  params[key] = defaultValue;
36
36
  }
37
37
  if (!type.isNumber(params[key])) {
38
- throw new Error(`Operator Error: _random.${key} takes an number type. Received: ${JSON.stringify(params)} at ${location}.`);
38
+ throw new Error(`_random.${key} takes a number type.`);
39
39
  }
40
40
  }
41
- function _random({ location, params }) {
41
+ function _random({ params }) {
42
42
  if (!type.isString(params) && !type.isObject(params)) {
43
- throw new Error(`Operator Error: _random takes an string or object type. Received: ${JSON.stringify(params)} at ${location}.`);
43
+ throw new Error(`_random takes a string or object type.`);
44
44
  }
45
45
  if (!type.isObject(params)) {
46
46
  params = {
@@ -48,23 +48,21 @@ function _random({ location, params }) {
48
48
  };
49
49
  }
50
50
  if (!typesEnum.includes(params.type)) {
51
- throw new Error(`Operator Error: _random type can be either 'string', 'integer' or 'float'. Received: ${JSON.stringify(params)} at ${location}.`);
51
+ throw new Error(`_random type can be either 'string', 'integer' or 'float'.`);
52
52
  }
53
53
  if (params.type === 'float') {
54
54
  evaluateDefaultNumber({
55
55
  key: 'min',
56
56
  defaultValue: 0,
57
- params,
58
- location
57
+ params
59
58
  });
60
59
  evaluateDefaultNumber({
61
60
  key: 'max',
62
61
  defaultValue: params.min + 1,
63
- params,
64
- location
62
+ params
65
63
  });
66
64
  if (params.max < params.min) {
67
- throw new Error(`Operator Error: _random.min must be less than _random.max. Received: ${JSON.stringify(params)} at ${location}.`);
65
+ throw new Error(`_random.min must be less than _random.max.`);
68
66
  }
69
67
  return getRandomFloat(params.min, params.max);
70
68
  }
@@ -72,26 +70,24 @@ function _random({ location, params }) {
72
70
  evaluateDefaultNumber({
73
71
  key: 'min',
74
72
  defaultValue: 0,
75
- params,
76
- location
73
+ params
77
74
  });
78
75
  evaluateDefaultNumber({
79
76
  key: 'max',
80
77
  defaultValue: params.min + 100,
81
- params,
82
- location
78
+ params
83
79
  });
84
80
  if (params.max < params.min) {
85
- throw new Error(`Operator Error: _random.min must be less than _random.max. Received: ${JSON.stringify(params)} at ${location}.`);
81
+ throw new Error(`_random.min must be less than _random.max.`);
86
82
  }
87
83
  return getRandomInt(params.min, params.max);
88
84
  }
89
85
  evaluateDefaultNumber({
90
86
  key: 'length',
91
87
  defaultValue: 8,
92
- params,
93
- location
88
+ params
94
89
  });
95
90
  return generateRandomString(params.length);
96
91
  }
92
+ _random.dynamic = true;
97
93
  export default _random;
@@ -0,0 +1,60 @@
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
+ enum: [
22
+ 'string',
23
+ 'integer',
24
+ 'float'
25
+ ],
26
+ description: 'Type of random value to generate.'
27
+ },
28
+ {
29
+ type: 'object',
30
+ required: [
31
+ 'type'
32
+ ],
33
+ properties: {
34
+ type: {
35
+ type: 'string',
36
+ enum: [
37
+ 'string',
38
+ 'integer',
39
+ 'float'
40
+ ],
41
+ description: 'Type of random value to generate.'
42
+ },
43
+ length: {
44
+ type: 'number',
45
+ description: 'Length of random string (default 8). Only for type "string".'
46
+ },
47
+ min: {
48
+ type: 'number',
49
+ description: 'Minimum value (inclusive). Only for type "integer" or "float".'
50
+ },
51
+ max: {
52
+ type: 'number',
53
+ description: 'Maximum value (inclusive). Only for type "integer" or "float".'
54
+ }
55
+ },
56
+ additionalProperties: false
57
+ }
58
+ ]
59
+ }
60
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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.
@@ -16,12 +16,12 @@
16
16
  function _regex({ location, params, state }) {
17
17
  const pattern = type.isObject(params) ? params.pattern : params;
18
18
  if (!type.isString(pattern)) {
19
- throw new Error(`Operator Error: _regex.pattern must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
19
+ throw new Error(`_regex.pattern must be a string.`);
20
20
  }
21
21
  let on = !type.isUndefined(params.on) ? params.on : get(state, location);
22
22
  if (!type.isUndefined(params.key)) {
23
23
  if (!type.isString(params.key)) {
24
- throw new Error(`Operator Error: _regex.key must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
24
+ throw new Error(`_regex.key must be a string.`);
25
25
  }
26
26
  on = get(state, params.key);
27
27
  }
@@ -29,14 +29,16 @@ function _regex({ location, params, state }) {
29
29
  return false;
30
30
  }
31
31
  if (!type.isString(on)) {
32
- throw new Error(`Operator Error: _regex.on must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
32
+ throw new Error(`_regex.on must be a string.`);
33
33
  }
34
34
  try {
35
35
  const re = new RegExp(pattern, params.flags || 'gm');
36
36
  return re.test(on);
37
37
  } catch (e) {
38
- // log e to LowdefyError
39
- throw new Error(`Operator Error: _regex failed to execute RegExp.test. Received: ${JSON.stringify(params)} at ${location}.`);
38
+ throw new Error('_regex failed to execute RegExp.test.', {
39
+ cause: e
40
+ });
40
41
  }
41
42
  }
43
+ _regex.dynamic = true;
42
44
  export default _regex;
@@ -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: 'Regex pattern string to test against the current location value.'
22
+ },
23
+ {
24
+ type: 'object',
25
+ required: [
26
+ 'pattern'
27
+ ],
28
+ properties: {
29
+ pattern: {
30
+ type: 'string',
31
+ description: 'Regex pattern string.'
32
+ },
33
+ on: {
34
+ type: 'string',
35
+ description: 'String to test the pattern against.'
36
+ },
37
+ key: {
38
+ type: 'string',
39
+ description: 'State key path to get the string to test against.'
40
+ },
41
+ flags: {
42
+ type: 'string',
43
+ description: 'Regex flags (default "gm").'
44
+ }
45
+ },
46
+ additionalProperties: false
47
+ }
48
+ ]
49
+ }
50
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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 _state({ arrayIndices, location, params, state }) {
22
22
  params
23
23
  });
24
24
  }
25
+ _state.dynamic = true;
25
26
  export default _state;
@@ -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 state.'
22
+ },
23
+ {
24
+ type: 'integer',
25
+ description: 'Index to access in state.'
26
+ },
27
+ {
28
+ type: 'boolean',
29
+ enum: [
30
+ true
31
+ ],
32
+ description: 'Return all state.'
33
+ },
34
+ {
35
+ type: 'object',
36
+ properties: {
37
+ key: {
38
+ oneOf: [
39
+ {
40
+ type: 'string',
41
+ description: 'Dot-notation path to value in state.'
42
+ },
43
+ {
44
+ type: 'integer',
45
+ description: 'Index to access in state.'
46
+ }
47
+ ]
48
+ },
49
+ default: {
50
+ description: 'Default value if key does not exist.'
51
+ },
52
+ all: {
53
+ type: 'boolean',
54
+ description: 'Return all state.'
55
+ }
56
+ },
57
+ additionalProperties: false
58
+ }
59
+ ]
60
+ }
61
+ };
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2024 Lowdefy, Inc
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.
@@ -289,4 +289,5 @@ function _string({ params, location, methodName }) {
289
289
  instanceType: 'string'
290
290
  });
291
291
  }
292
+ _string.dynamic = false;
292
293
  export default _string;
@@ -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: 'String 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-2024 Lowdefy, Inc
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,16 +13,17 @@
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 _subtract({ params, location }) {
16
+ function _subtract({ params }) {
17
17
  if (!type.isArray(params)) {
18
- throw new Error(`Operator Error: _subtract takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
18
+ throw new Error(`_subtract takes an array type as input.`);
19
19
  }
20
20
  if (params.length !== 2) {
21
- throw new Error(`Operator Error: _subtract takes an array of length 2 as input. Received: ${JSON.stringify(params)} at ${location}.`);
21
+ throw new Error(`_subtract 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(`Operator Error: _subtract takes an array of 2 numbers. Received: ${JSON.stringify(params)} at ${location}.`);
24
+ throw new Error(`_subtract takes an array of 2 numbers.`);
25
25
  }
26
26
  return params[0] - params[1];
27
27
  }
28
+ _subtract.dynamic = false;
28
29
  export default _subtract;
@@ -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 minus the second.'
25
+ }
26
+ };