@wix/wix-data-items-common 1.0.97 → 1.0.99
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/WixDataAggregate.js.map +1 -1
- package/dist/cjs/api/WixDataApi.js +28 -20
- package/dist/cjs/api/WixDataApi.js.map +1 -1
- package/dist/cjs/api/WixDataPatch.js.map +1 -1
- package/dist/cjs/api/impl/WixDataAggregateImpl.js.map +1 -1
- package/dist/cjs/api/impl/WixDataPatchImpl.js.map +1 -1
- package/dist/cjs/api/index.js +4 -1
- package/dist/cjs/api/index.js.map +1 -1
- package/dist/cjs/api/types.js.map +1 -1
- package/dist/cjs/types/data-item-types.js.map +1 -1
- package/dist/esm/api/WixDataApi.js +26 -16
- package/dist/esm/api/WixDataApi.js.map +1 -1
- package/dist/esm/api/impl/WixDataAggregateImpl.js.map +1 -1
- package/dist/esm/api/impl/WixDataPatchImpl.js.map +1 -1
- package/dist/esm/types/data-item-types.js.map +1 -1
- package/dist/types/api/WixDataAggregate.d.ts +2 -2
- package/dist/types/api/WixDataAggregate.d.ts.map +1 -1
- package/dist/types/api/WixDataApi.d.ts.map +1 -1
- package/dist/types/api/WixDataPatch.d.ts +38 -34
- package/dist/types/api/WixDataPatch.d.ts.map +1 -1
- package/dist/types/api/impl/WixDataAggregateImpl.d.ts +3 -3
- package/dist/types/api/impl/WixDataAggregateImpl.d.ts.map +1 -1
- package/dist/types/api/impl/WixDataPatchImpl.d.ts +5 -5
- package/dist/types/api/impl/WixDataPatchImpl.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +1 -1
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/types.d.ts +18 -6
- package/dist/types/api/types.d.ts.map +1 -1
- package/dist/types/types/data-item-types.d.ts +37 -14
- package/dist/types/types/data-item-types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/api/WixDataAggregate.ts"],"sourcesContent":["import { WixDataFilter } from './WixDataFilter'\nimport { WixDataReadOptions } from './types'\nimport { WixDataResult } from './WixDataResult'\n\n/**\n * @builder\n */\nexport interface WixDataAggregate {\n /**\n * Refines a `WixDataAggregate` to contain the sum from each aggregation group.\n *\n * The `sum()` method refines a `WixDataAggregate` to contain the sum of the\n * values from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldSum\"`, where `field` is the name of the specified field.\n * - The value is the sum of the values found in the specified field.\n *\n * Sums can only be calculated on fields of type Number.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the sum.\n * @requiredField field\n * @param projectedField - Name of the field in the aggregation results containing the sum.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n sum(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the average value from each aggregation group.\n *\n * The `avg()` method refines a `WixDataAggregate` to contain the average\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldAvg\"`, where `field` is the name of the specified field.\n * - The value is the average of the values found in the specified field.\n *\n * Averages can only be calculated on fields of type Number.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the average value.\n * @requiredField field\n * @param projectedField - Field in the aggregation results containing the average value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n avg(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the minimum value from each aggregation group.\n *\n * The `min()` method refines a `WixDataAggregate` to contain the minimum\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldMin\"`, where `field` is the name of the specified field.\n * - The value is the minimum value found in the specified field.\n *\n * The following types of fields can be compared to determine a minimum value:\n * - Number: Compares numerically.\n * - Date and Time: Compares JavaScript Date objects.\n * - Text: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Rich Text: Compares HTML source as text.\n * - URL: Compares as text.\n * - Image: Compares image source as text.\n * - Video: Compares video source as text.\n * - Document: Compares document source as text.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the minimum value.\n * @requiredField field\n * @param projectedField - Name of the field in the aggregation results containing the minimum value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n min(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the maximum value from each aggregation group.\n *\n * The `max()` method refines a `WixDataAggregate` to contain the maximum\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldMax\"`, where `field` is the name of the specified field.\n * - The value is the maximum value found in the specified field.\n *\n * The following types of fields can be compared to determine a maximum value:\n * - Number: Compares numerically.\n * - Date and Time: Compares JavaScript Date objects.\n * - Text: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Rich Text: Compares HTML source as text.\n * - URL: Compares as text.\n * - Image: Compares image source as text.\n * - Video: Compares video source as text.\n * - Document: Compares document source as text.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the maximum value.\n * @requiredField field\n * @param projectedField - Field in the aggregation results that contains the maximum value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n max(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to contain the item count of each group in the aggregation.\n *\n * The `count()` method refines a `WixDataAggregate` contains the item count in each of the aggregate's groups.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains items with the following additional key:value pair:\n * - The key is named `count`. You can set a custom key using the `projectedField` parameter.\n * - The value is the count of items aggregated in the group.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param projectedField - Field in the aggregation results that contains the count value. Default: `count`.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n count(projectedField?: string): WixDataAggregate\n\n /**\n * Filters out items from being used in an aggregation.\n *\n * The `filter()` method refines a `WixDataAggregate` so that it only\n * includes items from the aggregate's collection which match the specified\n * filter criteria.\n *\n * To create a filter, use the wix-data `filter()` method.\n *\n * Filtering using `filter()` takes place before grouping is performed on the\n * aggregation. To filter grouped results, use the `having()` method.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to use to filter out items from being used in the aggregation.\n * @requiredField filter\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n filter(filter: WixDataFilter): WixDataAggregate\n\n /**\n * Groups items together in an aggregation.\n *\n * The `group()` method refines a `WixDataAggregate` so that its items are\n * grouped by the specified field or fields.\n *\n * You can perform aggregations on the groups using the following methods:\n * - `avg()`\n * - `count()`\n * - `max()`\n * - `min()`\n * - `sum()`\n *\n * To filter grouped results, use the `having()` method.\n *\n * > **Notes:**\n * > - Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * > - You can only call the `group()` method once per aggregate query.\n * @public\n * @documentationMaturity preview\n * @param field - Field or fields to group on.\n * @requiredField field\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n group(...field: string[]): WixDataAggregate\n\n /**\n * Filters out groups from being returned from an aggregation.\n *\n * The `having()` method refines a `WixDataAggregate` so that it only\n * includes groups from the aggregate's grouping which match the specified\n * filter criteria.\n *\n * To create a filter, use the wix-data `filter()` method.\n *\n * Filtering using `having()` takes place after grouping is performed on the\n * aggregation. To filter items before grouping, use the `filter()` method.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be used in [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to use to filter out groups from being returned from the aggregation.\n * @requiredField filter\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n having(filter: WixDataFilter): WixDataAggregate\n\n /**\n * Limits the number of items or groups the aggregation returns.\n *\n * The `limit()` method defines the number of results an aggregation returns in each\n * page. Only one page of results is retrieved at a time. The `next()`\n * method is used to navigate the pages of a query result.\n *\n * By default, `limit` is set to `50`.\n *\n * The maximum value that `limit()` can accept is `1000`.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param limit - Number of items or groups to return.\n * @requiredField limit\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n limit(limit: number): WixDataAggregate\n\n /**\n * Sets the number of items or groups to skip before returning aggregation results.\n *\n * The `skip()` method defines the number of results to skip in the aggregation\n * results before returning new aggregation results.\n *\n * For example, if you perform an aggregation on a collection and 10 groups match\n * your aggregation, but you set `skip` to 3, the results returned will skip\n * the first 3 groups that match and return the 4th through 10th items.\n *\n * By default, `skip` is set to 0.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param skip - Number of items or groups to skip in the aggregation results before returning the results.\n * @requiredField skip\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n skip(skip: number): WixDataAggregate\n\n /**\n * Adds a sort to a query or sort, sorting by the specified fields in descending order.\n *\n * The `descending()` method refines this query to sort in descending order of the specified fields. If you\n * specify more than one field, descending() sorts the results in descending order by each field 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 field 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 field are ranked lowest.\n *\n * > **Note**: Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n descending(...fields: string[]): WixDataAggregate\n\n descending(fields: string[]): WixDataAggregate\n\n descending(...fields: any): WixDataAggregate\n\n /**\n * Adds a sort to a query or sort, sorting by the specified fields in ascending order.\n *\n * The `ascending()` method refines this query in ascending order of the specified fields. If you specify more\n * than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a field 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 field are ranked lowest.\n *\n * > **Note**: Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n ascending(...fields: string[]): WixDataAggregate\n\n ascending(fields: string[]): WixDataAggregate\n\n ascending(...fields: any): WixDataAggregate\n\n /**\n * Runs the aggregation and returns the results.\n *\n * The `run()` method returns a Promise that resolves to the results found\n * by the aggregation and some information about the results.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when running an aggregation.\n * @returns Promise that resolves to the results of the aggregation.\n */\n run(options?: WixDataReadOptions): Promise<WixDataResult<Record<string, any>>>\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/api/WixDataAggregate.ts"],"sourcesContent":["import { WixDataFilter } from './WixDataFilter'\nimport { WixDataAggregateOptions } from './types'\nimport { WixDataResult } from './WixDataResult'\n\n/**\n * @builder\n */\nexport interface WixDataAggregate {\n /**\n * Refines a `WixDataAggregate` to contain the sum from each aggregation group.\n *\n * The `sum()` method refines a `WixDataAggregate` to contain the sum of the\n * values from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldSum\"`, where `field` is the name of the specified field.\n * - The value is the sum of the values found in the specified field.\n *\n * Sums can only be calculated on fields of type Number.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the sum.\n * @requiredField field\n * @param projectedField - Name of the field in the aggregation results containing the sum.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n sum(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the average value from each aggregation group.\n *\n * The `avg()` method refines a `WixDataAggregate` to contain the average\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldAvg\"`, where `field` is the name of the specified field.\n * - The value is the average of the values found in the specified field.\n *\n * Averages can only be calculated on fields of type Number.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the average value.\n * @requiredField field\n * @param projectedField - Field in the aggregation results containing the average value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n avg(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the minimum value from each aggregation group.\n *\n * The `min()` method refines a `WixDataAggregate` to contain the minimum\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldMin\"`, where `field` is the name of the specified field.\n * - The value is the minimum value found in the specified field.\n *\n * The following types of fields can be compared to determine a minimum value:\n * - Number: Compares numerically.\n * - Date and Time: Compares JavaScript Date objects.\n * - Text: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Rich Text: Compares HTML source as text.\n * - URL: Compares as text.\n * - Image: Compares image source as text.\n * - Video: Compares video source as text.\n * - Document: Compares document source as text.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the minimum value.\n * @requiredField field\n * @param projectedField - Name of the field in the aggregation results containing the minimum value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n min(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to only contain the maximum value from each aggregation group.\n *\n * The `max()` method refines a `WixDataAggregate` to contain the maximum\n * value from the specified field for each aggregated group or from the\n * whole collection if no group is defined.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains an item for each group with the following key:value pairs:\n * - If a value was passed for the optional `projectedField`, the key is named\n * using that value. Otherwise, the key is named using the following format:\n * `\"fieldMax\"`, where `field` is the name of the specified field.\n * - The value is the maximum value found in the specified field.\n *\n * The following types of fields can be compared to determine a maximum value:\n * - Number: Compares numerically.\n * - Date and Time: Compares JavaScript Date objects.\n * - Text: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Rich Text: Compares HTML source as text.\n * - URL: Compares as text.\n * - Image: Compares image source as text.\n * - Video: Compares video source as text.\n * - Document: Compares document source as text.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to find the maximum value.\n * @requiredField field\n * @param projectedField - Field in the aggregation results that contains the maximum value.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n max(field: string, projectedField?: string): WixDataAggregate\n\n /**\n * Refines a `WixDataAggregate` to contain the item count of each group in the aggregation.\n *\n * The `count()` method refines a `WixDataAggregate` contains the item count in each of the aggregate's groups.\n *\n * When the aggregation is `run()`, the returned `WixDataAggregateResult`\n * object contains items with the following additional key:value pair:\n * - The key is named `count`. You can set a custom key using the `projectedField` parameter.\n * - The value is the count of items aggregated in the group.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param projectedField - Field in the aggregation results that contains the count value. Default: `count`.\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n count(projectedField?: string): WixDataAggregate\n\n /**\n * Filters out items from being used in an aggregation.\n *\n * The `filter()` method refines a `WixDataAggregate` so that it only\n * includes items from the aggregate's collection which match the specified\n * filter criteria.\n *\n * To create a filter, use the wix-data `filter()` method.\n *\n * Filtering using `filter()` takes place before grouping is performed on the\n * aggregation. To filter grouped results, use the `having()` method.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to use to filter out items from being used in the aggregation.\n * @requiredField filter\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n filter(filter: WixDataFilter): WixDataAggregate\n\n /**\n * Groups items together in an aggregation.\n *\n * The `group()` method refines a `WixDataAggregate` so that its items are\n * grouped by the specified field or fields.\n *\n * You can perform aggregations on the groups using the following methods:\n * - `avg()`\n * - `count()`\n * - `max()`\n * - `min()`\n * - `sum()`\n *\n * To filter grouped results, use the `having()` method.\n *\n * > **Notes:**\n * > - Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * > - You can only call the `group()` method once per aggregate query.\n * @public\n * @documentationMaturity preview\n * @param field - Field or fields to group on.\n * @requiredField field\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n group(...field: string[]): WixDataAggregate\n\n /**\n * Filters out groups from being returned from an aggregation.\n *\n * The `having()` method refines a `WixDataAggregate` so that it only\n * includes groups from the aggregate's grouping which match the specified\n * filter criteria.\n *\n * To create a filter, use the wix-data `filter()` method.\n *\n * Filtering using `having()` takes place after grouping is performed on the\n * aggregation. To filter items before grouping, use the `filter()` method.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be used in [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to use to filter out groups from being returned from the aggregation.\n * @requiredField filter\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n having(filter: WixDataFilter): WixDataAggregate\n\n /**\n * Limits the number of items or groups the aggregation returns.\n *\n * The `limit()` method defines the number of results an aggregation returns in each\n * page. Only one page of results is retrieved at a time. The `next()`\n * method is used to navigate the pages of a query result.\n *\n * By default, `limit` is set to `50`.\n *\n * The maximum value that `limit()` can accept is `1000`.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param limit - Number of items or groups to return.\n * @requiredField limit\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n limit(limit: number): WixDataAggregate\n\n /**\n * Sets the number of items or groups to skip before returning aggregation results.\n *\n * The `skip()` method defines the number of results to skip in the aggregation\n * results before returning new aggregation results.\n *\n * For example, if you perform an aggregation on a collection and 10 groups match\n * your aggregation, but you set `skip` to 3, the results returned will skip\n * the first 3 groups that match and return the 4th through 10th items.\n *\n * By default, `skip` is set to 0.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param skip - Number of items or groups to skip in the aggregation results before returning the results.\n * @requiredField skip\n * @returns `WixDataAggregate` object representing the refined aggregation.\n */\n skip(skip: number): WixDataAggregate\n\n /**\n * Adds a sort to a query or sort, sorting by the specified fields in descending order.\n *\n * The `descending()` method refines this query to sort in descending order of the specified fields. If you\n * specify more than one field, descending() sorts the results in descending order by each field 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 field 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 field are ranked lowest.\n *\n * > **Note**: Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n descending(...fields: string[]): WixDataAggregate\n\n descending(fields: string[]): WixDataAggregate\n\n descending(...fields: any): WixDataAggregate\n\n /**\n * Adds a sort to a query or sort, sorting by the specified fields in ascending order.\n *\n * The `ascending()` method refines this query in ascending order of the specified fields. If you specify more\n * than one field, `ascending()` sorts the results in ascending order by each field in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a field 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 field are ranked lowest.\n *\n * > **Note**: Aggregations can only be used on collections you have created. They cannot be used on [Wix app collections](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n ascending(...fields: string[]): WixDataAggregate\n\n ascending(fields: string[]): WixDataAggregate\n\n ascending(...fields: any): WixDataAggregate\n\n /**\n * Runs the aggregation and returns the results.\n *\n * The `run()` method returns a Promise that resolves to the results found\n * by the aggregation and some information about the results.\n *\n * > **Note:** Aggregations can only be used on collections you have created. They cannot be\n * > used on [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code).\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when running an aggregation.\n * @returns Promise that resolves to the results of the aggregation.\n */\n run(\n options?: WixDataAggregateOptions\n ): Promise<WixDataResult<Record<string, any>>>\n}\n"],"mappings":""}
|
|
@@ -68,8 +68,7 @@ class WixDataApi {
|
|
|
68
68
|
id: item._id,
|
|
69
69
|
data: item
|
|
70
70
|
},
|
|
71
|
-
|
|
72
|
-
...toOptions(options)
|
|
71
|
+
...toUpdateOptions(options)
|
|
73
72
|
});
|
|
74
73
|
return toDataItem(dataItem);
|
|
75
74
|
});
|
|
@@ -88,8 +87,7 @@ class WixDataApi {
|
|
|
88
87
|
id: item._id,
|
|
89
88
|
data: item
|
|
90
89
|
},
|
|
91
|
-
...
|
|
92
|
-
includeReferencedItems: options == null ? void 0 : options.includeReferences
|
|
90
|
+
...toUpdateOptions(options)
|
|
93
91
|
});
|
|
94
92
|
return toDataItem(dataItem);
|
|
95
93
|
});
|
|
@@ -108,8 +106,7 @@ class WixDataApi {
|
|
|
108
106
|
id: item._id,
|
|
109
107
|
data: item
|
|
110
108
|
},
|
|
111
|
-
...
|
|
112
|
-
includeReferencedItems: options == null ? void 0 : options.includeReferences
|
|
109
|
+
...toUpdateOptions(options)
|
|
113
110
|
});
|
|
114
111
|
return toDataItem(dataItem);
|
|
115
112
|
});
|
|
@@ -190,7 +187,7 @@ class WixDataApi {
|
|
|
190
187
|
dataItemId: patchParams.itemId,
|
|
191
188
|
fieldModifications
|
|
192
189
|
},
|
|
193
|
-
...
|
|
190
|
+
...toPatchOptions(options)
|
|
194
191
|
});
|
|
195
192
|
return result.dataItem ? toDataItem(result.dataItem) : null;
|
|
196
193
|
});
|
|
@@ -215,7 +212,7 @@ class WixDataApi {
|
|
|
215
212
|
dataItemId: itemId,
|
|
216
213
|
fieldModifications
|
|
217
214
|
})),
|
|
218
|
-
...
|
|
215
|
+
...toPatchOptions(options)
|
|
219
216
|
});
|
|
220
217
|
return toBulkResult(itemIds, results, ['WDE0073']);
|
|
221
218
|
});
|
|
@@ -376,7 +373,7 @@ class WixDataApi {
|
|
|
376
373
|
});
|
|
377
374
|
return [unwrapAggregationId(results), pagingMetadata];
|
|
378
375
|
});
|
|
379
|
-
const [items, paging] = await fetch(params.skipNumber,
|
|
376
|
+
const [items, paging] = await fetch(params.skipNumber, options == null ? void 0 : options.returnTotalCount);
|
|
380
377
|
return new _WixDataResultImpl.WixDataResultImpl(items, paging, fetch, params);
|
|
381
378
|
}
|
|
382
379
|
});
|
|
@@ -592,7 +589,7 @@ class WixDataApi {
|
|
|
592
589
|
referringItemFieldName: relationshipAttribute,
|
|
593
590
|
referringItemId: itemId(left),
|
|
594
591
|
referencedItemId: itemId(right),
|
|
595
|
-
...
|
|
592
|
+
...toReadOptions(options),
|
|
596
593
|
consistentRead: options == null ? void 0 : options.consistentRead
|
|
597
594
|
});
|
|
598
595
|
return isReferenced;
|
|
@@ -646,6 +643,18 @@ function withArgs(fn) {
|
|
|
646
643
|
return fn(arguments, ...args);
|
|
647
644
|
};
|
|
648
645
|
}
|
|
646
|
+
function toPatchOptions(options) {
|
|
647
|
+
return {
|
|
648
|
+
suppressHooks: options == null ? void 0 : options.suppressHooks,
|
|
649
|
+
...draftsOptions(options == null ? void 0 : options.showDrafts)
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function toUpdateOptions(options) {
|
|
653
|
+
return {
|
|
654
|
+
...toOptions(options),
|
|
655
|
+
includeReferencedItems: options == null ? void 0 : options.includeReferences
|
|
656
|
+
};
|
|
657
|
+
}
|
|
649
658
|
function toOptions(opts) {
|
|
650
659
|
if (!opts) {
|
|
651
660
|
return undefined;
|
|
@@ -653,11 +662,7 @@ function toOptions(opts) {
|
|
|
653
662
|
const res = {
|
|
654
663
|
suppressHooks: opts.suppressHooks,
|
|
655
664
|
appOptions: opts.appOptions,
|
|
656
|
-
...(opts
|
|
657
|
-
publishPluginOptions: {
|
|
658
|
-
includeDraftItems: opts.showDrafts
|
|
659
|
-
}
|
|
660
|
-
} : {})
|
|
665
|
+
...draftsOptions(opts == null ? void 0 : opts.showDrafts)
|
|
661
666
|
};
|
|
662
667
|
if (Object.entries(res).every(kv => kv[1] === undefined)) {
|
|
663
668
|
return undefined;
|
|
@@ -668,15 +673,18 @@ function toReadOptions(options) {
|
|
|
668
673
|
return {
|
|
669
674
|
suppressHooks: options == null ? void 0 : options.suppressHooks,
|
|
670
675
|
appOptions: options == null ? void 0 : options.appOptions,
|
|
671
|
-
...(
|
|
672
|
-
publishPluginOptions: {
|
|
673
|
-
includeDraftItems: options == null ? void 0 : options.showDrafts
|
|
674
|
-
}
|
|
675
|
-
} : {}),
|
|
676
|
+
...draftsOptions(options == null ? void 0 : options.showDrafts),
|
|
676
677
|
consistentRead: options == null ? void 0 : options.consistentRead,
|
|
677
678
|
language: options == null ? void 0 : options.language
|
|
678
679
|
};
|
|
679
680
|
}
|
|
681
|
+
function draftsOptions(showDrafts) {
|
|
682
|
+
return showDrafts !== undefined ? {
|
|
683
|
+
publishPluginOptions: {
|
|
684
|
+
includeDraftItems: showDrafts
|
|
685
|
+
}
|
|
686
|
+
} : {};
|
|
687
|
+
}
|
|
680
688
|
function toDataItem(item) {
|
|
681
689
|
return item.data;
|
|
682
690
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_errors","require","apiTypes","_interopRequireWildcard","_utils","_common","_WixDataQueryImpl","_WixDataResultImpl","_WixDataAggregateImpl","_ApiClient","_WixDataPatchImpl","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","WixDataApi","constructor","clientFactory","allowGet","environment","gridAppId","tracer","_defineProperty2","withArgs","args","collectionName","options","apiValidator","arity","validateAndReject","trace","env","client","truncateDataItems","dataCollectionId","toOptions","itemId","dataItem","getDataItem","dataItemId","toReadOptions","fields","catch","recover","ItemDoesNotExistCode","toDataItem","item","warnAboutBrokenFields","insertDataItem","id","_id","data","includeReferencedItems","includeReferences","saveDataItem","updateDataItem","removeDataItem","fieldModification","action","ACTION","SET_FIELD","fieldPath","setFieldOptions","value","actionOptions","REMOVE_FIELD","INCREMENT_FIELD","incrementFieldOptions","APPEND_TO_ARRAY","appendToArrayOptions","REMOVE_FROM_ARRAY","removeFromArrayOptions","Error","WixDataPatchImpl","onRun","_args","patchParams","fieldModifications","map","toFieldModificationApi","result","patchDataItem","patch","itemIds","WixDataBulkPatchImpl","results","bulkPatchDataItems","patches","toBulkResult","ensureValidQuery","invalidArgs","length","wdeValidationError","messages","queryValidations","queryInvalid","WixDataQueryImpl","onCount","params","invalidArguments","validateAndReturn","totalCount","countDataItems","filter","filterTree","onDistinct","field","_toSort$find","fieldName","order","toSort","orderBy","find","o","fetch","cursorOrOffset","returnTotalCount","distinctValues","pagingMetadata","queryDistinctValues","toPaging","limitNumber","isOffset","items","paging","skipNumber","WixDataResultImpl","onFind","dataItems","queryDataItems","query","projectedFields","sort","referencedItemOptions","included","cursor","limit","isNonEmptyString","WixDataAggregateImpl","validationErrors","aggregateValidations","aggregateInvalid","toOperation","itemFieldName","undefined","aggregateDataItems","initialFilter","aggregation","groupingFields","groupBy","operations","aggregates","resultFieldName","name","average","avg","min","max","sum","itemCount","count","finalFilter","havingTree","unwrapAggregationId","bulkRemoveOptions","bulkRemoveDataItems","dataItemIds","bulkInsertOptions","appId","runBulkSave","overrideExisting","bulkUpdateOptions","bulkUpdateDataItems","current","queryReferencedDataItems","onlyReferencedItems","holdingItem","relationshipAttribute","referenceParameter","referringItemId","referringItemFieldName","SortOrder","ASC","DESC","skip","refsOrAttr","leftOrOpts","right","refs","opts","argc","rights","asArray","relationshipName","left","references","bulkInsertDataItemReferences","dataItemReferences","referencedItemId","referenceParameters","replaceDataItemReferences","newReferencedItemIds","referenceRemoveParameters","bulkRemoveDataItemReferences","isReferenced","isReferencedDataItem","consistentRead","ApiClient","wixData","filterBuilder","request","bulkSaveDataItems","bulkInsertDataItems","ignoreCodes","fn","exports","arguments","res","suppressHooks","appOptions","showDrafts","publishPluginOptions","includeDraftItems","entries","every","kv","language","cursorPaging","offset","fieldOrder","providerOrValue","code","error","_details","details","applicationError","Promise","resolve","reject","hasFieldWithDollar","hasField","key","startsWith","hasFieldWithDot","includes","console","warn","errors","flatMap","_r$itemMetadata","_r$itemMetadata2","itemMetadata","success","BulkError","description","originalIndex","_r$itemMetadata3","inserted","BulkActionType","INSERT","updated","UPDATE","PATCH","removed","DELETE","skipped","insertedItemIds","_r$itemMetadata4","updatedItemIds","_r$itemMetadata5","removedItemIds","_r$itemMetadata6","isObject","rest","keys","notEmpty","xOrXs","isArray","commonApiValidator"],"sources":["../../../src/api/WixDataApi.ts"],"sourcesContent":["import {\n apiValidator as commonApiValidator,\n messages,\n BulkError,\n wdeValidationError,\n} from '../errors'\nimport { HttpApiClientFactory } from '../types'\nimport * as apiTypes from '../types/data-item-types'\n\nimport { hasField, isObject, isArray } from '../utils'\nimport { filterBuilder } from './common'\nimport {\n Provider,\n WixDataBulkResult,\n WixDataItem,\n WixDataItemOrId,\n WixDataOptions,\n WixDataQueryReferencedOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataReference,\n WixDataUpdateOptions,\n} from './types'\nimport { QueryParams, WixDataQueryImpl } from './impl/WixDataQueryImpl'\nimport { WixDataQuery } from './WixDataQuery'\nimport { WixDataResultImpl, PageFetcher } from './impl/WixDataResultImpl'\nimport { WixDataAggregateImpl } from './impl/WixDataAggregateImpl'\nimport { ApiClient } from './ApiClient'\nimport {\n WixDataPatch,\n FieldModification,\n WixDataBulkPatch,\n} from './WixDataPatch'\nimport { WixDataAggregate } from './WixDataAggregate'\nimport { WixDataFilter } from './WixDataFilter'\nimport { WixDataResult } from './WixDataResult'\nimport { WixDataBulkPatchImpl, WixDataPatchImpl } from './impl/WixDataPatchImpl'\n\ntype ProvidedOpt<T> = T | undefined | Provider<T | undefined>\ntype TraceWith = (\n label: string,\n opts?: object\n) => <T>(fn: () => Promise<T>) => Promise<T>\n\nexport class WixDataApi {\n private client: ApiClient\n\n constructor(\n clientFactory: HttpApiClientFactory<any>,\n allowGet: boolean,\n private readonly environment?: apiTypes.Environment,\n private readonly gridAppId?: ProvidedOpt<string>,\n private readonly tracer?: TraceWith\n ) {\n this.client = new ApiClient(clientFactory, allowGet)\n }\n\n get wixData(): WixDataApi {\n return this\n }\n\n get filter(): WixDataFilter {\n return filterBuilder()\n }\n\n // NOTE sort method for builder is not implemented\n\n truncate = withArgs(\n async (\n args,\n collectionName: string,\n options?: WixDataOptions\n ): Promise<void> => {\n await apiValidator()\n .arity('truncate', args, 1, 2)\n .collectionName(collectionName)\n .options(options)\n .validateAndReject()\n\n return this.trace('truncate', { collectionName })(async (env) => {\n await this.client.truncateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toOptions(options),\n })\n })\n }\n )\n\n // --- single-item methods ---\n\n get = withArgs(\n async (\n args,\n collectionName: string,\n itemId: string,\n options?: WixDataReadWithProjectionOptions\n ): Promise<WixDataItem | null> => {\n await apiValidator()\n .arity('get', args, 2, 3)\n .collectionName(collectionName)\n .itemId(itemId)\n .options(options)\n .validateAndReject()\n\n return this.trace('get', { collectionName, itemId })(async (env) => {\n const { dataItem } = await this.client\n .getDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItemId: itemId,\n ...toReadOptions(options),\n fields: options?.fields,\n })\n .catch(\n recover(ItemDoesNotExistCode, {} as apiTypes.GetDataItemResponse)\n )\n\n return dataItem ? toDataItem(dataItem) : null\n })\n }\n )\n\n insert = withArgs(\n async (\n args,\n collectionName: string,\n item: Partial<WixDataItem>,\n options?: WixDataUpdateOptions\n ): Promise<WixDataItem> => {\n await apiValidator()\n .arity('insert', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n warnAboutBrokenFields(item)\n\n return this.trace('insert', { collectionName })(async (env) => {\n const { dataItem } = await this.client.insertDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n includeReferencedItems: options?.includeReferences,\n ...toOptions(options),\n })\n\n return toDataItem(dataItem!)\n })\n }\n )\n\n save = withArgs(\n async (\n args,\n collectionName: string,\n item: Partial<WixDataItem>,\n options?: WixDataUpdateOptions\n ): Promise<WixDataItem> => {\n await apiValidator()\n .arity('save', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n return this.trace('save', { collectionName })(async (env) => {\n const { dataItem } = await this.client.saveDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n ...toOptions(options),\n includeReferencedItems: options?.includeReferences,\n })\n return toDataItem(dataItem!)\n })\n }\n )\n\n update = withArgs(\n async (\n args,\n collectionName: string,\n item: WixDataItem,\n options?: WixDataUpdateOptions\n ) => {\n await apiValidator()\n .arity('update', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n return this.trace('update', { collectionName })(async (env) => {\n const { dataItem } = await this.client.updateDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n ...toOptions(options),\n includeReferencedItems: options?.includeReferences,\n })\n return toDataItem(dataItem!)\n })\n }\n )\n\n remove = withArgs(\n async (\n args,\n collectionName: string,\n itemId: string,\n options?: WixDataOptions\n ): Promise<WixDataItem | null> => {\n await apiValidator()\n .arity('remove', args, 2, 3)\n .collectionName(collectionName)\n .itemId(itemId)\n .options(options)\n .validateAndReject()\n\n return this.trace('remove', { collectionName, itemId })(async (env) => {\n const { dataItem } = await this.client\n .removeDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItemId: itemId,\n ...toOptions(options),\n })\n .catch(\n recover(ItemDoesNotExistCode, {} as apiTypes.GetDataItemResponse)\n )\n return dataItem ? toDataItem(dataItem) : null\n })\n }\n )\n\n private toFieldModificationApi = (fieldModification: FieldModification) => {\n switch (fieldModification.action) {\n case 'SET_FIELD':\n return {\n action: apiTypes.ACTION.SET_FIELD,\n fieldPath: fieldModification.fieldPath,\n setFieldOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'REMOVE_FIELD':\n return {\n action: apiTypes.ACTION.REMOVE_FIELD,\n fieldPath: fieldModification.fieldPath,\n }\n case 'INCREMENT_FIELD':\n return {\n action: apiTypes.ACTION.INCREMENT_FIELD,\n fieldPath: fieldModification.fieldPath,\n incrementFieldOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'APPEND_TO_ARRAY':\n return {\n action: apiTypes.ACTION.APPEND_TO_ARRAY,\n fieldPath: fieldModification.fieldPath,\n appendToArrayOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'REMOVE_FROM_ARRAY':\n return {\n action: apiTypes.ACTION.REMOVE_FROM_ARRAY,\n fieldPath: fieldModification.fieldPath,\n removeFromArrayOptions: {\n value: fieldModification.actionOptions,\n },\n }\n default:\n throw new Error('Invalid patch action')\n }\n }\n\n patch = (collectionName: string, itemId: string): WixDataPatch => {\n return new WixDataPatchImpl({\n collectionName,\n itemId,\n onRun: async (_args, patchParams, options) => {\n const fieldModifications = patchParams.fieldModifications.map(\n this.toFieldModificationApi\n )\n\n return this.trace('patch', { collectionName })(async (env) => {\n const result = await this.client.patchDataItem({\n ...env,\n dataCollectionId: patchParams.collectionName,\n patch: {\n dataItemId: patchParams.itemId,\n fieldModifications,\n },\n ...toOptions(options),\n })\n\n return result.dataItem ? toDataItem(result.dataItem) : null\n })\n },\n })\n }\n\n bulkPatch = (collectionName: string, itemIds: string[]): WixDataBulkPatch => {\n return new WixDataBulkPatchImpl({\n collectionName,\n itemIds,\n onRun: async (_args, patchParams, options) => {\n const fieldModifications = patchParams.fieldModifications.map(\n this.toFieldModificationApi\n )\n\n return this.trace('bulkPatch', { collectionName })(async (env) => {\n const { results } = await this.client.bulkPatchDataItems({\n ...env,\n dataCollectionId: patchParams.collectionName,\n patches: patchParams.itemIds.map((itemId) => ({\n dataItemId: itemId,\n fieldModifications,\n })),\n ...toOptions(options),\n })\n\n return toBulkResult(itemIds, results!, ['WDE0073'])\n })\n },\n })\n }\n\n // --- query, count, distinct ---\n\n query = (collectionName: string): WixDataQuery => {\n const ensureValidQuery = (invalidArgs: string[]) => {\n if (invalidArgs.length > 0) {\n throw wdeValidationError(\n messages.queryValidations.queryInvalid(collectionName, invalidArgs)\n )\n }\n }\n\n return new WixDataQueryImpl({\n collectionName,\n onCount: async (args, params, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('count', args, 0, 1)\n .options(options)\n .validateAndReturn(),\n ])\n\n return this.trace('count', { collectionName })(async (env) => {\n const { totalCount } = await this.client.countDataItems({\n ...env,\n dataCollectionId: collectionName,\n filter: params.filterTree,\n ...toReadOptions(options),\n })\n return totalCount!\n })\n },\n onDistinct: async (args, params, field, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('distinct', args, 1, 2)\n .fieldName(field)\n .options(options)\n .validateAndReturn(),\n ])\n\n const order = toSort(params.orderBy).find(\n (o) => o.fieldName === field\n )?.order\n\n const fetch: PageFetcher<any> = (cursorOrOffset, returnTotalCount) =>\n this.trace('distinct', { collectionName, field })(async (env) => {\n const { distinctValues, pagingMetadata } =\n await this.client.queryDistinctValues({\n ...env,\n dataCollectionId: collectionName,\n ...toReadOptions(options),\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...(isOffset(cursorOrOffset)\n ? {\n fieldName: field,\n filter: params.filterTree,\n order,\n returnTotalCount,\n }\n : {}),\n })\n return [distinctValues!, pagingMetadata!]\n })\n\n const [items, paging] = await fetch(\n params.skipNumber,\n options?.returnTotalCount\n )\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n onFind: async (args, params, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('find', args, 0, 1)\n .options(options)\n .validateAndReturn(),\n ])\n\n const fetch: PageFetcher = (cursorOrOffset, returnTotalCount) =>\n this.trace('query', { collectionName })(async (env) => {\n const { dataItems, pagingMetadata } =\n await this.client.queryDataItems({\n ...env,\n dataCollectionId: collectionName,\n query: {\n fields: params.projectedFields,\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...(isOffset(cursorOrOffset)\n ? {\n filter: params.filterTree,\n sort: toSort(params.orderBy),\n }\n : {}),\n },\n referencedItemOptions: params.included,\n ...toReadOptions(options),\n ...(isOffset(cursorOrOffset) ? { returnTotalCount } : {}),\n })\n return [dataItems!.map(toDataItem), pagingMetadata!]\n })\n const [items, paging] = await fetch(\n params.skipNumber,\n options?.returnTotalCount\n )\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n })\n }\n\n // NOTE find method is not implemented\n\n fetch = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadOptions\n ): Promise<WixDataResult> => {\n await apiValidator()\n .arity('fetch', args, 2, 4)\n .collectionName(collectionName)\n .isNonEmptyString(cursor, 'cursor')\n .validateAndReject()\n\n const fetch: PageFetcher = (cursorOrOffset) =>\n this.trace('query', { collectionName })(async (env) => {\n const { dataItems, pagingMetadata } =\n await this.client.queryDataItems({\n ...env,\n dataCollectionId: collectionName,\n query: {\n ...toPaging(limit, cursorOrOffset),\n },\n ...toReadOptions(options),\n })\n return [dataItems!.map(toDataItem), pagingMetadata!]\n })\n const [items, paging] = await fetch(cursor)\n\n return new WixDataResultImpl(items, paging, fetch, {\n limitNumber: limit,\n collectionName,\n skipNumber: 0,\n })\n }\n )\n\n // --- aggregate ---\n\n aggregate = (collectionName: string): WixDataAggregate => {\n return new WixDataAggregateImpl({\n collectionName,\n onRun: async (args, params, options) => {\n const validationErrors = [\n ...params.invalidArguments,\n ...apiValidator()\n .arity('run', args, 0, 1)\n .collectionName(collectionName)\n .options(options)\n .validateAndReturn(),\n ]\n\n if (validationErrors.length > 0) {\n throw wdeValidationError(\n messages.aggregateValidations.aggregateInvalid(\n collectionName,\n validationErrors\n )\n )\n }\n\n const fetch: PageFetcher<Record<string, any>> = (\n cursorOrOffset,\n returnTotalCount\n ) =>\n this.trace('aggregate', { collectionName })(async (env) => {\n const toOperation = (field?: string) =>\n field ? { itemFieldName: field } : undefined\n\n const { results, pagingMetadata } =\n await this.client.aggregateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...toReadOptions(options),\n ...(isOffset(cursorOrOffset)\n ? {\n initialFilter: params.filterTree,\n aggregation: {\n groupingFields: params.groupBy,\n operations: params.aggregates.map((a) => ({\n resultFieldName: a.name,\n average: toOperation(a.avg),\n min: toOperation(a.min),\n max: toOperation(a.max),\n sum: toOperation(a.sum),\n itemCount: a.count ? {} : undefined,\n })),\n },\n finalFilter: params.havingTree,\n sort: toSort(params.orderBy),\n returnTotalCount,\n }\n : {}),\n })\n return [unwrapAggregationId(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(params.skipNumber, true)\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n })\n }\n\n fetchAggregate = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadOptions\n ) => {\n await apiValidator()\n .arity('fetchAggregate', args, 2, 4)\n .collectionName(collectionName)\n .isNonEmptyString(cursor, 'cursor')\n .validateAndReject()\n\n const fetch: PageFetcher<Record<string, any>> = (cursorOrOffset) =>\n this.trace('aggregate', { collectionName })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.aggregateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toPaging(limit, cursorOrOffset),\n ...toReadOptions(options),\n })\n return [unwrapAggregationId(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(cursor, true)\n\n return new WixDataResultImpl(items, paging, fetch, {\n limitNumber: limit,\n skipNumber: 0,\n collectionName,\n })\n }\n )\n\n // --- bulk methods ---\n\n bulkRemove = withArgs(\n async (\n args,\n collectionName: string,\n itemIds: string[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkRemove', args, 2, 3)\n .collectionName(collectionName)\n .itemIds(itemIds, collectionName)\n .bulkRemoveOptions(options)\n .validateAndReject()\n\n return this.trace('bulkRemove', { collectionName })(async (env) => {\n const { results } = await this.client.bulkRemoveDataItems({\n ...env,\n dataCollectionId: collectionName,\n dataItemIds: itemIds,\n ...toOptions(options),\n })\n // Non-existing items are skipped and not reported as errors.\n return toBulkResult(itemIds, results!, ['WDE0073'])\n })\n }\n )\n\n private async runBulkSave(\n env: { environment?: apiTypes.Environment; appId?: string },\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions,\n overrideExisting: boolean = true\n ): Promise<WixDataBulkResult> {\n const request: apiTypes.BulkInsertDataItemsRequest = {\n ...env,\n dataCollectionId: collectionName,\n dataItems: items.map((data) => ({\n id: data._id,\n data,\n })),\n ...toOptions(options),\n }\n const { results } = await (overrideExisting\n ? this.client.bulkSaveDataItems(request)\n : this.client.bulkInsertDataItems(request))\n const ignoreCodes = overrideExisting ? [] : ['WDE0074']\n return toBulkResult(items, results!, ignoreCodes)\n }\n\n bulkInsert = withArgs(\n async (\n args,\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions & { overrideExisting?: boolean }\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkInsert', args, 2, 3)\n .items(items, collectionName)\n .bulkInsertOptions(options)\n .collectionName(collectionName)\n .validateAndReject()\n\n return this.trace('bulkInsert', { collectionName, options })(\n async (appId) =>\n this.runBulkSave(\n appId,\n collectionName,\n items,\n options,\n options?.overrideExisting ?? false\n )\n )\n }\n )\n\n bulkSave = withArgs(\n async (\n args,\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkSave', args, 2, 3)\n .bulkInsertOptions(options)\n .collectionName(collectionName)\n .items(items, collectionName)\n .validateAndReject()\n\n return this.trace('bulkSave', { collectionName })(async (env) =>\n this.runBulkSave(env, collectionName, items, options)\n )\n }\n )\n\n bulkUpdate = withArgs(\n async (\n args,\n collectionName: string,\n items: WixDataItem[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkUpdate', args, 2, 3)\n .bulkUpdateOptions(options)\n .collectionName(collectionName)\n .items(items, collectionName)\n .validateAndReject()\n\n return this.trace('bulkUpdate', { collectionName })(async (env) => {\n const { results } = await this.client.bulkUpdateDataItems({\n ...env,\n dataCollectionId: collectionName,\n dataItems: items.map((data) => ({\n id: data._id,\n data,\n })),\n ...toOptions(options),\n })\n // Non-existing items are skipped and not reported as errors.\n return toBulkResult(items, results!, ['WDE0073'])\n })\n }\n )\n\n // --- references ---\n\n fetchReferenced = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadWithProjectionOptions\n ): Promise<WixDataResult<WixDataItem | string>> => {\n await apiValidator()\n .arity('fetchReferenced', args, 2, 4)\n .isNonEmptyString(cursor, 'cursor')\n .collectionName(collectionName)\n .validateAndReject()\n\n const fetch: PageFetcher<WixDataItem | string> = (current) =>\n this.trace('fetchReferenced', { collectionName })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.queryReferencedDataItems({\n ...env,\n ...toPaging(limit, current),\n ...toReadOptions(options),\n dataCollectionId: collectionName,\n fields: options?.fields,\n })\n return [onlyReferencedItems(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(cursor)\n return new WixDataResultImpl(items, paging, fetch, {\n collectionName,\n limitNumber: limit,\n skipNumber: 0,\n })\n }\n )\n\n queryReferenced = withArgs(\n async (\n args,\n collectionName: string,\n holdingItem: WixDataItemOrId,\n relationshipAttribute: string,\n options?: WixDataQueryReferencedOptions\n ): Promise<WixDataResult> => {\n await apiValidator()\n .arity('queryReferenced', args, 3, 4)\n .collectionName(collectionName)\n .referenceParameter(holdingItem)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .options(options)\n .validateAndReject()\n\n const id = itemId(holdingItem)\n const fetch: PageFetcher = (cursorOrOffset, returnTotalCount) =>\n this.trace('queryReferenced', {\n collectionName,\n itemId: id,\n options,\n relationshipAttribute,\n })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.queryReferencedDataItems({\n ...env,\n ...toPaging(options?.limit ?? 50, cursorOrOffset),\n ...toReadOptions(options),\n dataCollectionId: collectionName,\n fields: options?.fields,\n ...(isOffset(cursorOrOffset)\n ? {\n referringItemId: id,\n referringItemFieldName: relationshipAttribute,\n order:\n options?.order === 'asc'\n ? apiTypes.SortOrder.ASC\n : options?.order === 'desc'\n ? apiTypes.SortOrder.DESC\n : undefined,\n returnTotalCount,\n }\n : {}),\n })\n return [onlyReferencedItems(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(\n options?.skip ?? 0,\n options?.returnTotalCount\n )\n return new WixDataResultImpl(items, paging, fetch, {\n collectionName,\n limitNumber: options?.limit ?? 50,\n skipNumber: options?.skip ?? 0,\n })\n }\n )\n\n insertReference: {\n // overload with array of references\n (\n collectionName: string,\n refs: WixDataReference[],\n options?: WixDataOptions\n ): Promise<void>\n // overload with separate left and right(s)\n (\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ): Promise<void>\n } = withArgs(\n async (\n args,\n collectionName: string,\n refsOrAttr: any,\n leftOrOpts?: any,\n right?: any,\n options?: any\n ) => {\n let refs: WixDataReference[]\n let opts: WixDataOptions\n let argc: [number, number]\n\n if (typeof refsOrAttr === 'string') {\n const rights: WixDataItemOrId[] = asArray(right)\n refs = rights.map((r) => ({\n relationshipName: refsOrAttr,\n left: leftOrOpts as WixDataItemOrId,\n right: r,\n }))\n opts = options\n argc = [4, 5]\n } else {\n refs = refsOrAttr\n opts = leftOrOpts\n argc = [2, 3]\n }\n await apiValidator()\n .arity('insertReference', args, ...argc)\n .collectionName(collectionName)\n .references(refs)\n .options(opts)\n .validateAndReject()\n\n await this.trace('insertReference', { collectionName })(async (env) =>\n this.client.bulkInsertDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n dataItemReferences: refs.map((r) => ({\n referringItemFieldName: r.relationshipName,\n referringItemId: itemId(r.left),\n referencedItemId: itemId(r.right),\n })),\n ...toOptions(opts),\n })\n )\n }\n )\n\n replaceReferences = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ): Promise<void> => {\n const rights = asArray(right)\n await apiValidator()\n .arity('replaceReferences', args, 4, 5)\n .collectionName(collectionName)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .referenceParameter(left)\n .referenceParameters(rights)\n .options(options)\n .validateAndReject()\n\n await this.trace('replaceReferences', {\n collectionName,\n relationshipAttribute,\n })(async (env) =>\n this.client.replaceDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n newReferencedItemIds: rights.map(itemId),\n ...toOptions(options),\n })\n )\n }\n )\n\n removeReference = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ) => {\n const rights = asArray(right)\n await apiValidator()\n .arity('removeReference', args, 4, 5)\n .collectionName(collectionName)\n .referenceParameter(left)\n .referenceRemoveParameters(rights)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .options(options)\n .validateAndReject()\n\n await this.trace('removeReference', {\n collectionName,\n relationshipAttribute,\n })(async (env) =>\n this.client.bulkRemoveDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n dataItemReferences: rights.map((r) => ({\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n referencedItemId: itemId(r),\n })),\n ...toOptions(options),\n })\n )\n }\n )\n\n isReferenced = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId,\n options?: WixDataReadOptions\n ): Promise<boolean> => {\n await apiValidator()\n .arity('isReferenced', args, 4, 5)\n .collectionName(collectionName)\n .referenceParameter(left)\n .referenceParameter(right)\n .options(options)\n .validateAndReject()\n\n return this.trace('isReferenced', {\n collectionName,\n relationshipAttribute,\n })(async (env) => {\n const { isReferenced } = await this.client.isReferencedDataItem({\n ...env,\n dataCollectionId: collectionName,\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n referencedItemId: itemId(right),\n ...toOptions(options),\n consistentRead: options?.consistentRead,\n })\n return isReferenced!\n })\n }\n )\n\n private trace(\n action: string,\n opts: object\n ): <R>(\n fn: (env: {\n environment?: apiTypes.Environment\n appId?: string\n }) => Promise<R>\n ) => Promise<R> {\n return async (fn) => {\n const gridAppId = await get(this.gridAppId)\n const env = { appId: gridAppId, environment: this.environment }\n if (this.tracer) {\n return this.tracer(`WixDataApi.${action}`, {\n ...opts,\n gridAppId,\n environment: this.environment,\n })(() => fn(env))\n }\n return fn(env)\n }\n }\n}\n\nfunction withArgs<Args extends any[], R>(\n fn: (all: IArguments, ...args: Args) => R\n): (...args: Args) => R {\n return function (...args) {\n return fn(arguments, ...args)\n }\n}\n\nfunction toOptions(opts?: WixDataOptions) {\n if (!opts) {\n return undefined\n }\n const res = {\n suppressHooks: opts.suppressHooks,\n appOptions: opts.appOptions,\n ...(opts.showDrafts !== undefined\n ? { publishPluginOptions: { includeDraftItems: opts.showDrafts } }\n : {}),\n }\n if (Object.entries(res).every((kv) => kv[1] === undefined)) {\n return undefined\n }\n return res\n}\n\nfunction toReadOptions(options?: WixDataReadOptions) {\n return {\n suppressHooks: options?.suppressHooks,\n appOptions: options?.appOptions,\n ...(options?.showDrafts !== undefined\n ? { publishPluginOptions: { includeDraftItems: options?.showDrafts } }\n : {}),\n consistentRead: options?.consistentRead,\n language: options?.language,\n }\n}\n\nfunction toDataItem(item: apiTypes.DataItem): WixDataItem {\n return item.data as WixDataItem\n}\n\nfunction toPaging(limit: number | undefined, cursorOrOffset: string | number) {\n return typeof cursorOrOffset === 'string'\n ? {\n cursorPaging: {\n limit,\n cursor: cursorOrOffset,\n },\n }\n : limit !== undefined || cursorOrOffset > 0\n ? {\n paging: {\n limit,\n offset: cursorOrOffset,\n },\n }\n : {}\n}\n\nfunction toSort(orderBy: QueryParams['orderBy']): apiTypes.Sorting[] {\n return orderBy.map((fieldOrder) => {\n const [[fieldName, sort]] = Object.entries(fieldOrder)\n const order =\n sort === 'asc'\n ? apiTypes.SortOrder.ASC\n : sort === 'desc'\n ? apiTypes.SortOrder.DESC\n : undefined\n return { fieldName, order }\n })\n}\n\nasync function get<T>(providerOrValue: T | Provider<T>): Promise<T> {\n if (typeof (providerOrValue as any)?.get === 'function') {\n return (providerOrValue as Provider<T>).get()\n }\n return providerOrValue as T\n}\n\nfunction recover<T>(code: string, value: T): (error: unknown) => Promise<T> {\n return (error) => {\n if (\n error instanceof Error &&\n (error as any)?.details?.applicationError?.code === code\n ) {\n return Promise.resolve(value)\n }\n return Promise.reject(error)\n }\n}\n\nfunction warnAboutBrokenFields(item: Partial<WixDataItem>) {\n const hasFieldWithDollar = hasField(item, (key) => key.startsWith('$'))\n const hasFieldWithDot = hasField(item, (key) => key.includes('.'))\n if (hasFieldWithDollar) {\n console.error(\n \"Data inserted contains field name prefixed with symbol '$'. It is not recommended to use such field names as it will not work with some data operations.\"\n )\n }\n if (hasFieldWithDot) {\n console.warn(\n \"Data inserted contains field name containing symbol '.'. It is not recommended to use such field names as it will not work with some data operations.\"\n )\n }\n}\n\nfunction toBulkResult(\n request: any[],\n results: apiTypes.BulkDataItemResult[],\n ignoreCodes: string[] = []\n): WixDataBulkResult {\n const errors = results.flatMap((r) => {\n if (r.itemMetadata?.success || !r.itemMetadata?.error) {\n return []\n }\n if (ignoreCodes.includes(r.itemMetadata.error.code ?? '')) {\n return []\n }\n return [\n new BulkError(\n r.itemMetadata.error.description!,\n r.itemMetadata.error.code!,\n request[r.itemMetadata.originalIndex!],\n 'BulkError',\n r.itemMetadata.originalIndex!\n ),\n ]\n })\n const success = results.filter((r) => r.itemMetadata?.success)\n const inserted = success.filter(\n (r) => r.action === apiTypes.BulkActionType.INSERT\n )\n const updated = success.filter(\n (r) =>\n r.action === apiTypes.BulkActionType.UPDATE ||\n r.action === apiTypes.BulkActionType.PATCH\n )\n const removed = success.filter(\n (r) => r.action === apiTypes.BulkActionType.DELETE\n )\n return {\n inserted: inserted.length,\n updated: updated.length,\n removed: removed.length,\n skipped: request.length - errors.length - success.length,\n errors,\n insertedItemIds: inserted.map((r) => r.itemMetadata?.id!),\n updatedItemIds: updated.map((r) => r.itemMetadata?.id!),\n removedItemIds: removed.map((r) => r.itemMetadata?.id!),\n }\n}\n\nfunction unwrapAggregationId(\n items: Record<string, any>[]\n): Record<string, any>[] {\n // When grouping by one field WixDataService returns value on _id field directly, DataItemService wraps it in an object, i.e.\n // grouping by surname returns {_id: 'Simpson'} in WixDataService vs {_id: {surname: 'Simpson'}} in DataItemService\n // When grouping by more fields, values are kept wrapped.\n return items.map((item) => {\n const id = item._id\n if (isObject(id)) {\n const [key, ...rest] = Object.keys(id)\n if (rest.length === 0) {\n item._id = id[key]\n return item\n }\n }\n return item\n })\n}\n\nfunction onlyReferencedItems(\n results: apiTypes.ReferencedResult[]\n): WixDataItem[] {\n return results\n .map((result) => result.dataItem)\n .filter(notEmpty)\n .map(toDataItem)\n}\n\nfunction notEmpty<T>(value: T | null | undefined): value is T {\n return value != null\n}\n\nfunction itemId(item: WixDataItemOrId): string {\n return typeof item === 'string' ? item : item._id\n}\n\nfunction asArray<T>(xOrXs: T | T[]): T[] {\n return isArray(xOrXs) ? (xOrXs as T[]) : [xOrXs as T]\n}\n\nfunction isOffset(cursorOrOffset: string | number) {\n return typeof cursorOrOffset === 'number'\n}\n\nconst ItemDoesNotExistCode = 'WDE0073'\n\nfunction apiValidator() {\n return commonApiValidator(wdeValidationError)\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAaA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AASA,IAAAS,iBAAA,GAAAT,OAAA;AAAgF,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAA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,IAAA8N,eAAQ,EAAC/N,EAAE,CAAC,EAAE;MAChB,MAAM,CAACgM,GAAG,EAAE,GAAGgC,IAAI,CAAC,GAAG3Q,MAAM,CAAC4Q,IAAI,CAACjO,EAAE,CAAC;MACtC,IAAIgO,IAAI,CAACtL,MAAM,KAAK,CAAC,EAAE;QACrB7C,IAAI,CAACI,GAAG,GAAGD,EAAE,CAACgM,GAAG,CAAC;QAClB,OAAOnM,IAAI;MACb;IACF;IACA,OAAOA,IAAI;EACb,CAAC,CAAC;AACJ;AAEA,SAASiI,mBAAmBA,CAC1B1F,OAAoC,EACrB;EACf,OAAOA,OAAO,CACXP,GAAG,CAAEE,MAAM,IAAKA,MAAM,CAAC3C,QAAQ,CAAC,CAChCkE,MAAM,CAAC4K,QAAQ,CAAC,CAChBrM,GAAG,CAACjC,UAAU,CAAC;AACpB;AAEA,SAASsO,QAAQA,CAAIpN,KAA2B,EAAc;EAC5D,OAAOA,KAAK,IAAI,IAAI;AACtB;AAEA,SAAS3B,MAAMA,CAACU,IAAqB,EAAU;EAC7C,OAAO,OAAOA,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGA,IAAI,CAACI,GAAG;AACnD;AAEA,SAAS8I,OAAOA,CAAIoF,KAAc,EAAO;EACvC,OAAO,IAAAC,cAAO,EAACD,KAAK,CAAC,GAAIA,KAAK,GAAW,CAACA,KAAK,CAAM;AACvD;AAEA,SAAS1J,QAAQA,CAACP,cAA+B,EAAE;EACjD,OAAO,OAAOA,cAAc,KAAK,QAAQ;AAC3C;AAEA,MAAMvE,oBAAoB,GAAG,SAAS;AAEtC,SAASjB,YAAYA,CAAA,EAAG;EACtB,OAAO,IAAA2P,oBAAkB,EAAC1L,0BAAkB,CAAC;AAC/C"}
|
|
1
|
+
{"version":3,"names":["_errors","require","apiTypes","_interopRequireWildcard","_utils","_common","_WixDataQueryImpl","_WixDataResultImpl","_WixDataAggregateImpl","_ApiClient","_WixDataPatchImpl","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","WixDataApi","constructor","clientFactory","allowGet","environment","gridAppId","tracer","_defineProperty2","withArgs","args","collectionName","options","apiValidator","arity","validateAndReject","trace","env","client","truncateDataItems","dataCollectionId","toOptions","itemId","dataItem","getDataItem","dataItemId","toReadOptions","fields","catch","recover","ItemDoesNotExistCode","toDataItem","item","warnAboutBrokenFields","insertDataItem","id","_id","data","toUpdateOptions","saveDataItem","updateDataItem","removeDataItem","fieldModification","action","ACTION","SET_FIELD","fieldPath","setFieldOptions","value","actionOptions","REMOVE_FIELD","INCREMENT_FIELD","incrementFieldOptions","APPEND_TO_ARRAY","appendToArrayOptions","REMOVE_FROM_ARRAY","removeFromArrayOptions","Error","WixDataPatchImpl","onRun","_args","patchParams","fieldModifications","map","toFieldModificationApi","result","patchDataItem","patch","toPatchOptions","itemIds","WixDataBulkPatchImpl","results","bulkPatchDataItems","patches","toBulkResult","ensureValidQuery","invalidArgs","length","wdeValidationError","messages","queryValidations","queryInvalid","WixDataQueryImpl","onCount","params","invalidArguments","validateAndReturn","totalCount","countDataItems","filter","filterTree","onDistinct","field","_toSort$find","fieldName","order","toSort","orderBy","find","o","fetch","cursorOrOffset","returnTotalCount","distinctValues","pagingMetadata","queryDistinctValues","toPaging","limitNumber","isOffset","items","paging","skipNumber","WixDataResultImpl","onFind","dataItems","queryDataItems","query","projectedFields","sort","referencedItemOptions","included","cursor","limit","isNonEmptyString","WixDataAggregateImpl","validationErrors","aggregateValidations","aggregateInvalid","toOperation","itemFieldName","undefined","aggregateDataItems","initialFilter","aggregation","groupingFields","groupBy","operations","aggregates","resultFieldName","name","average","avg","min","max","sum","itemCount","count","finalFilter","havingTree","unwrapAggregationId","bulkRemoveOptions","bulkRemoveDataItems","dataItemIds","bulkInsertOptions","appId","runBulkSave","overrideExisting","bulkUpdateOptions","bulkUpdateDataItems","current","queryReferencedDataItems","onlyReferencedItems","holdingItem","relationshipAttribute","referenceParameter","referringItemId","referringItemFieldName","SortOrder","ASC","DESC","skip","refsOrAttr","leftOrOpts","right","refs","opts","argc","rights","asArray","relationshipName","left","references","bulkInsertDataItemReferences","dataItemReferences","referencedItemId","referenceParameters","replaceDataItemReferences","newReferencedItemIds","referenceRemoveParameters","bulkRemoveDataItemReferences","isReferenced","isReferencedDataItem","consistentRead","ApiClient","wixData","filterBuilder","request","bulkSaveDataItems","bulkInsertDataItems","ignoreCodes","fn","exports","arguments","suppressHooks","draftsOptions","showDrafts","includeReferencedItems","includeReferences","res","appOptions","entries","every","kv","language","publishPluginOptions","includeDraftItems","cursorPaging","offset","fieldOrder","providerOrValue","code","error","_details","details","applicationError","Promise","resolve","reject","hasFieldWithDollar","hasField","key","startsWith","hasFieldWithDot","includes","console","warn","errors","flatMap","_r$itemMetadata","_r$itemMetadata2","itemMetadata","success","BulkError","description","originalIndex","_r$itemMetadata3","inserted","BulkActionType","INSERT","updated","UPDATE","PATCH","removed","DELETE","skipped","insertedItemIds","_r$itemMetadata4","updatedItemIds","_r$itemMetadata5","removedItemIds","_r$itemMetadata6","isObject","rest","keys","notEmpty","xOrXs","isArray","commonApiValidator"],"sources":["../../../src/api/WixDataApi.ts"],"sourcesContent":["import {\n apiValidator as commonApiValidator,\n messages,\n BulkError,\n wdeValidationError,\n} from '../errors'\nimport { HttpApiClientFactory } from '../types'\nimport * as apiTypes from '../types/data-item-types'\n\nimport { hasField, isObject, isArray } from '../utils'\nimport { filterBuilder } from './common'\nimport {\n Provider,\n WixDataBulkResult,\n WixDataItem,\n WixDataItemOrId,\n WixDataOptions,\n WixDataPatchOptions,\n WixDataQueryReferencedOptions,\n WixDataReadOptions,\n WixDataReadWithProjectionOptions,\n WixDataReference,\n WixDataUpdateOptions,\n} from './types'\nimport { QueryParams, WixDataQueryImpl } from './impl/WixDataQueryImpl'\nimport { WixDataQuery } from './WixDataQuery'\nimport { WixDataResultImpl, PageFetcher } from './impl/WixDataResultImpl'\nimport { WixDataAggregateImpl } from './impl/WixDataAggregateImpl'\nimport { ApiClient } from './ApiClient'\nimport {\n WixDataPatch,\n FieldModification,\n WixDataBulkPatch,\n} from './WixDataPatch'\nimport { WixDataAggregate } from './WixDataAggregate'\nimport { WixDataFilter } from './WixDataFilter'\nimport { WixDataResult } from './WixDataResult'\nimport { WixDataBulkPatchImpl, WixDataPatchImpl } from './impl/WixDataPatchImpl'\n\ntype ProvidedOpt<T> = T | undefined | Provider<T | undefined>\ntype TraceWith = (\n label: string,\n opts?: object\n) => <T>(fn: () => Promise<T>) => Promise<T>\n\nexport class WixDataApi {\n private client: ApiClient\n\n constructor(\n clientFactory: HttpApiClientFactory<any>,\n allowGet: boolean,\n private readonly environment?: apiTypes.Environment,\n private readonly gridAppId?: ProvidedOpt<string>,\n private readonly tracer?: TraceWith\n ) {\n this.client = new ApiClient(clientFactory, allowGet)\n }\n\n get wixData(): WixDataApi {\n return this\n }\n\n get filter(): WixDataFilter {\n return filterBuilder()\n }\n\n // NOTE sort method for builder is not implemented\n\n truncate = withArgs(\n async (\n args,\n collectionName: string,\n options?: WixDataOptions\n ): Promise<void> => {\n await apiValidator()\n .arity('truncate', args, 1, 2)\n .collectionName(collectionName)\n .options(options)\n .validateAndReject()\n\n return this.trace('truncate', { collectionName })(async (env) => {\n await this.client.truncateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toOptions(options),\n })\n })\n }\n )\n\n // --- single-item methods ---\n\n get = withArgs(\n async (\n args,\n collectionName: string,\n itemId: string,\n options?: WixDataReadWithProjectionOptions\n ): Promise<WixDataItem | null> => {\n await apiValidator()\n .arity('get', args, 2, 3)\n .collectionName(collectionName)\n .itemId(itemId)\n .options(options)\n .validateAndReject()\n\n return this.trace('get', { collectionName, itemId })(async (env) => {\n const { dataItem } = await this.client\n .getDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItemId: itemId,\n ...toReadOptions(options),\n fields: options?.fields,\n })\n .catch(\n recover(ItemDoesNotExistCode, {} as apiTypes.GetDataItemResponse)\n )\n\n return dataItem ? toDataItem(dataItem) : null\n })\n }\n )\n\n insert = withArgs(\n async (\n args,\n collectionName: string,\n item: Partial<WixDataItem>,\n options?: WixDataUpdateOptions\n ): Promise<WixDataItem> => {\n await apiValidator()\n .arity('insert', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n warnAboutBrokenFields(item)\n\n return this.trace('insert', { collectionName })(async (env) => {\n const { dataItem } = await this.client.insertDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n ...toUpdateOptions(options),\n })\n\n return toDataItem(dataItem!)\n })\n }\n )\n\n save = withArgs(\n async (\n args,\n collectionName: string,\n item: Partial<WixDataItem>,\n options?: WixDataUpdateOptions\n ): Promise<WixDataItem> => {\n await apiValidator()\n .arity('save', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n return this.trace('save', { collectionName })(async (env) => {\n const { dataItem } = await this.client.saveDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n ...toUpdateOptions(options),\n })\n return toDataItem(dataItem!)\n })\n }\n )\n\n update = withArgs(\n async (\n args,\n collectionName: string,\n item: WixDataItem,\n options?: WixDataUpdateOptions\n ) => {\n await apiValidator()\n .arity('update', args, 2, 3)\n .collectionName(collectionName)\n .item(item, collectionName, false)\n .options(options)\n .validateAndReject()\n\n return this.trace('update', { collectionName })(async (env) => {\n const { dataItem } = await this.client.updateDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItem: {\n id: item._id,\n data: item,\n },\n ...toUpdateOptions(options),\n })\n return toDataItem(dataItem!)\n })\n }\n )\n\n remove = withArgs(\n async (\n args,\n collectionName: string,\n itemId: string,\n options?: WixDataOptions\n ): Promise<WixDataItem | null> => {\n await apiValidator()\n .arity('remove', args, 2, 3)\n .collectionName(collectionName)\n .itemId(itemId)\n .options(options)\n .validateAndReject()\n\n return this.trace('remove', { collectionName, itemId })(async (env) => {\n const { dataItem } = await this.client\n .removeDataItem({\n ...env,\n dataCollectionId: collectionName,\n dataItemId: itemId,\n ...toOptions(options),\n })\n .catch(\n recover(ItemDoesNotExistCode, {} as apiTypes.GetDataItemResponse)\n )\n return dataItem ? toDataItem(dataItem) : null\n })\n }\n )\n\n private toFieldModificationApi = (fieldModification: FieldModification) => {\n switch (fieldModification.action) {\n case 'SET_FIELD':\n return {\n action: apiTypes.ACTION.SET_FIELD,\n fieldPath: fieldModification.fieldPath,\n setFieldOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'REMOVE_FIELD':\n return {\n action: apiTypes.ACTION.REMOVE_FIELD,\n fieldPath: fieldModification.fieldPath,\n }\n case 'INCREMENT_FIELD':\n return {\n action: apiTypes.ACTION.INCREMENT_FIELD,\n fieldPath: fieldModification.fieldPath,\n incrementFieldOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'APPEND_TO_ARRAY':\n return {\n action: apiTypes.ACTION.APPEND_TO_ARRAY,\n fieldPath: fieldModification.fieldPath,\n appendToArrayOptions: {\n value: fieldModification.actionOptions,\n },\n }\n case 'REMOVE_FROM_ARRAY':\n return {\n action: apiTypes.ACTION.REMOVE_FROM_ARRAY,\n fieldPath: fieldModification.fieldPath,\n removeFromArrayOptions: {\n value: fieldModification.actionOptions,\n },\n }\n default:\n throw new Error('Invalid patch action')\n }\n }\n\n patch = (collectionName: string, itemId: string): WixDataPatch => {\n return new WixDataPatchImpl({\n collectionName,\n itemId,\n onRun: async (_args, patchParams, options) => {\n const fieldModifications = patchParams.fieldModifications.map(\n this.toFieldModificationApi\n )\n\n return this.trace('patch', { collectionName })(async (env) => {\n const result = await this.client.patchDataItem({\n ...env,\n dataCollectionId: patchParams.collectionName,\n patch: {\n dataItemId: patchParams.itemId,\n fieldModifications,\n },\n ...toPatchOptions(options),\n })\n\n return result.dataItem ? toDataItem(result.dataItem) : null\n })\n },\n })\n }\n\n bulkPatch = (collectionName: string, itemIds: string[]): WixDataBulkPatch => {\n return new WixDataBulkPatchImpl({\n collectionName,\n itemIds,\n onRun: async (_args, patchParams, options) => {\n const fieldModifications = patchParams.fieldModifications.map(\n this.toFieldModificationApi\n )\n\n return this.trace('bulkPatch', { collectionName })(async (env) => {\n const { results } = await this.client.bulkPatchDataItems({\n ...env,\n dataCollectionId: patchParams.collectionName,\n patches: patchParams.itemIds.map((itemId) => ({\n dataItemId: itemId,\n fieldModifications,\n })),\n ...toPatchOptions(options),\n })\n\n return toBulkResult(itemIds, results!, ['WDE0073'])\n })\n },\n })\n }\n\n // --- query, count, distinct ---\n\n query = (collectionName: string): WixDataQuery => {\n const ensureValidQuery = (invalidArgs: string[]) => {\n if (invalidArgs.length > 0) {\n throw wdeValidationError(\n messages.queryValidations.queryInvalid(collectionName, invalidArgs)\n )\n }\n }\n\n return new WixDataQueryImpl({\n collectionName,\n onCount: async (args, params, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('count', args, 0, 1)\n .options(options)\n .validateAndReturn(),\n ])\n\n return this.trace('count', { collectionName })(async (env) => {\n const { totalCount } = await this.client.countDataItems({\n ...env,\n dataCollectionId: collectionName,\n filter: params.filterTree,\n ...toReadOptions(options),\n })\n return totalCount!\n })\n },\n onDistinct: async (args, params, field, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('distinct', args, 1, 2)\n .fieldName(field)\n .options(options)\n .validateAndReturn(),\n ])\n\n const order = toSort(params.orderBy).find(\n (o) => o.fieldName === field\n )?.order\n\n const fetch: PageFetcher<any> = (cursorOrOffset, returnTotalCount) =>\n this.trace('distinct', { collectionName, field })(async (env) => {\n const { distinctValues, pagingMetadata } =\n await this.client.queryDistinctValues({\n ...env,\n dataCollectionId: collectionName,\n ...toReadOptions(options),\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...(isOffset(cursorOrOffset)\n ? {\n fieldName: field,\n filter: params.filterTree,\n order,\n returnTotalCount,\n }\n : {}),\n })\n return [distinctValues!, pagingMetadata!]\n })\n\n const [items, paging] = await fetch(\n params.skipNumber,\n options?.returnTotalCount\n )\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n onFind: async (args, params, options) => {\n ensureValidQuery([\n ...params.invalidArguments,\n ...apiValidator()\n .collectionName(collectionName)\n .arity('find', args, 0, 1)\n .options(options)\n .validateAndReturn(),\n ])\n\n const fetch: PageFetcher = (cursorOrOffset, returnTotalCount) =>\n this.trace('query', { collectionName })(async (env) => {\n const { dataItems, pagingMetadata } =\n await this.client.queryDataItems({\n ...env,\n dataCollectionId: collectionName,\n query: {\n fields: params.projectedFields,\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...(isOffset(cursorOrOffset)\n ? {\n filter: params.filterTree,\n sort: toSort(params.orderBy),\n }\n : {}),\n },\n referencedItemOptions: params.included,\n ...toReadOptions(options),\n ...(isOffset(cursorOrOffset) ? { returnTotalCount } : {}),\n })\n return [dataItems!.map(toDataItem), pagingMetadata!]\n })\n const [items, paging] = await fetch(\n params.skipNumber,\n options?.returnTotalCount\n )\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n })\n }\n\n // NOTE find method is not implemented\n\n fetch = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadOptions\n ): Promise<WixDataResult> => {\n await apiValidator()\n .arity('fetch', args, 2, 4)\n .collectionName(collectionName)\n .isNonEmptyString(cursor, 'cursor')\n .validateAndReject()\n\n const fetch: PageFetcher = (cursorOrOffset) =>\n this.trace('query', { collectionName })(async (env) => {\n const { dataItems, pagingMetadata } =\n await this.client.queryDataItems({\n ...env,\n dataCollectionId: collectionName,\n query: {\n ...toPaging(limit, cursorOrOffset),\n },\n ...toReadOptions(options),\n })\n return [dataItems!.map(toDataItem), pagingMetadata!]\n })\n const [items, paging] = await fetch(cursor)\n\n return new WixDataResultImpl(items, paging, fetch, {\n limitNumber: limit,\n collectionName,\n skipNumber: 0,\n })\n }\n )\n\n // --- aggregate ---\n\n aggregate = (collectionName: string): WixDataAggregate => {\n return new WixDataAggregateImpl({\n collectionName,\n onRun: async (args, params, options) => {\n const validationErrors = [\n ...params.invalidArguments,\n ...apiValidator()\n .arity('run', args, 0, 1)\n .collectionName(collectionName)\n .options(options)\n .validateAndReturn(),\n ]\n\n if (validationErrors.length > 0) {\n throw wdeValidationError(\n messages.aggregateValidations.aggregateInvalid(\n collectionName,\n validationErrors\n )\n )\n }\n\n const fetch: PageFetcher<Record<string, any>> = (\n cursorOrOffset,\n returnTotalCount\n ) =>\n this.trace('aggregate', { collectionName })(async (env) => {\n const toOperation = (field?: string) =>\n field ? { itemFieldName: field } : undefined\n\n const { results, pagingMetadata } =\n await this.client.aggregateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toPaging(params.limitNumber, cursorOrOffset),\n ...toReadOptions(options),\n ...(isOffset(cursorOrOffset)\n ? {\n initialFilter: params.filterTree,\n aggregation: {\n groupingFields: params.groupBy,\n operations: params.aggregates.map((a) => ({\n resultFieldName: a.name,\n average: toOperation(a.avg),\n min: toOperation(a.min),\n max: toOperation(a.max),\n sum: toOperation(a.sum),\n itemCount: a.count ? {} : undefined,\n })),\n },\n finalFilter: params.havingTree,\n sort: toSort(params.orderBy),\n returnTotalCount,\n }\n : {}),\n })\n return [unwrapAggregationId(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(\n params.skipNumber,\n options?.returnTotalCount\n )\n\n return new WixDataResultImpl(items, paging, fetch, params)\n },\n })\n }\n\n fetchAggregate = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadOptions\n ) => {\n await apiValidator()\n .arity('fetchAggregate', args, 2, 4)\n .collectionName(collectionName)\n .isNonEmptyString(cursor, 'cursor')\n .validateAndReject()\n\n const fetch: PageFetcher<Record<string, any>> = (cursorOrOffset) =>\n this.trace('aggregate', { collectionName })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.aggregateDataItems({\n ...env,\n dataCollectionId: collectionName,\n ...toPaging(limit, cursorOrOffset),\n ...toReadOptions(options),\n })\n return [unwrapAggregationId(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(cursor, true)\n\n return new WixDataResultImpl(items, paging, fetch, {\n limitNumber: limit,\n skipNumber: 0,\n collectionName,\n })\n }\n )\n\n // --- bulk methods ---\n\n bulkRemove = withArgs(\n async (\n args,\n collectionName: string,\n itemIds: string[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkRemove', args, 2, 3)\n .collectionName(collectionName)\n .itemIds(itemIds, collectionName)\n .bulkRemoveOptions(options)\n .validateAndReject()\n\n return this.trace('bulkRemove', { collectionName })(async (env) => {\n const { results } = await this.client.bulkRemoveDataItems({\n ...env,\n dataCollectionId: collectionName,\n dataItemIds: itemIds,\n ...toOptions(options),\n })\n // Non-existing items are skipped and not reported as errors.\n return toBulkResult(itemIds, results!, ['WDE0073'])\n })\n }\n )\n\n private async runBulkSave(\n env: { environment?: apiTypes.Environment; appId?: string },\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions,\n overrideExisting: boolean = true\n ): Promise<WixDataBulkResult> {\n const request: apiTypes.BulkInsertDataItemsRequest = {\n ...env,\n dataCollectionId: collectionName,\n dataItems: items.map((data) => ({\n id: data._id,\n data,\n })),\n ...toOptions(options),\n }\n const { results } = await (overrideExisting\n ? this.client.bulkSaveDataItems(request)\n : this.client.bulkInsertDataItems(request))\n const ignoreCodes = overrideExisting ? [] : ['WDE0074']\n return toBulkResult(items, results!, ignoreCodes)\n }\n\n bulkInsert = withArgs(\n async (\n args,\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions & { overrideExisting?: boolean }\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkInsert', args, 2, 3)\n .items(items, collectionName)\n .bulkInsertOptions(options)\n .collectionName(collectionName)\n .validateAndReject()\n\n return this.trace('bulkInsert', { collectionName, options })(\n async (appId) =>\n this.runBulkSave(\n appId,\n collectionName,\n items,\n options,\n options?.overrideExisting ?? false\n )\n )\n }\n )\n\n bulkSave = withArgs(\n async (\n args,\n collectionName: string,\n items: Partial<WixDataItem>[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkSave', args, 2, 3)\n .bulkInsertOptions(options)\n .collectionName(collectionName)\n .items(items, collectionName)\n .validateAndReject()\n\n return this.trace('bulkSave', { collectionName })(async (env) =>\n this.runBulkSave(env, collectionName, items, options)\n )\n }\n )\n\n bulkUpdate = withArgs(\n async (\n args,\n collectionName: string,\n items: WixDataItem[],\n options?: WixDataOptions\n ): Promise<WixDataBulkResult> => {\n await apiValidator()\n .arity('bulkUpdate', args, 2, 3)\n .bulkUpdateOptions(options)\n .collectionName(collectionName)\n .items(items, collectionName)\n .validateAndReject()\n\n return this.trace('bulkUpdate', { collectionName })(async (env) => {\n const { results } = await this.client.bulkUpdateDataItems({\n ...env,\n dataCollectionId: collectionName,\n dataItems: items.map((data) => ({\n id: data._id,\n data,\n })),\n ...toOptions(options),\n })\n // Non-existing items are skipped and not reported as errors.\n return toBulkResult(items, results!, ['WDE0073'])\n })\n }\n )\n\n // --- references ---\n\n fetchReferenced = withArgs(\n async (\n args,\n collectionName: string,\n cursor: string,\n limit?: number,\n options?: WixDataReadWithProjectionOptions\n ): Promise<WixDataResult<WixDataItem | string>> => {\n await apiValidator()\n .arity('fetchReferenced', args, 2, 4)\n .isNonEmptyString(cursor, 'cursor')\n .collectionName(collectionName)\n .validateAndReject()\n\n const fetch: PageFetcher<WixDataItem | string> = (current) =>\n this.trace('fetchReferenced', { collectionName })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.queryReferencedDataItems({\n ...env,\n ...toPaging(limit, current),\n ...toReadOptions(options),\n dataCollectionId: collectionName,\n fields: options?.fields,\n })\n return [onlyReferencedItems(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(cursor)\n return new WixDataResultImpl(items, paging, fetch, {\n collectionName,\n limitNumber: limit,\n skipNumber: 0,\n })\n }\n )\n\n queryReferenced = withArgs(\n async (\n args,\n collectionName: string,\n holdingItem: WixDataItemOrId,\n relationshipAttribute: string,\n options?: WixDataQueryReferencedOptions\n ): Promise<WixDataResult> => {\n await apiValidator()\n .arity('queryReferenced', args, 3, 4)\n .collectionName(collectionName)\n .referenceParameter(holdingItem)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .options(options)\n .validateAndReject()\n\n const id = itemId(holdingItem)\n const fetch: PageFetcher = (cursorOrOffset, returnTotalCount) =>\n this.trace('queryReferenced', {\n collectionName,\n itemId: id,\n options,\n relationshipAttribute,\n })(async (env) => {\n const { results, pagingMetadata } =\n await this.client.queryReferencedDataItems({\n ...env,\n ...toPaging(options?.limit ?? 50, cursorOrOffset),\n ...toReadOptions(options),\n dataCollectionId: collectionName,\n fields: options?.fields,\n ...(isOffset(cursorOrOffset)\n ? {\n referringItemId: id,\n referringItemFieldName: relationshipAttribute,\n order:\n options?.order === 'asc'\n ? apiTypes.SortOrder.ASC\n : options?.order === 'desc'\n ? apiTypes.SortOrder.DESC\n : undefined,\n returnTotalCount,\n }\n : {}),\n })\n return [onlyReferencedItems(results!), pagingMetadata!]\n })\n\n const [items, paging] = await fetch(\n options?.skip ?? 0,\n options?.returnTotalCount\n )\n return new WixDataResultImpl(items, paging, fetch, {\n collectionName,\n limitNumber: options?.limit ?? 50,\n skipNumber: options?.skip ?? 0,\n })\n }\n )\n\n insertReference: {\n // overload with array of references\n (\n collectionName: string,\n refs: WixDataReference[],\n options?: WixDataOptions\n ): Promise<void>\n // overload with separate left and right(s)\n (\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ): Promise<void>\n } = withArgs(\n async (\n args,\n collectionName: string,\n refsOrAttr: any,\n leftOrOpts?: any,\n right?: any,\n options?: any\n ) => {\n let refs: WixDataReference[]\n let opts: WixDataOptions\n let argc: [number, number]\n\n if (typeof refsOrAttr === 'string') {\n const rights: WixDataItemOrId[] = asArray(right)\n refs = rights.map((r) => ({\n relationshipName: refsOrAttr,\n left: leftOrOpts as WixDataItemOrId,\n right: r,\n }))\n opts = options\n argc = [4, 5]\n } else {\n refs = refsOrAttr\n opts = leftOrOpts\n argc = [2, 3]\n }\n await apiValidator()\n .arity('insertReference', args, ...argc)\n .collectionName(collectionName)\n .references(refs)\n .options(opts)\n .validateAndReject()\n\n await this.trace('insertReference', { collectionName })(async (env) =>\n this.client.bulkInsertDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n dataItemReferences: refs.map((r) => ({\n referringItemFieldName: r.relationshipName,\n referringItemId: itemId(r.left),\n referencedItemId: itemId(r.right),\n })),\n ...toOptions(opts),\n })\n )\n }\n )\n\n replaceReferences = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ): Promise<void> => {\n const rights = asArray(right)\n await apiValidator()\n .arity('replaceReferences', args, 4, 5)\n .collectionName(collectionName)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .referenceParameter(left)\n .referenceParameters(rights)\n .options(options)\n .validateAndReject()\n\n await this.trace('replaceReferences', {\n collectionName,\n relationshipAttribute,\n })(async (env) =>\n this.client.replaceDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n newReferencedItemIds: rights.map(itemId),\n ...toOptions(options),\n })\n )\n }\n )\n\n removeReference = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId | WixDataItemOrId[],\n options?: WixDataOptions\n ) => {\n const rights = asArray(right)\n await apiValidator()\n .arity('removeReference', args, 4, 5)\n .collectionName(collectionName)\n .referenceParameter(left)\n .referenceRemoveParameters(rights)\n .isNonEmptyString(relationshipAttribute, 'relationshipAttribute')\n .options(options)\n .validateAndReject()\n\n await this.trace('removeReference', {\n collectionName,\n relationshipAttribute,\n })(async (env) =>\n this.client.bulkRemoveDataItemReferences({\n ...env,\n dataCollectionId: collectionName,\n dataItemReferences: rights.map((r) => ({\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n referencedItemId: itemId(r),\n })),\n ...toOptions(options),\n })\n )\n }\n )\n\n isReferenced = withArgs(\n async (\n args,\n collectionName: string,\n relationshipAttribute: string,\n left: WixDataItemOrId,\n right: WixDataItemOrId,\n options?: WixDataReadOptions\n ): Promise<boolean> => {\n await apiValidator()\n .arity('isReferenced', args, 4, 5)\n .collectionName(collectionName)\n .referenceParameter(left)\n .referenceParameter(right)\n .options(options)\n .validateAndReject()\n\n return this.trace('isReferenced', {\n collectionName,\n relationshipAttribute,\n })(async (env) => {\n const { isReferenced } = await this.client.isReferencedDataItem({\n ...env,\n dataCollectionId: collectionName,\n referringItemFieldName: relationshipAttribute,\n referringItemId: itemId(left),\n referencedItemId: itemId(right),\n ...toReadOptions(options),\n consistentRead: options?.consistentRead,\n })\n return isReferenced!\n })\n }\n )\n\n private trace(\n action: string,\n opts: object\n ): <R>(\n fn: (env: {\n environment?: apiTypes.Environment\n appId?: string\n }) => Promise<R>\n ) => Promise<R> {\n return async (fn) => {\n const gridAppId = await get(this.gridAppId)\n const env = { appId: gridAppId, environment: this.environment }\n if (this.tracer) {\n return this.tracer(`WixDataApi.${action}`, {\n ...opts,\n gridAppId,\n environment: this.environment,\n })(() => fn(env))\n }\n return fn(env)\n }\n }\n}\n\nfunction withArgs<Args extends any[], R>(\n fn: (all: IArguments, ...args: Args) => R\n): (...args: Args) => R {\n return function (...args) {\n return fn(arguments, ...args)\n }\n}\n\nfunction toPatchOptions(options?: WixDataPatchOptions) {\n return {\n suppressHooks: options?.suppressHooks,\n ...draftsOptions(options?.showDrafts),\n }\n}\n\nfunction toUpdateOptions(options?: WixDataUpdateOptions) {\n return {\n ...toOptions(options),\n includeReferencedItems: options?.includeReferences,\n }\n}\n\nfunction toOptions(opts?: WixDataOptions) {\n if (!opts) {\n return undefined\n }\n const res = {\n suppressHooks: opts.suppressHooks,\n appOptions: opts.appOptions,\n ...draftsOptions(opts?.showDrafts),\n }\n if (Object.entries(res).every((kv) => kv[1] === undefined)) {\n return undefined\n }\n return res\n}\n\nfunction toReadOptions(options?: WixDataReadOptions) {\n return {\n suppressHooks: options?.suppressHooks,\n appOptions: options?.appOptions,\n ...draftsOptions(options?.showDrafts),\n consistentRead: options?.consistentRead,\n language: options?.language,\n }\n}\n\nfunction draftsOptions(showDrafts?: boolean) {\n return showDrafts !== undefined\n ? { publishPluginOptions: { includeDraftItems: showDrafts } }\n : {}\n}\n\nfunction toDataItem(item: apiTypes.DataItem): WixDataItem {\n return item.data as WixDataItem\n}\n\nfunction toPaging(limit: number | undefined, cursorOrOffset: string | number) {\n return typeof cursorOrOffset === 'string'\n ? {\n cursorPaging: {\n limit,\n cursor: cursorOrOffset,\n },\n }\n : limit !== undefined || cursorOrOffset > 0\n ? {\n paging: {\n limit,\n offset: cursorOrOffset,\n },\n }\n : {}\n}\n\nfunction toSort(orderBy: QueryParams['orderBy']): apiTypes.Sorting[] {\n return orderBy.map((fieldOrder) => {\n const [[fieldName, sort]] = Object.entries(fieldOrder)\n const order =\n sort === 'asc'\n ? apiTypes.SortOrder.ASC\n : sort === 'desc'\n ? apiTypes.SortOrder.DESC\n : undefined\n return { fieldName, order }\n })\n}\n\nasync function get<T>(providerOrValue: T | Provider<T>): Promise<T> {\n if (typeof (providerOrValue as any)?.get === 'function') {\n return (providerOrValue as Provider<T>).get()\n }\n return providerOrValue as T\n}\n\nfunction recover<T>(code: string, value: T): (error: unknown) => Promise<T> {\n return (error) => {\n if (\n error instanceof Error &&\n (error as any)?.details?.applicationError?.code === code\n ) {\n return Promise.resolve(value)\n }\n return Promise.reject(error)\n }\n}\n\nfunction warnAboutBrokenFields(item: Partial<WixDataItem>) {\n const hasFieldWithDollar = hasField(item, (key) => key.startsWith('$'))\n const hasFieldWithDot = hasField(item, (key) => key.includes('.'))\n if (hasFieldWithDollar) {\n console.error(\n \"Data inserted contains field name prefixed with symbol '$'. It is not recommended to use such field names as it will not work with some data operations.\"\n )\n }\n if (hasFieldWithDot) {\n console.warn(\n \"Data inserted contains field name containing symbol '.'. It is not recommended to use such field names as it will not work with some data operations.\"\n )\n }\n}\n\nfunction toBulkResult(\n request: any[],\n results: apiTypes.BulkDataItemResult[],\n ignoreCodes: string[] = []\n): WixDataBulkResult {\n const errors = results.flatMap((r) => {\n if (r.itemMetadata?.success || !r.itemMetadata?.error) {\n return []\n }\n if (ignoreCodes.includes(r.itemMetadata.error.code ?? '')) {\n return []\n }\n return [\n new BulkError(\n r.itemMetadata.error.description!,\n r.itemMetadata.error.code!,\n request[r.itemMetadata.originalIndex!],\n 'BulkError',\n r.itemMetadata.originalIndex!\n ),\n ]\n })\n const success = results.filter((r) => r.itemMetadata?.success)\n const inserted = success.filter(\n (r) => r.action === apiTypes.BulkActionType.INSERT\n )\n const updated = success.filter(\n (r) =>\n r.action === apiTypes.BulkActionType.UPDATE ||\n r.action === apiTypes.BulkActionType.PATCH\n )\n const removed = success.filter(\n (r) => r.action === apiTypes.BulkActionType.DELETE\n )\n return {\n inserted: inserted.length,\n updated: updated.length,\n removed: removed.length,\n skipped: request.length - errors.length - success.length,\n errors,\n insertedItemIds: inserted.map((r) => r.itemMetadata?.id!),\n updatedItemIds: updated.map((r) => r.itemMetadata?.id!),\n removedItemIds: removed.map((r) => r.itemMetadata?.id!),\n }\n}\n\nfunction unwrapAggregationId(\n items: Record<string, any>[]\n): Record<string, any>[] {\n // When grouping by one field WixDataService returns value on _id field directly, DataItemService wraps it in an object, i.e.\n // grouping by surname returns {_id: 'Simpson'} in WixDataService vs {_id: {surname: 'Simpson'}} in DataItemService\n // When grouping by more fields, values are kept wrapped.\n return items.map((item) => {\n const id = item._id\n if (isObject(id)) {\n const [key, ...rest] = Object.keys(id)\n if (rest.length === 0) {\n item._id = id[key]\n return item\n }\n }\n return item\n })\n}\n\nfunction onlyReferencedItems(\n results: apiTypes.ReferencedResult[]\n): WixDataItem[] {\n return results\n .map((result) => result.dataItem)\n .filter(notEmpty)\n .map(toDataItem)\n}\n\nfunction notEmpty<T>(value: T | null | undefined): value is T {\n return value != null\n}\n\nfunction itemId(item: WixDataItemOrId): string {\n return typeof item === 'string' ? item : item._id\n}\n\nfunction asArray<T>(xOrXs: T | T[]): T[] {\n return isArray(xOrXs) ? (xOrXs as T[]) : [xOrXs as T]\n}\n\nfunction isOffset(cursorOrOffset: string | number) {\n return typeof cursorOrOffset === 'number'\n}\n\nconst ItemDoesNotExistCode = 'WDE0073'\n\nfunction apiValidator() {\n return commonApiValidator(wdeValidationError)\n}\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAcA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AASA,IAAAS,iBAAA,GAAAT,OAAA;AAAgF,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,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AkB,EAAC7L,0BAAkB,CAAC;AAC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/api/WixDataPatch.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/api/WixDataPatch.ts"],"sourcesContent":["import { WixDataItem, WixDataBulkResult, WixDataPatchOptions } from './types'\n\nexport interface FieldModification {\n fieldPath: string\n action:\n | 'SET_FIELD'\n | 'REMOVE_FIELD'\n | 'INCREMENT_FIELD'\n | 'APPEND_TO_ARRAY'\n | 'REMOVE_FROM_ARRAY'\n actionOptions?: any\n}\n\n/**\n * @builder\n */\nexport interface WixDataBulkPatch {\n /**\n * Refines a patch operation to increment the specified field by the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is modified.\n * @requiredField fieldName\n * @param by - Value by which to increment the specified field. You can specify positive or negative values.\n * @requiredField by\n * @returns Updated patch.\n */\n incrementField(fieldName: string, by: number): WixDataBulkPatch\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set.\n * @requiredField fieldName\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch.\n */\n setField(fieldName: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to.\n * @requiredField fieldName\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch.\n */\n appendToArray(fieldName: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to remove the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from.\n * @requiredField fieldName\n * @param value - Value to remove from the specified array field.\n * @requiredField value\n * @returns Updated patch.\n */\n removeFromArray(fieldName: string, value: any): WixDataBulkPatch\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared.\n * @requiredField fieldName\n * @returns Updated patch.\n */\n removeField(fieldName: string): WixDataBulkPatch\n\n /**\n * Runs the bulk patch operation and returns a Promise that resolves to information about the operation results.\n *\n * @public\n * @documentationMaturity preview\n * @returns Bulk operation results.\n */\n run(options?: WixDataPatchOptions): Promise<WixDataBulkResult>\n}\n\n/**\n * @builder\n */\nexport interface WixDataPatch {\n /**\n * Refines a patch operation to increment the specified field by the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is modified.\n * @requiredField fieldName\n * @param by - Value by which to increment the specified field. You can specify positive or negative values.\n * @requiredField by\n * @returns Updated patch.\n */\n incrementField(fieldName: string, by: number): WixDataPatch\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set.\n * @requiredField fieldName\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch.\n */\n setField(fieldName: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to.\n * @requiredField fieldName\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch.\n */\n appendToArray(fieldName: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to remove the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from.\n * @requiredField fieldName\n * @param value - Value to remove from the specified array field.\n * @requiredField value\n * @returns Updated patch.\n */\n removeFromArray(fieldName: string, value: any): WixDataPatch\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared.\n * @requiredField fieldName\n * @returns Updated patch.\n */\n removeField(fieldName: string): WixDataPatch\n\n /**\n * Runs the patch operation and returns the patched item.\n *\n * The `run()` method returns a Promise that resolves to the patched item and item metadata.\n *\n * @public\n * @documentationMaturity preview\n * @returns Modified data item.\n */\n\n run(options?: WixDataPatchOptions): Promise<WixDataItem | null>\n}\n"],"mappings":""}
|