@unifiedcommerce/core 0.0.1 → 0.0.2

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 (554) hide show
  1. package/dist/auth/access.d.ts +1 -1
  2. package/dist/auth/access.d.ts.map +1 -1
  3. package/dist/auth/auth-schema.js +3 -3
  4. package/dist/auth/middleware.d.ts +2 -2
  5. package/dist/auth/middleware.d.ts.map +1 -1
  6. package/dist/auth/middleware.js +37 -10
  7. package/dist/auth/org.js +1 -1
  8. package/dist/auth/permissions.d.ts +1 -1
  9. package/dist/auth/permissions.d.ts.map +1 -1
  10. package/dist/auth/permissions.js +1 -1
  11. package/dist/auth/setup.d.ts +19 -10
  12. package/dist/auth/setup.d.ts.map +1 -1
  13. package/dist/auth/setup.js +3 -4
  14. package/dist/auth/system-actor.d.ts +1 -1
  15. package/dist/auth/system-actor.d.ts.map +1 -1
  16. package/dist/auth/system-actor.js +1 -1
  17. package/dist/config/defaults.d.ts +1 -1
  18. package/dist/config/defaults.d.ts.map +1 -1
  19. package/dist/config/define-config.d.ts +1 -1
  20. package/dist/config/define-config.d.ts.map +1 -1
  21. package/dist/config/define-config.js +2 -2
  22. package/dist/config/types.d.ts +11 -11
  23. package/dist/config/types.d.ts.map +1 -1
  24. package/dist/hooks/checkout-completion.d.ts +2 -2
  25. package/dist/hooks/checkout-completion.d.ts.map +1 -1
  26. package/dist/hooks/checkout-completion.js +2 -2
  27. package/dist/hooks/checkout.d.ts +3 -3
  28. package/dist/hooks/checkout.d.ts.map +1 -1
  29. package/dist/hooks/checkout.js +3 -3
  30. package/dist/hooks/order-emails.d.ts +1 -1
  31. package/dist/hooks/order-emails.d.ts.map +1 -1
  32. package/dist/index.d.ts +81 -81
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +50 -13381
  35. package/dist/interfaces/mcp/context-enrichment.d.ts +2 -2
  36. package/dist/interfaces/mcp/context-enrichment.d.ts.map +1 -1
  37. package/dist/interfaces/mcp/context-enrichment.js +1 -1
  38. package/dist/interfaces/mcp/server.d.ts +2 -2
  39. package/dist/interfaces/mcp/server.d.ts.map +1 -1
  40. package/dist/interfaces/mcp/server.js +3 -3
  41. package/dist/interfaces/mcp/transport.d.ts +2 -2
  42. package/dist/interfaces/mcp/transport.d.ts.map +1 -1
  43. package/dist/interfaces/mcp/transport.js +1 -1
  44. package/dist/interfaces/rest/customer-portal.d.ts +2 -2
  45. package/dist/interfaces/rest/customer-portal.d.ts.map +1 -1
  46. package/dist/interfaces/rest/customer-portal.js +3 -3
  47. package/dist/interfaces/rest/index.d.ts +2 -2
  48. package/dist/interfaces/rest/index.d.ts.map +1 -1
  49. package/dist/interfaces/rest/index.js +13 -13
  50. package/dist/interfaces/rest/router.d.ts +1 -1
  51. package/dist/interfaces/rest/router.d.ts.map +1 -1
  52. package/dist/interfaces/rest/router.js +4 -4
  53. package/dist/interfaces/rest/routes/admin-jobs.d.ts +2 -2
  54. package/dist/interfaces/rest/routes/admin-jobs.d.ts.map +1 -1
  55. package/dist/interfaces/rest/routes/admin-jobs.js +4 -4
  56. package/dist/interfaces/rest/routes/audit.d.ts +2 -2
  57. package/dist/interfaces/rest/routes/audit.d.ts.map +1 -1
  58. package/dist/interfaces/rest/routes/audit.js +3 -3
  59. package/dist/interfaces/rest/routes/carts.d.ts +2 -2
  60. package/dist/interfaces/rest/routes/carts.d.ts.map +1 -1
  61. package/dist/interfaces/rest/routes/carts.js +2 -2
  62. package/dist/interfaces/rest/routes/catalog.d.ts +2 -2
  63. package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -1
  64. package/dist/interfaces/rest/routes/catalog.js +2 -2
  65. package/dist/interfaces/rest/routes/checkout.d.ts +2 -2
  66. package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -1
  67. package/dist/interfaces/rest/routes/checkout.js +7 -7
  68. package/dist/interfaces/rest/routes/inventory.d.ts +2 -2
  69. package/dist/interfaces/rest/routes/inventory.d.ts.map +1 -1
  70. package/dist/interfaces/rest/routes/inventory.js +2 -2
  71. package/dist/interfaces/rest/routes/media.d.ts +2 -2
  72. package/dist/interfaces/rest/routes/media.d.ts.map +1 -1
  73. package/dist/interfaces/rest/routes/media.js +2 -2
  74. package/dist/interfaces/rest/routes/orders.d.ts +2 -2
  75. package/dist/interfaces/rest/routes/orders.d.ts.map +1 -1
  76. package/dist/interfaces/rest/routes/orders.js +2 -2
  77. package/dist/interfaces/rest/routes/payments.d.ts +2 -2
  78. package/dist/interfaces/rest/routes/payments.d.ts.map +1 -1
  79. package/dist/interfaces/rest/routes/payments.js +2 -2
  80. package/dist/interfaces/rest/routes/pricing.d.ts +2 -2
  81. package/dist/interfaces/rest/routes/pricing.d.ts.map +1 -1
  82. package/dist/interfaces/rest/routes/pricing.js +2 -2
  83. package/dist/interfaces/rest/routes/promotions.d.ts +2 -2
  84. package/dist/interfaces/rest/routes/promotions.d.ts.map +1 -1
  85. package/dist/interfaces/rest/routes/promotions.js +3 -3
  86. package/dist/interfaces/rest/routes/search.d.ts +2 -2
  87. package/dist/interfaces/rest/routes/search.d.ts.map +1 -1
  88. package/dist/interfaces/rest/routes/search.js +2 -2
  89. package/dist/interfaces/rest/routes/webhooks.d.ts +2 -2
  90. package/dist/interfaces/rest/routes/webhooks.d.ts.map +1 -1
  91. package/dist/interfaces/rest/routes/webhooks.js +2 -2
  92. package/dist/interfaces/rest/schemas/admin-jobs.js +1 -1
  93. package/dist/interfaces/rest/schemas/carts.d.ts +1 -1
  94. package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -1
  95. package/dist/interfaces/rest/schemas/carts.js +3 -3
  96. package/dist/interfaces/rest/schemas/catalog.js +3 -3
  97. package/dist/interfaces/rest/schemas/checkout.js +1 -1
  98. package/dist/interfaces/rest/schemas/customer-portal.js +2 -2
  99. package/dist/interfaces/rest/schemas/inventory.d.ts +1 -1
  100. package/dist/interfaces/rest/schemas/inventory.d.ts.map +1 -1
  101. package/dist/interfaces/rest/schemas/inventory.js +2 -2
  102. package/dist/interfaces/rest/schemas/media.js +1 -1
  103. package/dist/interfaces/rest/schemas/orders.js +2 -2
  104. package/dist/interfaces/rest/schemas/pricing.d.ts +1 -1
  105. package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -1
  106. package/dist/interfaces/rest/schemas/pricing.js +2 -2
  107. package/dist/interfaces/rest/schemas/promotions.d.ts +1 -1
  108. package/dist/interfaces/rest/schemas/promotions.d.ts.map +1 -1
  109. package/dist/interfaces/rest/schemas/promotions.js +2 -2
  110. package/dist/interfaces/rest/schemas/responses.js +5 -5
  111. package/dist/interfaces/rest/schemas/search.js +1 -1
  112. package/dist/interfaces/rest/schemas/webhooks.js +1 -1
  113. package/dist/interfaces/rest/utils.d.ts +2 -2
  114. package/dist/interfaces/rest/utils.d.ts.map +1 -1
  115. package/dist/interfaces/rest/utils.js +2 -2
  116. package/dist/interfaces/rest/webhook-router.d.ts +1 -1
  117. package/dist/interfaces/rest/webhook-router.d.ts.map +1 -1
  118. package/dist/kernel/compensation/executor.d.ts +2 -2
  119. package/dist/kernel/compensation/executor.d.ts.map +1 -1
  120. package/dist/kernel/compensation/types.d.ts +3 -3
  121. package/dist/kernel/compensation/types.d.ts.map +1 -1
  122. package/dist/kernel/database/drizzle-db.d.ts +1 -1
  123. package/dist/kernel/database/drizzle-db.d.ts.map +1 -1
  124. package/dist/kernel/database/drizzle-db.js +1 -1
  125. package/dist/kernel/database/migrate.d.ts +2 -2
  126. package/dist/kernel/database/migrate.d.ts.map +1 -1
  127. package/dist/kernel/database/migrate.js +1 -1
  128. package/dist/kernel/database/schema.d.ts +13 -13
  129. package/dist/kernel/database/schema.d.ts.map +1 -1
  130. package/dist/kernel/database/schema.js +13 -13
  131. package/dist/kernel/database/tx-context.d.ts +2 -2
  132. package/dist/kernel/database/tx-context.d.ts.map +1 -1
  133. package/dist/kernel/error-mapper.js +1 -1
  134. package/dist/kernel/factory/repository-factory.d.ts +2 -2
  135. package/dist/kernel/factory/repository-factory.d.ts.map +1 -1
  136. package/dist/kernel/factory/repository-factory.js +1 -1
  137. package/dist/kernel/hooks/create-context.d.ts +4 -4
  138. package/dist/kernel/hooks/create-context.d.ts.map +1 -1
  139. package/dist/kernel/hooks/create-context.js +1 -1
  140. package/dist/kernel/hooks/executor.d.ts +1 -1
  141. package/dist/kernel/hooks/executor.d.ts.map +1 -1
  142. package/dist/kernel/hooks/types.d.ts +3 -3
  143. package/dist/kernel/hooks/types.d.ts.map +1 -1
  144. package/dist/kernel/http-error.d.ts +1 -1
  145. package/dist/kernel/http-error.d.ts.map +1 -1
  146. package/dist/kernel/jobs/drizzle-adapter.d.ts +3 -3
  147. package/dist/kernel/jobs/drizzle-adapter.d.ts.map +1 -1
  148. package/dist/kernel/jobs/drizzle-adapter.js +2 -2
  149. package/dist/kernel/jobs/runner.d.ts +3 -3
  150. package/dist/kernel/jobs/runner.d.ts.map +1 -1
  151. package/dist/kernel/jobs/runner.js +1 -1
  152. package/dist/kernel/jobs/schema.js +1 -1
  153. package/dist/kernel/jobs/types.d.ts +2 -2
  154. package/dist/kernel/jobs/types.d.ts.map +1 -1
  155. package/dist/kernel/local-api.d.ts +21 -21
  156. package/dist/kernel/local-api.d.ts.map +1 -1
  157. package/dist/kernel/plugin/manifest.d.ts +1 -1
  158. package/dist/kernel/plugin/manifest.d.ts.map +1 -1
  159. package/dist/kernel/query/executor.d.ts +1 -1
  160. package/dist/kernel/query/executor.d.ts.map +1 -1
  161. package/dist/kernel/query/executor.js +1 -1
  162. package/dist/kernel/result.d.ts +1 -1
  163. package/dist/kernel/result.d.ts.map +1 -1
  164. package/dist/kernel/state-machine/machine.js +1 -1
  165. package/dist/modules/analytics/drizzle-adapter.d.ts +3 -3
  166. package/dist/modules/analytics/drizzle-adapter.d.ts.map +1 -1
  167. package/dist/modules/analytics/drizzle-adapter.js +2 -2
  168. package/dist/modules/analytics/models.d.ts +1 -1
  169. package/dist/modules/analytics/models.d.ts.map +1 -1
  170. package/dist/modules/analytics/repository/index.d.ts +1 -1
  171. package/dist/modules/analytics/repository/index.d.ts.map +1 -1
  172. package/dist/modules/analytics/service.d.ts +4 -4
  173. package/dist/modules/analytics/service.d.ts.map +1 -1
  174. package/dist/modules/analytics/service.js +2 -2
  175. package/dist/modules/analytics/types.d.ts +1 -1
  176. package/dist/modules/analytics/types.d.ts.map +1 -1
  177. package/dist/modules/audit/hooks.d.ts +1 -1
  178. package/dist/modules/audit/hooks.d.ts.map +1 -1
  179. package/dist/modules/audit/schema.js +1 -1
  180. package/dist/modules/audit/service.d.ts +4 -4
  181. package/dist/modules/audit/service.d.ts.map +1 -1
  182. package/dist/modules/audit/service.js +2 -2
  183. package/dist/modules/cart/access.d.ts +2 -2
  184. package/dist/modules/cart/access.d.ts.map +1 -1
  185. package/dist/modules/cart/matcher.d.ts +1 -1
  186. package/dist/modules/cart/matcher.d.ts.map +1 -1
  187. package/dist/modules/cart/repository/index.d.ts +3 -3
  188. package/dist/modules/cart/repository/index.d.ts.map +1 -1
  189. package/dist/modules/cart/repository/index.js +1 -1
  190. package/dist/modules/cart/schema.js +2 -2
  191. package/dist/modules/cart/service.d.ts +10 -10
  192. package/dist/modules/cart/service.d.ts.map +1 -1
  193. package/dist/modules/cart/service.js +8 -8
  194. package/dist/modules/catalog/repository/index.d.ts +3 -3
  195. package/dist/modules/catalog/repository/index.d.ts.map +1 -1
  196. package/dist/modules/catalog/repository/index.js +1 -1
  197. package/dist/modules/catalog/schema.js +1 -1
  198. package/dist/modules/catalog/service.d.ts +9 -9
  199. package/dist/modules/catalog/service.d.ts.map +1 -1
  200. package/dist/modules/catalog/service.js +8 -8
  201. package/dist/modules/customers/repository/index.d.ts +3 -3
  202. package/dist/modules/customers/repository/index.d.ts.map +1 -1
  203. package/dist/modules/customers/repository/index.js +1 -1
  204. package/dist/modules/customers/schema.js +1 -1
  205. package/dist/modules/customers/service.d.ts +4 -4
  206. package/dist/modules/customers/service.d.ts.map +1 -1
  207. package/dist/modules/customers/service.js +3 -3
  208. package/dist/modules/fulfillment/repository/index.d.ts +3 -3
  209. package/dist/modules/fulfillment/repository/index.d.ts.map +1 -1
  210. package/dist/modules/fulfillment/repository/index.js +1 -1
  211. package/dist/modules/fulfillment/schema.js +2 -2
  212. package/dist/modules/fulfillment/service.d.ts +6 -6
  213. package/dist/modules/fulfillment/service.d.ts.map +1 -1
  214. package/dist/modules/fulfillment/service.js +4 -4
  215. package/dist/modules/fulfillment/types.d.ts +2 -2
  216. package/dist/modules/fulfillment/types.d.ts.map +1 -1
  217. package/dist/modules/inventory/repository/index.d.ts +3 -3
  218. package/dist/modules/inventory/repository/index.d.ts.map +1 -1
  219. package/dist/modules/inventory/repository/index.js +1 -1
  220. package/dist/modules/inventory/schema.js +2 -2
  221. package/dist/modules/inventory/service.d.ts +9 -9
  222. package/dist/modules/inventory/service.d.ts.map +1 -1
  223. package/dist/modules/inventory/service.js +8 -8
  224. package/dist/modules/media/adapter.d.ts +1 -1
  225. package/dist/modules/media/adapter.d.ts.map +1 -1
  226. package/dist/modules/media/repository/index.d.ts +3 -3
  227. package/dist/modules/media/repository/index.d.ts.map +1 -1
  228. package/dist/modules/media/repository/index.js +1 -1
  229. package/dist/modules/media/schema.js +2 -2
  230. package/dist/modules/media/service.d.ts +6 -6
  231. package/dist/modules/media/service.d.ts.map +1 -1
  232. package/dist/modules/media/service.js +4 -4
  233. package/dist/modules/orders/repository/index.d.ts +3 -3
  234. package/dist/modules/orders/repository/index.d.ts.map +1 -1
  235. package/dist/modules/orders/repository/index.js +1 -1
  236. package/dist/modules/orders/schema.js +2 -2
  237. package/dist/modules/orders/service.d.ts +8 -8
  238. package/dist/modules/orders/service.d.ts.map +1 -1
  239. package/dist/modules/orders/service.js +9 -9
  240. package/dist/modules/orders/stale-order-cleanup.d.ts +1 -1
  241. package/dist/modules/orders/stale-order-cleanup.d.ts.map +1 -1
  242. package/dist/modules/orders/stale-order-cleanup.js +1 -1
  243. package/dist/modules/organization/service.d.ts +1 -1
  244. package/dist/modules/organization/service.d.ts.map +1 -1
  245. package/dist/modules/organization/service.js +1 -1
  246. package/dist/modules/payments/adapter.d.ts +1 -1
  247. package/dist/modules/payments/adapter.d.ts.map +1 -1
  248. package/dist/modules/payments/repository/index.d.ts +1 -1
  249. package/dist/modules/payments/repository/index.d.ts.map +1 -1
  250. package/dist/modules/payments/service.d.ts +3 -3
  251. package/dist/modules/payments/service.d.ts.map +1 -1
  252. package/dist/modules/payments/service.js +2 -2
  253. package/dist/modules/pricing/repository/index.d.ts +3 -3
  254. package/dist/modules/pricing/repository/index.d.ts.map +1 -1
  255. package/dist/modules/pricing/repository/index.js +1 -1
  256. package/dist/modules/pricing/schema.js +2 -2
  257. package/dist/modules/pricing/service.d.ts +7 -7
  258. package/dist/modules/pricing/service.d.ts.map +1 -1
  259. package/dist/modules/pricing/service.js +3 -3
  260. package/dist/modules/promotions/repository/index.d.ts +3 -3
  261. package/dist/modules/promotions/repository/index.d.ts.map +1 -1
  262. package/dist/modules/promotions/repository/index.js +1 -1
  263. package/dist/modules/promotions/schema.js +1 -1
  264. package/dist/modules/promotions/service.d.ts +8 -8
  265. package/dist/modules/promotions/service.d.ts.map +1 -1
  266. package/dist/modules/promotions/service.js +3 -3
  267. package/dist/modules/search/adapter.d.ts +1 -1
  268. package/dist/modules/search/adapter.d.ts.map +1 -1
  269. package/dist/modules/search/hooks.d.ts +1 -1
  270. package/dist/modules/search/hooks.d.ts.map +1 -1
  271. package/dist/modules/search/repository/index.d.ts +1 -1
  272. package/dist/modules/search/repository/index.d.ts.map +1 -1
  273. package/dist/modules/search/service.d.ts +4 -4
  274. package/dist/modules/search/service.d.ts.map +1 -1
  275. package/dist/modules/search/service.js +2 -2
  276. package/dist/modules/shipping/calculator.d.ts +3 -3
  277. package/dist/modules/shipping/calculator.d.ts.map +1 -1
  278. package/dist/modules/shipping/repository/index.d.ts +1 -1
  279. package/dist/modules/shipping/repository/index.d.ts.map +1 -1
  280. package/dist/modules/shipping/service.d.ts +5 -5
  281. package/dist/modules/shipping/service.d.ts.map +1 -1
  282. package/dist/modules/shipping/service.js +2 -2
  283. package/dist/modules/tax/adapter.d.ts +1 -1
  284. package/dist/modules/tax/adapter.d.ts.map +1 -1
  285. package/dist/modules/tax/repository/index.d.ts +1 -1
  286. package/dist/modules/tax/repository/index.d.ts.map +1 -1
  287. package/dist/modules/tax/service.d.ts +2 -2
  288. package/dist/modules/tax/service.d.ts.map +1 -1
  289. package/dist/modules/tax/service.js +2 -2
  290. package/dist/modules/webhooks/hook.d.ts +1 -1
  291. package/dist/modules/webhooks/hook.d.ts.map +1 -1
  292. package/dist/modules/webhooks/repository/index.d.ts +3 -3
  293. package/dist/modules/webhooks/repository/index.d.ts.map +1 -1
  294. package/dist/modules/webhooks/repository/index.js +1 -1
  295. package/dist/modules/webhooks/schema.js +1 -1
  296. package/dist/modules/webhooks/service.d.ts +4 -4
  297. package/dist/modules/webhooks/service.d.ts.map +1 -1
  298. package/dist/modules/webhooks/service.js +3 -3
  299. package/dist/modules/webhooks/tasks.d.ts +1 -1
  300. package/dist/modules/webhooks/tasks.d.ts.map +1 -1
  301. package/dist/modules/webhooks/tasks.js +1 -1
  302. package/dist/modules/webhooks/worker.d.ts +1 -1
  303. package/dist/modules/webhooks/worker.d.ts.map +1 -1
  304. package/dist/modules/webhooks/worker.js +2 -2
  305. package/dist/runtime/commerce.d.ts +9 -9
  306. package/dist/runtime/commerce.d.ts.map +1 -1
  307. package/dist/runtime/commerce.js +5 -5
  308. package/dist/runtime/kernel.d.ts +21 -21
  309. package/dist/runtime/kernel.d.ts.map +1 -1
  310. package/dist/runtime/kernel.js +41 -41
  311. package/dist/runtime/logger.d.ts +1 -1
  312. package/dist/runtime/logger.d.ts.map +1 -1
  313. package/dist/runtime/server.d.ts +6 -6
  314. package/dist/runtime/server.d.ts.map +1 -1
  315. package/dist/runtime/server.js +8 -6
  316. package/dist/runtime/shutdown.d.ts +1 -1
  317. package/dist/runtime/shutdown.d.ts.map +1 -1
  318. package/dist/test-utils/create-pglite-adapter.d.ts +2 -2
  319. package/dist/test-utils/create-pglite-adapter.d.ts.map +1 -1
  320. package/dist/test-utils/create-pglite-adapter.js +3 -3
  321. package/dist/test-utils/create-plugin-test-app.d.ts +3 -3
  322. package/dist/test-utils/create-plugin-test-app.d.ts.map +1 -1
  323. package/dist/test-utils/create-plugin-test-app.js +4 -4
  324. package/dist/test-utils/create-repository-test-harness.d.ts +2 -2
  325. package/dist/test-utils/create-repository-test-harness.d.ts.map +1 -1
  326. package/dist/test-utils/create-repository-test-harness.js +2 -2
  327. package/dist/test-utils/create-test-config.d.ts +1 -1
  328. package/dist/test-utils/create-test-config.d.ts.map +1 -1
  329. package/dist/test-utils/create-test-config.js +4 -4
  330. package/dist/test-utils/create-test-kernel.d.ts +2 -2
  331. package/dist/test-utils/create-test-kernel.d.ts.map +1 -1
  332. package/dist/test-utils/create-test-kernel.js +2 -2
  333. package/dist/test-utils/create-test-plugin-context.d.ts +2 -2
  334. package/dist/test-utils/create-test-plugin-context.d.ts.map +1 -1
  335. package/dist/test-utils/create-test-plugin-context.js +3 -3
  336. package/dist/test-utils/rest-api-test-utils.d.ts +4 -4
  337. package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -1
  338. package/dist/test-utils/rest-api-test-utils.js +8 -8
  339. package/dist/test-utils/test-actors.d.ts +1 -1
  340. package/dist/test-utils/test-actors.d.ts.map +1 -1
  341. package/dist/test-utils/typed-hooks.d.ts +2 -2
  342. package/dist/test-utils/typed-hooks.d.ts.map +1 -1
  343. package/dist/types/commerce-types.d.ts +5 -5
  344. package/dist/types/commerce-types.d.ts.map +1 -1
  345. package/dist/utils/logger.d.ts +1 -1
  346. package/dist/utils/logger.d.ts.map +1 -1
  347. package/package.json +17 -9
  348. package/src/auth/access.ts +1 -1
  349. package/src/auth/auth-schema.ts +3 -3
  350. package/src/auth/middleware.ts +43 -14
  351. package/src/auth/org.ts +1 -1
  352. package/src/auth/permissions.ts +2 -2
  353. package/src/auth/setup.ts +18 -14
  354. package/src/auth/system-actor.ts +2 -2
  355. package/src/config/defaults.ts +1 -1
  356. package/src/config/define-config.ts +3 -3
  357. package/src/config/types.ts +11 -11
  358. package/src/hooks/checkout-completion.ts +4 -4
  359. package/src/hooks/checkout.ts +8 -8
  360. package/src/hooks/order-emails.ts +1 -1
  361. package/src/index.ts +83 -83
  362. package/src/interfaces/mcp/context-enrichment.ts +3 -3
  363. package/src/interfaces/mcp/server.ts +6 -6
  364. package/src/interfaces/mcp/transport.ts +3 -3
  365. package/src/interfaces/rest/customer-portal.ts +6 -6
  366. package/src/interfaces/rest/index.ts +15 -15
  367. package/src/interfaces/rest/router.ts +5 -5
  368. package/src/interfaces/rest/routes/admin-jobs.ts +5 -5
  369. package/src/interfaces/rest/routes/audit.ts +4 -4
  370. package/src/interfaces/rest/routes/carts.ts +4 -4
  371. package/src/interfaces/rest/routes/catalog.ts +5 -5
  372. package/src/interfaces/rest/routes/checkout.ts +11 -11
  373. package/src/interfaces/rest/routes/inventory.ts +3 -3
  374. package/src/interfaces/rest/routes/media.ts +4 -4
  375. package/src/interfaces/rest/routes/orders.ts +3 -3
  376. package/src/interfaces/rest/routes/payments.ts +3 -3
  377. package/src/interfaces/rest/routes/pricing.ts +3 -3
  378. package/src/interfaces/rest/routes/promotions.ts +4 -4
  379. package/src/interfaces/rest/routes/search.ts +3 -3
  380. package/src/interfaces/rest/routes/webhooks.ts +3 -3
  381. package/src/interfaces/rest/schemas/admin-jobs.ts +1 -1
  382. package/src/interfaces/rest/schemas/carts.ts +3 -3
  383. package/src/interfaces/rest/schemas/catalog.ts +3 -3
  384. package/src/interfaces/rest/schemas/checkout.ts +1 -1
  385. package/src/interfaces/rest/schemas/customer-portal.ts +2 -2
  386. package/src/interfaces/rest/schemas/inventory.ts +2 -2
  387. package/src/interfaces/rest/schemas/media.ts +1 -1
  388. package/src/interfaces/rest/schemas/orders.ts +2 -2
  389. package/src/interfaces/rest/schemas/pricing.ts +2 -2
  390. package/src/interfaces/rest/schemas/promotions.ts +2 -2
  391. package/src/interfaces/rest/schemas/responses.ts +5 -5
  392. package/src/interfaces/rest/schemas/search.ts +1 -1
  393. package/src/interfaces/rest/schemas/webhooks.ts +1 -1
  394. package/src/interfaces/rest/utils.ts +4 -4
  395. package/src/interfaces/rest/webhook-router.ts +1 -1
  396. package/src/kernel/compensation/executor.ts +2 -2
  397. package/src/kernel/compensation/types.ts +3 -3
  398. package/src/kernel/database/drizzle-db.ts +1 -1
  399. package/src/kernel/database/migrate.ts +2 -2
  400. package/src/kernel/database/schema.ts +13 -13
  401. package/src/kernel/database/tx-context.ts +2 -2
  402. package/src/kernel/error-mapper.ts +1 -1
  403. package/src/kernel/factory/repository-factory.ts +3 -3
  404. package/src/kernel/hooks/create-context.ts +5 -5
  405. package/src/kernel/hooks/executor.ts +1 -1
  406. package/src/kernel/hooks/types.ts +3 -3
  407. package/src/kernel/http-error.ts +1 -1
  408. package/src/kernel/jobs/drizzle-adapter.ts +5 -5
  409. package/src/kernel/jobs/runner.ts +4 -4
  410. package/src/kernel/jobs/schema.ts +1 -1
  411. package/src/kernel/jobs/types.ts +2 -2
  412. package/src/kernel/local-api.ts +4 -4
  413. package/src/kernel/plugin/manifest.ts +1 -1
  414. package/src/kernel/query/executor.ts +2 -2
  415. package/src/kernel/result.ts +1 -1
  416. package/src/kernel/state-machine/machine.ts +1 -1
  417. package/src/modules/analytics/drizzle-adapter.ts +4 -4
  418. package/src/modules/analytics/models.ts +1 -1
  419. package/src/modules/analytics/repository/index.ts +1 -1
  420. package/src/modules/analytics/service.ts +5 -5
  421. package/src/modules/analytics/types.ts +1 -1
  422. package/src/modules/audit/hooks.ts +3 -3
  423. package/src/modules/audit/schema.ts +1 -1
  424. package/src/modules/audit/service.ts +5 -5
  425. package/src/modules/cart/access.ts +2 -2
  426. package/src/modules/cart/matcher.ts +1 -1
  427. package/src/modules/cart/repository/index.ts +3 -3
  428. package/src/modules/cart/schema.ts +2 -2
  429. package/src/modules/cart/service.ts +17 -17
  430. package/src/modules/catalog/repository/index.ts +3 -3
  431. package/src/modules/catalog/schema.ts +1 -1
  432. package/src/modules/catalog/service.ts +16 -16
  433. package/src/modules/customers/repository/index.ts +3 -3
  434. package/src/modules/customers/schema.ts +1 -1
  435. package/src/modules/customers/service.ts +6 -6
  436. package/src/modules/fulfillment/repository/index.ts +3 -3
  437. package/src/modules/fulfillment/schema.ts +2 -2
  438. package/src/modules/fulfillment/service.ts +9 -9
  439. package/src/modules/fulfillment/types.ts +2 -2
  440. package/src/modules/inventory/repository/index.ts +3 -3
  441. package/src/modules/inventory/schema.ts +2 -2
  442. package/src/modules/inventory/service.ts +16 -16
  443. package/src/modules/media/adapter.ts +1 -1
  444. package/src/modules/media/repository/index.ts +3 -3
  445. package/src/modules/media/schema.ts +2 -2
  446. package/src/modules/media/service.ts +9 -9
  447. package/src/modules/orders/repository/index.ts +3 -3
  448. package/src/modules/orders/schema.ts +2 -2
  449. package/src/modules/orders/service.ts +15 -15
  450. package/src/modules/orders/stale-order-cleanup.ts +2 -2
  451. package/src/modules/organization/service.ts +2 -2
  452. package/src/modules/payments/adapter.ts +1 -1
  453. package/src/modules/payments/repository/index.ts +1 -1
  454. package/src/modules/payments/service.ts +3 -3
  455. package/src/modules/pricing/repository/index.ts +3 -3
  456. package/src/modules/pricing/schema.ts +2 -2
  457. package/src/modules/pricing/service.ts +9 -9
  458. package/src/modules/promotions/repository/index.ts +3 -3
  459. package/src/modules/promotions/schema.ts +1 -1
  460. package/src/modules/promotions/service.ts +10 -10
  461. package/src/modules/search/adapter.ts +1 -1
  462. package/src/modules/search/hooks.ts +2 -2
  463. package/src/modules/search/repository/index.ts +1 -1
  464. package/src/modules/search/service.ts +5 -5
  465. package/src/modules/shipping/calculator.ts +3 -3
  466. package/src/modules/shipping/repository/index.ts +1 -1
  467. package/src/modules/shipping/service.ts +5 -5
  468. package/src/modules/tax/adapter.ts +1 -1
  469. package/src/modules/tax/repository/index.ts +1 -1
  470. package/src/modules/tax/service.ts +3 -3
  471. package/src/modules/webhooks/hook.ts +1 -1
  472. package/src/modules/webhooks/repository/index.ts +3 -3
  473. package/src/modules/webhooks/schema.ts +1 -1
  474. package/src/modules/webhooks/service.ts +6 -6
  475. package/src/modules/webhooks/tasks.ts +3 -3
  476. package/src/modules/webhooks/worker.ts +3 -3
  477. package/src/runtime/commerce.ts +11 -11
  478. package/src/runtime/kernel.ts +45 -45
  479. package/src/runtime/logger.ts +1 -1
  480. package/src/runtime/server.ts +17 -13
  481. package/src/runtime/shutdown.ts +1 -1
  482. package/src/test-utils/create-pglite-adapter.ts +5 -5
  483. package/src/test-utils/create-plugin-test-app.ts +7 -7
  484. package/src/test-utils/create-repository-test-harness.ts +3 -3
  485. package/src/test-utils/create-test-config.ts +6 -6
  486. package/src/test-utils/create-test-kernel.ts +3 -3
  487. package/src/test-utils/create-test-plugin-context.ts +4 -4
  488. package/src/test-utils/rest-api-test-utils.ts +11 -11
  489. package/src/test-utils/test-actors.ts +1 -1
  490. package/src/test-utils/typed-hooks.ts +2 -2
  491. package/src/types/commerce-types.ts +5 -5
  492. package/src/utils/logger.ts +1 -1
  493. package/dist/auth/pos.d.ts +0 -3
  494. package/dist/auth/pos.d.ts.map +0 -1
  495. package/dist/auth/pos.js +0 -62
  496. package/dist/index.js.map +0 -156
  497. package/dist/interfaces/graphql/index.d.ts +0 -4
  498. package/dist/interfaces/graphql/index.d.ts.map +0 -1
  499. package/dist/interfaces/graphql/index.js +0 -415
  500. package/dist/kernel/factory/in-memory-repository-factory.d.ts +0 -20
  501. package/dist/kernel/factory/in-memory-repository-factory.d.ts.map +0 -1
  502. package/dist/kernel/factory/in-memory-repository-factory.js +0 -83
  503. package/dist/kernel/plugin/capability-registry.d.ts +0 -9
  504. package/dist/kernel/plugin/capability-registry.d.ts.map +0 -1
  505. package/dist/kernel/plugin/capability-registry.js +0 -28
  506. package/dist/kernel/plugin/dependency-graph.d.ts +0 -6
  507. package/dist/kernel/plugin/dependency-graph.d.ts.map +0 -1
  508. package/dist/kernel/plugin/dependency-graph.js +0 -55
  509. package/dist/modules/analytics/cubes.d.ts +0 -19
  510. package/dist/modules/analytics/cubes.d.ts.map +0 -1
  511. package/dist/modules/analytics/cubes.js +0 -187
  512. package/dist/modules/cart/repository/in-memory.d.ts +0 -30
  513. package/dist/modules/cart/repository/in-memory.d.ts.map +0 -1
  514. package/dist/modules/cart/repository/in-memory.js +0 -159
  515. package/dist/modules/catalog/repository/in-memory.d.ts +0 -82
  516. package/dist/modules/catalog/repository/in-memory.d.ts.map +0 -1
  517. package/dist/modules/catalog/repository/in-memory.js +0 -444
  518. package/dist/modules/customers/repository/in-memory.d.ts +0 -37
  519. package/dist/modules/customers/repository/in-memory.d.ts.map +0 -1
  520. package/dist/modules/customers/repository/in-memory.js +0 -278
  521. package/dist/modules/fulfillment/repository/in-memory.d.ts +0 -53
  522. package/dist/modules/fulfillment/repository/in-memory.d.ts.map +0 -1
  523. package/dist/modules/fulfillment/repository/in-memory.js +0 -327
  524. package/dist/modules/inventory/repository/in-memory.d.ts +0 -51
  525. package/dist/modules/inventory/repository/in-memory.d.ts.map +0 -1
  526. package/dist/modules/inventory/repository/in-memory.js +0 -281
  527. package/dist/modules/media/repository/in-memory.d.ts +0 -26
  528. package/dist/modules/media/repository/in-memory.d.ts.map +0 -1
  529. package/dist/modules/media/repository/in-memory.js +0 -145
  530. package/dist/modules/orders/repository/in-memory.d.ts +0 -40
  531. package/dist/modules/orders/repository/in-memory.d.ts.map +0 -1
  532. package/dist/modules/orders/repository/in-memory.js +0 -245
  533. package/dist/modules/pricing/repository/in-memory.d.ts +0 -25
  534. package/dist/modules/pricing/repository/in-memory.d.ts.map +0 -1
  535. package/dist/modules/pricing/repository/in-memory.js +0 -288
  536. package/dist/modules/promotions/repository/in-memory.d.ts +0 -32
  537. package/dist/modules/promotions/repository/in-memory.d.ts.map +0 -1
  538. package/dist/modules/promotions/repository/in-memory.js +0 -227
  539. package/dist/modules/webhooks/repository/in-memory.d.ts +0 -31
  540. package/dist/modules/webhooks/repository/in-memory.d.ts.map +0 -1
  541. package/dist/modules/webhooks/repository/in-memory.js +0 -187
  542. package/dist/runtime/state-manager.d.ts +0 -14
  543. package/dist/runtime/state-manager.d.ts.map +0 -1
  544. package/dist/runtime/state-manager.js +0 -84
  545. package/dist/runtime/state-repository.d.ts +0 -13
  546. package/dist/runtime/state-repository.d.ts.map +0 -1
  547. package/dist/runtime/state-repository.js +0 -160
  548. package/dist/runtime/state.d.ts +0 -382
  549. package/dist/runtime/state.d.ts.map +0 -1
  550. package/dist/runtime/state.js +0 -37
  551. package/dist/runtime/store.d.ts +0 -382
  552. package/dist/runtime/store.d.ts.map +0 -1
  553. package/dist/runtime/store.js +0 -37
  554. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,7 +1,7 @@
