swell-js 5.8.2 → 5.9.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.
Files changed (86) hide show
  1. package/dist/api.mjs +53 -42
  2. package/dist/attributes.mjs +4 -6
  3. package/dist/cache.mjs +141 -140
  4. package/dist/card.mjs +149 -148
  5. package/dist/cart.mjs +3 -5
  6. package/dist/categories.mjs +4 -6
  7. package/dist/content.mjs +1 -9
  8. package/dist/cookie.mjs +3 -4
  9. package/dist/currency.mjs +2 -3
  10. package/dist/{find.18f1ac6d.mjs → find.ba551a2e.mjs} +125 -5
  11. package/dist/{index.a8d5c125.mjs → index.3949a230.mjs} +4 -21
  12. package/dist/index.mjs +3 -4
  13. package/dist/locale.mjs +1 -2
  14. package/dist/payment.mjs +11 -14
  15. package/dist/products.mjs +10 -15
  16. package/dist/{round.577a8441.mjs → round.c68b8be5.mjs} +1 -1
  17. package/dist/settings.mjs +3 -4
  18. package/dist/subscriptions.mjs +4 -6
  19. package/dist/swell.cjs +439 -323
  20. package/dist/swell.cjs.map +1 -1
  21. package/dist/swell.umd.min.js +13676 -18860
  22. package/dist/swell.umd.min.js.map +1 -1
  23. package/dist/utils/index.mjs +3 -4
  24. package/package.json +15 -8
  25. package/types/account/camel.ts +10 -7
  26. package/types/account/index.ts +3 -3
  27. package/types/account/snake.ts +5 -5
  28. package/types/attribute/camel.ts +7 -4
  29. package/types/attribute/index.ts +3 -3
  30. package/types/attribute/snake.ts +2 -2
  31. package/types/billing/camel.ts +4 -4
  32. package/types/billing/index.ts +2 -2
  33. package/types/billing/snake.ts +1 -1
  34. package/types/card/camel.ts +5 -5
  35. package/types/card/index.ts +3 -3
  36. package/types/card/snake.ts +3 -3
  37. package/types/cart/camel.ts +17 -14
  38. package/types/cart/index.ts +3 -3
  39. package/types/cart/snake.ts +12 -12
  40. package/types/category/camel.ts +4 -4
  41. package/types/category/index.ts +3 -3
  42. package/types/category/snake.ts +2 -2
  43. package/types/content/camel.ts +5 -5
  44. package/types/content/index.ts +3 -3
  45. package/types/content/snake.ts +3 -3
  46. package/types/coupon/camel.ts +4 -4
  47. package/types/coupon/index.ts +2 -2
  48. package/types/coupon/snake.ts +2 -2
  49. package/types/currency/camel.ts +2 -2
  50. package/types/currency/index.ts +3 -3
  51. package/types/discount/camel.ts +3 -3
  52. package/types/discount/index.ts +2 -2
  53. package/types/giftcard/camel.ts +10 -7
  54. package/types/giftcard/index.ts +2 -2
  55. package/types/giftcard/snake.ts +5 -5
  56. package/types/index.d.cts +207 -0
  57. package/types/index.d.ts +83 -56
  58. package/types/invoice/camel.ts +10 -10
  59. package/types/invoice/index.ts +3 -3
  60. package/types/invoice/snake.ts +8 -8
  61. package/types/order/camel.ts +18 -15
  62. package/types/order/index.ts +3 -3
  63. package/types/order/snake.ts +18 -13
  64. package/types/payment/camel.ts +13 -10
  65. package/types/payment/index.ts +3 -3
  66. package/types/payment/snake.ts +8 -8
  67. package/types/product/camel.ts +5 -5
  68. package/types/product/index.ts +4 -4
  69. package/types/product/snake.ts +3 -3
  70. package/types/promotion/camel.ts +6 -6
  71. package/types/promotion/index.ts +2 -2
  72. package/types/promotion/snake.ts +4 -4
  73. package/types/purchase_link/camel.ts +10 -7
  74. package/types/purchase_link/index.ts +2 -2
  75. package/types/purchase_link/snake.ts +5 -5
  76. package/types/refund/camel.ts +6 -6
  77. package/types/refund/index.ts +2 -2
  78. package/types/refund/snake.ts +4 -4
  79. package/types/shipment_rating/camel.ts +3 -3
  80. package/types/shipment_rating/index.ts +2 -2
  81. package/types/subscription/camel.ts +16 -13
  82. package/types/subscription/index.ts +3 -3
  83. package/types/subscription/snake.ts +16 -11
  84. package/types/user/camel.ts +2 -2
  85. package/types/user/index.ts +3 -3
  86. package/types/user/snake.ts +1 -1
