@wix/auto_sdk_stores_collections 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -1
- package/build/cjs/index.js +8 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -1
- package/build/cjs/index.typings.js +8 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +6 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +7 -1
- package/build/es/index.typings.mjs +6 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js +8 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +7 -1
- package/build/internal/cjs/index.typings.js +8 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs +6 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +7 -1
- package/build/internal/es/index.typings.mjs +6 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
2
|
import { Collection, GetCollectionBySlugResponse, CollectionsQueryBuilder, CollectionQuery, typedQueryCollections } from './index.typings.js';
|
|
3
|
-
export { CollectionQuerySpec, CollectionsQueryResult, CommonQueryWithEntityContext, CursorPaging, Cursors, GetCollectionBySlugRequest, GetCollectionRequest, GetCollectionResponse, Keyword, Media, MediaItem, MediaItemItemOneOf, MediaItemType, MediaItemTypeWithLiterals, MediaItemUrlAndSize, MediaItemVideo, PlatformPaging, PlatformPagingMetadata, PlatformQuery, PlatformQueryPagingMethodOneOf, QueryCollectionsRequest, QueryCollectionsResponse, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Tag } from './index.typings.js';
|
|
3
|
+
export { CollectionQuerySpec, CollectionsQueryResult, CommonQueryWithEntityContext, CursorPaging, Cursors, GetCollectionBySlugRequest, GetCollectionRequest, GetCollectionResponse, Keyword, Media, MediaItem, MediaItemItemOneOf, MediaItemType, MediaItemTypeWithLiterals, MediaItemUrlAndSize, MediaItemVideo, PlatformPaging, PlatformPagingMetadata, PlatformQuery, PlatformQueryPagingMethodOneOf, QueryCollectionsRequest, QueryCollectionsResponse, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Tag, utils } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function getCollection$1(httpClient: HttpClient): GetCollectionSignature;
|
|
6
6
|
interface GetCollectionSignature {
|
package/build/cjs/index.js
CHANGED
|
@@ -24,7 +24,8 @@ __export(index_exports, {
|
|
|
24
24
|
SortOrder: () => SortOrder,
|
|
25
25
|
getCollection: () => getCollection4,
|
|
26
26
|
getCollectionBySlug: () => getCollectionBySlug4,
|
|
27
|
-
queryCollections: () => queryCollections4
|
|
27
|
+
queryCollections: () => queryCollections4,
|
|
28
|
+
utils: () => utils
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(index_exports);
|
|
30
31
|
|
|
@@ -195,6 +196,7 @@ function getCollectionBySlug(payload) {
|
|
|
195
196
|
|
|
196
197
|
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
197
198
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
199
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
198
200
|
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
199
201
|
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
200
202
|
MediaItemType2["image"] = "image";
|
|
@@ -275,6 +277,9 @@ async function typedQueryCollections(query) {
|
|
|
275
277
|
throw transformedError;
|
|
276
278
|
}
|
|
277
279
|
}
|
|
280
|
+
var utils = {
|
|
281
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
282
|
+
};
|
|
278
283
|
async function getCollection2(_id) {
|
|
279
284
|
const { httpClient, sideEffects } = arguments[1];
|
|
280
285
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
@@ -374,6 +379,7 @@ var queryCollections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModul
|
|
|
374
379
|
SortOrder,
|
|
375
380
|
getCollection,
|
|
376
381
|
getCollectionBySlug,
|
|
377
|
-
queryCollections
|
|
382
|
+
queryCollections,
|
|
383
|
+
utils
|
|
378
384
|
});
|
|
379
385
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/stores-catalog-v1-collection-collections.universal.ts","../../src/stores-catalog-v1-collection-collections.http.ts","../../src/stores-catalog-v1-collection-collections.public.ts","../../src/stores-catalog-v1-collection-collections.context.ts"],"sourcesContent":["export * from './src/stores-catalog-v1-collection-collections.context.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 ambassadorWixStoresCatalogV1Collection from './stores-catalog-v1-collection-collections.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Collection {\n /**\n * Collection ID (generated automatically by the catalog).\n * @minLength 35\n * @maxLength 36\n * @readonly\n */\n _id?: string | null;\n /**\n * Collection name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /**\n * Media items (images, videos etc) associated with this collection. Read only.\n * @readonly\n */\n media?: Media;\n /**\n * Number of products in the collection. Read only.\n * @readonly\n */\n numberOfProducts?: number;\n /**\n * Collection description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Collection slug.\n * @minLength 1\n * @maxLength 100\n */\n slug?: string | null;\n /** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */\n visible?: boolean | null;\n /**\n * Date and time the collection was updated.\n * @internal\n * @readonly\n */\n lastUpdated?: Date | null;\n}\n\nexport interface Media {\n /** Primary media (image, video etc) associated with this product. */\n mainMedia?: MediaItem;\n /** Media (images, videos etc) associated with this product. */\n items?: MediaItem[];\n}\n\nexport interface MediaItem extends MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n /** Media item thumbnail details. */\n thumbnail?: MediaItemUrlAndSize;\n /** Media item type (image, video, etc.). */\n mediaType?: MediaItemTypeWithLiterals;\n /** Media item title. */\n title?: string;\n /** Media ID (for example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`). */\n _id?: string;\n}\n\n/** @oneof */\nexport interface MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n}\n\nexport interface MediaItemUrlAndSize {\n /**\n * Media item URL.\n * @format WEB_URL\n */\n url?: string;\n /** Media item width. */\n width?: number;\n /** Media item height. */\n height?: number;\n /** Media format (mp4, png, etc.). */\n format?: string | null;\n /** Alt text. This text will be shown in case the image is not available. */\n altText?: string | null;\n}\n\nexport enum MediaItemType {\n unspecified_media_item_type = 'unspecified_media_item_type',\n /** Image media type. */\n image = 'image',\n /** Video media type. */\n video = 'video',\n /** Audio media type. */\n audio = 'audio',\n /** Document media type. */\n document = 'document',\n /** Zip media type. */\n zip = 'zip',\n}\n\n/** @enumType */\nexport type MediaItemTypeWithLiterals =\n | MediaItemType\n | 'unspecified_media_item_type'\n | 'image'\n | 'video'\n | 'audio'\n | 'document'\n | 'zip';\n\nexport interface MediaItemVideo {\n /** Data (URL, size) about each resolution for which this video is available. */\n files?: MediaItemUrlAndSize[];\n /** ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`. */\n stillFrameMediaId?: string;\n}\n\n/**\n * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.\n * The search engines use this information for ranking purposes, or to display snippets in the search results.\n * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.\n */\nexport interface SeoSchema {\n /** SEO tag information. */\n tags?: Tag[];\n /** SEO general settings. */\n settings?: Settings;\n}\n\nexport interface Keyword {\n /** Keyword value. */\n term?: string;\n /** Whether the keyword is the main focus keyword. */\n isMain?: boolean;\n /**\n * The source that added the keyword terms to the SEO settings.\n * @maxLength 1000\n */\n origin?: string | null;\n}\n\nexport interface Tag {\n /**\n * SEO tag type.\n *\n *\n * Supported values: `title`, `meta`, `script`, `link`.\n */\n type?: string;\n /**\n * A `{\"key\": \"value\"}` pair object where each SEO tag property (`\"name\"`, `\"content\"`, `\"rel\"`, `\"href\"`) contains a value.\n * For example: `{\"name\": \"description\", \"content\": \"the description itself\"}`.\n */\n props?: Record<string, any> | null;\n /** SEO tag metadata. For example, `{\"height\": 300, \"width\": 240}`. */\n meta?: Record<string, any> | null;\n /** SEO tag inner content. For example, `<title> inner content </title>`. */\n children?: string;\n /** Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). */\n custom?: boolean;\n /** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */\n disabled?: boolean;\n}\n\nexport interface Settings {\n /**\n * Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.\n *\n *\n * Default: `false` (automatical redirect is enabled).\n */\n preventAutoRedirect?: boolean;\n /**\n * User-selected keyword terms for a specific page.\n * @maxSize 5\n */\n keywords?: Keyword[];\n}\n\nexport interface QueryCollectionsRequest {\n query?: PlatformQuery;\n}\n\nexport interface PlatformQuery extends PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /** Filter object. */\n filter?: Record<string, any> | null;\n /** Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\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 PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryCollectionsResponse {\n /** @maxSize 100 */\n collections?: Collection[];\n metadata?: PlatformPagingMetadata;\n}\n\nexport interface PlatformPagingMetadata {\n /** The number of items returned in this response. */\n count?: number | null;\n /** The offset which was requested. Returned if offset paging was used. */\n offset?: number | null;\n /** The total number of items that match the query. Returned if offset paging was used. */\n total?: number | null;\n /** Cursors to navigate through result pages. Returned if cursor paging was used. */\n cursors?: Cursors;\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 GetCollectionRequest {\n /** Requested collection ID. */\n _id: string;\n}\n\nexport interface GetCollectionResponse {\n collection?: Collection;\n}\n\nexport interface GetCollectionBySlugRequest {\n /**\n * Slug of the collection to retrieve.\n * @minLength 1\n * @maxLength 100\n */\n slug: string;\n}\n\nexport interface GetCollectionBySlugResponse {\n /** The requested collection. */\n collection?: Collection;\n}\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n * @public\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n */\nexport function queryCollections(): CollectionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Collection,\n 'OFFSET',\n QueryCollectionsRequest,\n QueryCollectionsResponse\n >({\n func: async (payload: QueryCollectionsRequest) => {\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.queryCollections(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: QueryCollectionsRequest['query']) => {\n const args = [query, {}] as [QueryCollectionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryCollectionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.collections,\n pagingMetadata: transformedData?.metadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface CollectionsQueryResult extends QueryOffsetResult {\n items: Collection[];\n query: CollectionsQueryBuilder;\n next: () => Promise<CollectionsQueryResult>;\n prev: () => Promise<CollectionsQueryResult>;\n}\n\nexport interface CollectionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'name',\n value: string\n ) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_id' | 'name',\n value: any[]\n ) => CollectionsQueryBuilder;\n in: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n exists: (\n propertyName: '_id' | 'name',\n value: boolean\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => CollectionsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => CollectionsQueryBuilder;\n find: () => Promise<CollectionsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n * @requiredField query\n */\nexport async function typedQueryCollections(\n query: CollectionQuery\n): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\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 ambassadorWixStoresCatalogV1Collection.queryCollections(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 CollectionQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['_id', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Collection,\n CollectionQuerySpec\n>;\nexport type CollectionQuery = {\n /** \n Pointer to page of results using offset. Cannot be used together with `cursorPaging`. \n */\n paging?: {\n /** \n Number of items to load. \n @max: 100 \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n\n /** \n Filter object. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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\n/**\n * Retrieves a collection with the provided ID.\n * @param _id - Requested collection ID.\n * @public\n * @requiredField _id\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollection\n */\nexport async function getCollection(\n _id: string\n): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts = ambassadorWixStoresCatalogV1Collection.getCollection(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a collection with the provided slug.\n * @param slug - Slug of the collection to retrieve.\n * @public\n * @requiredField slug\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug\n */\nexport async function getCollectionBySlug(\n slug: string\n): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ slug: slug });\n\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.getCollectionBySlug(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: { slug: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['slug']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nfunction resolveWixCatalogApiV2CollectionReadApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_collections';\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\nexport function queryCollections(payload: object): RequestOptionsFactory<any> {\n function __queryCollections({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.QueryCollections',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/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: [{ path: 'collections.lastUpdated' }],\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryCollections;\n}\n\n/** Retrieves a collection with the provided ID. */\nexport function getCollection(payload: object): RequestOptionsFactory<any> {\n function __getCollection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollection;\n}\n\n/** Retrieves a collection with the provided slug. */\nexport function getCollectionBySlug(\n payload: object\n): RequestOptionsFactory<any> {\n function __getCollectionBySlug({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/slug/{slug}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollectionBySlug;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Collection,\n CollectionQuery,\n CollectionsQueryBuilder,\n GetCollectionBySlugResponse,\n QueryCollectionsResponse,\n getCollection as universalGetCollection,\n getCollectionBySlug as universalGetCollectionBySlug,\n queryCollections as universalQueryCollections,\n typedQueryCollections as universalTypedQueryCollections,\n} from './stores-catalog-v1-collection-collections.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/stores' };\n\nexport function queryCollections(\n httpClient: HttpClient\n): QueryCollectionsSignature {\n return () =>\n universalQueryCollections(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryCollectionsSignature {\n /**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\n (): CollectionsQueryBuilder;\n}\n\nexport function typedQueryCollections(\n httpClient: HttpClient\n): TypedQueryCollectionsSignature {\n return (query: CollectionQuery) =>\n universalTypedQueryCollections(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryCollectionsSignature {\n /** */\n (query: CollectionQuery): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\n >\n >;\n}\n\nexport function getCollection(httpClient: HttpClient): GetCollectionSignature {\n return (_id: string) =>\n universalGetCollection(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCollectionSignature {\n /**\n * Retrieves a collection with the provided ID.\n * @param - Requested collection ID.\n */\n (_id: string): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n >;\n}\n\nexport function getCollectionBySlug(\n httpClient: HttpClient\n): GetCollectionBySlugSignature {\n return (slug: string) =>\n universalGetCollectionBySlug(\n slug,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCollectionBySlugSignature {\n /**\n * Retrieves a collection with the provided slug.\n * @param - Slug of the collection to retrieve.\n */\n (slug: string): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n >;\n}\n\nexport {\n Collection,\n CollectionQuerySpec,\n CollectionsQueryBuilder,\n CollectionsQueryResult,\n CursorPaging,\n Cursors,\n GetCollectionBySlugRequest,\n GetCollectionBySlugResponse,\n GetCollectionRequest,\n GetCollectionResponse,\n Keyword,\n Media,\n MediaItem,\n MediaItemItemOneOf,\n MediaItemType,\n MediaItemUrlAndSize,\n MediaItemVideo,\n PlatformPaging,\n PlatformPagingMetadata,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n QueryCollectionsRequest,\n QueryCollectionsResponse,\n SeoSchema,\n Settings,\n SortOrder,\n Sorting,\n Tag,\n} from './stores-catalog-v1-collection-collections.universal.js';\n","import {\n queryCollections as publicQueryCollections,\n typedQueryCollections as publicTypedQueryCollections,\n getCollection as publicGetCollection,\n getCollectionBySlug as publicGetCollectionBySlug,\n} from './stores-catalog-v1-collection-collections.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n CollectionQuery,\n CollectionsQueryBuilder,\n typedQueryCollections as universalTypedQueryCollections,\n} from './stores-catalog-v1-collection-collections.universal.js';\n\nfunction customQueryCollections(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryCollections(httpClient)(),\n typedQueryFunction: (query: CollectionQuery) =>\n publicTypedQueryCollections(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): CollectionsQueryBuilder;\n function overloadedQuery(\n query: CollectionQuery\n ): ReturnType<typeof universalTypedQueryCollections>;\n function overloadedQuery(query?: CollectionQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getCollection: MaybeContext<\n BuildRESTFunction<typeof publicGetCollection> & typeof publicGetCollection\n> = /*#__PURE__*/ createRESTModule(publicGetCollection);\nexport const getCollectionBySlug: MaybeContext<\n BuildRESTFunction<typeof publicGetCollectionBySlug> &\n typeof publicGetCollectionBySlug\n> = /*#__PURE__*/ createRESTModule(publicGetCollectionBySlug);\nexport const queryCollections: MaybeContext<\n BuildRESTFunction<typeof customQueryCollections> &\n typeof customQueryCollections\n> = /*#__PURE__*/ createRESTModule(customQueryCollections);\n\nexport {\n MediaItemType,\n SortOrder,\n} from './stores-catalog-v1-collection-collections.universal.js';\nexport {\n Collection,\n Media,\n MediaItem,\n MediaItemItemOneOf,\n MediaItemUrlAndSize,\n MediaItemVideo,\n SeoSchema,\n Keyword,\n Tag,\n Settings,\n QueryCollectionsRequest,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n Sorting,\n PlatformPaging,\n CursorPaging,\n QueryCollectionsResponse,\n PlatformPagingMetadata,\n Cursors,\n GetCollectionRequest,\n GetCollectionResponse,\n GetCollectionBySlugRequest,\n GetCollectionBySlugResponse,\n CollectionsQueryResult,\n CollectionsQueryBuilder,\n CollectionQuerySpec,\n} from './stores-catalog-v1-collection-collections.universal.js';\nexport {\n MediaItemTypeWithLiterals,\n SortOrderWithLiterals,\n CommonQueryWithEntityContext,\n CollectionQuery,\n} from './stores-catalog-v1-collection-collections.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,wBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,2CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kB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,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,MAAM,OAAO;AAAA,QACzC,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,MAAM;AAAA,IACT;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEzpBO,SAASG,kBACd,YAC2B;AAC3B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,UACN;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAiBO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,QACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAyBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,SACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9FA,IAAAC,uBAAiC;AAGjC,iCAA0C;AAO1C,SAAS,uBAAuB,YAAwB;AACtD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,MAAMC,kBAAuB,UAAU,EAAE;AAAA,IAC/D,oBAAoB,CAAC,UACnBC,uBAA4B,UAAU,EAAE,KAAK;AAAA,IAC/C,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA8B;AACrD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMH,oBAGK,2DAAiB,sBAAsB;","names":["getCollection","getCollectionBySlug","queryCollections","import_rest_modules","payload","import_transform_paths","MediaItemType","SortOrder","queryCollections","sdkTransformError","getCollection","getCollectionBySlug","queryCollections","typedQueryCollections","getCollection","getCollectionBySlug","import_rest_modules","queryCollections","typedQueryCollections","getCollection","getCollectionBySlug"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/stores-catalog-v1-collection-collections.universal.ts","../../src/stores-catalog-v1-collection-collections.http.ts","../../src/stores-catalog-v1-collection-collections.public.ts","../../src/stores-catalog-v1-collection-collections.context.ts"],"sourcesContent":["export * from './src/stores-catalog-v1-collection-collections.context.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 ambassadorWixStoresCatalogV1Collection from './stores-catalog-v1-collection-collections.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface Collection {\n /**\n * Collection ID (generated automatically by the catalog).\n * @minLength 35\n * @maxLength 36\n * @readonly\n */\n _id?: string | null;\n /**\n * Collection name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /**\n * Media items (images, videos etc) associated with this collection. Read only.\n * @readonly\n */\n media?: Media;\n /**\n * Number of products in the collection. Read only.\n * @readonly\n */\n numberOfProducts?: number;\n /**\n * Collection description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Collection slug.\n * @minLength 1\n * @maxLength 100\n */\n slug?: string | null;\n /** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */\n visible?: boolean | null;\n /**\n * Date and time the collection was updated.\n * @internal\n * @readonly\n */\n lastUpdated?: Date | null;\n}\n\nexport interface Media {\n /** Primary media (image, video etc) associated with this product. */\n mainMedia?: MediaItem;\n /** Media (images, videos etc) associated with this product. */\n items?: MediaItem[];\n}\n\nexport interface MediaItem extends MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n /** Media item thumbnail details. */\n thumbnail?: MediaItemUrlAndSize;\n /** Media item type (image, video, etc.). */\n mediaType?: MediaItemTypeWithLiterals;\n /** Media item title. */\n title?: string;\n /** Media ID (for example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`). */\n _id?: string;\n}\n\n/** @oneof */\nexport interface MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n}\n\nexport interface MediaItemUrlAndSize {\n /**\n * Media item URL.\n * @format WEB_URL\n */\n url?: string;\n /** Media item width. */\n width?: number;\n /** Media item height. */\n height?: number;\n /** Media format (mp4, png, etc.). */\n format?: string | null;\n /** Alt text. This text will be shown in case the image is not available. */\n altText?: string | null;\n}\n\nexport enum MediaItemType {\n unspecified_media_item_type = 'unspecified_media_item_type',\n /** Image media type. */\n image = 'image',\n /** Video media type. */\n video = 'video',\n /** Audio media type. */\n audio = 'audio',\n /** Document media type. */\n document = 'document',\n /** Zip media type. */\n zip = 'zip',\n}\n\n/** @enumType */\nexport type MediaItemTypeWithLiterals =\n | MediaItemType\n | 'unspecified_media_item_type'\n | 'image'\n | 'video'\n | 'audio'\n | 'document'\n | 'zip';\n\nexport interface MediaItemVideo {\n /** Data (URL, size) about each resolution for which this video is available. */\n files?: MediaItemUrlAndSize[];\n /** ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`. */\n stillFrameMediaId?: string;\n}\n\n/**\n * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.\n * The search engines use this information for ranking purposes, or to display snippets in the search results.\n * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.\n */\nexport interface SeoSchema {\n /** SEO tag information. */\n tags?: Tag[];\n /** SEO general settings. */\n settings?: Settings;\n}\n\nexport interface Keyword {\n /** Keyword value. */\n term?: string;\n /** Whether the keyword is the main focus keyword. */\n isMain?: boolean;\n /**\n * The source that added the keyword terms to the SEO settings.\n * @maxLength 1000\n */\n origin?: string | null;\n}\n\nexport interface Tag {\n /**\n * SEO tag type.\n *\n *\n * Supported values: `title`, `meta`, `script`, `link`.\n */\n type?: string;\n /**\n * A `{\"key\": \"value\"}` pair object where each SEO tag property (`\"name\"`, `\"content\"`, `\"rel\"`, `\"href\"`) contains a value.\n * For example: `{\"name\": \"description\", \"content\": \"the description itself\"}`.\n */\n props?: Record<string, any> | null;\n /** SEO tag metadata. For example, `{\"height\": 300, \"width\": 240}`. */\n meta?: Record<string, any> | null;\n /** SEO tag inner content. For example, `<title> inner content </title>`. */\n children?: string;\n /** Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). */\n custom?: boolean;\n /** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */\n disabled?: boolean;\n}\n\nexport interface Settings {\n /**\n * Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.\n *\n *\n * Default: `false` (automatical redirect is enabled).\n */\n preventAutoRedirect?: boolean;\n /**\n * User-selected keyword terms for a specific page.\n * @maxSize 5\n */\n keywords?: Keyword[];\n}\n\nexport interface QueryCollectionsRequest {\n query?: PlatformQuery;\n}\n\nexport interface PlatformQuery extends PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /** Filter object. */\n filter?: Record<string, any> | null;\n /** Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\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 PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryCollectionsResponse {\n /** @maxSize 100 */\n collections?: Collection[];\n metadata?: PlatformPagingMetadata;\n}\n\nexport interface PlatformPagingMetadata {\n /** The number of items returned in this response. */\n count?: number | null;\n /** The offset which was requested. Returned if offset paging was used. */\n offset?: number | null;\n /** The total number of items that match the query. Returned if offset paging was used. */\n total?: number | null;\n /** Cursors to navigate through result pages. Returned if cursor paging was used. */\n cursors?: Cursors;\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 GetCollectionRequest {\n /** Requested collection ID. */\n _id: string;\n}\n\nexport interface GetCollectionResponse {\n collection?: Collection;\n}\n\nexport interface GetCollectionBySlugRequest {\n /**\n * Slug of the collection to retrieve.\n * @minLength 1\n * @maxLength 100\n */\n slug: string;\n}\n\nexport interface GetCollectionBySlugResponse {\n /** The requested collection. */\n collection?: Collection;\n}\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n * @public\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n */\nexport function queryCollections(): CollectionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Collection,\n 'OFFSET',\n QueryCollectionsRequest,\n QueryCollectionsResponse\n >({\n func: async (payload: QueryCollectionsRequest) => {\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.queryCollections(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: QueryCollectionsRequest['query']) => {\n const args = [query, {}] as [QueryCollectionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryCollectionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.collections,\n pagingMetadata: transformedData?.metadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface CollectionsQueryResult extends QueryOffsetResult {\n items: Collection[];\n query: CollectionsQueryBuilder;\n next: () => Promise<CollectionsQueryResult>;\n prev: () => Promise<CollectionsQueryResult>;\n}\n\nexport interface CollectionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'name',\n value: string\n ) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_id' | 'name',\n value: any[]\n ) => CollectionsQueryBuilder;\n in: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n exists: (\n propertyName: '_id' | 'name',\n value: boolean\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => CollectionsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => CollectionsQueryBuilder;\n find: () => Promise<CollectionsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n * @requiredField query\n */\nexport async function typedQueryCollections(\n query: CollectionQuery\n): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\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 ambassadorWixStoresCatalogV1Collection.queryCollections(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 CollectionQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['_id', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Collection,\n CollectionQuerySpec\n>;\nexport type CollectionQuery = {\n /** \n Pointer to page of results using offset. Cannot be used together with `cursorPaging`. \n */\n paging?: {\n /** \n Number of items to load. \n @max: 100 \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n\n /** \n Filter object. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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 ...createQueryUtils<Collection, CollectionQuerySpec, CollectionQuery>(),\n};\n\n/**\n * Retrieves a collection with the provided ID.\n * @param _id - Requested collection ID.\n * @public\n * @requiredField _id\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollection\n */\nexport async function getCollection(\n _id: string\n): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts = ambassadorWixStoresCatalogV1Collection.getCollection(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a collection with the provided slug.\n * @param slug - Slug of the collection to retrieve.\n * @public\n * @requiredField slug\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug\n */\nexport async function getCollectionBySlug(\n slug: string\n): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ slug: slug });\n\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.getCollectionBySlug(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: { slug: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['slug']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nfunction resolveWixCatalogApiV2CollectionReadApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_collections';\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\nexport function queryCollections(payload: object): RequestOptionsFactory<any> {\n function __queryCollections({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.QueryCollections',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/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: [{ path: 'collections.lastUpdated' }],\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryCollections;\n}\n\n/** Retrieves a collection with the provided ID. */\nexport function getCollection(payload: object): RequestOptionsFactory<any> {\n function __getCollection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollection;\n}\n\n/** Retrieves a collection with the provided slug. */\nexport function getCollectionBySlug(\n payload: object\n): RequestOptionsFactory<any> {\n function __getCollectionBySlug({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/slug/{slug}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollectionBySlug;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Collection,\n CollectionQuery,\n CollectionsQueryBuilder,\n GetCollectionBySlugResponse,\n QueryCollectionsResponse,\n getCollection as universalGetCollection,\n getCollectionBySlug as universalGetCollectionBySlug,\n queryCollections as universalQueryCollections,\n typedQueryCollections as universalTypedQueryCollections,\n} from './stores-catalog-v1-collection-collections.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/stores' };\n\nexport function queryCollections(\n httpClient: HttpClient\n): QueryCollectionsSignature {\n return () =>\n universalQueryCollections(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryCollectionsSignature {\n /**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\n (): CollectionsQueryBuilder;\n}\n\nexport function typedQueryCollections(\n httpClient: HttpClient\n): TypedQueryCollectionsSignature {\n return (query: CollectionQuery) =>\n universalTypedQueryCollections(\n query,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryCollectionsSignature {\n /** */\n (query: CollectionQuery): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\n >\n >;\n}\n\nexport function getCollection(httpClient: HttpClient): GetCollectionSignature {\n return (_id: string) =>\n universalGetCollection(\n _id,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCollectionSignature {\n /**\n * Retrieves a collection with the provided ID.\n * @param - Requested collection ID.\n */\n (_id: string): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n >;\n}\n\nexport function getCollectionBySlug(\n httpClient: HttpClient\n): GetCollectionBySlugSignature {\n return (slug: string) =>\n universalGetCollectionBySlug(\n slug,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCollectionBySlugSignature {\n /**\n * Retrieves a collection with the provided slug.\n * @param - Slug of the collection to retrieve.\n */\n (slug: string): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n >;\n}\n\nexport {\n Collection,\n CollectionQuerySpec,\n CollectionsQueryBuilder,\n CollectionsQueryResult,\n CursorPaging,\n Cursors,\n GetCollectionBySlugRequest,\n GetCollectionBySlugResponse,\n GetCollectionRequest,\n GetCollectionResponse,\n Keyword,\n Media,\n MediaItem,\n MediaItemItemOneOf,\n MediaItemType,\n MediaItemUrlAndSize,\n MediaItemVideo,\n PlatformPaging,\n PlatformPagingMetadata,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n QueryCollectionsRequest,\n QueryCollectionsResponse,\n SeoSchema,\n Settings,\n SortOrder,\n Sorting,\n Tag,\n utils,\n} from './stores-catalog-v1-collection-collections.universal.js';\n","import {\n queryCollections as publicQueryCollections,\n typedQueryCollections as publicTypedQueryCollections,\n getCollection as publicGetCollection,\n getCollectionBySlug as publicGetCollectionBySlug,\n} from './stores-catalog-v1-collection-collections.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n CollectionQuery,\n CollectionsQueryBuilder,\n typedQueryCollections as universalTypedQueryCollections,\n} from './stores-catalog-v1-collection-collections.universal.js';\n\nfunction customQueryCollections(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: () => publicQueryCollections(httpClient)(),\n typedQueryFunction: (query: CollectionQuery) =>\n publicTypedQueryCollections(httpClient)(query),\n hasOptionsParameter: false,\n });\n\n function overloadedQuery(): CollectionsQueryBuilder;\n function overloadedQuery(\n query: CollectionQuery\n ): ReturnType<typeof universalTypedQueryCollections>;\n function overloadedQuery(query?: CollectionQuery): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const getCollection: MaybeContext<\n BuildRESTFunction<typeof publicGetCollection> & typeof publicGetCollection\n> = /*#__PURE__*/ createRESTModule(publicGetCollection);\nexport const getCollectionBySlug: MaybeContext<\n BuildRESTFunction<typeof publicGetCollectionBySlug> &\n typeof publicGetCollectionBySlug\n> = /*#__PURE__*/ createRESTModule(publicGetCollectionBySlug);\nexport const queryCollections: MaybeContext<\n BuildRESTFunction<typeof customQueryCollections> &\n typeof customQueryCollections\n> = /*#__PURE__*/ createRESTModule(customQueryCollections);\n\nexport {\n MediaItemType,\n SortOrder,\n} from './stores-catalog-v1-collection-collections.universal.js';\nexport {\n Collection,\n Media,\n MediaItem,\n MediaItemItemOneOf,\n MediaItemUrlAndSize,\n MediaItemVideo,\n SeoSchema,\n Keyword,\n Tag,\n Settings,\n QueryCollectionsRequest,\n PlatformQuery,\n PlatformQueryPagingMethodOneOf,\n Sorting,\n PlatformPaging,\n CursorPaging,\n QueryCollectionsResponse,\n PlatformPagingMetadata,\n Cursors,\n GetCollectionRequest,\n GetCollectionResponse,\n GetCollectionBySlugRequest,\n GetCollectionBySlugResponse,\n CollectionsQueryResult,\n CollectionsQueryBuilder,\n CollectionQuerySpec,\n} from './stores-catalog-v1-collection-collections.universal.js';\nexport { utils } from './stores-catalog-v1-collection-collections.universal.js';\nexport {\n MediaItemTypeWithLiterals,\n SortOrderWithLiterals,\n CommonQueryWithEntityContext,\n CollectionQuery,\n} from './stores-catalog-v1-collection-collections.universal.js';\n"],"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AW;AAAA,EACf;AACJ;AAUO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,UACN;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAiBO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,QACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAyBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,SACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC9FA,IAAAC,uBAAiC;AAGjC,iCAA0C;AAO1C,SAAS,uBAAuB,YAAwB;AACtD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,MAAMC,kBAAuB,UAAU,EAAE;AAAA,IAC/D,oBAAoB,CAAC,UACnBC,uBAA4B,UAAU,EAAE,KAAK;AAAA,IAC/C,qBAAqB;AAAA,EACvB,CAAC;AAMD,WAAS,gBAAgB,OAA8B;AACrD,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMH,oBAGK,2DAAiB,sBAAsB;","names":["getCollection","getCollectionBySlug","queryCollections","import_rest_modules","payload","import_transform_paths","MediaItemType","SortOrder","queryCollections","sdkTransformError","getCollection","getCollectionBySlug","queryCollections","typedQueryCollections","getCollection","getCollectionBySlug","import_rest_modules","queryCollections","typedQueryCollections","getCollection","getCollectionBySlug"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _wix_sdk_types from '@wix/sdk-types';
|
|
1
2
|
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface Collection {
|
|
@@ -382,6 +383,11 @@ type CollectionQuery = {
|
|
|
382
383
|
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
383
384
|
}[];
|
|
384
385
|
};
|
|
386
|
+
declare const utils: {
|
|
387
|
+
QueryBuilder: () => _wix_sdk_types.QueryBuilder<Collection, CollectionQuerySpec, CollectionQuery>;
|
|
388
|
+
Filter: _wix_sdk_types.FilterFactory<Collection, CollectionQuerySpec>;
|
|
389
|
+
Sort: _wix_sdk_types.SortFactory<CollectionQuerySpec>;
|
|
390
|
+
};
|
|
385
391
|
/**
|
|
386
392
|
* Retrieves a collection with the provided ID.
|
|
387
393
|
* @param _id - Requested collection ID.
|
|
@@ -399,4 +405,4 @@ declare function getCollection(_id: string): Promise<NonNullablePaths<Collection
|
|
|
399
405
|
*/
|
|
400
406
|
declare function getCollectionBySlug(slug: string): Promise<NonNullablePaths<GetCollectionBySlugResponse, `collection.media.mainMedia.image.url` | `collection.media.mainMedia.image.width` | `collection.media.mainMedia.image.height` | `collection.media.mainMedia.video.files` | `collection.media.mainMedia.video.stillFrameMediaId` | `collection.media.mainMedia.mediaType` | `collection.media.mainMedia.title` | `collection.media.mainMedia._id` | `collection.media.items` | `collection.numberOfProducts`, 6>>;
|
|
401
407
|
|
|
402
|
-
export { type Collection, type CollectionQuery, type CollectionQuerySpec, type CollectionsQueryBuilder, type CollectionsQueryResult, type CommonQueryWithEntityContext, type CursorPaging, type Cursors, type GetCollectionBySlugRequest, type GetCollectionBySlugResponse, type GetCollectionRequest, type GetCollectionResponse, type Keyword, type Media, type MediaItem, type MediaItemItemOneOf, MediaItemType, type MediaItemTypeWithLiterals, type MediaItemUrlAndSize, type MediaItemVideo, type PlatformPaging, type PlatformPagingMetadata, type PlatformQuery, type PlatformQueryPagingMethodOneOf, type QueryCollectionsRequest, type QueryCollectionsResponse, type SeoSchema, type Settings, SortOrder, type SortOrderWithLiterals, type Sorting, type Tag, getCollection, getCollectionBySlug, queryCollections, typedQueryCollections };
|
|
408
|
+
export { type Collection, type CollectionQuery, type CollectionQuerySpec, type CollectionsQueryBuilder, type CollectionsQueryResult, type CommonQueryWithEntityContext, type CursorPaging, type Cursors, type GetCollectionBySlugRequest, type GetCollectionBySlugResponse, type GetCollectionRequest, type GetCollectionResponse, type Keyword, type Media, type MediaItem, type MediaItemItemOneOf, MediaItemType, type MediaItemTypeWithLiterals, type MediaItemUrlAndSize, type MediaItemVideo, type PlatformPaging, type PlatformPagingMetadata, type PlatformQuery, type PlatformQueryPagingMethodOneOf, type QueryCollectionsRequest, type QueryCollectionsResponse, type SeoSchema, type Settings, SortOrder, type SortOrderWithLiterals, type Sorting, type Tag, getCollection, getCollectionBySlug, queryCollections, typedQueryCollections, utils };
|
|
@@ -25,7 +25,8 @@ __export(index_typings_exports, {
|
|
|
25
25
|
getCollection: () => getCollection2,
|
|
26
26
|
getCollectionBySlug: () => getCollectionBySlug2,
|
|
27
27
|
queryCollections: () => queryCollections2,
|
|
28
|
-
typedQueryCollections: () => typedQueryCollections
|
|
28
|
+
typedQueryCollections: () => typedQueryCollections,
|
|
29
|
+
utils: () => utils
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(index_typings_exports);
|
|
31
32
|
|
|
@@ -196,6 +197,7 @@ function getCollectionBySlug(payload) {
|
|
|
196
197
|
|
|
197
198
|
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
198
199
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
200
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
199
201
|
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
200
202
|
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
201
203
|
MediaItemType2["image"] = "image";
|
|
@@ -276,6 +278,9 @@ async function typedQueryCollections(query) {
|
|
|
276
278
|
throw transformedError;
|
|
277
279
|
}
|
|
278
280
|
}
|
|
281
|
+
var utils = {
|
|
282
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
283
|
+
};
|
|
279
284
|
async function getCollection2(_id) {
|
|
280
285
|
const { httpClient, sideEffects } = arguments[1];
|
|
281
286
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
@@ -329,6 +334,7 @@ async function getCollectionBySlug2(slug) {
|
|
|
329
334
|
getCollection,
|
|
330
335
|
getCollectionBySlug,
|
|
331
336
|
queryCollections,
|
|
332
|
-
typedQueryCollections
|
|
337
|
+
typedQueryCollections,
|
|
338
|
+
utils
|
|
333
339
|
});
|
|
334
340
|
//# sourceMappingURL=index.typings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/stores-catalog-v1-collection-collections.universal.ts","../../src/stores-catalog-v1-collection-collections.http.ts"],"sourcesContent":["export * from './src/stores-catalog-v1-collection-collections.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 ambassadorWixStoresCatalogV1Collection from './stores-catalog-v1-collection-collections.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Collection {\n /**\n * Collection ID (generated automatically by the catalog).\n * @minLength 35\n * @maxLength 36\n * @readonly\n */\n _id?: string | null;\n /**\n * Collection name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /**\n * Media items (images, videos etc) associated with this collection. Read only.\n * @readonly\n */\n media?: Media;\n /**\n * Number of products in the collection. Read only.\n * @readonly\n */\n numberOfProducts?: number;\n /**\n * Collection description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Collection slug.\n * @minLength 1\n * @maxLength 100\n */\n slug?: string | null;\n /** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */\n visible?: boolean | null;\n /**\n * Date and time the collection was updated.\n * @internal\n * @readonly\n */\n lastUpdated?: Date | null;\n}\n\nexport interface Media {\n /** Primary media (image, video etc) associated with this product. */\n mainMedia?: MediaItem;\n /** Media (images, videos etc) associated with this product. */\n items?: MediaItem[];\n}\n\nexport interface MediaItem extends MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n /** Media item thumbnail details. */\n thumbnail?: MediaItemUrlAndSize;\n /** Media item type (image, video, etc.). */\n mediaType?: MediaItemTypeWithLiterals;\n /** Media item title. */\n title?: string;\n /** Media ID (for example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`). */\n _id?: string;\n}\n\n/** @oneof */\nexport interface MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n}\n\nexport interface MediaItemUrlAndSize {\n /**\n * Media item URL.\n * @format WEB_URL\n */\n url?: string;\n /** Media item width. */\n width?: number;\n /** Media item height. */\n height?: number;\n /** Media format (mp4, png, etc.). */\n format?: string | null;\n /** Alt text. This text will be shown in case the image is not available. */\n altText?: string | null;\n}\n\nexport enum MediaItemType {\n unspecified_media_item_type = 'unspecified_media_item_type',\n /** Image media type. */\n image = 'image',\n /** Video media type. */\n video = 'video',\n /** Audio media type. */\n audio = 'audio',\n /** Document media type. */\n document = 'document',\n /** Zip media type. */\n zip = 'zip',\n}\n\n/** @enumType */\nexport type MediaItemTypeWithLiterals =\n | MediaItemType\n | 'unspecified_media_item_type'\n | 'image'\n | 'video'\n | 'audio'\n | 'document'\n | 'zip';\n\nexport interface MediaItemVideo {\n /** Data (URL, size) about each resolution for which this video is available. */\n files?: MediaItemUrlAndSize[];\n /** ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`. */\n stillFrameMediaId?: string;\n}\n\n/**\n * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.\n * The search engines use this information for ranking purposes, or to display snippets in the search results.\n * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.\n */\nexport interface SeoSchema {\n /** SEO tag information. */\n tags?: Tag[];\n /** SEO general settings. */\n settings?: Settings;\n}\n\nexport interface Keyword {\n /** Keyword value. */\n term?: string;\n /** Whether the keyword is the main focus keyword. */\n isMain?: boolean;\n /**\n * The source that added the keyword terms to the SEO settings.\n * @maxLength 1000\n */\n origin?: string | null;\n}\n\nexport interface Tag {\n /**\n * SEO tag type.\n *\n *\n * Supported values: `title`, `meta`, `script`, `link`.\n */\n type?: string;\n /**\n * A `{\"key\": \"value\"}` pair object where each SEO tag property (`\"name\"`, `\"content\"`, `\"rel\"`, `\"href\"`) contains a value.\n * For example: `{\"name\": \"description\", \"content\": \"the description itself\"}`.\n */\n props?: Record<string, any> | null;\n /** SEO tag metadata. For example, `{\"height\": 300, \"width\": 240}`. */\n meta?: Record<string, any> | null;\n /** SEO tag inner content. For example, `<title> inner content </title>`. */\n children?: string;\n /** Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). */\n custom?: boolean;\n /** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */\n disabled?: boolean;\n}\n\nexport interface Settings {\n /**\n * Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.\n *\n *\n * Default: `false` (automatical redirect is enabled).\n */\n preventAutoRedirect?: boolean;\n /**\n * User-selected keyword terms for a specific page.\n * @maxSize 5\n */\n keywords?: Keyword[];\n}\n\nexport interface QueryCollectionsRequest {\n query?: PlatformQuery;\n}\n\nexport interface PlatformQuery extends PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /** Filter object. */\n filter?: Record<string, any> | null;\n /** Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\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 PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryCollectionsResponse {\n /** @maxSize 100 */\n collections?: Collection[];\n metadata?: PlatformPagingMetadata;\n}\n\nexport interface PlatformPagingMetadata {\n /** The number of items returned in this response. */\n count?: number | null;\n /** The offset which was requested. Returned if offset paging was used. */\n offset?: number | null;\n /** The total number of items that match the query. Returned if offset paging was used. */\n total?: number | null;\n /** Cursors to navigate through result pages. Returned if cursor paging was used. */\n cursors?: Cursors;\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 GetCollectionRequest {\n /** Requested collection ID. */\n _id: string;\n}\n\nexport interface GetCollectionResponse {\n collection?: Collection;\n}\n\nexport interface GetCollectionBySlugRequest {\n /**\n * Slug of the collection to retrieve.\n * @minLength 1\n * @maxLength 100\n */\n slug: string;\n}\n\nexport interface GetCollectionBySlugResponse {\n /** The requested collection. */\n collection?: Collection;\n}\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n * @public\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n */\nexport function queryCollections(): CollectionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Collection,\n 'OFFSET',\n QueryCollectionsRequest,\n QueryCollectionsResponse\n >({\n func: async (payload: QueryCollectionsRequest) => {\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.queryCollections(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: QueryCollectionsRequest['query']) => {\n const args = [query, {}] as [QueryCollectionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryCollectionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.collections,\n pagingMetadata: transformedData?.metadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface CollectionsQueryResult extends QueryOffsetResult {\n items: Collection[];\n query: CollectionsQueryBuilder;\n next: () => Promise<CollectionsQueryResult>;\n prev: () => Promise<CollectionsQueryResult>;\n}\n\nexport interface CollectionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'name',\n value: string\n ) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_id' | 'name',\n value: any[]\n ) => CollectionsQueryBuilder;\n in: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n exists: (\n propertyName: '_id' | 'name',\n value: boolean\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => CollectionsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => CollectionsQueryBuilder;\n find: () => Promise<CollectionsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n * @requiredField query\n */\nexport async function typedQueryCollections(\n query: CollectionQuery\n): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\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 ambassadorWixStoresCatalogV1Collection.queryCollections(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 CollectionQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['_id', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Collection,\n CollectionQuerySpec\n>;\nexport type CollectionQuery = {\n /** \n Pointer to page of results using offset. Cannot be used together with `cursorPaging`. \n */\n paging?: {\n /** \n Number of items to load. \n @max: 100 \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n\n /** \n Filter object. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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\n/**\n * Retrieves a collection with the provided ID.\n * @param _id - Requested collection ID.\n * @public\n * @requiredField _id\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollection\n */\nexport async function getCollection(\n _id: string\n): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts = ambassadorWixStoresCatalogV1Collection.getCollection(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a collection with the provided slug.\n * @param slug - Slug of the collection to retrieve.\n * @public\n * @requiredField slug\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug\n */\nexport async function getCollectionBySlug(\n slug: string\n): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ slug: slug });\n\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.getCollectionBySlug(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: { slug: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['slug']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nfunction resolveWixCatalogApiV2CollectionReadApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_collections';\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\nexport function queryCollections(payload: object): RequestOptionsFactory<any> {\n function __queryCollections({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.QueryCollections',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/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: [{ path: 'collections.lastUpdated' }],\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryCollections;\n}\n\n/** Retrieves a collection with the provided ID. */\nexport function getCollection(payload: object): RequestOptionsFactory<any> {\n function __getCollection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollection;\n}\n\n/** Retrieves a collection with the provided slug. */\nexport function getCollectionBySlug(\n payload: object\n): RequestOptionsFactory<any> {\n function __getCollectionBySlug({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/slug/{slug}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },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AAE1B,UAAM;AAAA,EACR;AACF;AAgEA,eAAsBC,eACpB,KAgBA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,IAAI,IAAI,CAAC;AAEjE,QAAM,UAAiD,cAAc,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,IAAI,OAAO;AAAA,QACvC,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,KAAK;AAAA,IACR;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AASA,eAAsBE,qBACpB,MAgBA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,KAAW,CAAC;AAEpE,QAAM,UACmC,oBAAoB,OAAO;AAEpE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,MAAM,OAAO;AAAA,QACzC,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,MAAM;AAAA,IACT;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCollection","getCollectionBySlug","queryCollections","import_rest_modules","payload","import_transform_paths","MediaItemType","SortOrder","queryCollections","sdkTransformError","getCollection","getCollectionBySlug"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/stores-catalog-v1-collection-collections.universal.ts","../../src/stores-catalog-v1-collection-collections.http.ts"],"sourcesContent":["export * from './src/stores-catalog-v1-collection-collections.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 ambassadorWixStoresCatalogV1Collection from './stores-catalog-v1-collection-collections.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface Collection {\n /**\n * Collection ID (generated automatically by the catalog).\n * @minLength 35\n * @maxLength 36\n * @readonly\n */\n _id?: string | null;\n /**\n * Collection name.\n * @minLength 1\n * @maxLength 50\n */\n name?: string | null;\n /**\n * Media items (images, videos etc) associated with this collection. Read only.\n * @readonly\n */\n media?: Media;\n /**\n * Number of products in the collection. Read only.\n * @readonly\n */\n numberOfProducts?: number;\n /**\n * Collection description.\n * @maxLength 600\n */\n description?: string | null;\n /**\n * Collection slug.\n * @minLength 1\n * @maxLength 100\n */\n slug?: string | null;\n /** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */\n visible?: boolean | null;\n /**\n * Date and time the collection was updated.\n * @internal\n * @readonly\n */\n lastUpdated?: Date | null;\n}\n\nexport interface Media {\n /** Primary media (image, video etc) associated with this product. */\n mainMedia?: MediaItem;\n /** Media (images, videos etc) associated with this product. */\n items?: MediaItem[];\n}\n\nexport interface MediaItem extends MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n /** Media item thumbnail details. */\n thumbnail?: MediaItemUrlAndSize;\n /** Media item type (image, video, etc.). */\n mediaType?: MediaItemTypeWithLiterals;\n /** Media item title. */\n title?: string;\n /** Media ID (for example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`). */\n _id?: string;\n}\n\n/** @oneof */\nexport interface MediaItemItemOneOf {\n /** Image data (URL, size). */\n image?: MediaItemUrlAndSize;\n /** Video data (URL, size). */\n video?: MediaItemVideo;\n}\n\nexport interface MediaItemUrlAndSize {\n /**\n * Media item URL.\n * @format WEB_URL\n */\n url?: string;\n /** Media item width. */\n width?: number;\n /** Media item height. */\n height?: number;\n /** Media format (mp4, png, etc.). */\n format?: string | null;\n /** Alt text. This text will be shown in case the image is not available. */\n altText?: string | null;\n}\n\nexport enum MediaItemType {\n unspecified_media_item_type = 'unspecified_media_item_type',\n /** Image media type. */\n image = 'image',\n /** Video media type. */\n video = 'video',\n /** Audio media type. */\n audio = 'audio',\n /** Document media type. */\n document = 'document',\n /** Zip media type. */\n zip = 'zip',\n}\n\n/** @enumType */\nexport type MediaItemTypeWithLiterals =\n | MediaItemType\n | 'unspecified_media_item_type'\n | 'image'\n | 'video'\n | 'audio'\n | 'document'\n | 'zip';\n\nexport interface MediaItemVideo {\n /** Data (URL, size) about each resolution for which this video is available. */\n files?: MediaItemUrlAndSize[];\n /** ID of an image taken from the video. Used primarily for Wix Search indexing. For example, `\"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg\"`. */\n stillFrameMediaId?: string;\n}\n\n/**\n * The SEO schema object contains data about different types of meta tags. It makes sure that the information about your page is presented properly to search engines.\n * The search engines use this information for ranking purposes, or to display snippets in the search results.\n * This data will override other sources of tags (for example patterns) and will be included in the <head> section of the HTML document, while not being displayed on the page itself.\n */\nexport interface SeoSchema {\n /** SEO tag information. */\n tags?: Tag[];\n /** SEO general settings. */\n settings?: Settings;\n}\n\nexport interface Keyword {\n /** Keyword value. */\n term?: string;\n /** Whether the keyword is the main focus keyword. */\n isMain?: boolean;\n /**\n * The source that added the keyword terms to the SEO settings.\n * @maxLength 1000\n */\n origin?: string | null;\n}\n\nexport interface Tag {\n /**\n * SEO tag type.\n *\n *\n * Supported values: `title`, `meta`, `script`, `link`.\n */\n type?: string;\n /**\n * A `{\"key\": \"value\"}` pair object where each SEO tag property (`\"name\"`, `\"content\"`, `\"rel\"`, `\"href\"`) contains a value.\n * For example: `{\"name\": \"description\", \"content\": \"the description itself\"}`.\n */\n props?: Record<string, any> | null;\n /** SEO tag metadata. For example, `{\"height\": 300, \"width\": 240}`. */\n meta?: Record<string, any> | null;\n /** SEO tag inner content. For example, `<title> inner content </title>`. */\n children?: string;\n /** Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages). */\n custom?: boolean;\n /** Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines. */\n disabled?: boolean;\n}\n\nexport interface Settings {\n /**\n * Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.\n *\n *\n * Default: `false` (automatical redirect is enabled).\n */\n preventAutoRedirect?: boolean;\n /**\n * User-selected keyword terms for a specific page.\n * @maxSize 5\n */\n keywords?: Keyword[];\n}\n\nexport interface QueryCollectionsRequest {\n query?: PlatformQuery;\n}\n\nexport interface PlatformQuery extends PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /** Filter object. */\n filter?: Record<string, any> | null;\n /** Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface PlatformQueryPagingMethodOneOf {\n /** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */\n paging?: PlatformPaging;\n /** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */\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 PlatformPaging {\n /**\n * Number of items to load.\n * @max 100\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\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 QueryCollectionsResponse {\n /** @maxSize 100 */\n collections?: Collection[];\n metadata?: PlatformPagingMetadata;\n}\n\nexport interface PlatformPagingMetadata {\n /** The number of items returned in this response. */\n count?: number | null;\n /** The offset which was requested. Returned if offset paging was used. */\n offset?: number | null;\n /** The total number of items that match the query. Returned if offset paging was used. */\n total?: number | null;\n /** Cursors to navigate through result pages. Returned if cursor paging was used. */\n cursors?: Cursors;\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 GetCollectionRequest {\n /** Requested collection ID. */\n _id: string;\n}\n\nexport interface GetCollectionResponse {\n collection?: Collection;\n}\n\nexport interface GetCollectionBySlugRequest {\n /**\n * Slug of the collection to retrieve.\n * @minLength 1\n * @maxLength 100\n */\n slug: string;\n}\n\nexport interface GetCollectionBySlugResponse {\n /** The requested collection. */\n collection?: Collection;\n}\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n * @public\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n */\nexport function queryCollections(): CollectionsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n Collection,\n 'OFFSET',\n QueryCollectionsRequest,\n QueryCollectionsResponse\n >({\n func: async (payload: QueryCollectionsRequest) => {\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.queryCollections(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: QueryCollectionsRequest['query']) => {\n const args = [query, {}] as [QueryCollectionsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryCollectionsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.collections,\n pagingMetadata: transformedData?.metadata,\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: 'OFFSET',\n transformationPaths: {},\n });\n}\n\ninterface QueryOffsetResult {\n currentPage: number | undefined;\n totalPages: number | undefined;\n totalCount: number | undefined;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface CollectionsQueryResult extends QueryOffsetResult {\n items: Collection[];\n query: CollectionsQueryBuilder;\n next: () => Promise<CollectionsQueryResult>;\n prev: () => Promise<CollectionsQueryResult>;\n}\n\nexport interface CollectionsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n */\n startsWith: (\n propertyName: '_id' | 'name',\n value: string\n ) => CollectionsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_id' | 'name',\n value: any[]\n ) => CollectionsQueryBuilder;\n in: (propertyName: '_id' | 'name', value: any) => CollectionsQueryBuilder;\n exists: (\n propertyName: '_id' | 'name',\n value: boolean\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | 'name'>\n ) => CollectionsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => CollectionsQueryBuilder;\n /** @param skip - Number of items to skip in the query results before returning the results. */\n skip: (skip: number) => CollectionsQueryBuilder;\n find: () => Promise<CollectionsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections\n * @requiredField query\n */\nexport async function typedQueryCollections(\n query: CollectionQuery\n): Promise<\n NonNullablePaths<\n QueryCollectionsResponse,\n | `collections`\n | `collections.${number}.media.mainMedia.mediaType`\n | `collections.${number}.media.mainMedia.title`\n | `collections.${number}.media.mainMedia._id`\n | `collections.${number}.numberOfProducts`,\n 6\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 ambassadorWixStoresCatalogV1Collection.queryCollections(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 CollectionQuerySpec extends QuerySpec {\n paging: 'offset';\n wql: [\n {\n fields: ['_id', 'name'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n Collection,\n CollectionQuerySpec\n>;\nexport type CollectionQuery = {\n /** \n Pointer to page of results using offset. Cannot be used together with `cursorPaging`. \n */\n paging?: {\n /** \n Number of items to load. \n @max: 100 \n */\n limit?: NonNullable<CommonQueryWithEntityContext['paging']>['limit'] | null;\n /** \n Number of items to skip in the current sort order. \n */\n offset?:\n | NonNullable<CommonQueryWithEntityContext['paging']>['offset']\n | null;\n };\n\n /** \n Filter object. \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sorting options. For example, `[{\"fieldName\":\"sortField1\"},{\"fieldName\":\"sortField2\",\"direction\":\"DESC\"}]`. \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 ...createQueryUtils<Collection, CollectionQuerySpec, CollectionQuery>(),\n};\n\n/**\n * Retrieves a collection with the provided ID.\n * @param _id - Requested collection ID.\n * @public\n * @requiredField _id\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollection\n */\nexport async function getCollection(\n _id: string\n): Promise<\n NonNullablePaths<\n Collection,\n | `media.mainMedia.image.url`\n | `media.mainMedia.image.width`\n | `media.mainMedia.image.height`\n | `media.mainMedia.video.files`\n | `media.mainMedia.video.stillFrameMediaId`\n | `media.mainMedia.mediaType`\n | `media.mainMedia.title`\n | `media.mainMedia._id`\n | `media.items`\n | `numberOfProducts`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });\n\n const reqOpts = ambassadorWixStoresCatalogV1Collection.getCollection(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { id: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a collection with the provided slug.\n * @param slug - Slug of the collection to retrieve.\n * @public\n * @requiredField slug\n * @fqn wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug\n */\nexport async function getCollectionBySlug(\n slug: string\n): Promise<\n NonNullablePaths<\n GetCollectionBySlugResponse,\n | `collection.media.mainMedia.image.url`\n | `collection.media.mainMedia.image.width`\n | `collection.media.mainMedia.image.height`\n | `collection.media.mainMedia.video.files`\n | `collection.media.mainMedia.video.stillFrameMediaId`\n | `collection.media.mainMedia.mediaType`\n | `collection.media.mainMedia.title`\n | `collection.media.mainMedia._id`\n | `collection.media.items`\n | `collection.numberOfProducts`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ slug: slug });\n\n const reqOpts =\n ambassadorWixStoresCatalogV1Collection.getCollectionBySlug(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: { slug: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['slug']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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\nfunction resolveWixCatalogApiV2CollectionReadApiUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/wix-ecommerce-catalog-reader-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/stores-reader/v2/inventoryItems',\n destPath: '/v2/inventoryItems',\n },\n {\n srcPath: '/stores-reader/v2/collections',\n destPath: '/v2/collections',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_stores_collections';\n\n/**\n * Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.\n * See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.\n */\nexport function queryCollections(payload: object): RequestOptionsFactory<any> {\n function __queryCollections({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.QueryCollections',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/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: [{ path: 'collections.lastUpdated' }],\n },\n ]),\n fallback: [\n {\n method: 'POST' as any,\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/query',\n data: payload,\n host,\n }),\n data: payload,\n },\n ],\n };\n\n return metadata;\n }\n\n return __queryCollections;\n}\n\n/** Retrieves a collection with the provided ID. */\nexport function getCollection(payload: object): RequestOptionsFactory<any> {\n function __getCollection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/{id}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollection;\n}\n\n/** Retrieves a collection with the provided slug. */\nexport function getCollectionBySlug(\n payload: object\n): RequestOptionsFactory<any> {\n function __getCollectionBySlug({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.stores.catalog.v1.collection',\n method: 'GET' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/slug/{slug}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'collection.lastUpdated' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCollectionBySlug;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,wBAAAC;AAAA,EAAA;AAAA;AAAA;AAAA;;;ACAA,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AAsC,EAAE,IAAI,IAAI,CAAC;AAEjE,QAAM,UAAiD,cAAc,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,IAAI,OAAO;AAAA,QACvC,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,KAAK;AAAA,IACR;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AASA,eAAsBE,qBACpB,MAgBA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,EAAE,KAAW,CAAC;AAEpE,QAAM,UACmC,oBAAoB,OAAO;AAEpE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,MAAM,OAAO;AAAA,QACzC,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,MAAM;AAAA,IACT;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCollection","getCollectionBySlug","queryCollections","import_rest_modules","payload","import_transform_paths","MediaItemType","SortOrder","queryCollections","sdkTransformError","getCollection","getCollectionBySlug"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
2
|
import { Collection, GetCollectionBySlugResponse, CollectionsQueryBuilder, CollectionQuery, typedQueryCollections } from './index.typings.mjs';
|
|
3
|
-
export { CollectionQuerySpec, CollectionsQueryResult, CommonQueryWithEntityContext, CursorPaging, Cursors, GetCollectionBySlugRequest, GetCollectionRequest, GetCollectionResponse, Keyword, Media, MediaItem, MediaItemItemOneOf, MediaItemType, MediaItemTypeWithLiterals, MediaItemUrlAndSize, MediaItemVideo, PlatformPaging, PlatformPagingMetadata, PlatformQuery, PlatformQueryPagingMethodOneOf, QueryCollectionsRequest, QueryCollectionsResponse, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Tag } from './index.typings.mjs';
|
|
3
|
+
export { CollectionQuerySpec, CollectionsQueryResult, CommonQueryWithEntityContext, CursorPaging, Cursors, GetCollectionBySlugRequest, GetCollectionRequest, GetCollectionResponse, Keyword, Media, MediaItem, MediaItemItemOneOf, MediaItemType, MediaItemTypeWithLiterals, MediaItemUrlAndSize, MediaItemVideo, PlatformPaging, PlatformPagingMetadata, PlatformQuery, PlatformQueryPagingMethodOneOf, QueryCollectionsRequest, QueryCollectionsResponse, SeoSchema, Settings, SortOrder, SortOrderWithLiterals, Sorting, Tag, utils } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function getCollection$1(httpClient: HttpClient): GetCollectionSignature;
|
|
6
6
|
interface GetCollectionSignature {
|
package/build/es/index.mjs
CHANGED
|
@@ -168,6 +168,7 @@ function getCollectionBySlug(payload) {
|
|
|
168
168
|
|
|
169
169
|
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
170
170
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
171
|
+
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
171
172
|
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
172
173
|
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
173
174
|
MediaItemType2["image"] = "image";
|
|
@@ -248,6 +249,9 @@ async function typedQueryCollections(query) {
|
|
|
248
249
|
throw transformedError;
|
|
249
250
|
}
|
|
250
251
|
}
|
|
252
|
+
var utils = {
|
|
253
|
+
...createQueryUtils()
|
|
254
|
+
};
|
|
251
255
|
async function getCollection2(_id) {
|
|
252
256
|
const { httpClient, sideEffects } = arguments[1];
|
|
253
257
|
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
@@ -346,6 +350,7 @@ export {
|
|
|
346
350
|
SortOrder,
|
|
347
351
|
getCollection4 as getCollection,
|
|
348
352
|
getCollectionBySlug4 as getCollectionBySlug,
|
|
349
|
-
queryCollections4 as queryCollections
|
|
353
|
+
queryCollections4 as queryCollections,
|
|
354
|
+
utils
|
|
350
355
|
};
|
|
351
356
|
//# sourceMappingURL=index.mjs.map
|