@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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +10 -9
  2. package/build/cjs/index.js +77 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +7 -1
  5. package/build/cjs/index.typings.js +58 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +58 -1
  8. package/build/cjs/meta.js +31 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +10 -9
  11. package/build/es/index.mjs +77 -1
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +7 -1
  14. package/build/es/index.typings.mjs +57 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +58 -1
  17. package/build/es/meta.mjs +28 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +10 -9
  20. package/build/internal/cjs/index.js +77 -1
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +7 -1
  23. package/build/internal/cjs/index.typings.js +58 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +58 -1
  26. package/build/internal/cjs/meta.js +31 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +10 -9
  29. package/build/internal/es/index.mjs +77 -1
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +7 -1
  32. package/build/internal/es/index.typings.mjs +57 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +58 -1
  35. package/build/internal/es/meta.mjs +28 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -541,6 +541,12 @@ interface ProductsQueryBuilder {
541
541
  skipTo: (cursor: string) => ProductsQueryBuilder;
542
542
  find: () => Promise<ProductsQueryResult>;
543
543
  }
544
+ /**
545
+ * @hidden
546
+ * @fqn wix.coreservices.metroinspector.v1.products.ProductsService.QueryProducts
547
+ * @requiredField query
548
+ */
549
+ declare function typedQueryProducts(query: QueryV2, options?: QueryProductsOptions): Promise<NonNullablePaths<QueryProductsResponse, `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>>;
544
550
  /**
545
551
  * create multiple products in a single request. Works synchronously
546
552
  * @public
@@ -571,4 +577,4 @@ interface BulkUpdateProductsOptions {
571
577
  */
572
578
  declare function bulkDeleteProducts(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>>;
573
579
 
574
- export { type Address, type AddressLocation, type AddressStreetOneOf, type ApplicationError, type BulkActionMetadata, type BulkCreateProductsOptions, type BulkCreateProductsRequest, type BulkCreateProductsResponse, type BulkDeleteProductsRequest, type BulkDeleteProductsResponse, type BulkDeleteProductsResponseBulkProductResult, type BulkProductResult, type BulkUpdateProductsOptions, type BulkUpdateProductsRequest, type BulkUpdateProductsResponse, type BulkUpdateProductsResponseBulkProductResult, type CountProductsOptions, type CountProductsRequest, type CountProductsResponse, type CreateProductApplicationErrors, type CreateProductOptions, type CreateProductRequest, type CreateProductResponse, type CursorPaging, type Cursors, type DeleteProductRequest, type DeleteProductResponse, type FocalPoint, type GetProductRequest, type GetProductResponse, type GetProductsStartWithOptions, type GetProductsStartWithRequest, type GetProductsStartWithResponse, type ItemMetadata, LinkRel, type LinkRelWithLiterals, type MaskedProduct, type MyAddress, type PageLink, type Paging, type PagingMetadataV2, type Product, type ProductsQueryBuilder, type ProductsQueryResult, type QueryProductsOptions, type QueryProductsRequest, type QueryProductsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ResetProductsDbRequest, type ResetProductsDbResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type StandardDetails, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, type UpdateProductOptions, type UpdateProductRequest, type UpdateProductResponse, type Variant, type VideoResolution, bulkCreateProducts, bulkDeleteProducts, bulkUpdateProducts, countProducts, createProduct, deleteProduct, getProduct, getProductsStartWith, queryProducts, updateProduct };
580
+ export { type Address, type AddressLocation, type AddressStreetOneOf, type ApplicationError, type BulkActionMetadata, type BulkCreateProductsOptions, type BulkCreateProductsRequest, type BulkCreateProductsResponse, type BulkDeleteProductsRequest, type BulkDeleteProductsResponse, type BulkDeleteProductsResponseBulkProductResult, type BulkProductResult, type BulkUpdateProductsOptions, type BulkUpdateProductsRequest, type BulkUpdateProductsResponse, type BulkUpdateProductsResponseBulkProductResult, type CountProductsOptions, type CountProductsRequest, type CountProductsResponse, type CreateProductApplicationErrors, type CreateProductOptions, type CreateProductRequest, type CreateProductResponse, type CursorPaging, type Cursors, type DeleteProductRequest, type DeleteProductResponse, type FocalPoint, type GetProductRequest, type GetProductResponse, type GetProductsStartWithOptions, type GetProductsStartWithRequest, type GetProductsStartWithResponse, type ItemMetadata, LinkRel, type LinkRelWithLiterals, type MaskedProduct, type MyAddress, type PageLink, type Paging, type PagingMetadataV2, type Product, type ProductsQueryBuilder, type ProductsQueryResult, type QueryProductsOptions, type QueryProductsRequest, type QueryProductsResponse, type QueryV2, type QueryV2PagingMethodOneOf, type ResetProductsDbRequest, type ResetProductsDbResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type StandardDetails, type StreetAddress, type Subdivision, SubdivisionType, type SubdivisionTypeWithLiterals, type UpdateProductOptions, type UpdateProductRequest, type UpdateProductResponse, type Variant, type VideoResolution, bulkCreateProducts, bulkDeleteProducts, bulkUpdateProducts, countProducts, createProduct, deleteProduct, getProduct, getProductsStartWith, queryProducts, typedQueryProducts, updateProduct };
@@ -32,6 +32,7 @@ __export(index_typings_exports, {
32
32
  getProduct: () => getProduct2,
33
33
  getProductsStartWith: () => getProductsStartWith2,
34
34
  queryProducts: () => queryProducts2,
35
+ typedQueryProducts: () => typedQueryProducts,
35
36
  updateProduct: () => updateProduct2
36
37
  });
37
38
  module.exports = __toCommonJS(index_typings_exports);
@@ -1234,6 +1235,62 @@ function queryProducts2(options) {
1234
1235
  transformationPaths: {}
1235
1236
  });
1236
1237
  }
1238
+ async function typedQueryProducts(query, options) {
1239
+ const { httpClient, sideEffects } = arguments[2];
1240
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1241
+ query,
1242
+ ...options
1243
+ });
1244
+ const reqOpts = queryProducts(payload);
1245
+ sideEffects?.onSiteCall?.();
1246
+ try {
1247
+ const result = await httpClient.request(reqOpts);
1248
+ sideEffects?.onSuccess?.(result);
1249
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1250
+ (0, import_transform_paths2.transformPaths)(result.data, [
1251
+ {
1252
+ transformFn: import_image2.transformRESTImageToSDKImage,
1253
+ paths: [
1254
+ { path: "products.image" },
1255
+ { path: "products.variants.image" },
1256
+ { path: "products.mainVariant.image" }
1257
+ ]
1258
+ },
1259
+ {
1260
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1261
+ paths: [
1262
+ { path: "products.address" },
1263
+ { path: "products.customAddress" }
1264
+ ]
1265
+ },
1266
+ {
1267
+ transformFn: import_document2.transformRESTDocumentToSDKDocument,
1268
+ paths: [{ path: "products.document" }]
1269
+ },
1270
+ {
1271
+ transformFn: import_video_v22.transformRESTVideoV2ToSDKVideoV2,
1272
+ paths: [{ path: "products.video" }]
1273
+ },
1274
+ {
1275
+ transformFn: import_audio2.transformRESTAudioToSDKAudio,
1276
+ paths: [{ path: "products.audio" }]
1277
+ }
1278
+ ])
1279
+ );
1280
+ } catch (err) {
1281
+ const transformedError = (0, import_transform_error.transformError)(
1282
+ err,
1283
+ {
1284
+ spreadPathsToArguments: {},
1285
+ explicitPathsToArguments: { query: "$[0]" },
1286
+ singleArgumentUnchanged: false
1287
+ },
1288
+ ["query", "options"]
1289
+ );
1290
+ sideEffects?.onError?.(err);
1291
+ throw transformedError;
1292
+ }
1293
+ }
1237
1294
  async function bulkCreateProducts2(products, options) {
1238
1295
  const { httpClient, sideEffects } = arguments[2];
1239
1296
  const payload = (0, import_transform_paths2.transformPaths)(
@@ -1453,6 +1510,7 @@ async function bulkDeleteProducts2(productIds) {
1453
1510
  getProduct,
1454
1511
  getProductsStartWith,
1455
1512
  queryProducts,
1513
+ typedQueryProducts,
1456
1514
  updateProduct
1457
1515
  });
1458
1516
  //# sourceMappingURL=index.typings.js.map