@wix/wix-data-items-common 1.0.211 → 1.0.212

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.
@@ -1 +1 @@
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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AsB,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
+ {"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 /**\n * TODO clarify\n * Specifies which field to resolve.\n *\n * The `field()` method configures the aggregation pipeline to resolve the value of the specified field as an expression.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldPath - Path to the field containing the value to resolve. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n * @returns FieldExpression object.\n */\n field(fieldPath: string): FieldExpression\n /**\n * Text value.\n *\n * @param value - Text value to run the aggregation on.\n * @returns TextExpression object.\n */\n text(value: string): TextExpression\n /**\n * Numeric value.\n *\n * @param value - Numeric value to run the aggregation on.\n * @returns NumericExpression object.\n */\n numeric(value: number): NumericExpression\n /**\n * Adds the specified expressions.\n *\n * The `add()` method refines the aggregation pipeline to add the values of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to add together. All expressions must resolve to numbers.\n * @returns AddExpression object.\n */\n add(...expressions: Expression[]): AddExpression\n /**\n * Subtracts 1 expression from another.\n *\n * The `subtract()` method refines the aggregation pipeline to subtract the second expression from the first expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to subtract `second` from. Expression must resolve to a number.\n * @param second - Expression to subtract from `first`. Expression must resolve to a number.\n * @returns SubtractExpression object.\n */\n subtract(first: Expression, second: Expression): SubtractExpression\n /**\n * Multiplies multiple expressions together.\n *\n * The `multiply()` method refines the aggregation pipeline to multiply the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to multiply. All expressions must resolve to numbers.\n * @returns MultiplyExpression object.\n */\n multiply(...expressions: Expression[]): MultiplyExpression\n /**\n * Divides 1 expression by another.\n *\n * The `divide()` method refines the aggregation pipeline to divide the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second`. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns DivideExpression object.\n */\n divide(first: Expression, second: Expression): DivideExpression\n /**\n * Calculates the total sum of multiple expressions.\n *\n * The `sum()` method refines the aggregation pipeline to calculate the total sum of the specified expressions.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to calculate the total sum of. All expressions must resolve to numbers.\n * @returns SumExpression object.\n */\n sum(...expressions: Expression[]): SumExpression\n /**\n * Finds the absolute value of an expression.\n *\n * The `abs()` method refines the aggregation pipeline to find the absolute value of the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the absolute value of. Expression must resolve to a number.\n * @returns AbsExpression object.\n */\n abs(expression: Expression): AbsExpression\n /**\n * Finds the remainder when dividing 1 expression by another.\n *\n * The `mod()` method refines the aggregation pipeline to find the remainder when dividing the first expression by the second expression.\n *\n * @public\n * @documentationMaturity preview\n * @param first - Expression to divide by `second` to find the remainder. Expression must resolve to a number.\n * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.\n * @returns ModExpression object.\n */\n mod(first: Expression, second: Expression): ModExpression\n /**\n * Rounds an expression down to the nearest whole number.\n *\n * The `floor()` method refines the aggregation pipeline to round the specified expression down to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round down to the nearest whole number. Expression must resolve to a number.\n * @returns FloorExpression object.\n */\n floor(expression: Expression): FloorExpression\n /**\n * Rounds an expression up to the nearest whole number.\n *\n * The `ceil()` method refines the aggregation pipeline to round the specified expression up to the nearest integer.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to round up to the nearest whole number. Expression must resolve to a number.\n * @returns CeilExpression object.\n */\n ceil(expression: Expression): CeilExpression\n /**\n * Joins multiple expressions together to create a string\n *\n * The `concat()` method refines the aggregation pipeline to join multiple expressions together to create a new string.\n *\n * @public\n * @documentationMaturity preview\n * @param expressions - Expressions to join together. All expressions must resolve to strings.\n * @returns ConcatExpression object.\n */\n concat(...expressions: Expression[]): ConcatExpression\n /**\n * Converts an expression to a string.\n *\n * The `stringify()` method refines the aggregation pipeline to convert the specified expression to a string.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to a string.\n * @returns StringifyExpression object.\n */\n stringify(expression: Expression): StringifyExpression\n /**\n * Converts an expression to lowercase.\n *\n * The `toLower()` method refines the aggregation pipeline to convert the specified expression to lowercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to lowercase. Expression must resolve to a string.\n * @returns ToLowerExpression object.\n */\n toLower(expression: Expression): ToLowerExpression\n /**\n * Converts an expression to uppercase.\n *\n * The `toUpper()` method refines the aggregation pipeline to convert the specified expression to uppercase.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to convert to uppercase. Expression must resolve to a string.\n * @returns ToUpperExpression object.\n */\n toUpper(expression: Expression): ToUpperExpression\n /**\n * Extracts a portion of a string expression.\n *\n * The `substring()` method refines the aggregation pipeline to extract a portion of the specified string expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to extract a substring from. Expression must resolve to a string.\n * @param start - Starting position of the substring to extract, specified in zero-based indexing. Expression must resolve to a number.\n * @param length - Number of characters to extract from the starting position. Expression must resolve to a number.\n * @returns SubstringExpression object.\n */\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":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","build","group","groupIds","map","id","accumulator","exports"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericExpressionImpl } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface GroupStage extends PipelineStage {\n by(expression: Expression, key: string): GroupStage\n sum(expression: Expression, resultFieldName: string): GroupStage\n avg(expression: Expression, resultFieldName: string): GroupStage\n min(expression: Expression, resultFieldName: string): GroupStage\n max(expression: Expression, resultFieldName: string): GroupStage\n count(resultFieldName: string): GroupStage\n first(expression: Expression, resultFieldName: string): GroupStage\n last(expression: Expression, resultFieldName: string): GroupStage\n push(expression: Expression, resultFieldName: string): GroupStage\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(expression: Expression, key: string): GroupStage {\n this.ids.push({ expression, key })\n return this\n }\n\n sum(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'sum', resultFieldName)\n }\n\n avg(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'avg', resultFieldName)\n }\n\n min(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'min', resultFieldName)\n }\n\n max(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'max', resultFieldName)\n }\n\n count(resultFieldName: string): GroupStage {\n return this.addAccumulator(\n new NumericExpressionImpl(1),\n 'sum',\n resultFieldName\n )\n }\n\n first(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'first', resultFieldName)\n }\n\n last(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'last', resultFieldName)\n }\n\n push(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'push', resultFieldName)\n }\n\n private addAccumulator(\n expression: Expression,\n type: AccumulatorType,\n resultFieldName: string\n ): GroupStage {\n this.accumulators.push({ type, expression, resultFieldName })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.build(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.build(),\n },\n resultFieldName: accumulator.resultFieldName,\n })),\n },\n }\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n key: string\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;;AAaO,MAAMC,cAAc,CAAuB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,eAC5B,EAAE;IAAA,IAAAD,gBAAA,CAAAC,OAAA,wBACgB,EAAE;EAAA;EAExCC,EAAEA,CAACC,UAAsB,EAAEC,GAAW,EAAc;IAClD,IAAI,CAACC,GAAG,CAACC,IAAI,CAAC;MAAEH,UAAU;MAAEC;IAAI,CAAC,CAAC;IAClC,OAAO,IAAI;EACb;EAEAG,GAAGA,CAACJ,UAAsB,EAAEK,eAAuB,EAAc;IAC/D,OAAO,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,KAAKA,CAAA,EAAmB;IACtB,OAAO;MACLC,KAAK,EAAE;QACLC,QAAQ,EAAE,IAAI,CAAChB,GAAG,CAACiB,GAAG,CAAEC,EAAE,KAAM;UAC9BpB,UAAU,EAAEoB,EAAE,CAACpB,UAAU,CAACgB,KAAK,CAAC,CAAC;UACjCf,GAAG,EAAEmB,EAAE,CAACnB;QACV,CAAC,CAAC,CAAC;QACHc,YAAY,EAAE,IAAI,CAACA,YAAY,CAACI,GAAG,CAAEE,WAAW,KAAM;UACpD,CAACA,WAAW,CAACP,IAAI,GAAG;YAClBd,UAAU,EAAEqB,WAAW,CAACrB,UAAU,CAACgB,KAAK,CAAC;UAC3C,CAAC;UACDX,eAAe,EAAEgB,WAAW,CAAChB;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_Expression","require","GroupStageImpl","constructor","_defineProperty2","default","by","expression","key","ids","push","sum","resultFieldName","addAccumulator","avg","min","max","count","NumericExpressionImpl","first","last","type","accumulators","build","group","groupIds","map","id","accumulator","exports"],"sources":["../../../../src/api/stages/GroupStage.ts"],"sourcesContent":["import { Expression, NumericExpressionImpl } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface GroupStage extends PipelineStage {\n /**\n * // TODO\n * @param expression\n * @param key\n * @returns GroupStage object.\n */\n by(expression: Expression, key: string): GroupStage\n /**\n * Calculates the sum of the specified expression across all items in the group.\n *\n * The `sum()` method refines the aggregation pipeline to calculate the sum of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's total sum. Expression must resolve to a number.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n sum(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Calculates the average value across all items in the group based on the specified expression.\n *\n * The `avg()` method refines the aggregation pipeline to calculate the average value of the specified expression across all items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to calculate the group's average value. The expression must resolve to a number.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n avg(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the minimum value across all items in the group.\n *\n * The `min()` method refines the aggregation pipeline to find the minimum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's minimum value. Expression must resolve to a comparable value, such as a number or string.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n min(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the maximum value across all items in the group.\n *\n * The `max()` method refines the aggregation pipeline to find the maximum value of the specified field across all the items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the group's maximum value. Expression must resolve to a comparable value, such as a number or string.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n max(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Counts the number of items in the group.\n *\n * The `count()` method refines the aggregation pipeline to count the number of items in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n count(resultFieldName: string): GroupStage\n /**\n * Finds the first item in the group.\n *\n * The `first()` method refines the aggregation pipeline to find the first item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the first item in the group.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n first(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Finds the last item in the group.\n *\n * The `last()` method refines the aggregation pipeline to find the last item in the group.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to find the last item in the group.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n last(expression: Expression, resultFieldName: string): GroupStage\n /**\n * Collects values from all items in the group into an array.\n *\n * The `push()` method refines the aggregation pipeline to collect values from all items in the group into an array.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to collect items into an array.\n * @param resultFieldName - Field key in the output item to store the result in.\n * @returns GroupStage object.\n */\n push(expression: Expression, resultFieldName: string): GroupStage\n}\n\nexport class GroupStageImpl implements GroupStage {\n private ids: Id[] = []\n private accumulators: Accumulator[] = []\n\n by(expression: Expression, key: string): GroupStage {\n this.ids.push({ expression, key })\n return this\n }\n\n sum(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'sum', resultFieldName)\n }\n\n avg(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'avg', resultFieldName)\n }\n\n min(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'min', resultFieldName)\n }\n\n max(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'max', resultFieldName)\n }\n\n count(resultFieldName: string): GroupStage {\n return this.addAccumulator(\n new NumericExpressionImpl(1),\n 'sum',\n resultFieldName\n )\n }\n\n first(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'first', resultFieldName)\n }\n\n last(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'last', resultFieldName)\n }\n\n push(expression: Expression, resultFieldName: string): GroupStage {\n return this.addAccumulator(expression, 'push', resultFieldName)\n }\n\n private addAccumulator(\n expression: Expression,\n type: AccumulatorType,\n resultFieldName: string\n ): GroupStage {\n this.accumulators.push({ type, expression, resultFieldName })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return {\n group: {\n groupIds: this.ids.map((id) => ({\n expression: id.expression.build(),\n key: id.key,\n })),\n accumulators: this.accumulators.map((accumulator) => ({\n [accumulator.type]: {\n expression: accumulator.expression.build(),\n },\n resultFieldName: accumulator.resultFieldName,\n })),\n },\n }\n }\n}\n\ntype AccumulatorType = 'avg' | 'min' | 'max' | 'sum' | 'first' | 'last' | 'push'\n\ninterface Id {\n expression: Expression\n key: string\n}\n\ninterface Accumulator {\n type: AccumulatorType\n expression: Expression\n resultFieldName: string\n}\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAIA;AACA;AACA;;AA0GO,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;EAE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,EAAE,IAAI,CAACA,YAAY,CAACI,GAAG,CAAEE,WAAW,KAAM;UACpD,CAACA,WAAW,CAACP,IAAI,GAAG;YAClBd,UAAU,EAAEqB,WAAW,CAACrB,UAAU,CAACgB,KAAK,CAAC;UAC3C,CAAC;UACDX,eAAe,EAAEgB,WAAW,CAAChB;QAC/B,CAAC,CAAC;MACJ;IACF,CAAC;EACH;AACF;AAACiB,OAAA,CAAA3B,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","build","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n /**\n * Fields to include in the result.\n *\n * When specified, the result includes only the specified fields. All other fields are excluded.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to include in the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n include(...fieldNames: string[]): ProjectStage\n /**\n * Fields to exclude from the result.\n *\n * When specified, excludes the specified field from the result. All other fields are included.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to exclude from the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n exclude(...fieldNames: string[]): ProjectStage\n /**\n * Reshapes a new field based on the specified expression.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to resolve. The result of the expression becomes the value of the new field.\n * @param resultFieldName - Key of the field to create in the result.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n reshape(expression: Expression, resultFieldName: string): ProjectStage\n /**\n * Creates nested fields by including, excluding, or reshaping fields.\n *\n * @public\n * @documentationMaturity preview\n * @param stage - Projected stage to nest.\n * @param resultFieldName - Key of the field in which to nest the projected stage.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage\n}\n\nexport class ProjectStageImpl implements ProjectStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n reshape(expression: Expression, resultFieldName: string): ProjectStage {\n this.addField(expression, resultFieldName)\n return this\n }\n\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage {\n return this.addNestedProjectionField(resultFieldName, stage.fields)\n }\n\n private addField(\n expression: Expression,\n resultFieldName: string\n ): ProjectStage {\n this.fields.push({\n reshape: { resultFieldName, expression: expression.build() },\n })\n return this\n }\n\n private addNestedProjectionField(\n resultFieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectNested: { resultFieldName, fields } })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;;AA0DO,MAAMA,gBAAgB,CAAyB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACzB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,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","ignoreList":[]}
1
+ {"version":3,"names":["ProjectStageImpl","constructor","_defineProperty2","default","include","fieldNames","forEach","fieldName","fields","push","exclude","reshape","expression","resultFieldName","addField","projectNested","stage","addNestedProjectionField","build","projection","exports"],"sources":["../../../../src/api/stages/ProjectStage.ts"],"sourcesContent":["import { Expression } from '../expressions/Expression'\nimport * as apiTypes from '../../types/data-item-types'\nimport { PipelineStage } from './stages'\n\n/**\n * @builder\n */\nexport interface ProjectStage extends PipelineStage {\n /**\n * @internal\n */\n fields: apiTypes.Field[]\n /**\n * Fields to include in the result.\n *\n * When specified, the result includes only the specified fields. All other fields are excluded.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to include in the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n include(...fieldNames: string[]): ProjectStage\n /**\n * Fields to exclude from the result.\n *\n * When specified, excludes the specified field from the result. All other fields are included.\n *\n * @public\n * @documentationMaturity preview\n * @param fieldNames - Key of the field to exclude from the result. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n exclude(...fieldNames: string[]): ProjectStage\n /**\n * Reshapes a new field based on the specified expression. The field used by the expression is not included in the result.\n *\n * @public\n * @documentationMaturity preview\n * @param expression - Expression to resolve. The result of the expression becomes the value of the new field.\n * @param resultFieldName - Key of the field to create in the result.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n reshape(expression: Expression, resultFieldName: string): ProjectStage\n /**\n * Creates nested fields by including, excluding, or reshaping fields.\n *\n * @public\n * @documentationMaturity preview\n * @param stage - Projected stage to nest.\n * @param resultFieldName - Key of the field in which to nest the projected stage.\n *\n * Learn more about [field keys](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-id-velo-by-wix-only).\n * @returns ProjectStage object.\n */\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage\n}\n\nexport class ProjectStageImpl implements ProjectStage {\n fields: apiTypes.Field[] = []\n\n include(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ include: { fieldName } })\n })\n return this\n }\n\n exclude(...fieldNames: string[]): ProjectStage {\n fieldNames.forEach((fieldName) => {\n this.fields.push({ exclude: { fieldName } })\n })\n return this\n }\n\n reshape(expression: Expression, resultFieldName: string): ProjectStage {\n this.addField(expression, resultFieldName)\n return this\n }\n\n projectNested(stage: ProjectStage, resultFieldName: string): ProjectStage {\n return this.addNestedProjectionField(resultFieldName, stage.fields)\n }\n\n private addField(\n expression: Expression,\n resultFieldName: string\n ): ProjectStage {\n this.fields.push({\n reshape: { resultFieldName, expression: expression.build() },\n })\n return this\n }\n\n private addNestedProjectionField(\n resultFieldName: string,\n fields: apiTypes.Field[]\n ): ProjectStage {\n this.fields.push({ projectNested: { resultFieldName, fields } })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { projection: { fields: this.fields } }\n }\n}\n"],"mappings":";;;;;;AAIA;AACA;AACA;;AA0DO,MAAMA,gBAAgB,CAAyB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,kBACzB,EAAE;EAAA;EAE7BC,OAAOA,CAAC,GAAGC,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEL,OAAO,EAAE;UAAEG;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAG,OAAOA,CAAC,GAAGL,UAAoB,EAAgB;IAC7CA,UAAU,CAACC,OAAO,CAAEC,SAAS,IAAK;MAChC,IAAI,CAACC,MAAM,CAACC,IAAI,CAAC;QAAEC,OAAO,EAAE;UAAEH;QAAU;MAAE,CAAC,CAAC;IAC9C,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAI,OAAOA,CAACC,UAAsB,EAAEC,eAAuB,EAAgB;IACrE,IAAI,CAACC,QAAQ,CAACF,UAAU,EAAEC,eAAe,CAAC;IAC1C,OAAO,IAAI;EACb;EAEAE,aAAaA,CAACC,KAAmB,EAAEH,eAAuB,EAAgB;IACxE,OAAO,IAAI,CAACI,wBAAwB,CAACJ,eAAe,EAAEG,KAAK,CAACR,MAAM,CAAC;EACrE;EAEQM,QAAQA,CACdF,UAAsB,EACtBC,eAAuB,EACT;IACd,IAAI,CAACL,MAAM,CAACC,IAAI,CAAC;MACfE,OAAO,EAAE;QAAEE,eAAe;QAAED,UAAU,EAAEA,UAAU,CAACM,KAAK,CAAC;MAAE;IAC7D,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEQD,wBAAwBA,CAC9BJ,eAAuB,EACvBL,MAAwB,EACV;IACd,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC;MAAEM,aAAa,EAAE;QAAEF,eAAe;QAAEL;MAAO;IAAE,CAAC,CAAC;IAChE,OAAO,IAAI;EACb;;EAEA;EACAU,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,UAAU,EAAE;QAAEX,MAAM,EAAE,IAAI,CAACA;MAAO;IAAE,CAAC;EAChD;AACF;AAACY,OAAA,CAAApB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["apiTypes","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SortStageImpl","constructor","_defineProperty2","ascending","fields","forEach","field","sortFields","push","fieldName","order","SortOrder","ASC","descending","DESC","build","sort","values","exports"],"sources":["../../../../src/api/stages/SortStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface SortStage extends PipelineStage {\n ascending(...fields: string[]): SortStage\n descending(...fields: string[]): SortStage\n}\n\nexport class SortStageImpl implements SortStage {\n private sortFields: apiTypes.Sorting[] = []\n\n ascending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.ASC })\n })\n return this\n }\n\n descending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.DESC })\n })\n return this\n }\n\n /** @private */\n build(): apiTypes.Stage {\n return { sort: { values: this.sortFields } }\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAuD,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAEvD;AACA;AACA;;AAMO,MAAMkB,aAAa,CAAsB;EAAAC,YAAA;IAAA,IAAAC,gBAAA,CAAAX,OAAA,sBACL,EAAE;EAAA;EAE3CY,SAASA,CAAC,GAAGC,MAAgB,EAAa;IACxCA,MAAM,CAACC,OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACC;MAAI,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAC,UAAUA,CAAC,GAAGT,MAAgB,EAAa;IACzCA,MAAM,CAACC,OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACG;MAAK,CAAC,CAAC;IAC5E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,IAAI,EAAE;QAAEC,MAAM,EAAE,IAAI,CAACV;MAAW;IAAE,CAAC;EAC9C;AACF;AAACW,OAAA,CAAAlB,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["apiTypes","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SortStageImpl","constructor","_defineProperty2","ascending","fields","forEach","field","sortFields","push","fieldName","order","SortOrder","ASC","descending","DESC","build","sort","values","exports"],"sources":["../../../../src/api/stages/SortStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\n/**\n * @builder\n */\nexport interface SortStage extends PipelineStage {\n /**\n * Adds a sort stage that sorts the aggregation results by the specified fields in ascending order.\n *\n * The `ascending()` method refines the aggregation to sort results in ascending order of the specified fields. If you specify more than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @returns SortStage object.\n */\n ascending(...fields: string[]): SortStage\n /**\n * Adds a sort stage that sorts the aggregation results by the specified fields in descending order.\n *\n * The `descending()` method refines the aggregation to sort results in descending order of the specified fields. If you specify more than one field, `descending()` sorts the results in descending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes before `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a field contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort field are ranked lowest.\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @returns SortStage object.\n */\n descending(...fields: string[]): SortStage\n}\n\nexport class SortStageImpl implements SortStage {\n private sortFields: apiTypes.Sorting[] = []\n\n ascending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.ASC })\n })\n return this\n }\n\n descending(...fields: string[]): SortStage {\n fields.forEach((field) => {\n this.sortFields.push({ fieldName: field, order: apiTypes.SortOrder.DESC })\n })\n return this\n }\n\n /** @private */\n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OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACC;MAAI,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEAC,UAAUA,CAAC,GAAGT,MAAgB,EAAa;IACzCA,MAAM,CAACC,OAAO,CAAEC,KAAK,IAAK;MACxB,IAAI,CAACC,UAAU,CAACC,IAAI,CAAC;QAAEC,SAAS,EAAEH,KAAK;QAAEI,KAAK,EAAEhC,QAAQ,CAACiC,SAAS,CAACG;MAAK,CAAC,CAAC;IAC5E,CAAC,CAAC;IACF,OAAO,IAAI;EACb;;EAEA;EACAC,KAAKA,CAAA,EAAmB;IACtB,OAAO;MAAEC,IAAI,EAAE;QAAEC,MAAM,EAAE,IAAI,CAACV;MAAW;IAAE,CAAC;EAC9C;AACF;AAACW,OAAA,CAAAlB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"GroupStage.js","sourceRoot":"","sources":["../../../../src/api/stages/GroupStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAmB7E,MAAM,OAAO,cAAc;IAA3B;QACU,QAAG,GAAS,EAAE,CAAA;QACd,iBAAY,GAAkB,EAAE,CAAA;IAqE1C,CAAC;IAnEC,EAAE,CAAC,UAAsB,EAAE,GAAW;QACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAA;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,GAAG,CAAC,UAAsB,EAAE,eAAuB;QACjD,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,EAAE,eAAe,CAAC,CAAA;IAChE,CAAC;IAED,GAAG,CAAC,UAAsB,EAAE,eAAuB;QACjD,OAAO,IA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CAAC,CAAC;aACJ;SACF,CAAA;IACH,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"SortStage.js","sourceRoot":"","sources":["../../../../src/api/stages/SortStage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AAUvD,MAAM,OAAO,aAAa;IAA1B;QACU,eAAU,GAAuB,EAAE,CAAA;IAoB7C,CAAC;IAlBC,SAAS,CAAC,GAAG,MAAgB;QAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAA;QAC3E,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,MAAgB;QAC5B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;QAC5E,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;IACf,KAAK;QACH,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAA;IAC9C,CAAC;CACF"}
1
+ {"version":3,"file":"SortStage.js","sourceRoot":"","sources":["../../../../src/api/stages/SortStage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AA8CvD,MAAM,OAAO,aAAa;IAA1B;QACU,eAAU,GAAuB,EAAE,CAAA;IAoB7C,CAAC;IAlBC,SAAS,CAAC,GAAG,MAAgB;QAC3B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAAA;QAC3E,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,MAAgB;QAC5B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAA;QAC5E,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;IACf,KAAK;QACH,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAA;IAC9C,CAAC;CACF"}
@@ -4,22 +4,190 @@ export declare const expressions: WixDataAggregatePipelineExpressions;
4
4
  * @builder
5
5
  */
6
6
  export interface WixDataAggregatePipelineExpressions {
7
+ /**
8
+ * TODO clarify
9
+ * Specifies which field to resolve.
10
+ *
11
+ * The `field()` method configures the aggregation pipeline to resolve the value of the specified field as an expression.
12
+ *
13
+ * @public
14
+ * @documentationMaturity preview
15
+ * @param fieldPath - Path to the field containing the value to resolve. Use dot notation to specify nested fields. For example, `user.name` or `product.price`.
16
+ * @returns FieldExpression object.
17
+ */
7
18
  field(fieldPath: string): FieldExpression;
19
+ /**
20
+ * Text value.
21
+ *
22
+ * @param value - Text value to run the aggregation on.
23
+ * @returns TextExpression object.
24
+ */
8
25
  text(value: string): TextExpression;
26
+ /**
27
+ * Numeric value.
28
+ *
29
+ * @param value - Numeric value to run the aggregation on.
30
+ * @returns NumericExpression object.
31
+ */
9
32
  numeric(value: number): NumericExpression;
33
+ /**
34
+ * Adds the specified expressions.
35
+ *
36
+ * The `add()` method refines the aggregation pipeline to add the values of the specified expressions.
37
+ *
38
+ * @public
39
+ * @documentationMaturity preview
40
+ * @param expressions - Expressions to add together. All expressions must resolve to numbers.
41
+ * @returns AddExpression object.
42
+ */
10
43
  add(...expressions: Expression[]): AddExpression;
44
+ /**
45
+ * Subtracts 1 expression from another.
46
+ *
47
+ * The `subtract()` method refines the aggregation pipeline to subtract the second expression from the first expression.
48
+ *
49
+ * @public
50
+ * @documentationMaturity preview
51
+ * @param first - Expression to subtract `second` from. Expression must resolve to a number.
52
+ * @param second - Expression to subtract from `first`. Expression must resolve to a number.
53
+ * @returns SubtractExpression object.
54
+ */
11
55
  subtract(first: Expression, second: Expression): SubtractExpression;
56
+ /**
57
+ * Multiplies multiple expressions together.
58
+ *
59
+ * The `multiply()` method refines the aggregation pipeline to multiply the specified expressions.
60
+ *
61
+ * @public
62
+ * @documentationMaturity preview
63
+ * @param expressions - Expressions to multiply. All expressions must resolve to numbers.
64
+ * @returns MultiplyExpression object.
65
+ */
12
66
  multiply(...expressions: Expression[]): MultiplyExpression;
67
+ /**
68
+ * Divides 1 expression by another.
69
+ *
70
+ * The `divide()` method refines the aggregation pipeline to divide the first expression by the second expression.
71
+ *
72
+ * @public
73
+ * @documentationMaturity preview
74
+ * @param first - Expression to divide by `second`. Expression must resolve to a number.
75
+ * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.
76
+ * @returns DivideExpression object.
77
+ */
13
78
  divide(first: Expression, second: Expression): DivideExpression;
79
+ /**
80
+ * Calculates the total sum of multiple expressions.
81
+ *
82
+ * The `sum()` method refines the aggregation pipeline to calculate the total sum of the specified expressions.
83
+ *
84
+ * @public
85
+ * @documentationMaturity preview
86
+ * @param expressions - Expressions to calculate the total sum of. All expressions must resolve to numbers.
87
+ * @returns SumExpression object.
88
+ */
14
89
  sum(...expressions: Expression[]): SumExpression;
90
+ /**
91
+ * Finds the absolute value of an expression.
92
+ *
93
+ * The `abs()` method refines the aggregation pipeline to find the absolute value of the specified expression.
94
+ *
95
+ * @public
96
+ * @documentationMaturity preview
97
+ * @param expression - Expression to find the absolute value of. Expression must resolve to a number.
98
+ * @returns AbsExpression object.
99
+ */
15
100
  abs(expression: Expression): AbsExpression;
101
+ /**
102
+ * Finds the remainder when dividing 1 expression by another.
103
+ *
104
+ * The `mod()` method refines the aggregation pipeline to find the remainder when dividing the first expression by the second expression.
105
+ *
106
+ * @public
107
+ * @documentationMaturity preview
108
+ * @param first - Expression to divide by `second` to find the remainder. Expression must resolve to a number.
109
+ * @param second - Expression to divide `first` by. Expression must resolve to a non-zero number.
110
+ * @returns ModExpression object.
111
+ */
16
112
  mod(first: Expression, second: Expression): ModExpression;
113
+ /**
114
+ * Rounds an expression down to the nearest whole number.
115
+ *
116
+ * The `floor()` method refines the aggregation pipeline to round the specified expression down to the nearest integer.
117
+ *
118
+ * @public
119
+ * @documentationMaturity preview
120
+ * @param expression - Expression to round down to the nearest whole number. Expression must resolve to a number.
121
+ * @returns FloorExpression object.
122
+ */
17
123
  floor(expression: Expression): FloorExpression;
124
+ /**
125
+ * Rounds an expression up to the nearest whole number.
126
+ *
127
+ * The `ceil()` method refines the aggregation pipeline to round the specified expression up to the nearest integer.
128
+ *
129
+ * @public
130
+ * @documentationMaturity preview
131
+ * @param expression - Expression to round up to the nearest whole number. Expression must resolve to a number.
132
+ * @returns CeilExpression object.
133
+ */
18
134
  ceil(expression: Expression): CeilExpression;
135
+ /**
136
+ * Joins multiple expressions together to create a string
137
+ *
138
+ * The `concat()` method refines the aggregation pipeline to join multiple expressions together to create a new string.
139
+ *
140
+ * @public
141
+ * @documentationMaturity preview
142
+ * @param expressions - Expressions to join together. All expressions must resolve to strings.
143
+ * @returns ConcatExpression object.
144
+ */
19
145
  concat(...expressions: Expression[]): ConcatExpression;
146
+ /**
147
+ * Converts an expression to a string.
148
+ *
149
+ * The `stringify()` method refines the aggregation pipeline to convert the specified expression to a string.
150
+ *
151
+ * @public
152
+ * @documentationMaturity preview
153
+ * @param expression - Expression to convert to a string.
154
+ * @returns StringifyExpression object.
155
+ */
20
156
  stringify(expression: Expression): StringifyExpression;
157
+ /**
158
+ * Converts an expression to lowercase.
159
+ *
160
+ * The `toLower()` method refines the aggregation pipeline to convert the specified expression to lowercase.
161
+ *
162
+ * @public
163
+ * @documentationMaturity preview
164
+ * @param expression - Expression to convert to lowercase. Expression must resolve to a string.
165
+ * @returns ToLowerExpression object.
166
+ */
21
167
  toLower(expression: Expression): ToLowerExpression;
168
+ /**
169
+ * Converts an expression to uppercase.
170
+ *
171
+ * The `toUpper()` method refines the aggregation pipeline to convert the specified expression to uppercase.
172
+ *
173
+ * @public
174
+ * @documentationMaturity preview
175
+ * @param expression - Expression to convert to uppercase. Expression must resolve to a string.
176
+ * @returns ToUpperExpression object.
177
+ */
22
178
  toUpper(expression: Expression): ToUpperExpression;
179
+ /**
180
+ * Extracts a portion of a string expression.
181
+ *
182
+ * The `substring()` method refines the aggregation pipeline to extract a portion of the specified string expression.
183
+ *
184
+ * @public
185
+ * @documentationMaturity preview
186
+ * @param expression - Expression to extract a substring from. Expression must resolve to a string.
187
+ * @param start - Starting position of the substring to extract, specified in zero-based indexing. Expression must resolve to a number.
188
+ * @param length - Number of characters to extract from the starting position. Expression must resolve to a number.
189
+ * @returns SubstringExpression object.
190
+ */
23
191
  substring(expression: Expression, start: Expression, length?: Expression): SubstringExpression;
24
192
  length(expression: Expression): LengthExpression;
25
193
  }
@@ -1 +1 @@
1
- {"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../../src/api/expressions/expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,eAAe,EAEf,cAAc,EAEd,iBAAiB,EAEjB,aAAa,EAEb,kBAAkB,EAElB,kBAAkB,EAElB,gBAAgB,EAEhB,aAAa,EAEb,aAAa,EAEb,aAAa,EAEb,eAAe,EAEf,cAAc,EAEd,gBAAgB,EAEhB,mBAAmB,EAEnB,iBAAiB,EAEjB,iBAAiB,EAEjB,mBAAmB,EAEnB,gBAAgB,EAEjB,MAAM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AC,UAAU,EAAE,UAAU,GAAG,aAAa,CAAA;IAC1C;;;;;;;;;;OAUG;IACH,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,aAAa,CAAA;IACzD;;;;;;;;;OASG;IACH,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CAAA;IAC9C;;;;;;;;;OASG;IACH,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAAA;IAC5C;;;;;;;;;OASG;IACH,MAAM,CAAC,GAAG,WAAW,EAAE,UAAU,EAAE,GAAG,gBAAgB,CAAA;IACtD;;;;;;;;;OASG;IACH,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,mBAAmB,CAAA;IACtD;;;;;;;;;OASG;IACH,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,iBAAiB,CAAA;IAClD;;;;;;;;;OASG;IACH,OAAO,CAAC,UAAU,EAAE,UAAU,GAAG,iBAAiB,CAAA;IAClD;;;;;;;;;;;OAWG;IACH,SAAS,CACP,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,UAAU,EACjB,MAAM,CAAC,EAAE,UAAU,GAClB,mBAAmB,CAAA;IACtB,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAAA;CACjD"}
@@ -5,14 +5,107 @@ import { PipelineStage } from './stages';
5
5
  * @builder
6
6
  */
7
7
  export interface GroupStage extends PipelineStage {
8
+ /**
9
+ * // TODO
10
+ * @param expression
11
+ * @param key
12
+ * @returns GroupStage object.
13
+ */
8
14
  by(expression: Expression, key: string): GroupStage;
15
+ /**
16
+ * Calculates the sum of the specified expression across all items in the group.
17
+ *
18
+ * The `sum()` method refines the aggregation pipeline to calculate the sum of the specified expression across all items in the group.
19
+ *
20
+ * @public
21
+ * @documentationMaturity preview
22
+ * @param expression - Expression to calculate the group's total sum. Expression must resolve to a number.
23
+ * @param resultFieldName - Field key in the output item to store the result in.
24
+ * @returns GroupStage object.
25
+ */
9
26
  sum(expression: Expression, resultFieldName: string): GroupStage;
27
+ /**
28
+ * Calculates the average value across all items in the group based on the specified expression.
29
+ *
30
+ * The `avg()` method refines the aggregation pipeline to calculate the average value of the specified expression across all items in the group.
31
+ *
32
+ * @public
33
+ * @documentationMaturity preview
34
+ * @param expression - Expression to calculate the group's average value. The expression must resolve to a number.
35
+ * @param resultFieldName - Field key in the output item to store the result in.
36
+ * @returns GroupStage object.
37
+ */
10
38
  avg(expression: Expression, resultFieldName: string): GroupStage;
39
+ /**
40
+ * Finds the minimum value across all items in the group.
41
+ *
42
+ * The `min()` method refines the aggregation pipeline to find the minimum value of the specified field across all the items in the group.
43
+ *
44
+ * @public
45
+ * @documentationMaturity preview
46
+ * @param expression - Expression to find the group's minimum value. Expression must resolve to a comparable value, such as a number or string.
47
+ * @param resultFieldName - Field key in the output item to store the result in.
48
+ * @returns GroupStage object.
49
+ */
11
50
  min(expression: Expression, resultFieldName: string): GroupStage;
51
+ /**
52
+ * Finds the maximum value across all items in the group.
53
+ *
54
+ * The `max()` method refines the aggregation pipeline to find the maximum value of the specified field across all the items in the group.
55
+ *
56
+ * @public
57
+ * @documentationMaturity preview
58
+ * @param expression - Expression to find the group's maximum value. Expression must resolve to a comparable value, such as a number or string.
59
+ * @param resultFieldName - Field key in the output item to store the result in.
60
+ * @returns GroupStage object.
61
+ */
12
62
  max(expression: Expression, resultFieldName: string): GroupStage;
63
+ /**
64
+ * Counts the number of items in the group.
65
+ *
66
+ * The `count()` method refines the aggregation pipeline to count the number of items in the group.
67
+ *
68
+ * @public
69
+ * @documentationMaturity preview
70
+ * @param resultFieldName - Field key in the output item to store the result in.
71
+ * @returns GroupStage object.
72
+ */
13
73
  count(resultFieldName: string): GroupStage;
74
+ /**
75
+ * Finds the first item in the group.
76
+ *
77
+ * The `first()` method refines the aggregation pipeline to find the first item in the group.
78
+ *
79
+ * @public
80
+ * @documentationMaturity preview
81
+ * @param expression - Expression to find the first item in the group.
82
+ * @param resultFieldName - Field key in the output item to store the result in.
83
+ * @returns GroupStage object.
84
+ */
14
85
  first(expression: Expression, resultFieldName: string): GroupStage;
86
+ /**
87
+ * Finds the last item in the group.
88
+ *
89
+ * The `last()` method refines the aggregation pipeline to find the last item in the group.
90
+ *
91
+ * @public
92
+ * @documentationMaturity preview
93
+ * @param expression - Expression to find the last item in the group.
94
+ * @param resultFieldName - Field key in the output item to store the result in.
95
+ * @returns GroupStage object.
96
+ */
15
97
  last(expression: Expression, resultFieldName: string): GroupStage;
98
+ /**
99
+ * Collects values from all items in the group into an array.
100
+ *
101
+ * The `push()` method refines the aggregation pipeline to collect values from all items in the group into an array.
102
+ *
103
+ * @public
104
+ * @documentationMaturity preview
105
+ * @param expression - Expression to collect items into an array.
106
+ * @param resultFieldName - Field key in the output item to store the result in.
107
+ * @returns GroupStage object.
108
+ */
16
109
  push(expression: Expression, resultFieldName: string): GroupStage;
17
110
  }
18
111
  export declare class GroupStageImpl implements GroupStage {
@@ -1 +1 @@
1
- {"version":3,"file":"GroupStage.d.ts","sourceRoot":"","sources":["../../../../src/api/stages/GroupStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,2BAA2B,CAAA;AAC7E,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,aAAa;IAC/C,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;IACnD,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU,CAAA;IAChE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU,CAAA;IAChE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU,CAAA;IAChE,GAAG,CAAC,UAAU,EAAE,UAAU,EAA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AU;IAKnD,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIhE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIhE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIhE,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIhE,KAAK,CAAC,eAAe,EAAE,MAAM,GAAG,UAAU;IAQ1C,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIlE,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIjE,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,GAAG,UAAU;IAIjE,OAAO,CAAC,cAAc;IAStB,eAAe;IACf,KAAK,IAAI,QAAQ,CAAC,KAAK;CAgBxB"}
@@ -36,7 +36,7 @@ export interface ProjectStage extends PipelineStage {
36
36
  */
37
37
  exclude(...fieldNames: string[]): ProjectStage;
38
38
  /**
39
- * Reshapes a new field based on the specified expression.
39
+ * Reshapes a new field based on the specified expression. The field used by the expression is not included in the result.
40
40
  *
41
41
  * @public
42
42
  * @documentationMaturity preview
@@ -4,7 +4,43 @@ import * as apiTypes from '../../types/data-item-types';
4
4
  * @builder
5
5
  */
6
6
  export interface SortStage extends PipelineStage {
7
+ /**
8
+ * Adds a sort stage that sorts the aggregation results by the specified fields in ascending order.
9
+ *
10
+ * The `ascending()` method refines the aggregation to sort results in ascending order of the specified fields. If you specify more than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.
11
+ *
12
+ * You can sort the following types:
13
+ * - Number: Sorts numerically.
14
+ * - Date: Sorts by date and time.
15
+ * - String: Sorts lexicographically, so `"abc"` comes after `"XYZ"`.
16
+ * - Reference: Compares by the ID of the referenced item as a String.
17
+ *
18
+ * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort property are ranked lowest.
19
+ *
20
+ * @public
21
+ * @documentationMaturity preview
22
+ * @param fields - Fields used in the sort.
23
+ * @returns SortStage object.
24
+ */
7
25
  ascending(...fields: string[]): SortStage;
26
+ /**
27
+ * Adds a sort stage that sorts the aggregation results by the specified fields in descending order.
28
+ *
29
+ * The `descending()` method refines the aggregation to sort results in descending order of the specified fields. If you specify more than one field, `descending()` sorts the results in descending order by each field in the order they are listed.
30
+ *
31
+ * You can sort the following types:
32
+ * - Number: Sorts numerically.
33
+ * - Date: Sorts by date and time.
34
+ * - String: Sorts lexicographically, so `"abc"` comes before `"XYZ"`.
35
+ * - Reference: Compares by the ID of the referenced item as a String.
36
+ *
37
+ * If a field contains a number as a String, that value is sorted alphabetically and not numerically. Items that do not have a value for the specified sort field are ranked lowest.
38
+ *
39
+ * @public
40
+ * @documentationMaturity preview
41
+ * @param fields - Fields used in the sort.
42
+ * @returns SortStage object.
43
+ */
8
44
  descending(...fields: string[]): SortStage;
9
45
  }
10
46
  export declare class SortStageImpl implements SortStage {
@@ -1 +1 @@
1
- {"version":3,"file":"SortStage.d.ts","sourceRoot":"","sources":["../../../../src/api/stages/SortStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IACzC,UAAU,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAC3C;AAED,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,UAAU,CAAyB;IAE3C,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;IAOzC,UAAU,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;IAO1C,eAAe;IACf,KAAK,IAAI,QAAQ,CAAC,KAAK;CAGxB"}
1
+ {"version":3,"file":"SortStage.d.ts","sourceRoot":"","sources":["../../../../src/api/stages/SortStage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,6BAA6B,CAAA;AAEvD;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IACzC;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CAC3C;AAED,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,CAAC,UAAU,CAAyB;IAE3C,SAAS,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;IAOzC,UAAU,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS;IAO1C,eAAe;IACf,KAAK,IAAI,QAAQ,CAAC,KAAK;CAGxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-data-items-common",
3
- "version": "1.0.211",
3
+ "version": "1.0.212",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Rimvydas Gimbutas",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/jest": "^29.5.14",
41
- "@types/node": "^18.19.121",
41
+ "@types/node": "^18.19.122",
42
42
  "@wix/eslint-config-yoshi": "^6.156.0",
43
43
  "@wix/jest-yoshi-preset": "^6.156.0",
44
44
  "@wix/yoshi-flow-library": "^6.156.0",
@@ -85,5 +85,5 @@
85
85
  "wallaby": {
86
86
  "autoDetect": true
87
87
  },
88
- "falconPackageHash": "42eb77cf4f5334855f51408b52785499b0e27bc9e774c7e6184f304d"
88
+ "falconPackageHash": "b0c9cf557e3418e4e56c3ade0d1818da3a7273707be715840200b779"
89
89
  }