@wix/wix-data-items-common 1.0.268 → 1.0.269

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/types.ts"],"sourcesContent":["import { WixDataFilter } from './WixDataFilter'\n\nexport interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataRemoveOptions extends WixDataOptions {\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkPatchOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be patched.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and eventual consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions {}\n\nexport interface WixDataSaveOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataInsertOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkUpdateOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be updated.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkRemoveOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be removed.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataPatchOptions extends BaseOptions {\n /**\n * If provided, item will be patched only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataAggregateOptions extends WixDataQueryOptions {}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query results include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\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 * @readonly\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n * @readonly\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["../../../src/api/types.ts"],"sourcesContent":["import { WixDataFilter } from './WixDataFilter'\n\nexport interface BaseOptions {\n /**\n * Prevents hooks from running for the operation. Can only be used in the [backend code of a Wix site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/backend-code/about-the-site-backend).\n *\n * Default: `false`.\n */\n suppressHooks?: boolean\n\n /**\n * When `true`, operations include draft items. Read operations include draft items in their response, and write operations modify draft items.\n *\n * Default: `false`.\n */\n showDrafts?: boolean\n}\n\nexport interface WithAppOptions {\n /**\n * Options for [querying Wix app collections](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-app-collections/querying-wix-app-collections).\n */\n appOptions?: Record<string, any>\n}\n\nexport interface WixDataRemoveOptions extends WixDataOptions {\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkPatchOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be patched.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataOptions extends BaseOptions, WithAppOptions {}\n\nexport interface WixDataReadOptions extends WixDataOptions, WithAppOptions {\n /**\n * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format.\n * If provided, the result text is returned in the specified language. If not provided, the result text is not translated.\n *\n * > **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual).\n *\n */\n language?: string\n\n /**\n * When `true`, reads data from the primary database instance. This decreases performance but ensures data retrieved is\n * up-to-date even immediately after an update. Learn more about [Wix Data and eventual consistency](https://dev.wix.com/docs/sdk/backend-modules/data/eventual-consistency).\n */\n consistentRead?: boolean\n}\n\nexport interface WixDataReadWithProjectionOptions\n extends WixDataReadOptions,\n ProjectionOptions {}\n\nexport interface WixDataSaveOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataInsertOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n}\n\nexport interface WixDataUpdateOptions extends WixDataOptions {\n /**\n * If true, referenced items are included.\n * @internal\n */\n includeReferences?: boolean\n /**\n * If provided, item will be updated only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkUpdateOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be updated.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataBulkRemoveOptions extends WixDataOptions {\n /**\n * If provided, only items matching condition will be removed.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataPatchOptions extends BaseOptions {\n /**\n * If provided, item will be patched only if condition is met.\n */\n condition?: WixDataFilter\n}\n\nexport interface WixDataAggregateOptions extends WixDataQueryOptions {}\n\nexport interface WixDataQueryOptions extends WixDataReadOptions {\n /**\n * When `true`, the query results include a `totalCount` and `totalPages` properties containing the totals of items\n * matching query. Requesting total count slows down the query.\n *\n * Default: `false`\n */\n returnTotalCount?: boolean\n}\n\nexport interface WixDataQueryReferencedOptions\n extends WixDataQueryOptions,\n ProjectionOptions {\n /**\n * Order of the returned referenced items. Sorted by the date each item was referenced.\n *\n * Default: `asc`\n */\n order?: 'asc' | 'desc'\n\n /**\n * Number of items to skip in the current sort order.\n *\n * Default: `0`\n */\n skip?: number\n\n /**\n * Number of items to load.\n *\n * Default: `50`\n */\n limit?: number\n}\n\ninterface ProjectionOptions {\n /**\n * Lists of fields to return in a result.\n */\n fields?: string[]\n}\n\nexport interface WixDataItem {\n /**\n * Data item ID.\n */\n _id: string\n\n /**\n * Date and time the item was added to the collection.\n * @readonly\n */\n _createdDate?: Date\n\n /**\n * Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have\n * the same value.\n * @readonly\n */\n _updatedDate?: Date\n\n /**\n * ID of the user who created the item. Can be modified with site owner permissions.\n */\n _owner?: string\n\n /**\n * Data item contents.\n */\n [key: string]: any\n}\n\nexport type WixDataItemOrId = WixDataItem | string\nexport type Comparable = string | number | Date\n\nexport interface WixDataReference {\n relationshipName: string\n left: WixDataItemOrId\n right: WixDataItemOrId\n}\n\nexport interface Provider<T> {\n get(): T | Promise<T>\n}\n\nexport interface WixDataBulkError extends Error {\n /**\n * Description of the error.\n */\n message: string\n\n /**\n * Error code.\n */\n code: string\n\n /**\n * Index of the item within the request array. Allows for correlation between request and response items.\n */\n originalIndex: number\n\n /**\n * Failed item (or ID in case of `bulkRemove()`).\n */\n item: WixDataItem | string\n}\n\nexport interface WixDataBulkResult {\n /**\n * Number of inserted items.\n */\n inserted: number\n\n /**\n * Number of updated items.\n */\n updated: number\n\n /**\n * Number of removed items.\n */\n removed: number\n\n /**\n * Number of skipped items.\n */\n skipped: number\n\n /**\n * List of errors.\n */\n errors: WixDataBulkError[]\n\n /**\n * List of IDs of inserted items.\n */\n insertedItemIds: string[]\n\n /**\n * List of IDs of updated items.\n */\n updatedItemIds: string[]\n\n /**\n * List of IDs of removed items.\n */\n removedItemIds: string[]\n}\n"],"mappings":"","ignoreList":[]}
@@ -112,15 +112,15 @@ export interface WixDataQueryReferencedOptions extends WixDataQueryOptions, Proj
112
112
  */
113
113
  order?: 'asc' | 'desc';
114
114
  /**
115
- * Number of items to load.
115
+ * Number of items to skip in the current sort order.
116
116
  *
117
- * Default: `50`
117
+ * Default: `0`
118
118
  */
119
119
  skip?: number;
120
120
  /**
121
- * Number of items to skip in the current sort order.
121
+ * Number of items to load.
122
122
  *
123
- * Default: `0`
123
+ * Default: `50`
124
124
  */
125
125
  limit?: number;
126
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/wix-data-items-common",
3
- "version": "1.0.268",
3
+ "version": "1.0.269",
4
4
  "license": "UNLICENSED",
5
5
  "author": {
6
6
  "name": "Rimvydas Gimbutas",
@@ -85,5 +85,5 @@
85
85
  "wallaby": {
86
86
  "autoDetect": true
87
87
  },
88
- "falconPackageHash": "663b4ef955124af016dce4522e26305e7e5aa6603971b35c9eb94399"
88
+ "falconPackageHash": "00bc3b2754b18593d72062519aa457e1cde96b21d920a7c644788ca6"
89
89
  }