@wix/auto_sdk_ecom_checkout-templates 1.0.145 → 1.0.147

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 +1 -1
  2. package/build/cjs/index.js +144 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +74 -8
  5. package/build/cjs/index.typings.js +135 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +68 -9
  8. package/build/cjs/meta.js +97 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +1 -1
  11. package/build/es/index.mjs +143 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +74 -8
  14. package/build/es/index.typings.mjs +134 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +68 -9
  17. package/build/es/meta.mjs +96 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +23 -3
  20. package/build/internal/cjs/index.js +144 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +389 -9
  23. package/build/internal/cjs/index.typings.js +135 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +609 -10
  26. package/build/internal/cjs/meta.js +97 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +23 -3
  29. package/build/internal/es/index.mjs +143 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +389 -9
  32. package/build/internal/es/index.typings.mjs +134 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +609 -10
  35. package/build/internal/es/meta.mjs +96 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
2
  import { CheckoutTemplate, CreateCheckoutTemplateApplicationErrors, UpdateCheckoutTemplate, UpdateCheckoutTemplateApplicationErrors, CreateCheckoutFromTemplateResponse, CreateCheckoutFromTemplateApplicationErrors, RawHttpResponse, CreateAndRedirectToCheckoutApplicationErrors, CheckoutTemplateCreatedEnvelope, CheckoutTemplateDeletedEnvelope, CheckoutTemplateUpdatedEnvelope, CheckoutTemplateUsedEnvelope, CheckoutTemplatesQueryBuilder, CheckoutTemplateQuery, typedQueryCheckoutTemplates } from './index.typings.js';
