@wix/auto_sdk_stores_collections 1.0.10 → 1.0.12
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 +34 -1
- package/build/cjs/index.js +325 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +228 -1
- package/build/cjs/meta.js +238 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/{src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-DXVGSHC4.d.ts} +31 -57
- package/build/es/index.d.mts +34 -0
- package/build/es/index.mjs +300 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/{src/stores-catalog-v1-collection-collections.types.d.ts → meta.d.mts} +45 -81
- package/build/es/meta.mjs +212 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/{src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-DXVGSHC4.d.mts} +31 -57
- package/build/internal/cjs/index.d.ts +34 -1
- package/build/internal/cjs/index.js +325 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +228 -1
- package/build/internal/cjs/meta.js +238 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/{src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-BdGGTv5j.d.ts} +31 -57
- package/build/internal/es/index.d.mts +34 -0
- package/build/internal/es/index.mjs +300 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/{cjs/src/stores-catalog-v1-collection-collections.types.d.ts → internal/es/meta.d.mts} +45 -81
- package/build/internal/es/meta.mjs +212 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/internal/es/{src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-BdGGTv5j.d.mts} +31 -57
- package/package.json +9 -8
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.context.d.ts +0 -7
- package/build/cjs/src/stores-catalog-v1-collection-collections.context.js +0 -12
- package/build/cjs/src/stores-catalog-v1-collection-collections.context.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.http.d.ts +0 -10
- package/build/cjs/src/stores-catalog-v1-collection-collections.http.js +0 -162
- package/build/cjs/src/stores-catalog-v1-collection-collections.http.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.meta.d.ts +0 -19
- package/build/cjs/src/stores-catalog-v1-collection-collections.meta.js +0 -85
- package/build/cjs/src/stores-catalog-v1-collection-collections.meta.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.public.d.ts +0 -30
- package/build/cjs/src/stores-catalog-v1-collection-collections.public.js +0 -27
- package/build/cjs/src/stores-catalog-v1-collection-collections.public.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.types.js +0 -23
- package/build/cjs/src/stores-catalog-v1-collection-collections.types.js.map +0 -1
- package/build/cjs/src/stores-catalog-v1-collection-collections.universal.js +0 -160
- package/build/cjs/src/stores-catalog-v1-collection-collections.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.context.d.ts +0 -7
- package/build/es/src/stores-catalog-v1-collection-collections.context.js +0 -7
- package/build/es/src/stores-catalog-v1-collection-collections.context.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.http.d.ts +0 -10
- package/build/es/src/stores-catalog-v1-collection-collections.http.js +0 -156
- package/build/es/src/stores-catalog-v1-collection-collections.http.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.meta.d.ts +0 -19
- package/build/es/src/stores-catalog-v1-collection-collections.meta.js +0 -56
- package/build/es/src/stores-catalog-v1-collection-collections.meta.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.public.d.ts +0 -30
- package/build/es/src/stores-catalog-v1-collection-collections.public.js +0 -19
- package/build/es/src/stores-catalog-v1-collection-collections.public.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.types.js +0 -20
- package/build/es/src/stores-catalog-v1-collection-collections.types.js.map +0 -1
- package/build/es/src/stores-catalog-v1-collection-collections.universal.js +0 -131
- package/build/es/src/stores-catalog-v1-collection-collections.universal.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.context.d.ts +0 -7
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.context.js +0 -12
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.context.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.http.d.ts +0 -10
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.http.js +0 -162
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.http.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.meta.d.ts +0 -19
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.meta.js +0 -85
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.meta.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.public.d.ts +0 -30
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.public.js +0 -27
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.public.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.types.d.ts +0 -264
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.types.js +0 -23
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.types.js.map +0 -1
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.universal.js +0 -160
- package/build/internal/cjs/src/stores-catalog-v1-collection-collections.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.context.d.ts +0 -7
- package/build/internal/es/src/stores-catalog-v1-collection-collections.context.js +0 -7
- package/build/internal/es/src/stores-catalog-v1-collection-collections.context.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.http.d.ts +0 -10
- package/build/internal/es/src/stores-catalog-v1-collection-collections.http.js +0 -156
- package/build/internal/es/src/stores-catalog-v1-collection-collections.http.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.meta.d.ts +0 -19
- package/build/internal/es/src/stores-catalog-v1-collection-collections.meta.js +0 -56
- package/build/internal/es/src/stores-catalog-v1-collection-collections.meta.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.public.d.ts +0 -30
- package/build/internal/es/src/stores-catalog-v1-collection-collections.public.js +0 -19
- package/build/internal/es/src/stores-catalog-v1-collection-collections.public.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.types.d.ts +0 -264
- package/build/internal/es/src/stores-catalog-v1-collection-collections.types.js +0 -20
- package/build/internal/es/src/stores-catalog-v1-collection-collections.types.js.map +0 -1
- package/build/internal/es/src/stores-catalog-v1-collection-collections.universal.js +0 -131
- package/build/internal/es/src/stores-catalog-v1-collection-collections.universal.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface Collection {
|
|
1
|
+
interface Collection {
|
|
3
2
|
/**
|
|
4
3
|
* Collection ID (generated automatically by the catalog).
|
|
5
4
|
* @minLength 35
|
|
@@ -37,13 +36,13 @@ export interface Collection {
|
|
|
37
36
|
/** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */
|
|
38
37
|
visible?: boolean | null;
|
|
39
38
|
}
|
|
40
|
-
|
|
39
|
+
interface Media {
|
|
41
40
|
/** Primary media (image, video etc) associated with this product. */
|
|
42
41
|
mainMedia?: MediaItem;
|
|
43
42
|
/** Media (images, videos etc) associated with this product. */
|
|
44
43
|
items?: MediaItem[];
|
|
45
44
|
}
|
|
46
|
-
|
|
45
|
+
interface MediaItem extends MediaItemItemOneOf {
|
|
47
46
|
/** Image data (URL, size). */
|
|
48
47
|
image?: MediaItemUrlAndSize;
|
|
49
48
|
/** Video data (URL, size). */
|
|
@@ -58,13 +57,13 @@ export interface MediaItem extends MediaItemItemOneOf {
|
|
|
58
57
|
_id?: string;
|
|
59
58
|
}
|
|
60
59
|
/** @oneof */
|
|
61
|
-
|
|
60
|
+
interface MediaItemItemOneOf {
|
|
62
61
|
/** Image data (URL, size). */
|
|
63
62
|
image?: MediaItemUrlAndSize;
|
|
64
63
|
/** Video data (URL, size). */
|
|
65
64
|
video?: MediaItemVideo;
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
interface MediaItemUrlAndSize {
|
|
68
67
|
/**
|
|
69
68
|
* Media item URL.
|
|
70
69
|
* @format WEB_URL
|
|
@@ -79,7 +78,7 @@ export interface MediaItemUrlAndSize {
|
|
|
79
78
|
/** Alt text. This text will be shown in case the image is not available. */
|
|
80
79
|
altText?: string | null;
|
|
81
80
|
}
|
|
82
|
-
|
|
81
|
+
declare enum MediaItemType {
|
|
83
82
|
unspecified_media_item_type = "unspecified_media_item_type",
|
|
84
83
|
/** Image media type. */
|
|
85
84
|
image = "image",
|
|
@@ -93,8 +92,8 @@ export declare enum MediaItemType {
|
|
|
93
92
|
zip = "zip"
|
|
94
93
|
}
|
|
95
94
|
/** @enumType */
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
type MediaItemTypeWithLiterals = MediaItemType | 'unspecified_media_item_type' | 'image' | 'video' | 'audio' | 'document' | 'zip';
|
|
96
|
+
interface MediaItemVideo {
|
|
98
97
|
/** Data (URL, size) about each resolution for which this video is available. */
|
|
99
98
|
files?: MediaItemUrlAndSize[];
|
|
100
99
|
/** 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"`. */
|
|
@@ -105,13 +104,13 @@ export interface MediaItemVideo {
|
|
|
105
104
|
* The search engines use this information for ranking purposes, or to display snippets in the search results.
|
|
106
105
|
* 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.
|
|
107
106
|
*/
|
|
108
|
-
|
|
107
|
+
interface SeoSchema {
|
|
109
108
|
/** SEO tag information. */
|
|
110
109
|
tags?: Tag[];
|
|
111
110
|
/** SEO general settings. */
|
|
112
111
|
settings?: Settings;
|
|
113
112
|
}
|
|
114
|
-
|
|
113
|
+
interface Keyword {
|
|
115
114
|
/** Keyword value. */
|
|
116
115
|
term?: string;
|
|
117
116
|
/** Whether the keyword is the main focus keyword. */
|
|
@@ -122,7 +121,7 @@ export interface Keyword {
|
|
|
122
121
|
*/
|
|
123
122
|
origin?: string | null;
|
|
124
123
|
}
|
|
125
|
-
|
|
124
|
+
interface Tag {
|
|
126
125
|
/**
|
|
127
126
|
* SEO tag type.
|
|
128
127
|
*
|
|
@@ -144,7 +143,7 @@ export interface Tag {
|
|
|
144
143
|
/** Whether the tag is disabled. */
|
|
145
144
|
disabled?: boolean;
|
|
146
145
|
}
|
|
147
|
-
|
|
146
|
+
interface Settings {
|
|
148
147
|
/**
|
|
149
148
|
* Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
|
|
150
149
|
*
|
|
@@ -158,10 +157,10 @@ export interface Settings {
|
|
|
158
157
|
*/
|
|
159
158
|
keywords?: Keyword[];
|
|
160
159
|
}
|
|
161
|
-
|
|
160
|
+
interface QueryCollectionsRequest {
|
|
162
161
|
query?: PlatformQuery;
|
|
163
162
|
}
|
|
164
|
-
|
|
163
|
+
interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
165
164
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
166
165
|
paging?: PlatformPaging;
|
|
167
166
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
@@ -172,13 +171,13 @@ export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
|
172
171
|
sort?: Sorting[];
|
|
173
172
|
}
|
|
174
173
|
/** @oneof */
|
|
175
|
-
|
|
174
|
+
interface PlatformQueryPagingMethodOneOf {
|
|
176
175
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
177
176
|
paging?: PlatformPaging;
|
|
178
177
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
179
178
|
cursorPaging?: CursorPaging;
|
|
180
179
|
}
|
|
181
|
-
|
|
180
|
+
interface Sorting {
|
|
182
181
|
/**
|
|
183
182
|
* Name of the field to sort by.
|
|
184
183
|
* @maxLength 512
|
|
@@ -187,13 +186,13 @@ export interface Sorting {
|
|
|
187
186
|
/** Sort order. */
|
|
188
187
|
order?: SortOrderWithLiterals;
|
|
189
188
|
}
|
|
190
|
-
|
|
189
|
+
declare enum SortOrder {
|
|
191
190
|
ASC = "ASC",
|
|
192
191
|
DESC = "DESC"
|
|
193
192
|
}
|
|
194
193
|
/** @enumType */
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
195
|
+
interface PlatformPaging {
|
|
197
196
|
/**
|
|
198
197
|
* Number of items to load.
|
|
199
198
|
* @max 100
|
|
@@ -202,7 +201,7 @@ export interface PlatformPaging {
|
|
|
202
201
|
/** Number of items to skip in the current sort order. */
|
|
203
202
|
offset?: number | null;
|
|
204
203
|
}
|
|
205
|
-
|
|
204
|
+
interface CursorPaging {
|
|
206
205
|
/**
|
|
207
206
|
* Maximum number of items to return in the results.
|
|
208
207
|
* @max 100
|
|
@@ -217,12 +216,12 @@ export interface CursorPaging {
|
|
|
217
216
|
*/
|
|
218
217
|
cursor?: string | null;
|
|
219
218
|
}
|
|
220
|
-
|
|
219
|
+
interface QueryCollectionsResponse {
|
|
221
220
|
/** @maxSize 100 */
|
|
222
221
|
collections?: Collection[];
|
|
223
222
|
metadata?: PlatformPagingMetadata;
|
|
224
223
|
}
|
|
225
|
-
|
|
224
|
+
interface PlatformPagingMetadata {
|
|
226
225
|
/** The number of items returned in this response. */
|
|
227
226
|
count?: number | null;
|
|
228
227
|
/** The offset which was requested. Returned if offset paging was used. */
|
|
@@ -232,7 +231,7 @@ export interface PlatformPagingMetadata {
|
|
|
232
231
|
/** Cursors to navigate through result pages. Returned if cursor paging was used. */
|
|
233
232
|
cursors?: Cursors;
|
|
234
233
|
}
|
|
235
|
-
|
|
234
|
+
interface Cursors {
|
|
236
235
|
/**
|
|
237
236
|
* Cursor string pointing to the next page in the list of results.
|
|
238
237
|
* @maxLength 16000
|
|
@@ -244,14 +243,14 @@ export interface Cursors {
|
|
|
244
243
|
*/
|
|
245
244
|
prev?: string | null;
|
|
246
245
|
}
|
|
247
|
-
|
|
246
|
+
interface GetCollectionRequest {
|
|
248
247
|
/** Requested collection ID. */
|
|
249
248
|
_id: string;
|
|
250
249
|
}
|
|
251
|
-
|
|
250
|
+
interface GetCollectionResponse {
|
|
252
251
|
collection?: Collection;
|
|
253
252
|
}
|
|
254
|
-
|
|
253
|
+
interface GetCollectionBySlugRequest {
|
|
255
254
|
/**
|
|
256
255
|
* Slug of the collection to retrieve.
|
|
257
256
|
* @minLength 1
|
|
@@ -259,18 +258,10 @@ export interface GetCollectionBySlugRequest {
|
|
|
259
258
|
*/
|
|
260
259
|
slug: string;
|
|
261
260
|
}
|
|
262
|
-
|
|
261
|
+
interface GetCollectionBySlugResponse {
|
|
263
262
|
/** The requested collection. */
|
|
264
263
|
collection?: Collection;
|
|
265
264
|
}
|
|
266
|
-
type CollectionNonNullablePaths = `media.mainMedia.image.url` | `media.mainMedia.image.width` | `media.mainMedia.image.height` | `media.mainMedia.video.files` | `media.mainMedia.video.stillFrameMediaId` | `media.mainMedia.mediaType` | `media.mainMedia.title` | `media.mainMedia._id` | `media.items` | `numberOfProducts`;
|
|
267
|
-
/**
|
|
268
|
-
* Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.
|
|
269
|
-
* See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
|
|
270
|
-
* @public
|
|
271
|
-
* @fqn wix.catalog.api.v2.CollectionReadApi.QueryCollections
|
|
272
|
-
*/
|
|
273
|
-
export declare function queryCollections(): CollectionsQueryBuilder;
|
|
274
265
|
interface QueryOffsetResult {
|
|
275
266
|
currentPage: number | undefined;
|
|
276
267
|
totalPages: number | undefined;
|
|
@@ -280,13 +271,13 @@ interface QueryOffsetResult {
|
|
|
280
271
|
length: number;
|
|
281
272
|
pageSize: number;
|
|
282
273
|
}
|
|
283
|
-
|
|
274
|
+
interface CollectionsQueryResult extends QueryOffsetResult {
|
|
284
275
|
items: Collection[];
|
|
285
276
|
query: CollectionsQueryBuilder;
|
|
286
277
|
next: () => Promise<CollectionsQueryResult>;
|
|
287
278
|
prev: () => Promise<CollectionsQueryResult>;
|
|
288
279
|
}
|
|
289
|
-
|
|
280
|
+
interface CollectionsQueryBuilder {
|
|
290
281
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
291
282
|
* @param value - Value to compare against.
|
|
292
283
|
*/
|
|
@@ -331,22 +322,5 @@ export interface CollectionsQueryBuilder {
|
|
|
331
322
|
skip: (skip: number) => CollectionsQueryBuilder;
|
|
332
323
|
find: () => Promise<CollectionsQueryResult>;
|
|
333
324
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
* @param _id - Requested collection ID.
|
|
337
|
-
* @public
|
|
338
|
-
* @requiredField _id
|
|
339
|
-
* @fqn wix.catalog.api.v2.CollectionReadApi.GetCollection
|
|
340
|
-
*/
|
|
341
|
-
export declare function getCollection(_id: string): Promise<NonNullablePaths<Collection, CollectionNonNullablePaths>>;
|
|
342
|
-
/**
|
|
343
|
-
* Retrieves a collection with the provided slug.
|
|
344
|
-
* @param slug - Slug of the collection to retrieve.
|
|
345
|
-
* @public
|
|
346
|
-
* @requiredField slug
|
|
347
|
-
* @fqn wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug
|
|
348
|
-
*/
|
|
349
|
-
export declare function getCollectionBySlug(slug: string): Promise<NonNullablePaths<GetCollectionBySlugResponse, {
|
|
350
|
-
[P in CollectionNonNullablePaths]: `collection.${P}`;
|
|
351
|
-
}[CollectionNonNullablePaths]>>;
|
|
352
|
-
export {};
|
|
325
|
+
|
|
326
|
+
export { type CollectionsQueryBuilder as C, type GetCollectionBySlugResponse as G, type Keyword as K, MediaItemType as M, type PlatformQuery as P, type QueryCollectionsRequest as Q, SortOrder as S, type Tag as T, type Collection as a, type Media as b, type MediaItem as c, type MediaItemItemOneOf as d, type MediaItemUrlAndSize as e, type MediaItemVideo as f, type SeoSchema as g, type Settings as h, type PlatformQueryPagingMethodOneOf as i, type Sorting as j, type PlatformPaging as k, type CursorPaging as l, type QueryCollectionsResponse as m, type PlatformPagingMetadata as n, type Cursors as o, type GetCollectionRequest as p, type GetCollectionResponse as q, type GetCollectionBySlugRequest as r, type CollectionsQueryResult as s };
|
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { C as CollectionsQueryBuilder, a as Collection, G as GetCollectionBySlugResponse } from './stores-catalog-v1-collection-collections.universal-BdGGTv5j.js';
|
|
3
|
+
export { s as CollectionsQueryResult, l as CursorPaging, o as Cursors, r as GetCollectionBySlugRequest, p as GetCollectionRequest, q as GetCollectionResponse, K as Keyword, b as Media, c as MediaItem, d as MediaItemItemOneOf, M as MediaItemType, e as MediaItemUrlAndSize, f as MediaItemVideo, k as PlatformPaging, n as PlatformPagingMetadata, P as PlatformQuery, i as PlatformQueryPagingMethodOneOf, Q as QueryCollectionsRequest, m as QueryCollectionsResponse, g as SeoSchema, h as Settings, S as SortOrder, j as Sorting, T as Tag } from './stores-catalog-v1-collection-collections.universal-BdGGTv5j.js';
|
|
4
|
+
|
|
5
|
+
declare function queryCollections$1(httpClient: HttpClient): QueryCollectionsSignature;
|
|
6
|
+
interface QueryCollectionsSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a list of up to 100 collections, given the provided paging, sorting and filtering.
|
|
9
|
+
* See [Stores Pagination](https://dev.wix.com/api/rest/wix-stores/pagination) for more information.
|
|
10
|
+
*/
|
|
11
|
+
(): CollectionsQueryBuilder;
|
|
12
|
+
}
|
|
13
|
+
declare function getCollection$1(httpClient: HttpClient): GetCollectionSignature;
|
|
14
|
+
interface GetCollectionSignature {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves a collection with the provided ID.
|
|
17
|
+
* @param - Requested collection ID.
|
|
18
|
+
*/
|
|
19
|
+
(_id: string): Promise<Collection>;
|
|
20
|
+
}
|
|
21
|
+
declare function getCollectionBySlug$1(httpClient: HttpClient): GetCollectionBySlugSignature;
|
|
22
|
+
interface GetCollectionBySlugSignature {
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a collection with the provided slug.
|
|
25
|
+
* @param - Slug of the collection to retrieve.
|
|
26
|
+
*/
|
|
27
|
+
(slug: string): Promise<GetCollectionBySlugResponse>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare const queryCollections: MaybeContext<BuildRESTFunction<typeof queryCollections$1> & typeof queryCollections$1>;
|
|
31
|
+
declare const getCollection: MaybeContext<BuildRESTFunction<typeof getCollection$1> & typeof getCollection$1>;
|
|
32
|
+
declare const getCollectionBySlug: MaybeContext<BuildRESTFunction<typeof getCollectionBySlug$1> & typeof getCollectionBySlug$1>;
|
|
33
|
+
|
|
34
|
+
export { Collection, CollectionsQueryBuilder, GetCollectionBySlugResponse, getCollection, getCollectionBySlug, queryCollections };
|
|
@@ -1,18 +1,328 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
MediaItemType: () => MediaItemType,
|
|
24
|
+
SortOrder: () => SortOrder,
|
|
25
|
+
getCollection: () => getCollection4,
|
|
26
|
+
getCollectionBySlug: () => getCollectionBySlug4,
|
|
27
|
+
queryCollections: () => queryCollections4
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
|
|
31
|
+
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
32
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
33
|
+
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
34
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
35
|
+
|
|
36
|
+
// src/stores-catalog-v1-collection-collections.http.ts
|
|
37
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
38
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
39
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
40
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
41
|
+
function resolveWixCatalogApiV2CollectionReadApiUrl(opts) {
|
|
42
|
+
const domainToMappings = {
|
|
43
|
+
"api._api_base_domain_": [
|
|
44
|
+
{
|
|
45
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
46
|
+
destPath: ""
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"manage._base_domain_": [
|
|
50
|
+
{
|
|
51
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
52
|
+
destPath: ""
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"www.wixapis.com": [
|
|
56
|
+
{
|
|
57
|
+
srcPath: "/stores-reader/v2/collections",
|
|
58
|
+
destPath: "/v2/collections"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/stores-reader/v2/inventoryItems",
|
|
62
|
+
destPath: "/v2/inventoryItems"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"www._base_domain_": [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
68
|
+
destPath: ""
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"editor._base_domain_": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
74
|
+
destPath: ""
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"blocks._base_domain_": [
|
|
78
|
+
{
|
|
79
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
80
|
+
destPath: ""
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"create.editorx": [
|
|
84
|
+
{
|
|
85
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
86
|
+
destPath: ""
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
_: [
|
|
90
|
+
{
|
|
91
|
+
srcPath: "/stores-reader/v2/inventoryItems",
|
|
92
|
+
destPath: "/v2/inventoryItems"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
srcPath: "/stores-reader/v2/collections",
|
|
96
|
+
destPath: "/v2/collections"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
};
|
|
100
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
101
|
+
}
|
|
102
|
+
var PACKAGE_NAME = "@wix/auto_sdk_stores_collections";
|
|
103
|
+
function queryCollections(payload) {
|
|
104
|
+
function __queryCollections({ host }) {
|
|
105
|
+
const metadata = {
|
|
106
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
107
|
+
method: "POST",
|
|
108
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.QueryCollections",
|
|
109
|
+
packageName: PACKAGE_NAME,
|
|
110
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
111
|
+
protoPath: "/v2/collections/query",
|
|
112
|
+
data: payload,
|
|
113
|
+
host
|
|
114
|
+
}),
|
|
115
|
+
data: payload,
|
|
116
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
117
|
+
{
|
|
118
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
119
|
+
paths: [{ path: "collections.lastUpdated" }]
|
|
120
|
+
}
|
|
121
|
+
]),
|
|
122
|
+
fallback: [
|
|
123
|
+
{
|
|
124
|
+
method: "POST",
|
|
125
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
126
|
+
protoPath: "/v2/collections/query",
|
|
127
|
+
data: payload,
|
|
128
|
+
host
|
|
129
|
+
}),
|
|
130
|
+
data: payload
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
};
|
|
134
|
+
return metadata;
|
|
135
|
+
}
|
|
136
|
+
return __queryCollections;
|
|
137
|
+
}
|
|
138
|
+
function getCollection(payload) {
|
|
139
|
+
function __getCollection({ host }) {
|
|
140
|
+
const metadata = {
|
|
141
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
142
|
+
method: "GET",
|
|
143
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.GetCollection",
|
|
144
|
+
packageName: PACKAGE_NAME,
|
|
145
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
146
|
+
protoPath: "/v2/collections/{id}",
|
|
147
|
+
data: payload,
|
|
148
|
+
host
|
|
149
|
+
}),
|
|
150
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
151
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
152
|
+
{
|
|
153
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
154
|
+
paths: [{ path: "collection.lastUpdated" }]
|
|
155
|
+
}
|
|
156
|
+
])
|
|
157
|
+
};
|
|
158
|
+
return metadata;
|
|
159
|
+
}
|
|
160
|
+
return __getCollection;
|
|
161
|
+
}
|
|
162
|
+
function getCollectionBySlug(payload) {
|
|
163
|
+
function __getCollectionBySlug({ host }) {
|
|
164
|
+
const metadata = {
|
|
165
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
166
|
+
method: "GET",
|
|
167
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug",
|
|
168
|
+
packageName: PACKAGE_NAME,
|
|
169
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
170
|
+
protoPath: "/v2/collections/slug/{slug}",
|
|
171
|
+
data: payload,
|
|
172
|
+
host
|
|
173
|
+
}),
|
|
174
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
175
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
176
|
+
{
|
|
177
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
178
|
+
paths: [{ path: "collection.lastUpdated" }]
|
|
179
|
+
}
|
|
180
|
+
])
|
|
181
|
+
};
|
|
182
|
+
return metadata;
|
|
183
|
+
}
|
|
184
|
+
return __getCollectionBySlug;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
188
|
+
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
189
|
+
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
190
|
+
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
191
|
+
MediaItemType2["image"] = "image";
|
|
192
|
+
MediaItemType2["video"] = "video";
|
|
193
|
+
MediaItemType2["audio"] = "audio";
|
|
194
|
+
MediaItemType2["document"] = "document";
|
|
195
|
+
MediaItemType2["zip"] = "zip";
|
|
196
|
+
return MediaItemType2;
|
|
197
|
+
})(MediaItemType || {});
|
|
198
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
199
|
+
SortOrder2["ASC"] = "ASC";
|
|
200
|
+
SortOrder2["DESC"] = "DESC";
|
|
201
|
+
return SortOrder2;
|
|
202
|
+
})(SortOrder || {});
|
|
203
|
+
function queryCollections2() {
|
|
204
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
205
|
+
return (0, import_query_builder.queryBuilder)({
|
|
206
|
+
func: async (payload) => {
|
|
207
|
+
const reqOpts = queryCollections(payload);
|
|
208
|
+
sideEffects?.onSiteCall?.();
|
|
209
|
+
try {
|
|
210
|
+
const result = await httpClient.request(reqOpts);
|
|
211
|
+
sideEffects?.onSuccess?.(result);
|
|
212
|
+
return result;
|
|
213
|
+
} catch (err) {
|
|
214
|
+
sideEffects?.onError?.(err);
|
|
215
|
+
throw err;
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
requestTransformer: (query) => {
|
|
219
|
+
const args = [query, {}];
|
|
220
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
221
|
+
...args?.[1],
|
|
222
|
+
query: args?.[0]
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
responseTransformer: ({ data }) => {
|
|
226
|
+
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
227
|
+
(0, import_transform_paths2.transformPaths)(data, [])
|
|
228
|
+
);
|
|
229
|
+
return {
|
|
230
|
+
items: transformedData?.collections,
|
|
231
|
+
pagingMetadata: transformedData?.metadata
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
errorTransformer: (err) => {
|
|
235
|
+
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
236
|
+
spreadPathsToArguments: {},
|
|
237
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
238
|
+
singleArgumentUnchanged: false
|
|
239
|
+
});
|
|
240
|
+
throw transformedError;
|
|
241
|
+
},
|
|
242
|
+
pagingMethod: "OFFSET",
|
|
243
|
+
transformationPaths: {}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
async function getCollection2(_id) {
|
|
247
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
248
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
249
|
+
const reqOpts = getCollection(payload);
|
|
250
|
+
sideEffects?.onSiteCall?.();
|
|
251
|
+
try {
|
|
252
|
+
const result = await httpClient.request(reqOpts);
|
|
253
|
+
sideEffects?.onSuccess?.(result);
|
|
254
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.collection;
|
|
255
|
+
} catch (err) {
|
|
256
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
257
|
+
err,
|
|
258
|
+
{
|
|
259
|
+
spreadPathsToArguments: {},
|
|
260
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
261
|
+
singleArgumentUnchanged: false
|
|
262
|
+
},
|
|
263
|
+
["_id"]
|
|
264
|
+
);
|
|
265
|
+
sideEffects?.onError?.(err);
|
|
266
|
+
throw transformedError;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
async function getCollectionBySlug2(slug) {
|
|
270
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
271
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ slug });
|
|
272
|
+
const reqOpts = getCollectionBySlug(payload);
|
|
273
|
+
sideEffects?.onSiteCall?.();
|
|
274
|
+
try {
|
|
275
|
+
const result = await httpClient.request(reqOpts);
|
|
276
|
+
sideEffects?.onSuccess?.(result);
|
|
277
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
278
|
+
} catch (err) {
|
|
279
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
280
|
+
err,
|
|
281
|
+
{
|
|
282
|
+
spreadPathsToArguments: {},
|
|
283
|
+
explicitPathsToArguments: { slug: "$[0]" },
|
|
284
|
+
singleArgumentUnchanged: false
|
|
285
|
+
},
|
|
286
|
+
["slug"]
|
|
287
|
+
);
|
|
288
|
+
sideEffects?.onError?.(err);
|
|
289
|
+
throw transformedError;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// src/stores-catalog-v1-collection-collections.public.ts
|
|
294
|
+
function queryCollections3(httpClient) {
|
|
295
|
+
return () => queryCollections2(
|
|
296
|
+
// @ts-ignore
|
|
297
|
+
{ httpClient }
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
function getCollection3(httpClient) {
|
|
301
|
+
return (_id) => getCollection2(
|
|
302
|
+
_id,
|
|
303
|
+
// @ts-ignore
|
|
304
|
+
{ httpClient }
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
function getCollectionBySlug3(httpClient) {
|
|
308
|
+
return (slug) => getCollectionBySlug2(
|
|
309
|
+
slug,
|
|
310
|
+
// @ts-ignore
|
|
311
|
+
{ httpClient }
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// src/stores-catalog-v1-collection-collections.context.ts
|
|
316
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
317
|
+
var queryCollections4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryCollections3);
|
|
318
|
+
var getCollection4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCollection3);
|
|
319
|
+
var getCollectionBySlug4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCollectionBySlug3);
|
|
320
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
321
|
+
0 && (module.exports = {
|
|
322
|
+
MediaItemType,
|
|
323
|
+
SortOrder,
|
|
324
|
+
getCollection,
|
|
325
|
+
getCollectionBySlug,
|
|
326
|
+
queryCollections
|
|
327
|
+
});
|
|
18
328
|
//# sourceMappingURL=index.js.map
|