@aimee.shop/sdk 0.17.0 → 0.18.0-dev.121

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 (216) hide show
  1. package/dist/core/events/event-names.d.ts +142 -146
  2. package/dist/core/events/event-names.d.ts.map +1 -1
  3. package/dist/core/events/event-names.js +141 -145
  4. package/dist/core/events/event-names.js.map +1 -1
  5. package/dist/index.d.ts +17 -17
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/services/core/assets.client.d.ts +2 -8
  9. package/dist/services/core/assets.client.d.ts.map +1 -1
  10. package/dist/services/core/assets.client.js.map +1 -1
  11. package/dist/services/core/base-resource.d.ts +7 -2
  12. package/dist/services/core/base-resource.d.ts.map +1 -1
  13. package/dist/services/core/base-resource.js +27 -20
  14. package/dist/services/core/base-resource.js.map +1 -1
  15. package/dist/services/core/cart-messages/cart-messages.client.d.ts +14 -4
  16. package/dist/services/core/cart-messages/cart-messages.client.d.ts.map +1 -1
  17. package/dist/services/core/cart-messages/cart-messages.client.js +37 -4
  18. package/dist/services/core/cart-messages/cart-messages.client.js.map +1 -1
  19. package/dist/services/core/cart-messages/index.d.ts +1 -1
  20. package/dist/services/core/cart-messages/index.d.ts.map +1 -1
  21. package/dist/services/core/cart-messages/types.d.ts +19 -2
  22. package/dist/services/core/cart-messages/types.d.ts.map +1 -1
  23. package/dist/services/core/carts.client.d.ts +46 -8
  24. package/dist/services/core/carts.client.d.ts.map +1 -1
  25. package/dist/services/core/carts.client.js +18 -0
  26. package/dist/services/core/carts.client.js.map +1 -1
  27. package/dist/services/core/categories.client.d.ts +14 -7
  28. package/dist/services/core/categories.client.d.ts.map +1 -1
  29. package/dist/services/core/categories.client.js.map +1 -1
  30. package/dist/services/core/checkout.client.d.ts +74 -35
  31. package/dist/services/core/checkout.client.d.ts.map +1 -1
  32. package/dist/services/core/checkout.client.js +3 -2
  33. package/dist/services/core/checkout.client.js.map +1 -1
  34. package/dist/services/core/cms/cms.client.d.ts +1 -1
  35. package/dist/services/core/cms/cms.client.js +1 -1
  36. package/dist/services/core/cms/entries.client.d.ts +4 -2
  37. package/dist/services/core/cms/entries.client.d.ts.map +1 -1
  38. package/dist/services/core/cms/entries.client.js +8 -2
  39. package/dist/services/core/cms/entries.client.js.map +1 -1
  40. package/dist/services/core/cms/types.d.ts +95 -53
  41. package/dist/services/core/cms/types.d.ts.map +1 -1
  42. package/dist/services/core/cms/types.js.map +1 -1
  43. package/dist/services/core/customers.client.d.ts +70 -61
  44. package/dist/services/core/customers.client.d.ts.map +1 -1
  45. package/dist/services/core/customers.client.js +15 -13
  46. package/dist/services/core/customers.client.js.map +1 -1
  47. package/dist/services/core/discounts.client.d.ts +98 -46
  48. package/dist/services/core/discounts.client.d.ts.map +1 -1
  49. package/dist/services/core/discounts.client.js +17 -17
  50. package/dist/services/core/discounts.client.js.map +1 -1
  51. package/dist/services/core/facets.client.d.ts +27 -10
  52. package/dist/services/core/facets.client.d.ts.map +1 -1
  53. package/dist/services/core/facets.client.js +18 -7
  54. package/dist/services/core/facets.client.js.map +1 -1
  55. package/dist/services/core/fulfillments.client.d.ts +51 -27
  56. package/dist/services/core/fulfillments.client.d.ts.map +1 -1
  57. package/dist/services/core/fulfillments.client.js +30 -18
  58. package/dist/services/core/fulfillments.client.js.map +1 -1
  59. package/dist/services/core/inventory/adjustments.client.d.ts +12 -2
  60. package/dist/services/core/inventory/adjustments.client.d.ts.map +1 -1
  61. package/dist/services/core/inventory/adjustments.client.js.map +1 -1
  62. package/dist/services/core/inventory/index.d.ts +1 -1
  63. package/dist/services/core/inventory/index.d.ts.map +1 -1
  64. package/dist/services/core/inventory/reservations.client.d.ts +3 -3
  65. package/dist/services/core/inventory/reservations.client.d.ts.map +1 -1
  66. package/dist/services/core/inventory/reservations.client.js +2 -2
  67. package/dist/services/core/inventory/reservations.client.js.map +1 -1
  68. package/dist/services/core/inventory/types.d.ts +29 -6
  69. package/dist/services/core/inventory/types.d.ts.map +1 -1
  70. package/dist/services/core/inventory/types.js +1 -0
  71. package/dist/services/core/inventory/types.js.map +1 -1
  72. package/dist/services/core/invoices.client.d.ts +4 -7
  73. package/dist/services/core/invoices.client.d.ts.map +1 -1
  74. package/dist/services/core/invoices.client.js +1 -1
  75. package/dist/services/core/invoices.client.js.map +1 -1
  76. package/dist/services/core/openai-feed.client.d.ts +34 -3
  77. package/dist/services/core/openai-feed.client.d.ts.map +1 -1
  78. package/dist/services/core/openai-feed.client.js.map +1 -1
  79. package/dist/services/core/option-types.client.d.ts +6 -7
  80. package/dist/services/core/option-types.client.d.ts.map +1 -1
  81. package/dist/services/core/option-types.client.js +7 -8
  82. package/dist/services/core/option-types.client.js.map +1 -1
  83. package/dist/services/core/option-values.client.d.ts +2 -1
  84. package/dist/services/core/option-values.client.d.ts.map +1 -1
  85. package/dist/services/core/option-values.client.js +2 -1
  86. package/dist/services/core/option-values.client.js.map +1 -1
  87. package/dist/services/core/order-edits.client.d.ts +20 -14
  88. package/dist/services/core/order-edits.client.d.ts.map +1 -1
  89. package/dist/services/core/order-edits.client.js +1 -1
  90. package/dist/services/core/order-edits.client.js.map +1 -1
  91. package/dist/services/core/orders.client.d.ts +139 -49
  92. package/dist/services/core/orders.client.d.ts.map +1 -1
  93. package/dist/services/core/orders.client.js +40 -9
  94. package/dist/services/core/orders.client.js.map +1 -1
  95. package/dist/services/core/pricing/currencies.client.d.ts +9 -23
  96. package/dist/services/core/pricing/currencies.client.d.ts.map +1 -1
  97. package/dist/services/core/pricing/currencies.client.js +12 -30
  98. package/dist/services/core/pricing/currencies.client.js.map +1 -1
  99. package/dist/services/core/pricing/pricing.client.d.ts +5 -5
  100. package/dist/services/core/pricing/pricing.client.d.ts.map +1 -1
  101. package/dist/services/core/pricing/pricing.client.js +4 -4
  102. package/dist/services/core/pricing/pricing.client.js.map +1 -1
  103. package/dist/services/core/pricing/store-markets.client.d.ts +2 -5
  104. package/dist/services/core/pricing/store-markets.client.d.ts.map +1 -1
  105. package/dist/services/core/pricing/store-markets.client.js +1 -7
  106. package/dist/services/core/pricing/store-markets.client.js.map +1 -1
  107. package/dist/services/core/pricing/tiers.client.d.ts +4 -4
  108. package/dist/services/core/pricing/tiers.client.js +4 -4
  109. package/dist/services/core/pricing/types.d.ts +67 -60
  110. package/dist/services/core/pricing/types.d.ts.map +1 -1
  111. package/dist/services/core/pricing/variant-prices.client.d.ts +14 -14
  112. package/dist/services/core/pricing/variant-prices.client.d.ts.map +1 -1
  113. package/dist/services/core/pricing/variant-prices.client.js +14 -18
  114. package/dist/services/core/pricing/variant-prices.client.js.map +1 -1
  115. package/dist/services/core/products.client.d.ts +73 -13
  116. package/dist/services/core/products.client.d.ts.map +1 -1
  117. package/dist/services/core/products.client.js.map +1 -1
  118. package/dist/services/core/returns.client.d.ts +21 -6
  119. package/dist/services/core/returns.client.d.ts.map +1 -1
  120. package/dist/services/core/returns.client.js +12 -6
  121. package/dist/services/core/returns.client.js.map +1 -1
  122. package/dist/services/core/reviews.client.d.ts +17 -15
  123. package/dist/services/core/reviews.client.d.ts.map +1 -1
  124. package/dist/services/core/reviews.client.js.map +1 -1
  125. package/dist/services/core/search.client.d.ts +26 -11
  126. package/dist/services/core/search.client.d.ts.map +1 -1
  127. package/dist/services/core/search.client.js.map +1 -1
  128. package/dist/services/core/shipping/classes.client.d.ts +2 -5
  129. package/dist/services/core/shipping/classes.client.d.ts.map +1 -1
  130. package/dist/services/core/shipping/classes.client.js +4 -0
  131. package/dist/services/core/shipping/classes.client.js.map +1 -1
  132. package/dist/services/core/shipping/labels.client.d.ts +3 -6
  133. package/dist/services/core/shipping/labels.client.d.ts.map +1 -1
  134. package/dist/services/core/shipping/labels.client.js +5 -1
  135. package/dist/services/core/shipping/labels.client.js.map +1 -1
  136. package/dist/services/core/shipping/providers.client.d.ts +2 -5
  137. package/dist/services/core/shipping/providers.client.d.ts.map +1 -1
  138. package/dist/services/core/shipping/providers.client.js +6 -2
  139. package/dist/services/core/shipping/providers.client.js.map +1 -1
  140. package/dist/services/core/shipping/rules.client.d.ts +2 -5
  141. package/dist/services/core/shipping/rules.client.d.ts.map +1 -1
  142. package/dist/services/core/shipping/rules.client.js +4 -2
  143. package/dist/services/core/shipping/rules.client.js.map +1 -1
  144. package/dist/services/core/shipping/shipping.client.d.ts +4 -4
  145. package/dist/services/core/shipping/shipping.client.d.ts.map +1 -1
  146. package/dist/services/core/shipping/shipping.client.js +7 -5
  147. package/dist/services/core/shipping/shipping.client.js.map +1 -1
  148. package/dist/services/core/shipping/store-providers.client.d.ts +5 -5
  149. package/dist/services/core/shipping/store-providers.client.d.ts.map +1 -1
  150. package/dist/services/core/shipping/store-providers.client.js +1 -1
  151. package/dist/services/core/shipping/store-providers.client.js.map +1 -1
  152. package/dist/services/core/shipping/types.d.ts +196 -67
  153. package/dist/services/core/shipping/types.d.ts.map +1 -1
  154. package/dist/services/core/shipping/zones.client.d.ts +2 -5
  155. package/dist/services/core/shipping/zones.client.d.ts.map +1 -1
  156. package/dist/services/core/shipping/zones.client.js +4 -0
  157. package/dist/services/core/shipping/zones.client.js.map +1 -1
  158. package/dist/services/core/storefront/index.d.ts +1 -1
  159. package/dist/services/core/storefront/index.d.ts.map +1 -1
  160. package/dist/services/core/storefront/index.js.map +1 -1
  161. package/dist/services/core/storefront/storefront-auth.client.d.ts +9 -4
  162. package/dist/services/core/storefront/storefront-auth.client.d.ts.map +1 -1
  163. package/dist/services/core/storefront/storefront-auth.client.js +7 -2
  164. package/dist/services/core/storefront/storefront-auth.client.js.map +1 -1
  165. package/dist/services/core/storefront/storefront-plans.client.d.ts +5 -4
  166. package/dist/services/core/storefront/storefront-plans.client.d.ts.map +1 -1
  167. package/dist/services/core/storefront/storefront-plans.client.js.map +1 -1
  168. package/dist/services/core/storefront/storefront-subscriptions.client.d.ts +19 -12
  169. package/dist/services/core/storefront/storefront-subscriptions.client.d.ts.map +1 -1
  170. package/dist/services/core/storefront/storefront-subscriptions.client.js.map +1 -1
  171. package/dist/services/core/storefront/storefront.client.d.ts +4 -1
  172. package/dist/services/core/storefront/storefront.client.d.ts.map +1 -1
  173. package/dist/services/core/storefront/storefront.client.js +4 -1
  174. package/dist/services/core/storefront/storefront.client.js.map +1 -1
  175. package/dist/services/core/storefront/types.d.ts +10 -0
  176. package/dist/services/core/storefront/types.d.ts.map +1 -1
  177. package/dist/services/core/stores/configuration.client.d.ts +21 -18
  178. package/dist/services/core/stores/configuration.client.d.ts.map +1 -1
  179. package/dist/services/core/stores/configuration.client.js.map +1 -1
  180. package/dist/services/core/stores/index.d.ts +1 -1
  181. package/dist/services/core/stores/index.d.ts.map +1 -1
  182. package/dist/services/core/stores/index.js.map +1 -1
  183. package/dist/services/core/stores/stores.client.d.ts +44 -15
  184. package/dist/services/core/stores/stores.client.d.ts.map +1 -1
  185. package/dist/services/core/stores/stores.client.js +10 -5
  186. package/dist/services/core/stores/stores.client.js.map +1 -1
  187. package/dist/services/core/taxes/jurisdictions.client.d.ts +4 -4
  188. package/dist/services/core/taxes/jurisdictions.client.d.ts.map +1 -1
  189. package/dist/services/core/taxes/jurisdictions.client.js +7 -4
  190. package/dist/services/core/taxes/jurisdictions.client.js.map +1 -1
  191. package/dist/services/core/taxes/providers.client.d.ts +1 -1
  192. package/dist/services/core/taxes/providers.client.d.ts.map +1 -1
  193. package/dist/services/core/taxes/providers.client.js.map +1 -1
  194. package/dist/services/core/taxes/rates.client.d.ts +2 -1
  195. package/dist/services/core/taxes/rates.client.d.ts.map +1 -1
  196. package/dist/services/core/taxes/rates.client.js +2 -1
  197. package/dist/services/core/taxes/rates.client.js.map +1 -1
  198. package/dist/services/core/taxes/store-providers.client.d.ts +5 -5
  199. package/dist/services/core/taxes/store-providers.client.d.ts.map +1 -1
  200. package/dist/services/core/taxes/store-providers.client.js +1 -1
  201. package/dist/services/core/taxes/store-providers.client.js.map +1 -1
  202. package/dist/services/core/taxes/taxes.client.d.ts +6 -3
  203. package/dist/services/core/taxes/taxes.client.d.ts.map +1 -1
  204. package/dist/services/core/taxes/taxes.client.js +5 -2
  205. package/dist/services/core/taxes/taxes.client.js.map +1 -1
  206. package/dist/services/core/taxes/types.d.ts +251 -128
  207. package/dist/services/core/taxes/types.d.ts.map +1 -1
  208. package/dist/services/core/variants.client.d.ts +80 -11
  209. package/dist/services/core/variants.client.d.ts.map +1 -1
  210. package/dist/services/core/variants.client.js +2 -2
  211. package/dist/services/core/variants.client.js.map +1 -1
  212. package/dist/services/core/wishlists.client.d.ts +31 -25
  213. package/dist/services/core/wishlists.client.d.ts.map +1 -1
  214. package/dist/services/core/wishlists.client.js +4 -2
  215. package/dist/services/core/wishlists.client.js.map +1 -1
  216. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import type { HttpClientTransport as HttpClient } from '../../core/http-client.js';