@@ -0,0 +1,207 @@
1
+ // Generated by scripts/build-types-cjs.mjs from types/index.d.ts. Do not edit.
2
+ import type { SwellClientDefault } from './index.js' with { 'resolution-mode': 'import' };
3
+
4
+ declare const swell: SwellClientDefault<'snake'>;
5
+
6
+ declare namespace swell {
7
+ export type SnakeToCamelCase<S> = import('./index.js', { with: { 'resolution-mode': 'import' } }).SnakeToCamelCase<S>;
8
+ export type ConvertSnakeToCamelCase<T> = import('./index.js', { with: { 'resolution-mode': 'import' } }).ConvertSnakeToCamelCase<T>;
9
+ export type BaseModel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BaseModel;
10
+ export type Query = import('./index.js', { with: { 'resolution-mode': 'import' } }).Query;
11
+ export type IncludeQuery = import('./index.js', { with: { 'resolution-mode': 'import' } }).IncludeQuery;
12
+ export type InitOptions<C extends 'snake' | 'camel' = 'snake'> = import('./index.js', { with: { 'resolution-mode': 'import' } }).InitOptions<C>;
13
+ export type InitOptionsCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).InitOptionsCamel;
14
+ export type PublicConfig<C extends 'snake' | 'camel' = 'snake'> = import('./index.js', { with: { 'resolution-mode': 'import' } }).PublicConfig<C>;
15
+ export type ResultsResponse<T> = import('./index.js', { with: { 'resolution-mode': 'import' } }).ResultsResponse<T>;
16
+ export type ResultsResponseCamel<T> = import('./index.js', { with: { 'resolution-mode': 'import' } }).ResultsResponseCamel<T>;
17
+ export type Tax = import('./index.js', { with: { 'resolution-mode': 'import' } }).Tax;
18
+ export type ItemDiscount = import('./index.js', { with: { 'resolution-mode': 'import' } }).ItemDiscount;
19
+ export type Image = import('./index.js', { with: { 'resolution-mode': 'import' } }).Image;
20
+ export type ImageCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ImageCamel;
21
+ export type SwellError = import('./index.js', { with: { 'resolution-mode': 'import' } }).SwellError;
22
+ export type ServerError = import('./index.js', { with: { 'resolution-mode': 'import' } }).ServerError;
23
+ export type ErrorResponse = import('./index.js', { with: { 'resolution-mode': 'import' } }).ErrorResponse;
24
+ export type ProductQuery = import('./index.js', { with: { 'resolution-mode': 'import' } }).ProductQuery;
25
+ export type SwellClient<C extends 'snake' | 'camel' = 'snake'> = import('./index.js', { with: { 'resolution-mode': 'import' } }).SwellClient<C>;
26
+ export type SwellClientDefault<C extends 'snake' | 'camel'> = import('./index.js', { with: { 'resolution-mode': 'import' } }).SwellClientDefault<C>;
27
+ export type PasswordTokenInputCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).PasswordTokenInputCase;
28
+ export type AddressCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).AddressCase;
29
+ export type AccountCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).AccountCase;
30
+ export type Account = import('./index.js', { with: { 'resolution-mode': 'import' } }).Account;
31
+ export type Address = import('./index.js', { with: { 'resolution-mode': 'import' } }).Address;
32
+ export type PasswordTokenInput = import('./index.js', { with: { 'resolution-mode': 'import' } }).PasswordTokenInput;
33
+ export type AccountCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).AccountCamel;
34
+ export type AddressCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).AddressCamel;
35
+ export type PasswordTokenInputCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PasswordTokenInputCamel;
36
+ export type AttributeCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).AttributeCase;
37
+ export type Attribute = import('./index.js', { with: { 'resolution-mode': 'import' } }).Attribute;
38
+ export type AttributeCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).AttributeCamel;
39
+ export type Billing = import('./index.js', { with: { 'resolution-mode': 'import' } }).Billing;
40
+ export type BillingAffirm = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingAffirm;
41
+ export type BillingResolve = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingResolve;
42
+ export type BillingKlarna = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingKlarna;
43
+ export type BillingIdeal = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingIdeal;
44
+ export type BillingBancontact = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingBancontact;
45
+ export type BillingGoogle = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingGoogle;
46
+ export type BillingApple = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingApple;
47
+ export type BillingCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingCamel;
48
+ export type BillingAffirmCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingAffirmCamel;
49
+ export type BillingResolveCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingResolveCamel;
50
+ export type BillingKlarnaCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingKlarnaCamel;
51
+ export type BillingIdealCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingIdealCamel;
52
+ export type BillingBancontactCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingBancontactCamel;
53
+ export type BillingGoogleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingGoogleCamel;
54
+ export type BillingAppleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BillingAppleCamel;
55
+ export type InputCreateTokenCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputCreateTokenCase;
56
+ export type TokenResponseCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).TokenResponseCase;
57
+ export type CardCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).CardCase;
58
+ export type InputCreateToken = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputCreateToken;
59
+ export type TokenResponse = import('./index.js', { with: { 'resolution-mode': 'import' } }).TokenResponse;
60
+ export type Card = import('./index.js', { with: { 'resolution-mode': 'import' } }).Card;
61
+ export type InputCreateTokenCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputCreateTokenCamel;
62
+ export type TokenResponseCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).TokenResponseCamel;
63
+ export type CardCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CardCamel;
64
+ export type CartCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartCase;
65
+ export type CartItemCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemCase;
66
+ export type Cart = import('./index.js', { with: { 'resolution-mode': 'import' } }).Cart;
67
+ export type CartItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItem;
68
+ export type CartItemOptions = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemOptions;
69
+ export type CartItemPurchaseOption = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemPurchaseOption;
70
+ export type CartItemBillingSchedule = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemBillingSchedule;
71
+ export type CartItemOrderSchedule = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemOrderSchedule;
72
+ export type CartGiftCardItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartGiftCardItem;
73
+ export type CartShipping = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartShipping;
74
+ export type CartCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartCamel;
75
+ export type CartItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemCamel;
76
+ export type CartItemOptionsCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemOptionsCamel;
77
+ export type CartItemPurchaseOptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemPurchaseOptionCamel;
78
+ export type CartItemBillingScheduleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemBillingScheduleCamel;
79
+ export type CartItemOrderScheduleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartItemOrderScheduleCamel;
80
+ export type CartGiftCardItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartGiftCardItemCamel;
81
+ export type CartShippingCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CartShippingCamel;
82
+ export type CategoryCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).CategoryCase;
83
+ export type Category = import('./index.js', { with: { 'resolution-mode': 'import' } }).Category;
84
+ export type CategoryCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CategoryCamel;
85
+ export type ContentCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentCase;
86
+ export type ContentSectionCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentSectionCase;
87
+ export type ContentPageCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentPageCase;
88
+ export type ContentBlogCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlogCase;
89
+ export type ContentBlogCategoryCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlogCategoryCase;
90
+ export type Content = import('./index.js', { with: { 'resolution-mode': 'import' } }).Content;
91
+ export type ContentSection = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentSection;
92
+ export type ContentPage = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentPage;
93
+ export type ContentBlog = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlog;
94
+ export type ContentBlogCategory = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlogCategory;
95
+ export type ContentCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentCamel;
96
+ export type ContentSectionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentSectionCamel;
97
+ export type ContentPageCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentPageCamel;
98
+ export type ContentBlogCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlogCamel;
99
+ export type ContentBlogCategoryCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentBlogCategoryCamel;
100
+ export type Coupon = import('./index.js', { with: { 'resolution-mode': 'import' } }).Coupon;
101
+ export type CouponCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CouponCamel;
102
+ export type SelectCurrencyReturnCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).SelectCurrencyReturnCase;
103
+ export type EnabledCurrencyCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).EnabledCurrencyCase;
104
+ export type FormatInputCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).FormatInputCase;
105
+ export type SelectCurrencyReturn = import('./index.js', { with: { 'resolution-mode': 'import' } }).SelectCurrencyReturn;
106
+ export type EnabledCurrency = import('./index.js', { with: { 'resolution-mode': 'import' } }).EnabledCurrency;
107
+ export type FormatInput = import('./index.js', { with: { 'resolution-mode': 'import' } }).FormatInput;
108
+ export type SelectCurrencyReturnCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SelectCurrencyReturnCamel;
109
+ export type EnabledCurrencyCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).EnabledCurrencyCamel;
110
+ export type FormatInputCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).FormatInputCamel;
111
+ export type Discount = import('./index.js', { with: { 'resolution-mode': 'import' } }).Discount;
112
+ export type DiscountRule = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRule;
113
+ export type DiscountRuleBuyGetItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRuleBuyGetItem;
114
+ export type DiscountRuleBuyGetProduct = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRuleBuyGetProduct;
115
+ export type DiscountRuleBuyGetCategory = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRuleBuyGetCategory;
116
+ export type DiscountCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountCamel;
117
+ export type DiscountRuleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRuleCamel;
118
+ export type DiscountRuleBuyGetItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).DiscountRuleBuyGetItemCamel;
119
+ export type GiftcardDebit = import('./index.js', { with: { 'resolution-mode': 'import' } }).GiftcardDebit;
120
+ export type Giftcard = import('./index.js', { with: { 'resolution-mode': 'import' } }).Giftcard;
121
+ export type GiftcardDebitCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).GiftcardDebitCamel;
122
+ export type GiftcardCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).GiftcardCamel;
123
+ export type InvoiceCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).InvoiceCase;
124
+ export type Invoice = import('./index.js', { with: { 'resolution-mode': 'import' } }).Invoice;
125
+ export type InvoiceItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).InvoiceItem;
126
+ export type InvoiceCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).InvoiceCamel;
127
+ export type InvoiceItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).InvoiceItemCamel;
128
+ export type Locale = import('./index.js', { with: { 'resolution-mode': 'import' } }).Locale;
129
+ export type OrderCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderCase;
130
+ export type Order = import('./index.js', { with: { 'resolution-mode': 'import' } }).Order;
131
+ export type OrderOption = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderOption;
132
+ export type OrderItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderItem;
133
+ export type OrderShipping = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderShipping;
134
+ export type OrderGiftCard = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderGiftCard;
135
+ export type OrderCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderCamel;
136
+ export type OrderGiftCardCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderGiftCardCamel;
137
+ export type OrderItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderItemCamel;
138
+ export type OrderOptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderOptionCamel;
139
+ export type OrderShippingCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OrderShippingCamel;
140
+ export type PaymentCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).PaymentCase;
141
+ export type InputPaymentElementBase = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementBase;
142
+ export type InputPaymentElementCard = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementCard;
143
+ export type InputPaymentElementIdeal = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementIdeal;
144
+ export type InputPaymentElementPaypal = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementPaypal;
145
+ export type InputPaymentElementApple = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementApple;
146
+ export type InputPaymentElementGoogle = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementGoogle;
147
+ export type InputPaymentElementSezzle = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentElementSezzle;
148
+ export type InputPaymentRedirect = import('./index.js', { with: { 'resolution-mode': 'import' } }).InputPaymentRedirect;
149
+ export type Payment = import('./index.js', { with: { 'resolution-mode': 'import' } }).Payment;
150
+ export type PaymentCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PaymentCamel;
151
+ export type PriceRange = import('./index.js', { with: { 'resolution-mode': 'import' } }).PriceRange;
152
+ export type FlexibleProductInput = import('./index.js', { with: { 'resolution-mode': 'import' } }).FlexibleProductInput;
153
+ export type FlexibleProductInputCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).FlexibleProductInputCamel;
154
+ export type FlexibleProductInputCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).FlexibleProductInputCase;
155
+ export type ProductCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).ProductCase;
156
+ export type ContentObject = import('./index.js', { with: { 'resolution-mode': 'import' } }).ContentObject;
157
+ export type Product = import('./index.js', { with: { 'resolution-mode': 'import' } }).Product;
158
+ export type Variant = import('./index.js', { with: { 'resolution-mode': 'import' } }).Variant;
159
+ export type Price = import('./index.js', { with: { 'resolution-mode': 'import' } }).Price;
160
+ export type Upsell = import('./index.js', { with: { 'resolution-mode': 'import' } }).Upsell;
161
+ export type ProductOption = import('./index.js', { with: { 'resolution-mode': 'import' } }).ProductOption;
162
+ export type OptionValue = import('./index.js', { with: { 'resolution-mode': 'import' } }).OptionValue;
163
+ export type Bundle = import('./index.js', { with: { 'resolution-mode': 'import' } }).Bundle;
164
+ export type CrossSell = import('./index.js', { with: { 'resolution-mode': 'import' } }).CrossSell;
165
+ export type PurchaseOptions = import('./index.js', { with: { 'resolution-mode': 'import' } }).PurchaseOptions;
166
+ export type StandardPurchaseOption = import('./index.js', { with: { 'resolution-mode': 'import' } }).StandardPurchaseOption;
167
+ export type SubscriptionPlan = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionPlan;
168
+ export type SubscriptionPurchaseOption = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionPurchaseOption;
169
+ export type SubscriptionInterval = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionInterval;
170
+ export type ProductCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ProductCamel;
171
+ export type VariantCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).VariantCamel;
172
+ export type PriceCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PriceCamel;
173
+ export type UpsellCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).UpsellCamel;
174
+ export type ProductOptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ProductOptionCamel;
175
+ export type OptionValueCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).OptionValueCamel;
176
+ export type BundleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).BundleCamel;
177
+ export type CrossSellCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).CrossSellCamel;
178
+ export type PurchaseOptionsCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PurchaseOptionsCamel;
179
+ export type StandardPurchaseOptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).StandardPurchaseOptionCamel;
180
+ export type SubscriptionPlanCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionPlanCamel;
181
+ export type SubscriptionPurchaseOptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionPurchaseOptionCamel;
182
+ export type Promotion = import('./index.js', { with: { 'resolution-mode': 'import' } }).Promotion;
183
+ export type PromotionExclusion = import('./index.js', { with: { 'resolution-mode': 'import' } }).PromotionExclusion;
184
+ export type PromotionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PromotionCamel;
185
+ export type PromotionExclusionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PromotionExclusionCamel;
186
+ export type PurchaseLink = import('./index.js', { with: { 'resolution-mode': 'import' } }).PurchaseLink;
187
+ export type PurchaseLinkCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).PurchaseLinkCamel;
188
+ export type Refund = import('./index.js', { with: { 'resolution-mode': 'import' } }).Refund;
189
+ export type RefundCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).RefundCamel;
190
+ export type Settings = import('./index.js', { with: { 'resolution-mode': 'import' } }).Settings;
191
+ export type ShipmentRating = import('./index.js', { with: { 'resolution-mode': 'import' } }).ShipmentRating;
192
+ export type ShipmentService = import('./index.js', { with: { 'resolution-mode': 'import' } }).ShipmentService;
193
+ export type ShipmentRatingCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ShipmentRatingCamel;
194
+ export type ShipmentServiceCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).ShipmentServiceCamel;
195
+ export type SubscriptionCase = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionCase;
196
+ export type SubscriptionBillingSchedule = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionBillingSchedule;
197
+ export type SubscriptionOrderSchedule = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionOrderSchedule;
198
+ export type SubscriptionItem = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionItem;
199
+ export type Subscription = import('./index.js', { with: { 'resolution-mode': 'import' } }).Subscription;
200
+ export type SubscriptionBillingScheduleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionBillingScheduleCamel;
201
+ export type SubscriptionOrderScheduleCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionOrderScheduleCamel;
202
+ export type SubscriptionItemCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionItemCamel;
203
+ export type SubscriptionCamel = import('./index.js', { with: { 'resolution-mode': 'import' } }).SubscriptionCamel;
204
+ }
205
+
206
+ export as namespace swell;
207
+ export = swell;
package/types/index.d.ts CHANGED
@@ -8,25 +8,29 @@ import type {
8
8
  AccountCase,
9
9
  AddressCase,
10
10
  PasswordTokenInputCase,
11
- } from './account';
12
- import type { AttributeCase } from './attribute';
13
- import type { CardCase, InputCreateTokenCase, TokenResponseCase } from './card';
14
- import type { CartCase, CartItemCase } from './cart';
15
- import type { CategoryCase } from './category';
16
- import type { ContentCase } from './content';
11
+ } from './account/index.js';
12
+ import type { AttributeCase } from './attribute/index.js';
13
+ import type {
14
+ CardCase,
15
+ InputCreateTokenCase,
16
+ TokenResponseCase,
17
+ } from './card/index.js';
18
+ import type { CartCase, CartItemCase } from './cart/index.js';
19
+ import type { CategoryCase } from './category/index.js';
20
+ import type { ContentCase } from './content/index.js';
17
21
  import type {
18
22
  SelectCurrencyReturnCase,
19
23
  EnabledCurrencyCase,
20
24
  FormatInputCase,
21
- } from './currency';
22
- import type { InvoiceCase } from './invoice';
23
- import type { Locale } from './locale';
24
- import type { OrderCase } from './order';
25
+ } from './currency/index.js';
26
+ import type { InvoiceCase } from './invoice/index.js';
27
+ import type { Locale } from './locale/index.js';
28
+ import type { OrderCase } from './order/index.js';
25
29
  import type {
26
30
  ProductCase,
27
31
  FlexibleProductInputCase,
28
32
  PriceRange,
29
- } from './product';
33
+ } from './product/index.js';
30
34
 
