import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** A storage item is a global data container that you can use across multiple automations to store different types of data in key-value pairs. This include data such as Wix user preferences, counters, and configuration settings. */ interface StorageItem extends StorageItemValueOneOf { /** When the item type is `STRING`, the string value. */ stringValue?: StringValue; /** When the item type is `BOOLEAN`, the boolean value. */ booleanValue?: BooleanValue; /** When the item type is `NUMBER`, the numeric value. */ numberValue?: NumberValue; /** * When the item type is `COUNTER`, the counter value. * * > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates). */ counterValue?: CounterValue; /** * Storage item ID. * @format GUID * @readonly * @immutable */ _id?: string | null; /** * Unique storage item key. The key can only contain letters, numbers, and underscores. * * Once you create the item, you can't update its key. * @minLength 1 * @maxLength 63 * @immutable */ key?: string; /** * Storage item display name. The display name appears when you [add or edit steps to your automation](https://support.wix.com/en/article/wix-automations-creating-an-automation-with-the-new-builder#step-3-add-steps-to-you-automation). * @minLength 1 * @maxLength 63 */ displayName?: string; /** * Storage item description. * @maxLength 200 */ description?: string | null; /** * Data type of the storage item's value. Once created, you can't change the value's type. * @immutable */ type?: TypeWithLiterals; /** * When the storage item was created. * @readonly */ _createdDate?: Date | null; /** * When the storage item was last updated. * @readonly */ _updatedDate?: Date | null; /** * [Tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction) assigned to the storage item. * * You can use public and private tags for categorization and filtering. */ tags?: Tags; /** Extended fields. */ extendedFields?: ExtendedFields; } /** @oneof */ interface StorageItemValueOneOf { /** When the item type is `STRING`, the string value. */ stringValue?: StringValue; /** When the item type is `BOOLEAN`, the boolean value. */ booleanValue?: BooleanValue; /** When the item type is `NUMBER`, the numeric value. */ numberValue?: NumberValue; /** * When the item type is `COUNTER`, the counter value. * * > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates). */ counterValue?: CounterValue; } declare enum Format { /** Plain text. */ PLAIN_TEXT = "PLAIN_TEXT", /** [Universal Resource Identifier (URI)](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier). */ URI = "URI", /** Email. */ EMAIL = "EMAIL", /** Datetime string in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). */ DATETIME = "DATETIME" } /** @enumType */ type FormatWithLiterals = Format | 'PLAIN_TEXT' | 'URI' | 'EMAIL' | 'DATETIME'; interface StringValue { /** * String value. * @maxLength 4096 */ value?: string; /** String format. */ format?: FormatWithLiterals; } interface BooleanValue { /** Boolean value. */ value?: boolean; } interface NumberValue { /** * Numeric decimal value, represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:16 } */ value?: string; } interface CounterValue { /** * Counter decimal value, represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:16 } */ value?: string; } declare enum Type { /** String. */ STRING = "STRING", /** Boolean. */ BOOLEAN = "BOOLEAN", /** Number. */ NUMBER = "NUMBER", /** * Counter. * * > **Note**: Counters are numeric values used for running totals. They support [atomic increment and decrement operations](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates). */ COUNTER = "COUNTER" } /** @enumType */ type TypeWithLiterals = Type | 'STRING' | 'BOOLEAN' | 'NUMBER' | 'COUNTER'; /** * Common object for tags. * Should be use as in this example: * message Foo { * option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo"; * string id = 1; * ... * Tags tags = 5 * } * * example of taggable entity * { * id: "123" * tags: { * public_tags: { * tag_ids:["11","22"] * }, * private_tags: { * tag_ids: ["33", "44"] * } * } * } */ interface Tags { /** * List of private tags. * * Private tags require additional permissions to access. They are usually hidden from site members and visitors. */ privateTags?: TagList; /** * List of public tags. * * Public tags are visible to anyone with access to the main storage item, including site members and visitors. */ publicTags?: TagList; } interface TagList { /** * List of tag IDs. * @maxSize 100 * @maxLength 5 */ tagIds?: string[]; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface StorageItemValueUpdated { /** Updated storage item. */ updatedStorageItem?: StorageItem; } interface StorageItemCounterUpdated { /** Storage item with the updated counter. */ updatedStorageItem?: StorageItem; } interface TagsModified { /** Storage item whose tags were modified. */ storageItem?: StorageItem; /** Tags assigned. */ assignedTags?: Tags; /** Tags removed. */ unassignedTags?: Tags; } interface CreateStorageItemRequest { /** Storage item to create. */ storageItem: StorageItem; } interface CreateStorageItemResponse { /** Created storage item. */ storageItem?: StorageItem; } interface GetStorageItemRequest { /** * Key of the storage item to retrieve. * @minLength 1 * @maxLength 63 */ key: string; /** * Whether to retrieve the item from the primary instance. This decreases performance but ensures the item retrieved is up to date even immediately after an update. * * Default: `false`. */ consistentRead?: boolean; } interface GetStorageItemResponse { /** Retrieved storage item. */ storageItem?: StorageItem; } interface UpdateStorageItemValueRequest extends UpdateStorageItemValueRequestValueOneOf { /** * String value. * @maxLength 4096 */ stringValue?: string; /** Boolean value. */ booleanValue?: boolean; /** * Number value represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 } */ numberValue?: string; /** * Key of the storage item to update. * @minLength 1 * @maxLength 63 */ key: string; } /** @oneof */ interface UpdateStorageItemValueRequestValueOneOf { /** * String value. * @maxLength 4096 */ stringValue?: string; /** Boolean value. */ booleanValue?: boolean; /** * Number value represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 } */ numberValue?: string; } interface UpdateStorageItemValueResponse { /** Updated storage item. */ storageItem?: StorageItem; } interface UpdateStorageItemCounterByRequest { /** * Key of the storage item to update. * @minLength 1 * @maxLength 63 */ key: string; /** * Value to add to the existing counter, represented as a string. To decrement the counter, use a negative value. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 } */ value: string; } interface UpdateStorageItemCounterByResponse { /** Updated storage item. */ storageItem?: StorageItem; } interface QueryStorageItemsRequest { /** * Query preferences. * * Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language). */ query?: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; /** * Filter object. * * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). */ filter?: Record | null; /** * Sort object. * * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). * @maxSize 5 */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryStorageItemsResponse { /** List of storage items that match the query criteria. */ storageItems?: StorageItem[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface BulkUpdateStorageItemTagsRequest { /** * IDs of storage items to update. * @minSize 1 * @maxSize 100 * @format GUID */ storageItemIds: string[]; /** Tags to assign to the specified storage items. */ assignTags?: Tags; /** Tags to remove from the specified storage items. */ unassignTags?: Tags; } interface BulkUpdateStorageItemTagsResponse { /** * Update results. * @minSize 1 * @maxSize 100 */ results?: BulkUpdateStorageItemTagsResult[]; /** Bulk operation metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface ItemMetadata { /** * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed. * @format GUID */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface BulkUpdateStorageItemTagsResult { /** Update result metadata. */ itemMetadata?: ItemMetadata; } interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } interface BulkUpdateStorageItemTagsByFilterRequest { /** Filter criteria to select storage items for tag updates. Specifying an empty filter updates tags for all storage items. */ filter: Record | null; /** Tags to assign to the storage items. */ assignTags?: Tags; /** Tags to remove from the storage items. */ unassignTags?: Tags; } interface BulkUpdateStorageItemTagsByFilterResponse { /** * Job ID for tracking the progress of the bulk operation. * @format GUID */ jobId?: string; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** @docsIgnore */ type CreateStorageItemApplicationErrors = { code?: 'INVALID_STORAGE_ITEM_KEY_EXCEPTION'; description?: string; data?: Record; } | { code?: 'TOO_MANY_STORAGE_ITEMS'; description?: string; data?: Record; } | { code?: 'STORAGE_ITEM_VALUE_VALIDATION_EXCEPTION'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateStorageItemValueApplicationErrors = { code?: 'INVALID_STORAGE_ITEM_TYPE_EXCEPTION'; description?: string; data?: Record; } | { code?: 'VALUE_TYPE_MISMATCH_EXCEPTION'; description?: string; data?: Record; } | { code?: 'STORAGE_ITEM_VALUE_VALIDATION_EXCEPTION'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateStorageItemCounterByApplicationErrors = { code?: 'INVALID_STORAGE_ITEM_TYPE_EXCEPTION'; description?: string; data?: Record; } | { code?: 'INVALID_NUMBER_VALUE'; description?: string; data?: Record; }; /** @docsIgnore */ type BulkUpdateStorageItemTagsApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; description?: string; data?: Record; }; /** @docsIgnore */ type BulkUpdateStorageItemTagsByFilterApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; description?: string; data?: Record; }; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface StorageItemCreatedEnvelope { entity: StorageItem; metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ * @webhook * @eventType wix.automations.storage.v1.storage_item_created * @slug created * @documentationMaturity preview */ declare function onStorageItemCreated(handler: (event: StorageItemCreatedEnvelope) => void | Promise): void; interface StorageItemCounterUpdatedEnvelope { data: StorageItemCounterUpdated; metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ * @webhook * @eventType wix.automations.storage.v1.storage_item_storage_item_counter_updated * @slug storage_item_counter_updated * @documentationMaturity preview */ declare function onStorageItemCounterUpdated(handler: (event: StorageItemCounterUpdatedEnvelope) => void | Promise): void; interface StorageItemValueUpdatedEnvelope { data: StorageItemValueUpdated; metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ * @webhook * @eventType wix.automations.storage.v1.storage_item_storage_item_value_updated * @slug storage_item_value_updated * @documentationMaturity preview */ declare function onStorageItemValueUpdated(handler: (event: StorageItemValueUpdatedEnvelope) => void | Promise): void; interface StorageItemTagsModifiedEnvelope { data: TagsModified; metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ * @webhook * @eventType wix.automations.storage.v1.storage_item_tags_modified * @slug tags_modified * @documentationMaturity preview */ declare function onStorageItemTagsModified(handler: (event: StorageItemTagsModifiedEnvelope) => void | Promise): void; /** * Creates a storage item. * * Each storage item has a unique key and a value of a specific data type. Once created, you can't change the value type. * * > **Note**: You can currently create up to 100 storage items. * @param storageItem - Storage item to create. * @public * @documentationMaturity preview * @requiredField storageItem * @requiredField storageItem.displayName * @requiredField storageItem.key * @requiredField storageItem.type * @permissionId AUTOMATIONS.STORAGE_ITEM_CREATE * @applicableIdentity APP * @returns Created storage item. * @fqn wix.automations.storage.v1.StorageService.CreateStorageItem */ declare function createStorageItem(storageItem: NonNullablePaths): Promise & { __applicationErrorsType?: CreateStorageItemApplicationErrors; }>; /** * Retrieves the specified storage item. * @param key - Key of the storage item to retrieve. * @public * @documentationMaturity preview * @requiredField key * @permissionId AUTOMATIONS.STORAGE_ITEM_READ * @applicableIdentity APP * @returns Retrieved storage item. * @fqn wix.automations.storage.v1.StorageService.GetStorageItem */ declare function getStorageItem(key: string, options?: GetStorageItemOptions): Promise>; interface GetStorageItemOptions { /** * Whether to retrieve the item from the primary instance. This decreases performance but ensures the item retrieved is up to date even immediately after an update. * * Default: `false`. */ consistentRead?: boolean; } /** * Updates the value of an existing storage item. * * > **Note**: To update items of type `COUNTER`, call [Update Storage Item Counter By](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/update-storage-item-counter-by). * @param key - Key of the storage item to update. * @public * @documentationMaturity preview * @requiredField key * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE * @applicableIdentity APP * @fqn wix.automations.storage.v1.StorageService.UpdateStorageItemValue */ declare function updateStorageItemValue(key: string, options?: UpdateStorageItemValueOptions): Promise & { __applicationErrorsType?: UpdateStorageItemValueApplicationErrors; }>; interface UpdateStorageItemValueOptions extends UpdateStorageItemValueOptionsValueOneOf { /** * String value. * @maxLength 4096 */ stringValue?: string; /** Boolean value. */ booleanValue?: boolean; /** * Number value represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 } */ numberValue?: string; } /** @oneof */ interface UpdateStorageItemValueOptionsValueOneOf { /** * String value. * @maxLength 4096 */ stringValue?: string; /** Boolean value. */ booleanValue?: boolean; /** * Number value represented as a string. * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 } */ numberValue?: string; } /** * Atomically increments or decrements a storage item of type `COUNTER` by the specified value. * * Learn more about [atomic updates](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates). * * > **Note**: To update other types of items, call [Update Storage Item Value](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/update-storage-item-value). * @param key - Key of the storage item to update. * @param value - Value to add to the existing counter, represented as a string. To decrement the counter, use a negative value. * @public * @documentationMaturity preview * @requiredField key * @requiredField value * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE * @applicableIdentity APP * @fqn wix.automations.storage.v1.StorageService.UpdateStorageItemCounterBy */ declare function updateStorageItemCounterBy(key: string, value: string): Promise & { __applicationErrorsType?: UpdateStorageItemCounterByApplicationErrors; }>; /** * Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide. * * Learn more about [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language). * @public * @documentationMaturity preview * @permissionId AUTOMATIONS.STORAGE_ITEM_READ * @applicableIdentity APP * @fqn wix.automations.storage.v1.StorageService.QueryStorageItems */ declare function queryStorageItems(): StorageItemsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface StorageItemsQueryResult extends QueryCursorResult { items: StorageItem[]; query: StorageItemsQueryBuilder; next: () => Promise; prev: () => Promise; } interface StorageItemsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_id' | 'key' | 'displayName' | 'description' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_id' | 'key' | 'displayName' | 'description' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_id' | 'key' | 'displayName' | 'description' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_id' | 'key' | 'displayName' | 'description' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id' | 'key' | 'displayName' | 'description', value: string) => StorageItemsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate', value: any) => StorageItemsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate', value: boolean) => StorageItemsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate'>) => StorageItemsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_id' | 'key' | 'displayName' | 'description' | 'type' | '_createdDate' | '_updatedDate'>) => StorageItemsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => StorageItemsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => StorageItemsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * @hidden * @fqn wix.automations.storage.v1.StorageService.QueryStorageItems * @requiredField query */ declare function typedQueryStorageItems(query: StorageItemQuery): Promise>; interface StorageItemQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: [ '_createdDate', '_id', '_updatedDate', 'description', 'displayName', 'key', 'type' ]; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type StorageItemQuery = { /** Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: { /** Maximum number of items to return in the results. @max: 100 */ limit?: NonNullable['limit'] | null; /** Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. @maxLength: 16000 */ cursor?: NonNullable['cursor'] | null; }; /** Filter object. Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object. Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). @maxSize: 5 */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: _wix_sdk_types.QueryHelpers; }; /** * Updates tags for the specified storage items. * * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction). * * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned. * @param storageItemIds - IDs of storage items to update. * @public * @documentationMaturity preview * @requiredField storageItemIds * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE * @applicableIdentity APP * @fqn wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTags */ declare function bulkUpdateStorageItemTags(storageItemIds: string[], options?: BulkUpdateStorageItemTagsOptions): Promise & { __applicationErrorsType?: BulkUpdateStorageItemTagsApplicationErrors; }>; interface BulkUpdateStorageItemTagsOptions { /** Tags to assign to the specified storage items. */ assignTags?: Tags; /** Tags to remove from the specified storage items. */ unassignTags?: Tags; } /** * Updates tags for storage items that match the specified filter criteria. Specifying an empty filter updates tags for all storage items. * * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction). * * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned. * @param filter - Filter criteria to select storage items for tag updates. Specifying an empty filter updates tags for all storage items. * @public * @documentationMaturity preview * @requiredField filter * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE * @applicableIdentity APP * @fqn wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTagsByFilter */ declare function bulkUpdateStorageItemTagsByFilter(filter: Record, options?: BulkUpdateStorageItemTagsByFilterOptions): Promise & { __applicationErrorsType?: BulkUpdateStorageItemTagsByFilterApplicationErrors; }>; interface BulkUpdateStorageItemTagsByFilterOptions { /** Tags to assign to the storage items. */ assignTags?: Tags; /** Tags to remove from the storage items. */ unassignTags?: Tags; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ApplicationError, type BaseEventMetadata, type BooleanValue, type BulkActionMetadata, type BulkUpdateStorageItemTagsApplicationErrors, type BulkUpdateStorageItemTagsByFilterApplicationErrors, type BulkUpdateStorageItemTagsByFilterOptions, type BulkUpdateStorageItemTagsByFilterRequest, type BulkUpdateStorageItemTagsByFilterResponse, type BulkUpdateStorageItemTagsOptions, type BulkUpdateStorageItemTagsRequest, type BulkUpdateStorageItemTagsResponse, type BulkUpdateStorageItemTagsResult, type CommonQueryWithEntityContext, type CounterValue, type CreateStorageItemApplicationErrors, type CreateStorageItemRequest, type CreateStorageItemResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, Format, type FormatWithLiterals, type GetStorageItemOptions, type GetStorageItemRequest, type GetStorageItemResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type NumberValue, type QueryStorageItemsRequest, type QueryStorageItemsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type StorageItem, type StorageItemCounterUpdated, type StorageItemCounterUpdatedEnvelope, type StorageItemCreatedEnvelope, type StorageItemQuery, type StorageItemQuerySpec, type StorageItemTagsModifiedEnvelope, type StorageItemValueOneOf, type StorageItemValueUpdated, type StorageItemValueUpdatedEnvelope, type StorageItemsQueryBuilder, type StorageItemsQueryResult, type StringValue, type TagList, type Tags, type TagsModified, Type, type TypeWithLiterals, type UpdateStorageItemCounterByApplicationErrors, type UpdateStorageItemCounterByRequest, type UpdateStorageItemCounterByResponse, type UpdateStorageItemValueApplicationErrors, type UpdateStorageItemValueOptions, type UpdateStorageItemValueOptionsValueOneOf, type UpdateStorageItemValueRequest, type UpdateStorageItemValueRequestValueOneOf, type UpdateStorageItemValueResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkUpdateStorageItemTags, bulkUpdateStorageItemTagsByFilter, createStorageItem, getStorageItem, onStorageItemCounterUpdated, onStorageItemCreated, onStorageItemTagsModified, onStorageItemValueUpdated, queryStorageItems, typedQueryStorageItems, updateStorageItemCounterBy, updateStorageItemValue, utils };