@wix/wix-data-items-common 1.0.174 → 1.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/PipelineValidator.js +26 -0
- package/dist/cjs/api/PipelineValidator.js.map +1 -0
- package/dist/cjs/api/WixDataAggregatePipeline.js +4 -0
- package/dist/cjs/api/WixDataAggregatePipeline.js.map +1 -0
- package/dist/cjs/api/WixDataApi.js +4 -0
- package/dist/cjs/api/WixDataApi.js.map +1 -1
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js +96 -0
- package/dist/cjs/api/impl/WixDataAggregatePipelineImpl.js.map +1 -0
- package/dist/cjs/api/index.js +6 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/stages/LimitStage.js +16 -0
- package/dist/cjs/api/stages/LimitStage.js.map +1 -0
- package/dist/cjs/api/stages/SkipStage.js +16 -0
- package/dist/cjs/api/stages/SkipStage.js.map +1 -0
- package/dist/cjs/api/stages/SortStage.js +40 -0
- package/dist/cjs/api/stages/SortStage.js.map +1 -0
- package/dist/cjs/api/stages/stages.js +13 -0
- package/dist/cjs/api/stages/stages.js.map +1 -0
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/PipelineValidator.js +18 -0
- package/dist/esm/api/PipelineValidator.js.map +1 -0
- package/dist/esm/api/WixDataAggregatePipeline.js +2 -0
- package/dist/esm/api/WixDataAggregatePipeline.js.map +1 -0
- package/dist/esm/api/WixDataApi.js +4 -0
- package/dist/esm/api/WixDataApi.js.map +1 -1
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js +76 -0
- package/dist/esm/api/impl/WixDataAggregatePipelineImpl.js.map +1 -0
- package/dist/esm/api/index.js +1 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/api/stages/LimitStage.js +9 -0
- package/dist/esm/api/stages/LimitStage.js.map +1 -0
- package/dist/esm/api/stages/SkipStage.js +9 -0
- package/dist/esm/api/stages/SkipStage.js.map +1 -0
- package/dist/esm/api/stages/SortStage.js +22 -0
- package/dist/esm/api/stages/SortStage.js.map +1 -0
- package/dist/esm/api/stages/stages.js +9 -0
- package/dist/esm/api/stages/stages.js.map +1 -0
- package/dist/types/api/PipelineValidator.d.ts +9 -0
- package/dist/types/api/PipelineValidator.d.ts.map +1 -0
- package/dist/types/api/WixDataAggregatePipeline.d.ts +59 -0
- package/dist/types/api/WixDataAggregatePipeline.d.ts.map +1 -0
- package/dist/types/api/WixDataApi.d.ts +3 -0
- package/dist/types/api/WixDataApi.d.ts.map +1 -1
- package/dist/types/api/impl/WixDataAggregatePipelineImpl.d.ts +21 -0
- package/dist/types/api/impl/WixDataAggregatePipelineImpl.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/stages/LimitStage.d.ts +8 -0
- package/dist/types/api/stages/LimitStage.d.ts.map +1 -0
- package/dist/types/api/stages/SkipStage.d.ts +8 -0
- package/dist/types/api/stages/SkipStage.d.ts.map +1 -0
- package/dist/types/api/stages/SortStage.d.ts +9 -0
- package/dist/types/api/stages/SortStage.d.ts.map +1 -0
- package/dist/types/api/stages/stages.d.ts +13 -0
- package/dist/types/api/stages/stages.d.ts.map +1 -0
- package/dist/types/types/data-item-types.d.ts +3 -7
- package/dist/types/types/data-item-types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -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","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WixDataUpdateOptions","WixDataPatchOptions","WixDataQueryOptions","WixDataItem","WixDataReference","WixDataBulkError","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions"],"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 { WixDataPatch, WixDataBulkPatch } from './WixDataPatch'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataPatchOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\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,IAAAC,eAAA,GAAAT,OAAA;AAAiDC,OAAA,CAAAS,cAAA,GAAAD,eAAA,CAAAC,cAAA;AACjD,IAAAC,iBAAA,GAAAX,OAAA;AAAqDC,OAAA,CAAAW,gBAAA,GAAAD,iBAAA,CAAAC,gBAAA;AACrD,IAAAC,
|
|
1
|
+
{"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_WixDataSearch","WixDataSearch","_WixDataApi","WixDataApi","_WixDataResult","WixDataResult","_QueryValidator","QueryValidator","_WixDataAggregate","WixDataAggregate","_WixDataAggregatePipeline","WixDataAggregatePipeline","_QueryBase","QueryBase","_WixDataPatch","WixDataPatch","WixDataBulkPatch","_WixDataFilter","WixDataFilter","_types","WixDataOptions","WixDataReadOptions","WixDataReadWithProjectionOptions","WixDataUpdateOptions","WixDataPatchOptions","WixDataQueryOptions","WixDataItem","WixDataReference","WixDataBulkError","WixDataBulkResult","WixDataQueryReferencedOptions","WixDataAggregateOptions","_stages","stages","PipelineStage"],"sources":["../../../src/api/index.ts"],"sourcesContent":["export { WixDataQuery } from './WixDataQuery'\nexport { WixDataSearch } from './WixDataSearch'\nexport { WixDataApi } from './WixDataApi'\nexport { WixDataResult } from './WixDataResult'\nexport { QueryValidator } from './QueryValidator'\nexport { WixDataAggregate } from './WixDataAggregate'\nexport { WixDataAggregatePipeline } from './WixDataAggregatePipeline'\nexport { QueryBase } from './QueryBase'\nexport { WixDataPatch, WixDataBulkPatch } from './WixDataPatch'\nexport { WixDataFilter } from './WixDataFilter'\nexport {\n WixDataOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataUpdateOptions,\n WixDataPatchOptions,\n WixDataQueryOptions,\n WixDataItem,\n WixDataReference,\n WixDataBulkError,\n WixDataBulkResult,\n WixDataQueryReferencedOptions,\n WixDataAggregateOptions,\n} from './types'\nexport type { WixDataItemOrId } from './types'\nexport { stages, PipelineStage } from './stages/stages'\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,IAAAC,eAAA,GAAAT,OAAA;AAAiDC,OAAA,CAAAS,cAAA,GAAAD,eAAA,CAAAC,cAAA;AACjD,IAAAC,iBAAA,GAAAX,OAAA;AAAqDC,OAAA,CAAAW,gBAAA,GAAAD,iBAAA,CAAAC,gBAAA;AACrD,IAAAC,yBAAA,GAAAb,OAAA;AAAqEC,OAAA,CAAAa,wBAAA,GAAAD,yBAAA,CAAAC,wBAAA;AACrE,IAAAC,UAAA,GAAAf,OAAA;AAAuCC,OAAA,CAAAe,SAAA,GAAAD,UAAA,CAAAC,SAAA;AACvC,IAAAC,aAAA,GAAAjB,OAAA;AAA+DC,OAAA,CAAAiB,YAAA,GAAAD,aAAA,CAAAC,YAAA;AAAAjB,OAAA,CAAAkB,gBAAA,GAAAF,aAAA,CAAAE,gBAAA;AAC/D,IAAAC,cAAA,GAAApB,OAAA;AAA+CC,OAAA,CAAAoB,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAAAC,MAAA,GAAAtB,OAAA;AAagBC,OAAA,CAAAsB,cAAA,GAAAD,MAAA,CAAAC,cAAA;AAAAtB,OAAA,CAAAuB,kBAAA,GAAAF,MAAA,CAAAE,kBAAA;AAAAvB,OAAA,CAAAwB,gCAAA,GAAAH,MAAA,CAAAG,gCAAA;AAAAxB,OAAA,CAAAyB,oBAAA,GAAAJ,MAAA,CAAAI,oBAAA;AAAAzB,OAAA,CAAA0B,mBAAA,GAAAL,MAAA,CAAAK,mBAAA;AAAA1B,OAAA,CAAA2B,mBAAA,GAAAN,MAAA,CAAAM,mBAAA;AAAA3B,OAAA,CAAA4B,WAAA,GAAAP,MAAA,CAAAO,WAAA;AAAA5B,OAAA,CAAA6B,gBAAA,GAAAR,MAAA,CAAAQ,gBAAA;AAAA7B,OAAA,CAAA8B,gBAAA,GAAAT,MAAA,CAAAS,gBAAA;AAAA9B,OAAA,CAAA+B,iBAAA,GAAAV,MAAA,CAAAU,iBAAA;AAAA/B,OAAA,CAAAgC,6BAAA,GAAAX,MAAA,CAAAW,6BAAA;AAAAhC,OAAA,CAAAiC,uBAAA,GAAAZ,MAAA,CAAAY,uBAAA;AAEhB,IAAAC,OAAA,GAAAnC,OAAA;AAAuDC,OAAA,CAAAmC,MAAA,GAAAD,OAAA,CAAAC,MAAA;AAAAnC,OAAA,CAAAoC,aAAA,GAAAF,OAAA,CAAAE,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.LimitStage = void 0;
|
|
5
|
+
class LimitStage {
|
|
6
|
+
constructor(count) {
|
|
7
|
+
this.count = count;
|
|
8
|
+
}
|
|
9
|
+
toProto() {
|
|
10
|
+
return {
|
|
11
|
+
limit: this.count
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.LimitStage = LimitStage;
|
|
16
|
+
//# sourceMappingURL=LimitStage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LimitStage","constructor","count","toProto","limit","exports"],"sources":["../../../../src/api/stages/LimitStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\nexport class LimitStage implements PipelineStage {\n constructor(private count: number) {}\n\n toProto(): apiTypes.Stage {\n return { limit: this.count }\n }\n}\n"],"mappings":";;;;AAGO,MAAMA,UAAU,CAA0B;EAC/CC,WAAWA,CAASC,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EAEpCC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,KAAK,EAAE,IAAI,CAACF;IAAM,CAAC;EAC9B;AACF;AAACG,OAAA,CAAAL,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.SkipStage = void 0;
|
|
5
|
+
class SkipStage {
|
|
6
|
+
constructor(count) {
|
|
7
|
+
this.count = count;
|
|
8
|
+
}
|
|
9
|
+
toProto() {
|
|
10
|
+
return {
|
|
11
|
+
skip: this.count
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.SkipStage = SkipStage;
|
|
16
|
+
//# sourceMappingURL=SkipStage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SkipStage","constructor","count","toProto","skip","exports"],"sources":["../../../../src/api/stages/SkipStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\nexport class SkipStage implements PipelineStage {\n constructor(private count: number) {}\n\n toProto(): apiTypes.Stage {\n return { skip: this.count }\n }\n}\n"],"mappings":";;;;AAGO,MAAMA,SAAS,CAA0B;EAC9CC,WAAWA,CAASC,KAAa,EAAE;IAAA,KAAfA,KAAa,GAAbA,KAAa;EAAG;EAEpCC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,IAAI,EAAE,IAAI,CAACF;IAAM,CAAC;EAC7B;AACF;AAACG,OAAA,CAAAL,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.SortStage = void 0;
|
|
6
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
|
+
var apiTypes = _interopRequireWildcard(require("../../types/data-item-types"));
|
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
|
+
class SortStage {
|
|
10
|
+
constructor() {
|
|
11
|
+
(0, _defineProperty2.default)(this, "sortFields", []);
|
|
12
|
+
}
|
|
13
|
+
ascending(...fields) {
|
|
14
|
+
fields.forEach(field => {
|
|
15
|
+
this.sortFields.push({
|
|
16
|
+
fieldName: field,
|
|
17
|
+
order: apiTypes.SortOrder.ASC
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
descending(...fields) {
|
|
23
|
+
fields.forEach(field => {
|
|
24
|
+
this.sortFields.push({
|
|
25
|
+
fieldName: field,
|
|
26
|
+
order: apiTypes.SortOrder.DESC
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
toProto() {
|
|
32
|
+
return {
|
|
33
|
+
sort: {
|
|
34
|
+
values: this.sortFields
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.SortStage = SortStage;
|
|
40
|
+
//# sourceMappingURL=SortStage.js.map
|
|
@@ -0,0 +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","SortStage","constructor","_defineProperty2","ascending","fields","forEach","field","sortFields","push","fieldName","order","SortOrder","ASC","descending","DESC","toProto","sort","values","exports"],"sources":["../../../../src/api/stages/SortStage.ts"],"sourcesContent":["import { PipelineStage } from './stages'\nimport * as apiTypes from '../../types/data-item-types'\n\nexport class SortStage implements PipelineStage {\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 toProto(): 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;AAEhD,MAAMkB,SAAS,CAA0B;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;EAEAC,OAAOA,CAAA,EAAmB;IACxB,OAAO;MAAEC,IAAI,EAAE;QAAEC,MAAM,EAAE,IAAI,CAACV;MAAW;IAAE,CAAC;EAC9C;AACF;AAACW,OAAA,CAAAlB,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.stages = void 0;
|
|
5
|
+
var _SortStage = require("./SortStage");
|
|
6
|
+
var _LimitStage = require("./LimitStage");
|
|
7
|
+
var _SkipStage = require("./SkipStage");
|
|
8
|
+
const stages = exports.stages = {
|
|
9
|
+
sort: () => new _SortStage.SortStage(),
|
|
10
|
+
limit: count => new _LimitStage.LimitStage(count),
|
|
11
|
+
skip: count => new _SkipStage.SkipStage(count)
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=stages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_SortStage","require","_LimitStage","_SkipStage","stages","exports","sort","SortStage","limit","count","LimitStage","skip","SkipStage"],"sources":["../../../../src/api/stages/stages.ts"],"sourcesContent":["import { SortStage } from './SortStage'\nimport { LimitStage } from './LimitStage'\nimport { SkipStage } from './SkipStage'\nimport * as apiTypes from '../../types/data-item-types'\n\nexport const stages = {\n sort: () => new SortStage(),\n limit: (count: number) => new LimitStage(count),\n skip: (count: number) => new SkipStage(count),\n}\n\nexport interface PipelineStage {\n toProto(): apiTypes.Stage\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBE,IAAI,EAAEA,CAAA,KAAM,IAAIC,oBAAS,CAAC,CAAC;EAC3BC,KAAK,EAAGC,KAAa,IAAK,IAAIC,sBAAU,CAACD,KAAK,CAAC;EAC/CE,IAAI,EAAGF,KAAa,IAAK,IAAIG,oBAAS,CAACH,KAAK;AAC9C,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Environment","exports","ACTION","BulkActionType","Action","SortOrder","Mode"],"sources":["../../../src/types/data-item-types.ts"],"sourcesContent":["export interface DataItem {\n /** Data item ID. */\n id?: string\n /**\n * ID of the collection to which this item belongs.\n * @readonly\n */\n dataCollectionId?: string\n /**\n * Data item contents.\n *\n * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:\n *\n * + `_id`: Item ID.\n * + `_createdDate`: Date and time the item was added to the collection.\n * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.\n * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.\n */\n data?: Record<string, any> | null\n}\n\nexport interface InsertDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the item. */\n dataCollectionId: string\n /** Item to insert. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport enum Environment {\n LIVE = 'LIVE',\n SANDBOX = 'SANDBOX',\n SANDBOX_PREFERRED = 'SANDBOX_PREFERRED',\n}\n\nexport interface Options {\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: PublishPluginOptions\n}\n\nexport interface PublishPluginOptions {\n showDraftItems?: boolean\n}\n\nexport interface InsertDataItemResponse {\n /** Inserted data item. */\n dataItem?: DataItem\n}\n\nexport interface PatchDataItemRequest {\n /**\n * [Collection environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing) from which to delete item.\n *\n * Default: `LIVE`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection that contains the item to patch. */\n dataCollectionId: string\n /** Patch to apply to the item. */\n patch: Patch\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface Patch {\n /** ID of the item to patch. */\n dataItemId?: string\n /** Modifications to apply. */\n fieldModifications?: FieldModification[]\n}\n\nexport interface FieldModification extends FieldModificationActionOptionsOneOf {\n setFieldOptions?: SetFieldOptions\n incrementFieldOptions?: IncrementFieldOptions\n appendToArrayOptions?: AppendToArrayOptions\n removeFromArrayOptions?: RemoveFromArrayOptions\n /**\n * Path of the field ID to be modified. For example: `title`.\n *\n * Nested fields can be specified using dot notation. For example: `address.street`.\n */\n fieldPath?: string\n /** Patch action to be applied to the specified field. */\n action?: ACTION\n}\n\n/** @oneof */\nexport interface FieldModificationActionOptionsOneOf {\n setFieldOptions?: SetFieldOptions\n incrementFieldOptions?: IncrementFieldOptions\n appendToArrayOptions?: AppendToArrayOptions\n removeFromArrayOptions?: RemoveFromArrayOptions\n}\n\nexport enum ACTION {\n UNKNOWN_ACTION = 'UNKNOWN_ACTION',\n SET_FIELD = 'SET_FIELD',\n REMOVE_FIELD = 'REMOVE_FIELD',\n INCREMENT_FIELD = 'INCREMENT_FIELD',\n APPEND_TO_ARRAY = 'APPEND_TO_ARRAY',\n REMOVE_FROM_ARRAY = 'REMOVE_FROM_ARRAY',\n}\n\nexport interface SetFieldOptions {\n /**\n * Value to set for the specified field. This replaces the existing value.\n */\n value?: any\n}\n\nexport interface IncrementFieldOptions {\n /**\n * Numerical value by which to increment or decrement the current field value.\n */\n value?: number\n}\n\nexport interface AppendToArrayOptions {\n /**\n * Value to append to the specified array.\n */\n value?: any\n}\n\nexport interface RemoveFromArrayOptions {\n /**\n * Value to remove from the specified array.\n */\n value?: any\n}\n\nexport interface DataPublishPluginOptions {\n /**\n * Whether to include draft items.\n *\n * When `true`, the task deletes both published and draft items. Default: `false`.\n */\n includeDraftItems?: boolean\n}\n\nexport interface PatchDataItemResponse {\n /** Patched data item. */\n dataItem?: DataItem\n}\n\nexport interface BulkPatchDataItemsRequest {\n /**\n * [Collection environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing) from which to delete item.\n *\n * Default: `LIVE`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection that contains the items to patch. */\n dataCollectionId: string\n /** Patches to apply to the items. */\n patches: Patch[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Whether to return the updated data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Prevents hooks from running for the operation. Can only be used in the backend code of a Wix site.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkPatchDataItemsResponse {\n /** Information about the updated items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkDataItemResult {\n /** The action attempted for the data item. */\n action?: BulkActionType\n /** Metadata related to the data item for which the action was attempted. */\n itemMetadata?: ItemMetadata\n /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */\n dataItem?: DataItem\n}\n\nexport enum BulkActionType {\n UNKNOWN_ACTION_TYPE = 'UNKNOWN_ACTION_TYPE',\n INSERT = 'INSERT',\n UPDATE = 'UPDATE',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport interface ItemMetadata {\n /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */\n id?: string | null\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean\n /** Details about the error in case of failure. */\n error?: ApplicationError\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string\n /** Description of the error. */\n description?: string\n /** Data related to the error. */\n data?: Record<string, any> | null\n}\n\nexport interface BulkActionMetadata {\n /** Number of items successfully processed. */\n totalSuccesses?: number\n /** Number of items that couldn't be processed. */\n totalFailures?: number\n}\n\nexport interface UpdateDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the existing item. */\n dataCollectionId: string\n /** Updated data item content. The existing data item's content is replaced entirely. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface UpdateDataItemResponse {\n /** Updated data item. */\n dataItem?: DataItem\n}\n\nexport interface SaveDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert or update the item. */\n dataCollectionId: string\n /** Data item to insert or update. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface SaveDataItemResponse {\n /**\n * Action carried out for the item.\n *\n * + `INSERTED`: A new item was added to the collection.\n * + `UPDATED`: An existing item in the collection was updated.\n */\n action?: Action\n /** Inserted or updated data item. */\n dataItem?: DataItem\n}\n\nexport enum Action {\n UNKNOWN_ACTION = 'UNKNOWN_ACTION',\n INSERTED = 'INSERTED',\n UPDATED = 'UPDATED',\n}\n\nexport interface GetDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to retrieve the data item. */\n dataCollectionId: string\n /** ID of the data item to retrieve. */\n dataItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n *\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface GetDataItemResponse {\n /** Retrieved item. */\n dataItem?: DataItem\n}\n\nexport interface RemoveDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to remove the item. */\n dataCollectionId: string\n /** ID of the item to remove. */\n dataItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface RemoveDataItemResponse {\n /** Removed item. */\n dataItem?: DataItem\n}\n\nexport interface TruncateDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to truncate. */\n dataCollectionId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n}\n\nexport interface TruncateDataItemsResponse {}\n\nexport interface QueryDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to query. */\n dataCollectionId: string\n /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */\n query?: QueryV2\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Properties for which to include referenced items in the query's results.\n * Up to 50 referenced items can be included for each item that matches the query.\n * @deprecated\n * @replacedBy referenced_item_options\n * @removalDate 2025-08-01\n */\n includeReferencedItems?: string[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Request information about this collection caching\n * @internal\n */\n requestCachingInfo?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n /** Options for retrieving referenced items. */\n referencedItemOptions?: ReferencedItemOptions[]\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[]\n /**\n * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string\n /** Sort order. */\n order?: SortOrder\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null\n /** Number of items to skip in the current sort order. */\n offset?: number | null\n}\n\nexport interface CursorPaging {\n /** Number of items to load. */\n limit?: number | null\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null\n}\n\nexport interface ReferencedItemOptions {\n /** Field containing references in the queried item. */\n fieldName?: string\n /** Maximum number of referenced items to include for each queried item. */\n limit?: number | null\n}\n\nexport interface QueryDataItemsResponse {\n /** Retrieved items. */\n dataItems?: DataItem[]\n /**\n * Caching info. Returned if `request_caching_info` is true in the request and caching is allowed.\n * @internal\n */\n cachingInfo?: CachingInfo\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface CachingInfo {\n /** Caching tags for this collection */\n tags?: string[]\n /** max caching time if set */\n maxAge?: number | null\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null\n /** Offset that was requested. */\n offset?: number | null\n /** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */\n total?: number | null\n /** Whether the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n * @internal\n */\n hasNext?: boolean | null\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null\n}\n\nexport interface AggregateDataItemsRequest\n extends AggregateDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection on which to run the aggregation. */\n dataCollectionId: string\n /**\n * Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n initialFilter?: Record<string, any> | null\n /** Aggregation applied to the data. */\n aggregation?: Aggregation\n /**\n * Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n finalFilter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[]\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface AggregateDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Average {\n /** Name of the field for which to calculate the average value. */\n itemFieldName?: string\n}\n\nexport interface Min {\n /** Name of the field for which to calculate the minimum value. */\n itemFieldName?: string\n}\n\nexport interface Max {\n /** Name of the field for which to calculate the maximum value. */\n itemFieldName?: string\n}\n\nexport interface Sum {\n /** Name of the field for which to calculate the sum. */\n itemFieldName?: string\n}\n\nexport interface Count {}\n\nexport interface Operation extends OperationCalculateOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n average?: Average\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: Min\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: Max\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: Sum\n /** Calculate the number of items in the grouping. */\n itemCount?: Count\n /** Name of the field containing results of the operation. */\n resultFieldName?: string\n}\n\n/** @oneof */\nexport interface OperationCalculateOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n average?: Average\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: Min\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: Max\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: Sum\n /** Calculate the number of items in the grouping. */\n itemCount?: Count\n}\n\nexport interface Aggregation {\n /** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */\n groupingFields?: string[]\n /** Operations to carry out on the data in each grouping. */\n operations?: Operation[]\n}\n\nexport interface AggregateDataItemsResponse {\n /** Aggregation results. */\n results?: Record<string, any>[] | null\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface CountDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection for which to count query results. */\n dataCollectionId: string\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`.\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 * **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 language?: string | null\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface CountDataItemsResponse {\n /** Number of items matching the query. */\n totalCount?: number\n}\n\nexport interface QueryDistinctValuesRequest\n extends QueryDistinctValuesRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to query. */\n dataCollectionId: string\n /** Item field name for which to return all distinct values. */\n fieldName?: string\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`.\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /** Sort order. */\n order?: SortOrder\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface QueryDistinctValuesRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface QueryDistinctValuesResponse {\n /** List of distinct values contained in the field specified in `fieldName`. */\n distinctValues?: any[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface BulkInsertDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the items. */\n dataCollectionId: string\n /** Data items to insert. */\n dataItems: DataItem[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options.\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the inserted data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkInsertDataItemsResponse {\n /** Information about the inserted items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkUpdateDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to update items. */\n dataCollectionId: string\n /** Data items to update. */\n dataItems: DataItem[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the updated data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkUpdateDataItemsResponse {\n /** Information about the updated items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkSaveDataItemsRequest {\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert or update the items. */\n dataCollectionId: string\n /** Data items to insert or update. */\n dataItems: DataItem[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the saved data item.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkSaveDataItemsResponse {\n /** Information about the saved items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkRemoveDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to remove the item. */\n dataCollectionId: string\n /** IDs of data items to remove. */\n dataItemIds: string[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkRemoveDataItemsResponse {\n /** Information about the removed data items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface QueryReferencedDataItemsRequest\n extends QueryReferencedDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** ID of the referring item. */\n referringItemId?: string\n /** Field containing references in the referring item. */\n referringItemFieldName?: string\n /** Order of the returned referenced items. Sorted by the date each item was referenced. */\n order?: SortOrder\n /**\n * Whether to return the total count in the response.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface QueryReferencedDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface QueryReferencedDataItemsResponse {\n /** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */\n results?: ReferencedResult[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface UnresolvedReference {\n /** ID of the referring item. */\n referringItemId?: string\n /** Field specified to query for references. */\n referringItemFieldName?: string\n}\n\nexport interface ReferencedResult extends ReferencedResultEntityOneOf {\n /** Data item referenced. */\n dataItem?: DataItem\n /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */\n unresolvedReference?: UnresolvedReference\n}\n\n/** @oneof */\nexport interface ReferencedResultEntityOneOf {\n /** Data item referenced. */\n dataItem?: DataItem\n /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */\n unresolvedReference?: UnresolvedReference\n}\n\nexport interface IsReferencedDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring data item. */\n dataCollectionId: string\n /** Field to check for a reference to the item that may be referenced. */\n referringItemFieldName: string\n /** ID of the referring item. */\n referringItemId: string\n /** ID of the item that may be referenced. */\n referencedItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface IsReferencedDataItemResponse {\n /** Whether the specified reference exists. */\n isReferenced?: boolean\n}\n\nexport interface InsertDataItemReferenceRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the reference. */\n dataCollectionId: string\n /** Reference to insert */\n dataItemReference?: DataItemReference\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface DataItemReference {\n /** Referring item field containing the references to the referenced items. */\n referringItemFieldName?: string\n /** ID of the referring item. */\n referringItemId?: string\n /** ID of the referenced item. */\n referencedItemId?: string\n}\n\nexport interface InsertDataItemReferenceResponse {\n /** Inserted reference. */\n dataItemReference?: DataItemReference\n}\n\nexport interface RemoveDataItemReferenceRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** Reference to remove. */\n dataItemReference: DataItemReference\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface RemoveDataItemReferenceResponse {\n /** Removed reference. */\n dataItemReference?: DataItemReference\n}\n\nexport interface BulkInsertDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring items. */\n dataCollectionId: string\n /** References to insert. */\n dataItemReferences: DataItemReference[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the inserted data item references.\n * When `true`, the `results` objects contain a `dataItemReference` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkInsertDataItemReferencesResponse {\n /** Information about the inserted references. */\n results?: BulkDataItemReferenceResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkDataItemReferenceResult {\n /** Action attempted for the reference. */\n action?: BulkActionType\n /** Metadata related to the reference for which the action was attempted. */\n referenceMetadata?: ItemMetadata\n /** Reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */\n dataItemReference?: DataItemReference\n}\n\nexport interface BulkRemoveDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring items. */\n dataCollectionId: string\n /** References to remove. */\n dataItemReferences: DataItemReference[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkRemoveDataItemReferencesResponse {\n /** Information about the removed references. */\n results?: BulkDataItemReferenceResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface ReplaceDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** Field containing references in the referring item. */\n referringItemFieldName: string\n /** ID of the referring item. */\n referringItemId: string\n /** List of new referenced item IDs to replace the existing ones. */\n newReferencedItemIds?: string[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface ReplaceDataItemReferencesResponse {\n /** Updated references. */\n dataItemReferences?: DataItemReference[]\n}\n\nexport interface SearchDataItemsRequest {\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /**\n * ID of the collection to query.\n * @maxLength 255\n */\n dataCollectionId: string\n /** Search. */\n search?: Search\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n * @format GUID\n */\n appId?: string | null\n /**\n * NOT IMPLEMENTED!\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.\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 * If not provided, result text is not translated.\n * @internal\n * @format LANGUAGE_TAG\n */\n language?: string | null\n /**\n * Whether to suppress data hooks.\n * When `true`, data hooks typically triggered by this endpoint don't run.\n *\n * **Note:** This option can only be used in code that runs in [the Wix site backend](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`\n * @internal\n */\n suppressHooks?: boolean\n /**\n * Options for the Publish plugin.\n * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.\n */\n publishPluginOptions?: DataPublishPluginOptions\n /**\n * Options for retrieving referenced items.\n * @maxSize 100\n */\n referencedItemOptions?: SearchDataItemsRequestReferencedItemOptions[]\n}\n\nexport interface Search extends SearchPagingMethodOneOf {\n /** Pointer to page of results using offset. Can't be used together with 'cursor_paging'. */\n paging?: Paging\n /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can't be used together with 'filter' or 'sort'. */\n cursorPaging?: CursorPaging\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 10\n */\n sort?: Sorting[]\n /**\n * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n * @maxLength 200\n * @maxSize 20\n */\n fields?: string[]\n /** Free text to match in searchable fields. */\n search?: SearchDetails\n}\n\n/** @oneof */\nexport interface SearchPagingMethodOneOf {\n /** Pointer to page of results using offset. Can't be used together with 'cursor_paging'. */\n paging?: Paging\n /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can't be used together with 'filter' or 'sort'. */\n cursorPaging?: CursorPaging\n}\n\nexport interface SearchDetails {\n /** Defines how separate search terms in `expression` are combined. */\n mode?: Mode\n /**\n * Search term or expression.\n * @maxLength 100\n */\n expression?: string | null\n /** Whether to use auto fuzzy search (allowing typos by a managed proximity algorithm). */\n fuzzy?: boolean\n}\n\nexport enum Mode {\n /** Any of the search terms must be present. */\n OR = 'OR',\n /** All search terms must be present. */\n AND = 'AND',\n}\n\nexport interface SearchDataItemsRequestReferencedItemOptions {\n /**\n * Field containing references in the queried item.\n * @maxLength 1000\n */\n fieldName?: string\n /**\n * Maximum number of referenced items to include for each queried item.\n * @max 1000\n */\n limit?: number | null\n}\n\nexport interface SearchDataItemsResponse {\n /**\n * Retrieved items.\n * @maxSize 1000\n */\n dataItems?: DataItem[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface AggregatePipelineDataItemsRequest\n extends AggregatePipelineDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /**\n * ID of the collection on which to run the aggregation.\n * @maxLength 256\n */\n dataCollectionId: string\n /**\n * Aggregation operations applied (in order) to the data.\n * @maxSize 100\n */\n stages?: Pipeline[]\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n * @format GUID\n */\n appId?: string | null\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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.\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 * If not provided, result text is not translated.\n * @format LANGUAGE_TAG\n */\n language?: string | null\n /**\n * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.\n *\n * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:\n * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.\n * - `includeVariants`: Whether to include product variants in the query. Default: `false`.\n */\n appOptions?: Record<string, any> | null\n /**\n * Options for the Publish plugin.\n * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.\n */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface AggregatePipelineDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Expression extends ExpressionValueOneOf {\n /**\n * Field path to the value of field in the document.\n * @maxLength 1000\n */\n fieldPath?: string\n /**\n * String constant value.\n * @maxLength 1000\n */\n stringValue?: string\n /** Numeric constant value. */\n numericValue?: number\n /** Add expression */\n add?: AddOperation\n /** Sum expression */\n sum?: SumOperation\n /** Subtract expression */\n subtract?: SubtractOperation\n /** Multiply expression */\n multiply?: MultiplyOperation\n /** Divide expression */\n divide?: DivideOperation\n /** Abs expression */\n abs?: AbsOperation\n /** Mod expression */\n mod?: ModOperation\n /** Floor expression */\n floor?: FloorOperation\n /** Ceil expression */\n ceil?: CeilOperation\n /** Concat expression */\n concat?: ConcatOperation\n /** Stringify expression */\n stringify?: StringifyOperation\n /** ToLower expression */\n toLower?: ToLowerOperation\n /** ToUpper expression */\n toUpper?: ToUpperOperation\n /** Substring expression */\n substring?: SubstringOperation\n /** Length expression */\n length?: LengthOperation\n}\n\n/** @oneof */\nexport interface ExpressionValueOneOf {\n /**\n * Field path to the value of field in the document.\n * @maxLength 1000\n */\n fieldPath?: string\n /**\n * String constant value.\n * @maxLength 1000\n */\n stringValue?: string\n /** Numeric constant value. */\n numericValue?: number\n /** Add expression */\n add?: AddOperation\n /** Sum expression */\n sum?: SumOperation\n /** Subtract expression */\n subtract?: SubtractOperation\n /** Multiply expression */\n multiply?: MultiplyOperation\n /** Divide expression */\n divide?: DivideOperation\n /** Abs expression */\n abs?: AbsOperation\n /** Mod expression */\n mod?: ModOperation\n /** Floor expression */\n floor?: FloorOperation\n /** Ceil expression */\n ceil?: CeilOperation\n /** Concat expression */\n concat?: ConcatOperation\n /** Stringify expression */\n stringify?: StringifyOperation\n /** ToLower expression */\n toLower?: ToLowerOperation\n /** ToUpper expression */\n toUpper?: ToUpperOperation\n /** Substring expression */\n substring?: SubstringOperation\n /** Length expression */\n length?: LengthOperation\n}\n\nexport interface AddOperation {\n /**\n * Add expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface SumOperation {\n /**\n * Sum expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface SubtractOperation {\n /** Expression to subtract from */\n firstExpression?: Expression\n /** Expression to subtract by */\n secondExpression?: Expression\n}\n\nexport interface MultiplyOperation {\n /**\n * Multiply expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface DivideOperation {\n /** Expression to divide from */\n firstExpression?: Expression\n /** Expression to divide by */\n secondExpression?: Expression\n}\n\nexport interface AbsOperation {\n /** Expression to calculate absolute value of. */\n expression?: Expression\n}\n\nexport interface ModOperation {\n /** Expression to calculate modulo from */\n firstExpression?: Expression\n /** Expression to calculate modulo by */\n secondExpression?: Expression\n}\n\nexport interface FloorOperation {\n /** Expression to calculate floor value of. */\n expression?: Expression\n}\n\nexport interface CeilOperation {\n /** Expression to calculate ceil value of. */\n expression?: Expression\n}\n\nexport interface ConcatOperation {\n /**\n * Expression to concatenate.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface StringifyOperation {\n /** Expression to convert to string. */\n expression?: Expression\n}\n\nexport interface ToLowerOperation {\n /** Expression to convert to lower case. */\n expression?: Expression\n}\n\nexport interface ToUpperOperation {\n /** Expression to convert to upper case. */\n expression?: Expression\n}\n\nexport interface SubstringOperation {\n /** Expression to extract substring from. */\n expression?: Expression\n /** Number expression of start index of substring. */\n startExpression?: Expression\n /** Number expression of length of substring. */\n lengthExpression?: Expression\n}\n\nexport interface LengthOperation {\n /** Expression to calculate length of. */\n expression?: Expression\n}\n\nexport interface Avg {\n /** Expression to be evaluated and used for calculating the average value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorMin {\n /** Expression to be evaluated and used as the minimum value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorMax {\n /** Expression to be evaluated and used as the maximum value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorSum {\n /** Expression to be evaluated and used as the sum value in the grouping. */\n expression?: Expression\n}\n\nexport interface First {\n /** Expression to be evaluated and used as the first value in the grouping. */\n expression?: Expression\n}\n\nexport interface Last {\n /** Expression to be evaluated and used as the last value in the grouping. */\n expression?: Expression\n}\n\nexport interface Push {\n /** Expression to be evaluated and pushed to the resulting document. */\n expression?: Expression\n}\n\nexport interface Include {\n /**\n * Field name of the field to be included in the resulting document.\n * @maxLength 1000\n */\n fieldName?: string\n}\n\nexport interface Exclude {\n /**\n * Field name of the field to be excluded from the resulting document.\n * @maxLength 1000\n */\n fieldName?: string\n}\n\nexport interface ProjectionExpression {\n /**\n * Field name of resulting expression\n * @maxLength 1000\n */\n fieldName?: string\n /** Expression to be evaluated. */\n expression?: Expression\n}\n\nexport interface ProjectionFields {\n /**\n * Field name of resulting document\n * @maxLength 1000\n */\n fieldName?: string\n /**\n * Fields to be included in the resulting document.\n * @maxSize 1000\n */\n fields?: Field[]\n}\n\nexport interface Field extends FieldProjectionOneOf {\n /** When used include only specified field in resulting document. */\n include?: Include\n /** When used all fields are included in resulting document except specified fields. */\n exclude?: Exclude\n /** When used new fields created based on underlying arithmetic operations. */\n projectionExpression?: ProjectionExpression\n /** Nested fields to be projected in the resulting document. */\n projectionFields?: ProjectionFields\n}\n\n/** @oneof */\nexport interface FieldProjectionOneOf {\n /** When used include only specified field in resulting document. */\n include?: Include\n /** When used all fields are included in resulting document except specified fields. */\n exclude?: Exclude\n /** When used new fields created based on underlying arithmetic operations. */\n projectionExpression?: ProjectionExpression\n /** Nested fields to be projected in the resulting document. */\n projectionFields?: ProjectionFields\n}\n\nexport interface Id {\n /**\n * Group identifier key.\n * @maxLength 1000\n */\n key?: string\n /** Group expression value. */\n expression?: Expression\n}\n\nexport interface Accumulator extends AccumulatorExpressionOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n avg?: Avg\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: AccumulatorMin\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: AccumulatorMax\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: AccumulatorSum\n /** Calculate the number of items in the grouping. */\n count?: number\n /** Use first result from calculated grouping. */\n first?: First\n /** Use last result from calculated grouping. */\n last?: Last\n /** Execute calculation by group & push result to resulting group document. */\n push?: Push\n /**\n * Accumulator result field name.\n * @maxLength 1000\n */\n resultFieldName?: string\n}\n\n/** @oneof */\nexport interface AccumulatorExpressionOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n avg?: Avg\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: AccumulatorMin\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: AccumulatorMax\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: AccumulatorSum\n /** Calculate the number of items in the grouping. */\n count?: number\n /** Use first result from calculated grouping. */\n first?: First\n /** Use last result from calculated grouping. */\n last?: Last\n /** Execute calculation by group & push result to resulting group document. */\n push?: Push\n}\n\nexport interface Group {\n /**\n * Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection.\n * @maxSize 1000\n */\n ids?: Id[]\n /**\n * Operations to carry out on the data in each grouping.\n * @maxSize 1000\n */\n accumulators?: Accumulator[]\n}\n\nexport interface AggregatePipelineDataItemsRequestSorting {\n /**\n * Sort by one or more fields.\n * @maxSize 1000\n */\n values?: Sorting[]\n}\n\n/** Project document to include specific fields, rename or perform arithmetic operations on them. */\nexport interface Projection {\n /**\n * Field transformation projections.\n * @maxSize 1000\n */\n fields?: Field[]\n}\n\n/** Transform object to array. */\nexport interface ObjectToArray {\n /**\n * Field name of source document array field\n * @maxLength 1000\n */\n arrayFieldName?: string\n /**\n * Target field name for the projected document.\n * @maxLength 1000\n */\n destinationFieldName?: string\n}\n\n/** Unwind array field. */\nexport interface UnwindArray {\n /**\n * Field name of source document array field\n * @maxLength 1000\n */\n arrayFieldName?: string\n}\n\nexport interface Pipeline extends PipelineStageOneOf {\n /** Grouping stage. */\n group?: Group\n /**\n * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: AggregatePipelineDataItemsRequestSorting\n /** Project document to include specific fields with possibility of renaming them. */\n projection?: Projection\n /** Transform object to array. */\n objectToArray?: ObjectToArray\n /** Unwind array field. */\n unwindArray?: UnwindArray\n /** Skip resulting documents. */\n skip?: number\n /** Limit the number of resulting documents. */\n limit?: number\n}\n\n/** @oneof */\nexport interface PipelineStageOneOf {\n /** Grouping stage. */\n group?: Group\n /**\n * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: AggregatePipelineDataItemsRequestSorting\n /** Project document to include specific fields with possibility of renaming them. */\n projection?: Projection\n /** Transform object to array. */\n objectToArray?: ObjectToArray\n /** Unwind array field. */\n unwindArray?: UnwindArray\n /** Skip resulting documents. */\n skip?: number\n /** Limit the number of resulting documents. */\n limit?: number\n}\n\nexport interface AggregatePipelineDataItemsResponse {\n /**\n * Aggregation results.\n * @maxSize 10000\n */\n results?: Record<string, any>[] | null\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n"],"mappings":";;;;IA4DYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAyFvB;AAAA,IAQYE,MAAM,GAAAD,OAAA,CAAAC,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAA,IAsGNC,cAAc,GAAAF,OAAA,CAAAE,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAsIdC,MAAM,GAAAH,OAAA,CAAAG,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AA+OlB;AAAA,IAeYC,SAAS,GAAAJ,OAAA,CAAAI,SAAA,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAuJrB;AA6CA;AAoKA;AAgRA;AA6BA;AA4UA;AAAA,IAoBYC,IAAI,GAAAL,OAAA,CAAAK,IAAA,0BAAJA,IAAI;EACd;EADUA,IAAI;EAGd;EAHUA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAgGhB;AAqDA;AAoOA;AA8CA;AAyCA;AASA;AAcA;AAmCA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Environment","exports","ACTION","BulkActionType","Action","SortOrder","Mode"],"sources":["../../../src/types/data-item-types.ts"],"sourcesContent":["export interface DataItem {\n /** Data item ID. */\n id?: string\n /**\n * ID of the collection to which this item belongs.\n * @readonly\n */\n dataCollectionId?: string\n /**\n * Data item contents.\n *\n * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields:\n *\n * + `_id`: Item ID.\n * + `_createdDate`: Date and time the item was added to the collection.\n * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value.\n * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions.\n */\n data?: Record<string, any> | null\n}\n\nexport interface InsertDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the item. */\n dataCollectionId: string\n /** Item to insert. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport enum Environment {\n LIVE = 'LIVE',\n SANDBOX = 'SANDBOX',\n SANDBOX_PREFERRED = 'SANDBOX_PREFERRED',\n}\n\nexport interface Options {\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: PublishPluginOptions\n}\n\nexport interface PublishPluginOptions {\n showDraftItems?: boolean\n}\n\nexport interface InsertDataItemResponse {\n /** Inserted data item. */\n dataItem?: DataItem\n}\n\nexport interface PatchDataItemRequest {\n /**\n * [Collection environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing) from which to delete item.\n *\n * Default: `LIVE`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection that contains the item to patch. */\n dataCollectionId: string\n /** Patch to apply to the item. */\n patch: Patch\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface Patch {\n /** ID of the item to patch. */\n dataItemId?: string\n /** Modifications to apply. */\n fieldModifications?: FieldModification[]\n}\n\nexport interface FieldModification extends FieldModificationActionOptionsOneOf {\n setFieldOptions?: SetFieldOptions\n incrementFieldOptions?: IncrementFieldOptions\n appendToArrayOptions?: AppendToArrayOptions\n removeFromArrayOptions?: RemoveFromArrayOptions\n /**\n * Path of the field ID to be modified. For example: `title`.\n *\n * Nested fields can be specified using dot notation. For example: `address.street`.\n */\n fieldPath?: string\n /** Patch action to be applied to the specified field. */\n action?: ACTION\n}\n\n/** @oneof */\nexport interface FieldModificationActionOptionsOneOf {\n setFieldOptions?: SetFieldOptions\n incrementFieldOptions?: IncrementFieldOptions\n appendToArrayOptions?: AppendToArrayOptions\n removeFromArrayOptions?: RemoveFromArrayOptions\n}\n\nexport enum ACTION {\n UNKNOWN_ACTION = 'UNKNOWN_ACTION',\n SET_FIELD = 'SET_FIELD',\n REMOVE_FIELD = 'REMOVE_FIELD',\n INCREMENT_FIELD = 'INCREMENT_FIELD',\n APPEND_TO_ARRAY = 'APPEND_TO_ARRAY',\n REMOVE_FROM_ARRAY = 'REMOVE_FROM_ARRAY',\n}\n\nexport interface SetFieldOptions {\n /**\n * Value to set for the specified field. This replaces the existing value.\n */\n value?: any\n}\n\nexport interface IncrementFieldOptions {\n /**\n * Numerical value by which to increment or decrement the current field value.\n */\n value?: number\n}\n\nexport interface AppendToArrayOptions {\n /**\n * Value to append to the specified array.\n */\n value?: any\n}\n\nexport interface RemoveFromArrayOptions {\n /**\n * Value to remove from the specified array.\n */\n value?: any\n}\n\nexport interface DataPublishPluginOptions {\n /**\n * Whether to include draft items.\n *\n * When `true`, the task deletes both published and draft items. Default: `false`.\n */\n includeDraftItems?: boolean\n}\n\nexport interface PatchDataItemResponse {\n /** Patched data item. */\n dataItem?: DataItem\n}\n\nexport interface BulkPatchDataItemsRequest {\n /**\n * [Collection environment](https://support.wix.com/en/article/cms-about-sandbox-and-live-collections-and-syncing) from which to delete item.\n *\n * Default: `LIVE`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection that contains the items to patch. */\n dataCollectionId: string\n /** Patches to apply to the items. */\n patches: Patch[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Whether to return the updated data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Prevents hooks from running for the operation. Can only be used in the backend code of a Wix site.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkPatchDataItemsResponse {\n /** Information about the updated items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkDataItemResult {\n /** The action attempted for the data item. */\n action?: BulkActionType\n /** Metadata related to the data item for which the action was attempted. */\n itemMetadata?: ItemMetadata\n /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */\n dataItem?: DataItem\n}\n\nexport enum BulkActionType {\n UNKNOWN_ACTION_TYPE = 'UNKNOWN_ACTION_TYPE',\n INSERT = 'INSERT',\n UPDATE = 'UPDATE',\n DELETE = 'DELETE',\n PATCH = 'PATCH',\n}\n\nexport interface ItemMetadata {\n /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */\n id?: string | null\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean\n /** Details about the error in case of failure. */\n error?: ApplicationError\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string\n /** Description of the error. */\n description?: string\n /** Data related to the error. */\n data?: Record<string, any> | null\n}\n\nexport interface BulkActionMetadata {\n /** Number of items successfully processed. */\n totalSuccesses?: number\n /** Number of items that couldn't be processed. */\n totalFailures?: number\n}\n\nexport interface UpdateDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the existing item. */\n dataCollectionId: string\n /** Updated data item content. The existing data item's content is replaced entirely. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface UpdateDataItemResponse {\n /** Updated data item. */\n dataItem?: DataItem\n}\n\nexport interface SaveDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert or update the item. */\n dataCollectionId: string\n /** Data item to insert or update. */\n dataItem: DataItem\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferencedItems?: boolean\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface SaveDataItemResponse {\n /**\n * Action carried out for the item.\n *\n * + `INSERTED`: A new item was added to the collection.\n * + `UPDATED`: An existing item in the collection was updated.\n */\n action?: Action\n /** Inserted or updated data item. */\n dataItem?: DataItem\n}\n\nexport enum Action {\n UNKNOWN_ACTION = 'UNKNOWN_ACTION',\n INSERTED = 'INSERTED',\n UPDATED = 'UPDATED',\n}\n\nexport interface GetDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to retrieve the data item. */\n dataCollectionId: string\n /** ID of the data item to retrieve. */\n dataItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n *\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface GetDataItemResponse {\n /** Retrieved item. */\n dataItem?: DataItem\n}\n\nexport interface RemoveDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to remove the item. */\n dataCollectionId: string\n /** ID of the item to remove. */\n dataItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface RemoveDataItemResponse {\n /** Removed item. */\n dataItem?: DataItem\n}\n\nexport interface TruncateDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to truncate. */\n dataCollectionId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n}\n\nexport interface TruncateDataItemsResponse {}\n\nexport interface QueryDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to query. */\n dataCollectionId: string\n /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */\n query?: QueryV2\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Properties for which to include referenced items in the query's results.\n * Up to 50 referenced items can be included for each item that matches the query.\n * @deprecated\n * @replacedBy referenced_item_options\n * @removalDate 2025-08-01\n */\n includeReferencedItems?: string[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Request information about this collection caching\n * @internal\n */\n requestCachingInfo?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n /** Options for retrieving referenced items. */\n referencedItemOptions?: ReferencedItemOptions[]\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[]\n /**\n * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string\n /** Sort order. */\n order?: SortOrder\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null\n /** Number of items to skip in the current sort order. */\n offset?: number | null\n}\n\nexport interface CursorPaging {\n /** Number of items to load. */\n limit?: number | null\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null\n}\n\nexport interface ReferencedItemOptions {\n /** Field containing references in the queried item. */\n fieldName?: string\n /** Maximum number of referenced items to include for each queried item. */\n limit?: number | null\n}\n\nexport interface QueryDataItemsResponse {\n /** Retrieved items. */\n dataItems?: DataItem[]\n /**\n * Caching info. Returned if `request_caching_info` is true in the request and caching is allowed.\n * @internal\n */\n cachingInfo?: CachingInfo\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface CachingInfo {\n /** Caching tags for this collection */\n tags?: string[]\n /** max caching time if set */\n maxAge?: number | null\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null\n /** Offset that was requested. */\n offset?: number | null\n /** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */\n total?: number | null\n /** Whether the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n * @internal\n */\n hasNext?: boolean | null\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null\n}\n\nexport interface AggregateDataItemsRequest\n extends AggregateDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection on which to run the aggregation. */\n dataCollectionId: string\n /**\n * Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n initialFilter?: Record<string, any> | null\n /** Aggregation applied to the data. */\n aggregation?: Aggregation\n /**\n * Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n finalFilter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[]\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface AggregateDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Average {\n /** Name of the field for which to calculate the average value. */\n itemFieldName?: string\n}\n\nexport interface Min {\n /** Name of the field for which to calculate the minimum value. */\n itemFieldName?: string\n}\n\nexport interface Max {\n /** Name of the field for which to calculate the maximum value. */\n itemFieldName?: string\n}\n\nexport interface Sum {\n /** Name of the field for which to calculate the sum. */\n itemFieldName?: string\n}\n\nexport interface Count {}\n\nexport interface Operation extends OperationCalculateOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n average?: Average\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: Min\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: Max\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: Sum\n /** Calculate the number of items in the grouping. */\n itemCount?: Count\n /** Name of the field containing results of the operation. */\n resultFieldName?: string\n}\n\n/** @oneof */\nexport interface OperationCalculateOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n average?: Average\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: Min\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: Max\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: Sum\n /** Calculate the number of items in the grouping. */\n itemCount?: Count\n}\n\nexport interface Aggregation {\n /** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */\n groupingFields?: string[]\n /** Operations to carry out on the data in each grouping. */\n operations?: Operation[]\n}\n\nexport interface AggregateDataItemsResponse {\n /** Aggregation results. */\n results?: Record<string, any>[] | null\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface CountDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection for which to count query results. */\n dataCollectionId: string\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`.\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 * **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 language?: string | null\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface CountDataItemsResponse {\n /** Number of items matching the query. */\n totalCount?: number\n}\n\nexport interface QueryDistinctValuesRequest\n extends QueryDistinctValuesRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection to query. */\n dataCollectionId: string\n /** Item field name for which to return all distinct values. */\n fieldName?: string\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`.\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /** Sort order. */\n order?: SortOrder\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface QueryDistinctValuesRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface QueryDistinctValuesResponse {\n /** List of distinct values contained in the field specified in `fieldName`. */\n distinctValues?: any[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface BulkInsertDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the items. */\n dataCollectionId: string\n /** Data items to insert. */\n dataItems: DataItem[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options.\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the inserted data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkInsertDataItemsResponse {\n /** Information about the inserted items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkUpdateDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to update items. */\n dataCollectionId: string\n /** Data items to update. */\n dataItems: DataItem[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the updated data items.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkUpdateDataItemsResponse {\n /** Information about the updated items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkSaveDataItemsRequest {\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert or update the items. */\n dataCollectionId: string\n /** Data items to insert or update. */\n dataItems: DataItem[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the saved data item.\n * When `true`, the `results` objects contain a `dataItem` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkSaveDataItemsResponse {\n /** Information about the saved items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkRemoveDataItemsRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection from which to remove the item. */\n dataCollectionId: string\n /** IDs of data items to remove. */\n dataItemIds: string[]\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Should hooks execution be suppressed.\n * This option can only be used with Corvid backend\n * code identity.\n * @internal\n */\n suppressHooks?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\nexport interface BulkRemoveDataItemsResponse {\n /** Information about the removed data items. */\n results?: BulkDataItemResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface QueryReferencedDataItemsRequest\n extends QueryReferencedDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** ID of the referring item. */\n referringItemId?: string\n /** Field containing references in the referring item. */\n referringItemFieldName?: string\n /** Order of the returned referenced items. Sorted by the date each item was referenced. */\n order?: SortOrder\n /**\n * Whether to return the total count in the response.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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 | null\n /**\n * Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n */\n fields?: string[]\n /** @internal */\n appOptions?: Record<string, any> | null\n /** @internal */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface QueryReferencedDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface QueryReferencedDataItemsResponse {\n /** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */\n results?: ReferencedResult[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface UnresolvedReference {\n /** ID of the referring item. */\n referringItemId?: string\n /** Field specified to query for references. */\n referringItemFieldName?: string\n}\n\nexport interface ReferencedResult extends ReferencedResultEntityOneOf {\n /** Data item referenced. */\n dataItem?: DataItem\n /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */\n unresolvedReference?: UnresolvedReference\n}\n\n/** @oneof */\nexport interface ReferencedResultEntityOneOf {\n /** Data item referenced. */\n dataItem?: DataItem\n /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */\n unresolvedReference?: UnresolvedReference\n}\n\nexport interface IsReferencedDataItemRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring data item. */\n dataCollectionId: string\n /** Field to check for a reference to the item that may be referenced. */\n referringItemFieldName: string\n /** ID of the referring item. */\n referringItemId: string\n /** ID of the item that may be referenced. */\n referencedItemId: string\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface IsReferencedDataItemResponse {\n /** Whether the specified reference exists. */\n isReferenced?: boolean\n}\n\nexport interface InsertDataItemReferenceRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection in which to insert the reference. */\n dataCollectionId: string\n /** Reference to insert */\n dataItemReference?: DataItemReference\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface DataItemReference {\n /** Referring item field containing the references to the referenced items. */\n referringItemFieldName?: string\n /** ID of the referring item. */\n referringItemId?: string\n /** ID of the referenced item. */\n referencedItemId?: string\n}\n\nexport interface InsertDataItemReferenceResponse {\n /** Inserted reference. */\n dataItemReference?: DataItemReference\n}\n\nexport interface RemoveDataItemReferenceRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** Reference to remove. */\n dataItemReference: DataItemReference\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface RemoveDataItemReferenceResponse {\n /** Removed reference. */\n dataItemReference?: DataItemReference\n}\n\nexport interface BulkInsertDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring items. */\n dataCollectionId: string\n /** References to insert. */\n dataItemReferences: DataItemReference[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /**\n * Whether to return the inserted data item references.\n * When `true`, the `results` objects contain a `dataItemReference` field.\n *\n * Default: `false`\n */\n returnEntity?: boolean\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkInsertDataItemReferencesResponse {\n /** Information about the inserted references. */\n results?: BulkDataItemReferenceResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface BulkDataItemReferenceResult {\n /** Action attempted for the reference. */\n action?: BulkActionType\n /** Metadata related to the reference for which the action was attempted. */\n referenceMetadata?: ItemMetadata\n /** Reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */\n dataItemReference?: DataItemReference\n}\n\nexport interface BulkRemoveDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring items. */\n dataCollectionId: string\n /** References to remove. */\n dataItemReferences: DataItemReference[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface BulkRemoveDataItemReferencesResponse {\n /** Information about the removed references. */\n results?: BulkDataItemReferenceResult[]\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata\n}\n\nexport interface ReplaceDataItemReferencesRequest {\n /**\n * Environment: `LIVE` or `SANDBOX`.\n * @internal\n */\n environment?: Environment\n /** ID of the collection containing the referring item. */\n dataCollectionId: string\n /** Field containing references in the referring item. */\n referringItemFieldName: string\n /** ID of the referring item. */\n referringItemId: string\n /** List of new referenced item IDs to replace the existing ones. */\n newReferencedItemIds?: string[]\n /**\n * Grid app ID. Optional in `LIVE` segment.\n * @internal\n */\n appId?: string | null\n /**\n * Data access options\n * @internal\n * @deprecated\n * @replacedBy inlined\n * @removalDate 2024-07-12\n */\n options?: Options\n /** @internal */\n appOptions?: Record<string, any> | null\n}\n\nexport interface ReplaceDataItemReferencesResponse {\n /** Updated references. */\n dataItemReferences?: DataItemReference[]\n}\n\nexport interface SearchDataItemsRequest {\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /**\n * ID of the collection to query.\n * @maxLength 255\n */\n dataCollectionId: string\n /** Search. */\n search?: Search\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n * @format GUID\n */\n appId?: string | null\n /**\n * NOT IMPLEMENTED!\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.\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 * If not provided, result text is not translated.\n * @internal\n * @format LANGUAGE_TAG\n */\n language?: string | null\n /**\n * Whether to suppress data hooks.\n * When `true`, data hooks typically triggered by this endpoint don't run.\n *\n * **Note:** This option can only be used in code that runs in [the Wix site backend](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`\n * @internal\n */\n suppressHooks?: boolean\n /**\n * Options for the Publish plugin.\n * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.\n */\n publishPluginOptions?: DataPublishPluginOptions\n /**\n * Options for retrieving referenced items.\n * @maxSize 100\n */\n referencedItemOptions?: SearchDataItemsRequestReferencedItemOptions[]\n}\n\nexport interface Search extends SearchPagingMethodOneOf {\n /** Pointer to page of results using offset. Can't be used together with 'cursor_paging'. */\n paging?: Paging\n /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can't be used together with 'filter' or 'sort'. */\n cursorPaging?: CursorPaging\n /**\n * Filter object in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n *\n * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 10\n */\n sort?: Sorting[]\n /**\n * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned.\n * **Note:** The `_id` system field is always returned.\n * @maxLength 200\n * @maxSize 20\n */\n fields?: string[]\n /** Free text to match in searchable fields. */\n search?: SearchDetails\n}\n\n/** @oneof */\nexport interface SearchPagingMethodOneOf {\n /** Pointer to page of results using offset. Can't be used together with 'cursor_paging'. */\n paging?: Paging\n /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can't be used together with 'filter' or 'sort'. */\n cursorPaging?: CursorPaging\n}\n\nexport interface SearchDetails {\n /** Defines how separate search terms in `expression` are combined. */\n mode?: Mode\n /**\n * Search term or expression.\n * @maxLength 100\n */\n expression?: string | null\n /** Whether to use auto fuzzy search (allowing typos by a managed proximity algorithm). */\n fuzzy?: boolean\n}\n\nexport enum Mode {\n /** Any of the search terms must be present. */\n OR = 'OR',\n /** All search terms must be present. */\n AND = 'AND',\n}\n\nexport interface SearchDataItemsRequestReferencedItemOptions {\n /**\n * Field containing references in the queried item.\n * @maxLength 1000\n */\n fieldName?: string\n /**\n * Maximum number of referenced items to include for each queried item.\n * @max 1000\n */\n limit?: number | null\n}\n\nexport interface SearchDataItemsResponse {\n /**\n * Retrieved items.\n * @maxSize 1000\n */\n dataItems?: DataItem[]\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n\nexport interface AggregatePipelineDataItemsRequest\n extends AggregatePipelineDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n /**\n * Environment: LIVE or SANDBOX\n * @internal\n */\n environment?: Environment\n /**\n * ID of the collection on which to run the aggregation.\n * @maxLength 256\n */\n dataCollectionId: string\n /**\n * Aggregation operations applied (in order) to the data.\n * @maxSize 100\n */\n stages?: Stage[]\n /**\n * Whether to return the total count in the response for a query with offset paging.\n * When `true`, the `pagingMetadata` object in the response contains a `total` field.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n /**\n * Grid app id. Optional in Live segment.\n * @internal\n * @format GUID\n */\n appId?: string | null\n /**\n * Whether to retrieve data from the primary database instance.\n * This decreases performance but ensures data retrieved is up to date even immediately after an update.\n * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency).\n *\n * Default: `false`\n */\n consistentRead?: boolean\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.\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 * If not provided, result text is not translated.\n * @format LANGUAGE_TAG\n */\n language?: string | null\n /**\n * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying.\n *\n * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters:\n * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`.\n * - `includeVariants`: Whether to include product variants in the query. Default: `false`.\n */\n appOptions?: Record<string, any> | null\n /**\n * Options for the Publish plugin.\n * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.\n */\n publishPluginOptions?: DataPublishPluginOptions\n}\n\n/** @oneof */\nexport interface AggregatePipelineDataItemsRequestPagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging\n}\n\nexport interface Expression extends ExpressionValueOneOf {\n /**\n * Field path to the value of field in the document.\n * @maxLength 1000\n */\n fieldPath?: string\n /**\n * String constant value.\n * @maxLength 1000\n */\n stringValue?: string\n /** Numeric constant value. */\n numericValue?: number\n /** Add expression */\n add?: AddOperation\n /** Sum expression */\n sum?: SumOperation\n /** Subtract expression */\n subtract?: SubtractOperation\n /** Multiply expression */\n multiply?: MultiplyOperation\n /** Divide expression */\n divide?: DivideOperation\n /** Abs expression */\n abs?: AbsOperation\n /** Mod expression */\n mod?: ModOperation\n /** Floor expression */\n floor?: FloorOperation\n /** Ceil expression */\n ceil?: CeilOperation\n /** Concat expression */\n concat?: ConcatOperation\n /** Stringify expression */\n stringify?: StringifyOperation\n /** ToLower expression */\n toLower?: ToLowerOperation\n /** ToUpper expression */\n toUpper?: ToUpperOperation\n /** Substring expression */\n substring?: SubstringOperation\n /** Length expression */\n length?: LengthOperation\n}\n\n/** @oneof */\nexport interface ExpressionValueOneOf {\n /**\n * Field path to the value of field in the document.\n * @maxLength 1000\n */\n fieldPath?: string\n /**\n * String constant value.\n * @maxLength 1000\n */\n stringValue?: string\n /** Numeric constant value. */\n numericValue?: number\n /** Add expression */\n add?: AddOperation\n /** Sum expression */\n sum?: SumOperation\n /** Subtract expression */\n subtract?: SubtractOperation\n /** Multiply expression */\n multiply?: MultiplyOperation\n /** Divide expression */\n divide?: DivideOperation\n /** Abs expression */\n abs?: AbsOperation\n /** Mod expression */\n mod?: ModOperation\n /** Floor expression */\n floor?: FloorOperation\n /** Ceil expression */\n ceil?: CeilOperation\n /** Concat expression */\n concat?: ConcatOperation\n /** Stringify expression */\n stringify?: StringifyOperation\n /** ToLower expression */\n toLower?: ToLowerOperation\n /** ToUpper expression */\n toUpper?: ToUpperOperation\n /** Substring expression */\n substring?: SubstringOperation\n /** Length expression */\n length?: LengthOperation\n}\n\nexport interface AddOperation {\n /**\n * Add expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface SumOperation {\n /**\n * Sum expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface SubtractOperation {\n /** Expression to subtract from */\n firstExpression?: Expression\n /** Expression to subtract by */\n secondExpression?: Expression\n}\n\nexport interface MultiplyOperation {\n /**\n * Multiply expressions.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface DivideOperation {\n /** Expression to divide from */\n firstExpression?: Expression\n /** Expression to divide by */\n secondExpression?: Expression\n}\n\nexport interface AbsOperation {\n /** Expression to calculate absolute value of. */\n expression?: Expression\n}\n\nexport interface ModOperation {\n /** Expression to calculate modulo from */\n firstExpression?: Expression\n /** Expression to calculate modulo by */\n secondExpression?: Expression\n}\n\nexport interface FloorOperation {\n /** Expression to calculate floor value of. */\n expression?: Expression\n}\n\nexport interface CeilOperation {\n /** Expression to calculate ceil value of. */\n expression?: Expression\n}\n\nexport interface ConcatOperation {\n /**\n * Expression to concatenate.\n * @maxSize 1000\n */\n expressions?: Expression[]\n}\n\nexport interface StringifyOperation {\n /** Expression to convert to string. */\n expression?: Expression\n}\n\nexport interface ToLowerOperation {\n /** Expression to convert to lower case. */\n expression?: Expression\n}\n\nexport interface ToUpperOperation {\n /** Expression to convert to upper case. */\n expression?: Expression\n}\n\nexport interface SubstringOperation {\n /** Expression to extract substring from. */\n expression?: Expression\n /** Number expression of start index of substring. */\n startExpression?: Expression\n /** Number expression of length of substring. */\n lengthExpression?: Expression\n}\n\nexport interface LengthOperation {\n /** Expression to calculate length of. */\n expression?: Expression\n}\n\nexport interface Avg {\n /** Expression to be evaluated and used for calculating the average value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorMin {\n /** Expression to be evaluated and used as the minimum value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorMax {\n /** Expression to be evaluated and used as the maximum value in the grouping. */\n expression?: Expression\n}\n\nexport interface AccumulatorSum {\n /** Expression to be evaluated and used as the sum value in the grouping. */\n expression?: Expression\n}\n\nexport interface First {\n /** Expression to be evaluated and used as the first value in the grouping. */\n expression?: Expression\n}\n\nexport interface Last {\n /** Expression to be evaluated and used as the last value in the grouping. */\n expression?: Expression\n}\n\nexport interface Push {\n /** Expression to be evaluated and pushed to the resulting document. */\n expression?: Expression\n}\n\nexport interface Include {\n /**\n * Field name of the field to be included in the resulting document.\n * @maxLength 1000\n */\n fieldName?: string\n}\n\nexport interface Exclude {\n /**\n * Field name of the field to be excluded from the resulting document.\n * @maxLength 1000\n */\n fieldName?: string\n}\n\nexport interface ProjectionExpression {\n /**\n * Field name of resulting expression\n * @maxLength 1000\n */\n fieldName?: string\n /** Expression to be evaluated. */\n expression?: Expression\n}\n\nexport interface ProjectionFields {\n /**\n * Field name of resulting document\n * @maxLength 1000\n */\n fieldName?: string\n /**\n * Fields to be included in the resulting document.\n * @maxSize 1000\n */\n fields?: Field[]\n}\n\nexport interface Field extends FieldProjectionOneOf {\n /** When used include only specified field in resulting document. */\n include?: Include\n /** When used all fields are included in resulting document except specified fields. */\n exclude?: Exclude\n /** When used new fields created based on underlying arithmetic operations. */\n projectionExpression?: ProjectionExpression\n /** Nested fields to be projected in the resulting document. */\n projectionFields?: ProjectionFields\n}\n\n/** @oneof */\nexport interface FieldProjectionOneOf {\n /** When used include only specified field in resulting document. */\n include?: Include\n /** When used all fields are included in resulting document except specified fields. */\n exclude?: Exclude\n /** When used new fields created based on underlying arithmetic operations. */\n projectionExpression?: ProjectionExpression\n /** Nested fields to be projected in the resulting document. */\n projectionFields?: ProjectionFields\n}\n\nexport interface Id {\n /**\n * Group identifier key.\n * @maxLength 1000\n */\n key?: string\n /** Group expression value. */\n expression?: Expression\n}\n\nexport interface Accumulator extends AccumulatorExpressionOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n avg?: Avg\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: AccumulatorMin\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: AccumulatorMax\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: AccumulatorSum\n /** Use first result from calculated grouping. */\n first?: First\n /** Use last result from calculated grouping. */\n last?: Last\n /** Execute calculation by group & push result to resulting group document. */\n push?: Push\n /**\n * Accumulator result field name.\n * @maxLength 1000\n */\n resultFieldName?: string\n}\n\n/** @oneof */\nexport interface AccumulatorExpressionOneOf {\n /** Calculate the average value of a specified field for all items in the grouping. */\n avg?: Avg\n /** Calculate the minimum value of a specified field for all items in the grouping. */\n min?: AccumulatorMin\n /** Calculate the maximum value of a specified field for all items in the grouping. */\n max?: AccumulatorMax\n /** Calculate the sum of values of a specified field for all items in the grouping. */\n sum?: AccumulatorSum\n /** Use first result from calculated grouping. */\n first?: First\n /** Use last result from calculated grouping. */\n last?: Last\n /** Execute calculation by group & push result to resulting group document. */\n push?: Push\n}\n\nexport interface Group {\n /**\n * Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection.\n * @maxSize 1000\n */\n ids?: Id[]\n /**\n * Operations to carry out on the data in each grouping.\n * @maxSize 1000\n */\n accumulators?: Accumulator[]\n}\n\nexport interface AggregatePipelineDataItemsRequestSorting {\n /**\n * Sort by one or more fields.\n * @maxSize 1000\n */\n values?: Sorting[]\n}\n\n/** Project document to include specific fields, rename or perform arithmetic operations on them. */\nexport interface Projection {\n /**\n * Field transformation projections.\n * @maxSize 1000\n */\n fields?: Field[]\n}\n\n/** Transform object to array. */\nexport interface ObjectToArray {\n /**\n * Field name of source document array field\n * @maxLength 1000\n */\n arrayFieldName?: string\n /**\n * Target field name for the projected document.\n * @maxLength 1000\n */\n destinationFieldName?: string\n}\n\n/** Unwind array field. */\nexport interface UnwindArray {\n /**\n * Field name of source document array field\n * @maxLength 1000\n */\n arrayFieldName?: string\n}\n\nexport interface Stage extends StageStageOneOf {\n /** Grouping stage. */\n group?: Group\n /**\n * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: AggregatePipelineDataItemsRequestSorting\n /** Project document to include specific fields with possibility of renaming them. */\n projection?: Projection\n /** Transform object to array. */\n objectToArray?: ObjectToArray\n /** Unwind array field. */\n unwindArray?: UnwindArray\n /** Skip resulting documents. */\n skip?: number\n /** Limit the number of resulting documents. */\n limit?: number\n}\n\n/** @oneof */\nexport interface StageStageOneOf {\n /** Grouping stage. */\n group?: Group\n /**\n * Filtering stage. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object.\n *\n * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `\"someDateAndTimeFieldKey\": { \"$date\": \"YYYY-MM-DDTHH:mm:ss.sssZ\"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data).\n */\n filter?: Record<string, any> | null\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: AggregatePipelineDataItemsRequestSorting\n /** Project document to include specific fields with possibility of renaming them. */\n projection?: Projection\n /** Transform object to array. */\n objectToArray?: ObjectToArray\n /** Unwind array field. */\n unwindArray?: UnwindArray\n /** Skip resulting documents. */\n skip?: number\n /** Limit the number of resulting documents. */\n limit?: number\n}\n\nexport interface AggregatePipelineDataItemsResponse {\n /**\n * Aggregation results.\n * @maxSize 10000\n */\n results?: Record<string, any>[] | null\n /** Paging information. */\n pagingMetadata?: PagingMetadataV2\n}\n"],"mappings":";;;;IA4DYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAyFvB;AAAA,IAQYE,MAAM,GAAAD,OAAA,CAAAC,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAA,IAsGNC,cAAc,GAAAF,OAAA,CAAAE,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAsIdC,MAAM,GAAAH,OAAA,CAAAG,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AA+OlB;AAAA,IAeYC,SAAS,GAAAJ,OAAA,CAAAI,SAAA,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AAuJrB;AA6CA;AAoKA;AAgRA;AA6BA;AA4UA;AAAA,IAoBYC,IAAI,GAAAL,OAAA,CAAAK,IAAA,0BAAJA,IAAI;EACd;EADUA,IAAI;EAGd;EAHUA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAgGhB;AAqDA;AAoOA;AA4CA;AAuCA;AASA;AAcA;AAmCA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isNumber } from '../utils';
|
|
2
|
+
import { AggregatingValidator, messages } from '../errors';
|
|
3
|
+
export class PipelineValidator extends AggregatingValidator {
|
|
4
|
+
constructor(operatorName, previousInvalidArguments) {
|
|
5
|
+
super(previousInvalidArguments);
|
|
6
|
+
this.operatorName = operatorName;
|
|
7
|
+
}
|
|
8
|
+
_isNumber(specifier, operand) {
|
|
9
|
+
return this.addValidation(() => isNumber(operand), () => messages.queryValidations.isNumber(this.operatorName, specifier, operand));
|
|
10
|
+
}
|
|
11
|
+
isPositiveNumber(operand) {
|
|
12
|
+
return this._isNumber('positive', operand).addValidation(() => !Number.isNaN(operand) && operand > 0, () => messages.queryValidations.isPositiveNumber(this.operatorName, operand));
|
|
13
|
+
}
|
|
14
|
+
isNonNegativeNumber(operand) {
|
|
15
|
+
return this._isNumber('non-negative', operand).addValidation(() => !Number.isNaN(operand) && operand >= 0, () => messages.queryValidations.isNonNegativeNumber(this.operatorName, operand));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=PipelineValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipelineValidator.js","sourceRoot":"","sources":["../../../src/api/PipelineValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAE1D,MAAM,OAAO,iBAAkB,SAAQ,oBAAoB;IAGzD,YAAY,YAAoB,EAAE,wBAAkC;QAClE,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAED,SAAS,CAAC,SAAiB,EAAE,OAAY;QACvC,OAAO,IAAI,CAAC,aAAa,CACvB,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EACvB,GAAG,EAAE,CACH,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAChC,IAAI,CAAC,YAAY,EACjB,SAAS,EACT,OAAO,CACR,CACJ,CAAA;IACH,CAAC;IAED,gBAAgB,CAAC,OAAe;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,aAAa,CACtD,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAC3C,GAAG,EAAE,CACH,QAAQ,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CACzE,CAAA;IACH,CAAC;IAED,mBAAmB,CAAC,OAAe;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,aAAa,CAC1D,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,EAC5C,GAAG,EAAE,CACH,QAAQ,CAAC,gBAAgB,CAAC,mBAAmB,CAC3C,IAAI,CAAC,YAAY,EACjB,OAAO,CACR,CACJ,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WixDataAggregatePipeline.js","sourceRoot":"","sources":["../../../src/api/WixDataAggregatePipeline.ts"],"names":[],"mappings":""}
|
|
@@ -8,6 +8,7 @@ import { WixDataAggregateImpl } from './impl/WixDataAggregateImpl';
|
|
|
8
8
|
import { ApiClient } from './ApiClient';
|
|
9
9
|
import { WixDataBulkPatchImpl, WixDataPatchImpl } from './impl/WixDataPatchImpl';
|
|
10
10
|
import { WixDataSearchImpl } from './impl/WixDataSearchImpl';
|
|
11
|
+
import { WixDataAggregatePipelineImpl } from './impl/WixDataAggregatePipelineImpl';
|
|
11
12
|
export class WixDataApi {
|
|
12
13
|
constructor(clientFactory, allowGet, environment, gridAppId, tracer) {
|
|
13
14
|
this.environment = environment;
|
|
@@ -447,6 +448,9 @@ export class WixDataApi {
|
|
|
447
448
|
collectionName,
|
|
448
449
|
});
|
|
449
450
|
});
|
|
451
|
+
this.aggregatePipeline = (collectionName, pipeline) => {
|
|
452
|
+
return new WixDataAggregatePipelineImpl(collectionName, pipeline, this.client);
|
|
453
|
+
};
|
|
450
454
|
// --- bulk methods ---
|
|
451
455
|
this.bulkRemove = withArgs(async (args, collectionName, itemIds, options) => {
|
|
452
456
|
await apiValidator()
|