@elsikora/nestjs-crud-config 3.0.0 → 3.1.0-dev.1
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 +6 -1
- package/dist/cjs/modules/config/config.module.js +8 -0
- package/dist/cjs/modules/config/config.module.js.map +1 -1
- package/dist/cjs/modules/config/data/entity/entity.d.ts +3 -0
- package/dist/cjs/modules/config/data/entity/entity.js +6 -4
- package/dist/cjs/modules/config/data/entity/entity.js.map +1 -1
- package/dist/cjs/modules/config/migration/entity/entity.d.ts +3 -0
- package/dist/cjs/modules/config/migration/entity/entity.js +9 -7
- package/dist/cjs/modules/config/migration/entity/entity.js.map +1 -1
- package/dist/cjs/modules/config/section/entity/entity.d.ts +3 -0
- package/dist/cjs/modules/config/section/entity/entity.js +6 -4
- package/dist/cjs/modules/config/section/entity/entity.js.map +1 -1
- package/dist/cjs/shared/interface/config/entity/options.interface.d.ts +6 -0
- package/dist/esm/modules/config/config.module.js +8 -0
- package/dist/esm/modules/config/config.module.js.map +1 -1
- package/dist/esm/modules/config/data/entity/entity.d.ts +3 -0
- package/dist/esm/modules/config/data/entity/entity.js +6 -4
- package/dist/esm/modules/config/data/entity/entity.js.map +1 -1
- package/dist/esm/modules/config/migration/entity/entity.d.ts +3 -0
- package/dist/esm/modules/config/migration/entity/entity.js +9 -7
- package/dist/esm/modules/config/migration/entity/entity.js.map +1 -1
- package/dist/esm/modules/config/section/entity/entity.d.ts +3 -0
- package/dist/esm/modules/config/section/entity/entity.js +6 -4
- package/dist/esm/modules/config/section/entity/entity.js.map +1 -1
- package/dist/esm/shared/interface/config/entity/options.interface.d.ts +6 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -169,6 +169,7 @@ import { CrudConfigModule, TOKEN_CONSTANT } from "@elsikora/nestjs-crud-config";
|
|
|
169
169
|
// Entity customization
|
|
170
170
|
entityOptions: {
|
|
171
171
|
tablePrefix: "app_",
|
|
172
|
+
timestampColumnType: "timestamptz", // PostgreSQL; defaults to "timestamp"
|
|
172
173
|
configSection: {
|
|
173
174
|
tableName: "config_sections",
|
|
174
175
|
maxNameLength: 128,
|
|
@@ -316,6 +317,7 @@ import { CrudConfigModule } from "@elsikora/nestjs-crud-config";
|
|
|
316
317
|
},
|
|
317
318
|
entityOptions: {
|
|
318
319
|
tablePrefix: "app_",
|
|
320
|
+
timestampColumnType: "timestamptz", // Must be static for dynamic entities
|
|
319
321
|
configSection: {
|
|
320
322
|
tableName: "config_sections",
|
|
321
323
|
maxNameLength: 128,
|
|
@@ -338,7 +340,7 @@ export class AppModule {}
|
|
|
338
340
|
**Important:** The `staticOptions` property contains configuration that must be known at module compilation time:
|
|
339
341
|
|
|
340
342
|
- `controllersOptions` - REST API controller configuration
|
|
341
|
-
- `entityOptions` - Database entity customization (table names, field lengths)
|
|
343
|
+
- `entityOptions` - Database entity customization (table names, field lengths, timestamp type)
|
|
342
344
|
- `migrationEntityOptions` - Migration tracking table configuration
|
|
343
345
|
|
|
344
346
|
## 🚀 Migration System
|
|
@@ -990,6 +992,7 @@ The module provides extensive customization options:
|
|
|
990
992
|
CrudConfigModule.register({
|
|
991
993
|
entityOptions: {
|
|
992
994
|
tablePrefix: "myapp_",
|
|
995
|
+
timestampColumnType: "timestamptz",
|
|
993
996
|
configSection: {
|
|
994
997
|
tableName: "configuration_sections",
|
|
995
998
|
maxNameLength: 256,
|
|
@@ -1006,6 +1009,8 @@ CrudConfigModule.register({
|
|
|
1006
1009
|
});
|
|
1007
1010
|
```
|
|
1008
1011
|
|
|
1012
|
+
`timestampColumnType` applies to all nine temporal columns in the section, data, and migration entities. It defaults to `"timestamp"`; choose a TypeORM `ColumnType` supported by your database driver, such as `"timestamptz"` for PostgreSQL or `"datetime"` for SQL.js/SQLite. Changing it for an existing database still requires the corresponding schema migration.
|
|
1013
|
+
|
|
1009
1014
|
### What happens if the database is unavailable?
|
|
1010
1015
|
|
|
1011
1016
|
The module includes caching to handle temporary database outages:
|
|
@@ -26,12 +26,14 @@ var CrudConfigModule_1;
|
|
|
26
26
|
exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
27
27
|
static register(options) {
|
|
28
28
|
const prefix = options.entityOptions?.tablePrefix ?? "";
|
|
29
|
+
const timestampColumnType = options.entityOptions?.timestampColumnType ?? "timestamp";
|
|
29
30
|
const sectionEntity = entity.createConfigSectionEntity({
|
|
30
31
|
maxDescriptionLength: options.entityOptions?.configSection?.maxDescriptionLength ??
|
|
31
32
|
section_constant.CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
32
33
|
maxNameLength: options.entityOptions?.configSection?.maxNameLength ?? section_constant.CONFIG_SECTION_CONSTANT.MAX_NAME_LENGTH,
|
|
33
34
|
tableName: prefix +
|
|
34
35
|
(options.entityOptions?.configSection?.tableName ?? section_constant.CONFIG_SECTION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
36
|
+
timestampColumnType,
|
|
35
37
|
});
|
|
36
38
|
const dataEntity = entity$1.createConfigDataEntity({
|
|
37
39
|
configSectionEntity: sectionEntity,
|
|
@@ -43,10 +45,12 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
43
45
|
maxValueLength: options.entityOptions?.configData?.maxValueLength ?? data_constant.CONFIG_DATA_CONSTANT.MAX_VALUE_LENGTH,
|
|
44
46
|
tableName: prefix +
|
|
45
47
|
(options.entityOptions?.configData?.tableName ?? data_constant.CONFIG_DATA_CONSTANT.DEFAULT_TABLE_NAME),
|
|
48
|
+
timestampColumnType,
|
|
46
49
|
});
|
|
47
50
|
const migrationEntity = entity$2.createConfigMigrationEntity({
|
|
48
51
|
maxNameLength: options.migrationOptions?.maxNameLength ?? migration_constant.CONFIG_MIGRATION_CONSTANT.MAX_NAME_LENGTH,
|
|
49
52
|
tableName: prefix + (options.migrationOptions?.tableName ?? migration_constant.CONFIG_MIGRATION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
53
|
+
timestampColumnType,
|
|
50
54
|
});
|
|
51
55
|
const propertiesProvider = {
|
|
52
56
|
provide: token_constant.TOKEN_CONSTANT.CONFIG_OPTIONS,
|
|
@@ -181,12 +185,14 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
181
185
|
static registerAsync(properties) {
|
|
182
186
|
const staticEntityOptions = properties.staticOptions?.entityOptions;
|
|
183
187
|
const prefix = staticEntityOptions?.tablePrefix ?? "";
|
|
188
|
+
const timestampColumnType = staticEntityOptions?.timestampColumnType ?? "timestamp";
|
|
184
189
|
const sectionEntity = entity.createConfigSectionEntity({
|
|
185
190
|
maxDescriptionLength: staticEntityOptions?.configSection?.maxDescriptionLength ??
|
|
186
191
|
section_constant.CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
187
192
|
maxNameLength: staticEntityOptions?.configSection?.maxNameLength ?? section_constant.CONFIG_SECTION_CONSTANT.MAX_NAME_LENGTH,
|
|
188
193
|
tableName: prefix +
|
|
189
194
|
(staticEntityOptions?.configSection?.tableName ?? section_constant.CONFIG_SECTION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
195
|
+
timestampColumnType,
|
|
190
196
|
});
|
|
191
197
|
const dataEntity = entity$1.createConfigDataEntity({
|
|
192
198
|
configSectionEntity: sectionEntity,
|
|
@@ -198,6 +204,7 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
198
204
|
maxValueLength: staticEntityOptions?.configData?.maxValueLength ?? data_constant.CONFIG_DATA_CONSTANT.MAX_VALUE_LENGTH,
|
|
199
205
|
tableName: prefix +
|
|
200
206
|
(staticEntityOptions?.configData?.tableName ?? data_constant.CONFIG_DATA_CONSTANT.DEFAULT_TABLE_NAME),
|
|
207
|
+
timestampColumnType,
|
|
201
208
|
});
|
|
202
209
|
const staticControllersOptions = properties.staticOptions?.controllersOptions;
|
|
203
210
|
const DynamicConfigSectionController = staticControllersOptions?.section?.isEnabled === false
|
|
@@ -215,6 +222,7 @@ exports.CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
215
222
|
const migrationEntity = entity$2.createConfigMigrationEntity({
|
|
216
223
|
maxNameLength: staticMigrationOptions?.maxNameLength ?? migration_constant.CONFIG_MIGRATION_CONSTANT.MAX_NAME_LENGTH,
|
|
217
224
|
tableName: prefix + (staticMigrationOptions?.tableName ?? migration_constant.CONFIG_MIGRATION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
225
|
+
timestampColumnType,
|
|
218
226
|
});
|
|
219
227
|
const providers = [
|
|
220
228
|
this.createAsyncOptionsProvider(properties),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":["CrudConfigModule","createConfigSectionEntity","CONFIG_SECTION_CONSTANT","createConfigDataEntity","CONFIG_DATA_CONSTANT","createConfigMigrationEntity","CONFIG_MIGRATION_CONSTANT","TOKEN_CONSTANT","getDataSourceToken","getRepositoryToken","createDynamicService","createDynamicSectionController","createDynamicDataController","CacheModule","CrudConfigService","ConfigMigrationService","ConfigMigrationRunnerService","CryptoUtility","__decorate","Global","Module"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCaA,wBAAgB,GAAA,kBAAA,GAAtB,MAAM,gBAAgB,CAAA;IACrB,OAAO,QAAQ,CAAC,OAAuB,EAAA;QAC7C,MAAM,MAAM,GAAW,OAAO,CAAC,aAAa,EAAE,WAAW,IAAI,EAAE;QAE/D,MAAM,aAAa,GAAmCC,gCAAyB,CAAC;AAC/E,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB;AAC1D,gBAAAC,wCAAuB,CAAC,sBAAsB;YAC/C,aAAa,EACZ,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,IAAIA,wCAAuB,CAAC,eAAe;AAC/F,YAAA,SAAS,EACR,MAAM;iBACL,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,IAAIA,wCAAuB,CAAC,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":["CrudConfigModule","createConfigSectionEntity","CONFIG_SECTION_CONSTANT","createConfigDataEntity","CONFIG_DATA_CONSTANT","createConfigMigrationEntity","CONFIG_MIGRATION_CONSTANT","TOKEN_CONSTANT","getDataSourceToken","getRepositoryToken","createDynamicService","createDynamicSectionController","createDynamicDataController","CacheModule","CrudConfigService","ConfigMigrationService","ConfigMigrationRunnerService","CryptoUtility","__decorate","Global","Module"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCaA,wBAAgB,GAAA,kBAAA,GAAtB,MAAM,gBAAgB,CAAA;IACrB,OAAO,QAAQ,CAAC,OAAuB,EAAA;QAC7C,MAAM,MAAM,GAAW,OAAO,CAAC,aAAa,EAAE,WAAW,IAAI,EAAE;QAE/D,MAAM,mBAAmB,GACxB,OAAO,CAAC,aAAa,EAAE,mBAAmB,IAAI,WAAW;QAE1D,MAAM,aAAa,GAAmCC,gCAAyB,CAAC;AAC/E,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB;AAC1D,gBAAAC,wCAAuB,CAAC,sBAAsB;YAC/C,aAAa,EACZ,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,IAAIA,wCAAuB,CAAC,eAAe;AAC/F,YAAA,SAAS,EACR,MAAM;iBACL,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,IAAIA,wCAAuB,CAAC,kBAAkB,CAAC;YAChG,mBAAmB;AACnB,SAAA,CAAC;QAEF,MAAM,UAAU,GAAgCC,+BAAsB,CAAC;AACtE,YAAA,mBAAmB,EAAE,aAAa;AAClC,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,UAAU,EAAE,oBAAoB;AACvD,gBAAAC,kCAAoB,CAAC,sBAAsB;AAC5C,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A,UAAU,EAAE,OAAO,cAAwC,KAA6B;AACvF,gBAAA,OAAO,cAAc,CAAC,aAAa,EAAE;YACtC,CAAC;SACD;IACF;;AApYYP,wBAAgB,GAAA,kBAAA,GAAAkB,oBAAA,CAAA;AAF5B,IAAAC,aAAM,EAAE;IACRC,aAAM,CAAC,EAAE;AACG,CAAA,EAAApB,wBAAgB,CAqY5B;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IConfigSection } from '../../section';
|
|
2
2
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
3
|
+
import { ColumnType } from 'typeorm';
|
|
3
4
|
import { IConfigData } from '../interface';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a dynamic ConfigData entity with TypeORM decorators
|
|
@@ -10,6 +11,7 @@ import { IConfigData } from '../interface';
|
|
|
10
11
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
11
12
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
12
13
|
* @param {string} options.tableName - Name of the database table
|
|
14
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
13
15
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
14
16
|
*/
|
|
15
17
|
export declare function createConfigDataEntity(options: {
|
|
@@ -19,4 +21,5 @@ export declare function createConfigDataEntity(options: {
|
|
|
19
21
|
maxNameLength: number;
|
|
20
22
|
maxValueLength: number;
|
|
21
23
|
tableName: string;
|
|
24
|
+
timestampColumnType?: ColumnType;
|
|
22
25
|
}): TDynamicEntity<IConfigData>;
|
|
@@ -19,15 +19,17 @@ require('../../../../shared/utility/logger.utility.js');
|
|
|
19
19
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
20
20
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
21
21
|
* @param {string} options.tableName - Name of the database table
|
|
22
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
22
23
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
23
24
|
*/
|
|
24
25
|
function createConfigDataEntity(options) {
|
|
26
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
25
27
|
return entity_utility.createDynamicEntityClass({
|
|
26
28
|
columns: {
|
|
27
29
|
createdAt: {
|
|
28
30
|
default: () => "CURRENT_TIMESTAMP",
|
|
29
31
|
nullable: false,
|
|
30
|
-
type:
|
|
32
|
+
type: timestampColumnType,
|
|
31
33
|
},
|
|
32
34
|
description: {
|
|
33
35
|
length: options.maxDescriptionLength,
|
|
@@ -52,7 +54,7 @@ function createConfigDataEntity(options) {
|
|
|
52
54
|
updatedAt: {
|
|
53
55
|
default: () => "CURRENT_TIMESTAMP",
|
|
54
56
|
nullable: false,
|
|
55
|
-
type:
|
|
57
|
+
type: timestampColumnType,
|
|
56
58
|
},
|
|
57
59
|
value: {
|
|
58
60
|
length: options.maxValueLength,
|
|
@@ -62,7 +64,7 @@ function createConfigDataEntity(options) {
|
|
|
62
64
|
},
|
|
63
65
|
decorators: {
|
|
64
66
|
createdAt: [
|
|
65
|
-
typeorm.CreateDateColumn(),
|
|
67
|
+
typeorm.CreateDateColumn({ type: timestampColumnType }),
|
|
66
68
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
67
69
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
68
70
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -121,7 +123,7 @@ function createConfigDataEntity(options) {
|
|
|
121
123
|
}),
|
|
122
124
|
],
|
|
123
125
|
updatedAt: [
|
|
124
|
-
typeorm.UpdateDateColumn(),
|
|
126
|
+
typeorm.UpdateDateColumn({ type: timestampColumnType }),
|
|
125
127
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
126
128
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
127
129
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/data/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/data/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;AAkBA;;;;;;;;;;;AAWG;AACG,SAAU,sBAAsB,CAAC,OAQtC,EAAA;AACA,IAAA,MAAM,mBAAmB,GAAe,OAAO,CAAC,mBAAmB,IAAI,WAAW;AAElF,IAAA,OAAOA,uCAAwB,CAAC;AAC/B,QAAA,OAAO,EAAE;AACR,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,WAAW,EAAE;gBACZ,MAAM,EAAE,OAAO,CAAC,oBAAoB;AACpC,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,WAAW,EAAE;gBACZ,MAAM,EAAE,OAAO,CAAC,oBAAoB;AACpC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,WAAW,EAAE;AACZ,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,IAAI,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AEC,8CAA0B,CAAC,UAAU;oBACjD,IAAI,EAAEC,4CAAwB,CAAC,IAAI;iBACnC,CAAC;AACF,aAAA;AACD,YAAA,KAAK,EAAE;AACN,gBAAAH,uCAAmB,CAAC;AACnB,oBAAA,WAAW,EAAE,OAAO;AACpB,oBAAA,YAAY,EAAE,qBAAqB;oBACnC,MAAM,EAAEI,0CAAsB,CAAC,MAAM;oBACrC,SAAS,EAAE,OAAO,CAAC,cAAc;oBACjC,SAAS,EAAEC,0CAAqB,CAAC,iBAAiB;AAClD,oBAAA,OAAO,EAAE,CAAA,KAAA,EAAQ,OAAO,CAAC,cAAc,CAAA,EAAA,CAAI;oBAC3C,IAAI,EAAEF,4CAAwB,CAAC,MAAM;iBACrC,CAAC;AACF,aAAA;AACD,SAAA;AACD,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,SAAS,EAAE;AACV,YAAA,OAAO,EAAE;AACR,gBAAA,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,mBAAmB,EAAE;AAClD,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,QAAQ,EAAE,SAAS;AACnB,gBAAA,IAAI,EAAE,WAAW;AACjB,aAAA;AACD,SAAA;QACD,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AAC7C,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
2
|
+
import { ColumnType } from 'typeorm';
|
|
2
3
|
import { IConfigMigration } from '../interface';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a dynamic ConfigMigration entity with TypeORM decorators
|
|
5
6
|
* @param {object} options - Configuration options for the entity
|
|
6
7
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
7
8
|
* @param {string} options.tableName - Name of the database table
|
|
9
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
8
10
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
9
11
|
*/
|
|
10
12
|
export declare function createConfigMigrationEntity(options: {
|
|
11
13
|
maxNameLength: number;
|
|
12
14
|
tableName: string;
|
|
15
|
+
timestampColumnType?: ColumnType;
|
|
13
16
|
}): TDynamicEntity<IConfigMigration>;
|
|
@@ -16,23 +16,25 @@ require('../../../../shared/utility/logger.utility.js');
|
|
|
16
16
|
* @param {object} options - Configuration options for the entity
|
|
17
17
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
18
18
|
* @param {string} options.tableName - Name of the database table
|
|
19
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
19
20
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
20
21
|
*/
|
|
21
22
|
function createConfigMigrationEntity(options) {
|
|
23
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
22
24
|
return entity_utility.createDynamicEntityClass({
|
|
23
25
|
columns: {
|
|
24
26
|
createdAt: {
|
|
25
27
|
default: () => "CURRENT_TIMESTAMP",
|
|
26
28
|
nullable: false,
|
|
27
|
-
type:
|
|
29
|
+
type: timestampColumnType,
|
|
28
30
|
},
|
|
29
31
|
executedAt: {
|
|
30
32
|
nullable: true,
|
|
31
|
-
type:
|
|
33
|
+
type: timestampColumnType,
|
|
32
34
|
},
|
|
33
35
|
failedAt: {
|
|
34
36
|
nullable: true,
|
|
35
|
-
type:
|
|
37
|
+
type: timestampColumnType,
|
|
36
38
|
},
|
|
37
39
|
name: {
|
|
38
40
|
length: options.maxNameLength,
|
|
@@ -41,7 +43,7 @@ function createConfigMigrationEntity(options) {
|
|
|
41
43
|
},
|
|
42
44
|
startedAt: {
|
|
43
45
|
nullable: true,
|
|
44
|
-
type:
|
|
46
|
+
type: timestampColumnType,
|
|
45
47
|
},
|
|
46
48
|
status: {
|
|
47
49
|
default: "PENDING",
|
|
@@ -52,12 +54,12 @@ function createConfigMigrationEntity(options) {
|
|
|
52
54
|
updatedAt: {
|
|
53
55
|
default: () => "CURRENT_TIMESTAMP",
|
|
54
56
|
nullable: false,
|
|
55
|
-
type:
|
|
57
|
+
type: timestampColumnType,
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
60
|
decorators: {
|
|
59
61
|
createdAt: [
|
|
60
|
-
typeorm.CreateDateColumn(),
|
|
62
|
+
typeorm.CreateDateColumn({ type: timestampColumnType }),
|
|
61
63
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
62
64
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
63
65
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -116,7 +118,7 @@ function createConfigMigrationEntity(options) {
|
|
|
116
118
|
}),
|
|
117
119
|
],
|
|
118
120
|
updatedAt: [
|
|
119
|
-
typeorm.UpdateDateColumn(),
|
|
121
|
+
typeorm.UpdateDateColumn({ type: timestampColumnType }),
|
|
120
122
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
121
123
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
122
124
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/migration/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","CONFIG_MIGRATION_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/migration/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","CONFIG_MIGRATION_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;;AAiBA;;;;;;;AAOG;AACG,SAAU,2BAA2B,CAAC,OAI3C,EAAA;AACA,IAAA,MAAM,mBAAmB,GAAe,OAAO,CAAC,mBAAmB,IAAI,WAAW;AAElF,IAAA,OAAOA,uCAAwB,CAAC;AAC/B,QAAA,OAAO,EAAE;AACR,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,UAAU,EAAE;AACX,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,QAAQ,EAAE;AACT,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,IAAI,EAAE;gBACL,MAAM,EAAE,OAAO,CAAC,aAAa;AAC7B,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,SAAS,EAAE;AACV,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,MAAM,EAAE;AACP,gBAAA,OAAO,EAAE,SAAS;gBAClB,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC;AAC5D,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,MAAM;AACZ,aAAA;AACD,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EA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AiB;QACvB,SAAS,EAAE,OAAO,CAAC,SAAS;AAC5B,QAAA,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACnB,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
2
|
+
import { ColumnType } from 'typeorm';
|
|
2
3
|
import { IConfigSection } from '../interface';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a dynamic ConfigSection entity with TypeORM decorators
|
|
@@ -6,10 +7,12 @@ import { IConfigSection } from '../interface';
|
|
|
6
7
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
7
8
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
8
9
|
* @param {string} options.tableName - Name of the database table
|
|
10
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
9
11
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
10
12
|
*/
|
|
11
13
|
export declare function createConfigSectionEntity(options: {
|
|
12
14
|
maxDescriptionLength: number;
|
|
13
15
|
maxNameLength: number;
|
|
14
16
|
tableName: string;
|
|
17
|
+
timestampColumnType?: ColumnType;
|
|
15
18
|
}): TDynamicEntity<IConfigSection>;
|
|
@@ -16,15 +16,17 @@ require('../../../../shared/utility/logger.utility.js');
|
|
|
16
16
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
17
17
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
18
18
|
* @param {string} options.tableName - Name of the database table
|
|
19
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
19
20
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
20
21
|
*/
|
|
21
22
|
function createConfigSectionEntity(options) {
|
|
23
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
22
24
|
return entity_utility.createDynamicEntityClass({
|
|
23
25
|
columns: {
|
|
24
26
|
createdAt: {
|
|
25
27
|
default: () => "CURRENT_TIMESTAMP",
|
|
26
28
|
nullable: false,
|
|
27
|
-
type:
|
|
29
|
+
type: timestampColumnType,
|
|
28
30
|
},
|
|
29
31
|
description: {
|
|
30
32
|
length: options.maxDescriptionLength,
|
|
@@ -39,12 +41,12 @@ function createConfigSectionEntity(options) {
|
|
|
39
41
|
updatedAt: {
|
|
40
42
|
default: () => "CURRENT_TIMESTAMP",
|
|
41
43
|
nullable: false,
|
|
42
|
-
type:
|
|
44
|
+
type: timestampColumnType,
|
|
43
45
|
},
|
|
44
46
|
},
|
|
45
47
|
decorators: {
|
|
46
48
|
createdAt: [
|
|
47
|
-
typeorm.CreateDateColumn(),
|
|
49
|
+
typeorm.CreateDateColumn({ type: timestampColumnType }),
|
|
48
50
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
49
51
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
50
52
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -80,7 +82,7 @@ function createConfigSectionEntity(options) {
|
|
|
80
82
|
}),
|
|
81
83
|
],
|
|
82
84
|
updatedAt: [
|
|
83
|
-
typeorm.UpdateDateColumn(),
|
|
85
|
+
typeorm.UpdateDateColumn({ type: timestampColumnType }),
|
|
84
86
|
nestjsCrudAutomator.ApiPropertyDescribe({
|
|
85
87
|
format: nestjsCrudAutomator.EApiPropertyDateType.DATE_TIME,
|
|
86
88
|
identifier: nestjsCrudAutomator.EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/section/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/section/entity/entity.ts"],"sourcesContent":[null],"names":["createDynamicEntityClass","CreateDateColumn","ApiPropertyDescribe","EApiPropertyDateType","EApiPropertyDateIdentifier","EApiPropertyDescribeType","EApiPropertyStringType","API_PROPERTY_CONSTANT","UpdateDateColumn"],"mappings":";;;;;;;;;;;;AAiBA;;;;;;;;AAQG;AACG,SAAU,yBAAyB,CAAC,OAKzC,EAAA;AACA,IAAA,MAAM,mBAAmB,GAAe,OAAO,CAAC,mBAAmB,IAAI,WAAW;AAElF,IAAA,OAAOA,uCAAwB,CAAC;AAC/B,QAAA,OAAO,EAAE;AACR,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,WAAW,EAAE;gBACZ,MAAM,EAAE,OAAO,CAAC,oBAAoB;AACpC,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,IAAI,EAAE;gBACL,MAAM,EAAE,OAAO,CAAC,aAAa;AAC7B,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,SAAA;AACD,QAAA,UAAU,EAAE;AACX,YAAA,SAAS,EAAE;AACV,gBAAAC,wBAAgB,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;AAC/C,gBAAAC,uCAAmB,CAAC;oBACnB,MAAM,EAAEC,wCAAoB,CAAC,SAAS;oBACtC,UAAU,EAAEC,8CAA0B,CAAC,UAAU;oBACjD,IAAI,EAAEC,4CAAwB,CAAC,I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AAE,eAAe;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS;AAC5B,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ColumnType } from 'typeorm';
|
|
1
2
|
import { IConfigEntityDataOptions, IConfigEntitySectionOptions } from './';
|
|
2
3
|
/**
|
|
3
4
|
* Interface for entity customization options
|
|
@@ -16,4 +17,9 @@ export interface ICrudConfigEntityOptions {
|
|
|
16
17
|
* Table name prefix for all entities
|
|
17
18
|
*/
|
|
18
19
|
tablePrefix?: string;
|
|
20
|
+
/**
|
|
21
|
+
* TypeORM column type used by all ConfigSection, ConfigData, and ConfigMigration timestamp fields.
|
|
22
|
+
* Defaults to `timestamp`.
|
|
23
|
+
*/
|
|
24
|
+
timestampColumnType?: ColumnType;
|
|
19
25
|
}
|
|
@@ -24,12 +24,14 @@ var CrudConfigModule_1;
|
|
|
24
24
|
let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
25
25
|
static register(options) {
|
|
26
26
|
const prefix = options.entityOptions?.tablePrefix ?? "";
|
|
27
|
+
const timestampColumnType = options.entityOptions?.timestampColumnType ?? "timestamp";
|
|
27
28
|
const sectionEntity = createConfigSectionEntity({
|
|
28
29
|
maxDescriptionLength: options.entityOptions?.configSection?.maxDescriptionLength ??
|
|
29
30
|
CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
30
31
|
maxNameLength: options.entityOptions?.configSection?.maxNameLength ?? CONFIG_SECTION_CONSTANT.MAX_NAME_LENGTH,
|
|
31
32
|
tableName: prefix +
|
|
32
33
|
(options.entityOptions?.configSection?.tableName ?? CONFIG_SECTION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
34
|
+
timestampColumnType,
|
|
33
35
|
});
|
|
34
36
|
const dataEntity = createConfigDataEntity({
|
|
35
37
|
configSectionEntity: sectionEntity,
|
|
@@ -41,10 +43,12 @@ let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
41
43
|
maxValueLength: options.entityOptions?.configData?.maxValueLength ?? CONFIG_DATA_CONSTANT.MAX_VALUE_LENGTH,
|
|
42
44
|
tableName: prefix +
|
|
43
45
|
(options.entityOptions?.configData?.tableName ?? CONFIG_DATA_CONSTANT.DEFAULT_TABLE_NAME),
|
|
46
|
+
timestampColumnType,
|
|
44
47
|
});
|
|
45
48
|
const migrationEntity = createConfigMigrationEntity({
|
|
46
49
|
maxNameLength: options.migrationOptions?.maxNameLength ?? CONFIG_MIGRATION_CONSTANT.MAX_NAME_LENGTH,
|
|
47
50
|
tableName: prefix + (options.migrationOptions?.tableName ?? CONFIG_MIGRATION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
51
|
+
timestampColumnType,
|
|
48
52
|
});
|
|
49
53
|
const propertiesProvider = {
|
|
50
54
|
provide: TOKEN_CONSTANT.CONFIG_OPTIONS,
|
|
@@ -179,12 +183,14 @@ let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
179
183
|
static registerAsync(properties) {
|
|
180
184
|
const staticEntityOptions = properties.staticOptions?.entityOptions;
|
|
181
185
|
const prefix = staticEntityOptions?.tablePrefix ?? "";
|
|
186
|
+
const timestampColumnType = staticEntityOptions?.timestampColumnType ?? "timestamp";
|
|
182
187
|
const sectionEntity = createConfigSectionEntity({
|
|
183
188
|
maxDescriptionLength: staticEntityOptions?.configSection?.maxDescriptionLength ??
|
|
184
189
|
CONFIG_SECTION_CONSTANT.MAX_DESCRIPTION_LENGTH,
|
|
185
190
|
maxNameLength: staticEntityOptions?.configSection?.maxNameLength ?? CONFIG_SECTION_CONSTANT.MAX_NAME_LENGTH,
|
|
186
191
|
tableName: prefix +
|
|
187
192
|
(staticEntityOptions?.configSection?.tableName ?? CONFIG_SECTION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
193
|
+
timestampColumnType,
|
|
188
194
|
});
|
|
189
195
|
const dataEntity = createConfigDataEntity({
|
|
190
196
|
configSectionEntity: sectionEntity,
|
|
@@ -196,6 +202,7 @@ let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
196
202
|
maxValueLength: staticEntityOptions?.configData?.maxValueLength ?? CONFIG_DATA_CONSTANT.MAX_VALUE_LENGTH,
|
|
197
203
|
tableName: prefix +
|
|
198
204
|
(staticEntityOptions?.configData?.tableName ?? CONFIG_DATA_CONSTANT.DEFAULT_TABLE_NAME),
|
|
205
|
+
timestampColumnType,
|
|
199
206
|
});
|
|
200
207
|
const staticControllersOptions = properties.staticOptions?.controllersOptions;
|
|
201
208
|
const DynamicConfigSectionController = staticControllersOptions?.section?.isEnabled === false
|
|
@@ -213,6 +220,7 @@ let CrudConfigModule = CrudConfigModule_1 = class CrudConfigModule {
|
|
|
213
220
|
const migrationEntity = createConfigMigrationEntity({
|
|
214
221
|
maxNameLength: staticMigrationOptions?.maxNameLength ?? CONFIG_MIGRATION_CONSTANT.MAX_NAME_LENGTH,
|
|
215
222
|
tableName: prefix + (staticMigrationOptions?.tableName ?? CONFIG_MIGRATION_CONSTANT.DEFAULT_TABLE_NAME),
|
|
223
|
+
timestampColumnType,
|
|
216
224
|
});
|
|
217
225
|
const providers = [
|
|
218
226
|
this.createAsyncOptionsProvider(properties),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCO,IAAM,gBAAgB,GAAA,kBAAA,GAAtB,MAAM,gBAAgB,CAAA;IACrB,OAAO,QAAQ,CAAC,OAAuB,EAAA;QAC7C,MAAM,MAAM,GAAW,OAAO,CAAC,aAAa,EAAE,WAAW,IAAI,EAAE;QAE/D,MAAM,aAAa,GAAmC,yBAAyB,CAAC;AAC/E,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB;AAC1D,gBAAA,uBAAuB,CAAC,sBAAsB;YAC/C,aAAa,EACZ,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,IAAI,uBAAuB,CAAC,eAAe;AAC/F,YAAA,SAAS,EACR,MAAM;iBACL,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,IAAI,uBAAuB,CAAC,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.module.js","sources":["../../../../../src/modules/config/config.module.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAmCO,IAAM,gBAAgB,GAAA,kBAAA,GAAtB,MAAM,gBAAgB,CAAA;IACrB,OAAO,QAAQ,CAAC,OAAuB,EAAA;QAC7C,MAAM,MAAM,GAAW,OAAO,CAAC,aAAa,EAAE,WAAW,IAAI,EAAE;QAE/D,MAAM,mBAAmB,GACxB,OAAO,CAAC,aAAa,EAAE,mBAAmB,IAAI,WAAW;QAE1D,MAAM,aAAa,GAAmC,yBAAyB,CAAC;AAC/E,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,oBAAoB;AAC1D,gBAAA,uBAAuB,CAAC,sBAAsB;YAC/C,aAAa,EACZ,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,IAAI,uBAAuB,CAAC,eAAe;AAC/F,YAAA,SAAS,EACR,MAAM;iBACL,OAAO,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,IAAI,uBAAuB,CAAC,kBAAkB,CAAC;YAChG,mBAAmB;AACnB,SAAA,CAAC;QAEF,MAAM,UAAU,GAAgC,sBAAsB,CAAC;AACtE,YAAA,mBAAmB,EAAE,aAAa;AAClC,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,UAAU,EAAE,oBAAoB;AACvD,gBAAA,oBAAoB,CAAC,sBAAsB;AAC5C,YAAA,oBAAoB,EACnB,OAAO,CAAC,aAAa,EAAE,UAAU,EAAE,oBAAoB;AACvD,gBAAA,oBAAoB,CAAC,sBAAsB;YAC5C,aAAa,EACZ,OAAO,CAAC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
1
|
import { IConfigSection } from '../../section';
|
|
2
2
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
3
|
+
import { ColumnType } from 'typeorm';
|
|
3
4
|
import { IConfigData } from '../interface';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a dynamic ConfigData entity with TypeORM decorators
|
|
@@ -10,6 +11,7 @@ import { IConfigData } from '../interface';
|
|
|
10
11
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
11
12
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
12
13
|
* @param {string} options.tableName - Name of the database table
|
|
14
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
13
15
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
14
16
|
*/
|
|
15
17
|
export declare function createConfigDataEntity(options: {
|
|
@@ -19,4 +21,5 @@ export declare function createConfigDataEntity(options: {
|
|
|
19
21
|
maxNameLength: number;
|
|
20
22
|
maxValueLength: number;
|
|
21
23
|
tableName: string;
|
|
24
|
+
timestampColumnType?: ColumnType;
|
|
22
25
|
}): TDynamicEntity<IConfigData>;
|
|
@@ -17,15 +17,17 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
17
17
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
18
18
|
* @param {number} options.maxValueLength - Maximum length for value field
|
|
19
19
|
* @param {string} options.tableName - Name of the database table
|
|
20
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
20
21
|
* @returns {TDynamicEntity} Dynamically created ConfigData entity class
|
|
21
22
|
*/
|
|
22
23
|
function createConfigDataEntity(options) {
|
|
24
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
23
25
|
return createDynamicEntityClass({
|
|
24
26
|
columns: {
|
|
25
27
|
createdAt: {
|
|
26
28
|
default: () => "CURRENT_TIMESTAMP",
|
|
27
29
|
nullable: false,
|
|
28
|
-
type:
|
|
30
|
+
type: timestampColumnType,
|
|
29
31
|
},
|
|
30
32
|
description: {
|
|
31
33
|
length: options.maxDescriptionLength,
|
|
@@ -50,7 +52,7 @@ function createConfigDataEntity(options) {
|
|
|
50
52
|
updatedAt: {
|
|
51
53
|
default: () => "CURRENT_TIMESTAMP",
|
|
52
54
|
nullable: false,
|
|
53
|
-
type:
|
|
55
|
+
type: timestampColumnType,
|
|
54
56
|
},
|
|
55
57
|
value: {
|
|
56
58
|
length: options.maxValueLength,
|
|
@@ -60,7 +62,7 @@ function createConfigDataEntity(options) {
|
|
|
60
62
|
},
|
|
61
63
|
decorators: {
|
|
62
64
|
createdAt: [
|
|
63
|
-
CreateDateColumn(),
|
|
65
|
+
CreateDateColumn({ type: timestampColumnType }),
|
|
64
66
|
ApiPropertyDescribe({
|
|
65
67
|
format: EApiPropertyDateType.DATE_TIME,
|
|
66
68
|
identifier: EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -119,7 +121,7 @@ function createConfigDataEntity(options) {
|
|
|
119
121
|
}),
|
|
120
122
|
],
|
|
121
123
|
updatedAt: [
|
|
122
|
-
UpdateDateColumn(),
|
|
124
|
+
UpdateDateColumn({ type: timestampColumnType }),
|
|
123
125
|
ApiPropertyDescribe({
|
|
124
126
|
format: EApiPropertyDateType.DATE_TIME,
|
|
125
127
|
identifier: EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/data/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/data/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAkBA;;;;;;;;;;;AAWG;AACG,SAAU,sBAAsB,CAAC,OAQtC,EAAA;AACA,IAAA,MAAM,mBAAmB,GAAe,OAAO,CAAC,mBAAmB,IAAI,WAAW;AAElF,IAAA,OAAO,wBAAwB,CAAC;AAC/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,gBAAA,QAAQ,EAAE,SAAS;AACnB,gBAAA,IAAI,EAAE,WAAW;AACjB,aAAA;AACD,SAAA;QACD,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AAC7C,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
2
|
+
import { ColumnType } from 'typeorm';
|
|
2
3
|
import { IConfigMigration } from '../interface';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a dynamic ConfigMigration entity with TypeORM decorators
|
|
5
6
|
* @param {object} options - Configuration options for the entity
|
|
6
7
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
7
8
|
* @param {string} options.tableName - Name of the database table
|
|
9
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
8
10
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
9
11
|
*/
|
|
10
12
|
export declare function createConfigMigrationEntity(options: {
|
|
11
13
|
maxNameLength: number;
|
|
12
14
|
tableName: string;
|
|
15
|
+
timestampColumnType?: ColumnType;
|
|
13
16
|
}): TDynamicEntity<IConfigMigration>;
|
|
@@ -14,23 +14,25 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
14
14
|
* @param {object} options - Configuration options for the entity
|
|
15
15
|
* @param {number} options.maxNameLength - Maximum length for migration name field
|
|
16
16
|
* @param {string} options.tableName - Name of the database table
|
|
17
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
17
18
|
* @returns {TDynamicEntity} Dynamically created ConfigMigration entity class
|
|
18
19
|
*/
|
|
19
20
|
function createConfigMigrationEntity(options) {
|
|
21
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
20
22
|
return createDynamicEntityClass({
|
|
21
23
|
columns: {
|
|
22
24
|
createdAt: {
|
|
23
25
|
default: () => "CURRENT_TIMESTAMP",
|
|
24
26
|
nullable: false,
|
|
25
|
-
type:
|
|
27
|
+
type: timestampColumnType,
|
|
26
28
|
},
|
|
27
29
|
executedAt: {
|
|
28
30
|
nullable: true,
|
|
29
|
-
type:
|
|
31
|
+
type: timestampColumnType,
|
|
30
32
|
},
|
|
31
33
|
failedAt: {
|
|
32
34
|
nullable: true,
|
|
33
|
-
type:
|
|
35
|
+
type: timestampColumnType,
|
|
34
36
|
},
|
|
35
37
|
name: {
|
|
36
38
|
length: options.maxNameLength,
|
|
@@ -39,7 +41,7 @@ function createConfigMigrationEntity(options) {
|
|
|
39
41
|
},
|
|
40
42
|
startedAt: {
|
|
41
43
|
nullable: true,
|
|
42
|
-
type:
|
|
44
|
+
type: timestampColumnType,
|
|
43
45
|
},
|
|
44
46
|
status: {
|
|
45
47
|
default: "PENDING",
|
|
@@ -50,12 +52,12 @@ function createConfigMigrationEntity(options) {
|
|
|
50
52
|
updatedAt: {
|
|
51
53
|
default: () => "CURRENT_TIMESTAMP",
|
|
52
54
|
nullable: false,
|
|
53
|
-
type:
|
|
55
|
+
type: timestampColumnType,
|
|
54
56
|
},
|
|
55
57
|
},
|
|
56
58
|
decorators: {
|
|
57
59
|
createdAt: [
|
|
58
|
-
CreateDateColumn(),
|
|
60
|
+
CreateDateColumn({ type: timestampColumnType }),
|
|
59
61
|
ApiPropertyDescribe({
|
|
60
62
|
format: EApiPropertyDateType.DATE_TIME,
|
|
61
63
|
identifier: EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -114,7 +116,7 @@ function createConfigMigrationEntity(options) {
|
|
|
114
116
|
}),
|
|
115
117
|
],
|
|
116
118
|
updatedAt: [
|
|
117
|
-
UpdateDateColumn(),
|
|
119
|
+
UpdateDateColumn({ type: timestampColumnType }),
|
|
118
120
|
ApiPropertyDescribe({
|
|
119
121
|
format: EApiPropertyDateType.DATE_TIME,
|
|
120
122
|
identifier: EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/migration/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/migration/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;AAiBA;;;;;;;AAOG;AACG,SAAU,2BAA2B,CAAC,OAI3C,EAAA;AACA,IAAA,MAAM,mBAAmB,GAAe,OAAO,CAAC,mBAAmB,IAAI,WAAW;AAElF,IAAA,OAAO,wBAAwB,CAAC;AAC/B,QAAA,OAAO,EAAE;AACR,YAAA,SAAS,EAAE;AACV,gBAAA,OAAO,EAAE,MAAM,mBAAmB;AAClC,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,UAAU,EAAE;AACX,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,QAAQ,EAAE;AACT,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,IAAI,EAAE;gBACL,MAAM,EAAE,OAAO,CAAC,aAAa;AAC7B,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,SAAS;AACf,aAAA;AACD,YAAA,SAAS,EAAE;AACV,gBAAA,QAAQ,EAAE,IAAI;AACd,gBAAA,IAAI,EAAE,mBAAmB;AACzB,aAAA;AACD,YAAA,MAAM,EAAE;AACP,gBAAA,OAAO,EAAE,SAAS;gBAClB,IAAI,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC;AAC5D,gBAAA,QAAQ,EAAE,KAAK;AACf,gBAAA,IAAI,EAAE,MAAM;AACZ,aAAA;AACD,YAAA,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AAI,EAAE,iCAAiC,EAAE;AACnE,SAAA;AACD,QAAA,IAAI,EAAE,iBAAiB;QACvB,SAAS,EAAE,OAAO,CAAC,SAAS;AAC5B,QAAA,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;AACnB,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TDynamicEntity } from '../../../../shared/type';
|
|
2
|
+
import { ColumnType } from 'typeorm';
|
|
2
3
|
import { IConfigSection } from '../interface';
|
|
3
4
|
/**
|
|
4
5
|
* Creates a dynamic ConfigSection entity with TypeORM decorators
|
|
@@ -6,10 +7,12 @@ import { IConfigSection } from '../interface';
|
|
|
6
7
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
7
8
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
8
9
|
* @param {string} options.tableName - Name of the database table
|
|
10
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
9
11
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
10
12
|
*/
|
|
11
13
|
export declare function createConfigSectionEntity(options: {
|
|
12
14
|
maxDescriptionLength: number;
|
|
13
15
|
maxNameLength: number;
|
|
14
16
|
tableName: string;
|
|
17
|
+
timestampColumnType?: ColumnType;
|
|
15
18
|
}): TDynamicEntity<IConfigSection>;
|
|
@@ -14,15 +14,17 @@ import '../../../../shared/utility/logger.utility.js';
|
|
|
14
14
|
* @param {number} options.maxDescriptionLength - Maximum length for description field
|
|
15
15
|
* @param {number} options.maxNameLength - Maximum length for name field
|
|
16
16
|
* @param {string} options.tableName - Name of the database table
|
|
17
|
+
* @param {ColumnType} [options.timestampColumnType] - TypeORM type for timestamp fields; defaults to `timestamp`
|
|
17
18
|
* @returns {TDynamicEntity} Dynamically created ConfigSection entity class
|
|
18
19
|
*/
|
|
19
20
|
function createConfigSectionEntity(options) {
|
|
21
|
+
const timestampColumnType = options.timestampColumnType ?? "timestamp";
|
|
20
22
|
return createDynamicEntityClass({
|
|
21
23
|
columns: {
|
|
22
24
|
createdAt: {
|
|
23
25
|
default: () => "CURRENT_TIMESTAMP",
|
|
24
26
|
nullable: false,
|
|
25
|
-
type:
|
|
27
|
+
type: timestampColumnType,
|
|
26
28
|
},
|
|
27
29
|
description: {
|
|
28
30
|
length: options.maxDescriptionLength,
|
|
@@ -37,12 +39,12 @@ function createConfigSectionEntity(options) {
|
|
|
37
39
|
updatedAt: {
|
|
38
40
|
default: () => "CURRENT_TIMESTAMP",
|
|
39
41
|
nullable: false,
|
|
40
|
-
type:
|
|
42
|
+
type: timestampColumnType,
|
|
41
43
|
},
|
|
42
44
|
},
|
|
43
45
|
decorators: {
|
|
44
46
|
createdAt: [
|
|
45
|
-
CreateDateColumn(),
|
|
47
|
+
CreateDateColumn({ type: timestampColumnType }),
|
|
46
48
|
ApiPropertyDescribe({
|
|
47
49
|
format: EApiPropertyDateType.DATE_TIME,
|
|
48
50
|
identifier: EApiPropertyDateIdentifier.CREATED_AT,
|
|
@@ -78,7 +80,7 @@ function createConfigSectionEntity(options) {
|
|
|
78
80
|
}),
|
|
79
81
|
],
|
|
80
82
|
updatedAt: [
|
|
81
|
-
UpdateDateColumn(),
|
|
83
|
+
UpdateDateColumn({ type: timestampColumnType }),
|
|
82
84
|
ApiPropertyDescribe({
|
|
83
85
|
format: EApiPropertyDateType.DATE_TIME,
|
|
84
86
|
identifier: EApiPropertyDateIdentifier.UPDATED_AT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/section/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entity.js","sources":["../../../../../../../src/modules/config/section/entity/entity.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAiBA;;;;;;;;AAQG;AACG,SAAU,yBAAyB,CAAC,OAKzC,EAAA;AACA,IAAA,MAAM,mBAAmB,G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AA,EAAQ,OAAO,CAAC,oBAAoB,CAAA,EAAA,CAAI;oBACjD,IAAI,EAAE,wBAAwB,CAAC,MAAM;iBACrC,CAAC;AACF,aAAA;AACD,YAAA,EAAE,EAAE;AACH,gBAAA,mBAAmB,CAAC;oBACnB,IAAI,EAAE,wBAAwB,CAAC,IAAI;iBACnC,CAAC;AACF,aAAA;AACD,YAAA,IAAI,EAAE;AACL,gBAAA,mBAAmB,CAAC;AACnB,oBAAA,WAAW,EAAE,MAAM;AACnB,oBAAA,YAAY,EAAE,SAAS;oBACvB,MAAM,EAAE,sBAAsB,CAAC,MAAM;oBACrC,SAAS,EAAE,OAAO,CAAC,aAAa;oBAChC,SAAS,EAAE,qBAAqB,CAAC,eAAe;AAChD,oBAAA,OAAO,EAAE,CAAA,cAAA,EAAiB,OAAO,CAAC,aAAa,CAAA,EAAA,CAAI;oBACnD,IAAI,EAAE,wBAAwB,CAAC,MAAM;iBACrC,CAAC;AACF,aAAA;AACD,YAAA,SAAS,EAAE;AACV,gBAAA,gBAAgB,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;AAC/C,gBAAA,mBAAmB,CAAC;oBACnB,MAAM,EAAE,oBAAoB,CAAC,SAAS;oBACtC,UAAU,EAAE,0BAA0B,CAAC,UAAU;oBACjD,IAAI,EAAE,wBAAwB,CAAC,IAAI;iBACnC,CAAC;AACF,aAAA;AACD,SAAA;AACD,QAAA,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,OAAO,CAAC,SAAS;AAC5B,KAAA,CAAC;AACH;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ColumnType } from 'typeorm';
|
|
1
2
|
import { IConfigEntityDataOptions, IConfigEntitySectionOptions } from './';
|
|
2
3
|
/**
|
|
3
4
|
* Interface for entity customization options
|
|
@@ -16,4 +17,9 @@ export interface ICrudConfigEntityOptions {
|
|
|
16
17
|
* Table name prefix for all entities
|
|
17
18
|
*/
|
|
18
19
|
tablePrefix?: string;
|
|
20
|
+
/**
|
|
21
|
+
* TypeORM column type used by all ConfigSection, ConfigData, and ConfigMigration timestamp fields.
|
|
22
|
+
* Defaults to `timestamp`.
|
|
23
|
+
*/
|
|
24
|
+
timestampColumnType?: ColumnType;
|
|
19
25
|
}
|
package/package.json
CHANGED