@lowdefy/operators 4.0.0-rc.9 → 4.0.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,7 +16,7 @@
16
16
  let BuildParser = class BuildParser {
17
17
  // TODO: Look at logging here
18
18
  // TODO: Remove console.error = () => {}; from tests
19
- parse({ args , input , location , operatorPrefix ='_' }) {
19
+ parse({ args, input, location, operatorPrefix = '_' }) {
20
20
  if (type.isUndefined(input)) {
21
21
  return {
22
22
  output: input,
@@ -71,7 +71,7 @@ let BuildParser = class BuildParser {
71
71
  errors
72
72
  };
73
73
  }
74
- constructor({ env , payload , secrets , user , operators , verbose }){
74
+ constructor({ env, payload, secrets, user, operators, verbose }){
75
75
  this.env = env;
76
76
  this.operators = operators;
77
77
  this.parse = this.parse.bind(this);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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 getFromArray({ params , array , key , operator , location }) {
16
+ function getFromArray({ params, array, key, operator, location }) {
17
17
  if (params === true) return array;
18
18
  if (type.isString(params)) {
19
19
  return array.find((item)=>item[key] === params);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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 getFromObject({ params , object , arrayIndices , operator , location }) {
16
+ function getFromObject({ params, object, arrayIndices, operator, location }) {
17
17
  if (params === true) params = {
18
18
  all: true
19
19
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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/runClass.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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
- const runClass = ({ location , meta , methodName , operator , params , functions , defaultFunction })=>{
16
+ const runClass = ({ location, meta, methodName, operator, params, functions, defaultFunction })=>{
17
17
  if (!methodName) {
18
18
  if (meta[params]) {
19
19
  methodName = params;
@@ -69,8 +69,8 @@ const runClass = ({ location , meta , methodName , operator , params , functions
69
69
  }
70
70
  try {
71
71
  return functions[methodName](...args);
72
- } catch (e1) {
73
- throw new Error(`Operator Error: ${operator}.${methodName} - ${e1.message} Received: {"${operator}.${methodName}":${JSON.stringify(params)}} at ${location}.`);
72
+ } catch (e) {
73
+ throw new Error(`Operator Error: ${operator}.${methodName} - ${e.message} Received: {"${operator}.${methodName}":${JSON.stringify(params)}} at ${location}.`);
74
74
  }
75
75
  };
76
76
  export default runClass;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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
- const runInstance = ({ location , meta , methodName , operator , params , instanceType })=>{
16
+ const runInstance = ({ location, meta, methodName, operator, params, instanceType })=>{
17
17
  if (!meta[methodName]) {
18
18
  throw new Error(`Operator Error: ${operator}.${methodName} is not supported, use one of the following: ${Object.keys(meta).join(', ')}.
19
19
  Received: {"${operator}.${methodName}":${JSON.stringify(params)}} at ${location}.`);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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,7 +16,7 @@
16
16
  let ServerParser = class ServerParser {
17
17
  // TODO: Look at logging here
18
18
  // TODO: Remove console.error = () => {}; from tests
19
- parse({ args , input , location , operatorPrefix ='_' }) {
19
+ parse({ args, input, location, operatorPrefix = '_' }) {
20
20
  if (type.isUndefined(input)) {
21
21
  return {
22
22
  output: input,
@@ -72,7 +72,7 @@ let ServerParser = class ServerParser {
72
72
  errors
73
73
  };
74
74
  }
75
- constructor({ env , payload , secrets , user , operators , verbose }){
75
+ constructor({ env, payload, secrets, user, operators, verbose }){
76
76
  this.env = env;
77
77
  this.operators = operators;
78
78
  this.payload = payload;
package/dist/webParser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Copyright 2020-2023 Lowdefy, Inc
2
+ Copyright 2020-2024 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 { applyArrayIndices, serializer, type } from '@lowdefy/helpers';
16
16
  let WebParser = class WebParser {
17
- parse({ actions , args , arrayIndices , event , input , location , operatorPrefix ='_' }) {
17
+ parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
18
18
  if (type.isUndefined(input)) {
19
19
  return {
20
20
  output: input,
@@ -31,7 +31,7 @@ let WebParser = class WebParser {
31
31
  throw new Error('Operator parser location must be a string.');
32
32
  }
33
33
  const errors = [];
34
- const { basePath , home , inputs , lowdefyGlobal , menus , pageId , user , _internal } = this.context._internal.lowdefy;
34
+ const { basePath, home, inputs, lowdefyGlobal, menus, pageId, user, _internal } = this.context._internal.lowdefy;
35
35
  const reviver = (_, value)=>{
36
36
  if (!type.isObject(value)) return value;
37
37
  // TODO: pass ~k in errors.
@@ -54,8 +54,8 @@ let WebParser = class WebParser {
54
54
  home,
55
55
  input: inputs[this.context.id],
56
56
  location: applyArrayIndices(arrayIndices, location),
57
- lowdefyGlobal: lowdefyGlobal,
58
- menus: menus,
57
+ lowdefyGlobal,
58
+ menus,
59
59
  methodName,
60
60
  operatorPrefix,
61
61
  operators: this.operators,
@@ -81,7 +81,7 @@ let WebParser = class WebParser {
81
81
  errors
82
82
  };
83
83
  }
84
- constructor({ context , operators }){
84
+ constructor({ context, operators }){
85
85
  this.context = context;
86
86
  this.operators = operators;
87
87
  this.parse = this.parse.bind(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowdefy/operators",
3
- "version": "4.0.0-rc.9",
3
+ "version": "4.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "",
6
6
  "homepage": "https://lowdefy.com",
@@ -33,25 +33,23 @@
33
33
  "files": [
34
34
  "dist/*"
35
35
  ],
36
- "scripts": {
37
- "build": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
38
- "clean": "rm -rf dist",
39
- "prepublishOnly": "pnpm build",
40
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testTimeout=10000"
41
- },
42
36
  "dependencies": {
43
- "@lowdefy/helpers": "4.0.0-rc.9"
37
+ "@lowdefy/helpers": "4.0.0"
44
38
  },
45
39
  "devDependencies": {
46
- "@jest/globals": "28.1.0",
47
- "@swc/cli": "0.1.59",
48
- "@swc/core": "1.3.24",
49
- "@swc/jest": "0.2.24",
50
- "jest": "28.1.0",
51
- "jest-environment-jsdom": "28.1.0"
40
+ "@jest/globals": "28.1.3",
41
+ "@swc/cli": "0.1.63",
42
+ "@swc/core": "1.3.99",
43
+ "@swc/jest": "0.2.29",
44
+ "jest": "28.1.3",
45
+ "jest-environment-jsdom": "28.1.3"
52
46
  },
53
47
  "publishConfig": {
54
48
  "access": "public"
55
49
  },
56
- "gitHead": "d20e6ac424643feca527a732dc2b0710713c8243"
57
- }
50
+ "scripts": {
51
+ "build": "swc src --out-dir dist --config-file ../../.swcrc --delete-dir-on-start",
52
+ "clean": "rm -rf dist",
53
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --testTimeout=10000"
54
+ }
55
+ }