@imolko/ultra-ddd 2.1.4-beta → 2.1.5-beta
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/dist-browser/aggregate-root/aggregate-api.type.d.ts +39 -0
- package/dist-browser/aggregate-root/aggregate-api.type.d.ts.map +1 -1
- package/dist-browser/aggregate-root/aggregate-memento-hooks.d.ts +38 -0
- package/dist-browser/aggregate-root/aggregate-memento-hooks.d.ts.map +1 -0
- package/dist-browser/aggregate-root/aggregate-memento-hooks.js +46 -0
- package/dist-browser/aggregate-root/aggregate-memento-hooks.js.map +1 -0
- package/dist-browser/aggregate-root/aggregate-with-props.mixin.d.ts +3 -0
- package/dist-browser/aggregate-root/aggregate-with-props.mixin.d.ts.map +1 -1
- package/dist-browser/aggregate-root/aggregate-with-public-api.mixin.d.ts +40 -4
- package/dist-browser/aggregate-root/aggregate-with-public-api.mixin.d.ts.map +1 -1
- package/dist-browser/aggregate-root/aggregate-with-static-members.mixin.d.ts +7 -4
- package/dist-browser/aggregate-root/aggregate-with-static-members.mixin.d.ts.map +1 -1
- package/dist-browser/aggregate-root/aggregate-with-static-members.mixin.js +20 -10
- package/dist-browser/aggregate-root/aggregate-with-static-members.mixin.js.map +1 -1
- package/dist-browser/aggregate-root/event-sourced/errors/aggregate-replay.error.d.ts +11 -0
- package/dist-browser/aggregate-root/event-sourced/errors/aggregate-replay.error.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/errors/aggregate-replay.error.js +16 -0
- package/dist-browser/aggregate-root/event-sourced/errors/aggregate-replay.error.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/errors/index.d.ts +3 -0
- package/dist-browser/aggregate-root/event-sourced/errors/index.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/errors/index.js +3 -0
- package/dist-browser/aggregate-root/event-sourced/errors/index.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.d.ts +33 -0
- package/dist-browser/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.js +32 -0
- package/dist-browser/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced-aggregate-base.class.d.ts +126 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced-aggregate-base.class.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced-aggregate-base.class.js +178 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced-aggregate-base.class.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.fixtures.d.ts +616 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.fixtures.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.fixtures.js +139 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.fixtures.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.types.d.ts +30 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.types.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.types.js +2 -0
- package/dist-browser/aggregate-root/event-sourced/event-sourced.types.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/index.d.ts +5 -0
- package/dist-browser/aggregate-root/event-sourced/index.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/index.js +4 -0
- package/dist-browser/aggregate-root/event-sourced/index.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/domain-event-production.error.d.ts +18 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/domain-event-production.error.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/domain-event-production.error.js +19 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/domain-event-production.error.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/index.d.ts +2 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/index.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/index.js +2 -0
- package/dist-browser/aggregate-root/event-sourced/production/errors/index.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/index.d.ts +4 -0
- package/dist-browser/aggregate-root/event-sourced/production/index.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/index.js +3 -0
- package/dist-browser/aggregate-root/event-sourced/production/index.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/production.d.ts +74 -0
- package/dist-browser/aggregate-root/event-sourced/production/production.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/production/production.js +143 -0
- package/dist-browser/aggregate-root/event-sourced/production/production.js.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/recorded-event.d.ts +9 -0
- package/dist-browser/aggregate-root/event-sourced/recorded-event.d.ts.map +1 -0
- package/dist-browser/aggregate-root/event-sourced/recorded-event.js +12 -0
- package/dist-browser/aggregate-root/event-sourced/recorded-event.js.map +1 -0
- package/dist-browser/aggregate-root/index.d.ts +1 -0
- package/dist-browser/aggregate-root/index.d.ts.map +1 -1
- package/dist-browser/aggregate-root/index.js +1 -0
- package/dist-browser/aggregate-root/index.js.map +1 -1
- package/dist-browser/aggregate-root/use-examples/product-woo/aggregate.d.ts +20 -2
- package/dist-browser/aggregate-root/use-examples/product-woo/aggregate.d.ts.map +1 -1
- package/dist-browser/authorization/authenticated-subject.d.ts +61 -0
- package/dist-browser/authorization/authenticated-subject.d.ts.map +1 -0
- package/dist-browser/authorization/authenticated-subject.js +71 -0
- package/dist-browser/authorization/authenticated-subject.js.map +1 -0
- package/dist-browser/authorization/errors/authorization.error.d.ts +68 -0
- package/dist-browser/authorization/errors/authorization.error.d.ts.map +1 -0
- package/dist-browser/authorization/errors/authorization.error.js +81 -0
- package/dist-browser/authorization/errors/authorization.error.js.map +1 -0
- package/dist-browser/authorization/errors/index.d.ts +2 -0
- package/dist-browser/authorization/errors/index.d.ts.map +1 -0
- package/dist-browser/authorization/errors/index.js +2 -0
- package/dist-browser/authorization/errors/index.js.map +1 -0
- package/dist-browser/authorization/index.d.ts +7 -0
- package/dist-browser/authorization/index.d.ts.map +1 -0
- package/dist-browser/authorization/index.js +7 -0
- package/dist-browser/authorization/index.js.map +1 -0
- package/dist-browser/authorization/permission/conditions.d.ts +16 -0
- package/dist-browser/authorization/permission/conditions.d.ts.map +1 -0
- package/dist-browser/authorization/permission/conditions.js +17 -0
- package/dist-browser/authorization/permission/conditions.js.map +1 -0
- package/dist-browser/authorization/permission/definition.d.ts +23 -0
- package/dist-browser/authorization/permission/definition.d.ts.map +1 -0
- package/dist-browser/authorization/permission/definition.js +34 -0
- package/dist-browser/authorization/permission/definition.js.map +1 -0
- package/dist-browser/authorization/permission/errors.d.ts +3 -0
- package/dist-browser/authorization/permission/errors.d.ts.map +1 -0
- package/dist-browser/authorization/permission/errors.js +2 -0
- package/dist-browser/authorization/permission/errors.js.map +1 -0
- package/dist-browser/authorization/permission/index.d.ts +5 -0
- package/dist-browser/authorization/permission/index.d.ts.map +1 -0
- package/dist-browser/authorization/permission/index.js +2 -0
- package/dist-browser/authorization/permission/index.js.map +1 -0
- package/dist-browser/authorization/permission/payload.d.ts +4 -0
- package/dist-browser/authorization/permission/payload.d.ts.map +1 -0
- package/dist-browser/authorization/permission/payload.js +2 -0
- package/dist-browser/authorization/permission/payload.js.map +1 -0
- package/dist-browser/authorization/permission/primitive.d.ts +2 -0
- package/dist-browser/authorization/permission/primitive.d.ts.map +1 -0
- package/dist-browser/authorization/permission/primitive.js +2 -0
- package/dist-browser/authorization/permission/primitive.js.map +1 -0
- package/dist-browser/authorization/permission/props.d.ts +7 -0
- package/dist-browser/authorization/permission/props.d.ts.map +1 -0
- package/dist-browser/authorization/permission/props.js +2 -0
- package/dist-browser/authorization/permission/props.js.map +1 -0
- package/dist-browser/authorization/permission/value-object.d.ts +102 -0
- package/dist-browser/authorization/permission/value-object.d.ts.map +1 -0
- package/dist-browser/authorization/permission/value-object.js +17 -0
- package/dist-browser/authorization/permission/value-object.js.map +1 -0
- package/dist-browser/authorization/ports/authentication.port.d.ts +32 -0
- package/dist-browser/authorization/ports/authentication.port.d.ts.map +1 -0
- package/dist-browser/authorization/ports/authentication.port.js +2 -0
- package/dist-browser/authorization/ports/authentication.port.js.map +1 -0
- package/dist-browser/authorization/ports/authorization.port.d.ts +32 -0
- package/dist-browser/authorization/ports/authorization.port.d.ts.map +1 -0
- package/dist-browser/authorization/ports/authorization.port.js +8 -0
- package/dist-browser/authorization/ports/authorization.port.js.map +1 -0
- package/dist-browser/authorization/ports/index.d.ts +3 -0
- package/dist-browser/authorization/ports/index.d.ts.map +1 -0
- package/dist-browser/authorization/ports/index.js +3 -0
- package/dist-browser/authorization/ports/index.js.map +1 -0
- package/dist-browser/authorization/secured-use-case/index.d.ts +3 -0
- package/dist-browser/authorization/secured-use-case/index.d.ts.map +1 -0
- package/dist-browser/authorization/secured-use-case/index.js +3 -0
- package/dist-browser/authorization/secured-use-case/index.js.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.fixtures.d.ts +55 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.fixtures.d.ts.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.fixtures.js +76 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.fixtures.js.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.mixin.d.ts +14 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.mixin.d.ts.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.mixin.js +99 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.mixin.js.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.types.d.ts +71 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.types.d.ts.map +1 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.types.js +2 -0
- package/dist-browser/authorization/secured-use-case/secured-use-case.types.js.map +1 -0
- package/dist-browser/authorization/security/conditions.d.ts +21 -0
- package/dist-browser/authorization/security/conditions.d.ts.map +1 -0
- package/dist-browser/authorization/security/conditions.js +22 -0
- package/dist-browser/authorization/security/conditions.js.map +1 -0
- package/dist-browser/authorization/security/definition.d.ts +23 -0
- package/dist-browser/authorization/security/definition.d.ts.map +1 -0
- package/dist-browser/authorization/security/definition.js +40 -0
- package/dist-browser/authorization/security/definition.js.map +1 -0
- package/dist-browser/authorization/security/errors.d.ts +3 -0
- package/dist-browser/authorization/security/errors.d.ts.map +1 -0
- package/dist-browser/authorization/security/errors.js +2 -0
- package/dist-browser/authorization/security/errors.js.map +1 -0
- package/dist-browser/authorization/security/index.d.ts +6 -0
- package/dist-browser/authorization/security/index.d.ts.map +1 -0
- package/dist-browser/authorization/security/index.js +3 -0
- package/dist-browser/authorization/security/index.js.map +1 -0
- package/dist-browser/authorization/security/payload.d.ts +4 -0
- package/dist-browser/authorization/security/payload.d.ts.map +1 -0
- package/dist-browser/authorization/security/payload.js +2 -0
- package/dist-browser/authorization/security/payload.js.map +1 -0
- package/dist-browser/authorization/security/primitive.d.ts +13 -0
- package/dist-browser/authorization/security/primitive.d.ts.map +1 -0
- package/dist-browser/authorization/security/primitive.js +2 -0
- package/dist-browser/authorization/security/primitive.js.map +1 -0
- package/dist-browser/authorization/security/props.d.ts +11 -0
- package/dist-browser/authorization/security/props.d.ts.map +1 -0
- package/dist-browser/authorization/security/props.js +2 -0
- package/dist-browser/authorization/security/props.js.map +1 -0
- package/dist-browser/authorization/security/value-object.d.ts +214 -0
- package/dist-browser/authorization/security/value-object.d.ts.map +1 -0
- package/dist-browser/authorization/security/value-object.js +55 -0
- package/dist-browser/authorization/security/value-object.js.map +1 -0
- package/dist-browser/entity/identity/identifiable.interface.d.ts +21 -0
- package/dist-browser/entity/identity/identifiable.interface.d.ts.map +1 -0
- package/dist-browser/entity/identity/identifiable.interface.js +2 -0
- package/dist-browser/entity/identity/identifiable.interface.js.map +1 -0
- package/dist-browser/entity/identity/index.d.ts +3 -0
- package/dist-browser/entity/identity/index.d.ts.map +1 -1
- package/dist-browser/entity/identity/index.js +3 -0
- package/dist-browser/entity/identity/index.js.map +1 -1
- package/dist-browser/entity/identity/subject-id/conditions.d.ts +11 -0
- package/dist-browser/entity/identity/subject-id/conditions.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/conditions.js +15 -0
- package/dist-browser/entity/identity/subject-id/conditions.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/definition.d.ts +30 -0
- package/dist-browser/entity/identity/subject-id/definition.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/definition.js +47 -0
- package/dist-browser/entity/identity/subject-id/definition.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/errors.d.ts +3 -0
- package/dist-browser/entity/identity/subject-id/errors.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/errors.js +2 -0
- package/dist-browser/entity/identity/subject-id/errors.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/index.d.ts +5 -0
- package/dist-browser/entity/identity/subject-id/index.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/index.js +2 -0
- package/dist-browser/entity/identity/subject-id/index.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/payload.d.ts +4 -0
- package/dist-browser/entity/identity/subject-id/payload.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/payload.js +2 -0
- package/dist-browser/entity/identity/subject-id/payload.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/primitive.d.ts +2 -0
- package/dist-browser/entity/identity/subject-id/primitive.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/primitive.js +2 -0
- package/dist-browser/entity/identity/subject-id/primitive.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/props.d.ts +7 -0
- package/dist-browser/entity/identity/subject-id/props.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/props.js +2 -0
- package/dist-browser/entity/identity/subject-id/props.js.map +1 -0
- package/dist-browser/entity/identity/subject-id/value-object.d.ts +102 -0
- package/dist-browser/entity/identity/subject-id/value-object.d.ts.map +1 -0
- package/dist-browser/entity/identity/subject-id/value-object.js +17 -0
- package/dist-browser/entity/identity/subject-id/value-object.js.map +1 -0
- package/dist-browser/event/domain-event/domain-event-factory.mixin.d.ts +10 -1
- package/dist-browser/event/domain-event/domain-event-factory.mixin.d.ts.map +1 -1
- package/dist-browser/event/domain-event/domain-event-factory.mixin.js.map +1 -1
- package/dist-browser/event/domain-event/event-data.type.d.ts +53 -0
- package/dist-browser/event/domain-event/event-data.type.d.ts.map +1 -0
- package/dist-browser/event/domain-event/event-data.type.js +2 -0
- package/dist-browser/event/domain-event/event-data.type.js.map +1 -0
- package/dist-browser/event/domain-event/event-definition-payload.d.ts +4 -0
- package/dist-browser/event/domain-event/event-definition-payload.d.ts.map +1 -1
- package/dist-browser/event/domain-event/index.d.ts +2 -0
- package/dist-browser/event/domain-event/index.d.ts.map +1 -1
- package/dist-browser/event/domain-event/index.js.map +1 -1
- package/dist-browser/event/use-samples/file-uploaded/definition.d.ts +57 -2
- package/dist-browser/event/use-samples/file-uploaded/definition.d.ts.map +1 -1
- package/dist-browser/event/use-samples/file-uploaded/definition.js.map +1 -1
- package/dist-browser/event/use-samples/file-uploaded/event.d.ts +47 -1
- package/dist-browser/event/use-samples/file-uploaded/event.d.ts.map +1 -1
- package/dist-browser/event/use-samples/nested-event/definition.d.ts +66 -2
- package/dist-browser/event/use-samples/nested-event/definition.d.ts.map +1 -1
- package/dist-browser/event/use-samples/nested-event/definition.js.map +1 -1
- package/dist-browser/event/use-samples/nested-event/event.d.ts +56 -1
- package/dist-browser/event/use-samples/nested-event/event.d.ts.map +1 -1
- package/dist-browser/event/use-samples/validated-artifact/artifacts/aggregate.d.ts +20 -2
- package/dist-browser/event/use-samples/validated-artifact/artifacts/aggregate.d.ts.map +1 -1
- package/dist-browser/event/use-samples/validated-artifact/definition.d.ts +54 -2
- package/dist-browser/event/use-samples/validated-artifact/definition.d.ts.map +1 -1
- package/dist-browser/event/use-samples/validated-artifact/definition.js.map +1 -1
- package/dist-browser/event/use-samples/validated-artifact/event.d.ts +44 -1
- package/dist-browser/event/use-samples/validated-artifact/event.d.ts.map +1 -1
- package/dist-browser/helpers/copy-value.d.ts +12 -0
- package/dist-browser/helpers/copy-value.d.ts.map +1 -0
- package/dist-browser/helpers/copy-value.js +38 -0
- package/dist-browser/helpers/copy-value.js.map +1 -0
- package/dist-browser/index.d.ts +1 -0
- package/dist-browser/index.d.ts.map +1 -1
- package/dist-browser/index.js +1 -0
- package/dist-browser/index.js.map +1 -1
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.d.ts +20 -2
- package/dist-browser/test/execute-sequentially/artifacts/aggregate.d.ts.map +1 -1
- package/dist-node/aggregate-root/aggregate-api.type.d.ts +39 -0
- package/dist-node/aggregate-root/aggregate-api.type.d.ts.map +1 -1
- package/dist-node/aggregate-root/aggregate-memento-hooks.d.ts +38 -0
- package/dist-node/aggregate-root/aggregate-memento-hooks.d.ts.map +1 -0
- package/dist-node/aggregate-root/aggregate-memento-hooks.js +51 -0
- package/dist-node/aggregate-root/aggregate-memento-hooks.js.map +1 -0
- package/dist-node/aggregate-root/aggregate-with-props.mixin.d.ts +3 -0
- package/dist-node/aggregate-root/aggregate-with-props.mixin.d.ts.map +1 -1
- package/dist-node/aggregate-root/aggregate-with-public-api.mixin.d.ts +40 -4
- package/dist-node/aggregate-root/aggregate-with-public-api.mixin.d.ts.map +1 -1
- package/dist-node/aggregate-root/aggregate-with-static-members.mixin.d.ts +7 -4
- package/dist-node/aggregate-root/aggregate-with-static-members.mixin.d.ts.map +1 -1
- package/dist-node/aggregate-root/aggregate-with-static-members.mixin.js +20 -10
- package/dist-node/aggregate-root/aggregate-with-static-members.mixin.js.map +1 -1
- package/dist-node/aggregate-root/event-sourced/errors/aggregate-replay.error.d.ts +11 -0
- package/dist-node/aggregate-root/event-sourced/errors/aggregate-replay.error.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/errors/aggregate-replay.error.js +20 -0
- package/dist-node/aggregate-root/event-sourced/errors/aggregate-replay.error.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/errors/index.d.ts +3 -0
- package/dist-node/aggregate-root/event-sourced/errors/index.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/errors/index.js +19 -0
- package/dist-node/aggregate-root/event-sourced/errors/index.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.d.ts +33 -0
- package/dist-node/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.js +36 -0
- package/dist-node/aggregate-root/event-sourced/errors/stream-concurrency-conflict.error.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced-aggregate-base.class.d.ts +126 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced-aggregate-base.class.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced-aggregate-base.class.js +182 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced-aggregate-base.class.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.fixtures.d.ts +616 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.fixtures.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.fixtures.js +149 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.fixtures.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.types.d.ts +30 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.types.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.types.js +3 -0
- package/dist-node/aggregate-root/event-sourced/event-sourced.types.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/index.d.ts +5 -0
- package/dist-node/aggregate-root/event-sourced/index.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/index.js +23 -0
- package/dist-node/aggregate-root/event-sourced/index.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/domain-event-production.error.d.ts +18 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/domain-event-production.error.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/domain-event-production.error.js +23 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/domain-event-production.error.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/index.d.ts +2 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/index.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/index.js +18 -0
- package/dist-node/aggregate-root/event-sourced/production/errors/index.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/index.d.ts +4 -0
- package/dist-node/aggregate-root/event-sourced/production/index.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/index.js +24 -0
- package/dist-node/aggregate-root/event-sourced/production/index.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/production.d.ts +74 -0
- package/dist-node/aggregate-root/event-sourced/production/production.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/production/production.js +150 -0
- package/dist-node/aggregate-root/event-sourced/production/production.js.map +1 -0
- package/dist-node/aggregate-root/event-sourced/recorded-event.d.ts +9 -0
- package/dist-node/aggregate-root/event-sourced/recorded-event.d.ts.map +1 -0
- package/dist-node/aggregate-root/event-sourced/recorded-event.js +16 -0
- package/dist-node/aggregate-root/event-sourced/recorded-event.js.map +1 -0
- package/dist-node/aggregate-root/index.d.ts +1 -0
- package/dist-node/aggregate-root/index.d.ts.map +1 -1
- package/dist-node/aggregate-root/index.js +1 -0
- package/dist-node/aggregate-root/index.js.map +1 -1
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.d.ts +20 -2
- package/dist-node/aggregate-root/use-examples/product-woo/aggregate.d.ts.map +1 -1
- package/dist-node/authorization/authenticated-subject.d.ts +61 -0
- package/dist-node/authorization/authenticated-subject.d.ts.map +1 -0
- package/dist-node/authorization/authenticated-subject.js +75 -0
- package/dist-node/authorization/authenticated-subject.js.map +1 -0
- package/dist-node/authorization/errors/authorization.error.d.ts +68 -0
- package/dist-node/authorization/errors/authorization.error.d.ts.map +1 -0
- package/dist-node/authorization/errors/authorization.error.js +85 -0
- package/dist-node/authorization/errors/authorization.error.js.map +1 -0
- package/dist-node/authorization/errors/index.d.ts +2 -0
- package/dist-node/authorization/errors/index.d.ts.map +1 -0
- package/dist-node/authorization/errors/index.js +18 -0
- package/dist-node/authorization/errors/index.js.map +1 -0
- package/dist-node/authorization/index.d.ts +7 -0
- package/dist-node/authorization/index.d.ts.map +1 -0
- package/dist-node/authorization/index.js +23 -0
- package/dist-node/authorization/index.js.map +1 -0
- package/dist-node/authorization/permission/conditions.d.ts +16 -0
- package/dist-node/authorization/permission/conditions.d.ts.map +1 -0
- package/dist-node/authorization/permission/conditions.js +20 -0
- package/dist-node/authorization/permission/conditions.js.map +1 -0
- package/dist-node/authorization/permission/definition.d.ts +23 -0
- package/dist-node/authorization/permission/definition.d.ts.map +1 -0
- package/dist-node/authorization/permission/definition.js +37 -0
- package/dist-node/authorization/permission/definition.js.map +1 -0
- package/dist-node/authorization/permission/errors.d.ts +3 -0
- package/dist-node/authorization/permission/errors.d.ts.map +1 -0
- package/dist-node/authorization/permission/errors.js +3 -0
- package/dist-node/authorization/permission/errors.js.map +1 -0
- package/dist-node/authorization/permission/index.d.ts +5 -0
- package/dist-node/authorization/permission/index.d.ts.map +1 -0
- package/dist-node/authorization/permission/index.js +6 -0
- package/dist-node/authorization/permission/index.js.map +1 -0
- package/dist-node/authorization/permission/payload.d.ts +4 -0
- package/dist-node/authorization/permission/payload.d.ts.map +1 -0
- package/dist-node/authorization/permission/payload.js +3 -0
- package/dist-node/authorization/permission/payload.js.map +1 -0
- package/dist-node/authorization/permission/primitive.d.ts +2 -0
- package/dist-node/authorization/permission/primitive.d.ts.map +1 -0
- package/dist-node/authorization/permission/primitive.js +3 -0
- package/dist-node/authorization/permission/primitive.js.map +1 -0
- package/dist-node/authorization/permission/props.d.ts +7 -0
- package/dist-node/authorization/permission/props.d.ts.map +1 -0
- package/dist-node/authorization/permission/props.js +3 -0
- package/dist-node/authorization/permission/props.js.map +1 -0
- package/dist-node/authorization/permission/value-object.d.ts +102 -0
- package/dist-node/authorization/permission/value-object.d.ts.map +1 -0
- package/dist-node/authorization/permission/value-object.js +20 -0
- package/dist-node/authorization/permission/value-object.js.map +1 -0
- package/dist-node/authorization/ports/authentication.port.d.ts +32 -0
- package/dist-node/authorization/ports/authentication.port.d.ts.map +1 -0
- package/dist-node/authorization/ports/authentication.port.js +3 -0
- package/dist-node/authorization/ports/authentication.port.js.map +1 -0
- package/dist-node/authorization/ports/authorization.port.d.ts +32 -0
- package/dist-node/authorization/ports/authorization.port.d.ts.map +1 -0
- package/dist-node/authorization/ports/authorization.port.js +11 -0
- package/dist-node/authorization/ports/authorization.port.js.map +1 -0
- package/dist-node/authorization/ports/index.d.ts +3 -0
- package/dist-node/authorization/ports/index.d.ts.map +1 -0
- package/dist-node/authorization/ports/index.js +19 -0
- package/dist-node/authorization/ports/index.js.map +1 -0
- package/dist-node/authorization/secured-use-case/index.d.ts +3 -0
- package/dist-node/authorization/secured-use-case/index.d.ts.map +1 -0
- package/dist-node/authorization/secured-use-case/index.js +19 -0
- package/dist-node/authorization/secured-use-case/index.js.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.fixtures.d.ts +55 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.fixtures.d.ts.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.fixtures.js +89 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.fixtures.js.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.mixin.d.ts +14 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.mixin.d.ts.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.mixin.js +103 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.mixin.js.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.types.d.ts +71 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.types.d.ts.map +1 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.types.js +3 -0
- package/dist-node/authorization/secured-use-case/secured-use-case.types.js.map +1 -0
- package/dist-node/authorization/security/conditions.d.ts +21 -0
- package/dist-node/authorization/security/conditions.d.ts.map +1 -0
- package/dist-node/authorization/security/conditions.js +25 -0
- package/dist-node/authorization/security/conditions.js.map +1 -0
- package/dist-node/authorization/security/definition.d.ts +23 -0
- package/dist-node/authorization/security/definition.d.ts.map +1 -0
- package/dist-node/authorization/security/definition.js +43 -0
- package/dist-node/authorization/security/definition.js.map +1 -0
- package/dist-node/authorization/security/errors.d.ts +3 -0
- package/dist-node/authorization/security/errors.d.ts.map +1 -0
- package/dist-node/authorization/security/errors.js +3 -0
- package/dist-node/authorization/security/errors.js.map +1 -0
- package/dist-node/authorization/security/index.d.ts +6 -0
- package/dist-node/authorization/security/index.d.ts.map +1 -0
- package/dist-node/authorization/security/index.js +8 -0
- package/dist-node/authorization/security/index.js.map +1 -0
- package/dist-node/authorization/security/payload.d.ts +4 -0
- package/dist-node/authorization/security/payload.d.ts.map +1 -0
- package/dist-node/authorization/security/payload.js +3 -0
- package/dist-node/authorization/security/payload.js.map +1 -0
- package/dist-node/authorization/security/primitive.d.ts +13 -0
- package/dist-node/authorization/security/primitive.d.ts.map +1 -0
- package/dist-node/authorization/security/primitive.js +3 -0
- package/dist-node/authorization/security/primitive.js.map +1 -0
- package/dist-node/authorization/security/props.d.ts +11 -0
- package/dist-node/authorization/security/props.d.ts.map +1 -0
- package/dist-node/authorization/security/props.js +3 -0
- package/dist-node/authorization/security/props.js.map +1 -0
- package/dist-node/authorization/security/value-object.d.ts +214 -0
- package/dist-node/authorization/security/value-object.d.ts.map +1 -0
- package/dist-node/authorization/security/value-object.js +58 -0
- package/dist-node/authorization/security/value-object.js.map +1 -0
- package/dist-node/entity/identity/identifiable.interface.d.ts +21 -0
- package/dist-node/entity/identity/identifiable.interface.d.ts.map +1 -0
- package/dist-node/entity/identity/identifiable.interface.js +3 -0
- package/dist-node/entity/identity/identifiable.interface.js.map +1 -0
- package/dist-node/entity/identity/index.d.ts +3 -0
- package/dist-node/entity/identity/index.d.ts.map +1 -1
- package/dist-node/entity/identity/index.js +3 -0
- package/dist-node/entity/identity/index.js.map +1 -1
- package/dist-node/entity/identity/subject-id/conditions.d.ts +11 -0
- package/dist-node/entity/identity/subject-id/conditions.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/conditions.js +18 -0
- package/dist-node/entity/identity/subject-id/conditions.js.map +1 -0
- package/dist-node/entity/identity/subject-id/definition.d.ts +30 -0
- package/dist-node/entity/identity/subject-id/definition.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/definition.js +50 -0
- package/dist-node/entity/identity/subject-id/definition.js.map +1 -0
- package/dist-node/entity/identity/subject-id/errors.d.ts +3 -0
- package/dist-node/entity/identity/subject-id/errors.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/errors.js +3 -0
- package/dist-node/entity/identity/subject-id/errors.js.map +1 -0
- package/dist-node/entity/identity/subject-id/index.d.ts +5 -0
- package/dist-node/entity/identity/subject-id/index.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/index.js +6 -0
- package/dist-node/entity/identity/subject-id/index.js.map +1 -0
- package/dist-node/entity/identity/subject-id/payload.d.ts +4 -0
- package/dist-node/entity/identity/subject-id/payload.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/payload.js +3 -0
- package/dist-node/entity/identity/subject-id/payload.js.map +1 -0
- package/dist-node/entity/identity/subject-id/primitive.d.ts +2 -0
- package/dist-node/entity/identity/subject-id/primitive.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/primitive.js +3 -0
- package/dist-node/entity/identity/subject-id/primitive.js.map +1 -0
- package/dist-node/entity/identity/subject-id/props.d.ts +7 -0
- package/dist-node/entity/identity/subject-id/props.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/props.js +3 -0
- package/dist-node/entity/identity/subject-id/props.js.map +1 -0
- package/dist-node/entity/identity/subject-id/value-object.d.ts +102 -0
- package/dist-node/entity/identity/subject-id/value-object.d.ts.map +1 -0
- package/dist-node/entity/identity/subject-id/value-object.js +20 -0
- package/dist-node/entity/identity/subject-id/value-object.js.map +1 -0
- package/dist-node/event/domain-event/domain-event-factory.mixin.d.ts +10 -1
- package/dist-node/event/domain-event/domain-event-factory.mixin.d.ts.map +1 -1
- package/dist-node/event/domain-event/domain-event-factory.mixin.js.map +1 -1
- package/dist-node/event/domain-event/event-data.type.d.ts +53 -0
- package/dist-node/event/domain-event/event-data.type.d.ts.map +1 -0
- package/dist-node/event/domain-event/event-data.type.js +3 -0
- package/dist-node/event/domain-event/event-data.type.js.map +1 -0
- package/dist-node/event/domain-event/event-definition-payload.d.ts +4 -0
- package/dist-node/event/domain-event/event-definition-payload.d.ts.map +1 -1
- package/dist-node/event/domain-event/index.d.ts +2 -0
- package/dist-node/event/domain-event/index.d.ts.map +1 -1
- package/dist-node/event/domain-event/index.js.map +1 -1
- package/dist-node/event/use-samples/file-uploaded/definition.d.ts +57 -2
- package/dist-node/event/use-samples/file-uploaded/definition.d.ts.map +1 -1
- package/dist-node/event/use-samples/file-uploaded/definition.js.map +1 -1
- package/dist-node/event/use-samples/file-uploaded/event.d.ts +47 -1
- package/dist-node/event/use-samples/file-uploaded/event.d.ts.map +1 -1
- package/dist-node/event/use-samples/nested-event/definition.d.ts +66 -2
- package/dist-node/event/use-samples/nested-event/definition.d.ts.map +1 -1
- package/dist-node/event/use-samples/nested-event/definition.js.map +1 -1
- package/dist-node/event/use-samples/nested-event/event.d.ts +56 -1
- package/dist-node/event/use-samples/nested-event/event.d.ts.map +1 -1
- package/dist-node/event/use-samples/validated-artifact/artifacts/aggregate.d.ts +20 -2
- package/dist-node/event/use-samples/validated-artifact/artifacts/aggregate.d.ts.map +1 -1
- package/dist-node/event/use-samples/validated-artifact/definition.d.ts +54 -2
- package/dist-node/event/use-samples/validated-artifact/definition.d.ts.map +1 -1
- package/dist-node/event/use-samples/validated-artifact/definition.js.map +1 -1
- package/dist-node/event/use-samples/validated-artifact/event.d.ts +44 -1
- package/dist-node/event/use-samples/validated-artifact/event.d.ts.map +1 -1
- package/dist-node/helpers/copy-value.d.ts +12 -0
- package/dist-node/helpers/copy-value.d.ts.map +1 -0
- package/dist-node/helpers/copy-value.js +42 -0
- package/dist-node/helpers/copy-value.js.map +1 -0
- package/dist-node/index.d.ts +1 -0
- package/dist-node/index.d.ts.map +1 -1
- package/dist-node/index.js +1 -0
- package/dist-node/index.js.map +1 -1
- package/dist-node/test/execute-sequentially/artifacts/aggregate.d.ts +20 -2
- package/dist-node/test/execute-sequentially/artifacts/aggregate.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Permission = void 0;
|
|
4
|
+
var value_object_1 = require("./value-object");
|
|
5
|
+
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return value_object_1.Permission; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authorization/permission/index.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAAnC,0GAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/authorization/permission/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../src/authorization/permission/payload.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["../../../src/authorization/permission/primitive.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../../src/authorization/permission/primitive.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/authorization/permission/props.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/authorization/permission/props.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Definition } from './definition';
|
|
2
|
+
import { Errors } from './errors';
|
|
3
|
+
import { Props } from './props';
|
|
4
|
+
declare const Permission_base: ((abstract new (...args: any[]) => {
|
|
5
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
6
|
+
readonly props: Readonly<Props>;
|
|
7
|
+
equals<Implemented extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
8
|
+
getPrimitive(): string;
|
|
9
|
+
getPayload(): string;
|
|
10
|
+
}) & {
|
|
11
|
+
factoryUsed: boolean;
|
|
12
|
+
rules<Implemented extends /*elided*/ any & {
|
|
13
|
+
new (...args: any[]): {
|
|
14
|
+
readonly props: Readonly<Props>;
|
|
15
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
16
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
17
|
+
getPrimitive(): string;
|
|
18
|
+
getPayload(): string;
|
|
19
|
+
} & Props;
|
|
20
|
+
prototype: {
|
|
21
|
+
readonly props: Readonly<Props>;
|
|
22
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
23
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
24
|
+
getPrimitive(): string;
|
|
25
|
+
getPayload(): string;
|
|
26
|
+
} & Props;
|
|
27
|
+
} & ((abstract new (...args: any[]) => {
|
|
28
|
+
readonly props: Readonly<Props>;
|
|
29
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
30
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
31
|
+
getPrimitive(): string;
|
|
32
|
+
getPayload(): string;
|
|
33
|
+
}) & {
|
|
34
|
+
conditions: import("zod").ZodType;
|
|
35
|
+
builder?(value: Props): import("../..").ValueObjectBase<Props, string, string>;
|
|
36
|
+
NAME: string;
|
|
37
|
+
}) & typeof Definition>(this: Implemented): import("zod").ZodType<InstanceType<Implemented>, string, import("zod/v4/core").$ZodTypeInternals<InstanceType<Implemented>, string>>;
|
|
38
|
+
of<Implemented extends /*elided*/ any & {
|
|
39
|
+
new (...args: any[]): {
|
|
40
|
+
readonly props: Readonly<Props>;
|
|
41
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
42
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
43
|
+
getPrimitive(): string;
|
|
44
|
+
getPayload(): string;
|
|
45
|
+
} & Props;
|
|
46
|
+
prototype: {
|
|
47
|
+
readonly props: Readonly<Props>;
|
|
48
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
49
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
50
|
+
getPrimitive(): string;
|
|
51
|
+
getPayload(): string;
|
|
52
|
+
} & Props;
|
|
53
|
+
} & ((abstract new (...args: any[]) => {
|
|
54
|
+
readonly props: Readonly<Props>;
|
|
55
|
+
equals<Implemented_1 extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented_1, other?: Implemented_1 | undefined): boolean;
|
|
56
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
57
|
+
getPrimitive(): string;
|
|
58
|
+
getPayload(): string;
|
|
59
|
+
}) & {
|
|
60
|
+
conditions: import("zod").ZodType;
|
|
61
|
+
builder?(value: Props): import("../..").ValueObjectBase<Props, string, string>;
|
|
62
|
+
NAME: string;
|
|
63
|
+
}) & typeof Definition>(this: Implemented, payload: string): import("@imolko/ultra-result").Validation<Errors, InstanceType<Implemented>>;
|
|
64
|
+
builder(props: Props): {
|
|
65
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
66
|
+
readonly props: Readonly<Props>;
|
|
67
|
+
equals<Implemented extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
68
|
+
getPrimitive(): string;
|
|
69
|
+
getPayload(): string;
|
|
70
|
+
};
|
|
71
|
+
conditions: import("zod").ZodType;
|
|
72
|
+
NAME: string;
|
|
73
|
+
}) & {
|
|
74
|
+
new (...args: any[]): {
|
|
75
|
+
readonly props: Readonly<Props>;
|
|
76
|
+
equals<Implemented extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
77
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
78
|
+
getPrimitive(): string;
|
|
79
|
+
getPayload(): string;
|
|
80
|
+
} & Props;
|
|
81
|
+
prototype: {
|
|
82
|
+
readonly props: Readonly<Props>;
|
|
83
|
+
equals<Implemented extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
84
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
85
|
+
getPrimitive(): string;
|
|
86
|
+
getPayload(): string;
|
|
87
|
+
} & Props;
|
|
88
|
+
} & ((abstract new (...args: any[]) => {
|
|
89
|
+
readonly props: Readonly<Props>;
|
|
90
|
+
equals<Implemented extends import("../..").ValueObjectBase<Props, string, string>>(this: Implemented, other?: Implemented | undefined): boolean;
|
|
91
|
+
clone(changes: Partial<Props>): /*elided*/ any;
|
|
92
|
+
getPrimitive(): string;
|
|
93
|
+
getPayload(): string;
|
|
94
|
+
}) & {
|
|
95
|
+
conditions: import("zod").ZodType;
|
|
96
|
+
builder?(value: Props): import("../..").ValueObjectBase<Props, string, string>;
|
|
97
|
+
NAME: string;
|
|
98
|
+
}) & typeof Definition;
|
|
99
|
+
export declare class Permission extends Permission_base {
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
102
|
+
//# sourceMappingURL=value-object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-object.d.ts","sourceRoot":"","sources":["../../../src/authorization/permission/value-object.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,qBAIa,UAAW,SAAQ,eAMnB;CAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.Permission = void 0;
|
|
10
|
+
const value_object_1 = require("../../value-object");
|
|
11
|
+
const definition_1 = require("./definition");
|
|
12
|
+
let Permission = class Permission extends (0, value_object_1.ValueObjectWithPublicApi)(definition_1.Definition) {
|
|
13
|
+
};
|
|
14
|
+
exports.Permission = Permission;
|
|
15
|
+
exports.Permission = Permission = __decorate([
|
|
16
|
+
(0, value_object_1.RegisterValueObject)({
|
|
17
|
+
description: 'Permiso con la gramática <contexto>:<acción>, declarado por el caso de uso seguro',
|
|
18
|
+
})
|
|
19
|
+
], Permission);
|
|
20
|
+
//# sourceMappingURL=value-object.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-object.js","sourceRoot":"","sources":["../../../src/authorization/permission/value-object.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAG4B;AAE5B,6CAA0C;AAUnC,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,IAAA,uCAAwB,EAMtD,uBAAU,CAAC;CAAG,CAAA;AANH,gCAAU;qBAAV,UAAU;IAJtB,IAAA,kCAAmB,EAAC;QACnB,WAAW,EACT,mFAAmF;KACtF,CAAC;GACW,UAAU,CAMP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Validation } from '@imolko/ultra-result';
|
|
2
|
+
import { Identifiable, SubjectId } from '../../entity/identity';
|
|
3
|
+
import { AuthenticatedSubject } from '../authenticated-subject';
|
|
4
|
+
/**
|
|
5
|
+
* Resultado de autenticar la data cruda del transporte.
|
|
6
|
+
*
|
|
7
|
+
* @template Id Tipo de identidad del sujeto
|
|
8
|
+
* @template Errors Errores del transporte al autenticar
|
|
9
|
+
*/
|
|
10
|
+
export type AuthenticationResult<Id extends Identifiable = SubjectId, Errors = unknown> = Validation<Errors, AuthenticatedSubject<Id>>;
|
|
11
|
+
/**
|
|
12
|
+
* Puerto genérico de autenticación.
|
|
13
|
+
*
|
|
14
|
+
* La autenticación es vocabulario del transporte y la implementa el driver:
|
|
15
|
+
* traduce la data cruda (credenciales, token, sesión) a un sujeto autenticado.
|
|
16
|
+
* El caso de uso seguro recibe el sujeto ya autenticado en `run`, por lo que
|
|
17
|
+
* este puerto no participa del enforcement del caso de uso.
|
|
18
|
+
*
|
|
19
|
+
* @template RawData Forma cruda que entrega el transporte
|
|
20
|
+
* @template Id Tipo de identidad del sujeto
|
|
21
|
+
* @template Errors Errores del transporte al autenticar
|
|
22
|
+
*/
|
|
23
|
+
export interface AuthenticationPort<RawData = unknown, Id extends Identifiable = SubjectId, Errors = unknown> {
|
|
24
|
+
/**
|
|
25
|
+
* Autentica la data cruda del transporte.
|
|
26
|
+
*
|
|
27
|
+
* @param rawData Data cruda del transporte
|
|
28
|
+
* @returns Validación con los errores de autenticación o con el sujeto
|
|
29
|
+
*/
|
|
30
|
+
authenticate(rawData: RawData): AuthenticationResult<Id, Errors> | Promise<AuthenticationResult<Id, Errors>>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=authentication.port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.port.d.ts","sourceRoot":"","sources":["../../../src/authorization/ports/authentication.port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,CAC9B,EAAE,SAAS,YAAY,GAAG,SAAS,EACnC,MAAM,GAAG,OAAO,IACd,UAAU,CAAC,MAAM,EAAE,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB,CACjC,OAAO,GAAG,OAAO,EACjB,EAAE,SAAS,YAAY,GAAG,SAAS,EACnC,MAAM,GAAG,OAAO;IAEhB;;;;;OAKG;IACH,YAAY,CACV,OAAO,EAAE,OAAO,GAEd,oBAAoB,CAAC,EAAE,EAAE,MAAM,CAAC,GAChC,OAAO,CAAC,oBAAoB,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.port.js","sourceRoot":"","sources":["../../../src/authorization/ports/authentication.port.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Identifiable, SubjectId } from '../../entity/identity';
|
|
2
|
+
import { AuthenticatedSubject } from '../authenticated-subject';
|
|
3
|
+
import { Permission } from '../permission';
|
|
4
|
+
/**
|
|
5
|
+
* Decisiones que puede devolver un puerto de autorización.
|
|
6
|
+
*
|
|
7
|
+
* Sólo `granted` habilita la ejecución; cualquier otro valor se trata como
|
|
8
|
+
* denegación (enforcement fail-closed).
|
|
9
|
+
*/
|
|
10
|
+
export declare const AUTHORIZATION_DECISIONS: readonly ["granted", "denied"];
|
|
11
|
+
/** Decisión de autorización sobre un permiso concreto. */
|
|
12
|
+
export type AuthorizationDecision = (typeof AUTHORIZATION_DECISIONS)[number];
|
|
13
|
+
/**
|
|
14
|
+
* Puerto genérico de autorización del caso de uso seguro.
|
|
15
|
+
*
|
|
16
|
+
* Es independiente de la tecnología y del modelo de autorización (RBAC, ABAC,
|
|
17
|
+
* ReBAC, PDP): recibe el sujeto autenticado y el permiso exigido, y decide.
|
|
18
|
+
* El adaptador concreto vive en la aplicación.
|
|
19
|
+
*
|
|
20
|
+
* @template Id Tipo de identidad del sujeto
|
|
21
|
+
*/
|
|
22
|
+
export interface AuthorizationPort<Id extends Identifiable = SubjectId> {
|
|
23
|
+
/**
|
|
24
|
+
* Decide si el sujeto tiene el permiso indicado.
|
|
25
|
+
*
|
|
26
|
+
* @param subject Sujeto ya autenticado
|
|
27
|
+
* @param permission Permiso exigido por el caso de uso
|
|
28
|
+
* @returns `granted` si autoriza; `denied` si deniega
|
|
29
|
+
*/
|
|
30
|
+
authorize(subject: AuthenticatedSubject<Id>, permission: Permission): AuthorizationDecision | Promise<AuthorizationDecision>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=authorization.port.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.port.d.ts","sourceRoot":"","sources":["../../../src/authorization/ports/authorization.port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,gCAAiC,CAAC;AAEtE,0DAA0D;AAC1D,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB,CAAC,EAAE,SAAS,YAAY,GAAG,SAAS;IACpE;;;;;;OAMG;IACH,SAAS,CACP,OAAO,EAAE,oBAAoB,CAAC,EAAE,CAAC,EACjC,UAAU,EAAE,UAAU,GACrB,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTHORIZATION_DECISIONS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Decisiones que puede devolver un puerto de autorización.
|
|
6
|
+
*
|
|
7
|
+
* Sólo `granted` habilita la ejecución; cualquier otro valor se trata como
|
|
8
|
+
* denegación (enforcement fail-closed).
|
|
9
|
+
*/
|
|
10
|
+
exports.AUTHORIZATION_DECISIONS = ['granted', 'denied'];
|
|
11
|
+
//# sourceMappingURL=authorization.port.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization.port.js","sourceRoot":"","sources":["../../../src/authorization/ports/authorization.port.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authorization/ports/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./authentication.port"), exports);
|
|
18
|
+
__exportStar(require("./authorization.port"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authorization/ports/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,uDAAqC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authorization/secured-use-case/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./secured-use-case.mixin"), exports);
|
|
18
|
+
__exportStar(require("./secured-use-case.types"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/authorization/secured-use-case/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,2DAAyC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TaskExecution } from '@imolko/ultra-result';
|
|
2
|
+
import { SubjectId } from '../../entity/identity';
|
|
3
|
+
import { AuthenticatedSubject } from '../authenticated-subject';
|
|
4
|
+
import { Permission } from '../permission';
|
|
5
|
+
import { AuthorizationDecision, AuthorizationPort } from '../ports';
|
|
6
|
+
import { Security } from '../security';
|
|
7
|
+
export type Input = {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export type Output = {
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
export type UseCaseError = {
|
|
14
|
+
type: 'sample-error';
|
|
15
|
+
};
|
|
16
|
+
export declare const subject: AuthenticatedSubject<SubjectId>;
|
|
17
|
+
export declare const authorizationPort: (decide: (permission: Permission) => AuthorizationDecision, onAuthorize?: (permission: Permission) => void) => AuthorizationPort;
|
|
18
|
+
export declare const allowAll: AuthorizationPort<SubjectId>;
|
|
19
|
+
export declare const denyAll: AuthorizationPort<SubjectId>;
|
|
20
|
+
export declare const resetExecutions: () => void;
|
|
21
|
+
export declare const countExecutions: () => number;
|
|
22
|
+
export declare class RequiredDefinition {
|
|
23
|
+
static security: Security;
|
|
24
|
+
execute(input: Input): TaskExecution<UseCaseError, Output>;
|
|
25
|
+
}
|
|
26
|
+
export declare class OptionalDefinition {
|
|
27
|
+
static security: Security;
|
|
28
|
+
execute(input: Input): TaskExecution<UseCaseError, Output>;
|
|
29
|
+
}
|
|
30
|
+
export declare class MultiPermissionDefinition {
|
|
31
|
+
static security: Security;
|
|
32
|
+
execute(input: Input): TaskExecution<UseCaseError, Output>;
|
|
33
|
+
}
|
|
34
|
+
export declare class OpenDefinition {
|
|
35
|
+
static security: Security;
|
|
36
|
+
execute(input: Input): TaskExecution<UseCaseError, Output>;
|
|
37
|
+
}
|
|
38
|
+
export declare class AuthenticatedOnlyDefinition {
|
|
39
|
+
static security: Security;
|
|
40
|
+
execute(input: Input): TaskExecution<UseCaseError, Output>;
|
|
41
|
+
}
|
|
42
|
+
export declare class FailingDefinition {
|
|
43
|
+
static security: Security;
|
|
44
|
+
execute(_input: Input): TaskExecution<UseCaseError, Output>;
|
|
45
|
+
}
|
|
46
|
+
export declare class InsecureDefinition {
|
|
47
|
+
execute(): TaskExecution<UseCaseError, Output>;
|
|
48
|
+
}
|
|
49
|
+
export declare const RequiredUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof RequiredDefinition>;
|
|
50
|
+
export declare const OptionalUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof OptionalDefinition>;
|
|
51
|
+
export declare const MultiPermissionUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof MultiPermissionDefinition>;
|
|
52
|
+
export declare const OpenUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof OpenDefinition>;
|
|
53
|
+
export declare const AuthenticatedOnlyUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof AuthenticatedOnlyDefinition>;
|
|
54
|
+
export declare const FailingUseCase: import("./secured-use-case.types").SecuredUseCaseConstructor<typeof FailingDefinition>;
|
|
55
|
+
//# sourceMappingURL=secured-use-case.fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secured-use-case.fixtures.d.ts","sourceRoot":"","sources":["../../../src/authorization/secured-use-case/secured-use-case.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAgB,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACvC,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAMpD,eAAO,MAAM,OAAO,iCAEnB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAE1B,QAAQ,CAAC,UAAU,EAAE,UAAU,KAAK,qBAAqB,EACzD,cAAc,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,KAC7C,iBAMD,CAAC;AAEL,eAAO,MAAM,QAAQ,8BAAqC,CAAC;AAC3D,eAAO,MAAM,OAAO,8BAAoC,CAAC;AAIzD,eAAO,MAAM,eAAe,QAAO,IAElC,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,MAAoB,CAAC;AAExD,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,WAAoC;IAC5C,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAIlE;AAED,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,WAAmC;IAC3C,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAIlE;AAED,qBAAa,yBAAyB;IACpC,MAAM,CAAC,QAAQ,WAA6D;IACrE,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAIlE;AAED,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,WAAuB;IAC/B,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAIlE;AAED,qBAAa,2BAA2B;IACtC,MAAM,CAAC,QAAQ,WAAuB;IAC/B,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAIlE;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,WAAuB;IAC/B,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAGnE;AAED,qBAAa,kBAAkB;IACtB,OAAO,IAAI,aAAa,CAAC,YAAY,EAAE,MAAM,CAAC;CAGtD;AAED,eAAO,MAAM,eAAe,yFAAqC,CAAC;AAClE,eAAO,MAAM,eAAe,yFAAqC,CAAC;AAClE,eAAO,MAAM,sBAAsB,gGAA4C,CAAC;AAChF,eAAO,MAAM,WAAW,qFAAiC,CAAC;AAC1D,eAAO,MAAM,wBAAwB,kGAEpC,CAAC;AACF,eAAO,MAAM,cAAc,wFAAoC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FailingUseCase = exports.AuthenticatedOnlyUseCase = exports.OpenUseCase = exports.MultiPermissionUseCase = exports.OptionalUseCase = exports.RequiredUseCase = exports.InsecureDefinition = exports.FailingDefinition = exports.AuthenticatedOnlyDefinition = exports.OpenDefinition = exports.MultiPermissionDefinition = exports.OptionalDefinition = exports.RequiredDefinition = exports.countExecutions = exports.resetExecutions = exports.denyAll = exports.allowAll = exports.authorizationPort = exports.subject = void 0;
|
|
4
|
+
const ultra_result_1 = require("@imolko/ultra-result");
|
|
5
|
+
const identity_1 = require("../../entity/identity");
|
|
6
|
+
const authenticated_subject_1 = require("../authenticated-subject");
|
|
7
|
+
const permission_1 = require("../permission");
|
|
8
|
+
const security_1 = require("../security");
|
|
9
|
+
const secured_use_case_mixin_1 = require("./secured-use-case.mixin");
|
|
10
|
+
const claimsRead = permission_1.Permission.of('claims:read').getValue();
|
|
11
|
+
const claimsWrite = permission_1.Permission.of('claims:write').getValue();
|
|
12
|
+
const claimsAdmin = permission_1.Permission.of('claims:admin').getValue();
|
|
13
|
+
exports.subject = authenticated_subject_1.AuthenticatedSubject.of(identity_1.SubjectId.of('user-233').getValue());
|
|
14
|
+
const authorizationPort = (decide, onAuthorize) => ({
|
|
15
|
+
authorize: (_subject, permission) => {
|
|
16
|
+
onAuthorize?.(permission);
|
|
17
|
+
return decide(permission);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
exports.authorizationPort = authorizationPort;
|
|
21
|
+
exports.allowAll = (0, exports.authorizationPort)(() => 'granted');
|
|
22
|
+
exports.denyAll = (0, exports.authorizationPort)(() => 'denied');
|
|
23
|
+
let executions = 0;
|
|
24
|
+
const resetExecutions = () => {
|
|
25
|
+
executions = 0;
|
|
26
|
+
};
|
|
27
|
+
exports.resetExecutions = resetExecutions;
|
|
28
|
+
const countExecutions = () => executions;
|
|
29
|
+
exports.countExecutions = countExecutions;
|
|
30
|
+
class RequiredDefinition {
|
|
31
|
+
execute(input) {
|
|
32
|
+
executions += 1;
|
|
33
|
+
return async () => (0, ultra_result_1.ok)({ value: input.value });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.RequiredDefinition = RequiredDefinition;
|
|
37
|
+
RequiredDefinition.security = security_1.Security.required([claimsWrite]);
|
|
38
|
+
class OptionalDefinition {
|
|
39
|
+
execute(input) {
|
|
40
|
+
executions += 1;
|
|
41
|
+
return async () => (0, ultra_result_1.ok)({ value: input.value });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.OptionalDefinition = OptionalDefinition;
|
|
45
|
+
OptionalDefinition.security = security_1.Security.optional([claimsRead]);
|
|
46
|
+
class MultiPermissionDefinition {
|
|
47
|
+
execute(input) {
|
|
48
|
+
executions += 1;
|
|
49
|
+
return async () => (0, ultra_result_1.ok)({ value: input.value });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.MultiPermissionDefinition = MultiPermissionDefinition;
|
|
53
|
+
MultiPermissionDefinition.security = security_1.Security.required([claimsRead, claimsWrite, claimsAdmin]);
|
|
54
|
+
class OpenDefinition {
|
|
55
|
+
execute(input) {
|
|
56
|
+
executions += 1;
|
|
57
|
+
return async () => (0, ultra_result_1.ok)({ value: input.value });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.OpenDefinition = OpenDefinition;
|
|
61
|
+
OpenDefinition.security = security_1.Security.optional();
|
|
62
|
+
class AuthenticatedOnlyDefinition {
|
|
63
|
+
execute(input) {
|
|
64
|
+
executions += 1;
|
|
65
|
+
return async () => (0, ultra_result_1.ok)({ value: input.value });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.AuthenticatedOnlyDefinition = AuthenticatedOnlyDefinition;
|
|
69
|
+
AuthenticatedOnlyDefinition.security = security_1.Security.required();
|
|
70
|
+
class FailingDefinition {
|
|
71
|
+
execute(_input) {
|
|
72
|
+
return async () => (0, ultra_result_1.fail)({ type: 'sample-error' });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.FailingDefinition = FailingDefinition;
|
|
76
|
+
FailingDefinition.security = security_1.Security.optional();
|
|
77
|
+
class InsecureDefinition {
|
|
78
|
+
execute() {
|
|
79
|
+
return async () => (0, ultra_result_1.ok)({ value: 'insecure' });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.InsecureDefinition = InsecureDefinition;
|
|
83
|
+
exports.RequiredUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(RequiredDefinition);
|
|
84
|
+
exports.OptionalUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(OptionalDefinition);
|
|
85
|
+
exports.MultiPermissionUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(MultiPermissionDefinition);
|
|
86
|
+
exports.OpenUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(OpenDefinition);
|
|
87
|
+
exports.AuthenticatedOnlyUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(AuthenticatedOnlyDefinition);
|
|
88
|
+
exports.FailingUseCase = (0, secured_use_case_mixin_1.SecuredUseCase)(FailingDefinition);
|
|
89
|
+
//# sourceMappingURL=secured-use-case.fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secured-use-case.fixtures.js","sourceRoot":"","sources":["../../../src/authorization/secured-use-case/secured-use-case.fixtures.ts"],"names":[],"mappings":";;;AAAA,uDAI8B;AAE9B,oDAAgE;AAChE,oEAAgE;AAChE,8CAA2C;AAE3C,0CAAuC;AACvC,qEAA0D;AAM1D,MAAM,UAAU,GAAG,uBAAU,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC3D,MAAM,WAAW,GAAG,uBAAU,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC7D,MAAM,WAAW,GAAG,uBAAU,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEhD,QAAA,OAAO,GAAG,4CAAoB,CAAC,EAAE,CAC5C,oBAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CACpC,CAAC;AAEK,MAAM,iBAAiB,GAC5B,CACE,MAAyD,EACzD,WAA8C,EAC3B,EAAE,CACvB,CAAC;IACC,SAAS,EAAE,CAAC,QAA4C,EAAE,UAAU,EAAE,EAAE;QACtE,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC;QAC1B,OAAO,MAAM,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;CACF,CAAC,CAAC;AAVQ,QAAA,iBAAiB,qBAUzB;AAEQ,QAAA,QAAQ,GAAG,IAAA,yBAAiB,EAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC9C,QAAA,OAAO,GAAG,IAAA,yBAAiB,EAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AAEzD,IAAI,UAAU,GAAG,CAAC,CAAC;AAEZ,MAAM,eAAe,GAAG,GAAS,EAAE;IACxC,UAAU,GAAG,CAAC,CAAC;AACjB,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B;AAEK,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC,UAAU,CAAC;AAA3C,QAAA,eAAe,mBAA4B;AAExD,MAAa,kBAAkB;IAEtB,OAAO,CAAC,KAAY;QACzB,UAAU,IAAI,CAAC,CAAC;QAChB,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;;AALH,gDAMC;AALQ,2BAAQ,GAAG,mBAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAOrD,MAAa,kBAAkB;IAEtB,OAAO,CAAC,KAAY;QACzB,UAAU,IAAI,CAAC,CAAC;QAChB,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;;AALH,gDAMC;AALQ,2BAAQ,GAAG,mBAAQ,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAOpD,MAAa,yBAAyB;IAE7B,OAAO,CAAC,KAAY;QACzB,UAAU,IAAI,CAAC,CAAC;QAChB,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;;AALH,8DAMC;AALQ,kCAAQ,GAAG,mBAAQ,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAO9E,MAAa,cAAc;IAElB,OAAO,CAAC,KAAY;QACzB,UAAU,IAAI,CAAC,CAAC;QAChB,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;;AALH,wCAMC;AALQ,uBAAQ,GAAG,mBAAQ,CAAC,QAAQ,EAAE,CAAC;AAOxC,MAAa,2BAA2B;IAE/B,OAAO,CAAC,KAAY;QACzB,UAAU,IAAI,CAAC,CAAC;QAChB,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IAChD,CAAC;;AALH,kEAMC;AALQ,oCAAQ,GAAG,mBAAQ,CAAC,QAAQ,EAAE,CAAC;AAOxC,MAAa,iBAAiB;IAErB,OAAO,CAAC,MAAa;QAC1B,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,mBAAI,EAAe,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC;IAClE,CAAC;;AAJH,8CAKC;AAJQ,0BAAQ,GAAG,mBAAQ,CAAC,QAAQ,EAAE,CAAC;AAMxC,MAAa,kBAAkB;IACtB,OAAO;QACZ,OAAO,KAAK,IAAI,EAAE,CAAC,IAAA,iBAAE,EAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF;AAJD,gDAIC;AAEY,QAAA,eAAe,GAAG,IAAA,uCAAc,EAAC,kBAAkB,CAAC,CAAC;AACrD,QAAA,eAAe,GAAG,IAAA,uCAAc,EAAC,kBAAkB,CAAC,CAAC;AACrD,QAAA,sBAAsB,GAAG,IAAA,uCAAc,EAAC,yBAAyB,CAAC,CAAC;AACnE,QAAA,WAAW,GAAG,IAAA,uCAAc,EAAC,cAAc,CAAC,CAAC;AAC7C,QAAA,wBAAwB,GAAG,IAAA,uCAAc,EACpD,2BAA2B,CAC5B,CAAC;AACW,QAAA,cAAc,GAAG,IAAA,uCAAc,EAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SecuredUseCaseConstructor, SecuredUseCaseDefinition } from './secured-use-case.types';
|
|
2
|
+
/**
|
|
3
|
+
* Mixin de caso de uso seguro.
|
|
4
|
+
*
|
|
5
|
+
* Exige `security` en el tipo de la definición, expone `run` como único camino
|
|
6
|
+
* público y oculta `execute` en el tipo (no en el runtime). `run` aplica el
|
|
7
|
+
* enforcement fail-closed y preserva el canal del caso de uso, uniendo
|
|
8
|
+
* `AuthorizationError` a su tipo de error sin anidar resultados.
|
|
9
|
+
*
|
|
10
|
+
* @param Source Definición del caso de uso con `security` y `execute`
|
|
11
|
+
* @returns Constructor cuyo tipo público sólo ofrece `run`
|
|
12
|
+
*/
|
|
13
|
+
export declare const SecuredUseCase: <Definition extends SecuredUseCaseDefinition>(Source: Definition) => SecuredUseCaseConstructor<Definition>;
|
|
14
|
+
//# sourceMappingURL=secured-use-case.mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secured-use-case.mixin.d.ts","sourceRoot":"","sources":["../../../src/authorization/secured-use-case/secured-use-case.mixin.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,yBAAyB,EAEzB,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AA8ElC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,wBAAwB,EACxE,QAAQ,UAAU,KACjB,yBAAyB,CAAC,UAAU,CAgCtC,CAAC"}
|