{"version":3,"sources":["../../../src/platform-v1-wishlist-wishlist.universal.ts","../../../src/platform-v1-wishlist-wishlist.http.ts","../../../src/platform-v1-wishlist-wishlist.public.ts","../../../src/platform-v1-wishlist-wishlist.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixPlatformV1Wishlist from './platform-v1-wishlist-wishlist.http.js';\n\nexport interface WishlistData {\n  /**\n   * GUID unique to this list for this site\n   * @format GUID\n   */\n  _id?: string | null;\n  /** Member id the list belongs to */\n  ownerId?: string;\n  /**\n   * List of items in the list. Not necessarily the full list (can depends on request data)\n   * @minSize 1\n   * @maxSize 100\n   */\n  items?: WishlistItem[];\n  /**\n   * Total count of items in the list\n   * @min 1\n   * @max 100\n   */\n  totalCount?: number;\n}\n\nexport interface WishlistItem {\n  /** Unique identifier for an item of this type and origin */\n  _id?: string;\n  /**\n   * The data the item was save to the list\n   * @readonly\n   */\n  dateAdded?: Date | null;\n  /** The type of the item. For example \"product\" */\n  type?: string;\n  /** The origin of the item. Should be the scope the item type is related to. For example \"wixstores\" */\n  origin?: string;\n}\n\nexport interface ItemsAddedToWishlist {\n  /**\n   * GUID unique to this list for its site\n   * @format GUID\n   */\n  _id?: string | null;\n  /** Member id the list belongs to */\n  ownerId?: string;\n  /**\n   * List of items that were added to wishlist\n   * @minSize 1\n   * @maxSize 100\n   */\n  items?: WishlistItem[];\n}\n\nexport interface ItemsRemovedFromWishlist {\n  /**\n   * GUID unique to this list for its site\n   * @format GUID\n   */\n  _id?: string | null;\n  /** Member id the list belongs to */\n  ownerId?: string;\n  /**\n   * List of items that were removed from wishlist\n   * @minSize 1\n   * @maxSize 100\n   */\n  items?: WishlistItem[];\n}\n\nexport interface GetWishlistRequest {\n  /**\n   * List length limit. Default is 100\n   * @min 1\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * List starting index offset. Default is 0\n   * @max 100\n   */\n  offset?: number | null;\n  /** Filter requested list by specific kinds of items */\n  kind?: WishlistItemKind[];\n}\n\nexport interface WishlistItemKind {\n  /** The type of the item. For example \"product\" */\n  type?: string;\n  /** The origin of the item. Should be the scope the item type is related to. For example \"wixstores\" */\n  origin?: string;\n}\n\nexport interface GetWishlistResponse {\n  /** Object containing requested list data */\n  wishlist?: WishlistData;\n}\n\nexport interface AddToWishlistRequest {\n  /**\n   * List of items to add to list\n   * @minSize 1\n   * @maxSize 100\n   */\n  items?: WishlistItem[];\n}\n\nexport interface AddToWishlistResponse {}\n\nexport interface RemoveFromWishlistRequest {\n  /**\n   * List of items to remove from list\n   * @minSize 1\n   * @maxSize 100\n   */\n  items?: WishlistItem[];\n}\n\nexport interface RemoveFromWishlistResponse {}\n\nexport interface GetWishlistByIdRequest {\n  /**\n   * Unique identifier representing requested list\n   * @format GUID\n   */\n  _id: string;\n  /**\n   * List length limit. Default is 100\n   * @min 1\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * List starting index offset. Default is 0\n   * @max 100\n   */\n  offset?: number | null;\n  /** Filter requested list by specific kinds of items */\n  kind?: WishlistItemKind[];\n}\n\nexport interface GetWishlistByIdResponse {\n  /** Object containing requested list data */\n  wishlist?: WishlistData;\n}\n\nexport interface GetWishlistsRequest {\n  /**\n   * List length limit. Default is 100\n   * @min 1\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * List starting index offset. Default is 0\n   * @max 100\n   */\n  offset?: number | null;\n}\n\nexport interface GetWishlistsResponse {\n  /** List result of requested wishlists */\n  wishlists?: WishlistData[];\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/**\n * Get wishlist by id\n * @param _id - Unique identifier representing requested list\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @permissionId WISHLIST.MANAGE-SITE-WISHLISTS\n * @applicableIdentity APP\n * @returns Object containing requested list data\n * @fqn com.wixpress.wishlist.Wishlist.GetWishlistById\n */\nexport async function getWishlistById(\n  _id: string,\n  options?: GetWishlistByIdOptions\n): Promise<\n  NonNullablePaths<\n    WishlistData,\n    | `ownerId`\n    | `items`\n    | `items.${number}._id`\n    | `items.${number}.type`\n    | `items.${number}.origin`\n    | `totalCount`,\n    4\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    id: _id,\n    limit: options?.limit,\n    offset: options?.offset,\n    kind: options?.kind,\n  });\n\n  const reqOpts = ambassadorWixPlatformV1Wishlist.getWishlistById(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)?.wishlist!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          id: '$[0]',\n          limit: '$[1].limit',\n          offset: '$[1].offset',\n          kind: '$[1].kind',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['_id', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetWishlistByIdOptions {\n  /**\n   * List length limit. Default is 100\n   * @min 1\n   * @max 100\n   */\n  limit?: number | null;\n  /**\n   * List starting index offset. Default is 0\n   * @max 100\n   */\n  offset?: number | null;\n  /** Filter requested list by specific kinds of items */\n  kind?: WishlistItemKind[];\n}\n","import { 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\nfunction resolveComWixpressWishlistWishlistUrl(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'bo._base_domain_': [\n      {\n        srcPath: '/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'wixbo.ai': [\n      {\n        srcPath: '/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'wix-bo.com': [\n      {\n        srcPath: '/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'api._api_base_domain_': [\n      {\n        srcPath: '/wishlist-server',\n        destPath: '',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'ecom._base_domain_': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '/api',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/stores/v1/wishlists',\n        destPath: '/v1/wishlists',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/wishlist-server',\n        destPath: '',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_wishlist';\n\n/** Get wishlist by id */\nexport function getWishlistById(payload: object): RequestOptionsFactory<any> {\n  function __getWishlistById({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.platform.v1.wishlist',\n      method: 'POST' as any,\n      methodFqn: 'com.wixpress.wishlist.Wishlist.GetWishlistById',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressWishlistWishlistUrl({\n        protoPath: '/v1/wishlists/get',\n        data: payload,\n        host,\n      }),\n      data: payload,\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [{ path: 'wishlist.items.dateAdded' }],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getWishlistById;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n  GetWishlistByIdOptions,\n  WishlistData,\n  getWishlistById as universalGetWishlistById,\n} from './platform-v1-wishlist-wishlist.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/stores' };\n\nexport function getWishlistById(\n  httpClient: HttpClient\n): GetWishlistByIdSignature {\n  return (_id: string, options?: GetWishlistByIdOptions) =>\n    universalGetWishlistById(\n      _id,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetWishlistByIdSignature {\n  /**\n   * Get wishlist by id\n   * @param - Unique identifier representing requested list\n   * @returns Object containing requested list data\n   */\n  (_id: string, options?: GetWishlistByIdOptions): Promise<\n    NonNullablePaths<\n      WishlistData,\n      | `ownerId`\n      | `items`\n      | `items.${number}._id`\n      | `items.${number}.type`\n      | `items.${number}.origin`\n      | `totalCount`,\n      4\n    >\n  >;\n}\n\nexport {\n  AccountInfo,\n  AddToWishlistRequest,\n  AddToWishlistResponse,\n  GetWishlistByIdOptions,\n  GetWishlistByIdRequest,\n  GetWishlistByIdResponse,\n  GetWishlistRequest,\n  GetWishlistResponse,\n  GetWishlistsRequest,\n  GetWishlistsResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ItemsAddedToWishlist,\n  ItemsRemovedFromWishlist,\n  MessageEnvelope,\n  RemoveFromWishlistRequest,\n  RemoveFromWishlistResponse,\n  WebhookIdentityType,\n  WishlistData,\n  WishlistItem,\n  WishlistItemKind,\n} from './platform-v1-wishlist-wishlist.universal.js';\n","import { getWishlistById as publicGetWishlistById } from './platform-v1-wishlist-wishlist.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getWishlistById: MaybeContext<\n  BuildRESTFunction<typeof publicGetWishlistById> & typeof publicGetWishlistById\n> = /*#__PURE__*/ createRESTModule(publicGetWishlistById);\n\nexport { WebhookIdentityType } from './platform-v1-wishlist-wishlist.universal.js';\nexport {\n  WishlistData,\n  WishlistItem,\n  ItemsAddedToWishlist,\n  ItemsRemovedFromWishlist,\n  GetWishlistRequest,\n  WishlistItemKind,\n  GetWishlistResponse,\n  AddToWishlistRequest,\n  AddToWishlistResponse,\n  RemoveFromWishlistRequest,\n  RemoveFromWishlistResponse,\n  GetWishlistByIdRequest,\n  GetWishlistByIdResponse,\n  GetWishlistsRequest,\n  GetWishlistsResponse,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  GetWishlistByIdOptions,\n} from './platform-v1-wishlist-wishlist.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './platform-v1-wishlist-wishlist.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,sCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ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