@lowdefy/operators-js 4.0.0-rc.1 → 4.0.0-rc.11
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/operators/build/env.js +1 -1
- package/dist/operators/client/_index.js +1 -1
- package/dist/operators/client/actions.js +1 -1
- package/dist/operators/client/base64.js +1 -1
- package/dist/operators/client/event.js +1 -1
- package/dist/operators/client/event_log.js +1 -1
- package/dist/operators/client/global.js +1 -1
- package/dist/operators/client/input.js +1 -1
- package/dist/operators/client/location.js +2 -2
- package/dist/operators/client/media.js +2 -2
- package/dist/operators/client/menu.js +1 -1
- package/dist/operators/client/request.js +1 -1
- package/dist/operators/client/request_details.js +1 -1
- package/dist/operators/client/state.js +1 -1
- package/dist/operators/client/url_query.js +2 -2
- package/dist/operators/server/base64.js +1 -1
- package/dist/operators/server/hash.js +1 -1
- package/dist/operators/server/payload.js +1 -1
- package/dist/operators/server/secret.js +2 -2
- package/dist/operators/shared/and.js +1 -1
- package/dist/operators/shared/args.js +1 -1
- package/dist/operators/shared/array.js +1 -1
- package/dist/operators/shared/date.js +1 -1
- package/dist/operators/shared/divide.js +1 -1
- package/dist/operators/shared/eq.js +1 -1
- package/dist/operators/shared/function.js +2 -2
- package/dist/operators/shared/get.js +1 -1
- package/dist/operators/shared/gt.js +1 -1
- package/dist/operators/shared/gte.js +1 -1
- package/dist/operators/shared/if.js +1 -1
- package/dist/operators/shared/if_none.js +1 -1
- package/dist/operators/shared/intl.js +2 -2
- package/dist/operators/shared/json.js +1 -1
- package/dist/operators/shared/log.js +1 -1
- package/dist/operators/shared/lt.js +1 -1
- package/dist/operators/shared/lte.js +1 -1
- package/dist/operators/shared/math.js +1 -1
- package/dist/operators/shared/ne.js +1 -1
- package/dist/operators/shared/not.js +1 -1
- package/dist/operators/shared/number.js +1 -1
- package/dist/operators/shared/object.js +1 -1
- package/dist/operators/shared/operator.js +1 -1
- package/dist/operators/shared/or.js +1 -1
- package/dist/operators/shared/product.js +1 -1
- package/dist/operators/shared/random.js +2 -2
- package/dist/operators/shared/regex.js +1 -1
- package/dist/operators/shared/string.js +1 -1
- package/dist/operators/shared/subtract.js +1 -1
- package/dist/operators/shared/sum.js +1 -1
- package/dist/operators/shared/switch.js +2 -2
- package/dist/operators/shared/type.js +1 -1
- package/dist/operators/shared/uri.js +1 -1
- package/dist/operators/shared/user.js +1 -1
- package/package.json +10 -10
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _env({ arrayIndices
|
|
16
|
+
function _env({ arrayIndices, env, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _index({ arrayIndices
|
|
16
|
+
function _index({ arrayIndices, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _actions({ actions
|
|
16
|
+
function _actions({ actions, arrayIndices, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _event({ arrayIndices
|
|
16
|
+
function _event({ arrayIndices, event, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _event_log({ arrayIndices
|
|
16
|
+
function _event_log({ arrayIndices, eventLog, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _global({ arrayIndices
|
|
16
|
+
function _global({ arrayIndices, location, lowdefyGlobal, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _input({ arrayIndices
|
|
16
|
+
function _input({ arrayIndices, input, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -27,8 +27,8 @@ const validProperties = [
|
|
|
27
27
|
'protocol',
|
|
28
28
|
'search'
|
|
29
29
|
];
|
|
30
|
-
function _location({ arrayIndices
|
|
31
|
-
const { window
|
|
30
|
+
function _location({ arrayIndices, basePath, home, location, pageId, params, globals }) {
|
|
31
|
+
const { window } = globals;
|
|
32
32
|
if (!window?.location) {
|
|
33
33
|
throw new Error(`Operator Error: Browser window.location not available for _location. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
34
34
|
}
|
|
@@ -20,8 +20,8 @@ const breakpoints = {
|
|
|
20
20
|
lg: 1200,
|
|
21
21
|
xl: 1600
|
|
22
22
|
};
|
|
23
|
-
function _media({ arrayIndices
|
|
24
|
-
const { window
|
|
23
|
+
function _media({ arrayIndices, location, params, globals }) {
|
|
24
|
+
const { window } = globals;
|
|
25
25
|
if (!window?.innerWidth) {
|
|
26
26
|
throw new Error(`Operator Error: device window width not available for _media. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
27
27
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromArray } from '@lowdefy/operators';
|
|
16
|
-
function _menu({ params
|
|
16
|
+
function _menu({ params, menus, location }) {
|
|
17
17
|
return getFromArray({
|
|
18
18
|
params,
|
|
19
19
|
array: menus,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { applyArrayIndices, get, serializer, type } from '@lowdefy/helpers';
|
|
16
|
-
function _request({ arrayIndices
|
|
16
|
+
function _request({ arrayIndices, params, requests, location }) {
|
|
17
17
|
if (!type.isString(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _request accepts a string value. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _request_details({ params
|
|
16
|
+
function _request_details({ params, requests, arrayIndices, location }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _state({ arrayIndices
|
|
16
|
+
function _state({ arrayIndices, location, params, state }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
16
|
import { urlQuery } from '@lowdefy/helpers';
|
|
17
|
-
function _url_query({ arrayIndices
|
|
18
|
-
const { window
|
|
17
|
+
function _url_query({ arrayIndices, globals, location, params }) {
|
|
18
|
+
const { window } = globals;
|
|
19
19
|
if (!window?.location) {
|
|
20
20
|
throw new Error(`Operator Error: Browser window.location not available for _url_query. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
21
21
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _payload({ location
|
|
16
|
+
function _payload({ location, params, payload }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
location,
|
|
19
19
|
object: payload,
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _secret({ location
|
|
16
|
+
function _secret({ location, params, secrets = {} }) {
|
|
17
17
|
if (params === true || params.all) {
|
|
18
18
|
throw new Error(`Operator Error: Getting all secrets is not allowed. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
20
20
|
// Filter out OpenID Connect and JSON web token secrets
|
|
21
21
|
// eslint-disable-next-line no-unused-vars
|
|
22
|
-
const { OPENID_CLIENT_SECRET
|
|
22
|
+
const { OPENID_CLIENT_SECRET, JWT_SECRET, ...rest } = secrets;
|
|
23
23
|
return getFromObject({
|
|
24
24
|
location,
|
|
25
25
|
object: {
|
|
@@ -13,7 +13,7 @@
|
|
|
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, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _and takes an array type. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _args({ args
|
|
16
|
+
function _args({ args, arrayIndices, location, params }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
|
@@ -13,7 +13,7 @@
|
|
|
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, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _divide takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _eq takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ function _function({ actions
|
|
15
|
+
*/ function _function({ actions, arrayIndices, event, location, operatorPrefix, params, parser }) {
|
|
16
16
|
return (...args)=>{
|
|
17
|
-
const { output
|
|
17
|
+
const { output, errors } = parser.parse({
|
|
18
18
|
actions,
|
|
19
19
|
arrayIndices,
|
|
20
20
|
args,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
16
|
import { getFromObject } from '@lowdefy/operators';
|
|
17
|
-
function _get({ arrayIndices
|
|
17
|
+
function _get({ arrayIndices, location, params }) {
|
|
18
18
|
if (!type.isObject(params)) {
|
|
19
19
|
throw new Error(`Operator Error: _get takes an object as params. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
20
20
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _gt({ params
|
|
16
|
+
function _gt({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _gt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _gte({ params
|
|
16
|
+
function _gte({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _gte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ function _if({ location
|
|
15
|
+
*/ function _if({ location, params }) {
|
|
16
16
|
if (params.test === true) {
|
|
17
17
|
return params.then;
|
|
18
18
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _if_none({ params
|
|
16
|
+
function _if_none({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _if_none takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { runClass } from '@lowdefy/operators';
|
|
16
|
-
function createFormatter({ IntlClass
|
|
16
|
+
function createFormatter({ IntlClass }) {
|
|
17
17
|
const formatter = (on, options, locale)=>{
|
|
18
18
|
return new IntlClass(locale, options).format(on);
|
|
19
19
|
};
|
|
@@ -81,7 +81,7 @@ const functions = {
|
|
|
81
81
|
}),
|
|
82
82
|
relativeTimeFormat
|
|
83
83
|
};
|
|
84
|
-
function intl({ params
|
|
84
|
+
function intl({ params, location, methodName }) {
|
|
85
85
|
return runClass({
|
|
86
86
|
functions,
|
|
87
87
|
location,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ function _log({ params
|
|
15
|
+
*/ function _log({ params }) {
|
|
16
16
|
// eslint-disable-next-line no-console
|
|
17
17
|
console.log(params);
|
|
18
18
|
return params;
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _lt({ params
|
|
16
|
+
function _lt({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _lt takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _lte({ params
|
|
16
|
+
function _lte({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _lte takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _ne({ params
|
|
16
|
+
function _ne({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _ne takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ function _not({ params
|
|
15
|
+
*/ function _not({ params }) {
|
|
16
16
|
return !params;
|
|
17
17
|
}
|
|
18
18
|
export default _not;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { type } from '@lowdefy/helpers';
|
|
16
16
|
function _operator(options) {
|
|
17
|
-
const { operators
|
|
17
|
+
const { operators, params, location } = options;
|
|
18
18
|
if (!type.isString(params.name)) {
|
|
19
19
|
throw new Error(`Operator Error: _operator.name must be a valid operator name as string. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
20
20
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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
|
|
16
|
+
function _or({ location, params }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _or takes an array type. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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
|
|
16
|
+
function _product({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _product takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -30,7 +30,7 @@ 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
|
|
33
|
+
function evaluateDefaultNumber({ key, defaultValue, params, location }) {
|
|
34
34
|
if (type.isUndefined(params[key])) {
|
|
35
35
|
params[key] = defaultValue;
|
|
36
36
|
}
|
|
@@ -38,7 +38,7 @@ function evaluateDefaultNumber({ key , defaultValue , params , location }) {
|
|
|
38
38
|
throw new Error(`Operator Error: _random.${key} takes an number type. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function _random({ location
|
|
41
|
+
function _random({ location, params }) {
|
|
42
42
|
if (!type.isString(params) && !type.isObject(params)) {
|
|
43
43
|
throw new Error(`Operator Error: _random takes an string or object type. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
44
44
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
|
-
function _regex({ location
|
|
16
|
+
function _regex({ location, params, state }) {
|
|
17
17
|
const pattern = type.isObject(params) ? params.pattern : params;
|
|
18
18
|
if (!type.isString(pattern)) {
|
|
19
19
|
throw new Error(`Operator Error: _regex.pattern must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
@@ -13,7 +13,7 @@
|
|
|
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
|
|
16
|
+
function _subtract({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _subtract takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
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 _sum({ params
|
|
16
|
+
function _sum({ params, location }) {
|
|
17
17
|
if (!type.isArray(params)) {
|
|
18
18
|
throw new Error(`Operator Error: _sum takes an array type as input. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
@@ -13,13 +13,13 @@
|
|
|
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 _switch({ location
|
|
16
|
+
function _switch({ location, params }) {
|
|
17
17
|
if (!type.isArray(params.branches)) {
|
|
18
18
|
throw new Error(`Operator Error: switch takes an array type as input for the branches. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
19
19
|
}
|
|
20
20
|
for (const branch of params.branches){
|
|
21
21
|
if (!type.isBoolean(branch.if)) {
|
|
22
|
-
throw new Error(`Operator Error: switch takes a boolean type for parameter
|
|
22
|
+
throw new Error(`Operator Error: switch takes a boolean type for parameter "if". Received: ${JSON.stringify(params)} at ${location}.`);
|
|
23
23
|
}
|
|
24
24
|
if (branch.if === true) {
|
|
25
25
|
return branch.then;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
|
-
function _type({ location
|
|
16
|
+
function _type({ location, params, state }) {
|
|
17
17
|
const typeName = type.isObject(params) ? params.type : params;
|
|
18
18
|
if (!type.isString(typeName)) {
|
|
19
19
|
throw new Error(`Operator Error: _type.type must be a string. Received: ${JSON.stringify(params)} at ${location}.`);
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import { getFromObject } from '@lowdefy/operators';
|
|
16
|
-
function _user({ arrayIndices
|
|
16
|
+
function _user({ arrayIndices, location, params, user }) {
|
|
17
17
|
return getFromObject({
|
|
18
18
|
arrayIndices,
|
|
19
19
|
location,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators-js",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.11",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
"test": "TZ=UTC node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
52
|
-
"@lowdefy/operators": "4.0.0-rc.
|
|
51
|
+
"@lowdefy/helpers": "4.0.0-rc.11",
|
|
52
|
+
"@lowdefy/operators": "4.0.0-rc.11"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@jest/globals": "28.1.
|
|
56
|
-
"@swc/cli": "0.1.
|
|
57
|
-
"@swc/core": "1.3.
|
|
58
|
-
"@swc/jest": "0.2.
|
|
59
|
-
"jest": "28.1.
|
|
60
|
-
"jest-environment-jsdom": "28.1.
|
|
55
|
+
"@jest/globals": "28.1.3",
|
|
56
|
+
"@swc/cli": "0.1.62",
|
|
57
|
+
"@swc/core": "1.3.92",
|
|
58
|
+
"@swc/jest": "0.2.29",
|
|
59
|
+
"jest": "28.1.3",
|
|
60
|
+
"jest-environment-jsdom": "28.1.3"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "dbc49d3688a6d2f44de25cc3f4bc071627f7ebfa"
|
|
66
66
|
}
|