@fibery/expression-utils 9.2.1 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +6 -0
- package/lib/index.js +44 -0
- package/lib/src/context-variables.d.ts +22 -0
- package/lib/src/context-variables.js +122 -0
- package/lib/src/errors.d.ts +4 -0
- package/lib/src/errors.js +15 -0
- package/lib/src/fieldExpressionVisitorTypeAware.d.ts +5 -0
- package/lib/src/fieldExpressionVisitorTypeAware.js +133 -0
- package/lib/src/params-placeholders.d.ts +55 -0
- package/lib/src/params-placeholders.js +204 -0
- package/lib/src/tsfixme.d.ts +1 -0
- package/lib/src/tsfixme.js +2 -0
- package/lib/src/types.d.ts +35 -0
- package/lib/src/types.js +2 -0
- package/lib/src/utils.d.ts +42 -0
- package/lib/src/utils.js +260 -0
- package/lib/src/visitors.d.ts +44 -0
- package/lib/src/visitors.js +382 -0
- package/lib/testData/schemaMock.d.ts +502 -0
- package/lib/testData/schemaMock.js +138 -0
- package/package.json +22 -22
- package/lib/contextVariables.js +0 -20
- package/lib/expression-utils.js +0 -1035
- package/lib/paramsPlaceholders.js +0 -232
- package/lib/utils.js +0 -223
- package/lib/visitors.js +0 -660
- package/types.d.ts +0 -119
package/package.json
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/expression-utils",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.0",
|
|
4
4
|
"description": "utils for working with fibery api expressions",
|
|
5
|
+
"main": "./lib/index.js",
|
|
6
|
+
"types": "./lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"./lib"
|
|
9
|
+
],
|
|
5
10
|
"exports": {
|
|
6
|
-
".":
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"./paramsPlaceholders": "./lib/paramsPlaceholders.js"
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"default": "./lib/index.js"
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
|
-
"types": "./types.d.ts",
|
|
13
16
|
"fiberyDevExports": {
|
|
14
|
-
".": "./index.
|
|
15
|
-
"./
|
|
16
|
-
"./
|
|
17
|
-
"./
|
|
18
|
-
"./
|
|
17
|
+
".": "./index.ts",
|
|
18
|
+
"./src/utils": "./src/utils.ts",
|
|
19
|
+
"./src/visitors": "./src/visitors.ts",
|
|
20
|
+
"./src/params-placeholders": "./src/params-placeholders.ts",
|
|
21
|
+
"./src/context-variables": "./src/context-variables.ts"
|
|
19
22
|
},
|
|
20
|
-
"main": "./lib/expression-utils.js",
|
|
21
|
-
"files": [
|
|
22
|
-
"/lib",
|
|
23
|
-
"types.d.ts"
|
|
24
|
-
],
|
|
25
23
|
"private": false,
|
|
26
24
|
"dependencies": {
|
|
27
25
|
"lodash": "4.17.21",
|
|
@@ -30,11 +28,13 @@
|
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
30
|
"@babel/core": "7.23.9",
|
|
31
|
+
"@types/lodash": "4.14.172",
|
|
33
32
|
"@swc/jest": "0.2.29",
|
|
34
33
|
"jest": "27.5.1",
|
|
35
34
|
"jest-junit": "13.0.0",
|
|
36
|
-
"
|
|
35
|
+
"typescript": "5.8.3",
|
|
37
36
|
"@fibery/babel-preset": "7.4.0",
|
|
37
|
+
"@fibery/schema": "10.2.8",
|
|
38
38
|
"@fibery/eslint-config": "8.6.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
"testURL": "http://localhost"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
|
-
"build": "rm -rf lib &&
|
|
83
|
-
"test": "
|
|
84
|
-
"test:ci": "
|
|
85
|
-
"test:coverage": "
|
|
82
|
+
"build": "rm -rf lib && pnpm exec tsc --project tsconfig.build.json",
|
|
83
|
+
"test": "jest",
|
|
84
|
+
"test:ci": "jest --reporters=default --reporters=jest-junit",
|
|
85
|
+
"test:coverage": "jest --coverage --coverageDirectory=${JEST_COVERAGE_RESULT_DIR:-$(pwd)}/coverage/formulas --reporters=default --reporters=jest-junit",
|
|
86
86
|
"lint": "eslint ."
|
|
87
87
|
}
|
|
88
88
|
}
|
package/lib/contextVariables.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var _ = require('lodash');
|
|
2
|
-
|
|
3
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
4
|
-
|
|
5
|
-
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
6
|
-
|
|
7
|
-
const getEntityQueryVariables = schema => {
|
|
8
|
-
const grouped = ___default["default"].groupBy(schema.typeObjects.filter(x => x.isDomain), typeObject => typeObject.pluralTitle);
|
|
9
|
-
return ___default["default"].flatten(Object.values(grouped).map(group => {
|
|
10
|
-
return group.map(typeObject => ({
|
|
11
|
-
typeObject,
|
|
12
|
-
id: `entityQuery_${typeObject.id}`,
|
|
13
|
-
title: group.length > 1 ? `${typeObject.pluralTitle} (${typeObject.nameParts.namespace})` : typeObject.pluralTitle,
|
|
14
|
-
isCollection: true,
|
|
15
|
-
description: `All Entities from "${typeObject.title}" Database`
|
|
16
|
-
}));
|
|
17
|
-
}));
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
exports.getEntityQueryVariables = getEntityQueryVariables;
|