@metamask-previews/bridge-status-controller 73.1.0-preview-e12e4a38f → 74.0.0-preview-4f9d41d

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 (126) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/bridge-status-controller.cjs +167 -21
  3. package/dist/bridge-status-controller.cjs.map +1 -1
  4. package/dist/bridge-status-controller.d.cts +6 -1
  5. package/dist/bridge-status-controller.d.cts.map +1 -1
  6. package/dist/bridge-status-controller.d.mts +6 -1
  7. package/dist/bridge-status-controller.d.mts.map +1 -1
  8. package/dist/bridge-status-controller.mjs +167 -21
  9. package/dist/bridge-status-controller.mjs.map +1 -1
  10. package/dist/constants.cjs +1 -0
  11. package/dist/constants.cjs.map +1 -1
  12. package/dist/constants.d.cts.map +1 -1
  13. package/dist/constants.d.mts.map +1 -1
  14. package/dist/constants.mjs +1 -0
  15. package/dist/constants.mjs.map +1 -1
  16. package/dist/index.cjs +12 -6
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +3 -1
  19. package/dist/index.d.cts.map +1 -1
  20. package/dist/index.d.mts +3 -1
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +3 -0
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/quote-status-manager/constants.cjs +181 -0
  25. package/dist/quote-status-manager/constants.cjs.map +1 -0
  26. package/dist/quote-status-manager/constants.d.cts +137 -0
  27. package/dist/quote-status-manager/constants.d.cts.map +1 -0
  28. package/dist/quote-status-manager/constants.d.mts +137 -0
  29. package/dist/quote-status-manager/constants.d.mts.map +1 -0
  30. package/dist/quote-status-manager/constants.mjs +178 -0
  31. package/dist/quote-status-manager/constants.mjs.map +1 -0
  32. package/dist/quote-status-manager/errors.cjs +51 -0
  33. package/dist/quote-status-manager/errors.cjs.map +1 -0
  34. package/dist/quote-status-manager/errors.d.cts +45 -0
  35. package/dist/quote-status-manager/errors.d.cts.map +1 -0
  36. package/dist/quote-status-manager/errors.d.mts +45 -0
  37. package/dist/quote-status-manager/errors.d.mts.map +1 -0
  38. package/dist/quote-status-manager/errors.mjs +46 -0
  39. package/dist/quote-status-manager/errors.mjs.map +1 -0
  40. package/dist/quote-status-manager/quote-status-api-service.cjs +241 -0
  41. package/dist/quote-status-manager/quote-status-api-service.cjs.map +1 -0
  42. package/dist/quote-status-manager/quote-status-api-service.d.cts +93 -0
  43. package/dist/quote-status-manager/quote-status-api-service.d.cts.map +1 -0
  44. package/dist/quote-status-manager/quote-status-api-service.d.mts +93 -0
  45. package/dist/quote-status-manager/quote-status-api-service.d.mts.map +1 -0
  46. package/dist/quote-status-manager/quote-status-api-service.mjs +237 -0
  47. package/dist/quote-status-manager/quote-status-api-service.mjs.map +1 -0
  48. package/dist/quote-status-manager/quote-status-entry-store.cjs +271 -0
  49. package/dist/quote-status-manager/quote-status-entry-store.cjs.map +1 -0
  50. package/dist/quote-status-manager/quote-status-entry-store.d.cts +144 -0
  51. package/dist/quote-status-manager/quote-status-entry-store.d.cts.map +1 -0
  52. package/dist/quote-status-manager/quote-status-entry-store.d.mts +144 -0
  53. package/dist/quote-status-manager/quote-status-entry-store.d.mts.map +1 -0
  54. package/dist/quote-status-manager/quote-status-entry-store.mjs +267 -0
  55. package/dist/quote-status-manager/quote-status-entry-store.mjs.map +1 -0
  56. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.cjs +29 -0
  57. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.cjs.map +1 -0
  58. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.d.cts +32 -0
  59. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.d.cts.map +1 -0
  60. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.d.mts +32 -0
  61. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.d.mts.map +1 -0
  62. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.mjs +25 -0
  63. package/dist/quote-status-manager/quote-status-get-with-retry-outcome.mjs.map +1 -0
  64. package/dist/quote-status-manager/quote-status-state-fsm.cjs +107 -0
  65. package/dist/quote-status-manager/quote-status-state-fsm.cjs.map +1 -0
  66. package/dist/quote-status-manager/quote-status-state-fsm.d.cts +57 -0
  67. package/dist/quote-status-manager/quote-status-state-fsm.d.cts.map +1 -0
  68. package/dist/quote-status-manager/quote-status-state-fsm.d.mts +57 -0
  69. package/dist/quote-status-manager/quote-status-state-fsm.d.mts.map +1 -0
  70. package/dist/quote-status-manager/quote-status-state-fsm.mjs +103 -0
  71. package/dist/quote-status-manager/quote-status-state-fsm.mjs.map +1 -0
  72. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.cjs +27 -0
  73. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.cjs.map +1 -0
  74. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.d.cts +30 -0
  75. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.d.cts.map +1 -0
  76. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.d.mts +30 -0
  77. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.d.mts.map +1 -0
  78. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.mjs +23 -0
  79. package/dist/quote-status-manager/quote-status-update-with-retry-outcome.mjs.map +1 -0
  80. package/dist/quote-status-manager/quotes-status-manager.cjs +477 -0
  81. package/dist/quote-status-manager/quotes-status-manager.cjs.map +1 -0
  82. package/dist/quote-status-manager/quotes-status-manager.d.cts +124 -0
  83. package/dist/quote-status-manager/quotes-status-manager.d.cts.map +1 -0
  84. package/dist/quote-status-manager/quotes-status-manager.d.mts +124 -0
  85. package/dist/quote-status-manager/quotes-status-manager.d.mts.map +1 -0
  86. package/dist/quote-status-manager/quotes-status-manager.mjs +473 -0
  87. package/dist/quote-status-manager/quotes-status-manager.mjs.map +1 -0
  88. package/dist/quote-status-manager/types.cjs +8 -0
  89. package/dist/quote-status-manager/types.cjs.map +1 -0
  90. package/dist/quote-status-manager/types.d.cts +145 -0
  91. package/dist/quote-status-manager/types.d.cts.map +1 -0
  92. package/dist/quote-status-manager/types.d.mts +145 -0
  93. package/dist/quote-status-manager/types.d.mts.map +1 -0
  94. package/dist/quote-status-manager/types.mjs +6 -0
  95. package/dist/quote-status-manager/types.mjs.map +1 -0
  96. package/dist/quote-status-manager/utils.cjs +11 -0
  97. package/dist/quote-status-manager/utils.cjs.map +1 -0
  98. package/dist/quote-status-manager/utils.d.cts +7 -0
  99. package/dist/quote-status-manager/utils.d.cts.map +1 -0
  100. package/dist/quote-status-manager/utils.d.mts +7 -0
  101. package/dist/quote-status-manager/utils.d.mts.map +1 -0
  102. package/dist/quote-status-manager/utils.mjs +7 -0
  103. package/dist/quote-status-manager/utils.mjs.map +1 -0
  104. package/dist/quote-status-manager/validators.cjs +44 -0
  105. package/dist/quote-status-manager/validators.cjs.map +1 -0
  106. package/dist/quote-status-manager/validators.d.cts +172 -0
  107. package/dist/quote-status-manager/validators.d.cts.map +1 -0
  108. package/dist/quote-status-manager/validators.d.mts +172 -0
  109. package/dist/quote-status-manager/validators.d.mts.map +1 -0
  110. package/dist/quote-status-manager/validators.mjs +39 -0
  111. package/dist/quote-status-manager/validators.mjs.map +1 -0
  112. package/dist/types.cjs +2 -0
  113. package/dist/types.cjs.map +1 -1
  114. package/dist/types.d.cts +15 -3
  115. package/dist/types.d.cts.map +1 -1
  116. package/dist/types.d.mts +15 -3
  117. package/dist/types.d.mts.map +1 -1
  118. package/dist/types.mjs +2 -0
  119. package/dist/types.mjs.map +1 -1
  120. package/dist/utils/history.cjs +1 -0
  121. package/dist/utils/history.cjs.map +1 -1
  122. package/dist/utils/history.d.cts.map +1 -1
  123. package/dist/utils/history.d.mts.map +1 -1
  124. package/dist/utils/history.mjs +1 -0
  125. package/dist/utils/history.mjs.map +1 -1
  126. package/package.json +1 -1
