import { RequestOptionsFactory } from '@wix/sdk-types'; import { AggregateDataItemsRequest, AggregateDataItemsResponse, BulkInsertDataItemReferencesRequest, BulkInsertDataItemReferencesResponse, BulkInsertDataItemsRequest, BulkInsertDataItemsResponse, BulkRemoveDataItemReferencesRequest, BulkRemoveDataItemReferencesResponse, BulkRemoveDataItemsRequest, BulkRemoveDataItemsResponse, BulkSaveDataItemsRequest, BulkSaveDataItemsResponse, BulkUpdateDataItemsRequest, BulkUpdateDataItemsResponse, CountDataItemsRequest, CountDataItemsResponse, GetDataItemRequest, GetDataItemResponse, InsertDataItemReferenceRequest, InsertDataItemReferenceResponse, InsertDataItemRequest, InsertDataItemResponse, IsReferencedDataItemRequest, IsReferencedDataItemResponse, QueryDataItemsRequest, QueryDataItemsResponse, QueryDistinctValuesRequest, QueryDistinctValuesResponse, QueryReferencedDataItemsRequest, QueryReferencedDataItemsResponse, RemoveDataItemReferenceRequest, RemoveDataItemReferenceResponse, RemoveDataItemRequest, RemoveDataItemResponse, ReplaceDataItemReferencesRequest, ReplaceDataItemReferencesResponse, SaveDataItemRequest, SaveDataItemResponse, TruncateDataItemsRequest, TruncateDataItemsResponse, UpdateDataItemRequest, UpdateDataItemResponse } from './data-v2-data-item.types'; /** * Adds an item to a collection. * * * An item can only be inserted into an existing connection. * You can create a new collection using the [Data Collections API](https://dev.wix.com/api/rest/wix-data/wix-data/data-collections). * * When an item is inserted into a collection, the item's ID is automatically assigned a random value. * You can optionally provide a custom ID in `dataItem.id` when inserting the item. * If you specify an ID that already exists in the collection, the insertion will fail. * * If `dataItem.data` is empty, a new item is created with no data fields. */ export declare function insertDataItem(payload: InsertDataItemRequest): RequestOptionsFactory; /** * Updates an item in a collection. * * * This endpoint replaces the data item's existing data with the payload provided in `dataItem.data` in the request. * * To update an item, you need to specify an item ID and a collection ID. * If an item is found in the specified collection with the specified ID, that item is updated. * If the collection doesn't contain an item with that ID, the request fails. * * When an item is updated, its `data._updatedDate` field is changed to the current date and time. * * > **Note:** * > After an item is updated, it only contains the fields included in the `dataItem.data` payload in Update Data Item request. * > If the existing item has fields with values and those fields aren't included in the updated item, their values are lost. */ export declare function updateDataItem(payload: UpdateDataItemRequest): RequestOptionsFactory; /** * Inserts or updates an item in a collection. * * * The Save Data Item endpoint inserts or updates the specified item, depending on whether it already exists in the collection. * * + If you don't provide an ID, a new item is created. * * + If you provide an ID that does not exist in the collection, a new item is created with that ID. * * + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time. * * > **Note:** When you provide an item with an ID that already exists in the collection, the payload you provide in `dataItem.data` replaces the existing item with that ID. * > This means that the item's previous fields and values are lost. */ export declare function saveDataItem(payload: SaveDataItemRequest): RequestOptionsFactory; /** Retrieves an item from a collection. */ export declare function getDataItem(payload: GetDataItemRequest): RequestOptionsFactory; /** * Removes an item from a collection. * * * If any items in other collections reference the removed item in reference or multi-reference fields, those fields are cleared. * * > **Note:** * > Once an item has been removed from a collection, it can't be restored. */ export declare function removeDataItem(payload: RemoveDataItemRequest): RequestOptionsFactory; /** * Removes all items from a collection. * * * If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared. * * > **Note:** * > Once items have been removed from a collection, they can't be restored. */ export declare function truncateDataItems(payload: TruncateDataItemsRequest): RequestOptionsFactory; /** * Retrieves a list of items, on the basis of the filtering, sorting, and paging preferences you provide. * * * For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */ export declare function queryDataItems(payload: QueryDataItemsRequest): RequestOptionsFactory; /** * Runs an aggregation on a data collection and returns the resulting list of items. * * * An aggregation enables you to perform certain calculations on your collection data, or on groups of items that you define, to retrieve meaningful summaries. * You can also add paging, filtering, and sorting preferences to your aggregation to retrieve exactly what you need. */ export declare function aggregateDataItems(payload: AggregateDataItemsRequest): RequestOptionsFactory; /** Counts the number of items in a data collection that match the provided filtering preferences. */ export declare function countDataItems(payload: CountDataItemsRequest): RequestOptionsFactory; /** * Retrieves a list of distinct values for a given field in all items that match a query, without duplicates. * * * As with the [Query Data Items](https://dev.wix.com/api/rest/wix-data/wix-data/data-items/query-data-items) endpoint, this endpoint retrieves items based on the filtering, sorting, and paging preferences you provide. * However, the Query Distinct Values endpoint doesn't return all of the full items that match the query. * Rather, it returns all unique values of the field you specify in `fieldName` for items that match the query. * If more than one item has the same value for that field, that value appears only once. * * For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */ export declare function queryDistinctValues(payload: QueryDistinctValuesRequest): RequestOptionsFactory; /** * Adds multiple items to a collection. * * * When each item is inserted into a collection, its ID is automatically assigned to random value. * You can optionally provide your own ID when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail. */ export declare function bulkInsertDataItems(payload: BulkInsertDataItemsRequest): RequestOptionsFactory; /** * Updates multiple items in a collection. * * * This endpoint replaces each specified data item's existing data with the payload provided in the request. * * Each item in the request must include an ID. If an item is found in the specified collection with * the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails. * * When an item is updated, its `data._updatedDate` field is changed to the current date and time. * * > **Note:** * > After each item is updated, it only contains the fields included in the request. If the existing item has fields with values and those fields * > aren't included in the updated item, their values are lost. */ export declare function bulkUpdateDataItems(payload: BulkUpdateDataItemsRequest): RequestOptionsFactory; /** * Inserts or updates multiple items in a collection. * * * The Bulk Save Data Items endpoint inserts or updates each item provided, depending on whether it already exists in the collection. For each item: * * + If you don't provide an ID, a new item is created. * * + If you provide an ID that doesn't exist in the collection, a new item is created with that ID. * * + If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its `data._updatedDate` field is changed to the current date and time. * * > **Note:** When you provide an item with an ID that already exists in the collection, the item you provide completely replaces the existing item with that ID. * > This means that all of the item's previous fields and values are lost. */ export declare function bulkSaveDataItems(payload: BulkSaveDataItemsRequest): RequestOptionsFactory; /** * Removes multiple items from a collection. * * * If any items in other collections reference the removed items in reference or multi-reference fields, those fields are cleared. * * > **Note:** Once an item has been removed from a collection, it can't be restored. */ export declare function bulkRemoveDataItems(payload: BulkRemoveDataItemsRequest): RequestOptionsFactory; /** * Retrieves the full items referenced in the specified field of an item. * * * Reference and multi-reference fields refer to items in different collections. * Use this endpoint to retrieve the full details of the referenced items themselves. * * For example, suppose you have a **Movies** collection with an **Actors** field that contains references to items in a **People** collection. * Querying the **Movies** collection using the Query Referenced Data Items endpoint returns the relevant **People** items referenced in the **Actors** field of the specified **Movie** item. * This gives you information from the **People** collection about each of the actors in the specified movie. */ export declare function queryReferencedDataItems(payload: QueryReferencedDataItemsRequest): RequestOptionsFactory; /** Checks whether a field in a referring item contains a reference to a specified item. */ export declare function isReferencedDataItem(payload: IsReferencedDataItemRequest): RequestOptionsFactory; /** * Inserts a reference in the specified field in an item in a collection. * * * A reference in the `dataItemReference` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item. */ export declare function insertDataItemReference(payload: InsertDataItemReferenceRequest): RequestOptionsFactory; /** Removes the specified reference from the specified field. */ export declare function removeDataItemReference(payload: RemoveDataItemReferenceRequest): RequestOptionsFactory; /** * Inserts one or more references in the specified fields of items in a collection. * * * This endpoint adds one or more references to a collection. * Each new reference in the `dataItemReferences` field specifies a referring item's ID, the field in which to insert the reference, and the ID of the referenced item. */ export declare function bulkInsertDataItemReferences(payload: BulkInsertDataItemReferencesRequest): RequestOptionsFactory; /** Removes one or more references. */ export declare function bulkRemoveDataItemReferences(payload: BulkRemoveDataItemReferencesRequest): RequestOptionsFactory; /** * Replaces references in a specified field of a specified data item. * * * This endpoint replaces the existing reference or references contained in the field specified in `referringItemFieldName` within the data item specified in `referringItemId`. * The endpoint removes existing references and in their place it adds references to the items specified in `newReferencedItemIds`. * * > **Note:** If you pass an empty array in `newReferencedItemIds`, all existing references are removed. */ export declare function replaceDataItemReferences(payload: ReplaceDataItemReferencesRequest): RequestOptionsFactory;