1
1
  import { OpenAPIHono } from "@hono/zod-openapi";
2
- import type { Kernel } from "../../../runtime/kernel";
3
- import { createWebhookEndpointRoute, listWebhookEndpointsRoute, deleteWebhookEndpointRoute } from "../schemas/webhooks";
4
- import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils";
2
+ import type { Kernel } from "../../../runtime/kernel.js";
3
+ import { createWebhookEndpointRoute, listWebhookEndpointsRoute, deleteWebhookEndpointRoute } from "../schemas/webhooks.js";
4
+ import { type AppEnv, mapErrorToResponse, mapErrorToStatus, requirePerm } from "../utils.js";
5
5
 
6
6
  export function webhookRoutes(kernel: Kernel) {
7
7
  const router = new OpenAPIHono<AppEnv>();
@@ -1,5 +1,5 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { JobListResponse } from "./responses";
2
+ import { JobListResponse } from "./responses.js";
3
3
 
4
4
  // ─── Route Definitions ──────────────────────────────────────────────────────
5
5
 
@@ -1,11 +1,11 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses, UuidParamSchema, DeletedResponseSchema } from "./shared";
3
- import { CartResponse } from "./responses";
2
+ import { ErrorSchema, errorResponses, UuidParamSchema, DeletedResponseSchema } from "./shared.js";
3
+ import { CartResponse } from "./responses.js";
4
4
  import {
5
5
  CreateCartBodySchema,
6
6
  AddCartItemBodySchema,
7
7
  UpdateCartItemQuantityBodySchema,
8
- } from "../../../modules/cart/schemas";
8
+ } from "../../../modules/cart/schemas.js";
9
9
 
