@spine-event-engine/server 2.0.0-snapshot.11

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 (378) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +209 -0
  3. package/REFERENCE.md +760 -0
  4. package/dist/browser/browser-server.d.ts +95 -0
  5. package/dist/browser/browser-server.d.ts.map +1 -0
  6. package/dist/browser/browser-server.js +719 -0
  7. package/dist/browser/browser-server.js.map +1 -0
  8. package/dist/browser/durable-subscription-bindings.d.ts +122 -0
  9. package/dist/browser/durable-subscription-bindings.d.ts.map +1 -0
  10. package/dist/browser/durable-subscription-bindings.js +524 -0
  11. package/dist/browser/durable-subscription-bindings.js.map +1 -0
  12. package/dist/browser/index.d.ts +12 -0
  13. package/dist/browser/index.d.ts.map +1 -0
  14. package/dist/browser/index.js +24 -0
  15. package/dist/browser/index.js.map +1 -0
  16. package/dist/browser/options.d.ts +183 -0
  17. package/dist/browser/options.d.ts.map +1 -0
  18. package/dist/browser/options.js +15 -0
  19. package/dist/browser/options.js.map +1 -0
  20. package/dist/bus/command-bus.d.ts +63 -0
  21. package/dist/bus/command-bus.d.ts.map +1 -0
  22. package/dist/bus/command-bus.js +236 -0
  23. package/dist/bus/command-bus.js.map +1 -0
  24. package/dist/bus/command-dispatcher-registry.d.ts +33 -0
  25. package/dist/bus/command-dispatcher-registry.d.ts.map +1 -0
  26. package/dist/bus/command-dispatcher-registry.js +75 -0
  27. package/dist/bus/command-dispatcher-registry.js.map +1 -0
  28. package/dist/bus/command-dispatcher.d.ts +25 -0
  29. package/dist/bus/command-dispatcher.d.ts.map +1 -0
  30. package/dist/bus/command-dispatcher.js +15 -0
  31. package/dist/bus/command-dispatcher.js.map +1 -0
  32. package/dist/bus/command-errors.d.ts +23 -0
  33. package/dist/bus/command-errors.d.ts.map +1 -0
  34. package/dist/bus/command-errors.js +52 -0
  35. package/dist/bus/command-errors.js.map +1 -0
  36. package/dist/bus/event-bus.d.ts +113 -0
  37. package/dist/bus/event-bus.d.ts.map +1 -0
  38. package/dist/bus/event-bus.js +518 -0
  39. package/dist/bus/event-bus.js.map +1 -0
  40. package/dist/bus/event-dispatcher-origin-schemas.d.ts +17 -0
  41. package/dist/bus/event-dispatcher-origin-schemas.d.ts.map +1 -0
  42. package/dist/bus/event-dispatcher-origin-schemas.js +32 -0
  43. package/dist/bus/event-dispatcher-origin-schemas.js.map +1 -0
  44. package/dist/bus/event-dispatcher-registry.d.ts +48 -0
  45. package/dist/bus/event-dispatcher-registry.d.ts.map +1 -0
  46. package/dist/bus/event-dispatcher-registry.js +176 -0
  47. package/dist/bus/event-dispatcher-registry.js.map +1 -0
  48. package/dist/bus/event-dispatcher.d.ts +48 -0
  49. package/dist/bus/event-dispatcher.d.ts.map +1 -0
  50. package/dist/bus/event-dispatcher.js +15 -0
  51. package/dist/bus/event-dispatcher.js.map +1 -0
  52. package/dist/context/bounded-context.d.ts +592 -0
  53. package/dist/context/bounded-context.d.ts.map +1 -0
  54. package/dist/context/bounded-context.js +1897 -0
  55. package/dist/context/bounded-context.js.map +1 -0
  56. package/dist/context/entity-inbox.d.ts +63 -0
  57. package/dist/context/entity-inbox.d.ts.map +1 -0
  58. package/dist/context/entity-inbox.js +387 -0
  59. package/dist/context/entity-inbox.js.map +1 -0
  60. package/dist/context/local-inbox-handoff.d.ts +248 -0
  61. package/dist/context/local-inbox-handoff.d.ts.map +1 -0
  62. package/dist/context/local-inbox-handoff.js +340 -0
  63. package/dist/context/local-inbox-handoff.js.map +1 -0
  64. package/dist/context/projection-handoff.d.ts +46 -0
  65. package/dist/context/projection-handoff.d.ts.map +1 -0
  66. package/dist/context/projection-handoff.js +177 -0
  67. package/dist/context/projection-handoff.js.map +1 -0
  68. package/dist/context/tenant-index.d.ts +41 -0
  69. package/dist/context/tenant-index.d.ts.map +1 -0
  70. package/dist/context/tenant-index.js +93 -0
  71. package/dist/context/tenant-index.js.map +1 -0
  72. package/dist/delivery/conditional-pickup.d.ts +25 -0
  73. package/dist/delivery/conditional-pickup.d.ts.map +1 -0
  74. package/dist/delivery/conditional-pickup.js +26 -0
  75. package/dist/delivery/conditional-pickup.js.map +1 -0
  76. package/dist/delivery/delivery-builder.d.ts +216 -0
  77. package/dist/delivery/delivery-builder.d.ts.map +1 -0
  78. package/dist/delivery/delivery-builder.js +323 -0
  79. package/dist/delivery/delivery-builder.js.map +1 -0
  80. package/dist/delivery/delivery-lease.d.ts +15 -0
  81. package/dist/delivery/delivery-lease.d.ts.map +1 -0
  82. package/dist/delivery/delivery-lease.js +44 -0
  83. package/dist/delivery/delivery-lease.js.map +1 -0
  84. package/dist/delivery/delivery-loop.d.ts +113 -0
  85. package/dist/delivery/delivery-loop.d.ts.map +1 -0
  86. package/dist/delivery/delivery-loop.js +119 -0
  87. package/dist/delivery/delivery-loop.js.map +1 -0
  88. package/dist/delivery/delivery-monitor.d.ts +165 -0
  89. package/dist/delivery/delivery-monitor.d.ts.map +1 -0
  90. package/dist/delivery/delivery-monitor.js +168 -0
  91. package/dist/delivery/delivery-monitor.js.map +1 -0
  92. package/dist/delivery/delivery-ports.d.ts +151 -0
  93. package/dist/delivery/delivery-ports.d.ts.map +1 -0
  94. package/dist/delivery/delivery-ports.js +15 -0
  95. package/dist/delivery/delivery-ports.js.map +1 -0
  96. package/dist/delivery/delivery-run-control.d.ts +50 -0
  97. package/dist/delivery/delivery-run-control.d.ts.map +1 -0
  98. package/dist/delivery/delivery-run-control.js +66 -0
  99. package/dist/delivery/delivery-run-control.js.map +1 -0
  100. package/dist/delivery/delivery-run-coordinator.d.ts +218 -0
  101. package/dist/delivery/delivery-run-coordinator.d.ts.map +1 -0
  102. package/dist/delivery/delivery-run-coordinator.js +609 -0
  103. package/dist/delivery/delivery-run-coordinator.js.map +1 -0
  104. package/dist/delivery/delivery-storage-error.d.ts +13 -0
  105. package/dist/delivery/delivery-storage-error.d.ts.map +1 -0
  106. package/dist/delivery/delivery-storage-error.js +30 -0
  107. package/dist/delivery/delivery-storage-error.js.map +1 -0
  108. package/dist/delivery/delivery-supervisor.d.ts +175 -0
  109. package/dist/delivery/delivery-supervisor.d.ts.map +1 -0
  110. package/dist/delivery/delivery-supervisor.js +469 -0
  111. package/dist/delivery/delivery-supervisor.js.map +1 -0
  112. package/dist/delivery/delivery-worker.d.ts +180 -0
  113. package/dist/delivery/delivery-worker.d.ts.map +1 -0
  114. package/dist/delivery/delivery-worker.js +232 -0
  115. package/dist/delivery/delivery-worker.js.map +1 -0
  116. package/dist/delivery/delivery.d.ts +236 -0
  117. package/dist/delivery/delivery.d.ts.map +1 -0
  118. package/dist/delivery/delivery.js +539 -0
  119. package/dist/delivery/delivery.js.map +1 -0
  120. package/dist/delivery/inbox-records.d.ts +19 -0
  121. package/dist/delivery/inbox-records.d.ts.map +1 -0
  122. package/dist/delivery/inbox-records.js +291 -0
  123. package/dist/delivery/inbox-records.js.map +1 -0
  124. package/dist/delivery/inbox-storage.d.ts +83 -0
  125. package/dist/delivery/inbox-storage.d.ts.map +1 -0
  126. package/dist/delivery/inbox-storage.js +336 -0
  127. package/dist/delivery/inbox-storage.js.map +1 -0
  128. package/dist/delivery/inbox.d.ts +272 -0
  129. package/dist/delivery/inbox.d.ts.map +1 -0
  130. package/dist/delivery/inbox.js +183 -0
  131. package/dist/delivery/inbox.js.map +1 -0
  132. package/dist/delivery/parked-delivery-obligations.d.ts +182 -0
  133. package/dist/delivery/parked-delivery-obligations.d.ts.map +1 -0
  134. package/dist/delivery/parked-delivery-obligations.js +390 -0
  135. package/dist/delivery/parked-delivery-obligations.js.map +1 -0
  136. package/dist/delivery/shard-index.d.ts +41 -0
  137. package/dist/delivery/shard-index.d.ts.map +1 -0
  138. package/dist/delivery/shard-index.js +67 -0
  139. package/dist/delivery/shard-index.js.map +1 -0
  140. package/dist/delivery/sharded-work-registry.d.ts +114 -0
  141. package/dist/delivery/sharded-work-registry.d.ts.map +1 -0
  142. package/dist/delivery/sharded-work-registry.js +361 -0
  143. package/dist/delivery/sharded-work-registry.js.map +1 -0
  144. package/dist/entity/entity-metadata.d.ts +173 -0
  145. package/dist/entity/entity-metadata.d.ts.map +1 -0
  146. package/dist/entity/entity-metadata.js +187 -0
  147. package/dist/entity/entity-metadata.js.map +1 -0
  148. package/dist/entity/entity-storage-descriptor.d.ts +64 -0
  149. package/dist/entity/entity-storage-descriptor.d.ts.map +1 -0
  150. package/dist/entity/entity-storage-descriptor.js +227 -0
  151. package/dist/entity/entity-storage-descriptor.js.map +1 -0
  152. package/dist/entity/entity-transaction.d.ts +372 -0
  153. package/dist/entity/entity-transaction.d.ts.map +1 -0
  154. package/dist/entity/entity-transaction.js +413 -0
  155. package/dist/entity/entity-transaction.js.map +1 -0
  156. package/dist/entity/entity-transition-validation.d.ts +47 -0
  157. package/dist/entity/entity-transition-validation.d.ts.map +1 -0
  158. package/dist/entity/entity-transition-validation.js +327 -0
  159. package/dist/entity/entity-transition-validation.js.map +1 -0
  160. package/dist/entity/entity.d.ts +605 -0
  161. package/dist/entity/entity.d.ts.map +1 -0
  162. package/dist/entity/entity.js +981 -0
  163. package/dist/entity/entity.js.map +1 -0
  164. package/dist/entity/implicit-required-id.d.ts +15 -0
  165. package/dist/entity/implicit-required-id.d.ts.map +1 -0
  166. package/dist/entity/implicit-required-id.js +123 -0
  167. package/dist/entity/implicit-required-id.js.map +1 -0
  168. package/dist/entity/spec-scanner.d.ts +14 -0
  169. package/dist/entity/spec-scanner.d.ts.map +1 -0
  170. package/dist/entity/spec-scanner.js +37 -0
  171. package/dist/entity/spec-scanner.js.map +1 -0
  172. package/dist/handler/command-registration-readiness.d.ts +99 -0
  173. package/dist/handler/command-registration-readiness.d.ts.map +1 -0
  174. package/dist/handler/command-registration-readiness.js +120 -0
  175. package/dist/handler/command-registration-readiness.js.map +1 -0
  176. package/dist/handler/declared-rejections.d.ts +11 -0
  177. package/dist/handler/declared-rejections.d.ts.map +1 -0
  178. package/dist/handler/declared-rejections.js +34 -0
  179. package/dist/handler/declared-rejections.js.map +1 -0
  180. package/dist/handler/event-handler-filter.d.ts +43 -0
  181. package/dist/handler/event-handler-filter.d.ts.map +1 -0
  182. package/dist/handler/event-handler-filter.js +128 -0
  183. package/dist/handler/event-handler-filter.js.map +1 -0
  184. package/dist/handler/event-registration-readiness.d.ts +196 -0
  185. package/dist/handler/event-registration-readiness.d.ts.map +1 -0
  186. package/dist/handler/event-registration-readiness.js +187 -0
  187. package/dist/handler/event-registration-readiness.js.map +1 -0
  188. package/dist/handler/external.d.ts +10 -0
  189. package/dist/handler/external.d.ts.map +1 -0
  190. package/dist/handler/external.js +15 -0
  191. package/dist/handler/external.js.map +1 -0
  192. package/dist/handler/generated-handler-registry.d.ts +185 -0
  193. package/dist/handler/generated-handler-registry.d.ts.map +1 -0
  194. package/dist/handler/generated-handler-registry.js +439 -0
  195. package/dist/handler/generated-handler-registry.js.map +1 -0
  196. package/dist/handler/generated-registry-discovery.d.ts +94 -0
  197. package/dist/handler/generated-registry-discovery.d.ts.map +1 -0
  198. package/dist/handler/generated-registry-discovery.js +226 -0
  199. package/dist/handler/generated-registry-discovery.js.map +1 -0
  200. package/dist/handler/handler-decorators.d.ts +151 -0
  201. package/dist/handler/handler-decorators.d.ts.map +1 -0
  202. package/dist/handler/handler-decorators.js +275 -0
  203. package/dist/handler/handler-decorators.js.map +1 -0
  204. package/dist/handler/handler-metadata.d.ts +553 -0
  205. package/dist/handler/handler-metadata.d.ts.map +1 -0
  206. package/dist/handler/handler-metadata.js +437 -0
  207. package/dist/handler/handler-metadata.js.map +1 -0
  208. package/dist/handler/registration-readiness-metadata.d.ts +68 -0
  209. package/dist/handler/registration-readiness-metadata.d.ts.map +1 -0
  210. package/dist/handler/registration-readiness-metadata.js +171 -0
  211. package/dist/handler/registration-readiness-metadata.js.map +1 -0
  212. package/dist/handler/rejection-source.d.ts +11 -0
  213. package/dist/handler/rejection-source.d.ts.map +1 -0
  214. package/dist/handler/rejection-source.js +25 -0
  215. package/dist/handler/rejection-source.js.map +1 -0
  216. package/dist/handler/standalone.d.ts +25 -0
  217. package/dist/handler/standalone.d.ts.map +1 -0
  218. package/dist/handler/standalone.js +38 -0
  219. package/dist/handler/standalone.js.map +1 -0
  220. package/dist/index.d.ts +46 -0
  221. package/dist/index.d.ts.map +1 -0
  222. package/dist/index.js +54 -0
  223. package/dist/index.js.map +1 -0
  224. package/dist/integration/external-messages.d.ts +49 -0
  225. package/dist/integration/external-messages.d.ts.map +1 -0
  226. package/dist/integration/external-messages.js +112 -0
  227. package/dist/integration/external-messages.js.map +1 -0
  228. package/dist/integration/integration-broker.d.ts +74 -0
  229. package/dist/integration/integration-broker.d.ts.map +1 -0
  230. package/dist/integration/integration-broker.js +444 -0
  231. package/dist/integration/integration-broker.js.map +1 -0
  232. package/dist/integration/third-party-context.d.ts +56 -0
  233. package/dist/integration/third-party-context.d.ts.map +1 -0
  234. package/dist/integration/third-party-context.js +130 -0
  235. package/dist/integration/third-party-context.js.map +1 -0
  236. package/dist/repository/command-errors.d.ts +25 -0
  237. package/dist/repository/command-errors.d.ts.map +1 -0
  238. package/dist/repository/command-errors.js +43 -0
  239. package/dist/repository/command-errors.js.map +1 -0
  240. package/dist/repository/command-routing.d.ts +72 -0
  241. package/dist/repository/command-routing.d.ts.map +1 -0
  242. package/dist/repository/command-routing.js +98 -0
  243. package/dist/repository/command-routing.js.map +1 -0
  244. package/dist/repository/commit-fence.d.ts +22 -0
  245. package/dist/repository/commit-fence.d.ts.map +1 -0
  246. package/dist/repository/commit-fence.js +37 -0
  247. package/dist/repository/commit-fence.js.map +1 -0
  248. package/dist/repository/event-routing.d.ts +71 -0
  249. package/dist/repository/event-routing.d.ts.map +1 -0
  250. package/dist/repository/event-routing.js +96 -0
  251. package/dist/repository/event-routing.js.map +1 -0
  252. package/dist/repository/primitive-id.d.ts +75 -0
  253. package/dist/repository/primitive-id.d.ts.map +1 -0
  254. package/dist/repository/primitive-id.js +85 -0
  255. package/dist/repository/primitive-id.js.map +1 -0
  256. package/dist/repository/repository.d.ts +667 -0
  257. package/dist/repository/repository.d.ts.map +1 -0
  258. package/dist/repository/repository.js +3510 -0
  259. package/dist/repository/repository.js.map +1 -0
  260. package/dist/repository/routing-declarations.d.ts +75 -0
  261. package/dist/repository/routing-declarations.d.ts.map +1 -0
  262. package/dist/repository/routing-declarations.js +101 -0
  263. package/dist/repository/routing-declarations.js.map +1 -0
  264. package/dist/repository/state-update-routing.d.ts +66 -0
  265. package/dist/repository/state-update-routing.d.ts.map +1 -0
  266. package/dist/repository/state-update-routing.js +91 -0
  267. package/dist/repository/state-update-routing.js.map +1 -0
  268. package/dist/runtime/runtime.d.ts +156 -0
  269. package/dist/runtime/runtime.d.ts.map +1 -0
  270. package/dist/runtime/runtime.js +215 -0
  271. package/dist/runtime/runtime.js.map +1 -0
  272. package/dist/runtime/signal-intake.d.ts +84 -0
  273. package/dist/runtime/signal-intake.d.ts.map +1 -0
  274. package/dist/runtime/signal-intake.js +94 -0
  275. package/dist/runtime/signal-intake.js.map +1 -0
  276. package/dist/runtime/signal-metadata.d.ts +217 -0
  277. package/dist/runtime/signal-metadata.d.ts.map +1 -0
  278. package/dist/runtime/signal-metadata.js +333 -0
  279. package/dist/runtime/signal-metadata.js.map +1 -0
  280. package/dist/runtime/signal-publisher.d.ts +144 -0
  281. package/dist/runtime/signal-publisher.d.ts.map +1 -0
  282. package/dist/runtime/signal-publisher.js +248 -0
  283. package/dist/runtime/signal-publisher.js.map +1 -0
  284. package/dist/runtime/standalone-handler-runtime.d.ts +114 -0
  285. package/dist/runtime/standalone-handler-runtime.d.ts.map +1 -0
  286. package/dist/runtime/standalone-handler-runtime.js +307 -0
  287. package/dist/runtime/standalone-handler-runtime.js.map +1 -0
  288. package/dist/server/environment-attachment.d.ts +356 -0
  289. package/dist/server/environment-attachment.d.ts.map +1 -0
  290. package/dist/server/environment-attachment.js +2062 -0
  291. package/dist/server/environment-attachment.js.map +1 -0
  292. package/dist/server/environment-delivery-records.d.ts +77 -0
  293. package/dist/server/environment-delivery-records.d.ts.map +1 -0
  294. package/dist/server/environment-delivery-records.js +282 -0
  295. package/dist/server/environment-delivery-records.js.map +1 -0
  296. package/dist/server/environment-delivery-worker.d.ts +161 -0
  297. package/dist/server/environment-delivery-worker.d.ts.map +1 -0
  298. package/dist/server/environment-delivery-worker.js +673 -0
  299. package/dist/server/environment-delivery-worker.js.map +1 -0
  300. package/dist/server/environment.d.ts +43 -0
  301. package/dist/server/environment.d.ts.map +1 -0
  302. package/dist/server/environment.js +90 -0
  303. package/dist/server/environment.js.map +1 -0
  304. package/dist/server/managed-child-subscription.d.ts +11 -0
  305. package/dist/server/managed-child-subscription.d.ts.map +1 -0
  306. package/dist/server/managed-child-subscription.js +44 -0
  307. package/dist/server/managed-child-subscription.js.map +1 -0
  308. package/dist/server/managed-server-application.d.ts +327 -0
  309. package/dist/server/managed-server-application.d.ts.map +1 -0
  310. package/dist/server/managed-server-application.js +937 -0
  311. package/dist/server/managed-server-application.js.map +1 -0
  312. package/dist/server/node-coordinator.d.ts +191 -0
  313. package/dist/server/node-coordinator.d.ts.map +1 -0
  314. package/dist/server/node-coordinator.js +552 -0
  315. package/dist/server/node-coordinator.js.map +1 -0
  316. package/dist/server/process-server-coordinator.d.ts +15 -0
  317. package/dist/server/process-server-coordinator.d.ts.map +1 -0
  318. package/dist/server/process-server-coordinator.js +112 -0
  319. package/dist/server/process-server-coordinator.js.map +1 -0
  320. package/dist/server/reserved-spine-rpc-paths.json +8 -0
  321. package/dist/server/retryable-close.d.ts +28 -0
  322. package/dist/server/retryable-close.d.ts.map +1 -0
  323. package/dist/server/retryable-close.js +129 -0
  324. package/dist/server/retryable-close.js.map +1 -0
  325. package/dist/server/server-environment.d.ts +180 -0
  326. package/dist/server/server-environment.d.ts.map +1 -0
  327. package/dist/server/server-environment.js +418 -0
  328. package/dist/server/server-environment.js.map +1 -0
  329. package/dist/server/server-log.d.ts +18 -0
  330. package/dist/server/server-log.d.ts.map +1 -0
  331. package/dist/server/server-log.js +100 -0
  332. package/dist/server/server-log.js.map +1 -0
  333. package/dist/server/server.d.ts +221 -0
  334. package/dist/server/server.d.ts.map +1 -0
  335. package/dist/server/server.js +704 -0
  336. package/dist/server/server.js.map +1 -0
  337. package/dist/services/query-reader.d.ts +19 -0
  338. package/dist/services/query-reader.d.ts.map +1 -0
  339. package/dist/services/query-reader.js +43 -0
  340. package/dist/services/query-reader.js.map +1 -0
  341. package/dist/services/spine-services.d.ts +88 -0
  342. package/dist/services/spine-services.d.ts.map +1 -0
  343. package/dist/services/spine-services.js +1582 -0
  344. package/dist/services/spine-services.js.map +1 -0
  345. package/dist/spi/delivery.d.ts +5 -0
  346. package/dist/spi/delivery.d.ts.map +1 -0
  347. package/dist/spi/delivery.js +18 -0
  348. package/dist/spi/delivery.js.map +1 -0
  349. package/dist/spi/handler-registry.d.ts +8 -0
  350. package/dist/spi/handler-registry.d.ts.map +1 -0
  351. package/dist/spi/handler-registry.js +15 -0
  352. package/dist/spi/handler-registry.js.map +1 -0
  353. package/dist/stand/stand.d.ts +294 -0
  354. package/dist/stand/stand.d.ts.map +1 -0
  355. package/dist/stand/stand.js +681 -0
  356. package/dist/stand/stand.js.map +1 -0
  357. package/dist/stand/subscription-observer.d.ts +53 -0
  358. package/dist/stand/subscription-observer.d.ts.map +1 -0
  359. package/dist/stand/subscription-observer.js +444 -0
  360. package/dist/stand/subscription-observer.js.map +1 -0
  361. package/dist/stand/subscription-records.d.ts +12 -0
  362. package/dist/stand/subscription-records.d.ts.map +1 -0
  363. package/dist/stand/subscription-records.js +99 -0
  364. package/dist/stand/subscription-records.js.map +1 -0
  365. package/dist/stand/subscription-registry.d.ts +285 -0
  366. package/dist/stand/subscription-registry.d.ts.map +1 -0
  367. package/dist/stand/subscription-registry.js +403 -0
  368. package/dist/stand/subscription-registry.js.map +1 -0
  369. package/dist/stand/subscription-runtime.d.ts +102 -0
  370. package/dist/stand/subscription-runtime.d.ts.map +1 -0
  371. package/dist/stand/subscription-runtime.js +380 -0
  372. package/dist/stand/subscription-runtime.js.map +1 -0
  373. package/dist/testing/index.d.ts +36 -0
  374. package/dist/testing/index.d.ts.map +1 -0
  375. package/dist/testing/index.js +54 -0
  376. package/dist/testing/index.js.map +1 -0
  377. package/dist/tsconfig.tsbuildinfo +1 -0
  378. package/package.json +76 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,209 @@
