@aimee.shop/sdk 0.26.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 (479) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/dist/browser/browser-auth.d.ts +115 -0
  4. package/dist/browser/browser-auth.d.ts.map +1 -0
  5. package/dist/browser/browser-auth.js +234 -0
  6. package/dist/browser/browser-auth.js.map +1 -0
  7. package/dist/browser/index.d.ts +62 -0
  8. package/dist/browser/index.d.ts.map +1 -0
  9. package/dist/browser/index.js +69 -0
  10. package/dist/browser/index.js.map +1 -0
  11. package/dist/core/auth/api-key.authenticator.d.ts +16 -0
  12. package/dist/core/auth/api-key.authenticator.d.ts.map +1 -0
  13. package/dist/core/auth/api-key.authenticator.js +28 -0
  14. package/dist/core/auth/api-key.authenticator.js.map +1 -0
  15. package/dist/core/auth/auth-chain.d.ts +33 -0
  16. package/dist/core/auth/auth-chain.d.ts.map +1 -0
  17. package/dist/core/auth/auth-chain.js +65 -0
  18. package/dist/core/auth/auth-chain.js.map +1 -0
  19. package/dist/core/auth/authenticator.d.ts +19 -0
  20. package/dist/core/auth/authenticator.d.ts.map +1 -0
  21. package/dist/core/auth/authenticator.js +2 -0
  22. package/dist/core/auth/authenticator.js.map +1 -0
  23. package/dist/core/auth/cognito.authenticator.d.ts +28 -0
  24. package/dist/core/auth/cognito.authenticator.d.ts.map +1 -0
  25. package/dist/core/auth/cognito.authenticator.js +89 -0
  26. package/dist/core/auth/cognito.authenticator.js.map +1 -0
  27. package/dist/core/auth/index.d.ts +8 -0
  28. package/dist/core/auth/index.d.ts.map +1 -0
  29. package/dist/core/auth/index.js +6 -0
  30. package/dist/core/auth/index.js.map +1 -0
  31. package/dist/core/auth/interactive.authenticator.d.ts +22 -0
  32. package/dist/core/auth/interactive.authenticator.d.ts.map +1 -0
  33. package/dist/core/auth/interactive.authenticator.js +126 -0
  34. package/dist/core/auth/interactive.authenticator.js.map +1 -0
  35. package/dist/core/auth/lazy-interactive.authenticator.d.ts +51 -0
  36. package/dist/core/auth/lazy-interactive.authenticator.d.ts.map +1 -0
  37. package/dist/core/auth/lazy-interactive.authenticator.js +112 -0
  38. package/dist/core/auth/lazy-interactive.authenticator.js.map +1 -0
  39. package/dist/core/auth/token.authenticator.d.ts +20 -0
  40. package/dist/core/auth/token.authenticator.d.ts.map +1 -0
  41. package/dist/core/auth/token.authenticator.js +45 -0
  42. package/dist/core/auth/token.authenticator.js.map +1 -0
  43. package/dist/core/config.d.ts +72 -0
  44. package/dist/core/config.d.ts.map +1 -0
  45. package/dist/core/config.js +120 -0
  46. package/dist/core/config.js.map +1 -0
  47. package/dist/core/errors/index.d.ts +101 -0
  48. package/dist/core/errors/index.d.ts.map +1 -0
  49. package/dist/core/errors/index.js +119 -0
  50. package/dist/core/errors/index.js.map +1 -0
  51. package/dist/core/events/event-envelope.d.ts +34 -0
  52. package/dist/core/events/event-envelope.d.ts.map +1 -0
  53. package/dist/core/events/event-envelope.js +2 -0
  54. package/dist/core/events/event-envelope.js.map +1 -0
  55. package/dist/core/events/event-names.d.ts +552 -0
  56. package/dist/core/events/event-names.d.ts.map +1 -0
  57. package/dist/core/events/event-names.js +593 -0
  58. package/dist/core/events/event-names.js.map +1 -0
  59. package/dist/core/events/index.d.ts +4 -0
  60. package/dist/core/events/index.d.ts.map +1 -0
  61. package/dist/core/events/index.js +11 -0
  62. package/dist/core/events/index.js.map +1 -0
  63. package/dist/core/http-client.d.ts +88 -0
  64. package/dist/core/http-client.d.ts.map +1 -0
  65. package/dist/core/http-client.js +293 -0
  66. package/dist/core/http-client.js.map +1 -0
  67. package/dist/core/retry.d.ts +48 -0
  68. package/dist/core/retry.d.ts.map +1 -0
  69. package/dist/core/retry.js +57 -0
  70. package/dist/core/retry.js.map +1 -0
  71. package/dist/core/sdk.d.ts +153 -0
  72. package/dist/core/sdk.d.ts.map +1 -0
  73. package/dist/core/sdk.js +327 -0
  74. package/dist/core/sdk.js.map +1 -0
  75. package/dist/core/types/address.d.ts +18 -0
  76. package/dist/core/types/address.d.ts.map +1 -0
  77. package/dist/core/types/address.js +2 -0
  78. package/dist/core/types/address.js.map +1 -0
  79. package/dist/core/types/geo.d.ts +59 -0
  80. package/dist/core/types/geo.d.ts.map +1 -0
  81. package/dist/core/types/geo.js +78 -0
  82. package/dist/core/types/geo.js.map +1 -0
  83. package/dist/core/types/pagination.d.ts +42 -0
  84. package/dist/core/types/pagination.d.ts.map +1 -0
  85. package/dist/core/types/pagination.js +2 -0
  86. package/dist/core/types/pagination.js.map +1 -0
  87. package/dist/index.d.ts +68 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +37 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/services/core/assets.client.d.ts +520 -0
  92. package/dist/services/core/assets.client.d.ts.map +1 -0
  93. package/dist/services/core/assets.client.js +297 -0
  94. package/dist/services/core/assets.client.js.map +1 -0
  95. package/dist/services/core/base-resource.d.ts +70 -0
  96. package/dist/services/core/base-resource.d.ts.map +1 -0
  97. package/dist/services/core/base-resource.js +97 -0
  98. package/dist/services/core/base-resource.js.map +1 -0
  99. package/dist/services/core/cart-messages/cart-messages.client.d.ts +30 -0
  100. package/dist/services/core/cart-messages/cart-messages.client.d.ts.map +1 -0
  101. package/dist/services/core/cart-messages/cart-messages.client.js +30 -0
  102. package/dist/services/core/cart-messages/cart-messages.client.js.map +1 -0
  103. package/dist/services/core/cart-messages/index.d.ts +4 -0
  104. package/dist/services/core/cart-messages/index.d.ts.map +1 -0
  105. package/dist/services/core/cart-messages/index.js +3 -0
  106. package/dist/services/core/cart-messages/index.js.map +1 -0
  107. package/dist/services/core/cart-messages/types.d.ts +106 -0
  108. package/dist/services/core/cart-messages/types.d.ts.map +1 -0
  109. package/dist/services/core/cart-messages/types.js +6 -0
  110. package/dist/services/core/cart-messages/types.js.map +1 -0
  111. package/dist/services/core/carts.client.d.ts +253 -0
  112. package/dist/services/core/carts.client.d.ts.map +1 -0
  113. package/dist/services/core/carts.client.js +110 -0
  114. package/dist/services/core/carts.client.js.map +1 -0
  115. package/dist/services/core/categories.client.d.ts +105 -0
  116. package/dist/services/core/categories.client.d.ts.map +1 -0
  117. package/dist/services/core/categories.client.js +135 -0
  118. package/dist/services/core/categories.client.js.map +1 -0
  119. package/dist/services/core/checkout.client.d.ts +414 -0
  120. package/dist/services/core/checkout.client.d.ts.map +1 -0
  121. package/dist/services/core/checkout.client.js +153 -0
  122. package/dist/services/core/checkout.client.js.map +1 -0
  123. package/dist/services/core/cms/cms.client.d.ts +111 -0
  124. package/dist/services/core/cms/cms.client.d.ts.map +1 -0
  125. package/dist/services/core/cms/cms.client.js +148 -0
  126. package/dist/services/core/cms/cms.client.js.map +1 -0
  127. package/dist/services/core/cms/collections.client.d.ts +45 -0
  128. package/dist/services/core/cms/collections.client.d.ts.map +1 -0
  129. package/dist/services/core/cms/collections.client.js +67 -0
  130. package/dist/services/core/cms/collections.client.js.map +1 -0
  131. package/dist/services/core/cms/content-types.client.d.ts +101 -0
  132. package/dist/services/core/cms/content-types.client.d.ts.map +1 -0
  133. package/dist/services/core/cms/content-types.client.js +143 -0
  134. package/dist/services/core/cms/content-types.client.js.map +1 -0
  135. package/dist/services/core/cms/entries.client.d.ts +187 -0
  136. package/dist/services/core/cms/entries.client.d.ts.map +1 -0
  137. package/dist/services/core/cms/entries.client.js +265 -0
  138. package/dist/services/core/cms/entries.client.js.map +1 -0
  139. package/dist/services/core/cms/index.d.ts +10 -0
  140. package/dist/services/core/cms/index.d.ts.map +1 -0
  141. package/dist/services/core/cms/index.js +10 -0
  142. package/dist/services/core/cms/index.js.map +1 -0
  143. package/dist/services/core/cms/media.client.d.ts +63 -0
  144. package/dist/services/core/cms/media.client.d.ts.map +1 -0
  145. package/dist/services/core/cms/media.client.js +95 -0
  146. package/dist/services/core/cms/media.client.js.map +1 -0
  147. package/dist/services/core/cms/modules.client.d.ts +64 -0
  148. package/dist/services/core/cms/modules.client.d.ts.map +1 -0
  149. package/dist/services/core/cms/modules.client.js +88 -0
  150. package/dist/services/core/cms/modules.client.js.map +1 -0
  151. package/dist/services/core/cms/navigation.client.d.ts +78 -0
  152. package/dist/services/core/cms/navigation.client.d.ts.map +1 -0
  153. package/dist/services/core/cms/navigation.client.js +116 -0
  154. package/dist/services/core/cms/navigation.client.js.map +1 -0
  155. package/dist/services/core/cms/public.client.d.ts +64 -0
  156. package/dist/services/core/cms/public.client.d.ts.map +1 -0
  157. package/dist/services/core/cms/public.client.js +102 -0
  158. package/dist/services/core/cms/public.client.js.map +1 -0
  159. package/dist/services/core/cms/types.d.ts +804 -0
  160. package/dist/services/core/cms/types.d.ts.map +1 -0
  161. package/dist/services/core/cms/types.js +43 -0
  162. package/dist/services/core/cms/types.js.map +1 -0
  163. package/dist/services/core/customers.client.d.ts +285 -0
  164. package/dist/services/core/customers.client.d.ts.map +1 -0
  165. package/dist/services/core/customers.client.js +133 -0
  166. package/dist/services/core/customers.client.js.map +1 -0
  167. package/dist/services/core/discounts.client.d.ts +197 -0
  168. package/dist/services/core/discounts.client.d.ts.map +1 -0
  169. package/dist/services/core/discounts.client.js +81 -0
  170. package/dist/services/core/discounts.client.js.map +1 -0
  171. package/dist/services/core/exports/exports.client.d.ts +55 -0
  172. package/dist/services/core/exports/exports.client.d.ts.map +1 -0
  173. package/dist/services/core/exports/exports.client.js +80 -0
  174. package/dist/services/core/exports/exports.client.js.map +1 -0
  175. package/dist/services/core/exports/index.d.ts +4 -0
  176. package/dist/services/core/exports/index.d.ts.map +1 -0
  177. package/dist/services/core/exports/index.js +3 -0
  178. package/dist/services/core/exports/index.js.map +1 -0
  179. package/dist/services/core/exports/types.d.ts +68 -0
  180. package/dist/services/core/exports/types.d.ts.map +1 -0
  181. package/dist/services/core/exports/types.js +25 -0
  182. package/dist/services/core/exports/types.js.map +1 -0
  183. package/dist/services/core/facets.client.d.ts +127 -0
  184. package/dist/services/core/facets.client.d.ts.map +1 -0
  185. package/dist/services/core/facets.client.js +81 -0
  186. package/dist/services/core/facets.client.js.map +1 -0
  187. package/dist/services/core/fulfillments.client.d.ts +94 -0
  188. package/dist/services/core/fulfillments.client.d.ts.map +1 -0
  189. package/dist/services/core/fulfillments.client.js +66 -0
  190. package/dist/services/core/fulfillments.client.js.map +1 -0
  191. package/dist/services/core/inventory/adjustments.client.d.ts +60 -0
  192. package/dist/services/core/inventory/adjustments.client.d.ts.map +1 -0
  193. package/dist/services/core/inventory/adjustments.client.js +76 -0
  194. package/dist/services/core/inventory/adjustments.client.js.map +1 -0
  195. package/dist/services/core/inventory/index.d.ts +8 -0
  196. package/dist/services/core/inventory/index.d.ts.map +1 -0
  197. package/dist/services/core/inventory/index.js +7 -0
  198. package/dist/services/core/inventory/index.js.map +1 -0
  199. package/dist/services/core/inventory/inventory.client.d.ts +90 -0
  200. package/dist/services/core/inventory/inventory.client.d.ts.map +1 -0
  201. package/dist/services/core/inventory/inventory.client.js +135 -0
  202. package/dist/services/core/inventory/inventory.client.js.map +1 -0
  203. package/dist/services/core/inventory/locations.client.d.ts +71 -0
  204. package/dist/services/core/inventory/locations.client.d.ts.map +1 -0
  205. package/dist/services/core/inventory/locations.client.js +107 -0
  206. package/dist/services/core/inventory/locations.client.js.map +1 -0
  207. package/dist/services/core/inventory/reservations.client.d.ts +58 -0
  208. package/dist/services/core/inventory/reservations.client.d.ts.map +1 -0
  209. package/dist/services/core/inventory/reservations.client.js +87 -0
  210. package/dist/services/core/inventory/reservations.client.js.map +1 -0
  211. package/dist/services/core/inventory/stock.client.d.ts +74 -0
  212. package/dist/services/core/inventory/stock.client.d.ts.map +1 -0
  213. package/dist/services/core/inventory/stock.client.js +113 -0
  214. package/dist/services/core/inventory/stock.client.js.map +1 -0
  215. package/dist/services/core/inventory/types.d.ts +337 -0
  216. package/dist/services/core/inventory/types.d.ts.map +1 -0
  217. package/dist/services/core/inventory/types.js +2 -0
  218. package/dist/services/core/inventory/types.js.map +1 -0
  219. package/dist/services/core/invoices.client.d.ts +92 -0
  220. package/dist/services/core/invoices.client.d.ts.map +1 -0
  221. package/dist/services/core/invoices.client.js +68 -0
  222. package/dist/services/core/invoices.client.js.map +1 -0
  223. package/dist/services/core/notification-config.client.d.ts +57 -0
  224. package/dist/services/core/notification-config.client.d.ts.map +1 -0
  225. package/dist/services/core/notification-config.client.js +41 -0
  226. package/dist/services/core/notification-config.client.js.map +1 -0
  227. package/dist/services/core/openai-feed.client.d.ts +90 -0
  228. package/dist/services/core/openai-feed.client.d.ts.map +1 -0
  229. package/dist/services/core/openai-feed.client.js +63 -0
  230. package/dist/services/core/openai-feed.client.js.map +1 -0
  231. package/dist/services/core/option-types.client.d.ts +119 -0
  232. package/dist/services/core/option-types.client.d.ts.map +1 -0
  233. package/dist/services/core/option-types.client.js +81 -0
  234. package/dist/services/core/option-types.client.js.map +1 -0
  235. package/dist/services/core/option-values.client.d.ts +72 -0
  236. package/dist/services/core/option-values.client.d.ts.map +1 -0
  237. package/dist/services/core/option-values.client.js +64 -0
  238. package/dist/services/core/option-values.client.js.map +1 -0
  239. package/dist/services/core/order-edits.client.d.ts +88 -0
  240. package/dist/services/core/order-edits.client.d.ts.map +1 -0
  241. package/dist/services/core/order-edits.client.js +62 -0
  242. package/dist/services/core/order-edits.client.js.map +1 -0
  243. package/dist/services/core/orders.client.d.ts +284 -0
  244. package/dist/services/core/orders.client.d.ts.map +1 -0
  245. package/dist/services/core/orders.client.js +150 -0
  246. package/dist/services/core/orders.client.js.map +1 -0
  247. package/dist/services/core/pricing/currencies.client.d.ts +109 -0
  248. package/dist/services/core/pricing/currencies.client.d.ts.map +1 -0
  249. package/dist/services/core/pricing/currencies.client.js +145 -0
  250. package/dist/services/core/pricing/currencies.client.js.map +1 -0
  251. package/dist/services/core/pricing/customer-groups.client.d.ts +126 -0
  252. package/dist/services/core/pricing/customer-groups.client.d.ts.map +1 -0
  253. package/dist/services/core/pricing/customer-groups.client.js +154 -0
  254. package/dist/services/core/pricing/customer-groups.client.js.map +1 -0
  255. package/dist/services/core/pricing/geo-zones.client.d.ts +89 -0
  256. package/dist/services/core/pricing/geo-zones.client.d.ts.map +1 -0
  257. package/dist/services/core/pricing/geo-zones.client.js +116 -0
  258. package/dist/services/core/pricing/geo-zones.client.js.map +1 -0
  259. package/dist/services/core/pricing/index.d.ts +13 -0
  260. package/dist/services/core/pricing/index.d.ts.map +1 -0
  261. package/dist/services/core/pricing/index.js +13 -0
  262. package/dist/services/core/pricing/index.js.map +1 -0
  263. package/dist/services/core/pricing/markets.client.d.ts +154 -0
  264. package/dist/services/core/pricing/markets.client.d.ts.map +1 -0
  265. package/dist/services/core/pricing/markets.client.js +194 -0
  266. package/dist/services/core/pricing/markets.client.js.map +1 -0
  267. package/dist/services/core/pricing/pricing.client.d.ts +280 -0
  268. package/dist/services/core/pricing/pricing.client.d.ts.map +1 -0
  269. package/dist/services/core/pricing/pricing.client.js +363 -0
  270. package/dist/services/core/pricing/pricing.client.js.map +1 -0
  271. package/dist/services/core/pricing/product-geo-restrictions.client.d.ts +79 -0
  272. package/dist/services/core/pricing/product-geo-restrictions.client.d.ts.map +1 -0
  273. package/dist/services/core/pricing/product-geo-restrictions.client.js +109 -0
  274. package/dist/services/core/pricing/product-geo-restrictions.client.js.map +1 -0
  275. package/dist/services/core/pricing/product-market-settings.client.d.ts +168 -0
  276. package/dist/services/core/pricing/product-market-settings.client.d.ts.map +1 -0
  277. package/dist/services/core/pricing/product-market-settings.client.js +213 -0
  278. package/dist/services/core/pricing/product-market-settings.client.js.map +1 -0
  279. package/dist/services/core/pricing/rules.client.d.ts +46 -0
  280. package/dist/services/core/pricing/rules.client.d.ts.map +1 -0
  281. package/dist/services/core/pricing/rules.client.js +57 -0
  282. package/dist/services/core/pricing/rules.client.js.map +1 -0
  283. package/dist/services/core/pricing/store-markets.client.d.ts +168 -0
  284. package/dist/services/core/pricing/store-markets.client.d.ts.map +1 -0
  285. package/dist/services/core/pricing/store-markets.client.js +209 -0
  286. package/dist/services/core/pricing/store-markets.client.js.map +1 -0
  287. package/dist/services/core/pricing/tiers.client.d.ts +57 -0
  288. package/dist/services/core/pricing/tiers.client.d.ts.map +1 -0
  289. package/dist/services/core/pricing/tiers.client.js +72 -0
  290. package/dist/services/core/pricing/tiers.client.js.map +1 -0
  291. package/dist/services/core/pricing/types.d.ts +782 -0
  292. package/dist/services/core/pricing/types.d.ts.map +1 -0
  293. package/dist/services/core/pricing/types.js +2 -0
  294. package/dist/services/core/pricing/types.js.map +1 -0
  295. package/dist/services/core/pricing/variant-prices.client.d.ts +307 -0
  296. package/dist/services/core/pricing/variant-prices.client.d.ts.map +1 -0
  297. package/dist/services/core/pricing/variant-prices.client.js +347 -0
  298. package/dist/services/core/pricing/variant-prices.client.js.map +1 -0
  299. package/dist/services/core/product-relations.client.d.ts +260 -0
  300. package/dist/services/core/product-relations.client.d.ts.map +1 -0
  301. package/dist/services/core/product-relations.client.js +141 -0
  302. package/dist/services/core/product-relations.client.js.map +1 -0
  303. package/dist/services/core/products.client.d.ts +564 -0
  304. package/dist/services/core/products.client.d.ts.map +1 -0
  305. package/dist/services/core/products.client.js +277 -0
  306. package/dist/services/core/products.client.js.map +1 -0
  307. package/dist/services/core/returns.client.d.ts +199 -0
  308. package/dist/services/core/returns.client.d.ts.map +1 -0
  309. package/dist/services/core/returns.client.js +106 -0
  310. package/dist/services/core/returns.client.js.map +1 -0
  311. package/dist/services/core/reviews.client.d.ts +218 -0
  312. package/dist/services/core/reviews.client.d.ts.map +1 -0
  313. package/dist/services/core/reviews.client.js +161 -0
  314. package/dist/services/core/reviews.client.js.map +1 -0
  315. package/dist/services/core/search.client.d.ts +127 -0
  316. package/dist/services/core/search.client.d.ts.map +1 -0
  317. package/dist/services/core/search.client.js +120 -0
  318. package/dist/services/core/search.client.js.map +1 -0
  319. package/dist/services/core/shipping/classes.client.d.ts +20 -0
  320. package/dist/services/core/shipping/classes.client.d.ts.map +1 -0
  321. package/dist/services/core/shipping/classes.client.js +43 -0
  322. package/dist/services/core/shipping/classes.client.js.map +1 -0
  323. package/dist/services/core/shipping/index.d.ts +11 -0
  324. package/dist/services/core/shipping/index.d.ts.map +1 -0
  325. package/dist/services/core/shipping/index.js +11 -0
  326. package/dist/services/core/shipping/index.js.map +1 -0
  327. package/dist/services/core/shipping/labels.client.d.ts +20 -0
  328. package/dist/services/core/shipping/labels.client.d.ts.map +1 -0
  329. package/dist/services/core/shipping/labels.client.js +49 -0
  330. package/dist/services/core/shipping/labels.client.js.map +1 -0
  331. package/dist/services/core/shipping/providers.client.d.ts +19 -0
  332. package/dist/services/core/shipping/providers.client.d.ts.map +1 -0
  333. package/dist/services/core/shipping/providers.client.js +46 -0
  334. package/dist/services/core/shipping/providers.client.js.map +1 -0
  335. package/dist/services/core/shipping/rates.client.d.ts +19 -0
  336. package/dist/services/core/shipping/rates.client.d.ts.map +1 -0
  337. package/dist/services/core/shipping/rates.client.js +37 -0
  338. package/dist/services/core/shipping/rates.client.js.map +1 -0
  339. package/dist/services/core/shipping/rules.client.d.ts +17 -0
  340. package/dist/services/core/shipping/rules.client.d.ts.map +1 -0
  341. package/dist/services/core/shipping/rules.client.js +34 -0
  342. package/dist/services/core/shipping/rules.client.js.map +1 -0
  343. package/dist/services/core/shipping/shipper-identity.client.d.ts +49 -0
  344. package/dist/services/core/shipping/shipper-identity.client.d.ts.map +1 -0
  345. package/dist/services/core/shipping/shipper-identity.client.js +61 -0
  346. package/dist/services/core/shipping/shipper-identity.client.js.map +1 -0
  347. package/dist/services/core/shipping/shipping.client.d.ts +99 -0
  348. package/dist/services/core/shipping/shipping.client.d.ts.map +1 -0
  349. package/dist/services/core/shipping/shipping.client.js +165 -0
  350. package/dist/services/core/shipping/shipping.client.js.map +1 -0
  351. package/dist/services/core/shipping/store-providers.client.d.ts +48 -0
  352. package/dist/services/core/shipping/store-providers.client.d.ts.map +1 -0
  353. package/dist/services/core/shipping/store-providers.client.js +59 -0
  354. package/dist/services/core/shipping/store-providers.client.js.map +1 -0
  355. package/dist/services/core/shipping/types.d.ts +488 -0
  356. package/dist/services/core/shipping/types.d.ts.map +1 -0
  357. package/dist/services/core/shipping/types.js +3 -0
  358. package/dist/services/core/shipping/types.js.map +1 -0
  359. package/dist/services/core/shipping/zones.client.d.ts +16 -0
  360. package/dist/services/core/shipping/zones.client.d.ts.map +1 -0
  361. package/dist/services/core/shipping/zones.client.js +29 -0
  362. package/dist/services/core/shipping/zones.client.js.map +1 -0
  363. package/dist/services/core/storefront/index.d.ts +10 -0
  364. package/dist/services/core/storefront/index.d.ts.map +1 -0
  365. package/dist/services/core/storefront/index.js +10 -0
  366. package/dist/services/core/storefront/index.js.map +1 -0
  367. package/dist/services/core/storefront/storefront-addresses.client.d.ts +67 -0
  368. package/dist/services/core/storefront/storefront-addresses.client.d.ts.map +1 -0
  369. package/dist/services/core/storefront/storefront-addresses.client.js +95 -0
  370. package/dist/services/core/storefront/storefront-addresses.client.js.map +1 -0
  371. package/dist/services/core/storefront/storefront-auth.client.d.ts +104 -0
  372. package/dist/services/core/storefront/storefront-auth.client.d.ts.map +1 -0
  373. package/dist/services/core/storefront/storefront-auth.client.js +132 -0
  374. package/dist/services/core/storefront/storefront-auth.client.js.map +1 -0
  375. package/dist/services/core/storefront/storefront-orders.client.d.ts +73 -0
  376. package/dist/services/core/storefront/storefront-orders.client.d.ts.map +1 -0
  377. package/dist/services/core/storefront/storefront-orders.client.js +78 -0
  378. package/dist/services/core/storefront/storefront-orders.client.js.map +1 -0
  379. package/dist/services/core/storefront/storefront-plans.client.d.ts +76 -0
  380. package/dist/services/core/storefront/storefront-plans.client.d.ts.map +1 -0
  381. package/dist/services/core/storefront/storefront-plans.client.js +52 -0
  382. package/dist/services/core/storefront/storefront-plans.client.js.map +1 -0
  383. package/dist/services/core/storefront/storefront-reviews.client.d.ts +60 -0
  384. package/dist/services/core/storefront/storefront-reviews.client.d.ts.map +1 -0
  385. package/dist/services/core/storefront/storefront-reviews.client.js +88 -0
  386. package/dist/services/core/storefront/storefront-reviews.client.js.map +1 -0
  387. package/dist/services/core/storefront/storefront-subscriptions.client.d.ts +199 -0
  388. package/dist/services/core/storefront/storefront-subscriptions.client.d.ts.map +1 -0
  389. package/dist/services/core/storefront/storefront-subscriptions.client.js +149 -0
  390. package/dist/services/core/storefront/storefront-subscriptions.client.js.map +1 -0
  391. package/dist/services/core/storefront/storefront.client.d.ts +166 -0
  392. package/dist/services/core/storefront/storefront.client.d.ts.map +1 -0
  393. package/dist/services/core/storefront/storefront.client.js +228 -0
  394. package/dist/services/core/storefront/storefront.client.js.map +1 -0
  395. package/dist/services/core/storefront/types.d.ts +131 -0
  396. package/dist/services/core/storefront/types.d.ts.map +1 -0
  397. package/dist/services/core/storefront/types.js +3 -0
  398. package/dist/services/core/storefront/types.js.map +1 -0
  399. package/dist/services/core/storefront-redirects/index.d.ts +4 -0
  400. package/dist/services/core/storefront-redirects/index.d.ts.map +1 -0
  401. package/dist/services/core/storefront-redirects/index.js +3 -0
  402. package/dist/services/core/storefront-redirects/index.js.map +1 -0
  403. package/dist/services/core/storefront-redirects/storefront-redirects.client.d.ts +79 -0
  404. package/dist/services/core/storefront-redirects/storefront-redirects.client.d.ts.map +1 -0
  405. package/dist/services/core/storefront-redirects/storefront-redirects.client.js +132 -0
  406. package/dist/services/core/storefront-redirects/storefront-redirects.client.js.map +1 -0
  407. package/dist/services/core/storefront-redirects/storefront-redirects.public.client.d.ts +35 -0
  408. package/dist/services/core/storefront-redirects/storefront-redirects.public.client.d.ts.map +1 -0
  409. package/dist/services/core/storefront-redirects/storefront-redirects.public.client.js +42 -0
  410. package/dist/services/core/storefront-redirects/storefront-redirects.public.client.js.map +1 -0
  411. package/dist/services/core/storefront-redirects/types.d.ts +117 -0
  412. package/dist/services/core/storefront-redirects/types.d.ts.map +1 -0
  413. package/dist/services/core/storefront-redirects/types.js +2 -0
  414. package/dist/services/core/storefront-redirects/types.js.map +1 -0
  415. package/dist/services/core/stores/ai-discovery.client.d.ts +98 -0
  416. package/dist/services/core/stores/ai-discovery.client.d.ts.map +1 -0
  417. package/dist/services/core/stores/ai-discovery.client.js +72 -0
  418. package/dist/services/core/stores/ai-discovery.client.js.map +1 -0
  419. package/dist/services/core/stores/configuration.client.d.ts +238 -0
  420. package/dist/services/core/stores/configuration.client.d.ts.map +1 -0
  421. package/dist/services/core/stores/configuration.client.js +88 -0
  422. package/dist/services/core/stores/configuration.client.js.map +1 -0
  423. package/dist/services/core/stores/index.d.ts +11 -0
  424. package/dist/services/core/stores/index.d.ts.map +1 -0
  425. package/dist/services/core/stores/index.js +6 -0
  426. package/dist/services/core/stores/index.js.map +1 -0
  427. package/dist/services/core/stores/members.client.d.ts +91 -0
  428. package/dist/services/core/stores/members.client.d.ts.map +1 -0
  429. package/dist/services/core/stores/members.client.js +70 -0
  430. package/dist/services/core/stores/members.client.js.map +1 -0
  431. package/dist/services/core/stores/stores.client.d.ts +190 -0
  432. package/dist/services/core/stores/stores.client.d.ts.map +1 -0
  433. package/dist/services/core/stores/stores.client.js +177 -0
  434. package/dist/services/core/stores/stores.client.js.map +1 -0
  435. package/dist/services/core/stores/theme.types.d.ts +109 -0
  436. package/dist/services/core/stores/theme.types.d.ts.map +1 -0
  437. package/dist/services/core/stores/theme.types.js +27 -0
  438. package/dist/services/core/stores/theme.types.js.map +1 -0
  439. package/dist/services/core/taxes/index.d.ts +7 -0
  440. package/dist/services/core/taxes/index.d.ts.map +1 -0
  441. package/dist/services/core/taxes/index.js +7 -0
  442. package/dist/services/core/taxes/index.js.map +1 -0
  443. package/dist/services/core/taxes/jurisdictions.client.d.ts +61 -0
  444. package/dist/services/core/taxes/jurisdictions.client.d.ts.map +1 -0
  445. package/dist/services/core/taxes/jurisdictions.client.js +93 -0
  446. package/dist/services/core/taxes/jurisdictions.client.js.map +1 -0
  447. package/dist/services/core/taxes/providers.client.d.ts +111 -0
  448. package/dist/services/core/taxes/providers.client.d.ts.map +1 -0
  449. package/dist/services/core/taxes/providers.client.js +188 -0
  450. package/dist/services/core/taxes/providers.client.js.map +1 -0
  451. package/dist/services/core/taxes/rates.client.d.ts +63 -0
  452. package/dist/services/core/taxes/rates.client.d.ts.map +1 -0
  453. package/dist/services/core/taxes/rates.client.js +97 -0
  454. package/dist/services/core/taxes/rates.client.js.map +1 -0
  455. package/dist/services/core/taxes/store-providers.client.d.ts +48 -0
  456. package/dist/services/core/taxes/store-providers.client.d.ts.map +1 -0
  457. package/dist/services/core/taxes/store-providers.client.js +59 -0
  458. package/dist/services/core/taxes/store-providers.client.js.map +1 -0
  459. package/dist/services/core/taxes/taxes.client.d.ts +81 -0
  460. package/dist/services/core/taxes/taxes.client.d.ts.map +1 -0
  461. package/dist/services/core/taxes/taxes.client.js +117 -0
  462. package/dist/services/core/taxes/taxes.client.js.map +1 -0
  463. package/dist/services/core/taxes/types.d.ts +406 -0
  464. package/dist/services/core/taxes/types.d.ts.map +1 -0
  465. package/dist/services/core/taxes/types.js +3 -0
  466. package/dist/services/core/taxes/types.js.map +1 -0
  467. package/dist/services/core/variants.client.d.ts +415 -0
  468. package/dist/services/core/variants.client.d.ts.map +1 -0
  469. package/dist/services/core/variants.client.js +289 -0
  470. package/dist/services/core/variants.client.js.map +1 -0
  471. package/dist/services/core/wishlists.client.d.ts +151 -0
  472. package/dist/services/core/wishlists.client.d.ts.map +1 -0
  473. package/dist/services/core/wishlists.client.js +125 -0
  474. package/dist/services/core/wishlists.client.js.map +1 -0
  475. package/dist/storefront/index.d.ts +152 -0
  476. package/dist/storefront/index.d.ts.map +1 -0
  477. package/dist/storefront/index.js +189 -0
  478. package/dist/storefront/index.js.map +1 -0
  479. package/package.json +66 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ziftr
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # Aimee TypeScript SDKs
2
+
3
+ This repo publishes two ESM TypeScript SDK packages from one npm workspace.
4
+
5
+ ## Packages
6
+
7
+ ### `@aimee.shop/sdk`
8
+
9
+ Public SDK for storefront and merchant-safe commerce APIs.
10
+
11
+ ```bash
12
+ npm install @aimee.shop/sdk
13
+ ```
14
+
15
+ ```typescript
16
+ import { ZiftrSDK } from '@aimee.shop/sdk';
17
+
18
+ const sdk = new ZiftrSDK({
19
+ apiKey: process.env.ZIFTR_API_KEY,
20
+ tenantId: 'tenant-uuid',
21
+ });
22
+
23
+ const products = await sdk.products.list({ limit: 20 });
24
+ const checkout = await sdk.checkout.create({ cartId: 'cart-uuid' });
25
+ ```
26
+
27
+ Browser usage:
28
+
29
+ ```typescript
30
+ import { ziftr, browserAuth } from '@aimee.shop/sdk/browser';
31
+
32
+ await browserAuth.signIn('user@example.com', 'password');
33
+ const products = await ziftr.products.list();
34
+ ```
35
+
36
+ ### `@aimee.shop/sdk-platform`
37
+
38
+ Internal/admin SDK for platform operations. It includes the public SDK surface plus RBAC, payments admin, workflows, notifications, tenants, users/admin, API keys, UCP/admin, sandbox promotion, and content copy.
39
+
40
+ ```bash
41
+ npm install @aimee.shop/sdk @aimee.shop/sdk-platform
42
+ ```
43
+
44
+ ```typescript
45
+ import { ZiftrPlatformSDK } from '@aimee.shop/sdk-platform';
46
+
47
+ const sdk = new ZiftrPlatformSDK({
48
+ apiKey: process.env.ZIFTR_API_KEY,
49
+ tenantId: 'tenant-uuid',
50
+ });
51
+
52
+ const roles = await sdk.rbac.roles.list();
53
+ const tenants = await sdk.tenants.list();
54
+ ```
55
+
56
+ ## Development
57
+
58
+ ```bash
59
+ npm install
60
+ npm run build
61
+ npm run typecheck
62
+ npm test
63
+ npm run status
64
+ npm run pack:dry-run
65
+ ```
66
+
67
+ Quality rules:
68
+
69
+ - `npm run status` must pass before commit.
70
+ - No `any`, `as any`, or `@ts-ignore`.
71
+ - Public package must not include platform service files.
72
+ - Platform package is the only package that exposes internal/admin clients.
73
+
74
+ ## Authentication
75
+
76
+ Supported auth modes:
77
+
78
+ - API key for server-side consumers.
79
+ - `getAccessToken` for browser/framework-managed sessions.
80
+ - Cognito email/password for service-style auth.
81
+ - Interactive auth for local development.
82
+
83
+ ```typescript
84
+ const sdk = new ZiftrSDK({
85
+ getAccessToken: () => authContext.getToken(),
86
+ tenantId: 'tenant-uuid',
87
+ });
88
+ ```
89
+
90
+ ## Multi-Tenant Context
91
+
92
+ ```typescript
93
+ const tenantSdk = sdk.withTenant('other-tenant');
94
+ const storeSdk = sdk.withStore('store-uuid');
95
+ ```
96
+
97
+ Scoped instances share authentication but get their own HTTP client so tenant/store headers are isolated.
98
+
99
+ ## Notification config (server / `sk_` only)
100
+
101
+ List which transactional definitions exist for a store and fire a test send
102
+ without placing an order. Requires a secret API key (`sk_`) or admin JWT with
103
+ `notification-config:read` / `notification-config:trigger`, plus store context.
104
+ Publishable (`pk_`) keys return 403. This is not on `@aimee.shop/sdk/storefront`.
105
+ Admin template/provider work stays on `@aimee.shop/sdk-platform` (`sdk.notifications`).
106
+
107
+ ```typescript
108
+ sdk.setStore(storeId);
109
+ const { items } = await sdk.notificationConfig.list();
110
+ await sdk.notificationConfig.testSend({
111
+ eventName: 'order.created',
112
+ to: 'dev@example.com',
113
+ });
114
+ ```
115
+
116
+ The live order-confirmation event is `order.created` (not `order.confirmed`).
117
+
118
+ ## CSV exports (server / `sk_` only)
119
+
120
+ Create an async CSV export job, poll until `completed`, then open the
121
+ presigned download URL. Requires `{entity}:export` (`orders:export`,
122
+ `products:export`, `customers:export`) plus store context for store-scoped
123
+ entities. Publishable (`pk_`) keys return 403. This is not on
124
+ `@aimee.shop/sdk/storefront`.
125
+
126
+ ```typescript
127
+ sdk.setStore(storeId);
128
+ const { jobId } = await sdk.exports.create(
129
+ { entity: 'orders', filters: { status: 'PAID' }, columnSet: 'summary' },
130
+ { idempotencyKey: crypto.randomUUID() },
131
+ );
132
+ const job = await sdk.exports.get(jobId);
133
+ if (job.status === 'completed') {
134
+ const { downloadUrl } = await sdk.exports.getDownloadUrl(jobId);
135
+ }
136
+ ```
137
+
138
+ ## Package Boundary
139
+
140
+ Use `@aimee.shop/sdk` for storefronts, public developer tooling, and merchant-safe integrations.
141
+
142
+ Use `@aimee.shop/sdk-platform` for admin UI, internal services, and tools that need platform operations.
143
+
144
+ `@aimee.shop/sdk-platform` peer-depends on `@aimee.shop/sdk` and extends its public SDK class. Platform consumers should import SDK symbols from `@aimee.shop/sdk-platform` when they need the combined public plus platform surface.
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Browser-side Cognito authentication helper.
3
+ * Auto-detects and manages Cognito session from localStorage.
4
+ *
5
+ * Uses COGNITO_CONFIG resolved from environment variables at runtime.
6
+ * Set ZIFTR_COGNITO_USER_POOL_ID and ZIFTR_COGNITO_CLIENT_ID (or NEXT_PUBLIC_ variants).
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { browserAuth } from '@aimee.shop/sdk/browser';
11
+ *
12
+ * // Sign in
13
+ * await browserAuth.signIn('user@example.com', 'password');
14
+ *
15
+ * // Get current user
16
+ * const user = await browserAuth.getCurrentUser();
17
+ *
18
+ * // Sign out
19
+ * browserAuth.signOut();
20
+ * ```
21
+ */
22
+ import { CognitoUserSession } from 'amazon-cognito-identity-js';
23
+ /**
24
+ * User identity from Cognito JWT.
25
+ * Note: Tenant membership comes from /users/me/tenants API, not JWT.
26
+ * Note: Roles/permissions come from RBAC service, not JWT.
27
+ */
28
+ export interface BrowserUser {
29
+ email: string;
30
+ sub: string;
31
+ }
32
+ /**
33
+ * Result of a successful sign-in
34
+ */
35
+ export interface SignInResult {
36
+ user: BrowserUser;
37
+ accessToken: string;
38
+ idToken: string;
39
+ refreshToken: string;
40
+ }
41
+ /**
42
+ * Cognito authentication flow for sign-in.
43
+ *
44
+ * - `USER_SRP_AUTH` (default): two round trips with an SRP zero-knowledge
45
+ * proof; the password never leaves the browser.
46
+ * - `USER_PASSWORD_AUTH`: single round trip; the password is sent to Cognito
47
+ * over TLS. Faster, but only appropriate for first-party apps over HTTPS.
48
+ */
49
+ export type CognitoAuthFlow = 'USER_SRP_AUTH' | 'USER_PASSWORD_AUTH';
50
+ /**
51
+ * Options for {@link BrowserAuth.signIn}.
52
+ */
53
+ export interface SignInOptions {
54
+ /**
55
+ * Cognito authentication flow. Defaults to `USER_SRP_AUTH`.
56
+ *
57
+ * `USER_PASSWORD_AUTH` skips the SRP challenge round trip (saves a network
58
+ * round trip plus client-side SRP crypto) at the cost of sending the
59
+ * password to Cognito over TLS instead of an SRP zero-knowledge proof.
60
+ * Keep the default for public/storefront clients; opt in only for
61
+ * first-party apps. Requires `ALLOW_USER_PASSWORD_AUTH` on the Cognito app
62
+ * client, otherwise Cognito rejects with NotAuthorizedException.
63
+ */
64
+ authFlow?: CognitoAuthFlow;
65
+ }
66
+ /**
67
+ * Browser-side Cognito authentication helper.
68
+ * Manages Cognito user pool session in the browser.
69
+ */
70
+ export declare class BrowserAuth {
71
+ private pool;
72
+ /**
73
+ * Get or create the Cognito user pool instance.
74
+ * Uses COGNITO_CONFIG resolved from environment variables.
75
+ */
76
+ private getPool;
77
+ /**
78
+ * Get the current access token from the Cognito session.
79
+ * Returns null if not authenticated.
80
+ */
81
+ getAccessToken(): Promise<string | null>;
82
+ /**
83
+ * Get the current ID token from the Cognito session.
84
+ * Returns null if not authenticated.
85
+ */
86
+ getIdToken(): Promise<string | null>;
87
+ /**
88
+ * Get the current authenticated user.
89
+ * Returns null if not authenticated.
90
+ */
91
+ getCurrentUser(): Promise<BrowserUser | null>;
92
+ /**
93
+ * Check if there is a valid authenticated session.
94
+ */
95
+ isAuthenticated(): Promise<boolean>;
96
+ /**
97
+ * Sign in with email and password.
98
+ *
99
+ * Uses the SRP flow by default. Pass `{ authFlow: 'USER_PASSWORD_AUTH' }`
100
+ * to authenticate in a single round trip (see {@link SignInOptions}).
101
+ */
102
+ signIn(email: string, password: string, options?: SignInOptions): Promise<SignInResult>;
103
+ /**
104
+ * Sign out the current user.
105
+ * Clears the local session.
106
+ */
107
+ signOut(): void;
108
+ /**
109
+ * Refresh the current session.
110
+ * Returns the new session or null if refresh failed.
111
+ */
112
+ refreshSession(): Promise<CognitoUserSession | null>;
113
+ }
114
+ export declare const browserAuth: BrowserAuth;
115
+ //# sourceMappingURL=browser-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-auth.d.ts","sourceRoot":"","sources":["../../../../src/browser/browser-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAIL,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED;;;GAGG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAgC;IAE5C;;;OAGG;IACH,OAAO,CAAC,OAAO;IA0Bf;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAwB9C;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAuB1C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IA8BnD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAKzC;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA0C7F;;;OAGG;IACH,OAAO,IAAI,IAAI;IAYf;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;CAkC3D;AAGD,eAAO,MAAM,WAAW,aAAoB,CAAC"}
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Browser-side Cognito authentication helper.
3
+ * Auto-detects and manages Cognito session from localStorage.
4
+ *
5
+ * Uses COGNITO_CONFIG resolved from environment variables at runtime.
6
+ * Set ZIFTR_COGNITO_USER_POOL_ID and ZIFTR_COGNITO_CLIENT_ID (or NEXT_PUBLIC_ variants).
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { browserAuth } from '@aimee.shop/sdk/browser';
11
+ *
12
+ * // Sign in
13
+ * await browserAuth.signIn('user@example.com', 'password');
14
+ *
15
+ * // Get current user
16
+ * const user = await browserAuth.getCurrentUser();
17
+ *
18
+ * // Sign out
19
+ * browserAuth.signOut();
20
+ * ```
21
+ */
22
+ import { CognitoUserPool, CognitoUser, AuthenticationDetails, } from 'amazon-cognito-identity-js';
23
+ import { COGNITO_CONFIG } from '../core/config.js';
24
+ /**
25
+ * Browser-side Cognito authentication helper.
26
+ * Manages Cognito user pool session in the browser.
27
+ */
28
+ export class BrowserAuth {
29
+ pool = null;
30
+ /**
31
+ * Get or create the Cognito user pool instance.
32
+ * Uses COGNITO_CONFIG resolved from environment variables.
33
+ */
34
+ getPool() {
35
+ if (this.pool) {
36
+ return this.pool;
37
+ }
38
+ // Check for browser environment
39
+ if (typeof window === 'undefined') {
40
+ throw new Error('BrowserAuth can only be used in browser environments. ' +
41
+ 'For server-side usage, use ZiftrSDK with apiKey instead.');
42
+ }
43
+ // Validate Cognito config is available (resolved from env vars or defaults)
44
+ if (!COGNITO_CONFIG.userPoolId || !COGNITO_CONFIG.clientId) {
45
+ throw new Error('Cognito configuration not available. This is an SDK build issue.');
46
+ }
47
+ this.pool = new CognitoUserPool({
48
+ UserPoolId: COGNITO_CONFIG.userPoolId,
49
+ ClientId: COGNITO_CONFIG.clientId,
50
+ });
51
+ return this.pool;
52
+ }
53
+ /**
54
+ * Get the current access token from the Cognito session.
55
+ * Returns null if not authenticated.
56
+ */
57
+ async getAccessToken() {
58
+ try {
59
+ const pool = this.getPool();
60
+ const user = pool.getCurrentUser();
61
+ if (!user) {
62
+ return null;
63
+ }
64
+ return new Promise((resolve) => {
65
+ user.getSession((err, session) => {
66
+ if (err || !session?.isValid()) {
67
+ resolve(null);
68
+ return;
69
+ }
70
+ resolve(session.getAccessToken().getJwtToken());
71
+ });
72
+ });
73
+ }
74
+ catch {
75
+ // Pool initialization failed (missing config, SSR, etc.)
76
+ return null;
77
+ }
78
+ }
79
+ /**
80
+ * Get the current ID token from the Cognito session.
81
+ * Returns null if not authenticated.
82
+ */
83
+ async getIdToken() {
84
+ try {
85
+ const pool = this.getPool();
86
+ const user = pool.getCurrentUser();
87
+ if (!user) {
88
+ return null;
89
+ }
90
+ return new Promise((resolve) => {
91
+ user.getSession((err, session) => {
92
+ if (err || !session?.isValid()) {
93
+ resolve(null);
94
+ return;
95
+ }
96
+ resolve(session.getIdToken().getJwtToken());
97
+ });
98
+ });
99
+ }
100
+ catch {
101
+ return null;
102
+ }
103
+ }
104
+ /**
105
+ * Get the current authenticated user.
106
+ * Returns null if not authenticated.
107
+ */
108
+ async getCurrentUser() {
109
+ try {
110
+ const pool = this.getPool();
111
+ const cognitoUser = pool.getCurrentUser();
112
+ if (!cognitoUser) {
113
+ return null;
114
+ }
115
+ return new Promise((resolve) => {
116
+ cognitoUser.getSession((err, session) => {
117
+ if (err || !session?.isValid()) {
118
+ resolve(null);
119
+ return;
120
+ }
121
+ const idToken = session.getIdToken();
122
+ const payload = idToken.decodePayload();
123
+ resolve({
124
+ email: payload.email,
125
+ sub: payload.sub,
126
+ });
127
+ });
128
+ });
129
+ }
130
+ catch {
131
+ return null;
132
+ }
133
+ }
134
+ /**
135
+ * Check if there is a valid authenticated session.
136
+ */
137
+ async isAuthenticated() {
138
+ const token = await this.getAccessToken();
139
+ return token !== null;
140
+ }
141
+ /**
142
+ * Sign in with email and password.
143
+ *
144
+ * Uses the SRP flow by default. Pass `{ authFlow: 'USER_PASSWORD_AUTH' }`
145
+ * to authenticate in a single round trip (see {@link SignInOptions}).
146
+ */
147
+ async signIn(email, password, options) {
148
+ const pool = this.getPool();
149
+ const authDetails = new AuthenticationDetails({
150
+ Username: email,
151
+ Password: password,
152
+ });
153
+ const cognitoUser = new CognitoUser({
154
+ Username: email,
155
+ Pool: pool,
156
+ });
157
+ if (options?.authFlow === 'USER_PASSWORD_AUTH') {
158
+ cognitoUser.setAuthenticationFlowType('USER_PASSWORD_AUTH');
159
+ }
160
+ return new Promise((resolve, reject) => {
161
+ cognitoUser.authenticateUser(authDetails, {
162
+ onSuccess: (session) => {
163
+ const idTokenPayload = session.getIdToken().decodePayload();
164
+ resolve({
165
+ user: {
166
+ email: idTokenPayload.email,
167
+ sub: idTokenPayload.sub,
168
+ },
169
+ accessToken: session.getAccessToken().getJwtToken(),
170
+ idToken: session.getIdToken().getJwtToken(),
171
+ refreshToken: session.getRefreshToken().getToken(),
172
+ });
173
+ },
174
+ onFailure: (err) => {
175
+ reject(err);
176
+ },
177
+ newPasswordRequired: () => {
178
+ reject(new Error('NEW_PASSWORD_REQUIRED'));
179
+ },
180
+ });
181
+ });
182
+ }
183
+ /**
184
+ * Sign out the current user.
185
+ * Clears the local session.
186
+ */
187
+ signOut() {
188
+ try {
189
+ const pool = this.getPool();
190
+ const user = pool.getCurrentUser();
191
+ if (user) {
192
+ user.signOut();
193
+ }
194
+ }
195
+ catch {
196
+ // Ignore errors during sign out
197
+ }
198
+ }
199
+ /**
200
+ * Refresh the current session.
201
+ * Returns the new session or null if refresh failed.
202
+ */
203
+ async refreshSession() {
204
+ try {
205
+ const pool = this.getPool();
206
+ const user = pool.getCurrentUser();
207
+ if (!user) {
208
+ return null;
209
+ }
210
+ return new Promise((resolve) => {
211
+ user.getSession((err, session) => {
212
+ if (err || !session) {
213
+ resolve(null);
214
+ return;
215
+ }
216
+ const refreshToken = session.getRefreshToken();
217
+ user.refreshSession(refreshToken, (refreshErr, newSession) => {
218
+ if (refreshErr) {
219
+ resolve(null);
220
+ return;
221
+ }
222
+ resolve(newSession);
223
+ });
224
+ });
225
+ });
226
+ }
227
+ catch {
228
+ return null;
229
+ }
230
+ }
231
+ }
232
+ // Default singleton instance
233
+ export const browserAuth = new BrowserAuth();
234
+ //# sourceMappingURL=browser-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-auth.js","sourceRoot":"","sources":["../../../../src/browser/browser-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,eAAe,EACf,WAAW,EACX,qBAAqB,GAEtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAiDnD;;;GAGG;AACH,MAAM,OAAO,WAAW;IACd,IAAI,GAA2B,IAAI,CAAC;I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CAAC,OAAO,EAAE,CAAC;wBACpB,OAAO,CAAC,IAAI,CAAC,CAAC;wBACd,OAAO;oBACT,CAAC;oBAED,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;oBAE/C,IAAI,CAAC,cAAc,CACjB,YAAY,EACZ,CAAC,UAAwB,EAAE,UAAqC,EAAE,EAAE;wBAClE,IAAI,UAAU,EAAE,CAAC;4BACf,OAAO,CAAC,IAAI,CAAC,CAAC;4BACd,OAAO;wBACT,CAAC;wBACD,OAAO,CAAC,UAAU,CAAC,CAAC;oBACtB,CAAC,CACF,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAED,6BAA6B;AAC7B,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Browser entry point for @aimee.shop/sdk
3
+ *
4
+ * Provides a pre-configured SDK instance that automatically detects
5
+ * Cognito session from localStorage. No manual token injection required.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Simple, Stripe-like usage!
10
+ * import { ziftr } from '@aimee.shop/sdk/browser';
11
+ *
12
+ * // Just works - auth auto-detected from Cognito session
13
+ * const products = await ziftr.products.list();
14
+ * const orders = await ziftr.orders.list();
15
+ * ```
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Sign in and use
20
+ * import { ziftr, browserAuth } from '@aimee.shop/sdk/browser';
21
+ *
22
+ * await browserAuth.signIn('admin@example.com', 'password');
23
+ * const products = await ziftr.products.list();
24
+ * ```
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * // Check authentication status
29
+ * import { browserAuth } from '@aimee.shop/sdk/browser';
30
+ *
31
+ * const isLoggedIn = await browserAuth.isAuthenticated();
32
+ * const user = await browserAuth.getCurrentUser();
33
+ * ```
34
+ *
35
+ * @packageDocumentation
36
+ */
37
+ import { ZiftrSDK } from '../core/sdk.js';
38
+ import { browserAuth, BrowserAuth, BrowserUser, SignInResult, SignInOptions, CognitoAuthFlow } from './browser-auth.js';
39
+ /**
40
+ * Pre-configured SDK instance with auto-detected browser Cognito auth.
41
+ *
42
+ * This singleton automatically:
43
+ * - Detects Cognito session from localStorage
44
+ * - Injects ID token into all API requests
45
+ *
46
+ * For server-side usage, use `ZiftrSDK` with `apiKey` instead.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * import { ziftr } from '@aimee.shop/sdk/browser';
51
+ *
52
+ * // No setup needed - just use it!
53
+ * const products = await ziftr.products.list();
54
+ * ```
55
+ */
56
+ export declare const ziftr: ZiftrSDK;
57
+ export { browserAuth };
58
+ export type { BrowserAuth, BrowserUser, SignInResult, SignInOptions, CognitoAuthFlow };
59
+ export { ZiftrSDK };
60
+ export type { ZiftrSDKConfig, ServiceEndpoints, CognitoConfig } from '../core/config.js';
61
+ export { COGNITO_CONFIG } from '../core/config.js';
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACb,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,KAAK,UAMhB,CAAC;AAGH,OAAO,EAAE,WAAW,EAAE,CAAC;AAGvB,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAGvF,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIzF,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Browser entry point for @aimee.shop/sdk
3
+ *
4
+ * Provides a pre-configured SDK instance that automatically detects
5
+ * Cognito session from localStorage. No manual token injection required.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * // Simple, Stripe-like usage!
10
+ * import { ziftr } from '@aimee.shop/sdk/browser';
11
+ *
12
+ * // Just works - auth auto-detected from Cognito session
13
+ * const products = await ziftr.products.list();
14
+ * const orders = await ziftr.orders.list();
15
+ * ```
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // Sign in and use
20
+ * import { ziftr, browserAuth } from '@aimee.shop/sdk/browser';
21
+ *
22
+ * await browserAuth.signIn('admin@example.com', 'password');
23
+ * const products = await ziftr.products.list();
24
+ * ```
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * // Check authentication status
29
+ * import { browserAuth } from '@aimee.shop/sdk/browser';
30
+ *
31
+ * const isLoggedIn = await browserAuth.isAuthenticated();
32
+ * const user = await browserAuth.getCurrentUser();
33
+ * ```
34
+ *
35
+ * @packageDocumentation
36
+ */
37
+ import { ZiftrSDK } from '../core/sdk.js';
38
+ import { browserAuth, } from './browser-auth.js';
39
+ /**
40
+ * Pre-configured SDK instance with auto-detected browser Cognito auth.
41
+ *
42
+ * This singleton automatically:
43
+ * - Detects Cognito session from localStorage
44
+ * - Injects ID token into all API requests
45
+ *
46
+ * For server-side usage, use `ZiftrSDK` with `apiKey` instead.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * import { ziftr } from '@aimee.shop/sdk/browser';
51
+ *
52
+ * // No setup needed - just use it!
53
+ * const products = await ziftr.products.list();
54
+ * ```
55
+ */
56
+ export const ziftr = new ZiftrSDK({
57
+ // Auto-inject Cognito ID token (backend @ziftr/auth expects tokenUse: 'id')
58
+ getAccessToken: () => browserAuth.getIdToken(),
59
+ // Debug mode follows NODE_ENV
60
+ debug: process.env.NODE_ENV === 'development',
61
+ });
62
+ // Re-export auth helper for login/logout
63
+ export { browserAuth };
64
+ // Re-export main SDK class and types (for advanced usage)
65
+ export { ZiftrSDK };
66
+ // Re-export Cognito config for frontends that manage their own auth
67
+ // but want to use the SDK's baked-in configuration
68
+ export { COGNITO_CONFIG } from '../core/config.js';
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,WAAW,GAMZ,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC;IAChC,4EAA4E;IAC5E,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE;IAE9C,8BAA8B;IAC9B,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa;CAC9C,CAAC,CAAC;AAEH,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,CAAC;AAKvB,0DAA0D;AAC1D,OAAO,EAAE,QAAQ,EAAE,CAAC;AAGpB,oEAAoE;AACpE,mDAAmD;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Authenticator } from './authenticator.js';
2
+ /**
3
+ * API Key authenticator - highest priority in the chain.
4
+ * Simply adds the API key to request headers.
5
+ */
6
+ export declare class ApiKeyAuthenticator implements Authenticator {
7
+ readonly name = "api-key";
8
+ readonly priority = 1;
9
+ private readonly apiKey;
10
+ constructor(apiKey: string);
11
+ canAuthenticate(): boolean;
12
+ getAuthHeaders(): Promise<Record<string, string>>;
13
+ isExpired(): boolean;
14
+ refresh(): Promise<void>;
15
+ }
16
+ //# sourceMappingURL=api-key.authenticator.d.ts.map