@elsikora/nestjs-crud-config 4.1.0 → 5.0.0-dev.2
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 +33 -26
- package/dist/{esm/external → external}/tslib/tslib.es6.js +0 -1
- package/dist/{esm/index.d.ts → index.d.ts} +2 -2
- package/dist/{esm/index.js → index.js} +1 -1
- package/dist/{esm/modules → modules}/config/config.module.d.ts +1 -1
- package/dist/{esm/modules → modules}/config/config.module.js +4 -3
- package/dist/{cjs/modules → modules}/config/config.service.d.ts +5 -5
- package/dist/{esm/modules → modules}/config/config.service.js +0 -1
- package/dist/{cjs/modules → modules}/config/data/controller.d.ts +4 -4
- package/dist/{esm/modules → modules}/config/data/controller.js +0 -1
- package/dist/{cjs/modules → modules}/config/data/entity/entity.d.ts +4 -4
- package/dist/{esm/modules → modules}/config/data/entity/entity.js +3 -3
- package/dist/modules/config/data/entity/index.d.ts +1 -0
- package/dist/modules/config/data/index.d.ts +3 -0
- package/dist/modules/config/data/interface/index.d.ts +1 -0
- package/dist/{cjs/modules → modules}/config/data/interface/interface.d.ts +1 -1
- package/dist/modules/config/index.d.ts +11 -0
- package/dist/modules/config/interface/index.d.ts +4 -0
- package/dist/{cjs/modules → modules}/config/migration/entity/entity.d.ts +3 -3
- package/dist/{esm/modules → modules}/config/migration/entity/entity.js +4 -4
- package/dist/modules/config/migration/entity/index.d.ts +1 -0
- package/dist/modules/config/migration/enum/index.d.ts +1 -0
- package/dist/{esm/modules → modules}/config/migration/enum/status.js +0 -1
- package/dist/modules/config/migration/index.d.ts +5 -0
- package/dist/{cjs/modules → modules}/config/migration/interface/index.d.ts +3 -3
- package/dist/{esm/modules → modules}/config/migration/interface/interface.d.ts +1 -1
- package/dist/{cjs/modules → modules}/config/migration/interface/migration-definition.interface.d.ts +1 -1
- package/dist/{esm/modules → modules}/config/migration/interface/migration-options.interface.d.ts +1 -1
- package/dist/{esm/modules → modules}/config/migration/migration-runner.service.d.ts +2 -2
- package/dist/{esm/modules → modules}/config/migration/migration-runner.service.js +0 -1
- package/dist/{esm/modules → modules}/config/migration/migration.service.d.ts +3 -3
- package/dist/{esm/modules → modules}/config/migration/migration.service.js +9 -11
- package/dist/{cjs/modules → modules}/config/section/controller.d.ts +4 -4
- package/dist/{esm/modules → modules}/config/section/controller.js +0 -1
- package/dist/{esm/modules → modules}/config/section/entity/entity.d.ts +3 -3
- package/dist/{esm/modules → modules}/config/section/entity/entity.js +3 -3
- package/dist/modules/config/section/entity/index.d.ts +1 -0
- package/dist/modules/config/section/index.d.ts +2 -0
- package/dist/modules/config/section/interface/index.d.ts +1 -0
- package/dist/modules/config/type/index.d.ts +2 -0
- package/dist/{cjs/modules → modules}/config/type/type.d.ts +1 -1
- package/dist/modules/index.d.ts +1 -0
- package/dist/{esm/shared → shared}/constant/api-property.constant.js +0 -1
- package/dist/{esm/shared → shared}/constant/config/data.constant.js +0 -1
- package/dist/shared/constant/config/entity.constant.d.ts +4 -0
- package/dist/shared/constant/config/entity.constant.js +7 -0
- package/dist/shared/constant/config/index.d.ts +4 -0
- package/dist/{esm/shared → shared}/constant/config/migration.constant.js +0 -1
- package/dist/{esm/shared → shared}/constant/config/section.constant.js +0 -1
- package/dist/{esm/shared → shared}/constant/crypto.constant.js +0 -1
- package/dist/shared/constant/index.d.ts +4 -0
- package/dist/{esm/shared → shared}/constant/token.constant.js +0 -1
- package/dist/{esm/shared → shared}/enum/environment.enum.js +0 -1
- package/dist/shared/enum/index.d.ts +6 -0
- package/dist/{esm/shared → shared}/enum/instance-name.enum.js +0 -1
- package/dist/{esm/shared → shared}/enum/service.enum.js +0 -1
- package/dist/shared/index.d.ts +5 -0
- package/dist/{cjs/shared → shared}/interface/config/async-module-properties.interface.d.ts +4 -4
- package/dist/{cjs/shared → shared}/interface/config/controller-options.interface.d.ts +2 -2
- package/dist/{cjs/shared → shared}/interface/config/entity/index.d.ts +3 -3
- package/dist/{esm/shared → shared}/interface/config/entity/options.interface.d.ts +3 -2
- package/dist/{cjs/shared → shared}/interface/config/index.d.ts +8 -8
- package/dist/{esm/shared → shared}/interface/config/options.interface.d.ts +5 -5
- package/dist/{cjs/shared → shared}/interface/config/properties-factory.interface.d.ts +1 -1
- package/dist/{esm/shared → shared}/interface/config/static-options.interface.d.ts +2 -2
- package/dist/shared/interface/index.d.ts +2 -0
- package/dist/{cjs/shared → shared}/interface/utility/create-dynamic-entity/index.d.ts +2 -2
- package/dist/{esm/shared → shared}/interface/utility/create-dynamic-entity/options.interface.d.ts +1 -1
- package/dist/shared/interface/utility/index.d.ts +1 -0
- package/dist/shared/type/index.d.ts +1 -0
- package/dist/{cjs/shared → shared}/utility/create-dynamic/entity.utility.d.ts +2 -2
- package/dist/{esm/shared → shared}/utility/create-dynamic/entity.utility.js +0 -1
- package/dist/shared/utility/create-dynamic/index.d.ts +2 -0
- package/dist/{cjs/shared → shared}/utility/create-dynamic/service.utility.d.ts +1 -1
- package/dist/{esm/shared → shared}/utility/create-dynamic/service.utility.js +0 -1
- package/dist/{cjs/shared → shared}/utility/crypto.utility.d.ts +1 -1
- package/dist/{esm/shared → shared}/utility/crypto.utility.js +0 -1
- package/dist/shared/utility/index.d.ts +4 -0
- package/dist/shared/utility/logger.utility.d.ts +37 -0
- package/dist/{esm/shared → shared}/utility/logger.utility.js +26 -6
- package/package.json +73 -66
- package/dist/cjs/external/tslib/tslib.es6.js +0 -43
- package/dist/cjs/external/tslib/tslib.es6.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -11
- package/dist/cjs/index.js +0 -81
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/modules/config/config.module.d.ts +0 -33
- package/dist/cjs/modules/config/config.module.js +0 -321
- package/dist/cjs/modules/config/config.module.js.map +0 -1
- package/dist/cjs/modules/config/config.service.js +0 -315
- package/dist/cjs/modules/config/config.service.js.map +0 -1
- package/dist/cjs/modules/config/data/controller.js +0 -124
- package/dist/cjs/modules/config/data/controller.js.map +0 -1
- package/dist/cjs/modules/config/data/entity/entity.js +0 -161
- package/dist/cjs/modules/config/data/entity/entity.js.map +0 -1
- package/dist/cjs/modules/config/data/entity/index.d.ts +0 -1
- package/dist/cjs/modules/config/data/index.d.ts +0 -3
- package/dist/cjs/modules/config/data/interface/index.d.ts +0 -1
- package/dist/cjs/modules/config/index.d.ts +0 -11
- package/dist/cjs/modules/config/interface/index.d.ts +0 -4
- package/dist/cjs/modules/config/migration/entity/entity.js +0 -141
- package/dist/cjs/modules/config/migration/entity/entity.js.map +0 -1
- package/dist/cjs/modules/config/migration/entity/index.d.ts +0 -1
- package/dist/cjs/modules/config/migration/enum/index.d.ts +0 -1
- package/dist/cjs/modules/config/migration/enum/status.js +0 -11
- package/dist/cjs/modules/config/migration/enum/status.js.map +0 -1
- package/dist/cjs/modules/config/migration/index.d.ts +0 -5
- package/dist/cjs/modules/config/migration/interface/interface.d.ts +0 -12
- package/dist/cjs/modules/config/migration/interface/migration-options.interface.d.ts +0 -39
- package/dist/cjs/modules/config/migration/migration-runner.service.d.ts +0 -26
- package/dist/cjs/modules/config/migration/migration-runner.service.js +0 -93
- package/dist/cjs/modules/config/migration/migration-runner.service.js.map +0 -1
- package/dist/cjs/modules/config/migration/migration.service.d.ts +0 -79
- package/dist/cjs/modules/config/migration/migration.service.js +0 -377
- package/dist/cjs/modules/config/migration/migration.service.js.map +0 -1
- package/dist/cjs/modules/config/section/controller.js +0 -86
- package/dist/cjs/modules/config/section/controller.js.map +0 -1
- package/dist/cjs/modules/config/section/entity/entity.d.ts +0 -18
- package/dist/cjs/modules/config/section/entity/entity.js +0 -99
- package/dist/cjs/modules/config/section/entity/entity.js.map +0 -1
- package/dist/cjs/modules/config/section/entity/index.d.ts +0 -1
- package/dist/cjs/modules/config/section/index.d.ts +0 -2
- package/dist/cjs/modules/config/section/interface/index.d.ts +0 -1
- package/dist/cjs/modules/config/type/index.d.ts +0 -2
- package/dist/cjs/modules/index.d.ts +0 -1
- package/dist/cjs/package.json +0 -8
- package/dist/cjs/shared/constant/api-property.constant.js +0 -11
- package/dist/cjs/shared/constant/api-property.constant.js.map +0 -1
- package/dist/cjs/shared/constant/config/data.constant.js +0 -17
- package/dist/cjs/shared/constant/config/data.constant.js.map +0 -1
- package/dist/cjs/shared/constant/config/index.d.ts +0 -3
- package/dist/cjs/shared/constant/config/migration.constant.js +0 -15
- package/dist/cjs/shared/constant/config/migration.constant.js.map +0 -1
- package/dist/cjs/shared/constant/config/section.constant.js +0 -13
- package/dist/cjs/shared/constant/config/section.constant.js.map +0 -1
- package/dist/cjs/shared/constant/crypto.constant.js +0 -17
- package/dist/cjs/shared/constant/crypto.constant.js.map +0 -1
- package/dist/cjs/shared/constant/index.d.ts +0 -4
- package/dist/cjs/shared/constant/token.constant.js +0 -24
- package/dist/cjs/shared/constant/token.constant.js.map +0 -1
- package/dist/cjs/shared/enum/environment.enum.js +0 -20
- package/dist/cjs/shared/enum/environment.enum.js.map +0 -1
- package/dist/cjs/shared/enum/index.d.ts +0 -6
- package/dist/cjs/shared/enum/instance-name.enum.js +0 -11
- package/dist/cjs/shared/enum/instance-name.enum.js.map +0 -1
- package/dist/cjs/shared/enum/service.enum.js +0 -224
- package/dist/cjs/shared/enum/service.enum.js.map +0 -1
- package/dist/cjs/shared/index.d.ts +0 -5
- package/dist/cjs/shared/interface/config/entity/options.interface.d.ts +0 -25
- package/dist/cjs/shared/interface/config/options.interface.d.ts +0 -39
- package/dist/cjs/shared/interface/config/static-options.interface.d.ts +0 -45
- package/dist/cjs/shared/interface/index.d.ts +0 -2
- package/dist/cjs/shared/interface/utility/create-dynamic-entity/options.interface.d.ts +0 -15
- package/dist/cjs/shared/interface/utility/index.d.ts +0 -1
- package/dist/cjs/shared/type/index.d.ts +0 -1
- package/dist/cjs/shared/utility/create-dynamic/entity.utility.js +0 -68
- package/dist/cjs/shared/utility/create-dynamic/entity.utility.js.map +0 -1
- package/dist/cjs/shared/utility/create-dynamic/index.d.ts +0 -2
- package/dist/cjs/shared/utility/create-dynamic/service.utility.js +0 -35
- package/dist/cjs/shared/utility/create-dynamic/service.utility.js.map +0 -1
- package/dist/cjs/shared/utility/crypto.utility.js +0 -133
- package/dist/cjs/shared/utility/crypto.utility.js.map +0 -1
- package/dist/cjs/shared/utility/index.d.ts +0 -4
- package/dist/cjs/shared/utility/logger.utility.d.ts +0 -21
- package/dist/cjs/shared/utility/logger.utility.js +0 -68
- package/dist/cjs/shared/utility/logger.utility.js.map +0 -1
- package/dist/esm/external/tslib/tslib.es6.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/modules/config/config.module.js.map +0 -1
- package/dist/esm/modules/config/config.service.d.ts +0 -56
- package/dist/esm/modules/config/config.service.js.map +0 -1
- package/dist/esm/modules/config/data/controller.d.ts +0 -11
- package/dist/esm/modules/config/data/controller.js.map +0 -1
- package/dist/esm/modules/config/data/entity/entity.d.ts +0 -25
- package/dist/esm/modules/config/data/entity/entity.js.map +0 -1
- package/dist/esm/modules/config/data/entity/index.d.ts +0 -1
- package/dist/esm/modules/config/data/index.d.ts +0 -3
- package/dist/esm/modules/config/data/interface/index.d.ts +0 -1
- package/dist/esm/modules/config/data/interface/interface.d.ts +0 -13
- package/dist/esm/modules/config/index.d.ts +0 -11
- package/dist/esm/modules/config/interface/delete-options.interface.d.ts +0 -24
- package/dist/esm/modules/config/interface/get-list-options.interface.d.ts +0 -24
- package/dist/esm/modules/config/interface/get-options.interface.d.ts +0 -32
- package/dist/esm/modules/config/interface/index.d.ts +0 -4
- package/dist/esm/modules/config/interface/set-options.interface.d.ts +0 -36
- package/dist/esm/modules/config/migration/entity/entity.d.ts +0 -16
- package/dist/esm/modules/config/migration/entity/entity.js.map +0 -1
- package/dist/esm/modules/config/migration/entity/index.d.ts +0 -1
- package/dist/esm/modules/config/migration/enum/index.d.ts +0 -1
- package/dist/esm/modules/config/migration/enum/status.d.ts +0 -7
- package/dist/esm/modules/config/migration/enum/status.js.map +0 -1
- package/dist/esm/modules/config/migration/index.d.ts +0 -5
- package/dist/esm/modules/config/migration/interface/index.d.ts +0 -3
- package/dist/esm/modules/config/migration/interface/migration-definition.interface.d.ts +0 -31
- package/dist/esm/modules/config/migration/migration-runner.service.js.map +0 -1
- package/dist/esm/modules/config/migration/migration.service.js.map +0 -1
- package/dist/esm/modules/config/section/controller.d.ts +0 -11
- package/dist/esm/modules/config/section/controller.js.map +0 -1
- package/dist/esm/modules/config/section/entity/entity.js.map +0 -1
- package/dist/esm/modules/config/section/entity/index.d.ts +0 -1
- package/dist/esm/modules/config/section/index.d.ts +0 -2
- package/dist/esm/modules/config/section/interface/index.d.ts +0 -1
- package/dist/esm/modules/config/section/interface/interface.d.ts +0 -8
- package/dist/esm/modules/config/type/index.d.ts +0 -2
- package/dist/esm/modules/config/type/item.type.d.ts +0 -1
- package/dist/esm/modules/config/type/type.d.ts +0 -2
- package/dist/esm/modules/index.d.ts +0 -1
- package/dist/esm/package.json +0 -8
- package/dist/esm/shared/constant/api-property.constant.d.ts +0 -4
- package/dist/esm/shared/constant/api-property.constant.js.map +0 -1
- package/dist/esm/shared/constant/config/data.constant.d.ts +0 -7
- package/dist/esm/shared/constant/config/data.constant.js.map +0 -1
- package/dist/esm/shared/constant/config/index.d.ts +0 -3
- package/dist/esm/shared/constant/config/migration.constant.d.ts +0 -6
- package/dist/esm/shared/constant/config/migration.constant.js.map +0 -1
- package/dist/esm/shared/constant/config/section.constant.d.ts +0 -5
- package/dist/esm/shared/constant/config/section.constant.js.map +0 -1
- package/dist/esm/shared/constant/crypto.constant.d.ts +0 -7
- package/dist/esm/shared/constant/crypto.constant.js.map +0 -1
- package/dist/esm/shared/constant/index.d.ts +0 -4
- package/dist/esm/shared/constant/token.constant.d.ts +0 -10
- package/dist/esm/shared/constant/token.constant.js.map +0 -1
- package/dist/esm/shared/enum/environment.enum.d.ts +0 -16
- package/dist/esm/shared/enum/environment.enum.js.map +0 -1
- package/dist/esm/shared/enum/index.d.ts +0 -6
- package/dist/esm/shared/enum/instance-name.enum.d.ts +0 -7
- package/dist/esm/shared/enum/instance-name.enum.js.map +0 -1
- package/dist/esm/shared/enum/service.enum.d.ts +0 -220
- package/dist/esm/shared/enum/service.enum.js.map +0 -1
- package/dist/esm/shared/index.d.ts +0 -5
- package/dist/esm/shared/interface/config/async-module-properties.interface.d.ts +0 -47
- package/dist/esm/shared/interface/config/cache-options.interface.d.ts +0 -18
- package/dist/esm/shared/interface/config/controller-options.interface.d.ts +0 -32
- package/dist/esm/shared/interface/config/encryption-options.interface.d.ts +0 -19
- package/dist/esm/shared/interface/config/entity/data-options.interface.d.ts +0 -25
- package/dist/esm/shared/interface/config/entity/index.d.ts +0 -3
- package/dist/esm/shared/interface/config/entity/section-options.interface.d.ts +0 -17
- package/dist/esm/shared/interface/config/index.d.ts +0 -8
- package/dist/esm/shared/interface/config/properties-factory.interface.d.ts +0 -11
- package/dist/esm/shared/interface/index.d.ts +0 -2
- package/dist/esm/shared/interface/utility/create-dynamic-entity/index.d.ts +0 -2
- package/dist/esm/shared/interface/utility/create-dynamic-entity/relation-options.interface.d.ts +0 -9
- package/dist/esm/shared/interface/utility/index.d.ts +0 -1
- package/dist/esm/shared/type/dynamic-entity.type.d.ts +0 -2
- package/dist/esm/shared/type/index.d.ts +0 -1
- package/dist/esm/shared/utility/create-dynamic/entity.utility.d.ts +0 -11
- package/dist/esm/shared/utility/create-dynamic/entity.utility.js.map +0 -1
- package/dist/esm/shared/utility/create-dynamic/index.d.ts +0 -2
- package/dist/esm/shared/utility/create-dynamic/service.utility.d.ts +0 -10
- package/dist/esm/shared/utility/create-dynamic/service.utility.js.map +0 -1
- package/dist/esm/shared/utility/crypto.utility.d.ts +0 -37
- package/dist/esm/shared/utility/crypto.utility.js.map +0 -1
- package/dist/esm/shared/utility/index.d.ts +0 -4
- package/dist/esm/shared/utility/logger.utility.d.ts +0 -21
- package/dist/esm/shared/utility/logger.utility.js.map +0 -1
- /package/dist/{cjs/modules → modules}/config/interface/delete-options.interface.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/interface/get-list-options.interface.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/interface/get-options.interface.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/interface/set-options.interface.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/migration/enum/status.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/section/interface/interface.d.ts +0 -0
- /package/dist/{cjs/modules → modules}/config/type/item.type.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/api-property.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/config/data.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/config/migration.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/config/section.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/crypto.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/constant/token.constant.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/enum/environment.enum.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/enum/instance-name.enum.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/enum/service.enum.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/interface/config/cache-options.interface.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/interface/config/encryption-options.interface.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/interface/config/entity/data-options.interface.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/interface/config/entity/section-options.interface.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/interface/utility/create-dynamic-entity/relation-options.interface.d.ts +0 -0
- /package/dist/{cjs/shared → shared}/type/dynamic-entity.type.d.ts +0 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
- [Description](#-description)
|
|
17
17
|
- [Features](#-features)
|
|
18
18
|
- [Installation](#-installation)
|
|
19
|
-
- [Migrating to
|
|
19
|
+
- [Migrating to 5.0](#migrating-to-50)
|
|
20
20
|
- [Usage](#-usage)
|
|
21
21
|
- [Migration System](#-migration-system)
|
|
22
22
|
- [API Documentation](#-api-documentation)
|
|
@@ -55,31 +55,35 @@ Whether you're managing API keys across different environments, storing feature
|
|
|
55
55
|
|
|
56
56
|
## 🛠 Installation
|
|
57
57
|
|
|
58
|
-
These docs describe the CrudConfig
|
|
58
|
+
These docs describe the CrudConfig 5 contract: Automator 5, NestJS 12, TypeORM 1, ES modules only. Use the 5.x range, which also accepts the 5.0.0 prereleases:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
# npm
|
|
62
|
-
npm install @elsikora/nestjs-crud-config@^
|
|
62
|
+
npm install @elsikora/nestjs-crud-config@^5.0.0-0
|
|
63
63
|
|
|
64
64
|
# yarn
|
|
65
|
-
yarn add @elsikora/nestjs-crud-config@^
|
|
65
|
+
yarn add @elsikora/nestjs-crud-config@^5.0.0-0
|
|
66
66
|
|
|
67
67
|
# pnpm
|
|
68
|
-
pnpm add @elsikora/nestjs-crud-config@^
|
|
68
|
+
pnpm add @elsikora/nestjs-crud-config@^5.0.0-0
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
### Prerequisites
|
|
72
72
|
|
|
73
|
-
Install the required peer dependencies:
|
|
73
|
+
Node.js `^22.13.0 || >=24.11.0`. Install the required peer dependencies:
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
npm install @elsikora/nestjs-crud-automator@^
|
|
77
|
-
npm install @nestjs/passport@^
|
|
76
|
+
npm install @elsikora/nestjs-crud-automator@^5.0.0-0 @nestjs/common@^12 @nestjs/core@^12 @nestjs/typeorm@^12 typeorm@^1
|
|
77
|
+
npm install @nestjs/passport@^12 @nestjs/platform-fastify@^12 @nestjs/swagger@^12 @nestjs/throttler class-transformer class-validator fastify lodash
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
The package ships as ES modules only. CommonJS applications keep `require("@elsikora/nestjs-crud-config")`, which Node.js loads through `require(esm)`. Importing the package loads no `.env` file: set `NCC_LOG_LEVEL` in the environment, or load `.env` in the application, for example with `ConfigModule.forRoot()`.
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
### Automator 5 compatibility
|
|
83
|
+
|
|
84
|
+
CrudConfig 5 requires `@elsikora/nestjs-crud-automator ^5.0.0-dev.5`. Automator 4 and older are not supported.
|
|
85
|
+
|
|
86
|
+
Generated routes run Automator's `ApiAuthorizationGuard`. When the section or data controllers are enabled, import Automator's global `ApiAuthorizationModule` once in the root module, as the examples below do; without it the application fails at startup with `Nest can't resolve dependencies of the ApiAuthorizationGuard`. Headless mode does not need it.
|
|
83
87
|
|
|
84
88
|
Generated route overrides continue to use Automator generation config:
|
|
85
89
|
|
|
@@ -93,21 +97,19 @@ DELETE: {
|
|
|
93
97
|
|
|
94
98
|
ConfigData `CREATE` and `UPDATE` use Automator nested request relation loading. The built-in section relation expects request bodies such as `{ "section": { "id": "section-uuid" } }`.
|
|
95
99
|
|
|
96
|
-
CrudConfig creates each generated service through `createDynamicService()` and `@ApiService({ entity })`, so its inherited same-entity CRUD methods satisfy the Automator
|
|
97
|
-
|
|
98
|
-
The tested Swagger baseline remains exact `11.4.2`. See [Migrating to 4.0](#migrating-to-40) for the compatibility change.
|
|
100
|
+
CrudConfig creates each generated service through `createDynamicService()` and `@ApiService({ entity })`, so its inherited same-entity CRUD methods satisfy the Automator generated-route capability boundary. Applications do not need a wrapper or compatibility layer.
|
|
99
101
|
|
|
100
|
-
### Migrating to
|
|
102
|
+
### Migrating to 5.0
|
|
101
103
|
|
|
102
|
-
CrudConfig
|
|
104
|
+
CrudConfig 5 moves to the latest majors and ships as ES modules only. The CrudConfig runtime contract is otherwise unchanged:
|
|
103
105
|
|
|
104
|
-
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
- the
|
|
108
|
-
-
|
|
106
|
+
- peers move to Automator 5, NestJS 12, Swagger 12, `@nestjs/typeorm` 12 and TypeORM 1; Node.js `^22.13.0 || >=24.11.0`;
|
|
107
|
+
- the build is ESM only: `dist/esm`, `dist/cjs` and the `require` export condition are gone, CommonJS applications load the package through `require(esm)`;
|
|
108
|
+
- the `@nestjs/cache-manager` dependency moves to 12, so `npm ci` no longer fails with `ERESOLVE` on NestJS 12;
|
|
109
|
+
- the package no longer imports `dotenv/config`: it never loads `.env`, and `NCC_LOG_LEVEL` comes from the application's environment;
|
|
110
|
+
- module options, `CrudConfigService`, generated routes, the database schema and transaction ownership do not change.
|
|
109
111
|
|
|
110
|
-
See the complete [
|
|
112
|
+
See the complete [5.0 migration guide](docs/guides/migrating-to-5-0/page.mdx). The [4.0](docs/guides/migrating-to-4-0/page.mdx) and [3.0](docs/guides/migrating-to-3-0/page.mdx) migration guides remain available for older upgrades.
|
|
111
113
|
|
|
112
114
|
### Database Support
|
|
113
115
|
|
|
@@ -115,7 +117,7 @@ This package works with any database supported by TypeORM:
|
|
|
115
117
|
|
|
116
118
|
- PostgreSQL
|
|
117
119
|
- MySQL/MariaDB
|
|
118
|
-
- SQLite
|
|
120
|
+
- SQLite (through the `better-sqlite3` driver; TypeORM 1 removes `sqlite`)
|
|
119
121
|
- Microsoft SQL Server
|
|
120
122
|
- Oracle
|
|
121
123
|
- MongoDB
|
|
@@ -129,10 +131,13 @@ This package works with any database supported by TypeORM:
|
|
|
129
131
|
// app.module.ts
|
|
130
132
|
import { Module } from "@nestjs/common";
|
|
131
133
|
import { TypeOrmModule } from "@nestjs/typeorm";
|
|
134
|
+
import { ApiAuthorizationModule } from "@elsikora/nestjs-crud-automator";
|
|
132
135
|
import { CrudConfigModule, TOKEN_CONSTANT } from "@elsikora/nestjs-crud-config";
|
|
133
136
|
|
|
134
137
|
@Module({
|
|
135
138
|
imports: [
|
|
139
|
+
// Automator's generated routes run ApiAuthorizationGuard; import this global module once in the root module
|
|
140
|
+
ApiAuthorizationModule,
|
|
136
141
|
// First register CrudConfigModule to create dynamic entities
|
|
137
142
|
CrudConfigModule.register({
|
|
138
143
|
environment: "development",
|
|
@@ -170,7 +175,7 @@ import { CrudConfigModule, TOKEN_CONSTANT } from "@elsikora/nestjs-crud-config";
|
|
|
170
175
|
// Entity customization
|
|
171
176
|
entityOptions: {
|
|
172
177
|
tablePrefix: "app_",
|
|
173
|
-
timestampColumnType: "timestamptz", // PostgreSQL; defaults to
|
|
178
|
+
timestampColumnType: "timestamptz", // PostgreSQL; defaults to Date, the timestamp type of the driver
|
|
174
179
|
configSection: {
|
|
175
180
|
tableName: "config_sections",
|
|
176
181
|
maxNameLength: 128,
|
|
@@ -279,10 +284,12 @@ When using `registerAsync()`, static options like controllers and entity configu
|
|
|
279
284
|
// app.module.ts
|
|
280
285
|
import { Module } from "@nestjs/common";
|
|
281
286
|
import { ConfigModule, ConfigService } from "@nestjs/config";
|
|
287
|
+
import { ApiAuthorizationModule } from "@elsikora/nestjs-crud-automator";
|
|
282
288
|
import { CrudConfigModule } from "@elsikora/nestjs-crud-config";
|
|
283
289
|
|
|
284
290
|
@Module({
|
|
285
291
|
imports: [
|
|
292
|
+
ApiAuthorizationModule,
|
|
286
293
|
ConfigModule.forRoot(),
|
|
287
294
|
CrudConfigModule.registerAsync({
|
|
288
295
|
imports: [ConfigModule],
|
|
@@ -772,7 +779,7 @@ CrudConfigModule.register({
|
|
|
772
779
|
});
|
|
773
780
|
```
|
|
774
781
|
|
|
775
|
-
Automator
|
|
782
|
+
Automator route options use `generation.isEnabled` for route generation. Relation loading uses TypeORM `relationLoadStrategy` values (`"query"` or `"join"`); the built-in ConfigData section relation uses `"query"`.
|
|
776
783
|
|
|
777
784
|
## 🗄️ Database Schema
|
|
778
785
|
|
|
@@ -932,7 +939,7 @@ The module supports any database that TypeORM supports, including:
|
|
|
932
939
|
|
|
933
940
|
- **PostgreSQL** - Recommended for production
|
|
934
941
|
- **MySQL/MariaDB** - Popular choice for web applications
|
|
935
|
-
- **SQLite** - Perfect for development and testing
|
|
942
|
+
- **SQLite** - Perfect for development and testing (TypeORM 1 driver `better-sqlite3`)
|
|
936
943
|
- **Microsoft SQL Server** - Enterprise database support
|
|
937
944
|
- **Oracle** - Enterprise-grade database
|
|
938
945
|
- **MongoDB** - NoSQL document database
|
|
@@ -1017,7 +1024,7 @@ CrudConfigModule.register({
|
|
|
1017
1024
|
});
|
|
1018
1025
|
```
|
|
1019
1026
|
|
|
1020
|
-
`timestampColumnType` applies to all nine temporal columns in the section, data, and migration entities. It defaults to `
|
|
1027
|
+
`timestampColumnType` applies to all nine temporal columns in the section, data, and migration entities. It defaults to `Date`, which TypeORM maps to the timestamp type of each driver: `timestamp` on PostgreSQL and `datetime` on MySQL, MariaDB, SQLite (`better-sqlite3`) and SQL.js, so the default entities work on every one of them. Set a driver-specific type, such as `"timestamptz"` for PostgreSQL, only when the application needs it. Changing it for an existing database still requires the corresponding schema migration.
|
|
1021
1028
|
|
|
1022
1029
|
### What happens if the database is unavailable?
|
|
1023
1030
|
|
|
@@ -9,6 +9,7 @@ export { ConfigMigrationService } from './modules/config/migration/migration.ser
|
|
|
9
9
|
export { createConfigSectionEntity } from './modules/config/section/entity/entity.js';
|
|
10
10
|
export { API_PROPERTY_CONSTANT } from './shared/constant/api-property.constant.js';
|
|
11
11
|
export { CONFIG_DATA_CONSTANT } from './shared/constant/config/data.constant.js';
|
|
12
|
+
export { CONFIG_ENTITY_CONSTANT } from './shared/constant/config/entity.constant.js';
|
|
12
13
|
export { CONFIG_MIGRATION_CONSTANT } from './shared/constant/config/migration.constant.js';
|
|
13
14
|
export { CONFIG_SECTION_CONSTANT } from './shared/constant/config/section.constant.js';
|
|
14
15
|
export { CRYPTO_CONSTANT } from './shared/constant/crypto.constant.js';
|
|
@@ -20,4 +21,3 @@ export { createDynamicEntityClass, createDynamicEntityClass as createDynamicEnti
|
|
|
20
21
|
export { createDynamicService } from './shared/utility/create-dynamic/service.utility.js';
|
|
21
22
|
export { CryptoUtility } from './shared/utility/crypto.utility.js';
|
|
22
23
|
export { LoggerUtility } from './shared/utility/logger.utility.js';
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfigOptions, ICrudConfigAsyncModuleProperties } from '../../shared/interface/config';
|
|
1
|
+
import { IConfigOptions, ICrudConfigAsyncModuleProperties } from '../../shared/interface/config/index.js';
|
|
2
2
|
import { DynamicModule } from '@nestjs/common';
|
|
3
3
|
export declare class CrudConfigModule {
|
|
4
4
|
static register(options: IConfigOptions): DynamicModule;
|
|
@@ -11,6 +11,7 @@ import { CacheModule } from '@nestjs/cache-manager';
|
|
|
11
11
|
import { Global, Module } from '@nestjs/common';
|
|
12
12
|
import { getRepositoryToken, getDataSourceToken } from '@nestjs/typeorm';
|
|
13
13
|
import { CONFIG_DATA_CONSTANT } from '../../shared/constant/config/data.constant.js';
|
|
14
|
+
import { CONFIG_ENTITY_CONSTANT } from '../../shared/constant/config/entity.constant.js';
|
|
14
15
|
import { CONFIG_MIGRATION_CONSTANT } from '../../shared/constant/config/migration.constant.js';
|
|
15
16
|
import { CONFIG_SECTION_CONSTANT } from '../../shared/constant/config/section.constant.js';
|
|
16
17
|
import { TOKEN_CONSTANT } from '../../shared/constant/token.constant.js';
|
|
@@ -24,7 +25,8 @@ var CrudConfigModule_1;
|
|
|
24
25
|
let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
25
26
|
static register(options) {
|
|
26
27
|
const prefix = options.entityOptions?.tablePrefix ?? "";
|
|
27
|
-
const timestampColumnType = options.entityOptions?.timestampColumnType ??
|
|
28
|
+
const timestampColumnType = options.entityOptions?.timestampColumnType ??
|
|
29
|
+
CONFIG_ENTITY_CONSTANT.DEFAULT_TIMESTAMP_COLUMN_TYPE;
|
|
28
30
|
const sectionEntity = createConfigSectionEntity({
|
|
29
31
|
maxDescriptionLength: options.entityOptions?.configSection?.maxDescriptionLength ??
|
|
30
32
|
CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
@@ -183,7 +185,7 @@ let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
183
185
|
static registerAsync(properties) {
|
|
184
186
|
const staticEntityOptions = properties.staticOptions?.entityOptions;
|
|
185
187
|
const prefix = staticEntityOptions?.tablePrefix ?? "";
|
|
186
|
-
const timestampColumnType = staticEntityOptions?.timestampColumnType ??
|
|
188
|
+
const timestampColumnType = staticEntityOptions?.timestampColumnType ?? CONFIG_ENTITY_CONSTANT.DEFAULT_TIMESTAMP_COLUMN_TYPE;
|
|
187
189
|
const sectionEntity = createConfigSectionEntity({
|
|
188
190
|
maxDescriptionLength: staticEntityOptions?.configSection?.maxDescriptionLength ??
|
|
189
191
|
CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
@@ -318,4 +320,3 @@ CrudConfigModule = CrudConfigModule_1 = __decorate([
|
|
|
318
320
|
], CrudConfigModule);
|
|
319
321
|
|
|
320
322
|
export { CrudConfigModule };
|
|
321
|
-
//# sourceMappingURL=config.module.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IConfigData } from './data';
|
|
2
|
-
import { IConfigSection } from './section';
|
|
3
|
-
import { IConfigOptions } from '../../shared/interface/config';
|
|
1
|
+
import { IConfigData } from './data/index.js';
|
|
2
|
+
import { IConfigSection } from './section/index.js';
|
|
3
|
+
import { IConfigOptions } from '../../shared/interface/config/index.js';
|
|
4
4
|
import { Cache } from 'cache-manager';
|
|
5
5
|
import { ApiServiceBase } from '@elsikora/nestjs-crud-automator';
|
|
6
|
-
import { CryptoUtility } from '../../shared/utility';
|
|
6
|
+
import { CryptoUtility } from '../../shared/utility/index.js';
|
|
7
7
|
import { DataSource } from 'typeorm';
|
|
8
|
-
import { IConfigDeleteOptions, IConfigGetListOptions, IConfigGetOptions, IConfigSetOptions } from './interface';
|
|
8
|
+
import { IConfigDeleteOptions, IConfigGetListOptions, IConfigGetOptions, IConfigSetOptions } from './interface/index.js';
|
|
9
9
|
/**
|
|
10
10
|
* Service for managing configuration data with caching support
|
|
11
11
|
* Provides methods to retrieve configuration values with optional decryption
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IConfigData } from '.';
|
|
2
|
-
import { Type } from '@nestjs/common
|
|
3
|
-
import { IConfigControllerOptions } from '../../../shared/interface/config';
|
|
4
|
-
import { TDynamicEntity } from '../../../shared/type';
|
|
1
|
+
import { IConfigData } from './index.js';
|
|
2
|
+
import { Type } from '@nestjs/common';
|
|
3
|
+
import { IConfigControllerOptions } from '../../../shared/interface/config/index.js';
|
|
4
|
+
import { TDynamicEntity } from '../../../shared/type/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Factory to create dynamic ConfigData controller with the correct entity
|
|
7
7
|
* @param {TDynamicEntity} entity The entity type to create controller for
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IConfigSection } from '../../section';
|
|
2
|
-
import { TDynamicEntity } from '../../../../shared/type';
|
|
1
|
+
import { IConfigSection } from '../../section/index.js';
|
|
2
|
+
import { TDynamicEntity } from '../../../../shared/type/index.js';
|
|
3
3
|
import { ColumnType } from 'typeorm';
|
|
4
|
-
import { IConfigData } from '../interface';
|
|
4
|
+
import { IConfigData } from '../interface/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Creates a dynamic ConfigData entity with TypeORM decorators
|
|
7
7
|
* @param {object} options - Configuration options for the entity
|
|
@@ -11,7 +11,7 @@ import { IConfigData } from '../interface';
|
|
|
11
11
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
12
12
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
13
13
|
* @param {string} options.tableName - Name of the database table
|
|
14
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
14
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
15
15
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
16
16
|
*/
|
|
17
17
|
export declare function createConfigDataEntity(options: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiPropertyDescribe, EApiPropertyDescribeType, EApiPropertyStringType, EApiPropertyDateIdentifier, EApiPropertyDateType } from '@elsikora/nestjs-crud-automator';
|
|
2
2
|
import { API_PROPERTY_CONSTANT } from '../../../../shared/constant/api-property.constant.js';
|
|
3
|
+
import { CONFIG_ENTITY_CONSTANT } from '../../../../shared/constant/config/entity.constant.js';
|
|
3
4
|
import { createDynamicEntityClass } from '../../../../shared/utility/create-dynamic/entity.utility.js';
|
|
4
5
|
import '../../../../external/tslib/tslib.es6.js';
|
|
5
6
|
import '@nestjs/common';
|
|
@@ -17,11 +18,11 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
17
18
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
18
19
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
19
20
|
* @param {string} options.tableName - Name of the database table
|
|
20
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
21
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
21
22
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
22
23
|
*/
|
|
23
24
|
function createConfigDataEntity(options) {
|
|
24
|
-
const timestampColumnType = options.timestampColumnType ??
|
|
25
|
+
const timestampColumnType = options.timestampColumnType ?? CONFIG_ENTITY_CONSTANT.DEFAULT_TIMESTAMP_COLUMN_TYPE;
|
|
25
26
|
return createDynamicEntityClass({
|
|
26
27
|
columns: {
|
|
27
28
|
createdAt: {
|
|
@@ -156,4 +157,3 @@ function createConfigDataEntity(options) {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
export { createConfigDataEntity };
|
|
159
|
-
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createConfigDataEntity } from './entity.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IConfigData } from './interface.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IApiBaseEntity } from '@elsikora/nestjs-crud-automator';
|
|
2
|
-
import { IConfigSection } from '../../section';
|
|
2
|
+
import { IConfigSection } from '../../section/index.js';
|
|
3
3
|
export interface IConfigData extends IApiBaseEntity {
|
|
4
4
|
createdAt: Date;
|
|
5
5
|
description: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRUD Configuration Module for NestJS.
|
|
3
|
+
* Exports the module, service, and related interfaces.
|
|
4
|
+
*/
|
|
5
|
+
export { CrudConfigModule } from './config.module.js';
|
|
6
|
+
export { CrudConfigService } from './config.service.js';
|
|
7
|
+
export * from './data/index.js';
|
|
8
|
+
export type * from './interface/index.js';
|
|
9
|
+
export * from './migration/index.js';
|
|
10
|
+
export * from './section/index.js';
|
|
11
|
+
export type * from './type/index.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type IConfigDeleteOptions } from './delete-options.interface.js';
|
|
2
|
+
export { type IConfigGetListOptions } from './get-list-options.interface.js';
|
|
3
|
+
export { type IConfigGetOptions } from './get-options.interface.js';
|
|
4
|
+
export { type IConfigSetOptions } from './set-options.interface.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { TDynamicEntity } from '../../../../shared/type';
|
|
1
|
+
import { TDynamicEntity } from '../../../../shared/type/index.js';
|
|
2
2
|
import { ColumnType } from 'typeorm';
|
|
3
|
-
import { IConfigMigration } from '../interface';
|
|
3
|
+
import { IConfigMigration } from '../interface/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a dynamic ConfigMigration entity with TypeORM decorators
|
|
6
6
|
* @param {object} options - Configuration options for the entity
|
|
7
7
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
8
8
|
* @param {string} options.tableName - Name of the database table
|
|
9
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
9
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
10
10
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
11
11
|
*/
|
|
12
12
|
export declare function createConfigMigrationEntity(options: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiPropertyDescribe, EApiPropertyDescribeType, EApiPropertyDateIdentifier, EApiPropertyDateType, EApiPropertyStringType } from '@elsikora/nestjs-crud-automator';
|
|
2
2
|
import { API_PROPERTY_CONSTANT } from '../../../../shared/constant/api-property.constant.js';
|
|
3
|
+
import { CONFIG_ENTITY_CONSTANT } from '../../../../shared/constant/config/entity.constant.js';
|
|
3
4
|
import { CONFIG_MIGRATION_CONSTANT } from '../../../../shared/constant/config/migration.constant.js';
|
|
4
5
|
import { createDynamicEntityClass } from '../../../../shared/utility/create-dynamic/entity.utility.js';
|
|
5
6
|
import '../../../../external/tslib/tslib.es6.js';
|
|
@@ -14,11 +15,11 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
14
15
|
* @param {object} options - Configuration options for the entity
|
|
15
16
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
16
17
|
* @param {string} options.tableName - Name of the database table
|
|
17
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
18
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
18
19
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
19
20
|
*/
|
|
20
21
|
function createConfigMigrationEntity(options) {
|
|
21
|
-
const timestampColumnType = options.timestampColumnType ??
|
|
22
|
+
const timestampColumnType = options.timestampColumnType ?? CONFIG_ENTITY_CONSTANT.DEFAULT_TIMESTAMP_COLUMN_TYPE;
|
|
22
23
|
return createDynamicEntityClass({
|
|
23
24
|
columns: {
|
|
24
25
|
createdAt: {
|
|
@@ -47,7 +48,7 @@ function createConfigMigrationEntity(options) {
|
|
|
47
48
|
default: "PENDING",
|
|
48
49
|
enum: ["PENDING", "RUNNING", "COMPLETED", "FAILED", "STUCK"],
|
|
49
50
|
nullable: false,
|
|
50
|
-
type: "enum",
|
|
51
|
+
type: "simple-enum",
|
|
51
52
|
},
|
|
52
53
|
updatedAt: {
|
|
53
54
|
default: () => "CURRENT_TIMESTAMP",
|
|
@@ -136,4 +137,3 @@ function createConfigMigrationEntity(options) {
|
|
|
136
137
|
}
|
|
137
138
|
|
|
138
139
|
export { createConfigMigrationEntity };
|
|
139
|
-
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createConfigMigrationEntity } from './entity.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EConfigMigrationStatus } from './status.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { IConfigMigration } from './interface';
|
|
2
|
-
export type { IConfigMigrationDefinition } from './migration-definition.interface';
|
|
3
|
-
export type { IConfigMigrationOptions } from './migration-options.interface';
|
|
1
|
+
export type { IConfigMigration } from './interface.js';
|
|
2
|
+
export type { IConfigMigrationDefinition } from './migration-definition.interface.js';
|
|
3
|
+
export type { IConfigMigrationOptions } from './migration-options.interface.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IApiBaseEntity } from '@elsikora/nestjs-crud-automator';
|
|
2
|
-
import { EConfigMigrationStatus } from '../enum';
|
|
2
|
+
import { EConfigMigrationStatus } from '../enum/index.js';
|
|
3
3
|
export interface IConfigMigration extends IApiBaseEntity {
|
|
4
4
|
createdAt: Date;
|
|
5
5
|
executedAt?: Date;
|
package/dist/{esm/modules → modules}/config/migration/interface/migration-options.interface.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfigMigrationDefinition } from './migration-definition.interface';
|
|
1
|
+
import { IConfigMigrationDefinition } from './migration-definition.interface.js';
|
|
2
2
|
/**
|
|
3
3
|
* Interface for migration configuration options
|
|
4
4
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/migration-system | Migration System}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IConfigOptions } from '../../../shared/interface/config';
|
|
1
|
+
import { IConfigOptions } from '../../../shared/interface/config/index.js';
|
|
2
2
|
import { EntityManager } from 'typeorm';
|
|
3
3
|
import { OnApplicationBootstrap } from '@nestjs/common';
|
|
4
|
-
import { ConfigMigrationService } from './migration.service';
|
|
4
|
+
import { ConfigMigrationService } from './migration.service.js';
|
|
5
5
|
/**
|
|
6
6
|
* Service that runs migrations on application startup
|
|
7
7
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/migration-system | Migration System}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiServiceBase } from '@elsikora/nestjs-crud-automator';
|
|
2
|
-
import { IConfigOptions } from '../../../shared/interface/config';
|
|
3
|
-
import { IConfigMigration, IConfigMigrationDefinition } from './interface';
|
|
4
|
-
import { CrudConfigService } from '../config.service';
|
|
2
|
+
import { IConfigOptions } from '../../../shared/interface/config/index.js';
|
|
3
|
+
import { IConfigMigration, IConfigMigrationDefinition } from './interface/index.js';
|
|
4
|
+
import { CrudConfigService } from '../config.service.js';
|
|
5
5
|
import { OnModuleInit } from '@nestjs/common';
|
|
6
6
|
import { DataSource, EntityManager } from 'typeorm';
|
|
7
7
|
/**
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { __decorate, __param, __metadata } from '../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { ApiFunctionTransactionScope } from '@elsikora/nestjs-crud-automator';
|
|
3
3
|
import { CrudConfigService } from '../config.service.js';
|
|
4
|
-
import { Injectable, Inject
|
|
4
|
+
import { Injectable, Inject } from '@nestjs/common';
|
|
5
5
|
import { CONFIG_MIGRATION_CONSTANT } from '../../../shared/constant/config/migration.constant.js';
|
|
6
6
|
import { TOKEN_CONSTANT } from '../../../shared/constant/token.constant.js';
|
|
7
7
|
import { DataSource } from 'typeorm';
|
|
8
|
+
import '@nestjs/typeorm';
|
|
9
|
+
import '../../../shared/utility/crypto.utility.js';
|
|
10
|
+
import { LoggerUtility } from '../../../shared/utility/logger.utility.js';
|
|
8
11
|
import { EConfigMigrationStatus } from './enum/status.js';
|
|
9
12
|
|
|
10
|
-
var ConfigMigrationService_1;
|
|
11
13
|
/**
|
|
12
14
|
* Service responsible for coordinating and tracking execution of migrations.
|
|
13
15
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/migration-system | Migration System}
|
|
14
16
|
* @see {@link https://elsikora.com/docs/nestjs-crud-config/api-reference/classes/config-migration-service | API Reference - ConfigMigrationService}
|
|
15
17
|
*/
|
|
16
|
-
let ConfigMigrationService =
|
|
18
|
+
let ConfigMigrationService = class ConfigMigrationService {
|
|
17
19
|
dataSource;
|
|
18
20
|
options;
|
|
19
21
|
configService;
|
|
20
|
-
LOGGER =
|
|
22
|
+
LOGGER = LoggerUtility.getLogger("ConfigMigrationService");
|
|
21
23
|
MIGRATION_SERVICE;
|
|
22
24
|
constructor(dataSource, options, configService, migrationService) {
|
|
23
25
|
this.dataSource = dataSource;
|
|
@@ -325,11 +327,8 @@ let ConfigMigrationService = ConfigMigrationService_1 = class ConfigMigrationSer
|
|
|
325
327
|
}
|
|
326
328
|
async runWithOwnerManager(ownerManager, callback) {
|
|
327
329
|
const queryRunner = ownerManager.queryRunner;
|
|
328
|
-
if (
|
|
329
|
-
|
|
330
|
-
ownerManager.connection !== this.dataSource ||
|
|
331
|
-
// eslint-disable-next-line @elsikora/sonar/deprecation -- The supported TypeORM 0.3 QueryRunner exposes DataSource identity as connection.
|
|
332
|
-
queryRunner?.connection !== this.dataSource ||
|
|
330
|
+
if (ownerManager.dataSource !== this.dataSource ||
|
|
331
|
+
queryRunner?.dataSource !== this.dataSource ||
|
|
333
332
|
queryRunner.manager !== ownerManager ||
|
|
334
333
|
!queryRunner.isTransactionActive ||
|
|
335
334
|
queryRunner.isReleased) {
|
|
@@ -365,7 +364,7 @@ let ConfigMigrationService = ConfigMigrationService_1 = class ConfigMigrationSer
|
|
|
365
364
|
}
|
|
366
365
|
}
|
|
367
366
|
};
|
|
368
|
-
ConfigMigrationService =
|
|
367
|
+
ConfigMigrationService = __decorate([
|
|
369
368
|
Injectable(),
|
|
370
369
|
__param(0, Inject(DataSource)),
|
|
371
370
|
__param(1, Inject(TOKEN_CONSTANT.CONFIG_OPTIONS)),
|
|
@@ -374,4 +373,3 @@ ConfigMigrationService = ConfigMigrationService_1 = __decorate([
|
|
|
374
373
|
], ConfigMigrationService);
|
|
375
374
|
|
|
376
375
|
export { ConfigMigrationService };
|
|
377
|
-
//# sourceMappingURL=migration.service.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IConfigSection } from '.';
|
|
2
|
-
import { Type } from '@nestjs/common
|
|
3
|
-
import { IConfigControllerOptions } from '../../../shared/interface/config';
|
|
4
|
-
import { TDynamicEntity } from '../../../shared/type';
|
|
1
|
+
import { IConfigSection } from './index.js';
|
|
2
|
+
import { Type } from '@nestjs/common';
|
|
3
|
+
import { IConfigControllerOptions } from '../../../shared/interface/config/index.js';
|
|
4
|
+
import { TDynamicEntity } from '../../../shared/type/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Factory to create dynamic ConfigSection controller with the correct entity
|
|
7
7
|
* @param {TDynamicEntity} entity The entity type to create controller for
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { TDynamicEntity } from '../../../../shared/type';
|
|
1
|
+
import { TDynamicEntity } from '../../../../shared/type/index.js';
|
|
2
2
|
import { ColumnType } from 'typeorm';
|
|
3
|
-
import { IConfigSection } from '../interface';
|
|
3
|
+
import { IConfigSection } from '../interface/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a dynamic ConfigSection entity with TypeORM decorators
|
|
6
6
|
* @param {object} options - Configuration options for the entity
|
|
7
7
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
8
8
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
9
9
|
* @param {string} options.tableName - Name of the database table
|
|
10
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
10
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
11
11
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
12
12
|
*/
|
|
13
13
|
export declare function createConfigSectionEntity(options: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiPropertyDescribe, EApiPropertyDescribeType, EApiPropertyDateIdentifier, EApiPropertyDateType, EApiPropertyStringType } from '@elsikora/nestjs-crud-automator';
|
|
2
2
|
import { API_PROPERTY_CONSTANT } from '../../../../shared/constant/api-property.constant.js';
|
|
3
|
+
import { CONFIG_ENTITY_CONSTANT } from '../../../../shared/constant/config/entity.constant.js';
|
|
3
4
|
import { createDynamicEntityClass } from '../../../../shared/utility/create-dynamic/entity.utility.js';
|
|
4
5
|
import '../../../../external/tslib/tslib.es6.js';
|
|
5
6
|
import '@nestjs/common';
|
|
@@ -14,11 +15,11 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
14
15
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
15
16
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
16
17
|
* @param {string} options.tableName - Name of the database table
|
|
17
|
-
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp
|
|
18
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `Date`, the timestamp type of the driver
|
|
18
19
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
19
20
|
*/
|
|
20
21
|
function createConfigSectionEntity(options) {
|
|
21
|
-
const timestampColumnType = options.timestampColumnType ??
|
|
22
|
+
const timestampColumnType = options.timestampColumnType ?? CONFIG_ENTITY_CONSTANT.DEFAULT_TIMESTAMP_COLUMN_TYPE;
|
|
22
23
|
return createDynamicEntityClass({
|
|
23
24
|
columns: {
|
|
24
25
|
createdAt: {
|
|
@@ -94,4 +95,3 @@ function createConfigSectionEntity(options) {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
export { createConfigSectionEntity };
|
|
97
|
-
//# sourceMappingURL=entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createConfigSectionEntity } from './entity.js';
|