@wix/wix-data-items-common 1.0.304 → 1.0.305

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 (46) hide show
  1. package/dist/cjs/api/FieldModification.js +4 -0
  2. package/dist/cjs/api/FieldModification.js.map +1 -0
  3. package/dist/cjs/api/WixDataApi.js +126 -55
  4. package/dist/cjs/api/WixDataApi.js.map +1 -1
  5. package/dist/cjs/api/WixDataFieldModificationsBuilder.js +51 -0
  6. package/dist/cjs/api/WixDataFieldModificationsBuilder.js.map +1 -0
  7. package/dist/cjs/api/WixDataPatch.js.map +1 -1
  8. package/dist/cjs/api/impl/BaseFieldModificationsBuilder.js +85 -0
  9. package/dist/cjs/api/impl/BaseFieldModificationsBuilder.js.map +1 -0
  10. package/dist/cjs/api/impl/WixDataPatchImpl.js +13 -82
  11. package/dist/cjs/api/impl/WixDataPatchImpl.js.map +1 -1
  12. package/dist/cjs/api/index.js +13 -3
  13. package/dist/cjs/api/index.js.map +1 -1
  14. package/dist/cjs/api/types.js.map +1 -1
  15. package/dist/cjs/index.js.map +1 -1
  16. package/dist/esm/api/FieldModification.js +2 -0
  17. package/dist/esm/api/FieldModification.js.map +1 -0
  18. package/dist/esm/api/WixDataApi.js +82 -48
  19. package/dist/esm/api/WixDataApi.js.map +1 -1
  20. package/dist/esm/api/WixDataFieldModificationsBuilder.js +38 -0
  21. package/dist/esm/api/WixDataFieldModificationsBuilder.js.map +1 -0
  22. package/dist/esm/api/impl/BaseFieldModificationsBuilder.js +87 -0
  23. package/dist/esm/api/impl/BaseFieldModificationsBuilder.js.map +1 -0
  24. package/dist/esm/api/impl/WixDataPatchImpl.js +10 -90
  25. package/dist/esm/api/impl/WixDataPatchImpl.js.map +1 -1
  26. package/dist/esm/api/index.js +1 -0
  27. package/dist/esm/api/index.js.map +1 -1
  28. package/dist/types/api/FieldModification.d.ts +41 -0
  29. package/dist/types/api/FieldModification.d.ts.map +1 -0
  30. package/dist/types/api/WixDataApi.d.ts +32 -3
  31. package/dist/types/api/WixDataApi.d.ts.map +1 -1
  32. package/dist/types/api/WixDataFieldModificationsBuilder.d.ts +88 -0
  33. package/dist/types/api/WixDataFieldModificationsBuilder.d.ts.map +1 -0
  34. package/dist/types/api/WixDataPatch.d.ts +17 -167
  35. package/dist/types/api/WixDataPatch.d.ts.map +1 -1
  36. package/dist/types/api/impl/BaseFieldModificationsBuilder.d.ts +21 -0
  37. package/dist/types/api/impl/BaseFieldModificationsBuilder.d.ts.map +1 -0
  38. package/dist/types/api/impl/WixDataPatchImpl.d.ts +12 -27
  39. package/dist/types/api/impl/WixDataPatchImpl.d.ts.map +1 -1
  40. package/dist/types/api/index.d.ts +4 -2
  41. package/dist/types/api/index.d.ts.map +1 -1
  42. package/dist/types/api/types.d.ts +0 -12
  43. package/dist/types/api/types.d.ts.map +1 -1
  44. package/dist/types/index.d.ts +1 -0
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/WixDataPatch.ts"],"sourcesContent":["import {\n WixDataItem,\n WixDataBulkResult,\n WixDataPatchOptions,\n WixDataBulkPatchOptions,\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n} from './types'\n\nexport interface FieldModification {\n fieldPath: string\n action:\n | 'SET_FIELD'\n | 'REMOVE_FIELD'\n | 'INCREMENT_FIELD'\n | 'APPEND_TO_ARRAY'\n | 'REMOVE_FROM_ARRAY'\n actionOptions?: any\n}\n\n/**\n * @builder\n */\nexport interface WixDataBulkPatch {\n /**\n * Refines a patch operation to increment the specified field value by the specified parameter.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param by - Value by which to increment the specified field. To decrement, specify a negative value.\n * @requiredField by\n * @returns Updated patch object.\n */\n incrementField(field: string, by: number): WixDataBulkPatch\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch object.\n */\n setField(field: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n appendToArray(field: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to remove the first instance of the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value whose first instance is removed from the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n removeFromArray(field: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @returns Updated patch object.\n */\n removeField(field: string): WixDataBulkPatch\n\n /**\n * Runs the bulk patch operation and returns a Promise that resolves to information about the results.\n *\n * @public\n * @documentationMaturity preview\n * @returns Bulk operation results.\n */\n run(options?: WixDataBulkPatchOptions): Promise<WixDataBulkResult>\n}\n\n/**\n * @builder\n */\nexport interface WixDataPatchByFilter {\n /**\n * Refines a patch operation to increment the specified field value by the specified parameter.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param by - Value by which to increment the specified field. To decrement, specify a negative value.\n * @requiredField by\n * @returns Updated patch object.\n */\n incrementField(field: string, by: number): WixDataPatchByFilter\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch object.\n */\n setField(field: string, value: any): WixDataPatchByFilter\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n appendToArray(field: string, value: any): WixDataPatchByFilter\n\n /**\n * Refines a patch operation to remove the first instance of the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value whose first instance is removed from the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n removeFromArray(field: string, value: any): WixDataPatchByFilter\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @returns Updated patch object.\n */\n removeField(field: string): WixDataPatchByFilter\n\n /**\n * Starts the async patch operation and returns a Promise that resolves to the async job.\n *\n * @public\n * @documentationMaturity preview\n * @returns Async job information.\n */\n run(options?: WixDataAsyncByFilterOptions): Promise<WixDataAsyncJob>\n}\n\n/**\n * @builder\n */\nexport interface WixDataPatch {\n /**\n * Refines a patch operation to increment the specified field value by the specified parameter.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param by - Value by which to increment the specified field. To decrement, specify a negative value.\n * @requiredField by\n * @returns Updated patch object.\n */\n incrementField(field: string, by: number): WixDataPatch\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch object.\n */\n setField(field: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n appendToArray(field: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to remove the first instance of the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value whose first instance is removed from the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n removeFromArray(field: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @returns Updated patch object.\n */\n removeField(field: string): WixDataPatch\n\n /**\n * Runs the patch operation and returns a Promise that resolves to the patched item and operation metadata.\n *\n * @public\n * @documentationMaturity preview\n * @returns Modified data item.\n */\n\n run(options?: WixDataPatchOptions): Promise<WixDataItem | null>\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/api/WixDataPatch.ts"],"sourcesContent":["import {\n BaseOptions,\n WixDataOptions,\n WixDataItem,\n WixDataBulkResult,\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n} from './types'\nimport { WixDataFilter } from './WixDataFilter'\nimport { FieldModificationsBuilder } from './WixDataFieldModificationsBuilder'\n\nexport interface WixDataPatchOptions extends BaseOptions {\n /**\n * If provided, item will be patched only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkPatchOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be patched.\n */\n condition?: WixDataFilter\n}\n\n/**\n * @builder\n */\nexport interface WixDataBulkPatch\n extends FieldModificationsBuilder<WixDataBulkPatch> {\n /**\n * Runs the bulk patch operation and returns a Promise that resolves to information about the results.\n *\n * @public\n * @documentationMaturity preview\n * @returns Bulk operation results.\n */\n run(options?: WixDataBulkPatchOptions): Promise<WixDataBulkResult>\n}\n\n/**\n * @builder\n */\nexport interface WixDataPatchByFilter\n extends FieldModificationsBuilder<WixDataPatchByFilter> {\n /**\n * Starts the async patch operation and returns a Promise that resolves to the async job.\n *\n * @public\n * @documentationMaturity preview\n * @returns Async job information.\n */\n run(options?: WixDataAsyncByFilterOptions): Promise<WixDataAsyncJob>\n}\n\n/**\n * @builder\n */\nexport interface WixDataPatch extends FieldModificationsBuilder<WixDataPatch> {\n /**\n * Runs the patch operation and returns a Promise that resolves to the patched item and operation metadata.\n *\n * @public\n * @documentationMaturity preview\n * @returns Modified data item.\n */\n\n run(options?: WixDataPatchOptions): Promise<WixDataItem | null>\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ exports.__esModule = true;
5
+ exports.BaseFieldModificationsBuilder = void 0;
6
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _errors = require("../../errors");
8
+ var _utils = require("../../utils");
9
+ class BaseFieldModificationsBuilder {
10
+ constructor(origin) {
11
+ (0, _defineProperty2.default)(this, "fieldModifications", void 0);
12
+ (0, _defineProperty2.default)(this, "ownInvalidArguments", void 0);
13
+ this.ownInvalidArguments = origin.invalidArguments ?? [];
14
+ this.fieldModifications = origin.fieldModifications ?? [];
15
+ }
16
+ incrementField(fieldName, by) {
17
+ const [invalidArguments] = this.patchValidator('.incrementField').arityIsTwo(arguments).isNumber(fieldName, by).validateAndAggregate();
18
+ return this.copy({
19
+ invalidArguments,
20
+ addFieldModification: {
21
+ fieldPath: fieldName,
22
+ action: 'INCREMENT_FIELD',
23
+ value: by
24
+ }
25
+ });
26
+ }
27
+ setField(fieldName, value) {
28
+ const [invalidArguments] = this.patchValidator('.setField').arityIsTwo(arguments).validateAndAggregate();
29
+ return this.copy({
30
+ invalidArguments,
31
+ addFieldModification: {
32
+ fieldPath: fieldName,
33
+ action: 'SET_FIELD',
34
+ value
35
+ }
36
+ });
37
+ }
38
+ appendToArray(fieldName, value) {
39
+ const [invalidArguments] = this.patchValidator('.appendToArray').arityIsTwo(arguments).validateAndAggregate();
40
+ return this.copy({
41
+ invalidArguments,
42
+ addFieldModification: {
43
+ fieldPath: fieldName,
44
+ action: 'APPEND_TO_ARRAY',
45
+ value
46
+ }
47
+ });
48
+ }
49
+ removeFromArray(fieldName, value) {
50
+ const [invalidArguments] = this.patchValidator('.removeFromArray').arityIsTwo(arguments).validateAndAggregate();
51
+ return this.copy({
52
+ invalidArguments,
53
+ addFieldModification: {
54
+ fieldPath: fieldName,
55
+ action: 'REMOVE_FROM_ARRAY',
56
+ value
57
+ }
58
+ });
59
+ }
60
+ removeField(fieldName) {
61
+ const [invalidArguments] = this.patchValidator('.removeField').arityIsTwo(arguments).validateAndAggregate();
62
+ return this.copy({
63
+ invalidArguments,
64
+ addFieldModification: {
65
+ fieldPath: fieldName,
66
+ action: 'REMOVE_FIELD'
67
+ }
68
+ });
69
+ }
70
+ patchValidator(operatorName) {
71
+ return new FieldModificationsValidator(operatorName, this.ownInvalidArguments);
72
+ }
73
+ }
74
+ exports.BaseFieldModificationsBuilder = BaseFieldModificationsBuilder;
75
+ class FieldModificationsValidator extends _errors.AggregatingValidator {
76
+ constructor(operatorName, previousInvalidArguments) {
77
+ super(previousInvalidArguments);
78
+ this.operatorName = operatorName;
79
+ this.operatorName = operatorName;
80
+ }
81
+ isNumber(specifier, operand) {
82
+ return this.addValidation(() => (0, _utils.isNumber)(operand), () => _errors.messages.queryValidations.isNumber(this.operatorName, specifier, operand));
83
+ }
84
+ }
85
+ //# sourceMappingURL=BaseFieldModificationsBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_utils","BaseFieldModificationsBuilder","constructor","origin","_defineProperty2","default","ownInvalidArguments","invalidArguments","fieldModifications","incrementField","fieldName","by","patchValidator","arityIsTwo","arguments","isNumber","validateAndAggregate","copy","addFieldModification","fieldPath","action","value","setField","appendToArray","removeFromArray","removeField","operatorName","FieldModificationsValidator","exports","AggregatingValidator","previousInvalidArguments","specifier","operand","addValidation","messages","queryValidations"],"sources":["../../../../src/api/impl/BaseFieldModificationsBuilder.ts"],"sourcesContent":["import type { FieldModification } from '../FieldModification'\nimport type { FieldModificationsBuilder } from '../WixDataFieldModificationsBuilder'\nimport { AggregatingValidator, messages } from '../../errors'\nimport { isNumber } from '../../utils'\n\nexport abstract class BaseFieldModificationsBuilder<Self>\n implements FieldModificationsBuilder<Self>\n{\n protected readonly fieldModifications: FieldModification[]\n protected readonly ownInvalidArguments: string[]\n\n constructor(origin: {\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n }) {\n this.ownInvalidArguments = origin.invalidArguments ?? []\n this.fieldModifications = origin.fieldModifications ?? []\n }\n\n protected abstract copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): Self\n\n incrementField(fieldName: string, by: number): Self {\n const [invalidArguments] = this.patchValidator('.incrementField')\n .arityIsTwo(arguments)\n .isNumber(fieldName, by)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'INCREMENT_FIELD',\n value: by,\n },\n })\n }\n\n setField(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.setField')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'SET_FIELD',\n value,\n },\n })\n }\n\n appendToArray(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.appendToArray')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'APPEND_TO_ARRAY',\n value,\n },\n })\n }\n\n removeFromArray(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.removeFromArray')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'REMOVE_FROM_ARRAY',\n value,\n },\n })\n }\n\n removeField(fieldName: string): Self {\n const [invalidArguments] = this.patchValidator('.removeField')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'REMOVE_FIELD',\n },\n })\n }\n\n private patchValidator(operatorName: string) {\n return new FieldModificationsValidator(\n operatorName,\n this.ownInvalidArguments\n )\n }\n}\n\nclass FieldModificationsValidator extends AggregatingValidator {\n constructor(public operatorName: string, previousInvalidArguments: string[]) {\n super(previousInvalidArguments)\n this.operatorName = operatorName\n }\n\n isNumber(specifier: string, operand: any) {\n return this.addValidation(\n () => isNumber(operand),\n () =>\n messages.queryValidations.isNumber(\n this.operatorName,\n specifier,\n operand\n )\n )\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAeE,6BAA6B,CAEnD;EAIEC,WAAWA,CAACC,MAGX,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACD,IAAI,CAACC,mBAAmB,GAAGH,MAAM,CAACI,gBAAgB,IAAI,EAAE;IACxD,IAAI,CAACC,kBAAkB,GAAGL,MAAM,CAACK,kBAAkB,IAAI,EAAE;EAC3D;EAOAC,cAAcA,CAACC,SAAiB,EAAEC,EAAU,EAAQ;IAClD,MAAM,CAACJ,gBAAgB,CAAC,GAAG,IAAI,CAACK,cAAc,CAAC,iBAAiB,CAAC,CAC9DC,UAAU,CAACC,SAAS,CAAC,CACrBC,QAAQ,CAACL,SAAS,EAAEC,EAAE,CAAC,CACvBK,oBAAoB,CAAC,CAAC;IAEzB,OAAO,IAAI,CAACC,IAAI,CAAC;MAC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,CAAC,GAAG,IAAI,CAACK,cAAc,CAAC,cAAc,CAAC,CAC3DC,UAAU,CAACC,SAAS,CAAC,CACrBE,oBAAoB,CAAC,CAAC;IAEzB,OAAO,IAAI,CAACC,IAAI,CAAC;MACfV,gBAAgB;MAChBW,oBAAoB,EAAE;QACpBC,SAAS,EAAET,SAAS;QACpBU,MAAM,EAAE;MACV;IACF,CAAC,CAAC;EACJ;EAEQR,cAAcA,CAACc,YAAoB,EAAE;IAC3C,OAAO,IAAIC,2BAA2B,CACpCD,YAAY,EACZ,IAAI,CAACpB,mBACP,CAAC;EACH;AACF;AAACsB,OAAA,CAAA3B,6BAAA,GAAAA,6BAAA;AAED,MAAM0B,2BAA2B,SAASE,4BAAoB,CAAC;EAC7D3B,WAAWA,CAAQwB,YAAoB,EAAEI,wBAAkC,EAAE;IAC3E,KAAK,CAACA,wBAAwB,CAAC;IAAA,KADdJ,YAAoB,GAApBA,YAAoB;IAErC,IAAI,CAACA,YAAY,GAAGA,YAAY;EAClC;EAEAX,QAAQA,CAACgB,SAAiB,EAAEC,OAAY,EAAE;IACxC,OAAO,IAAI,CAACC,aAAa,CACvB,MAAM,IAAAlB,eAAQ,EAACiB,OAAO,CAAC,EACvB,MACEE,gBAAQ,CAACC,gBAAgB,CAACpB,QAAQ,CAChC,IAAI,CAACW,YAAY,EACjBK,SAAS,EACTC,OACF,CACJ,CAAC;EACH;AACF","ignoreList":[]}
@@ -4,86 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports.WixDataPatchImpl = exports.WixDataPatchByFilterImpl = exports.WixDataBulkPatchImpl = void 0;
6
6
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
- var _errors = require("../../errors");
8
- var _utils = require("../../utils");
9
- class WixDataPatchBase {
10
- constructor(origin) {
11
- (0, _defineProperty2.default)(this, "fieldModifications", void 0);
12
- (0, _defineProperty2.default)(this, "collectionName", void 0);
13
- (0, _defineProperty2.default)(this, "ownInvalidArguments", void 0);
14
- this.ownInvalidArguments = origin.invalidArguments ?? [];
15
- this.fieldModifications = origin.fieldModifications ?? [];
16
- this.collectionName = origin.collectionName;
17
- }
18
- incrementField(fieldName, by) {
19
- const [invalidArguments] = this.patchValidator('.incrementField').arityIsTwo(arguments).isNumber(fieldName, by).validateAndAggregate();
20
- return this.copy({
21
- invalidArguments,
22
- addFieldModification: {
23
- fieldPath: fieldName,
24
- action: 'INCREMENT_FIELD',
25
- actionOptions: by
26
- }
27
- });
28
- }
29
- setField(fieldName, value) {
30
- const [invalidArguments] = this.patchValidator('.setField').arityIsTwo(arguments).validateAndAggregate();
31
- return this.copy({
32
- invalidArguments,
33
- addFieldModification: {
34
- fieldPath: fieldName,
35
- action: 'SET_FIELD',
36
- actionOptions: value
37
- }
38
- });
39
- }
40
- appendToArray(fieldName, value) {
41
- const [invalidArguments] = this.patchValidator('.appendToArray').arityIsTwo(arguments).validateAndAggregate();
42
- return this.copy({
43
- invalidArguments,
44
- addFieldModification: {
45
- fieldPath: fieldName,
46
- action: 'APPEND_TO_ARRAY',
47
- actionOptions: value
48
- }
49
- });
50
- }
51
- removeFromArray(fieldName, value) {
52
- const [invalidArguments] = this.patchValidator('.removeFromArray').arityIsTwo(arguments).validateAndAggregate();
53
- return this.copy({
54
- invalidArguments,
55
- addFieldModification: {
56
- fieldPath: fieldName,
57
- action: 'REMOVE_FROM_ARRAY',
58
- actionOptions: value
59
- }
60
- });
61
- }
62
- removeField(fieldName) {
63
- const [invalidArguments] = this.patchValidator('.removeField').arityIsTwo(arguments).validateAndAggregate();
64
- return this.copy({
65
- invalidArguments,
66
- addFieldModification: {
67
- fieldPath: fieldName,
68
- action: 'REMOVE_FIELD'
69
- }
70
- });
71
- }
72
- patchValidator(operatorName) {
73
- return new PatchValidator(operatorName, this.ownInvalidArguments);
74
- }
75
- }
76
- class WixDataBulkPatchImpl extends WixDataPatchBase {
7
+ var _BaseFieldModificationsBuilder = require("./BaseFieldModificationsBuilder");
8
+ class WixDataBulkPatchImpl extends _BaseFieldModificationsBuilder.BaseFieldModificationsBuilder {
77
9
  constructor(origin) {
78
10
  super(origin);
79
11
  (0, _defineProperty2.default)(this, "onRun", void 0);
12
+ (0, _defineProperty2.default)(this, "collectionName", void 0);
80
13
  (0, _defineProperty2.default)(this, "itemIds", void 0);
14
+ this.collectionName = origin.collectionName;
81
15
  this.onRun = origin.onRun;
82
16
  this.itemIds = origin.itemIds;
83
17
  }
84
18
  copy(params) {
85
19
  return new WixDataBulkPatchImpl({
86
20
  ...this,
21
+ collectionName: this.collectionName,
87
22
  invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,
88
23
  fieldModifications: [...this.fieldModifications, ...[params.addFieldModification]],
89
24
  onRun: this.onRun
@@ -99,17 +34,20 @@ class WixDataBulkPatchImpl extends WixDataPatchBase {
99
34
  }
100
35
  }
101
36
  exports.WixDataBulkPatchImpl = WixDataBulkPatchImpl;
102
- class WixDataPatchImpl extends WixDataPatchBase {
37
+ class WixDataPatchImpl extends _BaseFieldModificationsBuilder.BaseFieldModificationsBuilder {
103
38
  constructor(origin) {
104
39
  super(origin);
105
40
  (0, _defineProperty2.default)(this, "onRun", void 0);
41
+ (0, _defineProperty2.default)(this, "collectionName", void 0);
106
42
  (0, _defineProperty2.default)(this, "itemId", void 0);
43
+ this.collectionName = origin.collectionName;
107
44
  this.onRun = origin.onRun;
108
45
  this.itemId = origin.itemId;
109
46
  }
110
47
  copy(params) {
111
48
  return new WixDataPatchImpl({
112
49
  ...this,
50
+ collectionName: this.collectionName,
113
51
  invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,
114
52
  fieldModifications: [...this.fieldModifications, ...[params.addFieldModification]],
115
53
  onRun: this.onRun
@@ -125,17 +63,20 @@ class WixDataPatchImpl extends WixDataPatchBase {
125
63
  }
126
64
  }
127
65
  exports.WixDataPatchImpl = WixDataPatchImpl;
128
- class WixDataPatchByFilterImpl extends WixDataPatchBase {
66
+ class WixDataPatchByFilterImpl extends _BaseFieldModificationsBuilder.BaseFieldModificationsBuilder {
129
67
  constructor(origin) {
130
68
  super(origin);
131
69
  (0, _defineProperty2.default)(this, "onRun", void 0);
70
+ (0, _defineProperty2.default)(this, "collectionName", void 0);
132
71
  (0, _defineProperty2.default)(this, "filter", void 0);
72
+ this.collectionName = origin.collectionName;
133
73
  this.onRun = origin.onRun;
134
74
  this.filter = origin.filter;
135
75
  }
136
76
  copy(params) {
137
77
  return new WixDataPatchByFilterImpl({
138
78
  ...this,
79
+ collectionName: this.collectionName,
139
80
  invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,
140
81
  fieldModifications: [...this.fieldModifications, ...[params.addFieldModification]],
141
82
  onRun: this.onRun
@@ -151,14 +92,4 @@ class WixDataPatchByFilterImpl extends WixDataPatchBase {
151
92
  }
152
93
  }
153
94
  exports.WixDataPatchByFilterImpl = WixDataPatchByFilterImpl;
154
- class PatchValidator extends _errors.AggregatingValidator {
155
- constructor(operatorName, previousInvalidArguments) {
156
- super(previousInvalidArguments);
157
- this.operatorName = operatorName;
158
- this.operatorName = operatorName;
159
- }
160
- isNumber(specifier, operand) {
161
- return this.addValidation(() => (0, _utils.isNumber)(operand), () => _errors.messages.queryValidations.isNumber(this.operatorName, specifier, operand));
162
- }
163
- }
164
95
  //# sourceMappingURL=WixDataPatchImpl.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_errors","require","_utils","WixDataPatchBase","constructor","origin","_defineProperty2","default","ownInvalidArguments","invalidArguments","fieldModifications","collectionName","incrementField","fieldName","by","patchValidator","arityIsTwo","arguments","isNumber","validateAndAggregate","copy","addFieldModification","fieldPath","action","actionOptions","setField","value","appendToArray","removeFromArray","removeField","operatorName","PatchValidator","WixDataBulkPatchImpl","onRun","itemIds","params","run","options","exports","WixDataPatchImpl","itemId","WixDataPatchByFilterImpl","filter","AggregatingValidator","previousInvalidArguments","specifier","operand","addValidation","messages","queryValidations"],"sources":["../../../../src/api/impl/WixDataPatchImpl.ts"],"sourcesContent":["import {\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n WixDataBulkResult,\n WixDataItem,\n WixDataPatchOptions,\n} from '../types'\nimport { AggregatingValidator, messages } from '../../errors'\nimport { isNumber } from '../../utils'\nimport {\n FieldModification,\n WixDataBulkPatch,\n WixDataPatch,\n WixDataPatchByFilter,\n} from '../WixDataPatch'\n\ninterface BulkPatchParams {\n collectionName: string\n itemIds: string[]\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ninterface PatchParams {\n collectionName: string\n itemId: string\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ninterface PatchByFilterParams {\n collectionName: string\n filter: Record<string, any>\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ntype OnRun = (\n args: IArguments,\n params: PatchParams,\n options?: WixDataPatchOptions\n) => Promise<WixDataItem | null>\n\ntype OnBulkRun = (\n args: IArguments,\n params: BulkPatchParams,\n options?: WixDataPatchOptions\n) => Promise<WixDataBulkResult>\n\ntype OnPatchByFilterRun = (\n args: IArguments,\n params: PatchByFilterParams,\n options?: WixDataAsyncByFilterOptions\n) => Promise<WixDataAsyncJob>\n\nabstract class WixDataPatchBase<Self> {\n protected readonly fieldModifications: FieldModification[]\n protected readonly collectionName: string\n protected readonly ownInvalidArguments: string[]\n\n constructor(origin: {\n collectionName: string\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n }) {\n this.ownInvalidArguments = origin.invalidArguments ?? []\n this.fieldModifications = origin.fieldModifications ?? []\n this.collectionName = origin.collectionName\n }\n\n protected abstract copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): Self\n\n incrementField(fieldName: string, by: number): Self {\n const [invalidArguments] = this.patchValidator('.incrementField')\n .arityIsTwo(arguments)\n .isNumber(fieldName, by)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'INCREMENT_FIELD',\n actionOptions: by,\n },\n })\n }\n\n setField(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.setField')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'SET_FIELD',\n actionOptions: value,\n },\n })\n }\n\n appendToArray(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.appendToArray')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'APPEND_TO_ARRAY',\n actionOptions: value,\n },\n })\n }\n\n removeFromArray(fieldName: string, value: any): Self {\n const [invalidArguments] = this.patchValidator('.removeFromArray')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'REMOVE_FROM_ARRAY',\n actionOptions: value,\n },\n })\n }\n\n removeField(fieldName: string): Self {\n const [invalidArguments] = this.patchValidator('.removeField')\n .arityIsTwo(arguments)\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n addFieldModification: {\n fieldPath: fieldName,\n action: 'REMOVE_FIELD',\n },\n })\n }\n\n private patchValidator(operatorName: string) {\n return new PatchValidator(operatorName, this.ownInvalidArguments)\n }\n}\n\nexport class WixDataBulkPatchImpl\n extends WixDataPatchBase<WixDataBulkPatchImpl>\n implements WixDataBulkPatch\n{\n private readonly onRun: OnBulkRun\n readonly itemIds: string[]\n\n constructor(origin: {\n collectionName: string\n itemIds: string[]\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnBulkRun\n }) {\n super(origin)\n this.onRun = origin.onRun\n this.itemIds = origin.itemIds\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataBulkPatchImpl {\n return new WixDataBulkPatchImpl({\n ...this,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataPatchOptions): Promise<WixDataBulkResult> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n itemIds: this.itemIds,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n\nexport class WixDataPatchImpl\n extends WixDataPatchBase<WixDataPatchImpl>\n implements WixDataPatch\n{\n private readonly onRun: OnRun\n readonly itemId: string\n\n constructor(origin: {\n collectionName: string\n itemId: string\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnRun\n }) {\n super(origin)\n this.onRun = origin.onRun\n this.itemId = origin.itemId\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataPatchImpl {\n return new WixDataPatchImpl({\n ...this,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataPatchOptions): Promise<WixDataItem | null> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n itemId: this.itemId,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n\nexport class WixDataPatchByFilterImpl\n extends WixDataPatchBase<WixDataPatchByFilterImpl>\n implements WixDataPatchByFilter\n{\n private readonly onRun: OnPatchByFilterRun\n readonly filter: Record<string, any>\n\n constructor(origin: {\n collectionName: string\n filter: Record<string, any>\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnPatchByFilterRun\n }) {\n super(origin)\n this.onRun = origin.onRun\n this.filter = origin.filter\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataPatchByFilterImpl {\n return new WixDataPatchByFilterImpl({\n ...this,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataAsyncByFilterOptions): Promise<WixDataAsyncJob> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n filter: this.filter,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n\nclass PatchValidator extends AggregatingValidator {\n constructor(public operatorName: string, previousInvalidArguments: string[]) {\n super(previousInvalidArguments)\n this.operatorName = operatorName\n }\n\n isNumber(specifier: string, operand: any) {\n return this.addValidation(\n () => isNumber(operand),\n () =>\n messages.queryValidations.isNumber(\n this.operatorName,\n specifier,\n operand\n )\n )\n }\n}\n"],"mappings":";;;;;;AAOA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AA+CA,MAAeE,gBAAgB,CAAO;EAKpCC,WAAWA,CAACC,MAIX,EAAE;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACD,IAAI,CAACC,mBAAmB,GAAGH,MAAM,CAACI,gBAAgB,IAAI,EAAE;IACxD,IAAI,CAACC,kBAAkB,GAAGL,MAAM,CAACK,kBAAkB,IAAI,EAAE;IACzD,IAAI,CAACC,cAAc,GAAGN,MAAM,CAACM,cAAc;EAC7C;EAOAC,cAAcA,CAACC,SAAiB,EAAEC,EAAU,EAAQ;IAClD,MAAM,CAACL,gBAAgB,CAAC,GAAG,IAAI,CAACM,cAAc,CAAC,iBAAiB,CAAC,CAC9DC,UAAU,CAACC,SAAS,CAAC,CACrBC,QAAQ,CAACL,SAAS,EAAEC,EAAE,CAAC,CACvBK,oBAAoB,CAAC,CAAC;IAEzB,OAAO,IAAI,CAACC,IAAI,CAAC;MACfX,gBAAgB;MAChBY,oBAAoB,EAAE;QACpBC,SAAS,EAAET,SAAS;QACpBU,MAAM,EAAE,iBAAiB;QACzBC,aAAa,EAAEV;MACjB;IACF,CAAC,CAAC;EAC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AA4B;IAC3B,OAAO,IAAIM,wBAAwB,CAAC;MAClC,GAAG,IAAI;MACPhC,gBAAgB,EAAE0B,MAAM,CAAC1B,gBAAgB,IAAI,IAAI,CAACD,mBAAmB;MACrEE,kBAAkB,EAAE,CAClB,GAAG,IAAI,CAACA,kBAAkB,EAC1B,GAAG,CAACyB,MAAM,CAACd,oBAAoB,CAAC,CACjC;MACDY,KAAK,EAAE,IAAI,CAACA;IACd,CAAC,CAAC;EACJ;EAEAG,GAAGA,CAACC,OAAqC,EAA4B;IACnE,OAAO,IAAI,CAACJ,KAAK,CACfhB,SAAS,EACT;MACEN,cAAc,EAAE,IAAI,CAACA,cAAc;MACnC+B,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBjC,gBAAgB,EAAE,IAAI,CAACD,mBAAmB;MAC1CE,kBAAkB,EAAE,IAAI,CAACA;IAC3B,CAAC,EACD2B,OACF,CAAC;EACH;AACF;AAACC,OAAA,CAAAG,wBAAA,GAAAA,wBAAA;AAED,MAAMV,cAAc,SAASY,4BAAoB,CAAC;EAChDvC,WAAWA,CAAQ0B,YAAoB,EAAEc,wBAAkC,EAAE;IAC3E,KAAK,CAACA,wBAAwB,CAAC;IAAA,KADdd,YAAoB,GAApBA,YAAoB;IAErC,IAAI,CAACA,YAAY,GAAGA,YAAY;EAClC;EAEAZ,QAAQA,CAAC2B,SAAiB,EAAEC,OAAY,EAAE;IACxC,OAAO,IAAI,CAACC,aAAa,CACvB,MAAM,IAAA7B,eAAQ,EAAC4B,OAAO,CAAC,EACvB,MACEE,gBAAQ,CAACC,gBAAgB,CAAC/B,QAAQ,CAChC,IAAI,CAACY,YAAY,EACjBe,SAAS,EACTC,OACF,CACJ,CAAC;EACH;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_BaseFieldModificationsBuilder","require","WixDataBulkPatchImpl","BaseFieldModificationsBuilder","constructor","origin","_defineProperty2","default","collectionName","onRun","itemIds","copy","params","invalidArguments","ownInvalidArguments","fieldModifications","addFieldModification","run","options","arguments","exports","WixDataPatchImpl","itemId","WixDataPatchByFilterImpl","filter"],"sources":["../../../../src/api/impl/WixDataPatchImpl.ts"],"sourcesContent":["import {\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n WixDataBulkResult,\n WixDataItem,\n} from '../types'\nimport {\n WixDataBulkPatch,\n WixDataBulkPatchOptions,\n WixDataPatch,\n WixDataPatchByFilter,\n WixDataPatchOptions,\n} from '../WixDataPatch'\nimport { FieldModification } from '../FieldModification'\nimport { BaseFieldModificationsBuilder } from './BaseFieldModificationsBuilder'\n\ninterface BulkPatchParams {\n collectionName: string\n itemIds: string[]\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ninterface PatchParams {\n collectionName: string\n itemId: string\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ninterface PatchByFilterParams {\n collectionName: string\n filter: Record<string, any>\n invalidArguments: string[]\n fieldModifications: FieldModification[]\n}\n\ntype OnRun = (\n args: IArguments,\n params: PatchParams,\n options?: WixDataPatchOptions\n) => Promise<WixDataItem | null>\n\ntype OnBulkRun = (\n args: IArguments,\n params: BulkPatchParams,\n options?: WixDataBulkPatchOptions\n) => Promise<WixDataBulkResult>\n\ntype OnPatchByFilterRun = (\n args: IArguments,\n params: PatchByFilterParams,\n options?: WixDataAsyncByFilterOptions\n) => Promise<WixDataAsyncJob>\n\nexport class WixDataBulkPatchImpl\n extends BaseFieldModificationsBuilder<WixDataBulkPatchImpl>\n implements WixDataBulkPatch\n{\n private readonly onRun: OnBulkRun\n private readonly collectionName: string\n readonly itemIds: string[]\n\n constructor(origin: {\n collectionName: string\n itemIds: string[]\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnBulkRun\n }) {\n super(origin)\n this.collectionName = origin.collectionName\n this.onRun = origin.onRun\n this.itemIds = origin.itemIds\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataBulkPatchImpl {\n return new WixDataBulkPatchImpl({\n ...this,\n collectionName: this.collectionName,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataBulkPatchOptions): Promise<WixDataBulkResult> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n itemIds: this.itemIds,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n\nexport class WixDataPatchImpl\n extends BaseFieldModificationsBuilder<WixDataPatchImpl>\n implements WixDataPatch\n{\n private readonly onRun: OnRun\n private readonly collectionName: string\n readonly itemId: string\n\n constructor(origin: {\n collectionName: string\n itemId: string\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnRun\n }) {\n super(origin)\n this.collectionName = origin.collectionName\n this.onRun = origin.onRun\n this.itemId = origin.itemId\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataPatchImpl {\n return new WixDataPatchImpl({\n ...this,\n collectionName: this.collectionName,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataPatchOptions): Promise<WixDataItem | null> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n itemId: this.itemId,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n\nexport class WixDataPatchByFilterImpl\n extends BaseFieldModificationsBuilder<WixDataPatchByFilterImpl>\n implements WixDataPatchByFilter\n{\n private readonly onRun: OnPatchByFilterRun\n private readonly collectionName: string\n readonly filter: Record<string, any>\n\n constructor(origin: {\n collectionName: string\n filter: Record<string, any>\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n onRun: OnPatchByFilterRun\n }) {\n super(origin)\n this.collectionName = origin.collectionName\n this.onRun = origin.onRun\n this.filter = origin.filter\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataPatchByFilterImpl {\n return new WixDataPatchByFilterImpl({\n ...this,\n collectionName: this.collectionName,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n ...[params.addFieldModification],\n ],\n onRun: this.onRun,\n })\n }\n\n run(options?: WixDataAsyncByFilterOptions): Promise<WixDataAsyncJob> {\n return this.onRun(\n arguments,\n {\n collectionName: this.collectionName,\n filter: this.filter,\n invalidArguments: this.ownInvalidArguments,\n fieldModifications: this.fieldModifications,\n },\n options\n )\n }\n}\n"],"mappings":";;;;;;AAcA,IAAAA,8BAAA,GAAAC,OAAA;AAyCO,MAAMC,oBAAoB,SACvBC,4DAA6B,CAEvC;EAKEC,WAAWA,CAACC,MAMX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACb,IAAI,CAACC,cAAc,GAAGH,MAAM,CAACG,cAAc;IAC3C,IAAI,CAACC,KAAK,GAAGJ,MAAM,CAACI,KAAK;IACzB,IAAI,CAACC,OAAO,GAAGL,MAAM,CAACK,OAAO;EAC/B;EAEUC,IAAIA,CAACC,MAGd,EAAwB;IACvB,OAAO,IAAIV,oBAAoB,CAAC;MAC9B,GAAG,IAAI;MACPM,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCK,gBAAgB,EAAED,MAAM,CAACC,gBAAgB,IAAI,IAAI,CAACC,mBAAmB;MACrEC,kBAAkB,EAAE,CAClB,GAAG,IAAI,CAACA,kBAAkB,EAC1B,GAAG,CAACH,MAAM,CAACI,oBAAoB,CAAC,CACjC;MACDP,KAAK,EAAE,IAAI,CAACA;IACd,CAAC,CAAC;EACJ;EAEAQ,GAAGA,CAACC,OAAiC,EAA8B;IACjE,OAAO,IAAI,CAACT,KA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AC;EACH;AACF;AAACE,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAEM,MAAME,wBAAwB,SAC3BpB,4DAA6B,CAEvC;EAKEC,WAAWA,CAACC,MAMX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACb,IAAI,CAACC,cAAc,GAAGH,MAAM,CAACG,cAAc;IAC3C,IAAI,CAACC,KAAK,GAAGJ,MAAM,CAACI,KAAK;IACzB,IAAI,CAACe,MAAM,GAAGnB,MAAM,CAACmB,MAAM;EAC7B;EAEUb,IAAIA,CAACC,MAGd,EAA4B;IAC3B,OAAO,IAAIW,wBAAwB,CAAC;MAClC,GAAG,IAAI;MACPf,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCK,gBAAgB,EAAED,MAAM,CAACC,gBAAgB,IAAI,IAAI,CAACC,mBAAmB;MACrEC,kBAAkB,EAAE,CAClB,GAAG,IAAI,CAACA,kBAAkB,EAC1B,GAAG,CAACH,MAAM,CAACI,oBAAoB,CAAC,CACjC;MACDP,KAAK,EAAE,IAAI,CAACA;IACd,CAAC,CAAC;EACJ;EAEAQ,GAAGA,CAACC,OAAqC,EAA4B;IACnE,OAAO,IAAI,CAACT,KAAK,CACfU,SAAS,EACT;MACEX,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCgB,MAAM,EAAE,IAAI,CAACA,MAAM;MACnBX,gBAAgB,EAAE,IAAI,CAACC,mBAAmB;MAC1CC,kBAAkB,EAAE,IAAI,CAACA;IAC3B,CAAC,EACDG,OACF,CAAC;EACH;AACF;AAACE,OAAA,CAAAG,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.stages = exports.pipelineBuilder = exports.expressions = exports.WixDataUpdateOptions = exports.WixDataSearchRequest = exports.WixDataSearch = exports.WixDataSaveOptions = exports.WixDataResult = exports.WixDataRemoveOptions = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQuerySpec = exports.WixDataQueryRequest = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQueryBuilder = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatchByFilter = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataInsertOptions = exports.WixDataGetOptions = exports.WixDataFilterInput = exports.WixDataFilter = exports.WixDataDistinctOptions = exports.WixDataDirectSearchOptions = exports.WixDataDirectQueryOptions = exports.WixDataCountOptions = exports.WixDataBulkUpdateOptions = exports.WixDataBulkSaveOptions = exports.WixDataBulkResult = exports.WixDataBulkRemoveOptions = exports.WixDataBulkPatchOptions = exports.WixDataBulkPatch = exports.WixDataBulkInsertOptions = exports.WixDataBulkError = exports.WixDataAsyncJobStatusValue = exports.WixDataAsyncJobStatus = exports.WixDataAsyncJob = exports.WixDataAsyncByFilterOptions = exports.WixDataApi = exports.WixDataAggregatePipelineStages = exports.WixDataAggregatePipelineExpressions = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.WithIncludeFieldGroupsOption = exports.UnwindStage = exports.ToUpperExpression = exports.ToLowerExpression = exports.TextExpression = exports.SumExpression = exports.SubtractExpression = exports.SubstringExpression = exports.StringifyExpression = exports.SortStage = exports.Sort = exports.SkipStage = exports.SearchParams = exports.SearchBuilder = exports.QueryValidator = exports.QueryBuilder = exports.QueryBase = exports.ProjectStage = exports.PipelineStage = exports.PipelineBuilder = exports.ObjectToArrayStage = exports.NumericExpression = exports.MultiplyExpression = exports.ModExpression = exports.LimitStage = exports.LengthExpression = exports.GroupStage = exports.FloorExpression = exports.FilterStage = exports.Filter = exports.FieldExpression = exports.DivideExpression = exports.ConcatExpression = exports.CeilExpression = exports.AddExpression = exports.AbsExpression = void 0;
4
+ exports.stages = exports.pipelineBuilder = exports.expressions = exports.WixDataUpdateOptions = exports.WixDataSearchRequest = exports.WixDataSearch = exports.WixDataSaveOptions = exports.WixDataResult = exports.WixDataRemoveOptions = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQuerySpec = exports.WixDataQueryRequest = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQueryBuilder = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatchByFilter = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataInsertOptions = exports.WixDataGetOptions = exports.WixDataFilterInput = exports.WixDataFilter = exports.WixDataFieldModificationsBuilder = exports.WixDataDistinctOptions = exports.WixDataDirectSearchOptions = exports.WixDataDirectQueryOptions = exports.WixDataCountOptions = exports.WixDataBulkUpdateOptions = exports.WixDataBulkSaveOptions = exports.WixDataBulkResult = exports.WixDataBulkRemoveOptions = exports.WixDataBulkPatchOptions = exports.WixDataBulkPatch = exports.WixDataBulkInsertOptions = exports.WixDataBulkError = exports.WixDataAsyncJobStatusValue = exports.WixDataAsyncJobStatus = exports.WixDataAsyncJob = exports.WixDataAsyncByFilterOptions = exports.WixDataApi = exports.WixDataAggregatePipelineStages = exports.WixDataAggregatePipelineExpressions = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.WithIncludeFieldGroupsOption = exports.UnwindStage = exports.ToUpperExpression = exports.ToLowerExpression = exports.TextExpression = exports.SumExpression = exports.SubtractExpression = exports.SubstringExpression = exports.StringifyExpression = exports.SortStage = exports.Sort = exports.SkipStage = exports.SetField = exports.SearchParams = exports.SearchBuilder = exports.RemoveFromArray = exports.RemoveField = exports.QueryValidator = exports.QueryBuilder = exports.QueryBase = exports.ProjectStage = exports.PipelineStage = exports.PipelineBuilder = exports.ObjectToArrayStage = exports.NumericExpression = exports.MultiplyExpression = exports.ModExpression = exports.LimitStage = exports.LengthExpression = exports.IncrementField = exports.GroupStage = exports.FloorExpression = exports.FilterStage = exports.Filter = exports.FieldModificationsBuilder = exports.FieldModification = exports.FieldExpression = exports.DivideExpression = exports.ConcatExpression = exports.CeilExpression = exports.AppendToArray = exports.AddExpression = exports.AbsExpression = void 0;
5
5
  var _WixDataQuery = require("./WixDataQuery");
6
6
  exports.WixDataQuery = _WixDataQuery.WixDataQuery;
7
7
  var _WixDataSearch = require("./WixDataSearch");
@@ -20,6 +20,18 @@ var _WixDataPatch = require("./WixDataPatch");
20
20
  exports.WixDataPatch = _WixDataPatch.WixDataPatch;
21
21
  exports.WixDataBulkPatch = _WixDataPatch.WixDataBulkPatch;
22
22
  exports.WixDataPatchByFilter = _WixDataPatch.WixDataPatchByFilter;
23
+ exports.WixDataPatchOptions = _WixDataPatch.WixDataPatchOptions;
24
+ exports.WixDataBulkPatchOptions = _WixDataPatch.WixDataBulkPatchOptions;
25
+ var _FieldModification = require("./FieldModification");
26
+ exports.FieldModification = _FieldModification.FieldModification;
27
+ exports.SetField = _FieldModification.SetField;
28
+ exports.RemoveField = _FieldModification.RemoveField;
29
+ exports.IncrementField = _FieldModification.IncrementField;
30
+ exports.AppendToArray = _FieldModification.AppendToArray;
31
+ exports.RemoveFromArray = _FieldModification.RemoveFromArray;
32
+ var _WixDataFieldModificationsBuilder = require("./WixDataFieldModificationsBuilder");
33
+ exports.FieldModificationsBuilder = _WixDataFieldModificationsBuilder.FieldModificationsBuilder;
34
+ exports.WixDataFieldModificationsBuilder = _WixDataFieldModificationsBuilder.WixDataFieldModificationsBuilder;
23
35
  var _WixDataFilter = require("./WixDataFilter");
24
36
  exports.WixDataFilter = _WixDataFilter.WixDataFilter;
25
37
  var _types = require("./types");
@@ -29,7 +41,6 @@ exports.WixDataReadWithProjectionOptions = _types.WixDataReadWithProjectionOptio
29
41
  exports.WithIncludeFieldGroupsOption = _types.WithIncludeFieldGroupsOption;
30
42
  exports.WixDataGetOptions = _types.WixDataGetOptions;
31
43
  exports.WixDataUpdateOptions = _types.WixDataUpdateOptions;
32
- exports.WixDataPatchOptions = _types.WixDataPatchOptions;
33
44
  exports.WixDataQueryOptions = _types.WixDataQueryOptions;
34
45
  exports.WixDataDirectQueryOptions = _types.WixDataDirectQueryOptions;
35
46
  exports.WixDataQueryRequest = _types.WixDataQueryRequest;
@@ -38,7 +49,6 @@ exports.WixDataItem = _types.WixDataItem;
38
49
  exports.WixDataReference = _types.WixDataReference;
39
50
  exports.WixDataBulkError = _types.WixDataBulkError;
40
51
  exports.WixDataSaveOptions = _types.WixDataSaveOptions;
41
- exports.WixDataBulkPatchOptions = _types.WixDataBulkPatchOptions;
42
52
  exports.WixDataAsyncByFilterOptions = _types.WixDataAsyncByFilterOptions;
43
53
  exports.WixDataAsyncJob = _types.WixDataAsyncJob;
44
54
  exports.WixDataAsyncJobStatus = _types.WixDataAsyncJobStatus;
@@ -1 +1 @@
1
- {"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_WixDataSearch","WixDataSearch","_WixDataApi","WixDataApi","_WixDataResult","WixDataResult","_QueryValidator","QueryValidator","_WixDataAggregate","WixDataAggregate","_QueryBase","QueryBase","_WixDataPatch","WixDataPatch","WixDataBulkPatch","WixDataPatchByFilter","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WithIncludeFieldGroupsOption","WixDataGetOptions","WixDataUpdateOptions","WixDataPatchOptions","WixDataQueryOptions","WixDataDirectQueryOptions","WixDataQueryRequest","WixDataQuerySpec","WixDataItem","WixDataReference","WixDataBulkError","WixDataSaveOptions","WixDataBulkPatchOptions","WixDataAsyncByFilterOptions","WixDataAsyncJob","WixDataAsyncJobStatus","WixDataAsyncJobStatusValue","WixDataFilterInput","WixDataBulkUpdateOptions","WixDataBulkRemoveOptions","WixDataBulkInsertOptions","WixDataBulkSaveOptions","WixDataInsertOptions","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions","WixDataRemoveOptions","WixDataDistinctOptions","WixDataCountOptions","WixDataSearchRequest","WixDataDirectSearchOptions","_stages","stages","PipelineStage","WixDataAggregatePipelineStages","_FilterStage","FilterStage","_ProjectStage","ProjectStage","_GroupStage","GroupStage","_UnwindStage","UnwindStage","_SortStage","SortStage","_LimitStage","LimitStage","_SkipStage","SkipStage","_ObjectToArrayStage","ObjectToArrayStage","_PipelineBuilder","PipelineBuilder","pipelineBuilder","_WixDataQueryBuilder","QueryBuilder","Sort","Filter","WixDataQueryBuilder","_WixDataSearchBuilder","SearchBuilder","SearchParams","_expressions","expressions","WixDataAggregatePipelineExpressions","_Expression","FieldExpression","TextExpression","NumericExpression","AddExpression","SubtractExpression","MultiplyExpression","DivideExpression","SumExpression","AbsExpression","ModExpression","FloorExpression","CeilExpression","ConcatExpression","StringifyExpression","ToLowerExpression","ToUpperExpression","SubstringExpression","LengthExpression"],"sources":["../../../src/api/index.ts"],"sourcesContent":["export { WixDataQuery } from './WixDataQuery'\nexport { WixDataSearch } from './WixDataSearch'\nexport { WixDataApi } from './WixDataApi'\nexport { WixDataResult } from './WixDataResult'\nexport { QueryValidator } from './QueryValidator'\nexport { WixDataAggregate } from './WixDataAggregate'\nexport { QueryBase } from './QueryBase'\nexport {\n WixDataPatch,\n WixDataBulkPatch,\n WixDataPatchByFilter,\n} from './WixDataPatch'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WithIncludeFieldGroupsOption,\n WixDataGetOptions,\n WixDataUpdateOptions,\n WixDataPatchOptions,\n WixDataQueryOptions,\n WixDataDirectQueryOptions,\n WixDataQueryRequest,\n WixDataQuerySpec,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataSaveOptions,\n WixDataBulkPatchOptions,\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n WixDataAsyncJobStatus,\n WixDataAsyncJobStatusValue,\n WixDataFilterInput,\n WixDataBulkUpdateOptions,\n WixDataBulkRemoveOptions,\n WixDataBulkInsertOptions,\n WixDataBulkSaveOptions,\n WixDataInsertOptions,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n WixDataRemoveOptions,\n WixDataDistinctOptions,\n WixDataCountOptions,\n WixDataSearchRequest,\n WixDataDirectSearchOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\nexport {\n stages,\n PipelineStage,\n WixDataAggregatePipelineStages,\n} from './stages/stages'\nexport { FilterStage } from './stages/FilterStage'\nexport { ProjectStage } from './stages/ProjectStage'\nexport { GroupStage } from './stages/GroupStage'\nexport { UnwindStage } from './stages/UnwindStage'\nexport { SortStage } from './stages/SortStage'\nexport { LimitStage } from './stages/LimitStage'\nexport { SkipStage } from './stages/SkipStage'\nexport { ObjectToArrayStage } from './stages/ObjectToArrayStage'\nexport { PipelineBuilder, pipelineBuilder } from './PipelineBuilder'\nexport {\n QueryBuilder,\n Sort,\n Filter,\n WixDataQueryBuilder,\n} from './WixDataQueryBuilder'\nexport { SearchBuilder, SearchParams } from './WixDataSearchBuilder'\nexport {\n expressions,\n WixDataAggregatePipelineExpressions,\n} from './expressions/expressions'\nexport {\n FieldExpression,\n TextExpression,\n NumericExpression,\n AddExpression,\n SubtractExpression,\n MultiplyExpression,\n DivideExpression,\n SumExpression,\n AbsExpression,\n ModExpression,\n FloorExpression,\n CeilExpression,\n ConcatExpression,\n StringifyExpression,\n ToLowerExpression,\n ToUpperExpression,\n SubstringExpression,\n LengthExpression,\n} from './expressions/Expression'\n"],"mappings":";;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAA6CC,OAAA,CAAAC,YAAA,GAAAH,aAAA,CAAAG,YAAA;AAC7C,IAAAC,cAAA,GAAAH,OAAA;AAA+CC,OAAA,CAAAG,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAAAC,WAAA,GAAAL,OAAA;AAAyCC,OAAA,CAAAK,UAAA,GAAAD,WAAA,CAAAC,UAAA;AACzC,IAAAC,cAAA,GAAAP,OAAA;AAA+CC,OAAA,CAAAO,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAA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,CAAAsG,gBAAA,GAAAb,WAAA,CAAAa,gBAAA;AAAAtG,OAAA,CAAAuG,mBAAA,GAAAd,WAAA,CAAAc,mBAAA;AAAAvG,OAAA,CAAAwG,iBAAA,GAAAf,WAAA,CAAAe,iBAAA;AAAAxG,OAAA,CAAAyG,iBAAA,GAAAhB,WAAA,CAAAgB,iBAAA;AAAAzG,OAAA,CAAA0G,mBAAA,GAAAjB,WAAA,CAAAiB,mBAAA;AAAA1G,OAAA,CAAA2G,gBAAA,GAAAlB,WAAA,CAAAkB,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_WixDataSearch","WixDataSearch","_WixDataApi","WixDataApi","_WixDataResult","WixDataResult","_QueryValidator","QueryValidator","_WixDataAggregate","WixDataAggregate","_QueryBase","QueryBase","_WixDataPatch","WixDataPatch","WixDataBulkPatch","WixDataPatchByFilter","WixDataPatchOptions","WixDataBulkPatchOptions","_FieldModification","FieldModification","SetField","RemoveField","IncrementField","AppendToArray","RemoveFromArray","_WixDataFieldModificationsBuilder","FieldModificationsBuilder","WixDataFieldModificationsBuilder","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WithIncludeFieldGroupsOption","WixDataGetOptions","WixDataUpdateOptions","WixDataQueryOptions","WixDataDirectQueryOptions","WixDataQueryRequest","WixDataQuerySpec","WixDataItem","WixDataReference","WixDataBulkError","WixDataSaveOptions","WixDataAsyncByFilterOptions","WixDataAsyncJob","WixDataAsyncJobStatus","WixDataAsyncJobStatusValue","WixDataFilterInput","WixDataBulkUpdateOptions","WixDataBulkRemoveOptions","WixDataBulkInsertOptions","WixDataBulkSaveOptions","WixDataInsertOptions","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions","WixDataRemoveOptions","WixDataDistinctOptions","WixDataCountOptions","WixDataSearchRequest","WixDataDirectSearchOptions","_stages","stages","PipelineStage","WixDataAggregatePipelineStages","_FilterStage","FilterStage","_ProjectStage","ProjectStage","_GroupStage","GroupStage","_UnwindStage","UnwindStage","_SortStage","SortStage","_LimitStage","LimitStage","_SkipStage","SkipStage","_ObjectToArrayStage","ObjectToArrayStage","_PipelineBuilder","PipelineBuilder","pipelineBuilder","_WixDataQueryBuilder","QueryBuilder","Sort","Filter","WixDataQueryBuilder","_WixDataSearchBuilder","SearchBuilder","SearchParams","_expressions","expressions","WixDataAggregatePipelineExpressions","_Expression","FieldExpression","TextExpression","NumericExpression","AddExpression","SubtractExpression","MultiplyExpression","DivideExpression","SumExpression","AbsExpression","ModExpression","FloorExpression","CeilExpression","ConcatExpression","StringifyExpression","ToLowerExpression","ToUpperExpression","SubstringExpression","LengthExpression"],"sources":["../../../src/api/index.ts"],"sourcesContent":["export { WixDataQuery } from './WixDataQuery'\nexport { WixDataSearch } from './WixDataSearch'\nexport { WixDataApi } from './WixDataApi'\nexport { WixDataResult } from './WixDataResult'\nexport { QueryValidator } from './QueryValidator'\nexport { WixDataAggregate } from './WixDataAggregate'\nexport { QueryBase } from './QueryBase'\nexport {\n WixDataPatch,\n WixDataBulkPatch,\n WixDataPatchByFilter,\n WixDataPatchOptions,\n WixDataBulkPatchOptions,\n} from './WixDataPatch'\nexport {\n FieldModification,\n SetField,\n RemoveField,\n IncrementField,\n AppendToArray,\n RemoveFromArray,\n} from './FieldModification'\nexport {\n FieldModificationsBuilder,\n WixDataFieldModificationsBuilder,\n} from './WixDataFieldModificationsBuilder'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WithIncludeFieldGroupsOption,\n WixDataGetOptions,\n WixDataUpdateOptions,\n WixDataQueryOptions,\n WixDataDirectQueryOptions,\n WixDataQueryRequest,\n WixDataQuerySpec,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataSaveOptions,\n WixDataAsyncByFilterOptions,\n WixDataAsyncJob,\n WixDataAsyncJobStatus,\n WixDataAsyncJobStatusValue,\n WixDataFilterInput,\n WixDataBulkUpdateOptions,\n WixDataBulkRemoveOptions,\n WixDataBulkInsertOptions,\n WixDataBulkSaveOptions,\n WixDataInsertOptions,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n WixDataRemoveOptions,\n WixDataDistinctOptions,\n WixDataCountOptions,\n WixDataSearchRequest,\n WixDataDirectSearchOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\nexport {\n stages,\n PipelineStage,\n WixDataAggregatePipelineStages,\n} from './stages/stages'\nexport { FilterStage } from './stages/FilterStage'\nexport { ProjectStage } from './stages/ProjectStage'\nexport { GroupStage } from './stages/GroupStage'\nexport { UnwindStage } from './stages/UnwindStage'\nexport { SortStage } from './stages/SortStage'\nexport { LimitStage } from './stages/LimitStage'\nexport { SkipStage } from './stages/SkipStage'\nexport { ObjectToArrayStage } from './stages/ObjectToArrayStage'\nexport { PipelineBuilder, pipelineBuilder } from './PipelineBuilder'\nexport {\n QueryBuilder,\n Sort,\n Filter,\n WixDataQueryBuilder,\n} from './WixDataQueryBuilder'\nexport { SearchBuilder, SearchParams } from './WixDataSearchBuilder'\nexport {\n expressions,\n WixDataAggregatePipelineExpressions,\n} from './expressions/expressions'\nexport {\n FieldExpression,\n TextExpression,\n NumericExpression,\n AddExpression,\n SubtractExpression,\n MultiplyExpression,\n DivideExpression,\n SumExpression,\n AbsExpression,\n ModExpression,\n FloorExpression,\n CeilExpression,\n ConcatExpression,\n StringifyExpression,\n ToLowerExpression,\n ToUpperExpression,\n SubstringExpression,\n LengthExpression,\n} from './expressions/Expression'\n"],"mappings":";;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAA6CC,OAAA,CAAAC,YAAA,GAAAH,aAAA,CAAAG,YAAA;AAC7C,IAAAC,cAAA,GAAAH,OAAA;AAA+CC,OAAA,CAAAG,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAAAC,WAAA,GAAAL,OAAA;AAAyCC,OAAA,CAAAK,UA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AAAD,WAAA,CAAAC,eAAA;AAAApG,OAAA,CAAAqG,cAAA,GAAAF,WAAA,CAAAE,cAAA;AAAArG,OAAA,CAAAsG,iBAAA,GAAAH,WAAA,CAAAG,iBAAA;AAAAtG,OAAA,CAAAuG,aAAA,GAAAJ,WAAA,CAAAI,aAAA;AAAAvG,OAAA,CAAAwG,kBAAA,GAAAL,WAAA,CAAAK,kBAAA;AAAAxG,OAAA,CAAAyG,kBAAA,GAAAN,WAAA,CAAAM,kBAAA;AAAAzG,OAAA,CAAA0G,gBAAA,GAAAP,WAAA,CAAAO,gBAAA;AAAA1G,OAAA,CAAA2G,aAAA,GAAAR,WAAA,CAAAQ,aAAA;AAAA3G,OAAA,CAAA4G,aAAA,GAAAT,WAAA,CAAAS,aAAA;AAAA5G,OAAA,CAAA6G,aAAA,GAAAV,WAAA,CAAAU,aAAA;AAAA7G,OAAA,CAAA8G,eAAA,GAAAX,WAAA,CAAAW,eAAA;AAAA9G,OAAA,CAAA+G,cAAA,GAAAZ,WAAA,CAAAY,cAAA;AAAA/G,OAAA,CAAAgH,gBAAA,GAAAb,WAAA,CAAAa,gBAAA;AAAAhH,OAAA,CAAAiH,mBAAA,GAAAd,WAAA,CAAAc,mBAAA;AAAAjH,OAAA,CAAAkH,iBAAA,GAAAf,WAAA,CAAAe,iBAAA;AAAAlH,OAAA,CAAAmH,iBAAA,GAAAhB,WAAA,CAAAgB,iBAAA;AAAAnH,OAAA,CAAAoH,mBAAA,GAAAjB,WAAA,CAAAiB,mBAAA;AAAApH,OAAA,CAAAqH,gBAAA,GAAAlB,WAAA,CAAAkB,gBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["import type { QueryRequest as SDKQueryRequest, QuerySpec } from '@wix/sdk-types'\nimport type { SortOrder } from '../types/data-item-types'\nimport { WixDataFilter } from './WixDataFilter'\n\nexport interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\n/**\n * Options for including referenced items in results.\n */\nexport interface IncludeReferencesOptions {\n /**\n * Reference fields to resolve in the results. When specified, the referenced items\n * are included in the response for the given fields.\n *\n * Each entry identifies a reference `field` by name and an optional `limit` that caps the number\n * of referenced items returned per queried item (relevant for multi-reference fields).\n */\n includeReferences?: { field: string; limit?: number }[]\n}\n\nexport interface WixDataRemoveOptions extends WixDataOptions {\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkPatchOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be patched.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and eventual consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\n/**\n * Options for standalone count queries.\n * @internal\n */\nexport interface WixDataCountOptions extends WixDataReadOptions {\n filter?: Record<string, any>\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions,\n IncludeReferencesOptions {}\n\nexport interface WithIncludeFieldGroupsOption {\n /**\n * Requests conditional fields. Currently used in App Collections.\n * Please refer to app collection documentation for a list of valid values.\n */\n includeFieldGroups?: string[]\n}\n\nexport interface WixDataGetOptions\n extends WixDataReadWithProjectionOptions,\n WithIncludeFieldGroupsOption {}\n\nexport interface WixDataSaveOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataInsertOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkUpdateOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n /**\n * If provided, only items matching condition will be updated.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkInsertOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataBulkSaveOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataBulkRemoveOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be removed.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataAsyncByFilterOptions extends BaseOptions {}\n\nexport type WixDataFilterInput = WixDataFilter | Record<string, any>\n\nexport interface WixDataAsyncJob {\n /** Job ID for tracking the async operation. */\n jobId: string\n}\n\nexport type WixDataAsyncJobStatusValue =\n | 'UNKNOWN_STATUS'\n | 'INITIALIZED'\n | 'PROCESSING'\n | 'SUCCEEDED'\n | 'FAILED'\n\nexport interface WixDataAsyncJobStatus {\n /** Current status of the async operation. */\n status?: WixDataAsyncJobStatusValue\n /** Number of items successfully processed so far. */\n successCount?: number\n}\n\nexport interface WixDataPatchOptions extends BaseOptions {\n /**\n * If provided, item will be patched only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataAggregateOptions extends WixDataQueryOptions {}\n\n/**\n * Options for standalone distinct field value queries.\n * @internal\n */\nexport interface WixDataDistinctOptions extends WixDataQueryOptions {\n filter?: Record<string, any>\n order?: SortOrder\n paging?: { limit?: number; offset?: number }\n cursorPaging?: { cursor?: string; limit?: number }\n}\n\n/**\n * WixData query specification.\n * Since WixData collections are dynamic, we allow any string field.\n * @internal\n */\nexport interface WixDataQuerySpec extends QuerySpec {\n wql: [\n {\n fields: string[]\n sort: 'BOTH'\n }\n ]\n paging: 'offset'\n}\n\n/**\n * Request object for direct query execution.\n * Extends the SDK's QueryRequest with WixData-specific fields.\n * Use this with `wixData.query(collectionName, queryRequest)` for one-shot queries.\n * @internal\n */\nexport interface WixDataQueryRequest\n extends Omit<SDKQueryRequest<WixDataItem, WixDataQuerySpec>, 'filter'> {\n /**\n * Filter object. Supports operators like `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`,\n * `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * Example:\n * ```js\n * { status: 'active', age: { $gt: 25 } }\n * ```\n */\n filter?: Record<string, any>\n\n /**\n * Cursor-based paging. Use this as an alternative to offset paging.\n *\n * Example:\n * ```js\n * { limit: 10, cursor: 'abc123' }\n * ```\n */\n cursorPaging?: {\n /** Maximum number of items to return. */\n limit?: number\n /** Cursor token pointing to a page of results. */\n cursor?: string\n }\n}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query results include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\n/**\n * Options for direct query execution.\n * @internal\n */\nexport interface WixDataDirectQueryOptions\n extends WixDataQueryOptions,\n IncludeReferencesOptions {\n /**\n * Requests conditional fields. Currently used in App Collections.\n * Please refer to app collection documentation for a list of valid values.\n */\n includeFieldGroups?: string[]\n}\n\n/**\n * Request object for direct search execution.\n * Matches the shape produced by `SearchBuilder().build()` so it can be passed directly.\n * Use this with `wixData.search(collectionName, searchRequest)` for direct search execution.\n * @internal\n */\nexport interface WixDataSearchRequest {\n /** Search parameters. */\n search?: {\n /** Search text expression. */\n expression?: string | null\n /** Whether to enable fuzzy matching. */\n fuzzy?: boolean | null\n /** Search mode: 'OR' (any term) or 'AND' (all terms). */\n mode?: 'OR' | 'AND' | null\n }\n /** Filter object. */\n filter?: Record<string, any>\n /** Sort array. */\n sort?: { fieldName: string; order?: 'ASC' | 'DESC' }[]\n /** Fields to return in results. */\n fields?: string[]\n /** Paging options. */\n paging?: { limit?: number; offset?: number }\n /** Cursor-based paging. */\n cursorPaging?: { cursor?: string; limit?: number }\n}\n\n/**\n * Options for direct search execution.\n * @internal\n */\nexport interface WixDataDirectSearchOptions\n extends WixDataReadOptions,\n IncludeReferencesOptions {}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `asc`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n skip?: number\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n * @readonly\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n * @readonly\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["import type { QueryRequest as SDKQueryRequest, QuerySpec } from '@wix/sdk-types'\nimport type { SortOrder } from '../types/data-item-types'\nimport { WixDataFilter } from './WixDataFilter'\n\nexport interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\n/**\n * Options for including referenced items in results.\n */\nexport interface IncludeReferencesOptions {\n /**\n * Reference fields to resolve in the results. When specified, the referenced items\n * are included in the response for the given fields.\n *\n * Each entry identifies a reference `field` by name and an optional `limit` that caps the number\n * of referenced items returned per queried item (relevant for multi-reference fields).\n */\n includeReferences?: { field: string; limit?: number }[]\n}\n\nexport interface WixDataRemoveOptions extends WixDataOptions {\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and eventual consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\n/**\n * Options for standalone count queries.\n * @internal\n */\nexport interface WixDataCountOptions extends WixDataReadOptions {\n filter?: Record<string, any>\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions,\n IncludeReferencesOptions {}\n\nexport interface WithIncludeFieldGroupsOption {\n /**\n * Requests conditional fields. Currently used in App Collections.\n * Please refer to app collection documentation for a list of valid values.\n */\n includeFieldGroups?: string[]\n}\n\nexport interface WixDataGetOptions\n extends WixDataReadWithProjectionOptions,\n WithIncludeFieldGroupsOption {}\n\nexport interface WixDataSaveOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataInsertOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /** Whether to save references from the data item to other items in the collection. */\n saveReferences?: boolean\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkUpdateOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n /**\n * If provided, only items matching condition will be updated.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkInsertOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataBulkSaveOptions extends WixDataOptions {\n /** Whether to save references from the data items to other items in the collection. */\n saveReferences?: boolean\n}\n\nexport interface WixDataBulkRemoveOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be removed.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataAsyncByFilterOptions extends BaseOptions {}\n\nexport type WixDataFilterInput = WixDataFilter | Record<string, any>\n\nexport interface WixDataAsyncJob {\n /** Job ID for tracking the async operation. */\n jobId: string\n}\n\nexport type WixDataAsyncJobStatusValue =\n | 'UNKNOWN_STATUS'\n | 'INITIALIZED'\n | 'PROCESSING'\n | 'SUCCEEDED'\n | 'FAILED'\n\nexport interface WixDataAsyncJobStatus {\n /** Current status of the async operation. */\n status?: WixDataAsyncJobStatusValue\n /** Number of items successfully processed so far. */\n successCount?: number\n}\n\nexport interface WixDataAggregateOptions extends WixDataQueryOptions {}\n\n/**\n * Options for standalone distinct field value queries.\n * @internal\n */\nexport interface WixDataDistinctOptions extends WixDataQueryOptions {\n filter?: Record<string, any>\n order?: SortOrder\n paging?: { limit?: number; offset?: number }\n cursorPaging?: { cursor?: string; limit?: number }\n}\n\n/**\n * WixData query specification.\n * Since WixData collections are dynamic, we allow any string field.\n * @internal\n */\nexport interface WixDataQuerySpec extends QuerySpec {\n wql: [\n {\n fields: string[]\n sort: 'BOTH'\n }\n ]\n paging: 'offset'\n}\n\n/**\n * Request object for direct query execution.\n * Extends the SDK's QueryRequest with WixData-specific fields.\n * Use this with `wixData.query(collectionName, queryRequest)` for one-shot queries.\n * @internal\n */\nexport interface WixDataQueryRequest\n extends Omit<SDKQueryRequest<WixDataItem, WixDataQuerySpec>, 'filter'> {\n /**\n * Filter object. Supports operators like `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`,\n * `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * Example:\n * ```js\n * { status: 'active', age: { $gt: 25 } }\n * ```\n */\n filter?: Record<string, any>\n\n /**\n * Cursor-based paging. Use this as an alternative to offset paging.\n *\n * Example:\n * ```js\n * { limit: 10, cursor: 'abc123' }\n * ```\n */\n cursorPaging?: {\n /** Maximum number of items to return. */\n limit?: number\n /** Cursor token pointing to a page of results. */\n cursor?: string\n }\n}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query results include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\n/**\n * Options for direct query execution.\n * @internal\n */\nexport interface WixDataDirectQueryOptions\n extends WixDataQueryOptions,\n IncludeReferencesOptions {\n /**\n * Requests conditional fields. Currently used in App Collections.\n * Please refer to app collection documentation for a list of valid values.\n */\n includeFieldGroups?: string[]\n}\n\n/**\n * Request object for direct search execution.\n * Matches the shape produced by `SearchBuilder().build()` so it can be passed directly.\n * Use this with `wixData.search(collectionName, searchRequest)` for direct search execution.\n * @internal\n */\nexport interface WixDataSearchRequest {\n /** Search parameters. */\n search?: {\n /** Search text expression. */\n expression?: string | null\n /** Whether to enable fuzzy matching. */\n fuzzy?: boolean | null\n /** Search mode: 'OR' (any term) or 'AND' (all terms). */\n mode?: 'OR' | 'AND' | null\n }\n /** Filter object. */\n filter?: Record<string, any>\n /** Sort array. */\n sort?: { fieldName: string; order?: 'ASC' | 'DESC' }[]\n /** Fields to return in results. */\n fields?: string[]\n /** Paging options. */\n paging?: { limit?: number; offset?: number }\n /** Cursor-based paging. */\n cursorPaging?: { cursor?: string; limit?: number }\n}\n\n/**\n * Options for direct search execution.\n * @internal\n */\nexport interface WixDataDirectSearchOptions\n extends WixDataReadOptions,\n IncludeReferencesOptions {}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `asc`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n skip?: number\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n * @readonly\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n * @readonly\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_sortMixin","_interopRequireDefault","require","exports","sortMixin","default","_filterBuilder","optimiseQuery","wixDataEncoder","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","_filter","_errors","_api","_types"],"sources":["../../src/index.ts"],"sourcesContent":["import sortMixin from './sort/sortMixin'\n\nexport { sortMixin }\nexport { optimiseQuery, wixDataEncoder } from '@wix/filter-builder'\nexport * from './utils'\nexport * from './filter'\nexport * from './errors'\nexport * from './api'\nexport * from './types'\nexport type { FilterTree } from './filter'\nexport type { HttpApiClientFactory, RequestInterceptor } from './types'\nexport type { WixDataItemOrId } from './api'\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwCC,OAAA,CAAAC,SAAA,GAAAJ,UAAA,CAAAK,OAAA;AAGxC,IAAAC,cAAA,GAAAJ,OAAA;AAAmEC,OAAA,CAAAI,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAAAJ,OAAA,CAAAK,cAAA,GAAAF,cAAA,CAAAE,cAAA;AACnE,IAAAC,MAAA,GAAAP,OAAA;AAAAQ,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,G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P,GAAA;AAAA;AACA,IAAAQ,MAAA,GAAAnB,OAAA;AAAAQ,MAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAV,OAAA,IAAAA,OAAA,CAAAU,GAAA,MAAAQ,MAAA,CAAAR,GAAA;EAAAV,OAAA,CAAAU,GAAA,IAAAQ,MAAA,CAAAR,GAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_sortMixin","_interopRequireDefault","require","exports","sortMixin","default","_filterBuilder","optimiseQuery","wixDataEncoder","_utils","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","_filter","_errors","_api","_types"],"sources":["../../src/index.ts"],"sourcesContent":["import sortMixin from './sort/sortMixin'\n\nexport { sortMixin }\nexport { optimiseQuery, wixDataEncoder } from '@wix/filter-builder'\nexport * from './utils'\nexport * from './filter'\nexport * from './errors'\nexport * from './api'\nexport * from './types'\nexport type { FieldModification } from './api/FieldModification'\nexport type { FilterTree } from './filter'\nexport type { HttpApiClientFactory, RequestInterceptor } from './types'\nexport type { WixDataItemOrId } from './api'\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwCC,OAAA,CAAAC,SAAA,GAAAJ,UAAA,CAAAK,OAAA;AAGxC,IAAAC,cAAA,GAAAJ,OAAA;AAAmEC,OAAA,CAAAI,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAAAJ,OAAA,CAAAK,cAAA,GAAAF,cAAA,CAAAE,cAAA;AACnE,IAAAC,MAAA,GAAAP,OAAA;AAAAQ,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,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AAA,CAAAP,GAAA;EAAAV,OAAA,CAAAU,GAAA,IAAAO,IAAA,CAAAP,GAAA;AAAA;AACA,IAAAQ,MAAA,GAAAnB,OAAA;AAAAQ,MAAA,CAAAC,IAAA,CAAAU,MAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAV,OAAA,IAAAA,OAAA,CAAAU,GAAA,MAAAQ,MAAA,CAAAR,GAAA;EAAAV,OAAA,CAAAU,GAAA,IAAAQ,MAAA,CAAAR,GAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=FieldModification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldModification.js","sourceRoot":"","sources":["../../../src/api/FieldModification.ts"],"names":[],"mappings":""}