@solidstarters/solid-core 1.2.150 → 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 +2 -0
- package/dist/dtos/create-scheduled-job.dto.d.ts.map +1 -1
- package/dist/dtos/create-scheduled-job.dto.js +13 -1
- package/dist/dtos/create-scheduled-job.dto.js.map +1 -1
- package/dist/dtos/create-user.dto.js +3 -3
- package/dist/dtos/create-user.dto.js.map +1 -1
- package/dist/dtos/update-scheduled-job.dto.d.ts +2 -0
- package/dist/dtos/update-scheduled-job.dto.d.ts.map +1 -1
- package/dist/dtos/update-scheduled-job.dto.js +13 -1
- package/dist/dtos/update-scheduled-job.dto.js.map +1 -1
- package/dist/entities/scheduled-job.entity.d.ts +2 -0
- package/dist/entities/scheduled-job.entity.d.ts.map +1 -1
- package/dist/entities/scheduled-job.entity.js +9 -1
- package/dist/entities/scheduled-job.entity.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js +4 -1
- package/dist/jobs/database/trigger-mcp-client-subscriber-database.service.js.map +1 -1
- package/dist/repository/scheduled-job.repository.d.ts +15 -0
- package/dist/repository/scheduled-job.repository.d.ts.map +1 -0
- package/dist/repository/scheduled-job.repository.js +93 -0
- package/dist/repository/scheduled-job.repository.js.map +1 -0
- package/dist/seeders/module-metadata-seeder.service.d.ts +5 -1
- package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
- package/dist/seeders/module-metadata-seeder.service.js +20 -2
- package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
- package/dist/seeders/seed-data/solid-core-metadata.json +156 -78
- package/dist/services/ai-interaction.service.d.ts +1 -1
- package/dist/services/ai-interaction.service.d.ts.map +1 -1
- package/dist/services/ai-interaction.service.js +4 -3
- package/dist/services/ai-interaction.service.js.map +1 -1
- package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.d.ts.map +1 -1
- package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js +16 -12
- package/dist/services/computed-fields/entity/concat-entity-computed-field-provider.service.js.map +1 -1
- package/dist/services/scheduled-jobs/scheduler.service.d.ts.map +1 -1
- package/dist/services/scheduled-jobs/scheduler.service.js +1 -1
- package/dist/services/scheduled-jobs/scheduler.service.js.map +1 -1
- package/dist/services/textract.service.d.ts +20 -0
- package/dist/services/textract.service.d.ts.map +1 -0
- package/dist/services/textract.service.js +199 -0
- package/dist/services/textract.service.js.map +1 -0
- package/dist/solid-core.module.d.ts.map +1 -1
- package/dist/solid-core.module.js +7 -0
- package/dist/solid-core.module.js.map +1 -1
- package/dist/subscribers/scheduled-job.subscriber.d.ts +19 -0
- package/dist/subscribers/scheduled-job.subscriber.d.ts.map +1 -0
- package/dist/subscribers/scheduled-job.subscriber.js +176 -0
- package/dist/subscribers/scheduled-job.subscriber.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- package/rebuild.sh +1 -1
- package/src/dtos/create-scheduled-job.dto.ts +8 -11
- package/src/dtos/create-user.dto.ts +2 -2
- package/src/dtos/update-scheduled-job.dto.ts +8 -12
- package/src/entities/scheduled-job.entity.ts +8 -2
- package/src/index.ts +1 -0
- package/src/jobs/database/trigger-mcp-client-subscriber-database.service.ts +8 -1
- package/src/repository/scheduled-job.repository.ts +105 -0
- package/src/seeders/module-metadata-seeder.service.ts +21 -1
- package/src/seeders/seed-data/solid-core-metadata.json +156 -78
- package/src/services/ai-interaction.service.ts +4 -3
- package/src/services/computed-fields/entity/concat-entity-computed-field-provider.service.ts +28 -18
- package/src/services/scheduled-jobs/scheduler.service.ts +2 -2
- package/src/services/textract.service.ts +189 -0
- package/src/solid-core.module.ts +7 -0
- package/src/subscribers/scheduled-job.subscriber.ts +176 -0
- package/src/# computed field pending issues.md +0 -3
- package/src/services/pending_import_issues +0 -3
- package/src/services/question-data-providers/test.sql +0 -1
- package/test.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidstarters/solid-core",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.152",
|
|
4
4
|
"description": "This module is a NestJS module containing all the required core providers required by a Solid application",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@angular-devkit/core": "^18.0.3",
|
|
36
36
|
"@aws-sdk/client-s3": "^3.637.0",
|
|
37
|
+
"@aws-sdk/client-textract": "^3.873.0",
|
|
37
38
|
"@aws-sdk/s3-request-presigner": "^3.828.0",
|
|
38
39
|
"@elasticemail/elasticemail-client": "^4.0.23",
|
|
39
40
|
"@hapi/joi": "^17.1.1",
|
package/rebuild.sh
CHANGED
|
@@ -7,59 +7,56 @@ export class CreateScheduledJobDto {
|
|
|
7
7
|
@IsString()
|
|
8
8
|
@ApiProperty()
|
|
9
9
|
scheduleName: string;
|
|
10
|
-
|
|
11
10
|
@IsNotEmpty()
|
|
12
11
|
@IsBoolean()
|
|
13
12
|
@ApiProperty()
|
|
14
13
|
isActive: boolean = false;
|
|
15
|
-
|
|
16
14
|
@IsNotEmpty()
|
|
17
15
|
@IsString()
|
|
18
16
|
@ApiProperty()
|
|
19
17
|
frequency: string;
|
|
20
|
-
|
|
21
18
|
@IsOptional()
|
|
22
19
|
@IsDate()
|
|
23
20
|
@ApiProperty()
|
|
24
21
|
startTime: Date;
|
|
25
|
-
|
|
26
22
|
@IsOptional()
|
|
27
23
|
@IsDate()
|
|
28
24
|
@ApiProperty()
|
|
29
25
|
endTime: Date;
|
|
30
|
-
|
|
31
26
|
@IsOptional()
|
|
32
27
|
@IsDate()
|
|
33
28
|
@ApiProperty()
|
|
34
29
|
startDate: Date;
|
|
35
|
-
|
|
36
30
|
@IsOptional()
|
|
37
31
|
@IsDate()
|
|
38
32
|
@ApiProperty()
|
|
39
33
|
endDate: Date;
|
|
40
|
-
|
|
41
34
|
@IsOptional()
|
|
42
35
|
@IsInt()
|
|
43
36
|
@ApiProperty()
|
|
44
37
|
dayOfMonth: number;
|
|
45
|
-
|
|
46
38
|
@IsOptional()
|
|
47
39
|
@IsDate()
|
|
48
40
|
@ApiProperty()
|
|
49
41
|
lastRunAt: Date;
|
|
50
|
-
|
|
51
42
|
@IsOptional()
|
|
52
43
|
@IsDate()
|
|
53
44
|
@ApiProperty()
|
|
54
45
|
nextRunAt: Date;
|
|
55
|
-
|
|
56
46
|
@IsOptional()
|
|
57
47
|
@IsString()
|
|
58
48
|
@ApiProperty()
|
|
59
49
|
dayOfWeek: string;
|
|
60
|
-
|
|
61
50
|
@IsNotEmpty()
|
|
62
51
|
@IsString()
|
|
63
52
|
@ApiProperty()
|
|
64
53
|
job: string;
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsInt()
|
|
56
|
+
@ApiProperty()
|
|
57
|
+
moduleId: number;
|
|
58
|
+
@IsString()
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@ApiProperty()
|
|
61
|
+
moduleUserKey: string;
|
|
65
62
|
}
|
|
@@ -23,12 +23,12 @@ export class CreateUserDto {
|
|
|
23
23
|
@ApiProperty()
|
|
24
24
|
mobile: string;
|
|
25
25
|
@IsOptional()
|
|
26
|
-
@Matches(
|
|
26
|
+
@Matches(/^$|^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
27
27
|
@IsString()
|
|
28
28
|
@ApiProperty()
|
|
29
29
|
password: string;
|
|
30
30
|
@IsOptional()
|
|
31
|
-
@Matches(
|
|
31
|
+
@Matches(/^$|^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).*$/)
|
|
32
32
|
@IsString()
|
|
33
33
|
@ApiProperty()
|
|
34
34
|
passwordConfirm: string;
|
|
@@ -5,68 +5,64 @@ export class UpdateScheduledJobDto {
|
|
|
5
5
|
@IsOptional()
|
|
6
6
|
@IsInt()
|
|
7
7
|
id: number;
|
|
8
|
-
|
|
9
8
|
@IsNotEmpty()
|
|
10
9
|
@IsOptional()
|
|
11
10
|
@IsString()
|
|
12
11
|
@ApiProperty()
|
|
13
12
|
scheduleName: string;
|
|
14
|
-
|
|
15
13
|
@IsNotEmpty()
|
|
16
14
|
@IsOptional()
|
|
17
15
|
@IsBoolean()
|
|
18
16
|
@ApiProperty()
|
|
19
17
|
isActive: boolean;
|
|
20
|
-
|
|
21
18
|
@IsNotEmpty()
|
|
22
19
|
@IsOptional()
|
|
23
20
|
@IsString()
|
|
24
21
|
@ApiProperty()
|
|
25
22
|
frequency: string;
|
|
26
|
-
|
|
27
23
|
@IsOptional()
|
|
28
24
|
@IsDate()
|
|
29
25
|
@ApiProperty()
|
|
30
26
|
startTime: Date;
|
|
31
|
-
|
|
32
27
|
@IsOptional()
|
|
33
28
|
@IsDate()
|
|
34
29
|
@ApiProperty()
|
|
35
30
|
endTime: Date;
|
|
36
|
-
|
|
37
31
|
@IsOptional()
|
|
38
32
|
@IsDate()
|
|
39
33
|
@ApiProperty()
|
|
40
34
|
startDate: Date;
|
|
41
|
-
|
|
42
35
|
@IsOptional()
|
|
43
36
|
@IsDate()
|
|
44
37
|
@ApiProperty()
|
|
45
38
|
endDate: Date;
|
|
46
|
-
|
|
47
39
|
@IsOptional()
|
|
48
40
|
@IsInt()
|
|
49
41
|
@ApiProperty()
|
|
50
42
|
dayOfMonth: number;
|
|
51
|
-
|
|
52
43
|
@IsOptional()
|
|
53
44
|
@IsDate()
|
|
54
45
|
@ApiProperty()
|
|
55
46
|
lastRunAt: Date;
|
|
56
|
-
|
|
57
47
|
@IsOptional()
|
|
58
48
|
@IsDate()
|
|
59
49
|
@ApiProperty()
|
|
60
50
|
nextRunAt: Date;
|
|
61
|
-
|
|
62
51
|
@IsOptional()
|
|
63
52
|
@IsString()
|
|
64
53
|
@ApiProperty()
|
|
65
54
|
dayOfWeek: string;
|
|
66
|
-
|
|
67
55
|
@IsNotEmpty()
|
|
68
56
|
@IsOptional()
|
|
69
57
|
@IsString()
|
|
70
58
|
@ApiProperty()
|
|
71
59
|
job: string;
|
|
60
|
+
@IsOptional()
|
|
61
|
+
@IsInt()
|
|
62
|
+
@ApiProperty()
|
|
63
|
+
moduleId: number;
|
|
64
|
+
@IsString()
|
|
65
|
+
@IsOptional()
|
|
66
|
+
@ApiProperty()
|
|
67
|
+
moduleUserKey: string;
|
|
72
68
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Entity, Column } from 'typeorm';
|
|
1
|
+
import { Entity, Column, ManyToOne, JoinColumn, Index } from 'typeorm';
|
|
2
2
|
import { CommonEntity } from './common.entity';
|
|
3
|
+
import { ModuleMetadata } from 'src/entities/module-metadata.entity';
|
|
3
4
|
|
|
4
5
|
@Entity('ss_scheduled_job')
|
|
5
6
|
export class ScheduledJob extends CommonEntity {
|
|
7
|
+
@Index({ unique: true })
|
|
6
8
|
@Column({ type: "varchar" })
|
|
7
9
|
scheduleName: string;
|
|
8
10
|
@Column({ type: "boolean", default: false })
|
|
@@ -27,4 +29,8 @@ export class ScheduledJob extends CommonEntity {
|
|
|
27
29
|
dayOfWeek: string;
|
|
28
30
|
@Column({ type: "varchar" })
|
|
29
31
|
job: string;
|
|
30
|
-
|
|
32
|
+
@Index()
|
|
33
|
+
@ManyToOne(() => ModuleMetadata, { onDelete: "CASCADE", nullable: false })
|
|
34
|
+
@JoinColumn({ referencedColumnName: 'id' })
|
|
35
|
+
module: ModuleMetadata;
|
|
36
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -218,6 +218,7 @@ export * from './services/crud.service'
|
|
|
218
218
|
export * from './services/email-template.service'
|
|
219
219
|
export * from './services/field-metadata.service'
|
|
220
220
|
export * from './services/file.service'
|
|
221
|
+
export * from './services/textract.service'
|
|
221
222
|
export * from './services/hashing.service'
|
|
222
223
|
export * from './services/list-of-values.service'
|
|
223
224
|
export * from './services/mail/elastic-email.service'
|
|
@@ -46,6 +46,8 @@ export class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<Trigg
|
|
|
46
46
|
const prompt = aiInteraction.message;
|
|
47
47
|
|
|
48
48
|
// Use this to invoke our mcp client
|
|
49
|
+
// TODO: try / catch ...
|
|
50
|
+
// Handle the rejection gracefully...
|
|
49
51
|
const aiResponse = await this.aiInteractionService.runMcpPrompt(prompt);
|
|
50
52
|
this.triggerMcpClientSubscriberLogger.log(`aiResponse: `);
|
|
51
53
|
this.triggerMcpClientSubscriberLogger.log(JSON.stringify(aiResponse));
|
|
@@ -75,7 +77,7 @@ export class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<Trigg
|
|
|
75
77
|
else {
|
|
76
78
|
let nestedResponse = aiResponse.response.trim();
|
|
77
79
|
|
|
78
|
-
await this.aiInteractionService.create({
|
|
80
|
+
const genAiInteraction = await this.aiInteractionService.create({
|
|
79
81
|
userId: aiInteraction.user.id,
|
|
80
82
|
threadId: aiInteraction.threadId,
|
|
81
83
|
parentInteractionId: aiInteraction.id,
|
|
@@ -88,6 +90,11 @@ export class TriggerMcpClientSubscriberDatabase extends DatabaseSubscriber<Trigg
|
|
|
88
90
|
metadata: JSON.stringify(aiResponse),
|
|
89
91
|
isApplied: aiInteraction.isApplied
|
|
90
92
|
});
|
|
93
|
+
|
|
94
|
+
// If the human interaction was with isAutoApply=true, then we can go ahead and autoApply.
|
|
95
|
+
if (aiInteraction.isAutoApply) {
|
|
96
|
+
this.aiInteractionService.applySolidAiInteraction(genAiInteraction.id);
|
|
97
|
+
}
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
return aiResponse;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Injectable, Logger } from "@nestjs/common";
|
|
2
|
+
import { CreateScheduledJobDto } from "src/dtos/create-scheduled-job.dto";
|
|
3
|
+
import { ModuleMetadata } from "src/entities/module-metadata.entity";
|
|
4
|
+
import { ScheduledJob } from "src/entities/scheduled-job.entity";
|
|
5
|
+
import { SolidRegistry } from "src/helpers/solid-registry";
|
|
6
|
+
import { CrudHelperService } from "src/services/crud-helper.service";
|
|
7
|
+
import { DataSource, Repository } from "typeorm";
|
|
8
|
+
|
|
9
|
+
// This should match whatever DTO structure you’re using in your seeding logic
|
|
10
|
+
// export type CreateScheduledJobDto = {
|
|
11
|
+
// scheduleName: string;
|
|
12
|
+
// isActive?: boolean;
|
|
13
|
+
// frequency: string;
|
|
14
|
+
// startTime?: Date;
|
|
15
|
+
// endTime?: Date;
|
|
16
|
+
// startDate?: Date;
|
|
17
|
+
// endDate?: Date;
|
|
18
|
+
// dayOfMonth?: number;
|
|
19
|
+
// lastRunAt?: Date;
|
|
20
|
+
// nextRunAt?: Date;
|
|
21
|
+
// dayOfWeek?: string;
|
|
22
|
+
// job: string;
|
|
23
|
+
// moduleUserKey: string;
|
|
24
|
+
// };
|
|
25
|
+
|
|
26
|
+
@Injectable()
|
|
27
|
+
export class ScheduledJobRepository extends Repository<ScheduledJob> {
|
|
28
|
+
private readonly logger = new Logger(ScheduledJobRepository.name);
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
private dataSource: DataSource,
|
|
32
|
+
private readonly solidRegistry: SolidRegistry,
|
|
33
|
+
private readonly crudHelperService: CrudHelperService
|
|
34
|
+
) {
|
|
35
|
+
super(ScheduledJob, dataSource.createEntityManager());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Converts an entity to a plain DTO object.
|
|
40
|
+
*/
|
|
41
|
+
async toDto(scheduledJob: ScheduledJob): Promise<CreateScheduledJobDto> {
|
|
42
|
+
let populatedScheduledJob: ScheduledJob = scheduledJob;
|
|
43
|
+
// If the scheduled job does not have the module relation loaded, load it
|
|
44
|
+
if (!scheduledJob.module) {
|
|
45
|
+
populatedScheduledJob = await this.findOne({
|
|
46
|
+
where: {
|
|
47
|
+
id: scheduledJob.id,
|
|
48
|
+
},
|
|
49
|
+
relations: {
|
|
50
|
+
module: true,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!populatedScheduledJob.module) {
|
|
56
|
+
throw new Error(`Module not found for scheduled job ID ${populatedScheduledJob.id}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
scheduleName: populatedScheduledJob.scheduleName,
|
|
61
|
+
isActive: populatedScheduledJob.isActive,
|
|
62
|
+
frequency: populatedScheduledJob.frequency,
|
|
63
|
+
startTime: populatedScheduledJob.startTime,
|
|
64
|
+
endTime: populatedScheduledJob.endTime,
|
|
65
|
+
startDate: populatedScheduledJob.startDate,
|
|
66
|
+
endDate: populatedScheduledJob.endDate,
|
|
67
|
+
dayOfMonth: populatedScheduledJob.dayOfMonth,
|
|
68
|
+
lastRunAt: populatedScheduledJob.lastRunAt,
|
|
69
|
+
nextRunAt: populatedScheduledJob.nextRunAt,
|
|
70
|
+
dayOfWeek: populatedScheduledJob.dayOfWeek,
|
|
71
|
+
job: populatedScheduledJob.job,
|
|
72
|
+
moduleUserKey: populatedScheduledJob.module.name,
|
|
73
|
+
moduleId: populatedScheduledJob.module.id,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async upsertWithDto(dto: CreateScheduledJobDto): Promise<ScheduledJob> {
|
|
78
|
+
const moduleRepo = this.dataSource.getRepository(ModuleMetadata);
|
|
79
|
+
|
|
80
|
+
const moduleEntity = await moduleRepo.findOne({
|
|
81
|
+
where: { name: dto.moduleUserKey },
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (!moduleEntity) {
|
|
85
|
+
throw new Error(`Module with userKey ${dto.moduleUserKey} not found`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const jobData = {
|
|
89
|
+
...dto,
|
|
90
|
+
module: moduleEntity,
|
|
91
|
+
};
|
|
92
|
+
const existing = await this.findOne({
|
|
93
|
+
where: { scheduleName: dto.scheduleName },
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
if (existing) {
|
|
97
|
+
const merged = this.merge(existing, jobData);
|
|
98
|
+
this.logger.debug(`Updating scheduled job: ${dto.scheduleName}`);
|
|
99
|
+
return this.save(merged);
|
|
100
|
+
} else {
|
|
101
|
+
this.logger.debug(`Creating scheduled job: ${dto.scheduleName}`);
|
|
102
|
+
return this.save(this.create(jobData));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -39,6 +39,9 @@ import { CreateListOfValuesDto } from 'src/dtos/create-list-of-values.dto';
|
|
|
39
39
|
import { SystemFieldsSeederService } from './system-fields-seeder.service';
|
|
40
40
|
import { CreateDashboardDto } from 'src/dtos/create-dashboard.dto';
|
|
41
41
|
import { DashboardRepository } from 'src/repository/dashboard.repository';
|
|
42
|
+
// import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';
|
|
43
|
+
import { ScheduledJobRepository } from 'src/repository/scheduled-job.repository';
|
|
44
|
+
import { CreateScheduledJobDto } from 'src/dtos/create-scheduled-job.dto';
|
|
42
45
|
|
|
43
46
|
@Injectable()
|
|
44
47
|
export class ModuleMetadataSeederService {
|
|
@@ -73,6 +76,7 @@ export class ModuleMetadataSeederService {
|
|
|
73
76
|
readonly securityRuleRepo: SecurityRuleRepository,
|
|
74
77
|
readonly systemFieldsSeederService: SystemFieldsSeederService,
|
|
75
78
|
readonly dashboardRepo: DashboardRepository,
|
|
79
|
+
readonly scheduledJobRepository: ScheduledJobRepository,
|
|
76
80
|
) { }
|
|
77
81
|
|
|
78
82
|
async seed() {
|
|
@@ -221,9 +225,15 @@ export class ModuleMetadataSeederService {
|
|
|
221
225
|
await this.seedDashboards(dashboards);
|
|
222
226
|
this.logger.log(`[End] Processing dashboards for ${moduleMetadata.name}`);
|
|
223
227
|
|
|
228
|
+
// Scheduled Jobs
|
|
229
|
+
this.logger.debug(`[Start] Processing scheduled jobs for ${moduleMetadata.name}`);
|
|
230
|
+
const scheduledJobs: CreateScheduledJobDto[] = overallMetadata.scheduledJobs;
|
|
231
|
+
if (scheduledJobs?.length > 0) {
|
|
232
|
+
await this.seedScheduledJobs(scheduledJobs);
|
|
233
|
+
}
|
|
234
|
+
this.logger.debug(`[End] Processing scheduled jobs for ${moduleMetadata.name}`);
|
|
224
235
|
|
|
225
236
|
this.logger.debug(`[End] module seed data: ${overallMetadata}`);
|
|
226
|
-
|
|
227
237
|
}
|
|
228
238
|
|
|
229
239
|
// Post seed data file processing.
|
|
@@ -588,4 +598,14 @@ export class ModuleMetadataSeederService {
|
|
|
588
598
|
}
|
|
589
599
|
}
|
|
590
600
|
|
|
601
|
+
async seedScheduledJobs(createScheduledJobDto: CreateScheduledJobDto[]) {
|
|
602
|
+
if (!createScheduledJobDto || createScheduledJobDto.length === 0) {
|
|
603
|
+
this.logger.debug(`No scheduled jobs found to seed`);
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
for (const dto of createScheduledJobDto) {
|
|
607
|
+
await this.scheduledJobRepository.upsertWithDto(dto);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
591
611
|
}
|
|
@@ -2548,7 +2548,7 @@
|
|
|
2548
2548
|
"userKeyFieldUserKey": "scheduleName",
|
|
2549
2549
|
"isChild": false,
|
|
2550
2550
|
"enableAuditTracking": true,
|
|
2551
|
-
"enableSoftDelete":
|
|
2551
|
+
"enableSoftDelete": false,
|
|
2552
2552
|
"draftPublishWorkflow": false,
|
|
2553
2553
|
"internationalisation": false,
|
|
2554
2554
|
"fields": [
|
|
@@ -2797,6 +2797,22 @@
|
|
|
2797
2797
|
"selectionValueType": "string",
|
|
2798
2798
|
"selectionDynamicProvider": "ListOfScheduledJobsSelectionProvider",
|
|
2799
2799
|
"selectionDynamicProviderCtxt": "{}"
|
|
2800
|
+
},
|
|
2801
|
+
{
|
|
2802
|
+
"name": "module",
|
|
2803
|
+
"displayName": "Module",
|
|
2804
|
+
"type": "relation",
|
|
2805
|
+
"required": true,
|
|
2806
|
+
"unique": false,
|
|
2807
|
+
"index": true,
|
|
2808
|
+
"private": false,
|
|
2809
|
+
"encrypt": false,
|
|
2810
|
+
"relationType": "many-to-one",
|
|
2811
|
+
"relationCoModelSingularName": "moduleMetadata",
|
|
2812
|
+
"relationCreateInverse": false,
|
|
2813
|
+
"relationCascade": "cascade",
|
|
2814
|
+
"relationModelModuleName": "solid-core",
|
|
2815
|
+
"isSystem": true
|
|
2800
2816
|
}
|
|
2801
2817
|
]
|
|
2802
2818
|
},
|
|
@@ -10219,6 +10235,13 @@
|
|
|
10219
10235
|
"isSearchable": true
|
|
10220
10236
|
}
|
|
10221
10237
|
},
|
|
10238
|
+
{
|
|
10239
|
+
"type": "field",
|
|
10240
|
+
"attrs": {
|
|
10241
|
+
"name": "module",
|
|
10242
|
+
"isSearchable": true
|
|
10243
|
+
}
|
|
10244
|
+
},
|
|
10222
10245
|
{
|
|
10223
10246
|
"type": "field",
|
|
10224
10247
|
"attrs": {
|
|
@@ -10313,100 +10336,154 @@
|
|
|
10313
10336
|
},
|
|
10314
10337
|
"children": [
|
|
10315
10338
|
{
|
|
10316
|
-
"type": "
|
|
10339
|
+
"type": "notebook",
|
|
10317
10340
|
"attrs": {
|
|
10318
|
-
"name": "
|
|
10341
|
+
"name": "notebook-1"
|
|
10319
10342
|
},
|
|
10320
10343
|
"children": [
|
|
10321
10344
|
{
|
|
10322
|
-
"type": "
|
|
10345
|
+
"type": "page",
|
|
10323
10346
|
"attrs": {
|
|
10324
|
-
"name": "
|
|
10325
|
-
"label": "
|
|
10326
|
-
"className": "col-6"
|
|
10347
|
+
"name": "page-general",
|
|
10348
|
+
"label": "General"
|
|
10327
10349
|
},
|
|
10328
10350
|
"children": [
|
|
10329
10351
|
{
|
|
10330
|
-
"type": "
|
|
10331
|
-
"attrs": {
|
|
10332
|
-
"name": "scheduleName"
|
|
10333
|
-
}
|
|
10334
|
-
},
|
|
10335
|
-
{
|
|
10336
|
-
"type": "field",
|
|
10352
|
+
"type": "row",
|
|
10337
10353
|
"attrs": {
|
|
10338
|
-
"name": "
|
|
10339
|
-
}
|
|
10354
|
+
"name": "row-general"
|
|
10355
|
+
},
|
|
10356
|
+
"children": [
|
|
10357
|
+
{
|
|
10358
|
+
"type": "column",
|
|
10359
|
+
"attrs": {
|
|
10360
|
+
"name": "group-basic",
|
|
10361
|
+
"label": "Basic",
|
|
10362
|
+
"className": "col-6"
|
|
10363
|
+
},
|
|
10364
|
+
"children": [
|
|
10365
|
+
{
|
|
10366
|
+
"type": "field",
|
|
10367
|
+
"attrs": {
|
|
10368
|
+
"name": "scheduleName"
|
|
10369
|
+
}
|
|
10370
|
+
},
|
|
10371
|
+
{
|
|
10372
|
+
"type": "field",
|
|
10373
|
+
"attrs": {
|
|
10374
|
+
"name": "job"
|
|
10375
|
+
}
|
|
10376
|
+
},
|
|
10377
|
+
{
|
|
10378
|
+
"type": "field",
|
|
10379
|
+
"attrs": {
|
|
10380
|
+
"name": "module"
|
|
10381
|
+
}
|
|
10382
|
+
},
|
|
10383
|
+
{
|
|
10384
|
+
"type": "field",
|
|
10385
|
+
"attrs": {
|
|
10386
|
+
"name": "isActive"
|
|
10387
|
+
}
|
|
10388
|
+
}
|
|
10389
|
+
]
|
|
10390
|
+
},
|
|
10391
|
+
{
|
|
10392
|
+
"type": "column",
|
|
10393
|
+
"attrs": {
|
|
10394
|
+
"name": "group-config",
|
|
10395
|
+
"label": "Configuration",
|
|
10396
|
+
"className": "col-6"
|
|
10397
|
+
},
|
|
10398
|
+
"children": [
|
|
10399
|
+
{
|
|
10400
|
+
"type": "field",
|
|
10401
|
+
"attrs": {
|
|
10402
|
+
"name": "frequency"
|
|
10403
|
+
}
|
|
10404
|
+
},
|
|
10405
|
+
{
|
|
10406
|
+
"type": "field",
|
|
10407
|
+
"attrs": {
|
|
10408
|
+
"name": "startTime"
|
|
10409
|
+
}
|
|
10410
|
+
},
|
|
10411
|
+
{
|
|
10412
|
+
"type": "field",
|
|
10413
|
+
"attrs": {
|
|
10414
|
+
"name": "endTime"
|
|
10415
|
+
}
|
|
10416
|
+
},
|
|
10417
|
+
{
|
|
10418
|
+
"type": "field",
|
|
10419
|
+
"attrs": {
|
|
10420
|
+
"name": "startDate"
|
|
10421
|
+
}
|
|
10422
|
+
},
|
|
10423
|
+
{
|
|
10424
|
+
"type": "field",
|
|
10425
|
+
"attrs": {
|
|
10426
|
+
"name": "endDate"
|
|
10427
|
+
}
|
|
10428
|
+
},
|
|
10429
|
+
{
|
|
10430
|
+
"type": "field",
|
|
10431
|
+
"attrs": {
|
|
10432
|
+
"name": "dayOfWeek"
|
|
10433
|
+
}
|
|
10434
|
+
},
|
|
10435
|
+
{
|
|
10436
|
+
"type": "field",
|
|
10437
|
+
"attrs": {
|
|
10438
|
+
"name": "dayOfMonth"
|
|
10439
|
+
}
|
|
10440
|
+
}
|
|
10441
|
+
]
|
|
10442
|
+
}
|
|
10443
|
+
]
|
|
10340
10444
|
}
|
|
10341
10445
|
]
|
|
10342
10446
|
},
|
|
10343
10447
|
{
|
|
10344
|
-
"type": "
|
|
10448
|
+
"type": "page",
|
|
10345
10449
|
"attrs": {
|
|
10346
|
-
"name": "
|
|
10347
|
-
"label": "
|
|
10348
|
-
"className": "col-6"
|
|
10450
|
+
"name": "page-runtime",
|
|
10451
|
+
"label": "Runtime"
|
|
10349
10452
|
},
|
|
10350
10453
|
"children": [
|
|
10351
10454
|
{
|
|
10352
|
-
"type": "
|
|
10353
|
-
"attrs": {
|
|
10354
|
-
"name": "isActive"
|
|
10355
|
-
}
|
|
10356
|
-
},
|
|
10357
|
-
{
|
|
10358
|
-
"type": "field",
|
|
10359
|
-
"attrs": {
|
|
10360
|
-
"name": "frequency"
|
|
10361
|
-
}
|
|
10362
|
-
},
|
|
10363
|
-
{
|
|
10364
|
-
"type": "field",
|
|
10365
|
-
"attrs": {
|
|
10366
|
-
"name": "startTime"
|
|
10367
|
-
}
|
|
10368
|
-
},
|
|
10369
|
-
{
|
|
10370
|
-
"type": "field",
|
|
10371
|
-
"attrs": {
|
|
10372
|
-
"name": "endTime"
|
|
10373
|
-
}
|
|
10374
|
-
},
|
|
10375
|
-
{
|
|
10376
|
-
"type": "field",
|
|
10377
|
-
"attrs": {
|
|
10378
|
-
"name": "startDate"
|
|
10379
|
-
}
|
|
10380
|
-
},
|
|
10381
|
-
{
|
|
10382
|
-
"type": "field",
|
|
10383
|
-
"attrs": {
|
|
10384
|
-
"name": "endDate"
|
|
10385
|
-
}
|
|
10386
|
-
},
|
|
10387
|
-
{
|
|
10388
|
-
"type": "field",
|
|
10389
|
-
"attrs": {
|
|
10390
|
-
"name": "lastRunAt"
|
|
10391
|
-
}
|
|
10392
|
-
},
|
|
10393
|
-
{
|
|
10394
|
-
"type": "field",
|
|
10395
|
-
"attrs": {
|
|
10396
|
-
"name": "nextRunAt"
|
|
10397
|
-
}
|
|
10398
|
-
},
|
|
10399
|
-
{
|
|
10400
|
-
"type": "field",
|
|
10401
|
-
"attrs": {
|
|
10402
|
-
"name": "dayOfWeek"
|
|
10403
|
-
}
|
|
10404
|
-
},
|
|
10405
|
-
{
|
|
10406
|
-
"type": "field",
|
|
10455
|
+
"type": "row",
|
|
10407
10456
|
"attrs": {
|
|
10408
|
-
"name": "
|
|
10409
|
-
}
|
|
10457
|
+
"name": "row-runtime"
|
|
10458
|
+
},
|
|
10459
|
+
"children": [
|
|
10460
|
+
{
|
|
10461
|
+
"type": "column",
|
|
10462
|
+
"attrs": {
|
|
10463
|
+
"name": "group-runtime",
|
|
10464
|
+
"label": "Execution",
|
|
10465
|
+
"className": "col-12"
|
|
10466
|
+
},
|
|
10467
|
+
"children": [
|
|
10468
|
+
{
|
|
10469
|
+
"type": "field",
|
|
10470
|
+
"attrs": {
|
|
10471
|
+
"name": "lastRunAt",
|
|
10472
|
+
"disabled": true,
|
|
10473
|
+
"readOnly": true
|
|
10474
|
+
}
|
|
10475
|
+
},
|
|
10476
|
+
{
|
|
10477
|
+
"type": "field",
|
|
10478
|
+
"attrs": {
|
|
10479
|
+
"name": "nextRunAt",
|
|
10480
|
+
"disabled": true,
|
|
10481
|
+
"readOnly": true
|
|
10482
|
+
}
|
|
10483
|
+
}
|
|
10484
|
+
]
|
|
10485
|
+
}
|
|
10486
|
+
]
|
|
10410
10487
|
}
|
|
10411
10488
|
]
|
|
10412
10489
|
}
|
|
@@ -12279,5 +12356,6 @@
|
|
|
12279
12356
|
}
|
|
12280
12357
|
],
|
|
12281
12358
|
"checksums": [],
|
|
12282
|
-
"listOfValues": []
|
|
12359
|
+
"listOfValues": [],
|
|
12360
|
+
"scheduledJobs": []
|
|
12283
12361
|
}
|