@wix/wix-data-items-common 1.0.205 → 1.0.207
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/expressions/Expression.js +38 -38
- package/dist/cjs/api/expressions/Expression.js.map +1 -1
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js +1 -1
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js.map +1 -1
- package/dist/cjs/api/stages/FilterStage.js +1 -1
- package/dist/cjs/api/stages/FilterStage.js.map +1 -1
- package/dist/cjs/api/stages/GroupStage.js +3 -3
- package/dist/cjs/api/stages/GroupStage.js.map +1 -1
- package/dist/cjs/api/stages/LimitStage.js +1 -1
- package/dist/cjs/api/stages/LimitStage.js.map +1 -1
- package/dist/cjs/api/stages/ObjectToArrayStage.js +1 -1
- package/dist/cjs/api/stages/ObjectToArrayStage.js.map +1 -1
- package/dist/cjs/api/stages/ProjectStage.js +2 -2
- package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
- package/dist/cjs/api/stages/SkipStage.js +1 -1
- package/dist/cjs/api/stages/SkipStage.js.map +1 -1
- package/dist/cjs/api/stages/SortStage.js +1 -1
- package/dist/cjs/api/stages/SortStage.js.map +1 -1
- package/dist/cjs/api/stages/UnwindStage.js +1 -1
- package/dist/cjs/api/stages/UnwindStage.js.map +1 -1
- package/dist/cjs/api/stages/stages.js.map +1 -1
- package/dist/esm/api/expressions/Expression.js +38 -38
- package/dist/esm/api/expressions/Expression.js.map +1 -1
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js +1 -1
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js.map +1 -1
- package/dist/esm/api/stages/FilterStage.js +1 -1
- package/dist/esm/api/stages/FilterStage.js.map +1 -1
- package/dist/esm/api/stages/GroupStage.js +3 -3
- package/dist/esm/api/stages/GroupStage.js.map +1 -1
- package/dist/esm/api/stages/LimitStage.js +1 -1
- package/dist/esm/api/stages/LimitStage.js.map +1 -1
- package/dist/esm/api/stages/ObjectToArrayStage.js +1 -1
- package/dist/esm/api/stages/ObjectToArrayStage.js.map +1 -1
- package/dist/esm/api/stages/ProjectStage.js +2 -2
- package/dist/esm/api/stages/ProjectStage.js.map +1 -1
- package/dist/esm/api/stages/SkipStage.js +1 -1
- package/dist/esm/api/stages/SkipStage.js.map +1 -1
- package/dist/esm/api/stages/SortStage.js +1 -1
- package/dist/esm/api/stages/SortStage.js.map +1 -1
- package/dist/esm/api/stages/UnwindStage.js +1 -1
- package/dist/esm/api/stages/UnwindStage.js.map +1 -1
- package/dist/types/api/expressions/Expression.d.ts +19 -19
- package/dist/types/api/expressions/Expression.d.ts.map +1 -1
- package/dist/types/api/impl/WixDataAggregatePipelineImpl.d.ts.map +1 -1
- package/dist/types/api/stages/FilterStage.d.ts +1 -1
- package/dist/types/api/stages/FilterStage.d.ts.map +1 -1
- package/dist/types/api/stages/GroupStage.d.ts +1 -1
- package/dist/types/api/stages/GroupStage.d.ts.map +1 -1
- package/dist/types/api/stages/LimitStage.d.ts +1 -1
- package/dist/types/api/stages/LimitStage.d.ts.map +1 -1
- package/dist/types/api/stages/ObjectToArrayStage.d.ts +1 -1
- package/dist/types/api/stages/ObjectToArrayStage.d.ts.map +1 -1
- package/dist/types/api/stages/ProjectStage.d.ts +1 -1
- package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
- package/dist/types/api/stages/SkipStage.d.ts +1 -1
- package/dist/types/api/stages/SkipStage.d.ts.map +1 -1
- package/dist/types/api/stages/SortStage.d.ts +1 -1
- package/dist/types/api/stages/SortStage.d.ts.map +1 -1
- package/dist/types/api/stages/UnwindStage.d.ts +1 -1
- package/dist/types/api/stages/UnwindStage.d.ts.map +1 -1
- package/dist/types/api/stages/stages.d.ts +1 -1
- package/dist/types/api/stages/stages.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -11,7 +11,7 @@ class FieldExpressionImpl {
|
|
|
11
11
|
this.fieldPath = fieldPath;
|
|
12
12
|
}
|
|
13
13
|
/** @private */
|
|
14
|
-
|
|
14
|
+
build() {
|
|
15
15
|
return {
|
|
16
16
|
fieldPath: this.fieldPath
|
|
17
17
|
};
|
|
@@ -27,7 +27,7 @@ class TextExpressionImpl {
|
|
|
27
27
|
this.value = value;
|
|
28
28
|
}
|
|
29
29
|
/** @private */
|
|
30
|
-
|
|
30
|
+
build() {
|
|
31
31
|
return {
|
|
32
32
|
text: this.value
|
|
33
33
|
};
|
|
@@ -43,7 +43,7 @@ class NumericExpressionImpl {
|
|
|
43
43
|
this.value = value;
|
|
44
44
|
}
|
|
45
45
|
/** @private */
|
|
46
|
-
|
|
46
|
+
build() {
|
|
47
47
|
return {
|
|
48
48
|
numeric: this.value
|
|
49
49
|
};
|
|
@@ -59,10 +59,10 @@ class AddExpressionImpl {
|
|
|
59
59
|
this.expressions = expressions;
|
|
60
60
|
}
|
|
61
61
|
/** @private */
|
|
62
|
-
|
|
62
|
+
build() {
|
|
63
63
|
return {
|
|
64
64
|
add: {
|
|
65
|
-
expressions: this.expressions.map(e => e.
|
|
65
|
+
expressions: this.expressions.map(e => e.build())
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -78,11 +78,11 @@ class SubtractExpressionImpl {
|
|
|
78
78
|
this.secondExpression = secondExpression;
|
|
79
79
|
}
|
|
80
80
|
/** @private */
|
|
81
|
-
|
|
81
|
+
build() {
|
|
82
82
|
return {
|
|
83
83
|
subtract: {
|
|
84
|
-
firstExpression: this.firstExpression.
|
|
85
|
-
secondExpression: this.secondExpression.
|
|
84
|
+
firstExpression: this.firstExpression.build(),
|
|
85
|
+
secondExpression: this.secondExpression.build()
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
}
|
|
@@ -97,10 +97,10 @@ class MultiplyExpressionImpl {
|
|
|
97
97
|
this.expressions = expressions;
|
|
98
98
|
}
|
|
99
99
|
/** @private */
|
|
100
|
-
|
|
100
|
+
build() {
|
|
101
101
|
return {
|
|
102
102
|
multiply: {
|
|
103
|
-
expressions: this.expressions.map(e => e.
|
|
103
|
+
expressions: this.expressions.map(e => e.build())
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
}
|
|
@@ -116,11 +116,11 @@ class DivideExpressionImpl {
|
|
|
116
116
|
this.secondExpression = secondExpression;
|
|
117
117
|
}
|
|
118
118
|
/** @private */
|
|
119
|
-
|
|
119
|
+
build() {
|
|
120
120
|
return {
|
|
121
121
|
divide: {
|
|
122
|
-
firstExpression: this.firstExpression.
|
|
123
|
-
secondExpression: this.secondExpression.
|
|
122
|
+
firstExpression: this.firstExpression.build(),
|
|
123
|
+
secondExpression: this.secondExpression.build()
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
@@ -135,10 +135,10 @@ class SumExpressionImpl {
|
|
|
135
135
|
this.expressions = expressions;
|
|
136
136
|
}
|
|
137
137
|
/** @private */
|
|
138
|
-
|
|
138
|
+
build() {
|
|
139
139
|
return {
|
|
140
140
|
sum: {
|
|
141
|
-
expressions: this.expressions.map(e => e.
|
|
141
|
+
expressions: this.expressions.map(e => e.build())
|
|
142
142
|
}
|
|
143
143
|
};
|
|
144
144
|
}
|
|
@@ -153,10 +153,10 @@ class AbsExpressionImpl {
|
|
|
153
153
|
this.expression = expression;
|
|
154
154
|
}
|
|
155
155
|
/** @private */
|
|
156
|
-
|
|
156
|
+
build() {
|
|
157
157
|
return {
|
|
158
158
|
abs: {
|
|
159
|
-
expression: this.expression.
|
|
159
|
+
expression: this.expression.build()
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
162
|
}
|
|
@@ -172,11 +172,11 @@ class ModExpressionImpl {
|
|
|
172
172
|
this.secondExpression = secondExpression;
|
|
173
173
|
}
|
|
174
174
|
/** @private */
|
|
175
|
-
|
|
175
|
+
build() {
|
|
176
176
|
return {
|
|
177
177
|
mod: {
|
|
178
|
-
firstExpression: this.firstExpression.
|
|
179
|
-
secondExpression: this.secondExpression.
|
|
178
|
+
firstExpression: this.firstExpression.build(),
|
|
179
|
+
secondExpression: this.secondExpression.build()
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
}
|
|
@@ -191,10 +191,10 @@ class FloorExpressionImpl {
|
|
|
191
191
|
this.expression = expression;
|
|
192
192
|
}
|
|
193
193
|
/** @private */
|
|
194
|
-
|
|
194
|
+
build() {
|
|
195
195
|
return {
|
|
196
196
|
floor: {
|
|
197
|
-
expression: this.expression.
|
|
197
|
+
expression: this.expression.build()
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
200
|
}
|
|
@@ -209,10 +209,10 @@ class CeilExpressionImpl {
|
|
|
209
209
|
this.expression = expression;
|
|
210
210
|
}
|
|
211
211
|
/** @private */
|
|
212
|
-
|
|
212
|
+
build() {
|
|
213
213
|
return {
|
|
214
214
|
ceil: {
|
|
215
|
-
expression: this.expression.
|
|
215
|
+
expression: this.expression.build()
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
}
|
|
@@ -227,10 +227,10 @@ class ConcatExpressionImpl {
|
|
|
227
227
|
this.expressions = expressions;
|
|
228
228
|
}
|
|
229
229
|
/** @private */
|
|
230
|
-
|
|
230
|
+
build() {
|
|
231
231
|
return {
|
|
232
232
|
concat: {
|
|
233
|
-
expressions: this.expressions.map(e => e.
|
|
233
|
+
expressions: this.expressions.map(e => e.build())
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
}
|
|
@@ -245,10 +245,10 @@ class StringifyExpressionImpl {
|
|
|
245
245
|
this.expression = expression;
|
|
246
246
|
}
|
|
247
247
|
/** @private */
|
|
248
|
-
|
|
248
|
+
build() {
|
|
249
249
|
return {
|
|
250
250
|
stringify: {
|
|
251
|
-
expression: this.expression.
|
|
251
|
+
expression: this.expression.build()
|
|
252
252
|
}
|
|
253
253
|
};
|
|
254
254
|
}
|
|
@@ -263,10 +263,10 @@ class ToLowerExpressionImpl {
|
|
|
263
263
|
this.expression = expression;
|
|
264
264
|
}
|
|
265
265
|
/** @private */
|
|
266
|
-
|
|
266
|
+
build() {
|
|
267
267
|
return {
|
|
268
268
|
toLower: {
|
|
269
|
-
expression: this.expression.
|
|
269
|
+
expression: this.expression.build()
|
|
270
270
|
}
|
|
271
271
|
};
|
|
272
272
|
}
|
|
@@ -281,10 +281,10 @@ class ToUpperExpressionImpl {
|
|
|
281
281
|
this.expression = expression;
|
|
282
282
|
}
|
|
283
283
|
/** @private */
|
|
284
|
-
|
|
284
|
+
build() {
|
|
285
285
|
return {
|
|
286
286
|
toUpper: {
|
|
287
|
-
expression: this.expression.
|
|
287
|
+
expression: this.expression.build()
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
290
|
}
|
|
@@ -301,15 +301,15 @@ class SubstringExpressionImpl {
|
|
|
301
301
|
this.lengthExpression = lengthExpression;
|
|
302
302
|
}
|
|
303
303
|
/** @private */
|
|
304
|
-
|
|
304
|
+
build() {
|
|
305
305
|
const proto = {
|
|
306
306
|
substring: {
|
|
307
|
-
expression: this.expression.
|
|
308
|
-
startExpression: this.startExpression.
|
|
307
|
+
expression: this.expression.build(),
|
|
308
|
+
startExpression: this.startExpression.build()
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
311
|
if (this.lengthExpression) {
|
|
312
|
-
proto.substring.lengthExpression = this.lengthExpression.
|
|
312
|
+
proto.substring.lengthExpression = this.lengthExpression.build();
|
|
313
313
|
}
|
|
314
314
|
return proto;
|
|
315
315
|
}
|
|
@@ -324,10 +324,10 @@ class LengthExpressionImpl {
|
|
|
324
324
|
this.expression = expression;
|
|
325
325
|
}
|
|
326
326
|
/** @private */
|
|
327
|
-
|
|
327
|
+
build() {
|
|
328
328
|
return {
|
|
329
329
|
length: {
|
|
330
|
-
expression: this.expression.
|
|
330
|
+
expression: this.expression.build()
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FieldExpressionImpl","constructor","fieldPath","toProto","exports","TextExpressionImpl","value","text","NumericExpressionImpl","numeric","AddExpressionImpl","expressions","add","map","e","SubtractExpressionImpl","firstExpression","secondExpression","subtract","MultiplyExpressionImpl","multiply","DivideExpressionImpl","divide","SumExpressionImpl","sum","AbsExpressionImpl","expression","abs","ModExpressionImpl","mod","FloorExpressionImpl","floor","CeilExpressionImpl","ceil","ConcatExpressionImpl","concat","StringifyExpressionImpl","stringify","ToLowerExpressionImpl","toLower","ToUpperExpressionImpl","toUpper","SubstringExpressionImpl","startExpression","lengthExpression","proto","substring","LengthExpressionImpl","length"],"sources":["../../../../src/api/expressions/Expression.ts"],"sourcesContent":["import * as apiTypes from '../../types/data-item-types'\n\nexport interface Expression {\n /**\n * @private\n */\n toProto(): apiTypes.Expression\n}\n\n/**\n * @builder\n */\nexport interface FieldExpression extends Expression {}\n\nexport class FieldExpressionImpl implements FieldExpression {\n constructor(private fieldPath: string) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return { fieldPath: this.fieldPath }\n }\n}\n\n/**\n * @builder\n */\nexport interface TextExpression extends Expression {}\n\nexport class TextExpressionImpl implements TextExpression {\n constructor(private value: string) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return { text: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport interface NumericExpression extends Expression {}\n\nexport class NumericExpressionImpl implements NumericExpression {\n constructor(private value: number) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return { numeric: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport interface AddExpression extends Expression {}\n\nexport class AddExpressionImpl implements AddExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n add: {\n expressions: this.expressions.map((e) => e.toProto()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SubtractExpression extends Expression {}\n\nexport class SubtractExpressionImpl implements SubtractExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n subtract: {\n firstExpression: this.firstExpression.toProto(),\n secondExpression: this.secondExpression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface MultiplyExpression extends Expression {}\n\nexport class MultiplyExpressionImpl implements MultiplyExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n multiply: {\n expressions: this.expressions.map((e) => e.toProto()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface DivideExpression extends Expression {}\n\nexport class DivideExpressionImpl implements DivideExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n divide: {\n firstExpression: this.firstExpression.toProto(),\n secondExpression: this.secondExpression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SumExpression extends Expression {}\n\nexport class SumExpressionImpl implements SumExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n sum: {\n expressions: this.expressions.map((e) => e.toProto()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface AbsExpression extends Expression {}\n\nexport class AbsExpressionImpl implements AbsExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n abs: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ModExpression extends Expression {}\n\nexport class ModExpressionImpl implements ModExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n mod: {\n firstExpression: this.firstExpression.toProto(),\n secondExpression: this.secondExpression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface FloorExpression extends Expression {}\n\nexport class FloorExpressionImpl implements FloorExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n floor: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface CeilExpression extends Expression {}\n\nexport class CeilExpressionImpl implements CeilExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n ceil: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ConcatExpression extends Expression {}\n\nexport class ConcatExpressionImpl implements ConcatExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n concat: {\n expressions: this.expressions.map((e) => e.toProto()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface StringifyExpression extends Expression {}\n\nexport class StringifyExpressionImpl implements StringifyExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n stringify: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ToLowerExpression extends Expression {}\n\nexport class ToLowerExpressionImpl implements ToLowerExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n toLower: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ToUpperExpression extends Expression {}\n\nexport class ToUpperExpressionImpl implements ToUpperExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n toUpper: {\n expression: this.expression.toProto(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SubstringExpression extends Expression {}\n\nexport class SubstringExpressionImpl implements SubstringExpression {\n constructor(\n private expression: Expression,\n private startExpression: Expression,\n private lengthExpression?: Expression\n ) {}\n /** @private */\n toProto(): apiTypes.Expression {\n const proto: any = {\n substring: {\n expression: this.expression.toProto(),\n startExpression: this.startExpression.toProto(),\n },\n }\n if (this.lengthExpression) {\n proto.substring.lengthExpression = this.lengthExpression.toProto()\n }\n return proto\n }\n}\n\n/**\n * @builder\n */\nexport interface LengthExpression extends Expression {}\n\nexport class LengthExpressionImpl implements LengthExpression {\n constructor(private expression: Expression) {}\n /** @private */\n toProto(): apiTypes.Expression {\n return {\n length: { expression: this.exp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D9C,WAAWA,CAASyB,UAAsB,EAAE;IAAA,KAAxBA,UAAsB,GAAtBA,UAAsB;EAAG;EAC7C;EACAvB,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MACL6C,MAAM,EAAE;QAAEtB,UAAU,EAAE,IAAI,CAACA,UAAU,CAACvB,OAAO,CAAC;MAAE;IAClD,CAAC;EACH;AACF;AAACC,OAAA,CAAA2C,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["FieldExpressionImpl","constructor","fieldPath","build","exports","TextExpressionImpl","value","text","NumericExpressionImpl","numeric","AddExpressionImpl","expressions","add","map","e","SubtractExpressionImpl","firstExpression","secondExpression","subtract","MultiplyExpressionImpl","multiply","DivideExpressionImpl","divide","SumExpressionImpl","sum","AbsExpressionImpl","expression","abs","ModExpressionImpl","mod","FloorExpressionImpl","floor","CeilExpressionImpl","ceil","ConcatExpressionImpl","concat","StringifyExpressionImpl","stringify","ToLowerExpressionImpl","toLower","ToUpperExpressionImpl","toUpper","SubstringExpressionImpl","startExpression","lengthExpression","proto","substring","LengthExpressionImpl","length"],"sources":["../../../../src/api/expressions/Expression.ts"],"sourcesContent":["import * as apiTypes from '../../types/data-item-types'\n\nexport interface Expression {\n /**\n * @private\n */\n build(): apiTypes.Expression\n}\n\n/**\n * @builder\n */\nexport interface FieldExpression extends Expression {}\n\nexport class FieldExpressionImpl implements FieldExpression {\n constructor(private fieldPath: string) {}\n /** @private */\n build(): apiTypes.Expression {\n return { fieldPath: this.fieldPath }\n }\n}\n\n/**\n * @builder\n */\nexport interface TextExpression extends Expression {}\n\nexport class TextExpressionImpl implements TextExpression {\n constructor(private value: string) {}\n /** @private */\n build(): apiTypes.Expression {\n return { text: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport interface NumericExpression extends Expression {}\n\nexport class NumericExpressionImpl implements NumericExpression {\n constructor(private value: number) {}\n /** @private */\n build(): apiTypes.Expression {\n return { numeric: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport interface AddExpression extends Expression {}\n\nexport class AddExpressionImpl implements AddExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n add: {\n expressions: this.expressions.map((e) => e.build()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SubtractExpression extends Expression {}\n\nexport class SubtractExpressionImpl implements SubtractExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n subtract: {\n firstExpression: this.firstExpression.build(),\n secondExpression: this.secondExpression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface MultiplyExpression extends Expression {}\n\nexport class MultiplyExpressionImpl implements MultiplyExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n multiply: {\n expressions: this.expressions.map((e) => e.build()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface DivideExpression extends Expression {}\n\nexport class DivideExpressionImpl implements DivideExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n divide: {\n firstExpression: this.firstExpression.build(),\n secondExpression: this.secondExpression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SumExpression extends Expression {}\n\nexport class SumExpressionImpl implements SumExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n sum: {\n expressions: this.expressions.map((e) => e.build()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface AbsExpression extends Expression {}\n\nexport class AbsExpressionImpl implements AbsExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n abs: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ModExpression extends Expression {}\n\nexport class ModExpressionImpl implements ModExpression {\n constructor(\n private firstExpression: Expression,\n private secondExpression: Expression\n ) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n mod: {\n firstExpression: this.firstExpression.build(),\n secondExpression: this.secondExpression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface FloorExpression extends Expression {}\n\nexport class FloorExpressionImpl implements FloorExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n floor: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface CeilExpression extends Expression {}\n\nexport class CeilExpressionImpl implements CeilExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n ceil: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ConcatExpression extends Expression {}\n\nexport class ConcatExpressionImpl implements ConcatExpression {\n constructor(private expressions: Expression[]) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n concat: {\n expressions: this.expressions.map((e) => e.build()),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface StringifyExpression extends Expression {}\n\nexport class StringifyExpressionImpl implements StringifyExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n stringify: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ToLowerExpression extends Expression {}\n\nexport class ToLowerExpressionImpl implements ToLowerExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n toLower: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface ToUpperExpression extends Expression {}\n\nexport class ToUpperExpressionImpl implements ToUpperExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n toUpper: {\n expression: this.expression.build(),\n },\n }\n }\n}\n\n/**\n * @builder\n */\nexport interface SubstringExpression extends Expression {}\n\nexport class SubstringExpressionImpl implements SubstringExpression {\n constructor(\n private expression: Expression,\n private startExpression: Expression,\n private lengthExpression?: Expression\n ) {}\n /** @private */\n build(): apiTypes.Expression {\n const proto: any = {\n substring: {\n expression: this.expression.build(),\n startExpression: this.startExpression.build(),\n },\n }\n if (this.lengthExpression) {\n proto.substring.lengthExpression = this.lengthExpression.build()\n }\n return proto\n }\n}\n\n/**\n * @builder\n */\nexport interface LengthExpression extends Expression {}\n\nexport class LengthExpressionImpl implements LengthExpression {\n constructor(private expression: Expression) {}\n /** @private */\n build(): apiTypes.Expression {\n return {\n length: { expression: this.expression.build() },\n }\n }\n}\n"],"mappings":";;;;AASA;AACA;AACA;;AAGO,MAAMA,mBAAmB,CAA4B;EAC1DC,WAAWA,CAASC,SAAiB,EAAE;IAAA,KAAnBA,SAAiB,GAAjBA,SAAiB;EAAG;EACxC;EACAC,KAAKA,CAAA,EAAwB;IAC3B,OAAO;MAAED,SAAS,EAAE,IAAI,CAACA;IAAU,CAAC;EACtC;AACF;;AAEA;AACA;AACA;AAFAE,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AAKO,MAAMK,kBAAkB,CAA2B;EACxDJ,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpC;EACAH,KAAKA,CAAA,EAAwB;IAC3B,OAAO;MAAEI,IAAI,EAAE,IAAI,CAACD;IAAM,CAAC;EAC7B;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAC,kBAAA,GAAAA,kBAAA;AAKO,MAAMG,qBAAqB,CAA8B;EAC9DP,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpC;EACAH,KAAKA,CAAA,EAAwB;IAC3B,OAAO;MAAEM,OAAO,EAAE,IAAI,CAACH;IAAM,CAAC;EAChC;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAI,qBAAA,GAAAA,qBAAA;AAKO,MAAME,iBAAiB,CAA0B;EACtDT,WAAWA,CAASU,WAAyB,EAAE;IAAA,KAA3BA,WAAyB,GAAzBA,WAAyB;EAAG;EAChD;EACAR,KAAKA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C;IACF,CAAC;IACD,IAAI,IAAI,CAACyC,gBAAgB,EAAE;MACzBC,KAAK,CAACC,SAAS,CAACF,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACzC,KAAK,CAAC,CAAC;IAClE;IACA,OAAO0C,KAAK;EACd;AACF;;AAEA;AACA;AACA;AAFAzC,OAAA,CAAAsC,uBAAA,GAAAA,uBAAA;AAKO,MAAMK,oBAAoB,CAA6B;EAC5D9C,WAAWA,CAASyB,UAAsB,EAAE;IAAA,KAAxBA,UAAsB,GAAtBA,UAAsB;EAAG;EAC7C;EACAvB,KAAKA,CAAA,EAAwB;IAC3B,OAAO;MACL6C,MAAM,EAAE;QAAEtB,UAAU,EAAE,IAAI,CAACA,UAAU,CAACvB,KAAK,CAAC;MAAE;IAChD,CAAC;EACH;AACF;AAACC,OAAA,CAAA2C,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ class WixDataAggregatePipelineImpl {
|
|
|
24
24
|
if (this.invalidArguments.length > 0) {
|
|
25
25
|
throw new Error(this.invalidArguments.join(', '));
|
|
26
26
|
}
|
|
27
|
-
const stages = this.pipeline.map(stage => stage.
|
|
27
|
+
const stages = this.pipeline.map(stage => stage.build());
|
|
28
28
|
const response = await this.client.aggregatePipelineDataItems({
|
|
29
29
|
dataCollectionId: this.collectionName,
|
|
30
30
|
stages,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_WixDataResultImpl","require","_PipelineValidator","WixDataAggregatePipelineImpl","constructor","collectionName","pipeline","client","limitNumber","skipNumber","invalidArguments","_defineProperty2","default","ownInvalidArguments","run","options","_response$pagingMetad","_response$results","length","Error","join","stages","map","stage","
|
|
1
|
+
{"version":3,"names":["_WixDataResultImpl","require","_PipelineValidator","WixDataAggregatePipelineImpl","constructor","collectionName","pipeline","client","limitNumber","skipNumber","invalidArguments","_defineProperty2","default","ownInvalidArguments","run","options","_response$pagingMetad","_response$results","length","Error","join","stages","map","stage","build","response","aggregatePipelineDataItems","dataCollectionId","paging","offset","limit","fetch","cursorOrOffset","returnTotalCount","request","cursorPaging","cursor","undefined","results","pagingMetadata","WixDataResultImpl","count","pipelineValidator","arityIsOne","arguments","isPositiveNumber","validateAndAggregate","copy","skip","isNonNegativeNumber","operatorName","PipelineValidator","params","exports"],"sources":["../../../../src/api/impl/WixDataAggregatePipelineImpl.ts"],"sourcesContent":["import { WixDataAggregateOptions } from '../types'\nimport { WixDataResult } from '../WixDataResult'\nimport { WixDataResultImpl, PageFetcher } from './WixDataResultImpl'\nimport { PipelineStage } from '../stages/stages'\nimport { ApiClient } from '../ApiClient'\nimport * as apiTypes from '../../types/data-item-types'\nimport { WixDataAggregatePipeline } from '../WixDataAggregatePipeline'\nimport { PipelineValidator } from '../PipelineValidator'\n\nexport class WixDataAggregatePipelineImpl implements WixDataAggregatePipeline {\n private readonly ownInvalidArguments: string[]\n\n constructor(\n private collectionName: string,\n private pipeline: PipelineStage[],\n private client: ApiClient,\n private limitNumber?: number,\n private skipNumber?: number,\n invalidArguments?: string[]\n ) {\n this.ownInvalidArguments = invalidArguments ?? []\n }\n\n get invalidArguments(): string[] {\n return this.ownInvalidArguments\n }\n\n async run(\n options?: WixDataAggregateOptions\n ): Promise<WixDataResult<Record<string, any>>> {\n if (this.invalidArguments.length > 0) {\n throw new Error(this.invalidArguments.join(', '))\n }\n\n const stages: apiTypes.Stage[] = this.pipeline.map((stage) => stage.build())\n\n const response = await this.client.aggregatePipelineDataItems({\n dataCollectionId: this.collectionName,\n stages,\n ...options,\n paging: { offset: this.skipNumber, limit: this.limitNumber },\n })\n\n const fetch: PageFetcher<Record<string, any>> = async (\n cursorOrOffset: string | number,\n returnTotalCount?: boolean\n ): Promise<[Record<string, any>[], apiTypes.PagingMetadataV2]> => {\n const request: apiTypes.AggregatePipelineDataItemsRequest = {\n dataCollectionId: this.collectionName,\n stages,\n ...options,\n }\n\n if (typeof cursorOrOffset === 'string') {\n request.cursorPaging = {\n limit: this.limitNumber,\n cursor: cursorOrOffset,\n }\n // Stages must not be sent if using cursor paging, as they'll be reused from original request\n request.stages = undefined\n } else {\n request.paging = { limit: this.limitNumber, offset: cursorOrOffset }\n }\n\n if (returnTotalCount) {\n request.returnTotalCount = true\n }\n\n const { results, pagingMetadata } =\n await this.client.aggregatePipelineDataItems(request)\n return [results!, pagingMetadata!]\n }\n\n return new WixDataResultImpl(\n response.results || [],\n response.pagingMetadata || { count: 0, offset: 0 },\n fetch,\n {\n collectionName: this.collectionName,\n skipNumber: response.pagingMetadata?.offset || 0,\n limitNumber: response.results?.length,\n }\n )\n }\n\n limit(limitNumber: number): WixDataAggregatePipeline {\n const [invalidArguments] = this.pipelineValidator('.limit')\n .arityIsOne(arguments)\n .isPositiveNumber(limitNumber)\n .validateAndAggregate()\n\n return this.copy({ limitNumber, invalidArguments })\n }\n\n skip(skipNumber: number): WixDataAggregatePipeline {\n const [invalidArguments] = this.pipelineValidator('.skip')\n .arityIsOne(arguments)\n .isNonNegativeNumber(skipNumber)\n .validateAndAggregate()\n\n return this.copy({ skipNumber, invalidArguments })\n }\n\n private pipelineValidator(operatorName: string) {\n return new PipelineValidator(operatorName, this.ownInvalidArguments)\n }\n\n private copy(params: {\n limitNumber?: number\n skipNumber?: number\n invalidArguments?: string[]\n }): WixDataAggregatePipelineImpl {\n return new WixDataAggregatePipelineImpl(\n this.collectionName,\n this.pipeline,\n this.client,\n params.limitNumber ?? this.limitNumber,\n params.skipNumber ?? this.skipNumber,\n params.invalidArguments ?? this.ownInvalidArguments\n )\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AAKA,IAAAC,kBAAA,GAAAD,OAAA;AAEO,MAAME,4BAA4B,CAAqC;EAG5EC,WAAWA,CACDC,cAAsB,EACtBC,QAAyB,EACzBC,MAAiB,EACjBC,WAAoB,EACpBC,UAAmB,EAC3BC,gBAA2B,EAC3B;IAAA,KANQL,cAAsB,GAAtBA,cAAsB;IAAA,KACtBC,QAAyB,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,OAAO,CAAC,CACvDC,UAAU,CAACC,SAAS,CAAC,CACrBK,mBAAmB,CAACxC,UAAU,CAAC,CAC/BqC,oBAAoB,CAAC,CAAC;IAEzB,OAAO,IAAI,CAACC,IAAI,CAAC;MAAEtC,UAAU;MAAEC;IAAiB,CAAC,CAAC;EACpD;EAEQgC,iBAAiBA,CAACQ,YAAoB,EAAE;IAC9C,OAAO,IAAIC,oCAAiB,CAACD,YAAY,EAAE,IAAI,CAACrC,mBAAmB,CAAC;EACtE;EAEQkC,IAAIA,CAACK,MAIZ,EAAgC;IAC/B,OAAO,IAAIjD,4BAA4B,CACrC,IAAI,CAACE,cAAc,EACnB,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,MAAM,EACX6C,MAAM,CAAC5C,WAAW,IAAI,IAAI,CAACA,WAAW,EACtC4C,MAAM,CAAC3C,UAAU,IAAI,IAAI,CAACA,UAAU,EACpC2C,MAAM,CAAC1C,gBAAgB,IAAI,IAAI,CAACG,mBAClC,CAAC;EACH;AACF;AAACwC,OAAA,CAAAlD,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_QueryBase","require","FilterStageImpl","QueryBase","constructor","origin","collectionName","filterBuilder","copy","params","invalidArguments","toProto","filter","build","exports"],"sources":["../../../../src/api/stages/FilterStage.ts"],"sourcesContent":["import { QueryBase } from '../QueryBase'\nimport { PlatformizedFilterBuilder, WithFilter } from '../../filter'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\ntype Comparable = string | number | Date\n\n/**\n * @builder\n * Filter stage for aggregate pipeline operations. This interface provides filtering capabilities\n * specifically designed for use within aggregate pipelines, typically used with `stages.filter()`\n * in pipeline arrays to refine data based on specified conditions.\n */\nexport interface FilterStage extends PipelineStage, WithFilter<FilterStage> {\n /**\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Filters pipeline data to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is `null` or `undefined` or the field does\n * not exist.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined filter.\n */\n isEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the aggregate pipeline filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided value.\n * @requiredField field\n * @param value - Value to locate in the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified field contains multiple references, pass item IDs in the\n * `value` field. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `values`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasAll(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): FilterStage\n\n /**\n * Adds an `or` condition to the aggregate pipeline filter.\n *\n * The `or()` method adds an inclusive `or` condition to this pipeline filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: FilterStage): FilterStage\n\n /**\n * Adds an `and` condition to the aggregate pipeline filter.\n *\n * A pipeline filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = stages.filter()\n * .eq(\"status\", \"pending\")\n * .or(stages.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = stages.filter()\n * .lt(\"age\", 25)\n * .or(stages.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `FilterStage` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * stages.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `FilterStage` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: FilterStage): FilterStage\n\n /**\n * Adds a `not` condition to the aggregate pipeline filter.\n *\n * The `not()` method adds a `not` condition to this pipeline filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: FilterStage): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this aggregate pipeline filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only matches values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - Field to compare with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): FilterStage\n}\n\nexport class FilterStageImpl\n extends QueryBase<FilterStageImpl>\n implements FilterStage\n{\n constructor(origin?: {\n collectionName?: string\n filterBuilder?: PlatformizedFilterBuilder\n }) {\n super({\n collectionName: origin?.collectionName || '',\n filterBuilder: origin?.filterBuilder,\n })\n }\n\n protected copy(params: any): FilterStageImpl {\n return new FilterStageImpl({\n collectionName: this.collectionName,\n filterBuilder: params.filterBuilder || this.filterBuilder,\n })\n }\n\n get invalidArguments(): string[] {\n return []\n }\n\n /** @private */\n toProto(): apiTypes.Stage {\n return { filter: this.filterBuilder.build() }\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA;AACA;AACA;AACA;AACA;AACA;;AAubO,MAAMC,eAAe,SAClBC,oBAAS,CAEnB;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAAC;MACJC,cAAc,EAAE,CAAAD,MAAM,oBAANA,MAAM,CAAEC,cAAc,KAAI,EAAE;MAC5CC,aAAa,EAAEF,MAAM,oBAANA,MAAM,CAAEE;IACzB,CAAC,CAAC;EACJ;EAEUC,IAAIA,CAACC,MAAW,EAAmB;IAC3C,OAAO,IAAIP,eAAe,CAAC;MACzBI,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,aAAa,EAAEE,MAAM,CAACF,aAAa,IAAI,IAAI,CAACA;IAC9C,CAAC,CAAC;EACJ;EAEA,IAAIG,gBAAgBA,CAAA,EAAa;IAC/B,OAAO,EAAE;EACX;;EAEA;EACAC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,MAAM,EAAE,IAAI,CAACL,aAAa,CAACM,KAAK,CAAC;IAAE,CAAC;EAC/C;AACF;AAACC,OAAA,CAAAZ,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_QueryBase","require","FilterStageImpl","QueryBase","constructor","origin","collectionName","filterBuilder","copy","params","invalidArguments","build","filter","exports"],"sources":["../../../../src/api/stages/FilterStage.ts"],"sourcesContent":["import { QueryBase } from '../QueryBase'\nimport { PlatformizedFilterBuilder, WithFilter } from '../../filter'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\ntype Comparable = string | number | Date\n\n/**\n * @builder\n * Filter stage for aggregate pipeline operations. This interface provides filtering capabilities\n * specifically designed for use within aggregate pipelines, typically used with `stages.filter()`\n * in pipeline arrays to refine data based on specified conditions.\n */\nexport interface FilterStage extends PipelineStage, WithFilter<FilterStage> {\n /**\n * @internal\n */\n readonly filterTree: Record<string, any>\n\n /**\n * @internal\n */\n readonly invalidArguments: string[]\n\n /**\n * Filters pipeline data to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this aggregate pipeline filter to only match\n * items where the value of the specified field is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this aggregate pipeline filter to only match items where the\n * value of the specified field is `null` or `undefined` or the field does\n * not exist.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined filter.\n */\n isEmpty(field: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this aggregate pipeline filter to only\n * match items where the value of the specified field ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the aggregate pipeline filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided value.\n * @requiredField field\n * @param value - Value to locate in the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified field contains multiple references, pass item IDs in the\n * `value` field. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: Comparable[]): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this aggregate pipeline filter to\n * only match items where the value of the specified field equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `values`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasAll(field: string, ...values: Comparable[]): FilterStage\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: Comparable[]): FilterStage\n\n /**\n * Adds an `or` condition to the aggregate pipeline filter.\n *\n * The `or()` method adds an inclusive `or` condition to this pipeline filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: FilterStage): FilterStage\n\n /**\n * Adds an `and` condition to the aggregate pipeline filter.\n *\n * A pipeline filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = stages.filter()\n * .eq(\"status\", \"pending\")\n * .or(stages.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = stages.filter()\n * .lt(\"age\", 25)\n * .or(stages.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `FilterStage` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * stages.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `FilterStage` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: FilterStage): FilterStage\n\n /**\n * Adds a `not` condition to the aggregate pipeline filter.\n *\n * The `not()` method adds a `not` condition to this pipeline filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: FilterStage): FilterStage\n\n /**\n * Filters pipeline data to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this aggregate pipeline filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only matches values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - Field to compare with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): FilterStage\n}\n\nexport class FilterStageImpl\n extends QueryBase<FilterStageImpl>\n implements FilterStage\n{\n constructor(origin?: {\n collectionName?: string\n filterBuilder?: PlatformizedFilterBuilder\n }) {\n super({\n collectionName: origin?.collectionName || '',\n filterBuilder: origin?.filterBuilder,\n })\n }\n\n protected copy(params: any): FilterStageImpl {\n return new FilterStageImpl({\n collectionName: this.collectionName,\n filterBuilder: params.filterBuilder || this.filterBuilder,\n })\n }\n\n get invalidArguments(): string[] {\n return []\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { filter: this.filterBuilder.build() }\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAOA;AACA;AACA;AACA;AACA;AACA;;AAubO,MAAMC,eAAe,SAClBC,oBAAS,CAEnB;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAAC;MACJC,cAAc,EAAE,CAAAD,MAAM,oBAANA,MAAM,CAAEC,cAAc,KAAI,EAAE;MAC5CC,aAAa,EAAEF,MAAM,oBAANA,MAAM,CAAEE;IACzB,CAAC,CAAC;EACJ;EAEUC,IAAIA,CAACC,MAAW,EAAmB;IAC3C,OAAO,IAAIP,eAAe,CAAC;MACzBI,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCC,aAAa,EAAEE,MAAM,CAACF,aAAa,IAAI,IAAI,CAACA;IAC9C,CAAC,CAAC;EACJ;EAEA,IAAIG,gBAAgBA,CAAA,EAAa;IAC/B,OAAO,EAAE;EACX;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,MAAM,EAAE,IAAI,CAACL,aAAa,CAACI,KAAK,CAAC;IAAE,CAAC;EAC/C;AACF;AAACE,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -55,16 +55,16 @@ class GroupStageImpl {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/** @private */
|
|
58
|
-
|
|
58
|
+
build() {
|
|
59
59
|
return {
|
|
60
60
|
group: {
|
|
61
61
|
groupIds: this.ids.map(id => ({
|
|
62
|
-
expression: id.expression.
|
|
62
|
+
expression: id.expression.build(),
|
|
63
63
|
key: id.key
|
|
64
64
|
})),
|
|
65
65
|
accumulators: this.accumulators.map(accumulator => ({
|
|
66
66
|
[accumulator.type]: {
|
|
67
|
-
expression: accumulator.expression.
|
|
67
|
+
expression: accumulator.expression.build()
|
|
68
68
|
},
|
|
69
69
|
resultFieldName: accumulator.resultFieldName
|
|
70
70
|
}))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","
|
|
1
|
+
{"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","build","group","groupIds","map","id","accumulator","exports"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericExpressionImpl } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface GroupStage extends PipelineStage {\n by(expression: Expression, key: string): GroupStage\n sum(expression: Expression, resultFieldName: string): GroupStage\n avg(expression: Expression, resultFieldName: string): GroupStage\n min(expression: Expression, resultFieldName: string): GroupStage\n max(expression: Expression, resultFieldName: string): GroupStage\n count(resultFieldName: string): GroupStage\n first(expression: Expression, resultFieldName: string): GroupStage\n last(expression: Expression, resultFieldName: string): GroupStage\n push(expression: Expression, resultFieldName: string): GroupStage\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(expression: Expression, key: string): GroupStage {\n this.ids.push({ expression, key })\n return this\n }\n\n sum(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'sum', resultFieldName)\n }\n\n avg(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'avg', resultFieldName)\n }\n\n min(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'min', resultFieldName)\n }\n\n max(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'max', resultFieldName)\n }\n\n count(resultFieldName: string): GroupStage {\n return this.addAccumulator(\n new NumericExpressionImpl(1),\n 'sum',\n resultFieldName\n )\n }\n\n first(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'first', resultFieldName)\n }\n\n last(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'last', resultFieldName)\n }\n\n push(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'push', resultFieldName)\n }\n\n private addAccumulator(\n expression: Expression,\n type: AccumulatorType,\n resultFieldName: string\n ): GroupStage {\n this.accumulators.push({ type, expression, resultFieldName })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.build(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.build(),\n },\n resultFieldName: accumulator.resultFieldName,\n })),\n },\n }\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n key: string\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;;AAaO,MAAMC,cAAc,CAAuB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,eAC5B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACgB,EAAE;EAAA;EAExCC,EAAEA,CAACC,UAAsB,EAAEC,GAAW,EAAc;IAClD,IAAI,CAACC,GAAG,CAACC,IAAI,CAAC;MAAEH,UAAU;MAAEC;IAAI,CAAC,CAAC;IAClC,OAAO,IAAI;EACb;EAEAG,GAAGA,CAACJ,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO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AAQ,EAAE,IAAI,CAAChB,GAAG,CAACiB,GAAG,CAAEC,EAAE,KAAM;UAC9BpB,UAAU,EAAEoB,EAAE,CAACpB,UAAU,CAACgB,KAAK,CAAC,CAAC;UACjCf,GAAG,EAAEmB,EAAE,CAACnB;QACV,CAAC,CAAC,CAAC;QACHc,YAAY,EAAE,IAAI,CAACA,YAAY,CAACI,GAAG,CAAEE,WAAW,KAAM;UACpD,CAACA,WAAW,CAACP,IAAI,GAAG;YAClBd,UAAU,EAAEqB,WAAW,CAACrB,UAAU,CAACgB,KAAK,CAAC;UAC3C,CAAC;UACDX,eAAe,EAAEgB,WAAW,CAAChB;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LimitStageImpl","constructor","count","
|
|
1
|
+
{"version":3,"names":["LimitStageImpl","constructor","count","build","limit","exports"],"sources":["../../../../src/api/stages/LimitStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface LimitStage extends PipelineStage {}\n\nexport class LimitStageImpl implements LimitStage {\n constructor(private count: number) {}\n\n /** @private */\n build(): apiTypes.Stage {\n return { limit: this.count }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;;AAGO,MAAMA,cAAc,CAAuB;EAChDC,WAAWA,CAASC,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;;EAEpC;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,KAAK,EAAE,IAAI,CAACF;IAAM,CAAC;EAC9B;AACF;AAACG,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ObjectToArrayStageImpl","constructor","objectFieldName","destinationFieldName","
|
|
1
|
+
{"version":3,"names":["ObjectToArrayStageImpl","constructor","objectFieldName","destinationFieldName","build","objectToArray","exports"],"sources":["../../../../src/api/stages/ObjectToArrayStage.ts"],"sourcesContent":["import * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ObjectToArrayStage extends PipelineStage {}\n\nexport class ObjectToArrayStageImpl implements ObjectToArrayStage {\n constructor(\n private objectFieldName: string,\n private destinationFieldName: string\n ) {}\n\n /** @private */\n build(): apiTypes.Stage {\n return {\n objectToArray: {\n objectFieldName: this.objectFieldName,\n destinationFieldName: this.destinationFieldName,\n },\n }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;;AAGO,MAAMA,sBAAsB,CAA+B;EAChEC,WAAWA,CACDC,eAAuB,EACvBC,oBAA4B,EACpC;IAAA,KAFQD,eAAuB,GAAvBA,eAAuB;IAAA,KACvBC,oBAA4B,GAA5BA,oBAA4B;EACnC;;EAEH;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MACLC,aAAa,EAAE;QACbH,eAAe,EAAE,IAAI,CAACA,eAAe;QACrCC,oBAAoB,EAAE,IAAI,CAACA;MAC7B;IACF,CAAC;EACH;AACF;AAACG,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
|
@@ -43,7 +43,7 @@ class ProjectStageImpl {
|
|
|
43
43
|
this.fields.push({
|
|
44
44
|
reshape: {
|
|
45
45
|
resultFieldName,
|
|
46
|
-
expression: expression.
|
|
46
|
+
expression: expression.build()
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
return this;
|
|
@@ -59,7 +59,7 @@ class ProjectStageImpl {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/** @private */
|
|
62
|
-
|
|
62
|
+
build() {
|
|
63
63
|
return {
|
|
64
64
|
projection: {
|
|
65
65
|
fields: this.fields
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","
|
|
1
|
+
{"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","build","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.build() },\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 build(): 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,KAAK,CAAC;MAAE;IAC7D,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,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,UAAU,EAAE;QAAEX,MAAM,EAAE,IAAI,CAACA;MAAO;IAAE,CAAC;EAChD;AACF;AAACY,OAAA,CAAApB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SkipStageImpl","constructor","count","
|
|
1
|
+
{"version":3,"names":["SkipStageImpl","constructor","count","build","skip","exports"],"sources":["../../../../src/api/stages/SkipStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface SkipStage extends PipelineStage {}\n\nexport class SkipStageImpl implements SkipStage {\n constructor(private count: number) {}\n\n /** @private */\n build(): apiTypes.Stage {\n return { skip: this.count }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;;AAGO,MAAMA,aAAa,CAAsB;EAC9CC,WAAWA,CAASC,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;;EAEpC;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,IAAI,EAAE,IAAI,CAACF;IAAM,CAAC;EAC7B;AACF;AAACG,OAAA,CAAAL,aAAA,GAAAA,aAAA","ignoreList":[]}
|