swell-js 5.8.2 → 5.9.0

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 (82) hide show
  1. package/dist/api.mjs +51 -39
  2. package/dist/attributes.mjs +2 -3
  3. package/dist/cache.mjs +139 -137
  4. package/dist/card.mjs +147 -145
  5. package/dist/cart.mjs +1 -2
  6. package/dist/categories.mjs +2 -3
  7. package/dist/content.mjs +1 -9
  8. package/dist/cookie.mjs +1 -1
  9. package/dist/{index.a8d5c125.mjs → index.777df7a8.mjs} +2 -14
  10. package/dist/index.mjs +1 -1
  11. package/dist/payment.mjs +10 -12
  12. package/dist/products.mjs +8 -12
  13. package/dist/settings.mjs +1 -1
  14. package/dist/subscriptions.mjs +2 -3
  15. package/dist/swell.cjs +319 -318
  16. package/dist/swell.cjs.map +1 -1
  17. package/dist/swell.umd.min.js +318 -317
  18. package/dist/swell.umd.min.js.map +1 -1
  19. package/dist/utils/index.mjs +1 -1
  20. package/package.json +13 -6
  21. package/types/account/camel.ts +10 -7
  22. package/types/account/index.ts +3 -3
  23. package/types/account/snake.ts +5 -5
  24. package/types/attribute/camel.ts +7 -4
  25. package/types/attribute/index.ts +3 -3
  26. package/types/attribute/snake.ts +2 -2
  27. package/types/billing/camel.ts +4 -4
  28. package/types/billing/index.ts +2 -2
  29. package/types/billing/snake.ts +1 -1
  30. package/types/card/camel.ts +5 -5
  31. package/types/card/index.ts +3 -3
  32. package/types/card/snake.ts +3 -3
  33. package/types/cart/camel.ts +17 -14
  34. package/types/cart/index.ts +3 -3
  35. package/types/cart/snake.ts +12 -12
  36. package/types/category/camel.ts +4 -4
  37. package/types/category/index.ts +3 -3
  38. package/types/category/snake.ts +2 -2
  39. package/types/content/camel.ts +5 -5
  40. package/types/content/index.ts +3 -3
  41. package/types/content/snake.ts +3 -3
  42. package/types/coupon/camel.ts +4 -4
  43. package/types/coupon/index.ts +2 -2
  44. package/types/coupon/snake.ts +2 -2
  45. package/types/currency/camel.ts +2 -2
  46. package/types/currency/index.ts +3 -3
  47. package/types/discount/camel.ts +3 -3
  48. package/types/discount/index.ts +2 -2
  49. package/types/giftcard/camel.ts +10 -7
  50. package/types/giftcard/index.ts +2 -2
  51. package/types/giftcard/snake.ts +5 -5
  52. package/types/index.d.cts +207 -0
  53. package/types/index.d.ts +83 -56
  54. package/types/invoice/camel.ts +10 -10
  55. package/types/invoice/index.ts +3 -3
  56. package/types/invoice/snake.ts +8 -8
  57. package/types/order/camel.ts +18 -15
  58. package/types/order/index.ts +3 -3
  59. package/types/order/snake.ts +18 -13
  60. package/types/payment/camel.ts +13 -10
  61. package/types/payment/index.ts +3 -3
  62. package/types/payment/snake.ts +8 -8
  63. package/types/product/camel.ts +5 -5
  64. package/types/product/index.ts +4 -4
  65. package/types/product/snake.ts +3 -3
  66. package/types/promotion/camel.ts +6 -6
  67. package/types/promotion/index.ts +2 -2
  68. package/types/promotion/snake.ts +4 -4
  69. package/types/purchase_link/camel.ts +10 -7
  70. package/types/purchase_link/index.ts +2 -2
  71. package/types/purchase_link/snake.ts +5 -5
  72. package/types/refund/camel.ts +6 -6
  73. package/types/refund/index.ts +2 -2
  74. package/types/refund/snake.ts +4 -4
  75. package/types/shipment_rating/camel.ts +3 -3
  76. package/types/shipment_rating/index.ts +2 -2
  77. package/types/subscription/camel.ts +16 -13
  78. package/types/subscription/index.ts +3 -3
  79. package/types/subscription/snake.ts +16 -11
  80. package/types/user/camel.ts +2 -2
  81. package/types/user/index.ts +3 -3
  82. package/types/user/snake.ts +1 -1
@@ -1,7 +1,7 @@
1
- import type { MakeCase } from '../utils';
1
+ import type { MakeCase } from '../utils.js';
2
2
 
3
- import type { Payment } from './snake';
4
- import type { PaymentCamel } from './camel';
3
+ import type { Payment } from './snake.js';
4
+ import type { PaymentCamel } from './camel.js';
5
5
 