3
- export { AccountInfo, AccountInfoMetadata, ActionEvent, AdditionalFee, AdditionalFeeSource, AdditionalFeeSourceWithLiterals, Address, AddressLocation, AddressWithContact, AggregatedTaxBreakdown, ApplicableLineItems, ApplicationError, AppliedDiscount, AppliedDiscountDiscountSourceOneOf, AutoTaxFallbackCalculationDetails, BalanceType, BalanceTypeWithLiterals, BaseEventMetadata, BillingSettings, BuyerInfo, BuyerInfoIdOneOf, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, Carrier, CarrierError, CarrierErrors, CarrierServiceOption, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, ChargeType, ChargeTypeWithLiterals, Checkout, CheckoutCustomization, CheckoutTemplateQuerySpec, CheckoutTemplateUsed, CheckoutTemplatesQueryResult, Color, CommonQueryWithEntityContext, ConversionInfo, Coupon, CreateAndRedirectToCheckoutRequest, CreateCheckoutFromTemplateRequest, CreateCheckoutTemplateRequest, CreateCheckoutTemplateResponse, CreatedBy, CreatedByIdOneOf, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomContentReference, CustomField, CustomLineItem, CustomSettings, DeleteCheckoutTemplateRequest, DeleteCheckoutTemplateResponse, DeliveryAllocation, DeliveryLogistics, DeliveryTimeSlot, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Dimensions, DimensionsUnit, DimensionsUnitWithLiterals, DiscountRule, DiscountRuleName, DiscountType, DiscountTypeWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, ExternalReference, FallbackReason, FallbackReasonWithLiterals, FieldViolation, FileType, FileTypeWithLiterals, FocalPoint, FreeTrialPeriod, FullAddressContactDetails, GetCheckoutTemplateRequest, GetCheckoutTemplateResponse, GiftCard, GiftCardCalculationError, Group, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, InvalidMembership, ItemAvailabilityInfo, ItemAvailabilityStatus, ItemAvailabilityStatusWithLiterals, ItemCombination, ItemCombinationLineItem, ItemModifier, ItemTaxFullDetails, ItemType, ItemTypeItemTypeDataOneOf, ItemTypePreset, ItemTypePresetWithLiterals, JurisdictionType, JurisdictionTypeWithLiterals, LineItem, LineItemDiscount, ManualCalculationReason, ManualCalculationReasonWithLiterals, Membership, MembershipName, MembershipOptions, MembershipPaymentCredits, MerchantDiscount, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, OtherCharge, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PhysicalProperties, PickupDetails, PickupMethod, PickupMethodWithLiterals, PlainTextValue, PlatformFee, PlatformFeeChargeType, PlatformFeeChargeTypeWithLiterals, Policy, PriceDescription, PriceSummary, ProductName, ProductPeriodAlignment, ProductPeriodAlignmentWithLiterals, QueryCheckoutTemplatesRequest, QueryCheckoutTemplatesResponse, RateType, RateTypeWithLiterals, Region, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedCarrierServiceOption, SelectedCarrierServiceOptionOtherCharge, SelectedCarrierServiceOptionPrices, SelectedMembership, SelectedMemberships, ServiceProperties, Severity, SeverityWithLiterals, ShippingInfo, ShippingOption, ShippingPrice, ShippingRegion, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetLineItem, TargetTargetTypeOneOf, TaxBreakdown, TaxCalculationDetails, TaxCalculationDetailsCalculationDetailsOneOf, TaxRateBreakdown, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCheckoutTemplateRequest, UpdateCheckoutTemplateResponse, V1ItemModifier, V1LineItem, V1ModifierGroup, ValidationError, VatId, VatType, VatTypeWithLiterals, Violation, WebClientCustomization, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals, utils } from './index.typings.js';
3
+ export { AccountInfo, AccountInfoMetadata, ActionEvent, AdditionalFee, AdditionalFeeSource, AdditionalFeeSourceWithLiterals, Address, AddressLocation, AddressWithContact, AggregatedTaxBreakdown, ApplicableLineItems, ApplicationError, AppliedDiscount, AppliedDiscountDiscountSourceOneOf, AutoTaxFallbackCalculationDetails, BalanceType, BalanceTypeWithLiterals, BaseEventMetadata, BillingSettings, BulkActionMetadata, BulkCheckoutTemplateResult, BulkCreateCheckoutTemplatesApplicationErrors, BulkCreateCheckoutTemplatesOptions, BulkCreateCheckoutTemplatesRequest, BulkCreateCheckoutTemplatesResponse, BuyerInfo, BuyerInfoIdOneOf, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, Carrier, CarrierError, CarrierErrors, CarrierServiceOption, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, ChargeType, ChargeTypeWithLiterals, Checkout, CheckoutCustomization, CheckoutTemplateQuerySpec, CheckoutTemplateUsed, CheckoutTemplatesQueryResult, Color, CommonQueryWithEntityContext, ConversionInfo, Coupon, CreateAndRedirectToCheckoutRequest, CreateCheckoutFromTemplateRequest, CreateCheckoutTemplateRequest, CreateCheckoutTemplateResponse, CreatedBy, CreatedByIdOneOf, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, CustomContentReference, CustomField, CustomLineItem, CustomSettings, DeleteCheckoutTemplateRequest, DeleteCheckoutTemplateResponse, DeliveryAllocation, DeliveryLogistics, DeliveryTimeSlot, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Dimensions, DimensionsUnit, DimensionsUnitWithLiterals, DiscountRule, DiscountRuleName, DiscountType, DiscountTypeWithLiterals, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExtendedFields, ExternalReference, FallbackReason, FallbackReasonWithLiterals, FieldViolation, FileType, FileTypeWithLiterals, FocalPoint, FreeTrialPeriod, FullAddressContactDetails, GetCheckoutTemplateRequest, GetCheckoutTemplateResponse, GiftCard, GiftCardCalculationError, Group, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, InvalidMembership, ItemAvailabilityInfo, ItemAvailabilityStatus, ItemAvailabilityStatusWithLiterals, ItemCombination, ItemCombinationLineItem, ItemMetadata, ItemModifier, ItemTaxFullDetails, ItemType, ItemTypeItemTypeDataOneOf, ItemTypePreset, ItemTypePresetWithLiterals, JurisdictionType, JurisdictionTypeWithLiterals, LineItem, LineItemDiscount, ManualCalculationReason, ManualCalculationReasonWithLiterals, Membership, MembershipName, MembershipOptions, MembershipPaymentCredits, MerchantDiscount, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, OtherCharge, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PhysicalProperties, PickupDetails, PickupMethod, PickupMethodWithLiterals, PlainTextValue, PlatformFee, PlatformFeeChargeType, PlatformFeeChargeTypeWithLiterals, Policy, PriceDescription, PriceSummary, ProductName, ProductPeriodAlignment, ProductPeriodAlignmentWithLiterals, QueryCheckoutTemplatesRequest, QueryCheckoutTemplatesResponse, RateType, RateTypeWithLiterals, Region, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedCarrierServiceOption, SelectedCarrierServiceOptionOtherCharge, SelectedCarrierServiceOptionPrices, SelectedMembership, SelectedMemberships, ServiceProperties, Severity, SeverityWithLiterals, ShippingInfo, ShippingOption, ShippingPrice, ShippingRegion, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetLineItem, TargetTargetTypeOneOf, TaxBreakdown, TaxCalculationDetails, TaxCalculationDetailsCalculationDetailsOneOf, TaxRateBreakdown, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCheckoutTemplateRequest, UpdateCheckoutTemplateResponse, V1ItemModifier, V1LineItem, V1ModifierGroup, ValidationError, VatId, VatType, VatTypeWithLiterals, Violation, WebClientCustomization, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals, utils } from './index.typings.js';
4
4
 
