@wix/auto_sdk_metro_products 1.0.6 → 1.0.8

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.
@@ -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, QueryProductsOptions, ProductsQueryBuilder, BulkCreateProductsOptions, BulkCreateProductsResponse, MaskedProduct, BulkUpdateProductsOptions, BulkUpdateProductsResponse, BulkDeleteProductsResponse } 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, QueryV2, QueryV2PagingMethodOneOf, ResetProductsDbRequest, ResetProductsDbResponse, SortOrder, SortOrderWithLiterals, Sorting, StandardDetails, StreetAddress, Subdivision, SubdivisionType, SubdivisionTypeWithLiterals, UpdateProductRequest, UpdateProductResponse, Variant, VideoResolution } from './index.typings.js';
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 };
@@ -127,6 +127,12 @@ function resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl(opts)
127
127
  srcPath: "/_api/metro-inspector",
128
128
  destPath: "/api"
129
129
  }
130
+ ],
131
+ "dev._base_domain_": [
132
+ {
133
+ srcPath: "/_api/metro-inspector",
134
+ destPath: ""
135
+ }
130
136
  ]
131
137
  };
132
138
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -1234,6 +1240,62 @@ function queryProducts2(options) {
1234
1240
  transformationPaths: {}
1235
1241
  });
1236
1242
  }
1243
+ async function typedQueryProducts(query, options) {
1244
+ const { httpClient, sideEffects } = arguments[2];
1245
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1246
+ query,
1247
+ ...options
1248
+ });
1249
+ const reqOpts = queryProducts(payload);
1250
+ sideEffects?.onSiteCall?.();
1251
+ try {
1252
+ const result = await httpClient.request(reqOpts);
1253
+ sideEffects?.onSuccess?.(result);
1254
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1255
+ (0, import_transform_paths2.transformPaths)(result.data, [
1256
+ {
1257
+ transformFn: import_image2.transformRESTImageToSDKImage,
1258
+ paths: [
1259
+ { path: "products.image" },
1260
+ { path: "products.variants.image" },
1261
+ { path: "products.mainVariant.image" }
1262
+ ]
1263
+ },
1264
+ {
1265
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1266
+ paths: [
1267
+ { path: "products.address" },
1268
+ { path: "products.customAddress" }
1269
+ ]
1270
+ },
1271
+ {
1272
+ transformFn: import_document2.transformRESTDocumentToSDKDocument,
1273
+ paths: [{ path: "products.document" }]
1274
+ },
1275
+ {
1276
+ transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1277
+ paths: [{ path: "products.video" }]
1278
+ },
1279
+ {
1280
+ transformFn: import_audio2.transformRESTAudioToSDKAudio,
1281
+ paths: [{ path: "products.audio" }]
1282
+ }
1283
+ ])
1284
+ );
1285
+ } catch (err) {
1286
+ const transformedError = (0, import_transform_error.transformError)(
1287
+ err,
1288
+ {
1289
+ spreadPathsToArguments: {},
1290
+ explicitPathsToArguments: { query: "$[0]" },
1291
+ singleArgumentUnchanged: false
1292
+ },
1293
+ ["query", "options"]
1294
+ );
1295
+ sideEffects?.onError?.(err);
1296
+ throw transformedError;
1297
+ }
1298
+ }
1237
1299
  async function bulkCreateProducts2(products, options) {
1238
1300
  const { httpClient, sideEffects } = arguments[2];
1239
1301
  const payload = (0, import_transform_paths2.transformPaths)(
@@ -1492,6 +1554,14 @@ function queryProducts3(httpClient) {
1492
1554
  { httpClient }
1493
1555
  );
1494
1556
  }
1557
+ function typedQueryProducts2(httpClient) {
1558
+ return (query, options) => typedQueryProducts(
1559
+ query,
1560
+ options,
1561
+ // @ts-ignore
1562
+ { httpClient }
1563
+ );
1564
+ }
1495
1565
  function bulkCreateProducts3(httpClient) {
1496
1566
  return (products, options) => bulkCreateProducts2(
1497
1567
  products,
@@ -1518,16 +1588,28 @@ function bulkDeleteProducts3(httpClient) {
1518
1588
 
1519
1589
  // src/metroinspector-v1-product-products.context.ts
1520
1590
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1591
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
1592
+ function customQueryProducts(httpClient) {
1593
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
1594
+ builderQueryFunction: (options) => queryProducts3(httpClient)(options),
1595
+ typedQueryFunction: (query, options) => typedQueryProducts2(httpClient)(query, options),
1596
+ hasOptionsParameter: true
1597
+ });
1598
+ function overloadedQuery(queryOrOptions, options) {
1599
+ return router(...arguments);
1600
+ }
1601
+ return overloadedQuery;
1602
+ }
1521
1603
  var createProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createProduct3);
1522
1604
  var deleteProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteProduct3);
1523
1605
  var updateProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateProduct3);
1524
1606
  var getProduct4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProduct3);
1525
1607
  var countProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(countProducts3);
1526
1608
  var getProductsStartWith4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getProductsStartWith3);
1527
- var queryProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryProducts3);
1528
1609
  var bulkCreateProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateProducts3);
1529
1610
  var bulkUpdateProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkUpdateProducts3);
1530
1611
  var bulkDeleteProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkDeleteProducts3);
1612
+ var queryProducts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryProducts);
1531
1613
  // Annotate the CommonJS export names for ESM import in node:
1532
1614
  0 && (module.exports = {
1533
1615
  LinkRel,