10
10
  export { CreateCartBodySchema, AddCartItemBodySchema, UpdateCartItemQuantityBodySchema };
11
11
 
@@ -1,6 +1,6 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { errorResponses } from "./shared";
3
- import { CatalogEntityResponse, CatalogEntityListResponse } from "./responses";
2
+ import { errorResponses } from "./shared.js";
3
+ import { CatalogEntityResponse, CatalogEntityListResponse } from "./responses.js";
4
4
  import {
5
5
  CreateEntityBodySchema,
6
6
  UpdateEntityBodySchema,
@@ -13,7 +13,7 @@ import {
13
13
  CreateOptionValueBodySchema,
14
14
  CreateVariantBodySchema,
15
15
  GenerateVariantsBodySchema,
16
- } from "../../../modules/catalog/schemas";
16
+ } from "../../../modules/catalog/schemas.js";
17
17
 
18
18
  // ─── Response Schemas ───────────────────────────────────────────────────────
19
19
 
@@ -1,5 +1,5 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
3
 
4
4
  // ─── Request Schema ──────────────────────────────────────────────────────────
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { errorResponses } from "./shared";
3
- import { CustomerResponse, OrderResponse, OrderListResponse, CustomerAddressListResponse, CartResponse } from "./responses";
2
+ import { errorResponses } from "./shared.js";
3
+ import { CustomerResponse, OrderResponse, OrderListResponse, CustomerAddressListResponse, CartResponse } from "./responses.js";
4
4
 