6
6
  export type PaymentCase = MakeCase<Payment, PaymentCamel>;
7
7
 
@@ -1,12 +1,12 @@
1
- import type { BaseModel, ResultsResponse } from '../index';
1
+ import type { BaseModel, ResultsResponse } from '../index.js';
2
2
 
3
- import type { Account } from '../account';
4
- import type { Subscription } from '../subscription';
5
- import type { Giftcard } from '../giftcard';
6
- import type { Invoice } from '../invoice';
7
- import type { Refund } from '../refund';
8
- import type { Order } from '../order';
9
- import type { Card } from '../card';
3
+ import type { Account } from '../account/index.js';
4
+ import type { Subscription } from '../subscription/index.js';
5
+ import type { Giftcard } from '../giftcard/index.js';
6
+ import type { Invoice } from '../invoice/index.js';
7
+ import type { Refund } from '../refund/index.js';
8
+ import type { Order } from '../order/index.js';
9
+ import type { Card } from '../card/index.js';
10
10
 
11
11
  export interface Payment extends BaseModel {
12
12
  account?: Account;
@@ -2,14 +2,14 @@ import type {
2
2
  ConvertSnakeToCamelCase,
3
3
  ResultsResponseCamel,
4
4
  ImageCamel,
5
- } from '..';
6
- import type { Replace } from '../utils';
5
+ } from '../index.js';
6
+ import type { Replace } from '../utils.js';
7
7
 
8
- import type { AttributeCamel } from '../attribute/camel';
8
+ import type { AttributeCamel } from '../attribute/camel.js';
9
9
  import type {
10
10
  SubscriptionBillingScheduleCamel,
11
11
  SubscriptionOrderScheduleCamel,
12
- } from '../subscription/camel';
12
+ } from '../subscription/camel.js';
13
13
 
14
14
  import type {
15
15
  Product,
@@ -23,7 +23,7 @@ import type {
23
23
  StandardPurchaseOption,
24
24
  SubscriptionPlan,
25
25
  SubscriptionPurchaseOption,
26
- } from './snake';
26
+ } from './snake.js';
27
27
 
28
28
  export type BundleCamel = ConvertSnakeToCamelCase<
29
29
  Replace<
@@ -1,5 +1,5 @@
1
- import type { ResultsResponse, ResultsResponseCamel } from '../index';
2
- import type { MakeCase } from '../utils';
1
+ import type { ResultsResponse, ResultsResponseCamel } from '../index.js';
2
+ import type { MakeCase } from '../utils.js';
3
3
 
4
4
  import type {
5
5
  ContentObject,
@@ -16,7 +16,7 @@ import type {
16
16
  SubscriptionPlan,
17
17
  SubscriptionPurchaseOption,
18
18
  SubscriptionInterval,
19
- } from './snake';
19
+ } from './snake.js';
20
20
 
21
21
  import type {
22
22
  ProductCamel,
@@ -31,7 +31,7 @@ import type {
31
31
  StandardPurchaseOptionCamel,
32
32
  SubscriptionPlanCamel,
33
33
  SubscriptionPurchaseOptionCamel,
34
- } from './camel';
34
+ } from './camel.js';
35
35
 
36
36
  export interface PriceRange {
37
37
  interval: number;
@@ -1,10 +1,10 @@
1
- import type { BaseModel, ResultsResponse, Image } from '../index';
1
+ import type { BaseModel, ResultsResponse, Image } from '../index.js';
2
2
 
3
- import type { Attribute } from '../attribute';
3
+ import type { Attribute } from '../attribute/index.js';
4
4
  import type {
5
5
  SubscriptionBillingSchedule,
6
6
  SubscriptionOrderSchedule,
7
- } from '../subscription';
7
+ } from '../subscription/index.js';
8
8
 
9
9
  export type SubscriptionInterval = 'monthly' | 'daily' | 'weekly' | 'yearly';
10
10
 
@@ -1,11 +1,11 @@
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 { ProductCamel } from '../product/camel';
5
- import type { DiscountCamel } from '../discount/camel';
6
- import type { CategoryCamel } from '../category/camel';
4
+ import type { ProductCamel } from '../product/camel.js';
5
+ import type { DiscountCamel } from '../discount/camel.js';
6
+ import type { CategoryCamel } from '../category/camel.js';
7
7
 
8
- import type { Promotion, PromotionExclusion } from './snake';
8
+ import type { Promotion, PromotionExclusion } from './snake.js';
9
9
 
10
10
  export type PromotionExclusionCamel = ConvertSnakeToCamelCase<
11
11
  Replace<
