@solidxai/core 0.1.19-beta.2 → 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 +11 -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 +32 -32
- 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 +13 -1
- package/dist/services/crud.service.js.map +1 -1
- package/dist/services/draft-publish-helper.service.d.ts.map +1 -1
- package/dist/services/draft-publish-helper.service.js +8 -6
- 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/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 +32 -32
- package/src/services/crud.service.ts +18 -1
- package/src/services/draft-publish-helper.service.ts +14 -9
- 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/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
|
@@ -2,8 +2,8 @@ import { CommonEntity } from 'src/entities/common.entity';
|
|
|
2
2
|
import { Entity, Column, Index } from 'typeorm';
|
|
3
3
|
import { getColumnType } from 'src/helpers/typeorm-db-helper';
|
|
4
4
|
|
|
5
|
-
@Entity('
|
|
6
|
-
export class
|
|
5
|
+
@Entity('ss_secret')
|
|
6
|
+
export class Secret extends CommonEntity {
|
|
7
7
|
@Index({ unique: true })
|
|
8
8
|
@Column({ type: "varchar" })
|
|
9
9
|
key: string;
|
|
@@ -48,7 +48,7 @@ export class PasswordFieldCrudManager implements FieldCrudManager {
|
|
|
48
48
|
if(dto[this.options.fieldName]){
|
|
49
49
|
dto[this.options.fieldName] = await this.options.hashingService.hash(dto[this.options.fieldName]);
|
|
50
50
|
dto['passwordScheme'] = this.options.hashingService.name(); //Don't want to expose this in dto // e.g., 'bcrypt'
|
|
51
|
-
dto['
|
|
51
|
+
dto['passwordSchemeVersion'] = this.options.hashingService.currentVersion(); //Don't want to expose this in dto // e.g., 1, 2, ...
|
|
52
52
|
}
|
|
53
53
|
return dto;
|
|
54
54
|
}
|
package/src/index.ts
CHANGED
|
@@ -133,8 +133,8 @@ export * from './dtos/create-workflow-execution-artifact.dto'
|
|
|
133
133
|
export * from './dtos/update-workflow-execution-artifact.dto'
|
|
134
134
|
export * from './dtos/create-workflow-trigger-execution.dto'
|
|
135
135
|
export * from './dtos/update-workflow-trigger-execution.dto'
|
|
136
|
-
export * from './dtos/create-
|
|
137
|
-
export * from './dtos/update-
|
|
136
|
+
export * from './dtos/create-secret.dto'
|
|
137
|
+
export * from './dtos/update-secret.dto'
|
|
138
138
|
export * from './dtos/execute-workflow.dto'
|
|
139
139
|
export * from './dtos/validate-workflow-definition.dto'
|
|
140
140
|
|
|
@@ -191,7 +191,7 @@ export * from './entities/workflow-step-execution.entity'
|
|
|
191
191
|
export * from './entities/workflow-execution-log.entity'
|
|
192
192
|
export * from './entities/workflow-execution-artifact.entity'
|
|
193
193
|
export * from './entities/workflow-trigger-execution.entity'
|
|
194
|
-
export * from './entities/
|
|
194
|
+
export * from './entities/secret.entity'
|
|
195
195
|
|
|
196
196
|
export * from './enums/auth-type.enum'
|
|
197
197
|
export * from './enums/legacy-table-type.enum'
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { FileServiceArtifactSink } from '../../testing/reporter/file-service-artifact-sink';
|
|
18
18
|
import { FILE_SERVICE, IFileService } from '../../services/file/file-service.interface';
|
|
19
19
|
import { TestRunJobPayload } from '../../dtos/test-run-request.dto';
|
|
20
|
-
import {
|
|
20
|
+
import { SecretService } from '../../services/secret.service';
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Executes a queued test run on the worker tier (QUEUES_SERVICE_ROLE=subscriber).
|
|
@@ -39,7 +39,7 @@ export class TestRunQueueSubscriberDatabase extends DatabaseSubscriber<TestRunJo
|
|
|
39
39
|
readonly poller: PollerService,
|
|
40
40
|
private readonly httpService: HttpService,
|
|
41
41
|
@Inject(FILE_SERVICE) private readonly fileService: IFileService,
|
|
42
|
-
private readonly
|
|
42
|
+
private readonly secretService: SecretService,
|
|
43
43
|
) {
|
|
44
44
|
super(mqMessageService, mqMessageQueueService, poller);
|
|
45
45
|
}
|
|
@@ -107,7 +107,7 @@ export class TestRunQueueSubscriberDatabase extends DatabaseSubscriber<TestRunJo
|
|
|
107
107
|
ui: { baseUrl: p.uiBaseUrl, headless: p.headless ?? true, capture: p.capture, recordVideo: p.recordVideo ?? true },
|
|
108
108
|
options: { printApiLogs: p.printApiLogs ?? true },
|
|
109
109
|
externalRunId: p.externalRunId,
|
|
110
|
-
resolveSecrets: (keys) => this.
|
|
110
|
+
resolveSecrets: (keys) => this.secretService.resolveAvailable(keys),
|
|
111
111
|
});
|
|
112
112
|
} catch (err: any) {
|
|
113
113
|
// A failed scenario is surfaced via the run.end webhook, not as a job failure.
|
|
@@ -4,16 +4,16 @@ import { SolidBaseRepository } from './solid-base.repository';
|
|
|
4
4
|
import { RequestContextService } from 'src/services/request-context.service';
|
|
5
5
|
import { DataSource } from 'typeorm';
|
|
6
6
|
import { InjectDataSource } from '@nestjs/typeorm';
|
|
7
|
-
import {
|
|
7
|
+
import { Secret } from '../entities/secret.entity';
|
|
8
8
|
|
|
9
9
|
@Injectable()
|
|
10
|
-
export class
|
|
10
|
+
export class SecretRepository extends SolidBaseRepository<Secret> {
|
|
11
11
|
constructor(
|
|
12
12
|
@InjectDataSource("default")
|
|
13
13
|
readonly dataSource: DataSource,
|
|
14
14
|
readonly requestContextService: RequestContextService,
|
|
15
15
|
readonly securityRuleRepository: SecurityRuleRepository,
|
|
16
16
|
) {
|
|
17
|
-
super(
|
|
17
|
+
super(Secret, dataSource, requestContextService, securityRuleRepository);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -7771,13 +7771,13 @@
|
|
|
7771
7771
|
"moduleUserKey": "solid-core"
|
|
7772
7772
|
},
|
|
7773
7773
|
{
|
|
7774
|
-
"singularName": "
|
|
7775
|
-
"pluralName": "
|
|
7776
|
-
"displayName": "
|
|
7774
|
+
"singularName": "secret",
|
|
7775
|
+
"pluralName": "secrets",
|
|
7776
|
+
"displayName": "Secret",
|
|
7777
7777
|
"description": "Stores encrypted global secrets available to workflow expressions.",
|
|
7778
7778
|
"dataSource": "default",
|
|
7779
7779
|
"dataSourceType": "postgres",
|
|
7780
|
-
"tableName": "
|
|
7780
|
+
"tableName": "ss_secret",
|
|
7781
7781
|
"userKeyFieldUserKey": "key",
|
|
7782
7782
|
"isChild": false,
|
|
7783
7783
|
"parentModelUserKey": null,
|
|
@@ -9051,30 +9051,30 @@
|
|
|
9051
9051
|
"modelUserKey": "workflowTriggerExecution"
|
|
9052
9052
|
},
|
|
9053
9053
|
{
|
|
9054
|
-
"displayName": "
|
|
9055
|
-
"name": "
|
|
9054
|
+
"displayName": "Secret List Action",
|
|
9055
|
+
"name": "secret-list-action",
|
|
9056
9056
|
"type": "solid",
|
|
9057
9057
|
"domain": "",
|
|
9058
9058
|
"context": "",
|
|
9059
9059
|
"customComponent": "",
|
|
9060
9060
|
"customIsModal": true,
|
|
9061
9061
|
"serverEndpoint": "",
|
|
9062
|
-
"viewUserKey": "
|
|
9062
|
+
"viewUserKey": "secret-list-view",
|
|
9063
9063
|
"moduleUserKey": "solid-core",
|
|
9064
|
-
"modelUserKey": "
|
|
9064
|
+
"modelUserKey": "secret"
|
|
9065
9065
|
},
|
|
9066
9066
|
{
|
|
9067
|
-
"displayName": "
|
|
9068
|
-
"name": "
|
|
9067
|
+
"displayName": "Secret Tree View Action",
|
|
9068
|
+
"name": "secret-tree-action",
|
|
9069
9069
|
"type": "solid",
|
|
9070
9070
|
"domain": "",
|
|
9071
9071
|
"context": "",
|
|
9072
9072
|
"customComponent": "",
|
|
9073
9073
|
"customIsModal": true,
|
|
9074
9074
|
"serverEndpoint": "",
|
|
9075
|
-
"viewUserKey": "
|
|
9075
|
+
"viewUserKey": "secret-tree-view",
|
|
9076
9076
|
"moduleUserKey": "solid-core",
|
|
9077
|
-
"modelUserKey": "
|
|
9077
|
+
"modelUserKey": "secret"
|
|
9078
9078
|
}
|
|
9079
9079
|
],
|
|
9080
9080
|
"menus": [
|
|
@@ -9475,11 +9475,11 @@
|
|
|
9475
9475
|
},
|
|
9476
9476
|
{
|
|
9477
9477
|
"displayName": "Secrets",
|
|
9478
|
-
"name": "
|
|
9479
|
-
"sequenceNumber":
|
|
9480
|
-
"actionUserKey": "
|
|
9478
|
+
"name": "secret-menu-item",
|
|
9479
|
+
"sequenceNumber": 9,
|
|
9480
|
+
"actionUserKey": "secret-list-action",
|
|
9481
9481
|
"moduleUserKey": "solid-core",
|
|
9482
|
-
"parentMenuItemUserKey": "
|
|
9482
|
+
"parentMenuItemUserKey": "other-menu-item",
|
|
9483
9483
|
"iconName": "key"
|
|
9484
9484
|
}
|
|
9485
9485
|
],
|
|
@@ -20191,12 +20191,12 @@
|
|
|
20191
20191
|
}
|
|
20192
20192
|
},
|
|
20193
20193
|
{
|
|
20194
|
-
"name": "
|
|
20195
|
-
"displayName": "
|
|
20194
|
+
"name": "secret-list-view",
|
|
20195
|
+
"displayName": "Secret",
|
|
20196
20196
|
"type": "list",
|
|
20197
20197
|
"context": "{}",
|
|
20198
20198
|
"moduleUserKey": "solid-core",
|
|
20199
|
-
"modelUserKey": "
|
|
20199
|
+
"modelUserKey": "secret",
|
|
20200
20200
|
"layout": {
|
|
20201
20201
|
"type": "list",
|
|
20202
20202
|
"attrs": {
|
|
@@ -20287,12 +20287,12 @@
|
|
|
20287
20287
|
}
|
|
20288
20288
|
},
|
|
20289
20289
|
{
|
|
20290
|
-
"name": "
|
|
20291
|
-
"displayName": "
|
|
20290
|
+
"name": "secret-tree-view",
|
|
20291
|
+
"displayName": "Secret",
|
|
20292
20292
|
"type": "tree",
|
|
20293
20293
|
"context": "{}",
|
|
20294
20294
|
"moduleUserKey": "solid-core",
|
|
20295
|
-
"modelUserKey": "
|
|
20295
|
+
"modelUserKey": "secret",
|
|
20296
20296
|
"layout": {
|
|
20297
20297
|
"type": "tree",
|
|
20298
20298
|
"attrs": {
|
|
@@ -20354,17 +20354,17 @@
|
|
|
20354
20354
|
}
|
|
20355
20355
|
},
|
|
20356
20356
|
{
|
|
20357
|
-
"name": "
|
|
20358
|
-
"displayName": "
|
|
20357
|
+
"name": "secret-form-view",
|
|
20358
|
+
"displayName": "Secret",
|
|
20359
20359
|
"type": "form",
|
|
20360
20360
|
"context": "{}",
|
|
20361
20361
|
"moduleUserKey": "solid-core",
|
|
20362
|
-
"modelUserKey": "
|
|
20362
|
+
"modelUserKey": "secret",
|
|
20363
20363
|
"layout": {
|
|
20364
20364
|
"type": "form",
|
|
20365
20365
|
"attrs": {
|
|
20366
20366
|
"name": "form-1",
|
|
20367
|
-
"label": "
|
|
20367
|
+
"label": "Secret",
|
|
20368
20368
|
"className": "grid"
|
|
20369
20369
|
},
|
|
20370
20370
|
"children": [
|
|
@@ -20377,20 +20377,20 @@
|
|
|
20377
20377
|
{
|
|
20378
20378
|
"type": "notebook",
|
|
20379
20379
|
"attrs": {
|
|
20380
|
-
"name": "
|
|
20380
|
+
"name": "secret-notebook"
|
|
20381
20381
|
},
|
|
20382
20382
|
"children": [
|
|
20383
20383
|
{
|
|
20384
20384
|
"type": "page",
|
|
20385
20385
|
"attrs": {
|
|
20386
|
-
"name": "
|
|
20386
|
+
"name": "secret-basic-info",
|
|
20387
20387
|
"label": "Basic Info"
|
|
20388
20388
|
},
|
|
20389
20389
|
"children": [
|
|
20390
20390
|
{
|
|
20391
20391
|
"type": "group",
|
|
20392
20392
|
"attrs": {
|
|
20393
|
-
"name": "
|
|
20393
|
+
"name": "secret-identity",
|
|
20394
20394
|
"label": "Identity",
|
|
20395
20395
|
"className": "col-12 sm:col-12 md:col-6 lg:col-6"
|
|
20396
20396
|
},
|
|
@@ -20418,7 +20418,7 @@
|
|
|
20418
20418
|
{
|
|
20419
20419
|
"type": "group",
|
|
20420
20420
|
"attrs": {
|
|
20421
|
-
"name": "
|
|
20421
|
+
"name": "secret-value",
|
|
20422
20422
|
"label": "Secret",
|
|
20423
20423
|
"className": "col-12 sm:col-12 md:col-6 lg:col-6"
|
|
20424
20424
|
},
|
|
@@ -20448,14 +20448,14 @@
|
|
|
20448
20448
|
{
|
|
20449
20449
|
"type": "page",
|
|
20450
20450
|
"attrs": {
|
|
20451
|
-
"name": "
|
|
20451
|
+
"name": "secret-usage",
|
|
20452
20452
|
"label": "Usage"
|
|
20453
20453
|
},
|
|
20454
20454
|
"children": [
|
|
20455
20455
|
{
|
|
20456
20456
|
"type": "group",
|
|
20457
20457
|
"attrs": {
|
|
20458
|
-
"name": "
|
|
20458
|
+
"name": "secret-usage-group",
|
|
20459
20459
|
"label": "Usage",
|
|
20460
20460
|
"className": "col-12 sm:col-12 md:col-6 lg:col-6"
|
|
20461
20461
|
},
|
|
@@ -180,6 +180,23 @@ export class CRUDService<T extends CommonEntity> { // Add two generic value i.e
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
private async loadFieldsHierarchy(model: ModelMetadata, updateDto: any): Promise<FieldMetadata[]> {
|
|
184
|
+
const fieldsToProcess = [...model.fields];
|
|
185
|
+
if (!model.isChild) {
|
|
186
|
+
return fieldsToProcess;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const modelMetadataHelperService = this.moduleRef.get(ModelMetadataHelperService, { strict: false });
|
|
190
|
+
const existingFieldIds = new Set(fieldsToProcess.map(field => field.id));
|
|
191
|
+
const hierarchyFields = await modelMetadataHelperService.loadFieldHierarchy(model.singularName);
|
|
192
|
+
const requestedInheritedFields = hierarchyFields.filter(field =>
|
|
193
|
+
!existingFieldIds.has(field.id) &&
|
|
194
|
+
field.name in updateDto
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
return [...fieldsToProcess, ...requestedInheritedFields];
|
|
198
|
+
}
|
|
199
|
+
|
|
183
200
|
private async validateAndTransformDto(field: FieldMetadata, dto: any, files: Express.Multer.File[], hasMediaFields: boolean, isPartialUpdate: boolean = false, isUpdate: boolean = false, entityId?: number) {
|
|
184
201
|
const fieldManager: FieldCrudManager = await this.fieldCrudManager(field, this.entityManager, isPartialUpdate, isUpdate, entityId);
|
|
185
202
|
const validationErrors = fieldManager.validate(dto, files);
|
|
@@ -250,7 +267,7 @@ export class CRUDService<T extends CommonEntity> { // Add two generic value i.e
|
|
|
250
267
|
await this.prepareManyToManyAuditSnapshot(entity,id,model.singularName);
|
|
251
268
|
let hasMediaFields = false;
|
|
252
269
|
|
|
253
|
-
const fieldsToProcess =
|
|
270
|
+
const fieldsToProcess = await this.loadFieldsHierarchy(model, updateDto);
|
|
254
271
|
|
|
255
272
|
// 2. Loop through the fields with a switch statement
|
|
256
273
|
// 3. Handle the fields based on field type
|
|
@@ -541,7 +541,8 @@ export class DraftPublishHelperService {
|
|
|
541
541
|
* statement, e.g.:
|
|
542
542
|
* INSERT INTO "join_table" ("falcon_banner_id", "falcon_banner_user_id")
|
|
543
543
|
* SELECT 48, "falcon_banner_user_id" FROM "join_table" WHERE "falcon_banner_id" = 47
|
|
544
|
-
*
|
|
544
|
+
* Identifiers and parameters go through the connection's driver, so the statement is
|
|
545
|
+
* valid on every supported database (Postgres, MSSQL, MySQL).
|
|
545
546
|
*/
|
|
546
547
|
private async copyManyToManyLinksToNewVersion<T extends CommonEntity>(
|
|
547
548
|
manager: EntityManager,
|
|
@@ -559,17 +560,21 @@ export class DraftPublishHelperService {
|
|
|
559
560
|
? [joinTable.ownerColumns, joinTable.inverseColumns]
|
|
560
561
|
: [joinTable.inverseColumns, joinTable.ownerColumns];
|
|
561
562
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const
|
|
563
|
+
const driver = manager.connection.driver;
|
|
564
|
+
// tablePath may be "schema.table" (or "db.schema.table" on MSSQL), so escape each part.
|
|
565
|
+
// [0]: Solid entities have a single-column id.
|
|
566
|
+
const joinTableName = joinTable.tablePath.split('.').map(part => driver.escape(part)).join('.');
|
|
567
|
+
const thisRecordColumn = driver.escape(thisRecordColumns[0].databaseName);
|
|
568
|
+
const linkedRecordColumn = driver.escape(linkedRecordColumns[0].databaseName);
|
|
566
569
|
|
|
567
|
-
|
|
570
|
+
const [sql, parameters] = driver.escapeQueryWithParameters(
|
|
568
571
|
`INSERT INTO ${joinTableName} (${thisRecordColumn}, ${linkedRecordColumn}) ` +
|
|
569
|
-
`SELECT
|
|
570
|
-
`WHERE ${thisRecordColumn} =
|
|
571
|
-
|
|
572
|
+
`SELECT :newVersionId, ${linkedRecordColumn} FROM ${joinTableName} ` +
|
|
573
|
+
`WHERE ${thisRecordColumn} = :publishedVersionId`,
|
|
574
|
+
{ newVersionId, publishedVersionId },
|
|
575
|
+
{},
|
|
572
576
|
);
|
|
577
|
+
await manager.query(sql, parameters);
|
|
573
578
|
}
|
|
574
579
|
|
|
575
580
|
private async cloneMediaForVersion<T extends CommonEntity>(
|
|
@@ -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,
|
|
@@ -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,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,qBAEa,wBAAwB;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,qBAAqB;IAK3D,MAAM,CAAS,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAOrG,UAAU,CAAS,UAAU,EAAE,uBAAuB,EAAE,EAAmB,UAAU,GAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAO;IAOnH,MAAM,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAO9H,aAAa,CAAc,EAAE,EAAE,MAAM,EAAU,SAAS,EAAE,uBAAuB,EAAmB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;IAM/H,WAAW,CAAS,GAAG,EAAE,MAAM,EAAE;;;;IAMjC,OAAO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CAEU,+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":[],"m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AAC","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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AoC,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"}
|