@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.
@@ -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 };
@@ -92,6 +92,12 @@ function resolveWixCoreservicesMetroinspectorV1ProductsProductsServiceUrl(opts)
92
92
  srcPath: "/_api/metro-inspector",
93
93
  destPath: "/api"
94
94
  }
95
+ ],
96
+ "dev._base_domain_": [
97
+ {
98
+ srcPath: "/_api/metro-inspector",
99
+ destPath: ""
100
+ }
95
101
  ]
96
102
  };
97
103
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -1199,6 +1205,62 @@ function queryProducts2(options) {
1199
1205
  transformationPaths: {}
1200
1206
  });
1201
1207
  }
1208
+ async function typedQueryProducts(query, options) {
1209
+ const { httpClient, sideEffects } = arguments[2];
1210
+ const payload = renameKeysFromSDKRequestToRESTRequest({
1211
+ query,
1212
+ ...options
1213
+ });
1214
+ const reqOpts = queryProducts(payload);
1215
+ sideEffects?.onSiteCall?.();
1216
+ try {
1217
+ const result = await httpClient.request(reqOpts);
1218
+ sideEffects?.onSuccess?.(result);
1219
+ return renameKeysFromRESTResponseToSDKResponse(
1220
+ transformPaths2(result.data, [
1221
+ {
1222
+ transformFn: transformRESTImageToSDKImage,
1223
+ paths: [
1224
+ { path: "products.image" },
1225
+ { path: "products.variants.image" },
1226
+ { path: "products.mainVariant.image" }
1227
+ ]
1228
+ },
1229
+ {
1230
+ transformFn: transformRESTAddressToSDKAddress,
1231
+ paths: [
1232
+ { path: "products.address" },
1233
+ { path: "products.customAddress" }
1234
+ ]
1235
+ },
1236
+ {
1237
+ transformFn: transformRESTDocumentToSDKDocument,
1238
+ paths: [{ path: "products.document" }]
1239
+ },
1240
+ {
1241
+ transformFn: transformRESTVideoV2ToSDKVideoV2,
1242
+ paths: [{ path: "products.video" }]
1243
+ },
1244
+ {
1245
+ transformFn: transformRESTAudioToSDKAudio,
1246
+ paths: [{ path: "products.audio" }]
1247
+ }
1248
+ ])
1249
+ );
1250
+ } catch (err) {
1251
+ const transformedError = sdkTransformError(
1252
+ err,
1253
+ {
1254
+ spreadPathsToArguments: {},
1255
+ explicitPathsToArguments: { query: "$[0]" },
1256
+ singleArgumentUnchanged: false
1257
+ },
1258
+ ["query", "options"]
1259
+ );
1260
+ sideEffects?.onError?.(err);
1261
+ throw transformedError;
1262
+ }
1263
+ }
1202
1264
  async function bulkCreateProducts2(products, options) {
1203
1265
  const { httpClient, sideEffects } = arguments[2];
1204
1266
  const payload = transformPaths2(
@@ -1417,6 +1479,7 @@ export {
1417
1479
  getProduct2 as getProduct,
1418
1480
  getProductsStartWith2 as getProductsStartWith,
1419
1481
  queryProducts2 as queryProducts,
1482
+ typedQueryProducts,
1420
1483
  updateProduct2 as updateProduct
1421
1484
  };
1422
1485
  //# sourceMappingURL=index.typings.mjs.map