31
35
  import type {
32
36
  InputPaymentElementCard,
@@ -37,34 +41,34 @@ import type {
37
41
  InputPaymentElementSezzle,
38
42
  InputPaymentRedirect,
39
43
  PaymentCase,
40
- } from './payment';
41
-
42
- import type { Settings } from './settings';
43
- import type { SubscriptionCase } from './subscription';
44
- import type { MakeCase } from './utils';
45
-
46
- export type * from './account';
47
- export type * from './attribute';
48
- export type * from './billing';
49
- export type * from './card';
50
- export type * from './cart';
51
- export type * from './category';
52
- export type * from './content';
53
- export type * from './coupon';
54
- export type * from './currency';
55
- export type * from './discount';
56
- export type * from './giftcard';
57
- export type * from './invoice';
58
- export type * from './locale';
59
- export type * from './order';
60
- export type * from './payment';
61
- export type * from './product';
62
- export type * from './promotion';
63
- export type * from './purchase_link';
64
- export type * from './refund';
65
- export type * from './settings';
66
- export type * from './shipment_rating';
67
- export type * from './subscription';
44
+ } from './payment/index.js';
45
+
46
+ import type { Settings } from './settings/index.js';
47
+ import type { SubscriptionCase } from './subscription/index.js';
48
+ import type { MakeCase } from './utils.js';
49
+
50
+ export type * from './account/index.js';
51
+ export type * from './attribute/index.js';
52
+ export type * from './billing/index.js';
53
+ export type * from './card/index.js';
54
+ export type * from './cart/index.js';
55
+ export type * from './category/index.js';
56
+ export type * from './content/index.js';
57
+ export type * from './coupon/index.js';
58
+ export type * from './currency/index.js';
59
+ export type * from './discount/index.js';
60
+ export type * from './giftcard/index.js';
61
+ export type * from './invoice/index.js';
62
+ export type * from './locale/index.js';
63
+ export type * from './order/index.js';
64
+ export type * from './payment/index.js';
65
+ export type * from './product/index.js';
66
+ export type * from './promotion/index.js';
67
+ export type * from './purchase_link/index.js';
68
+ export type * from './refund/index.js';
69
+ export type * from './settings/index.js';
70
+ export type * from './shipment_rating/index.js';
71
+ export type * from './subscription/index.js';
68
72
 
