@wix/wix-data-items-common 1.0.185 → 1.0.186

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.
Files changed (67) hide show
  1. package/dist/cjs/api/expressions/Expression.js +38 -37
  2. package/dist/cjs/api/expressions/Expression.js.map +1 -1
  3. package/dist/cjs/api/expressions/expressions.js +18 -18
  4. package/dist/cjs/api/expressions/expressions.js.map +1 -1
  5. package/dist/cjs/api/stages/FilterStage.js +5 -4
  6. package/dist/cjs/api/stages/FilterStage.js.map +1 -1
  7. package/dist/cjs/api/stages/GroupStage.js +5 -4
  8. package/dist/cjs/api/stages/GroupStage.js.map +1 -1
  9. package/dist/cjs/api/stages/LimitStage.js +4 -3
  10. package/dist/cjs/api/stages/LimitStage.js.map +1 -1
  11. package/dist/cjs/api/stages/ObjectToArrayStage.js +4 -3
  12. package/dist/cjs/api/stages/ObjectToArrayStage.js.map +1 -1
  13. package/dist/cjs/api/stages/ProjectStage.js +4 -3
  14. package/dist/cjs/api/stages/ProjectStage.js.map +1 -1
  15. package/dist/cjs/api/stages/SkipStage.js +4 -3
  16. package/dist/cjs/api/stages/SkipStage.js.map +1 -1
  17. package/dist/cjs/api/stages/SortStage.js +4 -3
  18. package/dist/cjs/api/stages/SortStage.js.map +1 -1
  19. package/dist/cjs/api/stages/UnwindStage.js +4 -3
  20. package/dist/cjs/api/stages/UnwindStage.js.map +1 -1
  21. package/dist/cjs/api/stages/stages.js +8 -8
  22. package/dist/cjs/api/stages/stages.js.map +1 -1
  23. package/dist/esm/api/expressions/Expression.js +18 -72
  24. package/dist/esm/api/expressions/Expression.js.map +1 -1
  25. package/dist/esm/api/expressions/expressions.js +19 -19
  26. package/dist/esm/api/expressions/expressions.js.map +1 -1
  27. package/dist/esm/api/index.js +0 -8
  28. package/dist/esm/api/index.js.map +1 -1
  29. package/dist/esm/api/stages/FilterStage.js +2 -5
  30. package/dist/esm/api/stages/FilterStage.js.map +1 -1
  31. package/dist/esm/api/stages/GroupStage.js +3 -6
  32. package/dist/esm/api/stages/GroupStage.js.map +1 -1
  33. package/dist/esm/api/stages/LimitStage.js +1 -4
  34. package/dist/esm/api/stages/LimitStage.js.map +1 -1
  35. package/dist/esm/api/stages/ObjectToArrayStage.js +1 -4
  36. package/dist/esm/api/stages/ObjectToArrayStage.js.map +1 -1
  37. package/dist/esm/api/stages/ProjectStage.js +1 -4
  38. package/dist/esm/api/stages/ProjectStage.js.map +1 -1
  39. package/dist/esm/api/stages/SkipStage.js +1 -4
  40. package/dist/esm/api/stages/SkipStage.js.map +1 -1
  41. package/dist/esm/api/stages/SortStage.js +1 -4
  42. package/dist/esm/api/stages/SortStage.js.map +1 -1
  43. package/dist/esm/api/stages/UnwindStage.js +1 -4
  44. package/dist/esm/api/stages/UnwindStage.js.map +1 -1
  45. package/dist/esm/api/stages/stages.js +16 -16
  46. package/dist/esm/api/stages/stages.js.map +1 -1
  47. package/dist/types/api/expressions/Expression.d.ts +54 -18
  48. package/dist/types/api/expressions/Expression.d.ts.map +1 -1
  49. package/dist/types/api/expressions/expressions.d.ts.map +1 -1
  50. package/dist/types/api/stages/FilterStage.d.ts +418 -3
  51. package/dist/types/api/stages/FilterStage.d.ts.map +1 -1
  52. package/dist/types/api/stages/GroupStage.d.ts +13 -2
  53. package/dist/types/api/stages/GroupStage.d.ts.map +1 -1
  54. package/dist/types/api/stages/LimitStage.d.ts +3 -1
  55. package/dist/types/api/stages/LimitStage.d.ts.map +1 -1
  56. package/dist/types/api/stages/ObjectToArrayStage.d.ts +3 -1
  57. package/dist/types/api/stages/ObjectToArrayStage.d.ts.map +1 -1
  58. package/dist/types/api/stages/ProjectStage.d.ts +11 -1
  59. package/dist/types/api/stages/ProjectStage.d.ts.map +1 -1
  60. package/dist/types/api/stages/SkipStage.d.ts +3 -1
  61. package/dist/types/api/stages/SkipStage.d.ts.map +1 -1
  62. package/dist/types/api/stages/SortStage.d.ts +5 -1
  63. package/dist/types/api/stages/SortStage.d.ts.map +1 -1
  64. package/dist/types/api/stages/UnwindStage.d.ts +3 -1
  65. package/dist/types/api/stages/UnwindStage.d.ts.map +1 -1
  66. package/dist/types/api/stages/stages.d.ts.map +1 -1
  67. package/package.json +2 -2
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.ToUpperExpression = exports.ToLowerExpression = exports.SumExpression = exports.SubtractExpression = exports.SubstringExpression = exports.StringifyExpression = exports.StringValueExpression = exports.NumericValueExpression = exports.MultiplyExpression = exports.ModExpression = exports.LengthExpression = exports.FloorExpression = exports.FieldExpression = exports.DivideExpression = exports.ConcatExpression = exports.CeilExpression = exports.AddExpression = exports.AbsExpression = void 0;
4
+ exports.ToUpperExpressionImpl = exports.ToLowerExpressionImpl = exports.SumExpressionImpl = exports.SubtractExpressionImpl = exports.SubstringExpressionImpl = exports.StringifyExpressionImpl = exports.StringValueExpressionImpl = exports.NumericValueExpressionImpl = 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
  */
