@wix/auto_sdk_metro_products 1.0.5 → 1.0.7
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 +10 -9
- package/build/cjs/index.js +77 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -1
- package/build/cjs/index.typings.js +58 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +58 -1
- package/build/cjs/meta.js +31 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +10 -9
- package/build/es/index.mjs +77 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +7 -1
- package/build/es/index.typings.mjs +57 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +58 -1
- package/build/es/meta.mjs +28 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +10 -9
- package/build/internal/cjs/index.js +77 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +7 -1
- package/build/internal/cjs/index.typings.js +58 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +58 -1
- package/build/internal/cjs/meta.js +31 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +10 -9
- package/build/internal/es/index.mjs +77 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +7 -1
- package/build/internal/es/index.typings.mjs +57 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +58 -1
- package/build/internal/es/meta.mjs +28 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
package/build/es/index.mjs
CHANGED
|
@@ -1199,6 +1199,62 @@ function queryProducts2(options) {
|
|
|
1199
1199
|
transformationPaths: {}
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
+
async function typedQueryProducts(query, options) {
|
|
1203
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1204
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1205
|
+
query,
|
|
1206
|
+
...options
|
|
1207
|
+
});
|
|
1208
|
+
const reqOpts = queryProducts(payload);
|
|
1209
|
+
sideEffects?.onSiteCall?.();
|
|
1210
|
+
try {
|
|
1211
|
+
const result = await httpClient.request(reqOpts);
|
|
1212
|
+
sideEffects?.onSuccess?.(result);
|
|
1213
|
+
return renameKeysFromRESTResponseToSDKResponse(
|
|
1214
|
+
transformPaths2(result.data, [
|
|
1215
|
+
{
|
|
1216
|
+
transformFn: transformRESTImageToSDKImage,
|
|
1217
|
+
paths: [
|
|
1218
|
+
{ path: "products.image" },
|
|
1219
|
+
{ path: "products.variants.image" },
|
|
1220
|
+
{ path: "products.mainVariant.image" }
|
|
1221
|
+
]
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
transformFn: transformRESTAddressToSDKAddress,
|
|
1225
|
+
paths: [
|
|
1226
|
+
{ path: "products.address" },
|
|
1227
|
+
{ path: "products.customAddress" }
|
|
1228
|
+
]
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
transformFn: transformRESTDocumentToSDKDocument,
|
|
1232
|
+
paths: [{ path: "products.document" }]
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
|
1236
|
+
paths: [{ path: "products.video" }]
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
transformFn: transformRESTAudioToSDKAudio,
|
|
1240
|
+
paths: [{ path: "products.audio" }]
|
|
1241
|
+
}
|
|
1242
|
+
])
|
|
1243
|
+
);
|
|
1244
|
+
} catch (err) {
|
|
1245
|
+
const transformedError = sdkTransformError(
|
|
1246
|
+
err,
|
|
1247
|
+
{
|
|
1248
|
+
spreadPathsToArguments: {},
|
|
1249
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1250
|
+
singleArgumentUnchanged: false
|
|
1251
|
+
},
|
|
1252
|
+
["query", "options"]
|
|
1253
|
+
);
|
|
1254
|
+
sideEffects?.onError?.(err);
|
|
1255
|
+
throw transformedError;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1202
1258
|
async function bulkCreateProducts2(products, options) {
|
|
1203
1259
|
const { httpClient, sideEffects } = arguments[2];
|
|
1204
1260
|
const payload = transformPaths2(
|
|
@@ -1457,6 +1513,14 @@ function queryProducts3(httpClient) {
|
|
|
1457
1513
|
{ httpClient }
|
|
1458
1514
|
);
|
|
1459
1515
|
}
|
|
1516
|
+
function typedQueryProducts2(httpClient) {
|
|
1517
|
+
return (query, options) => typedQueryProducts(
|
|
1518
|
+
query,
|
|
1519
|
+
options,
|
|
1520
|
+
// @ts-ignore
|
|
1521
|
+
{ httpClient }
|
|
1522
|
+
);
|
|
1523
|
+
}
|
|
1460
1524
|
function bulkCreateProducts3(httpClient) {
|
|
1461
1525
|
return (products, options) => bulkCreateProducts2(
|
|
1462
1526
|
products,
|
|
@@ -1483,16 +1547,28 @@ function bulkDeleteProducts3(httpClient) {
|
|
|
1483
1547
|
|
|
1484
1548
|
// src/metroinspector-v1-product-products.context.ts
|
|
1485
1549
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
1550
|
+
import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
|
|
1551
|
+
function customQueryProducts(httpClient) {
|
|
1552
|
+
const router = createQueryOverloadRouter({
|
|
1553
|
+
builderQueryFunction: (options) => queryProducts3(httpClient)(options),
|
|
1554
|
+
typedQueryFunction: (query, options) => typedQueryProducts2(httpClient)(query, options),
|
|
1555
|
+
hasOptionsParameter: true
|
|
1556
|
+
});
|
|
1557
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1558
|
+
return router(...arguments);
|
|
1559
|
+
}
|
|
1560
|
+
return overloadedQuery;
|
|
1561
|
+
}
|
|
1486
1562
|
var createProduct4 = /* @__PURE__ */ createRESTModule(createProduct3);
|
|
1487
1563
|
var deleteProduct4 = /* @__PURE__ */ createRESTModule(deleteProduct3);
|
|
1488
1564
|
var updateProduct4 = /* @__PURE__ */ createRESTModule(updateProduct3);
|
|
1489
1565
|
var getProduct4 = /* @__PURE__ */ createRESTModule(getProduct3);
|
|
1490
1566
|
var countProducts4 = /* @__PURE__ */ createRESTModule(countProducts3);
|
|
1491
1567
|
var getProductsStartWith4 = /* @__PURE__ */ createRESTModule(getProductsStartWith3);
|
|
1492
|
-
var queryProducts4 = /* @__PURE__ */ createRESTModule(queryProducts3);
|
|
1493
1568
|
var bulkCreateProducts4 = /* @__PURE__ */ createRESTModule(bulkCreateProducts3);
|
|
1494
1569
|
var bulkUpdateProducts4 = /* @__PURE__ */ createRESTModule(bulkUpdateProducts3);
|
|
1495
1570
|
var bulkDeleteProducts4 = /* @__PURE__ */ createRESTModule(bulkDeleteProducts3);
|
|
1571
|
+
var queryProducts4 = /* @__PURE__ */ createRESTModule(customQueryProducts);
|
|
1496
1572
|
export {
|
|
1497
1573
|
LinkRel,
|
|
1498
1574
|
SortOrder,
|