@wix/auto_sdk_ecom_subscription-contracts 1.0.64 → 1.0.66

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 +8 -18
  2. package/build/cjs/index.js +75 -11
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +11 -5
  5. package/build/cjs/index.typings.js +59 -12
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +5 -5
  8. package/build/cjs/meta.js +10 -10
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +8 -18
  11. package/build/es/index.mjs +74 -10
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +11 -5
  14. package/build/es/index.typings.mjs +56 -10
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +5 -5
  17. package/build/es/meta.mjs +9 -9
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +8 -18
  20. package/build/internal/cjs/index.js +75 -11
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +11 -5
  23. package/build/internal/cjs/index.typings.js +59 -12
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +5 -5
  26. package/build/internal/cjs/meta.js +10 -10
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +8 -18
  29. package/build/internal/es/index.mjs +74 -10
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +11 -5
  32. package/build/internal/es/index.typings.mjs +56 -10
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +5 -5
  35. package/build/internal/es/meta.mjs +9 -9
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +3 -3
@@ -449,18 +449,18 @@ interface PhysicalProperties {
449
449
  }
450
450
  interface ItemType extends ItemTypeItemTypeDataOneOf {
451
451
  /** Preset item type. */
452
- preset?: ItemTypeItemTypeWithLiterals;
452
+ preset?: ItemTypePresetWithLiterals;
453
453
  /** Custom item type. When none of the preset types are suitable, specifies the custom type. */
454
454
  custom?: string;
455
455
  }
456
456
  /** @oneof */
457
457
  interface ItemTypeItemTypeDataOneOf {
458
458
  /** Preset item type. */
459
- preset?: ItemTypeItemTypeWithLiterals;
459
+ preset?: ItemTypePresetWithLiterals;
460
460
  /** Custom item type. When none of the preset types are suitable, specifies the custom type. */
461
461
  custom?: string;
462
462
  }
