@wix/wix-data-items-common 1.0.78 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":[],"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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\n * @public\n * @documentationMaturity preview\n * @param projectedField - Field in the aggregation results that contains the count value. Defaults to `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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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\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 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\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 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://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections).\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 { 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 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/WixDataFilter.ts"],"sourcesContent":["/**\n * @builder\n */\nexport interface WixDataFilter {\n /**\n * Refines a filter to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this filter to only\n * match items where the value of the specified field equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type Array, `eq()` includes the item\n * as long as at least one Array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this filter to only\n * match items where the value of the specified field does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` includes items\n * in which none of the elements of the Array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this filter to only\n * match items where the value of the specified field is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this filter to only match\n * items where the value of the specified field is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this filter to only match\n * items where the value of the specified field is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this filter to only match\n * items where the value of the specified field is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this filter to only match items where the\n * value of the specified field is `null` or `undefined` or the field does\n * not exist.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined filter.\n */\n isEmpty(field: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this filter to\n * only match items where the value of the specified field starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this filter to only\n * match items where the value of the specified field ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided value.\n * @requiredField field\n * @param value - Value to locate in the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this filter to\n * only match items where the value of the specified field equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified field contains multiple references, pass item IDs in the\n * `value` field. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this filter to\n * only match items where the value of the specified field equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `values`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasAll(field: string, ...values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Adds an `or` condition to the filter.\n *\n * The `or()` method adds an inclusive `or` condition to this filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: WixDataFilter): WixDataFilter\n\n /**\n * Adds an `and` condition to the filter.\n *\n * A filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = items.filter()\n * .eq(\"status\", \"pending\")\n * .or(items.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = items.filter()\n * .lt(\"age\", 25)\n * .or(items.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `WixDataFilter` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * items.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `WixDataFilter` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: WixDataFilter): WixDataFilter\n\n /**\n * Adds a `not` condition to the filter.\n *\n * The `not()` method adds a `not` condition to this filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: WixDataFilter): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only matches values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - field whose value is compared with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): WixDataFilter\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["../../../src/api/WixDataFilter.ts"],"sourcesContent":["/**\n * @builder\n */\nexport interface WixDataFilter {\n /**\n * Refines a filter to match items whose specified field value equals the specified value.\n *\n * The `eq()` method refines this filter to only\n * match items where the value of the specified field equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to compare with.\n * @requiredField value\n * @returns Refined filter.\n */\n eq(field: string, value: any): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value does not equal the specified value.\n *\n * The `ne()` method refines this filter to only\n * match items where the value of the specified field does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of `field` is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ne(field: string, value: any): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this filter to only\n * match items where the value of the specified field is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n ge(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is greater than the specified value.\n *\n * The `gt()` method refines this filter to only match\n * items where the value of the specified field is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this filter to only match\n * items where the value of the specified field is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined filter.\n */\n le(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is less than the specified value.\n *\n * The `lt()` method refines this filter to only match\n * items where the value of the specified field is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a field contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified field are ranked lowest.\n *\n * The following field types can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the filter definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field has any value.\n *\n * The `isNotEmpty()` method refines this filter to only match items where the\n * value of the specified field is not `null` or `undefined`.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined filter.\n */\n isNotEmpty(field: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this filter to only match items where the\n * value of the specified field is `null` or `undefined` or the field does\n * not exist.\n *\n * If the field contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the filter.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns An object representing the refined filter.\n */\n isEmpty(field: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value starts with a specified string.\n *\n * The `startsWith()` method refines this filter to\n * only match items where the value of the specified field starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - Value to look for at the beginning of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n startsWith(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value ends with a specified string.\n *\n * The `endsWith()` method refines this filter to only\n * match items where the value of the specified field ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a field whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - Value to look for at the end of the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n endsWith(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value contains the specified value.\n *\n * The `contains()` method refines the filter to only match items for which the value of the specified field contains the specified value. `contains()` is not case-sensitive, so the value `sunday` is considered to contain the value `Sun`.\n *\n * You can use `contains()` with a field whose type is a string or a reference. However, for fields whose type is reference, `contains()` matches by the ID of the referenced item as a string. Instead, use the [`eq()`](https://dev.wix.com/docs/sdk/backend-modules/data/wix-data-items-sdk-1-0-0/wix-data-filter/eq) method.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the provided value.\n * @requiredField field\n * @param value - Value to locate in the specified field value.\n * @requiredField value\n * @returns Refined filter.\n */\n contains(field: string, value: string): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this filter to\n * only match items where the value of the specified field equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified field contains multiple references, pass item IDs in the\n * `value` field. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasSome(field: string, ...values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this filter to\n * only match items where the value of the specified field equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified field is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `values`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns An object representing the refined filter.\n */\n hasAll(field: string, ...values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: string[] | number[] | Date[]): WixDataFilter\n\n /**\n * Adds an `or` condition to the filter.\n *\n * The `or()` method adds an inclusive `or` condition to this filter. A filter\n * with an `or` returns all the items that match the filter as defined up to\n * the `or` method, the items that match the filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters.\n * If you use it on its own, it will return all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n or(filter: WixDataFilter): WixDataFilter\n\n /**\n * Adds an `and` condition to the filter.\n *\n * A filter with an `and` condition returns all items that meet the conditions defined on both sides of the condition.\n *\n * Use the `and()` method when performing compound queries. For example, the final filter in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n *\n * ```js\n * let statusFilter = items.filter()\n * .eq(\"status\", \"pending\")\n * .or(items.filter().eq(\"status\", \"rejected\"));\n *\n * let ageFilter = items.filter()\n * .lt(\"age\", 25)\n * .or(items.filter().gt(\"age\", 65));\n *\n * let statusAndAgeFilter = statusFilter.and(ageFilter);\n * ```\n *\n * > **Notes**:\n * > - The `and()` method is designed to work with 2 or more queries or filters. If used with a single query or filter, it returns all items in a collection.\n * > - When chaining multiple `WixDataFilter` methods to a filter, an `and` condition is implied. In such cases, you do not need to call the `and()` method explicitly. For example, this filter returns results where an item `status` is `active` and `age` is greater than 25:\n *\n * ```js\n * items.filter().eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * @public\n * @documentationMaturity preview\n * @param filter - `WixDataFilter` used with an `and` condition.\n * @requiredField filter\n * @returns The compound filter.\n */\n and(filter: WixDataFilter): WixDataFilter\n\n /**\n * Adds a `not` condition to the filter.\n *\n * The `not()` method adds a `not` condition to this filter. A filter with a `not`\n * returns all the items that match the filter as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the filter only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Object representing the refined filter.\n */\n not(filter: WixDataFilter): WixDataFilter\n\n /**\n * Refines a filter to match items whose specified field value is within the defined range.\n *\n * The `between()` method refines this filter to match items for which the value of the specified field is greater than or equal to `rangeStart` and less than `rangeEnd`. The method only matches values of [the same type](https://support.wix.com/en/article/cms-formerly-content-manager-about-your-collection-fields#field-type).\n *\n * The following types can be compared:\n * - Number: Compared numerically.\n * - Date: Compared as JavaScript Date objects.\n * - String: Compared lexicographically:\n * - `\"A\"` and `\"M\"` are considered between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are considered between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n *\n * > **Note**: Items that do not have a value for the specified field are considered as the lowest comparable value and are ranked last.\n *\n * @public\n * @documentationMaturity preview\n * @param field - Field to compare with `rangeStart` and `rangeEnd`.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined filter.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): WixDataFilter\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/WixDataQuery.ts"],"sourcesContent":["import { WixDataQueryOptions, WixDataReadOptions } from './types'\nimport { WixDataResult } from './WixDataResult'\nimport { WixDataFilter } from './WixDataFilter'\n\n/**\n * @builder\n */\nexport interface WixDataQuery {\n /**\n * Adds a sort to a query or sort, sorting by the specified properties in descending order.\n *\n * The `descending()` method refines this query to sort in descending order of the specified properties. If you\n * specify more than one property, descending() sorts the results in descending order by each property in the order\n * they are listed.\n *\n * You can sort the following types:\n *\n * Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes before `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items\n * that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n descending(...fields: string[]): WixDataQuery\n\n descending(fields: string[]): WixDataQuery\n\n descending(...fields: any): WixDataQuery\n\n /**\n * Adds a sort to a query or sort, sorting by the specified properties in ascending order.\n *\n * The `ascending()` method refines this query in ascending order of the specified properties. If you specify more\n * than one property, `ascending()` sorts the results in ascending order by each property in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically.\n * Items that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n ascending(...fields: string[]): WixDataQuery\n\n ascending(fields: string[]): WixDataQuery\n\n ascending(...fields: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value equals the specified value.\n *\n * The `eq()` method refines this query to only\n * match items where Value of the specified property equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type Array, `eq()` includes the item\n * as long as at least one Array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n eq(field: string, value: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` method refines this query to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an Array, `ne()` includes items\n * in which none of the elements of the Array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n ne(field: string, value: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this query to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n ge(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` method refines this query to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this query to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n le(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is less than the specified value.\n *\n * The `lt()` method refines this query to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property has any value.\n *\n * The `isNotEmpty()` method refines this query to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined query.\n */\n isNotEmpty(field: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this query to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined query.\n */\n isEmpty(field: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value starts with a specified string.\n *\n * The `startsWith()` method refines this query to\n * only match items where the value of the specified property starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - String to look for at the beginning of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n startsWith(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value ends with a specified string.\n *\n * The `endsWith()` method refines this query to only\n * match items where the value of the specified property ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - String to look for at the end of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n endsWith(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value contains a specified string.\n *\n * The `contains()` method refines this query to\n * only match items where the value of the specified property contains the\n * specified `string`. Matching with `contains()` is not case sensitive, so\n * `\"text\"` does contain `\"Tex\"`.\n *\n * You can use `contains()` with a property whose value is a String or a Reference.\n * For properties of type reference it is recommended that you use the [`eq()`](#eq)\n * method instead of `contains()`. With properties that are References, `contains()`\n * matches by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns Refined query.\n */\n contains(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this query to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns Refined query.\n */\n hasSome(field: string, ...values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this query to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns Refined query.\n */\n hasAll(field: string, ...values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Adds an `or` condition to the query or filter.\n *\n * The `or()` method adds an inclusive `or` condition to this filter. A query or filter\n * with an `or` returns all the items that match the query or filter as defined up to\n * the `or` method, the items that match the query or filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters. Used on its own, it returns all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n or(filter: WixDataFilter): WixDataQuery\n\n /**\n * Adds an `and` condition to the query or filter.\n *\n * The `and()` method adds an and condition to this query. A query or filter with an `and` returns all the items\n * that match the query or filter as defined up to the `and` method and also match the query or filter passed to\n * the `and` method.\n *\n * Note that when chaining multiple `WixDataFilter` methods to a query an and condition is assumed. In such cases,\n * you do not need to add a call to the `and()` method. For example, this query returns results where status is\n * active **and** age is greater than 25.\n * ```js\n * items.query(\"myCollection\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` method is needed when performing compound queries. For example, the final query in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```js\n * let statusQuery = items\n * .query(\"myCollection\")\n * .eq(\"status\", \"pending\")\n * .or(items.filter().eq(\"status\", \"rejected\"));\n *\n * let ageQuery = items\n * .filter()\n * .lt(\"age\", 25)\n * .or(items.filter().gt(\"age\", 65));\n *\n * let statusAndAgeQuery = statusQuery.and(ageQuery);\n * ```\n *\n * The `and()` method is designed to work with 2 or more queries or filters. When used on its own, it returns all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial query as an `and` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n and(filter: WixDataFilter): WixDataQuery\n\n /**\n * Adds a `not` condition to the query or filter.\n *\n * The `not()` method adds a `not` condition to this query. A query with a `not`\n * returns all the items that match the query as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the query only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n not(filter: WixDataFilter): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is within a specified range.\n *\n * The `between()` method refines this query to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * It only matches values of the same type. For example, a number value stored as a String type does not match the\n * same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared alphabetically and not numerically. Items\n * that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined query.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): WixDataQuery\n\n /**\n * Returns the number of items that match the query.\n *\n * The `count()` method returns a Promise that resolves to the number of\n * items that match the query. The Promise is rejected if `count()` is called\n * with incorrect permissions or if any of the methods used to refine the\n * query is invalid.\n *\n * Calling the `count()` method triggers the `beforeCount()` and `afterCount()` hooks if they have been defined.\n *\n * Use the `options` parameter to run `count()` without checking for permissions\n * or without its registered hooks.\n *\n * Any method that does not filter query results (e.g., [`ascending()`](#ascending))\n * does not affect the result of `count()`.\n *\n * If you build a query and don't refine it with any `WixDataQuery` methods,\n * `count()` returns the total number of items in the collection.\n *\n * > **Note**: You can also retrieve the number of query results by calling `find()` and setting the `options.returnTotalCount` property to `true`.\n *\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when processing this operation.\n * @returns Number of items that match the query.\n */\n count(options?: WixDataReadOptions): Promise<number>\n\n /**\n * Returns the distinct values that match the query, without duplicates.\n *\n * The `distinct()` method returns a Promise that resolves to:\n * - The distinct values found in the specified field when running the query.\n * - Additional information about the results, such as the number of values that match the query.\n *\n * Unlike `find()`, which returns all item objects that match the query, `distinct()` returns matching field values,\n * and eliminates duplicate field values from the query result. You cannot use `find()` and `distinct()` together.\n *\n * For an item to be resolved as distinct, only the specified field must be distinct. Other fields for that item in\n * the collection are not evaluated when resolving the promise.\n *\n * The Promise is rejected if `distinct()` is called with incorrect permissions or if any of the\n * methods used to refine the query is invalid.\n *\n * >**Note:** Only site visitors with [Data Read](https://support.wix.com/en/article/collection-permissions-an-overview#permissions)\n * permissions can retrieve and view data. You can override the permissions in backend code by setting the\n * `options.suppressAuth` option to `true`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared for distinct values.\n * @requiredField field\n * @param options - Configuration options for building the query.\n * @returns Promise that resolves to the results of the query.\n */\n distinct(\n field: string,\n options?: WixDataQueryOptions\n ): Promise<WixDataResult<any>>\n\n /**\n * Returns the items that match the query.\n *\n * The `find()` method returns a Promise that resolves to the results found\n * by the query and some information about the results. The Promise is\n * rejected if `find()` is called with incorrect permissions or if any of the\n * methods used to refine the query is invalid.\n *\n * Calling the `find()` method triggers the `beforeQuery()` and `afterQuery()` hooks if they have been defined.\n *\n * > **Note:**\n * > Calling `find()` triggers hooks for the specified collection only. It doesn't trigger hooks for referenced\n * > collections.\n *\n * Use the `options` parameter to override default preferences:\n * - Override permission checks with `suppressAuth`.\n * - Ensure the most up-to-date data is retrieved with `consistentRead`.\n * - Prevent hooks from running with `suppressHooks`.\n * - Speed up execution with `omitTotalCount`, if you don't need a count of items matching the query.\n *\n * If you build a query and don't refine it with any `wixDataQuery` methods,\n * `find()` returns the entire collection.\n * @public\n * @documentationMaturity preview\n * @param options - Configuration options for building the query.\n * @returns Promise that resolves to the results of the query.\n */\n find(options?: WixDataQueryOptions): Promise<WixDataResult>\n\n /**\n * Lists the fields to return in a query's results.\n *\n * The `fields()` method returns only the specified fields in the query's results.\n *\n * You can use `include()` in conjunction with `fields()` to get referenced items.\n *\n * When `fields()` receives an empty or invalid property, the query behaves as follows:\n * - When no fields are specified, the query returns all fields.\n * - When multiple fields are specified but some are invalid, invalid fields are ignored and valid fields are returned.\n * - When only invalid fields are specified, only the default `_id` field is returned.\n * @public\n * @documentationMaturity preview\n * @param fields - Properties to return.\n * @requiredField fields\n * @returns A `WixDataQuery` object representing the query.\n */\n fields(...fields: string[]): WixDataQuery\n\n /**\n * Limits the number of items the query returns.\n *\n * The `limit()` method defines the number of results a query returns in each\n * page. Only one page of results is retrieved at a time. The `next()`\n * and `prev()` methods are used to\n * 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 that for some Wix app collections, the maximum value `limit()` can accept is\n * less than `1000`. For example, the maximum limit for the Wix `Stores/Product` collection is 100.\n * @public\n * @documentationMaturity preview\n * @param limitNumber - Number of items to return, which is also the `pageSize` of the results object.\n * @requiredField limitNumber\n * @returns `WixDataQuery` object representing the refined query.\n */\n limit(limitNumber: number): WixDataQuery\n\n /**\n * Sets the number of items to skip before returning query results.\n *\n * The `skip()` method defines the number of results to skip in the query\n * results before returning new query results.\n *\n * For example, if you query a collection and 50 items match your query, but\n * you set `skip` to 10, the results returned will skip the first 10 items\n * that match and return the 11th through 50th items.\n *\n * By default, `skip` is set to 0.\n * @public\n * @documentationMaturity preview\n * @param skipCount - Number of items to skip in the query results before returning the results.\n * @requiredField skipCount\n * @returns `WixDataQuery` object representing the refined query.\n */\n skip(skipCount: number): WixDataQuery\n\n /**\n * Includes referenced items for the specified properties in a query's results.\n *\n * The `include()` method refines a query so that the items returned in the\n * query's results include the full referenced items for the specified properties.\n *\n * For example, suppose you have a **books** collection with an **author**\n * field that references an **authors** collection. Querying the **books**\n * collection with an `include(\"author\")` returns the relevant book items\n * and each item will include the full referenced author item in the book's\n * `author` property.\n *\n * When querying a collection that contains a reference field without using the\n * `include()` method:\n * - Single reference field: returned items contain only the ID of the\n * referenced item, and not the full referenced items.\n * - Multiple reference field: returned items do not contain the multiple\n * reference field at all.\n *\n * When including a property with multiple references, the following limitations\n * apply:\n * - Only one property with multiple references can be included.\n * - The query will return an error if more than 50 items are returned, regardless\n * of any query limit set using the `limit()` method.\n * - Each returned item can include up to 50 referenced items. If there are more\n * than 50 referenced items, only 50 are returned when the query is run\n * and the `partialIncludes`\n * property of the returned `WixDataQueryResult`\n * is `true`. To retrieve more than 50 referenced items, use the\n * `queryReferenced()` method.\n *\n * For a discussion of when to use the similar `queryReferenced()`\n * method and when to use `include()`, see [Querying Items that Reference Other Items](https://support.wix.com/en/article/including-referenced-data-when-filtering).\n *\n * > **Notes:**\n * > - Calling the `include()` method does not trigger any hooks.\n * > - The `include()` method is not supported for Single Item Collections.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields for which to include referenced items.\n * @requiredField fields\n * @returns A `WixDataQuery` object representing the query.\n */\n include(...fields: string[]): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(field: string, limit?: number): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(field1: string, field2: string, limit?: number): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n field5: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(...fieldNamesAndLimit: [...string[], number]): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(...args: unknown[]): WixDataQuery\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["../../../src/api/WixDataQuery.ts"],"sourcesContent":["import { WixDataQueryOptions, WixDataReadOptions } from './types'\nimport { WixDataResult } from './WixDataResult'\nimport { WixDataFilter } from './WixDataFilter'\n\n/**\n * @builder\n */\nexport interface WixDataQuery {\n /**\n * Adds a sort to a query or sort, sorting by the specified properties in descending order.\n *\n * The `descending()` method refines this query to sort in descending order of the specified properties. If you\n * specify more than one property, descending() sorts the results in descending order by each property in the order\n * they are listed.\n *\n * You can sort the following types:\n *\n * Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes before `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically. Items\n * that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n descending(...fields: string[]): WixDataQuery\n\n descending(fields: string[]): WixDataQuery\n\n descending(...fields: any): WixDataQuery\n\n /**\n * Adds a sort to a query or sort, sorting by the specified properties in ascending order.\n *\n * The `ascending()` method refines this query in ascending order of the specified properties. If you specify more\n * than one property, `ascending()` sorts the results in ascending order by each property in the order they are listed.\n *\n * You can sort the following types:\n * - Number: Sorts numerically.\n * - Date: Sorts by date and time.\n * - String: Sorts lexicographically, so `\"abc\"` comes after `\"XYZ\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n *\n * If a property contains a number as a String, that value is sorted alphabetically and not numerically.\n * Items that do not have a value for the specified sort property are ranked lowest.\n * @public\n * @documentationMaturity preview\n * @param fields - Fields used in the sort.\n * @requiredField fields\n * @returns Refined query.\n */\n ascending(...fields: string[]): WixDataQuery\n\n ascending(fields: string[]): WixDataQuery\n\n ascending(...fields: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value equals the specified value.\n *\n * The `eq()` method refines this query to only\n * match items where Value of the specified property equals the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * Matching strings with `eq()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If `field` points to a collection field of type array, `eq()` includes the item\n * as long as at least one array element matches the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n eq(field: string, value: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value does not equal the specified value.\n *\n * The `ne()` method refines this query to only\n * match items where the value of the specified property does not equal the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type is considered not equal to the same number stored as a Number type.\n *\n * Matching strings with `ne()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the `field` property is an array, `ne()` includes items\n * in which none of the elements of the array match the specified `value`.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n ne(field: string, value: any): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is greater than or equal to the specified\n * value.\n *\n * The `ge()` method refines this query to only\n * match items where the value of the specified property is greater than or\n * equal to the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"abc\"` is greater than or equal to `\"ABC\"` (because of the greater than),\n * but `\"ABC\"` is not greater than or equal to `\"abc\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n ge(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is greater than the specified value.\n *\n * The `gt()` method refines this query to only match\n * items where the value of the specified property is greater than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"text\"` is greater than `\"Text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n gt(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is less than or equal to the specified\n * value.\n *\n * The `le()` method refines this query to only match\n * items where the value of the specified property is less than or equal to the\n * specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically,\n * so `\"ABC\"` is less than or equal to `\"abc\"` (because of the less than),\n * but `\"abc\"` is not less than or equal to `\"ABC\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns Refined query.\n */\n le(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is less than the specified value.\n *\n * The `lt()` method refines this query to only match\n * items where the value of the specified property is less than the specified `value`.\n *\n * It only matches values of the same type. For example, a number value stored\n * as a String type does not match the same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared\n * alphabetically and not numerically. Items that do not have a value for the\n * specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so `\"Text\"` is less than `\"text\"`.\n * - Reference: Compares by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param value - Value to match.\n * @requiredField value\n * @returns An object with the query definition, based on the supplied parameters.\n */\n lt(field: string, value: string | number | Date): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property has any value.\n *\n * The `isNotEmpty()` method refines this query to only match items where the\n * value of the specified property is not `null` or `undefined`.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined query.\n */\n isNotEmpty(field: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property does not exist or does not have any value.\n *\n * The `isEmpty()` method refines this query to only match items where the\n * value of the specified property is `null` or `undefined` or the property does\n * not exist.\n *\n * If the property contains any value at all for a given item, including the\n * empty string or an invalid value, that item will match the query.\n * @public\n * @documentationMaturity preview\n * @param field - Field in which to check for a value.\n * @requiredField field\n * @returns Refined query.\n */\n isEmpty(field: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value starts with a specified string.\n *\n * The `startsWith()` method refines this query to\n * only match items where the value of the specified property starts with the\n * defined `string`. Matching with `startsWith()` is not case sensitive, so `\"TEXT\"` starts\n * with `\"tex\"`.\n *\n * You can only use `startsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `startsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the `value` parameter.\n * @requiredField field\n * @param value - String to look for at the beginning of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n startsWith(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value ends with a specified string.\n *\n * The `endsWith()` method refines this query to only\n * match items where the value of the specified property ends with the specified\n * `string`. Matching with `endsWith()` is not case sensitive, so `\"TEXT\"` ends\n * with `\"ext\"`.\n *\n * You can only use `endsWith()` with a property whose value is a String or Reference.\n * When using a Reference, `endsWith()` matches by the ID of the referenced item as Strings.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - String to look for at the end of the specified property value.\n * @requiredField value\n * @returns `WixDataQuery` object representing the refined query.\n */\n endsWith(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value contains a specified string.\n *\n * The `contains()` method refines this query to\n * only match items where the value of the specified property contains the\n * specified `string`. Matching with `contains()` is not case sensitive, so\n * `\"text\"` does contain `\"Tex\"`.\n *\n * You can use `contains()` with a property whose value is a String or a Reference.\n * For properties of type reference it is recommended that you use the [`eq()`](#eq)\n * method instead of `contains()`. With properties that are References, `contains()`\n * matches by the ID of the referenced item as a String.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with the string.\n * @requiredField field\n * @param value - The string to look for inside the specified property value.\n * @requiredField value\n * @returns Refined query.\n */\n contains(field: string, value: string): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value equals any of the specified `values`\n * parameters.\n *\n * The `hasSome()` method refines this query to\n * only match items where the value of the specified property equals any of\n * the specified values.\n *\n * Matching strings with `hasSome()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasSome()` will match\n * if any of the elements of that array match any of the specified values.\n *\n * If the specified property contains multiple references, pass item IDs in the\n * `value` property. In such a case, `hasSome()` will match if any of the\n * multiple references match any of the specified ID values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns Refined query.\n */\n hasSome(field: string, ...values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Overload for `hasSome()`\n * @public\n * @documentationMaturity preview\n */\n hasSome(field: string, values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property values equals all of the specified `value`\n * parameters.\n *\n * The `hasAll()` method refines this query to\n * only match items where the value of the specified property equals all of\n * the specified values.\n *\n * Matching strings with `hasAll()` is case sensitive, so `\"text\"` is not equal to `\"Text\"`.\n *\n * If the value of the specified property is an array, `hasAll()` will match\n * if there is a match in the elements of that array for all of the specified\n * values.\n *\n * You can specify a list of values to match by providing an array of\n * String, Number, or Date types as the `value` parameters.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with `value`.\n * @requiredField field\n * @param values - Values to match.\n * @requiredField values\n * @returns Refined query.\n */\n hasAll(field: string, ...values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Overload for `hasAll()`\n * @public\n * @documentationMaturity preview\n */\n hasAll(field: string, values: string[] | number[] | Date[]): WixDataQuery\n\n /**\n * Adds an `or` condition to the query or filter.\n *\n * The `or()` method adds an inclusive `or` condition to this filter. A query or filter\n * with an `or` returns all the items that match the query or filter as defined up to\n * the `or` method, the items that match the query or filter passed to the `or`\n * method, and the items that match both.\n *\n * The `or()` method is designed to work with 2 or more queries or filters. Used on its own, it returns all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as an `or` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n or(filter: WixDataFilter): WixDataQuery\n\n /**\n * Adds an `and` condition to the query or filter.\n *\n * The `and()` method adds an and condition to this query. A query or filter with an `and` returns all the items\n * that match the query or filter as defined up to the `and` method and also match the query or filter passed to\n * the `and` method.\n *\n * Note that when chaining multiple `WixDataFilter` methods to a query an and condition is assumed. In such cases,\n * you do not need to add a call to the `and()` method. For example, this query returns results where status is\n * active **and** age is greater than 25.\n * ```js\n * items.query(\"myCollection\").eq(\"status\", \"active\").gt(\"age\", 25);\n * ```\n *\n * The `and()` method is needed when performing compound queries. For example, the final query in this set of\n * queries returns results where status is either pending or rejected **and** age is either less than 25 or greater\n * than 65.\n * ```js\n * let statusQuery = items\n * .query(\"myCollection\")\n * .eq(\"status\", \"pending\")\n * .or(items.filter().eq(\"status\", \"rejected\"));\n *\n * let ageQuery = items\n * .filter()\n * .lt(\"age\", 25)\n * .or(items.filter().gt(\"age\", 65));\n *\n * let statusAndAgeQuery = statusQuery.and(ageQuery);\n * ```\n *\n * The `and()` method is designed to work with 2 or more queries or filters. When used on its own, it returns all the items in a collection.\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial query as an `and` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n and(filter: WixDataFilter): WixDataQuery\n\n /**\n * Adds a `not` condition to the query or filter.\n *\n * The `not()` method adds a `not` condition to this query. A query with a `not`\n * returns all the items that match the query as defined up to the `not`\n * method, but don't match the filter passed to the `not` method.\n *\n * If the query only contains a `not()` method, it returns all the items\n * that don't match the filter defined by the `not` method.\n *\n * @public\n * @documentationMaturity preview\n * @param filter - Filter to add to the initial filter as a `not` condition.\n * @requiredField filter\n * @returns Refined query.\n */\n not(filter: WixDataFilter): WixDataQuery\n\n /**\n * Refines a query to match items whose specified property value is within a specified range.\n *\n * The `between()` method refines this query to only match items where the value of the specified property is\n * greater than or equal to `rangeStart` and less than `rangeEnd`.\n *\n * It only matches values of the same type. For example, a number value stored as a String type does not match the\n * same number stored as a Number type.\n *\n * If a property contains a number as a String, that value is compared alphabetically and not numerically. Items\n * that do not have a value for the specified property are ranked lowest.\n *\n * The following types of properties can be compared:\n * - Number: Compares numerically.\n * - Date: Compares JavaScript Date objects.\n * - String: Compares lexicographically, so\n * - `\"A\"` and `\"M\"` are between `\"A\"` and `\"Z\"`, but `\"a\"`, `\"m\"`, `\"z\"` and `\"Z\"` are not.\n * - `\"A\"`, `\"M\"`, `\"Z\"`, and `\"a\"` are between `\"A\"` and `\"z\"`, but `\"z\"` is not.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared with rangeStart and rangeEnd.\n * @requiredField field\n * @param rangeStart - Starting value of the range to match.\n * @requiredField rangeStart\n * @param rangeEnd - Ending value of the range to match.\n * @requiredField rangeEnd\n * @returns Refined query.\n */\n between(\n field: string,\n rangeStart: string | number | Date,\n rangeEnd: string | number | Date\n ): WixDataQuery\n\n /**\n * Returns the number of items that match the query.\n *\n * The `count()` method returns a Promise that resolves to the number of\n * items that match the query. The Promise is rejected if `count()` is called\n * with incorrect permissions or if any of the methods used to refine the\n * query is invalid.\n *\n * Calling the `count()` method triggers the [`beforeCount()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-count) and [`afterCount()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-count) hooks if they have been defined.\n *\n * Use the `options` parameter to run `count()` without checking for permissions\n * or without its registered hooks.\n *\n * Any method that does not filter query results (e.g., [`ascending()`](#ascending))\n * does not affect the result of `count()`.\n *\n * If you build a query and don't refine it with any `WixDataQuery` methods,\n * `count()` returns the total number of items in the collection.\n *\n * > **Note**: You can also retrieve the number of query results by calling `find()` and setting the `options.returnTotalCount` property to `true`.\n *\n * @public\n * @documentationMaturity preview\n * @param options - Options to use when processing this operation.\n * @returns Number of items that match the query.\n */\n count(options?: WixDataReadOptions): Promise<number>\n\n /**\n * Returns the distinct values that match the query, without duplicates.\n *\n * The `distinct()` method returns a Promise that resolves to:\n * - The distinct values found in the specified field when running the query.\n * - Additional information about the results, such as the number of values that match the query.\n *\n * Unlike `find()`, which returns all item objects that match the query, `distinct()` returns matching field values,\n * and eliminates duplicate field values from the query result. You cannot use `find()` and `distinct()` together.\n *\n * For an item to be resolved as distinct, only the specified field must be distinct. Other fields for that item in\n * the collection are not evaluated when resolving the promise.\n *\n * The Promise is rejected if `distinct()` is called with incorrect permissions or if any of the\n * methods used to refine the query is invalid.\n *\n * >**Note:** Only site visitors with [Data Read](https://support.wix.com/en/article/collection-permissions-an-overview#permissions) permissions can retrieve and view data. You can override the permissions by calling this method with [elevated permissions](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-elevated-permissions).\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is compared for distinct values.\n * @requiredField field\n * @param options - Configuration options for building the query.\n * @returns Promise that resolves to the results of the query.\n */\n distinct(\n field: string,\n options?: WixDataQueryOptions\n ): Promise<WixDataResult<any>>\n\n /**\n * Returns the items that match the query.\n *\n * The `find()` method returns a Promise that resolves to the results found\n * by the query and some information about the results. The Promise is\n * rejected if `find()` is called with incorrect permissions or if any of the\n * methods used to refine the query is invalid.\n *\n * Calling the `find()` method triggers the [`beforeQuery()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/before-query) and [`afterQuery()`](https://dev.wix.com/docs/velo/api-reference/wix-data/hooks/after-query) hooks if they have been defined.\n *\n * > **Note:**\n * > Calling `find()` triggers hooks for the specified collection only. It doesn't trigger hooks for referenced collections.\n *\n * Use the `options` parameter to override default preferences:\n * - Ensure the most up-to-date data is retrieved with `consistentRead`.\n * - Prevent hooks from running with `suppressHooks`.\n * - Get a count of all the items that match the query by setting `returnTotalCount` to `true`.\n *\n * If you build a query and don't refine it with any `wixDataQuery` methods,\n * `find()` returns the entire collection.\n * @public\n * @documentationMaturity preview\n * @param options - Configuration options for building the query.\n * @returns Promise that resolves to the results of the query.\n */\n find(options?: WixDataQueryOptions): Promise<WixDataResult>\n\n /**\n * Lists the fields to return in a query's results.\n *\n * The `fields()` method returns only the specified fields in the query's results.\n *\n * You can use `include()` in conjunction with `fields()` to get referenced items.\n *\n * When `fields()` receives an empty or invalid property, the query behaves as follows:\n * - When no fields are specified, the query returns all fields.\n * - When multiple fields are specified but some are invalid, invalid fields are ignored and valid fields are returned.\n * - When only invalid fields are specified, only the default `_id` field is returned.\n * @public\n * @documentationMaturity preview\n * @param fields - Properties to return.\n * @requiredField fields\n * @returns A `WixDataQuery` object representing the query.\n */\n fields(...fields: string[]): WixDataQuery\n\n /**\n * Limits the number of items the query returns.\n *\n * The `limit()` method defines the number of results a query returns in each\n * page. Only one page of results is retrieved at a time. The `next()`\n * and `prev()` methods are used to\n * 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 that for some [Wix app collections](https://dev.wix.com/docs/develop-websites/articles/databases/wix-data/collections/working-with-wix-app-collections-and-code), the maximum value `limit()` can accept is\n * less than `1000`. For example, the maximum limit for the Wix `Stores/Product` collection is 100.\n * @public\n * @documentationMaturity preview\n * @param limitNumber - Number of items to return, which is also the `pageSize` of the results object.\n * @requiredField limitNumber\n * @returns `WixDataQuery` object representing the refined query.\n */\n limit(limitNumber: number): WixDataQuery\n\n /**\n * Sets the number of items to skip before returning query results.\n *\n * The `skip()` method defines the number of results to skip in the query\n * results before returning new query results.\n *\n * For example, if you query a collection and 50 items match your query, but\n * you set `skip` to 10, the results returned will skip the first 10 items\n * that match and return the 11th through 50th items.\n *\n * By default, `skip` is set to 0.\n * @public\n * @documentationMaturity preview\n * @param skipCount - Number of items to skip in the query results before returning the results.\n * @requiredField skipCount\n * @returns `WixDataQuery` object representing the refined query.\n */\n skip(skipCount: number): WixDataQuery\n\n /**\n * Includes referenced items for the specified properties in a query's results.\n *\n * The `include()` method refines a query so that the items returned in the\n * query's results include the full referenced items for the specified properties.\n *\n * For example, suppose you have a **books** collection with an **author**\n * field that references an **authors** collection. Querying the **books**\n * collection with an `include(\"author\")` returns the relevant book items\n * and each item will include the full referenced author item in the book's\n * `author` property.\n *\n * When querying a collection that contains a reference field without using the\n * `include()` method:\n * - Single reference field: returned items contain only the ID of the\n * referenced item, and not the full referenced items.\n * - Multiple reference field: returned items do not contain the multiple\n * reference field at all.\n *\n * When including a property with multiple references, the following limitations\n * apply:\n * - Only one property with multiple references can be included.\n * - The query will return an error if more than 50 items are returned, regardless\n * of any query limit set using the `limit()` method.\n * - Each returned item can include up to 50 referenced items. If there are more\n * than 50 referenced items, only 50 are returned when the query is run\n * and the `partialIncludes`\n * property of the returned `WixDataQueryResult`\n * is `true`. To retrieve more than 50 referenced items, use the\n * `queryReferenced()` method.\n *\n * For a discussion of when to use the similar `queryReferenced()`\n * method and when to use `include()`, see [Querying Items that Reference Other Items](https://support.wix.com/en/article/including-referenced-data-when-filtering).\n *\n * > **Note:** The `include()` method is not supported for [single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection).\n *\n * @public\n * @documentationMaturity preview\n * @param fields - Fields for which to include referenced items.\n * @requiredField fields\n * @returns A `WixDataQuery` object representing the query.\n */\n include(...fields: string[]): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(field: string, limit?: number): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(field1: string, field2: string, limit?: number): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(\n field1: string,\n field2: string,\n field3: string,\n field4: string,\n field5: string,\n limit?: number\n ): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(...fieldNamesAndLimit: [...string[], number]): WixDataQuery\n\n /**\n * Overload for `include()`\n * @public\n * @documentationMaturity preview\n */\n include(...args: unknown[]): WixDataQuery\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/WixDataResult.ts"],"sourcesContent":["import { WixDataItem } from './types'\n\n/**\n * @builder\n */\nexport interface WixDataResult<Item = WixDataItem> {\n // query is not implemented\n\n /**\n * Returns the items that match the query.\n *\n * The current page of items retrieved by the query.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * When no items match the query, the `items` array is empty.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly items: Item[]\n\n /**\n * Returns the total number of items that match the query.\n *\n * The `totalCount` returns the total number of items that match the query,\n * not just the number of items in the current page.\n *\n * > **Note:** This property is only available when the query's `options.returnTotalCount` parameter is set to `true`.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly totalCount: number | undefined\n\n /**\n * Returns the query page size.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly pageSize: number | undefined\n\n /**\n * Returns the index of the current results page number.\n *\n * The `currentPage` is a zero-based index of the current page of results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * The `currentPage` property returns `undefined` if the query returned no results.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly currentPage: number | undefined\n\n /**\n * Returns the number of items in the current results page.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly length: number\n\n /**\n * Returns the total number of pages the query produced.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * > **Note:** This property is only available when the query's `options.returnTotalCount` parameter is set to `true`.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly totalPages: number | undefined\n\n /**\n * Retrieves the next page of query results.\n *\n * The `next()` method retrieves the next page of query results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * If items are added or removed between calls to `next()` the values returned may change.\n *\n * >**Note:** The `next()` method is not supported for Single Item Collections.\n *\n * @public\n * @documentationMaturity preview\n * @returns A query result object with the next page of query results.\n */\n next(): Promise<WixDataResult<Item>>\n\n /**\n * Retrieves the previous page of query results.\n *\n * The `prev()` method retrieves the previous page of query results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * If items are added or removed between calls to `prev()` the values returned\n * may change.\n *\n * >**Note:** The `prev()` method is not supported for Single Item Collections.\n *\n * @public\n * @documentationMaturity preview\n * @returns A query result object with the previous page of query results.\n */\n prev(): Promise<WixDataResult<Item>>\n\n /**\n * Indicates if the query has more results.\n *\n * @public\n * @documentationMaturity preview\n * @returns `true` if there are more results.\n */\n hasNext(): boolean\n\n /**\n * Indicates the query has previous results.\n *\n * @public\n * @documentationMaturity preview\n * @returns `true` if there are previous results.\n */\n hasPrev(): boolean\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["../../../src/api/WixDataResult.ts"],"sourcesContent":["import { WixDataItem } from './types'\n\n/**\n * @builder\n */\nexport interface WixDataResult<Item = WixDataItem> {\n // query is not implemented\n\n /**\n * Returns the items that match the query.\n *\n * The current page of items retrieved by the query.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * When no items match the query, the `items` array is empty.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly items: Item[]\n\n /**\n * Returns the total number of items that match the query.\n *\n * The `totalCount` returns the total number of items that match the query,\n * not just the number of items in the current page.\n *\n * > **Note:** This property is only available when the query's `options.returnTotalCount` parameter is set to `true`.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly totalCount: number | undefined\n\n /**\n * Returns the query page size.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly pageSize: number | undefined\n\n /**\n * Returns the index of the current results page number.\n *\n * The `currentPage` is a zero-based index of the current page of results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * The `currentPage` property returns `undefined` if the query returned no results.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly currentPage: number | undefined\n\n /**\n * Returns the number of items in the current results page.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly length: number\n\n /**\n * Returns the total number of pages the query produced.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * > **Note:** This property is only available when the query's `options.returnTotalCount` parameter is set to `true`.\n * @public\n * @documentationMaturity preview\n * @readonly\n */\n readonly totalPages: number | undefined\n\n /**\n * Retrieves the next page of query results.\n *\n * The `next()` method retrieves the next page of query results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * If items are added or removed between calls to `next()` the values returned may change.\n *\n * >**Note:** The `next()` method is not supported for [single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection).\n *\n * @public\n * @documentationMaturity preview\n * @returns A query result object with the next page of query results.\n */\n next(): Promise<WixDataResult<Item>>\n\n /**\n * Retrieves the previous page of query results.\n *\n * The `prev()` method retrieves the previous page of query results.\n *\n * The page size is defined by the `limit()`\n * method, can be retrieved using the `pageSize` property, and\n * navigating through pages is done with the `prev()` and\n * `next()` methods.\n *\n * If items are added or removed between calls to `prev()` the values returned\n * may change.\n *\n * >**Note:** The `prev()` method is not supported for [single-item collections](https://support.wix.com/en/article/cms-adding-and-setting-up-a-single-item-collection).\n *\n * @public\n * @documentationMaturity preview\n * @returns A query result object with the previous page of query results.\n */\n prev(): Promise<WixDataResult<Item>>\n\n /**\n * Indicates if the query has more results.\n *\n * @public\n * @documentationMaturity preview\n * @returns `true` if there are more results.\n */\n hasNext(): boolean\n\n /**\n * Indicates the query has previous results.\n *\n * @public\n * @documentationMaturity preview\n * @returns `true` if there are previous results.\n */\n hasPrev(): boolean\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["export interface WixDataOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the backend code of a Wix site.\n */\n suppressHooks?: boolean\n\n /**\n * If `true`, operations work on draft items too.\n * Read operations includes draft items in response.\n * Write operations modifies draft items.\n */\n showDrafts?: boolean\n\n /**\n * Optional instructions for accessing Wix App Collections.\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataReadOptions extends WixDataOptions {\n /**\n * Language to translate result text into, in\n * [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language.\n *\n * **Note:** Translation for the specified language must be enabled for the collection in\n * [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n * If not provided, result text is not translated.\n */\n language?: string\n\n /**\n * When true, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and Eventual Consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions {}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query result include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `'asc'`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n skip?: number\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * The description of the error.\n */\n message: string\n\n /**\n * The error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * The failed item (or ID in case of `bulkRemove`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * The number of inserted items.\n */\n inserted: number\n\n /**\n * The number of updated items.\n */\n updated: number\n\n /**\n * The number of removed items.\n */\n removed: number\n\n /**\n * The number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["export interface WixDataOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the backend code of a Wix site.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n */\n showDrafts?: boolean\n\n /**\n * Optional instructions for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataReadOptions extends WixDataOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When true, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and Eventual Consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions {}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items will be included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query result include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `asc`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n skip?: number\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":""}