@@ -1,2 +1,2 @@
1
- export type { Promotion, PromotionExclusion } from './snake';
2
- export type { PromotionCamel, PromotionExclusionCamel } from './camel';
1
+ export type { Promotion, PromotionExclusion } from './snake.js';
2
+ export type { PromotionCamel, PromotionExclusionCamel } from './camel.js';
@@ -1,8 +1,8 @@
1
- import type { BaseModel } from '..';
1
+ import type { BaseModel } from '../index.js';
2
2
 
3
- import type { Product } from '../product';
4
- import type { Discount } from '../discount';
5
- import type { Category } from '../category';
3
+ import type { Product } from '../product/index.js';
4
+ import type { Discount } from '../discount/index.js';
5
+ import type { Category } from '../category/index.js';
6
6
 
7
7
  export interface PromotionExclusion {
8
8
  id: string;
@@ -1,12 +1,15 @@
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 { CouponCamel } from '../coupon/camel';
5
- import type { CartItemCamel } from '../cart/camel';
6
- import type { PromotionCamel } from '../promotion/camel';
7
- import type { DiscountCamel } from '../discount/camel';
7
+ import type { CouponCamel } from '../coupon/camel.js';
8
+ import type { CartItemCamel } from '../cart/camel.js';
9
+ import type { PromotionCamel } from '../promotion/camel.js';
10
+ import type { DiscountCamel } from '../discount/camel.js';
8
11
 
9
- import type { PurchaseLink } from './snake';
12
+ import type { PurchaseLink } from './snake.js';
10
13
 
11
14
  export type PurchaseLinkCamel = ConvertSnakeToCamelCase<
12
15
  Replace<
@@ -1,2 +1,2 @@
1
- export type { PurchaseLink } from './snake';
2
- export type { PurchaseLinkCamel } from './camel';
1
+ export type { PurchaseLink } from './snake.js';
2
+ export type { PurchaseLinkCamel } from './camel.js';
@@ -1,9 +1,9 @@
1
- import type { BaseModel, ResultsResponse } from '..';
1
+ import type { BaseModel, ResultsResponse } from '../index.js';
2
2
 
3
- import type { Coupon } from '../coupon';
4
- import type { CartItem } from '../cart';
5
- import type { Promotion } from '../promotion';
6
- import type { Discount } from '../discount';
3
+ import type { Coupon } from '../coupon/index.js';
4
+ import type { CartItem } from '../cart/index.js';
5
+ import type { Promotion } from '../promotion/index.js';
6
+ import type { Discount } from '../discount/index.js';
7
7
 
8
8
  export interface PurchaseLink extends BaseModel {
9
9
  name?: string;
@@ -1,11 +1,11 @@
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 } from '../order/camel';
5
- import type { PaymentCamel } from '../payment/camel';
6
- import type { SubscriptionCamel } from '../subscription/camel';
4
+ import type { OrderCamel } from '../order/camel.js';
5
+ import type { PaymentCamel } from '../payment/camel.js';
6
+ import type { SubscriptionCamel } from '../subscription/camel.js';
7
7
 
8
- import type { Refund } from './snake';
8
+ import type { Refund } from './snake.js';
9
9
 
10
10
  export type RefundCamel = ConvertSnakeToCamelCase<
11
11
  Replace<
@@ -1,2 +1,2 @@
1
- export type { Refund } from './snake';
2
- export type { RefundCamel } from './camel';
1
+ export type { Refund } from './snake.js';
2
+ export type { RefundCamel } from './camel.js';
@@ -1,8 +1,8 @@
1
- import type { BaseModel } from '..';
1
+ import type { BaseModel } from '../index.js';
2
2
 
3
- import type { Order } from '../order';
4
- import type { Payment } from '../payment';
5
- import type { Subscription } from '../subscription';
3
+ import type { Order } from '../order/index.js';
4
+ import type { Payment } from '../payment/index.js';
5
+ import type { Subscription } from '../subscription/index.js';
6
6
 
7
7
  export interface Refund extends BaseModel {
8
8
  amount?: number;
@@ -1,7 +1,7 @@
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 { ShipmentRating, ShipmentService } from './snake';
4
+ import type { ShipmentRating, ShipmentService } from './snake.js';
5
5
 
6
6
  export type ShipmentRatingCamel = ConvertSnakeToCamelCase<
7
7
  Replace<
@@ -1,2 +1,2 @@
1
- export type { ShipmentRating, ShipmentService } from './snake';
2
- export type { ShipmentRatingCamel, ShipmentServiceCamel } from './camel';
1
+ export type { ShipmentRating, ShipmentService } from './snake.js';
2
+ export type { ShipmentRatingCamel, ShipmentServiceCamel } from './camel.js';
@@ -1,26 +1,29 @@
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';
7
+ import type { AccountCamel } from '../account/camel.js';
5
8
  import type {
6
9
  CartItemOptionsCamel,
7
10
  CartItemPurchaseOptionCamel,
8
- } from '../cart/camel';
9
- import type { ProductCamel, VariantCamel } from '../product/camel';
10
- import type { DiscountCamel } from '../discount/camel';
11
- import type { PaymentCamel } from '../payment/camel';
12
- import type { InvoiceCamel } from '../invoice/camel';
13
- import type { BillingCamel } from '../billing/camel';
14
- import type { CouponCamel } from '../coupon/camel';
15
- import type { RefundCamel } from '../refund/camel';
16
- import type { OrderCamel } from '../order/camel';
11
+ } from '../cart/camel.js';
12
+ import type { ProductCamel, VariantCamel } from '../product/camel.js';
13
+ import type { DiscountCamel } from '../discount/camel.js';
14
+ import type { PaymentCamel } from '../payment/camel.js';
15
+ import type { InvoiceCamel } from '../invoice/camel.js';
16
+ import type { BillingCamel } from '../billing/camel.js';
17
+ import type { CouponCamel } from '../coupon/camel.js';
18
+ import type { RefundCamel } from '../refund/camel.js';
19
+ import type { OrderCamel } from '../order/camel.js';
17
20
 
18
21
  import type {
19
22
  SubscriptionBillingSchedule,
20
23
  SubscriptionOrderSchedule,
21
24
  SubscriptionItem,
22
25
  Subscription,
23
- } from './snake';
26
+ } from './snake.js';
24
27
 