5
5
  const GenericDataResponse = z.object({ data: z.record(z.string(), z.unknown()) });
6
6
 
@@ -1,9 +1,9 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
3
 
4
4
  // ─── Request Schemas ─────────────────────────────────────────────────────────
5
5
 
6
- import { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema } from "../../../modules/inventory/schemas";
6
+ import { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema } from "../../../modules/inventory/schemas.js";
7
7
  export { InventoryAdjustBodySchema, InventoryReserveBodySchema, InventoryReleaseBodySchema };
8
8
 
9
9
  export const CreateWarehouseBodySchema = z.object({
@@ -1,5 +1,5 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
3
 
4
4
  // ─── Request Schema ──────────────────────────────────────────────────────────
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
3
- import { OrderResponse, OrderListResponse } from "./responses";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
+ import { OrderResponse, OrderListResponse } from "./responses.js";
4
4
 
5
5
  // ─── Request Schemas ────────────────────────────────────────────────────────
6
6
 
@@ -1,9 +1,9 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
3
 
4
4
  // ─── Request Schemas ────────────────────────────────────────────────────────
5
5
 
6
- import { SetBasePriceBodySchema, CreateModifierBodySchema } from "../../../modules/pricing/schemas";
6
+ import { SetBasePriceBodySchema, CreateModifierBodySchema } from "../../../modules/pricing/schemas.js";
7
7
  export { SetBasePriceBodySchema, CreateModifierBodySchema };
8
8
 
9
9
  // ─── Response Schemas ───────────────────────────────────────────────────────
@@ -1,9 +1,9 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses, UuidParamSchema } from "./shared";
2
+ import { ErrorSchema, errorResponses, UuidParamSchema } from "./shared.js";
3
3
 
4
4
  // ─── Request Schemas ────────────────────────────────────────────────────────
5
5
 
6
- import { CreatePromotionBodySchema } from "../../../modules/promotions/schemas";
6
+ import { CreatePromotionBodySchema } from "../../../modules/promotions/schemas.js";
7
7
  export { CreatePromotionBodySchema };
8
8
 
9
9
  export const ValidatePromotionBodySchema = z.object({
@@ -9,11 +9,11 @@
9
9
 
10
10
  import { createSelectSchema } from "drizzle-zod";
11
11
  import { z } from "@hono/zod-openapi";
12
- import { orders, orderLineItems } from "../../../modules/orders/schema";
13
- import { carts, cartLineItems } from "../../../modules/cart/schema";
14
- import { customers, customerAddresses } from "../../../modules/customers/schema";
15
- import { sellableEntities } from "../../../modules/catalog/schema";
16
- import { commerceJobs } from "../../../kernel/jobs/schema";
12
+ import { orders, orderLineItems } from "../../../modules/orders/schema.js";
13
+ import { carts, cartLineItems } from "../../../modules/cart/schema.js";
14
+ import { customers, customerAddresses } from "../../../modules/customers/schema.js";
15
+ import { sellableEntities } from "../../../modules/catalog/schema.js";
16
+ import { commerceJobs } from "../../../kernel/jobs/schema.js";
17
17
 
18
18
  // ─── Orders ──────────────────────────────────────────────────────────────────
19
19
 
@@ -1,5 +1,5 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { CatalogEntitySchema } from "./responses";
2
+ import { CatalogEntitySchema } from "./responses.js";
3
3
 
4
4
  // ─── Route Definitions ──────────────────────────────────────────────────────
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { z, createRoute } from "@hono/zod-openapi";
2
- import { ErrorSchema, errorResponses } from "./shared";
2
+ import { ErrorSchema, errorResponses } from "./shared.js";
3
3
 
4
4
  // ─── Request Schema ──────────────────────────────────────────────────────────
5
5
 
@@ -1,7 +1,7 @@
1
- import type { CommerceError } from "../../kernel/errors";
2
- import { mapErrorToStatus } from "../../kernel/error-mapper";
3
- import { toCommerceError } from "../../kernel/errors";
4
- import type { Actor } from "../../auth/types";
1
+ import type { CommerceError } from "../../kernel/errors.js";
2
+ import { mapErrorToStatus } from "../../kernel/error-mapper.js";
3
+ import { toCommerceError } from "../../kernel/errors.js";
4
+ import type { Actor } from "../../auth/types.js";
5
5
 
6
6
  /**
7
7
  * Shared Hono environment type for all sub-routers.
@@ -27,7 +27,7 @@
27
27
  */
28
28
 
29
29
  import { Hono } from "hono";
30
- import type { Kernel } from "../../runtime/kernel";
30
+ import type { Kernel } from "../../runtime/kernel.js";
31
31
 
32
32
  export interface WebhookRouterResult {
33
33
  /** Raw Hono app — mount routes on this. No UC auth middleware attached. */
@@ -1,5 +1,5 @@
1
- import type { CompensationContext, Step } from "./types";
2
- import type { Result } from "../result";
1
+ import type { CompensationContext, Step } from "./types.js";
2
+ import type { Result } from "../result.js";
3
3
 
4
4
  /**
5
5
  * AnyStep erases the output type parameter so that heterogeneous step
@@ -1,6 +1,6 @@
1
- import type { TxContext } from "../database/tx-context";
2
- import type { HookContext } from "../hooks/types";
3
- import type { Result } from "../result";
1
+ import type { TxContext } from "../database/tx-context.js";
2
+ import type { HookContext } from "../hooks/types.js";
3
+ import type { Result } from "../result.js";
4
4
 
5
5
  /**
6
6
  * CompensationContext carries the transaction and hook context into
@@ -15,7 +15,7 @@
15
15
  */
16
16
 
17
17
  import type { PgDatabase, PgQueryResultHKT } from "drizzle-orm/pg-core";
18
- import * as schema from "./schema";
18
+ import * as schema from "./schema.js";
19
19
 
20
20
  /**
21
21
  * Combined schema type for type inference
@@ -20,8 +20,8 @@
20
20
  * });
21
21
  */
22
22
 
23
- import type { CommerceConfig } from "../../config/types";
24
- import * as schema from "./schema";
23
+ import type { CommerceConfig } from "../../config/types.js";
24
+ import * as schema from "./schema.js";
25
25
 
26
26
  /**
27
27
  * Returns the combined Drizzle schema object with all table definitions.
@@ -10,40 +10,40 @@
10
10
  */
11
11
 
12
12
  // Auth (Better Auth generated tables)
13
- export * from "../../auth/auth-schema";
13
+ export * from "../../auth/auth-schema.js";
14
14
 
15
15
  // Catalog module
16
- export * from "../../modules/catalog/schema";
16
+ export * from "../../modules/catalog/schema.js";
17
17
 
18
18
  // Inventory module
19
- export * from "../../modules/inventory/schema";
19
+ export * from "../../modules/inventory/schema.js";
20
20
 
21
21
  // Cart module
22
- export * from "../../modules/cart/schema";
22
+ export * from "../../modules/cart/schema.js";
23
23
 
24
24
  // Orders module
25
- export * from "../../modules/orders/schema";
25
+ export * from "../../modules/orders/schema.js";
26
26
 
27
27
  // Customers module
28
- export * from "../../modules/customers/schema";
28
+ export * from "../../modules/customers/schema.js";
29
29
 
30
30
  // Pricing module
31
- export * from "../../modules/pricing/schema";
31
+ export * from "../../modules/pricing/schema.js";
32
32
 
33
33
  // Promotions module
34
- export * from "../../modules/promotions/schema";
34
+ export * from "../../modules/promotions/schema.js";
35
35
 
36
36
  // Media module
37
- export * from "../../modules/media/schema";
37
+ export * from "../../modules/media/schema.js";
38
38
 
39
39
  // Webhooks module
40
- export * from "../../modules/webhooks/schema";
40
+ export * from "../../modules/webhooks/schema.js";
41
41
 
42
42
  // Fulfillment module
43
- export * from "../../modules/fulfillment/schema";
43
+ export * from "../../modules/fulfillment/schema.js";
44
44
 
45
45
  // Jobs (kernel)
46
- export * from "../jobs/schema";
46
+ export * from "../jobs/schema.js";
47
47
 
48
48
  // Audit module
49
- export * from "../../modules/audit/schema";
49
+ export * from "../../modules/audit/schema.js";
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import type { Actor } from "../../auth/types";
3
- import type { DatabaseAdapter } from "./adapter";
2
+ import type { Actor } from "../../auth/types.js";
3
+ import type { DatabaseAdapter } from "./adapter.js";
4
4
 
5
5
  export interface TxContext<TTx = unknown> {
6
6
  tx: TTx;
@@ -1,4 +1,4 @@
1
- import { toCommerceError } from "./errors";
1
+ import { toCommerceError } from "./errors.js";
2
2
  import type { ContentfulStatusCode } from "hono/utils/http-status";
3
3
 
4
4
  const statusByCode: Record<string, ContentfulStatusCode> = {
@@ -11,9 +11,9 @@ import {
11
11
  } from "drizzle-orm";
12
12
  import type { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core";
13
13
  import { PgTable } from "drizzle-orm/pg-core";
14
- import type { TxContext } from "../database/tx-context";
15
- import type { DrizzleDatabase, DbOrTx } from "../database/drizzle-db";
16
- import { CommerceNotFoundError } from "../errors";
14
+ import type { TxContext } from "../database/tx-context.js";
15
+ import type { DrizzleDatabase, DbOrTx } from "../database/drizzle-db.js";
16
+ import { CommerceNotFoundError } from "../errors.js";
17
17
 
18
18
  /**
19
19
  * Filter type — partial record of column values to match with eq().
@@ -1,9 +1,9 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import type { Actor } from "../../auth/types";
3
- import type { JobsAdapter } from "../jobs/adapter";
4
- import { NullJobsAdapter } from "../jobs/adapter";
5
- import type { PluginDb } from "../database/plugin-types";
6
- import type { HookContext, HookOrigin, Logger, ServiceContainer } from "./types";
2
+ import type { Actor } from "../../auth/types.js";
3
+ import type { JobsAdapter } from "../jobs/adapter.js";
4
+ import { NullJobsAdapter } from "../jobs/adapter.js";
5
+ import type { PluginDb } from "../database/plugin-types.js";
6
+ import type { HookContext, HookOrigin, Logger, ServiceContainer } from "./types.js";
7
7
 
8
8
  export interface CreateHookContextArgs {
9
9
  actor: Actor | null;
@@ -1,4 +1,4 @@
1
- import type { AfterHook, BeforeHook, HookContext, HookOperation } from "./types";
1
+ import type { AfterHook, BeforeHook, HookContext, HookOperation } from "./types.js";
2
2
 
3
3
  export interface HookError {
4
4
  hookName: string;
@@ -1,6 +1,6 @@
1
- import type { Actor } from "../../auth/types";
2
- import type { JobsAdapter } from "../jobs/adapter";
3
- import type { PluginDb } from "../database/plugin-types";
1
+ import type { Actor } from "../../auth/types.js";
2
+ import type { JobsAdapter } from "../jobs/adapter.js";
3
+ import type { PluginDb } from "../database/plugin-types.js";
4
4
 
5
5
  export type HookOperation =
6
6
  | "create"
@@ -17,7 +17,7 @@
17
17
  * - Everything else --> 400
18
18
  */
19
19
 
20
- import type { PluginResultErr } from "./result";
20
+ import type { PluginResultErr } from "./result.js";
21
21
 
22
22
  export interface HttpErrorResponse {
23
23
  status: 400 | 403 | 404 | 409 | 422;
@@ -1,9 +1,9 @@
1
1
  import { eq, and } from "drizzle-orm";
2
- import type { DrizzleDatabase } from "../database/drizzle-db";
3
- import type { TaskDefinition } from "./types";
4
- import type { JobsAdapter, EnqueueOptions } from "./adapter";
5
- import { DEFAULT_ORG_ID } from "../../auth/org";
6
- import { commerceJobs } from "./schema";
2
+ import type { DrizzleDatabase } from "../database/drizzle-db.js";
3
+ import type { TaskDefinition } from "./types.js";
4
+ import type { JobsAdapter, EnqueueOptions } from "./adapter.js";
5
+ import { DEFAULT_ORG_ID } from "../../auth/org.js";
6
+ import { commerceJobs } from "./schema.js";
7
7
 
8
8
  /**
9
9
  * PostgreSQL-backed job queue adapter using the application's own database.
@@ -1,8 +1,8 @@
1
1
  import { eq, and, sql } from "drizzle-orm";
2
- import type { DrizzleDatabase } from "../database/drizzle-db";
3
- import type { Logger, ServiceContainer } from "../hooks/types";
4
- import type { TaskDefinition } from "./types";
5
- import { commerceJobs } from "./schema";
2
+ import type { DrizzleDatabase } from "../database/drizzle-db.js";
3
+ import type { Logger, ServiceContainer } from "../hooks/types.js";
4
+ import type { TaskDefinition } from "./types.js";
5
+ import { commerceJobs } from "./schema.js";
6
6
 
7
7
  export interface RunPendingJobsArgs {
8
8
  db: DrizzleDatabase;
@@ -7,7 +7,7 @@ import {
7
7
  timestamp,
8
8
  index,
9
9
  } from "drizzle-orm/pg-core";
10
- import { organization } from "../../auth/auth-schema";
10
+ import { organization } from "../../auth/auth-schema.js";
11
11
 
12
12
  export const commerceJobs = pgTable("commerce_jobs", {
13
13
  id: uuid("id").primaryKey().defaultRandom(),
@@ -1,5 +1,5 @@
1
- import type { Logger, ServiceContainer } from "../hooks/types";
2
- import type { DrizzleDatabase } from "../database/drizzle-db";
1
+ import type { Logger, ServiceContainer } from "../hooks/types.js";
2
+ import type { DrizzleDatabase } from "../database/drizzle-db.js";
3
3
 
4
4
  export interface TaskContext {
5
5
  logger: Logger;
@@ -1,6 +1,6 @@
1
- import type { Actor } from "../auth/types";
2
- import type { Kernel } from "../runtime/kernel";
3
- import type { TxContext } from "./database/tx-context";
1
+ import type { Actor } from "../auth/types.js";
2
+ import type { Kernel } from "../runtime/kernel.js";
3
+ import type { TxContext } from "./database/tx-context.js";
4
4
 
5
5
  /**
6
6
  * Proxy-based Local API — the Payload-style programmatic interface.
@@ -13,7 +13,7 @@ import type { TxContext } from "./database/tx-context";
13
13
  *
14
14
  * ```typescript
15
15
  * import { createCommerce } from "@unifiedcommerce/core";
16
- * import config from "./commerce.config";
16
+ * import config from "./commerce.config.js";
17
17
  *
18
18
  * const commerce = await createCommerce(config);
19
19
  *
@@ -5,7 +5,7 @@ import type {
5
5
  CommerceConfig,
6
6
  CommercePlugin,
7
7
  MCPTool,
8
- } from "../../config/types";
8
+ } from "../../config/types.js";
9
9
 
10
10
  // ─── Plugin Logger ────────────────────────────────────────────────────
11
11
 
@@ -1,9 +1,9 @@
1
- import { CommerceNotFoundError } from "../errors";
1
+ import { CommerceNotFoundError } from "../errors.js";
2
2
  import type {
3
3
  QueryRegistry,
4
4
  EntityDefinition,
5
5
  RelationDefinition,
6
- } from "./registry";
6
+ } from "./registry.js";
7
7
 
8
8
  export interface QueryInput {
9
9
  entity: string;
@@ -1,4 +1,4 @@
1
- import type { CommerceError } from "./errors";
1
+ import type { CommerceError } from "./errors.js";
2
2
 
3
3
  export type Result<T, E = CommerceError> =
4
4
  | { ok: true; value: T; meta?: Record<string, unknown> }
@@ -1,4 +1,4 @@
1
- import { CommerceInvalidTransitionError } from "../errors";
1
+ import { CommerceInvalidTransitionError } from "../errors.js";
2
2
 
3
3
  export interface StateDefinition<TState extends string> {
4
4
  states: readonly TState[];
@@ -1,7 +1,7 @@
1
1
  import { sql, type SQL } from "drizzle-orm";
2
- import type { DrizzleDatabase } from "../../kernel/database/drizzle-db";
3
- import { CommerceValidationError } from "../../kernel/errors";
4
- import { Err, Ok, type Result } from "../../kernel/result";
2
+ import type { DrizzleDatabase } from "../../kernel/database/drizzle-db.js";
3
+ import { CommerceValidationError } from "../../kernel/errors.js";
4
+ import { Err, Ok, type Result } from "../../kernel/result.js";
5
5
  import type {
6
6
  AnalyticsAdapter,
7
7
  AnalyticsFilter,
@@ -12,7 +12,7 @@ import type {
12
12
  AnalyticsQueryResult,
13
13
  AnalyticsScope,
14
14
  AnalyticsTimeDimension,
15
- } from "./types";
15
+ } from "./types.js";
16
16
 
17
17
  // ─── Date Range Parsing ──────────────────────────────────────────────────────
18
18
 
@@ -1,4 +1,4 @@
1
- import type { AnalyticsModel } from "./types";
1
+ import type { AnalyticsModel } from "./types.js";
2
2
 
3
3
  /**
4
4
  * Built-in analytics model definitions for the 4 core tables.
@@ -1,4 +1,4 @@
1
- import type { TxContext } from "../../../kernel/database/tx-context";
1
+ import type { TxContext } from "../../../kernel/database/tx-context.js";
2
2
 
3
3
  export interface AnalyticsRepository {
4
4
  // RFC-002 scaffold: module repositories become the only persistence boundary.
@@ -6,9 +6,9 @@
6
6
  * (DrizzleAnalyticsAdapter — always on, built into core).
7
7
  */
8
8
 
9
- import type { CommerceConfig } from "../../config/types";
10
- import { CommerceValidationError } from "../../kernel/errors";
11
- import { Err, Ok, type Result } from "../../kernel/result";
9
+ import type { CommerceConfig } from "../../config/types.js";
10
+ import { CommerceValidationError } from "../../kernel/errors.js";
11
+ import { Err, Ok, type Result } from "../../kernel/result.js";
12
12
  import type {
13
13
  AnalyticsAdapter,
14
14
  AnalyticsMeta,
@@ -17,7 +17,7 @@ import type {
17
17
  AnalyticsQueryParams,
18
18
  AnalyticsQueryResult,
19
19
  AnalyticsScope,
20
- } from "./types";
20
+ } from "./types.js";
21
21
 
22
22
  // Re-export types for backwards compatibility
23
23
  export type {
@@ -26,7 +26,7 @@ export type {
26
26
  AnalyticsQueryParams,
27
27
  AnalyticsModelDefinition,
28
28
  AnalyticsMeta,
29
- } from "./types";
29
+ } from "./types.js";
30
30
 
31
31
  export interface AnalyticsServiceDeps {
32
32
  adapter: AnalyticsAdapter;
@@ -1,4 +1,4 @@
1
- import type { Result } from "../../kernel/result";
1
+ import type { Result } from "../../kernel/result.js";
2
2
 
3
3
  // ─── Query Params (unchanged from existing API) ─────────────────────────────
4
4
 
@@ -1,6 +1,6 @@
1
- import type { AfterHook } from "../../kernel/hooks/types";
2
- import type { HookHandler } from "../../kernel/hooks/registry";
3
- import type { AuditService } from "./service";
1
+ import type { AfterHook } from "../../kernel/hooks/types.js";
2
+ import type { HookHandler } from "../../kernel/hooks/registry.js";
3
+ import type { AuditService } from "./service.js";
4
4
 
5
5
  /**
6
6
  * Creates an after-hook that records an audit entry for the operation.
@@ -6,7 +6,7 @@ import {
6
6
  timestamp,
7
7
  index,
8
8
  } from "drizzle-orm/pg-core";
9
- import { organization } from "../../auth/auth-schema";
9
+ import { organization } from "../../auth/auth-schema.js";
10
10
 
11
11
  export const auditLog = pgTable(
12
12
  "commerce_audit_log",
@@ -1,10 +1,10 @@
1
1
  import { eq, and, desc, gte, lte } from "drizzle-orm";
2
2
  import type { InferSelectModel } from "drizzle-orm";
3
- import type { DrizzleDatabase } from "../../kernel/database/drizzle-db";
4
- import type { TxContext } from "../../kernel/database/tx-context";
5
- import type { HookContext } from "../../kernel/hooks/types";
6
- import { resolveOrgId } from "../../auth/org";
7
- import { auditLog } from "./schema";
3
+ import type { DrizzleDatabase } from "../../kernel/database/drizzle-db.js";
4
+ import type { TxContext } from "../../kernel/database/tx-context.js";
5
+ import type { HookContext } from "../../kernel/hooks/types.js";
6
+ import { resolveOrgId } from "../../auth/org.js";
7
+ import { auditLog } from "./schema.js";
8
8
 
9
9
  export type AuditEntry = InferSelectModel<typeof auditLog>;
10
10
 
@@ -1,5 +1,5 @@
1
- import type { Actor } from "../../auth/types";
2
- import type { Cart } from "./repository";
1
+ import type { Actor } from "../../auth/types.js";
2
+ import type { Cart } from "./repository/index.js";
3
3
 
4
4
  /**
5
5
  * Determines whether an actor can access a cart.
@@ -1,4 +1,4 @@
1
- import type { CartLineItem } from "./repository";
1
+ import type { CartLineItem } from "./repository/index.js";
2
2
 
3
3
  /**
4
4
  * Determines whether a new item matches an existing cart line item.
@@ -1,10 +1,10 @@
1
1
  import { eq, and, lt } from "drizzle-orm";
2
- import type { TxContext } from "../../../kernel/database/tx-context";
2
+ import type { TxContext } from "../../../kernel/database/tx-context.js";
3
3
  import type {
4
4
  DrizzleDatabase,
5
5
  DbOrTx,
6
- } from "../../../kernel/database/drizzle-db";
7
- import { carts, cartLineItems } from "../schema";
6
+ } from "../../../kernel/database/drizzle-db.js";
7
+ import { carts, cartLineItems } from "../schema.js";
8
8
 
9
9
  // Infer types from Drizzle schema
10
10
  export type Cart = typeof carts.$inferSelect;