@wix/wix-data-items-common 1.0.199 → 1.0.201
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 +25 -7
- package/dist/cjs/api/expressions/Expression.js.map +1 -1
- package/dist/cjs/api/expressions/expressions.js +2 -2
- package/dist/cjs/api/expressions/expressions.js.map +1 -1
- package/dist/cjs/api/index.js +20 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/stages/FilterStage.js +2 -0
- package/dist/cjs/api/stages/FilterStage.js.map +1 -1
- package/dist/cjs/api/stages/GroupStage.js +4 -2
- package/dist/cjs/api/stages/GroupStage.js.map +1 -1
- package/dist/cjs/api/stages/LimitStage.js +2 -0
- package/dist/cjs/api/stages/LimitStage.js.map +1 -1
- package/dist/cjs/api/stages/ObjectToArrayStage.js +5 -3
- package/dist/cjs/api/stages/ObjectToArrayStage.js.map +1 -1
- package/dist/cjs/api/stages/ProjectStage.js +10 -8
- package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
- package/dist/cjs/api/stages/SkipStage.js +2 -0
- package/dist/cjs/api/stages/SkipStage.js.map +1 -1
- package/dist/cjs/api/stages/SortStage.js +2 -0
- package/dist/cjs/api/stages/SortStage.js.map +1 -1
- package/dist/cjs/api/stages/UnwindStage.js +2 -0
- package/dist/cjs/api/stages/UnwindStage.js.map +1 -1
- package/dist/cjs/api/stages/stages.js +1 -1
- package/dist/cjs/api/stages/stages.js.map +1 -1
- package/dist/cjs/types/data-item-types.js +3 -3
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/expressions/Expression.js +22 -4
- package/dist/esm/api/expressions/Expression.js.map +1 -1
- package/dist/esm/api/expressions/expressions.js +3 -3
- package/dist/esm/api/expressions/expressions.js.map +1 -1
- package/dist/esm/api/stages/FilterStage.js +1 -0
- package/dist/esm/api/stages/FilterStage.js.map +1 -1
- package/dist/esm/api/stages/GroupStage.js +4 -3
- package/dist/esm/api/stages/GroupStage.js.map +1 -1
- package/dist/esm/api/stages/LimitStage.js +1 -0
- package/dist/esm/api/stages/LimitStage.js.map +1 -1
- package/dist/esm/api/stages/ObjectToArrayStage.js +4 -3
- package/dist/esm/api/stages/ObjectToArrayStage.js.map +1 -1
- package/dist/esm/api/stages/ProjectStage.js +7 -6
- package/dist/esm/api/stages/ProjectStage.js.map +1 -1
- package/dist/esm/api/stages/SkipStage.js +1 -0
- package/dist/esm/api/stages/SkipStage.js.map +1 -1
- package/dist/esm/api/stages/SortStage.js +1 -0
- package/dist/esm/api/stages/SortStage.js.map +1 -1
- package/dist/esm/api/stages/UnwindStage.js +1 -0
- package/dist/esm/api/stages/UnwindStage.js.map +1 -1
- package/dist/esm/api/stages/stages.js +1 -1
- package/dist/esm/api/stages/stages.js.map +1 -1
- package/dist/types/api/expressions/Expression.d.ts +23 -5
- package/dist/types/api/expressions/Expression.d.ts.map +1 -1
- package/dist/types/api/expressions/expressions.d.ts +3 -3
- package/dist/types/api/expressions/expressions.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/stages/FilterStage.d.ts +1 -0
- package/dist/types/api/stages/FilterStage.d.ts.map +1 -1
- package/dist/types/api/stages/GroupStage.d.ts +1 -0
- package/dist/types/api/stages/GroupStage.d.ts.map +1 -1
- package/dist/types/api/stages/LimitStage.d.ts +1 -0
- package/dist/types/api/stages/LimitStage.d.ts.map +1 -1
- package/dist/types/api/stages/ObjectToArrayStage.d.ts +3 -2
- package/dist/types/api/stages/ObjectToArrayStage.d.ts.map +1 -1
- package/dist/types/api/stages/ProjectStage.d.ts +5 -4
- package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
- package/dist/types/api/stages/SkipStage.d.ts +1 -0
- package/dist/types/api/stages/SkipStage.d.ts.map +1 -1
- package/dist/types/api/stages/SortStage.d.ts +1 -0
- package/dist/types/api/stages/SortStage.d.ts.map +1 -1
- package/dist/types/api/stages/UnwindStage.d.ts +1 -0
- package/dist/types/api/stages/UnwindStage.d.ts.map +1 -1
- package/dist/types/api/stages/stages.d.ts +2 -2
- package/dist/types/api/stages/stages.d.ts.map +1 -1
- package/dist/types/types/data-item-types.d.ts +316 -158
- package/dist/types/types/data-item-types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.ToUpperExpressionImpl = exports.ToLowerExpressionImpl = exports.
|
|
4
|
+
exports.ToUpperExpressionImpl = exports.ToLowerExpressionImpl = exports.TextExpressionImpl = exports.SumExpressionImpl = exports.SubtractExpressionImpl = exports.SubstringExpressionImpl = exports.StringifyExpressionImpl = exports.NumericExpressionImpl = exports.MultiplyExpressionImpl = exports.ModExpressionImpl = exports.LengthExpressionImpl = exports.FloorExpressionImpl = exports.FieldExpressionImpl = exports.DivideExpressionImpl = exports.ConcatExpressionImpl = exports.CeilExpressionImpl = exports.AddExpressionImpl = exports.AbsExpressionImpl = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* @builder
|
|
7
7
|
*/
|
|
@@ -10,6 +10,7 @@ class FieldExpressionImpl {
|
|
|
10
10
|
constructor(fieldPath) {
|
|
11
11
|
this.fieldPath = fieldPath;
|
|
12
12
|
}
|
|
13
|
+
/** @private */
|
|
13
14
|
toProto() {
|
|
14
15
|
return {
|
|
15
16
|
fieldPath: this.fieldPath
|
|
@@ -21,13 +22,14 @@ class FieldExpressionImpl {
|
|
|
21
22
|
* @builder
|
|
22
23
|
*/
|
|
23
24
|
exports.FieldExpressionImpl = FieldExpressionImpl;
|
|
24
|
-
class
|
|
25
|
+
class TextExpressionImpl {
|
|
25
26
|
constructor(value) {
|
|
26
27
|
this.value = value;
|
|
27
28
|
}
|
|
29
|
+
/** @private */
|
|
28
30
|
toProto() {
|
|
29
31
|
return {
|
|
30
|
-
|
|
32
|
+
text: this.value
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -35,14 +37,15 @@ class StringValueExpressionImpl {
|
|
|
35
37
|
/**
|
|
36
38
|
* @builder
|
|
37
39
|
*/
|
|
38
|
-
exports.
|
|
39
|
-
class
|
|
40
|
+
exports.TextExpressionImpl = TextExpressionImpl;
|
|
41
|
+
class NumericExpressionImpl {
|
|
40
42
|
constructor(value) {
|
|
41
43
|
this.value = value;
|
|
42
44
|
}
|
|
45
|
+
/** @private */
|
|
43
46
|
toProto() {
|
|
44
47
|
return {
|
|
45
|
-
|
|
48
|
+
numeric: this.value
|
|
46
49
|
};
|
|
47
50
|
}
|
|
48
51
|
}
|
|
@@ -50,11 +53,12 @@ class NumericValueExpressionImpl {
|
|
|
50
53
|
/**
|
|
51
54
|
* @builder
|
|
52
55
|
*/
|
|
53
|
-
exports.
|
|
56
|
+
exports.NumericExpressionImpl = NumericExpressionImpl;
|
|
54
57
|
class AddExpressionImpl {
|
|
55
58
|
constructor(expressions) {
|
|
56
59
|
this.expressions = expressions;
|
|
57
60
|
}
|
|
61
|
+
/** @private */
|
|
58
62
|
toProto() {
|
|
59
63
|
return {
|
|
60
64
|
add: {
|
|
@@ -73,6 +77,7 @@ class SubtractExpressionImpl {
|
|
|
73
77
|
this.firstExpression = firstExpression;
|
|
74
78
|
this.secondExpression = secondExpression;
|
|
75
79
|
}
|
|
80
|
+
/** @private */
|
|
76
81
|
toProto() {
|
|
77
82
|
return {
|
|
78
83
|
subtract: {
|
|
@@ -91,6 +96,7 @@ class MultiplyExpressionImpl {
|
|
|
91
96
|
constructor(expressions) {
|
|
92
97
|
this.expressions = expressions;
|
|
93
98
|
}
|
|
99
|
+
/** @private */
|
|
94
100
|
toProto() {
|
|
95
101
|
return {
|
|
96
102
|
multiply: {
|
|
@@ -109,6 +115,7 @@ class DivideExpressionImpl {
|
|
|
109
115
|
this.firstExpression = firstExpression;
|
|
110
116
|
this.secondExpression = secondExpression;
|
|
111
117
|
}
|
|
118
|
+
/** @private */
|
|
112
119
|
toProto() {
|
|
113
120
|
return {
|
|
114
121
|
divide: {
|
|
@@ -127,6 +134,7 @@ class SumExpressionImpl {
|
|
|
127
134
|
constructor(expressions) {
|
|
128
135
|
this.expressions = expressions;
|
|
129
136
|
}
|
|
137
|
+
/** @private */
|
|
130
138
|
toProto() {
|
|
131
139
|
return {
|
|
132
140
|
sum: {
|
|
@@ -144,6 +152,7 @@ class AbsExpressionImpl {
|
|
|
144
152
|
constructor(expression) {
|
|
145
153
|
this.expression = expression;
|
|
146
154
|
}
|
|
155
|
+
/** @private */
|
|
147
156
|
toProto() {
|
|
148
157
|
return {
|
|
149
158
|
abs: {
|
|
@@ -162,6 +171,7 @@ class ModExpressionImpl {
|
|
|
162
171
|
this.firstExpression = firstExpression;
|
|
163
172
|
this.secondExpression = secondExpression;
|
|
164
173
|
}
|
|
174
|
+
/** @private */
|
|
165
175
|
toProto() {
|
|
166
176
|
return {
|
|
167
177
|
mod: {
|
|
@@ -180,6 +190,7 @@ class FloorExpressionImpl {
|
|
|
180
190
|
constructor(expression) {
|
|
181
191
|
this.expression = expression;
|
|
182
192
|
}
|
|
193
|
+
/** @private */
|
|
183
194
|
toProto() {
|
|
184
195
|
return {
|
|
185
196
|
floor: {
|
|
@@ -197,6 +208,7 @@ class CeilExpressionImpl {
|
|
|
197
208
|
constructor(expression) {
|
|
198
209
|
this.expression = expression;
|
|
199
210
|
}
|
|
211
|
+
/** @private */
|
|
200
212
|
toProto() {
|
|
201
213
|
return {
|
|
202
214
|
ceil: {
|
|
@@ -214,6 +226,7 @@ class ConcatExpressionImpl {
|
|
|
214
226
|
constructor(expressions) {
|
|
215
227
|
this.expressions = expressions;
|
|
216
228
|
}
|
|
229
|
+
/** @private */
|
|
217
230
|
toProto() {
|
|
218
231
|
return {
|
|
219
232
|
concat: {
|
|
@@ -231,6 +244,7 @@ class StringifyExpressionImpl {
|
|
|
231
244
|
constructor(expression) {
|
|
232
245
|
this.expression = expression;
|
|
233
246
|
}
|
|
247
|
+
/** @private */
|
|
234
248
|
toProto() {
|
|
235
249
|
return {
|
|
236
250
|
stringify: {
|
|
@@ -248,6 +262,7 @@ class ToLowerExpressionImpl {
|
|
|
248
262
|
constructor(expression) {
|
|
249
263
|
this.expression = expression;
|
|
250
264
|
}
|
|
265
|
+
/** @private */
|
|
251
266
|
toProto() {
|
|
252
267
|
return {
|
|
253
268
|
toLower: {
|
|
@@ -265,6 +280,7 @@ class ToUpperExpressionImpl {
|
|
|
265
280
|
constructor(expression) {
|
|
266
281
|
this.expression = expression;
|
|
267
282
|
}
|
|
283
|
+
/** @private */
|
|
268
284
|
toProto() {
|
|
269
285
|
return {
|
|
270
286
|
toUpper: {
|
|
@@ -284,6 +300,7 @@ class SubstringExpressionImpl {
|
|
|
284
300
|
this.startExpression = startExpression;
|
|
285
301
|
this.lengthExpression = lengthExpression;
|
|
286
302
|
}
|
|
303
|
+
/** @private */
|
|
287
304
|
toProto() {
|
|
288
305
|
const proto = {
|
|
289
306
|
substring: {
|
|
@@ -306,6 +323,7 @@ class LengthExpressionImpl {
|
|
|
306
323
|
constructor(expression) {
|
|
307
324
|
this.expression = expression;
|
|
308
325
|
}
|
|
326
|
+
/** @private */
|
|
309
327
|
toProto() {
|
|
310
328
|
return {
|
|
311
329
|
length: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FieldExpressionImpl","constructor","fieldPath","toProto","exports","StringValueExpressionImpl","value","stringValue","NumericValueExpressionImpl","numericValue","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 * @internal\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 toProto(): apiTypes.Expression {\n return { fieldPath: this.fieldPath }\n }\n}\n\n/**\n * @builder\n */\nexport interface StringValueExpression extends Expression {}\n\nexport class StringValueExpressionImpl implements StringValueExpression {\n constructor(private value: string) {}\n toProto(): apiTypes.Expression {\n return { stringValue: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport interface NumericValueExpression extends Expression {}\n\nexport class NumericValueExpressionImpl implements NumericValueExpression {\n constructor(private value: number) {}\n toProto(): apiTypes.Expression {\n return { numericValue: 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 toProto(): apiTypes.Expression {\n return {\n length: { expression: this.expression.toProto() },\n }\n }\n}\n"],"mappings":";;;;AASA;AACA;AACA;;AAGO,MAAMA,mBAAmB,CAA4B;EAC1DC,WAAWA,CAASC,SAAiB,EAAE;IAAA,KAAnBA,SAAiB,GAAjBA,SAAiB;EAAG;EACxCC,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MAAED,SAAS,EAAE,IAAI,CAACA;IAAU,CAAC;EACtC;AACF;;AAEA;AACA;AACA;AAFAE,OAAA,CAAAJ,mBAAA,GAAAA,mBAAA;AAKO,MAAMK,yBAAyB,CAAkC;EACtEJ,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpCH,OAAOA,CAAA,EAAwB;IAC7B,O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AA,qBAAA;AAKO,MAAME,uBAAuB,CAAgC;EAClEzC,WAAWA,CACDyB,UAAsB,EACtBiB,eAA2B,EAC3BC,gBAA6B,EACrC;IAAA,KAHQlB,UAAsB,GAAtBA,UAAsB;IAAA,KACtBiB,eAA2B,GAA3BA,eAA2B;IAAA,KAC3BC,gBAA6B,GAA7BA,gBAA6B;EACpC;EACHzC,OAAOA,CAAA,EAAwB;IAC7B,MAAM0C,KAAU,GAAG;MACjBC,SAAS,EAAE;QACTpB,UAAU,EAAE,IAAI,CAACA,UAAU,CAACvB,OAAO,CAAC,CAAC;QACrCwC,eAAe,EAAE,IAAI,CAACA,eAAe,CAACxC,OAAO,CAAC;MAChD;IACF,CAAC;IACD,IAAI,IAAI,CAACyC,gBAAgB,EAAE;MACzBC,KAAK,CAACC,SAAS,CAACF,gBAAgB,GAAG,IAAI,CAACA,gBAAgB,CAACzC,OAAO,CAAC,CAAC;IACpE;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;EAC7CvB,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","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.expression.toProto() },\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,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CAACA,UAAU,CAACvB,OAAO,CAAC;MAAE;IAClD,CAAC;EACH;AACF;AAACC,OAAA,CAAA2C,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -5,8 +5,8 @@ exports.expressions = void 0;
|
|
|
5
5
|
var _Expression = require("./Expression");
|
|
6
6
|
const expressions = exports.expressions = {
|
|
7
7
|
field: fieldPath => new _Expression.FieldExpressionImpl(fieldPath),
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
text: value => new _Expression.TextExpressionImpl(value),
|
|
9
|
+
numeric: value => new _Expression.NumericExpressionImpl(value),
|
|
10
10
|
add: (...expressions) => new _Expression.AddExpressionImpl(expressions),
|
|
11
11
|
subtract: (first, second) => new _Expression.SubtractExpressionImpl(first, second),
|
|
12
12
|
multiply: (...expressions) => new _Expression.MultiplyExpressionImpl(expressions),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpressionImpl","
|
|
1
|
+
{"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpressionImpl","text","value","TextExpressionImpl","numeric","NumericExpressionImpl","add","AddExpressionImpl","subtract","first","second","SubtractExpressionImpl","multiply","MultiplyExpressionImpl","divide","DivideExpressionImpl","sum","SumExpressionImpl","abs","expression","AbsExpressionImpl","mod","ModExpressionImpl","floor","FloorExpressionImpl","ceil","CeilExpressionImpl","concat","ConcatExpressionImpl","stringify","StringifyExpressionImpl","toLower","ToLowerExpressionImpl","toUpper","ToUpperExpressionImpl","substring","start","length","SubstringExpressionImpl","LengthExpressionImpl"],"sources":["../../../../src/api/expressions/expressions.ts"],"sourcesContent":["import {\n Expression,\n FieldExpression,\n FieldExpressionImpl,\n TextExpression,\n TextExpressionImpl,\n NumericExpression,\n NumericExpressionImpl,\n AddExpression,\n AddExpressionImpl,\n SubtractExpression,\n SubtractExpressionImpl,\n MultiplyExpression,\n MultiplyExpressionImpl,\n DivideExpression,\n DivideExpressionImpl,\n SumExpression,\n SumExpressionImpl,\n AbsExpression,\n AbsExpressionImpl,\n ModExpression,\n ModExpressionImpl,\n FloorExpression,\n FloorExpressionImpl,\n CeilExpression,\n CeilExpressionImpl,\n ConcatExpression,\n ConcatExpressionImpl,\n StringifyExpression,\n StringifyExpressionImpl,\n ToLowerExpression,\n ToLowerExpressionImpl,\n ToUpperExpression,\n ToUpperExpressionImpl,\n SubstringExpression,\n SubstringExpressionImpl,\n LengthExpression,\n LengthExpressionImpl,\n} from './Expression'\n\nexport const expressions: WixDataAggregatePipelineExpressions = {\n field: (fieldPath: string): FieldExpression =>\n new FieldExpressionImpl(fieldPath),\n text: (value: string): TextExpression => new TextExpressionImpl(value),\n numeric: (value: number): NumericExpression =>\n new NumericExpressionImpl(value),\n add: (...expressions: Expression[]): AddExpression =>\n new AddExpressionImpl(expressions),\n subtract: (first: Expression, second: Expression): SubtractExpression =>\n new SubtractExpressionImpl(first, second),\n multiply: (...expressions: Expression[]): MultiplyExpression =>\n new MultiplyExpressionImpl(expressions),\n divide: (first: Expression, second: Expression): DivideExpression =>\n new DivideExpressionImpl(first, second),\n sum: (...expressions: Expression[]): SumExpression =>\n new SumExpressionImpl(expressions),\n abs: (expression: Expression): AbsExpression =>\n new AbsExpressionImpl(expression),\n mod: (first: Expression, second: Expression): ModExpression =>\n new ModExpressionImpl(first, second),\n\n floor: (expression: Expression): FloorExpression =>\n new FloorExpressionImpl(expression),\n ceil: (expression: Expression): CeilExpression =>\n new CeilExpressionImpl(expression),\n concat: (...expressions: Expression[]): ConcatExpression =>\n new ConcatExpressionImpl(expressions),\n stringify: (expression: Expression): StringifyExpression =>\n new StringifyExpressionImpl(expression),\n toLower: (expression: Expression): ToLowerExpression =>\n new ToLowerExpressionImpl(expression),\n toUpper: (expression: Expression): ToUpperExpression =>\n new ToUpperExpressionImpl(expression),\n substring: (\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression =>\n new SubstringExpressionImpl(expression, start, length),\n length: (expression: Expression): LengthExpression =>\n new LengthExpressionImpl(expression),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineExpressions {\n field(fieldPath: string): FieldExpression\n text(value: string): TextExpression\n numeric(value: number): NumericExpression\n add(...expressions: Expression[]): AddExpression\n subtract(first: Expression, second: Expression): SubtractExpression\n multiply(...expressions: Expression[]): MultiplyExpression\n divide(first: Expression, second: Expression): DivideExpression\n sum(...expressions: Expression[]): SumExpression\n abs(expression: Expression): AbsExpression\n mod(first: Expression, second: Expression): ModExpression\n floor(expression: Expression): FloorExpression\n ceil(expression: Expression): CeilExpression\n concat(...expressions: Expression[]): ConcatExpression\n stringify(expression: Expression): StringifyExpression\n toLower(expression: Expression): ToLowerExpression\n toUpper(expression: Expression): ToUpperExpression\n substring(\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression\n length(expression: Expression): LengthExpression\n}\n"],"mappings":";;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAwCO,MAAMC,WAAgD,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC9DE,KAAK,EAAGC,SAAiB,IACvB,IAAIC,+BAAmB,CAACD,SAAS,CAAC;EACpCE,IAAI,EAAGC,KAAa,IAAqB,IAAIC,8BAAkB,CAACD,KAAK,CAAC;EACtEE,OAAO,EAAGF,KAAa,IACrB,IAAIG,iCAAqB,CAACH,KAAK,CAAC;EAClCI,GAAG,EAAEA,CAAC,GAAGV,WAAyB,KAChC,IAAIW,6BAAiB,CAACX,WAAW,CAAC;EACpCY,QAAQ,EAAEA,CAACC,KAAiB,EAAEC,MAAkB,KAC9C,IAAIC,kCAAsB,CAACF,KAAK,EAAEC,MAAM,CAAC;EAC3CE,QAAQ,EAAEA,CAAC,GAAGhB,WAAyB,KACrC,IAAIiB,kCAAsB,CAACjB,WAAW,CAAC;EACzCkB,MAAM,EAAEA,CAACL,KAAiB,EAAEC,MAAkB,KAC5C,IAAIK,gCAAoB,CAACN,KAAK,EAAEC,MAAM,CAAC;EACzCM,GAAG,EAAEA,CAAC,GAAGpB,WAAyB,KAChC,IAAIqB,6BAAiB,CAACrB,WAAW,CAAC;EACpCsB,GAAG,EAAGC,UAAsB,IAC1B,IAAIC,6BAAiB,CAACD,UAAU,CAAC;EACnCE,GAAG,EAAEA,CAACZ,KAAiB,EAAEC,MAAkB,KACzC,IAAIY,6BAAiB,CAACb,KAAK,EAAEC,MAAM,CAAC;EAEtCa,KAAK,EAAGJ,UAAsB,IAC5B,IAAIK,+BAAmB,CAACL,UAAU,CAAC;EACrCM,IAAI,EAAGN,UAAsB,IAC3B,IAAIO,8BAAkB,CAACP,UAAU,CAAC;EACpCQ,MAAM,EAAEA,CAAC,GAAG/B,WAAyB,KACnC,IAAIgC,gCAAoB,CAAChC,WAAW,CAAC;EACvCiC,SAAS,EAAGV,UAAsB,IAChC,IAAIW,mCAAuB,CAACX,UAAU,CAAC;EACzCY,OAAO,EAAGZ,UAAsB,IAC9B,IAAIa,iCAAqB,CAACb,UAAU,CAAC;EACvCc,OAAO,EAAGd,UAAsB,IAC9B,IAAIe,iCAAqB,CAACf,UAAU,CAAC;EACvCgB,SAAS,EAAEA,CACThB,UAAsB,EACtBiB,KAAiB,EACjBC,MAAmB,KAEnB,IAAIC,mCAAuB,CAACnB,UAAU,EAAEiB,KAAK,EAAEC,MAAM,CAAC;EACxDA,MAAM,EAAGlB,UAAsB,IAC7B,IAAIoB,gCAAoB,CAACpB,UAAU;AACvC,CAAC;;AAED;AACA;AACA","ignoreList":[]}
|
package/dist/cjs/api/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.stages = exports.expressions = exports.WixDataUpdateOptions = exports.WixDataSearch = exports.WixDataResult = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataFilter = exports.WixDataBulkResult = exports.WixDataBulkPatch = exports.WixDataBulkError = exports.WixDataApi = exports.WixDataAggregatePipelineStages = exports.WixDataAggregatePipelineExpressions = exports.WixDataAggregatePipeline = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.UnwindStage = exports.SortStage = exports.SkipStage = exports.QueryValidator = exports.QueryBase = exports.ProjectStage = exports.PipelineStage = exports.ObjectToArrayStage = exports.LimitStage = exports.GroupStage = exports.FilterStage = void 0;
|
|
4
|
+
exports.stages = exports.expressions = exports.WixDataUpdateOptions = exports.WixDataSearch = exports.WixDataResult = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataFilter = exports.WixDataBulkResult = exports.WixDataBulkPatch = exports.WixDataBulkError = exports.WixDataApi = exports.WixDataAggregatePipelineStages = exports.WixDataAggregatePipelineExpressions = exports.WixDataAggregatePipeline = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.UnwindStage = exports.ToUpperExpression = exports.ToLowerExpression = exports.TextExpression = exports.SumExpression = exports.SubtractExpression = exports.SubstringExpression = exports.StringifyExpression = exports.SortStage = exports.SkipStage = exports.QueryValidator = exports.QueryBase = exports.ProjectStage = exports.PipelineStage = exports.ObjectToArrayStage = exports.NumericExpression = exports.MultiplyExpression = exports.ModExpression = exports.LimitStage = exports.LengthExpression = exports.GroupStage = exports.FloorExpression = exports.FilterStage = exports.FieldExpression = exports.DivideExpression = exports.ConcatExpression = exports.CeilExpression = exports.AddExpression = exports.AbsExpression = void 0;
|
|
5
5
|
var _WixDataQuery = require("./WixDataQuery");
|
|
6
6
|
exports.WixDataQuery = _WixDataQuery.WixDataQuery;
|
|
7
7
|
var _WixDataSearch = require("./WixDataSearch");
|
|
@@ -59,4 +59,23 @@ exports.ObjectToArrayStage = _ObjectToArrayStage.ObjectToArrayStage;
|
|
|
59
59
|
var _expressions = require("./expressions/expressions");
|
|
60
60
|
exports.expressions = _expressions.expressions;
|
|
61
61
|
exports.WixDataAggregatePipelineExpressions = _expressions.WixDataAggregatePipelineExpressions;
|
|
62
|
+
var _Expression = require("./expressions/Expression");
|
|
63
|
+
exports.FieldExpression = _Expression.FieldExpression;
|
|
64
|
+
exports.TextExpression = _Expression.TextExpression;
|
|
65
|
+
exports.NumericExpression = _Expression.NumericExpression;
|
|
66
|
+
exports.AddExpression = _Expression.AddExpression;
|
|
67
|
+
exports.SubtractExpression = _Expression.SubtractExpression;
|
|
68
|
+
exports.MultiplyExpression = _Expression.MultiplyExpression;
|
|
69
|
+
exports.DivideExpression = _Expression.DivideExpression;
|
|
70
|
+
exports.SumExpression = _Expression.SumExpression;
|
|
71
|
+
exports.AbsExpression = _Expression.AbsExpression;
|
|
72
|
+
exports.ModExpression = _Expression.ModExpression;
|
|
73
|
+
exports.FloorExpression = _Expression.FloorExpression;
|
|
74
|
+
exports.CeilExpression = _Expression.CeilExpression;
|
|
75
|
+
exports.ConcatExpression = _Expression.ConcatExpression;
|
|
76
|
+
exports.StringifyExpression = _Expression.StringifyExpression;
|
|
77
|
+
exports.ToLowerExpression = _Expression.ToLowerExpression;
|
|
78
|
+
exports.ToUpperExpression = _Expression.ToUpperExpression;
|
|
79
|
+
exports.SubstringExpression = _Expression.SubstringExpression;
|
|
80
|
+
exports.LengthExpression = _Expression.LengthExpression;
|
|
62
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_WixDataSearch","WixDataSearch","_WixDataApi","WixDataApi","_WixDataResult","WixDataResult","_QueryValidator","QueryValidator","_WixDataAggregate","WixDataAggregate","_WixDataAggregatePipeline","WixDataAggregatePipeline","_QueryBase","QueryBase","_WixDataPatch","WixDataPatch","WixDataBulkPatch","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WixDataUpdateOptions","WixDataPatchOptions","WixDataQueryOptions","WixDataItem","WixDataReference","WixDataBulkError","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions","_stages","stages","PipelineStage","WixDataAggregatePipelineStages","_FilterStage","FilterStage","_ProjectStage","ProjectStage","_GroupStage","GroupStage","_UnwindStage","UnwindStage","_SortStage","SortStage","_LimitStage","LimitStage","_SkipStage","SkipStage","_ObjectToArrayStage","ObjectToArrayStage","_expressions","expressions","WixDataAggregatePipelineExpressions"],"sources":["../../../src/api/index.ts"],"sourcesContent":["export { WixDataQuery } from './WixDataQuery'\nexport { WixDataSearch } from './WixDataSearch'\nexport { WixDataApi } from './WixDataApi'\nexport { WixDataResult } from './WixDataResult'\nexport { QueryValidator } from './QueryValidator'\nexport { WixDataAggregate } from './WixDataAggregate'\nexport { WixDataAggregatePipeline } from './WixDataAggregatePipeline'\nexport { QueryBase } from './QueryBase'\nexport { WixDataPatch, WixDataBulkPatch } from './WixDataPatch'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataPatchOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\nexport {\n stages,\n PipelineStage,\n WixDataAggregatePipelineStages,\n} from './stages/stages'\nexport { FilterStage } from './stages/FilterStage'\nexport { ProjectStage } from './stages/ProjectStage'\nexport { GroupStage } from './stages/GroupStage'\nexport { UnwindStage } from './stages/UnwindStage'\nexport { SortStage } from './stages/SortStage'\nexport { LimitStage } from './stages/LimitStage'\nexport { SkipStage } from './stages/SkipStage'\nexport { ObjectToArrayStage } from './stages/ObjectToArrayStage'\nexport {\n expressions,\n WixDataAggregatePipelineExpressions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,OAAA;AAA8CC,OAAA,CAAAmD,SAAA,GAAAD,UAAA,CAAAC,SAAA;AAC9C,IAAAC,mBAAA,GAAArD,OAAA;AAAgEC,OAAA,CAAAqD,kBAAA,GAAAD,mBAAA,CAAAC,kBAAA;AAChE,IAAAC,YAAA,GAAAvD,OAAA;AAGkCC,OAAA,CAAAuD,WAAA,GAAAD,YAAA,CAAAC,WAAA;AAAAvD,OAAA,CAAAwD,mCAAA,GAAAF,YAAA,CAAAE,mCAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_WixDataSearch","WixDataSearch","_WixDataApi","WixDataApi","_WixDataResult","WixDataResult","_QueryValidator","QueryValidator","_WixDataAggregate","WixDataAggregate","_WixDataAggregatePipeline","WixDataAggregatePipeline","_QueryBase","QueryBase","_WixDataPatch","WixDataPatch","WixDataBulkPatch","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WixDataUpdateOptions","WixDataPatchOptions","WixDataQueryOptions","WixDataItem","WixDataReference","WixDataBulkError","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions","_stages","stages","PipelineStage","WixDataAggregatePipelineStages","_FilterStage","FilterStage","_ProjectStage","ProjectStage","_GroupStage","GroupStage","_UnwindStage","UnwindStage","_SortStage","SortStage","_LimitStage","LimitStage","_SkipStage","SkipStage","_ObjectToArrayStage","ObjectToArrayStage","_expressions","expressions","WixDataAggregatePipelineExpressions","_Expression","FieldExpression","TextExpression","NumericExpression","AddExpression","SubtractExpression","MultiplyExpression","DivideExpression","SumExpression","AbsExpression","ModExpression","FloorExpression","CeilExpression","ConcatExpression","StringifyExpression","ToLowerExpression","ToUpperExpression","SubstringExpression","LengthExpression"],"sources":["../../../src/api/index.ts"],"sourcesContent":["export { WixDataQuery } from './WixDataQuery'\nexport { WixDataSearch } from './WixDataSearch'\nexport { WixDataApi } from './WixDataApi'\nexport { WixDataResult } from './WixDataResult'\nexport { QueryValidator } from './QueryValidator'\nexport { WixDataAggregate } from './WixDataAggregate'\nexport { WixDataAggregatePipeline } from './WixDataAggregatePipeline'\nexport { QueryBase } from './QueryBase'\nexport { WixDataPatch, WixDataBulkPatch } from './WixDataPatch'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataPatchOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\nexport {\n stages,\n PipelineStage,\n WixDataAggregatePipelineStages,\n} from './stages/stages'\nexport { FilterStage } from './stages/FilterStage'\nexport { ProjectStage } from './stages/ProjectStage'\nexport { GroupStage } from './stages/GroupStage'\nexport { UnwindStage } from './stages/UnwindStage'\nexport { SortStage } from './stages/SortStage'\nexport { LimitStage } from './stages/LimitStage'\nexport { SkipStage } from './stages/SkipStage'\nexport { ObjectToArrayStage } from './stages/ObjectToArrayStage'\nexport {\n expressions,\n WixDataAggregatePipelineExpressions,\n} from './expressions/expressions'\nexport {\n FieldExpression,\n TextExpression,\n NumericExpression,\n AddExpression,\n SubtractExpression,\n MultiplyExpression,\n DivideExpression,\n SumExpression,\n AbsExpression,\n ModExpression,\n FloorExpression,\n CeilExpression,\n ConcatExpression,\n StringifyExpression,\n ToLowerExpression,\n ToUpperExpression,\n SubstringExpression,\n LengthExpression,\n} from './expressions/Expression'\n"],"mappings":";;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAA6CC,OAAA,CAAAC,YAAA,GAAAH,aAAA,CAAAG,YAAA;AAC7C,IAAAC,cAAA,GAAAH,OAAA;AAA+CC,OAAA,CAAAG,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAAAC,WAAA,GAAAL,OAAA;AAAyCC,OAAA,CAAAK,UAAA,GAAAD,WAAA,CAA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AA,CAAAE,mCAAA;AAClC,IAAAC,WAAA,GAAA1D,OAAA;AAmBiCC,OAAA,CAAA0D,eAAA,GAAAD,WAAA,CAAAC,eAAA;AAAA1D,OAAA,CAAA2D,cAAA,GAAAF,WAAA,CAAAE,cAAA;AAAA3D,OAAA,CAAA4D,iBAAA,GAAAH,WAAA,CAAAG,iBAAA;AAAA5D,OAAA,CAAA6D,aAAA,GAAAJ,WAAA,CAAAI,aAAA;AAAA7D,OAAA,CAAA8D,kBAAA,GAAAL,WAAA,CAAAK,kBAAA;AAAA9D,OAAA,CAAA+D,kBAAA,GAAAN,WAAA,CAAAM,kBAAA;AAAA/D,OAAA,CAAAgE,gBAAA,GAAAP,WAAA,CAAAO,gBAAA;AAAAhE,OAAA,CAAAiE,aAAA,GAAAR,WAAA,CAAAQ,aAAA;AAAAjE,OAAA,CAAAkE,aAAA,GAAAT,WAAA,CAAAS,aAAA;AAAAlE,OAAA,CAAAmE,aAAA,GAAAV,WAAA,CAAAU,aAAA;AAAAnE,OAAA,CAAAoE,eAAA,GAAAX,WAAA,CAAAW,eAAA;AAAApE,OAAA,CAAAqE,cAAA,GAAAZ,WAAA,CAAAY,cAAA;AAAArE,OAAA,CAAAsE,gBAAA,GAAAb,WAAA,CAAAa,gBAAA;AAAAtE,OAAA,CAAAuE,mBAAA,GAAAd,WAAA,CAAAc,mBAAA;AAAAvE,OAAA,CAAAwE,iBAAA,GAAAf,WAAA,CAAAe,iBAAA;AAAAxE,OAAA,CAAAyE,iBAAA,GAAAhB,WAAA,CAAAgB,iBAAA;AAAAzE,OAAA,CAAA0E,mBAAA,GAAAjB,WAAA,CAAAiB,mBAAA;AAAA1E,OAAA,CAAA2E,gBAAA,GAAAlB,WAAA,CAAAkB,gBAAA","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 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;EAEAC,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","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":[]}
|
|
@@ -34,7 +34,7 @@ class GroupStageImpl {
|
|
|
34
34
|
return this.addAccumulator(expression, 'max', resultFieldName);
|
|
35
35
|
}
|
|
36
36
|
count(resultFieldName) {
|
|
37
|
-
return this.addAccumulator(new _Expression.
|
|
37
|
+
return this.addAccumulator(new _Expression.NumericExpressionImpl(1), 'sum', resultFieldName);
|
|
38
38
|
}
|
|
39
39
|
first(expression, resultFieldName) {
|
|
40
40
|
return this.addAccumulator(expression, 'first', resultFieldName);
|
|
@@ -53,10 +53,12 @@ class GroupStageImpl {
|
|
|
53
53
|
});
|
|
54
54
|
return this;
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
/** @private */
|
|
56
58
|
toProto() {
|
|
57
59
|
return {
|
|
58
60
|
group: {
|
|
59
|
-
|
|
61
|
+
groupIds: this.ids.map(id => ({
|
|
60
62
|
expression: id.expression.toProto(),
|
|
61
63
|
key: id.key
|
|
62
64
|
})),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","
|
|
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","toProto","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 toProto(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.toProto(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.toProto(),\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,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAE,GAAGA,CAACP,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAG,GAAGA,CAACR,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAI,GAAGA,CAACT,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,KAAK,EAAEK,eAAe,CAAC;EAChE;EAEAK,KAAKA,CAACL,eAAuB,EAAc;IACzC,OAAO,IAAI,CAACC,cAAc,CACxB,IAAIK,iCAAqB,CAAC,CAAC,CAAC,EAC5B,KAAK,EACLN,eACF,CAAC;EACH;EAEAO,KAAKA,CAACZ,UAAsB,EAAEK,eAAuB,EAAc;IACjE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,OAAO,EAAEK,eAAe,CAAC;EAClE;EAEAQ,IAAIA,CAACb,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEAF,IAAIA,CAACH,UAAsB,EAAEK,eAAuB,EAAc;IAChE,OAAO,IAAI,CAACC,cAAc,CAACN,UAAU,EAAE,MAAM,EAAEK,eAAe,CAAC;EACjE;EAEQC,cAAcA,CACpBN,UAAsB,EACtBc,IAAqB,EACrBT,eAAuB,EACX;IACZ,IAAI,CAACU,YAAY,CAACZ,IAAI,CAAC;MAAEW,IAAI;MAAEd,UAAU;MAAEK;IAAgB,CAAC,CAAC;IAC7D,OAAO,IAAI;EACb;;EAEA;EACAW,OAAOA,CAAA,EAAmB;IACxB,OAAO;MACLC,KAAK,EAAE;QACLC,QAAQ,EAAE,IAAI,CAAChB,GAAG,CAACiB,GAAG,CAAEC,EAAE,KAAM;UAC9BpB,UAAU,EAAEoB,EAAE,CAACpB,UAAU,CAACgB,OAAO,CAAC,CAAC;UACnCf,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,OAAO,CAAC;UAC7C,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","toProto","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 toProto(): 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;
|
|
1
|
+
{"version":3,"names":["LimitStageImpl","constructor","count","toProto","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 toProto(): 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,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,KAAK,EAAE,IAAI,CAACF;IAAM,CAAC;EAC9B;AACF;AAACG,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -7,14 +7,16 @@ exports.ObjectToArrayStageImpl = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
class ObjectToArrayStageImpl {
|
|
10
|
-
constructor(
|
|
11
|
-
this.
|
|
10
|
+
constructor(objectFieldName, destinationFieldName) {
|
|
11
|
+
this.objectFieldName = objectFieldName;
|
|
12
12
|
this.destinationFieldName = destinationFieldName;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
/** @private */
|
|
14
16
|
toProto() {
|
|
15
17
|
return {
|
|
16
18
|
objectToArray: {
|
|
17
|
-
|
|
19
|
+
objectFieldName: this.objectFieldName,
|
|
18
20
|
destinationFieldName: this.destinationFieldName
|
|
19
21
|
}
|
|
20
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ObjectToArrayStageImpl","constructor","
|
|
1
|
+
{"version":3,"names":["ObjectToArrayStageImpl","constructor","objectFieldName","destinationFieldName","toProto","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 toProto(): 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,OAAOA,CAAA,EAAmB;IACxB,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":[]}
|
|
@@ -32,31 +32,33 @@ class ProjectStageImpl {
|
|
|
32
32
|
});
|
|
33
33
|
return this;
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
reshape(expression, fieldName) {
|
|
36
36
|
this.addField(expression, fieldName);
|
|
37
37
|
return this;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
nested(stage, fieldName) {
|
|
40
40
|
return this.addNestedProjectionField(fieldName, stage.fields);
|
|
41
41
|
}
|
|
42
|
-
addField(expression,
|
|
42
|
+
addField(expression, resultFieldName) {
|
|
43
43
|
this.fields.push({
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
reshape: {
|
|
45
|
+
resultFieldName,
|
|
46
46
|
expression: expression.toProto()
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
return this;
|
|
50
50
|
}
|
|
51
|
-
addNestedProjectionField(
|
|
51
|
+
addNestedProjectionField(resultFieldName, fields) {
|
|
52
52
|
this.fields.push({
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
projectNested: {
|
|
54
|
+
resultFieldName,
|
|
55
55
|
fields
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
return this;
|
|
59
59
|
}
|
|
60
|
+
|
|
61
|
+
/** @private */
|
|
60
62
|
toProto() {
|
|
61
63
|
return {
|
|
62
64
|
projection: {
|