@bett3r-dev/pv3 1.0.0 → 2.5.1

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 (648) hide show
  1. package/CHANGELOG.md +329 -0
  2. package/build/adapters/cache/memory/index.d.ts.map +1 -1
  3. package/build/adapters/cache/memory/index.js +93 -20
  4. package/build/adapters/cache/memory/index.js.map +1 -1
  5. package/build/adapters/cache/memory/index.test.d.ts +2 -0
  6. package/build/adapters/cache/memory/index.test.d.ts.map +1 -0
  7. package/build/adapters/cache/memory/index.test.js +98 -0
  8. package/build/adapters/cache/memory/index.test.js.map +1 -0
  9. package/build/adapters/configuration/dotEnv.d.ts.map +1 -1
  10. package/build/adapters/configuration/dotEnv.js.map +1 -1
  11. package/build/adapters/database/memory/index.d.ts +5 -1
  12. package/build/adapters/database/memory/index.d.ts.map +1 -1
  13. package/build/adapters/database/memory/index.js +336 -44
  14. package/build/adapters/database/memory/index.js.map +1 -1
  15. package/build/adapters/database/memory/index.test.d.ts +2 -0
  16. package/build/adapters/database/memory/index.test.d.ts.map +1 -0
  17. package/build/adapters/database/memory/index.test.js +167 -0
  18. package/build/adapters/database/memory/index.test.js.map +1 -0
  19. package/build/adapters/database/memory/pagingCursorZero.test.d.ts +2 -0
  20. package/build/adapters/database/memory/pagingCursorZero.test.d.ts.map +1 -0
  21. package/build/adapters/database/memory/pagingCursorZero.test.js +60 -0
  22. package/build/adapters/database/memory/pagingCursorZero.test.js.map +1 -0
  23. package/build/adapters/database/memory/pagingVanishedCursor.test.d.ts +2 -0
  24. package/build/adapters/database/memory/pagingVanishedCursor.test.d.ts.map +1 -0
  25. package/build/adapters/database/memory/pagingVanishedCursor.test.js +72 -0
  26. package/build/adapters/database/memory/pagingVanishedCursor.test.js.map +1 -0
  27. package/build/adapters/endpoints/addAuthUser/index.d.ts +6 -4
  28. package/build/adapters/endpoints/addAuthUser/index.d.ts.map +1 -1
  29. package/build/adapters/endpoints/addAuthUser/index.js +12 -31
  30. package/build/adapters/endpoints/addAuthUser/index.js.map +1 -1
  31. package/build/adapters/endpoints/addDevAuthUser/index.d.ts +32 -0
  32. package/build/adapters/endpoints/addDevAuthUser/index.d.ts.map +1 -0
  33. package/build/adapters/endpoints/addDevAuthUser/index.js +39 -0
  34. package/build/adapters/endpoints/addDevAuthUser/index.js.map +1 -0
  35. package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.d.ts +2 -0
  36. package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.d.ts.map +1 -0
  37. package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.js +97 -0
  38. package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.js.map +1 -0
  39. package/build/adapters/endpoints/asyncLocalStorage/index.d.ts +22 -0
  40. package/build/adapters/endpoints/asyncLocalStorage/index.d.ts.map +1 -0
  41. package/build/adapters/endpoints/asyncLocalStorage/index.js +62 -0
  42. package/build/adapters/endpoints/asyncLocalStorage/index.js.map +1 -0
  43. package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.d.ts +2 -0
  44. package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.d.ts.map +1 -0
  45. package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.js +98 -0
  46. package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.js.map +1 -0
  47. package/build/adapters/endpoints/endpointValidation/index.d.ts +2 -2
  48. package/build/adapters/endpoints/endpointValidation/index.d.ts.map +1 -1
  49. package/build/adapters/endpoints/endpointValidation/index.js +19 -9
  50. package/build/adapters/endpoints/endpointValidation/index.js.map +1 -1
  51. package/build/adapters/endpoints/genericMiddleware/index.d.ts +23 -0
  52. package/build/adapters/endpoints/genericMiddleware/index.d.ts.map +1 -0
  53. package/build/adapters/endpoints/genericMiddleware/index.js +30 -0
  54. package/build/adapters/endpoints/genericMiddleware/index.js.map +1 -0
  55. package/build/adapters/endpoints/httpMethodOverride/index.d.ts +8 -0
  56. package/build/adapters/endpoints/httpMethodOverride/index.d.ts.map +1 -0
  57. package/build/adapters/endpoints/httpMethodOverride/index.js +44 -0
  58. package/build/adapters/endpoints/httpMethodOverride/index.js.map +1 -0
  59. package/build/adapters/endpoints/index.d.ts +5 -0
  60. package/build/adapters/endpoints/index.d.ts.map +1 -1
  61. package/build/adapters/endpoints/index.js +5 -1
  62. package/build/adapters/endpoints/index.js.map +1 -1
  63. package/build/adapters/endpoints/localAuthorization/index.d.ts +1 -0
  64. package/build/adapters/endpoints/localAuthorization/index.js +2 -0
  65. package/build/adapters/endpoints/localAuthorization/index.js.map +1 -1
  66. package/build/adapters/endpoints/mapQueryFromHeaders/index.d.ts +8 -0
  67. package/build/adapters/endpoints/mapQueryFromHeaders/index.d.ts.map +1 -0
  68. package/build/adapters/endpoints/mapQueryFromHeaders/index.js +36 -0
  69. package/build/adapters/endpoints/mapQueryFromHeaders/index.js.map +1 -0
  70. package/build/adapters/endpoints/tcpConsumer/index.d.ts.map +1 -1
  71. package/build/adapters/endpoints/tcpConsumer/index.js +8 -7
  72. package/build/adapters/endpoints/tcpConsumer/index.js.map +1 -1
  73. package/build/adapters/endpoints/userSession/__tests__/userSession.test.d.ts +2 -0
  74. package/build/adapters/endpoints/userSession/__tests__/userSession.test.d.ts.map +1 -0
  75. package/build/adapters/endpoints/userSession/__tests__/userSession.test.js +175 -0
  76. package/build/adapters/endpoints/userSession/__tests__/userSession.test.js.map +1 -0
  77. package/build/adapters/endpoints/userSession/index.d.ts +2 -2
  78. package/build/adapters/endpoints/userSession/index.d.ts.map +1 -1
  79. package/build/adapters/endpoints/userSession/index.js +36 -2
  80. package/build/adapters/endpoints/userSession/index.js.map +1 -1
  81. package/build/adapters/eventstore/database.d.ts.map +1 -1
  82. package/build/adapters/eventstore/database.js +261 -58
  83. package/build/adapters/eventstore/database.js.map +1 -1
  84. package/build/adapters/eventstore/database.test.d.ts +2 -0
  85. package/build/adapters/eventstore/database.test.d.ts.map +1 -0
  86. package/build/adapters/eventstore/database.test.js +123 -0
  87. package/build/adapters/eventstore/database.test.js.map +1 -0
  88. package/build/adapters/infrastructure/local/index.d.ts +2 -2
  89. package/build/adapters/infrastructure/local/index.d.ts.map +1 -1
  90. package/build/adapters/infrastructure/local/index.js +3 -3
  91. package/build/adapters/infrastructure/local/index.js.map +1 -1
  92. package/build/adapters/logger/__tests__/json.test.d.ts +2 -0
  93. package/build/adapters/logger/__tests__/json.test.d.ts.map +1 -0
  94. package/build/adapters/logger/__tests__/json.test.js +125 -0
  95. package/build/adapters/logger/__tests__/json.test.js.map +1 -0
  96. package/build/adapters/logger/console.d.ts.map +1 -1
  97. package/build/adapters/logger/console.js +4 -2
  98. package/build/adapters/logger/console.js.map +1 -1
  99. package/build/adapters/logger/http.d.ts +3 -0
  100. package/build/adapters/logger/http.d.ts.map +1 -0
  101. package/build/adapters/logger/http.js +49 -0
  102. package/build/adapters/logger/http.js.map +1 -0
  103. package/build/adapters/logger/index.d.ts +3 -0
  104. package/build/adapters/logger/index.d.ts.map +1 -1
  105. package/build/adapters/logger/index.js +3 -0
  106. package/build/adapters/logger/index.js.map +1 -1
  107. package/build/adapters/logger/json.d.ts +3 -0
  108. package/build/adapters/logger/json.d.ts.map +1 -0
  109. package/build/adapters/logger/json.js +41 -0
  110. package/build/adapters/logger/json.js.map +1 -0
  111. package/build/adapters/logger/stdout.d.ts +3 -0
  112. package/build/adapters/logger/stdout.d.ts.map +1 -0
  113. package/build/adapters/logger/stdout.js +52 -0
  114. package/build/adapters/logger/stdout.js.map +1 -0
  115. package/build/index.d.ts +3 -1
  116. package/build/index.d.ts.map +1 -1
  117. package/build/index.js +3 -1
  118. package/build/index.js.map +1 -1
  119. package/build/libraries/deployment-units/computeMDUs.d.ts +11 -0
  120. package/build/libraries/deployment-units/computeMDUs.d.ts.map +1 -0
  121. package/build/libraries/deployment-units/computeMDUs.js +695 -0
  122. package/build/libraries/deployment-units/computeMDUs.js.map +1 -0
  123. package/build/libraries/deployment-units/computeMDUs.test.d.ts +2 -0
  124. package/build/libraries/deployment-units/computeMDUs.test.d.ts.map +1 -0
  125. package/build/libraries/deployment-units/computeMDUs.test.js +996 -0
  126. package/build/libraries/deployment-units/computeMDUs.test.js.map +1 -0
  127. package/build/libraries/deployment-units/index.d.ts +6 -0
  128. package/build/libraries/deployment-units/index.d.ts.map +1 -0
  129. package/build/libraries/deployment-units/index.js +8 -0
  130. package/build/libraries/deployment-units/index.js.map +1 -0
  131. package/build/libraries/deployment-units/manifestWriter.d.ts +11 -0
  132. package/build/libraries/deployment-units/manifestWriter.d.ts.map +1 -0
  133. package/build/libraries/deployment-units/manifestWriter.js +28 -0
  134. package/build/libraries/deployment-units/manifestWriter.js.map +1 -0
  135. package/build/libraries/deployment-units/types.d.ts +43 -0
  136. package/build/libraries/deployment-units/types.d.ts.map +1 -0
  137. package/build/libraries/deployment-units/types.js +3 -0
  138. package/build/libraries/deployment-units/types.js.map +1 -0
  139. package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.d.ts +2 -0
  140. package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.d.ts.map +1 -0
  141. package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.js +17 -0
  142. package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.js.map +1 -0
  143. package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.d.ts +2 -0
  144. package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.d.ts.map +1 -0
  145. package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.js +13 -0
  146. package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.js.map +1 -0
  147. package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.d.ts +2 -0
  148. package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.d.ts.map +1 -0
  149. package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.js +12 -0
  150. package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.js.map +1 -0
  151. package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.d.ts +2 -0
  152. package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.d.ts.map +1 -0
  153. package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.js +21 -0
  154. package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.js.map +1 -0
  155. package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.d.ts +2 -0
  156. package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.d.ts.map +1 -0
  157. package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.js +16 -0
  158. package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.js.map +1 -0
  159. package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.d.ts +2 -0
  160. package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.d.ts.map +1 -0
  161. package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.js +14 -0
  162. package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.js.map +1 -0
  163. package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.d.ts +2 -0
  164. package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.d.ts.map +1 -0
  165. package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.js +88 -0
  166. package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.js.map +1 -0
  167. package/build/libraries/eventsourcing/__tests__/queryVisibility.test.d.ts +2 -0
  168. package/build/libraries/eventsourcing/__tests__/queryVisibility.test.d.ts.map +1 -0
  169. package/build/libraries/eventsourcing/__tests__/queryVisibility.test.js +82 -0
  170. package/build/libraries/eventsourcing/__tests__/queryVisibility.test.js.map +1 -0
  171. package/build/libraries/eventsourcing/commandHandlers/index.d.ts +40 -0
  172. package/build/libraries/eventsourcing/commandHandlers/index.d.ts.map +1 -0
  173. package/build/libraries/eventsourcing/commandHandlers/index.js +1065 -0
  174. package/build/libraries/eventsourcing/commandHandlers/index.js.map +1 -0
  175. package/build/libraries/eventsourcing/commandTemplates/index.d.ts.map +1 -0
  176. package/build/libraries/eventsourcing/commandTemplates/index.js.map +1 -0
  177. package/build/libraries/eventsourcing/commandTemplates/multiStream.d.ts +7 -0
  178. package/build/libraries/eventsourcing/commandTemplates/multiStream.d.ts.map +1 -0
  179. package/build/libraries/eventsourcing/commandTemplates/multiStream.js +116 -0
  180. package/build/libraries/eventsourcing/commandTemplates/multiStream.js.map +1 -0
  181. package/build/libraries/eventsourcing/commandTemplates/snapshot.d.ts +108 -0
  182. package/build/libraries/eventsourcing/commandTemplates/snapshot.d.ts.map +1 -0
  183. package/build/libraries/eventsourcing/commandTemplates/snapshot.js +127 -0
  184. package/build/libraries/eventsourcing/commandTemplates/snapshot.js.map +1 -0
  185. package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.d.ts +2 -0
  186. package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.d.ts.map +1 -0
  187. package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.js +77 -0
  188. package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.js.map +1 -0
  189. package/build/libraries/eventsourcing/eventHandlers/index.d.ts +52 -0
  190. package/build/libraries/eventsourcing/eventHandlers/index.d.ts.map +1 -0
  191. package/build/libraries/eventsourcing/eventHandlers/index.js +474 -0
  192. package/build/libraries/eventsourcing/eventHandlers/index.js.map +1 -0
  193. package/build/libraries/eventsourcing/executionContext.d.ts +50 -0
  194. package/build/libraries/eventsourcing/executionContext.d.ts.map +1 -0
  195. package/build/libraries/eventsourcing/executionContext.js +10 -0
  196. package/build/libraries/eventsourcing/executionContext.js.map +1 -0
  197. package/build/libraries/eventsourcing/idempotencyChecks/index.d.ts +5 -0
  198. package/build/libraries/eventsourcing/idempotencyChecks/index.d.ts.map +1 -0
  199. package/build/libraries/eventsourcing/idempotencyChecks/index.js +26 -0
  200. package/build/libraries/eventsourcing/idempotencyChecks/index.js.map +1 -0
  201. package/build/libraries/eventsourcing/index.d.ts +14 -0
  202. package/build/libraries/eventsourcing/index.d.ts.map +1 -0
  203. package/build/{ports → libraries}/eventsourcing/index.js +50 -15
  204. package/build/{ports → libraries}/eventsourcing/index.js.map +1 -1
  205. package/build/libraries/eventsourcing/invariants/combinators.d.ts +4 -0
  206. package/build/libraries/eventsourcing/invariants/combinators.d.ts.map +1 -0
  207. package/build/{ports → libraries}/eventsourcing/invariants/combinators.js +3 -3
  208. package/build/libraries/eventsourcing/invariants/combinators.js.map +1 -0
  209. package/build/libraries/eventsourcing/invariants/common.d.ts +15 -0
  210. package/build/libraries/eventsourcing/invariants/common.d.ts.map +1 -0
  211. package/build/libraries/eventsourcing/invariants/common.js +27 -0
  212. package/build/libraries/eventsourcing/invariants/common.js.map +1 -0
  213. package/build/libraries/eventsourcing/invariants/comparisons.d.ts +16 -0
  214. package/build/libraries/eventsourcing/invariants/comparisons.d.ts.map +1 -0
  215. package/build/libraries/eventsourcing/invariants/comparisons.js +35 -0
  216. package/build/libraries/eventsourcing/invariants/comparisons.js.map +1 -0
  217. package/build/libraries/eventsourcing/invariants/comparisons.test.d.ts +2 -0
  218. package/build/libraries/eventsourcing/invariants/comparisons.test.d.ts.map +1 -0
  219. package/build/libraries/eventsourcing/invariants/comparisons.test.js +25 -0
  220. package/build/libraries/eventsourcing/invariants/comparisons.test.js.map +1 -0
  221. package/build/libraries/eventsourcing/invariants/index.d.ts +17 -0
  222. package/build/libraries/eventsourcing/invariants/index.d.ts.map +1 -0
  223. package/build/libraries/eventsourcing/invariants/index.js +47 -0
  224. package/build/libraries/eventsourcing/invariants/index.js.map +1 -0
  225. package/build/libraries/eventsourcing/invariants/stateExistance.d.ts +4 -0
  226. package/build/libraries/eventsourcing/invariants/stateExistance.d.ts.map +1 -0
  227. package/build/libraries/eventsourcing/invariants/stateExistance.js +22 -0
  228. package/build/libraries/eventsourcing/invariants/stateExistance.js.map +1 -0
  229. package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.d.ts +2 -0
  230. package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.d.ts.map +1 -0
  231. package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.js +563 -0
  232. package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.js.map +1 -0
  233. package/build/libraries/eventsourcing/subscriptions/index.d.ts.map +1 -0
  234. package/build/libraries/eventsourcing/subscriptions/index.js.map +1 -0
  235. package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.d.ts +5 -0
  236. package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.d.ts.map +1 -0
  237. package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.js +198 -0
  238. package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.js.map +1 -0
  239. package/build/libraries/eventsourcing/utils/aggregateBuilder.d.ts +5 -0
  240. package/build/libraries/eventsourcing/utils/aggregateBuilder.d.ts.map +1 -0
  241. package/build/{ports → libraries}/eventsourcing/utils/aggregateBuilder.js +17 -3
  242. package/build/libraries/eventsourcing/utils/aggregateBuilder.js.map +1 -0
  243. package/build/libraries/eventsourcing/utils/commandBuilder.d.ts +3 -0
  244. package/build/libraries/eventsourcing/utils/commandBuilder.d.ts.map +1 -0
  245. package/build/{ports → libraries}/eventsourcing/utils/commandBuilder.js +44 -1
  246. package/build/libraries/eventsourcing/utils/commandBuilder.js.map +1 -0
  247. package/build/{ports → libraries}/eventsourcing/utils/eventHandlerBuilder.d.ts +2 -2
  248. package/build/libraries/eventsourcing/utils/eventHandlerBuilder.d.ts.map +1 -0
  249. package/build/libraries/eventsourcing/utils/eventHandlerBuilder.js.map +1 -0
  250. package/build/libraries/eventsourcing/utils/externalSystemBuilder.d.ts +5 -0
  251. package/build/libraries/eventsourcing/utils/externalSystemBuilder.d.ts.map +1 -0
  252. package/build/libraries/eventsourcing/utils/externalSystemBuilder.js +43 -0
  253. package/build/libraries/eventsourcing/utils/externalSystemBuilder.js.map +1 -0
  254. package/build/libraries/eventsourcing/utils/index.d.ts +22 -0
  255. package/build/libraries/eventsourcing/utils/index.d.ts.map +1 -0
  256. package/build/libraries/eventsourcing/utils/index.js +88 -0
  257. package/build/libraries/eventsourcing/utils/index.js.map +1 -0
  258. package/build/libraries/eventsourcing/utils/policyBuilder.d.ts +4 -0
  259. package/build/libraries/eventsourcing/utils/policyBuilder.d.ts.map +1 -0
  260. package/build/libraries/eventsourcing/utils/policyBuilder.js +53 -0
  261. package/build/libraries/eventsourcing/utils/policyBuilder.js.map +1 -0
  262. package/build/libraries/eventsourcing/utils/readmodelBuilder.d.ts +6 -0
  263. package/build/libraries/eventsourcing/utils/readmodelBuilder.d.ts.map +1 -0
  264. package/build/libraries/eventsourcing/utils/readmodelBuilder.js +68 -0
  265. package/build/libraries/eventsourcing/utils/readmodelBuilder.js.map +1 -0
  266. package/build/libraries/localOutbox/index.d.ts +6 -0
  267. package/build/libraries/localOutbox/index.d.ts.map +1 -0
  268. package/build/libraries/localOutbox/index.js +72 -0
  269. package/build/libraries/localOutbox/index.js.map +1 -0
  270. package/build/libraries/modulePath.d.ts +14 -0
  271. package/build/libraries/modulePath.d.ts.map +1 -0
  272. package/build/libraries/modulePath.js +21 -0
  273. package/build/libraries/modulePath.js.map +1 -0
  274. package/build/libraries/modules/fs.d.ts +2 -4
  275. package/build/libraries/modules/fs.d.ts.map +1 -1
  276. package/build/libraries/modules/fs.js +21 -84
  277. package/build/libraries/modules/fs.js.map +1 -1
  278. package/build/libraries/modules/index.d.ts +2 -0
  279. package/build/libraries/modules/index.d.ts.map +1 -1
  280. package/build/libraries/modules/index.js +2 -0
  281. package/build/libraries/modules/index.js.map +1 -1
  282. package/build/libraries/modules/scopedPortsView.d.ts +42 -0
  283. package/build/libraries/modules/scopedPortsView.d.ts.map +1 -0
  284. package/build/libraries/modules/scopedPortsView.js +55 -0
  285. package/build/libraries/modules/scopedPortsView.js.map +1 -0
  286. package/build/libraries/modules/scopedPortsView.test.d.ts +10 -0
  287. package/build/libraries/modules/scopedPortsView.test.d.ts.map +1 -0
  288. package/build/libraries/modules/scopedPortsView.test.js +103 -0
  289. package/build/libraries/modules/scopedPortsView.test.js.map +1 -0
  290. package/build/libraries/modules/selectiveLoader.d.ts +21 -0
  291. package/build/libraries/modules/selectiveLoader.d.ts.map +1 -0
  292. package/build/libraries/modules/selectiveLoader.js +164 -0
  293. package/build/libraries/modules/selectiveLoader.js.map +1 -0
  294. package/build/libraries/modules/selectiveLoader.test.d.ts +2 -0
  295. package/build/libraries/modules/selectiveLoader.test.d.ts.map +1 -0
  296. package/build/libraries/modules/selectiveLoader.test.js +471 -0
  297. package/build/libraries/modules/selectiveLoader.test.js.map +1 -0
  298. package/build/libraries/openApi/pruneUnusedRef.d.ts.map +1 -1
  299. package/build/libraries/openApi/pruneUnusedRef.js.map +1 -1
  300. package/build/libraries/tcp/index.d.ts +0 -1
  301. package/build/libraries/tcp/index.d.ts.map +1 -1
  302. package/build/libraries/tcp/index.js +32 -9
  303. package/build/libraries/tcp/index.js.map +1 -1
  304. package/build/libraries/tcp/types.d.ts +0 -1
  305. package/build/libraries/tcp/types.d.ts.map +1 -1
  306. package/build/libraries/validation/__tests__/readmodelQuerySchema.test.d.ts +2 -0
  307. package/build/libraries/validation/__tests__/readmodelQuerySchema.test.d.ts.map +1 -0
  308. package/build/libraries/validation/__tests__/readmodelQuerySchema.test.js +100 -0
  309. package/build/libraries/validation/__tests__/readmodelQuerySchema.test.js.map +1 -0
  310. package/build/libraries/validation/__tests__/validation.test.js +17 -7
  311. package/build/libraries/validation/__tests__/validation.test.js.map +1 -1
  312. package/build/libraries/validation/index.d.ts +3 -3
  313. package/build/libraries/validation/index.d.ts.map +1 -1
  314. package/build/libraries/validation/index.js +49 -15
  315. package/build/libraries/validation/index.js.map +1 -1
  316. package/build/ports/authentication/index.js.map +1 -1
  317. package/build/ports/authentication/index.test.d.ts +2 -0
  318. package/build/ports/authentication/index.test.d.ts.map +1 -0
  319. package/build/ports/authentication/index.test.js +38 -0
  320. package/build/ports/authentication/index.test.js.map +1 -0
  321. package/build/ports/base.d.ts.map +1 -1
  322. package/build/ports/base.js +39 -5
  323. package/build/ports/base.js.map +1 -1
  324. package/build/ports/base.test.d.ts +2 -0
  325. package/build/ports/base.test.d.ts.map +1 -0
  326. package/build/ports/base.test.js +92 -0
  327. package/build/ports/base.test.js.map +1 -0
  328. package/build/ports/cache/index.js.map +1 -1
  329. package/build/ports/cache/index.test.d.ts +2 -0
  330. package/build/ports/cache/index.test.d.ts.map +1 -0
  331. package/build/ports/cache/index.test.js +43 -0
  332. package/build/ports/cache/index.test.js.map +1 -0
  333. package/build/ports/configuration/__tests__/cliArgs.test.d.ts +2 -0
  334. package/build/ports/configuration/__tests__/cliArgs.test.d.ts.map +1 -0
  335. package/build/ports/configuration/__tests__/cliArgs.test.js +158 -0
  336. package/build/ports/configuration/__tests__/cliArgs.test.js.map +1 -0
  337. package/build/ports/configuration/__tests__/configurationPortEmitter.test.d.ts +2 -0
  338. package/build/ports/configuration/__tests__/configurationPortEmitter.test.d.ts.map +1 -0
  339. package/build/ports/configuration/__tests__/configurationPortEmitter.test.js +63 -0
  340. package/build/ports/configuration/__tests__/configurationPortEmitter.test.js.map +1 -0
  341. package/build/ports/configuration/__tests__/getArgsSync.test.d.ts +2 -0
  342. package/build/ports/configuration/__tests__/getArgsSync.test.d.ts.map +1 -0
  343. package/build/ports/configuration/__tests__/getArgsSync.test.js +85 -0
  344. package/build/ports/configuration/__tests__/getArgsSync.test.js.map +1 -0
  345. package/build/ports/configuration/args.d.ts +50 -43
  346. package/build/ports/configuration/args.d.ts.map +1 -1
  347. package/build/ports/configuration/args.js +76 -13
  348. package/build/ports/configuration/args.js.map +1 -1
  349. package/build/ports/configuration/common.js +1 -2
  350. package/build/ports/configuration/common.js.map +1 -1
  351. package/build/ports/configuration/index.d.ts +1 -1
  352. package/build/ports/configuration/index.d.ts.map +1 -1
  353. package/build/ports/configuration/index.js +85 -17
  354. package/build/ports/configuration/index.js.map +1 -1
  355. package/build/ports/configuration/localConfig.d.ts.map +1 -1
  356. package/build/ports/configuration/localConfig.js +46 -27
  357. package/build/ports/configuration/localConfig.js.map +1 -1
  358. package/build/ports/database/index.d.ts +1 -2
  359. package/build/ports/database/index.d.ts.map +1 -1
  360. package/build/ports/database/index.js +23 -17
  361. package/build/ports/database/index.js.map +1 -1
  362. package/build/ports/database/index.test.d.ts +2 -0
  363. package/build/ports/database/index.test.d.ts.map +1 -0
  364. package/build/ports/database/index.test.js +43 -0
  365. package/build/ports/database/index.test.js.map +1 -0
  366. package/build/ports/endpoints/__tests__/declarationSite.test.d.ts +2 -0
  367. package/build/ports/endpoints/__tests__/declarationSite.test.d.ts.map +1 -0
  368. package/build/ports/endpoints/__tests__/declarationSite.test.js +165 -0
  369. package/build/ports/endpoints/__tests__/declarationSite.test.js.map +1 -0
  370. package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.d.ts +9 -0
  371. package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.d.ts.map +1 -0
  372. package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.js +20 -0
  373. package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.js.map +1 -0
  374. package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.d.ts +10 -0
  375. package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.d.ts.map +1 -0
  376. package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.js +21 -0
  377. package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.js.map +1 -0
  378. package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.d.ts +15 -0
  379. package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.d.ts.map +1 -0
  380. package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.js +46 -0
  381. package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.js.map +1 -0
  382. package/build/ports/endpoints/__tests__/manifestEndpoints.test.d.ts +2 -0
  383. package/build/ports/endpoints/__tests__/manifestEndpoints.test.d.ts.map +1 -0
  384. package/build/ports/endpoints/__tests__/manifestEndpoints.test.js +117 -0
  385. package/build/ports/endpoints/__tests__/manifestEndpoints.test.js.map +1 -0
  386. package/build/ports/endpoints/declarationSite.d.ts +63 -0
  387. package/build/ports/endpoints/declarationSite.d.ts.map +1 -0
  388. package/build/ports/endpoints/declarationSite.js +126 -0
  389. package/build/ports/endpoints/declarationSite.js.map +1 -0
  390. package/build/ports/endpoints/health.d.ts +26 -0
  391. package/build/ports/endpoints/health.d.ts.map +1 -0
  392. package/build/ports/endpoints/health.js +96 -0
  393. package/build/ports/endpoints/health.js.map +1 -0
  394. package/build/ports/endpoints/index.d.ts +43 -7
  395. package/build/ports/endpoints/index.d.ts.map +1 -1
  396. package/build/ports/endpoints/index.js +317 -67
  397. package/build/ports/endpoints/index.js.map +1 -1
  398. package/build/ports/endpoints/openApi.d.ts +3 -2
  399. package/build/ports/endpoints/openApi.d.ts.map +1 -1
  400. package/build/ports/endpoints/openApi.js +184 -55
  401. package/build/ports/endpoints/openApi.js.map +1 -1
  402. package/build/ports/endpoints/utils.d.ts.map +1 -1
  403. package/build/ports/endpoints/utils.js.map +1 -1
  404. package/build/ports/eventstore/index.d.ts.map +1 -1
  405. package/build/ports/eventstore/index.js +37 -5
  406. package/build/ports/eventstore/index.js.map +1 -1
  407. package/build/ports/eventstore/index.test.d.ts +2 -0
  408. package/build/ports/eventstore/index.test.d.ts.map +1 -0
  409. package/build/ports/eventstore/index.test.js +68 -0
  410. package/build/ports/eventstore/index.test.js.map +1 -0
  411. package/build/ports/infrastructure/index.d.ts +61 -23
  412. package/build/ports/infrastructure/index.d.ts.map +1 -1
  413. package/build/ports/infrastructure/index.js +187 -37
  414. package/build/ports/infrastructure/index.js.map +1 -1
  415. package/build/ports/infrastructure/index.test.d.ts +2 -0
  416. package/build/ports/infrastructure/index.test.d.ts.map +1 -0
  417. package/build/ports/infrastructure/index.test.js +228 -0
  418. package/build/ports/infrastructure/index.test.js.map +1 -0
  419. package/build/ports/infrastructure/utils.d.ts +2 -1
  420. package/build/ports/infrastructure/utils.d.ts.map +1 -1
  421. package/build/ports/infrastructure/utils.js +48 -22
  422. package/build/ports/infrastructure/utils.js.map +1 -1
  423. package/build/ports/logger/__tests__/logger.test.d.ts +2 -0
  424. package/build/ports/logger/__tests__/logger.test.d.ts.map +1 -0
  425. package/build/ports/logger/__tests__/logger.test.js +69 -0
  426. package/build/ports/logger/__tests__/logger.test.js.map +1 -0
  427. package/build/ports/logger/index.d.ts.map +1 -1
  428. package/build/ports/logger/index.js +3 -2
  429. package/build/ports/logger/index.js.map +1 -1
  430. package/build/utils/__tests__/applyCollectionFilterInMemory.test.d.ts +2 -0
  431. package/build/utils/__tests__/applyCollectionFilterInMemory.test.d.ts.map +1 -0
  432. package/build/utils/__tests__/applyCollectionFilterInMemory.test.js +33 -0
  433. package/build/utils/__tests__/applyCollectionFilterInMemory.test.js.map +1 -0
  434. package/build/utils/__tests__/decodeObjectQueryParams.test.d.ts +2 -0
  435. package/build/utils/__tests__/decodeObjectQueryParams.test.d.ts.map +1 -0
  436. package/build/utils/__tests__/decodeObjectQueryParams.test.js +118 -0
  437. package/build/utils/__tests__/decodeObjectQueryParams.test.js.map +1 -0
  438. package/build/utils/index.d.ts +26 -34
  439. package/build/utils/index.d.ts.map +1 -1
  440. package/build/utils/index.js +159 -170
  441. package/build/utils/index.js.map +1 -1
  442. package/package.json +31 -11
  443. package/build/adapters/cache/memory/__tests__/memoryCache.test.d.ts +0 -1
  444. package/build/adapters/cache/memory/__tests__/memoryCache.test.d.ts.map +0 -1
  445. package/build/adapters/cache/memory/__tests__/memoryCache.test.js +0 -6
  446. package/build/adapters/cache/memory/__tests__/memoryCache.test.js.map +0 -1
  447. package/build/adapters/database/memory/__tests__/memoryDb.test.d.ts +0 -1
  448. package/build/adapters/database/memory/__tests__/memoryDb.test.d.ts.map +0 -1
  449. package/build/adapters/database/memory/__tests__/memoryDb.test.js +0 -36
  450. package/build/adapters/database/memory/__tests__/memoryDb.test.js.map +0 -1
  451. package/build/ports/endpoints/__tests__/endpointsCall.test.d.ts +0 -2
  452. package/build/ports/endpoints/__tests__/endpointsCall.test.d.ts.map +0 -1
  453. package/build/ports/endpoints/__tests__/endpointsCall.test.js +0 -21
  454. package/build/ports/endpoints/__tests__/endpointsCall.test.js.map +0 -1
  455. package/build/ports/endpoints/__tests__/test-client-library/base.d.ts +0 -77
  456. package/build/ports/endpoints/__tests__/test-client-library/base.d.ts.map +0 -1
  457. package/build/ports/endpoints/__tests__/test-client-library/base.js +0 -91
  458. package/build/ports/endpoints/__tests__/test-client-library/base.js.map +0 -1
  459. package/build/ports/endpoints/__tests__/test-client-library/index.d.ts +0 -29
  460. package/build/ports/endpoints/__tests__/test-client-library/index.d.ts.map +0 -1
  461. package/build/ports/endpoints/__tests__/test-client-library/index.js +0 -43
  462. package/build/ports/endpoints/__tests__/test-client-library/index.js.map +0 -1
  463. package/build/ports/endpoints/__tests__/test-client-library/services/service.d.ts +0 -106
  464. package/build/ports/endpoints/__tests__/test-client-library/services/service.d.ts.map +0 -1
  465. package/build/ports/endpoints/__tests__/test-client-library/services/service.js +0 -62
  466. package/build/ports/endpoints/__tests__/test-client-library/services/service.js.map +0 -1
  467. package/build/ports/endpoints/__tests__/utils.test.d.ts +0 -1
  468. package/build/ports/endpoints/__tests__/utils.test.d.ts.map +0 -1
  469. package/build/ports/endpoints/__tests__/utils.test.js +0 -53
  470. package/build/ports/endpoints/__tests__/utils.test.js.map +0 -1
  471. package/build/ports/eventsourcing/__tests__/eventhandlers.test.d.ts +0 -2
  472. package/build/ports/eventsourcing/__tests__/eventhandlers.test.d.ts.map +0 -1
  473. package/build/ports/eventsourcing/__tests__/eventhandlers.test.js +0 -35
  474. package/build/ports/eventsourcing/__tests__/eventhandlers.test.js.map +0 -1
  475. package/build/ports/eventsourcing/__tests__/invariants.test.d.ts +0 -2
  476. package/build/ports/eventsourcing/__tests__/invariants.test.d.ts.map +0 -1
  477. package/build/ports/eventsourcing/__tests__/invariants.test.js +0 -210
  478. package/build/ports/eventsourcing/__tests__/invariants.test.js.map +0 -1
  479. package/build/ports/eventsourcing/commandHandlers/index.d.ts +0 -25
  480. package/build/ports/eventsourcing/commandHandlers/index.d.ts.map +0 -1
  481. package/build/ports/eventsourcing/commandHandlers/index.js +0 -392
  482. package/build/ports/eventsourcing/commandHandlers/index.js.map +0 -1
  483. package/build/ports/eventsourcing/commandTemplates/index.d.ts.map +0 -1
  484. package/build/ports/eventsourcing/commandTemplates/index.js.map +0 -1
  485. package/build/ports/eventsourcing/commandTemplates/multiStream.d.ts +0 -4
  486. package/build/ports/eventsourcing/commandTemplates/multiStream.d.ts.map +0 -1
  487. package/build/ports/eventsourcing/commandTemplates/multiStream.js +0 -73
  488. package/build/ports/eventsourcing/commandTemplates/multiStream.js.map +0 -1
  489. package/build/ports/eventsourcing/commandTemplates/snapshot.d.ts +0 -9
  490. package/build/ports/eventsourcing/commandTemplates/snapshot.d.ts.map +0 -1
  491. package/build/ports/eventsourcing/commandTemplates/snapshot.js +0 -39
  492. package/build/ports/eventsourcing/commandTemplates/snapshot.js.map +0 -1
  493. package/build/ports/eventsourcing/eventHandlers/index.d.ts +0 -33
  494. package/build/ports/eventsourcing/eventHandlers/index.d.ts.map +0 -1
  495. package/build/ports/eventsourcing/eventHandlers/index.js +0 -276
  496. package/build/ports/eventsourcing/eventHandlers/index.js.map +0 -1
  497. package/build/ports/eventsourcing/index.d.ts +0 -9
  498. package/build/ports/eventsourcing/index.d.ts.map +0 -1
  499. package/build/ports/eventsourcing/invariants/combinators.d.ts +0 -4
  500. package/build/ports/eventsourcing/invariants/combinators.d.ts.map +0 -1
  501. package/build/ports/eventsourcing/invariants/combinators.js.map +0 -1
  502. package/build/ports/eventsourcing/invariants/common.d.ts +0 -10
  503. package/build/ports/eventsourcing/invariants/common.d.ts.map +0 -1
  504. package/build/ports/eventsourcing/invariants/common.js +0 -37
  505. package/build/ports/eventsourcing/invariants/common.js.map +0 -1
  506. package/build/ports/eventsourcing/invariants/comparisons.d.ts +0 -19
  507. package/build/ports/eventsourcing/invariants/comparisons.d.ts.map +0 -1
  508. package/build/ports/eventsourcing/invariants/comparisons.js +0 -83
  509. package/build/ports/eventsourcing/invariants/comparisons.js.map +0 -1
  510. package/build/ports/eventsourcing/invariants/index.d.ts +0 -5
  511. package/build/ports/eventsourcing/invariants/index.d.ts.map +0 -1
  512. package/build/ports/eventsourcing/invariants/index.js +0 -21
  513. package/build/ports/eventsourcing/invariants/index.js.map +0 -1
  514. package/build/ports/eventsourcing/invariants/stateExistance.d.ts +0 -4
  515. package/build/ports/eventsourcing/invariants/stateExistance.d.ts.map +0 -1
  516. package/build/ports/eventsourcing/invariants/stateExistance.js +0 -33
  517. package/build/ports/eventsourcing/invariants/stateExistance.js.map +0 -1
  518. package/build/ports/eventsourcing/subscriptions/index.d.ts.map +0 -1
  519. package/build/ports/eventsourcing/subscriptions/index.js.map +0 -1
  520. package/build/ports/eventsourcing/subscriptions/sseSubscriptions.d.ts +0 -3
  521. package/build/ports/eventsourcing/subscriptions/sseSubscriptions.d.ts.map +0 -1
  522. package/build/ports/eventsourcing/subscriptions/sseSubscriptions.js +0 -81
  523. package/build/ports/eventsourcing/subscriptions/sseSubscriptions.js.map +0 -1
  524. package/build/ports/eventsourcing/utils/aggregateBuilder.d.ts +0 -4
  525. package/build/ports/eventsourcing/utils/aggregateBuilder.d.ts.map +0 -1
  526. package/build/ports/eventsourcing/utils/aggregateBuilder.js.map +0 -1
  527. package/build/ports/eventsourcing/utils/commandBuilder.d.ts +0 -3
  528. package/build/ports/eventsourcing/utils/commandBuilder.d.ts.map +0 -1
  529. package/build/ports/eventsourcing/utils/commandBuilder.js.map +0 -1
  530. package/build/ports/eventsourcing/utils/eventHandlerBuilder.d.ts.map +0 -1
  531. package/build/ports/eventsourcing/utils/eventHandlerBuilder.js.map +0 -1
  532. package/build/ports/eventsourcing/utils/externalSystemBuilder.d.ts +0 -4
  533. package/build/ports/eventsourcing/utils/externalSystemBuilder.d.ts.map +0 -1
  534. package/build/ports/eventsourcing/utils/externalSystemBuilder.js +0 -34
  535. package/build/ports/eventsourcing/utils/externalSystemBuilder.js.map +0 -1
  536. package/build/ports/eventsourcing/utils/index.d.ts +0 -13
  537. package/build/ports/eventsourcing/utils/index.d.ts.map +0 -1
  538. package/build/ports/eventsourcing/utils/index.js +0 -45
  539. package/build/ports/eventsourcing/utils/index.js.map +0 -1
  540. package/build/ports/eventsourcing/utils/policyBuilder.d.ts +0 -3
  541. package/build/ports/eventsourcing/utils/policyBuilder.d.ts.map +0 -1
  542. package/build/ports/eventsourcing/utils/policyBuilder.js +0 -29
  543. package/build/ports/eventsourcing/utils/policyBuilder.js.map +0 -1
  544. package/build/ports/eventsourcing/utils/readmodelBuilder.d.ts +0 -5
  545. package/build/ports/eventsourcing/utils/readmodelBuilder.d.ts.map +0 -1
  546. package/build/ports/eventsourcing/utils/readmodelBuilder.js +0 -45
  547. package/build/ports/eventsourcing/utils/readmodelBuilder.js.map +0 -1
  548. package/build/ports/infrastructure/__tests__/fixture/index.d.ts +0 -3
  549. package/build/ports/infrastructure/__tests__/fixture/index.d.ts.map +0 -1
  550. package/build/ports/infrastructure/__tests__/fixture/index.js +0 -19
  551. package/build/ports/infrastructure/__tests__/fixture/index.js.map +0 -1
  552. package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.d.ts +0 -19
  553. package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.d.ts.map +0 -1
  554. package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.js +0 -76
  555. package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.js.map +0 -1
  556. package/build/ports/infrastructure/__tests__/fixture/structureState.d.ts +0 -177
  557. package/build/ports/infrastructure/__tests__/fixture/structureState.d.ts.map +0 -1
  558. package/build/ports/infrastructure/__tests__/fixture/structureState.js +0 -258
  559. package/build/ports/infrastructure/__tests__/fixture/structureState.js.map +0 -1
  560. package/build/ports/infrastructure/__tests__/infrastructure.test.d.ts +0 -2
  561. package/build/ports/infrastructure/__tests__/infrastructure.test.d.ts.map +0 -1
  562. package/build/ports/infrastructure/__tests__/infrastructure.test.js +0 -11
  563. package/build/ports/infrastructure/__tests__/infrastructure.test.js.map +0 -1
  564. package/src/adapters/cache/index.ts +0 -1
  565. package/src/adapters/cache/memory/__tests__/memoryCache.test.ts +0 -6
  566. package/src/adapters/cache/memory/index.ts +0 -142
  567. package/src/adapters/configuration/__tests__/.env +0 -4
  568. package/src/adapters/configuration/__tests__/dotEnv.test.ts +0 -38
  569. package/src/adapters/configuration/dotEnv.ts +0 -33
  570. package/src/adapters/configuration/index.ts +0 -1
  571. package/src/adapters/database/index.ts +0 -1
  572. package/src/adapters/database/memory/__tests__/memoryDb.test.ts +0 -37
  573. package/src/adapters/database/memory/index.ts +0 -279
  574. package/src/adapters/endpoints/addAuthUser/index.ts +0 -55
  575. package/src/adapters/endpoints/endpointValidation/index.ts +0 -26
  576. package/src/adapters/endpoints/index.ts +0 -4
  577. package/src/adapters/endpoints/localAuthorization/index.ts +0 -75
  578. package/src/adapters/endpoints/tcpConsumer/index.ts +0 -69
  579. package/src/adapters/endpoints/userSession/index.ts +0 -40
  580. package/src/adapters/eventstore/database.ts +0 -178
  581. package/src/adapters/eventstore/index.ts +0 -1
  582. package/src/adapters/infrastructure/index.ts +0 -1
  583. package/src/adapters/infrastructure/local/index.ts +0 -40
  584. package/src/adapters/logger/console.ts +0 -42
  585. package/src/adapters/logger/index.ts +0 -1
  586. package/src/index.ts +0 -25
  587. package/src/libraries/modules/fs.ts +0 -88
  588. package/src/libraries/modules/index.ts +0 -1
  589. package/src/libraries/openApi/index.ts +0 -1
  590. package/src/libraries/openApi/pruneUnusedRef.ts +0 -35
  591. package/src/libraries/tcp/index.ts +0 -98
  592. package/src/libraries/tcp/types.ts +0 -43
  593. package/src/libraries/validation/__tests__/validation.test.ts +0 -25
  594. package/src/libraries/validation/index.ts +0 -48
  595. package/src/ports/authentication/index.ts +0 -25
  596. package/src/ports/base.ts +0 -20
  597. package/src/ports/cache/index.ts +0 -17
  598. package/src/ports/configuration/__tests__/configurationPort.test.ts +0 -47
  599. package/src/ports/configuration/args.ts +0 -39
  600. package/src/ports/configuration/common.ts +0 -12
  601. package/src/ports/configuration/index.ts +0 -110
  602. package/src/ports/configuration/localConfig.ts +0 -117
  603. package/src/ports/database/index.ts +0 -25
  604. package/src/ports/endpoints/__tests__/endpointsCall.test.ts +0 -20
  605. package/src/ports/endpoints/__tests__/test-client-library/base.ts +0 -167
  606. package/src/ports/endpoints/__tests__/test-client-library/index.ts +0 -23
  607. package/src/ports/endpoints/__tests__/test-client-library/services/service.ts +0 -181
  608. package/src/ports/endpoints/__tests__/utils.test.ts +0 -54
  609. package/src/ports/endpoints/index.ts +0 -272
  610. package/src/ports/endpoints/openApi.ts +0 -191
  611. package/src/ports/endpoints/utils.ts +0 -31
  612. package/src/ports/eventsourcing/__tests__/eventhandlers.test.ts +0 -30
  613. package/src/ports/eventsourcing/__tests__/invariants.test.ts +0 -213
  614. package/src/ports/eventsourcing/commandHandlers/index.ts +0 -625
  615. package/src/ports/eventsourcing/commandTemplates/index.ts +0 -2
  616. package/src/ports/eventsourcing/commandTemplates/multiStream.ts +0 -70
  617. package/src/ports/eventsourcing/commandTemplates/snapshot.ts +0 -43
  618. package/src/ports/eventsourcing/eventHandlers/index.ts +0 -429
  619. package/src/ports/eventsourcing/index.ts +0 -98
  620. package/src/ports/eventsourcing/invariants/combinators.ts +0 -25
  621. package/src/ports/eventsourcing/invariants/common.ts +0 -42
  622. package/src/ports/eventsourcing/invariants/comparisons.ts +0 -90
  623. package/src/ports/eventsourcing/invariants/index.ts +0 -4
  624. package/src/ports/eventsourcing/invariants/stateExistance.ts +0 -34
  625. package/src/ports/eventsourcing/subscriptions/index.ts +0 -1
  626. package/src/ports/eventsourcing/subscriptions/sseSubscriptions.ts +0 -103
  627. package/src/ports/eventsourcing/utils/aggregateBuilder.ts +0 -49
  628. package/src/ports/eventsourcing/utils/commandBuilder.ts +0 -113
  629. package/src/ports/eventsourcing/utils/eventHandlerBuilder.ts +0 -22
  630. package/src/ports/eventsourcing/utils/externalSystemBuilder.ts +0 -42
  631. package/src/ports/eventsourcing/utils/index.ts +0 -25
  632. package/src/ports/eventsourcing/utils/policyBuilder.ts +0 -31
  633. package/src/ports/eventsourcing/utils/readmodelBuilder.ts +0 -52
  634. package/src/ports/eventstore/index.ts +0 -11
  635. package/src/ports/infrastructure/__tests__/fixture/index.ts +0 -2
  636. package/src/ports/infrastructure/__tests__/fixture/infrastructureServices.ts +0 -72
  637. package/src/ports/infrastructure/__tests__/fixture/structureState.ts +0 -254
  638. package/src/ports/infrastructure/__tests__/infrastructure.test.ts +0 -11
  639. package/src/ports/infrastructure/index.ts +0 -162
  640. package/src/ports/infrastructure/utils.ts +0 -130
  641. package/src/ports/logger/index.ts +0 -34
  642. package/src/utils/index.ts +0 -186
  643. package/tsconfig.json +0 -19
  644. /package/build/{ports → libraries}/eventsourcing/commandTemplates/index.d.ts +0 -0
  645. /package/build/{ports → libraries}/eventsourcing/commandTemplates/index.js +0 -0
  646. /package/build/{ports → libraries}/eventsourcing/subscriptions/index.d.ts +0 -0
  647. /package/build/{ports → libraries}/eventsourcing/subscriptions/index.js +0 -0
  648. /package/build/{ports → libraries}/eventsourcing/utils/eventHandlerBuilder.js +0 -0
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const declarationSite_1 = require("../declarationSite");
8
+ const PORT_DIRECTORY = path_1.default.resolve(__dirname, '..');
9
+ // In production the frames between the declaring file and here are the port's
10
+ // own — declarationSite.ts and index.ts's `registerEndpoint`, both of which the
11
+ // capture skips. So the caller of `getDeclarationSite` stands in for the
12
+ // function that declared the endpoint.
13
+ describe('getDeclarationSite', () => {
14
+ it('reports the file and the function that registered the endpoint', () => {
15
+ const registerHealthSyncEndpoints = () => (0, declarationSite_1.getDeclarationSite)('endpoint "Test"');
16
+ const site = registerHealthSyncEndpoints();
17
+ expect(site.filePath).toBe(path_1.default.resolve(__filename));
18
+ // The declaring function is what the manifest names the artifact after, so
19
+ // the selective loader resolves the export exactly instead of guessing.
20
+ expect(site.exportName).toBe('registerHealthSyncEndpoints');
21
+ });
22
+ it('still reports the file when the caller cannot be named', () => {
23
+ const site = (() => (0, declarationSite_1.getDeclarationSite)('endpoint "Test"'))();
24
+ expect(site.filePath).toBe(path_1.default.resolve(__filename));
25
+ });
26
+ it('skips the endpoints port itself rather than attributing the endpoint to pv3', () => {
27
+ const site = (0, declarationSite_1.getDeclarationSite)('endpoint "Test"');
28
+ // Without the frame filter this would be declarationSite.ts, and every
29
+ // endpoint in the manifest would be declared by pv3 instead of by its module.
30
+ expect(path_1.default.dirname(site.filePath)).not.toBe(PORT_DIRECTORY);
31
+ expect(site.filePath).toBe(path_1.default.resolve(__filename));
32
+ });
33
+ describe('frame resolution', () => {
34
+ it('skips the port when the stack reports src but the port was loaded from build', () => {
35
+ // A consumer under ts-node loads pv3 from `build/`, and source-map-support
36
+ // rewrites the frames back to `src/**.ts`. Keying the boundary off
37
+ // `__dirname` (the build tree) matched nothing, so every endpoint was
38
+ // attributed to declarationSite.ts and the whole manifest collapsed into
39
+ // one bogus artifact.
40
+ const site = (0, declarationSite_1.resolveDeclarationFrame)([
41
+ 'Error',
42
+ ' at getDeclarationSite (/repo/pv3/packages/pv3/src/ports/endpoints/declarationSite.ts:78:20)',
43
+ ' at registerEndpoint (/repo/pv3/packages/pv3/src/ports/endpoints/index.ts:266:32)',
44
+ ' at registerHealthSyncEndpoints (/repo/teselly/src/modules/marketplace-health/healthSync.endpoints.ts:27:20)',
45
+ ' at create (/repo/teselly/src/modules/marketplace-health/index.ts:9:3)'
46
+ ]);
47
+ expect(site).toEqual({
48
+ filePath: '/repo/teselly/src/modules/marketplace-health/healthSync.endpoints.ts',
49
+ exportName: 'registerHealthSyncEndpoints',
50
+ kind: 'module'
51
+ });
52
+ });
53
+ it('reads through an anonymous frame and node internals', () => {
54
+ const site = (0, declarationSite_1.resolveDeclarationFrame)([
55
+ 'Error',
56
+ ' at getDeclarationSite (/repo/pv3/build/ports/endpoints/declarationSite.js:60:20)',
57
+ ' at registerEndpoint (/repo/pv3/build/ports/endpoints/index.js:266:32)',
58
+ ' at Object.<anonymous> (/repo/teselly/src/modules/generic/upload.endpoints.ts:14:5)',
59
+ ' at node:internal/modules/cjs/loader:1105:14'
60
+ ]);
61
+ expect(site?.filePath).toBe('/repo/teselly/src/modules/generic/upload.endpoints.ts');
62
+ expect(site?.exportName).toBeUndefined();
63
+ });
64
+ it('reports nothing when every frame belongs to the port', () => {
65
+ expect((0, declarationSite_1.resolveDeclarationFrame)([
66
+ 'Error',
67
+ ' at getDeclarationSite (/repo/pv3/src/ports/endpoints/declarationSite.ts:78:20)',
68
+ ' at registerEndpoint (/repo/pv3/src/ports/endpoints/index.ts:266:32)'
69
+ ])).toBeUndefined();
70
+ });
71
+ });
72
+ });
73
+ // ---------------------------------------------------------------------------
74
+ // Which bucket the declaring file falls in — the whole of F1's three-way split
75
+ // plus the one site it refuses. Synthetic stacks throughout: every interesting
76
+ // case is a frame this process cannot produce (a sibling pv3 package, a
77
+ // compiled tree, a service's module directory, a file in neither tree).
78
+ // ---------------------------------------------------------------------------
79
+ describe('declaration buckets', () => {
80
+ const SRC_PORT_ROOT = '/repo/pv3/packages/pv3/src';
81
+ const BUILD_PORT_ROOT = '/repo/pv3/packages/pv3/build';
82
+ /**
83
+ * A stack with the two frames the capture always skips on top. The pv3
84
+ * boundary is derived from the FIRST of them, so which tree the port itself
85
+ * was loaded from is a parameter of every case.
86
+ */
87
+ const siteFrom = (callerFrame, portRoot = SRC_PORT_ROOT) => {
88
+ const extension = portRoot.endsWith('build') ? 'js' : 'ts';
89
+ return (0, declarationSite_1.resolveDeclarationFrame)([
90
+ 'Error',
91
+ ` at getDeclarationSite (${portRoot}/ports/endpoints/declarationSite.${extension}:78:20)`,
92
+ ` at registerEndpoint (${portRoot}/ports/endpoints/index.${extension}:266:32)`,
93
+ callerFrame
94
+ ]);
95
+ };
96
+ it('calls a file under the service\'s modules/ tree a manual endpoint', () => {
97
+ const site = siteFrom(' at registerHealthSyncEndpoints (/repo/teselly/src/services/server/src/modules/marketplace-health/healthSync.endpoints.ts:27:20)');
98
+ expect(site?.kind).toBe('module');
99
+ });
100
+ it('calls a file inside the pv3 package a framework route', () => {
101
+ // pv3 derives this route from an aggregate; nothing declared it and no
102
+ // deployment unit owns it. The boundary is read off the PORT'S OWN FRAME —
103
+ // deriving it from `__dirname` would compare this synthetic /repo path
104
+ // against the real checkout and call it foreign.
105
+ const site = siteFrom(' at routeCommandHandler (/repo/pv3/packages/pv3/src/libraries/eventsourcing/commandHandlers/index.ts:804:22)');
106
+ expect(site?.kind).toBe('framework');
107
+ });
108
+ it('calls a sibling pv3 package a framework route as well', () => {
109
+ // The live case: pv3-admin-server registers 17 routes on the real port and
110
+ // is NOT inside packages/pv3. Classifying it foreign would fail teselly's
111
+ // manifest generation on pv3's own endpoints.
112
+ const site = siteFrom(' at AdminServer (/repo/pv3/packages/pv3-admin-server/src/index.ts:136:13)');
113
+ expect(site?.kind).toBe('framework');
114
+ });
115
+ it('follows the tree the stack reports, not the one the port was loaded from', () => {
116
+ // Under ts-node a consumer loads pv3 from build/ while source-map-support
117
+ // rewrites the frames to src/. Both trees belong to the same package, so
118
+ // either mix is still the framework.
119
+ expect(siteFrom(' at routeCommandHandler (/repo/pv3/packages/pv3/build/libraries/eventsourcing/commandHandlers/index.js:804:22)', BUILD_PORT_ROOT)?.kind).toBe('framework');
120
+ expect(siteFrom(' at routeCommandHandler (/repo/pv3/packages/pv3/src/libraries/eventsourcing/commandHandlers/index.ts:804:22)', BUILD_PORT_ROOT)?.kind).toBe('framework');
121
+ });
122
+ it('refuses a module\'s own index.ts — the composition root', () => {
123
+ // `create( ports )` never runs in a lifted pod, so capturing this file
124
+ // would make `create` an artifact factory and lift the module's entire
125
+ // interior into a pod under one endpoint's contract.
126
+ const site = siteFrom(' at create (/repo/teselly/src/services/server/src/modules/dev-utils/index.ts:32:22)');
127
+ expect(site?.kind).toBe('moduleIndex');
128
+ });
129
+ it('accepts an index.ts that is not the module root', () => {
130
+ // The live Better Auth case: modules/identity/teselly-better-auth/index.ts
131
+ // is one artifact among many in `identity`, not identity's composition
132
+ // root. Refusing it would break the one file that holds 46 routes.
133
+ const site = siteFrom(' at TesellyAuth (/repo/teselly/src/services/server/src/modules/identity/teselly-better-auth/index.ts:1009:15)');
134
+ expect(site?.kind).toBe('module');
135
+ });
136
+ it('accepts a sub-composition root deeper in the module tree', () => {
137
+ // `modules/items-publishing/size-guides/index.ts` is a real file. Only the
138
+ // module's OWN index.ts is the root `loadModulesFromDirectory` calls
139
+ // `create( ports )` on; refusing every path ending in index.ts would break
140
+ // a legitimate file the design never meant to touch.
141
+ const site = siteFrom(' at registerSizeGuideEndpoints (/repo/teselly/src/services/server/src/modules/items-publishing/size-guides/index.ts:41:5)');
142
+ expect(site?.kind).toBe('module');
143
+ });
144
+ it('decides on the path, never on the registrar\'s name', () => {
145
+ // `generateAppLoginUrl.ts` exports a function literally called `create` and
146
+ // is a genuine endpoint registrar. A refusal keyed on the name instead of
147
+ // the file would reject it — and the manifest names the artifact after this
148
+ // frame, which is what `loadFromManifest` then requires by name.
149
+ const site = siteFrom(' at create (/repo/teselly/src/services/server/src/modules/clients-management/users/generateAppLoginUrl.ts:13:22)');
150
+ expect(site?.kind).toBe('module');
151
+ expect(site?.exportName).toBe('create');
152
+ });
153
+ it('refuses a file in neither tree instead of inventing a third bucket', () => {
154
+ const site = siteFrom(' at registerWorkerEndpoints (/repo/teselly/src/tests/src/automation/rulesWorkerClaim.integration.test.ts:81:20)');
155
+ expect(site?.kind).toBe('foreign');
156
+ });
157
+ it('does not read "pv3" out of an unrelated ancestor directory name', () => {
158
+ // A checkout at ~/development/pv3-2257 is not the pv3 package. The family
159
+ // test is anchored at the directory the port's own package sits in, so a
160
+ // name match anywhere else in the path means nothing.
161
+ const site = siteFrom(' at registerThings (/Users/dev/development/pv3-2257-app/src/handlers/things.ts:12:3)');
162
+ expect(site?.kind).toBe('foreign');
163
+ });
164
+ });
165
+ //# sourceMappingURL=declarationSite.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarationSite.test.js","sourceRoot":"","sources":["../../../../src/ports/endpoints/__tests__/declarationSite.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,wDAAiF;AAEjF,MAAM,cAAc,GAAG,cAAI,CAAC,OAAO,CAAE,SAAS,EAAE,IAAI,CAAE,CAAC;AAEvD,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,uCAAuC;AACvC,QAAQ,CAAE,oBAAoB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAE,gEAAgE,EAAE,GAAG,EAAE;QACzE,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAAC,IAAA,oCAAkB,EAAE,iBAAiB,CAAE,CAAC;QAElF,MAAM,IAAI,GAAG,2BAA2B,EAAE,CAAC;QAE3C,MAAM,CAAE,IAAI,CAAC,QAAQ,CAAE,CAAC,IAAI,CAAE,cAAI,CAAC,OAAO,CAAE,UAAU,CAAE,CAAC,CAAC;QAC1D,2EAA2E;QAC3E,wEAAwE;QACxE,MAAM,CAAE,IAAI,CAAC,UAAU,CAAE,CAAC,IAAI,CAAE,6BAA6B,CAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,E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I,CAAE,SAAS,CAAE,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { EndpointsPort } from '@bett3r-dev/pv3-types';
2
+ /**
3
+ * A registrar whose export is literally named `create`, in a file that is NOT a
4
+ * composition root — the shape of `clients-management/users/generateAppLoginUrl.ts`.
5
+ * The refusal keys on the file's path, so this one is captured, and the manifest
6
+ * names its artifact `create`, which is the export `loadFromManifest` requires.
7
+ */
8
+ export declare const create: (endpoints: EndpointsPort) => void;
9
+ //# sourceMappingURL=appLoginUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appLoginUrl.d.ts","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,MAAM,cAAgB,aAAa,SAQ/C,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create = void 0;
4
+ /**
5
+ * A registrar whose export is literally named `create`, in a file that is NOT a
6
+ * composition root — the shape of `clients-management/users/generateAppLoginUrl.ts`.
7
+ * The refusal keys on the file's path, so this one is captured, and the manifest
8
+ * names its artifact `create`, which is the export `loadFromManifest` requires.
9
+ */
10
+ const create = (endpoints) => {
11
+ endpoints.registerEndpoint({
12
+ name: 'Generate App Login Url',
13
+ route: '/sales/generate-app-login-url',
14
+ method: 'GET',
15
+ loggingModule: 'sales',
16
+ action: async () => ({})
17
+ });
18
+ };
19
+ exports.create = create;
20
+ //# sourceMappingURL=appLoginUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appLoginUrl.js","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACI,MAAM,MAAM,GAAG,CAAE,SAAwB,EAAG,EAAE;IACnD,SAAS,CAAC,gBAAgB,CAAC;QACzB,IAAI,EAAE,wBAAwB;QAC9B,KAAK,EAAE,+BAA+B;QACtC,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,OAAO;QACtB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,MAAM,GAAN,MAAM,CAQjB"}
@@ -0,0 +1,10 @@
1
+ import { EndpointsPort } from '@bett3r-dev/pv3-types';
2
+ /**
3
+ * A stand-in for a service module's composition root — the shape the port
4
+ * refuses. `create( ports )` does not run in a lifted pod, so a route
5
+ * registered from here exists in the monolith and in no lifted pod.
6
+ *
7
+ * Required by `manifestEndpoints.test.ts` and by nothing else.
8
+ */
9
+ export declare const create: (endpoints: EndpointsPort) => void;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,cAAgB,aAAa,SAQ/C,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create = void 0;
4
+ /**
5
+ * A stand-in for a service module's composition root — the shape the port
6
+ * refuses. `create( ports )` does not run in a lifted pod, so a route
7
+ * registered from here exists in the monolith and in no lifted pod.
8
+ *
9
+ * Required by `manifestEndpoints.test.ts` and by nothing else.
10
+ */
11
+ const create = (endpoints) => {
12
+ endpoints.registerEndpoint({
13
+ name: 'Whoami',
14
+ route: '/sales/whoami',
15
+ method: 'GET',
16
+ loggingModule: 'sales',
17
+ action: async () => ({})
18
+ });
19
+ };
20
+ exports.create = create;
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/index.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACI,MAAM,MAAM,GAAG,CAAE,SAAwB,EAAG,EAAE;IACnD,SAAS,CAAC,gBAAgB,CAAC;QACzB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,eAAe;QACtB,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,OAAO;QACtB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,MAAM,GAAN,MAAM,CAQjB"}
@@ -0,0 +1,15 @@
1
+ import { EndpointsPort } from '@bett3r-dev/pv3-types';
2
+ /**
3
+ * A stand-in for a service module's endpoint file.
4
+ *
5
+ * It sits under a `modules/<name>/` path deliberately: the endpoints port
6
+ * decides what a route is from WHERE it was declared, and that question can
7
+ * only be put to a real stack. pv3 ships no `modules/<name>/` directory of its
8
+ * own, so this is the only file in the package that classifies as a service
9
+ * module — it is required by `manifestEndpoints.test.ts` and by nothing else.
10
+ */
11
+ export declare const registerOrderEndpoints: (endpoints: EndpointsPort) => void;
12
+ export declare const registerItemDraftEndpoints: (endpoints: EndpointsPort) => void;
13
+ /** Names no aggregate — the case the whole slice exists for. */
14
+ export declare const registerOrderSearchEndpoint: (endpoints: EndpointsPort) => void;
15
+ //# sourceMappingURL=orders.endpoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.endpoints.d.ts","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;;;;GAQG;AAEH,eAAO,MAAM,sBAAsB,cAAgB,aAAa,SAS/D,CAAC;AAEF,eAAO,MAAM,0BAA0B,cAAgB,aAAa,SASnE,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,2BAA2B,cAAgB,aAAa,SAQpE,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerOrderSearchEndpoint = exports.registerItemDraftEndpoints = exports.registerOrderEndpoints = void 0;
4
+ /**
5
+ * A stand-in for a service module's endpoint file.
6
+ *
7
+ * It sits under a `modules/<name>/` path deliberately: the endpoints port
8
+ * decides what a route is from WHERE it was declared, and that question can
9
+ * only be put to a real stack. pv3 ships no `modules/<name>/` directory of its
10
+ * own, so this is the only file in the package that classifies as a service
11
+ * module — it is required by `manifestEndpoints.test.ts` and by nothing else.
12
+ */
13
+ const registerOrderEndpoints = (endpoints) => {
14
+ endpoints.registerEndpoint({
15
+ name: 'Order Fulfilment Status',
16
+ route: '/sales/orders/:orderId/fulfilment-status',
17
+ method: 'POST',
18
+ loggingModule: 'sales',
19
+ linkedTo: ['OrdersAggregate'],
20
+ action: async () => ({})
21
+ });
22
+ };
23
+ exports.registerOrderEndpoints = registerOrderEndpoints;
24
+ const registerItemDraftEndpoints = (endpoints) => {
25
+ endpoints.registerEndpoint({
26
+ name: 'Item Drafts',
27
+ route: '/sales/item-drafts/:id?',
28
+ method: 'GET',
29
+ loggingModule: 'sales',
30
+ linkedTo: ['ItemsAggregate'],
31
+ action: async () => ({})
32
+ });
33
+ };
34
+ exports.registerItemDraftEndpoints = registerItemDraftEndpoints;
35
+ /** Names no aggregate — the case the whole slice exists for. */
36
+ const registerOrderSearchEndpoint = (endpoints) => {
37
+ endpoints.registerEndpoint({
38
+ name: 'Order Search',
39
+ route: '/sales/orders-search',
40
+ method: 'GET',
41
+ loggingModule: 'sales',
42
+ action: async () => ({})
43
+ });
44
+ };
45
+ exports.registerOrderSearchEndpoint = registerOrderSearchEndpoint;
46
+ //# sourceMappingURL=orders.endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.endpoints.js","sourceRoot":"","sources":["../../../../../../../src/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AAEI,MAAM,sBAAsB,GAAG,CAAE,SAAwB,EAAG,EAAE;IACnE,SAAS,CAAC,gBAAgB,CAAC;QACzB,IAAI,EAAE,yBAAyB;QAC/B,KAAK,EAAE,0CAA0C;QACjD,MAAM,EAAE,MAAM;QACd,aAAa,EAAE,OAAO;QACtB,QAAQ,EAAE,CAAC,iBAAiB,CAAC;QAC7B,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC;AATW,QAAA,sBAAsB,GAAtB,sBAAsB,CASjC;AAEK,MAAM,0BAA0B,GAAG,CAAE,SAAwB,EAAG,EAAE;IACvE,SAAS,CAAC,gBAAgB,CAAC;QACzB,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,OAAO;QACtB,QAAQ,EAAE,CAAC,gBAAgB,CAAC;QAC5B,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC;AATW,QAAA,0BAA0B,GAA1B,0BAA0B,CASrC;AAEF,gEAAgE;AACzD,MAAM,2BAA2B,GAAG,CAAE,SAAwB,EAAG,EAAE;IACxE,SAAS,CAAC,gBAAgB,CAAC;QACzB,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,KAAK;QACb,aAAa,EAAE,OAAO;QACtB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACzB,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,2BAA2B,GAA3B,2BAA2B,CAQtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=manifestEndpoints.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestEndpoints.test.d.ts","sourceRoot":"","sources":["../../../../src/ports/endpoints/__tests__/manifestEndpoints.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const vm_1 = __importDefault(require("vm"));
7
+ const configuration_1 = require("../../configuration");
8
+ const index_1 = require("../index");
9
+ const appLoginUrl_1 = require("./fixtures/modules/sales/appLoginUrl");
10
+ const sales_1 = require("./fixtures/modules/sales");
11
+ const orders_endpoints_1 = require("./fixtures/modules/sales/orders.endpoints");
12
+ /**
13
+ * What the endpoints port hands the deployment manifest for a manually
14
+ * registered route. `computeMDUs` turns this into an `endpoint` artifact's
15
+ * `routes` list, and teselly's manifest-coverage guard keys its comparison by
16
+ * the same `METHOD route` pair — so a field the port never fills would leave
17
+ * both of those green over nothing.
18
+ *
19
+ * Which routes are captured at all is decided by WHERE they were declared, and
20
+ * only a real stack answers that — hence the `fixtures/modules/sales/` files.
21
+ * Registering from this file instead exercises the framework bucket, since a
22
+ * test inside the pv3 package is exactly what a pv3-registered route looks like.
23
+ */
24
+ const configAdapter = (config) => ({
25
+ applyConfig: async () => config,
26
+ name: 'test',
27
+ _adapter: () => { },
28
+ start: async () => { },
29
+ stop: async () => { }
30
+ });
31
+ const createEndpointsPort = async () => {
32
+ const configuration = await (0, configuration_1.Configuration)(configAdapter({}));
33
+ return (0, index_1.Endpoints)({ packageJson: { name: 'test', version: '1' }, configuration });
34
+ };
35
+ describe('getManifestEndpoints', () => {
36
+ it('records which route the captured declaration site is', async () => {
37
+ const endpoints = await createEndpointsPort();
38
+ (0, orders_endpoints_1.registerOrderEndpoints)(endpoints);
39
+ const [captured] = endpoints.getManifestEndpoints();
40
+ expect(captured.route).toBe('/sales/orders/:orderId/fulfilment-status');
41
+ expect(captured.method).toBe('POST');
42
+ // The declaring FUNCTION, off the V8 frame — not the file name. The
43
+ // selective loader calls this export by name.
44
+ expect(captured.exportName).toBe('registerOrderEndpoints');
45
+ });
46
+ it('records the route as declared when it carries an optional path parameter', async () => {
47
+ const endpoints = await createEndpointsPort();
48
+ (0, orders_endpoints_1.registerItemDraftEndpoints)(endpoints);
49
+ const captured = endpoints.getManifestEndpoints();
50
+ // `registerEndpoint` stores this endpoint under TWO route-table keys
51
+ // (`/…/:id` and `/…`), so the manifest would otherwise see it twice.
52
+ expect(captured).toHaveLength(1);
53
+ // The declared route, `?` intact — the same string teselly's coverage guard
54
+ // reads off the booted endpoint, so the two sides key identically.
55
+ expect(captured[0].route).toBe('/sales/item-drafts/:id?');
56
+ });
57
+ it('captures a module route that declares nothing at all', async () => {
58
+ const endpoints = await createEndpointsPort();
59
+ (0, orders_endpoints_1.registerOrderSearchEndpoint)(endpoints);
60
+ const captured = endpoints.getManifestEndpoints();
61
+ // Being in a module IS the declaration. Before this, a route with no
62
+ // `linkedTo` was captured for nothing and existed in no deployment unit.
63
+ expect(captured).toHaveLength(1);
64
+ expect(captured[0].route).toBe('/sales/orders-search');
65
+ expect(captured[0].linkedTo).toBeUndefined();
66
+ expect(captured[0].exportName).toBe('registerOrderSearchEndpoint');
67
+ });
68
+ it('captures nothing for a route registered from inside pv3', async () => {
69
+ const endpoints = await createEndpointsPort();
70
+ // Declared from this test file — i.e. from inside the pv3 package, which is
71
+ // what every framework-derived route (an aggregate's command route, a
72
+ // readmodel's query route, pv3-admin-server's console) looks like on the
73
+ // stack. No deployment unit owns those and none should try.
74
+ endpoints.registerEndpoint({
75
+ name: 'Framework Route',
76
+ route: '/pv3-internal/framework-route',
77
+ method: 'GET',
78
+ loggingModule: 'test',
79
+ action: async () => ({})
80
+ });
81
+ expect(endpoints.getManifestEndpoints()).toEqual([]);
82
+ });
83
+ it('captures a registrar named `create` that is not a composition root', async () => {
84
+ const endpoints = await createEndpointsPort();
85
+ (0, appLoginUrl_1.create)(endpoints);
86
+ const [captured] = endpoints.getManifestEndpoints();
87
+ // The refusal below keys on the file, not on the function: this is the live
88
+ // shape of `clients-management/users/generateAppLoginUrl.ts`.
89
+ expect(captured.route).toBe('/sales/generate-app-login-url');
90
+ expect(captured.exportName).toBe('create');
91
+ });
92
+ it('refuses a module composition root, naming the file and where to move it', async () => {
93
+ const endpoints = await createEndpointsPort();
94
+ (0, sales_1.create)(endpoints);
95
+ // Capturing `create()` would make it an artifact factory and lift the whole
96
+ // module interior into a pod under one endpoint's contract; NOT capturing it
97
+ // silently would leave the route in the monolith and in no lifted pod.
98
+ expect(() => endpoints.getManifestEndpoints()).toThrow(/modules[/\\]sales[/\\]index\.ts/);
99
+ expect(() => endpoints.getManifestEndpoints()).toThrow(/composition root/i);
100
+ });
101
+ it('refuses a declaration site in neither the modules tree nor pv3', async () => {
102
+ const endpoints = await createEndpointsPort();
103
+ // A file in neither tree cannot be authored inside this package — every path
104
+ // here is either under `fixtures/modules/` or inside pv3 — so the frame is
105
+ // synthesised by compiling the registrar under a foreign filename. V8 reports
106
+ // it verbatim, which is exactly what teselly's own out-of-tree registrars
107
+ // (`src/tests/**/*.integration.test.ts`) look like on a real stack.
108
+ const registerFromOutsideAnyModule = vm_1.default.runInThisContext('(( endpoints ) => endpoints.registerEndpoint({' +
109
+ " name: 'Worker Probe', route: '/probes/worker', method: 'GET'," +
110
+ " loggingModule: 'test', action: async () => ({})" +
111
+ '}))', { filename: '/repo/teselly/src/tests/src/automation/rulesWorkerClaim.integration.test.ts' });
112
+ registerFromOutsideAnyModule(endpoints);
113
+ expect(() => endpoints.getManifestEndpoints()).toThrow(/rulesWorkerClaim\.integration\.test\.ts/);
114
+ expect(() => endpoints.getManifestEndpoints()).toThrow(/modules/);
115
+ });
116
+ });
117
+ //# sourceMappingURL=manifestEndpoints.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestEndpoints.test.js","sourceRoot":"","sources":["../../../../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E,CAAC;IAChF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,gEAAgE,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,SAAS,GAAG,MAAM,mBAAmB,EAAE,CAAC;QAE9C,6EAA6E;QAC7E,2EAA2E;QAC3E,8EAA8E;QAC9E,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,4BAA4B,GAAG,YAAE,CAAC,gBAAgB,CACtD,gDAAgD;YAChD,iEAAiE;YACjE,mDAAmD;YACnD,KAAK,EACL,EAAE,QAAQ,EAAE,6EAA6E,EAAE,CAC5F,CAAC;QACF,4BAA4B,CAAE,SAAS,CAAE,CAAC;QAE1C,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAE,yCAAyC,CAAE,CAAC;QACpG,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAE,SAAS,CAAE,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * What the file a route was registered from says the route IS.
3
+ *
4
+ * - `module` — a file under the service's `modules/<name>/` tree: a manually
5
+ * registered endpoint, and therefore a deployment artifact. Being in a module
6
+ * is the whole declaration; naming an aggregate is the exception, not the rule.
7
+ * - `framework` — a file inside the pv3 package family: a route pv3 derived from
8
+ * an artifact (an aggregate's command route, a readmodel's query route, the
9
+ * admin console). Nothing declared it and no deployment unit owns it.
10
+ * - `moduleIndex` — a module's own `index.ts`, refused: `create( ports )` never
11
+ * runs in a lifted pod, so capturing it would make `create` an artifact
12
+ * factory and lift the module's entire interior into a pod under one
13
+ * endpoint's contract.
14
+ * - `foreign` — neither. Refused rather than dropped into a silent third bucket.
15
+ */
16
+ export type DeclarationKind = 'module' | 'framework' | 'moduleIndex' | 'foreign';
17
+ /**
18
+ * Where a manually registered endpoint was declared.
19
+ *
20
+ * `getStackTrace()` (libraries/eventsourcing/utils) answers the same question for
21
+ * aggregates, readmodels, systems and policies, but it cannot be reused here: it
22
+ * keys on the artifact filename suffix `/\.(readmodel|aggregate|system|policy)\.ts:/`
23
+ * and throws for a file named `itemDeletePreflight.endpoints.ts`. Endpoint files
24
+ * carry no mandated suffix, so this sibling walks the stack for the first frame
25
+ * outside the endpoints port instead of pattern-matching the filename.
26
+ */
27
+ export type DeclarationSite = {
28
+ /** Absolute path of the file the endpoint was registered from. */
29
+ filePath: string;
30
+ /**
31
+ * The function that made the registration call, when V8 could name it — for
32
+ * `export const registerHealthSyncEndpoints = ( ports ) => {…}` that is the
33
+ * exported symbol itself. The deployment manifest names the endpoint artifact
34
+ * after it so the selective loader resolves the export exactly, instead of
35
+ * guessing at it from the file name.
36
+ */
37
+ exportName?: string;
38
+ /** Which of the four buckets above the declaring file falls in. */
39
+ kind: DeclarationKind;
40
+ };
41
+ /**
42
+ * The first frame outside the endpoints port — i.e. the caller that registered
43
+ * the endpoint. Exported for testing: the interesting failures are all about
44
+ * which frame gets picked, and a real stack cannot express them.
45
+ *
46
+ * The boundary is read off the stack rather than from `__dirname`, because the
47
+ * two disagree. A consumer running under ts-node loads the port from `build/`
48
+ * (so `__dirname` is the emitted tree) while source-map-support rewrites the
49
+ * frames to the original `src/**.ts` — comparing the two attributed EVERY
50
+ * endpoint to this file. Since the Error is constructed here, the topmost frame
51
+ * is always this module in whichever tree the stack reports, and `index.ts`'s
52
+ * `registerEndpoint` is its neighbour, so one directory skips both.
53
+ */
54
+ export declare const resolveDeclarationFrame: (frames: string[]) => DeclarationSite | undefined;
55
+ /**
56
+ * Where the caller registered the endpoint from.
57
+ *
58
+ * @param description names the endpoint in the failure message, since a
59
+ * declaration site that cannot be captured would otherwise drop the endpoint
60
+ * from the deployment manifest silently.
61
+ */
62
+ export declare const getDeclarationSite: (description: string) => DeclarationSite;
63
+ //# sourceMappingURL=declarationSite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declarationSite.d.ts","sourceRoot":"","sources":["../../../src/ports/endpoints/declarationSite.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAwEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,WAAa,MAAM,EAAE,KAAG,eAAe,GAAG,SAuB7E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,gBAAkB,MAAM,KAAI,eAY1D,CAAC"}