@solidxai/core 0.1.19-beta.1 → 0.1.19-beta.3
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/CHANGELOG.md +22 -0
- package/dist/commands/run-tests.command.d.ts +3 -3
- package/dist/commands/run-tests.command.d.ts.map +1 -1
- package/dist/commands/run-tests.command.js +5 -5
- package/dist/commands/run-tests.command.js.map +1 -1
- package/dist/controllers/secret.controller.d.ts +24 -0
- package/dist/controllers/secret.controller.d.ts.map +1 -0
- package/dist/controllers/{workflow-secret.controller.js → secret.controller.js} +30 -30
- package/dist/controllers/secret.controller.js.map +1 -0
- package/dist/dtos/{create-workflow-secret.dto.d.ts → create-secret.dto.d.ts} +2 -2
- package/dist/dtos/create-secret.dto.d.ts.map +1 -0
- package/dist/dtos/{create-workflow-secret.dto.js → create-secret.dto.js} +12 -12
- package/dist/dtos/create-secret.dto.js.map +1 -0
- package/dist/dtos/{update-workflow-secret.dto.d.ts → update-secret.dto.d.ts} +2 -2
- package/dist/dtos/update-secret.dto.d.ts.map +1 -0
- package/dist/dtos/{update-workflow-secret.dto.js → update-secret.dto.js} +13 -13
- package/dist/dtos/update-secret.dto.js.map +1 -0
- package/dist/entities/{workflow-secret.entity.d.ts → secret.entity.d.ts} +2 -2
- package/dist/entities/secret.entity.d.ts.map +1 -0
- package/dist/entities/{workflow-secret.entity.js → secret.entity.js} +15 -15
- package/dist/entities/secret.entity.js.map +1 -0
- package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.js +1 -1
- package/dist/helpers/field-crud-managers/PasswordFieldCrudManager.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts +3 -3
- package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts.map +1 -1
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js +5 -5
- package/dist/jobs/database/test-run-queue-subscriber-database.service.js.map +1 -1
- package/dist/repository/{workflow-secret.repository.d.ts → secret.repository.d.ts} +3 -3
- package/dist/repository/secret.repository.d.ts.map +1 -0
- package/dist/repository/{workflow-secret.repository.js → secret.repository.js} +8 -8
- package/dist/repository/secret.repository.js.map +1 -0
- package/dist/seeders/seed-data/solid-core-metadata.json +90 -34
- package/dist/services/chatter-message.service.d.ts +1 -0
- package/dist/services/chatter-message.service.d.ts.map +1 -1
- package/dist/services/chatter-message.service.js +7 -4
- package/dist/services/chatter-message.service.js.map +1 -1
- package/dist/services/crud.service.d.ts +1 -0
- package/dist/services/crud.service.d.ts.map +1 -1
- package/dist/services/crud.service.js +14 -2
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/draft-publish-helper.service.d.ts +1 -0
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -1
- package/dist/services/draft-publish-helper.service.js +28 -3
- package/dist/services/draft-publish-helper.service.js.map +1 -1
- package/dist/services/{workflow-secret.service.d.ts → secret.service.d.ts} +11 -11
- package/dist/services/secret.service.d.ts.map +1 -0
- package/dist/services/{workflow-secret.service.js → secret.service.js} +17 -17
- package/dist/services/secret.service.js.map +1 -0
- package/dist/services/workflow/workflow-runtime.service.d.ts +3 -3
- package/dist/services/workflow/workflow-runtime.service.d.ts.map +1 -1
- package/dist/services/workflow/workflow-runtime.service.js +5 -5
- package/dist/services/workflow/workflow-runtime.service.js.map +1 -1
- package/dist/solid-core.module.js +8 -8
- package/dist/solid-core.module.js.map +1 -1
- package/dist/subscribers/audit.subscriber.d.ts.map +1 -1
- package/dist/subscribers/audit.subscriber.js +1 -1
- package/dist/subscribers/audit.subscriber.js.map +1 -1
- package/package.json +1 -1
- package/sql/cleanup-old-workflow-secret-metadata.mssql.sql +57 -0
- package/sql/cleanup-old-workflow-secret-metadata.postgres.sql +59 -0
- package/src/commands/run-tests.command.ts +3 -3
- package/src/controllers/{workflow-secret.controller.ts → secret.controller.ts} +10 -10
- package/src/dtos/{create-workflow-secret.dto.ts → create-secret.dto.ts} +1 -1
- package/src/dtos/{update-workflow-secret.dto.ts → update-secret.dto.ts} +1 -1
- package/src/entities/{workflow-secret.entity.ts → secret.entity.ts} +2 -2
- package/src/helpers/field-crud-managers/PasswordFieldCrudManager.ts +1 -1
- package/src/index.ts +3 -3
- package/src/jobs/database/test-run-queue-subscriber-database.service.ts +3 -3
- package/src/repository/{workflow-secret.repository.ts → secret.repository.ts} +3 -3
- package/src/seeders/seed-data/solid-core-metadata.json +90 -34
- package/src/services/chatter-message.service.ts +10 -4
- package/src/services/crud.service.ts +21 -2
- package/src/services/draft-publish-helper.service.ts +60 -3
- package/src/services/{workflow-secret.service.ts → secret.service.ts} +18 -18
- package/src/services/workflow/workflow-runtime.service.ts +3 -3
- package/src/solid-core.module.ts +8 -8
- package/src/subscribers/audit.subscriber.ts +2 -1
- package/dist/controllers/workflow-secret.controller.d.ts +0 -24
- package/dist/controllers/workflow-secret.controller.d.ts.map +0 -1
- package/dist/controllers/workflow-secret.controller.js.map +0 -1
- package/dist/dtos/create-workflow-secret.dto.d.ts.map +0 -1
- package/dist/dtos/create-workflow-secret.dto.js.map +0 -1
- package/dist/dtos/update-workflow-secret.dto.d.ts.map +0 -1
- package/dist/dtos/update-workflow-secret.dto.js.map +0 -1
- package/dist/entities/workflow-secret.entity.d.ts.map +0 -1
- package/dist/entities/workflow-secret.entity.js.map +0 -1
- package/dist/repository/workflow-secret.repository.d.ts.map +0 -1
- package/dist/repository/workflow-secret.repository.js.map +0 -1
- package/dist/services/workflow-secret.service.d.ts.map +0 -1
- package/dist/services/workflow-secret.service.js.map +0 -1
|
@@ -3,32 +3,32 @@ import { InjectEntityManager } from '@nestjs/typeorm';
|
|
|
3
3
|
import { ModuleRef } from "@nestjs/core";
|
|
4
4
|
import { EntityManager, In } from 'typeorm';
|
|
5
5
|
import { CRUDService } from 'src/services/crud.service';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { Secret } from '../entities/secret.entity';
|
|
7
|
+
import { SecretRepository } from '../repository/secret.repository';
|
|
8
8
|
import { EncryptionService } from './encryption.service';
|
|
9
9
|
|
|
10
10
|
const MASKED_SECRET_VALUE = "********";
|
|
11
11
|
|
|
12
12
|
@Injectable()
|
|
13
|
-
export class
|
|
14
|
-
private readonly logger = new Logger(
|
|
13
|
+
export class SecretService extends CRUDService<Secret> {
|
|
14
|
+
private readonly logger = new Logger(SecretService.name);
|
|
15
15
|
private readonly encryptionService: EncryptionService | null;
|
|
16
16
|
|
|
17
17
|
constructor(
|
|
18
18
|
@InjectEntityManager("default")
|
|
19
19
|
readonly entityManager: EntityManager,
|
|
20
|
-
readonly repo:
|
|
20
|
+
readonly repo: SecretRepository,
|
|
21
21
|
readonly moduleRef: ModuleRef,
|
|
22
22
|
) {
|
|
23
|
-
super(entityManager, repo, '
|
|
23
|
+
super(entityManager, repo, 'secret', 'solid-core', moduleRef);
|
|
24
24
|
const encKey = process.env.APP_ENCRYPTION_KEY;
|
|
25
25
|
this.encryptionService = encKey ? new EncryptionService(encKey) : null;
|
|
26
26
|
if (!encKey) {
|
|
27
|
-
this.logger.warn('APP_ENCRYPTION_KEY is not set —
|
|
27
|
+
this.logger.warn('APP_ENCRYPTION_KEY is not set — secrets cannot be encrypted or decrypted');
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
async create(createDto: any, files: Express.Multer.File[] = [], solidRequestContext: any = {}): Promise<
|
|
31
|
+
async create(createDto: any, files: Express.Multer.File[] = [], solidRequestContext: any = {}): Promise<Secret> {
|
|
32
32
|
const preparedDto = this.prepareSecretForSave(createDto, true);
|
|
33
33
|
const saved = await super.create(preparedDto, files, solidRequestContext);
|
|
34
34
|
return this.maskSecret(saved);
|
|
@@ -41,13 +41,13 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
41
41
|
isPartialUpdate = false,
|
|
42
42
|
solidRequestContext: any = {},
|
|
43
43
|
isUpdate = false,
|
|
44
|
-
): Promise<
|
|
44
|
+
): Promise<Secret> {
|
|
45
45
|
const preparedDto = this.prepareSecretForSave(updateDto, false);
|
|
46
46
|
const saved = await super.update(id, preparedDto, files, isPartialUpdate, solidRequestContext, isUpdate);
|
|
47
47
|
return this.maskSecret(saved);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
async createMany(createDtos: any[], solidRequestContext: any = {}): Promise<
|
|
50
|
+
async createMany(createDtos: any[], solidRequestContext: any = {}): Promise<Secret[]> {
|
|
51
51
|
const preparedDtos = createDtos.map((dto) => this.prepareSecretForSave(dto, true));
|
|
52
52
|
const saved = await super.createMany(preparedDtos, solidRequestContext);
|
|
53
53
|
return saved.map((secret) => this.maskSecret(secret));
|
|
@@ -57,7 +57,7 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
57
57
|
const response = await super.find(basicFilterDto, solidRequestContext);
|
|
58
58
|
return {
|
|
59
59
|
...response,
|
|
60
|
-
records: (response.records ?? []).map((secret:
|
|
60
|
+
records: (response.records ?? []).map((secret: Secret) => this.maskSecret(secret)),
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
66
66
|
return this.maskSecret(secret);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
async
|
|
69
|
+
async getSecretsContext(): Promise<Record<string, any>> {
|
|
70
70
|
const secrets = await this.repo.find({
|
|
71
71
|
where: { status: "active" } as any,
|
|
72
72
|
});
|
|
@@ -77,7 +77,7 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
77
77
|
this.assignSecretPath(context, secret.key, this.decryptAndCoerce(secret));
|
|
78
78
|
secret.lastAccessedAt = new Date();
|
|
79
79
|
} catch (error) {
|
|
80
|
-
this.logger.warn(`Failed to resolve
|
|
80
|
+
this.logger.warn(`Failed to resolve secret "${secret.key}": ${error instanceof Error ? error.message : String(error)}`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
@@ -153,7 +153,7 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
153
153
|
const hasNewValue = rawValue !== undefined && rawValue !== null && rawValue !== MASKED_SECRET_VALUE;
|
|
154
154
|
|
|
155
155
|
if (requireValue && !hasNewValue) {
|
|
156
|
-
throw new BadRequestException('
|
|
156
|
+
throw new BadRequestException('Secret value is required.');
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
if (hasNewValue) {
|
|
@@ -168,15 +168,15 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
168
168
|
|
|
169
169
|
private encrypt(value: string): string {
|
|
170
170
|
if (!this.encryptionService) {
|
|
171
|
-
throw new BadRequestException('APP_ENCRYPTION_KEY must be set before
|
|
171
|
+
throw new BadRequestException('APP_ENCRYPTION_KEY must be set before secrets can be saved.');
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
return this.encryptionService.isEncrypted(value) ? value : this.encryptionService.encrypt(value);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
private decryptAndCoerce(secret:
|
|
177
|
+
private decryptAndCoerce(secret: Secret): any {
|
|
178
178
|
if (!this.encryptionService) {
|
|
179
|
-
throw new BadRequestException('APP_ENCRYPTION_KEY must be set before
|
|
179
|
+
throw new BadRequestException('APP_ENCRYPTION_KEY must be set before secrets can be used.');
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
const decryptedValue = this.encryptionService.decrypt(secret.value);
|
|
@@ -211,7 +211,7 @@ export class WorkflowSecretService extends CRUDService<WorkflowSecret> {
|
|
|
211
211
|
cursor[parts[parts.length - 1]] = value;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
private maskSecret(secret:
|
|
214
|
+
private maskSecret(secret: Secret): Secret {
|
|
215
215
|
if (secret) {
|
|
216
216
|
secret.value = MASKED_SECRET_VALUE;
|
|
217
217
|
}
|
|
@@ -15,7 +15,7 @@ import { WorkflowExecutionWriterService } from './workflow-execution-writer.serv
|
|
|
15
15
|
import { WorkflowExpressionService } from './workflow-expression.service';
|
|
16
16
|
import { WorkflowDefinitionValidatorService } from './workflow-definition-validator.service';
|
|
17
17
|
import { WorkflowNodeRegistryService } from './workflow-node-registry.service';
|
|
18
|
-
import {
|
|
18
|
+
import { SecretService } from '../secret.service';
|
|
19
19
|
import { PublisherFactory } from '../queues/publisher-factory.service';
|
|
20
20
|
import { WorkflowExecutionQueuePayload } from '../../types/workflow-execution-queue.types';
|
|
21
21
|
import YAML from 'yaml';
|
|
@@ -31,7 +31,7 @@ export class WorkflowRuntimeService {
|
|
|
31
31
|
private readonly expression: WorkflowExpressionService,
|
|
32
32
|
private readonly writer: WorkflowExecutionWriterService,
|
|
33
33
|
private readonly validator: WorkflowDefinitionValidatorService,
|
|
34
|
-
private readonly
|
|
34
|
+
private readonly secretService: SecretService,
|
|
35
35
|
private readonly workflowExecutionPublisherFactory: PublisherFactory<WorkflowExecutionQueuePayload>,
|
|
36
36
|
) {}
|
|
37
37
|
|
|
@@ -150,7 +150,7 @@ export class WorkflowRuntimeService {
|
|
|
150
150
|
|
|
151
151
|
const definitionDsl = this.assertDefinitionYaml(definition.definitionYaml);
|
|
152
152
|
this.validator.validate(definitionDsl);
|
|
153
|
-
const secrets = await this.
|
|
153
|
+
const secrets = await this.secretService.getSecretsContext();
|
|
154
154
|
const input = this.resolveWorkflowInput(definitionDsl, request, secrets);
|
|
155
155
|
const variables = this.resolveWorkflowVariables(definitionDsl, request, input, secrets);
|
|
156
156
|
const effectiveRequest: WorkflowExecutionRequest = {
|
package/src/solid-core.module.ts
CHANGED
|
@@ -419,14 +419,14 @@ import { WorkflowStepExecution } from './entities/workflow-step-execution.entity
|
|
|
419
419
|
import { WorkflowExecutionLog } from './entities/workflow-execution-log.entity';
|
|
420
420
|
import { WorkflowExecutionArtifact } from './entities/workflow-execution-artifact.entity';
|
|
421
421
|
import { WorkflowTriggerExecution } from './entities/workflow-trigger-execution.entity';
|
|
422
|
-
import {
|
|
422
|
+
import { Secret } from './entities/secret.entity';
|
|
423
423
|
import { WorkflowDefinitionController } from './controllers/workflow-definition.controller';
|
|
424
424
|
import { WorkflowExecutionController } from './controllers/workflow-execution.controller';
|
|
425
425
|
import { WorkflowStepExecutionController } from './controllers/workflow-step-execution.controller';
|
|
426
426
|
import { WorkflowExecutionLogController } from './controllers/workflow-execution-log.controller';
|
|
427
427
|
import { WorkflowExecutionArtifactController } from './controllers/workflow-execution-artifact.controller';
|
|
428
428
|
import { WorkflowTriggerExecutionController } from './controllers/workflow-trigger-execution.controller';
|
|
429
|
-
import {
|
|
429
|
+
import { SecretController } from './controllers/secret.controller';
|
|
430
430
|
import { WorkflowDefinitionService } from './services/workflow-definition.service';
|
|
431
431
|
import { WorkflowDefinitionMetadataSyncService } from './services/workflow/workflow-definition-metadata-sync.service';
|
|
432
432
|
import { WorkflowExecutionService } from './services/workflow-execution.service';
|
|
@@ -434,14 +434,14 @@ import { WorkflowStepExecutionService } from './services/workflow-step-execution
|
|
|
434
434
|
import { WorkflowExecutionLogService } from './services/workflow-execution-log.service';
|
|
435
435
|
import { WorkflowExecutionArtifactService } from './services/workflow-execution-artifact.service';
|
|
436
436
|
import { WorkflowTriggerExecutionService } from './services/workflow-trigger-execution.service';
|
|
437
|
-
import {
|
|
437
|
+
import { SecretService } from './services/secret.service';
|
|
438
438
|
import { WorkflowDefinitionRepository } from './repository/workflow-definition.repository';
|
|
439
439
|
import { WorkflowExecutionRepository } from './repository/workflow-execution.repository';
|
|
440
440
|
import { WorkflowStepExecutionRepository } from './repository/workflow-step-execution.repository';
|
|
441
441
|
import { WorkflowExecutionLogRepository } from './repository/workflow-execution-log.repository';
|
|
442
442
|
import { WorkflowExecutionArtifactRepository } from './repository/workflow-execution-artifact.repository';
|
|
443
443
|
import { WorkflowTriggerExecutionRepository } from './repository/workflow-trigger-execution.repository';
|
|
444
|
-
import {
|
|
444
|
+
import { SecretRepository } from './repository/secret.repository';
|
|
445
445
|
import { WorkflowDefinitionValidatorService } from './services/workflow/workflow-definition-validator.service';
|
|
446
446
|
import { WorkflowExecutionWriterService } from './services/workflow/workflow-execution-writer.service';
|
|
447
447
|
import { WorkflowExpressionService } from './services/workflow/workflow-expression.service';
|
|
@@ -517,7 +517,7 @@ import { SwitchNode } from './services/workflow/nodes/switch.node';
|
|
|
517
517
|
WorkflowExecutionLog,
|
|
518
518
|
WorkflowExecutionArtifact,
|
|
519
519
|
WorkflowTriggerExecution,
|
|
520
|
-
|
|
520
|
+
Secret,
|
|
521
521
|
]),
|
|
522
522
|
|
|
523
523
|
CacheModule.registerAsync(CacheManagerOptions),
|
|
@@ -653,7 +653,7 @@ import { SwitchNode } from './services/workflow/nodes/switch.node';
|
|
|
653
653
|
WorkflowExecutionLogController,
|
|
654
654
|
WorkflowExecutionArtifactController,
|
|
655
655
|
WorkflowTriggerExecutionController,
|
|
656
|
-
|
|
656
|
+
SecretController,
|
|
657
657
|
],
|
|
658
658
|
providers: [
|
|
659
659
|
{
|
|
@@ -984,8 +984,8 @@ import { SwitchNode } from './services/workflow/nodes/switch.node';
|
|
|
984
984
|
WorkflowExecutionArtifactRepository,
|
|
985
985
|
WorkflowTriggerExecutionService,
|
|
986
986
|
WorkflowTriggerExecutionRepository,
|
|
987
|
-
|
|
988
|
-
|
|
987
|
+
SecretService,
|
|
988
|
+
SecretRepository,
|
|
989
989
|
WorkflowInvocationService,
|
|
990
990
|
WorkflowRuntimeService,
|
|
991
991
|
WorkflowExecutionWriterService,
|
|
@@ -113,7 +113,8 @@ export class AuditSubscriber implements EntitySubscriberInterface {
|
|
|
113
113
|
(relationAfter as any)[field.name] = await event.queryRunner.manager
|
|
114
114
|
.createQueryBuilder()
|
|
115
115
|
.relation(event.metadata.target as any, field.name)
|
|
116
|
-
.
|
|
116
|
+
// Entity, not scalar id — see CRUDService.prepareManyToManyAuditSnapshot.
|
|
117
|
+
.of(relationAfter)
|
|
117
118
|
.loadMany();
|
|
118
119
|
}
|
|
119
120
|
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { WorkflowSecretService } from '../services/workflow-secret.service';
|
|
2
|
-
import { CreateWorkflowSecretDto } from '../dtos/create-workflow-secret.dto';
|
|
3
|
-
import { UpdateWorkflowSecretDto } from '../dtos/update-workflow-secret.dto';
|
|
4
|
-
export declare class WorkflowSecretController {
|
|
5
|
-
private readonly service;
|
|
6
|
-
constructor(service: WorkflowSecretService);
|
|
7
|
-
create(createDto: CreateWorkflowSecretDto, files: Array<Express.Multer.File>): Promise<import("..").WorkflowSecret>;
|
|
8
|
-
insertMany(createDtos: CreateWorkflowSecretDto[], filesArray?: Express.Multer.File[][]): Promise<import("..").WorkflowSecret[]>;
|
|
9
|
-
update(id: number, updateDto: UpdateWorkflowSecretDto, files: Array<Express.Multer.File>): Promise<import("..").WorkflowSecret>;
|
|
10
|
-
partialUpdate(id: number, updateDto: UpdateWorkflowSecretDto, files: Array<Express.Multer.File>): Promise<import("..").WorkflowSecret>;
|
|
11
|
-
recoverMany(ids: number[]): Promise<{
|
|
12
|
-
message: string;
|
|
13
|
-
recoveredIds: number[];
|
|
14
|
-
}>;
|
|
15
|
-
recover(id: number): Promise<{
|
|
16
|
-
message: string;
|
|
17
|
-
data: import("..").WorkflowSecret;
|
|
18
|
-
}>;
|
|
19
|
-
findMany(query: any): Promise<any>;
|
|
20
|
-
findOne(id: string, query: any): Promise<import("..").WorkflowSecret>;
|
|
21
|
-
deleteMany(ids: number[]): Promise<any>;
|
|
22
|
-
delete(id: number): Promise<import("..").WorkflowSecret[]>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=workflow-secret.controller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/workflow-secret.controller.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAA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AE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC3D,IAAA,YAAG,GAAE;;IACU,WAAA,IAAA,cAAK,GAAE,CAAA;;;;wDAEtB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,YAAG,EAAC,KAAK,CAAC;;IACI,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IAAc,WAAA,IAAA,cAAK,GAAE,CAAA;;;;uDAE9C;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,OAAO,CAAC;;IACE,WAAA,IAAA,aAAI,GAAE,CAAA;;;;0DAEvB;AAIK;IAFL,IAAA,uBAAa,EAAC,KAAK,CAAC;IACpB,IAAA,eAAM,EAAC,KAAK,CAAC;;IACA,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;sDAExB;mCA1EU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,YAAY,CAAC;IACrB,IAAA,mBAAU,EAAC,iBAAiB,CAAC;qCAEU,+CAAqB;GADhD,wBAAwB,CA2EpC","sourcesContent":["import { Controller, Post, Body, Param, UploadedFiles, UseInterceptors, Put, Get, Query, Delete, Patch } from '@nestjs/common';\nimport { AnyFilesInterceptor } from \"@nestjs/platform-express\";\nimport { ApiBearerAuth, ApiQuery, ApiTags } from '@nestjs/swagger';\nimport { WorkflowSecretService } from '../services/workflow-secret.service';\nimport { CreateWorkflowSecretDto } from '../dtos/create-workflow-secret.dto';\nimport { UpdateWorkflowSecretDto } from '../dtos/update-workflow-secret.dto';\n\nimport { ShowSoftDeleted } from '../enums/show-soft-deleted.enum';\n\n@ApiTags('Solid Core')\n@Controller('workflow-secret')\nexport class WorkflowSecretController {\n constructor(private readonly service: WorkflowSecretService) {}\n\n @ApiBearerAuth(\"jwt\")\n @Post()\n @UseInterceptors(AnyFilesInterceptor())\n create(@Body() createDto: CreateWorkflowSecretDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.create(createDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk')\n @UseInterceptors(AnyFilesInterceptor())\n insertMany(@Body() createDtos: CreateWorkflowSecretDto[], @UploadedFiles() filesArray: Express.Multer.File[][] = []) {\n return this.service.insertMany(createDtos, filesArray);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Put(':id')\n @UseInterceptors(AnyFilesInterceptor())\n update(@Param('id') id: number, @Body() updateDto: UpdateWorkflowSecretDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Patch(':id')\n @UseInterceptors(AnyFilesInterceptor())\n partialUpdate(@Param('id') id: number, @Body() updateDto: UpdateWorkflowSecretDto, @UploadedFiles() files: Array<Express.Multer.File>) {\n return this.service.update(id, updateDto, files, true);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Post('/bulk-recover')\n async recoverMany(@Body() ids: number[]) {\n return this.service.recoverMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get('/recover/:id')\n async recover(@Param('id') id: number) {\n return this.service.recover(id);\n }\n\n @ApiBearerAuth(\"jwt\")\n @ApiQuery({ name: 'showSoftDeleted', required: false, enum: ShowSoftDeleted })\n @ApiQuery({ name: 'limit', required: false, type: Number })\n @ApiQuery({ name: 'offset', required: false, type: Number })\n @ApiQuery({ name: 'fields', required: false, type: Array })\n @ApiQuery({ name: 'sort', required: false, type: Array })\n @ApiQuery({ name: 'groupBy', required: false, type: Array })\n @ApiQuery({ name: 'populate', required: false, type: Array })\n @ApiQuery({ name: 'populateMedia', required: false, type: Array })\n @ApiQuery({ name: 'filters', required: false, type: Array })\n @Get()\n async findMany(@Query() query: any) {\n return this.service.find(query);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Get(':id')\n async findOne(@Param('id') id: string, @Query() query: any) {\n return this.service.findOne(+id, query);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete('/bulk')\n async deleteMany(@Body() ids: number[]) {\n return this.service.deleteMany(ids);\n }\n\n @ApiBearerAuth(\"jwt\")\n @Delete(':id')\n async delete(@Param('id') id: number) {\n return this.service.delete(id);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-workflow-secret.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/create-workflow-secret.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,uBAAuB;IAIhC,GAAG,EAAE,MAAM,CAAC;IAKZ,WAAW,EAAE,MAAM,CAAC;IAKpB,WAAW,EAAE,MAAM,CAAC;IAKpB,KAAK,EAAE,MAAM,CAAC;IAKd,SAAS,EAAE,MAAM,CAAY;IAK7B,MAAM,EAAE,MAAM,CAAY;IAK1B,aAAa,EAAE,IAAI,CAAC;IAKpB,cAAc,EAAE,IAAI,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-workflow-secret.dto.js","sourceRoot":"","sources":["../../src/dtos/create-workflow-secret.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAA2E;AAE3E,MAAa,uBAAuB;IAApC;QAwBI,cAAS,GAAW,QAAQ,CAAC;QAK7B,WAAM,GAAW,QAAQ,CAAC;KAW7B;;;;CAAA;AAxCD,0DAwCC;AApCG;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE,CAAC;;oDAC/F;AAKZ;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;4DAC5D;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;;4DACpE;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;;sDACpF;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uEAAuE,EAAE,CAAC;;0DACzE;AAK7B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;uDAC/B;AAK1B;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;8BACpD,IAAI;8DAAC;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;8BACxE,IAAI;+DAAC","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsNotEmpty, IsOptional, IsString, IsDate } from 'class-validator';\n\nexport class CreateWorkflowSecretDto {\n @IsNotEmpty()\n @IsString()\n @ApiProperty({ description: \"Global secret key used in workflow expressions, for example smtp.password.\" })\n key: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty({ description: \"Human-facing secret name shown in the admin UI.\" })\n displayName: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Operational notes describing where this secret is used.\" })\n description: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty({ description: \"Plain value supplied by an admin. It is encrypted before storage.\" })\n value: string;\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty({ description: \"How the decrypted value should be coerced for workflow runtime usage.\" })\n valueType: string = \"string\";\n\n @IsNotEmpty()\n @IsString()\n @ApiProperty({ description: \"Secret lifecycle status.\" })\n status: string = \"active\";\n\n @IsOptional()\n @IsDate()\n @ApiProperty({ description: \"When this secret was last rotated.\" })\n lastRotatedAt: Date;\n\n @IsOptional()\n @IsDate()\n @ApiProperty({ description: \"When this secret was last resolved by workflow runtime.\" })\n lastAccessedAt: Date;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-workflow-secret.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/update-workflow-secret.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,uBAAuB;IAGhC,EAAE,EAAE,MAAM,CAAC;IAMX,GAAG,EAAE,MAAM,CAAC;IAMZ,WAAW,EAAE,MAAM,CAAC;IAKpB,WAAW,EAAE,MAAM,CAAC;IAMpB,KAAK,EAAE,MAAM,CAAC;IAMd,SAAS,EAAE,MAAM,CAAC;IAMlB,MAAM,EAAE,MAAM,CAAC;IAKf,aAAa,EAAE,IAAI,CAAC;IAKpB,cAAc,EAAE,IAAI,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-workflow-secret.dto.js","sourceRoot":"","sources":["../../src/dtos/update-workflow-secret.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAkF;AAElF,MAAa,uBAAuB;;;;CAiDnC;AAjDD,0DAiDC;AA9CG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;mDACG;AAMX;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4EAA4E,EAAE,CAAC;;oDAC/F;AAMZ;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,CAAC;;4DAC5D;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;;4DACpE;AAMpB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;;sDACpF;AAMd;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uEAAuE,EAAE,CAAC;;0DACpF;AAMlB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;uDAC1C;AAKf;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;8BACpD,IAAI;8DAAC;AAKpB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;8BACxE,IAAI;+DAAC","sourcesContent":["import { ApiProperty } from '@nestjs/swagger';\nimport { IsInt, IsOptional, IsString, IsNotEmpty, IsDate } from 'class-validator';\n\nexport class UpdateWorkflowSecretDto {\n @IsOptional()\n @IsInt()\n id: number;\n\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Global secret key used in workflow expressions, for example smtp.password.\" })\n key: string;\n\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Human-facing secret name shown in the admin UI.\" })\n displayName: string;\n\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Operational notes describing where this secret is used.\" })\n description: string;\n\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Plain value supplied by an admin. It is encrypted before storage.\" })\n value: string;\n\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"How the decrypted value should be coerced for workflow runtime usage.\" })\n valueType: string;\n\n @IsNotEmpty()\n @IsOptional()\n @IsString()\n @ApiProperty({ description: \"Secret lifecycle status.\" })\n status: string;\n\n @IsOptional()\n @IsDate()\n @ApiProperty({ description: \"When this secret was last rotated.\" })\n lastRotatedAt: Date;\n\n @IsOptional()\n @IsDate()\n @ApiProperty({ description: \"When this secret was last resolved by workflow runtime.\" })\n lastAccessedAt: Date;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1D,qBACa,cAAe,SAAQ,YAAY;IAG5C,GAAG,EAAE,MAAM,CAAC;IAIZ,WAAW,EAAE,MAAM,CAAC;IAGpB,WAAW,EAAE,MAAM,CAAC;IAGpB,KAAK,EAAE,MAAM,CAAC;IAId,SAAS,EAAE,MAAM,CAAY;IAI7B,MAAM,EAAE,MAAM,CAAY;IAG1B,aAAa,EAAE,IAAI,CAAC;IAGpB,cAAc,EAAE,IAAI,CAAC;CACxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgD;AAChD,oEAA8D;AAGvD,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAAzC;;QAiBH,cAAS,GAAW,QAAQ,CAAC;QAI7B,WAAM,GAAW,QAAQ,CAAC;KAO7B;;;;CAAA,CAAA;AA5BY,wCAAc;AAGvB;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2CAChB;AAIZ;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mDACR;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrB;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CACX;AAId;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;iDAClB;AAI7B;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;;8CACrB;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BAC1C,IAAI;qDAAC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BACzC,IAAI;sDAAC;yBA3BZ,cAAc;IAD1B,IAAA,gBAAM,EAAC,oBAAoB,CAAC;GAChB,cAAc,CA4B1B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index } from 'typeorm';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_secret')\nexport class WorkflowSecret extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n key: string;\n\n @Index()\n @Column({ type: \"varchar\" })\n displayName: string;\n\n @Column({ type: \"text\", nullable: true })\n description: string;\n\n @Column({ type: \"text\" })\n value: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"string\" })\n valueType: string = \"string\";\n\n @Index()\n @Column({ type: \"varchar\", default: \"active\" })\n status: string = \"active\";\n\n @Column({ nullable: true, ...getColumnType('datetime') })\n lastRotatedAt: Date;\n\n @Column({ nullable: true, ...getColumnType('datetime') })\n lastAccessedAt: Date;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.repository.d.ts","sourceRoot":"","sources":["../../src/repository/workflow-secret.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,qBACa,wBAAyB,SAAQ,mBAAmB,CAAC,cAAc,CAAC;IAGzE,QAAQ,CAAC,UAAU,EAAE,UAAU;IAC/B,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB;IACrD,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB;gBAF9C,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB;CAI9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.repository.js","sourceRoot":"","sources":["../../src/repository/workflow-secret.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAAoE;AACpE,mEAA8D;AAC9D,iFAA6E;AAC7E,qCAAqC;AACrC,6CAAmD;AACnD,+EAAoE;AAG7D,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,2CAAmC;IAC7E,YAEa,UAAsB,EACtB,qBAA4C,EAC5C,sBAA8C;QAEvD,KAAK,CAAC,uCAAc,EAAE,UAAU,EAAE,qBAAqB,EAAE,sBAAsB,CAAC,CAAC;QAJxE,eAAU,GAAV,UAAU,CAAY;QACtB,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,2BAAsB,GAAtB,sBAAsB,CAAwB;IAG3D,CAAC;CACJ,CAAA;AATY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,0BAAgB,EAAC,SAAS,CAAC,CAAA;qCACP,oBAAU;QACC,+CAAqB;QACpB,iDAAsB;GALlD,wBAAwB,CASpC","sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { SecurityRuleRepository } from './security-rule.repository';\nimport { SolidBaseRepository } from './solid-base.repository';\nimport { RequestContextService } from 'src/services/request-context.service';\nimport { DataSource } from 'typeorm';\nimport { InjectDataSource } from '@nestjs/typeorm';\nimport { WorkflowSecret } from '../entities/workflow-secret.entity';\n\n@Injectable()\nexport class WorkflowSecretRepository extends SolidBaseRepository<WorkflowSecret> {\n constructor(\n @InjectDataSource(\"default\")\n readonly dataSource: DataSource,\n readonly requestContextService: RequestContextService,\n readonly securityRuleRepository: SecurityRuleRepository,\n ) {\n super(WorkflowSecret, dataSource, requestContextService, securityRuleRepository);\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.service.d.ts","sourceRoot":"","sources":["../../src/services/workflow-secret.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAM,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA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AAC,CAAC,EAAE,CAAC;YACpF,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAC1C,CAAC;IAEO,UAAU,CAAC,MAAsB;QACvC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,KAAK,GAAG,mBAAmB,CAAC;QACrC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AA/MY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,6BAAmB,EAAC,SAAS,CAAC,CAAA;qCACP,uBAAa;QACtB,qDAAwB;QACnB,gBAAS;GARpB,qBAAqB,CA+MjC","sourcesContent":["import { BadRequestException, Injectable, Logger, NotFoundException } from '@nestjs/common';\nimport { InjectEntityManager } from '@nestjs/typeorm';\nimport { ModuleRef } from \"@nestjs/core\";\nimport { EntityManager, In } from 'typeorm';\nimport { CRUDService } from 'src/services/crud.service';\nimport { WorkflowSecret } from '../entities/workflow-secret.entity';\nimport { WorkflowSecretRepository } from '../repository/workflow-secret.repository';\nimport { EncryptionService } from './encryption.service';\n\nconst MASKED_SECRET_VALUE = \"********\";\n\n@Injectable()\nexport class WorkflowSecretService extends CRUDService<WorkflowSecret> {\n private readonly logger = new Logger(WorkflowSecretService.name);\n private readonly encryptionService: EncryptionService | null;\n\n constructor(\n @InjectEntityManager(\"default\")\n readonly entityManager: EntityManager,\n readonly repo: WorkflowSecretRepository,\n readonly moduleRef: ModuleRef,\n ) {\n super(entityManager, repo, 'workflowSecret', 'solid-core', moduleRef);\n const encKey = process.env.APP_ENCRYPTION_KEY;\n this.encryptionService = encKey ? new EncryptionService(encKey) : null;\n if (!encKey) {\n this.logger.warn('APP_ENCRYPTION_KEY is not set — workflow secrets cannot be encrypted or decrypted');\n }\n }\n\n async create(createDto: any, files: Express.Multer.File[] = [], solidRequestContext: any = {}): Promise<WorkflowSecret> {\n const preparedDto = this.prepareSecretForSave(createDto, true);\n const saved = await super.create(preparedDto, files, solidRequestContext);\n return this.maskSecret(saved);\n }\n\n async update(\n id: number,\n updateDto: any,\n files: Express.Multer.File[] = [],\n isPartialUpdate = false,\n solidRequestContext: any = {},\n isUpdate = false,\n ): Promise<WorkflowSecret> {\n const preparedDto = this.prepareSecretForSave(updateDto, false);\n const saved = await super.update(id, preparedDto, files, isPartialUpdate, solidRequestContext, isUpdate);\n return this.maskSecret(saved);\n }\n\n async createMany(createDtos: any[], solidRequestContext: any = {}): Promise<WorkflowSecret[]> {\n const preparedDtos = createDtos.map((dto) => this.prepareSecretForSave(dto, true));\n const saved = await super.createMany(preparedDtos, solidRequestContext);\n return saved.map((secret) => this.maskSecret(secret));\n }\n\n async find(basicFilterDto: any, solidRequestContext: any = {}): Promise<any> {\n const response = await super.find(basicFilterDto, solidRequestContext);\n return {\n ...response,\n records: (response.records ?? []).map((secret: WorkflowSecret) => this.maskSecret(secret)),\n };\n }\n\n async findOne(id: number, query: any = {}, solidRequestContext: any = {}) {\n const secret = await super.findOne(id, query, solidRequestContext);\n return this.maskSecret(secret);\n }\n\n async getWorkflowSecretsContext(): Promise<Record<string, any>> {\n const secrets = await this.repo.find({\n where: { status: \"active\" } as any,\n });\n\n const context: Record<string, any> = {};\n for (const secret of secrets) {\n try {\n this.assignSecretPath(context, secret.key, this.decryptAndCoerce(secret));\n secret.lastAccessedAt = new Date();\n } catch (error) {\n this.logger.warn(`Failed to resolve workflow secret \"${secret.key}\": ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n if (secrets.length > 0) {\n await this.repo.save(secrets);\n }\n\n return context;\n }\n\n /**\n * Resolves one secret to its decrypted, type-coerced value.\n *\n * `key` is the literal key column value — \"smtp.password\" is one row, not a path.\n * Callers must resolve at point of use and must not cache the result.\n */\n async resolve(key: string): Promise<any> {\n const resolved = await this.resolveMany([key]);\n return resolved[key];\n }\n\n /**\n * Resolves whatever of `keys` exists and is active, in a single query, omitting the\n * rest. Returns a flat map keyed by the literal keys requested.\n *\n * For callers that can report a missing key better than this service can — the test\n * runner lets an unresolved key surface at the step that references it, which names\n * the token and locates the failure. Prefer resolveMany elsewhere.\n *\n * Still fail-closed on infrastructure: an absent APP_ENCRYPTION_KEY or a failed\n * decrypt throws rather than yielding a partial map.\n */\n async resolveAvailable(keys: string[]): Promise<Record<string, any>> {\n const uniqueKeys = Array.from(new Set((keys ?? []).filter(Boolean)));\n if (uniqueKeys.length === 0) {\n return {};\n }\n\n const secrets = await this.repo.find({\n where: { key: In(uniqueKeys), status: \"active\" } as any,\n });\n\n return secrets.reduce((resolved, secret) => {\n resolved[secret.key] = this.decryptAndCoerce(secret);\n return resolved;\n }, {} as Record<string, any>);\n }\n\n /**\n * Resolves several secrets in a single query, returning a flat map keyed by the\n * literal keys requested.\n *\n * Fail-closed: throws for a key that is missing, inactive or undecryptable rather\n * than omitting it from the result. A credential that silently resolves to undefined\n * becomes an empty password on an outbound request.\n */\n async resolveMany(keys: string[]): Promise<Record<string, any>> {\n const resolved = await this.resolveAvailable(keys);\n\n const missing = Array.from(new Set((keys ?? []).filter(Boolean))).filter(\n (key) => !(key in resolved),\n );\n if (missing.length > 0) {\n throw new NotFoundException(`No active secret found for: ${missing.join(', ')}`);\n }\n\n return resolved;\n }\n\n private prepareSecretForSave(dto: any, requireValue: boolean): any {\n const preparedDto = { ...dto };\n const rawValue = preparedDto.value;\n const hasNewValue = rawValue !== undefined && rawValue !== null && rawValue !== MASKED_SECRET_VALUE;\n\n if (requireValue && !hasNewValue) {\n throw new BadRequestException('Workflow secret value is required.');\n }\n\n if (hasNewValue) {\n preparedDto.value = this.encrypt(String(rawValue));\n preparedDto.lastRotatedAt = new Date();\n } else {\n delete preparedDto.value;\n }\n\n return preparedDto;\n }\n\n private encrypt(value: string): string {\n if (!this.encryptionService) {\n throw new BadRequestException('APP_ENCRYPTION_KEY must be set before workflow secrets can be saved.');\n }\n\n return this.encryptionService.isEncrypted(value) ? value : this.encryptionService.encrypt(value);\n }\n\n private decryptAndCoerce(secret: WorkflowSecret): any {\n if (!this.encryptionService) {\n throw new BadRequestException('APP_ENCRYPTION_KEY must be set before workflow secrets can be used.');\n }\n\n const decryptedValue = this.encryptionService.decrypt(secret.value);\n switch (secret.valueType) {\n case 'json':\n return JSON.parse(decryptedValue);\n case 'number':\n return Number(decryptedValue);\n case 'boolean':\n return decryptedValue === 'true' || decryptedValue === '1';\n case 'string':\n default:\n return decryptedValue;\n }\n }\n\n private assignSecretPath(target: Record<string, any>, key: string, value: any): void {\n const parts = String(key)\n .split('.')\n .map((part) => part.trim())\n .filter(Boolean);\n\n if (parts.length === 0) {\n return;\n }\n\n let cursor = target;\n parts.slice(0, -1).forEach((part) => {\n cursor[part] = cursor[part] && typeof cursor[part] === 'object' ? cursor[part] : {};\n cursor = cursor[part];\n });\n cursor[parts[parts.length - 1]] = value;\n }\n\n private maskSecret(secret: WorkflowSecret): WorkflowSecret {\n if (secret) {\n secret.value = MASKED_SECRET_VALUE;\n }\n return secret;\n }\n}\n"]}
|