8
- class FieldExpression {
8
+
9
+ class FieldExpressionImpl {
9
10
  constructor(fieldPath) {
10
11
  this.fieldPath = fieldPath;
11
12
  }
@@ -19,8 +20,8 @@ class FieldExpression {
19
20
  /**
20
21
  * @builder
21
22
  */
22
- exports.FieldExpression = FieldExpression;
23
- class StringValueExpression {
23
+ exports.FieldExpressionImpl = FieldExpressionImpl;
24
+ class StringValueExpressionImpl {
24
25
  constructor(value) {
25
26
  this.value = value;
26
27
  }
@@ -34,8 +35,8 @@ class StringValueExpression {
34
35
  /**
35
36
  * @builder
36
37
  */
37
- exports.StringValueExpression = StringValueExpression;
38
- class NumericValueExpression {
38
+ exports.StringValueExpressionImpl = StringValueExpressionImpl;
39
+ class NumericValueExpressionImpl {
39
40
  constructor(value) {
40
41
  this.value = value;
41
42
  }
@@ -49,8 +50,8 @@ class NumericValueExpression {
49
50
  /**
50
51
  * @builder
51
52
  */
52
- exports.NumericValueExpression = NumericValueExpression;
53
- class AddExpression {
53
+ exports.NumericValueExpressionImpl = NumericValueExpressionImpl;
54
+ class AddExpressionImpl {
54
55
  constructor(expressions) {
55
56
  this.expressions = expressions;
56
57
  }
@@ -66,8 +67,8 @@ class AddExpression {
66
67
  /**
67
68
  * @builder
68
69
  */
69
- exports.AddExpression = AddExpression;
70
- class SubtractExpression {
70
+ exports.AddExpressionImpl = AddExpressionImpl;
71
+ class SubtractExpressionImpl {
71
72
  constructor(firstExpression, secondExpression) {
72
73
  this.firstExpression = firstExpression;
73
74
  this.secondExpression = secondExpression;
@@ -85,8 +86,8 @@ class SubtractExpression {
85
86
  /**
86
87
  * @builder
87
88
  */
88
- exports.SubtractExpression = SubtractExpression;
89
- class MultiplyExpression {
89
+ exports.SubtractExpressionImpl = SubtractExpressionImpl;
90
+ class MultiplyExpressionImpl {
90
91
  constructor(expressions) {
91
92
  this.expressions = expressions;
92
93
  }
@@ -102,8 +103,8 @@ class MultiplyExpression {
102
103
  /**
103
104
  * @builder
104
105
  */
105
- exports.MultiplyExpression = MultiplyExpression;
106
- class DivideExpression {
106
+ exports.MultiplyExpressionImpl = MultiplyExpressionImpl;
107
+ class DivideExpressionImpl {
107
108
  constructor(firstExpression, secondExpression) {
108
109
  this.firstExpression = firstExpression;
109
110
  this.secondExpression = secondExpression;
@@ -121,8 +122,8 @@ class DivideExpression {
121
122
  /**
122
123
  * @builder
123
124
  */
124
- exports.DivideExpression = DivideExpression;
125
- class SumExpression {
125
+ exports.DivideExpressionImpl = DivideExpressionImpl;
126
+ class SumExpressionImpl {
126
127
  constructor(expressions) {
127
128
  this.expressions = expressions;
128
129
  }
@@ -138,8 +139,8 @@ class SumExpression {
138
139
  /**
139
140
  * @builder
140
141
  */
141
- exports.SumExpression = SumExpression;
142
- class AbsExpression {
142
+ exports.SumExpressionImpl = SumExpressionImpl;
143
+ class AbsExpressionImpl {
143
144
  constructor(expression) {
144
145
  this.expression = expression;
145
146
  }
@@ -155,8 +156,8 @@ class AbsExpression {
155
156
  /**
156
157
  * @builder
157
158
  */
158
- exports.AbsExpression = AbsExpression;
159
- class ModExpression {
159
+ exports.AbsExpressionImpl = AbsExpressionImpl;
160
+ class ModExpressionImpl {
160
161
  constructor(firstExpression, secondExpression) {
161
162
  this.firstExpression = firstExpression;
162
163
  this.secondExpression = secondExpression;
@@ -174,8 +175,8 @@ class ModExpression {
174
175
  /**
175
176
  * @builder
176
177
  */
177
- exports.ModExpression = ModExpression;
178
- class FloorExpression {
178
+ exports.ModExpressionImpl = ModExpressionImpl;
179
+ class FloorExpressionImpl {
179
180
  constructor(expression) {
180
181
  this.expression = expression;
181
182
  }
@@ -191,8 +192,8 @@ class FloorExpression {
191
192
  /**
192
193
  * @builder
193
194
  */
194
- exports.FloorExpression = FloorExpression;
195
- class CeilExpression {
195
+ exports.FloorExpressionImpl = FloorExpressionImpl;
196
+ class CeilExpressionImpl {
196
197
  constructor(expression) {
197
198
  this.expression = expression;
198
199
  }
@@ -208,8 +209,8 @@ class CeilExpression {
208
209
  /**
209
210
  * @builder
210
211
  */
211
- exports.CeilExpression = CeilExpression;
212
- class ConcatExpression {
212
+ exports.CeilExpressionImpl = CeilExpressionImpl;
213
+ class ConcatExpressionImpl {
213
214
  constructor(expressions) {
214
215
  this.expressions = expressions;
215
216
  }
@@ -225,8 +226,8 @@ class ConcatExpression {
225
226
  /**
226
227
  * @builder
227
228
  */
228
- exports.ConcatExpression = ConcatExpression;
229
- class StringifyExpression {
229
+ exports.ConcatExpressionImpl = ConcatExpressionImpl;
230
+ class StringifyExpressionImpl {
230
231
  constructor(expression) {
231
232
  this.expression = expression;
232
233
  }
@@ -242,8 +243,8 @@ class StringifyExpression {
242
243
  /**
243
244
  * @builder
244
245
  */
245
- exports.StringifyExpression = StringifyExpression;
246
- class ToLowerExpression {
246
+ exports.StringifyExpressionImpl = StringifyExpressionImpl;
247
+ class ToLowerExpressionImpl {
247
248
  constructor(expression) {
248
249
  this.expression = expression;
249
250
  }
@@ -259,8 +260,8 @@ class ToLowerExpression {
259
260
  /**
260
261
  * @builder
261
262
  */
262
- exports.ToLowerExpression = ToLowerExpression;
263
- class ToUpperExpression {
263
+ exports.ToLowerExpressionImpl = ToLowerExpressionImpl;
264
+ class ToUpperExpressionImpl {
264
265
  constructor(expression) {
265
266
  this.expression = expression;
266
267
  }
@@ -276,8 +277,8 @@ class ToUpperExpression {
276
277
  /**
277
278
  * @builder
278
279
  */
279
- exports.ToUpperExpression = ToUpperExpression;
280
- class SubstringExpression {
280
+ exports.ToUpperExpressionImpl = ToUpperExpressionImpl;
281
+ class SubstringExpressionImpl {
281
282
  constructor(expression, startExpression, lengthExpression) {
282
283
  this.expression = expression;
283
284
  this.startExpression = startExpression;
@@ -300,8 +301,8 @@ class SubstringExpression {
300
301
  /**
301
302
  * @builder
302
303
  */
303
- exports.SubstringExpression = SubstringExpression;
304
- class LengthExpression {
304
+ exports.SubstringExpressionImpl = SubstringExpressionImpl;
305
+ class LengthExpressionImpl {
305
306
  constructor(expression) {
306
307
  this.expression = expression;
307
308
  }
@@ -313,5 +314,5 @@ class LengthExpression {
313
314
  };
314
315
  }
315
316
  }
316
- exports.LengthExpression = LengthExpression;
317
+ exports.LengthExpressionImpl = LengthExpressionImpl;
317
318
  //# sourceMappingURL=Expression.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FieldExpression","constructor","fieldPath","toProto","exports","StringValueExpression","value","stringValue","NumericValueExpression","numericValue","AddExpression","expressions","add","map","e","SubtractExpression","firstExpression","secondExpression","subtract","MultiplyExpression","multiply","DivideExpression","divide","SumExpression","sum","AbsExpression","expression","abs","ModExpression","mod","FloorExpression","floor","CeilExpression","ceil","ConcatExpression","concat","StringifyExpression","stringify","ToLowerExpression","toLower","ToUpperExpression","toUpper","SubstringExpression","startExpression","lengthExpression","proto","substring","LengthExpression","length"],"sources":["../../../../src/api/expressions/Expression.ts"],"sourcesContent":["import * as apiTypes from '../../types/data-item-types'\n\nexport interface Expression {\n toProto(): apiTypes.Expression\n}\n\n/**\n * @builder\n */\nexport class FieldExpression implements Expression {\n constructor(private fieldPath: string) {}\n toProto(): apiTypes.Expression {\n return { fieldPath: this.fieldPath }\n }\n}\n\n/**\n * @builder\n */\nexport class StringValueExpression implements Expression {\n constructor(private value: string) {}\n toProto(): apiTypes.Expression {\n return { stringValue: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport class NumericValueExpression implements Expression {\n constructor(private value: number) {}\n toProto(): apiTypes.Expression {\n return { numericValue: this.value }\n }\n}\n\n/**\n * @builder\n */\nexport class AddExpression implements Expression {\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 class SubtractExpression implements Expression {\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 class MultiplyExpression implements Expression {\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 class DivideExpression implements Expression {\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 class SumExpression implements Expression {\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 class AbsExpression implements Expression {\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 class ModExpression implements Expression {\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 class FloorExpression implements Expression {\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 class CeilExpression implements Expression {\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 class ConcatExpression implements Expression {\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 class StringifyExpression implements Expression {\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 class ToLowerExpression implements Expression {\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 class ToUpperExpression implements Expression {\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 class SubstringExpression implements Expression {\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 class LengthExpression implements Expression {\n constructor(private expression: Expression) {}\n toProto(): apiTypes.Expression {\n return {\n length: { expression: this.expression.toProto() },\n }\n }\n}\n"],"mappings":";;;;AAMA;AACA;AACA;AACO,MAAMA,eAAe,CAAuB;EACjDC,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,eAAA,GAAAA,eAAA;AAGO,MAAMK,qBAAqB,CAAuB;EACvDJ,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpCH,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MAAEI,WAAW,EAAE,IAAI,CAACD;IAAM,CAAC;EACpC;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAC,qBAAA,GAAAA,qBAAA;AAGO,MAAMG,sBAAsB,CAAuB;EACxDP,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpCH,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MAAEM,YAAY,EAAE,IAAI,CAACH;IAAM,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAI,sBAAA,GAAAA,sBAAA;AAGO,MAAME,aAAa,CAAuB;EAC/CT,WAAWA,CAASU,WAAyB,EAAE;IAAA,KAA3BA,WAAyB,GAAzBA,WAAyB;EAAG;EAChDR,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MACLS,GAAG,EAAE;QACHD,WAAW,EAAE,IAAI,CAACA,WAAW,CAACE,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACX,OAAO,CAAC,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A,mBAAA;AAGO,MAAMK,gBAAgB,CAAuB;EAClD9C,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,gBAAA,GAAAA,gBAAA","ignoreList":[]}
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 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":";;;;AAMA;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,OAAO;MAAEI,WAAW,EAAE,IAAI,CAACD;IAAM,CAAC;EACpC;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAC,yBAAA,GAAAA,yBAAA;AAKO,MAAMG,0BAA0B,CAAmC;EACxEP,WAAWA,CAASK,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EACpCH,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MAAEM,YAAY,EAAE,IAAI,CAACH;IAAM,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AAFAF,OAAA,CAAAI,0BAAA,GAAAA,0BAAA;AAKO,MAAME,iBAAiB,CAA0B;EACtDT,WAAWA,CAASU,WAAyB,EAAE;IAAA,KAA3BA,WAAyB,GAAzBA,WAAyB;EAAG;EAChDR,OAAOA,CAAA,EAAwB;IAC7B,OAAO;MACL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G,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":[]}
@@ -4,24 +4,24 @@ exports.__esModule = true;
4
4
  exports.expressions = void 0;
5
5
  var _Expression = require("./Expression");
6
6
  const expressions = exports.expressions = {
7
- field: fieldPath => new _Expression.FieldExpression(fieldPath),
8
- stringValue: value => new _Expression.StringValueExpression(value),
9
- numericValue: value => new _Expression.NumericValueExpression(value),
10
- add: (...expressions) => new _Expression.AddExpression(expressions),
11
- subtract: (first, second) => new _Expression.SubtractExpression(first, second),
12
- multiply: (...expressions) => new _Expression.MultiplyExpression(expressions),
13
- divide: (first, second) => new _Expression.DivideExpression(first, second),
14
- sum: (...expressions) => new _Expression.SumExpression(expressions),
15
- abs: expression => new _Expression.AbsExpression(expression),
16
- mod: (first, second) => new _Expression.ModExpression(first, second),
17
- floor: expression => new _Expression.FloorExpression(expression),
18
- ceil: expression => new _Expression.CeilExpression(expression),
19
- concat: (...expressions) => new _Expression.ConcatExpression(expressions),
20
- stringify: expression => new _Expression.StringifyExpression(expression),
21
- toLower: expression => new _Expression.ToLowerExpression(expression),
22
- toUpper: expression => new _Expression.ToUpperExpression(expression),
23
- substring: (expression, start, length) => new _Expression.SubstringExpression(expression, start, length),
24
- length: expression => new _Expression.LengthExpression(expression)
7
+ field: fieldPath => new _Expression.FieldExpressionImpl(fieldPath),
8
+ stringValue: value => new _Expression.StringValueExpressionImpl(value),
9
+ numericValue: value => new _Expression.NumericValueExpressionImpl(value),
10
+ add: (...expressions) => new _Expression.AddExpressionImpl(expressions),
11
+ subtract: (first, second) => new _Expression.SubtractExpressionImpl(first, second),
12
+ multiply: (...expressions) => new _Expression.MultiplyExpressionImpl(expressions),
13
+ divide: (first, second) => new _Expression.DivideExpressionImpl(first, second),
14
+ sum: (...expressions) => new _Expression.SumExpressionImpl(expressions),
15
+ abs: expression => new _Expression.AbsExpressionImpl(expression),
16
+ mod: (first, second) => new _Expression.ModExpressionImpl(first, second),
17
+ floor: expression => new _Expression.FloorExpressionImpl(expression),
18
+ ceil: expression => new _Expression.CeilExpressionImpl(expression),
19
+ concat: (...expressions) => new _Expression.ConcatExpressionImpl(expressions),
20
+ stringify: expression => new _Expression.StringifyExpressionImpl(expression),
21
+ toLower: expression => new _Expression.ToLowerExpressionImpl(expression),
22
+ toUpper: expression => new _Expression.ToUpperExpressionImpl(expression),
23
+ substring: (expression, start, length) => new _Expression.SubstringExpressionImpl(expression, start, length),
24
+ length: expression => new _Expression.LengthExpressionImpl(expression)
25
25
  };
26
26
 
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpression","stringValue","value","StringValueExpression","numericValue","NumericValueExpression","add","AddExpression","subtract","first","second","SubtractExpression","multiply","MultiplyExpression","divide","DivideExpression","sum","SumExpression","abs","expression","AbsExpression","mod","ModExpression","floor","FloorExpression","ceil","CeilExpression","concat","ConcatExpression","stringify","StringifyExpression","toLower","ToLowerExpression","toUpper","ToUpperExpression","substring","start","length","SubstringExpression","LengthExpression"],"sources":["../../../../src/api/expressions/expressions.ts"],"sourcesContent":["import {\n Expression,\n FieldExpression,\n StringValueExpression,\n NumericValueExpression,\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 './Expression'\n\nexport const expressions: WixDataAggregatePipelineExpressions = {\n field: (fieldPath: string): FieldExpression => new FieldExpression(fieldPath),\n stringValue: (value: string): StringValueExpression =>\n new StringValueExpression(value),\n numericValue: (value: number): NumericValueExpression =>\n new NumericValueExpression(value),\n add: (...expressions: Expression[]): AddExpression =>\n new AddExpression(expressions),\n subtract: (first: Expression, second: Expression): SubtractExpression =>\n new SubtractExpression(first, second),\n multiply: (...expressions: Expression[]): MultiplyExpression =>\n new MultiplyExpression(expressions),\n divide: (first: Expression, second: Expression): DivideExpression =>\n new DivideExpression(first, second),\n sum: (...expressions: Expression[]): SumExpression =>\n new SumExpression(expressions),\n abs: (expression: Expression): AbsExpression => new AbsExpression(expression),\n mod: (first: Expression, second: Expression): ModExpression =>\n new ModExpression(first, second),\n\n floor: (expression: Expression): FloorExpression =>\n new FloorExpression(expression),\n ceil: (expression: Expression): CeilExpression =>\n new CeilExpression(expression),\n concat: (...expressions: Expression[]): ConcatExpression =>\n new ConcatExpression(expressions),\n stringify: (expression: Expression): StringifyExpression =>\n new StringifyExpression(expression),\n toLower: (expression: Expression): ToLowerExpression =>\n new ToLowerExpression(expression),\n toUpper: (expression: Expression): ToUpperExpression =>\n new ToUpperExpression(expression),\n substring: (\n expression: Expression,\n start: Expression,\n length?: Expression\n ): SubstringExpression => new SubstringExpression(expression, start, length),\n length: (expression: Expression): LengthExpression =>\n new LengthExpression(expression),\n}\n\n/**\n * @builder\n */\nexport interface WixDataAggregatePipelineExpressions {\n field(fieldPath: string): FieldExpression\n stringValue(value: string): StringValueExpression\n numericValue(value: number): NumericValueExpression\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;AAsBO,MAAMC,WAAgD,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC9DE,KAAK,EAAGC,SAAiB,IAAsB,IAAIC,2BAAe,CAACD,SAAS,CAAC;EAC7EE,WAAW,EAAGC,KAAa,IACzB,IAAIC,iCAAqB,CAACD,KAAK,CAAC;EAClCE,YAAY,EAAGF,KAAa,IAC1B,IAAIG,kCAAsB,CAACH,KAAK,CAAC;EACnCI,GAAG,EAAEA,CAAC,GAAGV,WAAyB,KAChC,IAAIW,yBAAa,CAACX,WAAW,CAAC;EAChCY,QAAQ,EAAEA,CAACC,KAAiB,EAAEC,MAAkB,KAC9C,IAAIC,8BAAkB,CAACF,KAAK,EAAEC,MAAM,CAAC;EACvCE,QAAQ,EAAEA,CAAC,GAAGhB,WAAyB,KACrC,IAAIiB,8BAAkB,CAACjB,WAAW,CAAC;EACrCkB,MAAM,EAAEA,CAACL,KAAiB,EAAEC,MAAkB,KAC5C,IAAIK,4BAAgB,CAACN,KAAK,EAAEC,MAAM,CAAC;EACrCM,GAAG,EAAEA,CAAC,GAAGpB,WAAyB,KAChC,IAAIqB,yBAAa,CAACrB,WAAW,CAAC;EAChCsB,GAAG,EAAGC,UAAsB,IAAoB,IAAIC,yBAAa,CAACD,UAAU,CAAC;EAC7EE,GAAG,EAAEA,CAACZ,KAAiB,EAAEC,MAAkB,KACzC,IAAIY,yBAAa,CAACb,KAAK,EAAEC,MAAM,CAAC;EAElCa,KAAK,EAAGJ,UAAsB,IAC5B,IAAIK,2BAAe,CAACL,UAAU,CAAC;EACjCM,IAAI,EAAGN,UAAsB,IAC3B,IAAIO,0BAAc,CAACP,UAAU,CAAC;EAChCQ,MAAM,EAAEA,CAAC,GAAG/B,WAAyB,KACnC,IAAIgC,4BAAgB,CAAChC,WAAW,CAAC;EACnCiC,SAAS,EAAGV,UAAsB,IAChC,IAAIW,+BAAmB,CAACX,UAAU,CAAC;EACrCY,OAAO,EAAGZ,UAAsB,IAC9B,IAAIa,6BAAiB,CAACb,UAAU,CAAC;EACnCc,OAAO,EAAGd,UAAsB,IAC9B,IAAIe,6BAAiB,CAACf,UAAU,CAAC;EACnCgB,SAAS,EAAEA,CACThB,UAAsB,EACtBiB,KAAiB,EACjBC,MAAmB,KACK,IAAIC,+BAAmB,CAACnB,UAAU,EAAEiB,KAAK,EAAEC,MAAM,CAAC;EAC5EA,MAAM,EAAGlB,UAAsB,IAC7B,IAAIoB,4BAAgB,CAACpB,UAAU;AACnC,CAAC;;AAED;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["_Expression","require","expressions","exports","field","fieldPath","FieldExpressionImpl","stringValue","value","StringValueExpressionImpl","numericValue","NumericValueExpressionImpl","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 StringValueExpression,\n StringValueExpressionImpl,\n NumericValueExpression,\n NumericValueExpressionImpl,\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 stringValue: (value: string): StringValueExpression =>\n new StringValueExpressionImpl(value),\n numericValue: (value: number): NumericValueExpression =>\n new NumericValueExpressionImpl(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 stringValue(value: string): StringValueExpression\n numericValue(value: number): NumericValueExpression\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,WAAW,EAAGC,KAAa,IACzB,IAAIC,qCAAyB,CAACD,KAAK,CAAC;EACtCE,YAAY,EAAGF,KAAa,IAC1B,IAAIG,sCAA0B,CAACH,KAAK,CAAC;EACvCI,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":[]}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.FilterStage = void 0;
4
+ exports.FilterStageImpl = void 0;
5
5
  var _QueryBase = require("../QueryBase");
6
6
  /**
7
7
  * @builder
8
8
  */
9
- class FilterStage extends _QueryBase.QueryBase {
9
+
10
+ class FilterStageImpl extends _QueryBase.QueryBase {
10
11
  constructor(origin) {
11
12
  super({
12
13
  collectionName: (origin == null ? void 0 : origin.collectionName) || '',
@@ -14,7 +15,7 @@ class FilterStage extends _QueryBase.QueryBase {
14
15
  });
15
16
  }
16
17
  copy(params) {
17
- return new FilterStage({
18
+ return new FilterStageImpl({
18
19
  collectionName: this.collectionName,
19
20
  filterBuilder: params.filterBuilder || this.filterBuilder
20
21
  });
@@ -28,5 +29,5 @@ class FilterStage extends _QueryBase.QueryBase {
28
29
  };
29
30
  }
30
31
  }
31
- exports.FilterStage = FilterStage;
32
+ exports.FilterStageImpl = FilterStageImpl;
32
33
  //# sourceMappingURL=FilterStage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_QueryBase","require","FilterStage","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 } from '../../filter'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport class FilterStage\n extends QueryBase<FilterStage>\n implements PipelineStage\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): FilterStage {\n return new FilterStage({\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;AAKA;AACA;AACA;AACO,MAAMC,WAAW,SACdC,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,EAAe;IACvC,OAAO,IAAIP,WAAW,CAAC;MACrBI,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,WAAA,GAAAA,WAAA","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 */\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 * Refines a filter to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this 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 * Refines a filter to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this 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 * Refines a filter to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this 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 * Refines a filter to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this 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 * Refines a filter to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this 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 * Refines a filter to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this 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 * Refines a filter to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this 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 * Refines a filter to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this 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 * Refines a filter to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this 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 * Refines a filter to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this 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 * Refines a filter to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the 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 * Refines a filter to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this 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 * Refines a filter to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this 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 filter.\n *\n * The `or()` method adds an inclusive `or` condition to this 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 filter.\n *\n * A 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 = items.filter()\n * .eq(\"status\", \"pending\")\n * .or(items.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = items.filter()\n * .lt(\"age\", 25)\n * .or(items.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 * items.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 filter.\n *\n * The `not()` method adds a `not` condition to this 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 * Refines a filter to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this 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;;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":[]}
@@ -2,13 +2,14 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.GroupStage = exports.GroupFieldBuilder = void 0;
5
+ exports.GroupStageImpl = exports.GroupFieldBuilder = void 0;
6
6
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
7
  var _Expression = require("../expressions/Expression");
8
8
  /**
9
9
  * @builder
10
10
  */
11
- class GroupStage {
11
+
12
+ class GroupStageImpl {
12
13
  constructor() {
13
14
  (0, _defineProperty2.default)(this, "ids", []);
14
15
  (0, _defineProperty2.default)(this, "accumulators", []);
@@ -32,7 +33,7 @@ class GroupStage {
32
33
  return new GroupFieldBuilder(this, expression, 'max');
33
34
  }
34
35
  count() {
35
- return new GroupFieldBuilder(this, new _Expression.NumericValueExpression(1), 'sum');
36
+ return new GroupFieldBuilder(this, new _Expression.NumericValueExpressionImpl(1), 'sum');
36
37
  }
37
38
  first(expression) {
38
39
  return new GroupFieldBuilder(this, expression, 'first');
@@ -67,7 +68,7 @@ class GroupStage {
67
68
  };
68
69
  }
69
70
  }
70
- exports.GroupStage = GroupStage;
71
+ exports.GroupStageImpl = GroupStageImpl;
71
72
  class GroupFieldBuilder {
72
73
  constructor(stage, expression, type) {
73
74
  this.stage = stage;
@@ -1 +1 @@
1
- {"version":3,"names":["_Expression","require","GroupStage","constructor","_defineProperty2","default","by","expressions","ids","push","map","expression","sum","GroupFieldBuilder","avg","min","max","count","NumericValueExpression","first","last","addAccumulator","type","resultFieldName","accumulators","toProto","group","id","accumulator","exports","stage","as"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericValueExpression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport class GroupStage implements PipelineStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(...expressions: Expression[]): GroupStage {\n this.ids.push(\n ...expressions.map((expression) => ({\n expression,\n }))\n )\n return this\n }\n\n sum(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'sum')\n }\n\n avg(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'avg')\n }\n\n min(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'min')\n }\n\n max(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'max')\n }\n\n count(): GroupFieldBuilder {\n return new GroupFieldBuilder(this, new NumericValueExpression(1), 'sum')\n }\n\n first(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'first')\n }\n\n last(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'last')\n }\n\n push(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'push')\n }\n\n 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 toProto(): apiTypes.Stage {\n return {\n group: {\n ids: this.ids.map((id) => ({\n expression: id.expression.toProto(),\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\nexport class GroupFieldBuilder {\n constructor(\n private stage: GroupStage,\n private expression: Expression,\n private type: AccumulatorType\n ) {}\n\n as(resultFieldName: string): GroupStage {\n return this.stage.addAccumulator(\n this.expression,\n this.type,\n resultFieldName\n )\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;AACO,MAAMC,UAAU,CAA0B;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,eAC3B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACgB,EAAE;EAAA;EAExCC,EAAEA,CAAC,GAAGC,WAAyB,EAAc;IAC3C,IAAI,CAACC,GAAG,CAACC,IAAI,CACX,GAAGF,WAAW,CAACG,GAAG,CAAEC,UAAU,KAAM;MAClCA;IACF,CAAC,CAAC,CACJ,CAAC;IACD,OAAO,IAAI;EACb;EAEAC,GAAGA,CAACD,UAAsB,EAAqB;IAC7C,OAAO,IAAIE,iBAAiB,CAAC,IAAI,EAAEF,UAAU,EAAE,KAAK,CAAC;EACvD;EAEAG,GAAGA,CAACH,UAAsB,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B,WAAW,KAAM;UACpD,CAACA,WAAW,CAACN,IAAI,GAAG;YAClBX,UAAU,EAAEiB,WAAW,CAACjB,UAAU,CAACc,OAAO,CAAC;UAC7C,CAAC;UACDF,eAAe,EAAEK,WAAW,CAACL;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACM,OAAA,CAAA3B,UAAA,GAAAA,UAAA;AAEM,MAAMW,iBAAiB,CAAC;EAC7BV,WAAWA,CACD2B,KAAiB,EACjBnB,UAAsB,EACtBW,IAAqB,EAC7B;IAAA,KAHQQ,KAAiB,GAAjBA,KAAiB;IAAA,KACjBnB,UAAsB,GAAtBA,UAAsB;IAAA,KACtBW,IAAqB,GAArBA,IAAqB;EAC5B;EAEHS,EAAEA,CAACR,eAAuB,EAAc;IACtC,OAAO,IAAI,CAACO,KAAK,CAACT,cAAc,CAC9B,IAAI,CAACV,UAAU,EACf,IAAI,CAACW,IAAI,EACTC,eACF,CAAC;EACH;AACF;AAACM,OAAA,CAAAhB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expressions","ids","push","map","expression","sum","GroupFieldBuilder","avg","min","max","count","NumericValueExpressionImpl","first","last","addAccumulator","type","resultFieldName","accumulators","toProto","group","id","accumulator","exports","stage","as"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import {\n Expression,\n NumericValueExpressionImpl,\n} 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(...expressions: Expression[]): GroupStage\n sum(expression: Expression): GroupFieldBuilder\n avg(expression: Expression): GroupFieldBuilder\n min(expression: Expression): GroupFieldBuilder\n max(expression: Expression): GroupFieldBuilder\n count(): GroupFieldBuilder\n first(expression: Expression): GroupFieldBuilder\n last(expression: Expression): GroupFieldBuilder\n push(expression: Expression): GroupFieldBuilder\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(...expressions: Expression[]): GroupStage {\n this.ids.push(\n ...expressions.map((expression) => ({\n expression,\n }))\n )\n return this\n }\n\n sum(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'sum')\n }\n\n avg(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'avg')\n }\n\n min(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'min')\n }\n\n max(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'max')\n }\n\n count(): GroupFieldBuilder {\n return new GroupFieldBuilder(this, new NumericValueExpressionImpl(1), 'sum')\n }\n\n first(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'first')\n }\n\n last(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'last')\n }\n\n push(expression: Expression): GroupFieldBuilder {\n return new GroupFieldBuilder(this, expression, 'push')\n }\n\n 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 toProto(): apiTypes.Stage {\n return {\n group: {\n ids: this.ids.map((id) => ({\n expression: id.expression.toProto(),\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\nexport class GroupFieldBuilder {\n constructor(\n private stage: GroupStageImpl,\n private expression: Expression,\n private type: AccumulatorType\n ) {}\n\n as(resultFieldName: string): GroupStage {\n return this.stage.addAccumulator(\n this.expression,\n this.type,\n resultFieldName\n )\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string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
3
  exports.__esModule = true;
4
- exports.LimitStage = void 0;
4
+ exports.LimitStageImpl = void 0;
5
5
  /**
6
6
  * @builder
7
7
  */
8
- class LimitStage {
8
+
9
+ class LimitStageImpl {
9
10
  constructor(count) {
10
11
  this.count = count;
11
12
  }
@@ -15,5 +16,5 @@ class LimitStage {
15
16
  };
16
17
  }
17
18
  }
18
- exports.LimitStage = LimitStage;
19
+ exports.LimitStageImpl = LimitStageImpl;
19
20
  //# sourceMappingURL=LimitStage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LimitStage","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 class LimitStage implements PipelineStage {\n constructor(private count: number) {}\n\n toProto(): apiTypes.Stage {\n return { limit: this.count }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;AACO,MAAMA,UAAU,CAA0B;EAC/CC,WAAWA,CAASC,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EAEpCC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,KAAK,EAAE,IAAI,CAACF;IAAM,CAAC;EAC9B;AACF;AAACG,OAAA,CAAAL,UAAA,GAAAA,UAAA","ignoreList":[]}
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;EAEpCC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,KAAK,EAAE,IAAI,CAACF;IAAM,CAAC;EAC9B;AACF;AAACG,OAAA,CAAAL,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.ObjectToArrayStage = void 0;
4
+ exports.ObjectToArrayStageImpl = void 0;
5
5
  /**
6
6
  * @builder
7
7
  */
8
- class ObjectToArrayStage {
8
+
9
+ class ObjectToArrayStageImpl {
9
10
  constructor(arrayFieldName, destinationFieldName) {
10
11
  this.arrayFieldName = arrayFieldName;
11
12
  this.destinationFieldName = destinationFieldName;
@@ -19,5 +20,5 @@ class ObjectToArrayStage {
19
20
  };
20
21
  }
21
22
  }
22
- exports.ObjectToArrayStage = ObjectToArrayStage;
23
+ exports.ObjectToArrayStageImpl = ObjectToArrayStageImpl;
23
24
  //# sourceMappingURL=ObjectToArrayStage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ObjectToArrayStage","constructor","arrayFieldName","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 class ObjectToArrayStage implements PipelineStage {\n constructor(\n private arrayFieldName: string,\n private destinationFieldName: string\n ) {}\n\n toProto(): apiTypes.Stage {\n return {\n objectToArray: {\n arrayFieldName: this.arrayFieldName,\n destinationFieldName: this.destinationFieldName,\n },\n }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;AACO,MAAMA,kBAAkB,CAA0B;EACvDC,WAAWA,CACDC,cAAsB,EACtBC,oBAA4B,EACpC;IAAA,KAFQD,cAAsB,GAAtBA,cAAsB;IAAA,KACtBC,oBAA4B,GAA5BA,oBAA4B;EACnC;EAEHC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MACLC,aAAa,EAAE;QACbH,cAAc,EAAE,IAAI,CAACA,cAAc;QACnCC,oBAAoB,EAAE,IAAI,CAACA;MAC7B;IACF,CAAC;EACH;AACF;AAACG,OAAA,CAAAN,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["ObjectToArrayStageImpl","constructor","arrayFieldName","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 arrayFieldName: string,\n private destinationFieldName: string\n ) {}\n\n toProto(): apiTypes.Stage {\n return {\n objectToArray: {\n arrayFieldName: this.arrayFieldName,\n destinationFieldName: this.destinationFieldName,\n },\n }\n }\n}\n"],"mappings":";;;;AAGA;AACA;AACA;;AAGO,MAAMA,sBAAsB,CAA+B;EAChEC,WAAWA,CACDC,cAAsB,EACtBC,oBAA4B,EACpC;IAAA,KAFQD,cAAsB,GAAtBA,cAAsB;IAAA,KACtBC,oBAA4B,GAA5BA,oBAA4B;EACnC;EAEHC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MACLC,aAAa,EAAE;QACbH,cAAc,EAAE,IAAI,CAACA,cAAc;QACnCC,oBAAoB,EAAE,IAAI,CAACA;MAC7B;IACF,CAAC;EACH;AACF;AAACG,OAAA,CAAAN,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -2,12 +2,13 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
  exports.__esModule = true;
5
- exports.ProjectStage = void 0;
5
+ exports.ProjectStageImpl = void 0;
6
6
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
7
  /**
8
8
  * @builder
9
9
  */
10
- class ProjectStage {
10
+
11
+ class ProjectStageImpl {
11
12
  constructor() {
12
13
  (0, _defineProperty2.default)(this, "fields", []);
13
14
  }
@@ -64,5 +65,5 @@ class ProjectStage {
64
65
  };
65
66
  }
66
67
  }
67
- exports.ProjectStage = ProjectStage;
68
+ exports.ProjectStageImpl = ProjectStageImpl;
68
69
  //# sourceMappingURL=ProjectStage.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ProjectStage","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","with","expression","addField","withNested","stage","addNestedProjectionField","projectionExpression","toProto","projectionFields","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport class ProjectStage implements PipelineStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n with(expression: Expression, fieldName: string): ProjectStage {\n this.addField(expression, fieldName)\n return this\n }\n\n withNested(stage: ProjectStage, fieldName: string): ProjectStage {\n return this.addNestedProjectionField(fieldName, stage.fields)\n }\n\n private addField(expression: Expression, fieldName: string): ProjectStage {\n this.fields.push({\n projectionExpression: { fieldName, expression: expression.toProto() },\n })\n return this\n }\n\n private addNestedProjectionField(\n fieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectionFields: { fieldName, fields } })\n return this\n }\n\n toProto(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;AACO,MAAMA,YAAY,CAA0B;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACtB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OA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jectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","with","expression","addField","withNested","stage","addNestedProjectionField","projectionExpression","toProto","projectionFields","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n\n include(...fieldNames: string[]): ProjectStage\n exclude(...fieldNames: string[]): ProjectStage\n with(expression: Expression, fieldName: string): ProjectStage\n withNested(stage: ProjectStage, fieldName: string): ProjectStage\n}\n\nexport class ProjectStageImpl implements ProjectStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n with(expression: Expression, fieldName: string): ProjectStage {\n this.addField(expression, fieldName)\n return this\n }\n\n withNested(stage: ProjectStage, fieldName: string): ProjectStage {\n return this.addNestedProjectionField(fieldName, stage.fields)\n }\n\n private addField(expression: Expression, fieldName: string): ProjectStage {\n this.fields.push({\n projectionExpression: { fieldName, expression: expression.toProto() },\n })\n return this\n }\n\n private addNestedProjectionField(\n fieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectionFields: { fieldName, fields } })\n return this\n }\n\n toProto(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;;AAaO,MAAMA,gBAAgB,CAAyB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACzB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAA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  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.SkipStage = void 0;
4
+ exports.SkipStageImpl = void 0;
5
5
  /**
6
6
  * @builder
7
7
  */
8
- class SkipStage {
8
+
9
+ class SkipStageImpl {
9
10
  constructor(count) {
10
11
  this.count = count;
11
12
  }
@@ -15,5 +16,5 @@ class SkipStage {
15
16
  };
16
17
  }
17
18
  }
18
- exports.SkipStage = SkipStage;
19
+ exports.SkipStageImpl = SkipStageImpl;
19
20
  //# sourceMappingURL=SkipStage.js.map