@wix/auto_sdk_metro_products 1.0.6 → 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/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/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/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/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 };
|
|
@@ -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(
|
|
@@ -1417,6 +1473,7 @@ export {
|
|
|
1417
1473
|
getProduct2 as getProduct,
|
|
1418
1474
|
getProductsStartWith2 as getProductsStartWith,
|
|
1419
1475
|
queryProducts2 as queryProducts,
|
|
1476
|
+
typedQueryProducts,
|
|
1420
1477
|
updateProduct2 as updateProduct
|
|
1421
1478
|
};
|
|
1422
1479
|
//# sourceMappingURL=index.typings.mjs.map
|