5
5
  declare function createCheckoutTemplate$1(httpClient: HttpClient): CreateCheckoutTemplateSignature;
6
6
  interface CreateCheckoutTemplateSignature {
@@ -50,6 +50,7 @@ __export(index_exports, {
50
50
  VatType: () => VatType,
51
51
  WebhookIdentityType: () => WebhookIdentityType,
52
52
  WeightUnit: () => WeightUnit,
53
+ bulkCreateCheckoutTemplates: () => bulkCreateCheckoutTemplates4,
53
54
  createAndRedirectToCheckout: () => createAndRedirectToCheckout4,
54
55
  createCheckoutFromTemplate: () => createCheckoutFromTemplate4,
55
56
  createCheckoutTemplate: () => createCheckoutTemplate4,
@@ -201,6 +202,81 @@ function createCheckoutTemplate(payload) {
201
202
  }
202
203
  return __createCheckoutTemplate;
203
204
  }
205
+ function bulkCreateCheckoutTemplates(payload) {
206
+ function __bulkCreateCheckoutTemplates({ host }) {
207
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
208
+ {
209
+ transformFn: import_float.transformSDKFloatToRESTFloat,
210
+ paths: [
211
+ {
212
+ path: "checkoutTemplates.lineItems.catalogOverrideFields.physicalProperties.weight"
213
+ },
214
+ {
215
+ path: "checkoutTemplates.customLineItems.physicalProperties.weight"
216
+ }
217
+ ]
218
+ },
219
+ {
220
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
221
+ paths: [
222
+ {
223
+ path: "checkoutTemplates.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
224
+ },
225
+ {
226
+ path: "checkoutTemplates.customLineItems.serviceProperties.scheduledDate"
227
+ },
228
+ {
229
+ path: "checkoutTemplates.customLineItems.serviceProperties.endDate"
230
+ }
231
+ ]
232
+ }
233
+ ]);
234
+ const metadata = {
235
+ entityFqdn: "wix.ecom.v1.checkout_template",
236
+ method: "POST",
237
+ methodFqn: "wix.ecom.checkout_template.api.v1.CheckoutTemplateService.BulkCreateCheckoutTemplates",
238
+ packageName: PACKAGE_NAME,
239
+ migrationOptions: {
240
+ optInTransformResponse: true
241
+ },
242
+ url: resolveWixEcomCheckoutTemplateApiV1CheckoutTemplateServiceUrl({
243
+ protoPath: "/v1/bulk/checkout-templates/create",
244
+ data: serializedData,
245
+ host
246
+ }),
247
+ data: serializedData,
248
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
249
+ {
250
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
251
+ paths: [
252
+ {
253
+ path: "results.item.lineItems.catalogOverrideFields.physicalProperties.weight"
254
+ },
255
+ {
256
+ path: "results.item.customLineItems.physicalProperties.weight"
257
+ }
258
+ ]
259
+ },
260
+ {
261
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
262
+ paths: [
263
+ {
264
+ path: "results.item.customLineItems.subscriptionOptionInfo.subscriptionSettings.startDate"
265
+ },
266
+ {
267
+ path: "results.item.customLineItems.serviceProperties.scheduledDate"
268
+ },
269
+ {
270
+ path: "results.item.customLineItems.serviceProperties.endDate"
271
+ }
272
+ ]
273
+ }
274
+ ])
275
+ };
276
+ return metadata;
277
+ }
278
+ return __bulkCreateCheckoutTemplates;
279
+ }
204
280
  function getCheckoutTemplate(payload) {
205
281
  function __getCheckoutTemplate({ host }) {
206
282
  const metadata = {
@@ -732,6 +808,64 @@ async function createCheckoutTemplate2(checkoutTemplate) {
732
808
  throw transformedError;
733
809
  }
734
810
  }
811
+ async function bulkCreateCheckoutTemplates2(checkoutTemplates, options) {
812
+ const { httpClient, sideEffects } = arguments[2];
813
+ const payload = (0, import_transform_paths2.transformPaths)(
814
+ (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
815
+ checkoutTemplates,
816
+ returnEntity: options?.returnEntity
817
+ }),
818
+ [
819
+ {
820
+ transformFn: import_image.transformSDKImageToRESTImage,
821
+ paths: [
822
+ { path: "checkoutTemplates.lineItems.catalogOverrideFields.image" },
823
+ { path: "checkoutTemplates.customLineItems.media" }
824
+ ]
825
+ },
826
+ {
827
+ transformFn: import_page_url_v2.transformSDKPageURLV2ToRESTPageURLV2,
828
+ paths: [{ path: "checkoutTemplates.customLineItems.url" }]
829
+ }
830
+ ]
831
+ );
832
+ const reqOpts = bulkCreateCheckoutTemplates(payload);
833
+ sideEffects?.onSiteCall?.();
834
+ try {
835
+ const result = await httpClient.request(reqOpts);
836
+ sideEffects?.onSuccess?.(result);
837
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
838
+ (0, import_transform_paths2.transformPaths)(result.data, [
839
+ {
840
+ transformFn: import_image2.transformRESTImageToSDKImage,
841
+ paths: [
842
+ { path: "results.item.lineItems.catalogOverrideFields.image" },
843
+ { path: "results.item.customLineItems.media" }
844
+ ]
845
+ },
846
+ {
847
+ transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
848
+ paths: [{ path: "results.item.customLineItems.url" }]
849
+ }
850
+ ])
851
+ );
852
+ } catch (err) {
853
+ const transformedError = (0, import_transform_error.transformError)(
854
+ err,
855
+ {
856
+ spreadPathsToArguments: {},
857
+ explicitPathsToArguments: {
858
+ checkoutTemplates: "$[0]",
859
+ returnEntity: "$[1].returnEntity"
860
+ },
861
+ singleArgumentUnchanged: false
862
+ },
863
+ ["checkoutTemplates", "options"]
864
+ );
865
+ sideEffects?.onError?.(err);
866
+ throw transformedError;
867
+ }
868
+ }
735
869
  async function getCheckoutTemplate2(checkoutTemplateId) {
736
870
  const { httpClient, sideEffects } = arguments[1];
737
871
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1017,6 +1151,14 @@ function createCheckoutTemplate3(httpClient) {
1017
1151
  { httpClient }
1018
1152
  );
1019
1153
  }
