├── .env ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── .travis.yml ├── README.md ├── docker-compose.yaml ├── event.json ├── nest-cli.json ├── package.json ├── src ├── app.middleware.ts ├── app.module.ts ├── bootstrap.module.ts ├── config │ └── configuration.ts ├── console.ts ├── main.ts └── scope │ ├── application │ ├── command │ │ ├── create-scope.command.ts │ │ ├── create-scope.handler.spec.ts │ │ ├── create-scope.handler.ts │ │ ├── index.ts │ │ ├── remove-scope.command.ts │ │ ├── remove-scope.handler.spec.ts │ │ ├── remove-scope.handler.ts │ │ ├── rename-scope.command.ts │ │ ├── rename-scope.handler.spec.ts │ │ └── rename-scope.handler.ts │ ├── index.ts │ ├── query │ │ ├── get-scope.handler.ts │ │ ├── get-scope.query.ts │ │ ├── get-scopes.handler.ts │ │ ├── get-scopes.query.ts │ │ └── index.ts │ └── services │ │ ├── index.ts │ │ └── scope-finder.interface.ts │ ├── domain │ ├── event │ │ ├── index.ts │ │ ├── scope-was-created.event.ts │ │ ├── scope-was-removed.event.ts │ │ └── scope-was-renamed.event.ts │ ├── exception │ │ ├── index.ts │ │ ├── scope-alias-already-registered.error.ts │ │ ├── scope-id-already-registered.error.ts │ │ └── scope-id-not-found.error.ts │ ├── index.ts │ ├── model │ │ ├── index.ts │ │ ├── scope-alias.spec.ts │ │ ├── scope-alias.ts │ │ ├── scope-id.spec.ts │ │ ├── scope-id.ts │ │ ├── scope-name.spec.ts │ │ ├── scope-name.ts │ │ ├── scope.spec.ts │ │ └── scope.ts │ ├── repository │ │ ├── index.ts │ │ └── scopes.ts │ └── services │ │ ├── check-unique-scope-alias.service.ts │ │ └── index.ts │ ├── dto │ ├── index.ts │ ├── request │ │ ├── create-scope.dto.ts │ │ ├── index.ts │ │ ├── remove-scope.dto.ts │ │ └── rename-scope.dto.ts │ └── response │ │ ├── index.ts │ │ └── scope.dto.ts │ └── infrastructure │ ├── controller │ └── scope.controller.ts │ ├── read-model │ ├── index.ts │ └── scopes │ │ ├── index.ts │ │ ├── scope-was-created.projection.ts │ │ ├── scope-was-removed.projection.ts │ │ ├── scope-was-renamed.projection.ts │ │ └── scope.schema.ts │ ├── scope.module.ts │ ├── scope.provider.ts │ └── service │ ├── check-unique-scope-alias.service.ts │ ├── index.ts │ ├── scope-finder.service.ts │ └── scope.service.ts ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/.env -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/.eslintrc.js -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/.gitignore -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/.prettierrc -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/.travis.yml -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/README.md -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/docker-compose.yaml -------------------------------------------------------------------------------- /event.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/event.json -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/nest-cli.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/package.json -------------------------------------------------------------------------------- /src/app.middleware.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/app.middleware.ts -------------------------------------------------------------------------------- /src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/app.module.ts -------------------------------------------------------------------------------- /src/bootstrap.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/bootstrap.module.ts -------------------------------------------------------------------------------- /src/config/configuration.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/config/configuration.ts -------------------------------------------------------------------------------- /src/console.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/console.ts -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/main.ts -------------------------------------------------------------------------------- /src/scope/application/command/create-scope.command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/create-scope.command.ts -------------------------------------------------------------------------------- /src/scope/application/command/create-scope.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/create-scope.handler.spec.ts -------------------------------------------------------------------------------- /src/scope/application/command/create-scope.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/create-scope.handler.ts -------------------------------------------------------------------------------- /src/scope/application/command/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/index.ts -------------------------------------------------------------------------------- /src/scope/application/command/remove-scope.command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/remove-scope.command.ts -------------------------------------------------------------------------------- /src/scope/application/command/remove-scope.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/remove-scope.handler.spec.ts -------------------------------------------------------------------------------- /src/scope/application/command/remove-scope.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/remove-scope.handler.ts -------------------------------------------------------------------------------- /src/scope/application/command/rename-scope.command.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/rename-scope.command.ts -------------------------------------------------------------------------------- /src/scope/application/command/rename-scope.handler.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/rename-scope.handler.spec.ts -------------------------------------------------------------------------------- /src/scope/application/command/rename-scope.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/command/rename-scope.handler.ts -------------------------------------------------------------------------------- /src/scope/application/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/index.ts -------------------------------------------------------------------------------- /src/scope/application/query/get-scope.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/query/get-scope.handler.ts -------------------------------------------------------------------------------- /src/scope/application/query/get-scope.query.ts: -------------------------------------------------------------------------------- 1 | export class GetScopeQuery { 2 | constructor(public readonly id: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /src/scope/application/query/get-scopes.handler.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/query/get-scopes.handler.ts -------------------------------------------------------------------------------- /src/scope/application/query/get-scopes.query.ts: -------------------------------------------------------------------------------- 1 | export class GetScopesQuery {} 2 | -------------------------------------------------------------------------------- /src/scope/application/query/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/query/index.ts -------------------------------------------------------------------------------- /src/scope/application/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './scope-finder.interface'; 2 | -------------------------------------------------------------------------------- /src/scope/application/services/scope-finder.interface.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/application/services/scope-finder.interface.ts -------------------------------------------------------------------------------- /src/scope/domain/event/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/event/index.ts -------------------------------------------------------------------------------- /src/scope/domain/event/scope-was-created.event.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/event/scope-was-created.event.ts -------------------------------------------------------------------------------- /src/scope/domain/event/scope-was-removed.event.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/event/scope-was-removed.event.ts -------------------------------------------------------------------------------- /src/scope/domain/event/scope-was-renamed.event.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/event/scope-was-renamed.event.ts -------------------------------------------------------------------------------- /src/scope/domain/exception/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/exception/index.ts -------------------------------------------------------------------------------- /src/scope/domain/exception/scope-alias-already-registered.error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/exception/scope-alias-already-registered.error.ts -------------------------------------------------------------------------------- /src/scope/domain/exception/scope-id-already-registered.error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/exception/scope-id-already-registered.error.ts -------------------------------------------------------------------------------- /src/scope/domain/exception/scope-id-not-found.error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/exception/scope-id-not-found.error.ts -------------------------------------------------------------------------------- /src/scope/domain/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/index.ts -------------------------------------------------------------------------------- /src/scope/domain/model/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/index.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-alias.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-alias.spec.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-alias.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-alias.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-id.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-id.spec.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-id.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-id.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-name.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-name.spec.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope-name.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope-name.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope.spec.ts -------------------------------------------------------------------------------- /src/scope/domain/model/scope.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/model/scope.ts -------------------------------------------------------------------------------- /src/scope/domain/repository/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/repository/index.ts -------------------------------------------------------------------------------- /src/scope/domain/repository/scopes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/repository/scopes.ts -------------------------------------------------------------------------------- /src/scope/domain/services/check-unique-scope-alias.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/domain/services/check-unique-scope-alias.service.ts -------------------------------------------------------------------------------- /src/scope/domain/services/index.ts: -------------------------------------------------------------------------------- 1 | export * from './check-unique-scope-alias.service'; 2 | -------------------------------------------------------------------------------- /src/scope/dto/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/dto/index.ts -------------------------------------------------------------------------------- /src/scope/dto/request/create-scope.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/dto/request/create-scope.dto.ts -------------------------------------------------------------------------------- /src/scope/dto/request/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/dto/request/index.ts -------------------------------------------------------------------------------- /src/scope/dto/request/remove-scope.dto.ts: -------------------------------------------------------------------------------- 1 | export class RemoveScopeDto { 2 | constructor(public readonly _id: string) {} 3 | } 4 | -------------------------------------------------------------------------------- /src/scope/dto/request/rename-scope.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/dto/request/rename-scope.dto.ts -------------------------------------------------------------------------------- /src/scope/dto/response/index.ts: -------------------------------------------------------------------------------- 1 | export * from './scope.dto'; 2 | -------------------------------------------------------------------------------- /src/scope/dto/response/scope.dto.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/dto/response/scope.dto.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/controller/scope.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/controller/scope.controller.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/index.ts: -------------------------------------------------------------------------------- 1 | export * from './scopes'; 2 | -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/scopes/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/read-model/scopes/index.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/scopes/scope-was-created.projection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/read-model/scopes/scope-was-created.projection.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/scopes/scope-was-removed.projection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/read-model/scopes/scope-was-removed.projection.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/scopes/scope-was-renamed.projection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/read-model/scopes/scope-was-renamed.projection.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/read-model/scopes/scope.schema.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/read-model/scopes/scope.schema.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/scope.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/scope.module.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/scope.provider.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/scope.provider.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/service/check-unique-scope-alias.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/service/check-unique-scope-alias.service.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/service/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/service/index.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/service/scope-finder.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/service/scope-finder.service.ts -------------------------------------------------------------------------------- /src/scope/infrastructure/service/scope.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/src/scope/infrastructure/service/scope.service.ts -------------------------------------------------------------------------------- /test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/test/jest-e2e.json -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/tsconfig.build.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/tsconfig.json -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgomez/iam-ddd-cqrs-es-nestjs/HEAD/yarn.lock --------------------------------------------------------------------------------