@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/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { CreateProductOptions, Product, CreateProductApplicationErrors, UpdateProductOptions, CountProductsOptions, CountProductsResponse, GetProductsStartWithOptions, GetProductsStartWithResponse,
|
|
3
|
-
export { Address, AddressLocation, AddressStreetOneOf, ApplicationError, BulkActionMetadata, BulkCreateProductsRequest, BulkDeleteProductsRequest, BulkDeleteProductsResponseBulkProductResult, BulkProductResult, BulkUpdateProductsRequest, BulkUpdateProductsResponseBulkProductResult, CountProductsRequest, CreateProductRequest, CreateProductResponse, CursorPaging, Cursors, DeleteProductRequest, DeleteProductResponse, FocalPoint, GetProductRequest, GetProductResponse, GetProductsStartWithRequest, ItemMetadata, LinkRel, LinkRelWithLiterals, MyAddress, PageLink, Paging, PagingMetadataV2, ProductsQueryResult, QueryProductsRequest, QueryProductsResponse,
|
|
2
|
+
import { CreateProductOptions, Product, CreateProductApplicationErrors, UpdateProductOptions, CountProductsOptions, CountProductsResponse, GetProductsStartWithOptions, GetProductsStartWithResponse, BulkCreateProductsOptions, BulkCreateProductsResponse, MaskedProduct, BulkUpdateProductsOptions, BulkUpdateProductsResponse, BulkDeleteProductsResponse, QueryV2, typedQueryProducts, QueryProductsOptions, ProductsQueryBuilder } from './index.typings.js';
|
|
3
|
+
export { Address, AddressLocation, AddressStreetOneOf, ApplicationError, BulkActionMetadata, BulkCreateProductsRequest, BulkDeleteProductsRequest, BulkDeleteProductsResponseBulkProductResult, BulkProductResult, BulkUpdateProductsRequest, BulkUpdateProductsResponseBulkProductResult, CountProductsRequest, CreateProductRequest, CreateProductResponse, CursorPaging, Cursors, DeleteProductRequest, DeleteProductResponse, FocalPoint, GetProductRequest, GetProductResponse, GetProductsStartWithRequest, ItemMetadata, LinkRel, LinkRelWithLiterals, MyAddress, PageLink, Paging, PagingMetadataV2, ProductsQueryResult, QueryProductsRequest, QueryProductsResponse, QueryV2PagingMethodOneOf, ResetProductsDbRequest, ResetProductsDbResponse, SortOrder, SortOrderWithLiterals, Sorting, StandardDetails, StreetAddress, Subdivision, SubdivisionType, SubdivisionTypeWithLiterals, UpdateProductRequest, UpdateProductResponse, Variant, VideoResolution } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createProduct$1(httpClient: HttpClient): CreateProductSignature;
|
|
6
6
|
interface CreateProductSignature {
|
|
@@ -40,11 +40,6 @@ interface GetProductsStartWithSignature {
|
|
|
40
40
|
/** */
|
|
41
41
|
(title: string, options?: GetProductsStartWithOptions): Promise<NonNullablePaths<GetProductsStartWithResponse, `products` | `products.${number}._id` | `products.${number}.collectionId` | `products.${number}.address.streetAddress.number` | `products.${number}.address.streetAddress.name` | `products.${number}.pageLink.pageId` | `products.${number}.guid`, 6>>;
|
|
42
42
|
}
|
|
43
|
-
declare function queryProducts$1(httpClient: HttpClient): QueryProductsSignature;
|
|
44
|
-
interface QueryProductsSignature {
|
|
45
|
-
/** */
|
|
46
|
-
(options?: QueryProductsOptions): ProductsQueryBuilder;
|
|
47
|
-
}
|
|
48
43
|
declare function bulkCreateProducts$1(httpClient: HttpClient): BulkCreateProductsSignature;
|
|
49
44
|
interface BulkCreateProductsSignature {
|
|
50
45
|
/**
|
|
@@ -67,15 +62,21 @@ interface BulkDeleteProductsSignature {
|
|
|
67
62
|
(productIds: string[]): Promise<NonNullablePaths<BulkDeleteProductsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
68
63
|
}
|
|
69
64
|
|
|
65
|
+
declare function customQueryProducts(httpClient: HttpClient): {
|
|
66
|
+
(query: QueryV2): ReturnType<typeof typedQueryProducts>;
|
|
67
|
+
(query: QueryV2, options: QueryProductsOptions): ReturnType<typeof typedQueryProducts>;
|
|
68
|
+
(): ProductsQueryBuilder;
|
|
69
|
+
(options: QueryProductsOptions): ProductsQueryBuilder;
|
|
70
|
+
};
|
|
70
71
|
declare const createProduct: MaybeContext<BuildRESTFunction<typeof createProduct$1> & typeof createProduct$1>;
|
|
71
72
|
declare const deleteProduct: MaybeContext<BuildRESTFunction<typeof deleteProduct$1> & typeof deleteProduct$1>;
|
|
72
73
|
declare const updateProduct: MaybeContext<BuildRESTFunction<typeof updateProduct$1> & typeof updateProduct$1>;
|
|
73
74
|
declare const getProduct: MaybeContext<BuildRESTFunction<typeof getProduct$1> & typeof getProduct$1>;
|
|
74
75
|
declare const countProducts: MaybeContext<BuildRESTFunction<typeof countProducts$1> & typeof countProducts$1>;
|
|
75
76
|
declare const getProductsStartWith: MaybeContext<BuildRESTFunction<typeof getProductsStartWith$1> & typeof getProductsStartWith$1>;
|
|
76
|
-
declare const queryProducts: MaybeContext<BuildRESTFunction<typeof queryProducts$1> & typeof queryProducts$1>;
|
|
77
77
|
declare const bulkCreateProducts: MaybeContext<BuildRESTFunction<typeof bulkCreateProducts$1> & typeof bulkCreateProducts$1>;
|
|
78
78
|
declare const bulkUpdateProducts: MaybeContext<BuildRESTFunction<typeof bulkUpdateProducts$1> & typeof bulkUpdateProducts$1>;
|
|
79
79
|
declare const bulkDeleteProducts: MaybeContext<BuildRESTFunction<typeof bulkDeleteProducts$1> & typeof bulkDeleteProducts$1>;
|
|
80
|
+
declare const queryProducts: MaybeContext<BuildRESTFunction<typeof customQueryProducts> & typeof customQueryProducts>;
|
|
80
81
|
|
|
81
|
-
export { BulkCreateProductsOptions, BulkCreateProductsResponse, BulkDeleteProductsResponse, BulkUpdateProductsOptions, BulkUpdateProductsResponse, CountProductsOptions, CountProductsResponse, CreateProductApplicationErrors, CreateProductOptions, GetProductsStartWithOptions, GetProductsStartWithResponse, MaskedProduct, Product, ProductsQueryBuilder, QueryProductsOptions, UpdateProductOptions, bulkCreateProducts, bulkDeleteProducts, bulkUpdateProducts, countProducts, createProduct, deleteProduct, getProduct, getProductsStartWith, queryProducts, updateProduct };
|
|
82
|
+
export { BulkCreateProductsOptions, BulkCreateProductsResponse, BulkDeleteProductsResponse, BulkUpdateProductsOptions, BulkUpdateProductsResponse, CountProductsOptions, CountProductsResponse, CreateProductApplicationErrors, CreateProductOptions, GetProductsStartWithOptions, GetProductsStartWithResponse, MaskedProduct, Product, ProductsQueryBuilder, QueryProductsOptions, QueryV2, UpdateProductOptions, bulkCreateProducts, bulkDeleteProducts, bulkUpdateProducts, countProducts, createProduct, deleteProduct, getProduct, getProductsStartWith, queryProducts, updateProduct };
|
package/build/cjs/index.js
CHANGED
|
@@ -1234,6 +1234,62 @@ function queryProducts2(options) {
|
|
|
1234
1234
|
transformationPaths: {}
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
+
async function typedQueryProducts(query, options) {
|
|
1238
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1239
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1240
|
+
query,
|
|
1241
|
+
...options
|
|
1242
|
+
});
|
|
1243
|
+
const reqOpts = queryProducts(payload);
|
|
1244
|
+
sideEffects?.onSiteCall?.();
|
|
1245
|
+
try {
|
|
1246
|
+
const result = await httpClient.request(reqOpts);
|
|
1247
|
+
sideEffects?.onSuccess?.(result);
|
|
1248
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
1249
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
1250
|
+
{
|
|
1251
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
1252
|
+
paths: [
|
|
1253
|
+
{ path: "products.image" },
|
|
1254
|
+
{ path: "products.variants.image" },
|
|
1255
|
+
{ path: "products.mainVariant.image" }
|
|
1256
|
+
]
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
transformFn: import_address2.transformRESTAddressToSDKAddress,
|
|
1260
|
+
paths: [
|
|
1261
|
+
{ path: "products.address" },
|
|
1262
|
+
{ path: "products.customAddress" }
|
|
1263
|
+
]
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
transformFn: import_document2.transformRESTDocumentToSDKDocument,
|
|
1267
|
+
paths: [{ path: "products.document" }]
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
|
|
1271
|
+
paths: [{ path: "products.video" }]
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
transformFn: import_audio2.transformRESTAudioToSDKAudio,
|
|
1275
|
+
paths: [{ path: "products.audio" }]
|
|
1276
|
+
}
|
|
1277
|
+
])
|
|
1278
|
+
);
|
|
1279
|
+
} catch (err) {
|
|
1280
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
1281
|
+
err,
|
|
1282
|
+
{
|
|
1283
|
+
spreadPathsToArguments: {},
|
|
1284
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
1285
|
+
singleArgumentUnchanged: false
|
|
1286
|
+
},
|
|
1287
|
+
["query", "options"]
|
|
1288
|
+
);
|
|
1289
|
+
sideEffects?.onError?.(err);
|
|
1290
|
+
throw transformedError;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1237
1293
|
async function bulkCreateProducts2(products, options) {
|
|
1238
1294
|
const { httpClient, sideEffects } = arguments[2];
|
|
1239
1295
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
@@ -1492,6 +1548,14 @@ function queryProducts3(httpClient) {
|
|
|
1492
1548
|
{ httpClient }
|
|
1493
1549
|
);
|
|
1494
1550
|
}
|
|
1551
|
+
function typedQueryProducts2(httpClient) {
|
|
1552
|
+
return (query, options) => typedQueryProducts(
|
|
1553
|
+
query,
|
|
1554
|
+
options,
|
|
1555
|
+
// @ts-ignore
|
|
1556
|
+
{ httpClient }
|
|
1557
|
+
);
|
|
1558
|
+
}
|
|
1495
1559
|
function bulkCreateProducts3(httpClient) {
|
|
1496
1560
|
return (products, options) => bulkCreateProducts2(
|
|
1497
1561
|
products,
|
|
@@ -1518,16 +1582,28 @@ function bulkDeleteProducts3(httpClient) {
|
|
|
1518
1582
|
|
|
1519
1583
|
// src/metroinspector-v1-product-products.context.ts
|
|
1520
1584
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
1585
|
+
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
1586
|
+
function customQueryProducts(httpClient) {
|
|
1587
|
+
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
1588
|
+
builderQueryFunction: (options) => queryProducts3(httpClient)(options),
|
|
1589
|
+
typedQueryFunction: (query, options) => typedQueryProducts2(httpClient)(query, options),
|
|
1590
|
+
hasOptionsParameter: true
|
|
1591
|
+
});
|
|
1592
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
1593
|
+
return router(...arguments);
|
|
1594
|
+
}
|
|
1595
|
+
return overloadedQuery;
|
|
1596
|
+
}
|
|
1521
1597
|
var createProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createProduct3);
|
|
1522
1598
|
var deleteProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteProduct3);
|
|
1523
1599
|
var updateProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateProduct3);
|
|
1524
1600
|
var getProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProduct3);
|
|
1525
1601
|
var countProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(countProducts3);
|
|
1526
1602
|
var getProductsStartWith4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductsStartWith3);
|
|
1527
|
-
var queryProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryProducts3);
|
|
1528
1603
|
var bulkCreateProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateProducts3);
|
|
1529
1604
|
var bulkUpdateProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateProducts3);
|
|
1530
1605
|
var bulkDeleteProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteProducts3);
|
|
1606
|
+
var queryProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryProducts);
|
|
1531
1607
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1532
1608
|
0 && (module.exports = {
|
|
1533
1609
|
LinkRel,
|