{"version":3,"sources":["../../src/automations-storage-v1-storage-item-storage-item.public.ts","../../src/automations-storage-v1-storage-item-storage-item.universal.ts","../../src/automations-storage-v1-storage-item-storage-item.http.ts","../../src/automations-storage-v1-storage-item-storage-item.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  BulkUpdateStorageItemTagsApplicationErrors,\n  BulkUpdateStorageItemTagsByFilterApplicationErrors,\n  BulkUpdateStorageItemTagsByFilterOptions,\n  BulkUpdateStorageItemTagsByFilterResponse,\n  BulkUpdateStorageItemTagsOptions,\n  BulkUpdateStorageItemTagsResponse,\n  CreateStorageItemApplicationErrors,\n  GetStorageItemOptions,\n  QueryStorageItemsResponse,\n  StorageItem,\n  StorageItemCounterUpdatedEnvelope,\n  StorageItemCreatedEnvelope,\n  StorageItemQuery,\n  StorageItemTagsModifiedEnvelope,\n  StorageItemValueUpdatedEnvelope,\n  StorageItemsQueryBuilder,\n  UpdateStorageItemCounterByApplicationErrors,\n  UpdateStorageItemCounterByResponse,\n  UpdateStorageItemValueApplicationErrors,\n  UpdateStorageItemValueOptions,\n  UpdateStorageItemValueResponse,\n  bulkUpdateStorageItemTags as universalBulkUpdateStorageItemTags,\n  bulkUpdateStorageItemTagsByFilter as universalBulkUpdateStorageItemTagsByFilter,\n  createStorageItem as universalCreateStorageItem,\n  getStorageItem as universalGetStorageItem,\n  queryStorageItems as universalQueryStorageItems,\n  typedQueryStorageItems as universalTypedQueryStorageItems,\n  updateStorageItemCounterBy as universalUpdateStorageItemCounterBy,\n  updateStorageItemValue as universalUpdateStorageItemValue,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\n\nconst TRANSFORM_PATHS_0 = [\n  { path: 'entity.createdDate' },\n  { path: 'entity.updatedDate' },\n  { path: 'metadata.eventTime' },\n];\nconst TRANSFORM_PATHS_1 = [\n  { path: 'data.updatedStorageItem.createdDate' },\n  { path: 'data.updatedStorageItem.updatedDate' },\n  { path: 'metadata.eventTime' },\n];\nconst TRANSFORM_PATHS_2 = [\n  { path: 'data.storageItem.createdDate' },\n  { path: 'data.storageItem.updatedDate' },\n  { path: 'metadata.eventTime' },\n];\nexport const __metadata = { PACKAGE_NAME: '@wix/automations' };\n\nexport function createStorageItem(\n  httpClient: HttpClient\n): CreateStorageItemSignature {\n  return (\n    storageItem: NonNullablePaths<\n      StorageItem,\n      `displayName` | `key` | `type`,\n      0\n    >\n  ) =>\n    universalCreateStorageItem(\n      storageItem,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface CreateStorageItemSignature {\n  /**\n   * Creates a storage item.\n   *\n   * Each storage item has a unique key and a value of a specific data type. Once created, you can't change the value type.\n   *\n   * > **Note**: You can currently create up to 100 storage items.\n   * @param - Storage item to create.\n   * @returns Created storage item.\n   */\n  (\n    storageItem: NonNullablePaths<\n      StorageItem,\n      `displayName` | `key` | `type`,\n      0\n    >\n  ): Promise<\n    NonNullablePaths<\n      StorageItem,\n      | `stringValue.value`\n      | `stringValue.format`\n      | `booleanValue.value`\n      | `numberValue.value`\n      | `counterValue.value`\n      | `key`\n      | `displayName`\n      | `type`\n      | `tags.privateTags.tagIds`,\n      2\n    > & {\n      __applicationErrorsType?: CreateStorageItemApplicationErrors;\n    }\n  >;\n}\n\nexport function getStorageItem(\n  httpClient: HttpClient\n): GetStorageItemSignature {\n  return (key: string, options?: GetStorageItemOptions) =>\n    universalGetStorageItem(\n      key,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetStorageItemSignature {\n  /**\n   * Retrieves the specified storage item.\n   * @param - Key of the storage item to retrieve.\n   * @returns Retrieved storage item.\n   */\n  (key: string, options?: GetStorageItemOptions): Promise<\n    NonNullablePaths<\n      StorageItem,\n      | `stringValue.value`\n      | `stringValue.format`\n      | `booleanValue.value`\n      | `numberValue.value`\n      | `counterValue.value`\n      | `key`\n      | `displayName`\n      | `type`\n      | `tags.privateTags.tagIds`,\n      2\n    >\n  >;\n}\n\nexport function updateStorageItemValue(\n  httpClient: HttpClient\n): UpdateStorageItemValueSignature {\n  return (key: string, options?: UpdateStorageItemValueOptions) =>\n    universalUpdateStorageItemValue(\n      key,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdateStorageItemValueSignature {\n  /**\n   * Updates the value of an existing storage item.\n   *\n   * > **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).\n   * @param - Key of the storage item to update.\n   */\n  (key: string, options?: UpdateStorageItemValueOptions): Promise<\n    NonNullablePaths<\n      UpdateStorageItemValueResponse,\n      | `storageItem.stringValue.value`\n      | `storageItem.stringValue.format`\n      | `storageItem.booleanValue.value`\n      | `storageItem.numberValue.value`\n      | `storageItem.counterValue.value`\n      | `storageItem.key`\n      | `storageItem.displayName`\n      | `storageItem.type`\n      | `storageItem.tags.privateTags.tagIds`,\n      3\n    > & {\n      __applicationErrorsType?: UpdateStorageItemValueApplicationErrors;\n    }\n  >;\n}\n\nexport function updateStorageItemCounterBy(\n  httpClient: HttpClient\n): UpdateStorageItemCounterBySignature {\n  return (key: string, value: string) =>\n    universalUpdateStorageItemCounterBy(\n      key,\n      value,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface UpdateStorageItemCounterBySignature {\n  /**\n   * Atomically increments or decrements a storage item of type `COUNTER` by the specified value.\n   *\n   * Learn more about [atomic updates](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates).\n   *\n   * > **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).\n   * @param - Key of the storage item to update.\n   * @param - Value to add to the existing counter, represented as a string. To decrement the counter, use a negative value.\n   */\n  (key: string, value: string): Promise<\n    NonNullablePaths<\n      UpdateStorageItemCounterByResponse,\n      | `storageItem.stringValue.value`\n      | `storageItem.stringValue.format`\n      | `storageItem.booleanValue.value`\n      | `storageItem.numberValue.value`\n      | `storageItem.counterValue.value`\n      | `storageItem.key`\n      | `storageItem.displayName`\n      | `storageItem.type`\n      | `storageItem.tags.privateTags.tagIds`,\n      3\n    > & {\n      __applicationErrorsType?: UpdateStorageItemCounterByApplicationErrors;\n    }\n  >;\n}\n\nexport function queryStorageItems(\n  httpClient: HttpClient\n): QueryStorageItemsSignature {\n  return () =>\n    universalQueryStorageItems(\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface QueryStorageItemsSignature {\n  /**\n   * Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.\n   *\n   * 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).\n   */\n  (): StorageItemsQueryBuilder;\n}\n\nexport function typedQueryStorageItems(\n  httpClient: HttpClient\n): TypedQueryStorageItemsSignature {\n  return (query: StorageItemQuery) =>\n    universalTypedQueryStorageItems(\n      query,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface TypedQueryStorageItemsSignature {\n  /** */\n  (query: StorageItemQuery): Promise<\n    NonNullablePaths<\n      QueryStorageItemsResponse,\n      | `storageItems`\n      | `storageItems.${number}.stringValue.value`\n      | `storageItems.${number}.stringValue.format`\n      | `storageItems.${number}.booleanValue.value`\n      | `storageItems.${number}.numberValue.value`\n      | `storageItems.${number}.counterValue.value`\n      | `storageItems.${number}.key`\n      | `storageItems.${number}.displayName`\n      | `storageItems.${number}.type`,\n      3\n    >\n  >;\n}\n\nexport function bulkUpdateStorageItemTags(\n  httpClient: HttpClient\n): BulkUpdateStorageItemTagsSignature {\n  return (\n    storageItemIds: string[],\n    options?: BulkUpdateStorageItemTagsOptions\n  ) =>\n    universalBulkUpdateStorageItemTags(\n      storageItemIds,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface BulkUpdateStorageItemTagsSignature {\n  /**\n   * Updates tags for the specified storage items.\n   *\n   * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n   *\n   * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n   * @param - IDs of storage items to update.\n   */\n  (\n    storageItemIds: string[],\n    options?: BulkUpdateStorageItemTagsOptions\n  ): Promise<\n    NonNullablePaths<\n      BulkUpdateStorageItemTagsResponse,\n      | `results`\n      | `results.${number}.itemMetadata.originalIndex`\n      | `results.${number}.itemMetadata.success`\n      | `results.${number}.itemMetadata.error.code`\n      | `results.${number}.itemMetadata.error.description`\n      | `bulkActionMetadata.totalSuccesses`\n      | `bulkActionMetadata.totalFailures`\n      | `bulkActionMetadata.undetailedFailures`,\n      4\n    > & {\n      __applicationErrorsType?: BulkUpdateStorageItemTagsApplicationErrors;\n    }\n  >;\n}\n\nexport function bulkUpdateStorageItemTagsByFilter(\n  httpClient: HttpClient\n): BulkUpdateStorageItemTagsByFilterSignature {\n  return (\n    filter: Record<string, any>,\n    options?: BulkUpdateStorageItemTagsByFilterOptions\n  ) =>\n    universalBulkUpdateStorageItemTagsByFilter(\n      filter,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface BulkUpdateStorageItemTagsByFilterSignature {\n  /**\n   * Updates tags for storage items that match the specified filter criteria. Specifying an empty filter updates tags for all storage items.\n   *\n   * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n   *\n   * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n   * @param - Filter criteria to select storage items for tag updates. Specifying an empty filter updates tags for all storage items.\n   */\n  (\n    filter: Record<string, any>,\n    options?: BulkUpdateStorageItemTagsByFilterOptions\n  ): Promise<\n    NonNullablePaths<BulkUpdateStorageItemTagsByFilterResponse, `jobId`, 0> & {\n      __applicationErrorsType?: BulkUpdateStorageItemTagsByFilterApplicationErrors;\n    }\n  >;\n}\n\nexport const onStorageItemCreated = /*#__PURE__*/ EventDefinition(\n  'wix.automations.storage.v1.storage_item_created',\n  true,\n  (event: StorageItemCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: TRANSFORM_PATHS_0,\n        },\n      ])\n    )\n)<StorageItemCreatedEnvelope>();\nexport const onStorageItemCounterUpdated = /*#__PURE__*/ EventDefinition(\n  'wix.automations.storage.v1.storage_item_storage_item_counter_updated',\n  true,\n  (event: StorageItemCounterUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: TRANSFORM_PATHS_1,\n        },\n      ])\n    )\n)<StorageItemCounterUpdatedEnvelope>();\nexport const onStorageItemValueUpdated = /*#__PURE__*/ EventDefinition(\n  'wix.automations.storage.v1.storage_item_storage_item_value_updated',\n  true,\n  (event: StorageItemValueUpdatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: TRANSFORM_PATHS_1,\n        },\n      ])\n    )\n)<StorageItemValueUpdatedEnvelope>();\nexport const onStorageItemTagsModified = /*#__PURE__*/ EventDefinition(\n  'wix.automations.storage.v1.storage_item_tags_modified',\n  true,\n  (event: StorageItemTagsModifiedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: TRANSFORM_PATHS_2,\n        },\n      ])\n    )\n)<StorageItemTagsModifiedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  ApplicationError,\n  BaseEventMetadata,\n  BooleanValue,\n  BulkActionMetadata,\n  BulkUpdateStorageItemTagsByFilterOptions,\n  BulkUpdateStorageItemTagsByFilterRequest,\n  BulkUpdateStorageItemTagsByFilterResponse,\n  BulkUpdateStorageItemTagsOptions,\n  BulkUpdateStorageItemTagsRequest,\n  BulkUpdateStorageItemTagsResponse,\n  BulkUpdateStorageItemTagsResult,\n  CounterValue,\n  CreateStorageItemRequest,\n  CreateStorageItemResponse,\n  CursorPaging,\n  CursorPagingMetadata,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Cursors,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  ExtendedFields,\n  Format,\n  GetStorageItemOptions,\n  GetStorageItemRequest,\n  GetStorageItemResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ItemMetadata,\n  MessageEnvelope,\n  NumberValue,\n  QueryStorageItemsRequest,\n  QueryStorageItemsResponse,\n  RestoreInfo,\n  SortOrder,\n  Sorting,\n  StorageItem,\n  StorageItemCounterUpdated,\n  StorageItemCounterUpdatedEnvelope,\n  StorageItemCreatedEnvelope,\n  StorageItemQuerySpec,\n  StorageItemTagsModifiedEnvelope,\n  StorageItemValueOneOf,\n  StorageItemValueUpdated,\n  StorageItemValueUpdatedEnvelope,\n  StorageItemsQueryBuilder,\n  StorageItemsQueryResult,\n  StringValue,\n  TagList,\n  Tags,\n  TagsModified,\n  Type,\n  UpdateStorageItemCounterByRequest,\n  UpdateStorageItemCounterByResponse,\n  UpdateStorageItemValueOptions,\n  UpdateStorageItemValueOptionsValueOneOf,\n  UpdateStorageItemValueRequest,\n  UpdateStorageItemValueRequestValueOneOf,\n  UpdateStorageItemValueResponse,\n  WebhookIdentityType,\n  utils,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n  HttpClient,\n  HttpResponse,\n  NonNullablePaths,\n  QuerySpec,\n  Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixAutomationsStorageV1StorageItem from './automations-storage-v1-storage-item-storage-item.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/** 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. */\nexport interface StorageItem extends StorageItemValueOneOf {\n  /** When the item type is `STRING`, the string value. */\n  stringValue?: StringValue;\n  /** When the item type is `BOOLEAN`, the boolean value. */\n  booleanValue?: BooleanValue;\n  /** When the item type is `NUMBER`, the numeric value. */\n  numberValue?: NumberValue;\n  /**\n   * When the item type is `COUNTER`, the counter value.\n   *\n   * > **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).\n   */\n  counterValue?: CounterValue;\n  /**\n   * Storage item ID.\n   * @format GUID\n   * @readonly\n   * @immutable\n   */\n  _id?: string | null;\n  /**\n   * Unique storage item key. The key can only contain letters, numbers, and underscores.\n   *\n   * Once you create the item, you can't update its key.\n   * @minLength 1\n   * @maxLength 63\n   * @immutable\n   */\n  key?: string;\n  /**\n   * 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).\n   * @minLength 1\n   * @maxLength 63\n   */\n  displayName?: string;\n  /**\n   * Storage item description.\n   * @maxLength 200\n   */\n  description?: string | null;\n  /**\n   * Data type of the storage item's value. Once created, you can't change the value's type.\n   * @immutable\n   */\n  type?: TypeWithLiterals;\n  /**\n   * When the storage item was created.\n   * @readonly\n   */\n  _createdDate?: Date | null;\n  /**\n   * When the storage item was last updated.\n   * @readonly\n   */\n  _updatedDate?: Date | null;\n  /**\n   * [Tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction) assigned to the storage item.\n   *\n   * You can use public and private tags for categorization and filtering.\n   */\n  tags?: Tags;\n  /** Extended fields. */\n  extendedFields?: ExtendedFields;\n}\n\n/** @oneof */\nexport interface StorageItemValueOneOf {\n  /** When the item type is `STRING`, the string value. */\n  stringValue?: StringValue;\n  /** When the item type is `BOOLEAN`, the boolean value. */\n  booleanValue?: BooleanValue;\n  /** When the item type is `NUMBER`, the numeric value. */\n  numberValue?: NumberValue;\n  /**\n   * When the item type is `COUNTER`, the counter value.\n   *\n   * > **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).\n   */\n  counterValue?: CounterValue;\n}\n\nexport enum Format {\n  /** Plain text. */\n  PLAIN_TEXT = 'PLAIN_TEXT',\n  /** [Universal Resource Identifier (URI)](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier). */\n  URI = 'URI',\n  /** Email. */\n  EMAIL = 'EMAIL',\n  /** Datetime string in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601). */\n  DATETIME = 'DATETIME',\n}\n\n/** @enumType */\nexport type FormatWithLiterals =\n  | Format\n  | 'PLAIN_TEXT'\n  | 'URI'\n  | 'EMAIL'\n  | 'DATETIME';\n\nexport interface StringValue {\n  /**\n   * String value.\n   * @maxLength 4096\n   */\n  value?: string;\n  /** String format. */\n  format?: FormatWithLiterals;\n}\n\nexport interface BooleanValue {\n  /** Boolean value. */\n  value?: boolean;\n}\n\nexport interface NumberValue {\n  /**\n   * Numeric decimal value, represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:16 }\n   */\n  value?: string;\n}\n\nexport interface CounterValue {\n  /**\n   * Counter decimal value, represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:16 }\n   */\n  value?: string;\n}\n\nexport enum Type {\n  /** String. */\n  STRING = 'STRING',\n  /** Boolean. */\n  BOOLEAN = 'BOOLEAN',\n  /** Number. */\n  NUMBER = 'NUMBER',\n  /**\n   * Counter.\n   *\n   * > **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).\n   */\n  COUNTER = 'COUNTER',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n  | Type\n  | 'STRING'\n  | 'BOOLEAN'\n  | 'NUMBER'\n  | 'COUNTER';\n\n/**\n * Common object for tags.\n * Should be use as in this example:\n * message Foo {\n * option (.wix.api.decomposite_of) = \"wix.commons.v2.tags.Foo\";\n * string id = 1;\n * ...\n * Tags tags = 5\n * }\n *\n * example of taggable entity\n * {\n * id: \"123\"\n * tags: {\n * public_tags: {\n * tag_ids:[\"11\",\"22\"]\n * },\n * private_tags: {\n * tag_ids: [\"33\", \"44\"]\n * }\n * }\n * }\n */\nexport interface Tags {\n  /**\n   * List of private tags.\n   *\n   * Private tags require additional permissions to access. They are usually hidden from site members and visitors.\n   */\n  privateTags?: TagList;\n  /**\n   * List of public tags.\n   *\n   * Public tags are visible to anyone with access to the main storage item, including site members and visitors.\n   */\n  publicTags?: TagList;\n}\n\nexport interface TagList {\n  /**\n   * List of tag IDs.\n   * @maxSize 100\n   * @maxLength 5\n   */\n  tagIds?: string[];\n}\n\nexport interface ExtendedFields {\n  /**\n   * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n   * The value of each key is structured according to the schema defined when the extended fields were configured.\n   *\n   * You can only access fields for which you have the appropriate permissions.\n   *\n   * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n   */\n  namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface StorageItemValueUpdated {\n  /** Updated storage item. */\n  updatedStorageItem?: StorageItem;\n}\n\nexport interface StorageItemCounterUpdated {\n  /** Storage item with the updated counter. */\n  updatedStorageItem?: StorageItem;\n}\n\nexport interface TagsModified {\n  /** Storage item whose tags were modified. */\n  storageItem?: StorageItem;\n  /** Tags assigned. */\n  assignedTags?: Tags;\n  /** Tags removed. */\n  unassignedTags?: Tags;\n}\n\nexport interface CreateStorageItemRequest {\n  /** Storage item to create. */\n  storageItem: StorageItem;\n}\n\nexport interface CreateStorageItemResponse {\n  /** Created storage item. */\n  storageItem?: StorageItem;\n}\n\nexport interface GetStorageItemRequest {\n  /**\n   * Key of the storage item to retrieve.\n   * @minLength 1\n   * @maxLength 63\n   */\n  key: string;\n  /**\n   * 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.\n   *\n   * Default: `false`.\n   */\n  consistentRead?: boolean;\n}\n\nexport interface GetStorageItemResponse {\n  /** Retrieved storage item. */\n  storageItem?: StorageItem;\n}\n\nexport interface UpdateStorageItemValueRequest\n  extends UpdateStorageItemValueRequestValueOneOf {\n  /**\n   * String value.\n   * @maxLength 4096\n   */\n  stringValue?: string;\n  /** Boolean value. */\n  booleanValue?: boolean;\n  /**\n   * Number value represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 }\n   */\n  numberValue?: string;\n  /**\n   * Key of the storage item to update.\n   * @minLength 1\n   * @maxLength 63\n   */\n  key: string;\n}\n\n/** @oneof */\nexport interface UpdateStorageItemValueRequestValueOneOf {\n  /**\n   * String value.\n   * @maxLength 4096\n   */\n  stringValue?: string;\n  /** Boolean value. */\n  booleanValue?: boolean;\n  /**\n   * Number value represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 }\n   */\n  numberValue?: string;\n}\n\nexport interface UpdateStorageItemValueResponse {\n  /** Updated storage item. */\n  storageItem?: StorageItem;\n}\n\nexport interface UpdateStorageItemCounterByRequest {\n  /**\n   * Key of the storage item to update.\n   * @minLength 1\n   * @maxLength 63\n   */\n  key: string;\n  /**\n   * Value to add to the existing counter, represented as a string. To decrement the counter, use a negative value.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 }\n   */\n  value: string;\n}\n\nexport interface UpdateStorageItemCounterByResponse {\n  /** Updated storage item. */\n  storageItem?: StorageItem;\n}\n\nexport interface QueryStorageItemsRequest {\n  /**\n   * Query preferences.\n   *\n   * 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).\n   */\n  query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n  /**\n   * Cursor paging options.\n   *\n   * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n   */\n  cursorPaging?: CursorPaging;\n  /**\n   * Filter object.\n   *\n   * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).\n   */\n  filter?: Record<string, any> | null;\n  /**\n   * Sort object.\n   *\n   * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).\n   * @maxSize 5\n   */\n  sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n  /**\n   * Cursor paging options.\n   *\n   * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).\n   */\n  cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n  /**\n   * Name of the field to sort by.\n   * @maxLength 512\n   */\n  fieldName?: string;\n  /** Sort order. */\n  order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n  ASC = 'ASC',\n  DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n  /**\n   * Maximum number of items to return in the results.\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * Pointer to the next or previous page in the list of results.\n   *\n   * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n   * Not relevant for the first request.\n   * @maxLength 16000\n   */\n  cursor?: string | null;\n}\n\nexport interface QueryStorageItemsResponse {\n  /** List of storage items that match the query criteria. */\n  storageItems?: StorageItem[];\n  /** Paging metadata. */\n  pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n  /** Number of items returned in current page. */\n  count?: number | null;\n  /** Cursor strings that point to the next page, previous page, or both. */\n  cursors?: Cursors;\n  /**\n   * Whether there are more pages to retrieve following the current page.\n   *\n   * + `true`: Another page of results can be retrieved.\n   * + `false`: This is the last page.\n   */\n  hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n  /**\n   * Cursor string pointing to the next page in the list of results.\n   * @maxLength 16000\n   */\n  next?: string | null;\n  /**\n   * Cursor pointing to the previous page in the list of results.\n   * @maxLength 16000\n   */\n  prev?: string | null;\n}\n\nexport interface BulkUpdateStorageItemTagsRequest {\n  /**\n   * IDs of storage items to update.\n   * @minSize 1\n   * @maxSize 100\n   * @format GUID\n   */\n  storageItemIds: string[];\n  /** Tags to assign to the specified storage items. */\n  assignTags?: Tags;\n  /** Tags to remove from the specified storage items. */\n  unassignTags?: Tags;\n}\n\nexport interface BulkUpdateStorageItemTagsResponse {\n  /**\n   * Update results.\n   * @minSize 1\n   * @maxSize 100\n   */\n  results?: BulkUpdateStorageItemTagsResult[];\n  /** Bulk operation metadata. */\n  bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n  /**\n   * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed.\n   * @format GUID\n   */\n  _id?: string | null;\n  /** Index of the item within the request array. Allows for correlation between request and response items. */\n  originalIndex?: number;\n  /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */\n  success?: boolean;\n  /** Details about the error in case of failure. */\n  error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n  /** Error code. */\n  code?: string;\n  /** Description of the error. */\n  description?: string;\n  /** Data related to the error. */\n  data?: Record<string, any> | null;\n}\n\nexport interface BulkUpdateStorageItemTagsResult {\n  /** Update result metadata. */\n  itemMetadata?: ItemMetadata;\n}\n\nexport interface BulkActionMetadata {\n  /** Number of items that were successfully processed. */\n  totalSuccesses?: number;\n  /** Number of items that couldn't be processed. */\n  totalFailures?: number;\n  /** Number of failures without details because detailed failure threshold was exceeded. */\n  undetailedFailures?: number;\n}\n\nexport interface BulkUpdateStorageItemTagsByFilterRequest {\n  /** Filter criteria to select storage items for tag updates. Specifying an empty filter updates tags for all storage items. */\n  filter: Record<string, any> | null;\n  /** Tags to assign to the storage items. */\n  assignTags?: Tags;\n  /** Tags to remove from the storage items. */\n  unassignTags?: Tags;\n}\n\nexport interface BulkUpdateStorageItemTagsByFilterResponse {\n  /**\n   * Job ID for tracking the progress of the bulk operation.\n   * @format GUID\n   */\n  jobId?: string;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * 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.\n   * 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.\n   */\n  entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n  createdEvent?: EntityCreatedEvent;\n  updatedEvent?: EntityUpdatedEvent;\n  deletedEvent?: EntityDeletedEvent;\n  actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n  entity?: string;\n}\n\nexport interface RestoreInfo {\n  deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n  /**\n   * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n   * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n   * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n   */\n  currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n  /** Entity that was deleted. */\n  deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n  body?: string;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateStorageItemApplicationErrors =\n  | {\n      code?: 'INVALID_STORAGE_ITEM_KEY_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'TOO_MANY_STORAGE_ITEMS';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'STORAGE_ITEM_VALUE_VALIDATION_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type UpdateStorageItemValueApplicationErrors =\n  | {\n      code?: 'INVALID_STORAGE_ITEM_TYPE_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'VALUE_TYPE_MISMATCH_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'STORAGE_ITEM_VALUE_VALIDATION_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type UpdateStorageItemCounterByApplicationErrors =\n  | {\n      code?: 'INVALID_STORAGE_ITEM_TYPE_EXCEPTION';\n      description?: string;\n      data?: Record<string, any>;\n    }\n  | {\n      code?: 'INVALID_NUMBER_VALUE';\n      description?: string;\n      data?: Record<string, any>;\n    };\n/** @docsIgnore */\nexport type BulkUpdateStorageItemTagsApplicationErrors = {\n  code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS';\n  description?: string;\n  data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type BulkUpdateStorageItemTagsByFilterApplicationErrors = {\n  code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS';\n  description?: string;\n  data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * 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.\n   * 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.\n   */\n  entityEventSequence?: string | null;\n  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface StorageItemCreatedEnvelope {\n  entity: StorageItem;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ\n * @webhook\n * @eventType wix.automations.storage.v1.storage_item_created\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onStorageItemCreated(\n  handler: (event: StorageItemCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface StorageItemCounterUpdatedEnvelope {\n  data: StorageItemCounterUpdated;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ\n * @webhook\n * @eventType wix.automations.storage.v1.storage_item_storage_item_counter_updated\n * @slug storage_item_counter_updated\n * @documentationMaturity preview\n */\nexport declare function onStorageItemCounterUpdated(\n  handler: (event: StorageItemCounterUpdatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface StorageItemValueUpdatedEnvelope {\n  data: StorageItemValueUpdated;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ\n * @webhook\n * @eventType wix.automations.storage.v1.storage_item_storage_item_value_updated\n * @slug storage_item_value_updated\n * @documentationMaturity preview\n */\nexport declare function onStorageItemValueUpdated(\n  handler: (event: StorageItemValueUpdatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface StorageItemTagsModifiedEnvelope {\n  data: TagsModified;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionScope Set Up Automations\n * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS\n * @permissionId AUTOMATIONS.STORAGE_ITEM_DOMAIN_EVENTS_READ\n * @webhook\n * @eventType wix.automations.storage.v1.storage_item_tags_modified\n * @slug tags_modified\n * @documentationMaturity preview\n */\nexport declare function onStorageItemTagsModified(\n  handler: (event: StorageItemTagsModifiedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a storage item.\n *\n * Each storage item has a unique key and a value of a specific data type. Once created, you can't change the value type.\n *\n * > **Note**: You can currently create up to 100 storage items.\n * @param storageItem - Storage item to create.\n * @public\n * @documentationMaturity preview\n * @requiredField storageItem\n * @requiredField storageItem.displayName\n * @requiredField storageItem.key\n * @requiredField storageItem.type\n * @permissionId AUTOMATIONS.STORAGE_ITEM_CREATE\n * @applicableIdentity APP\n * @returns Created storage item.\n * @fqn wix.automations.storage.v1.StorageService.CreateStorageItem\n */\nexport async function createStorageItem(\n  storageItem: NonNullablePaths<StorageItem, `displayName` | `key` | `type`, 0>\n): Promise<\n  NonNullablePaths<\n    StorageItem,\n    | `stringValue.value`\n    | `stringValue.format`\n    | `booleanValue.value`\n    | `numberValue.value`\n    | `counterValue.value`\n    | `key`\n    | `displayName`\n    | `type`\n    | `tags.privateTags.tagIds`,\n    2\n  > & {\n    __applicationErrorsType?: CreateStorageItemApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    storageItem: storageItem,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.createStorageItem(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.storageItem!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { storageItem: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['storageItem']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves the specified storage item.\n * @param key - Key of the storage item to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField key\n * @permissionId AUTOMATIONS.STORAGE_ITEM_READ\n * @applicableIdentity APP\n * @returns Retrieved storage item.\n * @fqn wix.automations.storage.v1.StorageService.GetStorageItem\n */\nexport async function getStorageItem(\n  key: string,\n  options?: GetStorageItemOptions\n): Promise<\n  NonNullablePaths<\n    StorageItem,\n    | `stringValue.value`\n    | `stringValue.format`\n    | `booleanValue.value`\n    | `numberValue.value`\n    | `counterValue.value`\n    | `key`\n    | `displayName`\n    | `type`\n    | `tags.privateTags.tagIds`,\n    2\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    key: key,\n    consistentRead: options?.consistentRead,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.getStorageItem(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.storageItem!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          key: '$[0]',\n          consistentRead: '$[1].consistentRead',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['key', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetStorageItemOptions {\n  /**\n   * 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.\n   *\n   * Default: `false`.\n   */\n  consistentRead?: boolean;\n}\n\n/**\n * Updates the value of an existing storage item.\n *\n * > **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).\n * @param key - Key of the storage item to update.\n * @public\n * @documentationMaturity preview\n * @requiredField key\n * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.automations.storage.v1.StorageService.UpdateStorageItemValue\n */\nexport async function updateStorageItemValue(\n  key: string,\n  options?: UpdateStorageItemValueOptions\n): Promise<\n  NonNullablePaths<\n    UpdateStorageItemValueResponse,\n    | `storageItem.stringValue.value`\n    | `storageItem.stringValue.format`\n    | `storageItem.booleanValue.value`\n    | `storageItem.numberValue.value`\n    | `storageItem.counterValue.value`\n    | `storageItem.key`\n    | `storageItem.displayName`\n    | `storageItem.type`\n    | `storageItem.tags.privateTags.tagIds`,\n    3\n  > & {\n    __applicationErrorsType?: UpdateStorageItemValueApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    key: key,\n    stringValue: options?.stringValue,\n    booleanValue: options?.booleanValue,\n    numberValue: options?.numberValue,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.updateStorageItemValue(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          key: '$[0]',\n          stringValue: '$[1].stringValue',\n          booleanValue: '$[1].booleanValue',\n          numberValue: '$[1].numberValue',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['key', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface UpdateStorageItemValueOptions\n  extends UpdateStorageItemValueOptionsValueOneOf {\n  /**\n   * String value.\n   * @maxLength 4096\n   */\n  stringValue?: string;\n  /** Boolean value. */\n  booleanValue?: boolean;\n  /**\n   * Number value represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 }\n   */\n  numberValue?: string;\n}\n\n/** @oneof */\nexport interface UpdateStorageItemValueOptionsValueOneOf {\n  /**\n   * String value.\n   * @maxLength 4096\n   */\n  stringValue?: string;\n  /** Boolean value. */\n  booleanValue?: boolean;\n  /**\n   * Number value represented as a string.\n   * @decimalValue options { lte:9999999999999999.99, gte:-9999999999999999.99, maxScale:2 }\n   */\n  numberValue?: string;\n}\n\n/**\n * Atomically increments or decrements a storage item of type `COUNTER` by the specified value.\n *\n * Learn more about [atomic updates](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates).\n *\n * > **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).\n * @param key - Key of the storage item to update.\n * @param value - Value to add to the existing counter, represented as a string. To decrement the counter, use a negative value.\n * @public\n * @documentationMaturity preview\n * @requiredField key\n * @requiredField value\n * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.automations.storage.v1.StorageService.UpdateStorageItemCounterBy\n */\nexport async function updateStorageItemCounterBy(\n  key: string,\n  value: string\n): Promise<\n  NonNullablePaths<\n    UpdateStorageItemCounterByResponse,\n    | `storageItem.stringValue.value`\n    | `storageItem.stringValue.format`\n    | `storageItem.booleanValue.value`\n    | `storageItem.numberValue.value`\n    | `storageItem.counterValue.value`\n    | `storageItem.key`\n    | `storageItem.displayName`\n    | `storageItem.type`\n    | `storageItem.tags.privateTags.tagIds`,\n    3\n  > & {\n    __applicationErrorsType?: UpdateStorageItemCounterByApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    key: key,\n    value: value,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.updateStorageItemCounterBy(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { key: '$[0]', value: '$[1]' },\n        singleArgumentUnchanged: false,\n      },\n      ['key', 'value']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\n/**\n * Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.\n *\n * 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).\n * @public\n * @documentationMaturity preview\n * @permissionId AUTOMATIONS.STORAGE_ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.automations.storage.v1.StorageService.QueryStorageItems\n */\nexport function queryStorageItems(): StorageItemsQueryBuilder {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[0] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  return queryBuilder<\n    StorageItem,\n    'CURSOR',\n    QueryStorageItemsRequest,\n    QueryStorageItemsResponse\n  >({\n    func: async (payload: QueryStorageItemsRequest) => {\n      const reqOpts =\n        ambassadorWixAutomationsStorageV1StorageItem.queryStorageItems(payload);\n\n      sideEffects?.onSiteCall?.();\n      try {\n        const result = await httpClient.request(reqOpts);\n        sideEffects?.onSuccess?.(result);\n        return result;\n      } catch (err) {\n        sideEffects?.onError?.(err);\n        throw err;\n      }\n    },\n    requestTransformer: (query: QueryStorageItemsRequest['query']) => {\n      const args = [query, {}] as [QueryStorageItemsRequest['query'], {}];\n      return renameKeysFromSDKRequestToRESTRequest({\n        ...args?.[1],\n        query: args?.[0],\n      });\n    },\n    responseTransformer: ({\n      data,\n    }: HttpResponse<QueryStorageItemsResponse>) => {\n      const transformedData = renameKeysFromRESTResponseToSDKResponse(\n        transformPaths(data, [])\n      );\n\n      return {\n        items: transformedData?.storageItems,\n        pagingMetadata: transformedData?.pagingMetadata,\n      };\n    },\n    errorTransformer: (err: unknown) => {\n      const transformedError = sdkTransformError(err, {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      });\n\n      throw transformedError;\n    },\n    pagingMethod: 'CURSOR',\n    transformationPaths: {},\n  });\n}\n\ninterface QueryCursorResult {\n  cursors: Cursors;\n  hasNext: () => boolean;\n  hasPrev: () => boolean;\n  length: number;\n  pageSize: number;\n}\n\nexport interface StorageItemsQueryResult extends QueryCursorResult {\n  items: StorageItem[];\n  query: StorageItemsQueryBuilder;\n  next: () => Promise<StorageItemsQueryResult>;\n  prev: () => Promise<StorageItemsQueryResult>;\n}\n\nexport interface StorageItemsQueryBuilder {\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  eq: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  ne: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  ge: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  gt: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  le: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `value`.\n   * @param value - Value to compare against.\n   * @documentationMaturity preview\n   */\n  lt: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyName - Property whose value is compared with `string`.\n   * @param string - String to compare against. Case-insensitive.\n   * @documentationMaturity preview\n   */\n  startsWith: (\n    propertyName: '_id' | 'key' | 'displayName' | 'description',\n    value: string\n  ) => StorageItemsQueryBuilder;\n  /** @documentationMaturity preview */\n  in: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate',\n    value: any\n  ) => StorageItemsQueryBuilder;\n  /** @documentationMaturity preview */\n  exists: (\n    propertyName:\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate',\n    value: boolean\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n   * @documentationMaturity preview\n   */\n  ascending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate'\n    >\n  ) => StorageItemsQueryBuilder;\n  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n   * @documentationMaturity preview\n   */\n  descending: (\n    ...propertyNames: Array<\n      | '_id'\n      | 'key'\n      | 'displayName'\n      | 'description'\n      | 'type'\n      | '_createdDate'\n      | '_updatedDate'\n    >\n  ) => StorageItemsQueryBuilder;\n  /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n   * @documentationMaturity preview\n   */\n  limit: (limit: number) => StorageItemsQueryBuilder;\n  /** @param cursor - A pointer to specific record\n   * @documentationMaturity preview\n   */\n  skipTo: (cursor: string) => StorageItemsQueryBuilder;\n  /** @documentationMaturity preview */\n  find: () => Promise<StorageItemsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.automations.storage.v1.StorageService.QueryStorageItems\n * @requiredField query\n */\nexport async function typedQueryStorageItems(\n  query: StorageItemQuery\n): Promise<\n  NonNullablePaths<\n    QueryStorageItemsResponse,\n    | `storageItems`\n    | `storageItems.${number}.stringValue.value`\n    | `storageItems.${number}.stringValue.format`\n    | `storageItems.${number}.booleanValue.value`\n    | `storageItems.${number}.numberValue.value`\n    | `storageItems.${number}.counterValue.value`\n    | `storageItems.${number}.key`\n    | `storageItems.${number}.displayName`\n    | `storageItems.${number}.type`,\n    3\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.queryStorageItems(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { query: '$[0]' },\n        singleArgumentUnchanged: false,\n      },\n      ['query']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface StorageItemQuerySpec extends QuerySpec {\n  paging: 'cursor';\n  wql: [\n    {\n      fields: [\n        '_createdDate',\n        '_id',\n        '_updatedDate',\n        'description',\n        'displayName',\n        'key',\n        'type'\n      ];\n      operators: '*';\n      sort: 'BOTH';\n    }\n  ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n  StorageItem,\n  StorageItemQuerySpec\n>;\nexport type StorageItemQuery = {\n  /** \n  Cursor paging options.\n\n  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).  \n  */\n  cursorPaging?: {\n    /** \n  Maximum number of items to return in the results. \n  @max: 100 \n  */\n    limit?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n      | null;\n    /** \n  Pointer to the next or previous page in the list of results.\n\n  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n  Not relevant for the first request. \n  @maxLength: 16000 \n  */\n    cursor?:\n      | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n      | null;\n  };\n  /** \n  Filter object.\n\n  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).  \n  */\n  filter?: CommonQueryWithEntityContext['filter'] | null;\n  /** \n  Sort object.\n\n  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). \n  @maxSize: 5 \n  */\n  sort?: {\n    /** \n  Name of the field to sort by. \n  @maxLength: 512 \n  */\n    fieldName?: NonNullable<\n      CommonQueryWithEntityContext['sort']\n    >[number]['fieldName'];\n    /** \n  Sort order.  \n  */\n    order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n  }[];\n};\n\nexport const utils = {\n  query: /*#__PURE__*/ createQueryUtils<\n    StorageItem,\n    StorageItemQuerySpec,\n    StorageItemQuery\n  >(),\n};\n\n/**\n * Updates tags for the specified storage items.\n *\n * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n *\n * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n * @param storageItemIds - IDs of storage items to update.\n * @public\n * @documentationMaturity preview\n * @requiredField storageItemIds\n * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTags\n */\nexport async function bulkUpdateStorageItemTags(\n  storageItemIds: string[],\n  options?: BulkUpdateStorageItemTagsOptions\n): Promise<\n  NonNullablePaths<\n    BulkUpdateStorageItemTagsResponse,\n    | `results`\n    | `results.${number}.itemMetadata.originalIndex`\n    | `results.${number}.itemMetadata.success`\n    | `results.${number}.itemMetadata.error.code`\n    | `results.${number}.itemMetadata.error.description`\n    | `bulkActionMetadata.totalSuccesses`\n    | `bulkActionMetadata.totalFailures`\n    | `bulkActionMetadata.undetailedFailures`,\n    4\n  > & {\n    __applicationErrorsType?: BulkUpdateStorageItemTagsApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    storageItemIds: storageItemIds,\n    assignTags: options?.assignTags,\n    unassignTags: options?.unassignTags,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.bulkUpdateStorageItemTags(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          storageItemIds: '$[0]',\n          assignTags: '$[1].assignTags',\n          unassignTags: '$[1].unassignTags',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['storageItemIds', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface BulkUpdateStorageItemTagsOptions {\n  /** Tags to assign to the specified storage items. */\n  assignTags?: Tags;\n  /** Tags to remove from the specified storage items. */\n  unassignTags?: Tags;\n}\n\n/**\n * Updates tags for storage items that match the specified filter criteria. Specifying an empty filter updates tags for all storage items.\n *\n * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n *\n * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n * @param filter - Filter criteria to select storage items for tag updates. Specifying an empty filter updates tags for all storage items.\n * @public\n * @documentationMaturity preview\n * @requiredField filter\n * @permissionId AUTOMATIONS.STORAGE_ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTagsByFilter\n */\nexport async function bulkUpdateStorageItemTagsByFilter(\n  filter: Record<string, any>,\n  options?: BulkUpdateStorageItemTagsByFilterOptions\n): Promise<\n  NonNullablePaths<BulkUpdateStorageItemTagsByFilterResponse, `jobId`, 0> & {\n    __applicationErrorsType?: BulkUpdateStorageItemTagsByFilterApplicationErrors;\n  }\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    filter: filter,\n    assignTags: options?.assignTags,\n    unassignTags: options?.unassignTags,\n  });\n\n  const reqOpts =\n    ambassadorWixAutomationsStorageV1StorageItem.bulkUpdateStorageItemTagsByFilter(\n      payload\n    );\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          filter: '$[0]',\n          assignTags: '$[1].assignTags',\n          unassignTags: '$[1].unassignTags',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['filter', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface BulkUpdateStorageItemTagsByFilterOptions {\n  /** Tags to assign to the storage items. */\n  assignTags?: Tags;\n  /** Tags to remove from the storage items. */\n  unassignTags?: Tags;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nconst TRANSFORM_PATHS_0 = [\n  { path: 'storageItem.createdDate' },\n  { path: 'storageItem.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n  { path: 'storageItems.createdDate' },\n  { path: 'storageItems.updatedDate' },\n];\n\nfunction resolveWixAutomationsStorageV1StorageServiceUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/storage-service',\n        destPath: '',\n      },\n    ],\n    'api._api_base_domain_': [\n      {\n        srcPath: '/storage-service',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/storage-service',\n        destPath: '',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/storage-service',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/storage-service',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_automations_storage-item';\n\n/**\n * Creates a storage item.\n *\n * Each storage item has a unique key and a value of a specific data type. Once created, you can't change the value type.\n *\n * > **Note**: You can currently create up to 100 storage items.\n */\nexport function createStorageItem(payload: object): RequestOptionsFactory<any> {\n  function __createStorageItem({ host }: any) {\n    const serializedData = transformPaths(payload, [\n      {\n        transformFn: transformSDKTimestampToRESTTimestamp,\n        paths: TRANSFORM_PATHS_0,\n      },\n    ]);\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'POST' as any,\n      methodFqn: 'wix.automations.storage.v1.StorageService.CreateStorageItem',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/storage-items',\n        data: serializedData,\n        host,\n      }),\n      data: serializedData,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __createStorageItem;\n}\n\n/** Retrieves the specified storage item. */\nexport function getStorageItem(payload: object): RequestOptionsFactory<any> {\n  function __getStorageItem({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'GET' as any,\n      methodFqn: 'wix.automations.storage.v1.StorageService.GetStorageItem',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/storage-items/{key}',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getStorageItem;\n}\n\n/**\n * Updates the value of an existing storage item.\n *\n * > **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).\n */\nexport function updateStorageItemValue(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __updateStorageItemValue({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'PATCH' as any,\n      methodFqn:\n        'wix.automations.storage.v1.StorageService.UpdateStorageItemValue',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/storage-items/{key}/update-value',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __updateStorageItemValue;\n}\n\n/**\n * Atomically increments or decrements a storage item of type `COUNTER` by the specified value.\n *\n * Learn more about [atomic updates](https://dev.wix.com/docs/api-reference/business-management/automations/storage-item/introduction#atomic-updates).\n *\n * > **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).\n */\nexport function updateStorageItemCounterBy(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __updateStorageItemCounterBy({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'PATCH' as any,\n      methodFqn:\n        'wix.automations.storage.v1.StorageService.UpdateStorageItemCounterBy',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/storage-items/{key}/update-counter-by',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_0,\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __updateStorageItemCounterBy;\n}\n\n/**\n * Retrieves a list of storage items based on the filtering, sorting, and paging preferences you provide.\n *\n * 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).\n */\nexport function queryStorageItems(payload: object): RequestOptionsFactory<any> {\n  function __queryStorageItems({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'GET' as any,\n      methodFqn: 'wix.automations.storage.v1.StorageService.QueryStorageItems',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/storage-items/query',\n        data: payload,\n        host,\n      }),\n      params: toURLSearchParams(payload, true),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: TRANSFORM_PATHS_1,\n          },\n        ]),\n      fallback: [\n        {\n          method: 'POST' as any,\n          url: resolveWixAutomationsStorageV1StorageServiceUrl({\n            protoPath: '/v1/storage-items/query',\n            data: payload,\n            host,\n          }),\n          data: payload,\n        },\n      ],\n    };\n\n    return metadata;\n  }\n\n  return __queryStorageItems;\n}\n\n/**\n * Updates tags for the specified storage items.\n *\n * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n *\n * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n */\nexport function bulkUpdateStorageItemTags(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __bulkUpdateStorageItemTags({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTags',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/bulk/storage-items/update-tags',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __bulkUpdateStorageItemTags;\n}\n\n/**\n * Updates tags for storage items that match the specified filter criteria. Specifying an empty filter updates tags for all storage items.\n *\n * Learn more about [tags](https://dev.wix.com/docs/api-reference/business-management/tags/introduction).\n *\n * > **Note**: A tag that appears in both `assignTags` and `unassignTags` is assigned.\n */\nexport function bulkUpdateStorageItemTagsByFilter(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __bulkUpdateStorageItemTagsByFilter({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.automations.storage.v1.storage_item',\n      method: 'POST' as any,\n      methodFqn:\n        'wix.automations.storage.v1.StorageService.BulkUpdateStorageItemTagsByFilter',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveWixAutomationsStorageV1StorageServiceUrl({\n        protoPath: '/v1/bulk/storage-items/update-tags-by-filter',\n        data: payload,\n        host,\n      }),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __bulkUpdateStorageItemTagsByFilter;\n}\n","import {\n  createStorageItem as publicCreateStorageItem,\n  getStorageItem as publicGetStorageItem,\n  updateStorageItemValue as publicUpdateStorageItemValue,\n  updateStorageItemCounterBy as publicUpdateStorageItemCounterBy,\n  queryStorageItems as publicQueryStorageItems,\n  typedQueryStorageItems as publicTypedQueryStorageItems,\n  bulkUpdateStorageItemTags as publicBulkUpdateStorageItemTags,\n  bulkUpdateStorageItemTagsByFilter as publicBulkUpdateStorageItemTagsByFilter,\n} from './automations-storage-v1-storage-item-storage-item.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n  BuildRESTFunction,\n  MaybeContext,\n  BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n  StorageItemQuery,\n  StorageItemsQueryBuilder,\n  typedQueryStorageItems as universalTypedQueryStorageItems,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\nimport { onStorageItemCreated as publicOnStorageItemCreated } from './automations-storage-v1-storage-item-storage-item.public.js';\nimport { onStorageItemCounterUpdated as publicOnStorageItemCounterUpdated } from './automations-storage-v1-storage-item-storage-item.public.js';\nimport { onStorageItemValueUpdated as publicOnStorageItemValueUpdated } from './automations-storage-v1-storage-item-storage-item.public.js';\nimport { onStorageItemTagsModified as publicOnStorageItemTagsModified } from './automations-storage-v1-storage-item-storage-item.public.js';\n\nfunction customQueryStorageItems(httpClient: HttpClient) {\n  const router = /*#__PURE__*/ createQueryOverloadRouter({\n    builderQueryFunction: () => publicQueryStorageItems(httpClient)(),\n    typedQueryFunction: (query: StorageItemQuery) =>\n      publicTypedQueryStorageItems(httpClient)(query),\n    hasOptionsParameter: false,\n  });\n\n  function overloadedQuery(): StorageItemsQueryBuilder;\n  function overloadedQuery(\n    query: StorageItemQuery\n  ): ReturnType<typeof universalTypedQueryStorageItems>;\n  function overloadedQuery(query?: StorageItemQuery): any {\n    return router(...arguments);\n  }\n\n  return overloadedQuery;\n}\n\nexport const createStorageItem: MaybeContext<\n  BuildRESTFunction<typeof publicCreateStorageItem> &\n    typeof publicCreateStorageItem\n> = /*#__PURE__*/ createRESTModule(publicCreateStorageItem);\nexport const getStorageItem: MaybeContext<\n  BuildRESTFunction<typeof publicGetStorageItem> & typeof publicGetStorageItem\n> = /*#__PURE__*/ createRESTModule(publicGetStorageItem);\nexport const updateStorageItemValue: MaybeContext<\n  BuildRESTFunction<typeof publicUpdateStorageItemValue> &\n    typeof publicUpdateStorageItemValue\n> = /*#__PURE__*/ createRESTModule(publicUpdateStorageItemValue);\nexport const updateStorageItemCounterBy: MaybeContext<\n  BuildRESTFunction<typeof publicUpdateStorageItemCounterBy> &\n    typeof publicUpdateStorageItemCounterBy\n> = /*#__PURE__*/ createRESTModule(publicUpdateStorageItemCounterBy);\nexport const bulkUpdateStorageItemTags: MaybeContext<\n  BuildRESTFunction<typeof publicBulkUpdateStorageItemTags> &\n    typeof publicBulkUpdateStorageItemTags\n> = /*#__PURE__*/ createRESTModule(publicBulkUpdateStorageItemTags);\nexport const bulkUpdateStorageItemTagsByFilter: MaybeContext<\n  BuildRESTFunction<typeof publicBulkUpdateStorageItemTagsByFilter> &\n    typeof publicBulkUpdateStorageItemTagsByFilter\n> = /*#__PURE__*/ createRESTModule(publicBulkUpdateStorageItemTagsByFilter);\nexport const queryStorageItems: MaybeContext<\n  BuildRESTFunction<typeof customQueryStorageItems> &\n    typeof customQueryStorageItems\n> = /*#__PURE__*/ createRESTModule(customQueryStorageItems);\n/** */\nexport const onStorageItemCreated: BuildEventDefinition<\n  typeof publicOnStorageItemCreated\n> &\n  typeof publicOnStorageItemCreated = /*#__PURE__*/ createEventModule(\n  publicOnStorageItemCreated\n);\n/** */\nexport const onStorageItemCounterUpdated: BuildEventDefinition<\n  typeof publicOnStorageItemCounterUpdated\n> &\n  typeof publicOnStorageItemCounterUpdated = /*#__PURE__*/ createEventModule(\n  publicOnStorageItemCounterUpdated\n);\n/** */\nexport const onStorageItemValueUpdated: BuildEventDefinition<\n  typeof publicOnStorageItemValueUpdated\n> &\n  typeof publicOnStorageItemValueUpdated = /*#__PURE__*/ createEventModule(\n  publicOnStorageItemValueUpdated\n);\n/** */\nexport const onStorageItemTagsModified: BuildEventDefinition<\n  typeof publicOnStorageItemTagsModified\n> &\n  typeof publicOnStorageItemTagsModified = /*#__PURE__*/ createEventModule(\n  publicOnStorageItemTagsModified\n);\n\nexport {\n  Format,\n  Type,\n  SortOrder,\n  WebhookIdentityType,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\nexport {\n  StorageItem,\n  StorageItemValueOneOf,\n  StringValue,\n  BooleanValue,\n  NumberValue,\n  CounterValue,\n  Tags,\n  TagList,\n  ExtendedFields,\n  StorageItemValueUpdated,\n  StorageItemCounterUpdated,\n  TagsModified,\n  CreateStorageItemRequest,\n  CreateStorageItemResponse,\n  GetStorageItemRequest,\n  GetStorageItemResponse,\n  UpdateStorageItemValueRequest,\n  UpdateStorageItemValueRequestValueOneOf,\n  UpdateStorageItemValueResponse,\n  UpdateStorageItemCounterByRequest,\n  UpdateStorageItemCounterByResponse,\n  QueryStorageItemsRequest,\n  CursorQuery,\n  CursorQueryPagingMethodOneOf,\n  Sorting,\n  CursorPaging,\n  QueryStorageItemsResponse,\n  CursorPagingMetadata,\n  Cursors,\n  BulkUpdateStorageItemTagsRequest,\n  BulkUpdateStorageItemTagsResponse,\n  ItemMetadata,\n  ApplicationError,\n  BulkUpdateStorageItemTagsResult,\n  BulkActionMetadata,\n  BulkUpdateStorageItemTagsByFilterRequest,\n  BulkUpdateStorageItemTagsByFilterResponse,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  StorageItemCreatedEnvelope,\n  StorageItemCounterUpdatedEnvelope,\n  StorageItemValueUpdatedEnvelope,\n  StorageItemTagsModifiedEnvelope,\n  GetStorageItemOptions,\n  UpdateStorageItemValueOptions,\n  UpdateStorageItemValueOptionsValueOneOf,\n  StorageItemsQueryResult,\n  StorageItemsQueryBuilder,\n  StorageItemQuerySpec,\n  BulkUpdateStorageItemTagsOptions,\n  BulkUpdateStorageItemTagsByFilterOptions,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\nexport { utils } from './automations-storage-v1-storage-item-storage-item.universal.js';\nexport {\n  FormatWithLiterals,\n  TypeWithLiterals,\n  SortOrderWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n  CreateStorageItemApplicationErrors,\n  UpdateStorageItemValueApplicationErrors,\n  UpdateStorageItemCounterByApplicationErrors,\n  BulkUpdateStorageItemTagsApplicationErrors,\n  BulkUpdateStorageItemTagsByFilterApplicationErrors,\n  CommonQueryWithEntityContext,\n  StorageItemQuery,\n} from './automations-storage-v1-storage-item-storage-item.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,IAAM,oBAAoB;AAAA,EACxB,EA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;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAmC;;;AGpYnC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAOlC,SAAS,iCAAiC;AAW1C,SAAS,wBAAwB,YAAwB;AACvD,QAAM,SAAuB,0CAA0B;AAAA,IACrD,sBAAsB,MAAMG,mBAAwB,UAAU,EAAE;AAAA,IAChE,oBAAoB,CAAC,UACnBC,wBAA6B,UAAU,EAAE,KAAK;AAAA,IAChD,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA+B;AACtD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,qBAGK,iCAAiBA,kBAAuB;AACnD,IAAMC,kBAEK,iCAAiBA,eAAoB;AAChD,IAAMC,0BAGK,iCAAiBA,uBAA4B;AACxD,IAAMC,8BAGK,iCAAiBA,2BAAgC;AAC5D,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,qCAGK,iCAAiBA,kCAAuC;AACnE,IAAMP,qBAGK,iCAAiB,uBAAuB;AAEnD,IAAMQ,wBAGuC;AAAA,EAClD;AACF;AAEO,IAAMC,+BAG8C;AAAA,EACzD;AACF;AAEO,IAAMC,6BAG4C;AAAA,EACvD;AACF;AAEO,IAAMC,6BAG4C;AAAA,EACvD;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","transformPaths","Format","Type","SortOrder","WebhookIdentityType","createStorageItem","getStorageItem","updateStorageItemValue","updateStorageItemCounterBy","queryStorageItems","bulkUpdateStorageItemTags","bulkUpdateStorageItemTagsByFilter","TRANSFORM_PATHS_0","TRANSFORM_PATHS_1","createStorageItem","getStorageItem","updateStorageItemValue","updateStorageItemCounterBy","queryStorageItems","typedQueryStorageItems","bulkUpdateStorageItemTags","bulkUpdateStorageItemTagsByFilter","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","TRANSFORM_PATHS_0","TRANSFORM_PATHS_1","queryStorageItems","typedQueryStorageItems","createStorageItem","getStorageItem","updateStorageItemValue","updateStorageItemCounterBy","bulkUpdateStorageItemTags","bulkUpdateStorageItemTagsByFilter","onStorageItemCreated","onStorageItemCounterUpdated","onStorageItemValueUpdated","onStorageItemTagsModified"]}