@classytic/cart 0.1.0 → 0.1.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 (45) hide show
  1. package/README.md +1 -10
  2. package/dist/{cart-event-catalog-BIbi2Q_n.d.mts → cart-event-catalog-BxDJhtTM.d.mts} +1 -1
  3. package/dist/cart.error-BwWy4RlY.mjs +27 -0
  4. package/dist/{create-cart-q3CXxPP7.mjs → create-cart-B4l61iKT.mjs} +589 -543
  5. package/dist/domain/errors/index.d.mts +1 -1
  6. package/dist/domain/errors/index.mjs +5 -3
  7. package/dist/domain/events/index.d.mts +2 -2
  8. package/dist/domain/events/index.mjs +2 -2
  9. package/dist/domain/index.d.mts +11 -11
  10. package/dist/domain/index.mjs +11 -10
  11. package/dist/domain/ports/index.d.mts +2 -2
  12. package/dist/domain/ports/index.mjs +1 -1
  13. package/dist/domain/saga/index.d.mts +2 -2
  14. package/dist/domain/saga/index.mjs +2 -3
  15. package/dist/engine/index.d.mts +1 -1
  16. package/dist/engine/index.mjs +1 -1
  17. package/dist/{errors-CHR9RlbY.mjs → errors-DzR7Pipp.mjs} +27 -27
  18. package/dist/{index-Doi5uzux.d.mts → index-BFBUk6qT.d.mts} +68 -68
  19. package/dist/index.d.mts +73 -58
  20. package/dist/index.mjs +50 -49
  21. package/dist/{internal-event-bus-IkUfQJxn.d.mts → internal-event-bus-DKcDteh-.d.mts} +109 -84
  22. package/dist/{line-item.entity-B3M_i-pw.d.mts → kind-registry-C1n47C7h.d.mts} +52 -52
  23. package/dist/{kind-registry-Ba4PO4WC.mjs → kind-registry-C99h_-8t.mjs} +1 -1
  24. package/dist/{kind.error-CCjTB6kW.mjs → kind.error-DIaJpdUb.mjs} +2 -27
  25. package/dist/kinds/index.d.mts +1 -1
  26. package/dist/kinds/index.mjs +1 -1
  27. package/dist/{line-kind-Bndo6IS8.d.mts → line-kind-Ck3fVXzG.d.mts} +1 -1
  28. package/dist/{cart-event-catalog-BOP9aDhL.mjs → outbox-store-CWW8ppxS.mjs} +31 -31
  29. package/dist/{not-found.error-B6WYnAjX.mjs → price-changed.error-C-wGVcfc.mjs} +23 -47
  30. package/dist/{idempotency-record.entity-DIFXjN1V.d.mts → reservation.entity-b5cZ1ojx.d.mts} +72 -72
  31. package/dist/{shipping.bridge-DD4A_O0O.d.mts → shipping.bridge-CmQFTgSE.d.mts} +82 -82
  32. package/dist/state-transition.error-2fRLh3p0.mjs +26 -0
  33. package/dist/{saga-step-fn-Cyob38iU.d.mts → state-transitions-X_Eix5Iw.d.mts} +31 -30
  34. package/dist/state-transitions-e4z3Yhxb.mjs +61 -0
  35. package/dist/{bundle.kind-BdgnyKZt.d.mts → variant.kind-9P1DXdXu.d.mts} +51 -51
  36. package/dist/{bundle.kind-DFydSxV_.mjs → variant.kind-DfEh2oku.mjs} +133 -133
  37. package/package.json +14 -7
  38. package/dist/saga-steps-B27LI7xp.mjs +0 -27
  39. package/dist/state-transitions-CpJpZZTK.mjs +0 -21
  40. /package/dist/{cart-status.vo-2iisZGhb.d.mts → cart-status.vo-CNJw4aaB.d.mts} +0 -0
  41. /package/dist/{domain-event-DHNkz15G.mjs → domain-event-CIEORKF6.mjs} +0 -0
  42. /package/dist/{id.port-C3rlDAKP.mjs → id.port-BhbFZJPm.mjs} +0 -0
  43. /package/dist/{id.port-DPXLrqb2.d.mts → id.port-C7ygWLRU.d.mts} +0 -0
  44. /package/dist/{index-DEHBdV_z.d.mts → index-2Ag-54t8.d.mts} +0 -0
  45. /package/dist/{outbox-store-CTWz9pvG.d.mts → outbox-store-CBt9fSYh.d.mts} +0 -0
package/README.md CHANGED
@@ -85,9 +85,6 @@ Cart no longer provisions its own durable Mongo outbox by default.
85
85
  - If a write runs with `ctx.session` and no `outbox` is configured, cart throws
86
86
  instead of pretending the event was written durably.
87
87
 
88
- For the exact host contract and examples, see
89
- [`docs/host-integration.md`](./docs/host-integration.md).
90
-
91
88
  ## Zero framework dependencies
92
89
 
93
90
  `peerDependencies`: `mongoose`, `@classytic/mongokit`.
@@ -99,11 +96,5 @@ backend framework.
99
96
  ## Tests
100
97
 
101
98
  ```bash
102
- npm test # 84 tests, 12 files, ~1.5s
99
+ npm test
103
100
  ```
104
-
105
- See [`tests/scenarios/`](./tests/scenarios/) for per-industry examples
106
- and [`tests/integration/`](./tests/integration/) for real-Mongo proofs.
107
-
108
- See [`CLAUDE.md`](./CLAUDE.md) for the agent guide and
109
- [`MIGRATION.md`](./MIGRATION.md) for be-prod migration steps.
@@ -1,4 +1,4 @@
1
- import { _ as CartEventMeta, b as CartEventName, h as CartDomainEvent } from "./outbox-store-CTWz9pvG.mjs";
1
+ import { _ as CartEventMeta, b as CartEventName, h as CartDomainEvent } from "./outbox-store-CBt9fSYh.mjs";
2
2
 
3
3
  //#region src/domain/events/event-schema.d.ts
4
4
  /**
@@ -0,0 +1,27 @@
1
+ //#region src/domain/errors/cart.error.ts
2
+ var CartError = class extends Error {
3
+ /** Optional structured context for logging / debugging. */
4
+ context;
5
+ constructor(message, context) {
6
+ super(message);
7
+ this.name = new.target.name;
8
+ this.context = context;
9
+ Object.setPrototypeOf(this, new.target.prototype);
10
+ }
11
+ /**
12
+ * Serialize to a wire-safe shape. Suitable for HTTP error bodies and
13
+ * structured logging. Never includes stack frames.
14
+ */
15
+ toJSON() {
16
+ return {
17
+ name: this.name,
18
+ code: this.code,
19
+ category: this.category,
20
+ message: this.message,
21
+ retryable: this.retryable,
22
+ context: this.context
23
+ };
24
+ }
25
+ };
26
+ //#endregion
27
+ export { CartError as t };