@bett3r-dev/pv3 1.0.0 → 1.1.7
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.
- package/CHANGELOG.md +329 -0
- package/build/adapters/cache/memory/index.d.ts.map +1 -1
- package/build/adapters/cache/memory/index.js +93 -20
- package/build/adapters/cache/memory/index.js.map +1 -1
- package/build/adapters/cache/memory/index.test.d.ts +2 -0
- package/build/adapters/cache/memory/index.test.d.ts.map +1 -0
- package/build/adapters/cache/memory/index.test.js +98 -0
- package/build/adapters/cache/memory/index.test.js.map +1 -0
- package/build/adapters/configuration/dotEnv.d.ts.map +1 -1
- package/build/adapters/configuration/dotEnv.js.map +1 -1
- package/build/adapters/database/memory/index.d.ts +5 -1
- package/build/adapters/database/memory/index.d.ts.map +1 -1
- package/build/adapters/database/memory/index.js +336 -44
- package/build/adapters/database/memory/index.js.map +1 -1
- package/build/adapters/database/memory/index.test.d.ts +2 -0
- package/build/adapters/database/memory/index.test.d.ts.map +1 -0
- package/build/adapters/database/memory/index.test.js +167 -0
- package/build/adapters/database/memory/index.test.js.map +1 -0
- package/build/adapters/database/memory/pagingCursorZero.test.d.ts +2 -0
- package/build/adapters/database/memory/pagingCursorZero.test.d.ts.map +1 -0
- package/build/adapters/database/memory/pagingCursorZero.test.js +60 -0
- package/build/adapters/database/memory/pagingCursorZero.test.js.map +1 -0
- package/build/adapters/database/memory/pagingVanishedCursor.test.d.ts +2 -0
- package/build/adapters/database/memory/pagingVanishedCursor.test.d.ts.map +1 -0
- package/build/adapters/database/memory/pagingVanishedCursor.test.js +72 -0
- package/build/adapters/database/memory/pagingVanishedCursor.test.js.map +1 -0
- package/build/adapters/endpoints/addAuthUser/index.d.ts +6 -4
- package/build/adapters/endpoints/addAuthUser/index.d.ts.map +1 -1
- package/build/adapters/endpoints/addAuthUser/index.js +12 -31
- package/build/adapters/endpoints/addAuthUser/index.js.map +1 -1
- package/build/adapters/endpoints/addDevAuthUser/index.d.ts +32 -0
- package/build/adapters/endpoints/addDevAuthUser/index.d.ts.map +1 -0
- package/build/adapters/endpoints/addDevAuthUser/index.js +39 -0
- package/build/adapters/endpoints/addDevAuthUser/index.js.map +1 -0
- package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.d.ts +2 -0
- package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.d.ts.map +1 -0
- package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.js +97 -0
- package/build/adapters/endpoints/asyncLocalStorage/__tests__/asyncLocalStorage.test.js.map +1 -0
- package/build/adapters/endpoints/asyncLocalStorage/index.d.ts +22 -0
- package/build/adapters/endpoints/asyncLocalStorage/index.d.ts.map +1 -0
- package/build/adapters/endpoints/asyncLocalStorage/index.js +62 -0
- package/build/adapters/endpoints/asyncLocalStorage/index.js.map +1 -0
- package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.d.ts +2 -0
- package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.d.ts.map +1 -0
- package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.js +98 -0
- package/build/adapters/endpoints/endpointValidation/__tests__/endpointValidation.test.js.map +1 -0
- package/build/adapters/endpoints/endpointValidation/index.d.ts +2 -2
- package/build/adapters/endpoints/endpointValidation/index.d.ts.map +1 -1
- package/build/adapters/endpoints/endpointValidation/index.js +19 -9
- package/build/adapters/endpoints/endpointValidation/index.js.map +1 -1
- package/build/adapters/endpoints/genericMiddleware/index.d.ts +23 -0
- package/build/adapters/endpoints/genericMiddleware/index.d.ts.map +1 -0
- package/build/adapters/endpoints/genericMiddleware/index.js +30 -0
- package/build/adapters/endpoints/genericMiddleware/index.js.map +1 -0
- package/build/adapters/endpoints/httpMethodOverride/index.d.ts +8 -0
- package/build/adapters/endpoints/httpMethodOverride/index.d.ts.map +1 -0
- package/build/adapters/endpoints/httpMethodOverride/index.js +44 -0
- package/build/adapters/endpoints/httpMethodOverride/index.js.map +1 -0
- package/build/adapters/endpoints/index.d.ts +5 -0
- package/build/adapters/endpoints/index.d.ts.map +1 -1
- package/build/adapters/endpoints/index.js +5 -1
- package/build/adapters/endpoints/index.js.map +1 -1
- package/build/adapters/endpoints/localAuthorization/index.d.ts +1 -0
- package/build/adapters/endpoints/localAuthorization/index.js +2 -0
- package/build/adapters/endpoints/localAuthorization/index.js.map +1 -1
- package/build/adapters/endpoints/mapQueryFromHeaders/index.d.ts +8 -0
- package/build/adapters/endpoints/mapQueryFromHeaders/index.d.ts.map +1 -0
- package/build/adapters/endpoints/mapQueryFromHeaders/index.js +36 -0
- package/build/adapters/endpoints/mapQueryFromHeaders/index.js.map +1 -0
- package/build/adapters/endpoints/tcpConsumer/index.d.ts.map +1 -1
- package/build/adapters/endpoints/tcpConsumer/index.js +8 -7
- package/build/adapters/endpoints/tcpConsumer/index.js.map +1 -1
- package/build/adapters/endpoints/userSession/__tests__/userSession.test.d.ts +2 -0
- package/build/adapters/endpoints/userSession/__tests__/userSession.test.d.ts.map +1 -0
- package/build/adapters/endpoints/userSession/__tests__/userSession.test.js +175 -0
- package/build/adapters/endpoints/userSession/__tests__/userSession.test.js.map +1 -0
- package/build/adapters/endpoints/userSession/index.d.ts +2 -2
- package/build/adapters/endpoints/userSession/index.d.ts.map +1 -1
- package/build/adapters/endpoints/userSession/index.js +36 -2
- package/build/adapters/endpoints/userSession/index.js.map +1 -1
- package/build/adapters/eventstore/database.d.ts.map +1 -1
- package/build/adapters/eventstore/database.js +261 -58
- package/build/adapters/eventstore/database.js.map +1 -1
- package/build/adapters/eventstore/database.test.d.ts +2 -0
- package/build/adapters/eventstore/database.test.d.ts.map +1 -0
- package/build/adapters/eventstore/database.test.js +123 -0
- package/build/adapters/eventstore/database.test.js.map +1 -0
- package/build/adapters/infrastructure/local/index.d.ts +2 -2
- package/build/adapters/infrastructure/local/index.d.ts.map +1 -1
- package/build/adapters/infrastructure/local/index.js +3 -3
- package/build/adapters/infrastructure/local/index.js.map +1 -1
- package/build/adapters/logger/__tests__/json.test.d.ts +2 -0
- package/build/adapters/logger/__tests__/json.test.d.ts.map +1 -0
- package/build/adapters/logger/__tests__/json.test.js +125 -0
- package/build/adapters/logger/__tests__/json.test.js.map +1 -0
- package/build/adapters/logger/console.d.ts.map +1 -1
- package/build/adapters/logger/console.js +4 -2
- package/build/adapters/logger/console.js.map +1 -1
- package/build/adapters/logger/http.d.ts +3 -0
- package/build/adapters/logger/http.d.ts.map +1 -0
- package/build/adapters/logger/http.js +49 -0
- package/build/adapters/logger/http.js.map +1 -0
- package/build/adapters/logger/index.d.ts +3 -0
- package/build/adapters/logger/index.d.ts.map +1 -1
- package/build/adapters/logger/index.js +3 -0
- package/build/adapters/logger/index.js.map +1 -1
- package/build/adapters/logger/json.d.ts +3 -0
- package/build/adapters/logger/json.d.ts.map +1 -0
- package/build/adapters/logger/json.js +41 -0
- package/build/adapters/logger/json.js.map +1 -0
- package/build/adapters/logger/stdout.d.ts +3 -0
- package/build/adapters/logger/stdout.d.ts.map +1 -0
- package/build/adapters/logger/stdout.js +52 -0
- package/build/adapters/logger/stdout.js.map +1 -0
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/libraries/deployment-units/computeMDUs.d.ts +11 -0
- package/build/libraries/deployment-units/computeMDUs.d.ts.map +1 -0
- package/build/libraries/deployment-units/computeMDUs.js +695 -0
- package/build/libraries/deployment-units/computeMDUs.js.map +1 -0
- package/build/libraries/deployment-units/computeMDUs.test.d.ts +2 -0
- package/build/libraries/deployment-units/computeMDUs.test.d.ts.map +1 -0
- package/build/libraries/deployment-units/computeMDUs.test.js +996 -0
- package/build/libraries/deployment-units/computeMDUs.test.js.map +1 -0
- package/build/libraries/deployment-units/index.d.ts +6 -0
- package/build/libraries/deployment-units/index.d.ts.map +1 -0
- package/build/libraries/deployment-units/index.js +8 -0
- package/build/libraries/deployment-units/index.js.map +1 -0
- package/build/libraries/deployment-units/manifestWriter.d.ts +11 -0
- package/build/libraries/deployment-units/manifestWriter.d.ts.map +1 -0
- package/build/libraries/deployment-units/manifestWriter.js +28 -0
- package/build/libraries/deployment-units/manifestWriter.js.map +1 -0
- package/build/libraries/deployment-units/types.d.ts +43 -0
- package/build/libraries/deployment-units/types.d.ts.map +1 -0
- package/build/libraries/deployment-units/types.js +3 -0
- package/build/libraries/deployment-units/types.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.js +17 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/defaultVisibilityThings.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.js +13 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupA/things.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.js +12 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/dupB/things.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.js +21 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/publicThings.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.js +16 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/queryOnlyThings.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.js +14 -0
- package/build/libraries/eventsourcing/__tests__/fixtures/subscribingThings.readmodel.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.js +88 -0
- package/build/libraries/eventsourcing/__tests__/queryOnlyReadmodel.test.js.map +1 -0
- package/build/libraries/eventsourcing/__tests__/queryVisibility.test.d.ts +2 -0
- package/build/libraries/eventsourcing/__tests__/queryVisibility.test.d.ts.map +1 -0
- package/build/libraries/eventsourcing/__tests__/queryVisibility.test.js +82 -0
- package/build/libraries/eventsourcing/__tests__/queryVisibility.test.js.map +1 -0
- package/build/libraries/eventsourcing/commandHandlers/index.d.ts +40 -0
- package/build/libraries/eventsourcing/commandHandlers/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/commandHandlers/index.js +1065 -0
- package/build/libraries/eventsourcing/commandHandlers/index.js.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/index.js.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/multiStream.d.ts +7 -0
- package/build/libraries/eventsourcing/commandTemplates/multiStream.d.ts.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/multiStream.js +116 -0
- package/build/libraries/eventsourcing/commandTemplates/multiStream.js.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/snapshot.d.ts +108 -0
- package/build/libraries/eventsourcing/commandTemplates/snapshot.d.ts.map +1 -0
- package/build/libraries/eventsourcing/commandTemplates/snapshot.js +127 -0
- package/build/libraries/eventsourcing/commandTemplates/snapshot.js.map +1 -0
- package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.d.ts +2 -0
- package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.d.ts.map +1 -0
- package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.js +77 -0
- package/build/libraries/eventsourcing/eventHandlers/__tests__/queryResponseFormatterCaller.test.js.map +1 -0
- package/build/libraries/eventsourcing/eventHandlers/index.d.ts +52 -0
- package/build/libraries/eventsourcing/eventHandlers/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/eventHandlers/index.js +474 -0
- package/build/libraries/eventsourcing/eventHandlers/index.js.map +1 -0
- package/build/libraries/eventsourcing/executionContext.d.ts +50 -0
- package/build/libraries/eventsourcing/executionContext.d.ts.map +1 -0
- package/build/libraries/eventsourcing/executionContext.js +10 -0
- package/build/libraries/eventsourcing/executionContext.js.map +1 -0
- package/build/libraries/eventsourcing/idempotencyChecks/index.d.ts +5 -0
- package/build/libraries/eventsourcing/idempotencyChecks/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/idempotencyChecks/index.js +26 -0
- package/build/libraries/eventsourcing/idempotencyChecks/index.js.map +1 -0
- package/build/libraries/eventsourcing/index.d.ts +14 -0
- package/build/libraries/eventsourcing/index.d.ts.map +1 -0
- package/build/{ports → libraries}/eventsourcing/index.js +50 -15
- package/build/{ports → libraries}/eventsourcing/index.js.map +1 -1
- package/build/libraries/eventsourcing/invariants/combinators.d.ts +4 -0
- package/build/libraries/eventsourcing/invariants/combinators.d.ts.map +1 -0
- package/build/{ports → libraries}/eventsourcing/invariants/combinators.js +3 -3
- package/build/libraries/eventsourcing/invariants/combinators.js.map +1 -0
- package/build/libraries/eventsourcing/invariants/common.d.ts +15 -0
- package/build/libraries/eventsourcing/invariants/common.d.ts.map +1 -0
- package/build/libraries/eventsourcing/invariants/common.js +27 -0
- package/build/libraries/eventsourcing/invariants/common.js.map +1 -0
- package/build/libraries/eventsourcing/invariants/comparisons.d.ts +16 -0
- package/build/libraries/eventsourcing/invariants/comparisons.d.ts.map +1 -0
- package/build/libraries/eventsourcing/invariants/comparisons.js +35 -0
- package/build/libraries/eventsourcing/invariants/comparisons.js.map +1 -0
- package/build/libraries/eventsourcing/invariants/comparisons.test.d.ts +2 -0
- package/build/libraries/eventsourcing/invariants/comparisons.test.d.ts.map +1 -0
- package/build/libraries/eventsourcing/invariants/comparisons.test.js +25 -0
- package/build/libraries/eventsourcing/invariants/comparisons.test.js.map +1 -0
- package/build/libraries/eventsourcing/invariants/index.d.ts +17 -0
- package/build/libraries/eventsourcing/invariants/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/invariants/index.js +47 -0
- package/build/libraries/eventsourcing/invariants/index.js.map +1 -0
- package/build/libraries/eventsourcing/invariants/stateExistance.d.ts +4 -0
- package/build/libraries/eventsourcing/invariants/stateExistance.d.ts.map +1 -0
- package/build/libraries/eventsourcing/invariants/stateExistance.js +22 -0
- package/build/libraries/eventsourcing/invariants/stateExistance.js.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.d.ts +2 -0
- package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.d.ts.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.js +563 -0
- package/build/libraries/eventsourcing/subscriptions/__tests__/sseSubscriptions.test.js.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/index.js.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.d.ts +5 -0
- package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.d.ts.map +1 -0
- package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.js +198 -0
- package/build/libraries/eventsourcing/subscriptions/sseSubscriptions.js.map +1 -0
- package/build/libraries/eventsourcing/utils/aggregateBuilder.d.ts +5 -0
- package/build/libraries/eventsourcing/utils/aggregateBuilder.d.ts.map +1 -0
- package/build/{ports → libraries}/eventsourcing/utils/aggregateBuilder.js +17 -3
- package/build/libraries/eventsourcing/utils/aggregateBuilder.js.map +1 -0
- package/build/libraries/eventsourcing/utils/commandBuilder.d.ts +3 -0
- package/build/libraries/eventsourcing/utils/commandBuilder.d.ts.map +1 -0
- package/build/{ports → libraries}/eventsourcing/utils/commandBuilder.js +44 -1
- package/build/libraries/eventsourcing/utils/commandBuilder.js.map +1 -0
- package/build/{ports → libraries}/eventsourcing/utils/eventHandlerBuilder.d.ts +2 -2
- package/build/libraries/eventsourcing/utils/eventHandlerBuilder.d.ts.map +1 -0
- package/build/libraries/eventsourcing/utils/eventHandlerBuilder.js.map +1 -0
- package/build/libraries/eventsourcing/utils/externalSystemBuilder.d.ts +5 -0
- package/build/libraries/eventsourcing/utils/externalSystemBuilder.d.ts.map +1 -0
- package/build/libraries/eventsourcing/utils/externalSystemBuilder.js +43 -0
- package/build/libraries/eventsourcing/utils/externalSystemBuilder.js.map +1 -0
- package/build/libraries/eventsourcing/utils/index.d.ts +22 -0
- package/build/libraries/eventsourcing/utils/index.d.ts.map +1 -0
- package/build/libraries/eventsourcing/utils/index.js +88 -0
- package/build/libraries/eventsourcing/utils/index.js.map +1 -0
- package/build/libraries/eventsourcing/utils/policyBuilder.d.ts +4 -0
- package/build/libraries/eventsourcing/utils/policyBuilder.d.ts.map +1 -0
- package/build/libraries/eventsourcing/utils/policyBuilder.js +53 -0
- package/build/libraries/eventsourcing/utils/policyBuilder.js.map +1 -0
- package/build/libraries/eventsourcing/utils/readmodelBuilder.d.ts +6 -0
- package/build/libraries/eventsourcing/utils/readmodelBuilder.d.ts.map +1 -0
- package/build/libraries/eventsourcing/utils/readmodelBuilder.js +68 -0
- package/build/libraries/eventsourcing/utils/readmodelBuilder.js.map +1 -0
- package/build/libraries/localOutbox/index.d.ts +6 -0
- package/build/libraries/localOutbox/index.d.ts.map +1 -0
- package/build/libraries/localOutbox/index.js +72 -0
- package/build/libraries/localOutbox/index.js.map +1 -0
- package/build/libraries/modulePath.d.ts +14 -0
- package/build/libraries/modulePath.d.ts.map +1 -0
- package/build/libraries/modulePath.js +21 -0
- package/build/libraries/modulePath.js.map +1 -0
- package/build/libraries/modules/fs.d.ts +2 -4
- package/build/libraries/modules/fs.d.ts.map +1 -1
- package/build/libraries/modules/fs.js +21 -84
- package/build/libraries/modules/fs.js.map +1 -1
- package/build/libraries/modules/index.d.ts +2 -0
- package/build/libraries/modules/index.d.ts.map +1 -1
- package/build/libraries/modules/index.js +2 -0
- package/build/libraries/modules/index.js.map +1 -1
- package/build/libraries/modules/scopedPortsView.d.ts +42 -0
- package/build/libraries/modules/scopedPortsView.d.ts.map +1 -0
- package/build/libraries/modules/scopedPortsView.js +55 -0
- package/build/libraries/modules/scopedPortsView.js.map +1 -0
- package/build/libraries/modules/scopedPortsView.test.d.ts +10 -0
- package/build/libraries/modules/scopedPortsView.test.d.ts.map +1 -0
- package/build/libraries/modules/scopedPortsView.test.js +103 -0
- package/build/libraries/modules/scopedPortsView.test.js.map +1 -0
- package/build/libraries/modules/selectiveLoader.d.ts +21 -0
- package/build/libraries/modules/selectiveLoader.d.ts.map +1 -0
- package/build/libraries/modules/selectiveLoader.js +164 -0
- package/build/libraries/modules/selectiveLoader.js.map +1 -0
- package/build/libraries/modules/selectiveLoader.test.d.ts +2 -0
- package/build/libraries/modules/selectiveLoader.test.d.ts.map +1 -0
- package/build/libraries/modules/selectiveLoader.test.js +471 -0
- package/build/libraries/modules/selectiveLoader.test.js.map +1 -0
- package/build/libraries/openApi/pruneUnusedRef.d.ts.map +1 -1
- package/build/libraries/openApi/pruneUnusedRef.js.map +1 -1
- package/build/libraries/tcp/index.d.ts +0 -1
- package/build/libraries/tcp/index.d.ts.map +1 -1
- package/build/libraries/tcp/index.js +32 -9
- package/build/libraries/tcp/index.js.map +1 -1
- package/build/libraries/tcp/types.d.ts +0 -1
- package/build/libraries/tcp/types.d.ts.map +1 -1
- package/build/libraries/validation/__tests__/readmodelQuerySchema.test.d.ts +2 -0
- package/build/libraries/validation/__tests__/readmodelQuerySchema.test.d.ts.map +1 -0
- package/build/libraries/validation/__tests__/readmodelQuerySchema.test.js +100 -0
- package/build/libraries/validation/__tests__/readmodelQuerySchema.test.js.map +1 -0
- package/build/libraries/validation/__tests__/validation.test.js +17 -7
- package/build/libraries/validation/__tests__/validation.test.js.map +1 -1
- package/build/libraries/validation/index.d.ts +3 -3
- package/build/libraries/validation/index.d.ts.map +1 -1
- package/build/libraries/validation/index.js +49 -15
- package/build/libraries/validation/index.js.map +1 -1
- package/build/ports/authentication/index.js.map +1 -1
- package/build/ports/authentication/index.test.d.ts +2 -0
- package/build/ports/authentication/index.test.d.ts.map +1 -0
- package/build/ports/authentication/index.test.js +38 -0
- package/build/ports/authentication/index.test.js.map +1 -0
- package/build/ports/base.d.ts.map +1 -1
- package/build/ports/base.js +39 -5
- package/build/ports/base.js.map +1 -1
- package/build/ports/base.test.d.ts +2 -0
- package/build/ports/base.test.d.ts.map +1 -0
- package/build/ports/base.test.js +92 -0
- package/build/ports/base.test.js.map +1 -0
- package/build/ports/cache/index.js.map +1 -1
- package/build/ports/cache/index.test.d.ts +2 -0
- package/build/ports/cache/index.test.d.ts.map +1 -0
- package/build/ports/cache/index.test.js +43 -0
- package/build/ports/cache/index.test.js.map +1 -0
- package/build/ports/configuration/__tests__/cliArgs.test.d.ts +2 -0
- package/build/ports/configuration/__tests__/cliArgs.test.d.ts.map +1 -0
- package/build/ports/configuration/__tests__/cliArgs.test.js +158 -0
- package/build/ports/configuration/__tests__/cliArgs.test.js.map +1 -0
- package/build/ports/configuration/__tests__/configurationPortEmitter.test.d.ts +2 -0
- package/build/ports/configuration/__tests__/configurationPortEmitter.test.d.ts.map +1 -0
- package/build/ports/configuration/__tests__/configurationPortEmitter.test.js +63 -0
- package/build/ports/configuration/__tests__/configurationPortEmitter.test.js.map +1 -0
- package/build/ports/configuration/__tests__/getArgsSync.test.d.ts +2 -0
- package/build/ports/configuration/__tests__/getArgsSync.test.d.ts.map +1 -0
- package/build/ports/configuration/__tests__/getArgsSync.test.js +85 -0
- package/build/ports/configuration/__tests__/getArgsSync.test.js.map +1 -0
- package/build/ports/configuration/args.d.ts +50 -43
- package/build/ports/configuration/args.d.ts.map +1 -1
- package/build/ports/configuration/args.js +76 -13
- package/build/ports/configuration/args.js.map +1 -1
- package/build/ports/configuration/common.js +1 -2
- package/build/ports/configuration/common.js.map +1 -1
- package/build/ports/configuration/index.d.ts +1 -1
- package/build/ports/configuration/index.d.ts.map +1 -1
- package/build/ports/configuration/index.js +85 -17
- package/build/ports/configuration/index.js.map +1 -1
- package/build/ports/configuration/localConfig.d.ts.map +1 -1
- package/build/ports/configuration/localConfig.js +46 -27
- package/build/ports/configuration/localConfig.js.map +1 -1
- package/build/ports/database/index.d.ts +1 -2
- package/build/ports/database/index.d.ts.map +1 -1
- package/build/ports/database/index.js +23 -17
- package/build/ports/database/index.js.map +1 -1
- package/build/ports/database/index.test.d.ts +2 -0
- package/build/ports/database/index.test.d.ts.map +1 -0
- package/build/ports/database/index.test.js +43 -0
- package/build/ports/database/index.test.js.map +1 -0
- package/build/ports/endpoints/__tests__/declarationSite.test.d.ts +2 -0
- package/build/ports/endpoints/__tests__/declarationSite.test.d.ts.map +1 -0
- package/build/ports/endpoints/__tests__/declarationSite.test.js +165 -0
- package/build/ports/endpoints/__tests__/declarationSite.test.js.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.d.ts +9 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.d.ts.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.js +20 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/appLoginUrl.js.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.d.ts +10 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.d.ts.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.js +21 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/index.js.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.d.ts +15 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.d.ts.map +1 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.js +46 -0
- package/build/ports/endpoints/__tests__/fixtures/modules/sales/orders.endpoints.js.map +1 -0
- package/build/ports/endpoints/__tests__/manifestEndpoints.test.d.ts +2 -0
- package/build/ports/endpoints/__tests__/manifestEndpoints.test.d.ts.map +1 -0
- package/build/ports/endpoints/__tests__/manifestEndpoints.test.js +117 -0
- package/build/ports/endpoints/__tests__/manifestEndpoints.test.js.map +1 -0
- package/build/ports/endpoints/declarationSite.d.ts +63 -0
- package/build/ports/endpoints/declarationSite.d.ts.map +1 -0
- package/build/ports/endpoints/declarationSite.js +126 -0
- package/build/ports/endpoints/declarationSite.js.map +1 -0
- package/build/ports/endpoints/health.d.ts +26 -0
- package/build/ports/endpoints/health.d.ts.map +1 -0
- package/build/ports/endpoints/health.js +96 -0
- package/build/ports/endpoints/health.js.map +1 -0
- package/build/ports/endpoints/index.d.ts +43 -7
- package/build/ports/endpoints/index.d.ts.map +1 -1
- package/build/ports/endpoints/index.js +317 -67
- package/build/ports/endpoints/index.js.map +1 -1
- package/build/ports/endpoints/openApi.d.ts +3 -2
- package/build/ports/endpoints/openApi.d.ts.map +1 -1
- package/build/ports/endpoints/openApi.js +184 -55
- package/build/ports/endpoints/openApi.js.map +1 -1
- package/build/ports/endpoints/utils.d.ts.map +1 -1
- package/build/ports/endpoints/utils.js.map +1 -1
- package/build/ports/eventstore/index.d.ts.map +1 -1
- package/build/ports/eventstore/index.js +37 -5
- package/build/ports/eventstore/index.js.map +1 -1
- package/build/ports/eventstore/index.test.d.ts +2 -0
- package/build/ports/eventstore/index.test.d.ts.map +1 -0
- package/build/ports/eventstore/index.test.js +68 -0
- package/build/ports/eventstore/index.test.js.map +1 -0
- package/build/ports/infrastructure/index.d.ts +61 -23
- package/build/ports/infrastructure/index.d.ts.map +1 -1
- package/build/ports/infrastructure/index.js +187 -37
- package/build/ports/infrastructure/index.js.map +1 -1
- package/build/ports/infrastructure/index.test.d.ts +2 -0
- package/build/ports/infrastructure/index.test.d.ts.map +1 -0
- package/build/ports/infrastructure/index.test.js +228 -0
- package/build/ports/infrastructure/index.test.js.map +1 -0
- package/build/ports/infrastructure/utils.d.ts +2 -1
- package/build/ports/infrastructure/utils.d.ts.map +1 -1
- package/build/ports/infrastructure/utils.js +48 -22
- package/build/ports/infrastructure/utils.js.map +1 -1
- package/build/ports/logger/__tests__/logger.test.d.ts +2 -0
- package/build/ports/logger/__tests__/logger.test.d.ts.map +1 -0
- package/build/ports/logger/__tests__/logger.test.js +69 -0
- package/build/ports/logger/__tests__/logger.test.js.map +1 -0
- package/build/ports/logger/index.d.ts.map +1 -1
- package/build/ports/logger/index.js +3 -2
- package/build/ports/logger/index.js.map +1 -1
- package/build/utils/__tests__/applyCollectionFilterInMemory.test.d.ts +2 -0
- package/build/utils/__tests__/applyCollectionFilterInMemory.test.d.ts.map +1 -0
- package/build/utils/__tests__/applyCollectionFilterInMemory.test.js +33 -0
- package/build/utils/__tests__/applyCollectionFilterInMemory.test.js.map +1 -0
- package/build/utils/__tests__/decodeObjectQueryParams.test.d.ts +2 -0
- package/build/utils/__tests__/decodeObjectQueryParams.test.d.ts.map +1 -0
- package/build/utils/__tests__/decodeObjectQueryParams.test.js +118 -0
- package/build/utils/__tests__/decodeObjectQueryParams.test.js.map +1 -0
- package/build/utils/index.d.ts +26 -34
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +159 -170
- package/build/utils/index.js.map +1 -1
- package/package.json +31 -11
- package/build/adapters/cache/memory/__tests__/memoryCache.test.d.ts +0 -1
- package/build/adapters/cache/memory/__tests__/memoryCache.test.d.ts.map +0 -1
- package/build/adapters/cache/memory/__tests__/memoryCache.test.js +0 -6
- package/build/adapters/cache/memory/__tests__/memoryCache.test.js.map +0 -1
- package/build/adapters/database/memory/__tests__/memoryDb.test.d.ts +0 -1
- package/build/adapters/database/memory/__tests__/memoryDb.test.d.ts.map +0 -1
- package/build/adapters/database/memory/__tests__/memoryDb.test.js +0 -36
- package/build/adapters/database/memory/__tests__/memoryDb.test.js.map +0 -1
- package/build/ports/endpoints/__tests__/endpointsCall.test.d.ts +0 -2
- package/build/ports/endpoints/__tests__/endpointsCall.test.d.ts.map +0 -1
- package/build/ports/endpoints/__tests__/endpointsCall.test.js +0 -21
- package/build/ports/endpoints/__tests__/endpointsCall.test.js.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/base.d.ts +0 -77
- package/build/ports/endpoints/__tests__/test-client-library/base.d.ts.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/base.js +0 -91
- package/build/ports/endpoints/__tests__/test-client-library/base.js.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/index.d.ts +0 -29
- package/build/ports/endpoints/__tests__/test-client-library/index.d.ts.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/index.js +0 -43
- package/build/ports/endpoints/__tests__/test-client-library/index.js.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/services/service.d.ts +0 -106
- package/build/ports/endpoints/__tests__/test-client-library/services/service.d.ts.map +0 -1
- package/build/ports/endpoints/__tests__/test-client-library/services/service.js +0 -62
- package/build/ports/endpoints/__tests__/test-client-library/services/service.js.map +0 -1
- package/build/ports/endpoints/__tests__/utils.test.d.ts +0 -1
- package/build/ports/endpoints/__tests__/utils.test.d.ts.map +0 -1
- package/build/ports/endpoints/__tests__/utils.test.js +0 -53
- package/build/ports/endpoints/__tests__/utils.test.js.map +0 -1
- package/build/ports/eventsourcing/__tests__/eventhandlers.test.d.ts +0 -2
- package/build/ports/eventsourcing/__tests__/eventhandlers.test.d.ts.map +0 -1
- package/build/ports/eventsourcing/__tests__/eventhandlers.test.js +0 -35
- package/build/ports/eventsourcing/__tests__/eventhandlers.test.js.map +0 -1
- package/build/ports/eventsourcing/__tests__/invariants.test.d.ts +0 -2
- package/build/ports/eventsourcing/__tests__/invariants.test.d.ts.map +0 -1
- package/build/ports/eventsourcing/__tests__/invariants.test.js +0 -210
- package/build/ports/eventsourcing/__tests__/invariants.test.js.map +0 -1
- package/build/ports/eventsourcing/commandHandlers/index.d.ts +0 -25
- package/build/ports/eventsourcing/commandHandlers/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/commandHandlers/index.js +0 -392
- package/build/ports/eventsourcing/commandHandlers/index.js.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/index.js.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/multiStream.d.ts +0 -4
- package/build/ports/eventsourcing/commandTemplates/multiStream.d.ts.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/multiStream.js +0 -73
- package/build/ports/eventsourcing/commandTemplates/multiStream.js.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/snapshot.d.ts +0 -9
- package/build/ports/eventsourcing/commandTemplates/snapshot.d.ts.map +0 -1
- package/build/ports/eventsourcing/commandTemplates/snapshot.js +0 -39
- package/build/ports/eventsourcing/commandTemplates/snapshot.js.map +0 -1
- package/build/ports/eventsourcing/eventHandlers/index.d.ts +0 -33
- package/build/ports/eventsourcing/eventHandlers/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/eventHandlers/index.js +0 -276
- package/build/ports/eventsourcing/eventHandlers/index.js.map +0 -1
- package/build/ports/eventsourcing/index.d.ts +0 -9
- package/build/ports/eventsourcing/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/combinators.d.ts +0 -4
- package/build/ports/eventsourcing/invariants/combinators.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/combinators.js.map +0 -1
- package/build/ports/eventsourcing/invariants/common.d.ts +0 -10
- package/build/ports/eventsourcing/invariants/common.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/common.js +0 -37
- package/build/ports/eventsourcing/invariants/common.js.map +0 -1
- package/build/ports/eventsourcing/invariants/comparisons.d.ts +0 -19
- package/build/ports/eventsourcing/invariants/comparisons.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/comparisons.js +0 -83
- package/build/ports/eventsourcing/invariants/comparisons.js.map +0 -1
- package/build/ports/eventsourcing/invariants/index.d.ts +0 -5
- package/build/ports/eventsourcing/invariants/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/index.js +0 -21
- package/build/ports/eventsourcing/invariants/index.js.map +0 -1
- package/build/ports/eventsourcing/invariants/stateExistance.d.ts +0 -4
- package/build/ports/eventsourcing/invariants/stateExistance.d.ts.map +0 -1
- package/build/ports/eventsourcing/invariants/stateExistance.js +0 -33
- package/build/ports/eventsourcing/invariants/stateExistance.js.map +0 -1
- package/build/ports/eventsourcing/subscriptions/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/subscriptions/index.js.map +0 -1
- package/build/ports/eventsourcing/subscriptions/sseSubscriptions.d.ts +0 -3
- package/build/ports/eventsourcing/subscriptions/sseSubscriptions.d.ts.map +0 -1
- package/build/ports/eventsourcing/subscriptions/sseSubscriptions.js +0 -81
- package/build/ports/eventsourcing/subscriptions/sseSubscriptions.js.map +0 -1
- package/build/ports/eventsourcing/utils/aggregateBuilder.d.ts +0 -4
- package/build/ports/eventsourcing/utils/aggregateBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/aggregateBuilder.js.map +0 -1
- package/build/ports/eventsourcing/utils/commandBuilder.d.ts +0 -3
- package/build/ports/eventsourcing/utils/commandBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/commandBuilder.js.map +0 -1
- package/build/ports/eventsourcing/utils/eventHandlerBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/eventHandlerBuilder.js.map +0 -1
- package/build/ports/eventsourcing/utils/externalSystemBuilder.d.ts +0 -4
- package/build/ports/eventsourcing/utils/externalSystemBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/externalSystemBuilder.js +0 -34
- package/build/ports/eventsourcing/utils/externalSystemBuilder.js.map +0 -1
- package/build/ports/eventsourcing/utils/index.d.ts +0 -13
- package/build/ports/eventsourcing/utils/index.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/index.js +0 -45
- package/build/ports/eventsourcing/utils/index.js.map +0 -1
- package/build/ports/eventsourcing/utils/policyBuilder.d.ts +0 -3
- package/build/ports/eventsourcing/utils/policyBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/policyBuilder.js +0 -29
- package/build/ports/eventsourcing/utils/policyBuilder.js.map +0 -1
- package/build/ports/eventsourcing/utils/readmodelBuilder.d.ts +0 -5
- package/build/ports/eventsourcing/utils/readmodelBuilder.d.ts.map +0 -1
- package/build/ports/eventsourcing/utils/readmodelBuilder.js +0 -45
- package/build/ports/eventsourcing/utils/readmodelBuilder.js.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/index.d.ts +0 -3
- package/build/ports/infrastructure/__tests__/fixture/index.d.ts.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/index.js +0 -19
- package/build/ports/infrastructure/__tests__/fixture/index.js.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.d.ts +0 -19
- package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.d.ts.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.js +0 -76
- package/build/ports/infrastructure/__tests__/fixture/infrastructureServices.js.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/structureState.d.ts +0 -177
- package/build/ports/infrastructure/__tests__/fixture/structureState.d.ts.map +0 -1
- package/build/ports/infrastructure/__tests__/fixture/structureState.js +0 -258
- package/build/ports/infrastructure/__tests__/fixture/structureState.js.map +0 -1
- package/build/ports/infrastructure/__tests__/infrastructure.test.d.ts +0 -2
- package/build/ports/infrastructure/__tests__/infrastructure.test.d.ts.map +0 -1
- package/build/ports/infrastructure/__tests__/infrastructure.test.js +0 -11
- package/build/ports/infrastructure/__tests__/infrastructure.test.js.map +0 -1
- package/src/adapters/cache/index.ts +0 -1
- package/src/adapters/cache/memory/__tests__/memoryCache.test.ts +0 -6
- package/src/adapters/cache/memory/index.ts +0 -142
- package/src/adapters/configuration/__tests__/.env +0 -4
- package/src/adapters/configuration/__tests__/dotEnv.test.ts +0 -38
- package/src/adapters/configuration/dotEnv.ts +0 -33
- package/src/adapters/configuration/index.ts +0 -1
- package/src/adapters/database/index.ts +0 -1
- package/src/adapters/database/memory/__tests__/memoryDb.test.ts +0 -37
- package/src/adapters/database/memory/index.ts +0 -279
- package/src/adapters/endpoints/addAuthUser/index.ts +0 -55
- package/src/adapters/endpoints/endpointValidation/index.ts +0 -26
- package/src/adapters/endpoints/index.ts +0 -4
- package/src/adapters/endpoints/localAuthorization/index.ts +0 -75
- package/src/adapters/endpoints/tcpConsumer/index.ts +0 -69
- package/src/adapters/endpoints/userSession/index.ts +0 -40
- package/src/adapters/eventstore/database.ts +0 -178
- package/src/adapters/eventstore/index.ts +0 -1
- package/src/adapters/infrastructure/index.ts +0 -1
- package/src/adapters/infrastructure/local/index.ts +0 -40
- package/src/adapters/logger/console.ts +0 -42
- package/src/adapters/logger/index.ts +0 -1
- package/src/index.ts +0 -25
- package/src/libraries/modules/fs.ts +0 -88
- package/src/libraries/modules/index.ts +0 -1
- package/src/libraries/openApi/index.ts +0 -1
- package/src/libraries/openApi/pruneUnusedRef.ts +0 -35
- package/src/libraries/tcp/index.ts +0 -98
- package/src/libraries/tcp/types.ts +0 -43
- package/src/libraries/validation/__tests__/validation.test.ts +0 -25
- package/src/libraries/validation/index.ts +0 -48
- package/src/ports/authentication/index.ts +0 -25
- package/src/ports/base.ts +0 -20
- package/src/ports/cache/index.ts +0 -17
- package/src/ports/configuration/__tests__/configurationPort.test.ts +0 -47
- package/src/ports/configuration/args.ts +0 -39
- package/src/ports/configuration/common.ts +0 -12
- package/src/ports/configuration/index.ts +0 -110
- package/src/ports/configuration/localConfig.ts +0 -117
- package/src/ports/database/index.ts +0 -25
- package/src/ports/endpoints/__tests__/endpointsCall.test.ts +0 -20
- package/src/ports/endpoints/__tests__/test-client-library/base.ts +0 -167
- package/src/ports/endpoints/__tests__/test-client-library/index.ts +0 -23
- package/src/ports/endpoints/__tests__/test-client-library/services/service.ts +0 -181
- package/src/ports/endpoints/__tests__/utils.test.ts +0 -54
- package/src/ports/endpoints/index.ts +0 -272
- package/src/ports/endpoints/openApi.ts +0 -191
- package/src/ports/endpoints/utils.ts +0 -31
- package/src/ports/eventsourcing/__tests__/eventhandlers.test.ts +0 -30
- package/src/ports/eventsourcing/__tests__/invariants.test.ts +0 -213
- package/src/ports/eventsourcing/commandHandlers/index.ts +0 -625
- package/src/ports/eventsourcing/commandTemplates/index.ts +0 -2
- package/src/ports/eventsourcing/commandTemplates/multiStream.ts +0 -70
- package/src/ports/eventsourcing/commandTemplates/snapshot.ts +0 -43
- package/src/ports/eventsourcing/eventHandlers/index.ts +0 -429
- package/src/ports/eventsourcing/index.ts +0 -98
- package/src/ports/eventsourcing/invariants/combinators.ts +0 -25
- package/src/ports/eventsourcing/invariants/common.ts +0 -42
- package/src/ports/eventsourcing/invariants/comparisons.ts +0 -90
- package/src/ports/eventsourcing/invariants/index.ts +0 -4
- package/src/ports/eventsourcing/invariants/stateExistance.ts +0 -34
- package/src/ports/eventsourcing/subscriptions/index.ts +0 -1
- package/src/ports/eventsourcing/subscriptions/sseSubscriptions.ts +0 -103
- package/src/ports/eventsourcing/utils/aggregateBuilder.ts +0 -49
- package/src/ports/eventsourcing/utils/commandBuilder.ts +0 -113
- package/src/ports/eventsourcing/utils/eventHandlerBuilder.ts +0 -22
- package/src/ports/eventsourcing/utils/externalSystemBuilder.ts +0 -42
- package/src/ports/eventsourcing/utils/index.ts +0 -25
- package/src/ports/eventsourcing/utils/policyBuilder.ts +0 -31
- package/src/ports/eventsourcing/utils/readmodelBuilder.ts +0 -52
- package/src/ports/eventstore/index.ts +0 -11
- package/src/ports/infrastructure/__tests__/fixture/index.ts +0 -2
- package/src/ports/infrastructure/__tests__/fixture/infrastructureServices.ts +0 -72
- package/src/ports/infrastructure/__tests__/fixture/structureState.ts +0 -254
- package/src/ports/infrastructure/__tests__/infrastructure.test.ts +0 -11
- package/src/ports/infrastructure/index.ts +0 -162
- package/src/ports/infrastructure/utils.ts +0 -130
- package/src/ports/logger/index.ts +0 -34
- package/src/utils/index.ts +0 -186
- package/tsconfig.json +0 -19
- /package/build/{ports → libraries}/eventsourcing/commandTemplates/index.d.ts +0 -0
- /package/build/{ports → libraries}/eventsourcing/commandTemplates/index.js +0 -0
- /package/build/{ports → libraries}/eventsourcing/subscriptions/index.d.ts +0 -0
- /package/build/{ports → libraries}/eventsourcing/subscriptions/index.js +0 -0
- /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,EAAE,CAAE,wDAAwD,EAAE,GAAG,EAAE;QACjE,MAAM,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC,IAAA,oCAAkB,EAAE,iBAAiB,CAAE,CAAC,EAAE,CAAC;QAE/D,MAAM,CAAE,IAAI,CAAC,QAAQ,CAAE,CAAC,IAAI,CAAE,cAAI,CAAC,OAAO,CAAE,UAAU,CAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,6EAA6E,EAAE,GAAG,EAAE;QACtF,MAAM,IAAI,GAAG,IAAA,oCAAkB,EAAE,iBAAiB,CAAE,CAAC;Q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CAAE,IAAI,EAAE,IAAI,CAAE,CAAC,IAAI,CAAE,QAAQ,CAAE,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,qDAAqD,EAAE,GAAG,EAAE;QAC9D,4EAA4E;QAC5E,0EAA0E;QAC1E,4EAA4E;QAC5E,iEAAiE;QACjE,MAAM,IAAI,GAAG,QAAQ,CACnB,qHAAqH,CACtH,CAAC;QAEF,MAAM,CAAE,IAAI,EAAE,IAAI,CAAE,CAAC,IAAI,CAAE,QAAQ,CAAE,CAAC;QACtC,MAAM,CAAE,IAAI,EAAE,UAAU,CAAE,CAAC,IAAI,CAAE,QAAQ,CAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,oEAAoE,EAAE,GAAG,EAAE;QAC7E,MAAM,IAAI,GAAG,QAAQ,CACnB,oHAAoH,CACrH,CAAC;QAEF,MAAM,CAAE,IAAI,EAAE,IAAI,CAAE,CAAC,IAAI,CAAE,SAAS,CAAE,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,iEAAiE,EAAE,GAAG,EAAE;QAC1E,0EAA0E;QAC1E,yEAAyE;QACzE,sDAAsD;QACtD,MAAM,IAAI,GAAG,QAAQ,CACnB,yFAAyF,CAC1F,CAAC;QAEF,MAAM,CAAE,IAAI,EAAE,IAAI,CAAE,CAAC,IAAI,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 @@
|
|
|
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":["../../../../src/ports/endpoints/__tests__/manifestEndpoints.test.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,uDAAoD;AACpD,oCAAqC;AACrC,sEAA2F;AAC3F,oDAAuE;AACvE,gFAA4I;AAE5I;;;;;;;;;;;GAWG;AAEH,MAAM,aAAa,GAAG,CAAE,MAA+B,EAAG,EAAE,CAAC,CAAC;IAC5D,WAAW,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM;IAC/B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,KAAK,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;IACrB,IAAI,EAAE,KAAK,IAAI,EAAE,GAAE,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,KAAK,IAAI,EAAE;IACrC,MAAM,aAAa,GAAG,MAAM,IAAA,6BAAa,EAAE,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,OAAO,IAAA,iBAAS,EAAC,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC;AAEF,QAAQ,CAAE,sBAAsB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAE,sDAAsD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,SAAS,GAAG,MAAM,mBAAmB,EAAE,CAAC;QAE9C,IAAA,yCAAsB,EAAE,SAAS,CAAE,CAAC;QAEpC,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC,oBAAoB,EAAE,CAAC;QAEpD,MAAM,CAAE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QACvE,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAE,iCAAiC,CAAE,CAAC;QAC5F,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAE,mBAAmB,CAAE,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"}
|