@rocketmakers/orbit-capsule-utils 0.18.0 → 2.0.0-beta.10
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/README.md +3 -49
- package/lib/bootstrap/boot.d.ts +7 -10
- package/lib/bootstrap/boot.d.ts.map +1 -0
- package/lib/bootstrap/boot.js +26 -24
- package/lib/bootstrap/boot.js.map +1 -1
- package/lib/bootstrap/common.d.ts +2 -13
- package/lib/bootstrap/common.d.ts.map +1 -0
- package/lib/bootstrap/common.js +2 -48
- package/lib/bootstrap/common.js.map +1 -1
- package/lib/bootstrap/createExpressApp.d.ts +9 -3
- package/lib/bootstrap/createExpressApp.d.ts.map +1 -0
- package/lib/bootstrap/createExpressApp.js +18 -42
- package/lib/bootstrap/createExpressApp.js.map +1 -1
- package/lib/bootstrap/index.d.ts +2 -2
- package/lib/bootstrap/index.d.ts.map +1 -0
- package/lib/bootstrap/index.js +1 -2
- package/lib/bootstrap/index.js.map +1 -1
- package/lib/bootstrap/ioc/index.d.ts +3 -0
- package/lib/bootstrap/ioc/index.d.ts.map +1 -0
- package/lib/bootstrap/ioc/index.js +6 -0
- package/lib/bootstrap/ioc/index.js.map +1 -0
- package/lib/bootstrap/ioc/register.d.ts +5 -0
- package/lib/bootstrap/ioc/register.d.ts.map +1 -0
- package/lib/bootstrap/ioc/register.js +16 -0
- package/lib/bootstrap/ioc/register.js.map +1 -0
- package/lib/bootstrap/ioc/tsoaIoc.d.ts +9 -0
- package/lib/bootstrap/ioc/tsoaIoc.d.ts.map +1 -0
- package/lib/bootstrap/ioc/tsoaIoc.helper.d.ts +4 -0
- package/lib/bootstrap/ioc/tsoaIoc.helper.d.ts.map +1 -0
- package/lib/bootstrap/ioc/tsoaIoc.helper.js +15 -0
- package/lib/bootstrap/ioc/tsoaIoc.helper.js.map +1 -0
- package/lib/bootstrap/ioc/tsoaIoc.js +12 -0
- package/lib/bootstrap/ioc/tsoaIoc.js.map +1 -0
- package/lib/bootstrap/ioc/types.d.ts +10 -0
- package/lib/bootstrap/ioc/types.d.ts.map +1 -0
- package/lib/{core/dto.js → bootstrap/ioc/types.js} +1 -1
- package/lib/bootstrap/ioc/types.js.map +1 -0
- package/lib/config/app.d.ts +9 -58
- package/lib/config/app.d.ts.map +1 -0
- package/lib/config/app.js +9 -133
- package/lib/config/app.js.map +1 -1
- package/lib/config/environment.generated.d.ts +7 -0
- package/lib/config/environment.generated.d.ts.map +1 -0
- package/lib/config/environment.generated.js +25 -0
- package/lib/config/environment.generated.js.map +1 -0
- package/lib/config/index.d.ts +2 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/index.js +1 -0
- package/lib/config/index.js.map +1 -1
- package/lib/database/connectionFactory.d.ts +5 -1
- package/lib/database/connectionFactory.d.ts.map +1 -0
- package/lib/database/connectionFactory.js +6 -7
- package/lib/database/connectionFactory.js.map +1 -1
- package/lib/database/index.d.ts +1 -7
- package/lib/database/index.d.ts.map +1 -0
- package/lib/database/index.js +0 -7
- package/lib/database/index.js.map +1 -1
- package/lib/index.d.ts +2 -10
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +1 -10
- package/lib/index.js.map +1 -1
- package/lib/middleware/errors.d.ts +2 -1
- package/lib/middleware/errors.d.ts.map +1 -0
- package/lib/middleware/errors.js +16 -12
- package/lib/middleware/errors.js.map +1 -1
- package/lib/middleware/index.d.ts +1 -1
- package/lib/middleware/index.d.ts.map +1 -0
- package/lib/middleware/index.js +0 -1
- package/lib/middleware/index.js.map +1 -1
- package/lib/rest/health.d.ts +7 -0
- package/lib/rest/health.d.ts.map +1 -0
- package/lib/{controllers → rest}/health.js +16 -16
- package/lib/rest/health.js.map +1 -0
- package/lib/rest/index.d.ts +2 -0
- package/lib/rest/index.d.ts.map +1 -0
- package/lib/{controllers → rest}/index.js +0 -0
- package/lib/rest/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -22111
- package/lib/utils/capsules.d.ts +11 -0
- package/lib/utils/capsules.d.ts.map +1 -0
- package/lib/utils/capsules.js +31 -0
- package/lib/utils/capsules.js.map +1 -0
- package/lib/utils/index.d.ts +2 -10
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/index.js +1 -10
- package/lib/utils/index.js.map +1 -1
- package/package.json +51 -72
- package/.npm-version +0 -1
- package/check-npm.js +0 -37
- package/lib/_tests/assertHelpers/array.d.ts +0 -1
- package/lib/_tests/assertHelpers/array.js +0 -22
- package/lib/_tests/assertHelpers/array.js.map +0 -1
- package/lib/_tests/assertHelpers/authorisation.d.ts +0 -9
- package/lib/_tests/assertHelpers/authorisation.js +0 -94
- package/lib/_tests/assertHelpers/authorisation.js.map +0 -1
- package/lib/_tests/assertHelpers/context.d.ts +0 -3
- package/lib/_tests/assertHelpers/context.js +0 -13
- package/lib/_tests/assertHelpers/context.js.map +0 -1
- package/lib/_tests/assertHelpers/core.d.ts +0 -2
- package/lib/_tests/assertHelpers/core.js +0 -39
- package/lib/_tests/assertHelpers/core.js.map +0 -1
- package/lib/_tests/assertHelpers/string.d.ts +0 -4
- package/lib/_tests/assertHelpers/string.js +0 -81
- package/lib/_tests/assertHelpers/string.js.map +0 -1
- package/lib/_tests/assertHelpers/validation.d.ts +0 -14
- package/lib/_tests/assertHelpers/validation.js +0 -60
- package/lib/_tests/assertHelpers/validation.js.map +0 -1
- package/lib/_tests/common.d.ts +0 -5
- package/lib/_tests/common.js +0 -32
- package/lib/_tests/common.js.map +0 -1
- package/lib/_tests/factories/context.d.ts +0 -43
- package/lib/_tests/factories/context.js +0 -142
- package/lib/_tests/factories/context.js.map +0 -1
- package/lib/_tests/factories/transaction.d.ts +0 -2
- package/lib/_tests/factories/transaction.js +0 -8
- package/lib/_tests/factories/transaction.js.map +0 -1
- package/lib/_tests/services/claims/claims.test.d.ts +0 -1
- package/lib/_tests/services/claims/claims.test.js +0 -51
- package/lib/_tests/services/claims/claims.test.js.map +0 -1
- package/lib/_tests/services/encryption/encryptDecrypt.test.d.ts +0 -1
- package/lib/_tests/services/encryption/encryptDecrypt.test.js +0 -104
- package/lib/_tests/services/encryption/encryptDecrypt.test.js.map +0 -1
- package/lib/_tests/services/encryption/mockedService.d.ts +0 -6
- package/lib/_tests/services/encryption/mockedService.js +0 -12
- package/lib/_tests/services/encryption/mockedService.js.map +0 -1
- package/lib/_tests/tasks/factories/scheduledTask.d.ts +0 -2
- package/lib/_tests/tasks/factories/scheduledTask.js +0 -23
- package/lib/_tests/tasks/factories/scheduledTask.js.map +0 -1
- package/lib/_tests/tasks/factories/task.d.ts +0 -3
- package/lib/_tests/tasks/factories/task.js +0 -23
- package/lib/_tests/tasks/factories/task.js.map +0 -1
- package/lib/_tests/tasks/services/taskService/index.test.d.ts +0 -1
- package/lib/_tests/tasks/services/taskService/index.test.js +0 -9
- package/lib/_tests/tasks/services/taskService/index.test.js.map +0 -1
- package/lib/_tests/tasks/services/taskService/mockedService.d.ts +0 -25
- package/lib/_tests/tasks/services/taskService/mockedService.js +0 -60
- package/lib/_tests/tasks/services/taskService/mockedService.js.map +0 -1
- package/lib/_tests/tasks/services/taskService/process.d.ts +0 -1
- package/lib/_tests/tasks/services/taskService/process.js +0 -127
- package/lib/_tests/tasks/services/taskService/process.js.map +0 -1
- package/lib/_tests/tasks/services/taskService/schedule.d.ts +0 -1
- package/lib/_tests/tasks/services/taskService/schedule.js +0 -100
- package/lib/_tests/tasks/services/taskService/schedule.js.map +0 -1
- package/lib/_tests/tracing/decorators/tracing.test.d.ts +0 -1
- package/lib/_tests/tracing/decorators/tracing.test.js +0 -44
- package/lib/_tests/tracing/decorators/tracing.test.js.map +0 -1
- package/lib/_tests/utils/array.test.d.ts +0 -1
- package/lib/_tests/utils/array.test.js +0 -105
- package/lib/_tests/utils/array.test.js.map +0 -1
- package/lib/_tests/utils/dates.test.d.ts +0 -1
- package/lib/_tests/utils/dates.test.js +0 -63
- package/lib/_tests/utils/dates.test.js.map +0 -1
- package/lib/_tests/utils/errors.d.ts +0 -6
- package/lib/_tests/utils/errors.js +0 -30
- package/lib/_tests/utils/errors.js.map +0 -1
- package/lib/auth/authorisation.d.ts +0 -22
- package/lib/auth/authorisation.js +0 -198
- package/lib/auth/authorisation.js.map +0 -1
- package/lib/auth/claims.d.ts +0 -4
- package/lib/auth/claims.js +0 -11
- package/lib/auth/claims.js.map +0 -1
- package/lib/auth/context.d.ts +0 -23
- package/lib/auth/context.js +0 -58
- package/lib/auth/context.js.map +0 -1
- package/lib/auth/index.d.ts +0 -7
- package/lib/auth/index.js +0 -11
- package/lib/auth/index.js.map +0 -1
- package/lib/auth/interfaces.d.ts +0 -5
- package/lib/auth/interfaces.js +0 -3
- package/lib/auth/interfaces.js.map +0 -1
- package/lib/auth/session.d.ts +0 -15
- package/lib/auth/session.js +0 -3
- package/lib/auth/session.js.map +0 -1
- package/lib/auth/tokenParser.d.ts +0 -21
- package/lib/auth/tokenParser.js +0 -120
- package/lib/auth/tokenParser.js.map +0 -1
- package/lib/auth/user.d.ts +0 -63
- package/lib/auth/user.js +0 -27
- package/lib/auth/user.js.map +0 -1
- package/lib/bootstrap/kernel.d.ts +0 -24
- package/lib/bootstrap/kernel.js +0 -76
- package/lib/bootstrap/kernel.js.map +0 -1
- package/lib/bootstrap/request.d.ts +0 -41
- package/lib/bootstrap/request.js +0 -50
- package/lib/bootstrap/request.js.map +0 -1
- package/lib/build/config.d.ts +0 -20
- package/lib/build/config.js +0 -3
- package/lib/build/config.js.map +0 -1
- package/lib/build/index.d.ts +0 -1
- package/lib/build/index.js +0 -5
- package/lib/build/index.js.map +0 -1
- package/lib/controllers/health.d.ts +0 -7
- package/lib/controllers/health.js.map +0 -1
- package/lib/controllers/index.d.ts +0 -1
- package/lib/controllers/index.js.map +0 -1
- package/lib/core/arrays.d.ts +0 -1
- package/lib/core/arrays.js +0 -3
- package/lib/core/arrays.js.map +0 -1
- package/lib/core/dto.d.ts +0 -26
- package/lib/core/dto.js.map +0 -1
- package/lib/core/errors.d.ts +0 -51
- package/lib/core/errors.js +0 -155
- package/lib/core/errors.js.map +0 -1
- package/lib/core/index.d.ts +0 -7
- package/lib/core/index.js +0 -11
- package/lib/core/index.js.map +0 -1
- package/lib/core/opaqueTypes.d.ts +0 -12
- package/lib/core/opaqueTypes.js +0 -8
- package/lib/core/opaqueTypes.js.map +0 -1
- package/lib/core/pagination.d.ts +0 -32
- package/lib/core/pagination.js +0 -66
- package/lib/core/pagination.js.map +0 -1
- package/lib/core/query.d.ts +0 -21
- package/lib/core/query.js +0 -17
- package/lib/core/query.js.map +0 -1
- package/lib/core/serverError.d.ts +0 -42
- package/lib/core/serverError.js +0 -86
- package/lib/core/serverError.js.map +0 -1
- package/lib/core/types.d.ts +0 -37
- package/lib/core/types.js +0 -46
- package/lib/core/types.js.map +0 -1
- package/lib/database/columns.d.ts +0 -5
- package/lib/database/columns.js +0 -14
- package/lib/database/columns.js.map +0 -1
- package/lib/database/dataContext.d.ts +0 -14
- package/lib/database/dataContext.js +0 -26
- package/lib/database/dataContext.js.map +0 -1
- package/lib/database/entities.d.ts +0 -10
- package/lib/database/entities.js +0 -29
- package/lib/database/entities.js.map +0 -1
- package/lib/database/query.d.ts +0 -3
- package/lib/database/query.js +0 -51
- package/lib/database/query.js.map +0 -1
- package/lib/database/relationsBuilder.d.ts +0 -6
- package/lib/database/relationsBuilder.js +0 -33
- package/lib/database/relationsBuilder.js.map +0 -1
- package/lib/database/repository.d.ts +0 -32
- package/lib/database/repository.js +0 -157
- package/lib/database/repository.js.map +0 -1
- package/lib/database/select.d.ts +0 -4
- package/lib/database/select.js +0 -27
- package/lib/database/select.js.map +0 -1
- package/lib/database/transformers.d.ts +0 -12
- package/lib/database/transformers.js +0 -38
- package/lib/database/transformers.js.map +0 -1
- package/lib/graphql/GraphqlController.d.ts +0 -12
- package/lib/graphql/GraphqlController.js +0 -81
- package/lib/graphql/GraphqlController.js.map +0 -1
- package/lib/graphql/index.d.ts +0 -4
- package/lib/graphql/index.js +0 -8
- package/lib/graphql/index.js.map +0 -1
- package/lib/graphql/init.d.ts +0 -9
- package/lib/graphql/init.js +0 -51
- package/lib/graphql/init.js.map +0 -1
- package/lib/graphql/registrations.d.ts +0 -7
- package/lib/graphql/registrations.js +0 -16
- package/lib/graphql/registrations.js.map +0 -1
- package/lib/graphql/types/InputTypes/index.d.ts +0 -2
- package/lib/graphql/types/InputTypes/index.js +0 -6
- package/lib/graphql/types/InputTypes/index.js.map +0 -1
- package/lib/graphql/types/InputTypes/paging.d.ts +0 -5
- package/lib/graphql/types/InputTypes/paging.js +0 -20
- package/lib/graphql/types/InputTypes/paging.js.map +0 -1
- package/lib/graphql/types/InputTypes/query.d.ts +0 -7
- package/lib/graphql/types/InputTypes/query.js +0 -36
- package/lib/graphql/types/InputTypes/query.js.map +0 -1
- package/lib/graphql/types/ObjectTypes/index.d.ts +0 -2
- package/lib/graphql/types/ObjectTypes/index.js +0 -6
- package/lib/graphql/types/ObjectTypes/index.js.map +0 -1
- package/lib/graphql/types/ObjectTypes/paging.d.ts +0 -6
- package/lib/graphql/types/ObjectTypes/paging.js +0 -24
- package/lib/graphql/types/ObjectTypes/paging.js.map +0 -1
- package/lib/graphql/types/ObjectTypes/user.d.ts +0 -26
- package/lib/graphql/types/ObjectTypes/user.js +0 -114
- package/lib/graphql/types/ObjectTypes/user.js.map +0 -1
- package/lib/graphql/types/index.d.ts +0 -2
- package/lib/graphql/types/index.js +0 -6
- package/lib/graphql/types/index.js.map +0 -1
- package/lib/middleware/health.d.ts +0 -4
- package/lib/middleware/health.js +0 -15
- package/lib/middleware/health.js.map +0 -1
- package/lib/notify/decorator.d.ts +0 -6
- package/lib/notify/decorator.js +0 -8
- package/lib/notify/decorator.js.map +0 -1
- package/lib/notify/index.d.ts +0 -1
- package/lib/notify/index.js +0 -5
- package/lib/notify/index.js.map +0 -1
- package/lib/public/api-clients/auditClientApi.d.ts +0 -165
- package/lib/public/api-clients/auditClientApi.js +0 -255
- package/lib/public/api-clients/auditClientApi.js.map +0 -1
- package/lib/public/api-clients/authClientApi.d.ts +0 -585
- package/lib/public/api-clients/authClientApi.js +0 -555
- package/lib/public/api-clients/authClientApi.js.map +0 -1
- package/lib/public/api-clients/notifyClientApi.d.ts +0 -435
- package/lib/public/api-clients/notifyClientApi.js +0 -386
- package/lib/public/api-clients/notifyClientApi.js.map +0 -1
- package/lib/public/api-clients/storageClientApi.d.ts +0 -345
- package/lib/public/api-clients/storageClientApi.js +0 -340
- package/lib/public/api-clients/storageClientApi.js.map +0 -1
- package/lib/services/client.d.ts +0 -2
- package/lib/services/client.js +0 -38
- package/lib/services/client.js.map +0 -1
- package/lib/services/encryption.d.ts +0 -20
- package/lib/services/encryption.js +0 -74
- package/lib/services/encryption.js.map +0 -1
- package/lib/services/identity.d.ts +0 -7
- package/lib/services/identity.js +0 -41
- package/lib/services/identity.js.map +0 -1
- package/lib/services/index.d.ts +0 -8
- package/lib/services/index.js +0 -12
- package/lib/services/index.js.map +0 -1
- package/lib/services/jsonSchema.d.ts +0 -7
- package/lib/services/jsonSchema.js +0 -22
- package/lib/services/jsonSchema.js.map +0 -1
- package/lib/services/time.d.ts +0 -21
- package/lib/services/time.js +0 -20
- package/lib/services/time.js.map +0 -1
- package/lib/services/token.d.ts +0 -5
- package/lib/services/token.js +0 -17
- package/lib/services/token.js.map +0 -1
- package/lib/services/transaction.d.ts +0 -7
- package/lib/services/transaction.js +0 -11
- package/lib/services/transaction.js.map +0 -1
- package/lib/services/uuidGenerator.d.ts +0 -7
- package/lib/services/uuidGenerator.js +0 -11
- package/lib/services/uuidGenerator.js.map +0 -1
- package/lib/tasks/configTypes.d.ts +0 -3
- package/lib/tasks/configTypes.js +0 -3
- package/lib/tasks/configTypes.js.map +0 -1
- package/lib/tasks/data/ScheduledTaskRepository.d.ts +0 -14
- package/lib/tasks/data/ScheduledTaskRepository.js +0 -64
- package/lib/tasks/data/ScheduledTaskRepository.js.map +0 -1
- package/lib/tasks/data/TaskRepository.d.ts +0 -17
- package/lib/tasks/data/TaskRepository.js +0 -69
- package/lib/tasks/data/TaskRepository.js.map +0 -1
- package/lib/tasks/data/entities/ScheduledTask.d.ts +0 -10
- package/lib/tasks/data/entities/ScheduledTask.js +0 -33
- package/lib/tasks/data/entities/ScheduledTask.js.map +0 -1
- package/lib/tasks/data/entities/Task.d.ts +0 -13
- package/lib/tasks/data/entities/Task.js +0 -46
- package/lib/tasks/data/entities/Task.js.map +0 -1
- package/lib/tasks/data/repositories.d.ts +0 -18
- package/lib/tasks/data/repositories.js +0 -3
- package/lib/tasks/data/repositories.js.map +0 -1
- package/lib/tasks/data/types/opaqueTypes.d.ts +0 -3
- package/lib/tasks/data/types/opaqueTypes.js +0 -3
- package/lib/tasks/data/types/opaqueTypes.js.map +0 -1
- package/lib/tasks/data/types/scheduledTaskTypes.d.ts +0 -11
- package/lib/tasks/data/types/scheduledTaskTypes.js +0 -3
- package/lib/tasks/data/types/scheduledTaskTypes.js.map +0 -1
- package/lib/tasks/data/types/taskTypes.d.ts +0 -18
- package/lib/tasks/data/types/taskTypes.js +0 -10
- package/lib/tasks/data/types/taskTypes.js.map +0 -1
- package/lib/tasks/index.d.ts +0 -3
- package/lib/tasks/index.js +0 -7
- package/lib/tasks/index.js.map +0 -1
- package/lib/tasks/services/TaskService.d.ts +0 -19
- package/lib/tasks/services/TaskService.js +0 -107
- package/lib/tasks/services/TaskService.js.map +0 -1
- package/lib/tasks/services/index.d.ts +0 -16
- package/lib/tasks/services/index.js +0 -3
- package/lib/tasks/services/index.js.map +0 -1
- package/lib/tasks/validators/index.d.ts +0 -2
- package/lib/tasks/validators/index.js +0 -6
- package/lib/tasks/validators/index.js.map +0 -1
- package/lib/tasks/validators/scheduledTaskValidators.d.ts +0 -5
- package/lib/tasks/validators/scheduledTaskValidators.js +0 -12
- package/lib/tasks/validators/scheduledTaskValidators.js.map +0 -1
- package/lib/tasks/validators/taskValidators.d.ts +0 -5
- package/lib/tasks/validators/taskValidators.js +0 -15
- package/lib/tasks/validators/taskValidators.js.map +0 -1
- package/lib/tracing/decorator.d.ts +0 -19
- package/lib/tracing/decorator.js +0 -101
- package/lib/tracing/decorator.js.map +0 -1
- package/lib/tracing/index.d.ts +0 -3
- package/lib/tracing/index.js +0 -7
- package/lib/tracing/index.js.map +0 -1
- package/lib/tracing/init.d.ts +0 -4
- package/lib/tracing/init.js +0 -24
- package/lib/tracing/init.js.map +0 -1
- package/lib/tracing/middleware.d.ts +0 -3
- package/lib/tracing/middleware.js +0 -15
- package/lib/tracing/middleware.js.map +0 -1
- package/lib/utils/array.d.ts +0 -1
- package/lib/utils/array.js +0 -19
- package/lib/utils/array.js.map +0 -1
- package/lib/utils/base64.d.ts +0 -1
- package/lib/utils/base64.js +0 -12
- package/lib/utils/base64.js.map +0 -1
- package/lib/utils/context.d.ts +0 -16
- package/lib/utils/context.js +0 -21
- package/lib/utils/context.js.map +0 -1
- package/lib/utils/dates.d.ts +0 -12
- package/lib/utils/dates.js +0 -46
- package/lib/utils/dates.js.map +0 -1
- package/lib/utils/errors.d.ts +0 -4
- package/lib/utils/errors.js +0 -24
- package/lib/utils/errors.js.map +0 -1
- package/lib/utils/httpErrors.d.ts +0 -7
- package/lib/utils/httpErrors.js +0 -9
- package/lib/utils/httpErrors.js.map +0 -1
- package/lib/utils/number.d.ts +0 -4
- package/lib/utils/number.js +0 -21
- package/lib/utils/number.js.map +0 -1
- package/lib/utils/object.d.ts +0 -6
- package/lib/utils/object.js +0 -40
- package/lib/utils/object.js.map +0 -1
- package/lib/utils/random.d.ts +0 -13
- package/lib/utils/random.js +0 -41
- package/lib/utils/random.js.map +0 -1
- package/lib/utils/string.d.ts +0 -3
- package/lib/utils/string.js +0 -32
- package/lib/utils/string.js.map +0 -1
- package/lib/validation/index.d.ts +0 -1
- package/lib/validation/index.js +0 -5
- package/lib/validation/index.js.map +0 -1
- package/lib/validation/validators.d.ts +0 -32
- package/lib/validation/validators.js +0 -158
- package/lib/validation/validators.js.map +0 -1
- package/tsconfig.json +0 -35
package/README.md
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `package-boilerplate`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> TODO: description
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
## bootstrap
|
|
8
7
|
|
|
9
|
-
Startup functions for use with Rocketmakers API controller and IoC.
|
|
10
|
-
|
|
11
|
-
## controllers
|
|
12
|
-
|
|
13
|
-
Common controllers such as kubernetes health controller.
|
|
14
|
-
|
|
15
|
-
## database
|
|
16
|
-
|
|
17
|
-
Database utility functions. Currently only supports typeorm.
|
|
18
|
-
|
|
19
|
-
## middleware
|
|
20
|
-
|
|
21
|
-
Express middleware utils such as error handling etc.
|
|
22
|
-
|
|
23
|
-
## validation
|
|
24
|
-
|
|
25
|
-
Common validation functions.
|
|
26
|
-
|
|
27
|
-
## auth
|
|
28
|
-
|
|
29
|
-
Authentication helpers including user types and authorisation functions.
|
|
30
|
-
|
|
31
|
-
## config
|
|
32
|
-
|
|
33
|
-
Defines shape of config and ways of extracting it.
|
|
34
|
-
|
|
35
|
-
## core
|
|
36
|
-
|
|
37
|
-
Core types to be used throughout the system.
|
|
38
|
-
|
|
39
|
-
## graphql
|
|
40
|
-
|
|
41
|
-
Useful graphql functions including a GraphqlController and initialisation.
|
|
42
|
-
|
|
43
|
-
## notify
|
|
44
|
-
|
|
45
|
-
Simple notification decorator for generating notification definitions.
|
|
46
|
-
|
|
47
|
-
## services
|
|
48
|
-
|
|
49
|
-
Useful services such as encryption, generating API clients etc.
|
|
50
|
-
|
|
51
|
-
## utils
|
|
52
|
-
|
|
53
|
-
Generic utility functions.
|
package/lib/bootstrap/boot.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare function coreBoot(name: string, bootstrap: (bootstrapped: CommonBootstrapped, config: AppConfig) => void, settings?: IInitialiseBootSettings): Promise<CommonBootstrapped>;
|
|
10
|
-
export declare function boot(name: string, bootstrap: (bootstrapped: CommonBootstrapped, config: AppConfig) => void, settings?: IInitialiseBootSettings): Promise<void>;
|
|
1
|
+
/// <reference types="bunyan" />
|
|
2
|
+
import { Logger } from '@rocketmakers/log';
|
|
3
|
+
import { IExpressSetup } from './createExpressApp';
|
|
4
|
+
import { AppConfig } from '../config';
|
|
5
|
+
export declare function protectedBoot(func: () => Promise<void>): void;
|
|
6
|
+
export declare function boot(name: string, bootstrap: (logger: Logger, config: AppConfig) => Promise<void>, setup: IExpressSetup): Promise<import("express-serve-static-core").Express>;
|
|
7
|
+
//# sourceMappingURL=boot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/bootstrap/boot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAoB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAc,MAAM,WAAW,CAAC;AAElD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAO7D;AAED,wBAAsB,IAAI,CACxB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,EAC/D,KAAK,EAAE,aAAa,wDA6BrB"}
|
package/lib/bootstrap/boot.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.boot = exports.
|
|
3
|
+
exports.boot = exports.protectedBoot = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const log_1 = require("@rocketmakers/log");
|
|
6
|
+
const tsoa_1 = require("tsoa");
|
|
6
7
|
const createExpressApp_1 = require("./createExpressApp");
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
kernel_1.makeInjectable(repository_1.CustomRepositoryBase);
|
|
14
|
-
kernel_1.makeUnmanaged(repository_1.CustomRepositoryBase, 0);
|
|
15
|
-
const bootstrapped = yield common_1.commonBootstrap(name, app_1.appConfig);
|
|
16
|
-
yield bootstrap(bootstrapped, app_1.appConfig);
|
|
17
|
-
if (app_1.appConfig.tracing.enabled) {
|
|
18
|
-
init_1.initTracing(app_1.appConfig.tracing, bootstrapped.logger);
|
|
19
|
-
}
|
|
20
|
-
if (settings && settings.preRun) {
|
|
21
|
-
yield settings.preRun(app_1.appConfig);
|
|
22
|
-
}
|
|
23
|
-
return bootstrapped;
|
|
8
|
+
const config_1 = require("../config");
|
|
9
|
+
function protectedBoot(func) {
|
|
10
|
+
func().catch(e => {
|
|
11
|
+
console.error(e, 'Fatal error during api boot', 'Exiting process');
|
|
12
|
+
process.exit(1);
|
|
24
13
|
});
|
|
25
14
|
}
|
|
26
|
-
exports.
|
|
27
|
-
function boot(name, bootstrap,
|
|
15
|
+
exports.protectedBoot = protectedBoot;
|
|
16
|
+
function boot(name, bootstrap, setup) {
|
|
28
17
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
18
|
+
const config = yield (0, config_1.initConfig)();
|
|
19
|
+
const logger = log_1.ConsoleLogger.create(name);
|
|
20
|
+
const origValidator = tsoa_1.ValidationService.prototype.ValidateParam;
|
|
21
|
+
tsoa_1.ValidationService.prototype.ValidateParam = function (property, rawValue, _name, _fieldErrors, parent, minimalSwaggerConfig) {
|
|
22
|
+
const fe = {};
|
|
23
|
+
const value = origValidator.apply(this, [property, rawValue, name, fe, parent, minimalSwaggerConfig]);
|
|
24
|
+
const keys = Object.keys(fe);
|
|
25
|
+
if (keys.length > 0) {
|
|
26
|
+
return rawValue;
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
};
|
|
30
|
+
yield bootstrap(logger, config);
|
|
31
|
+
const app = (0, createExpressApp_1.createExpressApp)(logger, config, setup);
|
|
32
|
+
app.listen(config.port, () => logger.info(`Listening on port ${config.port}`));
|
|
33
|
+
return app;
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
exports.boot = boot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/bootstrap/boot.ts"],"names":[],"mappings":";;;;AAAA,2CAA0D;AAC1D,+BAAsD;AACtD,yDAAqE;AACrE,sCAAkD;AAElD,SAAgB,aAAa,CAAC,IAAyB;IACrD,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAEf,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,6BAA6B,EAAE,iBAAiB,CAAC,CAAC;QAEnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAPD,sCAOC;AAED,SAAsB,IAAI,CACxB,IAAY,EACZ,SAA+D,EAC/D,KAAoB;;QAEpB,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,GAAE,CAAC;QAClC,MAAM,MAAM,GAAG,mBAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAE1C,MAAM,aAAa,GAAG,wBAAiB,CAAC,SAAS,CAAC,aAAa,CAAC;QAEhE,wBAAiB,CAAC,SAAS,CAAC,aAAa,GAAG,UAC1C,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,MAAM,EACN,oBAAoB;YAEpB,MAAM,EAAE,GAAgB,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC;YACtG,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7B,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;gBACnB,OAAO,QAAQ,CAAC;aACjB;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEhC,MAAM,GAAG,GAAG,IAAA,mCAAgB,EAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACpD,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/E,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAhCD,oBAgCC"}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Logger, LoggerLevel } from '@rocketmakers/log';
|
|
3
|
-
import { AppConfig } from '../config/app';
|
|
4
|
-
import { types } from '../core/types';
|
|
5
|
-
export interface BootstrappedLogger {
|
|
6
|
-
logger: Logger;
|
|
7
|
-
}
|
|
8
|
-
export interface CommonBootstrapped extends BootstrappedLogger {
|
|
9
|
-
config: AppConfig;
|
|
10
|
-
types: typeof types;
|
|
11
|
-
}
|
|
1
|
+
import { LoggerLevel } from '@rocketmakers/log';
|
|
12
2
|
export declare type TValidLogLevels = LoggerLevel;
|
|
13
|
-
export declare function getSingleLogLevel(loggerLevels?: string): LoggerLevel;
|
|
14
3
|
export declare function getMultipleLogLevels<T extends string[]>(loggerLevels: string | undefined, supportedLogLevels: T): T;
|
|
15
|
-
|
|
4
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/bootstrap/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,oBAAY,eAAe,GAAG,WAAW,CAAC;AAE1C,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,YAAY,oBAAU,EAAE,kBAAkB,EAAE,CAAC,GAAG,CAAC,CAOzG"}
|
package/lib/bootstrap/common.js
CHANGED
|
@@ -1,59 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const encryption_1 = require("../services/encryption");
|
|
6
|
-
const app_1 = require("../config/app");
|
|
7
|
-
const kernel_1 = require("./kernel");
|
|
8
|
-
const types_1 = require("../core/types");
|
|
9
|
-
const dataContext_1 = require("../database/dataContext");
|
|
10
|
-
const time_1 = require("../services/time");
|
|
11
|
-
const uuidGenerator_1 = require("../services/uuidGenerator");
|
|
12
|
-
const string_1 = require("../utils/string");
|
|
13
|
-
const transaction_1 = require("../services/transaction");
|
|
14
|
-
const auth_1 = require("../auth");
|
|
15
|
-
const validLogLevels = ['trace', 'debug', 'debug', 'fatal', 'info', 'warn'];
|
|
16
|
-
function getSingleLogLevel(loggerLevels = 'info') {
|
|
17
|
-
const selectedLogLevel = loggerLevels.split(',')[0];
|
|
18
|
-
if (!validLogLevels.includes(selectedLogLevel)) {
|
|
19
|
-
return 'info';
|
|
20
|
-
}
|
|
21
|
-
return selectedLogLevel;
|
|
22
|
-
}
|
|
23
|
-
exports.getSingleLogLevel = getSingleLogLevel;
|
|
3
|
+
exports.getMultipleLogLevels = void 0;
|
|
24
4
|
function getMultipleLogLevels(loggerLevels = 'error', supportedLogLevels) {
|
|
25
5
|
const selectedLogLevels = loggerLevels.split(',');
|
|
26
|
-
const validSelectedLogLevels = selectedLogLevels.filter(
|
|
6
|
+
const validSelectedLogLevels = selectedLogLevels.filter(sll => supportedLogLevels.includes(sll));
|
|
27
7
|
if (validSelectedLogLevels.length === 0) {
|
|
28
8
|
return ['error'];
|
|
29
9
|
}
|
|
30
10
|
return validSelectedLogLevels;
|
|
31
11
|
}
|
|
32
12
|
exports.getMultipleLogLevels = getMultipleLogLevels;
|
|
33
|
-
function commonBootstrap(name, config) {
|
|
34
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
yield app_1.initConfig();
|
|
36
|
-
const registeredLogLevel = getSingleLogLevel(config.logLevels);
|
|
37
|
-
const loggerRegistration = kernel_1.registerLogger(name, registeredLogLevel);
|
|
38
|
-
loggerRegistration.logger.info(`${string_1.upperFirst(name)} log level: ${registeredLogLevel}`);
|
|
39
|
-
kernel_1.registerConstant(types_1.types.Config, config);
|
|
40
|
-
kernel_1.registerConstant(types_1.types.Services.Time, new time_1.TimeService());
|
|
41
|
-
kernel_1.registerConstant(types_1.types.Services.UuidGenerator, new uuidGenerator_1.UuidGeneratorService());
|
|
42
|
-
kernel_1.registerSingleton(transaction_1.TransactionService, types_1.types.Services.Transaction);
|
|
43
|
-
kernel_1.registerSingleton(dataContext_1.DataContextProvider, types_1.types.Services.DataContextProvider);
|
|
44
|
-
kernel_1.registerSingleton(auth_1.ContextProvider, types_1.types.Services.ContextProvider);
|
|
45
|
-
kernel_1.registerSingleton(dataContext_1.DataContextProvider, types_1.types.Services.DataContextProvider);
|
|
46
|
-
if (config.encryptionKey) {
|
|
47
|
-
const key = config.encryptionKey;
|
|
48
|
-
const encryptionService = new encryption_1.EncryptionService(key);
|
|
49
|
-
const result = yield encryptionService.test();
|
|
50
|
-
if (!result || result.isSuccessful === false) {
|
|
51
|
-
throw new Error(result ? result.message : 'Encryption service failing test with configured keys');
|
|
52
|
-
}
|
|
53
|
-
kernel_1.registerConstant(types_1.types.Services.Encryption, encryptionService);
|
|
54
|
-
}
|
|
55
|
-
return Object.assign(Object.assign({}, loggerRegistration), { config, types: types_1.types });
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
exports.commonBootstrap = commonBootstrap;
|
|
59
13
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/bootstrap/common.ts"],"names":[],"mappings":";;;AAIA,SAAgB,oBAAoB,CAAqB,YAAY,GAAG,OAAO,EAAE,kBAAqB;IACpG,MAAM,iBAAiB,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAM,CAAC;IACvD,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,GAAsB,CAAC,CAAC,CAAC;IACpH,IAAI,sBAAsB,CAAC,MAAM,KAAK,CAAC,EAAE;QACvC,OAAO,CAAC,OAAO,CAAM,CAAC;KACvB;IACD,OAAO,sBAA2B,CAAC;AACrC,CAAC;AAPD,oDAOC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
/// <reference types="bunyan" />
|
|
1
2
|
import * as express from 'express';
|
|
2
|
-
import {
|
|
3
|
-
import { AppConfig } from '../config
|
|
4
|
-
export
|
|
3
|
+
import { Logger } from '@rocketmakers/log';
|
|
4
|
+
import { AppConfig } from '../config';
|
|
5
|
+
export interface IExpressSetup {
|
|
6
|
+
pre?: (app: express.Express) => void;
|
|
7
|
+
post: (app: express.Express) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createExpressApp(logger: Logger, config: AppConfig, setup: IExpressSetup): import("express-serve-static-core").Express;
|
|
10
|
+
//# sourceMappingURL=createExpressApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createExpressApp.d.ts","sourceRoot":"","sources":["../../src/bootstrap/createExpressApp.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAatC,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC;IACrC,IAAI,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,+CA4BvF"}
|
|
@@ -5,60 +5,36 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const bodyParser = require("body-parser");
|
|
6
6
|
const cors = require("cors");
|
|
7
7
|
const express = require("express");
|
|
8
|
-
const rokot_apicontroller_1 = require("rokot-apicontroller");
|
|
9
8
|
const terminus_1 = require("@godaddy/terminus");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
logger.error(message);
|
|
18
|
-
throw new Error(message);
|
|
19
|
-
}
|
|
20
|
-
function updateApiControllers() {
|
|
21
|
-
for (const controller of rokot_apicontroller_1.apiControllers) {
|
|
22
|
-
for (const route of controller.routes) {
|
|
23
|
-
const instance = kernel_1.kernel.get(controller.name);
|
|
24
|
-
if (instance[route.memberName]) {
|
|
25
|
-
route.func = instance[route.memberName];
|
|
26
|
-
}
|
|
9
|
+
const middleware_1 = require("../middleware");
|
|
10
|
+
function healthCheck(logger, path) {
|
|
11
|
+
logger.trace(`Adding health check at ${path}`);
|
|
12
|
+
return (req, res, next) => {
|
|
13
|
+
if (req.path === path) {
|
|
14
|
+
res.status(204).send();
|
|
15
|
+
return;
|
|
27
16
|
}
|
|
28
|
-
|
|
17
|
+
next();
|
|
18
|
+
};
|
|
29
19
|
}
|
|
30
|
-
function createExpressApp(
|
|
20
|
+
function createExpressApp(logger, config, setup) {
|
|
31
21
|
const app = express();
|
|
32
|
-
if (setup) {
|
|
33
|
-
setup(app);
|
|
22
|
+
if (setup.pre) {
|
|
23
|
+
setup.pre(app);
|
|
34
24
|
}
|
|
35
|
-
const { logger } = bootstrapped;
|
|
36
25
|
app.set('etag', false);
|
|
37
26
|
app.use(cors({ origin: true, credentials: true }));
|
|
38
27
|
app.disable('x-powered-by');
|
|
39
|
-
app.use(
|
|
28
|
+
app.use(healthCheck(logger, '/health'));
|
|
40
29
|
app.use(bodyParser.json());
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (runtimeApi.errors && runtimeApi.errors.length) {
|
|
46
|
-
fail(logger, 'Unable to build api model - Service stopping!');
|
|
47
|
-
}
|
|
48
|
-
const builder = new request_1.CustomExpressRouteBuilder(isCloud, port || '', logger, app, (_, n) => kernel_1.kernel.get(n));
|
|
49
|
-
const ok = builder.build(runtimeApi);
|
|
50
|
-
if (!ok) {
|
|
51
|
-
fail(logger, 'Unable to build express routes - Service stopping!');
|
|
52
|
-
}
|
|
53
|
-
if (environment !== 'production') {
|
|
54
|
-
app.get('/graphql', graphql_playground_middleware_express_1.default({ endpoint: '/graphql' }));
|
|
55
|
-
}
|
|
56
|
-
app.use(errors_1.errorRequestHandler(logger, errorHandler));
|
|
57
|
-
terminus_1.createTerminus(app, {
|
|
30
|
+
app.use(bodyParser.raw({ limit: config.requestRawBodySizeLimit }));
|
|
31
|
+
setup.post(app);
|
|
32
|
+
app.use((0, middleware_1.errorRequestHandler)(logger));
|
|
33
|
+
(0, terminus_1.createTerminus)(app, {
|
|
58
34
|
beforeShutdown() {
|
|
59
35
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
36
|
logger.warn(`Server about to shutdown`);
|
|
61
|
-
return new Promise(
|
|
37
|
+
return new Promise(resolve => {
|
|
62
38
|
setTimeout(resolve, 5000);
|
|
63
39
|
});
|
|
64
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createExpressApp.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"createExpressApp.js","sourceRoot":"","sources":["../../src/bootstrap/createExpressApp.ts"],"names":[],"mappings":";;;;AAAA,0CAA0C;AAC1C,6BAA6B;AAC7B,mCAAmC;AAEnC,gDAAmD;AACnD,8CAAoD;AAGpD,SAAS,WAAW,CAAC,MAAc,EAAE,IAAY;IAC/C,MAAM,CAAC,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAoB,EAAE,GAAqB,EAAE,IAA0B,EAAE,EAAE;QACjF,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,EAAE;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACvB,OAAO;SACR;QACD,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAOD,SAAgB,gBAAgB,CAAC,MAAc,EAAE,MAAiB,EAAE,KAAoB;IACtF,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC;IAEtB,IAAI,KAAK,CAAC,GAAG,EAAE;QACb,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAChB;IAED,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACvB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACnD,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5B,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACxC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3B,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC;IAEnE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEhB,GAAG,CAAC,GAAG,CAAC,IAAA,gCAAmB,EAAC,MAAM,CAAC,CAAC,CAAC;IAErC,IAAA,yBAAc,EAAC,GAAG,EAAE;QACZ,cAAc;;gBAClB,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACxC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;oBAC3B,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACL,CAAC;SAAA;KACF,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC;AA5BD,4CA4BC"}
|
package/lib/bootstrap/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bootstrap/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,OAAO,CAAC"}
|
package/lib/bootstrap/index.js
CHANGED
|
@@ -4,6 +4,5 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./boot"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./common"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./createExpressApp"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./
|
|
8
|
-
tslib_1.__exportStar(require("./request"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./ioc"), exports);
|
|
9
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bootstrap/index.ts"],"names":[],"mappings":";;;AAAA,iDAAuB;AACvB,mDAAyB;AACzB,6DAAmC;AACnC,gDAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/ioc/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bootstrap/ioc/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B;AAC3B,kDAAwB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IContainer } from '@rocketmakers/ioc';
|
|
2
|
+
import { AppConfig } from '../..';
|
|
3
|
+
import { ICommonContainerTypes } from './types';
|
|
4
|
+
export declare function registerCommonIoC(config: AppConfig): IContainer<ICommonContainerTypes>;
|
|
5
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/ioc/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAmD,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAOtF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerCommonIoC = void 0;
|
|
4
|
+
const ioc_1 = require("@rocketmakers/ioc");
|
|
5
|
+
const orbit_db_typeorm_1 = require("@rocketmakers/orbit-db-typeorm");
|
|
6
|
+
const __1 = require("../..");
|
|
7
|
+
function registerCommonIoC(config) {
|
|
8
|
+
return (0, ioc_1.register)({
|
|
9
|
+
config: builder => builder.constant(config),
|
|
10
|
+
transactionService: builder => builder.class(orbit_db_typeorm_1.TransactionService, []).inSingletonScope(),
|
|
11
|
+
healthController: builder => builder.class(__1.HealthController, []).inTransientScope(),
|
|
12
|
+
transactionalHealthController: builder => builder.class(__1.TransactionalHealthController, []).inTransientScope(),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.registerCommonIoC = registerCommonIoC;
|
|
16
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/bootstrap/ioc/register.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,qEAAoE;AACpE,6BAAmF;AAGnF,SAAgB,iBAAiB,CAAC,MAAiB;IACjD,OAAO,IAAA,cAAQ,EAAwB;QACrC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC3C,kBAAkB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,qCAAkB,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE;QACvF,gBAAgB,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,oBAAgB,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE;QACnF,6BAA6B,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,iCAA6B,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE;KAC9G,CAAC,CAAC;AACL,CAAC;AAPD,8CAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsoaIoc.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/ioc/tsoaIoc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAGpC,cAAM,GAAI,YAAW,YAAY;IAC/B,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE;QAAE,SAAS,EAAE,CAAC,CAAA;KAAE,GAAG,CAAC;CAGxC;AAGD,eAAO,MAAM,YAAY,KAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsoaIoc.helper.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/ioc/tsoaIoc.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,qBAAqB,GAAG,cAAc,CAI9E;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM,qBAAqB,CAEtE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContainerKey = exports.ContainerKey = void 0;
|
|
4
|
+
const iocKey = Symbol('ContainerIocKey');
|
|
5
|
+
function ContainerKey(name) {
|
|
6
|
+
return t => {
|
|
7
|
+
t[iocKey] = name;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.ContainerKey = ContainerKey;
|
|
11
|
+
function getContainerKey(item) {
|
|
12
|
+
return item[iocKey];
|
|
13
|
+
}
|
|
14
|
+
exports.getContainerKey = getContainerKey;
|
|
15
|
+
//# sourceMappingURL=tsoaIoc.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsoaIoc.helper.js","sourceRoot":"","sources":["../../../src/bootstrap/ioc/tsoaIoc.helper.ts"],"names":[],"mappings":";;;AAEA,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACzC,SAAgB,YAAY,CAAC,IAAiC;IAC5D,OAAO,CAAC,CAAC,EAAE;QACR,CAAS,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC;AAJD,oCAIC;AAED,SAAgB,eAAe,CAAC,IAAS;IACvC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAFD,0CAEC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.iocContainer = void 0;
|
|
4
|
+
const ioc_1 = require("@rocketmakers/ioc");
|
|
5
|
+
const tsoaIoc_helper_1 = require("./tsoaIoc.helper");
|
|
6
|
+
class Ioc {
|
|
7
|
+
get(controller) {
|
|
8
|
+
return ioc_1.internalContainer.get((0, tsoaIoc_helper_1.getContainerKey)(controller));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.iocContainer = new Ioc();
|
|
12
|
+
//# sourceMappingURL=tsoaIoc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsoaIoc.js","sourceRoot":"","sources":["../../../src/bootstrap/ioc/tsoaIoc.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AAEtD,qDAAmD;AAEnD,MAAM,GAAG;IACP,GAAG,CAAI,UAA4B;QACjC,OAAO,uBAAiB,CAAC,GAAG,CAAC,IAAA,gCAAe,EAAC,UAAU,CAAC,CAAiB,CAAC;IAC5E,CAAC;CACF;AAGY,QAAA,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TransactionService } from '@rocketmakers/orbit-db-typeorm';
|
|
2
|
+
import { AppConfig } from '../../config/app';
|
|
3
|
+
import { HealthController, TransactionalHealthController } from '../../rest';
|
|
4
|
+
export interface ICommonContainerTypes {
|
|
5
|
+
config: AppConfig;
|
|
6
|
+
transactionService: TransactionService;
|
|
7
|
+
healthController: HealthController;
|
|
8
|
+
transactionalHealthController: TransactionalHealthController;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/ioc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAE7E,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,SAAS,CAAC;IAGlB,kBAAkB,EAAE,kBAAkB,CAAC;IAGvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,6BAA6B,EAAE,6BAA6B,CAAC;CAC9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/bootstrap/ioc/types.ts"],"names":[],"mappings":""}
|
package/lib/config/app.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GraphQLOptions } from 'apollo-server-core';
|
|
3
|
-
import { TSupportedDatabases } from '../database/connectionFactory';
|
|
4
|
-
export declare type EnvironmentType = 'dev' | 'test' | 'production';
|
|
1
|
+
import { TSupportedDatabases } from '@rocketmakers/orbit-core';
|
|
5
2
|
export interface IDatabaseConfig {
|
|
6
3
|
name: string;
|
|
7
4
|
hostname: string;
|
|
@@ -10,57 +7,11 @@ export interface IDatabaseConfig {
|
|
|
10
7
|
port: number;
|
|
11
8
|
databaseType: TSupportedDatabases;
|
|
12
9
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
inviteExistingUser: string;
|
|
22
|
-
passwordless: string;
|
|
23
|
-
};
|
|
24
|
-
export declare const appConfig: {
|
|
25
|
-
isCloud: boolean;
|
|
26
|
-
environment: EnvironmentType;
|
|
27
|
-
authUserPrivateKey: string;
|
|
28
|
-
authUserPublicKey: string;
|
|
29
|
-
authSystemPrivateKey: string;
|
|
30
|
-
authSystemPublicKey: string;
|
|
31
|
-
port: string;
|
|
32
|
-
logLevels: string | undefined;
|
|
33
|
-
encryptionKey: string | undefined;
|
|
34
|
-
session: {
|
|
35
|
-
tokenExpirationMs: number;
|
|
36
|
-
identityServiceEndpoint: string;
|
|
37
|
-
};
|
|
38
|
-
graphqlOptions: (logger: Logger) => GraphQLOptions;
|
|
39
|
-
tracing: {
|
|
40
|
-
logger?: import("@opentelemetry/types").Logger | undefined;
|
|
41
|
-
serviceName: string;
|
|
42
|
-
tags?: import("@opentelemetry/exporter-jaeger/build/src/types").Tag[] | undefined;
|
|
43
|
-
host?: string | undefined;
|
|
44
|
-
port?: number | undefined;
|
|
45
|
-
maxPacketSize?: number | undefined;
|
|
46
|
-
forceFlush?: boolean | undefined;
|
|
47
|
-
flushTimeout?: number | undefined;
|
|
48
|
-
flushInterval?: number | undefined;
|
|
49
|
-
enabled: boolean;
|
|
50
|
-
};
|
|
51
|
-
database: IDatabaseConfig;
|
|
52
|
-
maximumTaskRetryCount: number;
|
|
53
|
-
multiTenanted: boolean;
|
|
54
|
-
enforcePasswords: boolean;
|
|
55
|
-
callbacks: {
|
|
56
|
-
createUser: string;
|
|
57
|
-
registerUser: string;
|
|
58
|
-
forgotPassword: string;
|
|
59
|
-
inviteUser: string;
|
|
60
|
-
inviteExistingUser: string;
|
|
61
|
-
passwordless: string;
|
|
62
|
-
};
|
|
63
|
-
tokenLengthForCodeTokenType: number;
|
|
64
|
-
};
|
|
65
|
-
export declare function initConfig(): Promise<void>;
|
|
66
|
-
export declare type AppConfig = typeof appConfig;
|
|
10
|
+
export interface AppConfig {
|
|
11
|
+
environment: string;
|
|
12
|
+
port: number;
|
|
13
|
+
logLevels?: string;
|
|
14
|
+
requestRawBodySizeLimit: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function initConfig(): Promise<AppConfig>;
|
|
17
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/config/app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,CASrD"}
|