1
+ # Spine application server for Node.js
2
+
3
+ `@spine-event-engine/server` is the native Node.js runtime for a Spine bounded
4
+ context. Use it to assemble contexts and expose native Connect/gRPC-compatible
5
+ services. Browser hosting is deliberately a separate entry point.
6
+
7
+ > **Experimental prerelease.** Install an exact snapshot while this API evolves:
8
+ > Snapshot releases may remove earlier prerelease import paths.
9
+
10
+ ## Install and prerequisites
11
+
12
+ ```bash
13
+ pnpm add @spine-event-engine/server@snapshot
14
+ ```
15
+
16
+ Use Node.js in ESM mode. Before adding entities, generate your application
17
+ model and handler registry with `@spine-event-engine/proto-tools`. The small
18
+ example below has no entity handlers, so it is useful for proving that native
19
+ assembly, listener startup, and cleanup work locally.
20
+
21
+ ## First native server
22
+
23
+ Build one context, start a loopback listener on an ephemeral port, and close
24
+ the returned running server. `start()` installs no signal handlers, which makes
25
+ this shape appropriate for tests and hosts that manage shutdown themselves.
26
+
27
+ <!-- docs-snippet-path: packages/server/test/server/server-environment.test.ts -->
28
+
29
+ ```ts
30
+ import { BoundedContext, Server } from "@spine-event-engine/server";
31
+
32
+ const context = BoundedContext.singleTenant("Tasks").build();
33
+ const running = await new Server({ contexts: [context], port: 0 }).start();
34
+ try {
35
+ // Native Command, Query, and Subscription services are now listening.
36
+ } finally {
37
+ await running.close();
38
+ }
39
+ ```
40
+
41
+ Add generated entities with `BoundedContext.add(...)` and use
42
+ `buildAsync()` when framework-generated repository discovery is needed. A
43
+ context is single-tenant or multitenant by construction; select that mode
44
+ before registering application handlers and storage.
45
+
46
+ ## Async handlers and Process Manager queries
47
+
48
+ An `@Assign`, `@Command`, `@React`, or `@Subscribe` handler may return its
49
+ usual result directly or through exactly one built-in `Promise<T>` layer. Its
50
+ transaction remains open until that promise settles. Nested `Promise<Promise<T>>`
51
+ results and structural or imported thenable lookalikes are rejected during handler
52
+ analysis. Rejection rolls back framework state and suppresses produced output; it
53
+ cannot roll back an external HTTP request or other side effect.
54
+
55
+ Declare each domain rejection a command handler may throw. This registers the
56
+ rejection before the server starts, so a client can subscribe even when no
57
+ server handler consumes that rejection:
58
+
59
+ <!-- docs-snippet-path: examples/todo/src/index.ts -->
60
+
61
+ ```ts
62
+ import { Assign, Throws } from "@spine-event-engine/server";
63
+ import type { CompleteTask } from "../generated/spine/examples/todo/task_commands_pb.js";
64
+ import type { TaskCompleted } from "../generated/spine/examples/todo/task_events_pb.js";
65
+ import { TaskAlreadyDone } from "../generated/spine/examples/todo/task_rejections.js";
66
+
67
+ class TaskAssignee {
68
+ @Assign
69
+ @Throws(TaskAlreadyDone)
70
+ completeTask(command: CompleteTask): TaskCompleted {
71
+ throw TaskAlreadyDone.create({ id: command.id });
72
+ }
73
+ }
74
+ ```
75
+
76
+ Place the primary handler decorator first for readability. Reversing the two
77
+ decorators has the same behavior.
78
+
79
+ Process Managers, but not Aggregates, have protected read-only `select()` during a handler:
80
+
81
+ ```ts
82
+ import { EntityQuery, type EntityColumn } from "@spine-event-engine/core";
83
+ import { ProcessManager } from "@spine-event-engine/server";
84
+
85
+ type RequestView = import("@bufbuild/protobuf").Message<"RequestView"> & {
86
+ id: string;
87
+ status: string;
88
+ createdAt: number;
89
+ };
90
+ declare const RequestViewSchema: import("@bufbuild/protobuf/codegenv2").GenMessage<RequestView>;
91
+ declare const RequestViewColumns: {
92
+ readonly status: EntityColumn<typeof RequestViewSchema, "status", string, "equal">;
93
+ readonly createdAt: EntityColumn<
94
+ typeof RequestViewSchema,
95
+ "createdAt",
96
+ number,
97
+ "equal" | "greaterThan"
98
+ >;
99
+ };
100
+ abstract class RequestCoordinator extends ProcessManager<string, typeof RequestViewSchema> {
101
+ protected async handleRequest(requestId: string): Promise<void> {
102
+ const pending = await this.select(RequestViewSchema, RequestViewColumns)
103
+ .where(EntityQuery.eq(RequestViewColumns.status, "pending"))
104
+ .orderBy(RequestViewColumns.createdAt, "asc")
105
+ .limit(10)
106
+ .read();
107
+ const one = await this.select(RequestViewSchema, RequestViewColumns).findById(requestId);
108
+ void [pending, one];
109
+ }
110
+ }
111
+ ```
112
+
113
+ These reads are eventually consistent. `limit()` may not exceed 1,000, and
114
+ `all()` can be expensive for a large Projection; prefer a targeted, ordered,
115
+ bounded query. Queries inherit the active handler's actor and tenant; there is
116
+ no tenant override.
117
+
118
+ Use `EntityQuery.all(...)` when every predicate must match and
119
+ `EntityQuery.either(...)` when any branch may match.
120
+
121
+ ## Native lifecycle and routing
122
+
123
+ `Server.run()` is the standalone process form: it handles `SIGINT`/`SIGTERM`
124
+ cleanup. `Server.start()` returns a `RunningServer` for an embedding host to
125
+ close. `ManagedServerApplication` is the Node-only complete-replica entrypoint;
126
+ it does not infer process or Delivery-shard counts.
127
+
128
+ Routes are declared by generated message schema or interface token. Exact
129
+ schema routes take precedence. Query results from `Stand` are authoritative;
130
+ subscriptions are live, best-effort notifications, so clients re-query after a
131
+ reconnect or a possible gap. Configure a storage provider for durable
132
+ application state and generated repository assembly; in-memory choices are
133
+ for local development and tests.
134
+
135
+ ## Entity identifiers
136
+
137
+ An Entity ID can be a primitive value or a complete generated Protobuf message.
138
+ For a message-valued ID, the Entity state message declares that ID message as
139
+ its first field. Every field declared by the ID message, including nested
140
+ messages, is part of the identity.
141
+
142
+ ```proto
143
+ message WorkItemId {
144
+ spine.core.UserId owner = 1;
145
+ int32 sequence = 2;
146
+ }
147
+
148
+ message WorkItem {
149
+ WorkItemId id = 1;
150
+ string title = 2;
151
+ }
152
+ ```
153
+
154
+ Generated messages can have any declared identifier fields. For example,
155
+ `CommandId` is a generated message ID:
156
+
157
+ ```ts
158
+ import { create } from "@bufbuild/protobuf";
159
+ import { type MessageId } from "@spine-event-engine/server";
160
+ import { CommandIdSchema } from "@spine-event-engine/proto";
161
+
162
+ const id = create(CommandIdSchema, { uuid: "task-42" });
163
+ const entityId: MessageId = id;
164
+ ```
165
+
166
+ At routing, the generated ID is checked against the state field's declared
167
+ schema and its generated validation rules before durable use. When default
168
+ routing finds a message but the Entity ID type is primitive, define a custom
169
+ route that returns the intended primitive ID.
170
+
171
+ Without a custom route, Command routing uses the Command's declared first
172
+ field. Event routing uses a compatible producer ID when available and otherwise
173
+ uses the Event's declared first field. State-update routing selects the first
174
+ state field compatible with the Entity ID.
175
+
176
+ ## Browser gateway migration
177
+
178
+ The server root has no browser options and does not load auth. To host a
179
+ browser-facing Gateway, install the optional auth peer and import the browser
180
+ entry point explicitly:
181
+
182
+ ```bash
183
+ pnpm add @spine-event-engine/server@snapshot @spine-event-engine/auth@snapshot
184
+ ```
185
+
186
+ ```ts
187
+ import { BrowserServer, DurableSubscriptionBindings } from "@spine-event-engine/server/browser";
188
+ ```
189
+
190
+ `BrowserServer.open(...)` composes a browser listener around a caller-managed
191
+ native server; `BrowserServer.run(...)` starts and manages a standalone or
192
+ combined browser host. Supply exact allowed origins, a session or intentional
193
+ public admission, authorization and trusted-context resolvers, finite limits,
194
+ and backend forwarding. Authenticated durable bindings are browser-host
195
+ infrastructure, not native `Server` state. See the [browser/auth extension guide](https://github.com/SpineEventEngine/spine-ts/blob/master/docs/BROWSER_CLIENT_AUTH_EXTENSION_GUIDE.md)
196
+ before exposing a backend to a browser.
197
+
198
+ ## Limits
199
+
200
+ This package does not create an identity provider, browser session store,
201
+ authorization policy, TLS configuration, or deployment topology. It does not
202
+ guarantee replay, gap repair, exactly-once subscription effects, or
203
+ cluster-complete notification delivery.
204
+
205
+ ## Next steps
206
+
207
+ - [Detailed coding-agent reference](REFERENCE.md)
208
+ - [Authentication gateway](https://github.com/SpineEventEngine/spine-ts/blob/master/packages/auth/README.md)
209
+ - [Message Board application](https://github.com/SpineEventEngine/spine-ts/blob/master/examples/message-board/app/README.md)