69
73
  export type SnakeToCamelCase<S> = S extends `${infer T}_${infer U}`
70
74
  ? `${T}${Capitalize<SnakeToCamelCase<U>>}`
@@ -108,7 +112,11 @@ export interface InitOptions<C extends 'snake' | 'camel' = 'snake'> {
108
112
  useCamelCase?: boolean;
109
113
  url?: string;
110
114
  vaultUrl?: string;
111
- setCookie?: (key: string, value: string) => void;
115
+ setCookie?: (
116
+ key: string,
117
+ value: string,
118
+ options?: Record<string, string | number | boolean | Date>,
119
+ ) => void;
112
120
  getCookie?: (key: string) => string | undefined;
113
121
  headers?: Record<string, string>;
114
122
  getCart?: () => Promise<CartCase[C] | null>;
@@ -125,6 +133,15 @@ export interface InitOptionsCamel extends InitOptions<'camel'> {
125
133
  useCamelCase: true;
126
134
  }
127
135
 
136
+ /** Serializable initialization options; applications expose only public values. */
137
+ export type PublicConfig<C extends 'snake' | 'camel' = 'snake'> = Omit<
138
+ InitOptions<C>,
139
+ 'setCookie' | 'getCookie' | 'getCart' | 'updateCart'
140
+ > & {
141
+ storeId: string;
142
+ publicKey: string;
143
+ };
144
+
128
145
  export interface ResultsResponse<T> {
129
146
  count: number;
130
147
  limit: number;
@@ -320,7 +337,7 @@ export interface SwellClient<C extends 'snake' | 'camel' = 'snake'> {
320
337
  };
321
338
 
322
339
  currency: {
323
- format(amount: number, format: FormatInputCase[C]): string;
340
+ format(amount: number, format?: FormatInputCase[C]): string;
324
341
  set(code?: string): EnabledCurrencyCase[C];
325
342
  get(): EnabledCurrencyCase[C];
326
343
  list(): EnabledCurrencyCase[C][] | Promise<EnabledCurrencyCase[C][]>;
@@ -504,21 +521,28 @@ export interface SwellClient<C extends 'snake' | 'camel' = 'snake'> {
504
521
  data?: unknown,
505
522
  options?: unknown,
506
523
  ): Promise<object>;
524
+
525
+ delete(
526
+ appId: string,
527
+ functionName: string,
528
+ data?: unknown,
529
+ options?: unknown,
530
+ ): Promise<object>;
507
531
  };
508
532
 
509
533
  utils: {
510
- get: typeof import('lodash-es/get').default;
511
- set: typeof import('lodash-es/set').default;
512
- uniq: typeof import('lodash-es/uniq').default;
513
- find: typeof import('lodash-es/find').default;
514
- round: typeof import('lodash-es/round').default;
515
- pick: typeof import('lodash-es/pick').default;
516
- findIndex: typeof import('lodash-es/findIndex').default;
517
- cloneDeep: typeof import('lodash-es/cloneDeep').default;
518
- toNumber: typeof import('lodash-es/toNumber').default;
519
- toLower: typeof import('lodash-es/toLower').default;
520
- isEqual: typeof import('lodash-es/isEqual').default;
521
- isEmpty: typeof import('lodash-es/isEmpty').default;
534
+ get: typeof import('lodash-es').get;
535
+ set: typeof import('lodash-es').set;
536
+ uniq: typeof import('lodash-es').uniq;
537
+ find: typeof import('lodash-es').find;
538
+ round: typeof import('lodash-es').round;
539
+ pick: typeof import('lodash-es').pick;
540
+ findIndex: typeof import('lodash-es').findIndex;
541
+ cloneDeep: typeof import('lodash-es').cloneDeep;
542
+ toNumber: typeof import('lodash-es').toNumber;
543
+ toLower: typeof import('lodash-es').toLower;
544
+ isEqual: typeof import('lodash-es').isEqual;
545
+ isEmpty: typeof import('lodash-es').isEmpty;
522
546
  merge: typeof import('deepmerge');
523
547
 
524
548
  map<T, R>(arr: T[], mapper: (item: T) => R): R[];
@@ -559,7 +583,11 @@ export interface SwellClient<C extends 'snake' | 'camel' = 'snake'> {
559
583
  delete<T>(url: string, data?: unknown): Promise<T>;
560
584
 
561
585
  getCookie(key: string): string | undefined;
562
- setCookie(key: string, value: string, options?: Record<string, string>): void;
586
+ setCookie(
587
+ key: string,
588
+ value: string,
589
+ options?: Record<string, string | number | boolean | Date>,
590
+ ): void;
563
591
  }
564
592
 
565
593
  export interface SwellClientDefault<C extends 'snake' | 'camel'>
@@ -581,5 +609,4 @@ export interface SwellClientDefault<C extends 'snake' | 'camel'>
581
609
 
582
610
  declare const swell: SwellClientDefault<'snake'>;
583
611
 
584
- export as namespace swell;
585
- export = swell;
612
+ export default swell;
@@ -1,15 +1,15 @@
1
- import type { ConvertSnakeToCamelCase } from '..';
2
- import type { Replace } from '../utils';
1
+ import type { ConvertSnakeToCamelCase } from '../index.js';
2
+ import type { Replace } from '../utils.js';
3
3
 
4
- import type { OrderCamel, OrderShippingCamel } from '../order/camel';
5
- import type { SubscriptionCamel } from '../subscription/camel';
6
- import type { DiscountCamel } from '../discount/camel';
7
- import type { AccountCamel } from '../account/camel';
8
- import type { ProductCamel } from '../product/camel';
9
- import type { BillingCamel } from '../billing/camel';
10
- import type { CouponCamel } from '../coupon/camel';
4
+ import type { OrderCamel, OrderShippingCamel } from '../order/camel.js';
5
+ import type { SubscriptionCamel } from '../subscription/camel.js';
6
+ import type { DiscountCamel } from '../discount/camel.js';
7
+ import type { AccountCamel } from '../account/camel.js';
8
+ import type { ProductCamel } from '../product/camel.js';
9
+ import type { BillingCamel } from '../billing/camel.js';
10
+ import type { CouponCamel } from '../coupon/camel.js';
11
11
 
12
- import type { Invoice, InvoiceItem } from './snake';
12
+ import type { Invoice, InvoiceItem } from './snake.js';
13
13
 
14
14
  export type InvoiceItemCamel = ConvertSnakeToCamelCase<
15
15
  Replace<
@@ -1,7 +1,7 @@
1
- import type { MakeCase } from '../utils';
1
+ import type { MakeCase } from '../utils.js';
2
2
 
3
- import type { Invoice, InvoiceItem } from './snake';
4
- import type { InvoiceCamel, InvoiceItemCamel } from './camel';
3
+ import type { Invoice, InvoiceItem } from './snake.js';
4
+ import type { InvoiceCamel, InvoiceItemCamel } from './camel.js';
5
5
 
6
6
  export type InvoiceCase = MakeCase<Invoice, InvoiceCamel>;
7
7
 
@@ -1,12 +1,12 @@
1
- import type { BaseModel, ItemDiscount, Tax } from '../index';
1
+ import type { BaseModel, ItemDiscount, Tax } from '../index.js';
2
2
 
3
- import type { Order, OrderShipping } from '../order';
4
- import type { Subscription } from '../subscription';
5
- import type { Discount } from '../discount';
6
- import type { Account } from '../account';
7
- import type { Product } from '../product';
8
- import type { Billing } from '../billing';
9
- import type { Coupon } from '../coupon';
3
+ import type { Order, OrderShipping } from '../order/index.js';
4
+ import type { Subscription } from '../subscription/index.js';
5
+ import type { Discount } from '../discount/index.js';
6
+ import type { Account } from '../account/index.js';
7
+ import type { Product } from '../product/index.js';
8
+ import type { Billing } from '../billing/index.js';
9
+ import type { Coupon } from '../coupon/index.js';
10
10
 
11
11
  export interface InvoiceItem {
12
12
  id?: string;
@@ -1,18 +1,21 @@
1
- import type { ConvertSnakeToCamelCase, ResultsResponseCamel } from '..';
2
- import type { Replace } from '../utils';
1
+ import type {
2
+ ConvertSnakeToCamelCase,
3
+ ResultsResponseCamel,
4
+ } from '../index.js';
5
+ import type { Replace } from '../utils.js';
3
6
 
4
- import type { CartCamel, CartItemPurchaseOptionCamel } from '../cart/camel';
5
- import type { ProductCamel, VariantCamel } from '../product/camel';
6
- import type { AccountCamel, AddressCamel } from '../account/camel';
7
- import type { GiftcardCamel } from '../giftcard/camel';
8
- import type { PaymentCamel } from '../payment/camel';
9
- import type { BillingCamel } from '../billing/camel';
10
- import type { CouponCamel } from '../coupon/camel';
11
- import type { DiscountCamel } from '../discount/camel';
12
- import type { PromotionCamel } from '../promotion/camel';
13
- import type { SubscriptionCamel } from '../subscription/camel';
14
- import type { PurchaseLinkCamel } from '../purchase_link/camel';
15
- import type { ShipmentRatingCamel } from '../shipment_rating/camel';
7
+ import type { CartCamel, CartItemPurchaseOptionCamel } from '../cart/camel.js';
8
+ import type { ProductCamel, VariantCamel } from '../product/camel.js';
9
+ import type { AccountCamel, AddressCamel } from '../account/camel.js';
10
+ import type { GiftcardCamel } from '../giftcard/camel.js';
11
+ import type { PaymentCamel } from '../payment/camel.js';
12
+ import type { BillingCamel } from '../billing/camel.js';
13
+ import type { CouponCamel } from '../coupon/camel.js';
14
+ import type { DiscountCamel } from '../discount/camel.js';
15
+ import type { PromotionCamel } from '../promotion/camel.js';
16
+ import type { SubscriptionCamel } from '../subscription/camel.js';
17
+ import type { PurchaseLinkCamel } from '../purchase_link/camel.js';
18
+ import type { ShipmentRatingCamel } from '../shipment_rating/camel.js';
16
19
 
17
20
  import type {
18
21
  Order,
@@ -20,7 +23,7 @@ import type {
20
23
  OrderShipping,
21
24
  OrderOption,
22
25
  OrderGiftCard,
23
- } from './snake';
26
+ } from './snake.js';
24
27
 
25
28
  export type OrderOptionCamel = ConvertSnakeToCamelCase<OrderOption>;
26
29
 
@@ -1,4 +1,4 @@
1
- import type { MakeCase } from '../utils';
1
+ import type { MakeCase } from '../utils.js';
2
2
 
3
3
  import type {
4
4
  Order,
@@ -6,7 +6,7 @@ import type {
6
6
  OrderItem,
7
7
  OrderShipping,
8
8
  OrderGiftCard,
9
- } from './snake';
9
+ } from './snake.js';
10
10
 
11
11
  import type {
12
12
  OrderCamel,
@@ -14,7 +14,7 @@ import type {
14
14
  OrderItemCamel,
15
15
  OrderOptionCamel,
16
16
  OrderShippingCamel,
17
- } from './camel';
17
+ } from './camel.js';
18
18
 
19
19
  export type OrderCase = MakeCase<Order, OrderCamel>;
20
20
 
@@ -1,17 +1,22 @@
1
- import type { BaseModel, ItemDiscount, ResultsResponse, Tax } from '../index';
1
+ import type {
2
+ BaseModel,
3
+ ItemDiscount,
4
+ ResultsResponse,
5
+ Tax,
6
+ } from '../index.js';
2
7
 
3
- import type { Cart, CartItemPurchaseOption } from '../cart';
4
- import type { Product, Variant } from '../product';
5
- import type { Account, Address } from '../account';
6
- import type { Giftcard } from '../giftcard';
7
- import type { Payment } from '../payment';
8
- import type { Billing } from '../billing';
9
- import type { Coupon } from '../coupon';
10
- import type { Discount } from '../discount';
11
- import type { Promotion } from '../promotion';
12
- import type { Subscription } from '../subscription';
13
- import type { PurchaseLink } from '../purchase_link';
14
- import type { ShipmentRating } from '../shipment_rating';
8
+ import type { Cart, CartItemPurchaseOption } from '../cart/index.js';
9
+ import type { Product, Variant } from '../product/index.js';
10
+ import type { Account, Address } from '../account/index.js';
11
+ import type { Giftcard } from '../giftcard/index.js';
12
+ import type { Payment } from '../payment/index.js';
13
+ import type { Billing } from '../billing/index.js';
14
+ import type { Coupon } from '../coupon/index.js';
15
+ import type { Discount } from '../discount/index.js';
16
+ import type { Promotion } from '../promotion/index.js';
17
+ import type { Subscription } from '../subscription/index.js';
18
+ import type { PurchaseLink } from '../purchase_link/index.js';
19
+ import type { ShipmentRating } from '../shipment_rating/index.js';
15
20
 
16
21
  export interface OrderOption {
17
22
  id?: string;
@@ -1,15 +1,18 @@
1
- import type { ConvertSnakeToCamelCase, ResultsResponseCamel } from '..';
2
- import type { Replace } from '../utils';
1
+ import type {
2
+ ConvertSnakeToCamelCase,
3
+ ResultsResponseCamel,
4
+ } from '../index.js';
5
+ import type { Replace } from '../utils.js';
3
6
 
4
- import type { AccountCamel } from '../account/camel';
5
- import type { SubscriptionCamel } from '../subscription/camel';
6
- import type { GiftcardCamel } from '../giftcard/camel';
7
- import type { InvoiceCamel } from '../invoice/camel';
8
- import type { RefundCamel } from '../refund/camel';
9
- import type { OrderCamel } from '../order/camel';
10
- import type { CardCamel } from '../card/camel';
7
+ import type { AccountCamel } from '../account/camel.js';
8
+ import type { SubscriptionCamel } from '../subscription/camel.js';
9
+ import type { GiftcardCamel } from '../giftcard/camel.js';
10
+ import type { InvoiceCamel } from '../invoice/camel.js';
11
+ import type { RefundCamel } from '../refund/camel.js';
12
+ import type { OrderCamel } from '../order/camel.js';
13
+ import type { CardCamel } from '../card/camel.js';
11
14
 
12
- import type { Payment } from './snake';
15
+ import type { Payment } from './snake.js';
13
16
 
14
17
  export type PaymentCamel = ConvertSnakeToCamelCase<
15
18
  Replace<