2
- import type { AddressSnapshot } from '../../core/types/address.js';
3
2
  import type { PaginatedResponse } from '../../core/types/pagination.js';
4
3
  import { BaseResourceClient } from './base-resource.js';
5
4
  export type CustomerType = 'guest' | 'individual' | 'organization';
@@ -31,7 +30,6 @@ interface CustomerMutableFields {
31
30
  externalRefs?: Record<string, unknown>;
32
31
  preferences?: Record<string, unknown>;
33
32
  metadata?: Record<string, unknown>;
34
- notes?: string;
35
33
  tags?: string[];
36
34
  taxExemptStatus?: CustomerTaxExemptStatus;
37
35
  customerGroupId?: string;
@@ -41,10 +39,10 @@ interface CustomerMutableFields {
41
39
  paymentTerms?: PaymentTerms;
42
40
  accountNumber?: string;
43
41
  }
44
- export interface Customer extends CustomerMutableFields {
42
+ export interface Customer extends Omit<CustomerMutableFields, 'cognitoUserId'> {
45
43
  id: string;
46
44
  tenantId: string;
47
- storeId: string;
45
+ storeId: string | null;
48
46
  customerType: CustomerType;
49
47
  status: CustomerStatus;
50
48
  isGuest: boolean;
@@ -54,27 +52,36 @@ export interface Customer extends CustomerMutableFields {
54
52
  acceptsSms: boolean;
55
53
  preferredLanguage: string;
56
54
  totalOrders: number;
55
+ /** Cents, serialized from BigInt */
57
56
  totalSpent: string;
57
+ /** Cents, serialized from BigInt */
58
58
  averageOrderValue: string;
59
+ /** Cents, serialized from BigInt */
59
60
  lifetimeValue: string;
60
61
  lastOrderAt?: string;
61
62
  lastLoginAt?: string;
62
63
  registeredAt?: string;
63
64
  loyaltyPoints: number;
64
65
  purchasingLimit?: string;
65
- addresses?: CustomerAddress[];
66
66
  createdAt: string;
67
67
  updatedAt: string;
68
68
  }
69
+ /** Returned by createGuest: the customer plus the token that identifies the guest later */
70
+ export interface GuestCustomer extends Customer {
71
+ guestToken: string;
72
+ }
69
73
  export type CreateCustomerDto = CustomerMutableFields & {
70
74
  purchasingLimit?: number;
71
75
  };
72
76
  export type UpdateCustomerDto = CustomerMutableFields & {
73
77
  purchasingLimit?: number;
78
+ /** ISO date string */
79
+ lastLoginAt?: string;
80
+ /** ISO date string */
81
+ registeredAt?: string;
74
82
  };
75
83
  export interface CustomerFilters extends Record<string, unknown> {
76
- email?: string;
77
- isGuest?: boolean;
84
+ /** Matches email, firstName, lastName */
78
85
  search?: string;
79
86
  customerType?: CustomerFilterType;
80
87
  status?: CustomerStatus;
@@ -82,16 +89,31 @@ export interface CustomerFilters extends Record<string, unknown> {
82
89
  export type AddressType = 'billing' | 'shipping' | 'work' | 'home' | 'other';
83
90
  export type DefaultAddressType = 'billing' | 'shipping';
84
91
  export type ValidationStatus = 'pending' | 'valid' | 'invalid' | 'failed';
85
- export type ValidationProvider = 'googlePlaces' | 'smartystreets';
86
- export type GeocodingProvider = 'googleMaps' | 'mapbox';
87
- export interface CustomerAddress extends AddressSnapshot {
92
+ export type ValidationProvider = 'easypost';
93
+ export type GeocodingProvider = 'easypost';
94
+ /** Postal fields shared by customer address responses and write DTOs */
95
+ interface CustomerAddressFields {
96
+ firstName?: string;
97
+ lastName?: string;
98
+ company?: string;
99
+ address1: string;
100
+ address2?: string;
101
+ address3?: string;
102
+ city: string;
103
+ state?: string;
104
+ zip: string;
105
+ /** ISO-2 on responses; ISO-2, ISO-3 or English name accepted on writes */
106
+ country: string;
107
+ phone?: string;
108
+ instructions?: string;
109
+ }
110
+ export interface CustomerAddress extends CustomerAddressFields {
88
111
  id: string;
89
112
  customerId: string;
90
113
  tenantId: string;
91
114
  storeId: string;
92
115
  type: AddressType;
93
116
  label?: string;
94
- address3?: string;
95
117
  isValidated: boolean;
96
118
  validationStatus: ValidationStatus;
97
119
  validationMetadata?: Record<string, unknown>;
@@ -104,10 +126,9 @@ export interface CustomerAddress extends AddressSnapshot {
104
126
  createdAt: string;
105
127
  updatedAt: string;
106
128
  }
107
- export interface CreateCustomerAddressDto extends AddressSnapshot {
129
+ export interface CreateCustomerAddressDto extends CustomerAddressFields {
108
130
  type: AddressType;
109
131
  label?: string;
110
- address3?: string;
111
132
  isValidated?: boolean;
112
133
  validationStatus?: ValidationStatus;
113
134
  validationMetadata?: Record<string, unknown>;
@@ -118,10 +139,9 @@ export interface CreateCustomerAddressDto extends AddressSnapshot {
118
139
  isDefaultShipping?: boolean;
119
140
  metadata?: Record<string, unknown>;
120
141
  }
121
- export interface UpdateCustomerAddressDto extends Partial<AddressSnapshot> {
142
+ export interface UpdateCustomerAddressDto extends Partial<CustomerAddressFields> {
122
143
  type?: AddressType;
123
144
  label?: string;
124
- address3?: string;
125
145
  isValidated?: boolean;
126
146
  validationStatus?: ValidationStatus;
127
147
  validationMetadata?: Record<string, unknown>;
@@ -133,49 +153,37 @@ export interface UpdateCustomerAddressDto extends Partial<AddressSnapshot> {
133
153
  metadata?: Record<string, unknown>;
134
154
  }
135
155
  export interface ValidateAddressDto {
136
- isValidated?: boolean;
156
+ isValidated: boolean;
137
157
  latitude?: number;
138
158
  longitude?: number;
139
159
  metadata?: Record<string, unknown>;
140
160
  }
141
- export interface ValidateAddressDataDto extends Pick<AddressSnapshot, 'address1' | 'city' | 'zip' | 'country'> {
142
- address2?: string;
143
- address3?: string;
144
- state?: string;
161
+ export interface ValidateAddressDataDto extends Pick<CustomerAddressFields, 'address1' | 'address2' | 'address3' | 'city' | 'state' | 'zip' | 'country'> {
145
162
  provider?: ValidationProvider;
146
163
  }
147
164
  export interface AddressValidationResult {
148
165
  isValid: boolean;
149
- validationStatus: ValidationStatus;
150
- standardizedAddress?: {
151
- address1?: string;
152
- address2?: string;
153
- address3?: string;
154
- city?: string;
155
- state?: string;
156
- zip?: string;
157
- country?: string;
166
+ validationStatus: 'valid' | 'invalid' | 'failed';
167
+ standardizedAddress: {
168
+ address1: string;
169
+ address2: string | null;
170
+ address3: string | null;
171
+ city: string;
172
+ state: string | null;
173
+ zip: string;
174
+ country: string;
158
175
  };
159
- geocoding?: {
160
- latitude?: number;
161
- longitude?: number;
162
- timezone?: string;
176
+ geocoding: {
177
+ latitude: number;
178
+ longitude: number;
179
+ timezone: string;
180
+ } | null;
181
+ validationMetadata: {
182
+ provider: string;
183
+ confidence: number;
184
+ timestamp: string;
185
+ componentsMatched: string[];
163
186
  };
164
- validationMetadata?: Record<string, unknown>;
165
- }
166
- export interface GeocodeAddressDto extends Pick<AddressSnapshot, 'address1' | 'city' | 'zip' | 'country'> {
167
- address2?: string;
168
- address3?: string;
169
- state?: string;
170
- provider?: GeocodingProvider;
171
- }
172
- export interface GeocodeResult {
173
- latitude: number;
174
- longitude: number;
175
- timezone?: string;
176
- provider?: string;
177
- accuracy?: string;
178
- metadata?: Record<string, unknown>;
179
187
  }
180
188
  export interface ValidationProvidersResult {
181
189
  validationProviders: ProviderInfo[];
@@ -184,8 +192,8 @@ export interface ValidationProvidersResult {
184
192
  export interface ProviderInfo {
185
193
  name: string;
186
194
  displayName: string;
187
- supportedCountries?: string[];
188
- features?: string[];
195
+ supportedCountries: string[];
196
+ features: string[];
189
197
  isEnabled: boolean;
190
198
  }
191
199
  export interface ConvertGuestDto {
@@ -221,15 +229,16 @@ export declare class CustomersClient extends BaseResourceClient<Customer, Create
221
229
  */
222
230
  search(query: string, limit?: number): Promise<PaginatedResponse<Customer>>;
223
231
  /**
224
- * Get customer by email
232
+ * Get customer by email. Throws `NotFoundError` when no customer matches.
225
233
  */
226
234
  getByEmail(email: string): Promise<Customer>;
227
235
  /**
228
- * Create a guest customer for anonymous shopping
236
+ * Create a guest customer for anonymous shopping.
237
+ * Keep the returned guestToken to look the guest up later.
229
238
  */
230
- createGuest(): Promise<Customer>;
239
+ createGuest(): Promise<GuestCustomer>;
231
240
  /**
232
- * Get guest customer by token
241
+ * Get guest customer by token. Throws `NotFoundError` when the token matches no customer.
233
242
  */
234
243
  getByGuestToken(token: string): Promise<Customer>;
235
244
  /**
@@ -244,9 +253,13 @@ export declare class CustomersClient extends BaseResourceClient<Customer, Create
244
253
  */
245
254
  merge(data: MergeCustomersDto): Promise<Customer>;
246
255
  /**
247
- * Get customer addresses with optional type filter
256
+ * Get customer addresses with optional type filter.
257
+ * The API pages addresses with a 0-indexed page (default 0) and limit (default 50).
248
258
  */
249
- getAddresses(customerId: string, type?: AddressType): Promise<CustomerAddress[]>;
259
+ getAddresses(customerId: string, type?: AddressType, options?: {
260
+ page?: number;
261
+ limit?: number;
262
+ }): Promise<CustomerAddress[]>;
250
263
  /**
251
264
  * Get a specific address by ID
252
265
  */
@@ -266,7 +279,7 @@ export declare class CustomersClient extends BaseResourceClient<Customer, Create
266
279
  /**
267
280
  * Get default billing or shipping address
268
281
  */
269
- getDefaultAddress(customerId: string, type: DefaultAddressType): Promise<CustomerAddress>;
282
+ getDefaultAddress(customerId: string, type: DefaultAddressType): Promise<CustomerAddress | null>;
270
283
  /**
271
284
  * Get all addresses of a specific type
272
285
  */
@@ -283,10 +296,6 @@ export declare class CustomersClient extends BaseResourceClient<Customer, Create
283
296
  * Validate address data using external services (Google Places, SmartyStreets)
284
297
  */
285
298
  validateAddressData(customerId: string, data: ValidateAddressDataDto): Promise<AddressValidationResult>;
286
- /**
287
- * Geocode an address to get latitude, longitude, and timezone
288
- */
289
- geocodeAddress(customerId: string, data: GeocodeAddressDto): Promise<GeocodeResult>;
290
299
  /**
291
300
  * Get available address validation and geocoding providers
292
301
  */
@@ -1 +1 @@
1
- {"version":3,"file":"customers.client.d.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C,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAKrF"}
@@ -30,22 +30,23 @@ export class CustomersClient extends BaseResourceClient {
30
30
  return this.list({ filters: { search: query }, limit });
31
31
  }
32
32
  /**
33
- * Get customer by email
33
+ * Get customer by email. Throws `NotFoundError` when no customer matches.
34
34
  */
35
35
  async getByEmail(email) {
36
36
  return this.http.get(`${this.endpoint}/email/${encodeURIComponent(email)}`);
37
37
  }
38
38
  /**
39
- * Create a guest customer for anonymous shopping
39
+ * Create a guest customer for anonymous shopping.
40
+ * Keep the returned guestToken to look the guest up later.
40
41
  */
41
42
  async createGuest() {
42
43
  return this.http.post(`${this.endpoint}/guest`, {});
43
44
  }
44
45
  /**
45
- * Get guest customer by token
46
+ * Get guest customer by token. Throws `NotFoundError` when the token matches no customer.
46
47
  */
47
48
  async getByGuestToken(token) {
48
- return this.http.get(`${this.endpoint}/guest/${token}`);
49
+ return this.http.get(`${this.endpoint}/guest/${encodeURIComponent(token)}`);
49
50
  }
50
51
  /**
51
52
  * Convert a guest customer to a registered customer
@@ -64,12 +65,17 @@ export class CustomersClient extends BaseResourceClient {
64
65
  }
65
66
  // ==================== Address Methods ====================
66
67
  /**
67
- * Get customer addresses with optional type filter
68
+ * Get customer addresses with optional type filter.
69
+ * The API pages addresses with a 0-indexed page (default 0) and limit (default 50).
68
70
  */
69
- async getAddresses(customerId, type) {
71
+ async getAddresses(customerId, type, options = {}) {
70
72
  const params = {};
71
73
  if (type)
72
74
  params.type = type;
75
+ if (options.page !== undefined)
76
+ params.page = String(options.page);
77
+ if (options.limit !== undefined)
78
+ params.limit = String(options.limit);
73
79
  return this.http.get(`${this.endpoint}/${customerId}/addresses`, { params });
74
80
  }
75
81
  /**
@@ -100,7 +106,9 @@ export class CustomersClient extends BaseResourceClient {
100
106
  * Get default billing or shipping address
101
107
  */
102
108
  async getDefaultAddress(customerId, type) {
103
- return this.http.get(`${this.endpoint}/${customerId}/addresses/default/${type}`);
109
+ // The API answers 200 with an empty body when no default is set
110
+ const address = await this.http.get(`${this.endpoint}/${customerId}/addresses/default/${type}`);
111
+ return address || null;
104
112
  }
105
113
  /**
106
114
  * Get all addresses of a specific type
@@ -126,12 +134,6 @@ export class CustomersClient extends BaseResourceClient {
126
134
  async validateAddressData(customerId, data) {
127
135
  return this.http.post(`${this.endpoint}/${customerId}/addresses/validate`, data);
128
136
  }
129
- /**
130
- * Geocode an address to get latitude, longitude, and timezone
131
- */
132
- async geocodeAddress(customerId, data) {
133
- return this.http.post(`${this.endpoint}/${customerId}/addresses/geocode`, data);
134
- }
135
137
  /**
136
138
  * Get available address validation and geocoding providers
137
139
  */
@@ -1 +1 @@
1
- {"version":3,"file":"customers.client.js","sourceRoot":"","sources":["../../../../../src/services/core/customers.client.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAgOxD,mDAAmD;AAEnD,MAAM,OAAO,eAAgB,SAAQ,kBAKpC;IACC,YAAY,UAAsB,EAAE,OAAe;QACjD,KAAK,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAAuB;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAW,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,kBAAkB,CAAC,UAAkB,EAAE,IAAuB;QAClE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,QAAQ,aAAa,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAC7D,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,KAAc;QACxC,OAAO,IAAI,CAAC,I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G;IACH,KAAK,CAAC,iBAAiB,CACrB,UAAkB,EAClB,SAAiB,EACjB,IAAwB;QAExB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,cAAc,SAAS,gBAAgB,IAAI,EAAE,EAC3E,EAAE,CACH,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,UAAkB,EAClB,SAAiB,EACjB,IAAwB;QAExB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,cAAc,SAAS,WAAW,EAChE,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CACvB,UAAkB,EAClB,IAA4B;QAE5B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,qBAAqB,EACnD,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,UAAkB,EAAE,IAAuB;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAgB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,oBAAoB,EAAE,IAAI,CAAC,CAAC;IACjG,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAAC,UAAkB;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,iCAAiC,CAChE,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"customers.client.js","sourceRoot":"","sources":["../../../../../src/services/core/customers.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAyOxD,mDAAmD;AAEnD,MAAM,OAAO,eAAgB,SAAQ,kBAKpC;IACC,YAAY,UAAsB,EAAE,OAAe;QACjD,KAAK,C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CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,cAAc,SAAS,WAAW,EAChE,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CACvB,UAAkB,EAClB,IAA4B;QAE5B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,qBAAqB,EACnD,IAAI,CACL,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAAC,UAAkB;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,GAAG,IAAI,CAAC,QAAQ,IAAI,UAAU,iCAAiC,CAChE,CAAC;IACJ,CAAC;CACF"}
@@ -29,29 +29,34 @@ export interface Discount {
29
29
  /** Oldest live code, or `null` when the discount has none (auto-applied). */
30
30
  primaryCode: string | null;
31
31
  name: string;
32
- description?: string;
32
+ description: string | null;
33
33
  discountType: DiscountType;
34
- discountValue: number;
35
- currency?: string;
36
- minimumOrderAmount?: number;
37
- minimumOrderQuantity?: number;
38
- usageLimit?: number;
39
- usageLimitPerCustomer?: number;
34
+ /** Integer serialized as a string: cents for fixedAmount, whole percent (0-100) for percent. */
35
+ discountValue: string;
36
+ currency: string;
37
+ /** Cents, serialized from BigInt */
38
+ minimumOrderAmount: string | null;
39
+ minimumOrderQuantity: number | null;
40
+ usageLimit: number | null;
41
+ usageLimitPerCustomer: number | null;
40
42
  usageCount: number;
41
- applicableProducts?: string[];
42
- applicableCategories?: string[];
43
- applicableVariants?: string[];
44
- requiredCustomerTags?: string[];
45
- excludedCustomerTags?: string[];
46
- startsAt?: string;
47
- endsAt?: string;
43
+ applicableProducts: string[];
44
+ applicableCategories: string[];
45
+ applicableVariants: string[];
46
+ customerEligibility: Record<string, unknown> | null;
47
+ requiredCustomerTags: string[];
48
+ excludedCustomerTags: string[];
49
+ startsAt: string;
50
+ endsAt: string | null;
48
51
  isActive: boolean;
49
- isAutoApplied?: boolean;
50
- canCombineWithOthers?: boolean;
51
- priority?: number;
52
- metadata?: Record<string, unknown>;
52
+ isAutoApplied: boolean;
53
+ canCombineWithOthers: boolean;
54
+ priority: number;
55
+ /** BOGO discounts carry their `bogoConfig` here. */
56
+ metadata: Record<string, unknown> | null;
53
57
  createdAt: string;
54
58
  updatedAt: string;
59
+ deletedAt: string | null;
55
60
  }
56
61
  export interface DiscountCondition {
57
62
  type: 'product' | 'category' | 'customer' | 'minimumQuantity';
@@ -81,9 +86,10 @@ export interface CreateDiscountDto {
81
86
  name: string;
82
87
  description?: string;
83
88
  discountType: DiscountType;
84
- /** Discount value (percentage, fixed amount). Not required for freeShipping or buyXGetY. */
89
+ /** Integer: cents for fixedAmount, whole percent (0-100) for percent. Not used for freeShipping or buyXGetY. */
85
90
  discountValue?: number;
86
91
  currency?: string;
92
+ /** Integer cents */
87
93
  minimumOrderAmount?: number;
88
94
  minimumOrderQuantity?: number;
89
95
  usageLimit?: number;
@@ -91,6 +97,7 @@ export interface CreateDiscountDto {
91
97
  applicableProducts?: string[];
92
98
  applicableCategories?: string[];
93
99
  applicableVariants?: string[];
100
+ customerEligibility?: Record<string, unknown>;
94
101
  requiredCustomerTags?: string[];
95
102
  excludedCustomerTags?: string[];
96
103
  startsAt?: string;
@@ -103,7 +110,9 @@ export interface CreateDiscountDto {
103
110
  /** Configuration for Buy X Get Y discounts. Required when discountType is buyXGetY. */
104
111
  bogoConfig?: BogoConfig;
105
112
  }
113
+ /** PATCH body: every CreateDiscountDto field is optional (including code). */
106
114
  export interface UpdateDiscountDto {
115
+ code?: string;
107
116
  name?: string;
108
117
  description?: string;
109
118
  discountType?: DiscountType;
@@ -116,6 +125,7 @@ export interface UpdateDiscountDto {
116
125
  applicableProducts?: string[];
117
126
  applicableCategories?: string[];
118
127
  applicableVariants?: string[];
128
+ customerEligibility?: Record<string, unknown>;
119
129
  requiredCustomerTags?: string[];
120
130
  excludedCustomerTags?: string[];
121
131
  startsAt?: string;
@@ -127,23 +137,72 @@ export interface UpdateDiscountDto {
127
137
  metadata?: Record<string, unknown>;
128
138
  bogoConfig?: BogoConfig;
129
139
  }
140
+ /** Query filters read by GET /v1/discounts. */
130
141
  export interface DiscountFilters extends Record<string, unknown> {
131
- isActive?: boolean;
132
- discountType?: DiscountType;
133
- code?: string;
142
+ /** Case-insensitive match on code or name. */
143
+ search?: string;
144
+ active?: boolean;
145
+ type?: DiscountType;
146
+ }
147
+ /** Response of GET /v1/discounts (`page` is 0-based). */
148
+ export interface DiscountListResponse {
149
+ data: Discount[];
150
+ total: number;
151
+ page: number;
152
+ limit: number;
153
+ }
154
+ /** Body for POST /v1/discounts/validate and POST /v1/discounts/calculate. */
155
+ export interface ValidateDiscountDto {
156
+ code: string;
157
+ customerId?: string;
158
+ /** Guest shopper email for the per-customer limit (matched trimmed and lowercased). */
159
+ customerEmail?: string;
160
+ orderAmount?: number;
161
+ orderQuantity?: number;
162
+ shippingAmount?: number;
163
+ cartItems?: {
164
+ items: Array<{
165
+ productId: string;
166
+ variantId?: string;
167
+ categoryIds?: string[];
168
+ quantity: number;
169
+ price: number;
170
+ }>;
171
+ };
134
172
  }
135
173
  export interface DiscountValidation {
136
174
  isValid: boolean;
137
- discount?: Discount;
175
+ /** Why the code is invalid (when `isValid` is false). */
176
+ reason?: string;
177
+ discount?: Record<string, unknown>;
138
178
  /** Id of the matched code (the code row, not the discount). */
139
179
  discountCodeId?: string;
140
- error?: string;
180
+ /** Integer cents */
141
181
  discountAmount?: number;
182
+ remainingUses?: number;
183
+ remainingUsesPerCustomer?: number;
142
184
  }
143
- /** Optional context for `discounts.validate`. */
144
- export interface ValidateDiscountOptions {
145
- /** Guest shopper email for the per-customer limit (matched trimmed and lowercased). */
146
- customerEmail?: string;
185
+ export interface DiscountUsageByDate {
186
+ date: string;
187
+ count: number;
188
+ /** Cents, serialized from BigInt */
189
+ amountSaved: string;
190
+ }
191
+ export interface DiscountTopCustomer {
192
+ customerId: string;
193
+ usageCount: number;
194
+ /** Cents, serialized from BigInt */
195
+ totalSaved: string;
196
+ }
197
+ export interface DiscountUsageStats {
198
+ discountId: string;
199
+ code: string;
200
+ totalUsages: number;
201
+ /** Cents, serialized from BigInt */
202
+ totalAmountSaved: string;
203
+ uniqueCustomers: number;
204
+ usageByDate?: DiscountUsageByDate[];
205
+ topCustomers?: DiscountTopCustomer[];
147
206
  }
148
207
  /** One code of a discount (`/v1/discounts/:id/codes`). */
149
208
  export interface DiscountCode {
@@ -217,7 +276,7 @@ export declare class DiscountCodesClient {
217
276
  * `list()` `page` is 0-based (server default `page=0`). Most other SDK list
218
277
  * helpers document 1-indexed pages. `codes.list()` is 1-based.
219
278
  */
220
- export declare class DiscountsClient extends BaseResourceClient<Discount, CreateDiscountDto, UpdateDiscountDto, DiscountFilters> {
279
+ export declare class DiscountsClient extends BaseResourceClient<Discount, CreateDiscountDto, UpdateDiscountDto, DiscountFilters, DiscountListResponse> {
221
280
  /** Sub-client for the codes of a discount */
222
281
  readonly codes: DiscountCodesClient;
223
282
  constructor(httpClient: HttpClient, baseUrl: string);
@@ -226,20 +285,14 @@ export declare class DiscountsClient extends BaseResourceClient<Discount, Create
226
285
  */
227
286
  getByCode(code: string): Promise<Discount>;
228
287
  /**
229
- * Validate a discount code for a cart
288
+ * Validate a discount code against order context (amount, quantity, items).
230
289
  */
231
- validate(code: string, cartId: string, options?: ValidateDiscountOptions): Promise<DiscountValidation>;
290
+ validate(data: ValidateDiscountDto): Promise<DiscountValidation>;
232
291
  /**
233
- * Calculate discount amount for a cart
292
+ * Calculate the discount amount for order context. Same body and response
293
+ * as validate().
234
294
  */
235
- calculate(code: string, cartTotal: number, items?: {
236
- productId: string;
237
- quantity: number;
238
- price: number;
239
- }[]): Promise<{
240
- discountAmount: number;
241
- newTotal: number;
242
- }>;
295
+ calculate(data: ValidateDiscountDto): Promise<DiscountValidation>;
243
296
  /**
244
297
  * Activate a discount
245
298
  */
@@ -249,12 +302,11 @@ export declare class DiscountsClient extends BaseResourceClient<Discount, Create
249
302
  */
250
303
  deactivate(discountId: string): Promise<Discount>;
251
304
  /**
252
- * Get discount usage statistics
305
+ * Get discount usage statistics, optionally bounded by ISO dates.
253
306
  */
254
- getUsageStats(discountId: string): Promise<{
255
- totalUsage: number;
256
- totalDiscountAmount: number;
257
- uniqueCustomers: number;
258
- }>;
307
+ getUsageStats(discountId: string, range?: {
308
+ startDate?: string;
309
+ endDate?: string;
310
+ }): Promise<DiscountUsageStats>;
259
311
  }
260
312
  //# sourceMappingURL=discounts.client.d.ts.map