@wix/auto_sdk_stores_collections 1.0.36 → 1.0.38
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 +6 -2
- package/build/cjs/index.js +531 -11
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +523 -3
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +6 -2
- package/build/es/index.mjs +521 -11
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +513 -3
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +6 -2
- package/build/internal/cjs/index.js +531 -11
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +523 -3
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +6 -2
- package/build/internal/es/index.mjs +521 -11
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +513 -3
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@
|
|
|
2
2
|
import { Collection, GetCollectionBySlugResponse, CollectionsQueryBuilder, CollectionQuery, typedQueryCollections } from './index.typings.js';
|
|
3
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
|
-
declare function getCollection$1(httpClient: HttpClient
|
|
5
|
+
declare function getCollection$1(httpClient: HttpClient, __options?: {
|
|
6
|
+
validateRequestSchema?: boolean;
|
|
7
|
+
}): GetCollectionSignature;
|
|
6
8
|
interface GetCollectionSignature {
|
|
7
9
|
/**
|
|
8
10
|
* Retrieves a collection with the provided ID.
|
|
@@ -10,7 +12,9 @@ interface GetCollectionSignature {
|
|
|
10
12
|
*/
|
|
11
13
|
(_id: string): Promise<NonNullablePaths<Collection, `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`, 5>>;
|
|
12
14
|
}
|
|
13
|
-
declare function getCollectionBySlug$1(httpClient: HttpClient
|
|
15
|
+
declare function getCollectionBySlug$1(httpClient: HttpClient, __options?: {
|
|
16
|
+
validateRequestSchema?: boolean;
|
|
17
|
+
}): GetCollectionBySlugSignature;
|
|
14
18
|
interface GetCollectionBySlugSignature {
|
|
15
19
|
/**
|
|
16
20
|
* Retrieves a collection with the provided slug.
|
package/build/cjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// index.ts
|
|
@@ -196,6 +206,507 @@ function getCollectionBySlug(payload) {
|
|
|
196
206
|
|
|
197
207
|
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
198
208
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
209
|
+
|
|
210
|
+
// src/stores-catalog-v1-collection-collections.schemas.ts
|
|
211
|
+
var z = __toESM(require("zod"));
|
|
212
|
+
var QueryCollectionsRequest = z.object({
|
|
213
|
+
query: z.intersection(
|
|
214
|
+
z.object({
|
|
215
|
+
filter: z.record(z.string(), z.any()).describe("Filter object.").optional().nullable(),
|
|
216
|
+
sort: z.array(
|
|
217
|
+
z.object({
|
|
218
|
+
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
219
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
220
|
+
})
|
|
221
|
+
).optional()
|
|
222
|
+
}),
|
|
223
|
+
z.xor([
|
|
224
|
+
z.object({
|
|
225
|
+
paging: z.never().optional(),
|
|
226
|
+
cursorPaging: z.never().optional()
|
|
227
|
+
}),
|
|
228
|
+
z.object({
|
|
229
|
+
cursorPaging: z.never().optional(),
|
|
230
|
+
paging: z.object({
|
|
231
|
+
limit: z.number().int().describe("Number of items to load.").min(0).max(100).optional().nullable(),
|
|
232
|
+
offset: z.number().int().describe("Number of items to skip in the current sort order.").min(0).optional().nullable()
|
|
233
|
+
}).describe(
|
|
234
|
+
"Pointer to page of results using offset. Cannot be used together with `cursorPaging`."
|
|
235
|
+
)
|
|
236
|
+
}),
|
|
237
|
+
z.object({
|
|
238
|
+
paging: z.never().optional(),
|
|
239
|
+
cursorPaging: z.object({
|
|
240
|
+
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(100).optional().nullable(),
|
|
241
|
+
cursor: z.string().describe(
|
|
242
|
+
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
243
|
+
).max(16e3).optional().nullable()
|
|
244
|
+
}).describe(
|
|
245
|
+
"Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`."
|
|
246
|
+
)
|
|
247
|
+
})
|
|
248
|
+
])
|
|
249
|
+
)
|
|
250
|
+
});
|
|
251
|
+
var QueryCollectionsResponse = z.object({
|
|
252
|
+
collections: z.array(
|
|
253
|
+
z.object({
|
|
254
|
+
_id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
|
|
255
|
+
name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
|
|
256
|
+
media: z.object({
|
|
257
|
+
mainMedia: z.intersection(
|
|
258
|
+
z.object({
|
|
259
|
+
thumbnail: z.object({
|
|
260
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
261
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
262
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
263
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
264
|
+
altText: z.string().describe(
|
|
265
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
266
|
+
).optional().nullable()
|
|
267
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
268
|
+
mediaType: z.enum([
|
|
269
|
+
"unspecified_media_item_type",
|
|
270
|
+
"image",
|
|
271
|
+
"video",
|
|
272
|
+
"audio",
|
|
273
|
+
"document",
|
|
274
|
+
"zip"
|
|
275
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
276
|
+
title: z.string().describe("Media item title.").optional(),
|
|
277
|
+
_id: z.string().describe(
|
|
278
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
279
|
+
).optional()
|
|
280
|
+
}),
|
|
281
|
+
z.xor([
|
|
282
|
+
z.object({
|
|
283
|
+
image: z.never().optional(),
|
|
284
|
+
video: z.never().optional()
|
|
285
|
+
}),
|
|
286
|
+
z.object({
|
|
287
|
+
video: z.never().optional(),
|
|
288
|
+
image: z.object({
|
|
289
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
290
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
291
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
292
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
293
|
+
altText: z.string().describe(
|
|
294
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
295
|
+
).optional().nullable()
|
|
296
|
+
}).describe("Image data (URL, size).")
|
|
297
|
+
}),
|
|
298
|
+
z.object({
|
|
299
|
+
image: z.never().optional(),
|
|
300
|
+
video: z.object({
|
|
301
|
+
files: z.array(
|
|
302
|
+
z.object({
|
|
303
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
304
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
305
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
306
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
307
|
+
altText: z.string().describe(
|
|
308
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
309
|
+
).optional().nullable()
|
|
310
|
+
})
|
|
311
|
+
).optional(),
|
|
312
|
+
stillFrameMediaId: z.string().describe(
|
|
313
|
+
'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"`.'
|
|
314
|
+
).optional()
|
|
315
|
+
}).describe("Video data (URL, size).")
|
|
316
|
+
})
|
|
317
|
+
])
|
|
318
|
+
).describe(
|
|
319
|
+
"Primary media (image, video etc) associated with this product."
|
|
320
|
+
).optional(),
|
|
321
|
+
items: z.array(
|
|
322
|
+
z.intersection(
|
|
323
|
+
z.object({
|
|
324
|
+
thumbnail: z.object({
|
|
325
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
326
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
327
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
328
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
329
|
+
altText: z.string().describe(
|
|
330
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
331
|
+
).optional().nullable()
|
|
332
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
333
|
+
mediaType: z.enum([
|
|
334
|
+
"unspecified_media_item_type",
|
|
335
|
+
"image",
|
|
336
|
+
"video",
|
|
337
|
+
"audio",
|
|
338
|
+
"document",
|
|
339
|
+
"zip"
|
|
340
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
341
|
+
title: z.string().describe("Media item title.").optional(),
|
|
342
|
+
_id: z.string().describe(
|
|
343
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
344
|
+
).optional()
|
|
345
|
+
}),
|
|
346
|
+
z.xor([
|
|
347
|
+
z.object({
|
|
348
|
+
image: z.never().optional(),
|
|
349
|
+
video: z.never().optional()
|
|
350
|
+
}),
|
|
351
|
+
z.object({
|
|
352
|
+
video: z.never().optional(),
|
|
353
|
+
image: z.object({
|
|
354
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
355
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
356
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
357
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
358
|
+
altText: z.string().describe(
|
|
359
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
360
|
+
).optional().nullable()
|
|
361
|
+
}).describe("Image data (URL, size).")
|
|
362
|
+
}),
|
|
363
|
+
z.object({
|
|
364
|
+
image: z.never().optional(),
|
|
365
|
+
video: z.object({
|
|
366
|
+
files: z.array(
|
|
367
|
+
z.object({
|
|
368
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
369
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
370
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
371
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
372
|
+
altText: z.string().describe(
|
|
373
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
374
|
+
).optional().nullable()
|
|
375
|
+
})
|
|
376
|
+
).optional(),
|
|
377
|
+
stillFrameMediaId: z.string().describe(
|
|
378
|
+
'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"`.'
|
|
379
|
+
).optional()
|
|
380
|
+
}).describe("Video data (URL, size).")
|
|
381
|
+
})
|
|
382
|
+
])
|
|
383
|
+
)
|
|
384
|
+
).optional()
|
|
385
|
+
}).describe(
|
|
386
|
+
"Media items (images, videos etc) associated with this collection. Read only."
|
|
387
|
+
).optional(),
|
|
388
|
+
numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
|
|
389
|
+
description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
|
|
390
|
+
slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
|
|
391
|
+
visible: z.boolean().describe(
|
|
392
|
+
"Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
|
|
393
|
+
).optional().nullable()
|
|
394
|
+
})
|
|
395
|
+
).max(100).optional(),
|
|
396
|
+
metadata: z.object({
|
|
397
|
+
count: z.number().int().describe("The number of items returned in this response.").optional().nullable(),
|
|
398
|
+
offset: z.number().int().describe(
|
|
399
|
+
"The offset which was requested. Returned if offset paging was used."
|
|
400
|
+
).optional().nullable(),
|
|
401
|
+
total: z.number().int().describe(
|
|
402
|
+
"The total number of items that match the query. Returned if offset paging was used."
|
|
403
|
+
).optional().nullable(),
|
|
404
|
+
cursors: z.object({
|
|
405
|
+
next: z.string().describe(
|
|
406
|
+
"Cursor string pointing to the next page in the list of results."
|
|
407
|
+
).max(16e3).optional().nullable(),
|
|
408
|
+
prev: z.string().describe(
|
|
409
|
+
"Cursor pointing to the previous page in the list of results."
|
|
410
|
+
).max(16e3).optional().nullable()
|
|
411
|
+
}).describe(
|
|
412
|
+
"Cursors to navigate through result pages. Returned if cursor paging was used."
|
|
413
|
+
).optional()
|
|
414
|
+
}).optional()
|
|
415
|
+
});
|
|
416
|
+
var GetCollectionRequest = z.object({
|
|
417
|
+
_id: z.string().describe("Requested collection ID.")
|
|
418
|
+
});
|
|
419
|
+
var GetCollectionResponse = z.object({
|
|
420
|
+
_id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
|
|
421
|
+
name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
|
|
422
|
+
media: z.object({
|
|
423
|
+
mainMedia: z.intersection(
|
|
424
|
+
z.object({
|
|
425
|
+
thumbnail: z.object({
|
|
426
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
427
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
428
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
429
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
430
|
+
altText: z.string().describe(
|
|
431
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
432
|
+
).optional().nullable()
|
|
433
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
434
|
+
mediaType: z.enum([
|
|
435
|
+
"unspecified_media_item_type",
|
|
436
|
+
"image",
|
|
437
|
+
"video",
|
|
438
|
+
"audio",
|
|
439
|
+
"document",
|
|
440
|
+
"zip"
|
|
441
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
442
|
+
title: z.string().describe("Media item title.").optional(),
|
|
443
|
+
_id: z.string().describe(
|
|
444
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
445
|
+
).optional()
|
|
446
|
+
}),
|
|
447
|
+
z.xor([
|
|
448
|
+
z.object({
|
|
449
|
+
image: z.never().optional(),
|
|
450
|
+
video: z.never().optional()
|
|
451
|
+
}),
|
|
452
|
+
z.object({
|
|
453
|
+
video: z.never().optional(),
|
|
454
|
+
image: z.object({
|
|
455
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
456
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
457
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
458
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
459
|
+
altText: z.string().describe(
|
|
460
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
461
|
+
).optional().nullable()
|
|
462
|
+
}).describe("Image data (URL, size).")
|
|
463
|
+
}),
|
|
464
|
+
z.object({
|
|
465
|
+
image: z.never().optional(),
|
|
466
|
+
video: z.object({
|
|
467
|
+
files: z.array(
|
|
468
|
+
z.object({
|
|
469
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
470
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
471
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
472
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
473
|
+
altText: z.string().describe(
|
|
474
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
475
|
+
).optional().nullable()
|
|
476
|
+
})
|
|
477
|
+
).optional(),
|
|
478
|
+
stillFrameMediaId: z.string().describe(
|
|
479
|
+
'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"`.'
|
|
480
|
+
).optional()
|
|
481
|
+
}).describe("Video data (URL, size).")
|
|
482
|
+
})
|
|
483
|
+
])
|
|
484
|
+
).describe(
|
|
485
|
+
"Primary media (image, video etc) associated with this product."
|
|
486
|
+
).optional(),
|
|
487
|
+
items: z.array(
|
|
488
|
+
z.intersection(
|
|
489
|
+
z.object({
|
|
490
|
+
thumbnail: z.object({
|
|
491
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
492
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
493
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
494
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
495
|
+
altText: z.string().describe(
|
|
496
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
497
|
+
).optional().nullable()
|
|
498
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
499
|
+
mediaType: z.enum([
|
|
500
|
+
"unspecified_media_item_type",
|
|
501
|
+
"image",
|
|
502
|
+
"video",
|
|
503
|
+
"audio",
|
|
504
|
+
"document",
|
|
505
|
+
"zip"
|
|
506
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
507
|
+
title: z.string().describe("Media item title.").optional(),
|
|
508
|
+
_id: z.string().describe(
|
|
509
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
510
|
+
).optional()
|
|
511
|
+
}),
|
|
512
|
+
z.xor([
|
|
513
|
+
z.object({
|
|
514
|
+
image: z.never().optional(),
|
|
515
|
+
video: z.never().optional()
|
|
516
|
+
}),
|
|
517
|
+
z.object({
|
|
518
|
+
video: z.never().optional(),
|
|
519
|
+
image: z.object({
|
|
520
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
521
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
522
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
523
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
524
|
+
altText: z.string().describe(
|
|
525
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
526
|
+
).optional().nullable()
|
|
527
|
+
}).describe("Image data (URL, size).")
|
|
528
|
+
}),
|
|
529
|
+
z.object({
|
|
530
|
+
image: z.never().optional(),
|
|
531
|
+
video: z.object({
|
|
532
|
+
files: z.array(
|
|
533
|
+
z.object({
|
|
534
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
535
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
536
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
537
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
538
|
+
altText: z.string().describe(
|
|
539
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
540
|
+
).optional().nullable()
|
|
541
|
+
})
|
|
542
|
+
).optional(),
|
|
543
|
+
stillFrameMediaId: z.string().describe(
|
|
544
|
+
'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"`.'
|
|
545
|
+
).optional()
|
|
546
|
+
}).describe("Video data (URL, size).")
|
|
547
|
+
})
|
|
548
|
+
])
|
|
549
|
+
)
|
|
550
|
+
).optional()
|
|
551
|
+
}).describe(
|
|
552
|
+
"Media items (images, videos etc) associated with this collection. Read only."
|
|
553
|
+
).optional(),
|
|
554
|
+
numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
|
|
555
|
+
description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
|
|
556
|
+
slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
|
|
557
|
+
visible: z.boolean().describe(
|
|
558
|
+
"Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
|
|
559
|
+
).optional().nullable()
|
|
560
|
+
});
|
|
561
|
+
var GetCollectionBySlugRequest = z.object({
|
|
562
|
+
slug: z.string().describe("Slug of the collection to retrieve.").min(1).max(100)
|
|
563
|
+
});
|
|
564
|
+
var GetCollectionBySlugResponse = z.object({
|
|
565
|
+
collection: z.object({
|
|
566
|
+
_id: z.string().describe("Collection ID (generated automatically by the catalog).").min(35).max(36).optional().nullable(),
|
|
567
|
+
name: z.string().describe("Collection name.").min(1).max(50).optional().nullable(),
|
|
568
|
+
media: z.object({
|
|
569
|
+
mainMedia: z.intersection(
|
|
570
|
+
z.object({
|
|
571
|
+
thumbnail: z.object({
|
|
572
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
573
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
574
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
575
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
576
|
+
altText: z.string().describe(
|
|
577
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
578
|
+
).optional().nullable()
|
|
579
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
580
|
+
mediaType: z.enum([
|
|
581
|
+
"unspecified_media_item_type",
|
|
582
|
+
"image",
|
|
583
|
+
"video",
|
|
584
|
+
"audio",
|
|
585
|
+
"document",
|
|
586
|
+
"zip"
|
|
587
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
588
|
+
title: z.string().describe("Media item title.").optional(),
|
|
589
|
+
_id: z.string().describe(
|
|
590
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
591
|
+
).optional()
|
|
592
|
+
}),
|
|
593
|
+
z.xor([
|
|
594
|
+
z.object({
|
|
595
|
+
image: z.never().optional(),
|
|
596
|
+
video: z.never().optional()
|
|
597
|
+
}),
|
|
598
|
+
z.object({
|
|
599
|
+
video: z.never().optional(),
|
|
600
|
+
image: z.object({
|
|
601
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
602
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
603
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
604
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
605
|
+
altText: z.string().describe(
|
|
606
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
607
|
+
).optional().nullable()
|
|
608
|
+
}).describe("Image data (URL, size).")
|
|
609
|
+
}),
|
|
610
|
+
z.object({
|
|
611
|
+
image: z.never().optional(),
|
|
612
|
+
video: z.object({
|
|
613
|
+
files: z.array(
|
|
614
|
+
z.object({
|
|
615
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
616
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
617
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
618
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
619
|
+
altText: z.string().describe(
|
|
620
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
621
|
+
).optional().nullable()
|
|
622
|
+
})
|
|
623
|
+
).optional(),
|
|
624
|
+
stillFrameMediaId: z.string().describe(
|
|
625
|
+
'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"`.'
|
|
626
|
+
).optional()
|
|
627
|
+
}).describe("Video data (URL, size).")
|
|
628
|
+
})
|
|
629
|
+
])
|
|
630
|
+
).describe(
|
|
631
|
+
"Primary media (image, video etc) associated with this product."
|
|
632
|
+
).optional(),
|
|
633
|
+
items: z.array(
|
|
634
|
+
z.intersection(
|
|
635
|
+
z.object({
|
|
636
|
+
thumbnail: z.object({
|
|
637
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
638
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
639
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
640
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
641
|
+
altText: z.string().describe(
|
|
642
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
643
|
+
).optional().nullable()
|
|
644
|
+
}).describe("Media item thumbnail details.").optional(),
|
|
645
|
+
mediaType: z.enum([
|
|
646
|
+
"unspecified_media_item_type",
|
|
647
|
+
"image",
|
|
648
|
+
"video",
|
|
649
|
+
"audio",
|
|
650
|
+
"document",
|
|
651
|
+
"zip"
|
|
652
|
+
]).describe("Media item type (image, video, etc.).").optional(),
|
|
653
|
+
title: z.string().describe("Media item title.").optional(),
|
|
654
|
+
_id: z.string().describe(
|
|
655
|
+
'Media ID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).'
|
|
656
|
+
).optional()
|
|
657
|
+
}),
|
|
658
|
+
z.xor([
|
|
659
|
+
z.object({
|
|
660
|
+
image: z.never().optional(),
|
|
661
|
+
video: z.never().optional()
|
|
662
|
+
}),
|
|
663
|
+
z.object({
|
|
664
|
+
video: z.never().optional(),
|
|
665
|
+
image: z.object({
|
|
666
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
667
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
668
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
669
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
670
|
+
altText: z.string().describe(
|
|
671
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
672
|
+
).optional().nullable()
|
|
673
|
+
}).describe("Image data (URL, size).")
|
|
674
|
+
}),
|
|
675
|
+
z.object({
|
|
676
|
+
image: z.never().optional(),
|
|
677
|
+
video: z.object({
|
|
678
|
+
files: z.array(
|
|
679
|
+
z.object({
|
|
680
|
+
url: z.string().describe("Media item URL.").url().optional(),
|
|
681
|
+
width: z.number().int().describe("Media item width.").min(0).optional(),
|
|
682
|
+
height: z.number().int().describe("Media item height.").min(0).optional(),
|
|
683
|
+
format: z.string().describe("Media format (mp4, png, etc.).").optional().nullable(),
|
|
684
|
+
altText: z.string().describe(
|
|
685
|
+
"Alt text. This text will be shown in case the image is not available."
|
|
686
|
+
).optional().nullable()
|
|
687
|
+
})
|
|
688
|
+
).optional(),
|
|
689
|
+
stillFrameMediaId: z.string().describe(
|
|
690
|
+
'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"`.'
|
|
691
|
+
).optional()
|
|
692
|
+
}).describe("Video data (URL, size).")
|
|
693
|
+
})
|
|
694
|
+
])
|
|
695
|
+
)
|
|
696
|
+
).optional()
|
|
697
|
+
}).describe(
|
|
698
|
+
"Media items (images, videos etc) associated with this collection. Read only."
|
|
699
|
+
).optional(),
|
|
700
|
+
numberOfProducts: z.number().int().describe("Number of products in the collection. Read only.").optional(),
|
|
701
|
+
description: z.string().describe("Collection description.").min(0).max(600).optional().nullable(),
|
|
702
|
+
slug: z.string().describe("Collection slug.").min(1).max(100).optional().nullable(),
|
|
703
|
+
visible: z.boolean().describe(
|
|
704
|
+
"Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`."
|
|
705
|
+
).optional().nullable()
|
|
706
|
+
}).describe("The requested collection.").optional()
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
199
710
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
200
711
|
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
201
712
|
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
@@ -255,7 +766,10 @@ function queryCollections2() {
|
|
|
255
766
|
});
|
|
256
767
|
}
|
|
257
768
|
async function typedQueryCollections(query) {
|
|
258
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
769
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
770
|
+
if (validateRequestSchema) {
|
|
771
|
+
QueryCollectionsRequest.parse({ query });
|
|
772
|
+
}
|
|
259
773
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
260
774
|
const reqOpts = queryCollections(payload);
|
|
261
775
|
sideEffects?.onSiteCall?.();
|
|
@@ -283,7 +797,10 @@ var utils = {
|
|
|
283
797
|
}
|
|
284
798
|
};
|
|
285
799
|
async function getCollection2(_id) {
|
|
286
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
800
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
801
|
+
if (validateRequestSchema) {
|
|
802
|
+
GetCollectionRequest.parse({ _id });
|
|
803
|
+
}
|
|
287
804
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
288
805
|
const reqOpts = getCollection(payload);
|
|
289
806
|
sideEffects?.onSiteCall?.();
|
|
@@ -306,7 +823,10 @@ async function getCollection2(_id) {
|
|
|
306
823
|
}
|
|
307
824
|
}
|
|
308
825
|
async function getCollectionBySlug2(slug) {
|
|
309
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
826
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
827
|
+
if (validateRequestSchema) {
|
|
828
|
+
GetCollectionBySlugRequest.parse({ slug });
|
|
829
|
+
}
|
|
310
830
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ slug });
|
|
311
831
|
const reqOpts = getCollectionBySlug(payload);
|
|
312
832
|
sideEffects?.onSiteCall?.();
|
|
@@ -330,31 +850,31 @@ async function getCollectionBySlug2(slug) {
|
|
|
330
850
|
}
|
|
331
851
|
|
|
332
852
|
// src/stores-catalog-v1-collection-collections.public.ts
|
|
333
|
-
function queryCollections3(httpClient) {
|
|
853
|
+
function queryCollections3(httpClient, __options) {
|
|
334
854
|
return () => queryCollections2(
|
|
335
855
|
// @ts-ignore
|
|
336
|
-
{ httpClient }
|
|
856
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
337
857
|
);
|
|
338
858
|
}
|
|
339
|
-
function typedQueryCollections2(httpClient) {
|
|
859
|
+
function typedQueryCollections2(httpClient, __options) {
|
|
340
860
|
return (query) => typedQueryCollections(
|
|
341
861
|
query,
|
|
342
862
|
// @ts-ignore
|
|
343
|
-
{ httpClient }
|
|
863
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
344
864
|
);
|
|
345
865
|
}
|
|
346
|
-
function getCollection3(httpClient) {
|
|
866
|
+
function getCollection3(httpClient, __options) {
|
|
347
867
|
return (_id) => getCollection2(
|
|
348
868
|
_id,
|
|
349
869
|
// @ts-ignore
|
|
350
|
-
{ httpClient }
|
|
870
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
351
871
|
);
|
|
352
872
|
}
|
|
353
|
-
function getCollectionBySlug3(httpClient) {
|
|
873
|
+
function getCollectionBySlug3(httpClient, __options) {
|
|
354
874
|
return (slug) => getCollectionBySlug2(
|
|
355
875
|
slug,
|
|
356
876
|
// @ts-ignore
|
|
357
|
-
{ httpClient }
|
|
877
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
358
878
|
);
|
|
359
879
|
}
|
|
360
880
|
|