1154
+ function bulkCreateCheckoutTemplates3(httpClient) {
1155
+ return (checkoutTemplates, options) => bulkCreateCheckoutTemplates2(
1156
+ checkoutTemplates,
1157
+ options,
1158
+ // @ts-ignore
1159
+ { httpClient }
1160
+ );
1161
+ }
1020
1162
  function getCheckoutTemplate3(httpClient) {
1021
1163
  return (checkoutTemplateId) => getCheckoutTemplate2(
1022
1164
  checkoutTemplateId,
@@ -1304,6 +1446,7 @@ function customQueryCheckoutTemplates(httpClient) {
1304
1446
  return overloadedQuery;
1305
1447
  }
1306
1448
  var createCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createCheckoutTemplate3);
1449
+ var bulkCreateCheckoutTemplates4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateCheckoutTemplates3);
1307
1450
  var getCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCheckoutTemplate3);
1308
1451
  var updateCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateCheckoutTemplate3);
1309
1452
  var deleteCheckoutTemplate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(deleteCheckoutTemplate3);
@@ -1354,6 +1497,7 @@ var onCheckoutTemplateUsed2 = (0, import_event_definition_modules.createEventMod
1354
1497
  VatType,
1355
1498
  WebhookIdentityType,
1356
1499
  WeightUnit,
1500
+ bulkCreateCheckoutTemplates,
1357
1501
  createAndRedirectToCheckout,
1358
1502
  createCheckoutFromTemplate,
1359
1503
  createCheckoutTemplate,