@@ -0,0 +1,32 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.cjs";
2
+ import { QuoteStatusGetError } from "./errors.cjs";
3
+ import { QuoteStatusGetResponse } from "./types.cjs";
4
+ /**
5
+ * Result of a retrying quote status fetch
6
+ * ({@link QuoteStatusApiService.getQuoteStatusWithRetry}).
7
+ *
8
+ * Represents how a fetch attempt resolved so callers can branch on the
9
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
10
+ * The discriminating {@link type} indicates whether the fetch was accepted,
11
+ * was interrupted, or exhausted its retries. The optional {@link response}
12
+ * carries the backend quote status payload when the fetch succeeded.
13
+ */
14
+ export declare class QuoteStatusGetWithRetryOutcome {
15
+ /**
16
+ * Discriminant describing how the fetch attempt resolved.
17
+ */
18
+ readonly type: QuoteStatusFetchWithRetryOutcomeType;
19
+ /**
20
+ * Backend quote status payload when the fetch was accepted
21
+ * ({@link QuoteStatusFetchWithRetryOutcomeType.Accepted}).
22
+ */
23
+ readonly response?: QuoteStatusGetResponse;
24
+ readonly error?: QuoteStatusGetError;
25
+ /**
26
+ * @param outcome - The outcome type describing how the fetch resolved.
27
+ * @param response - Optional backend quote status payload when accepted.
28
+ * @param error - Optional quote status fetch error when the outcome is non-retryable.
29
+ */
30
+ constructor(outcome: QuoteStatusFetchWithRetryOutcomeType, response?: QuoteStatusGetResponse, error?: QuoteStatusGetError);
31
+ }
32
+ //# sourceMappingURL=quote-status-get-with-retry-outcome.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-get-with-retry-outcome.d.cts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-get-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AACnE,OAAO,EAAE,mBAAmB,EAAE,qBAAiB;AAC/C,OAAO,EAAE,sBAAsB,EAAE,oBAAgB;AAEjD;;;;;;;;;GASG;AACH,qBAAa,8BAA8B;IACzC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oCAAoC,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAE3C,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAErC;;;;OAIG;gBAED,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,CAAC,EAAE,sBAAsB,EACjC,KAAK,CAAC,EAAE,mBAAmB;CAM9B"}
@@ -0,0 +1,32 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.mjs";
2
+ import { QuoteStatusGetError } from "./errors.mjs";
3
+ import { QuoteStatusGetResponse } from "./types.mjs";
4
+ /**
5
+ * Result of a retrying quote status fetch
6
+ * ({@link QuoteStatusApiService.getQuoteStatusWithRetry}).
7
+ *
8
+ * Represents how a fetch attempt resolved so callers can branch on the
9
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
10
+ * The discriminating {@link type} indicates whether the fetch was accepted,
11
+ * was interrupted, or exhausted its retries. The optional {@link response}
12
+ * carries the backend quote status payload when the fetch succeeded.
13
+ */
14
+ export declare class QuoteStatusGetWithRetryOutcome {
15
+ /**
16
+ * Discriminant describing how the fetch attempt resolved.
17
+ */
18
+ readonly type: QuoteStatusFetchWithRetryOutcomeType;
19
+ /**
20
+ * Backend quote status payload when the fetch was accepted
21
+ * ({@link QuoteStatusFetchWithRetryOutcomeType.Accepted}).
22
+ */
23
+ readonly response?: QuoteStatusGetResponse;
24
+ readonly error?: QuoteStatusGetError;
25
+ /**
26
+ * @param outcome - The outcome type describing how the fetch resolved.
27
+ * @param response - Optional backend quote status payload when accepted.
28
+ * @param error - Optional quote status fetch error when the outcome is non-retryable.
29
+ */
30
+ constructor(outcome: QuoteStatusFetchWithRetryOutcomeType, response?: QuoteStatusGetResponse, error?: QuoteStatusGetError);
31
+ }
32
+ //# sourceMappingURL=quote-status-get-with-retry-outcome.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-get-with-retry-outcome.d.mts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-get-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AACnE,OAAO,EAAE,mBAAmB,EAAE,qBAAiB;AAC/C,OAAO,EAAE,sBAAsB,EAAE,oBAAgB;AAEjD;;;;;;;;;GASG;AACH,qBAAa,8BAA8B;IACzC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oCAAoC,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAE3C,QAAQ,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAErC;;;;OAIG;gBAED,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,CAAC,EAAE,sBAAsB,EACjC,KAAK,CAAC,EAAE,mBAAmB;CAM9B"}
@@ -0,0 +1,25 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.mjs";
2
+ import { QuoteStatusGetError } from "./errors.mjs";
3
+ /**
4
+ * Result of a retrying quote status fetch
5
+ * ({@link QuoteStatusApiService.getQuoteStatusWithRetry}).
6
+ *
7
+ * Represents how a fetch attempt resolved so callers can branch on the
8
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
9
+ * The discriminating {@link type} indicates whether the fetch was accepted,
10
+ * was interrupted, or exhausted its retries. The optional {@link response}
11
+ * carries the backend quote status payload when the fetch succeeded.
12
+ */
13
+ export class QuoteStatusGetWithRetryOutcome {
14
+ /**
15
+ * @param outcome - The outcome type describing how the fetch resolved.
16
+ * @param response - Optional backend quote status payload when accepted.
17
+ * @param error - Optional quote status fetch error when the outcome is non-retryable.
18
+ */
19
+ constructor(outcome, response, error) {
20
+ this.type = outcome;
21
+ this.response = response;
22
+ this.error = error;
23
+ }
24
+ }
25
+ //# sourceMappingURL=quote-status-get-with-retry-outcome.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-get-with-retry-outcome.mjs","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-get-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AACnE,OAAO,EAAE,mBAAmB,EAAE,qBAAiB;AAG/C;;;;;;;;;GASG;AACH,MAAM,OAAO,8BAA8B;IAczC;;;;OAIG;IACH,YACE,OAA6C,EAC7C,QAAiC,EACjC,KAA2B;QAE3B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF","sourcesContent":["import { QuoteStatusFetchWithRetryOutcomeType } from './constants';\nimport { QuoteStatusGetError } from './errors';\nimport { QuoteStatusGetResponse } from './types';\n\n/**\n * Result of a retrying quote status fetch\n * ({@link QuoteStatusApiService.getQuoteStatusWithRetry}).\n *\n * Represents how a fetch attempt resolved so callers can branch on the\n * outcome without having to re-interpret raw HTTP responses or thrown errors.\n * The discriminating {@link type} indicates whether the fetch was accepted,\n * was interrupted, or exhausted its retries. The optional {@link response}\n * carries the backend quote status payload when the fetch succeeded.\n */\nexport class QuoteStatusGetWithRetryOutcome {\n /**\n * Discriminant describing how the fetch attempt resolved.\n */\n readonly type: QuoteStatusFetchWithRetryOutcomeType;\n\n /**\n * Backend quote status payload when the fetch was accepted\n * ({@link QuoteStatusFetchWithRetryOutcomeType.Accepted}).\n */\n readonly response?: QuoteStatusGetResponse;\n\n readonly error?: QuoteStatusGetError;\n\n /**\n * @param outcome - The outcome type describing how the fetch resolved.\n * @param response - Optional backend quote status payload when accepted.\n * @param error - Optional quote status fetch error when the outcome is non-retryable.\n */\n constructor(\n outcome: QuoteStatusFetchWithRetryOutcomeType,\n response?: QuoteStatusGetResponse,\n error?: QuoteStatusGetError,\n ) {\n this.type = outcome;\n this.response = response;\n this.error = error;\n }\n}\n"]}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _QuoteStatusStateFsm_instances, _QuoteStatusStateFsm_state, _QuoteStatusStateFsm_listeners, _QuoteStatusStateFsm_emitStateUpdate;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.QuoteStatusStateFsm = void 0;
16
+ const constants_1 = require("./constants.cjs");
17
+ /**
18
+ * Finite state machine that enforces forward-only quote status transitions.
19
+ */
20
+ class QuoteStatusStateFsm {
21
+ /**
22
+ * Creates a state machine with a default {@link QuoteStatusState.Submitted}
23
+ * state.
24
+ *
25
+ * @param initialState - Optional initial state.
26
+ */
27
+ constructor(initialState = constants_1.QuoteStatusState.Submitted) {
28
+ _QuoteStatusStateFsm_instances.add(this);
29
+ _QuoteStatusStateFsm_state.set(this, void 0);
30
+ _QuoteStatusStateFsm_listeners.set(this, new Set());
31
+ __classPrivateFieldSet(this, _QuoteStatusStateFsm_state, initialState, "f");
32
+ }
33
+ /**
34
+ * Current lifecycle state.
35
+ *
36
+ * @returns The current quote status lifecycle state.
37
+ */
38
+ get state() {
39
+ return __classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f");
40
+ }
41
+ /**
42
+ * Returns whether the current state can transition to the provided next state.
43
+ *
44
+ * @param nextState - Desired next state.
45
+ * @returns `true` if the transition is valid.
46
+ */
47
+ canTransitionTo(nextState) {
48
+ // Seeded persisted state may contain an unknown/legacy value that is not a
49
+ // key in the transition map. Treat any such state as terminal (no allowed
50
+ // transitions) instead of throwing on `undefined.includes(...)`.
51
+ return (constants_1.AllowedQuoteStatusStateTransitions[__classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f")]?.includes(nextState) ??
52
+ false);
53
+ }
54
+ /**
55
+ * Transitions to the provided state if allowed.
56
+ *
57
+ * Emits a state update event when the transition succeeds.
58
+ *
59
+ * @param nextState - Desired next state.
60
+ * @returns `true` if the transition was applied, otherwise `false`.
61
+ */
62
+ transitionTo(nextState) {
63
+ if (!this.canTransitionTo(nextState)) {
64
+ return false;
65
+ }
66
+ const previousState = __classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f");
67
+ __classPrivateFieldSet(this, _QuoteStatusStateFsm_state, nextState, "f");
68
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_instances, "m", _QuoteStatusStateFsm_emitStateUpdate).call(this, { previousState, nextState });
69
+ return true;
70
+ }
71
+ /**
72
+ * Subscribes to state update events.
73
+ *
74
+ * @param listener - Callback invoked on each successful state transition.
75
+ * @returns Unsubscribe function.
76
+ */
77
+ onStateUpdate(listener) {
78
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").add(listener);
79
+ return () => __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").delete(listener);
80
+ }
81
+ /**
82
+ * Removes every subscribed state update listener.
83
+ */
84
+ removeAllListeners() {
85
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").clear();
86
+ }
87
+ /**
88
+ * Serializes the machine to a plain, persistable object.
89
+ *
90
+ * @returns The current lifecycle state wrapped in a plain object.
91
+ */
92
+ toJson() {
93
+ return {
94
+ state: this.state,
95
+ };
96
+ }
97
+ }
98
+ exports.QuoteStatusStateFsm = QuoteStatusStateFsm;
99
+ _QuoteStatusStateFsm_state = new WeakMap(), _QuoteStatusStateFsm_listeners = new WeakMap(), _QuoteStatusStateFsm_instances = new WeakSet(), _QuoteStatusStateFsm_emitStateUpdate = function _QuoteStatusStateFsm_emitStateUpdate(event) {
100
+ // Iterate over a snapshot so that a listener subscribing or unsubscribing
101
+ // (including unsubscribing itself) during emission does not affect the
102
+ // current notification pass.
103
+ for (const listener of [...__classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f")]) {
104
+ listener(event);
105
+ }
106
+ };
107
+ //# sourceMappingURL=quote-status-state-fsm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-state-fsm.cjs","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-state-fsm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAGqB;AAMrB;;GAEG;AACH,MAAa,mBAAmB;IAK9B;;;;;OAKG;IACH,YAAY,eAAiC,4BAAgB,CAAC,SAAS;;QAVvE,6CAAyB;QAEhB,yCAAa,IAAI,GAAG,EAAkC,EAAC;QAS9D,uBAAA,IAAI,8BAAU,YAAY,MAAA,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK;QACP,OAAO,uBAAA,IAAI,kCAAO,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,SAA2B;QACzC,2EAA2E;QAC3E,0EAA0E;QAC1E,iEAAiE;QACjE,OAAO,CACL,8CAAkC,CAAC,uBAAA,IAAI,kCAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;YACpE,KAAK,CACN,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,SAA2B;QACtC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,aAAa,GAAG,uBAAA,IAAI,kCAAO,CAAC;QAClC,uBAAA,IAAI,8BAAU,SAAS,MAAA,CAAC;QACxB,uBAAA,IAAI,4EAAiB,MAArB,IAAI,EAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,QAAwC;QACpD,uBAAA,IAAI,sCAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE,CAAC,uBAAA,IAAI,sCAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,uBAAA,IAAI,sCAAW,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAWD;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AAhGD,kDAgGC;iOAnBkB,KAAkC;IACjD,0EAA0E;IAC1E,uEAAuE;IACvE,6BAA6B;IAC7B,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,uBAAA,IAAI,sCAAW,CAAC,EAAE,CAAC;QAC5C,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import {\n AllowedQuoteStatusStateTransitions,\n QuoteStatusState,\n} from './constants';\nimport type {\n QuoteStatusStateUpdateEvent,\n QuoteStatusStateUpdateListener,\n} from './types';\n\n/**\n * Finite state machine that enforces forward-only quote status transitions.\n */\nexport class QuoteStatusStateFsm {\n #state: QuoteStatusState;\n\n readonly #listeners = new Set<QuoteStatusStateUpdateListener>();\n\n /**\n * Creates a state machine with a default {@link QuoteStatusState.Submitted}\n * state.\n *\n * @param initialState - Optional initial state.\n */\n constructor(initialState: QuoteStatusState = QuoteStatusState.Submitted) {\n this.#state = initialState;\n }\n\n /**\n * Current lifecycle state.\n *\n * @returns The current quote status lifecycle state.\n */\n get state(): QuoteStatusState {\n return this.#state;\n }\n\n /**\n * Returns whether the current state can transition to the provided next state.\n *\n * @param nextState - Desired next state.\n * @returns `true` if the transition is valid.\n */\n canTransitionTo(nextState: QuoteStatusState): boolean {\n // Seeded persisted state may contain an unknown/legacy value that is not a\n // key in the transition map. Treat any such state as terminal (no allowed\n // transitions) instead of throwing on `undefined.includes(...)`.\n return (\n AllowedQuoteStatusStateTransitions[this.#state]?.includes(nextState) ??\n false\n );\n }\n\n /**\n * Transitions to the provided state if allowed.\n *\n * Emits a state update event when the transition succeeds.\n *\n * @param nextState - Desired next state.\n * @returns `true` if the transition was applied, otherwise `false`.\n */\n transitionTo(nextState: QuoteStatusState): boolean {\n if (!this.canTransitionTo(nextState)) {\n return false;\n }\n\n const previousState = this.#state;\n this.#state = nextState;\n this.#emitStateUpdate({ previousState, nextState });\n return true;\n }\n\n /**\n * Subscribes to state update events.\n *\n * @param listener - Callback invoked on each successful state transition.\n * @returns Unsubscribe function.\n */\n onStateUpdate(listener: QuoteStatusStateUpdateListener): () => void {\n this.#listeners.add(listener);\n return () => this.#listeners.delete(listener);\n }\n\n /**\n * Removes every subscribed state update listener.\n */\n removeAllListeners(): void {\n this.#listeners.clear();\n }\n\n #emitStateUpdate(event: QuoteStatusStateUpdateEvent): void {\n // Iterate over a snapshot so that a listener subscribing or unsubscribing\n // (including unsubscribing itself) during emission does not affect the\n // current notification pass.\n for (const listener of [...this.#listeners]) {\n listener(event);\n }\n }\n\n /**\n * Serializes the machine to a plain, persistable object.\n *\n * @returns The current lifecycle state wrapped in a plain object.\n */\n toJson(): { state: QuoteStatusState } {\n return {\n state: this.state,\n };\n }\n}\n"]}
@@ -0,0 +1,57 @@
1
+ import { QuoteStatusState } from "./constants.cjs";
2
+ import type { QuoteStatusStateUpdateListener } from "./types.cjs";
3
+ /**
4
+ * Finite state machine that enforces forward-only quote status transitions.
5
+ */
6
+ export declare class QuoteStatusStateFsm {
7
+ #private;
8
+ /**
9
+ * Creates a state machine with a default {@link QuoteStatusState.Submitted}
10
+ * state.
11
+ *
12
+ * @param initialState - Optional initial state.
13
+ */
14
+ constructor(initialState?: QuoteStatusState);
15
+ /**
16
+ * Current lifecycle state.
17
+ *
18
+ * @returns The current quote status lifecycle state.
19
+ */
20
+ get state(): QuoteStatusState;
21
+ /**
22
+ * Returns whether the current state can transition to the provided next state.
23
+ *
24
+ * @param nextState - Desired next state.
25
+ * @returns `true` if the transition is valid.
26
+ */
27
+ canTransitionTo(nextState: QuoteStatusState): boolean;
28
+ /**
29
+ * Transitions to the provided state if allowed.
30
+ *
31
+ * Emits a state update event when the transition succeeds.
32
+ *
33
+ * @param nextState - Desired next state.
34
+ * @returns `true` if the transition was applied, otherwise `false`.
35
+ */
36
+ transitionTo(nextState: QuoteStatusState): boolean;
37
+ /**
38
+ * Subscribes to state update events.
39
+ *
40
+ * @param listener - Callback invoked on each successful state transition.
41
+ * @returns Unsubscribe function.
42
+ */
43
+ onStateUpdate(listener: QuoteStatusStateUpdateListener): () => void;
44
+ /**
45
+ * Removes every subscribed state update listener.
46
+ */
47
+ removeAllListeners(): void;
48
+ /**
49
+ * Serializes the machine to a plain, persistable object.
50
+ *
51
+ * @returns The current lifecycle state wrapped in a plain object.
52
+ */
53
+ toJson(): {
54
+ state: QuoteStatusState;
55
+ };
56
+ }
57
+ //# sourceMappingURL=quote-status-state-fsm.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-state-fsm.d.cts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-state-fsm.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EACjB,wBAAoB;AACrB,OAAO,KAAK,EAEV,8BAA8B,EAC/B,oBAAgB;AAEjB;;GAEG;AACH,qBAAa,mBAAmB;;IAK9B;;;;;OAKG;gBACS,YAAY,GAAE,gBAA6C;IAIvE;;;;OAIG;IACH,IAAI,KAAK,IAAI,gBAAgB,CAE5B;IAED;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO;IAUrD;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO;IAWlD;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,8BAA8B,GAAG,MAAM,IAAI;IAKnE;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAa1B;;;;OAIG;IACH,MAAM,IAAI;QAAE,KAAK,EAAE,gBAAgB,CAAA;KAAE;CAKtC"}
@@ -0,0 +1,57 @@
1
+ import { QuoteStatusState } from "./constants.mjs";
2
+ import type { QuoteStatusStateUpdateListener } from "./types.mjs";
3
+ /**
4
+ * Finite state machine that enforces forward-only quote status transitions.
5
+ */
6
+ export declare class QuoteStatusStateFsm {
7
+ #private;
8
+ /**
9
+ * Creates a state machine with a default {@link QuoteStatusState.Submitted}
10
+ * state.
11
+ *
12
+ * @param initialState - Optional initial state.
13
+ */
14
+ constructor(initialState?: QuoteStatusState);
15
+ /**
16
+ * Current lifecycle state.
17
+ *
18
+ * @returns The current quote status lifecycle state.
19
+ */
20
+ get state(): QuoteStatusState;
21
+ /**
22
+ * Returns whether the current state can transition to the provided next state.
23
+ *
24
+ * @param nextState - Desired next state.
25
+ * @returns `true` if the transition is valid.
26
+ */
27
+ canTransitionTo(nextState: QuoteStatusState): boolean;
28
+ /**
29
+ * Transitions to the provided state if allowed.
30
+ *
31
+ * Emits a state update event when the transition succeeds.
32
+ *
33
+ * @param nextState - Desired next state.
34
+ * @returns `true` if the transition was applied, otherwise `false`.
35
+ */
36
+ transitionTo(nextState: QuoteStatusState): boolean;
37
+ /**
38
+ * Subscribes to state update events.
39
+ *
40
+ * @param listener - Callback invoked on each successful state transition.
41
+ * @returns Unsubscribe function.
42
+ */
43
+ onStateUpdate(listener: QuoteStatusStateUpdateListener): () => void;
44
+ /**
45
+ * Removes every subscribed state update listener.
46
+ */
47
+ removeAllListeners(): void;
48
+ /**
49
+ * Serializes the machine to a plain, persistable object.
50
+ *
51
+ * @returns The current lifecycle state wrapped in a plain object.
52
+ */
53
+ toJson(): {
54
+ state: QuoteStatusState;
55
+ };
56
+ }
57
+ //# sourceMappingURL=quote-status-state-fsm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-state-fsm.d.mts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-state-fsm.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EACjB,wBAAoB;AACrB,OAAO,KAAK,EAEV,8BAA8B,EAC/B,oBAAgB;AAEjB;;GAEG;AACH,qBAAa,mBAAmB;;IAK9B;;;;;OAKG;gBACS,YAAY,GAAE,gBAA6C;IAIvE;;;;OAIG;IACH,IAAI,KAAK,IAAI,gBAAgB,CAE5B;IAED;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO;IAUrD;;;;;;;OAOG;IACH,YAAY,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO;IAWlD;;;;;OAKG;IACH,aAAa,CAAC,QAAQ,EAAE,8BAA8B,GAAG,MAAM,IAAI;IAKnE;;OAEG;IACH,kBAAkB,IAAI,IAAI;IAa1B;;;;OAIG;IACH,MAAM,IAAI;QAAE,KAAK,EAAE,gBAAgB,CAAA;KAAE;CAKtC"}
@@ -0,0 +1,103 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _QuoteStatusStateFsm_instances, _QuoteStatusStateFsm_state, _QuoteStatusStateFsm_listeners, _QuoteStatusStateFsm_emitStateUpdate;
13
+ import { AllowedQuoteStatusStateTransitions, QuoteStatusState } from "./constants.mjs";
14
+ /**
15
+ * Finite state machine that enforces forward-only quote status transitions.
16
+ */
17
+ export class QuoteStatusStateFsm {
18
+ /**
19
+ * Creates a state machine with a default {@link QuoteStatusState.Submitted}
20
+ * state.
21
+ *
22
+ * @param initialState - Optional initial state.
23
+ */
24
+ constructor(initialState = QuoteStatusState.Submitted) {
25
+ _QuoteStatusStateFsm_instances.add(this);
26
+ _QuoteStatusStateFsm_state.set(this, void 0);
27
+ _QuoteStatusStateFsm_listeners.set(this, new Set());
28
+ __classPrivateFieldSet(this, _QuoteStatusStateFsm_state, initialState, "f");
29
+ }
30
+ /**
31
+ * Current lifecycle state.
32
+ *
33
+ * @returns The current quote status lifecycle state.
34
+ */
35
+ get state() {
36
+ return __classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f");
37
+ }
38
+ /**
39
+ * Returns whether the current state can transition to the provided next state.
40
+ *
41
+ * @param nextState - Desired next state.
42
+ * @returns `true` if the transition is valid.
43
+ */
44
+ canTransitionTo(nextState) {
45
+ // Seeded persisted state may contain an unknown/legacy value that is not a
46
+ // key in the transition map. Treat any such state as terminal (no allowed
47
+ // transitions) instead of throwing on `undefined.includes(...)`.
48
+ return (AllowedQuoteStatusStateTransitions[__classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f")]?.includes(nextState) ??
49
+ false);
50
+ }
51
+ /**
52
+ * Transitions to the provided state if allowed.
53
+ *
54
+ * Emits a state update event when the transition succeeds.
55
+ *
56
+ * @param nextState - Desired next state.
57
+ * @returns `true` if the transition was applied, otherwise `false`.
58
+ */
59
+ transitionTo(nextState) {
60
+ if (!this.canTransitionTo(nextState)) {
61
+ return false;
62
+ }
63
+ const previousState = __classPrivateFieldGet(this, _QuoteStatusStateFsm_state, "f");
64
+ __classPrivateFieldSet(this, _QuoteStatusStateFsm_state, nextState, "f");
65
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_instances, "m", _QuoteStatusStateFsm_emitStateUpdate).call(this, { previousState, nextState });
66
+ return true;
67
+ }
68
+ /**
69
+ * Subscribes to state update events.
70
+ *
71
+ * @param listener - Callback invoked on each successful state transition.
72
+ * @returns Unsubscribe function.
73
+ */
74
+ onStateUpdate(listener) {
75
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").add(listener);
76
+ return () => __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").delete(listener);
77
+ }
78
+ /**
79
+ * Removes every subscribed state update listener.
80
+ */
81
+ removeAllListeners() {
82
+ __classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f").clear();
83
+ }
84
+ /**
85
+ * Serializes the machine to a plain, persistable object.
86
+ *
87
+ * @returns The current lifecycle state wrapped in a plain object.
88
+ */
89
+ toJson() {
90
+ return {
91
+ state: this.state,
92
+ };
93
+ }
94
+ }
95
+ _QuoteStatusStateFsm_state = new WeakMap(), _QuoteStatusStateFsm_listeners = new WeakMap(), _QuoteStatusStateFsm_instances = new WeakSet(), _QuoteStatusStateFsm_emitStateUpdate = function _QuoteStatusStateFsm_emitStateUpdate(event) {
96
+ // Iterate over a snapshot so that a listener subscribing or unsubscribing
97
+ // (including unsubscribing itself) during emission does not affect the
98
+ // current notification pass.
99
+ for (const listener of [...__classPrivateFieldGet(this, _QuoteStatusStateFsm_listeners, "f")]) {
100
+ listener(event);
101
+ }
102
+ };
103
+ //# sourceMappingURL=quote-status-state-fsm.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-state-fsm.mjs","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-state-fsm.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,kCAAkC,EAClC,gBAAgB,EACjB,wBAAoB;AAMrB;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAK9B;;;;;OAKG;IACH,YAAY,eAAiC,gBAAgB,CAAC,SAAS;;QAVvE,6CAAyB;QAEhB,yCAAa,IAAI,GAAG,EAAkC,EAAC;QAS9D,uBAAA,IAAI,8BAAU,YAAY,MAAA,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK;QACP,OAAO,uBAAA,IAAI,kCAAO,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,SAA2B;QACzC,2EAA2E;QAC3E,0EAA0E;QAC1E,iEAAiE;QACjE,OAAO,CACL,kCAAkC,CAAC,uBAAA,IAAI,kCAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;YACpE,KAAK,CACN,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAC,SAA2B;QACtC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,aAAa,GAAG,uBAAA,IAAI,kCAAO,CAAC;QAClC,uBAAA,IAAI,8BAAU,SAAS,MAAA,CAAC;QACxB,uBAAA,IAAI,4EAAiB,MAArB,IAAI,EAAkB,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,QAAwC;QACpD,uBAAA,IAAI,sCAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,OAAO,GAAG,EAAE,CAAC,uBAAA,IAAI,sCAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,uBAAA,IAAI,sCAAW,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAWD;;;;OAIG;IACH,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;iOAnBkB,KAAkC;IACjD,0EAA0E;IAC1E,uEAAuE;IACvE,6BAA6B;IAC7B,KAAK,MAAM,QAAQ,IAAI,CAAC,GAAG,uBAAA,IAAI,sCAAW,CAAC,EAAE,CAAC;QAC5C,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import {\n AllowedQuoteStatusStateTransitions,\n QuoteStatusState,\n} from './constants';\nimport type {\n QuoteStatusStateUpdateEvent,\n QuoteStatusStateUpdateListener,\n} from './types';\n\n/**\n * Finite state machine that enforces forward-only quote status transitions.\n */\nexport class QuoteStatusStateFsm {\n #state: QuoteStatusState;\n\n readonly #listeners = new Set<QuoteStatusStateUpdateListener>();\n\n /**\n * Creates a state machine with a default {@link QuoteStatusState.Submitted}\n * state.\n *\n * @param initialState - Optional initial state.\n */\n constructor(initialState: QuoteStatusState = QuoteStatusState.Submitted) {\n this.#state = initialState;\n }\n\n /**\n * Current lifecycle state.\n *\n * @returns The current quote status lifecycle state.\n */\n get state(): QuoteStatusState {\n return this.#state;\n }\n\n /**\n * Returns whether the current state can transition to the provided next state.\n *\n * @param nextState - Desired next state.\n * @returns `true` if the transition is valid.\n */\n canTransitionTo(nextState: QuoteStatusState): boolean {\n // Seeded persisted state may contain an unknown/legacy value that is not a\n // key in the transition map. Treat any such state as terminal (no allowed\n // transitions) instead of throwing on `undefined.includes(...)`.\n return (\n AllowedQuoteStatusStateTransitions[this.#state]?.includes(nextState) ??\n false\n );\n }\n\n /**\n * Transitions to the provided state if allowed.\n *\n * Emits a state update event when the transition succeeds.\n *\n * @param nextState - Desired next state.\n * @returns `true` if the transition was applied, otherwise `false`.\n */\n transitionTo(nextState: QuoteStatusState): boolean {\n if (!this.canTransitionTo(nextState)) {\n return false;\n }\n\n const previousState = this.#state;\n this.#state = nextState;\n this.#emitStateUpdate({ previousState, nextState });\n return true;\n }\n\n /**\n * Subscribes to state update events.\n *\n * @param listener - Callback invoked on each successful state transition.\n * @returns Unsubscribe function.\n */\n onStateUpdate(listener: QuoteStatusStateUpdateListener): () => void {\n this.#listeners.add(listener);\n return () => this.#listeners.delete(listener);\n }\n\n /**\n * Removes every subscribed state update listener.\n */\n removeAllListeners(): void {\n this.#listeners.clear();\n }\n\n #emitStateUpdate(event: QuoteStatusStateUpdateEvent): void {\n // Iterate over a snapshot so that a listener subscribing or unsubscribing\n // (including unsubscribing itself) during emission does not affect the\n // current notification pass.\n for (const listener of [...this.#listeners]) {\n listener(event);\n }\n }\n\n /**\n * Serializes the machine to a plain, persistable object.\n *\n * @returns The current lifecycle state wrapped in a plain object.\n */\n toJson(): { state: QuoteStatusState } {\n return {\n state: this.state,\n };\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QuoteStatusUpdateWithRetryOutcome = void 0;
4
+ const constants_1 = require("./constants.cjs");
5
+ /**
6
+ * Result of a retrying quote status update
7
+ * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).
8
+ *
9
+ * Represents how an update attempt resolved so callers can branch on the
10
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
11
+ * The discriminating {@link type} indicates whether the update was accepted,
12
+ * hit a non-retryable error, was interrupted, or exhausted its retries. The
13
+ * optional {@link response} carries the backend error payload (when present),
14
+ * which callers use to reconcile local state for non-retryable errors.
15
+ */
16
+ class QuoteStatusUpdateWithRetryOutcome {
17
+ /**
18
+ * @param outcome - The outcome type describing how the update resolved.
19
+ * @param response - Optional backend error response associated with the outcome.
20
+ */
21
+ constructor(outcome, response) {
22
+ this.type = outcome;
23
+ this.response = response;
24
+ }
25
+ }
26
+ exports.QuoteStatusUpdateWithRetryOutcome = QuoteStatusUpdateWithRetryOutcome;
27
+ //# sourceMappingURL=quote-status-update-with-retry-outcome.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-update-with-retry-outcome.cjs","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-update-with-retry-outcome.ts"],"names":[],"mappings":";;;AAAA,+CAAmE;AAGnE;;;;;;;;;;GAUG;AACH,MAAa,iCAAiC;IAY5C;;;OAGG;IACH,YACE,OAA6C,EAC7C,QAAoC;QAEpC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAvBD,8EAuBC","sourcesContent":["import { QuoteStatusFetchWithRetryOutcomeType } from './constants';\nimport { QuoteStatusUpdateResponse } from './types';\n\n/**\n * Result of a retrying quote status update\n * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).\n *\n * Represents how an update attempt resolved so callers can branch on the\n * outcome without having to re-interpret raw HTTP responses or thrown errors.\n * The discriminating {@link type} indicates whether the update was accepted,\n * hit a non-retryable error, was interrupted, or exhausted its retries. The\n * optional {@link response} carries the backend error payload (when present),\n * which callers use to reconcile local state for non-retryable errors.\n */\nexport class QuoteStatusUpdateWithRetryOutcome {\n /**\n * Discriminant describing how the update attempt resolved.\n */\n readonly type: QuoteStatusFetchWithRetryOutcomeType;\n\n /**\n * Backend error response associated with the outcome, when one was returned\n * (typically for {@link QuoteStatusUpdateWithRetryOutcomeType.NonRetryable}).\n */\n readonly response?: QuoteStatusUpdateResponse;\n\n /**\n * @param outcome - The outcome type describing how the update resolved.\n * @param response - Optional backend error response associated with the outcome.\n */\n constructor(\n outcome: QuoteStatusFetchWithRetryOutcomeType,\n response?: QuoteStatusUpdateResponse,\n ) {\n this.type = outcome;\n this.response = response;\n }\n}\n"]}
@@ -0,0 +1,30 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.cjs";
2
+ import { QuoteStatusUpdateResponse } from "./types.cjs";
3
+ /**
4
+ * Result of a retrying quote status update
5
+ * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).
6
+ *
7
+ * Represents how an update attempt resolved so callers can branch on the
8
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
9
+ * The discriminating {@link type} indicates whether the update was accepted,
10
+ * hit a non-retryable error, was interrupted, or exhausted its retries. The
11
+ * optional {@link response} carries the backend error payload (when present),
12
+ * which callers use to reconcile local state for non-retryable errors.
13
+ */
14
+ export declare class QuoteStatusUpdateWithRetryOutcome {
15
+ /**
16
+ * Discriminant describing how the update attempt resolved.
17
+ */
18
+ readonly type: QuoteStatusFetchWithRetryOutcomeType;
19
+ /**
20
+ * Backend error response associated with the outcome, when one was returned
21
+ * (typically for {@link QuoteStatusUpdateWithRetryOutcomeType.NonRetryable}).
22
+ */
23
+ readonly response?: QuoteStatusUpdateResponse;
24
+ /**
25
+ * @param outcome - The outcome type describing how the update resolved.
26
+ * @param response - Optional backend error response associated with the outcome.
27
+ */
28
+ constructor(outcome: QuoteStatusFetchWithRetryOutcomeType, response?: QuoteStatusUpdateResponse);
29
+ }
30
+ //# sourceMappingURL=quote-status-update-with-retry-outcome.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-update-with-retry-outcome.d.cts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-update-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AACnE,OAAO,EAAE,yBAAyB,EAAE,oBAAgB;AAEpD;;;;;;;;;;GAUG;AACH,qBAAa,iCAAiC;IAC5C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oCAAoC,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAE9C;;;OAGG;gBAED,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,CAAC,EAAE,yBAAyB;CAKvC"}
@@ -0,0 +1,30 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.mjs";
2
+ import { QuoteStatusUpdateResponse } from "./types.mjs";
3
+ /**
4
+ * Result of a retrying quote status update
5
+ * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).
6
+ *
7
+ * Represents how an update attempt resolved so callers can branch on the
8
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
9
+ * The discriminating {@link type} indicates whether the update was accepted,
10
+ * hit a non-retryable error, was interrupted, or exhausted its retries. The
11
+ * optional {@link response} carries the backend error payload (when present),
12
+ * which callers use to reconcile local state for non-retryable errors.
13
+ */
14
+ export declare class QuoteStatusUpdateWithRetryOutcome {
15
+ /**
16
+ * Discriminant describing how the update attempt resolved.
17
+ */
18
+ readonly type: QuoteStatusFetchWithRetryOutcomeType;
19
+ /**
20
+ * Backend error response associated with the outcome, when one was returned
21
+ * (typically for {@link QuoteStatusUpdateWithRetryOutcomeType.NonRetryable}).
22
+ */
23
+ readonly response?: QuoteStatusUpdateResponse;
24
+ /**
25
+ * @param outcome - The outcome type describing how the update resolved.
26
+ * @param response - Optional backend error response associated with the outcome.
27
+ */
28
+ constructor(outcome: QuoteStatusFetchWithRetryOutcomeType, response?: QuoteStatusUpdateResponse);
29
+ }
30
+ //# sourceMappingURL=quote-status-update-with-retry-outcome.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-update-with-retry-outcome.d.mts","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-update-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AACnE,OAAO,EAAE,yBAAyB,EAAE,oBAAgB;AAEpD;;;;;;;;;;GAUG;AACH,qBAAa,iCAAiC;IAC5C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,oCAAoC,CAAC;IAEpD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IAE9C;;;OAGG;gBAED,OAAO,EAAE,oCAAoC,EAC7C,QAAQ,CAAC,EAAE,yBAAyB;CAKvC"}
@@ -0,0 +1,23 @@
1
+ import { QuoteStatusFetchWithRetryOutcomeType } from "./constants.mjs";
2
+ /**
3
+ * Result of a retrying quote status update
4
+ * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).
5
+ *
6
+ * Represents how an update attempt resolved so callers can branch on the
7
+ * outcome without having to re-interpret raw HTTP responses or thrown errors.
8
+ * The discriminating {@link type} indicates whether the update was accepted,
9
+ * hit a non-retryable error, was interrupted, or exhausted its retries. The
10
+ * optional {@link response} carries the backend error payload (when present),
11
+ * which callers use to reconcile local state for non-retryable errors.
12
+ */
13
+ export class QuoteStatusUpdateWithRetryOutcome {
14
+ /**
15
+ * @param outcome - The outcome type describing how the update resolved.
16
+ * @param response - Optional backend error response associated with the outcome.
17
+ */
18
+ constructor(outcome, response) {
19
+ this.type = outcome;
20
+ this.response = response;
21
+ }
22
+ }
23
+ //# sourceMappingURL=quote-status-update-with-retry-outcome.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote-status-update-with-retry-outcome.mjs","sourceRoot":"","sources":["../../src/quote-status-manager/quote-status-update-with-retry-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,wBAAoB;AAGnE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,iCAAiC;IAY5C;;;OAGG;IACH,YACE,OAA6C,EAC7C,QAAoC;QAEpC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF","sourcesContent":["import { QuoteStatusFetchWithRetryOutcomeType } from './constants';\nimport { QuoteStatusUpdateResponse } from './types';\n\n/**\n * Result of a retrying quote status update\n * ({@link QuoteStatusApiService.updateQuoteStatusWithRetry}).\n *\n * Represents how an update attempt resolved so callers can branch on the\n * outcome without having to re-interpret raw HTTP responses or thrown errors.\n * The discriminating {@link type} indicates whether the update was accepted,\n * hit a non-retryable error, was interrupted, or exhausted its retries. The\n * optional {@link response} carries the backend error payload (when present),\n * which callers use to reconcile local state for non-retryable errors.\n */\nexport class QuoteStatusUpdateWithRetryOutcome {\n /**\n * Discriminant describing how the update attempt resolved.\n */\n readonly type: QuoteStatusFetchWithRetryOutcomeType;\n\n /**\n * Backend error response associated with the outcome, when one was returned\n * (typically for {@link QuoteStatusUpdateWithRetryOutcomeType.NonRetryable}).\n */\n readonly response?: QuoteStatusUpdateResponse;\n\n /**\n * @param outcome - The outcome type describing how the update resolved.\n * @param response - Optional backend error response associated with the outcome.\n */\n constructor(\n outcome: QuoteStatusFetchWithRetryOutcomeType,\n response?: QuoteStatusUpdateResponse,\n ) {\n this.type = outcome;\n this.response = response;\n }\n}\n"]}