@wix/wix-data-items-common 1.0.203 → 1.0.205
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/cjs/api/stages/ProjectStage.js +4 -4
- package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
- package/dist/esm/api/stages/ProjectStage.js +4 -4
- package/dist/esm/api/stages/ProjectStage.js.map +1 -1
- package/dist/types/api/stages/ProjectStage.d.ts +50 -4
- package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -32,12 +32,12 @@ class ProjectStageImpl {
|
|
|
32
32
|
});
|
|
33
33
|
return this;
|
|
34
34
|
}
|
|
35
|
-
reshape(expression,
|
|
36
|
-
this.addField(expression,
|
|
35
|
+
reshape(expression, resultFieldName) {
|
|
36
|
+
this.addField(expression, resultFieldName);
|
|
37
37
|
return this;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
return this.addNestedProjectionField(
|
|
39
|
+
projectNested(stage, resultFieldName) {
|
|
40
|
+
return this.addNestedProjectionField(resultFieldName, stage.fields);
|
|
41
41
|
}
|
|
42
42
|
addField(expression, resultFieldName) {
|
|
43
43
|
this.fields.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","addField","
|
|
1
|
+
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","toProto","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n /**\n * Fields to include in the result.\n *\n * When specified, the result includes only the specified fields. All other fields are excluded.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to include in the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n include(...fieldNames: string[]): ProjectStage\n /**\n * Fields to exclude from the result.\n *\n * When specified, excludes the specified field from the result. All other fields are included.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to exclude from the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n exclude(...fieldNames: string[]): ProjectStage\n /**\n * Reshapes a new field based on the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to resolve. The result of the expression becomes the value of the new field.\n * @param resultFieldName - Key of the field to create in the result.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n reshape(expression: Expression, resultFieldName: string): ProjectStage\n /**\n * Creates nested fields by including, excluding, or reshaping fields.\n *\n * @public\n * @documentationMaturity preview\n * @param stage - Projected stage to nest.\n * @param resultFieldName - Key of the field in which to nest the projected stage.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage\n}\n\nexport class ProjectStageImpl implements ProjectStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n reshape(expression: Expression, resultFieldName: string): ProjectStage {\n this.addField(expression, resultFieldName)\n return this\n }\n\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage {\n return this.addNestedProjectionField(resultFieldName, stage.fields)\n }\n\n private addField(\n expression: Expression,\n resultFieldName: string\n ): ProjectStage {\n this.fields.push({\n reshape: { resultFieldName, expression: expression.toProto() },\n })\n return this\n }\n\n private addNestedProjectionField(\n resultFieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectNested: { resultFieldName, fields } })\n return this\n }\n\n /** @private */\n toProto(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;;AA0DO,MAAMA,gBAAgB,CAAyB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACzB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEL,OAAO,EAAE;UAAEG;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAG,OAAOA,CAAC,GAAGL,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEC,OAAO,EAAE;UAAEH;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAI,OAAOA,CAACC,UAAsB,EAAEC,eAAuB,EAAgB;IACrE,IAAI,CAACC,QAAQ,CAACF,UAAU,EAAEC,eAAe,CAAC;IAC1C,OAAO,IAAI;EACb;EAEAE,aAAaA,CAACC,KAAmB,EAAEH,eAAuB,EAAgB;IACxE,OAAO,IAAI,CAACI,wBAAwB,CAACJ,eAAe,EAAEG,KAAK,CAACR,MAAM,CAAC;EACrE;EAEQM,QAAQA,CACdF,UAAsB,EACtBC,eAAuB,EACT;IACd,IAAI,CAACL,MAAM,CAACC,IAAI,CAAC;MACfE,OAAO,EAAE;QAAEE,eAAe;QAAED,UAAU,EAAEA,UAAU,CAACM,OAAO,CAAC;MAAE;IAC/D,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEQD,wBAAwBA,CAC9BJ,eAAuB,EACvBL,MAAwB,EACV;IACd,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC;MAAEM,aAAa,EAAE;QAAEF,eAAe;QAAEL;MAAO;IAAE,CAAC,CAAC;IAChE,OAAO,IAAI;EACb;;EAEA;EACAU,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,UAAU,EAAE;QAAEX,MAAM,EAAE,IAAI,CAACA;MAAO;IAAE,CAAC;EAChD;AACF;AAACY,OAAA,CAAApB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -14,12 +14,12 @@ export class ProjectStageImpl {
|
|
|
14
14
|
});
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
17
|
-
reshape(expression,
|
|
18
|
-
this.addField(expression,
|
|
17
|
+
reshape(expression, resultFieldName) {
|
|
18
|
+
this.addField(expression, resultFieldName);
|
|
19
19
|
return this;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
return this.addNestedProjectionField(
|
|
21
|
+
projectNested(stage, resultFieldName) {
|
|
22
|
+
return this.addNestedProjectionField(resultFieldName, stage.fields);
|
|
23
23
|
}
|
|
24
24
|
addField(expression, resultFieldName) {
|
|
25
25
|
this.fields.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectStage.js","sourceRoot":"","sources":["../../../../src/api/stages/ProjectStage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProjectStage.js","sourceRoot":"","sources":["../../../../src/api/stages/ProjectStage.ts"],"names":[],"mappings":"AAgEA,MAAM,OAAO,gBAAgB;IA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AE,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAA;IAChD,CAAC;CACF"}
|
|
@@ -9,17 +9,63 @@ export interface ProjectStage extends PipelineStage {
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
fields: apiTypes.Field[];
|
|
12
|
+
/**
|
|
13
|
+
* Fields to include in the result.
|
|
14
|
+
*
|
|
15
|
+
* When specified, the result includes only the specified fields. All other fields are excluded.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
* @documentationMaturity preview
|
|
19
|
+
* @param fieldNames - Key of the field to include in the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.
|
|
20
|
+
*
|
|
21
|
+
* Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).
|
|
22
|
+
* @returns ProjectStage object.
|
|
23
|
+
*/
|
|
12
24
|
include(...fieldNames: string[]): ProjectStage;
|
|
25
|
+
/**
|
|
26
|
+
* Fields to exclude from the result.
|
|
27
|
+
*
|
|
28
|
+
* When specified, excludes the specified field from the result. All other fields are included.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
* @documentationMaturity preview
|
|
32
|
+
* @param fieldNames - Key of the field to exclude from the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.
|
|
33
|
+
*
|
|
34
|
+
* Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).
|
|
35
|
+
* @returns ProjectStage object.
|
|
36
|
+
*/
|
|
13
37
|
exclude(...fieldNames: string[]): ProjectStage;
|
|
14
|
-
|
|
15
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Reshapes a new field based on the specified expression.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
* @documentationMaturity preview
|
|
43
|
+
* @param expression - Expression to resolve. The result of the expression becomes the value of the new field.
|
|
44
|
+
* @param resultFieldName - Key of the field to create in the result.
|
|
45
|
+
*
|
|
46
|
+
* Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).
|
|
47
|
+
* @returns ProjectStage object.
|
|
48
|
+
*/
|
|
49
|
+
reshape(expression: Expression, resultFieldName: string): ProjectStage;
|
|
50
|
+
/**
|
|
51
|
+
* Creates nested fields by including, excluding, or reshaping fields.
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
* @documentationMaturity preview
|
|
55
|
+
* @param stage - Projected stage to nest.
|
|
56
|
+
* @param resultFieldName - Key of the field in which to nest the projected stage.
|
|
57
|
+
*
|
|
58
|
+
* Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).
|
|
59
|
+
* @returns ProjectStage object.
|
|
60
|
+
*/
|
|
61
|
+
projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage;
|
|
16
62
|
}
|
|
17
63
|
export declare class ProjectStageImpl implements ProjectStage {
|
|
18
64
|
fields: apiTypes.Field[];
|
|
19
65
|
include(...fieldNames: string[]): ProjectStage;
|
|
20
66
|
exclude(...fieldNames: string[]): ProjectStage;
|
|
21
|
-
reshape(expression: Expression,
|
|
22
|
-
|
|
67
|
+
reshape(expression: Expression, resultFieldName: string): ProjectStage;
|
|
68
|
+
projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage;
|
|
23
69
|
private addField;
|
|
24
70
|
private addNestedProjectionField;
|
|
25
71
|
/** @private */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectStage.d.ts","sourceRoot":"","sources":["../../../../src/api/stages/ProjectStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,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AAe;IACf,OAAO,IAAI,QAAQ,CAAC,KAAK;CAG1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/wix-data-items-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.205",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rimvydas Gimbutas",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@babel/runtime": "^7.28.2",
|
|
33
33
|
"@types/kind-of": "^6.0.3",
|
|
34
34
|
"@types/safe-json-stringify": "^1.1.5",
|
|
35
|
-
"@wix/filter-builder": "1.0.
|
|
35
|
+
"@wix/filter-builder": "1.0.183",
|
|
36
36
|
"kind-of": "^6.0.3",
|
|
37
37
|
"safe-json-stringify": "^1.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/jest": "^29.5.14",
|
|
41
|
-
"@types/node": "^18.19.
|
|
41
|
+
"@types/node": "^18.19.121",
|
|
42
42
|
"@wix/eslint-config-yoshi": "^6.154.0",
|
|
43
43
|
"@wix/jest-yoshi-preset": "^6.154.0",
|
|
44
44
|
"@wix/yoshi-flow-library": "^6.154.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"wallaby": {
|
|
86
86
|
"autoDetect": true
|
|
87
87
|
},
|
|
88
|
-
"falconPackageHash": "
|
|
88
|
+
"falconPackageHash": "d3bdfdd6a2d2207601482420dc63627f3da935e822d7f2fc4dbebe0a"
|
|
89
89
|
}
|