@wix/wix-data-items-common 1.0.150 → 1.0.152
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/ApiClient.js +6 -0
- package/dist/cjs/api/ApiClient.js.map +1 -1
- package/dist/cjs/api/WixDataApi.js +44 -0
- package/dist/cjs/api/WixDataApi.js.map +1 -1
- package/dist/cjs/api/WixDataSearch.js +4 -0
- package/dist/cjs/api/WixDataSearch.js.map +1 -0
- package/dist/cjs/api/impl/WixDataSearchImpl.js +137 -0
- package/dist/cjs/api/impl/WixDataSearchImpl.js.map +1 -0
- package/dist/cjs/api/index.js +3 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/types/api.js.map +1 -1
- package/dist/cjs/types/data-item-types.js +7 -1
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/ApiClient.js +6 -0
- package/dist/esm/api/ApiClient.js.map +1 -1
- package/dist/esm/api/WixDataApi.js +44 -0
- package/dist/esm/api/WixDataApi.js.map +1 -1
- package/dist/esm/api/WixDataSearch.js +2 -0
- package/dist/esm/api/WixDataSearch.js.map +1 -0
- package/dist/esm/api/impl/WixDataSearchImpl.js +131 -0
- package/dist/esm/api/impl/WixDataSearchImpl.js.map +1 -0
- package/dist/esm/api/index.js.map +1 -1
- package/dist/esm/types/data-item-types.js +7 -0
- package/dist/esm/types/data-item-types.js.map +1 -1
- package/dist/types/api/ApiClient.d.ts +2 -1
- package/dist/types/api/ApiClient.d.ts.map +1 -1
- package/dist/types/api/WixDataApi.d.ts +2 -0
- package/dist/types/api/WixDataApi.d.ts.map +1 -1
- package/dist/types/api/WixDataSearch.d.ts +682 -0
- package/dist/types/api/WixDataSearch.d.ts.map +1 -0
- package/dist/types/api/impl/WixDataSearchImpl.d.ts +80 -0
- package/dist/types/api/impl/WixDataSearchImpl.d.ts.map +1 -0
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/types/api.d.ts +2 -1
- package/dist/types/types/api.d.ts.map +1 -1
- package/dist/types/types/data-item-types.d.ts +130 -0
- package/dist/types/types/data-item-types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/api/WixDataSearch.ts"],"sourcesContent":["import { WixDataResult } from './WixDataResult'\nimport { WixDataReadOptions } from './types'\nimport { WixDataFilter } from './WixDataFilter'\n\n/**\n * @builder\n * Represents a search operation to be performed on a WixData collection.\n * Allows for building complex search requests by specifying search expressions,\n * modes, filters, sorting, and pagination.\n */\nexport interface WixDataSearch {\n /**\n * Sets the text to search for in the collection.\n * @param queryText The text to search for.\n * @returns The current WixDataSearch instance for chaining.\n */\n expression(queryText: string): WixDataSearch\n\n /**\n * Sets the search mode to fuzzy.\n * Fuzzy search allows for approximate matches, while exact search requires precise matches.\n * @returns The current WixDataSearch instance for chaining.\n */\n fuzzy(): WixDataSearch\n\n /**\n * Sets the search mode to \"AND\".\n * When in \"AND\" mode, all specified search terms or filter conditions must be met for an item to be included in the results.\n * @returns The current WixDataSearch instance for chaining.\n */\n andMode(): WixDataSearch\n\n /**\n * Sets the search mode to \"OR\".\n * When in \"OR\" mode, an item is included in the results if it meets any of the specified search terms or filter conditions.\n * @returns The current WixDataSearch instance for chaining.\n */\n orMode(): WixDataSearch\n\n /**\n * Performs a full-text search across the collection based on the configured expression, modes, and filters.\n * @param options - Options for the search operation, such as read consistency.\n * @returns A Promise that resolves to a WixDataResult containing the matching items and search metadata.\n */\n run(options?: WixDataReadOptions): Promise<WixDataResult>\n\n /**\n * Adds a sort to a search, sorting by the specified properties in descending order.\n *\n * The `descending()` method refines this search to sort in descending order of the specified properties. If you\n * specify more than one property, descending() sorts the results in descending order by each property in the order\n * they are listed.\n *\n * You can sort the following types:\n *\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes before `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items\n * that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n descending(...fields: string[]): WixDataSearch\n /**\n * @param fields - An array of fields to sort by in descending order.\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n descending(fields: string[]): WixDataSearch\n /**\n * @param fields - Fields used in the sort.\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n descending(...fields: any): WixDataSearch\n\n /**\n * Adds a sort to a search, sorting by the specified properties in ascending order.\n *\n * The `ascending()` method refines this search in ascending order of the specified properties. If you specify more\n * than one property, `ascending()` sorts the results in ascending order by each property in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically.\n * Items that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n ascending(...fields: string[]): WixDataSearch\n /**\n * @param fields - An array of fields to sort by in ascending order.\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n ascending(fields: string[]): WixDataSearch\n /**\n * @param fields - Fields used in the sort.\n * @returns The current WixDataSearch instance, refined with the specified sort order.\n */\n ascending(...fields: any): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value equals the specified value.\n *\n * The `eq()` method refines this search to only\n * match items where the value of the specified property equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item\n * as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the equality filter.\n */\n eq(field: string, value: any): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` method refines this search to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to not match.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the inequality filter.\n */\n ne(field: string, value: any): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this search to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare against.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the 'greater than or equal' filter.\n */\n ge(field: string, value: string | number | Date): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` method refines this search to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare against.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the 'greater than' filter.\n */\n gt(field: string, value: string | number | Date): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this search to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare against.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the 'less than or equal' filter.\n */\n le(field: string, value: string | number | Date): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value is less than the specified value.\n *\n * The `lt()` method refines this search to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare against.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the 'less than' filter.\n */\n lt(field: string, value: string | number | Date): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property has any value (is not null or undefined).\n *\n * The `isNotEmpty()` method refines this search to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the search filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a non-empty value.\n * @requiredField field\n * @returns The current WixDataSearch instance, refined with the 'is not empty' filter.\n */\n isNotEmpty(field: string): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property does not exist or does not have any value (is null or undefined).\n *\n * The `isEmpty()` method refines this search to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will not match the search filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for an empty or non-existent value.\n * @requiredField field\n * @returns The current WixDataSearch instance, refined with the 'is empty' filter.\n */\n isEmpty(field: string): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value starts with a specified string.\n *\n * The `startsWith()` method refines this search to\n * only match items where the value of the specified property starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - String to look for at the beginning of the specified property value.\n * @requiredField value\n * @returns The current `WixDataSearch` instance, refined with the 'starts with' filter.\n */\n startsWith(field: string, value: string): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value ends with a specified string.\n *\n * The `endsWith()` method refines this search to only\n * match items where the value of the specified property ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - String to look for at the end of the specified property value.\n * @requiredField value\n * @returns The current `WixDataSearch` instance, refined with the 'ends with' filter.\n */\n endsWith(field: string, value: string): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value contains a specified string.\n *\n * The `contains()` method refines this search to\n * only match items where the value of the specified property contains the\n * specified `string`. Matching with `contains()` is not case sensitive, so\n * `\"text\"` does contain `\"Tex\"`.\n *\n * You can use `contains()` with a property whose value is a String or a Reference.\n * For properties of type reference it is recommended that you use the [`eq()`](#eq)\n * method instead of `contains()`. With properties that are References, `contains()`\n * matches by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns The current WixDataSearch instance, refined with the 'contains' filter.\n */\n contains(field: string, value: string): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this search to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns The current WixDataSearch instance, refined with the 'has some' filter.\n */\n hasSome(field: string, ...values: string[] | number[] | Date[]): WixDataSearch\n\n /**\n * Overload for `hasSome()`. Refines a search to match items whose specified property value equals any of the specified values.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided values.\n * @requiredField field\n * @param values - An array of values to match.\n * @requiredField values\n * @returns The current WixDataSearch instance, refined with the 'has some' filter.\n */\n hasSome(field: string, values: string[] | number[] | Date[]): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this search to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match. All specified values must be present.\n * @requiredField values\n * @returns The current WixDataSearch instance, refined with the 'has all' filter.\n */\n hasAll(field: string, ...values: string[] | number[] | Date[]): WixDataSearch\n\n /**\n * Overload for `hasAll()`. Refines a search to match items whose specified property values equals all of the specified values.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided values.\n * @requiredField field\n * @param values - An array of values to match. All values in the array must be present.\n * @requiredField values\n * @returns The current WixDataSearch instance, refined with the 'has all' filter.\n */\n hasAll(field: string, values: string[] | number[] | Date[]): WixDataSearch\n\n /**\n * Adds an `or` condition to the search filter.\n *\n * The `or()` method adds an inclusive `or` condition to this search filter. A search\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more filters. Used on its own, it may not produce expected results.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns The current WixDataSearch instance, refined with the 'or' condition.\n */\n or(filter: WixDataFilter): WixDataSearch\n\n /**\n * Adds an `and` condition to the search filter.\n *\n * The `and()` method adds an `and` condition to this search filter. A search with an `and` returns all the items\n * that match the filter as defined up to the `and` method and also match the filter passed to\n * the `and` method.\n *\n * Note that when chaining multiple filter methods to a search, an `and` condition is often assumed by default.\n * For example, this search returns results where status is active **and** age is greater than 25:\n * ```javascript\n * wixData.search(\"myCollection\").expression(\"some text\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` method is needed when performing compound filters. For example, the final search in this set of\n * operations returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```javascript\n * let statusFilter = wixData.filter().eq(\"status\", \"pending\").or(wixData.filter().eq(\"status\", \"rejected\"));\n * let ageFilter = wixData.filter().lt(\"age\", 25).or(wixData.filter().gt(\"age\", 65));\n *\n * let finalSearch = wixData.search(\"myCollection\").expression(\"some text\").and(statusFilter).and(ageFilter);\n * ```\n *\n * The `and()` method is designed to work with 2 or more filters.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial search filter as an `and` condition.\n * @requiredField filter\n * @returns The current WixDataSearch instance, refined with the 'and' condition.\n */\n and(filter: WixDataFilter): WixDataSearch\n\n /**\n * Adds a `not` condition to the search filter.\n *\n * The `not()` method adds a `not` condition to this search filter. A search with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the search filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns The current WixDataSearch instance, refined with the 'not' condition.\n */\n not(filter: WixDataFilter): WixDataSearch\n\n /**\n * Refines a search to match items whose specified property value is within a specified range.\n *\n * The `between()` method refines this search to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * It only matches values of the same type. For example, a number value stored as a String type does not match the\n * same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared alphabetically and not numerically. Items\n * that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match (inclusive).\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match (exclusive).\n * @requiredField rangeEnd\n * @returns The current WixDataSearch instance, refined with the 'between' filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): WixDataSearch\n\n /**\n * Lists the fields to return in a search's results.\n *\n * The `fields()` method specifies which fields to return in the search results.\n *\n * You can use `include()` in conjunction with `fields()` to get referenced items.\n *\n * When `fields()` receives an empty or invalid property, the search behaves as follows:\n * - When no fields are specified, the search returns all fields.\n * - When multiple fields are specified but some are invalid, invalid fields are ignored and valid fields are returned.\n * - When only invalid fields are specified, only the default `_id` field is returned.\n * @public\n * @documentationMaturity preview\n * @param fields - Properties to return.\n * @requiredField fields\n * @returns The current `WixDataSearch` instance, configured to return specified fields.\n */\n fields(...fields: string[]): WixDataSearch\n\n /**\n * Limits the number of items the search returns.\n *\n * The `limit()` method defines the number of results a search returns in each\n * page. Only one page of results is retrieved at a time. The `next()`\n * and `prev()` methods of the `WixDataResult` object are used to\n * navigate the pages of a search result.\n *\n * By default, `limit` is set to `50`.\n *\n * The maximum value that `limit()` can accept is `1000`.\n *\n * Note that for some [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), the maximum value `limit()` can accept is\n * less than `1000`. For example, the maximum limit for the Wix `Stores/Product` collection is 100.\n * @public\n * @documentationMaturity preview\n * @param limitNumber - Number of items to return, which is also the `pageSize` of the results object.\n * @requiredField limitNumber\n * @returns The current `WixDataSearch` instance, refined with the specified limit.\n */\n limit(limitNumber: number): WixDataSearch\n\n /**\n * Sets the number of items to skip before returning search results.\n *\n * The `skip()` method defines the number of results to skip in the search\n * results before returning new search results.\n *\n * For example, if your search matches 50 items, but\n * you set `skip` to 10, the results returned will skip the first 10 items\n * that match and return the 11th through 50th items.\n *\n * By default, `skip` is set to 0.\n * @public\n * @documentationMaturity preview\n * @param skipCount - Number of items to skip in the search results before returning the results.\n * @requiredField skipCount\n * @returns The current `WixDataSearch` instance, refined with the specified skip count.\n */\n skip(skipCount: number): WixDataSearch\n\n /**\n * Includes referenced items for the specified properties in a search's results.\n *\n * The `include()` method refines a search so that the items returned in the\n * search's results include the full referenced items for the specified properties.\n *\n * For example, suppose you have a **books** collection with an **author**\n * field that references an **authors** collection. Searching the **books**\n * collection with an `include(\"author\")` returns the relevant book items\n * and each item will include the full referenced author item in the book's\n * `author` property.\n *\n * When searching a collection that contains a reference field without using the\n * `include()` method:\n * - Single reference field: returned items contain only the ID of the\n * referenced item, and not the full referenced items.\n * - Multiple reference field: returned items do not contain the multiple\n * reference field at all.\n *\n * When including a property with multiple references, the following limitations\n * apply:\n * - Only one property with multiple references can be included.\n * - The search will return an error if more than 50 items are returned, regardless\n * of any search limit set using the `limit()` method.\n * - Each returned item can include up to 50 referenced items. If there are more\n * than 50 referenced items, only 50 are returned when the search is run\n * and the `partialIncludes` property of the returned `WixDataResult` is `true`.\n *\n * > **Note:** The `include()` method is not supported for [single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection).\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields for which to include referenced items.\n * @requiredField fields\n * @returns The current `WixDataSearch` instance, configured to include referenced items.\n */\n include(...fields: string[]): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified property in a search's results.\n * @public\n * @documentationMaturity preview\n * @param field - Field for which to include referenced items.\n * @param limit - Optional limit for the number of referenced items to include (behavior may vary).\n * @returns The current `WixDataSearch` instance.\n */\n include(field: string, limit?: number): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified properties in a search's results.\n * @public\n * @documentationMaturity preview\n * @param field1 - First field for which to include referenced items.\n * @param field2 - Second field for which to include referenced items.\n * @param limit - Optional limit for the number of referenced items to include (behavior may vary).\n * @returns The current `WixDataSearch` instance.\n */\n include(field1: string, field2: string, limit?: number): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified properties in a search's results.\n * @public\n * @documentationMaturity preview\n * @param field1 - First field.\n * @param field2 - Second field.\n * @param field3 - Third field.\n * @param limit - Optional limit.\n * @returns The current `WixDataSearch` instance.\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n limit?: number\n ): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified properties in a search's results.\n * @public\n * @documentationMaturity preview\n * @param field1 - First field.\n * @param field2 - Second field.\n * @param field3 - Third field.\n * @param field4 - Fourth field.\n * @param limit - Optional limit.\n * @returns The current `WixDataSearch` instance.\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n limit?: number\n ): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified properties in a search's results.\n * @public\n * @documentationMaturity preview\n * @param field1 - First field.\n * @param field2 - Second field.\n * @param field3 - Third field.\n * @param field4 - Fourth field.\n * @param field5 - Fifth field.\n * @param limit - Optional limit.\n * @returns The current `WixDataSearch` instance.\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n field5: string,\n limit?: number\n ): WixDataSearch\n\n /**\n * Overload for `include()`. Includes referenced items for the specified properties in a search's results.\n * Allows specifying multiple field names and an optional limit.\n * @public\n * @documentationMaturity preview\n * @param fieldNamesAndLimit - An array of field names, optionally followed by a limit number.\n * @returns The current `WixDataSearch` instance.\n */\n include(...fieldNamesAndLimit: [...string[], number]): WixDataSearch\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.WixDataSearchImpl = void 0;
|
|
6
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
|
+
var _types = require("../../types");
|
|
8
|
+
var _QueryValidator = require("../QueryValidator");
|
|
9
|
+
var _QueryBase = require("../QueryBase");
|
|
10
|
+
class WixDataSearchImpl extends _QueryBase.QueryBase {
|
|
11
|
+
constructor(origin) {
|
|
12
|
+
super(origin);
|
|
13
|
+
(0, _defineProperty2.default)(this, "projectedFields", void 0);
|
|
14
|
+
(0, _defineProperty2.default)(this, "limitNumber", void 0);
|
|
15
|
+
(0, _defineProperty2.default)(this, "skipNumber", void 0);
|
|
16
|
+
(0, _defineProperty2.default)(this, "included", void 0);
|
|
17
|
+
(0, _defineProperty2.default)(this, "queryText", void 0);
|
|
18
|
+
(0, _defineProperty2.default)(this, "searchMode", void 0);
|
|
19
|
+
(0, _defineProperty2.default)(this, "isFuzzy", void 0);
|
|
20
|
+
(0, _defineProperty2.default)(this, "onRun", void 0);
|
|
21
|
+
(0, _defineProperty2.default)(this, "ownInvalidArguments", void 0);
|
|
22
|
+
this.projectedFields = (origin == null ? void 0 : origin.projectedFields) ?? [];
|
|
23
|
+
this.limitNumber = origin == null ? void 0 : origin.limitNumber;
|
|
24
|
+
this.skipNumber = (origin == null ? void 0 : origin.skipNumber) ?? 0;
|
|
25
|
+
this.included = (origin == null ? void 0 : origin.included) ?? [];
|
|
26
|
+
this.ownInvalidArguments = origin.invalidArguments ?? [];
|
|
27
|
+
this.queryText = origin.queryText;
|
|
28
|
+
this.searchMode = origin.searchMode;
|
|
29
|
+
this.isFuzzy = origin.isFuzzy;
|
|
30
|
+
this.onRun = origin.onRun;
|
|
31
|
+
}
|
|
32
|
+
copy(params) {
|
|
33
|
+
return new WixDataSearchImpl({
|
|
34
|
+
...this,
|
|
35
|
+
filterBuilder: params.filterBuilder ?? this.filterBuilder,
|
|
36
|
+
projectedFields: params.projectedFields ?? this.projectedFields,
|
|
37
|
+
limitNumber: params.limitNumber ?? this.limitNumber,
|
|
38
|
+
skipNumber: params.skipNumber ?? this.skipNumber,
|
|
39
|
+
included: params.included ?? this.included,
|
|
40
|
+
sort: params.sort ?? this.sort,
|
|
41
|
+
invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,
|
|
42
|
+
queryText: params.queryText ?? this.queryText,
|
|
43
|
+
searchMode: params.searchMode ?? this.searchMode,
|
|
44
|
+
isFuzzy: params.isFuzzy ?? this.isFuzzy,
|
|
45
|
+
onRun: this.onRun
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
expression(queryText) {
|
|
49
|
+
return this.copy({
|
|
50
|
+
queryText
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
andMode() {
|
|
54
|
+
return this.copy({
|
|
55
|
+
searchMode: _types.Mode.AND
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
orMode() {
|
|
59
|
+
return this.copy({
|
|
60
|
+
searchMode: _types.Mode.OR
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
fuzzy() {
|
|
64
|
+
return this.copy({
|
|
65
|
+
isFuzzy: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
run(options) {
|
|
69
|
+
return this.onRun(this.toSearchParams(), options);
|
|
70
|
+
}
|
|
71
|
+
get invalidArguments() {
|
|
72
|
+
return [...this.ownInvalidArguments, ...this.filterBuilder.invalidArguments, ...this.sort.invalidArguments];
|
|
73
|
+
}
|
|
74
|
+
toSearchParams() {
|
|
75
|
+
let filterTree;
|
|
76
|
+
try {
|
|
77
|
+
// optimized filter if no errors
|
|
78
|
+
filterTree = this.filterBuilder.build();
|
|
79
|
+
} catch (_error) {
|
|
80
|
+
filterTree = this.filterBuilder.filterTree;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
collectionName: this.collectionName,
|
|
84
|
+
invalidArguments: this.invalidArguments,
|
|
85
|
+
projectedFields: this.projectedFields,
|
|
86
|
+
limitNumber: this.limitNumber,
|
|
87
|
+
skipNumber: this.skipNumber,
|
|
88
|
+
included: this.included,
|
|
89
|
+
filterTree,
|
|
90
|
+
orderBy: this.orderBy,
|
|
91
|
+
queryText: this.queryText,
|
|
92
|
+
searchMode: this.searchMode,
|
|
93
|
+
isFuzzy: this.isFuzzy
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
fields(...fields) {
|
|
97
|
+
return this.copy({
|
|
98
|
+
projectedFields: [...this.projectedFields, ...fields]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
limit(limitNumber) {
|
|
102
|
+
const [invalidArguments] = this.queryValidator('.limit').arityIsOne(arguments).isPositiveNumber(limitNumber).isInteger(limitNumber).validateAndAggregate();
|
|
103
|
+
return this.copy({
|
|
104
|
+
invalidArguments,
|
|
105
|
+
limitNumber
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
skip(skipNumber) {
|
|
109
|
+
const [invalidArguments] = this.queryValidator('.skip').arityIsOne(arguments).isNonNegativeNumber(skipNumber).isInteger(skipNumber).validateAndAggregate();
|
|
110
|
+
return this.copy({
|
|
111
|
+
invalidArguments,
|
|
112
|
+
skipNumber
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
include(...args) {
|
|
116
|
+
if (args.length === 0) {
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
const last = args[args.length - 1];
|
|
120
|
+
const limit = typeof last === 'number' ? last : undefined;
|
|
121
|
+
const expectedFieldNameCount = limit === undefined ? args.length : args.length - 1;
|
|
122
|
+
const newIncludes = args.slice(0, expectedFieldNameCount).map(fieldName => ({
|
|
123
|
+
fieldName: fieldName,
|
|
124
|
+
limit
|
|
125
|
+
}));
|
|
126
|
+
const [invalidArguments] = args.slice(0, expectedFieldNameCount).reduce((validator, value, _, __) => validator.nonEmptyString(value), this.queryValidator('.include')).validateAndAggregate();
|
|
127
|
+
return this.copy({
|
|
128
|
+
invalidArguments,
|
|
129
|
+
included: [...this.included, ...newIncludes]
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
queryValidator(operatorName, invalidArguments = this.ownInvalidArguments) {
|
|
133
|
+
return new _QueryValidator.QueryValidator(operatorName, invalidArguments);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.WixDataSearchImpl = WixDataSearchImpl;
|
|
137
|
+
//# sourceMappingURL=WixDataSearchImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_types","require","_QueryValidator","_QueryBase","WixDataSearchImpl","QueryBase","constructor","origin","_defineProperty2","default","projectedFields","limitNumber","skipNumber","included","ownInvalidArguments","invalidArguments","queryText","searchMode","isFuzzy","onRun","copy","params","filterBuilder","sort","expression","andMode","Mode","AND","orMode","OR","fuzzy","run","options","toSearchParams","filterTree","build","_error","collectionName","orderBy","fields","limit","queryValidator","arityIsOne","arguments","isPositiveNumber","isInteger","validateAndAggregate","skip","isNonNegativeNumber","include","args","length","last","undefined","expectedFieldNameCount","newIncludes","slice","map","fieldName","reduce","validator","value","_","__","nonEmptyString","operatorName","QueryValidator","exports"],"sources":["../../../../src/api/impl/WixDataSearchImpl.ts"],"sourcesContent":["import { PlatformizedFilterBuilder } from '../../filter'\nimport { ReferencedItemOptions, Mode } from '../../types'\nimport { Sort } from '../../sort/sortMixin'\nimport { WixDataResult } from '../WixDataResult'\nimport { WixDataReadOptions } from '../types'\nimport { QueryValidator } from '../QueryValidator'\nimport { QueryBase } from '../QueryBase'\nimport { WixDataSearch } from '../WixDataSearch'\n\ntype OnRun = (\n params: SearchParams,\n options?: WixDataReadOptions\n) => Promise<WixDataResult>\n\nexport type SearchParams = {\n collectionName: string\n invalidArguments: string[]\n filterTree?: Record<string, any>\n projectedFields: string[]\n limitNumber?: number\n skipNumber: number\n included: ReferencedItemOptions[]\n orderBy: { [field: string]: 'asc' | 'desc' }[]\n queryText?: string\n searchMode?: Mode\n isFuzzy?: boolean\n}\n\nexport class WixDataSearchImpl\n extends QueryBase<WixDataSearchImpl>\n implements WixDataSearch\n{\n readonly projectedFields: string[]\n\n readonly limitNumber?: number\n\n readonly skipNumber: number\n\n readonly included: ReferencedItemOptions[]\n\n private readonly queryText?: string\n private readonly searchMode?: Mode\n private readonly isFuzzy?: boolean\n\n private readonly onRun: OnRun\n\n private readonly ownInvalidArguments: string[]\n\n constructor(origin: {\n collectionName: string\n filterBuilder?: PlatformizedFilterBuilder\n invalidArguments?: string[]\n projectedFields?: string[]\n limitNumber?: number\n skipNumber?: number\n included?: ReferencedItemOptions[]\n sort?: Sort\n queryText?: string\n searchMode?: Mode\n isFuzzy?: boolean\n onRun: OnRun\n }) {\n super(origin)\n this.projectedFields = origin?.projectedFields ?? []\n this.limitNumber = origin?.limitNumber\n this.skipNumber = origin?.skipNumber ?? 0\n this.included = origin?.included ?? []\n this.ownInvalidArguments = origin.invalidArguments ?? []\n this.queryText = origin.queryText\n this.searchMode = origin.searchMode\n this.isFuzzy = origin.isFuzzy\n this.onRun = origin.onRun\n }\n\n protected override copy(params: {\n filterBuilder?: PlatformizedFilterBuilder\n projectedFields?: string[]\n limitNumber?: number\n skipNumber?: number\n included?: ReferencedItemOptions[]\n sort?: Sort\n invalidArguments?: string[]\n queryText?: string\n searchMode?: Mode\n isFuzzy?: boolean\n }): WixDataSearchImpl {\n return new WixDataSearchImpl({\n ...this,\n filterBuilder: params.filterBuilder ?? this.filterBuilder,\n projectedFields: params.projectedFields ?? this.projectedFields,\n limitNumber: params.limitNumber ?? this.limitNumber,\n skipNumber: params.skipNumber ?? this.skipNumber,\n included: params.included ?? this.included,\n sort: params.sort ?? this.sort,\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n queryText: params.queryText ?? this.queryText,\n searchMode: params.searchMode ?? this.searchMode,\n isFuzzy: params.isFuzzy ?? this.isFuzzy,\n onRun: this.onRun,\n })\n }\n\n expression(queryText: string): WixDataSearch {\n return this.copy({ queryText })\n }\n\n andMode(): WixDataSearch {\n return this.copy({ searchMode: Mode.AND })\n }\n\n orMode(): WixDataSearch {\n return this.copy({ searchMode: Mode.OR })\n }\n\n fuzzy(): WixDataSearch {\n return this.copy({ isFuzzy: true })\n }\n\n run(options?: WixDataReadOptions): Promise<WixDataResult> {\n return this.onRun(this.toSearchParams(), options)\n }\n\n get invalidArguments(): string[] {\n return [\n ...this.ownInvalidArguments,\n ...this.filterBuilder.invalidArguments,\n ...this.sort.invalidArguments,\n ]\n }\n\n private toSearchParams(): SearchParams {\n let filterTree\n try {\n // optimized filter if no errors\n filterTree = this.filterBuilder.build()\n } catch (_error: unknown) {\n filterTree = this.filterBuilder.filterTree\n }\n return {\n collectionName: this.collectionName,\n invalidArguments: this.invalidArguments,\n projectedFields: this.projectedFields,\n limitNumber: this.limitNumber,\n skipNumber: this.skipNumber,\n included: this.included,\n filterTree,\n orderBy: this.orderBy,\n queryText: this.queryText,\n searchMode: this.searchMode,\n isFuzzy: this.isFuzzy,\n }\n }\n\n fields(...fields: string[]): WixDataSearch {\n return this.copy({\n projectedFields: [...this.projectedFields, ...fields],\n })\n }\n\n limit(limitNumber: number) {\n const [invalidArguments] = this.queryValidator('.limit')\n .arityIsOne(arguments)\n .isPositiveNumber(limitNumber)\n .isInteger(limitNumber)\n .validateAndAggregate()\n return this.copy({\n invalidArguments,\n limitNumber,\n })\n }\n\n skip(skipNumber: number) {\n const [invalidArguments] = this.queryValidator('.skip')\n .arityIsOne(arguments)\n .isNonNegativeNumber(skipNumber)\n .isInteger(skipNumber)\n .validateAndAggregate()\n return this.copy({\n invalidArguments,\n skipNumber,\n })\n }\n\n include(...fieldNames: string[]): WixDataSearch\n\n include(fieldName: string, limit?: number): WixDataSearch\n\n include(fieldName1: string, fieldName2: string, limit?: number): WixDataSearch\n\n include(\n fieldName1: string,\n fieldName2: string,\n fieldName3: string,\n limit?: number\n ): WixDataSearch\n\n include(\n fieldName1: string,\n fieldName2: string,\n fieldName3: string,\n fieldName4: string,\n limit?: number\n ): WixDataSearch\n\n include(\n fieldName1: string,\n fieldName2: string,\n fieldName3: string,\n fieldName4: string,\n fieldName5: string,\n limit?: number\n ): WixDataSearch\n\n include(...fieldNamesAndLimit: [...string[], number]): WixDataSearch\n\n include(...args: unknown[]): WixDataSearch {\n if (args.length === 0) {\n return this\n }\n\n const last = args[args.length - 1]\n const limit: number | undefined =\n typeof last === 'number' ? last : undefined\n\n const expectedFieldNameCount =\n limit === undefined ? args.length : args.length - 1\n\n const newIncludes = args\n .slice(0, expectedFieldNameCount)\n .map((fieldName) => ({\n fieldName: fieldName as string,\n limit,\n }))\n\n const [invalidArguments] = args\n .slice(0, expectedFieldNameCount)\n .reduce<QueryValidator>(\n (validator: QueryValidator, value: unknown, _, __) =>\n validator.nonEmptyString(value),\n this.queryValidator('.include')\n )\n .validateAndAggregate()\n\n return this.copy({\n invalidArguments,\n included: [...this.included, ...newIncludes],\n })\n }\n\n private queryValidator(\n operatorName: string,\n invalidArguments = this.ownInvalidArguments\n ) {\n return new QueryValidator(operatorName, invalidArguments)\n }\n}\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAsBO,MAAMG,iBAAiB,SACpBC,oBAAS,CAEnB;EAiBEC,WAAWA,CAACC,MAaX,EAAE;IACD,KAAK,CAACA,MAAM,CAAC;IAAA,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACb,IAAI,CAACC,eAAe,GAAG,CAAAH,MAAM,oBAANA,MAAM,CAAEG,eAAe,KAAI,EAAE;IACpD,IAAI,CAACC,WAAW,GAAGJ,MAAM,oBAANA,MAAM,CAAEI,WAAW;IACtC,IAAI,CAACC,UAAU,GAAG,CAAAL,MAAM,oBAANA,MAAM,CAAEK,UAAU,KAAI,CAAC;IACzC,IAAI,CAACC,QAAQ,GAAG,CAAAN,MAAM,oBAANA,MAAM,CAAEM,QAAQ,KAAI,EAAE;IACtC,IAAI,CAACC,mBAAmB,GAAGP,MAAM,CAACQ,gBAAgB,IAAI,EAAE;IACxD,IAAI,CAACC,SAAS,GAAGT,MAAM,CAACS,SAAS;IACjC,IAAI,CAACC,UAAU,GAAGV,MAAM,CAACU,UAAU;IACnC,IAAI,CAACC,OAAO,GAAGX,MAAM,CAACW,OAAO;IAC7B,IAAI,CAACC,KAAK,GAAGZ,MAAM,CAACY,KAAK;EAC3B;EAEmBC,IAAIA,CAACC,MAWvB,EAAqB;IACpB,OAAO,IAAIjB,iBAAiB,CAAC;MAC3B,GAAG,IAAI;MACPkB,aAAa,EAAED,MAAM,CAACC,aAAa,IAAI,IAAI,CAACA,aAAa;MACzDZ,eAAe,EAAEW,MAAM,CAACX,eAAe,IAAI,IAAI,CAACA,eAAe;MAC/DC,WAAW,EAAEU,MAAM,CAACV,WAAW,IAAI,IAAI,CAACA,WAAW;MACnDC,UAAU,EAAES,MAAM,CAACT,UAAU,IAAI,IAAI,CAACA,UAAU;MAChDC,QAAQ,EAAEQ,MAAM,CAACR,QAAQ,IAAI,IAAI,CAACA,QAAQ;MAC1CU,IAAI,EAAEF,MAAM,CAACE,IAAI,IAAI,IAAI,CAACA,IAAI;MAC9BR,gBAAgB,EAAEM,MAAM,CAACN,gBAAgB,IAAI,IAAI,CAACD,mBAAmB;MACrEE,SAAS,EAAEK,MAAM,CAACL,SAAS,IAAI,IAAI,CAACA,SAAS;MAC7CC,UAAU,EAAEI,MAAM,CAACJ,UAAU,IAAI,IAAI,CAACA,UAAU;MAChDC,OAAO,EAAEG,MAAM,CAACH,OAAO,IAAI,IAAI,CAACA,OAAO;MACvCC,KAAK,EAAE,IAAI,CAACA;IACd,CAAC,CAAC;EACJ;EAEAK,UAAUA,CAACR,SAAiB,EAAiB;IAC3C,OAAO,IAAI,CAACI,IAAI,CAAC;MAAEJ;IAAU,CAAC,CAAC;EACjC;EAEAS,OAAOA,CAAA,EAAkB;IACvB,OAAO,IAAI,CAACL,IAAI,CAAC;MAAEH,UAAU,EAAES,WAAI,CAACC;IAAI,CAAC,CAAC;EAC5C;EAEAC,MAAMA,CAAA,EAAkB;IACtB,OAAO,IAAI,CAACR,IAAI,CAAC;MAAEH,UAAU,EAAES,WAAI,CAACG;IAAG,CAAC,CAAC;EAC3C;EAEAC,KAAKA,CAAA,EAAkB;IACrB,OAAO,IAAI,CAACV,IAAI,CAAC;MAAEF,OAAO,EAAE;IAAK,CAAC,CAAC;EACrC;EAEAa,GAAGA,CAACC,OAA4B,EAA0B;IACxD,OAAO,IAAI,CAACb,KAAK,CAAC,IAAI,CAACc,cAAc,CAAC,CAAC,EAAED,OAAO,CAAC;EACnD;EAEA,IAAIjB,gBAAgBA,CAAA,EAAa;IAC/B,OAAO,CACL,GAAG,IAAI,CAACD,mBAAmB,EAC3B,GAAG,IAAI,CAACQ,aAAa,CAACP,gBAAgB,EACtC,GAAG,IAAI,CAACQ,IAAI,CAACR,gBAAgB,CAC9B;EACH;EAEQkB,cAAcA,CAAA,EAAiB;IACrC,IAAIC,UAAU;IACd,IAAI;MACF;MACAA,UAAU,GAAG,IAAI,CAACZ,aAAa,CAACa,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,OAAOC,MAAe,EAAE;MACxBF,UAAU,GAAG,IAAI,CAACZ,aAAa,CAACY,UAAU;IAC5C;IACA,OAAO;MACLG,cAAc,EAAE,IAAI,CAACA,cAAc;MACnCtB,gBAAgB,EAAE,IAAI,CAACA,gBAAgB;MACvCL,eAAe,EAAE,IAAI,CAACA,eAAe;MACrCC,WAAW,EAAE,IAAI,CAACA,WAAW;MAC7BC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,QAAQ,EAAE,IAAI,CAACA,QAAQ;MACvBqB,UAAU;MACVI,OAAO,EAAE,IAAI,CAACA,OAAO;MACrBtB,SAAS,EAAE,IAAI,CAACA,SAAS;MACzBC,UAAU,EAAE,IAAI,CAACA,UAAU;MAC3BC,OAAO,EAAE,IAAI,CAACA;IAChB,CAAC;EACH;EAEAqB,MAAMA,CAAC,GAAGA,MAAgB,EAAiB;IACzC,OAAO,IAAI,CAACnB,IAAI,CAAC;MACfV,eAAe,EAAE,CAAC,GAAG,IAAI,CAACA,eAAe,EAAE,GAAG6B,MAAM;IACtD,CAAC,CAAC;EACJ;EAEAC,KAAKA,CAAC7B,WAAmB,EAAE;IACzB,MAAM,CAACI,gBAAgB,CAAC,GAAG,IAAI,CAAC0B,cAAc,CAAC,QAAQ,CAAC,CACrDC,UAAU,CAACC,SAAS,CAAC,CACrBC,gBAAgB,CAACjC,WAAW,CAAC,CAC7BkC,SAAS,CAAClC,WAAW,CAAC,CACtBmC,oBAAoB,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC1B,IAAI,CAAC;MACfL,gBAAgB;MAChBJ;IACF,CAAC,CAAC;EACJ;EAEAoC,IAAIA,CAACnC,UAAkB,EAAE;IACvB,MAAM,CAACG,gBAAgB,CAAC,GAAG,IAAI,CAAC0B,cAAc,CAAC,OAAO,CAAC,CACpDC,UAAU,CAACC,SAAS,CAAC,CACrBK,mBAAmB,CAACpC,UAAU,CAAC,CAC/BiC,SAAS,CAACjC,UAAU,CAAC,CACrBkC,oBAAoB,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC1B,IAAI,CAAC;MACfL,gBAAgB;MAChBH;IACF,CAAC,CAAC;EACJ;EAkCAqC,OAAOA,CAAC,GAAGC,IAAe,EAAiB;IACzC,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO,IAAI;IACb;IAEA,MAAMC,IAAI,GAAGF,IAAI,CAACA,IAAI,CAACC,MAAM,GAAG,CAAC,CAAC;IAClC,MAAMX,KAAyB,GAC7B,OAAOY,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGC,SAAS;IAE7C,MAAMC,sBAAsB,GAC1Bd,KAAK,KAAKa,SAAS,GAAGH,IAAI,CAACC,MAAM,GAAGD,IAAI,CAACC,MAAM,GAAG,CAAC;IAErD,MAAMI,WAAW,GAAGL,IAAI,CACrBM,KAAK,CAAC,CAAC,EAAEF,sBAAsB,CAAC,CAChCG,GAAG,CAAEC,SAAS,KAAM;MACnBA,SAAS,EAAEA,SAAmB;MAC9BlB;IACF,CAAC,CAAC,CAAC;IAEL,MAAM,CAACzB,gBAAgB,CAAC,GAAGmC,IAAI,CAC5BM,KAAK,CAAC,CAAC,EAAEF,sBAAsB,CAAC,CAChCK,MAAM,CACL,CAACC,SAAyB,EAAEC,KAAc,EAAEC,CAAC,EAAEC,EAAE,KAC/CH,SAAS,CAACI,cAAc,CAACH,KAAK,CAAC,EACjC,IAAI,CAACpB,cAAc,CAAC,UAAU,CAChC,CAAC,CACAK,oBAAoB,CAAC,CAAC;IAEzB,OAAO,IAAI,CAAC1B,IAAI,CAAC;MACfL,gBAAgB;MAChBF,QAAQ,EAAE,CAAC,GAAG,IAAI,CAACA,QAAQ,EAAE,GAAG0C,WAAW;IAC7C,CAAC,CAAC;EACJ;EAEQd,cAAcA,CACpBwB,YAAoB,EACpBlD,gBAAgB,GAAG,IAAI,CAACD,mBAAmB,EAC3C;IACA,OAAO,IAAIoD,8BAAc,CAACD,YAAY,EAAElD,gBAAgB,CAAC;EAC3D;AACF;AAACoD,OAAA,CAAA/D,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
package/dist/cjs/api/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.WixDataUpdateOptions = exports.WixDataResult = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataFilter = exports.WixDataBulkResult = exports.WixDataBulkPatch = exports.WixDataBulkError = exports.WixDataApi = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.QueryValidator = exports.QueryBase = void 0;
|
|
4
|
+
exports.WixDataUpdateOptions = exports.WixDataSearch = exports.WixDataResult = exports.WixDataReference = exports.WixDataReadWithProjectionOptions = exports.WixDataReadOptions = exports.WixDataQueryReferencedOptions = exports.WixDataQueryOptions = exports.WixDataQuery = exports.WixDataPatchOptions = exports.WixDataPatch = exports.WixDataOptions = exports.WixDataItem = exports.WixDataFilter = exports.WixDataBulkResult = exports.WixDataBulkPatch = exports.WixDataBulkError = exports.WixDataApi = exports.WixDataAggregateOptions = exports.WixDataAggregate = exports.QueryValidator = exports.QueryBase = void 0;
|
|
5
5
|
var _WixDataQuery = require("./WixDataQuery");
|
|
6
6
|
exports.WixDataQuery = _WixDataQuery.WixDataQuery;
|
|
7
|
+
var _WixDataSearch = require("./WixDataSearch");
|
|
8
|
+
exports.WixDataSearch = _WixDataSearch.WixDataSearch;
|
|
7
9
|
var _WixDataApi = require("./WixDataApi");
|
|
8
10
|
exports.WixDataApi = _WixDataApi.WixDataApi;
|
|
9
11
|
var _WixDataResult = require("./WixDataResult");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_WixDataQuery","require","exports","WixDataQuery","_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 { 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,
|
|
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,UAAA,GAAAb,OAAA;AAAuCC,OAAA,CAAAa,SAAA,GAAAD,UAAA,CAAAC,SAAA;AACvC,IAAAC,aAAA,GAAAf,OAAA;AAA+DC,OAAA,CAAAe,YAAA,GAAAD,aAAA,CAAAC,YAAA;AAAAf,OAAA,CAAAgB,gBAAA,GAAAF,aAAA,CAAAE,gBAAA;AAC/D,IAAAC,cAAA,GAAAlB,OAAA;AAA+CC,OAAA,CAAAkB,aAAA,GAAAD,cAAA,CAAAC,aAAA;AAC/C,IAAAC,MAAA,GAAApB,OAAA;AAagBC,OAAA,CAAAoB,cAAA,GAAAD,MAAA,CAAAC,cAAA;AAAApB,OAAA,CAAAqB,kBAAA,GAAAF,MAAA,CAAAE,kBAAA;AAAArB,OAAA,CAAAsB,gCAAA,GAAAH,MAAA,CAAAG,gCAAA;AAAAtB,OAAA,CAAAuB,oBAAA,GAAAJ,MAAA,CAAAI,oBAAA;AAAAvB,OAAA,CAAAwB,mBAAA,GAAAL,MAAA,CAAAK,mBAAA;AAAAxB,OAAA,CAAAyB,mBAAA,GAAAN,MAAA,CAAAM,mBAAA;AAAAzB,OAAA,CAAA0B,WAAA,GAAAP,MAAA,CAAAO,WAAA;AAAA1B,OAAA,CAAA2B,gBAAA,GAAAR,MAAA,CAAAQ,gBAAA;AAAA3B,OAAA,CAAA4B,gBAAA,GAAAT,MAAA,CAAAS,gBAAA;AAAA5B,OAAA,CAAA6B,iBAAA,GAAAV,MAAA,CAAAU,iBAAA;AAAA7B,OAAA,CAAA8B,6BAAA,GAAAX,MAAA,CAAAW,6BAAA;AAAA9B,OAAA,CAAA+B,uBAAA,GAAAZ,MAAA,CAAAY,uBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/api.ts"],"sourcesContent":["import {\n AggregateDataItemsRequest,\n AggregateDataItemsResponse,\n BulkInsertDataItemReferencesRequest,\n BulkInsertDataItemReferencesResponse,\n BulkInsertDataItemsRequest,\n BulkInsertDataItemsResponse,\n BulkPatchDataItemsRequest,\n BulkPatchDataItemsResponse,\n BulkRemoveDataItemReferencesRequest,\n BulkRemoveDataItemReferencesResponse,\n BulkRemoveDataItemsRequest,\n BulkRemoveDataItemsResponse,\n BulkSaveDataItemsRequest,\n BulkSaveDataItemsResponse,\n BulkUpdateDataItemsRequest,\n BulkUpdateDataItemsResponse,\n CountDataItemsRequest,\n CountDataItemsResponse,\n GetDataItemRequest,\n GetDataItemResponse,\n InsertDataItemRequest,\n InsertDataItemResponse,\n IsReferencedDataItemRequest,\n IsReferencedDataItemResponse,\n PatchDataItemRequest,\n PatchDataItemResponse,\n QueryDataItemsRequest,\n QueryDataItemsResponse,\n QueryDistinctValuesRequest,\n QueryDistinctValuesResponse,\n QueryReferencedDataItemsRequest,\n QueryReferencedDataItemsResponse,\n RemoveDataItemRequest,\n RemoveDataItemResponse,\n ReplaceDataItemReferencesRequest,\n ReplaceDataItemReferencesResponse,\n SaveDataItemRequest,\n SaveDataItemResponse,\n TruncateDataItemsRequest,\n TruncateDataItemsResponse,\n UpdateDataItemRequest,\n UpdateDataItemResponse,\n} from './data-item-types'\n\nexport interface HttpApiClient {\n getDataItem(r: GetDataItemRequest): Promise<HttpResponse<GetDataItemResponse>>\n\n insertDataItem(\n r: InsertDataItemRequest\n ): Promise<HttpResponse<InsertDataItemResponse>>\n\n saveDataItem(\n r: SaveDataItemRequest\n ): Promise<HttpResponse<SaveDataItemResponse>>\n\n updateDataItem(\n r: UpdateDataItemRequest\n ): Promise<HttpResponse<UpdateDataItemResponse>>\n\n patchDataItem(\n r: PatchDataItemRequest\n ): Promise<HttpResponse<PatchDataItemResponse>>\n\n removeDataItem(\n r: RemoveDataItemRequest\n ): Promise<HttpResponse<RemoveDataItemResponse>>\n\n countDataItems(\n r: CountDataItemsRequest\n ): Promise<HttpResponse<CountDataItemsResponse>>\n\n queryDistinctValues(\n r: QueryDistinctValuesRequest\n ): Promise<HttpResponse<QueryDistinctValuesResponse>>\n\n queryDataItems(\n r: QueryDataItemsRequest\n ): Promise<HttpResponse<QueryDataItemsResponse>>\n\n aggregateDataItems(\n r: AggregateDataItemsRequest\n ): Promise<HttpResponse<AggregateDataItemsResponse>>\n\n bulkInsertDataItems(\n r: BulkInsertDataItemsRequest\n ): Promise<HttpResponse<BulkInsertDataItemsResponse>>\n\n bulkUpdateDataItems(\n r: BulkUpdateDataItemsRequest\n ): Promise<HttpResponse<BulkUpdateDataItemsResponse>>\n\n bulkPatchDataItems(\n r: BulkPatchDataItemsRequest\n ): Promise<HttpResponse<BulkPatchDataItemsResponse>>\n\n bulkSaveDataItems(\n r: BulkSaveDataItemsRequest\n ): Promise<HttpResponse<BulkSaveDataItemsResponse>>\n\n bulkRemoveDataItems(\n r: BulkRemoveDataItemsRequest\n ): Promise<HttpResponse<BulkRemoveDataItemsResponse>>\n\n queryReferencedDataItems(\n r: QueryReferencedDataItemsRequest\n ): Promise<HttpResponse<QueryReferencedDataItemsResponse>>\n\n bulkInsertDataItemReferences(\n r: BulkInsertDataItemReferencesRequest\n ): Promise<HttpResponse<BulkInsertDataItemReferencesResponse>>\n\n replaceDataItemReferences(\n r: ReplaceDataItemReferencesRequest\n ): Promise<HttpResponse<ReplaceDataItemReferencesResponse>>\n\n bulkRemoveDataItemReferences(\n r: BulkRemoveDataItemReferencesRequest\n ): Promise<HttpResponse<BulkRemoveDataItemReferencesResponse>>\n\n isReferencedDataItem(\n r: IsReferencedDataItemRequest\n ): Promise<HttpResponse<IsReferencedDataItemResponse>>\n\n truncateDataItems(\n r: TruncateDataItemsRequest\n ): Promise<HttpResponse<TruncateDataItemsResponse>>\n}\n\nexport interface HttpResponse<T> {\n data: T\n}\n\nexport interface Request {\n data?: any\n url?: string\n methodFqn?: string\n method?: string\n}\n\nexport type RequestInterceptor<R extends Request> = (req: R) => R\n\nexport type HttpApiClientFactory<R extends Request> = (\n requestInterceptor: RequestInterceptor<R>\n) => HttpApiClient\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/api.ts"],"sourcesContent":["import {\n AggregateDataItemsRequest,\n AggregateDataItemsResponse,\n BulkInsertDataItemReferencesRequest,\n BulkInsertDataItemReferencesResponse,\n BulkInsertDataItemsRequest,\n BulkInsertDataItemsResponse,\n BulkPatchDataItemsRequest,\n BulkPatchDataItemsResponse,\n BulkRemoveDataItemReferencesRequest,\n BulkRemoveDataItemReferencesResponse,\n BulkRemoveDataItemsRequest,\n BulkRemoveDataItemsResponse,\n BulkSaveDataItemsRequest,\n BulkSaveDataItemsResponse,\n BulkUpdateDataItemsRequest,\n BulkUpdateDataItemsResponse,\n CountDataItemsRequest,\n CountDataItemsResponse,\n GetDataItemRequest,\n GetDataItemResponse,\n InsertDataItemRequest,\n InsertDataItemResponse,\n IsReferencedDataItemRequest,\n IsReferencedDataItemResponse,\n PatchDataItemRequest,\n PatchDataItemResponse,\n QueryDataItemsRequest,\n QueryDataItemsResponse,\n QueryDistinctValuesRequest,\n QueryDistinctValuesResponse,\n QueryReferencedDataItemsRequest,\n QueryReferencedDataItemsResponse,\n RemoveDataItemRequest,\n RemoveDataItemResponse,\n ReplaceDataItemReferencesRequest,\n ReplaceDataItemReferencesResponse,\n SaveDataItemRequest,\n SaveDataItemResponse,\n SearchDataItemsRequest,\n SearchDataItemsResponse,\n TruncateDataItemsRequest,\n TruncateDataItemsResponse,\n UpdateDataItemRequest,\n UpdateDataItemResponse,\n} from './data-item-types'\n\nexport interface HttpApiClient {\n getDataItem(r: GetDataItemRequest): Promise<HttpResponse<GetDataItemResponse>>\n\n insertDataItem(\n r: InsertDataItemRequest\n ): Promise<HttpResponse<InsertDataItemResponse>>\n\n saveDataItem(\n r: SaveDataItemRequest\n ): Promise<HttpResponse<SaveDataItemResponse>>\n\n updateDataItem(\n r: UpdateDataItemRequest\n ): Promise<HttpResponse<UpdateDataItemResponse>>\n\n patchDataItem(\n r: PatchDataItemRequest\n ): Promise<HttpResponse<PatchDataItemResponse>>\n\n removeDataItem(\n r: RemoveDataItemRequest\n ): Promise<HttpResponse<RemoveDataItemResponse>>\n\n countDataItems(\n r: CountDataItemsRequest\n ): Promise<HttpResponse<CountDataItemsResponse>>\n\n queryDistinctValues(\n r: QueryDistinctValuesRequest\n ): Promise<HttpResponse<QueryDistinctValuesResponse>>\n\n queryDataItems(\n r: QueryDataItemsRequest\n ): Promise<HttpResponse<QueryDataItemsResponse>>\n\n aggregateDataItems(\n r: AggregateDataItemsRequest\n ): Promise<HttpResponse<AggregateDataItemsResponse>>\n\n bulkInsertDataItems(\n r: BulkInsertDataItemsRequest\n ): Promise<HttpResponse<BulkInsertDataItemsResponse>>\n\n bulkUpdateDataItems(\n r: BulkUpdateDataItemsRequest\n ): Promise<HttpResponse<BulkUpdateDataItemsResponse>>\n\n bulkPatchDataItems(\n r: BulkPatchDataItemsRequest\n ): Promise<HttpResponse<BulkPatchDataItemsResponse>>\n\n bulkSaveDataItems(\n r: BulkSaveDataItemsRequest\n ): Promise<HttpResponse<BulkSaveDataItemsResponse>>\n\n bulkRemoveDataItems(\n r: BulkRemoveDataItemsRequest\n ): Promise<HttpResponse<BulkRemoveDataItemsResponse>>\n\n queryReferencedDataItems(\n r: QueryReferencedDataItemsRequest\n ): Promise<HttpResponse<QueryReferencedDataItemsResponse>>\n\n bulkInsertDataItemReferences(\n r: BulkInsertDataItemReferencesRequest\n ): Promise<HttpResponse<BulkInsertDataItemReferencesResponse>>\n\n replaceDataItemReferences(\n r: ReplaceDataItemReferencesRequest\n ): Promise<HttpResponse<ReplaceDataItemReferencesResponse>>\n\n bulkRemoveDataItemReferences(\n r: BulkRemoveDataItemReferencesRequest\n ): Promise<HttpResponse<BulkRemoveDataItemReferencesResponse>>\n\n isReferencedDataItem(\n r: IsReferencedDataItemRequest\n ): Promise<HttpResponse<IsReferencedDataItemResponse>>\n\n truncateDataItems(\n r: TruncateDataItemsRequest\n ): Promise<HttpResponse<TruncateDataItemsResponse>>\n\n searchDataItems(\n r: SearchDataItemsRequest\n ): Promise<HttpResponse<SearchDataItemsResponse>>\n}\n\nexport interface HttpResponse<T> {\n data: T\n}\n\nexport interface Request {\n data?: any\n url?: string\n methodFqn?: string\n method?: string\n}\n\nexport type RequestInterceptor<R extends Request> = (req: R) => R\n\nexport type HttpApiClientFactory<R extends Request> = (\n requestInterceptor: RequestInterceptor<R>\n) => HttpApiClient\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.SortOrder = exports.Environment = exports.BulkActionType = exports.Action = exports.ACTION = void 0;
|
|
4
|
+
exports.SortOrder = exports.Mode = exports.Environment = exports.BulkActionType = exports.Action = exports.ACTION = void 0;
|
|
5
5
|
let Environment = exports.Environment = /*#__PURE__*/function (Environment) {
|
|
6
6
|
Environment["LIVE"] = "LIVE";
|
|
7
7
|
Environment["SANDBOX"] = "SANDBOX";
|
|
@@ -43,4 +43,10 @@ let SortOrder = exports.SortOrder = /*#__PURE__*/function (SortOrder) {
|
|
|
43
43
|
/** @oneof */
|
|
44
44
|
/** @oneof */
|
|
45
45
|
/** @oneof */
|
|
46
|
+
/** @oneof */
|
|
47
|
+
let Mode = exports.Mode = /*#__PURE__*/function (Mode) {
|
|
48
|
+
Mode["OR"] = "OR";
|
|
49
|
+
Mode["AND"] = "AND";
|
|
50
|
+
return Mode;
|
|
51
|
+
}({});
|
|
46
52
|
//# sourceMappingURL=data-item-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Environment","exports","ACTION","BulkActionType","Action","SortOrder"],"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"],"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","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"],"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;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA","ignoreList":[]}
|
|
@@ -153,6 +153,12 @@ export class ApiClient {
|
|
|
153
153
|
return parseDates(response.data);
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
+
async searchDataItems(r) {
|
|
157
|
+
return this.withErrorHandling(async () => {
|
|
158
|
+
const response = await this.httpApiClient.searchDataItems(r);
|
|
159
|
+
return parseDates(response.data);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
156
162
|
async withErrorHandling(call) {
|
|
157
163
|
try {
|
|
158
164
|
return await call();
|