@fibery/expression-utils 15.0.0 → 16.0.1
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/select.test-d.d.ts +6 -0
- package/lib/select.test-d.js +15 -0
- package/lib/types.d.ts +9 -5
- package/package.json +4 -4
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/select.test-d.ts
|
|
2
|
+
const nestedProjection = { tasks: {
|
|
3
|
+
"q/from": ["tasks"],
|
|
4
|
+
"q/limit": 10,
|
|
5
|
+
"q/select": { owner: {
|
|
6
|
+
"fibery/id": ["owner", "fibery/id"],
|
|
7
|
+
avatar: {
|
|
8
|
+
"q/from": ["owner", "avatar"],
|
|
9
|
+
"q/select": { name: ["name"] }
|
|
10
|
+
}
|
|
11
|
+
} }
|
|
12
|
+
} };
|
|
13
|
+
const invalidProjection = { invalid: true };
|
|
14
|
+
//#endregion
|
|
15
|
+
export { invalidProjection, nestedProjection };
|
package/lib/types.d.ts
CHANGED
|
@@ -15,7 +15,13 @@ type FromRootExpression = ["q/from-root", ...FieldExpression[]];
|
|
|
15
15
|
type Expression = string | Expression[] | FieldExpression | FunctionCallExpression | FromRootExpression;
|
|
16
16
|
type OrderBy = Array<[Expression, string] | [Expression, string, string]>;
|
|
17
17
|
type QueryLimit = number | "q/no-limit";
|
|
18
|
-
type Select =
|
|
18
|
+
type Select = {
|
|
19
|
+
[field: string]: Expression | SubQuery | Select;
|
|
20
|
+
};
|
|
21
|
+
declare const projected: unique symbol;
|
|
22
|
+
type Projection<T extends object = FiberyObject> = Select & {
|
|
23
|
+
readonly [projected]?: T;
|
|
24
|
+
};
|
|
19
25
|
type Query = {
|
|
20
26
|
"q/from": string;
|
|
21
27
|
"q/select"?: Expression | Select;
|
|
@@ -55,12 +61,10 @@ type FiberyAutocompletes = {
|
|
|
55
61
|
"fibery/public-id"?: PublicId;
|
|
56
62
|
"fibery/rank"?: number;
|
|
57
63
|
__NOTHING_INTERESTING__TitleField__?: string;
|
|
64
|
+
"icon/icon"?: string | null;
|
|
58
65
|
};
|
|
59
66
|
type FiberyObject = FiberyIdentity & FiberyAutocompletes & {
|
|
60
67
|
[field: string]: unknown;
|
|
61
68
|
};
|
|
62
|
-
type FiberyObjectYOLO = FiberyIdentity & FiberyAutocompletes & {
|
|
63
|
-
[field: string]: any;
|
|
64
|
-
};
|
|
65
69
|
//#endregion
|
|
66
|
-
export { Expression, ExpressionVisitor, ExpressionVisitorWithDefault, FiberyObject,
|
|
70
|
+
export { Expression, ExpressionVisitor, ExpressionVisitorWithDefault, FiberyObject, FieldExpression, FromRootExpression, FunctionCallExpression, FunctionsMeta, MultiFieldAccess, OrderBy, Projection, Query, QueryLimit, Select, SubQuery };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/expression-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "utils for working with fibery api expressions",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"files": [
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"lodash": "4.17.21",
|
|
29
|
-
"moment": "2.
|
|
29
|
+
"moment": "2.31.0",
|
|
30
30
|
"uuid": "11.1.0",
|
|
31
|
-
"@fibery/helpers": "4.
|
|
31
|
+
"@fibery/helpers": "4.1.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@fibery/schema": "12.0.
|
|
34
|
+
"@fibery/schema": "12.0.2"
|
|
35
35
|
}
|
|
36
36
|
}
|