463
- declare enum ItemTypeItemType {
463
+ declare enum ItemTypePreset {
464
464
  UNRECOGNISED = "UNRECOGNISED",
465
465
  PHYSICAL = "PHYSICAL",
466
466
  DIGITAL = "DIGITAL",
@@ -468,7 +468,7 @@ declare enum ItemTypeItemType {
468
468
  SERVICE = "SERVICE"
469
469
  }
470
470
  /** @enumType */
471
- type ItemTypeItemTypeWithLiterals = ItemTypeItemType | 'UNRECOGNISED' | 'PHYSICAL' | 'DIGITAL' | 'GIFT_CARD' | 'SERVICE';
471
+ type ItemTypePresetWithLiterals = ItemTypePreset | 'UNRECOGNISED' | 'PHYSICAL' | 'DIGITAL' | 'GIFT_CARD' | 'SERVICE';
472
472
  /** Type of selected payment option for catalog item */
473
473
  declare enum PaymentOptionType {
474
474
  /** The entire payment for this item happens as part of the checkout. */
@@ -2060,5 +2060,11 @@ interface SubscriptionContractsQueryBuilder {
2060
2060
  /** @documentationMaturity preview */
2061
2061
  find: () => Promise<SubscriptionContractsQueryResult>;
2062
2062
  }
2063
+ /**
2064
+ * @hidden
2065
+ * @fqn wix.ecom.subscription_contracts.v1.SubscriptionContracts.QuerySubscriptionContracts
2066
+ * @requiredField query
2067
+ */
2068
+ declare function typedQuerySubscriptionContracts(query: CursorQuery): Promise<NonNullablePaths<QuerySubscriptionContractsResponse, `subscriptionContracts` | `subscriptionContracts.${number}.subscriptionSettings.frequency` | `subscriptionContracts.${number}.subscriptionSettings.autoRenewal` | `subscriptionContracts.${number}.subscriptionSettings.enableCustomerCancellation` | `subscriptionContracts.${number}.subscriptionSettings.freeTrialPeriod.frequency` | `subscriptionContracts.${number}.subscriptionSettings.freeTrialPeriod.interval` | `subscriptionContracts.${number}.buyerInfo.visitorId` | `subscriptionContracts.${number}.buyerInfo.memberId` | `subscriptionContracts.${number}.weightUnit` | `subscriptionContracts.${number}.taxIncludedInPrices` | `subscriptionContracts.${number}.shippingInfo.title` | `subscriptionContracts.${number}.channelInfo.type`, 6>>;
2063
2069
 
2064
- export { type ActionEvent, type AdditionalFee, type Address, type AddressLocation, type AddressWithContact, AdjustmentType, type AdjustmentTypeWithLiterals, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type BaseEventMetadata, type BillingAdjustment, type BillingAdjustmentPriceSummary, type BulkActionMetadata, type BulkCreateSubscriptionContractsRequest, type BulkCreateSubscriptionContractsResponse, type BulkSubscriptionContractResult, type BulkUpdateSubscriptionContractsRequest, type BulkUpdateSubscriptionContractsResponse, type BuyerInfo, type BuyerInfoIdOneOf, type CatalogReference, type ChannelInfo, ChannelType, type ChannelTypeWithLiterals, type Color, type Coupon, type CreateSubscriptionContractRequest, type CreateSubscriptionContractResponse, type CurrencyConversionDetails, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomField, type DeliveryLogistics, type DeliveryLogisticsAddressOneOf, type DeliveryTimeSlot, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type DigitalFile, DiscountReason, type DiscountReasonWithLiterals, type DiscountRule, type DiscountRuleName, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type FocalPoint, type FreeTrialPeriod, type FullAddressContactDetails, type GetSubscriptionContractRequest, type GetSubscriptionContractResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ItemModifier, type ItemTaxFullDetails, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LineItemDiscount, type LineItemTaxBreakdown, type LineItemTaxInfo, type Location, type LocationAndQuantity, type MaskedSubscriptionContract, type MerchantDiscount, type MerchantDiscountMerchantDiscountReasonOneOf, type MessageEnvelope, type ModifierGroup, type OrderLineItem, type OrderTaxBreakdown, type OrderTaxInfo, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PhysicalProperties, type PickupAddress, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlainTextValue, type Price, type PriceDescription, type PriceSummary, type ProductName, type QuerySubscriptionContractsRequest, type QuerySubscriptionContractsResponse, type RestoreInfo, type ShippingInformation, type ShippingPrice, type ShippingRegion, SortOrder, type SortOrderWithLiterals, type Sorting, type StreetAddress, type SubscriptionContract, type SubscriptionContractCreatedEnvelope, type SubscriptionContractDeletedEnvelope, type SubscriptionContractUpdatedEnvelope, type SubscriptionContractsQueryBuilder, type SubscriptionContractsQueryResult, type SubscriptionDescription, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionInfo, type SubscriptionSettings, type SubscriptionTitle, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type TranslatableString, type UpdateSubscriptionContractRequest, type UpdateSubscriptionContractResponse, type V1FreeTrialPeriod, type V1SubscriptionDescription, type V1SubscriptionSettings, type V1SubscriptionTitle, V2SubscriptionFrequency, type V2SubscriptionFrequencyWithLiterals, type VatId, VatType, type VatTypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, getSubscriptionContract, onSubscriptionContractCreated, onSubscriptionContractDeleted, onSubscriptionContractUpdated, querySubscriptionContracts };
2070
+ export { type ActionEvent, type AdditionalFee, type Address, type AddressLocation, type AddressWithContact, AdjustmentType, type AdjustmentTypeWithLiterals, type ApplicationError, type AppliedDiscount, type AppliedDiscountDiscountSourceOneOf, type BaseEventMetadata, type BillingAdjustment, type BillingAdjustmentPriceSummary, type BulkActionMetadata, type BulkCreateSubscriptionContractsRequest, type BulkCreateSubscriptionContractsResponse, type BulkSubscriptionContractResult, type BulkUpdateSubscriptionContractsRequest, type BulkUpdateSubscriptionContractsResponse, type BuyerInfo, type BuyerInfoIdOneOf, type CatalogReference, type ChannelInfo, ChannelType, type ChannelTypeWithLiterals, type Color, type Coupon, type CreateSubscriptionContractRequest, type CreateSubscriptionContractResponse, type CurrencyConversionDetails, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomField, type DeliveryLogistics, type DeliveryLogisticsAddressOneOf, type DeliveryTimeSlot, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type DigitalFile, DiscountReason, type DiscountReasonWithLiterals, type DiscountRule, type DiscountRuleName, DiscountType, type DiscountTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type FocalPoint, type FreeTrialPeriod, type FullAddressContactDetails, type GetSubscriptionContractRequest, type GetSubscriptionContractResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ItemModifier, type ItemTaxFullDetails, type ItemType, type ItemTypeItemTypeDataOneOf, ItemTypePreset, type ItemTypePresetWithLiterals, JurisdictionType, type JurisdictionTypeWithLiterals, type LineItemDiscount, type LineItemTaxBreakdown, type LineItemTaxInfo, type Location, type LocationAndQuantity, type MaskedSubscriptionContract, type MerchantDiscount, type MerchantDiscountMerchantDiscountReasonOneOf, type MessageEnvelope, type ModifierGroup, type OrderLineItem, type OrderTaxBreakdown, type OrderTaxInfo, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PhysicalProperties, type PickupAddress, type PickupDetails, PickupMethod, type PickupMethodWithLiterals, type PlainTextValue, type Price, type PriceDescription, type PriceSummary, type ProductName, type QuerySubscriptionContractsRequest, type QuerySubscriptionContractsResponse, type RestoreInfo, type ShippingInformation, type ShippingPrice, type ShippingRegion, SortOrder, type SortOrderWithLiterals, type Sorting, type StreetAddress, type SubscriptionContract, type SubscriptionContractCreatedEnvelope, type SubscriptionContractDeletedEnvelope, type SubscriptionContractUpdatedEnvelope, type SubscriptionContractsQueryBuilder, type SubscriptionContractsQueryResult, type SubscriptionDescription, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionInfo, type SubscriptionSettings, type SubscriptionTitle, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type TranslatableString, type UpdateSubscriptionContractRequest, type UpdateSubscriptionContractResponse, type V1FreeTrialPeriod, type V1SubscriptionDescription, type V1SubscriptionSettings, type V1SubscriptionTitle, V2SubscriptionFrequency, type V2SubscriptionFrequencyWithLiterals, type VatId, VatType, type VatTypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals, getSubscriptionContract, onSubscriptionContractCreated, onSubscriptionContractDeleted, onSubscriptionContractUpdated, querySubscriptionContracts, typedQuerySubscriptionContracts };
@@ -232,14 +232,14 @@ var DescriptionLineType = /* @__PURE__ */ ((DescriptionLineType2) => {
232
232
  DescriptionLineType2["COLOR"] = "COLOR";
233
233
  return DescriptionLineType2;
234
234
  })(DescriptionLineType || {});
235
- var ItemTypeItemType = /* @__PURE__ */ ((ItemTypeItemType2) => {
236
- ItemTypeItemType2["UNRECOGNISED"] = "UNRECOGNISED";
237
- ItemTypeItemType2["PHYSICAL"] = "PHYSICAL";
238
- ItemTypeItemType2["DIGITAL"] = "DIGITAL";
239
- ItemTypeItemType2["GIFT_CARD"] = "GIFT_CARD";
240
- ItemTypeItemType2["SERVICE"] = "SERVICE";
241
- return ItemTypeItemType2;
242
- })(ItemTypeItemType || {});
235
+ var ItemTypePreset = /* @__PURE__ */ ((ItemTypePreset2) => {
236
+ ItemTypePreset2["UNRECOGNISED"] = "UNRECOGNISED";
237
+ ItemTypePreset2["PHYSICAL"] = "PHYSICAL";
238
+ ItemTypePreset2["DIGITAL"] = "DIGITAL";
239
+ ItemTypePreset2["GIFT_CARD"] = "GIFT_CARD";
240
+ ItemTypePreset2["SERVICE"] = "SERVICE";
241
+ return ItemTypePreset2;
242
+ })(ItemTypePreset || {});
243
243
  var PaymentOptionType = /* @__PURE__ */ ((PaymentOptionType2) => {
244
244
  PaymentOptionType2["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
245
245
  PaymentOptionType2["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
@@ -454,13 +454,58 @@ function querySubscriptionContracts2() {
454
454
  transformationPaths: {}
455
455
  });
456
456
  }
457
+ async function typedQuerySubscriptionContracts(query) {
458
+ const { httpClient, sideEffects } = arguments[1];
459
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query });
460
+ const reqOpts = querySubscriptionContracts(
461
+ payload
462
+ );
463
+ sideEffects?.onSiteCall?.();
464
+ try {
465
+ const result = await httpClient.request(reqOpts);
466
+ sideEffects?.onSuccess?.(result);
467
+ return renameKeysFromRESTResponseToSDKResponse(
468
+ transformPaths2(result.data, [
469
+ {
470
+ transformFn: transformRESTImageToSDKImage,
471
+ paths: [{ path: "subscriptionContracts.lineItems.image" }]
472
+ },
473
+ {
474
+ transformFn: transformRESTAddressToSDKAddress,
475
+ paths: [
476
+ { path: "subscriptionContracts.billingInfo.address" },
477
+ {
478
+ path: "subscriptionContracts.shippingInfo.logistics.shippingDestination.address"
479
+ },
480
+ {
481
+ path: "subscriptionContracts.shippingInfo.logistics.pickupDetails.address"
482
+ },
483
+ { path: "subscriptionContracts.recipientInfo.address" }
484
+ ]
485
+ }
486
+ ])
487
+ );
488
+ } catch (err) {
489
+ const transformedError = sdkTransformError(
490
+ err,
491
+ {
492
+ spreadPathsToArguments: {},
493
+ explicitPathsToArguments: { query: "$[0]" },
494
+ singleArgumentUnchanged: false
495
+ },
496
+ ["query"]
497
+ );
498
+ sideEffects?.onError?.(err);
499
+ throw transformedError;
500
+ }
501
+ }
457
502
  export {
458
503
  AdjustmentType,
459
504
  ChannelType,
460
505
  DescriptionLineType,
461
506
  DiscountReason,
462
507
  DiscountType,
463
- ItemTypeItemType,
508
+ ItemTypePreset,
464
509
  JurisdictionType,
465
510
  PaymentOptionType,
466
511
  PickupMethod,
@@ -472,6 +517,7 @@ export {
472
517
  WebhookIdentityType,
473
518
  WeightUnit,
474
519
  getSubscriptionContract2 as getSubscriptionContract,
475
- querySubscriptionContracts2 as querySubscriptionContracts
520
+ querySubscriptionContracts2 as querySubscriptionContracts,
521
+ typedQuerySubscriptionContracts
476
522
  };
477
523
  //# sourceMappingURL=index.typings.mjs.map