@wix/auto_sdk_stores_collections 1.0.9 → 1.0.11
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/index.d.mts +34 -0
- package/build/index.d.ts +34 -0
- package/build/index.js +328 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +300 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/index.d.mts +34 -0
- package/build/internal/index.d.ts +34 -0
- package/build/internal/index.js +328 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +300 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/{es/src/stores-catalog-v1-collection-collections.types.d.ts → internal/meta.d.mts} +45 -81
- package/build/internal/{cjs/src/stores-catalog-v1-collection-collections.types.d.ts → meta.d.ts} +45 -81
- package/build/internal/meta.js +241 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +212 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/internal/{cjs/src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-BdGGTv5j.d.mts} +31 -57
- package/build/internal/{es/src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-BdGGTv5j.d.ts} +31 -57
- package/build/{cjs/src/stores-catalog-v1-collection-collections.types.d.ts → meta.d.mts} +45 -81
- package/build/{internal/es/src/stores-catalog-v1-collection-collections.types.d.ts → meta.d.ts} +45 -81
- package/build/meta.js +241 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +212 -0
- package/build/meta.mjs.map +1 -0
- package/build/{cjs/src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-DXVGSHC4.d.mts} +31 -57
- package/build/{es/src/stores-catalog-v1-collection-collections.universal.d.ts → stores-catalog-v1-collection-collections.universal-DXVGSHC4.d.ts} +31 -57
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- 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/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.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/package.json +0 -3
- 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.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.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/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.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.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.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
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import { queryBuilder } from "@wix/sdk-runtime/query-builder";
|
|
4
|
+
import {
|
|
5
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
6
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
7
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
8
|
+
|
|
9
|
+
// src/stores-catalog-v1-collection-collections.http.ts
|
|
10
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
12
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
13
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
14
|
+
function resolveWixCatalogApiV2CollectionReadApiUrl(opts) {
|
|
15
|
+
const domainToMappings = {
|
|
16
|
+
"api._api_base_domain_": [
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
19
|
+
destPath: ""
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"manage._base_domain_": [
|
|
23
|
+
{
|
|
24
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
25
|
+
destPath: ""
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"www.wixapis.com": [
|
|
29
|
+
{
|
|
30
|
+
srcPath: "/stores-reader/v2/collections",
|
|
31
|
+
destPath: "/v2/collections"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
srcPath: "/stores-reader/v2/inventoryItems",
|
|
35
|
+
destPath: "/v2/inventoryItems"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"www._base_domain_": [
|
|
39
|
+
{
|
|
40
|
+
srcPath: "/wix-ecommerce-catalog-reader-web",
|
|
41
|
+
destPath: ""
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"editor._base_domain_": [
|
|
45
|
+
{
|
|
46
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
47
|
+
destPath: ""
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"blocks._base_domain_": [
|
|
51
|
+
{
|
|
52
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
53
|
+
destPath: ""
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"create.editorx": [
|
|
57
|
+
{
|
|
58
|
+
srcPath: "/_api/wix-ecommerce-catalog-reader-web",
|
|
59
|
+
destPath: ""
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
_: [
|
|
63
|
+
{
|
|
64
|
+
srcPath: "/stores-reader/v2/inventoryItems",
|
|
65
|
+
destPath: "/v2/inventoryItems"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
srcPath: "/stores-reader/v2/collections",
|
|
69
|
+
destPath: "/v2/collections"
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
74
|
+
}
|
|
75
|
+
var PACKAGE_NAME = "@wix/auto_sdk_stores_collections";
|
|
76
|
+
function queryCollections(payload) {
|
|
77
|
+
function __queryCollections({ host }) {
|
|
78
|
+
const metadata = {
|
|
79
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
80
|
+
method: "POST",
|
|
81
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.QueryCollections",
|
|
82
|
+
packageName: PACKAGE_NAME,
|
|
83
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
84
|
+
protoPath: "/v2/collections/query",
|
|
85
|
+
data: payload,
|
|
86
|
+
host
|
|
87
|
+
}),
|
|
88
|
+
data: payload,
|
|
89
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
90
|
+
{
|
|
91
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
92
|
+
paths: [{ path: "collections.lastUpdated" }]
|
|
93
|
+
}
|
|
94
|
+
]),
|
|
95
|
+
fallback: [
|
|
96
|
+
{
|
|
97
|
+
method: "POST",
|
|
98
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
99
|
+
protoPath: "/v2/collections/query",
|
|
100
|
+
data: payload,
|
|
101
|
+
host
|
|
102
|
+
}),
|
|
103
|
+
data: payload
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
return metadata;
|
|
108
|
+
}
|
|
109
|
+
return __queryCollections;
|
|
110
|
+
}
|
|
111
|
+
function getCollection(payload) {
|
|
112
|
+
function __getCollection({ host }) {
|
|
113
|
+
const metadata = {
|
|
114
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
115
|
+
method: "GET",
|
|
116
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.GetCollection",
|
|
117
|
+
packageName: PACKAGE_NAME,
|
|
118
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
119
|
+
protoPath: "/v2/collections/{id}",
|
|
120
|
+
data: payload,
|
|
121
|
+
host
|
|
122
|
+
}),
|
|
123
|
+
params: toURLSearchParams(payload),
|
|
124
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
125
|
+
{
|
|
126
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
127
|
+
paths: [{ path: "collection.lastUpdated" }]
|
|
128
|
+
}
|
|
129
|
+
])
|
|
130
|
+
};
|
|
131
|
+
return metadata;
|
|
132
|
+
}
|
|
133
|
+
return __getCollection;
|
|
134
|
+
}
|
|
135
|
+
function getCollectionBySlug(payload) {
|
|
136
|
+
function __getCollectionBySlug({ host }) {
|
|
137
|
+
const metadata = {
|
|
138
|
+
entityFqdn: "wix.stores.catalog.v1.collection",
|
|
139
|
+
method: "GET",
|
|
140
|
+
methodFqn: "wix.catalog.api.v2.CollectionReadApi.GetCollectionBySlug",
|
|
141
|
+
packageName: PACKAGE_NAME,
|
|
142
|
+
url: resolveWixCatalogApiV2CollectionReadApiUrl({
|
|
143
|
+
protoPath: "/v2/collections/slug/{slug}",
|
|
144
|
+
data: payload,
|
|
145
|
+
host
|
|
146
|
+
}),
|
|
147
|
+
params: toURLSearchParams(payload),
|
|
148
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
149
|
+
{
|
|
150
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
151
|
+
paths: [{ path: "collection.lastUpdated" }]
|
|
152
|
+
}
|
|
153
|
+
])
|
|
154
|
+
};
|
|
155
|
+
return metadata;
|
|
156
|
+
}
|
|
157
|
+
return __getCollectionBySlug;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// src/stores-catalog-v1-collection-collections.universal.ts
|
|
161
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
162
|
+
var MediaItemType = /* @__PURE__ */ ((MediaItemType2) => {
|
|
163
|
+
MediaItemType2["unspecified_media_item_type"] = "unspecified_media_item_type";
|
|
164
|
+
MediaItemType2["image"] = "image";
|
|
165
|
+
MediaItemType2["video"] = "video";
|
|
166
|
+
MediaItemType2["audio"] = "audio";
|
|
167
|
+
MediaItemType2["document"] = "document";
|
|
168
|
+
MediaItemType2["zip"] = "zip";
|
|
169
|
+
return MediaItemType2;
|
|
170
|
+
})(MediaItemType || {});
|
|
171
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
172
|
+
SortOrder2["ASC"] = "ASC";
|
|
173
|
+
SortOrder2["DESC"] = "DESC";
|
|
174
|
+
return SortOrder2;
|
|
175
|
+
})(SortOrder || {});
|
|
176
|
+
function queryCollections2() {
|
|
177
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
178
|
+
return queryBuilder({
|
|
179
|
+
func: async (payload) => {
|
|
180
|
+
const reqOpts = queryCollections(payload);
|
|
181
|
+
sideEffects?.onSiteCall?.();
|
|
182
|
+
try {
|
|
183
|
+
const result = await httpClient.request(reqOpts);
|
|
184
|
+
sideEffects?.onSuccess?.(result);
|
|
185
|
+
return result;
|
|
186
|
+
} catch (err) {
|
|
187
|
+
sideEffects?.onError?.(err);
|
|
188
|
+
throw err;
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
requestTransformer: (query) => {
|
|
192
|
+
const args = [query, {}];
|
|
193
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
194
|
+
...args?.[1],
|
|
195
|
+
query: args?.[0]
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
responseTransformer: ({ data }) => {
|
|
199
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
200
|
+
transformPaths2(data, [])
|
|
201
|
+
);
|
|
202
|
+
return {
|
|
203
|
+
items: transformedData?.collections,
|
|
204
|
+
pagingMetadata: transformedData?.metadata
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
errorTransformer: (err) => {
|
|
208
|
+
const transformedError = sdkTransformError(err, {
|
|
209
|
+
spreadPathsToArguments: {},
|
|
210
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
211
|
+
singleArgumentUnchanged: false
|
|
212
|
+
});
|
|
213
|
+
throw transformedError;
|
|
214
|
+
},
|
|
215
|
+
pagingMethod: "OFFSET",
|
|
216
|
+
transformationPaths: {}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
async function getCollection2(_id) {
|
|
220
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
221
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
222
|
+
const reqOpts = getCollection(payload);
|
|
223
|
+
sideEffects?.onSiteCall?.();
|
|
224
|
+
try {
|
|
225
|
+
const result = await httpClient.request(reqOpts);
|
|
226
|
+
sideEffects?.onSuccess?.(result);
|
|
227
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.collection;
|
|
228
|
+
} catch (err) {
|
|
229
|
+
const transformedError = sdkTransformError(
|
|
230
|
+
err,
|
|
231
|
+
{
|
|
232
|
+
spreadPathsToArguments: {},
|
|
233
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
234
|
+
singleArgumentUnchanged: false
|
|
235
|
+
},
|
|
236
|
+
["_id"]
|
|
237
|
+
);
|
|
238
|
+
sideEffects?.onError?.(err);
|
|
239
|
+
throw transformedError;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
async function getCollectionBySlug2(slug) {
|
|
243
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
244
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ slug });
|
|
245
|
+
const reqOpts = getCollectionBySlug(payload);
|
|
246
|
+
sideEffects?.onSiteCall?.();
|
|
247
|
+
try {
|
|
248
|
+
const result = await httpClient.request(reqOpts);
|
|
249
|
+
sideEffects?.onSuccess?.(result);
|
|
250
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
251
|
+
} catch (err) {
|
|
252
|
+
const transformedError = sdkTransformError(
|
|
253
|
+
err,
|
|
254
|
+
{
|
|
255
|
+
spreadPathsToArguments: {},
|
|
256
|
+
explicitPathsToArguments: { slug: "$[0]" },
|
|
257
|
+
singleArgumentUnchanged: false
|
|
258
|
+
},
|
|
259
|
+
["slug"]
|
|
260
|
+
);
|
|
261
|
+
sideEffects?.onError?.(err);
|
|
262
|
+
throw transformedError;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// src/stores-catalog-v1-collection-collections.public.ts
|
|
267
|
+
function queryCollections3(httpClient) {
|
|
268
|
+
return () => queryCollections2(
|
|
269
|
+
// @ts-ignore
|
|
270
|
+
{ httpClient }
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
function getCollection3(httpClient) {
|
|
274
|
+
return (_id) => getCollection2(
|
|
275
|
+
_id,
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
{ httpClient }
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
function getCollectionBySlug3(httpClient) {
|
|
281
|
+
return (slug) => getCollectionBySlug2(
|
|
282
|
+
slug,
|
|
283
|
+
// @ts-ignore
|
|
284
|
+
{ httpClient }
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// src/stores-catalog-v1-collection-collections.context.ts
|
|
289
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
290
|
+
var queryCollections4 = /* @__PURE__ */ createRESTModule(queryCollections3);
|
|
291
|
+
var getCollection4 = /* @__PURE__ */ createRESTModule(getCollection3);
|
|
292
|
+
var getCollectionBySlug4 = /* @__PURE__ */ createRESTModule(getCollectionBySlug3);
|
|
293
|
+
export {
|
|
294
|
+
MediaItemType,
|
|
295
|
+
SortOrder,
|
|
296
|
+
getCollection4 as getCollection,
|
|
297
|
+
getCollectionBySlug4 as getCollectionBySlug,
|
|
298
|
+
queryCollections4 as queryCollections
|
|
299
|
+
};
|
|
300
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../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":["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 { HttpClient, HttpResponse, NonNullablePaths } 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 meta data. 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. */\n custom?: boolean;\n /** Whether the tag is disabled. */\n disabled?: boolean;\n}\n\nexport interface Settings {\n /**\n * Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.\n *\n *\n * Default: `false` (Auto 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\ntype CollectionNonNullablePaths =\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\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 * 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<NonNullablePaths<Collection, CollectionNonNullablePaths>> {\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 {\n [P in CollectionNonNullablePaths]: `collection.${P}`;\n }[CollectionNonNullablePaths]\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: 'POST' as any,\n methodFqn: 'wix.catalog.api.v2.CollectionReadApi.QueryCollections',\n packageName: PACKAGE_NAME,\n url: resolveWixCatalogApiV2CollectionReadApiUrl({\n protoPath: '/v2/collections/query',\n data: payload,\n host,\n }),\n data: payload,\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 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 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 } from '@wix/sdk-types';\nimport {\n Collection,\n CollectionsQueryBuilder,\n GetCollectionBySlugResponse,\n getCollection as universalGetCollection,\n getCollectionBySlug as universalGetCollectionBySlug,\n queryCollections as universalQueryCollections,\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 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<Collection>;\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<GetCollectionBySlugResponse>;\n}\n\nexport {\n Collection,\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 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';\n\nexport const queryCollections: MaybeContext<\n BuildRESTFunction<typeof publicQueryCollections> &\n typeof publicQueryCollections\n> = /*#__PURE__*/ createRESTModule(publicQueryCollections);\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);\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} from './stores-catalog-v1-collection-collections.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,2CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,S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BO,SAASC,kBACd,YAC2B;AAC3B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CAAC,QACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,SACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnDA,SAAS,wBAAwB;AAG1B,IAAMC,oBAGK,iCAAiBA,iBAAsB;AAClD,IAAMC,iBAEK,iCAAiBA,cAAmB;AAC/C,IAAMC,uBAGK,iCAAiBA,oBAAyB;","names":["payload","transformPaths","MediaItemType","SortOrder","queryCollections","getCollection","getCollectionBySlug","queryCollections","getCollection","getCollectionBySlug","queryCollections","getCollection","getCollectionBySlug"]}
|
package/build/{es/src/stores-catalog-v1-collection-collections.types.d.ts → internal/meta.d.mts}
RENAMED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { Q as QueryCollectionsRequest$1, m as QueryCollectionsResponse$1, p as GetCollectionRequest$1, q as GetCollectionResponse$1, r as GetCollectionBySlugRequest$1, G as GetCollectionBySlugResponse$1 } from './stores-catalog-v1-collection-collections.universal-BdGGTv5j.mjs';
|
|
2
|
+
|
|
3
|
+
interface Collection {
|
|
2
4
|
/**
|
|
3
5
|
* Collection ID (generated automatically by the catalog).
|
|
4
6
|
* @minLength 35
|
|
@@ -36,13 +38,13 @@ export interface Collection {
|
|
|
36
38
|
/** Collection visibility. Only impacts dynamic pages, no impact on static pages. Default: `true`. */
|
|
37
39
|
visible?: boolean | null;
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
interface Media {
|
|
40
42
|
/** Primary media (image, video etc) associated with this product. */
|
|
41
43
|
mainMedia?: MediaItem;
|
|
42
44
|
/** Media (images, videos etc) associated with this product. */
|
|
43
45
|
items?: MediaItem[];
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
interface MediaItem extends MediaItemItemOneOf {
|
|
46
48
|
/** Image data (URL, size). */
|
|
47
49
|
image?: MediaItemUrlAndSize;
|
|
48
50
|
/** Video data (URL, size). */
|
|
@@ -57,13 +59,13 @@ export interface MediaItem extends MediaItemItemOneOf {
|
|
|
57
59
|
id?: string;
|
|
58
60
|
}
|
|
59
61
|
/** @oneof */
|
|
60
|
-
|
|
62
|
+
interface MediaItemItemOneOf {
|
|
61
63
|
/** Image data (URL, size). */
|
|
62
64
|
image?: MediaItemUrlAndSize;
|
|
63
65
|
/** Video data (URL, size). */
|
|
64
66
|
video?: MediaItemVideo;
|
|
65
67
|
}
|
|
66
|
-
|
|
68
|
+
interface MediaItemUrlAndSize {
|
|
67
69
|
/**
|
|
68
70
|
* Media item URL.
|
|
69
71
|
* @format WEB_URL
|
|
@@ -78,7 +80,7 @@ export interface MediaItemUrlAndSize {
|
|
|
78
80
|
/** Alt text. This text will be shown in case the image is not available. */
|
|
79
81
|
altText?: string | null;
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
declare enum MediaItemType {
|
|
82
84
|
unspecified_media_item_type = "unspecified_media_item_type",
|
|
83
85
|
/** Image media type. */
|
|
84
86
|
image = "image",
|
|
@@ -92,75 +94,17 @@ export declare enum MediaItemType {
|
|
|
92
94
|
zip = "zip"
|
|
93
95
|
}
|
|
94
96
|
/** @enumType */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
+
type MediaItemTypeWithLiterals = MediaItemType | 'unspecified_media_item_type' | 'image' | 'video' | 'audio' | 'document' | 'zip';
|
|
98
|
+
interface MediaItemVideo {
|
|
97
99
|
/** Data (URL, size) about each resolution for which this video is available. */
|
|
98
100
|
files?: MediaItemUrlAndSize[];
|
|
99
101
|
/** 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"`. */
|
|
100
102
|
stillFrameMediaId?: string;
|
|
101
103
|
}
|
|
102
|
-
|
|
103
|
-
* 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.
|
|
104
|
-
* The search engines use this information for ranking purposes, or to display snippets in the search results.
|
|
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.
|
|
106
|
-
*/
|
|
107
|
-
export interface SeoSchema {
|
|
108
|
-
/** SEO tag information. */
|
|
109
|
-
tags?: Tag[];
|
|
110
|
-
/** SEO general settings. */
|
|
111
|
-
settings?: Settings;
|
|
112
|
-
}
|
|
113
|
-
export interface Keyword {
|
|
114
|
-
/** Keyword value. */
|
|
115
|
-
term?: string;
|
|
116
|
-
/** Whether the keyword is the main focus keyword. */
|
|
117
|
-
isMain?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* The source that added the keyword terms to the SEO settings.
|
|
120
|
-
* @maxLength 1000
|
|
121
|
-
*/
|
|
122
|
-
origin?: string | null;
|
|
123
|
-
}
|
|
124
|
-
export interface Tag {
|
|
125
|
-
/**
|
|
126
|
-
* SEO tag type.
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* Supported values: `title`, `meta`, `script`, `link`.
|
|
130
|
-
*/
|
|
131
|
-
type?: string;
|
|
132
|
-
/**
|
|
133
|
-
* A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value.
|
|
134
|
-
* For example: `{"name": "description", "content": "the description itself"}`.
|
|
135
|
-
*/
|
|
136
|
-
props?: Record<string, any> | null;
|
|
137
|
-
/** SEO tag meta data. For example, `{"height": 300, "width": 240}`. */
|
|
138
|
-
meta?: Record<string, any> | null;
|
|
139
|
-
/** SEO tag inner content. For example, `<title> inner content </title>`. */
|
|
140
|
-
children?: string;
|
|
141
|
-
/** Whether the tag is a custom tag. */
|
|
142
|
-
custom?: boolean;
|
|
143
|
-
/** Whether the tag is disabled. */
|
|
144
|
-
disabled?: boolean;
|
|
145
|
-
}
|
|
146
|
-
export interface Settings {
|
|
147
|
-
/**
|
|
148
|
-
* Whether the Auto Redirect feature, which creates `301 redirects` on a slug change, is enabled.
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
* Default: `false` (Auto Redirect is enabled.)
|
|
152
|
-
*/
|
|
153
|
-
preventAutoRedirect?: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* User-selected keyword terms for a specific page.
|
|
156
|
-
* @maxSize 5
|
|
157
|
-
*/
|
|
158
|
-
keywords?: Keyword[];
|
|
159
|
-
}
|
|
160
|
-
export interface QueryCollectionsRequest {
|
|
104
|
+
interface QueryCollectionsRequest {
|
|
161
105
|
query?: PlatformQuery;
|
|
162
106
|
}
|
|
163
|
-
|
|
107
|
+
interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
164
108
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
165
109
|
paging?: PlatformPaging;
|
|
166
110
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
@@ -171,13 +115,13 @@ export interface PlatformQuery extends PlatformQueryPagingMethodOneOf {
|
|
|
171
115
|
sort?: Sorting[];
|
|
172
116
|
}
|
|
173
117
|
/** @oneof */
|
|
174
|
-
|
|
118
|
+
interface PlatformQueryPagingMethodOneOf {
|
|
175
119
|
/** Pointer to page of results using offset. Cannot be used together with `cursorPaging`. */
|
|
176
120
|
paging?: PlatformPaging;
|
|
177
121
|
/** Cursor pointing to page of results. Cannot be used together with `paging`. `cursorPaging.cursor` can not be used together with `filter` or `sort`. */
|
|
178
122
|
cursorPaging?: CursorPaging;
|
|
179
123
|
}
|
|
180
|
-
|
|
124
|
+
interface Sorting {
|
|
181
125
|
/**
|
|
182
126
|
* Name of the field to sort by.
|
|
183
127
|
* @maxLength 512
|
|
@@ -186,13 +130,13 @@ export interface Sorting {
|
|
|
186
130
|
/** Sort order. */
|
|
187
131
|
order?: SortOrderWithLiterals;
|
|
188
132
|
}
|
|
189
|
-
|
|
133
|
+
declare enum SortOrder {
|
|
190
134
|
ASC = "ASC",
|
|
191
135
|
DESC = "DESC"
|
|
192
136
|
}
|
|
193
137
|
/** @enumType */
|
|
194
|
-
|
|
195
|
-
|
|
138
|
+
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
139
|
+
interface PlatformPaging {
|
|
196
140
|
/**
|
|
197
141
|
* Number of items to load.
|
|
198
142
|
* @max 100
|
|
@@ -201,7 +145,7 @@ export interface PlatformPaging {
|
|
|
201
145
|
/** Number of items to skip in the current sort order. */
|
|
202
146
|
offset?: number | null;
|
|
203
147
|
}
|
|
204
|
-
|
|
148
|
+
interface CursorPaging {
|
|
205
149
|
/**
|
|
206
150
|
* Maximum number of items to return in the results.
|
|
207
151
|
* @max 100
|
|
@@ -216,12 +160,12 @@ export interface CursorPaging {
|
|
|
216
160
|
*/
|
|
217
161
|
cursor?: string | null;
|
|
218
162
|
}
|
|
219
|
-
|
|
163
|
+
interface QueryCollectionsResponse {
|
|
220
164
|
/** @maxSize 100 */
|
|
221
165
|
collections?: Collection[];
|
|
222
166
|
metadata?: PlatformPagingMetadata;
|
|
223
167
|
}
|
|
224
|
-
|
|
168
|
+
interface PlatformPagingMetadata {
|
|
225
169
|
/** The number of items returned in this response. */
|
|
226
170
|
count?: number | null;
|
|
227
171
|
/** The offset which was requested. Returned if offset paging was used. */
|
|
@@ -231,7 +175,7 @@ export interface PlatformPagingMetadata {
|
|
|
231
175
|
/** Cursors to navigate through result pages. Returned if cursor paging was used. */
|
|
232
176
|
cursors?: Cursors;
|
|
233
177
|
}
|
|
234
|
-
|
|
178
|
+
interface Cursors {
|
|
235
179
|
/**
|
|
236
180
|
* Cursor string pointing to the next page in the list of results.
|
|
237
181
|
* @maxLength 16000
|
|
@@ -243,14 +187,14 @@ export interface Cursors {
|
|
|
243
187
|
*/
|
|
244
188
|
prev?: string | null;
|
|
245
189
|
}
|
|
246
|
-
|
|
190
|
+
interface GetCollectionRequest {
|
|
247
191
|
/** Requested collection ID. */
|
|
248
192
|
id: string;
|
|
249
193
|
}
|
|
250
|
-
|
|
194
|
+
interface GetCollectionResponse {
|
|
251
195
|
collection?: Collection;
|
|
252
196
|
}
|
|
253
|
-
|
|
197
|
+
interface GetCollectionBySlugRequest {
|
|
254
198
|
/**
|
|
255
199
|
* Slug of the collection to retrieve.
|
|
256
200
|
* @minLength 1
|
|
@@ -258,7 +202,27 @@ export interface GetCollectionBySlugRequest {
|
|
|
258
202
|
*/
|
|
259
203
|
slug: string;
|
|
260
204
|
}
|
|
261
|
-
|
|
205
|
+
interface GetCollectionBySlugResponse {
|
|
262
206
|
/** The requested collection. */
|
|
263
207
|
collection?: Collection;
|
|
264
208
|
}
|
|
209
|
+
|
|
210
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
211
|
+
getUrl: (context: any) => string;
|
|
212
|
+
httpMethod: K;
|
|
213
|
+
path: string;
|
|
214
|
+
pathParams: M;
|
|
215
|
+
__requestType: T;
|
|
216
|
+
__originalRequestType: S;
|
|
217
|
+
__responseType: Q;
|
|
218
|
+
__originalResponseType: R;
|
|
219
|
+
};
|
|
220
|
+
declare function queryCollections(): __PublicMethodMetaInfo<'GET', {}, QueryCollectionsRequest$1, QueryCollectionsRequest, QueryCollectionsResponse$1, QueryCollectionsResponse>;
|
|
221
|
+
declare function getCollection(): __PublicMethodMetaInfo<'GET', {
|
|
222
|
+
id: string;
|
|
223
|
+
}, GetCollectionRequest$1, GetCollectionRequest, GetCollectionResponse$1, GetCollectionResponse>;
|
|
224
|
+
declare function getCollectionBySlug(): __PublicMethodMetaInfo<'GET', {
|
|
225
|
+
slug: string;
|
|
226
|
+
}, GetCollectionBySlugRequest$1, GetCollectionBySlugRequest, GetCollectionBySlugResponse$1, GetCollectionBySlugResponse>;
|
|
227
|
+
|
|
228
|
+
export { type __PublicMethodMetaInfo, getCollection, getCollectionBySlug, queryCollections };
|