@solidstarters/solid-core 1.2.151 → 1.2.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dtos/create-scheduled-job.dto.d.ts +1 -0
- package/dist/dtos/create-scheduled-job.dto.d.ts.map +1 -1
- package/dist/dtos/create-scheduled-job.dto.js +10 -2
- package/dist/dtos/create-scheduled-job.dto.js.map +1 -1
- package/dist/dtos/update-scheduled-job.dto.d.ts +1 -0
- package/dist/dtos/update-scheduled-job.dto.d.ts.map +1 -1
- package/dist/dtos/update-scheduled-job.dto.js +10 -2
- package/dist/dtos/update-scheduled-job.dto.js.map +1 -1
- package/dist/entities/scheduled-job.entity.d.ts.map +1 -1
- package/dist/entities/scheduled-job.entity.js +1 -0
- package/dist/entities/scheduled-job.entity.js.map +1 -1
- package/dist/repository/scheduled-job.repository.d.ts +1 -15
- package/dist/repository/scheduled-job.repository.d.ts.map +1 -1
- package/dist/repository/scheduled-job.repository.js +28 -20
- package/dist/repository/scheduled-job.repository.js.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts +2 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/subscribers/scheduled-job.subscriber.d.ts +1 -1
- package/dist/subscribers/scheduled-job.subscriber.d.ts.map +1 -1
- package/dist/subscribers/scheduled-job.subscriber.js +5 -4
- package/dist/subscribers/scheduled-job.subscriber.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rebuild.sh +1 -1
- package/src/dtos/create-scheduled-job.dto.ts +7 -13
- package/src/dtos/update-scheduled-job.dto.ts +7 -14
- package/src/entities/scheduled-job.entity.ts +1 -0
- package/src/repository/scheduled-job.repository.ts +46 -35
- package/src/seeders/module-metadata-seeder.service.ts +2 -1
- package/src/subscribers/scheduled-job.subscriber.ts +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-scheduled-job.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-scheduled-job.dto.ts"],"names":[],"mappings":"AAIA,qBAAa,qBAAqB;IAI9B,YAAY,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create-scheduled-job.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-scheduled-job.dto.ts"],"names":[],"mappings":"AAIA,qBAAa,qBAAqB;IAI9B,YAAY,EAAE,MAAM,CAAC;IAIrB,QAAQ,EAAE,OAAO,CAAS;IAI1B,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,IAAI,CAAC;IAIhB,OAAO,EAAE,IAAI,CAAC;IAId,SAAS,EAAE,IAAI,CAAC;IAIhB,OAAO,EAAE,IAAI,CAAC;IAId,UAAU,EAAE,MAAM,CAAC;IAInB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAIlB,GAAG,EAAE,MAAM,CAAC;IAIZ,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -19,7 +19,7 @@ class CreateScheduledJobDto {
|
|
|
19
19
|
this.isActive = false;
|
|
20
20
|
}
|
|
21
21
|
static _OPENAPI_METADATA_FACTORY() {
|
|
22
|
-
return { scheduleName: { required: true, type: () => String }, isActive: { required: true, type: () => Boolean, default: false }, frequency: { required: true, type: () => String }, startTime: { required: true, type: () => Date }, endTime: { required: true, type: () => Date }, startDate: { required: true, type: () => Date }, endDate: { required: true, type: () => Date }, dayOfMonth: { required: true, type: () => Number }, lastRunAt: { required: true, type: () => Date }, nextRunAt: { required: true, type: () => Date }, dayOfWeek: { required: true, type: () => String }, job: { required: true, type: () => String }, moduleId: { required: true, type: () => Number } };
|
|
22
|
+
return { scheduleName: { required: true, type: () => String }, isActive: { required: true, type: () => Boolean, default: false }, frequency: { required: true, type: () => String }, startTime: { required: true, type: () => Date }, endTime: { required: true, type: () => Date }, startDate: { required: true, type: () => Date }, endDate: { required: true, type: () => Date }, dayOfMonth: { required: true, type: () => Number }, lastRunAt: { required: true, type: () => Date }, nextRunAt: { required: true, type: () => Date }, dayOfWeek: { required: true, type: () => String }, job: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String } };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.CreateScheduledJobDto = CreateScheduledJobDto;
|
|
@@ -96,7 +96,15 @@ __decorate([
|
|
|
96
96
|
__metadata("design:type", String)
|
|
97
97
|
], CreateScheduledJobDto.prototype, "job", void 0);
|
|
98
98
|
__decorate([
|
|
99
|
-
(0, class_validator_2.
|
|
99
|
+
(0, class_validator_2.IsOptional)(),
|
|
100
|
+
(0, class_validator_2.IsInt)(),
|
|
101
|
+
(0, swagger_1.ApiProperty)(),
|
|
100
102
|
__metadata("design:type", Number)
|
|
101
103
|
], CreateScheduledJobDto.prototype, "moduleId", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, class_validator_1.IsString)(),
|
|
106
|
+
(0, class_validator_2.IsOptional)(),
|
|
107
|
+
(0, swagger_1.ApiProperty)(),
|
|
108
|
+
__metadata("design:type", String)
|
|
109
|
+
], CreateScheduledJobDto.prototype, "moduleUserKey", void 0);
|
|
102
110
|
//# sourceMappingURL=create-scheduled-job.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-scheduled-job.dto.js","sourceRoot":"","sources":["../../src/dtos/create-scheduled-job.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAC3C,qDAAmF;AAEnF,MAAa,qBAAqB;IAAlC;
|
|
1
|
+
{"version":3,"file":"create-scheduled-job.dto.js","sourceRoot":"","sources":["../../src/dtos/create-scheduled-job.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2C;AAC3C,qDAAmF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AAW,GAAE;;kDACF;AAIZ;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACQ","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsString } from 'class-validator';\nimport { IsNotEmpty, IsBoolean, IsDate, IsOptional, IsInt } from 'class-validator';\n\nexport class CreateScheduledJobDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n scheduleName: string;\n @IsNotEmpty()\n @IsBoolean()\n @ApiProperty()\n isActive: boolean = false;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n frequency: string;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n startTime: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n endTime: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n startDate: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n endDate: Date;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n dayOfMonth: number;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n lastRunAt: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n nextRunAt: Date;\n @IsOptional()\n @IsString()\n @ApiProperty()\n dayOfWeek: string;\n @IsNotEmpty()\n @IsString()\n @ApiProperty()\n job: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-scheduled-job.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-scheduled-job.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,qBAAqB;IAG9B,EAAE,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"update-scheduled-job.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-scheduled-job.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,qBAAqB;IAG9B,EAAE,EAAE,MAAM,CAAC;IAKX,YAAY,EAAE,MAAM,CAAC;IAKrB,QAAQ,EAAE,OAAO,CAAC;IAKlB,SAAS,EAAE,MAAM,CAAC;IAIlB,SAAS,EAAE,IAAI,CAAC;IAIhB,OAAO,EAAE,IAAI,CAAC;IAId,SAAS,EAAE,IAAI,CAAC;IAIhB,OAAO,EAAE,IAAI,CAAC;IAId,UAAU,EAAE,MAAM,CAAC;IAInB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,IAAI,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAKlB,GAAG,EAAE,MAAM,CAAC;IAIZ,QAAQ,EAAE,MAAM,CAAC;IAIjB,aAAa,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -15,7 +15,7 @@ const class_validator_1 = require("class-validator");
|
|
|
15
15
|
const swagger_1 = require("@nestjs/swagger");
|
|
16
16
|
class UpdateScheduledJobDto {
|
|
17
17
|
static _OPENAPI_METADATA_FACTORY() {
|
|
18
|
-
return { id: { required: true, type: () => Number }, scheduleName: { required: true, type: () => String }, isActive: { required: true, type: () => Boolean }, frequency: { required: true, type: () => String }, startTime: { required: true, type: () => Date }, endTime: { required: true, type: () => Date }, startDate: { required: true, type: () => Date }, endDate: { required: true, type: () => Date }, dayOfMonth: { required: true, type: () => Number }, lastRunAt: { required: true, type: () => Date }, nextRunAt: { required: true, type: () => Date }, dayOfWeek: { required: true, type: () => String }, job: { required: true, type: () => String }, moduleId: { required: true, type: () => Number } };
|
|
18
|
+
return { id: { required: true, type: () => Number }, scheduleName: { required: true, type: () => String }, isActive: { required: true, type: () => Boolean }, frequency: { required: true, type: () => String }, startTime: { required: true, type: () => Date }, endTime: { required: true, type: () => Date }, startDate: { required: true, type: () => Date }, endDate: { required: true, type: () => Date }, dayOfMonth: { required: true, type: () => Number }, lastRunAt: { required: true, type: () => Date }, nextRunAt: { required: true, type: () => Date }, dayOfWeek: { required: true, type: () => String }, job: { required: true, type: () => String }, moduleId: { required: true, type: () => Number }, moduleUserKey: { required: true, type: () => String } };
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.UpdateScheduledJobDto = UpdateScheduledJobDto;
|
|
@@ -101,7 +101,15 @@ __decorate([
|
|
|
101
101
|
__metadata("design:type", String)
|
|
102
102
|
], UpdateScheduledJobDto.prototype, "job", void 0);
|
|
103
103
|
__decorate([
|
|
104
|
-
(0, class_validator_1.
|
|
104
|
+
(0, class_validator_1.IsOptional)(),
|
|
105
|
+
(0, class_validator_1.IsInt)(),
|
|
106
|
+
(0, swagger_1.ApiProperty)(),
|
|
105
107
|
__metadata("design:type", Number)
|
|
106
108
|
], UpdateScheduledJobDto.prototype, "moduleId", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, class_validator_1.IsString)(),
|
|
111
|
+
(0, class_validator_1.IsOptional)(),
|
|
112
|
+
(0, swagger_1.ApiProperty)(),
|
|
113
|
+
__metadata("design:type", String)
|
|
114
|
+
], UpdateScheduledJobDto.prototype, "moduleUserKey", void 0);
|
|
107
115
|
//# sourceMappingURL=update-scheduled-job.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-scheduled-job.dto.js","sourceRoot":"","sources":["../../src/dtos/update-scheduled-job.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA6F;AAC7F,6CAA8C;AAE9C,MAAa,qBAAqB;;;;
|
|
1
|
+
{"version":3,"file":"update-scheduled-job.dto.js","sourceRoot":"","sources":["../../src/dtos/update-scheduled-job.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qDAA6F;AAC7F,6CAA8C;AAE9C,MAAa,qBAAqB;;;;CAgEjC;AAhED,sDAgEC;AA7DG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;iDACG;AAKX;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4B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IAAA,uBAAK,GAAE;IACP,IAAA,qBAAW,GAAE;;uDACG;AAIjB;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,GAAE;;4DACQ","sourcesContent":["import { IsInt, IsOptional, IsString, IsNotEmpty, IsBoolean, IsDate } from 'class-validator';\nimport { ApiProperty } from '@nestjs/swagger';\n\nexport class UpdateScheduledJobDto {\n @IsOptional()\n @IsInt()\n id: number;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n scheduleName: string;\n @IsNotEmpty()\n @IsOptional()\n @IsBoolean()\n @ApiProperty()\n isActive: boolean;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n frequency: string;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n startTime: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n endTime: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n startDate: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n endDate: Date;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n dayOfMonth: number;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n lastRunAt: Date;\n @IsOptional()\n @IsDate()\n @ApiProperty()\n nextRunAt: Date;\n @IsOptional()\n @IsString()\n @ApiProperty()\n dayOfWeek: string;\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty()\n job: string;\n @IsOptional()\n @IsInt()\n @ApiProperty()\n moduleId: number;\n @IsString()\n @IsOptional()\n @ApiProperty()\n moduleUserKey: string;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-job.entity.d.ts","sourceRoot":"","sources":["../../src/entities/scheduled-job.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,qBACa,YAAa,SAAQ,YAAY;IAG1C,YAAY,EAAE,MAAM,CAAC;IAErB,QAAQ,EAAE,OAAO,CAAS;IAE1B,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,IAAI,CAAC;IAEhB,OAAO,EAAE,IAAI,CAAC;IAEd,SAAS,EAAE,IAAI,CAAC;IAEhB,OAAO,EAAE,IAAI,CAAC;IAEd,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,IAAI,CAAC;IAEhB,SAAS,EAAE,IAAI,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-job.entity.d.ts","sourceRoot":"","sources":["../../src/entities/scheduled-job.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,qBACa,YAAa,SAAQ,YAAY;IAG1C,YAAY,EAAE,MAAM,CAAC;IAErB,QAAQ,EAAE,OAAO,CAAS;IAE1B,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,IAAI,CAAC;IAEhB,OAAO,EAAE,IAAI,CAAC;IAEd,SAAS,EAAE,IAAI,CAAC;IAEhB,OAAO,EAAE,IAAI,CAAC;IAEd,UAAU,EAAE,MAAM,CAAC;IAEnB,SAAS,EAAE,IAAI,CAAC;IAEhB,SAAS,EAAE,IAAI,CAAC;IAEhB,SAAS,EAAE,MAAM,CAAC;IAElB,GAAG,EAAE,MAAM,CAAC;IAIZ,MAAM,EAAE,cAAc,CAAC;CAC1B"}
|
|
@@ -74,6 +74,7 @@ __decorate([
|
|
|
74
74
|
__metadata("design:type", String)
|
|
75
75
|
], ScheduledJob.prototype, "job", void 0);
|
|
76
76
|
__decorate([
|
|
77
|
+
(0, typeorm_1.Index)(),
|
|
77
78
|
(0, typeorm_1.ManyToOne)(() => module_metadata_entity_1.ModuleMetadata, { onDelete: "CASCADE", nullable: false }),
|
|
78
79
|
(0, typeorm_1.JoinColumn)({ referencedColumnName: 'id' }),
|
|
79
80
|
__metadata("design:type", module_metadata_entity_1.ModuleMetadata)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-job.entity.js","sourceRoot":"","sources":["../../src/entities/scheduled-job.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAuE;AACvE,mDAA+C;AAC/C,qEAAqE;AAG9D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QAKH,aAAQ,GAAY,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-job.entity.js","sourceRoot":"","sources":["../../src/entities/scheduled-job.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,qCAAuE;AACvE,mDAA+C;AAC/C,qEAAqE;AAG9D,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,4BAAY;IAAvC;;QAKH,aAAQ,GAAY,KAAK,CAAC;KAyB7B;;iIAzBuB,KAAK;;CAyB5B,CAAA;AA9BY,oCAAY;AAGrB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;kDACP;AAErB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;8CAClB;AAE1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CACV;AAElB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;+CAAC;AAEhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChC,IAAI;6CAAC;AAEd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAC9B,IAAI;+CAAC;AAEhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAChC,IAAI;6CAAC;AAEd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACzB;AAEnB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnC,IAAI;+CAAC;AAEhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACnC,IAAI;+CAAC;AAEhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CAC1B;AAElB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChB;AAIZ;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uCAAc,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACzE,IAAA,oBAAU,EAAC,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;8BACnC,uCAAc;4CAAC;uBA7Bd,YAAY;IADxB,IAAA,gBAAM,EAAC,kBAAkB,CAAC;GACd,YAAY,CA8BxB","sourcesContent":["import { Entity, Column, ManyToOne, JoinColumn, Index } from 'typeorm';\nimport { CommonEntity } from './common.entity';\nimport { ModuleMetadata } from 'src/entities/module-metadata.entity';\n\n@Entity('ss_scheduled_job')\nexport class ScheduledJob extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n scheduleName: string;\n @Column({ type: \"boolean\", default: false })\n isActive: boolean = false;\n @Column({ type: \"varchar\" })\n frequency: string;\n @Column({ type: \"time\", nullable: true })\n startTime: Date;\n @Column({ type: \"time\", nullable: true })\n endTime: Date;\n @Column({ type: \"date\", nullable: true })\n startDate: Date;\n @Column({ type: \"date\", nullable: true })\n endDate: Date;\n @Column({ type: \"integer\", nullable: true })\n dayOfMonth: number;\n @Column({ type: \"timestamp\", nullable: true })\n lastRunAt: Date;\n @Column({ type: \"timestamp\", nullable: true })\n nextRunAt: Date;\n @Column({ type: \"varchar\", nullable: true })\n dayOfWeek: string;\n @Column({ type: \"varchar\" })\n job: string;\n @Index()\n @ManyToOne(() => ModuleMetadata, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn({ referencedColumnName: 'id' })\n module: ModuleMetadata;\n}\n"]}
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
+
import { CreateScheduledJobDto } from "src/dtos/create-scheduled-job.dto";
|
|
1
2
|
import { ScheduledJob } from "src/entities/scheduled-job.entity";
|
|
2
3
|
import { SolidRegistry } from "src/helpers/solid-registry";
|
|
3
4
|
import { CrudHelperService } from "src/services/crud-helper.service";
|
|
4
5
|
import { DataSource, Repository } from "typeorm";
|
|
5
|
-
export type CreateScheduledJobDto = {
|
|
6
|
-
scheduleName: string;
|
|
7
|
-
isActive?: boolean;
|
|
8
|
-
frequency: string;
|
|
9
|
-
startTime?: Date;
|
|
10
|
-
endTime?: Date;
|
|
11
|
-
startDate?: Date;
|
|
12
|
-
endDate?: Date;
|
|
13
|
-
dayOfMonth?: number;
|
|
14
|
-
lastRunAt?: Date;
|
|
15
|
-
nextRunAt?: Date;
|
|
16
|
-
dayOfWeek?: string;
|
|
17
|
-
job: string;
|
|
18
|
-
moduleUserKey: string;
|
|
19
|
-
};
|
|
20
6
|
export declare class ScheduledJobRepository extends Repository<ScheduledJob> {
|
|
21
7
|
private dataSource;
|
|
22
8
|
private readonly solidRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-job.repository.d.ts","sourceRoot":"","sources":["../../src/repository/scheduled-job.repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduled-job.repository.d.ts","sourceRoot":"","sources":["../../src/repository/scheduled-job.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmBjD,qBACa,sBAAuB,SAAQ,UAAU,CAAC,YAAY,CAAC;IAIhE,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IALpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;gBAGxD,UAAU,EAAE,UAAU,EACb,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB;IAQjD,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAoCjE,aAAa,CAAC,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;CA4BvE"}
|
|
@@ -26,27 +26,35 @@ let ScheduledJobRepository = ScheduledJobRepository_1 = class ScheduledJobReposi
|
|
|
26
26
|
this.logger = new common_1.Logger(ScheduledJobRepository_1.name);
|
|
27
27
|
}
|
|
28
28
|
async toDto(scheduledJob) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
let populatedScheduledJob = scheduledJob;
|
|
30
|
+
if (!scheduledJob.module) {
|
|
31
|
+
populatedScheduledJob = await this.findOne({
|
|
32
|
+
where: {
|
|
33
|
+
id: scheduledJob.id,
|
|
34
|
+
},
|
|
35
|
+
relations: {
|
|
36
|
+
module: true,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (!populatedScheduledJob.module) {
|
|
41
|
+
throw new Error(`Module not found for scheduled job ID ${populatedScheduledJob.id}`);
|
|
35
42
|
}
|
|
36
43
|
return {
|
|
37
|
-
scheduleName:
|
|
38
|
-
isActive:
|
|
39
|
-
frequency:
|
|
40
|
-
startTime:
|
|
41
|
-
endTime:
|
|
42
|
-
startDate:
|
|
43
|
-
endDate:
|
|
44
|
-
dayOfMonth:
|
|
45
|
-
lastRunAt:
|
|
46
|
-
nextRunAt:
|
|
47
|
-
dayOfWeek:
|
|
48
|
-
job:
|
|
49
|
-
moduleUserKey:
|
|
44
|
+
scheduleName: populatedScheduledJob.scheduleName,
|
|
45
|
+
isActive: populatedScheduledJob.isActive,
|
|
46
|
+
frequency: populatedScheduledJob.frequency,
|
|
47
|
+
startTime: populatedScheduledJob.startTime,
|
|
48
|
+
endTime: populatedScheduledJob.endTime,
|
|
49
|
+
startDate: populatedScheduledJob.startDate,
|
|
50
|
+
endDate: populatedScheduledJob.endDate,
|
|
51
|
+
dayOfMonth: populatedScheduledJob.dayOfMonth,
|
|
52
|
+
lastRunAt: populatedScheduledJob.lastRunAt,
|
|
53
|
+
nextRunAt: populatedScheduledJob.nextRunAt,
|
|
54
|
+
dayOfWeek: populatedScheduledJob.dayOfWeek,
|
|
55
|
+
job: populatedScheduledJob.job,
|
|
56
|
+
moduleUserKey: populatedScheduledJob.module.name,
|
|
57
|
+
moduleId: populatedScheduledJob.module.id,
|
|
50
58
|
};
|
|
51
59
|
}
|
|
52
60
|
async upsertWithDto(dto) {
|
|
@@ -55,7 +63,7 @@ let ScheduledJobRepository = ScheduledJobRepository_1 = class ScheduledJobReposi
|
|
|
55
63
|
where: { name: dto.moduleUserKey },
|
|
56
64
|
});
|
|
57
65
|
if (!moduleEntity) {
|
|
58
|
-
throw new Error(`Module with
|
|
66
|
+
throw new Error(`Module with userKey ${dto.moduleUserKey} not found`);
|
|
59
67
|
}
|
|
60
68
|
const jobData = {
|
|
61
69
|
...dto,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-job.repository.js","sourceRoot":"","sources":["../../src/repository/scheduled-job.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;
|
|
1
|
+
{"version":3,"file":"scheduled-job.repository.js","sourceRoot":"","sources":["../../src/repository/scheduled-job.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AAEpD,+EAAqE;AACrE,2EAAiE;AACjE,8DAA2D;AAC3D,yEAAqE;AACrE,qCAAiD;AAoB1C,IAAM,sBAAsB,8BAA5B,MAAM,sBAAuB,SAAQ,oBAAwB;IAGlE,YACU,UAAsB,EACb,aAA4B,EAC5B,iBAAoC;QAErD,KAAK,CAAC,mCAAY,EAAE,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;QAJ9C,eAAU,GAAV,UAAU,CAAY;QACb,kBAAa,GAAb,aAAa,CAAe;QAC5B,sBAAiB,GAAjB,iBAAiB,CAAmB;QALtC,WAAM,GAAG,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IAQlE,CAAC;IAKD,KAAK,CAAC,KAAK,CAAC,YAA0B;QACpC,IAAI,qBAAqB,GAAiB,YAAY,CAAC;QAEvD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;YACvB,qBAAqB,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;gBACvC,KAAK,EAAE;oBACH,EAAE,EAAE,YAAY,CAAC,EAAE;iBACtB;gBACD,SAAS,EAAE;oBACP,MAAM,EAAE,IAAI;iBACf;aACJ,CAAC,CAAC;QACP,CAAC;QAED,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,yCAAyC,qBAAqB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AAC;QAEH,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF,CAAA;AA9EY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAKW,oBAAU;QACE,8BAAa;QACT,uCAAiB;GAN5C,sBAAsB,CA8ElC","sourcesContent":["import { Injectable, Logger } from \"@nestjs/common\";\nimport { CreateScheduledJobDto } from \"src/dtos/create-scheduled-job.dto\";\nimport { ModuleMetadata } from \"src/entities/module-metadata.entity\";\nimport { ScheduledJob } from \"src/entities/scheduled-job.entity\";\nimport { SolidRegistry } from \"src/helpers/solid-registry\";\nimport { CrudHelperService } from \"src/services/crud-helper.service\";\nimport { DataSource, Repository } from \"typeorm\";\n\n// This should match whatever DTO structure you’re using in your seeding logic\n// export type CreateScheduledJobDto = {\n// scheduleName: string;\n// isActive?: boolean;\n// frequency: string;\n// startTime?: Date;\n// endTime?: Date;\n// startDate?: Date;\n// endDate?: Date;\n// dayOfMonth?: number;\n// lastRunAt?: Date;\n// nextRunAt?: Date;\n// dayOfWeek?: string;\n// job: string;\n// moduleUserKey: string;\n// };\n\n@Injectable()\nexport class ScheduledJobRepository extends Repository<ScheduledJob> {\n private readonly logger = new Logger(ScheduledJobRepository.name);\n\n constructor(\n private dataSource: DataSource,\n private readonly solidRegistry: SolidRegistry,\n private readonly crudHelperService: CrudHelperService\n ) {\n super(ScheduledJob, dataSource.createEntityManager());\n }\n\n /**\n * Converts an entity to a plain DTO object.\n */\n async toDto(scheduledJob: ScheduledJob): Promise<CreateScheduledJobDto> {\n let populatedScheduledJob: ScheduledJob = scheduledJob;\n // If the scheduled job does not have the module relation loaded, load it\n if (!scheduledJob.module) {\n populatedScheduledJob = await this.findOne({\n where: {\n id: scheduledJob.id,\n },\n relations: {\n module: true,\n },\n });\n }\n\n if (!populatedScheduledJob.module) {\n throw new Error(`Module not found for scheduled job ID ${populatedScheduledJob.id}`);\n }\n\n return {\n scheduleName: populatedScheduledJob.scheduleName,\n isActive: populatedScheduledJob.isActive,\n frequency: populatedScheduledJob.frequency,\n startTime: populatedScheduledJob.startTime,\n endTime: populatedScheduledJob.endTime,\n startDate: populatedScheduledJob.startDate,\n endDate: populatedScheduledJob.endDate,\n dayOfMonth: populatedScheduledJob.dayOfMonth,\n lastRunAt: populatedScheduledJob.lastRunAt,\n nextRunAt: populatedScheduledJob.nextRunAt,\n dayOfWeek: populatedScheduledJob.dayOfWeek,\n job: populatedScheduledJob.job,\n moduleUserKey: populatedScheduledJob.module.name,\n moduleId: populatedScheduledJob.module.id,\n };\n }\n\n async upsertWithDto(dto: CreateScheduledJobDto): Promise<ScheduledJob> {\n const moduleRepo = this.dataSource.getRepository(ModuleMetadata);\n\n const moduleEntity = await moduleRepo.findOne({\n where: { name: dto.moduleUserKey },\n });\n\n if (!moduleEntity) {\n throw new Error(`Module with userKey ${dto.moduleUserKey} not found`);\n }\n\n const jobData = {\n ...dto,\n module: moduleEntity,\n };\n const existing = await this.findOne({\n where: { scheduleName: dto.scheduleName },\n });\n\n if (existing) {\n const merged = this.merge(existing, jobData);\n this.logger.debug(`Updating scheduled job: ${dto.scheduleName}`);\n return this.save(merged);\n } else {\n this.logger.debug(`Creating scheduled job: ${dto.scheduleName}`);\n return this.save(this.create(jobData));\n }\n }\n}\n"]}
|
|
@@ -31,7 +31,8 @@ import { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';
|
|
|
31
31
|
import { SystemFieldsSeederService } from './system-fields-seeder.service';
|
|
32
32
|
import { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';
|
|
33
33
|
import { DashboardRepository } from 'src/repository/dashboard.repository';
|
|
34
|
-
import { ScheduledJobRepository
|
|
34
|
+
import { ScheduledJobRepository } from 'src/repository/scheduled-job.repository';
|
|
35
|
+
import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';
|
|
35
36
|
export declare class ModuleMetadataSeederService {
|
|
36
37
|
private readonly moduleMetadataService;
|
|
37
38
|
private readonly modelMetadataService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-metadata-seeder.service.d.ts","sourceRoot":"","sources":["../../src/seeders/module-metadata-seeder.service.ts"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mCAAmC,EAAE,MAAM,qDAAqD,CAAC;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,yCAAyC,EAAE,MAAM,4DAA4D,CAAC;AACvH,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO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AA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAmBJ,YAAA,IAAA,0BAAgB,EAAC,+CAAkB,CAAC,CAAA;IAGpC,YAAA,IAAA,eAAM,EAAC,4BAAgB,CAAC,GAAG,CAAC,CAAA;IAE5B,YAAA,IAAA,eAAM,EAAC,sBAAS,CAAC,GAAG,CAAC,CAAA;IACrB,YAAA,IAAA,eAAM,EAAC,uBAAY,CAAC,GAAG,CAAC,CAAA;IAGxB,YAAA,IAAA,0BAAgB,EAAC,wBAAO,EAAE,SAAS,CAAC,CAAA;qCAvBG,+CAAqB;QACtB,6CAAoB;QACpB,6CAAoB;QACL,6EAAmC;QAC3D,2CAAmB;QACnB,0BAAW;QACD,8CAAqB;QACxB,+CAAqB;QACnB,oDAAuB;QAC3B,2CAAmB;QACF,0FAAyC;QACtD,6CAAoB;QACtB,yCAAkB;QACjB,4CAAmB;QAExB,oBAAU;QACX,8BAAa,0BAMZ,gCAAc;QAExB,oBAAU;QACN,iDAAsB;QACb,wDAAyB;QACrC,0CAAmB;QACV,iDAAsB;GAhClD,2BAA2B,CAojBvC","sourcesContent":["import { Inject, Injectable, Logger } from '@nestjs/common';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport appBuilderConfig from '../config/app-builder.config';\nimport { ConfigType } from '@nestjs/config';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { ModuleMetadataService } from '../services/module-metadata.service';\nimport { CreateModelMetadataDto } from '../dtos/create-model-metadata.dto';\nimport { ModelMetadataService } from '../services/model-metadata.service';\nimport { MediaStorageProviderMetadataService } from '../services/media-storage-provider-metadata.service';\nimport { FieldMetadataService } from '../services/field-metadata.service';\nimport { UserService } from 'src/services/user.service';\nimport { AuthenticationService } from 'src/services/authentication.service';\nimport { MediaStorageProviderMetadataSeederService } from '../services/media-storage-provider-metadata-seeder.service';\nimport { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { EmailTemplateService } from 'src/services/email-template.service';\nimport { SmsTemplateService } from 'src/services/sms-template.service';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { ViewMetadataService } from '../services/view-metadata.service';\nimport { ActionMetadataService } from '../services/action-metadata.service';\nimport { MenuItemMetadataService } from '../services/menu-item-metadata.service';\nimport { InjectRepository } from '@nestjs/typeorm';\nimport { PermissionMetadata } from '../entities/permission-metadata.entity';\nimport { Repository } from 'typeorm';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { RoleMetadataService } from '../services/role-metadata.service';\nimport { getCoreModuleNames, getDynamicModuleNames } from '../helpers/module.helper';\nimport solidCoreMetadata from './seed-data/solid-core-metadata.json';\nimport { iamConfig } from 'src/config/iam.config';\nimport commonConfig from 'src/config/common.config';\nimport { CreateSettingDto } from 'src/dtos/create-setting.dto';\nimport { SettingService } from 'src/services/setting.service';\nimport { Setting } from 'src/entities/setting.entity';\nimport { CreateSecurityRuleDto } from 'src/dtos/create-security-rule.dto';\nimport { SecurityRuleRepository } from 'src/repository/security-rule.repository';\nimport { ListOfValuesService } from 'src/services/list-of-values.service';\nimport { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';\nimport { SystemFieldsSeederService } from './system-fields-seeder.service';\nimport { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\n// import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\nimport { ScheduledJobRepository, CreateScheduledJobDto } from 'src/repository/scheduled-job.repository';\n\n@Injectable()\nexport class ModuleMetadataSeederService {\n private readonly logger = new Logger(ModuleMetadataSeederService.name);\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly modelMetadataService: ModelMetadataService,\n private readonly fieldMetadataService: FieldMetadataService,\n private readonly mediaStorageProviderMetadataService: MediaStorageProviderMetadataService,\n private readonly roleService: RoleMetadataService,\n private readonly userService: UserService,\n private readonly authenticationService: AuthenticationService,\n private readonly solidActionService: ActionMetadataService,\n private readonly solidMenuItemService: MenuItemMetadataService,\n private readonly solidViewService: ViewMetadataService,\n private readonly mediaStorageProviderSeederService: MediaStorageProviderMetadataSeederService,\n private readonly emailTemplateService: EmailTemplateService,\n private readonly smsTemplateService: SmsTemplateService,\n private readonly listOfValuesService: ListOfValuesService,\n @InjectRepository(PermissionMetadata)\n private readonly permissionRepo: Repository<PermissionMetadata>,\n private readonly solidRegistry: SolidRegistry,\n @Inject(appBuilderConfig.KEY)\n private readonly appBuilderConfiguration: ConfigType<typeof appBuilderConfig>,\n @Inject(iamConfig.KEY) private readonly iamConfiguration: ConfigType<typeof iamConfig>,\n @Inject(commonConfig.KEY)\n private readonly commonConfiguration: ConfigType<typeof commonConfig>,\n private readonly seetingService: SettingService,\n @InjectRepository(Setting, 'default')\n readonly settingsRepo: Repository<Setting>,\n readonly securityRuleRepo: SecurityRuleRepository,\n readonly systemFieldsSeederService: SystemFieldsSeederService,\n readonly dashboardRepo: DashboardRepository,\n readonly scheduledJobRepository: ScheduledJobRepository,\n ) { }\n\n async seed() {\n\n const typedSolidCoreMetadata: any = structuredClone(solidCoreMetadata);\n\n // Run the permissions seeder. \n // await this.permissionsSeederService.seed();\n this.logger.log(`Seeding permissions`);\n await this.seedPermissions();\n\n // TODO: move this also the main loop processing. Generate the media storage providers required by default\n this.logger.log(`Seeding media storage providers`);\n await this.mediaStorageProviderSeederService.seed();\n\n // Seed any missing system fields metadata for all models.\n this.logger.log(`Seeding system fields metadata`);\n await this.systemFieldsSeederService.seed();\n\n // Read the module metadata from a file specified in the .env \n // Add the core json file as the first entry in the above array.\n // Please note the sequence of core files is important below...\n const coreModules = getCoreModuleNames();\n const seedDataFiles = [\n // 'src/common/seeders/seed-data/common-metadata.json',\n // 'src/iam/seeders/seed-data/iam-metadata.json',\n // 'src/app-builder/seeders/seed-data/app-builder-metadata.json',\n // 'src/queues/seeders/seed-data/queues-metadata.json',\n // ...coreModules.map(module => `src/${module}/seeders/seed-data/${module}-metadata.json`),\n typedSolidCoreMetadata\n ];\n this.logger.debug(`getting dynamics modules`);\n const enabledModules = getDynamicModuleNames();\n this.logger.log(`Seeding metadata`);\n\n for (let i = 0; i < enabledModules.length; i++) {\n const enabledModule = enabledModules[i];\n const enabledModuleSeedFile = `module-metadata/${enabledModule}/${enabledModule}-metadata.json`\n const fullPath = path.join(process.cwd(), enabledModuleSeedFile);\n if (fs.existsSync(fullPath)) {\n const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n seedDataFiles.push(overallMetadata)\n }\n }\n\n this.logger.debug(`Seed data files are: ${seedDataFiles}`);\n let usersDetail;\n for (let i = 0; i < seedDataFiles.length; i++) {\n\n // Module, model & field handling.\n const overallMetadata = seedDataFiles[i];\n // const fullPath = path.join(process.cwd(), seedDataFile);\n\n // For each module metadata seed file provided, read contents, parse & convert to a variable. \n // this.logger.log(`[Start] module seed data: ${fullPath}`);\n\n // const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n // Process module metadata first. \n const moduleMetadata: CreateModuleMetadataDto = overallMetadata.moduleMetadata;\n this.logger.log(`[Start] Processing module metadata for ${moduleMetadata.name}`)\n await this.seedModuleModelFields(moduleMetadata);\n this.logger.log(`[End] Processing module metadata for ${moduleMetadata.name}`)\n\n // Media Storage provider templates\n this.logger.log(`[Start] Processing Media Storage Provider for ${moduleMetadata.name}`);\n const mediaStorageProviders = overallMetadata.mediaStorageProviders;\n await this.seedMediaStorageProviders(mediaStorageProviders);\n this.logger.log(`[End] Processing Media Storage Provider for ${moduleMetadata.name}`);\n\n // Custom role handling\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n const roles = overallMetadata.roles;\n\n // Every role configuration in the seeder json can optionally have a permissions attribute. \n // While creating roles we are only passing the role name to be used. \n await this.roleService.createRolesIfNotExists(roles.map(role => { return { name: role.name } }));\n\n // After roles are created, we iterate over all roles and attach permissions (if specified in the seeder json) to the respective role.\n for (let roleI = 0; roleI < roles.length; roleI++) {\n const role = roles[roleI];\n if (role.permissions) {\n await this.roleService.addPermissionsToRole(role.name, role.permissions)\n }\n }\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n\n // Custom user handling\n this.logger.log(`[Start] Processing users for ${moduleMetadata.name}`);\n const users = overallMetadata.users;\n usersDetail = users;\n await this.seedUsers(users);\n this.logger.log(`[End] Processing users for ${moduleMetadata.name}`)\n\n // Application Module View handling \n this.logger.log(`[Start] Processing views for ${moduleMetadata.name}`);\n const views = overallMetadata.views;\n await this.seedViews(views);\n this.logger.log(`[End] Processing views for ${moduleMetadata.name}`)\n\n // Application Module Action handling\n this.logger.log(`[Start] Processing actions for ${moduleMetadata.name}`);\n const actions = overallMetadata.actions;\n await this.seedActions(actions);\n this.logger.log(`[End] Processing actions for ${moduleMetadata.name}`)\n\n // Application Module Menu handling \n this.logger.log(`[Start] Processing menus for ${moduleMetadata.name}`);\n const menus = overallMetadata.menus;\n await this.seedMenus(menus);\n this.logger.log(`[End] Processing menus for ${moduleMetadata.name}`)\n\n // Email templates \n this.logger.log(`[Start] Processing email templates for ${moduleMetadata.name}`);\n const emailTemplates: CreateEmailTemplateDto[] = overallMetadata.emailTemplates;\n await this.seedEmailTemplates(emailTemplates, moduleMetadata);\n this.logger.log(`[End] Processing email templates for ${moduleMetadata.name}`);\n\n // Sms templates\n this.logger.log(`[Start] Processing sms templates for ${moduleMetadata.name}`);\n const smsTemplates: CreateSmsTemplateDto[] = overallMetadata.smsTemplates;\n await this.seedSmsTemplates(smsTemplates, moduleMetadata);\n this.logger.log(`[End] Processing sms templates for ${moduleMetadata.name}`);\n\n // Settings\n this.logger.log(`[Start] Processing settings for ${moduleMetadata.name}`);\n await this.seetingService.seedDefaultSettings();\n this.logger.log(`[End] Processing settings for ${moduleMetadata.name}`);\n\n // Security rules\n this.logger.log(`[Start] Processing security rules for ${moduleMetadata.name}`);\n const securityRules: CreateSecurityRuleDto[] = overallMetadata.securityRules;\n await this.seedSecurityRules(securityRules);\n this.logger.log(`[End] Processing security rules for ${moduleMetadata.name}`);\n\n // List Of Values\n this.logger.log(`[Start] Processing List Of Values for ${moduleMetadata.name}`);\n const listOfValues: CreateListOfValuesDto[] = overallMetadata.listOfValues;\n await this.seedListOfValues(listOfValues);\n this.logger.log(`[End] Processing List Of Values for ${moduleMetadata.name}`);\n\n // Dashboards\n this.logger.log(`[Start] Processing dashboards for ${moduleMetadata.name}`);\n const dashboards: CreateDashboardDto[] = overallMetadata.dashboards;\n await this.seedDashboards(dashboards);\n this.logger.log(`[End] Processing dashboards for ${moduleMetadata.name}`);\n\n // Scheduled Jobs\n this.logger.debug(`[Start] Processing scheduled jobs for ${moduleMetadata.name}`);\n const scheduledJobs: CreateScheduledJobDto[] = overallMetadata.scheduledJobs;\n if (scheduledJobs?.length > 0) {\n await this.seedScheduledJobs(scheduledJobs);\n }\n this.logger.debug(`[End] Processing scheduled jobs for ${moduleMetadata.name}`);\n\n this.logger.debug(`[End] module seed data: ${overallMetadata}`);\n }\n\n // Post seed data file processing. \n\n // 1. Give all permissions to the Admin role.\n this.logger.log(`About to add all permissions to the Admin role`);\n await this.roleService.addAllPermissionsToRole(\"Admin\");\n // 2. Give wrapSettings permissions to the Public role.\n const internalRolePermission = [\n 'UserController.findMany',\n 'UserController.checkIfPermissionExists',\n 'UserController.findOne',\n 'MenuItemMetadataController.findMany',\n 'MenuItemMetadataController.findUserMenus',\n 'MenuItemMetadataController.findOne',\n 'ViewMetadataController.getLayout',\n 'ViewMetadataController.findMany',\n 'ViewMetadataController.findOne',\n 'AuthenticationController.changePassword',\n 'FieldMetadataController.getSelectionDynamicValues',\n 'FieldMetadataController.getSelectionDynamicValue',\n 'FieldMetadataController.findFieldDefaultMetaData',\n 'SavedFiltersController.delete',\n 'SavedFiltersController.deleteMany',\n 'SavedFiltersController.findOne',\n 'SavedFiltersController.findMany',\n 'SavedFiltersController.recover',\n 'SavedFiltersController.recoverMany',\n 'SavedFiltersController.partialUpdate',\n 'SavedFiltersController.update',\n 'SavedFiltersController.insertMany',\n 'SavedFiltersController.create',\n 'AuthenticationController.logout'\n ]\n await this.roleService.addPermissionToRole('Internal User', internalRolePermission);\n await this.roleService.addPermissionToRole('Public', ['SettingController.wrapSettings', 'AuthenticationController.logout']);\n this.logger.log(`All Seeders finished`);\n this.logger.log(`Newly created username is: ${usersDetail?.length > 0 ? usersDetail[0]?.username : ''} and password is ${usersDetail?.length > 0 ? usersDetail[0]?.password : ''}`);\n }\n\n\n async seedPermissions() {\n\n const controllers = this.solidRegistry.getControllers();\n\n // Loop over the countries and create them.\n for (let id = 0; id < controllers.length; id++) {\n try {\n const controller = controllers[id];\n this.logger.log(`Resolving controller: ${controller.name}`);\n\n const methods = controller.methods;\n for (let mId = 0; mId < methods.length; mId++) {\n\n const methodName = methods[mId];\n const permissionName = `${controller.name}.${methodName}`;\n\n const existingPermission = await this.permissionRepo.findOne({\n where: {\n name: permissionName\n }\n });\n\n if (existingPermission) {\n this.logger.log(`Permission ${permissionName} already exists.`);\n }\n else {\n this.logger.log(`Permission ${permissionName} does not exist, creating new.`);\n\n const newPermission = this.permissionRepo.create({\n name: permissionName\n });\n await this.permissionRepo.save(newPermission);\n\n }\n }\n\n } catch (error) {\n this.logger.error(error);\n }\n }\n }\n\n async seedMediaStorageProviders(mediaStorageProviders: any) {\n for (let i = 0; i < mediaStorageProviders.length; i++) {\n const mediaStorageProivder = mediaStorageProviders[i];\n await this.mediaStorageProviderMetadataService.upsert(mediaStorageProivder);\n }\n }\n\n async seedEmailTemplates(emailTemplates: CreateEmailTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!emailTemplates) {\n return;\n }\n\n for (let i = 0; i < emailTemplates.length; i++) {\n const emailTemplate = emailTemplates[i];\n this.logger.log(`Found ${emailTemplate.name} email template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/email-templates');\n const filePath = path.join(seedDataPath, emailTemplate.body);\n this.logger.log(`Seeding email template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n emailTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/email-templates/${emailTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom email template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n emailTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n // Save to DB.\n await this.emailTemplateService.removeByName(emailTemplate.name);\n await this.emailTemplateService.create(emailTemplate);\n }\n\n }\n\n async seedSmsTemplates(smsTemplates: CreateSmsTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!smsTemplates) {\n return;\n }\n\n for (let i = 0; i < smsTemplates.length; i++) {\n const smsTemplate = smsTemplates[i];\n this.logger.log(`Found ${smsTemplate.name} sms template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/sms-templates');\n const filePath = path.join(seedDataPath, smsTemplate.body);\n this.logger.log(`Seeding sms template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n smsTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/sms-templates/${smsTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom sms template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n smsTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n\n // Save to DB.\n await this.smsTemplateService.removeByName(smsTemplate.name);\n await this.smsTemplateService.create(smsTemplate);\n }\n }\n\n async seedMenus(menus: any) {\n if (!menus) {\n return;\n }\n\n for (let j = 0; j < menus.length; j++) {\n const menuData = menus[j];\n\n const adminRole = await this.roleService.findRoleByName('Admin');\n\n const specifiedRoles = menuData['roles'];\n\n // If the developer has specified roles, then resolve them, making sure that admin role is also given.\n const specifiedRoleObjects = [adminRole];\n if (specifiedRoles) {\n for (let i = 0; i < specifiedRoles.length; i++) {\n const specifiedRole = specifiedRoles[i];\n const specifiedRoleObject = await this.roleService.findRoleByName(specifiedRole);\n if (!specifiedRoleObject) {\n throw new Error(`Invalid role: (${specifiedRole}) specified against menu with display name ${menuData.displayName}.`);\n }\n specifiedRoleObjects.push(specifiedRoleObject);\n }\n }\n\n menuData['roles'] = specifiedRoleObjects;\n menuData['action'] = await this.solidActionService.findOneByUserKey(menuData.actionUserKey);\n menuData['module'] = await this.moduleMetadataService.findOneByUserKey(menuData.moduleUserKey);\n\n if (menuData.parentMenuItemUserKey) {\n menuData['parentMenuItem'] = await this.solidMenuItemService.findOneByUserKey(menuData.parentMenuItemUserKey);\n } else {\n menuData['parentMenuItem'] = null\n }\n await this.solidMenuItemService.upsert(menuData);\n }\n }\n\n async seedActions(actions: any) {\n if (!actions) {\n return;\n }\n\n for (let j = 0; j < actions.length; j++) {\n const actionData = actions[j];\n actionData['module'] = await this.moduleMetadataService.findOneByUserKey(actionData.moduleUserKey);\n if (actionData.type === 'solid') {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n actionData['view'] = await this.solidViewService.findOneByUserKey(actionData.viewUserKey);\n }\n else {\n if (actionData.modelUserKey) {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n }\n }\n await this.solidActionService.upsert(actionData);\n }\n }\n\n async seedViews(views: any) {\n if (!views) {\n return;\n }\n\n for (let j = 0; j < views.length; j++) {\n const viewData = views[j];\n\n // preety format the layout & context. \n viewData['layout'] = JSON.stringify(viewData['layout'], null, 2);\n // viewData['context'] = JSON.stringify(viewData['context'], null, 2);\n\n viewData['module'] = await this.moduleMetadataService.findOneByUserKey(viewData.moduleUserKey);\n viewData['model'] = await this.modelMetadataService.findOneByUserKey(viewData.modelUserKey);\n // await this.solidViewService.upsert(viewData);\n // First check if module already exists using name\n\n // Changed the below to upsert as now we are saving modifications to the view json to file system also.\n // await this.solidViewService.createIfNotPresent(viewData);\n await this.solidViewService.upsert(viewData);\n }\n }\n\n async seedUsers(users) {\n if (!users) {\n return;\n }\n\n for (let l = 0; l < users.length; l++) {\n const user = users[l];\n let exisitingUser = await this.userService.findOneByUsername(user.username);\n if (!exisitingUser) {\n exisitingUser = await this.authenticationService.signUp(user);\n\n this.logger.log(`Newly created user is ${user}`);\n }\n // now add Roles to user.\n // for (let m = 0; m < roles.length; m++) {\n // const role = roles[m];\n // await this.userService.addRoleToUser(user.email, role.name);\n // }\n }\n }\n\n async seedModuleModelFields(moduleMetadata: CreateModuleMetadataDto) {\n\n // First we create the module. \n // await this.moduleMetadataService.removeByName(moduleMetadata.name);\n // const module = await this.moduleMetadataService.create(moduleMetadata);\n const module = await this.moduleMetadataService.upsert(moduleMetadata);\n\n // Next create all the models. \n const modelsMetadata: CreateModelMetadataDto[] = moduleMetadata.models;\n for (let j = 0; j < modelsMetadata.length; j++) {\n const modelMetadata = modelsMetadata[j];\n\n // Before creating the model, we need to make sure we are linking it to the newly created module.\n // modelMetdata['moduleId'] = module.id;\n modelMetadata['module'] = module;\n\n // Please note that all the fields will also get created as we have setup the relation in model.entity.ts as cascade=true\n // await this.modelMetadataService.removeBySingularName(modelMetdata.singularName);\n // await this.modelMetadataService.modelSeeder(modelMetdata);\n\n // upsert the model information.\n // const fieldsMetadata = modelMetdata.fields;\n // delete modelMetdata['fields'];\n const { fields: fieldsMetadata, ...modelMetaDataWithoutFields } = modelMetadata;\n\n // Load and set the parent model if it exists.\n if (modelMetadata.isChild && modelMetadata.parentModelUserKey) {\n const parentModel = await this.modelMetadataService.findOneByUserKey(modelMetadata.parentModelUserKey);\n modelMetaDataWithoutFields['parentModel'] = parentModel;\n }\n\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n const model = await this.modelMetadataService.findOneBySingularName(modelMetadata.singularName)\n\n // iterate over all fields and upsert. \n let userKeyField = null;\n const userKeyFieldName = modelMetadata.userKeyFieldUserKey;\n for (let k = 0; k < fieldsMetadata.length; k++) {\n const fieldMetadata = fieldsMetadata[k];\n\n // TODO: resolve model & mediaStorageProvider. \n fieldMetadata['model'] = model;\n if (fieldMetadata.mediaStorageProviderUserKey) {\n fieldMetadata['mediaStorageProvider'] = await this.mediaStorageProviderMetadataService.findOneByUserKey(fieldMetadata.mediaStorageProviderUserKey);\n }\n // console.log(fieldMetadata.displayName);\n\n const affectedField = await this.fieldMetadataService.upsert(fieldMetadata);\n if (fieldMetadata.name === userKeyFieldName) {\n const { model, ...fieldData } = affectedField;\n userKeyField = fieldData;\n }\n }\n\n // Now that we have created fields & model update the model to stamp the userKeyField. \n if (userKeyField) {\n modelMetaDataWithoutFields['userKeyField'] = userKeyField;\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n }\n }\n }\n\n async seedSettings(createDto: CreateSettingDto) {\n const settingsArray: any[] = await this.settingsRepo.find();\n if (!settingsArray || settingsArray.length === 0) {\n this.seetingService.create(createDto);\n }\n }\n\n async seedSecurityRules(rulesDto: CreateSecurityRuleDto[]) {\n if (!rulesDto || rulesDto.length === 0) {\n this.logger.debug(`No security rules found to seed`);\n return;\n }\n for (const dto of rulesDto) {\n await this.securityRuleRepo.upsertWithDto({ ...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig) });\n }\n }\n\n async seedListOfValues(listOfValuesDto: CreateListOfValuesDto[]) {\n if (!listOfValuesDto || listOfValuesDto.length === 0) {\n this.logger.debug(`No List Of Values found to seed`);\n return;\n }\n for (let j = 0; j < listOfValuesDto.length; j++) {\n await this.listOfValuesService.upsert(listOfValuesDto);\n }\n }\n\n async seedDashboards(dashboardDtos: CreateDashboardDto[]) {\n if (!dashboardDtos || dashboardDtos.length === 0) {\n this.logger.debug(`No dashboards found to seed`);\n return;\n }\n for (const dto of dashboardDtos) {\n await this.dashboardRepo.upsertWithDto(dto);\n }\n }\n\n async seedScheduledJobs(createScheduledJobDto: CreateScheduledJobDto[]) {\n if (!createScheduledJobDto || createScheduledJobDto.length === 0) {\n this.logger.debug(`No scheduled jobs found to seed`);\n return;\n }\n for (const dto of createScheduledJobDto) {\n await this.scheduledJobRepository.upsertWithDto(dto);\n }\n }\n\n}"]}
|
|
1
|
+
{"version":3,"file":"module-metadata-seeder.service.js","sourceRoot":"","sources":["../../src/seeders/module-metadata-seeder.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4D;AAC5D,uCAAyB;AACzB,2CAA6B;AAE7B,sFAA4D;AAG5D,iFAA4E;AAE5E,+EAA0E;AAC1E,iHAA0G;AAC1G,+EAA0E;AAC1E,2DAAwD;AACxD,+EAA4E;AAC5E,+HAAuH;AAEvH,+EAA2E;AAC3E,2EAAuE;AAEvE,6EAAwE;AACxE,iFAA4E;AAC5E,uFAAiF;AACjF,6CAAmD;AACnD,uFAA4E;AAC5E,qCAAqC;AACrC,8DAA0D;AAC1D,6EAAwE;AACxE,4DAAqF;AACrF,oGAAqE;AACrE,qDAAkD;AAClD,4EAAoD;AAEpD,iEAA8D;AAC9D,+DAAsD;AAEtD,qFAAiF;AACjF,+EAA0E;AAE1E,iFAA2E;AAE3E,6EAA0E;AAE1E,qFAAiF;AAI1E,IAAM,2BAA2B,mCAAjC,MAAM,2BAA2B;IAGpC,YACqB,qBAA4C,EAC5C,oBAA0C,EAC1C,oBAA0C,EAC1C,mCAAwE,EACxE,WAAgC,EAChC,WAAwB,EACxB,qBAA4C,EAC5C,kBAAyC,EACzC,oBAA6C,EAC7C,gBAAqC,EACrC,iCAA4E,EAC5E,oBAA0C,EAC1C,kBAAsC,EACtC,mBAAwC,EAEzD,cAA+D,EAC9C,aAA4B,EA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tB,6CAAoB;QACpB,6CAAoB;QACL,6EAAmC;QAC3D,2CAAmB;QACnB,0BAAW;QACD,8CAAqB;QACxB,+CAAqB;QACnB,oDAAuB;QAC3B,2CAAmB;QACF,0FAAyC;QACtD,6CAAoB;QACtB,yCAAkB;QACjB,4CAAmB;QAExB,oBAAU;QACX,8BAAa,0BAMZ,gCAAc;QAExB,oBAAU;QACN,iDAAsB;QACb,wDAAyB;QACrC,0CAAmB;QACV,iDAAsB;GAhClD,2BAA2B,CAojBvC","sourcesContent":["import { Inject, Injectable, Logger } from '@nestjs/common';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport appBuilderConfig from '../config/app-builder.config';\nimport { ConfigType } from '@nestjs/config';\nimport { CreateModuleMetadataDto } from '../dtos/create-module-metadata.dto';\nimport { ModuleMetadataService } from '../services/module-metadata.service';\nimport { CreateModelMetadataDto } from '../dtos/create-model-metadata.dto';\nimport { ModelMetadataService } from '../services/model-metadata.service';\nimport { MediaStorageProviderMetadataService } from '../services/media-storage-provider-metadata.service';\nimport { FieldMetadataService } from '../services/field-metadata.service';\nimport { UserService } from 'src/services/user.service';\nimport { AuthenticationService } from 'src/services/authentication.service';\nimport { MediaStorageProviderMetadataSeederService } from '../services/media-storage-provider-metadata-seeder.service';\nimport { CreateEmailTemplateDto } from 'src/dtos/create-email-template.dto';\nimport { EmailTemplateService } from 'src/services/email-template.service';\nimport { SmsTemplateService } from 'src/services/sms-template.service';\nimport { CreateSmsTemplateDto } from 'src/dtos/create-sms-template.dto';\nimport { ViewMetadataService } from '../services/view-metadata.service';\nimport { ActionMetadataService } from '../services/action-metadata.service';\nimport { MenuItemMetadataService } from '../services/menu-item-metadata.service';\nimport { InjectRepository } from '@nestjs/typeorm';\nimport { PermissionMetadata } from '../entities/permission-metadata.entity';\nimport { Repository } from 'typeorm';\nimport { SolidRegistry } from '../helpers/solid-registry';\nimport { RoleMetadataService } from '../services/role-metadata.service';\nimport { getCoreModuleNames, getDynamicModuleNames } from '../helpers/module.helper';\nimport solidCoreMetadata from './seed-data/solid-core-metadata.json';\nimport { iamConfig } from 'src/config/iam.config';\nimport commonConfig from 'src/config/common.config';\nimport { CreateSettingDto } from 'src/dtos/create-setting.dto';\nimport { SettingService } from 'src/services/setting.service';\nimport { Setting } from 'src/entities/setting.entity';\nimport { CreateSecurityRuleDto } from 'src/dtos/create-security-rule.dto';\nimport { SecurityRuleRepository } from 'src/repository/security-rule.repository';\nimport { ListOfValuesService } from 'src/services/list-of-values.service';\nimport { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';\nimport { SystemFieldsSeederService } from './system-fields-seeder.service';\nimport { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';\nimport { DashboardRepository } from 'src/repository/dashboard.repository';\n// import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\nimport { ScheduledJobRepository } from 'src/repository/scheduled-job.repository';\nimport { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';\n\n@Injectable()\nexport class ModuleMetadataSeederService {\n private readonly logger = new Logger(ModuleMetadataSeederService.name);\n\n constructor(\n private readonly moduleMetadataService: ModuleMetadataService,\n private readonly modelMetadataService: ModelMetadataService,\n private readonly fieldMetadataService: FieldMetadataService,\n private readonly mediaStorageProviderMetadataService: MediaStorageProviderMetadataService,\n private readonly roleService: RoleMetadataService,\n private readonly userService: UserService,\n private readonly authenticationService: AuthenticationService,\n private readonly solidActionService: ActionMetadataService,\n private readonly solidMenuItemService: MenuItemMetadataService,\n private readonly solidViewService: ViewMetadataService,\n private readonly mediaStorageProviderSeederService: MediaStorageProviderMetadataSeederService,\n private readonly emailTemplateService: EmailTemplateService,\n private readonly smsTemplateService: SmsTemplateService,\n private readonly listOfValuesService: ListOfValuesService,\n @InjectRepository(PermissionMetadata)\n private readonly permissionRepo: Repository<PermissionMetadata>,\n private readonly solidRegistry: SolidRegistry,\n @Inject(appBuilderConfig.KEY)\n private readonly appBuilderConfiguration: ConfigType<typeof appBuilderConfig>,\n @Inject(iamConfig.KEY) private readonly iamConfiguration: ConfigType<typeof iamConfig>,\n @Inject(commonConfig.KEY)\n private readonly commonConfiguration: ConfigType<typeof commonConfig>,\n private readonly seetingService: SettingService,\n @InjectRepository(Setting, 'default')\n readonly settingsRepo: Repository<Setting>,\n readonly securityRuleRepo: SecurityRuleRepository,\n readonly systemFieldsSeederService: SystemFieldsSeederService,\n readonly dashboardRepo: DashboardRepository,\n readonly scheduledJobRepository: ScheduledJobRepository,\n ) { }\n\n async seed() {\n\n const typedSolidCoreMetadata: any = structuredClone(solidCoreMetadata);\n\n // Run the permissions seeder. \n // await this.permissionsSeederService.seed();\n this.logger.log(`Seeding permissions`);\n await this.seedPermissions();\n\n // TODO: move this also the main loop processing. Generate the media storage providers required by default\n this.logger.log(`Seeding media storage providers`);\n await this.mediaStorageProviderSeederService.seed();\n\n // Seed any missing system fields metadata for all models.\n this.logger.log(`Seeding system fields metadata`);\n await this.systemFieldsSeederService.seed();\n\n // Read the module metadata from a file specified in the .env \n // Add the core json file as the first entry in the above array.\n // Please note the sequence of core files is important below...\n const coreModules = getCoreModuleNames();\n const seedDataFiles = [\n // 'src/common/seeders/seed-data/common-metadata.json',\n // 'src/iam/seeders/seed-data/iam-metadata.json',\n // 'src/app-builder/seeders/seed-data/app-builder-metadata.json',\n // 'src/queues/seeders/seed-data/queues-metadata.json',\n // ...coreModules.map(module => `src/${module}/seeders/seed-data/${module}-metadata.json`),\n typedSolidCoreMetadata\n ];\n this.logger.debug(`getting dynamics modules`);\n const enabledModules = getDynamicModuleNames();\n this.logger.log(`Seeding metadata`);\n\n for (let i = 0; i < enabledModules.length; i++) {\n const enabledModule = enabledModules[i];\n const enabledModuleSeedFile = `module-metadata/${enabledModule}/${enabledModule}-metadata.json`\n const fullPath = path.join(process.cwd(), enabledModuleSeedFile);\n if (fs.existsSync(fullPath)) {\n const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n seedDataFiles.push(overallMetadata)\n }\n }\n\n this.logger.debug(`Seed data files are: ${seedDataFiles}`);\n let usersDetail;\n for (let i = 0; i < seedDataFiles.length; i++) {\n\n // Module, model & field handling.\n const overallMetadata = seedDataFiles[i];\n // const fullPath = path.join(process.cwd(), seedDataFile);\n\n // For each module metadata seed file provided, read contents, parse & convert to a variable. \n // this.logger.log(`[Start] module seed data: ${fullPath}`);\n\n // const overallMetadata: any = JSON.parse(fs.readFileSync(fullPath, 'utf-8').toString());\n\n // Process module metadata first. \n const moduleMetadata: CreateModuleMetadataDto = overallMetadata.moduleMetadata;\n this.logger.log(`[Start] Processing module metadata for ${moduleMetadata.name}`)\n await this.seedModuleModelFields(moduleMetadata);\n this.logger.log(`[End] Processing module metadata for ${moduleMetadata.name}`)\n\n // Media Storage provider templates\n this.logger.log(`[Start] Processing Media Storage Provider for ${moduleMetadata.name}`);\n const mediaStorageProviders = overallMetadata.mediaStorageProviders;\n await this.seedMediaStorageProviders(mediaStorageProviders);\n this.logger.log(`[End] Processing Media Storage Provider for ${moduleMetadata.name}`);\n\n // Custom role handling\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n const roles = overallMetadata.roles;\n\n // Every role configuration in the seeder json can optionally have a permissions attribute. \n // While creating roles we are only passing the role name to be used. \n await this.roleService.createRolesIfNotExists(roles.map(role => { return { name: role.name } }));\n\n // After roles are created, we iterate over all roles and attach permissions (if specified in the seeder json) to the respective role.\n for (let roleI = 0; roleI < roles.length; roleI++) {\n const role = roles[roleI];\n if (role.permissions) {\n await this.roleService.addPermissionsToRole(role.name, role.permissions)\n }\n }\n this.logger.log(`[End] Processing roles for ${moduleMetadata.name}`)\n\n // Custom user handling\n this.logger.log(`[Start] Processing users for ${moduleMetadata.name}`);\n const users = overallMetadata.users;\n usersDetail = users;\n await this.seedUsers(users);\n this.logger.log(`[End] Processing users for ${moduleMetadata.name}`)\n\n // Application Module View handling \n this.logger.log(`[Start] Processing views for ${moduleMetadata.name}`);\n const views = overallMetadata.views;\n await this.seedViews(views);\n this.logger.log(`[End] Processing views for ${moduleMetadata.name}`)\n\n // Application Module Action handling\n this.logger.log(`[Start] Processing actions for ${moduleMetadata.name}`);\n const actions = overallMetadata.actions;\n await this.seedActions(actions);\n this.logger.log(`[End] Processing actions for ${moduleMetadata.name}`)\n\n // Application Module Menu handling \n this.logger.log(`[Start] Processing menus for ${moduleMetadata.name}`);\n const menus = overallMetadata.menus;\n await this.seedMenus(menus);\n this.logger.log(`[End] Processing menus for ${moduleMetadata.name}`)\n\n // Email templates \n this.logger.log(`[Start] Processing email templates for ${moduleMetadata.name}`);\n const emailTemplates: CreateEmailTemplateDto[] = overallMetadata.emailTemplates;\n await this.seedEmailTemplates(emailTemplates, moduleMetadata);\n this.logger.log(`[End] Processing email templates for ${moduleMetadata.name}`);\n\n // Sms templates\n this.logger.log(`[Start] Processing sms templates for ${moduleMetadata.name}`);\n const smsTemplates: CreateSmsTemplateDto[] = overallMetadata.smsTemplates;\n await this.seedSmsTemplates(smsTemplates, moduleMetadata);\n this.logger.log(`[End] Processing sms templates for ${moduleMetadata.name}`);\n\n // Settings\n this.logger.log(`[Start] Processing settings for ${moduleMetadata.name}`);\n await this.seetingService.seedDefaultSettings();\n this.logger.log(`[End] Processing settings for ${moduleMetadata.name}`);\n\n // Security rules\n this.logger.log(`[Start] Processing security rules for ${moduleMetadata.name}`);\n const securityRules: CreateSecurityRuleDto[] = overallMetadata.securityRules;\n await this.seedSecurityRules(securityRules);\n this.logger.log(`[End] Processing security rules for ${moduleMetadata.name}`);\n\n // List Of Values\n this.logger.log(`[Start] Processing List Of Values for ${moduleMetadata.name}`);\n const listOfValues: CreateListOfValuesDto[] = overallMetadata.listOfValues;\n await this.seedListOfValues(listOfValues);\n this.logger.log(`[End] Processing List Of Values for ${moduleMetadata.name}`);\n\n // Dashboards\n this.logger.log(`[Start] Processing dashboards for ${moduleMetadata.name}`);\n const dashboards: CreateDashboardDto[] = overallMetadata.dashboards;\n await this.seedDashboards(dashboards);\n this.logger.log(`[End] Processing dashboards for ${moduleMetadata.name}`);\n\n // Scheduled Jobs\n this.logger.debug(`[Start] Processing scheduled jobs for ${moduleMetadata.name}`);\n const scheduledJobs: CreateScheduledJobDto[] = overallMetadata.scheduledJobs;\n if (scheduledJobs?.length > 0) {\n await this.seedScheduledJobs(scheduledJobs);\n }\n this.logger.debug(`[End] Processing scheduled jobs for ${moduleMetadata.name}`);\n\n this.logger.debug(`[End] module seed data: ${overallMetadata}`);\n }\n\n // Post seed data file processing. \n\n // 1. Give all permissions to the Admin role.\n this.logger.log(`About to add all permissions to the Admin role`);\n await this.roleService.addAllPermissionsToRole(\"Admin\");\n // 2. Give wrapSettings permissions to the Public role.\n const internalRolePermission = [\n 'UserController.findMany',\n 'UserController.checkIfPermissionExists',\n 'UserController.findOne',\n 'MenuItemMetadataController.findMany',\n 'MenuItemMetadataController.findUserMenus',\n 'MenuItemMetadataController.findOne',\n 'ViewMetadataController.getLayout',\n 'ViewMetadataController.findMany',\n 'ViewMetadataController.findOne',\n 'AuthenticationController.changePassword',\n 'FieldMetadataController.getSelectionDynamicValues',\n 'FieldMetadataController.getSelectionDynamicValue',\n 'FieldMetadataController.findFieldDefaultMetaData',\n 'SavedFiltersController.delete',\n 'SavedFiltersController.deleteMany',\n 'SavedFiltersController.findOne',\n 'SavedFiltersController.findMany',\n 'SavedFiltersController.recover',\n 'SavedFiltersController.recoverMany',\n 'SavedFiltersController.partialUpdate',\n 'SavedFiltersController.update',\n 'SavedFiltersController.insertMany',\n 'SavedFiltersController.create',\n 'AuthenticationController.logout'\n ]\n await this.roleService.addPermissionToRole('Internal User', internalRolePermission);\n await this.roleService.addPermissionToRole('Public', ['SettingController.wrapSettings', 'AuthenticationController.logout']);\n this.logger.log(`All Seeders finished`);\n this.logger.log(`Newly created username is: ${usersDetail?.length > 0 ? usersDetail[0]?.username : ''} and password is ${usersDetail?.length > 0 ? usersDetail[0]?.password : ''}`);\n }\n\n\n async seedPermissions() {\n\n const controllers = this.solidRegistry.getControllers();\n\n // Loop over the countries and create them.\n for (let id = 0; id < controllers.length; id++) {\n try {\n const controller = controllers[id];\n this.logger.log(`Resolving controller: ${controller.name}`);\n\n const methods = controller.methods;\n for (let mId = 0; mId < methods.length; mId++) {\n\n const methodName = methods[mId];\n const permissionName = `${controller.name}.${methodName}`;\n\n const existingPermission = await this.permissionRepo.findOne({\n where: {\n name: permissionName\n }\n });\n\n if (existingPermission) {\n this.logger.log(`Permission ${permissionName} already exists.`);\n }\n else {\n this.logger.log(`Permission ${permissionName} does not exist, creating new.`);\n\n const newPermission = this.permissionRepo.create({\n name: permissionName\n });\n await this.permissionRepo.save(newPermission);\n\n }\n }\n\n } catch (error) {\n this.logger.error(error);\n }\n }\n }\n\n async seedMediaStorageProviders(mediaStorageProviders: any) {\n for (let i = 0; i < mediaStorageProviders.length; i++) {\n const mediaStorageProivder = mediaStorageProviders[i];\n await this.mediaStorageProviderMetadataService.upsert(mediaStorageProivder);\n }\n }\n\n async seedEmailTemplates(emailTemplates: CreateEmailTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!emailTemplates) {\n return;\n }\n\n for (let i = 0; i < emailTemplates.length; i++) {\n const emailTemplate = emailTemplates[i];\n this.logger.log(`Found ${emailTemplate.name} email template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/email-templates');\n const filePath = path.join(seedDataPath, emailTemplate.body);\n this.logger.log(`Seeding email template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n emailTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/email-templates/${emailTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom email template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n emailTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n // Save to DB.\n await this.emailTemplateService.removeByName(emailTemplate.name);\n await this.emailTemplateService.create(emailTemplate);\n }\n\n }\n\n async seedSmsTemplates(smsTemplates: CreateSmsTemplateDto[], moduleMetadata: CreateModuleMetadataDto) {\n if (!smsTemplates) {\n return;\n }\n\n for (let i = 0; i < smsTemplates.length; i++) {\n const smsTemplate = smsTemplates[i];\n this.logger.log(`Found ${smsTemplate.name} sms template`);\n\n // We need to load the actual template contents. \n if (moduleMetadata.name === 'solid-core') {\n const modulePath = path.dirname(require.resolve('@solidstarters/solid-core'));\n const seedDataPath = path.join(modulePath, '../src/seeders/seed-data/sms-templates');\n const filePath = path.join(seedDataPath, smsTemplate.body);\n this.logger.log(`Seeding sms template from solid-core at path: ${filePath}`);\n if (fs.existsSync(filePath)) {\n smsTemplate.body = fs.readFileSync(filePath, 'utf-8').toString();\n }\n }\n else {\n // Check if file exists\n const emailTemplateHandlebar = `module-metadata/${moduleMetadata.name}/sms-templates/${smsTemplate.body}`\n const fullPath = path.join(process.cwd(), emailTemplateHandlebar);\n this.logger.log(`Seeding custom sms template from consuming model at path: ${fullPath}`);\n if (fs.existsSync(fullPath)) {\n smsTemplate.body = fs.readFileSync(fullPath, 'utf-8').toString();\n }\n }\n\n\n // Save to DB.\n await this.smsTemplateService.removeByName(smsTemplate.name);\n await this.smsTemplateService.create(smsTemplate);\n }\n }\n\n async seedMenus(menus: any) {\n if (!menus) {\n return;\n }\n\n for (let j = 0; j < menus.length; j++) {\n const menuData = menus[j];\n\n const adminRole = await this.roleService.findRoleByName('Admin');\n\n const specifiedRoles = menuData['roles'];\n\n // If the developer has specified roles, then resolve them, making sure that admin role is also given.\n const specifiedRoleObjects = [adminRole];\n if (specifiedRoles) {\n for (let i = 0; i < specifiedRoles.length; i++) {\n const specifiedRole = specifiedRoles[i];\n const specifiedRoleObject = await this.roleService.findRoleByName(specifiedRole);\n if (!specifiedRoleObject) {\n throw new Error(`Invalid role: (${specifiedRole}) specified against menu with display name ${menuData.displayName}.`);\n }\n specifiedRoleObjects.push(specifiedRoleObject);\n }\n }\n\n menuData['roles'] = specifiedRoleObjects;\n menuData['action'] = await this.solidActionService.findOneByUserKey(menuData.actionUserKey);\n menuData['module'] = await this.moduleMetadataService.findOneByUserKey(menuData.moduleUserKey);\n\n if (menuData.parentMenuItemUserKey) {\n menuData['parentMenuItem'] = await this.solidMenuItemService.findOneByUserKey(menuData.parentMenuItemUserKey);\n } else {\n menuData['parentMenuItem'] = null\n }\n await this.solidMenuItemService.upsert(menuData);\n }\n }\n\n async seedActions(actions: any) {\n if (!actions) {\n return;\n }\n\n for (let j = 0; j < actions.length; j++) {\n const actionData = actions[j];\n actionData['module'] = await this.moduleMetadataService.findOneByUserKey(actionData.moduleUserKey);\n if (actionData.type === 'solid') {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n actionData['view'] = await this.solidViewService.findOneByUserKey(actionData.viewUserKey);\n }\n else {\n if (actionData.modelUserKey) {\n actionData['model'] = await this.modelMetadataService.findOneByUserKey(actionData.modelUserKey);\n }\n }\n await this.solidActionService.upsert(actionData);\n }\n }\n\n async seedViews(views: any) {\n if (!views) {\n return;\n }\n\n for (let j = 0; j < views.length; j++) {\n const viewData = views[j];\n\n // preety format the layout & context. \n viewData['layout'] = JSON.stringify(viewData['layout'], null, 2);\n // viewData['context'] = JSON.stringify(viewData['context'], null, 2);\n\n viewData['module'] = await this.moduleMetadataService.findOneByUserKey(viewData.moduleUserKey);\n viewData['model'] = await this.modelMetadataService.findOneByUserKey(viewData.modelUserKey);\n // await this.solidViewService.upsert(viewData);\n // First check if module already exists using name\n\n // Changed the below to upsert as now we are saving modifications to the view json to file system also.\n // await this.solidViewService.createIfNotPresent(viewData);\n await this.solidViewService.upsert(viewData);\n }\n }\n\n async seedUsers(users) {\n if (!users) {\n return;\n }\n\n for (let l = 0; l < users.length; l++) {\n const user = users[l];\n let exisitingUser = await this.userService.findOneByUsername(user.username);\n if (!exisitingUser) {\n exisitingUser = await this.authenticationService.signUp(user);\n\n this.logger.log(`Newly created user is ${user}`);\n }\n // now add Roles to user.\n // for (let m = 0; m < roles.length; m++) {\n // const role = roles[m];\n // await this.userService.addRoleToUser(user.email, role.name);\n // }\n }\n }\n\n async seedModuleModelFields(moduleMetadata: CreateModuleMetadataDto) {\n\n // First we create the module. \n // await this.moduleMetadataService.removeByName(moduleMetadata.name);\n // const module = await this.moduleMetadataService.create(moduleMetadata);\n const module = await this.moduleMetadataService.upsert(moduleMetadata);\n\n // Next create all the models. \n const modelsMetadata: CreateModelMetadataDto[] = moduleMetadata.models;\n for (let j = 0; j < modelsMetadata.length; j++) {\n const modelMetadata = modelsMetadata[j];\n\n // Before creating the model, we need to make sure we are linking it to the newly created module.\n // modelMetdata['moduleId'] = module.id;\n modelMetadata['module'] = module;\n\n // Please note that all the fields will also get created as we have setup the relation in model.entity.ts as cascade=true\n // await this.modelMetadataService.removeBySingularName(modelMetdata.singularName);\n // await this.modelMetadataService.modelSeeder(modelMetdata);\n\n // upsert the model information.\n // const fieldsMetadata = modelMetdata.fields;\n // delete modelMetdata['fields'];\n const { fields: fieldsMetadata, ...modelMetaDataWithoutFields } = modelMetadata;\n\n // Load and set the parent model if it exists.\n if (modelMetadata.isChild && modelMetadata.parentModelUserKey) {\n const parentModel = await this.modelMetadataService.findOneByUserKey(modelMetadata.parentModelUserKey);\n modelMetaDataWithoutFields['parentModel'] = parentModel;\n }\n\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n const model = await this.modelMetadataService.findOneBySingularName(modelMetadata.singularName)\n\n // iterate over all fields and upsert. \n let userKeyField = null;\n const userKeyFieldName = modelMetadata.userKeyFieldUserKey;\n for (let k = 0; k < fieldsMetadata.length; k++) {\n const fieldMetadata = fieldsMetadata[k];\n\n // TODO: resolve model & mediaStorageProvider. \n fieldMetadata['model'] = model;\n if (fieldMetadata.mediaStorageProviderUserKey) {\n fieldMetadata['mediaStorageProvider'] = await this.mediaStorageProviderMetadataService.findOneByUserKey(fieldMetadata.mediaStorageProviderUserKey);\n }\n // console.log(fieldMetadata.displayName);\n\n const affectedField = await this.fieldMetadataService.upsert(fieldMetadata);\n if (fieldMetadata.name === userKeyFieldName) {\n const { model, ...fieldData } = affectedField;\n userKeyField = fieldData;\n }\n }\n\n // Now that we have created fields & model update the model to stamp the userKeyField. \n if (userKeyField) {\n modelMetaDataWithoutFields['userKeyField'] = userKeyField;\n await this.modelMetadataService.upsert(modelMetaDataWithoutFields);\n }\n }\n }\n\n async seedSettings(createDto: CreateSettingDto) {\n const settingsArray: any[] = await this.settingsRepo.find();\n if (!settingsArray || settingsArray.length === 0) {\n this.seetingService.create(createDto);\n }\n }\n\n async seedSecurityRules(rulesDto: CreateSecurityRuleDto[]) {\n if (!rulesDto || rulesDto.length === 0) {\n this.logger.debug(`No security rules found to seed`);\n return;\n }\n for (const dto of rulesDto) {\n await this.securityRuleRepo.upsertWithDto({ ...dto, securityRuleConfig: JSON.stringify(dto.securityRuleConfig) });\n }\n }\n\n async seedListOfValues(listOfValuesDto: CreateListOfValuesDto[]) {\n if (!listOfValuesDto || listOfValuesDto.length === 0) {\n this.logger.debug(`No List Of Values found to seed`);\n return;\n }\n for (let j = 0; j < listOfValuesDto.length; j++) {\n await this.listOfValuesService.upsert(listOfValuesDto);\n }\n }\n\n async seedDashboards(dashboardDtos: CreateDashboardDto[]) {\n if (!dashboardDtos || dashboardDtos.length === 0) {\n this.logger.debug(`No dashboards found to seed`);\n return;\n }\n for (const dto of dashboardDtos) {\n await this.dashboardRepo.upsertWithDto(dto);\n }\n }\n\n async seedScheduledJobs(createScheduledJobDto: CreateScheduledJobDto[]) {\n if (!createScheduledJobDto || createScheduledJobDto.length === 0) {\n this.logger.debug(`No scheduled jobs found to seed`);\n return;\n }\n for (const dto of createScheduledJobDto) {\n await this.scheduledJobRepository.upsertWithDto(dto);\n }\n }\n\n}"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DataSource, EntitySubscriberInterface, InsertEvent, UpdateEvent, RemoveEvent } from "typeorm";
|
|
2
1
|
import { ScheduledJob } from "src/entities/scheduled-job.entity";
|
|
3
2
|
import { ModuleMetadataHelperService } from "src/helpers/module-metadata-helper.service";
|
|
4
3
|
import { ScheduledJobRepository } from "src/repository/scheduled-job.repository";
|
|
4
|
+
import { DataSource, EntitySubscriberInterface, InsertEvent, RemoveEvent, UpdateEvent } from "typeorm";
|
|
5
5
|
export declare class ScheduledJobSubscriber implements EntitySubscriberInterface<ScheduledJob> {
|
|
6
6
|
private readonly dataSource;
|
|
7
7
|
private readonly moduleMetadataHelperService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-job.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/scheduled-job.subscriber.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduled-job.subscriber.d.ts","sourceRoot":"","sources":["../../src/subscribers/scheduled-job.subscriber.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EACL,UAAU,EAEV,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,qBACa,sBACX,YAAW,yBAAyB,CAAC,YAAY,CAAC;IAW5B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC/C,OAAO,CAAC,QAAQ,CAAC,2BAA2B;IAC5C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAZnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA2C;IAGlE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAIlC;gBAGqC,UAAU,EAAE,UAAU,EAC1C,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,sBAAsB;IAK3D,QAAQ;IAIF,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC;IAQ5C,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC;IAqB5C,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC;YAIpC,cAAc;YAkDd,cAAc;CAoD7B"}
|