@lowdefy/operators-js 4.0.0-rc.0 → 4.0.0-rc.10

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 (59) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/operators/build/env.js +2 -2
  3. package/dist/operators/client/_index.js +2 -2
  4. package/dist/operators/client/actions.js +2 -2
  5. package/dist/operators/client/base64.js +2 -2
  6. package/dist/operators/client/event.js +2 -2
  7. package/dist/operators/client/event_log.js +2 -2
  8. package/dist/operators/client/global.js +2 -2
  9. package/dist/operators/client/input.js +2 -2
  10. package/dist/operators/client/location.js +4 -4
  11. package/dist/operators/client/media.js +3 -3
  12. package/dist/operators/client/menu.js +2 -2
  13. package/dist/operators/client/request.js +2 -2
  14. package/dist/operators/client/request_details.js +2 -2
  15. package/dist/operators/client/state.js +2 -2
  16. package/dist/operators/client/url_query.js +3 -3
  17. package/dist/operators/server/base64.js +2 -2
  18. package/dist/operators/server/hash.js +2 -2
  19. package/dist/operators/server/payload.js +2 -2
  20. package/dist/operators/server/secret.js +3 -3
  21. package/dist/operators/shared/and.js +2 -2
  22. package/dist/operators/shared/args.js +2 -2
  23. package/dist/operators/shared/array.js +2 -2
  24. package/dist/operators/shared/date.js +2 -2
  25. package/dist/operators/shared/divide.js +2 -2
  26. package/dist/operators/shared/eq.js +2 -2
  27. package/dist/operators/shared/function.js +3 -3
  28. package/dist/operators/shared/get.js +2 -2
  29. package/dist/operators/shared/gt.js +2 -2
  30. package/dist/operators/shared/gte.js +2 -2
  31. package/dist/operators/shared/if.js +2 -2
  32. package/dist/operators/shared/if_none.js +2 -2
  33. package/dist/operators/shared/intl.js +3 -3
  34. package/dist/operators/shared/json.js +2 -2
  35. package/dist/operators/shared/log.js +2 -2
  36. package/dist/operators/shared/lt.js +2 -2
  37. package/dist/operators/shared/lte.js +2 -2
  38. package/dist/operators/shared/math.js +2 -2
  39. package/dist/operators/shared/ne.js +2 -2
  40. package/dist/operators/shared/not.js +2 -2
  41. package/dist/operators/shared/number.js +2 -2
  42. package/dist/operators/shared/object.js +2 -2
  43. package/dist/operators/shared/operator.js +2 -2
  44. package/dist/operators/shared/or.js +2 -2
  45. package/dist/operators/shared/product.js +2 -2
  46. package/dist/operators/shared/random.js +3 -3
  47. package/dist/operators/shared/regex.js +2 -2
  48. package/dist/operators/shared/string.js +2 -2
  49. package/dist/operators/shared/subtract.js +2 -2
  50. package/dist/operators/shared/sum.js +2 -2
  51. package/dist/operators/shared/switch.js +3 -3
  52. package/dist/operators/shared/type.js +2 -2
  53. package/dist/operators/shared/uri.js +2 -2
  54. package/dist/operators/shared/user.js +2 -2
  55. package/dist/operatorsBuild.js +1 -1
  56. package/dist/operatorsClient.js +1 -1
  57. package/dist/operatorsServer.js +1 -1
  58. package/dist/types.js +1 -1
  59. package/package.json +11 -10
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , env , location , params }) {
16
+ function _env({ arrayIndices, env, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location , params }) {
16
+ function _index({ arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , arrayIndices , location , params }) {
16
+ function _actions({ actions, arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -37,7 +37,7 @@ const meta = {
37
37
  ]
38
38
  }
39
39
  };
40
- function _base64({ params , location , methodName }) {
40
+ function _base64({ params, location, methodName }) {
41
41
  return runClass({
42
42
  functions,
43
43
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , event , location , params }) {
16
+ function _event({ arrayIndices, event, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , eventLog , location , params }) {
16
+ function _event_log({ arrayIndices, eventLog, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location , lowdefyGlobal , params }) {
16
+ function _global({ arrayIndices, location, lowdefyGlobal, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , input , location , params }) {
16
+ function _input({ arrayIndices, input, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -25,10 +25,10 @@ const validProperties = [
25
25
  'pathname',
26
26
  'port',
27
27
  'protocol',
28
- 'search',
28
+ 'search'
29
29
  ];
30
- function _location({ arrayIndices , basePath , home , location , pageId , params , globals }) {
31
- const { window } = globals;
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -20,8 +20,8 @@ const breakpoints = {
20
20
  lg: 1200,
21
21
  xl: 1600
22
22
  };
23
- function _media({ arrayIndices , location , params , globals }) {
24
- const { window } = globals;
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , menus , location }) {
16
+ function _menu({ params, menus, location }) {
17
17
  return getFromArray({
18
18
  params,
19
19
  array: menus,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params , requests , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , requests , arrayIndices , location }) {
16
+ function _request_details({ params, requests, arrayIndices, location }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location , params , state }) {
16
+ function _state({ arrayIndices, location, params, state }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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 , globals , location , params }) {
18
- const { window } = globals;
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -39,7 +39,7 @@ const meta = {
39
39
  ]
40
40
  }
41
41
  };
42
- function _base64({ params , location , methodName }) {
42
+ function _base64({ params, location, methodName }) {
43
43
  return runClass({
44
44
  functions,
45
45
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -71,7 +71,7 @@ const meta = {
71
71
  singleArg: true
72
72
  }
73
73
  };
74
- function _hash({ params , location , methodName }) {
74
+ function _hash({ params, location, methodName }) {
75
75
  return runClass({
76
76
  functions,
77
77
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params , payload }) {
16
+ function _payload({ location, params, payload }) {
17
17
  return getFromObject({
18
18
  location,
19
19
  object: payload,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params , secrets ={} }) {
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 , JWT_SECRET , ...rest } = secrets;
22
+ const { OPENID_CLIENT_SECRET, JWT_SECRET, ...rest } = secrets;
23
23
  return getFromObject({
24
24
  location,
25
25
  object: {
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , arrayIndices , location , params }) {
16
+ function _args({ args, arrayIndices, location, params }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -250,7 +250,7 @@ const meta = {
250
250
  property: true
251
251
  }
252
252
  };
253
- function _array({ params , location , methodName }) {
253
+ function _array({ params, location, methodName }) {
254
254
  return runInstance({
255
255
  location,
256
256
  meta,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -421,7 +421,7 @@ const meta = {
421
421
  ]
422
422
  }
423
423
  };
424
- function _date({ params , location , methodName }) {
424
+ function _date({ params, location, methodName }) {
425
425
  if ([
426
426
  'now',
427
427
  'parse',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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 , arrayIndices , event , location , operatorPrefix , params , parser }) {
15
+ */ function _function({ actions, arrayIndices, event, location, operatorPrefix, params, parser }) {
16
16
  return (...args)=>{
17
- const { output , errors } = parser.parse({
17
+ const { output, errors } = parser.parse({
18
18
  actions,
19
19
  arrayIndices,
20
20
  args,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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 , location , params }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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 , params }) {
15
+ */ function _if({ location, params }) {
16
16
  if (params.test === true) {
17
17
  return params.then;
18
18
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location , methodName }) {
84
+ function intl({ params, location, methodName }) {
85
85
  return runClass({
86
86
  functions,
87
87
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -47,7 +47,7 @@ const meta = {
47
47
  ]
48
48
  }
49
49
  };
50
- function _json({ params , location , methodName }) {
50
+ function _json({ params, location, methodName }) {
51
51
  return runClass({
52
52
  functions,
53
53
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -258,7 +258,7 @@ const meta = {
258
258
  property: true
259
259
  }
260
260
  };
261
- function _math({ params , location , methodName }) {
261
+ function _math({ params, location, methodName }) {
262
262
  return runClass({
263
263
  functions: Math,
264
264
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -117,7 +117,7 @@ const meta = {
117
117
  ]
118
118
  }
119
119
  };
120
- function _number({ params , location , methodName }) {
120
+ function _number({ params, location, methodName }) {
121
121
  if ([
122
122
  'toExponential',
123
123
  'toFixed',
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -106,7 +106,7 @@ const metaClass = {
106
106
  prep
107
107
  }
108
108
  };
109
- function _object({ params , location , methodName }) {
109
+ function _object({ params, location, methodName }) {
110
110
  if (methodName === 'hasOwnProperty') {
111
111
  return runInstance({
112
112
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -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 , params , location } = options;
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , defaultValue , params , location }) {
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 , params }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params , state }) {
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}.`);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -279,7 +279,7 @@ const meta = {
279
279
  prep
280
280
  }
281
281
  };
282
- function _string({ params , location , methodName }) {
282
+ function _string({ params, location, methodName }) {
283
283
  return runInstance({
284
284
  location,
285
285
  meta,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location }) {
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
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params }) {
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 test. Received: ${JSON.stringify(params)} at ${location}.`);
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;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , params , state }) {
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}.`);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -37,7 +37,7 @@ const meta = {
37
37
  ]
38
38
  }
39
39
  };
40
- function _uri({ params , location , methodName }) {
40
+ function _uri({ params, location, methodName }) {
41
41
  return runClass({
42
42
  functions,
43
43
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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,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 , location , params , user }) {
16
+ function _user({ arrayIndices, location, params, user }) {
17
17
  return getFromObject({
18
18
  arrayIndices,
19
19
  location,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2022 Lowdefy, Inc
2
+ Copyright 2020-2023 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators-js",
3
- "version": "4.0.0-rc.0",
3
+ "version": "4.0.0-rc.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -45,21 +45,22 @@
45
45
  "build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
46
46
  "clean": "rm -rf dist",
47
47
  "prepublishOnly": "pnpm build",
48
- "test": "TZ=UTC jest --coverage"
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.0",
52
- "@lowdefy/operators": "4.0.0-rc.0"
51
+ "@lowdefy/helpers": "4.0.0-rc.10",
52
+ "@lowdefy/operators": "4.0.0-rc.10"
53
53
  },
54
54
  "devDependencies": {
55
- "@swc/cli": "0.1.57",
56
- "@swc/core": "1.2.194",
57
- "@swc/jest": "0.2.21",
58
- "jest": "28.1.0",
59
- "jest-environment-jsdom": "28.1.0"
55
+ "@jest/globals": "28.1.3",
56
+ "@swc/cli": "0.1.62",
57
+ "@swc/core": "1.3.70",
58
+ "@swc/jest": "0.2.27",
59
+ "jest": "28.1.3",
60
+ "jest-environment-jsdom": "28.1.3"
60
61
  },
61
62
  "publishConfig": {
62
63
  "access": "public"
63
64
  },
64
- "gitHead": "f6872d7ff6da421710096536fce7b2016ef8f35c"
65
+ "gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
65
66
  }