25
28
  export type SubscriptionItemCamel = ConvertSnakeToCamelCase<
26
29
  Replace<
@@ -1,18 +1,18 @@
1
- import type { MakeCase } from '../utils';
1
+ import type { MakeCase } from '../utils.js';
2
2
 
3
3
  import type {
4
4
  SubscriptionBillingSchedule,
5
5
  SubscriptionOrderSchedule,
6
6
  SubscriptionItem,
7
7
  Subscription,
8
- } from './snake';
8
+ } from './snake.js';
9
9
 
10
10
  import type {
11
11
  SubscriptionBillingScheduleCamel,
12
12
  SubscriptionOrderScheduleCamel,
13
13
  SubscriptionItemCamel,
14
14
  SubscriptionCamel,
15
- } from './camel';
15
+ } from './camel.js';
16
16
 
17
17
  export type SubscriptionCase = MakeCase<Subscription, SubscriptionCamel>;
18
18
 
@@ -1,15 +1,20 @@
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 { Account } from '../account';
4
- import type { CartItemOptions, CartItemPurchaseOption } from '../cart';
5
- import type { Product, Variant } from '../product';
6
- import type { Discount } from '../discount';
7
- import type { Payment } from '../payment';
8
- import type { Invoice } from '../invoice';
9
- import type { Billing } from '../billing';
10
- import type { Coupon } from '../coupon';
11
- import type { Refund } from '../refund';
12
- import type { Order } from '../order';
8
+ import type { Account } from '../account/index.js';
9
+ import type { CartItemOptions, CartItemPurchaseOption } from '../cart/index.js';
10
+ import type { Product, Variant } from '../product/index.js';
11
+ import type { Discount } from '../discount/index.js';
12
+ import type { Payment } from '../payment/index.js';
13
+ import type { Invoice } from '../invoice/index.js';
14
+ import type { Billing } from '../billing/index.js';
15
+ import type { Coupon } from '../coupon/index.js';
16
+ import type { Refund } from '../refund/index.js';
17
+ import type { Order } from '../order/index.js';
13
18
 
14
19
  export interface SubscriptionItem {
15
20
  id: string;
@@ -1,4 +1,4 @@
1
- import type { ConvertSnakeToCamelCase } from '..';
2
- import type { User } from './snake';
1
+ import type { ConvertSnakeToCamelCase } from '../index.js';
2
+ import type { User } from './snake.js';
3
3
 
4
4
  export type UserCamel = ConvertSnakeToCamelCase<User>;
@@ -1,7 +1,7 @@
1
- import type { MakeCase } from '../utils';
1
+ import type { MakeCase } from '../utils.js';
2
2
 
3
- import type { User } from './snake';
4
- import type { UserCamel } from './camel';
3
+ import type { User } from './snake.js';
4
+ import type { UserCamel } from './camel.js';
5
5
 
6
6
  export type UserCase = MakeCase<User, UserCamel>;
7
7
 
@@ -1,4 +1,4 @@
1
- import type { BaseModel } from '..';
1
+ import type { BaseModel } from '../index.js';
2
2
 
3
3
  export interface User extends BaseModel {
4
4
  name?: string;