@wix/auto_sdk_stores_catalog-imports-v-3 1.0.0 → 1.0.1

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.
@@ -3021,6 +3021,47 @@ interface ProductCategoryIdsInfo {
3021
3021
  categoryIds?: string[];
3022
3022
  }
3023
3023
  interface AddProductsToImportResponse {
3024
+ /**
3025
+ * Action results.
3026
+ * @minSize 1
3027
+ * @maxSize 100
3028
+ */
3029
+ results?: AddProductResult[];
3030
+ /** Bulk action metadata. */
3031
+ bulkActionMetadata?: BulkActionMetadata;
3032
+ }
3033
+ interface AddProductResult {
3034
+ /** Item metadata. */
3035
+ itemMetadata?: ItemMetadata;
3036
+ }
3037
+ interface ItemMetadata {
3038
+ /**
3039
+ * The product `handle` as passed in the `AddProductsToImport` request.
3040
+ * @format GUID
3041
+ */
3042
+ id?: string | null;
3043
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
3044
+ originalIndex?: number;
3045
+ /** Whether the requested action for this item was successful. When `false`, the `error` field is returned. */
3046
+ success?: boolean;
3047
+ /** Details about the error in case of failure. */
3048
+ error?: ApplicationError;
3049
+ }
3050
+ interface ApplicationError {
3051
+ /** Error code. */
3052
+ code?: string;
3053
+ /** Description of the error. */
3054
+ description?: string;
3055
+ /** Data related to the error. */
3056
+ data?: Record<string, any> | null;
3057
+ }
3058
+ interface BulkActionMetadata {
3059
+ /** Number of items that were successfully processed. */
3060
+ totalSuccesses?: number;
3061
+ /** Number of items that couldn't be processed. */
3062
+ totalFailures?: number;
3063
+ /** Number of failures without details because detailed failure threshold was exceeded. */
3064
+ undetailedFailures?: number;
3024
3065
  }
3025
3066
  interface SubmitCatalogImportRequest {
3026
3067
  /**
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { CatalogImport, ProductItem, SubmitCatalogImportResponse, SubmitCatalogImportApplicationErrors } from './index.typings.mjs';
3
- export { ActionEvent, AddProductsToImportRequest, AddProductsToImportResponse, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundType, BackgroundTypeWithLiterals, BlockquoteData, BookingData, Border, BorderColors, Brand, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, CatalogImportAlreadySubmittedErrorData, CellStyle, ChoiceType, ChoiceTypeWithLiterals, ChoicesSettings, CodeBlockData, CollapsibleListData, ColorData, Colors, ConnectedModifier, ConnectedModifierChoice, ConnectedModifierChoiceValueOneOf, ConnectedModifierModifierSettingsOneOf, ConnectedOption, ConnectedOptionChoice, ConnectedOptionChoiceValueOneOf, ConnectedOptionOptionSettingsOneOf, CreateCatalogImportRequest, CreateCatalogImportResponse, Crop, CropWithLiterals, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, Dimensions, Direction, DirectionWithLiterals, DiscountType, DiscountTypeWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, EmbedData, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, ExtendedFields, FileData, FileSource, FileSourceDataOneOf, FileType, FileTypeWithLiterals, FixedMonetaryAmount, FontSizeData, FontType, FontTypeWithLiterals, FreeTextSettings, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, IdentificationData, IdentificationDataIdOneOf, Image, ImageData, ImageDataStyles, ImageStyles, InfoSection, InitialExpandedItems, InitialExpandedItemsWithLiterals, InventoryItemComposite, InventoryItemCompositeTrackingMethodOneOf, Item, ItemDataOneOf, ItemStyle, Keyword, Layout, LayoutCellData, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, MapTypeWithLiterals, MeasurementUnit, MeasurementUnitWithLiterals, Media, MediaItemsInfo, MediaType, MediaTypeWithLiterals, MentionData, MessageEnvelope, Metadata, ModifierChoicesSettings, ModifierRenderType, ModifierRenderTypeWithLiterals, MultipleColors, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionChoiceIds, OptionChoiceNames, OptionChoiceReferences, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, PDFSettings, ParagraphData, Permissions, PhysicalProperties, Placement, PlacementWithLiterals, PlaybackOptions, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, PollSettings, Position, PositionWithLiterals, PreorderInfo, PriceInfo, PricePerUnit, PricePerUnitRange, PricePerUnitRangePricePerUnit, PricePerUnitSettings, PricingData, ProductCategoryIdsInfo, ProductMedia, ProductMediaMediaOneOf, ProductMediaSetByOneOf, ProductOptionRenderType, ProductOptionRenderTypeWithLiterals, ProductType, ProductTypeWithLiterals, ProductWithInventory, ProductWithInventoryTypedPropertiesOneOf, Rel, Resizing, ResizingWithLiterals, RestoreInfo, RevenueDetails, Ribbon, RibbonStyles, RichContent, SecuredMedia, SeoSchema, Settings, Source, SourceWithLiterals, Spoiler, SpoilerData, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, SubmitCatalogImportRequest, Subscription, SubscriptionCyclesOneOf, SubscriptionDetails, SubscriptionDiscount, SubscriptionDiscountDiscountOneOf, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, TableCellData, TableData, Tag, Target, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnail, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, Type, TypeWithLiterals, V1Media, VariantDigitalProperties, VariantPhysicalProperties, VariantWithInventory, VariantWithInventoryTypedPropertiesOneOf, VariantsInfo, VerticalAlignment, VerticalAlignmentWithLiterals, Video, VideoData, VideoResolution, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightMeasurementUnitInfo, WeightRange, WeightUnit, WeightUnitWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.mjs';
2
+ import { CatalogImport, ProductItem, AddProductsToImportResponse, SubmitCatalogImportResponse, SubmitCatalogImportApplicationErrors } from './index.typings.mjs';
3
+ export { ActionEvent, AddProductResult, AddProductsToImportRequest, Alignment, AlignmentWithLiterals, AnchorData, AppEmbedData, AppEmbedDataAppDataOneOf, AppType, AppTypeWithLiterals, ApplicationError, AspectRatio, AspectRatioWithLiterals, AudioData, Background, BackgroundBackgroundOneOf, BackgroundType, BackgroundTypeWithLiterals, BlockquoteData, BookingData, Border, BorderColors, Brand, BulkActionMetadata, BulletedListData, ButtonData, ButtonDataType, ButtonDataTypeWithLiterals, ButtonStyles, CaptionData, CardStyles, CatalogImportAlreadySubmittedErrorData, CellStyle, ChoiceType, ChoiceTypeWithLiterals, ChoicesSettings, CodeBlockData, CollapsibleListData, ColorData, Colors, ConnectedModifier, ConnectedModifierChoice, ConnectedModifierChoiceValueOneOf, ConnectedModifierModifierSettingsOneOf, ConnectedOption, ConnectedOptionChoice, ConnectedOptionChoiceValueOneOf, ConnectedOptionOptionSettingsOneOf, CreateCatalogImportRequest, CreateCatalogImportResponse, Crop, CropWithLiterals, Decoration, DecorationDataOneOf, DecorationType, DecorationTypeWithLiterals, Design, Dimensions, Direction, DirectionWithLiterals, DiscountType, DiscountTypeWithLiterals, DividerData, DividerDataAlignment, DividerDataAlignmentWithLiterals, DocumentStyle, DomainEvent, DomainEventBodyOneOf, EmbedData, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventData, ExtendedFields, FileData, FileSource, FileSourceDataOneOf, FileType, FileTypeWithLiterals, FixedMonetaryAmount, FontSizeData, FontType, FontTypeWithLiterals, FreeTextSettings, GIF, GIFData, GIFType, GIFTypeWithLiterals, GalleryData, GalleryOptions, GalleryOptionsLayout, Gradient, HTMLData, HTMLDataDataOneOf, HeadingData, Height, IdentificationData, IdentificationDataIdOneOf, Image, ImageData, ImageDataStyles, ImageStyles, InfoSection, InitialExpandedItems, InitialExpandedItemsWithLiterals, InventoryItemComposite, InventoryItemCompositeTrackingMethodOneOf, Item, ItemDataOneOf, ItemMetadata, ItemStyle, Keyword, Layout, LayoutCellData, LayoutType, LayoutTypeWithLiterals, LayoutWithLiterals, LineStyle, LineStyleWithLiterals, Link, LinkData, LinkDataOneOf, LinkPreviewData, LinkPreviewDataStyles, ListValue, MapData, MapSettings, MapType, MapTypeWithLiterals, MeasurementUnit, MeasurementUnitWithLiterals, Media, MediaItemsInfo, MediaType, MediaTypeWithLiterals, MentionData, MessageEnvelope, Metadata, ModifierChoicesSettings, ModifierRenderType, ModifierRenderTypeWithLiterals, MultipleColors, Node, NodeDataOneOf, NodeStyle, NodeType, NodeTypeWithLiterals, NullValue, NullValueWithLiterals, Oembed, Option, OptionChoiceIds, OptionChoiceNames, OptionChoiceReferences, OptionDesign, OptionLayout, OrderedListData, Orientation, OrientationWithLiterals, PDFSettings, ParagraphData, Permissions, PhysicalProperties, Placement, PlacementWithLiterals, PlaybackOptions, PluginContainerData, PluginContainerDataAlignment, PluginContainerDataAlignmentWithLiterals, PluginContainerDataWidth, PluginContainerDataWidthDataOneOf, Poll, PollData, PollDataLayout, PollDesign, PollLayout, PollLayoutDirection, PollLayoutDirectionWithLiterals, PollLayoutType, PollLayoutTypeWithLiterals, PollSettings, Position, PositionWithLiterals, PreorderInfo, PriceInfo, PricePerUnit, PricePerUnitRange, PricePerUnitRangePricePerUnit, PricePerUnitSettings, PricingData, ProductCategoryIdsInfo, ProductMedia, ProductMediaMediaOneOf, ProductMediaSetByOneOf, ProductOptionRenderType, ProductOptionRenderTypeWithLiterals, ProductType, ProductTypeWithLiterals, ProductWithInventory, ProductWithInventoryTypedPropertiesOneOf, Rel, Resizing, ResizingWithLiterals, RestoreInfo, RevenueDetails, Ribbon, RibbonStyles, RichContent, SecuredMedia, SeoSchema, Settings, Source, SourceWithLiterals, Spoiler, SpoilerData, Styles, StylesBorder, StylesPosition, StylesPositionWithLiterals, SubmitCatalogImportRequest, Subscription, SubscriptionCyclesOneOf, SubscriptionDetails, SubscriptionDiscount, SubscriptionDiscountDiscountOneOf, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, TableCellData, TableData, Tag, Target, TargetWithLiterals, TextAlignment, TextAlignmentWithLiterals, TextData, TextNodeStyle, TextStyle, Thumbnail, Thumbnails, ThumbnailsAlignment, ThumbnailsAlignmentWithLiterals, Type, TypeWithLiterals, V1Media, VariantDigitalProperties, VariantPhysicalProperties, VariantWithInventory, VariantWithInventoryTypedPropertiesOneOf, VariantsInfo, VerticalAlignment, VerticalAlignmentWithLiterals, Video, VideoData, VideoResolution, ViewMode, ViewModeWithLiterals, ViewRole, ViewRoleWithLiterals, VoteRole, VoteRoleWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightMeasurementUnitInfo, WeightRange, WeightUnit, WeightUnitWithLiterals, Width, WidthType, WidthTypeWithLiterals, WidthWithLiterals } from './index.typings.mjs';
4
4
 
5
5
  /** @internal */
6
6
  declare function createCatalogImport$1(httpClient: HttpClient): CreateCatalogImportSignature;
@@ -30,7 +30,7 @@ interface AddProductsToImportSignature {
30
30
  * @param - Catalog Import ID.
31
31
  * @param - List of product items to add to the import session.
32
32
  */
33
- (catalogImportId: string, products: NonNullablePaths<ProductItem, `product.handle`, 3>[]): Promise<void>;
33
+ (catalogImportId: string, products: NonNullablePaths<ProductItem, `product.handle`, 3>[]): Promise<NonNullablePaths<AddProductsToImportResponse, `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>>;
34
34
  }
35
35
  /** @internal */
36
36
  declare function submitCatalogImport$1(httpClient: HttpClient): SubmitCatalogImportSignature;
@@ -52,4 +52,4 @@ declare const addProductsToImport: MaybeContext<BuildRESTFunction<typeof addProd
52
52
  /** @internal */
53
53
  declare const submitCatalogImport: MaybeContext<BuildRESTFunction<typeof submitCatalogImport$1> & typeof submitCatalogImport$1>;
54
54
 
55
- export { CatalogImport, ProductItem, SubmitCatalogImportApplicationErrors, SubmitCatalogImportResponse, addProductsToImport, createCatalogImport, submitCatalogImport };
55
+ export { AddProductsToImportResponse, CatalogImport, ProductItem, SubmitCatalogImportApplicationErrors, SubmitCatalogImportResponse, addProductsToImport, createCatalogImport, submitCatalogImport };
@@ -714,6 +714,7 @@ async function addProductsToImport2(catalogImportId, products) {
714
714
  try {
715
715
  const result = await httpClient.request(reqOpts);
716
716
  sideEffects?.onSuccess?.(result);
717
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
717
718
  } catch (err) {
718
719
  const transformedError = sdkTransformError(
719
720
  err,