@solidxai/core 0.1.13-beta.10 → 0.1.13-beta.11
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 +557 -0
- package/dist/entities/dashboard-user-layout.entity.js +2 -2
- package/dist/entities/dashboard-user-layout.entity.js.map +1 -1
- package/dist/entities/view-metadata.entity.js.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-artifact.entity.js +4 -3
- package/dist/entities/workflow-execution-artifact.entity.js.map +1 -1
- package/dist/entities/workflow-execution-log.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution-log.entity.js +4 -3
- package/dist/entities/workflow-execution-log.entity.js.map +1 -1
- package/dist/entities/workflow-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-execution.entity.js +3 -2
- package/dist/entities/workflow-execution.entity.js.map +1 -1
- package/dist/entities/workflow-secret.entity.d.ts.map +1 -1
- package/dist/entities/workflow-secret.entity.js +3 -2
- package/dist/entities/workflow-secret.entity.js.map +1 -1
- package/dist/entities/workflow-step-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-step-execution.entity.js +3 -2
- package/dist/entities/workflow-step-execution.entity.js.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.d.ts.map +1 -1
- package/dist/entities/workflow-trigger-execution.entity.js +6 -5
- package/dist/entities/workflow-trigger-execution.entity.js.map +1 -1
- package/dist/helpers/typeorm-db-helper.d.ts.map +1 -1
- package/dist/helpers/typeorm-db-helper.js +9 -0
- package/dist/helpers/typeorm-db-helper.js.map +1 -1
- package/dist-tests/api/authenticate.spec.js +119 -0
- package/dist-tests/api/authenticate.spec.js.map +1 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js +97 -0
- package/dist-tests/api/crud-service.findOne.cityMaster.spec.js.map +1 -0
- package/dist-tests/api/ping.spec.js +21 -0
- package/dist-tests/api/ping.spec.js.map +1 -0
- package/dist-tests/helpers/auth.js +41 -0
- package/dist-tests/helpers/auth.js.map +1 -0
- package/dist-tests/helpers/env.js +11 -0
- package/dist-tests/helpers/env.js.map +1 -0
- package/docs/agent-builder/notebook-lm-prompt-for-agent-builder.md +136 -0
- package/docs/agent-builder/team-ready-note-agent-builder.md +305 -0
- package/docs/agent-hub-grooming.md +301 -0
- package/docs/dashboards/AGENTIC_DASHBOARD_IMPLEMENTATION_PLAN.md +438 -0
- package/docs/dashboards/dashboard-curl-smoke-tests.txt +146 -0
- package/docs/dashboards/delete-legacy-dashboard-metadata.sql +172 -0
- package/docs/datasource-introspection-ddl-analysis.md +326 -0
- package/docs/datasource-introspection-implementation-plan.md +306 -0
- package/docs/grouping-enhancements.md +89 -0
- package/docs/java-spring/README.md +3 -0
- package/docs/java-spring/solid-core-module-deep-dive-report.md +1317 -0
- package/docs/module-package-import-handoff.md +691 -0
- package/docs/seed-changes.md +65 -0
- package/docs/test-data-workflow.md +200 -0
- package/docs/type-declaration-import-issue.md +24 -0
- package/docs/workflow/business-automation-example-notes.md +309 -0
- package/docs/workflow/control-flow-node-addition-sop.md +324 -0
- package/docs/workflow/data-engineering-pipeline-example-notes.md +330 -0
- package/docs/workflow/foreach-example-notes.md +187 -0
- package/docs/workflow/hello-world-example-notes.md +271 -0
- package/docs/workflow/kestra-concepts-plugins-blueprints.md +315 -0
- package/docs/workflow/loop-until-example-notes.md +198 -0
- package/docs/workflow/microservices-and-apis-example-notes.md +264 -0
- package/docs/workflow/samples.md +25 -0
- package/docs/workflow/what-is-kestra.md +79 -0
- package/docs/workflow/workflow-core-module-handoff-summary.md +191 -0
- package/docs/workflow/workflow-module-brd.md +185 -0
- package/docs/workflow/workflow-module-domain-model.md +252 -0
- package/docs/workflow/workflow-module-metadata-dsl.md +302 -0
- package/docs/workflow/workflow-module-technical-spec.md +293 -0
- package/docs/workflow/workflow-node-type-contracts.md +635 -0
- package/docs/workflow/workflow-node-ui-metadata-contract.md +1262 -0
- package/docs/workflow/workflow-solidx-model-field-spec.md +284 -0
- package/package.json +1 -1
- package/src/entities/dashboard-user-layout.entity.ts +2 -2
- package/src/entities/view-metadata.entity.ts +2 -2
- package/src/entities/workflow-execution-artifact.entity.ts +4 -3
- package/src/entities/workflow-execution-log.entity.ts +4 -3
- package/src/entities/workflow-execution.entity.ts +3 -2
- package/src/entities/workflow-secret.entity.ts +3 -2
- package/src/entities/workflow-step-execution.entity.ts +3 -2
- package/src/entities/workflow-trigger-execution.entity.ts +6 -5
- package/src/helpers/typeorm-db-helper.ts +12 -1
- package/.claude/settings.local.json +0 -16
- package/CLAUDE.md +0 -26
- package/src/services/1.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution-artifact.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-artifact.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAAgE;AAChE,qFAAwE;
|
|
1
|
+
{"version":3,"file":"workflow-execution-artifact.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-artifact.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAAgE;AAChE,qFAAwE;AACxE,oEAA8D;AAGvD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,4BAAY;IAApD;;QAwBH,iBAAY,GAAW,SAAS,CAAC;KAyCpC;;;;CAAA,CAAA;AAjEY,8DAAyB;AAGlC;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;8DACR;AAKpB;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACvD,IAAA,oBAAU,GAAE;8BACM,6CAAiB;oEAAC;AAKr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,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4DACzB;AAIlB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAC3B;AAIjB;IAFC,IAAA,eAAK,GAAE;IACP,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAA,iCAAa,EAAC,UAAU,CAAC,EAAE,CAAC;8BAC7C,IAAI;6DAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACnC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2DAClC;oCAhEL,yBAAyB;IADrC,IAAA,gBAAM,EAAC,gCAAgC,CAAC;GAC5B,yBAAyB,CAiErC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowExecution } from './workflow-execution.entity';\nimport { WorkflowStepExecution } from './workflow-step-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_execution_artifact')\nexport class WorkflowExecutionArtifact extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n artifactKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { nullable: false })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @ManyToOne(() => WorkflowStepExecution, { nullable: true })\n @JoinColumn()\n workflowStepExecution: WorkflowStepExecution;\n\n @Index()\n @Column({ type: \"varchar\" })\n name: string;\n\n @Column({ type: \"text\", nullable: true })\n description: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"payload\" })\n artifactType: string = \"payload\";\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeType: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n storageProviderKey: string;\n\n @Column({ type: \"text\", nullable: true })\n uri: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n fileName: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n mimeType: string;\n\n @Column({ type: \"bigint\", nullable: true })\n sizeBytes: bigint;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n checksum: string;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n producedAt: Date;\n\n @Column({ type: \"simple-json\", nullable: true })\n payload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n metadata: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution-log.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-execution-log.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGxE,qBACa,oBAAqB,SAAQ,YAAY;IAGlD,MAAM,EAAE,MAAM,CAAC;IAKf,iBAAiB,EAAE,iBAAiB,CAAC;IAKrC,qBAAqB,EAAE,qBAAqB,CAAC;IAI7C,KAAK,EAAE,MAAM,CAAU;IAGvB,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAIlB,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,EAAE,MAAM,CAAC;IAIf,QAAQ,EAAE,MAAM,CAAC;IAIjB,cAAc,EAAE,MAAM,CAAC;IAIvB,UAAU,EAAE,IAAI,CAAC;IAGjB,OAAO,EAAE,GAAG,CAAC;IAGb,QAAQ,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
17
17
|
const workflow_step_execution_entity_1 = require("./workflow-step-execution.entity");
|
|
18
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
18
19
|
let WorkflowExecutionLog = class WorkflowExecutionLog extends common_entity_1.CommonEntity {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -32,13 +33,13 @@ __decorate([
|
|
|
32
33
|
], WorkflowExecutionLog.prototype, "logKey", void 0);
|
|
33
34
|
__decorate([
|
|
34
35
|
(0, typeorm_1.Index)(),
|
|
35
|
-
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, {
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, { nullable: false }),
|
|
36
37
|
(0, typeorm_1.JoinColumn)(),
|
|
37
38
|
__metadata("design:type", workflow_execution_entity_1.WorkflowExecution)
|
|
38
39
|
], WorkflowExecutionLog.prototype, "workflowExecution", void 0);
|
|
39
40
|
__decorate([
|
|
40
41
|
(0, typeorm_1.Index)(),
|
|
41
|
-
(0, typeorm_1.ManyToOne)(() => workflow_step_execution_entity_1.WorkflowStepExecution, {
|
|
42
|
+
(0, typeorm_1.ManyToOne)(() => workflow_step_execution_entity_1.WorkflowStepExecution, { nullable: true }),
|
|
42
43
|
(0, typeorm_1.JoinColumn)(),
|
|
43
44
|
__metadata("design:type", workflow_step_execution_entity_1.WorkflowStepExecution)
|
|
44
45
|
], WorkflowExecutionLog.prototype, "workflowStepExecution", void 0);
|
|
@@ -78,7 +79,7 @@ __decorate([
|
|
|
78
79
|
], WorkflowExecutionLog.prototype, "sequenceNumber", void 0);
|
|
79
80
|
__decorate([
|
|
80
81
|
(0, typeorm_1.Index)(),
|
|
81
|
-
(0, typeorm_1.Column)({
|
|
82
|
+
(0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
82
83
|
__metadata("design:type", Date)
|
|
83
84
|
], WorkflowExecutionLog.prototype, "occurredAt", void 0);
|
|
84
85
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution-log.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAAgE;AAChE,qFAAwE;
|
|
1
|
+
{"version":3,"file":"workflow-execution-log.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAAgE;AAChE,qFAAwE;AACxE,oEAA8D;AAGvD,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,4BAAY;IAA/C;;QAiBH,UAAK,GAAW,MAAM,CAAC;KAkC1B;;;;CAAA,CAAA;AAnDY,oDAAoB;AAG7B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;oDACb;AAKf;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACvD,IAAA,oBAAU,GAA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AAI,EAAE,CAAC;;qDACnC;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sDAClC;+BAlDL,oBAAoB;IADhC,IAAA,gBAAM,EAAC,2BAA2B,CAAC;GACvB,oBAAoB,CAmDhC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowExecution } from './workflow-execution.entity';\nimport { WorkflowStepExecution } from './workflow-step-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_execution_log')\nexport class WorkflowExecutionLog extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n logKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { nullable: false })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @ManyToOne(() => WorkflowStepExecution, { nullable: true })\n @JoinColumn()\n workflowStepExecution: WorkflowStepExecution;\n\n @Index()\n @Column({ type: \"varchar\", default: \"info\" })\n level: string = \"info\";\n\n @Column({ type: \"text\" })\n message: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n eventType: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n source: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n nodeType: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n sequenceNumber: number;\n\n @Index()\n @Column({ ...getColumnType('datetime') })\n occurredAt: Date;\n\n @Column({ type: \"simple-json\", nullable: true })\n context: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n metadata: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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C;IAGhD,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;IAG9C,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;CAC3D"}
|
|
@@ -17,6 +17,7 @@ const workflow_definition_entity_1 = require("./workflow-definition.entity");
|
|
|
17
17
|
const workflow_step_execution_entity_1 = require("./workflow-step-execution.entity");
|
|
18
18
|
const workflow_execution_log_entity_1 = require("./workflow-execution-log.entity");
|
|
19
19
|
const workflow_execution_artifact_entity_1 = require("./workflow-execution-artifact.entity");
|
|
20
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
20
21
|
let WorkflowExecution = class WorkflowExecution extends common_entity_1.CommonEntity {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments);
|
|
@@ -60,12 +61,12 @@ __decorate([
|
|
|
60
61
|
], WorkflowExecution.prototype, "triggerType", void 0);
|
|
61
62
|
__decorate([
|
|
62
63
|
(0, typeorm_1.Index)(),
|
|
63
|
-
(0, typeorm_1.Column)({
|
|
64
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
64
65
|
__metadata("design:type", Date)
|
|
65
66
|
], WorkflowExecution.prototype, "startedAt", void 0);
|
|
66
67
|
__decorate([
|
|
67
68
|
(0, typeorm_1.Index)(),
|
|
68
|
-
(0, typeorm_1.Column)({
|
|
69
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
69
70
|
__metadata("design:type", Date)
|
|
70
71
|
], WorkflowExecution.prototype, "finishedAt", void 0);
|
|
71
72
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAkF;AAClF,6EAAiE;AACjE,qFAAyE;AACzE,mFAAuE;AACvE,6FAAiF;
|
|
1
|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G1B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,sDAAqB,EAAE,qBAAqB,CAAC,EAAE,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iEAC5E;AAGhD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oDAAoB,EAAE,oBAAoB,CAAC,EAAE,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;gEAC3E;AAG9C;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8DAAyB,EAAE,yBAAyB,CAAC,EAAE,CAAC,yBAAyB,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;qEAChF;4BAxE/C,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,uBAAuB,CAAC;GACnB,iBAAiB,CAyE7B","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne, OneToMany } from 'typeorm';\nimport { WorkflowDefinition } from './workflow-definition.entity'\nimport { WorkflowStepExecution } from './workflow-step-execution.entity';\nimport { WorkflowExecutionLog } from './workflow-execution-log.entity';\nimport { WorkflowExecutionArtifact } from './workflow-execution-artifact.entity';\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_execution')\nexport class WorkflowExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n executionIdentifier: string;\n\n @Index()\n @ManyToOne(() => WorkflowDefinition, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n workflowDefinition: WorkflowDefinition;\n\n @Index()\n @Column({ type: \"varchar\" })\n workflowKey: string;\n\n @Column({ type: \"varchar\", nullable: true })\n workflowDisplayName: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"created\" })\n status: string = \"created\";\n\n @Index()\n @Column({ type: \"varchar\", default: \"manual\" })\n triggerType: string = \"manual\";\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Column({ type: \"simple-json\", nullable: true })\n inputPayload: any;\n\n // Retained for schema/backward compatibility only. Combined workflow output\n // is no longer persisted here because large loops can make this payload\n // duplicate all step outputs and cause OOMs; use step execution outputs.\n @Column({ type: \"simple-json\", nullable: true })\n outputPayload: any;\n\n @Column({ type: \"varchar\", nullable: true })\n definitionVersion: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n definitionChecksum: string;\n\n @Column({ name: \"definition_snapshot\", type: \"text\", nullable: true})\n definitionSnapshot: string;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n\n @Index()\n @Column({ type: \"bigint\", nullable: true })\n requestedByUserId: bigint;\n\n @OneToMany(() => WorkflowStepExecution, workflowStepExecution => workflowStepExecution.workflowExecution, { cascade: true })\n workflowStepExecutions: WorkflowStepExecution[];\n\n @OneToMany(() => WorkflowExecutionLog, workflowExecutionLog => workflowExecutionLog.workflowExecution, { cascade: true })\n workflowExecutionLogs: WorkflowExecutionLog[];\n\n @OneToMany(() => WorkflowExecutionArtifact, workflowExecutionArtifact => workflowExecutionArtifact.workflowExecution, { cascade: true })\n workflowExecutionArtifacts: WorkflowExecutionArtifact[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -13,6 +13,7 @@ exports.WorkflowSecret = void 0;
|
|
|
13
13
|
const openapi = require("@nestjs/swagger");
|
|
14
14
|
const common_entity_1 = require("./common.entity");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
16
17
|
let WorkflowSecret = class WorkflowSecret extends common_entity_1.CommonEntity {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
@@ -53,11 +54,11 @@ __decorate([
|
|
|
53
54
|
__metadata("design:type", String)
|
|
54
55
|
], WorkflowSecret.prototype, "status", void 0);
|
|
55
56
|
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)({
|
|
57
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
57
58
|
__metadata("design:type", Date)
|
|
58
59
|
], WorkflowSecret.prototype, "lastRotatedAt", void 0);
|
|
59
60
|
__decorate([
|
|
60
|
-
(0, typeorm_1.Column)({
|
|
61
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
61
62
|
__metadata("design:type", Date)
|
|
62
63
|
], WorkflowSecret.prototype, "lastAccessedAt", void 0);
|
|
63
64
|
exports.WorkflowSecret = WorkflowSecret = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-secret.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-secret.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAgD;
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-step-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,qBACa,qBAAsB,SAAQ,YAAY;IAGnD,gBAAgB,EAAE,MAAM,CAAC;IAKzB,iBAAiB,EAAE,iBAAiB,CAAC;IAIrC,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAIjB,QAAQ,EAAE,MAAM,CAAU;IAI1B,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,MAAM,CAAa;IAI3B,aAAa,EAAE,MAAM,CAAK;IAG1B,UAAU,EAAE,MAAM,CAAK;IAGvB,UAAU,EAAE,MAAM,CAAC;IAInB,YAAY,EAAE,MAAM,CAAC;IAIrB,sBAAsB,EAAE,MAAM,CAAC;IAI/B,cAAc,EAAE,MAAM,CAAC;IAIvB,SAAS,EAAE,IAAI,CAAC;IAIhB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,MAAM,CAAC;IAGlB,YAAY,EAAE,GAAG,CAAC;IAGlB,aAAa,EAAE,GAAG,CAAC;IAGnB,cAAc,EAAE,GAAG,CAAC;IAGpB,YAAY,EAAE,GAAG,CAAC;IAGlB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,GAAG,CAAC;CACrB"}
|
|
@@ -14,6 +14,7 @@ const openapi = require("@nestjs/swagger");
|
|
|
14
14
|
const common_entity_1 = require("./common.entity");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
17
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
17
18
|
let WorkflowStepExecution = class WorkflowStepExecution extends common_entity_1.CommonEntity {
|
|
18
19
|
constructor() {
|
|
19
20
|
super(...arguments);
|
|
@@ -92,12 +93,12 @@ __decorate([
|
|
|
92
93
|
], WorkflowStepExecution.prototype, "sequenceNumber", void 0);
|
|
93
94
|
__decorate([
|
|
94
95
|
(0, typeorm_1.Index)(),
|
|
95
|
-
(0, typeorm_1.Column)({
|
|
96
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
96
97
|
__metadata("design:type", Date)
|
|
97
98
|
], WorkflowStepExecution.prototype, "startedAt", void 0);
|
|
98
99
|
__decorate([
|
|
99
100
|
(0, typeorm_1.Index)(),
|
|
100
|
-
(0, typeorm_1.Column)({
|
|
101
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
101
102
|
__metadata("design:type", Date)
|
|
102
103
|
], WorkflowStepExecution.prototype, "finishedAt", void 0);
|
|
103
104
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAA+D;
|
|
1
|
+
{"version":3,"file":"workflow-step-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-step-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,2EAA+D;AAC/D,oEAA8D;AAGvD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,4BAAY;IAAhD;;QAmBH,aAAQ,GAAW,MAAM,CAAC;QAQ1B,WAAM,GAAW,SAAS,CAAC;QAI3B,kBAAa,GAAW,CAAC,CAAC;QAG1B,eAAU,GAAW,CAAC,CAAC;KAgD1B;;;;CAAA,CAAA;AAlFY,sDAAqB;AAG9B;IAFC,IAAA,eAAK,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+DACH;AAKzB;IAHC,IAAA,eAAK,GAAE;IACP,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC5E,IAAA,oBAAU,GAAE;8BACM,6CAAiB;gEAAC;AAIrC;IAFC,IAAA,eAAK,GAAE;IACP,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from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowExecution } from './workflow-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_step_execution')\nexport class WorkflowStepExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n stepExecutionKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { onDelete: \"CASCADE\", nullable: false })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @Column({ type: \"varchar\" })\n nodeId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n nodeName: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"task\" })\n nodeKind: string = \"task\";\n\n @Index()\n @Column({ type: \"varchar\" })\n nodeType: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"created\" })\n status: string = \"created\";\n\n @Index()\n @Column({ type: \"integer\", default: 1 })\n attemptNumber: number = 1;\n\n @Column({ type: \"integer\", nullable: true, default: 0 })\n retryCount: number = 0;\n\n @Column({ type: \"integer\", nullable: true })\n maxRetries: number;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n parentNodeId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n parentStepExecutionKey: string;\n\n @Index()\n @Column({ type: \"integer\", nullable: true })\n sequenceNumber: number;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Column({ type: \"bigint\", nullable: true })\n timeoutMs: bigint;\n\n @Column({ type: \"simple-json\", nullable: true })\n inputPayload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n outputPayload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n runtimeContext: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n nodeSnapshot: any;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-trigger-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-trigger-execution.entity.d.ts","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/D,qBACa,wBAAyB,SAAQ,YAAY;IAGtD,mBAAmB,EAAE,MAAM,CAAC;IAK5B,kBAAkB,EAAE,kBAAkB,CAAC;IAKvC,iBAAiB,EAAE,iBAAiB,CAAC;IAIrC,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,EAAE,MAAM,CAAC;IAIpB,WAAW,EAAE,MAAM,CAAC;IAIpB,MAAM,EAAE,MAAM,CAAc;IAI5B,OAAO,EAAE,OAAO,CAAS;IAIzB,OAAO,EAAE,IAAI,CAAC;IAId,SAAS,EAAE,IAAI,CAAC;IAIhB,UAAU,EAAE,IAAI,CAAC;IAGjB,UAAU,EAAE,MAAM,CAAC;IAInB,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,MAAM,CAAC;IAItB,cAAc,EAAE,MAAM,CAAC;IAGvB,OAAO,EAAE,GAAG,CAAC;IAGb,eAAe,EAAE,GAAG,CAAC;IAGrB,YAAY,EAAE,MAAM,CAAC;IAGrB,YAAY,EAAE,GAAG,CAAC;IAGlB,QAAQ,EAAE,GAAG,CAAC;CACjB"}
|
|
@@ -15,6 +15,7 @@ const common_entity_1 = require("./common.entity");
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const workflow_definition_entity_1 = require("./workflow-definition.entity");
|
|
17
17
|
const workflow_execution_entity_1 = require("./workflow-execution.entity");
|
|
18
|
+
const typeorm_db_helper_1 = require("../helpers/typeorm-db-helper");
|
|
18
19
|
let WorkflowTriggerExecution = class WorkflowTriggerExecution extends common_entity_1.CommonEntity {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(...arguments);
|
|
@@ -33,13 +34,13 @@ __decorate([
|
|
|
33
34
|
], WorkflowTriggerExecution.prototype, "triggerExecutionKey", void 0);
|
|
34
35
|
__decorate([
|
|
35
36
|
(0, typeorm_1.Index)(),
|
|
36
|
-
(0, typeorm_1.ManyToOne)(() => workflow_definition_entity_1.WorkflowDefinition, {
|
|
37
|
+
(0, typeorm_1.ManyToOne)(() => workflow_definition_entity_1.WorkflowDefinition, { nullable: false }),
|
|
37
38
|
(0, typeorm_1.JoinColumn)(),
|
|
38
39
|
__metadata("design:type", workflow_definition_entity_1.WorkflowDefinition)
|
|
39
40
|
], WorkflowTriggerExecution.prototype, "workflowDefinition", void 0);
|
|
40
41
|
__decorate([
|
|
41
42
|
(0, typeorm_1.Index)(),
|
|
42
|
-
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, {
|
|
43
|
+
(0, typeorm_1.ManyToOne)(() => workflow_execution_entity_1.WorkflowExecution, { nullable: true }),
|
|
43
44
|
(0, typeorm_1.JoinColumn)(),
|
|
44
45
|
__metadata("design:type", workflow_execution_entity_1.WorkflowExecution)
|
|
45
46
|
], WorkflowTriggerExecution.prototype, "workflowExecution", void 0);
|
|
@@ -69,17 +70,17 @@ __decorate([
|
|
|
69
70
|
], WorkflowTriggerExecution.prototype, "matched", void 0);
|
|
70
71
|
__decorate([
|
|
71
72
|
(0, typeorm_1.Index)(),
|
|
72
|
-
(0, typeorm_1.Column)({
|
|
73
|
+
(0, typeorm_1.Column)({ ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
73
74
|
__metadata("design:type", Date)
|
|
74
75
|
], WorkflowTriggerExecution.prototype, "firedAt", void 0);
|
|
75
76
|
__decorate([
|
|
76
77
|
(0, typeorm_1.Index)(),
|
|
77
|
-
(0, typeorm_1.Column)({
|
|
78
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
78
79
|
__metadata("design:type", Date)
|
|
79
80
|
], WorkflowTriggerExecution.prototype, "startedAt", void 0);
|
|
80
81
|
__decorate([
|
|
81
82
|
(0, typeorm_1.Index)(),
|
|
82
|
-
(0, typeorm_1.Column)({
|
|
83
|
+
(0, typeorm_1.Column)({ nullable: true, ...(0, typeorm_db_helper_1.getColumnType)('datetime') }),
|
|
83
84
|
__metadata("design:type", Date)
|
|
84
85
|
], WorkflowTriggerExecution.prototype, "finishedAt", void 0);
|
|
85
86
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-trigger-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,6EAAkE;AAClE,2EAA+D;
|
|
1
|
+
{"version":3,"file":"workflow-trigger-execution.entity.js","sourceRoot":"","sources":["../../src/entities/workflow-trigger-execution.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mDAA0D;AAC1D,qCAAuE;AACvE,6EAAkE;AAClE,2EAA+D;AAC/D,oEAA8D;AAGvD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,4BAAY;IAAnD;;QA4BH,WAAM,GAAW,UAAU,CAAC;QAI5B,YAAO,GAAY,KAAK,CAAC;KA2C5B;;skBA3CsB,KAAK;;CA2C3B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AC;;0DAClC;mCA1EL,wBAAwB;IADpC,IAAA,gBAAM,EAAC,+BAA+B,CAAC;GAC3B,wBAAwB,CA2EpC","sourcesContent":["import { CommonEntity } from 'src/entities/common.entity';\nimport { Entity, Column, Index, JoinColumn, ManyToOne } from 'typeorm';\nimport { WorkflowDefinition } from './workflow-definition.entity';\nimport { WorkflowExecution } from './workflow-execution.entity'\nimport { getColumnType } from 'src/helpers/typeorm-db-helper';\n\n@Entity('ss_workflow_trigger_execution')\nexport class WorkflowTriggerExecution extends CommonEntity {\n @Index({ unique: true })\n @Column({ type: \"varchar\" })\n triggerExecutionKey: string;\n\n @Index()\n @ManyToOne(() => WorkflowDefinition, { nullable: false })\n @JoinColumn()\n workflowDefinition: WorkflowDefinition;\n\n @Index()\n @ManyToOne(() => WorkflowExecution, { nullable: true })\n @JoinColumn()\n workflowExecution: WorkflowExecution;\n\n @Index()\n @Column({ type: \"varchar\" })\n triggerId: string;\n\n @Column({ type: \"varchar\", nullable: true })\n triggerName: string;\n\n @Index()\n @Column({ type: \"varchar\" })\n triggerType: string;\n\n @Index()\n @Column({ type: \"varchar\", default: \"received\" })\n status: string = \"received\";\n\n @Index()\n @Column({ nullable: true, default: false })\n matched: boolean = false;\n\n @Index()\n @Column({ ...getColumnType('datetime') })\n firedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n startedAt: Date;\n\n @Index()\n @Column({ nullable: true, ...getColumnType('datetime') })\n finishedAt: Date;\n\n @Column({ type: \"bigint\", nullable: true })\n durationMs: bigint;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n source: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n correlationId: string;\n\n @Index()\n @Column({ type: \"varchar\", nullable: true })\n idempotencyKey: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n payload: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n triggerSnapshot: any;\n\n @Column({ type: \"text\", nullable: true })\n errorSummary: string;\n\n @Column({ type: \"simple-json\", nullable: true })\n errorDetails: any;\n\n @Column({ type: \"simple-json\", nullable: true })\n metadata: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-db-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"typeorm-db-helper.d.ts","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA0DxC,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAUvE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAkB9D"}
|
|
@@ -36,6 +36,13 @@ const DECIMAL_MAP = {
|
|
|
36
36
|
[create_model_metadata_dto_1.DatasourceType.mariadb]: { type: "float" },
|
|
37
37
|
[create_model_metadata_dto_1.DatasourceType.oracle]: { type: "float" },
|
|
38
38
|
};
|
|
39
|
+
const DATE_TIME_MAP = {
|
|
40
|
+
[create_model_metadata_dto_1.DatasourceType.postgres]: { type: "timestamp" },
|
|
41
|
+
[create_model_metadata_dto_1.DatasourceType.mssql]: { type: "datetime2" },
|
|
42
|
+
[create_model_metadata_dto_1.DatasourceType.mysql]: { type: "datetime" },
|
|
43
|
+
[create_model_metadata_dto_1.DatasourceType.mariadb]: { type: "datetime" },
|
|
44
|
+
[create_model_metadata_dto_1.DatasourceType.oracle]: { type: "timestamp" },
|
|
45
|
+
};
|
|
39
46
|
const solidCoreDbType = Object.values(create_model_metadata_dto_1.DatasourceType).includes(process.env.SOLID_CORE_DB_TYPE)
|
|
40
47
|
? process.env.SOLID_CORE_DB_TYPE
|
|
41
48
|
: create_model_metadata_dto_1.DatasourceType.postgres;
|
|
@@ -59,6 +66,8 @@ function getColumnType(solidType) {
|
|
|
59
66
|
return SIMPLE_JSON_LARGE_TEXT_MAP[solidCoreDbType];
|
|
60
67
|
case "decimal":
|
|
61
68
|
return DECIMAL_MAP[solidCoreDbType];
|
|
69
|
+
case "datetime":
|
|
70
|
+
return DATE_TIME_MAP[solidCoreDbType];
|
|
62
71
|
default:
|
|
63
72
|
return {};
|
|
64
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-db-helper.js","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"typeorm-db-helper.js","sourceRoot":"","sources":["../../src/helpers/typeorm-db-helper.ts"],"names":[],"mappings":";;AA0DA,0CAUC;AAED,sCAkBC;AAvFD,iFAAoE;AAEpE,MAAM,aAAa,GAA0C;IACzD,CAAC,0CAAc,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAC3C,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE;IAC3D,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;IAC5C,CAAC,0CAAc,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;IAC9C,CAAC,0CAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CAC5C,CAAC;AAKF,MAAM,0BAA0B,GAA0C;IACtE,CAAC,0CAAc,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC7B,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE,EAAE;IAC1B,CAAC,0CAAc,CAAC,KAAK,CAAC,EAAE;QACpB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;YACT,EAAE,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK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KAAK,UAAU;YACX,OAAO,aAAa,CAAC,eAAe,CAAC,CAAC;QAE1C;YACI,OAAO,EAAE,CAAC;IAClB,CAAC;AACL,CAAC","sourcesContent":["import { ColumnOptions } from \"typeorm\";\nimport { DatasourceType } from \"src/dtos/create-model-metadata.dto\";\n\nconst LONG_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"text\" },\n [DatasourceType.mssql]: { type: \"nvarchar\", length: \"max\" },\n [DatasourceType.mysql]: { type: \"longtext\" },\n [DatasourceType.mariadb]: { type: \"longtext\" },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\n// For simple-json columns that may contain large payloads: on MySQL/MariaDB the default\n// TEXT backing store is limited to 64 KB, so we override the type to longtext and supply\n// an explicit JSON transformer so TypeORM still serialises/deserialises correctly.\nconst SIMPLE_JSON_LARGE_TEXT_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: {},\n [DatasourceType.mssql]: {},\n [DatasourceType.mysql]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.mariadb]: {\n type: \"longtext\",\n transformer: {\n to: (value: any) => (value !== undefined && value !== null ? JSON.stringify(value) : value),\n from: (value: any) => (value !== null && value !== undefined ? JSON.parse(value) : value),\n },\n },\n [DatasourceType.oracle]: { type: \"clob\" },\n};\n\nconst DECIMAL_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"float4\" },\n [DatasourceType.mssql]: { type: \"float\" },\n [DatasourceType.mysql]: { type: \"float\" },\n [DatasourceType.mariadb]: { type: \"float\" },\n [DatasourceType.oracle]: { type: \"float\" },\n};\n\nconst DATE_TIME_MAP: Record<DatasourceType, ColumnOptions> = {\n [DatasourceType.postgres]: { type: \"timestamp\" },\n [DatasourceType.mssql]: { type: \"datetime2\" },\n [DatasourceType.mysql]: { type: \"datetime\" },\n [DatasourceType.mariadb]: { type: \"datetime\" },\n [DatasourceType.oracle]: { type: \"timestamp\" },\n};\n\nconst solidCoreDbType: DatasourceType =\n Object.values(DatasourceType).includes(process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n ? (process.env.SOLID_CORE_DB_TYPE as DatasourceType)\n : DatasourceType.postgres;\n\n// Must use ANSI CAST() syntax — not Postgres-specific `::text` — because TypeORM's\n// replacePropertyNamesForTheWholeQuery regex treats ':' as part of the property name,\n// so `alias.col::text` is parsed as property `col::text` (no match → no column substitution).\nexport function buildCastToText(driver: string, colExpr: string): string {\n switch (driver) {\n case DatasourceType.mssql:\n return `CAST(${colExpr} AS NVARCHAR(MAX))`;\n case DatasourceType.mysql:\n case DatasourceType.mariadb:\n return `CAST(${colExpr} AS CHAR)`;\n default:\n return `CAST(${colExpr} AS TEXT)`;\n }\n}\n\nexport function getColumnType(solidType: string): ColumnOptions {\n switch (solidType) {\n case \"longText\":\n case \"richText\":\n return LONG_TEXT_MAP[solidCoreDbType];\n\n case \"simpleJsonLargeText\":\n return SIMPLE_JSON_LARGE_TEXT_MAP[solidCoreDbType];\n\n case \"decimal\":\n return DECIMAL_MAP[solidCoreDbType];\n\n case \"datetime\":\n return DATE_TIME_MAP[solidCoreDbType];\n\n default:\n return {};\n }\n}\n"]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const env_1 = require("../helpers/env");
|
|
5
|
+
const baseURL = process.env.API_BASE_URL ?? "http://localhost:3000";
|
|
6
|
+
const TEST_USER_EMAIL = (0, env_1.getRequiredEnv)("TEST_USER_EMAIL");
|
|
7
|
+
const TEST_USER_PASSWORD = (0, env_1.getRequiredEnv)("TEST_USER_PASSWORD");
|
|
8
|
+
function base64UrlDecode(input) {
|
|
9
|
+
const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
10
|
+
const padded = normalized.length % 4 === 0
|
|
11
|
+
? normalized
|
|
12
|
+
: normalized.padEnd(normalized.length + (4 - (normalized.length % 4)), "=");
|
|
13
|
+
return Buffer.from(padded, "base64").toString("utf-8");
|
|
14
|
+
}
|
|
15
|
+
function validateJwt(token) {
|
|
16
|
+
const parts = token.split(".");
|
|
17
|
+
if (parts.length !== 3) {
|
|
18
|
+
throw new Error("JWT must have three dot-separated parts.");
|
|
19
|
+
}
|
|
20
|
+
const headerJson = JSON.parse(base64UrlDecode(parts[0]));
|
|
21
|
+
const payloadJson = JSON.parse(base64UrlDecode(parts[1]));
|
|
22
|
+
if (!headerJson || typeof headerJson !== "object") {
|
|
23
|
+
throw new Error("JWT header must be a JSON object.");
|
|
24
|
+
}
|
|
25
|
+
if (!payloadJson || typeof payloadJson !== "object") {
|
|
26
|
+
throw new Error("JWT payload must be a JSON object.");
|
|
27
|
+
}
|
|
28
|
+
if (typeof payloadJson.exp !== "number") {
|
|
29
|
+
throw new Error("JWT payload.exp must be a number.");
|
|
30
|
+
}
|
|
31
|
+
return payloadJson;
|
|
32
|
+
}
|
|
33
|
+
(0, test_1.test)("API: authenticate succeeds with valid credentials", async () => {
|
|
34
|
+
const api = await test_1.request.newContext({
|
|
35
|
+
baseURL,
|
|
36
|
+
extraHTTPHeaders: {
|
|
37
|
+
accept: "*/*",
|
|
38
|
+
"content-type": "application/json",
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
const res = await api.post("/api/iam/authenticate", {
|
|
43
|
+
data: {
|
|
44
|
+
email: TEST_USER_EMAIL,
|
|
45
|
+
username: "",
|
|
46
|
+
password: TEST_USER_PASSWORD,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
(0, test_1.expect)(res.status()).toBe(200);
|
|
50
|
+
const json = await res.json();
|
|
51
|
+
(0, test_1.expect)(json.statusCode).toBe(200);
|
|
52
|
+
(0, test_1.expect)(Array.isArray(json.message)).toBe(true);
|
|
53
|
+
(0, test_1.expect)(json.message.length).toBe(0);
|
|
54
|
+
(0, test_1.expect)(json.error).toBe("");
|
|
55
|
+
const user = json.data?.user;
|
|
56
|
+
(0, test_1.expect)(user, "Expected data.user to be an object.").toBeTruthy();
|
|
57
|
+
(0, test_1.expect)(typeof user).toBe("object");
|
|
58
|
+
const email = user?.email;
|
|
59
|
+
(0, test_1.expect)(typeof email).toBe("string");
|
|
60
|
+
if (email === TEST_USER_EMAIL) {
|
|
61
|
+
(0, test_1.expect)(email).toBe(TEST_USER_EMAIL);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
(0, test_1.expect)(email.length).toBeGreaterThan(0);
|
|
65
|
+
}
|
|
66
|
+
(0, test_1.expect)(typeof user?.mobile).toBe("string");
|
|
67
|
+
(0, test_1.expect)(typeof user?.username).toBe("string");
|
|
68
|
+
(0, test_1.expect)(typeof user?.forcePasswordChange).toBe("boolean");
|
|
69
|
+
(0, test_1.expect)(typeof user?.id).toBe("number");
|
|
70
|
+
const roles = user?.roles;
|
|
71
|
+
(0, test_1.expect)(Array.isArray(roles)).toBe(true);
|
|
72
|
+
if (Array.isArray(roles)) {
|
|
73
|
+
(0, test_1.expect)(roles.every((role) => typeof role === "string")).toBe(true);
|
|
74
|
+
(0, test_1.expect)(roles).toContain("Admin");
|
|
75
|
+
}
|
|
76
|
+
const accessToken = json.data?.accessToken;
|
|
77
|
+
const refreshToken = json.data?.refreshToken;
|
|
78
|
+
(0, test_1.expect)(typeof accessToken).toBe("string");
|
|
79
|
+
(0, test_1.expect)(typeof refreshToken).toBe("string");
|
|
80
|
+
const accessPayload = validateJwt(accessToken);
|
|
81
|
+
const refreshPayload = validateJwt(refreshToken);
|
|
82
|
+
(0, test_1.expect)(typeof accessPayload.exp).toBe("number");
|
|
83
|
+
(0, test_1.expect)(typeof refreshPayload.exp).toBe("number");
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
await api.dispose();
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
(0, test_1.test)("API: authenticate fails with wrong password", async () => {
|
|
90
|
+
const api = await test_1.request.newContext({
|
|
91
|
+
baseURL,
|
|
92
|
+
extraHTTPHeaders: {
|
|
93
|
+
accept: "*/*",
|
|
94
|
+
"content-type": "application/json",
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
try {
|
|
98
|
+
const res = await api.post("/api/iam/authenticate", {
|
|
99
|
+
data: {
|
|
100
|
+
email: TEST_USER_EMAIL,
|
|
101
|
+
username: "",
|
|
102
|
+
password: `${TEST_USER_PASSWORD}__wrong`,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
(0, test_1.expect)(res.status()).toBe(401);
|
|
106
|
+
const json = await res.json();
|
|
107
|
+
(0, test_1.expect)(json.statusCode).toBe(401);
|
|
108
|
+
(0, test_1.expect)(json.statusCodeMessage).toBe("Unauthorized");
|
|
109
|
+
(0, test_1.expect)(json.message).toBe("Invalid credentials");
|
|
110
|
+
(0, test_1.expect)(json.error).toBe("Invalid credentials");
|
|
111
|
+
(0, test_1.expect)(json.data?.statusCode).toBe(401);
|
|
112
|
+
(0, test_1.expect)(json.data?.error).toBe("Unauthorized");
|
|
113
|
+
(0, test_1.expect)(json.data?.message).toBe("Invalid credentials");
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
await api.dispose();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=authenticate.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticate.spec.js","sourceRoot":"","sources":["../../tests/api/authenticate.spec.ts"],"names":[],"mappings":";;AAAA,2CAAyD;AACzD,wCAAgD;AAOhD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,uBAAuB,CAAC;AACpE,MAAM,eAAe,GAAG,IAAA,oBAAc,EAAC,iBAAiB,CAAC,CAAC;AAC1D,MAAM,kBAAkB,GAAG,IA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AAC,CAAC;QAC/B,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAE9B,IAAA,aAAM,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,IAAA,aAAM,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACpD,IAAA,aAAM,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACjD,IAAA,aAAM,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC/C,IAAA,aAAM,EAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,IAAA,aAAM,EAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9C,IAAA,aAAM,EAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACT,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { expect, request, test } from \"@playwright/test\";\nimport { getRequiredEnv } from \"../helpers/env\";\n\ntype JwtPayload = {\n exp?: number;\n [key: string]: unknown;\n};\n\nconst baseURL = process.env.API_BASE_URL ?? \"http://localhost:3000\";\nconst TEST_USER_EMAIL = getRequiredEnv(\"TEST_USER_EMAIL\");\nconst TEST_USER_PASSWORD = getRequiredEnv(\"TEST_USER_PASSWORD\");\n\nfunction base64UrlDecode(input: string): string {\n const normalized = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded =\n normalized.length % 4 === 0\n ? normalized\n : normalized.padEnd(\n normalized.length + (4 - (normalized.length % 4)),\n \"=\"\n );\n return Buffer.from(padded, \"base64\").toString(\"utf-8\");\n}\n\nfunction validateJwt(token: string): JwtPayload {\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"JWT must have three dot-separated parts.\");\n }\n\n const headerJson = JSON.parse(base64UrlDecode(parts[0]));\n const payloadJson = JSON.parse(base64UrlDecode(parts[1]));\n\n if (!headerJson || typeof headerJson !== \"object\") {\n throw new Error(\"JWT header must be a JSON object.\");\n }\n\n if (!payloadJson || typeof payloadJson !== \"object\") {\n throw new Error(\"JWT payload must be a JSON object.\");\n }\n\n if (typeof payloadJson.exp !== \"number\") {\n throw new Error(\"JWT payload.exp must be a number.\");\n }\n\n return payloadJson as JwtPayload;\n}\n\ntest(\"API: authenticate succeeds with valid credentials\", async () => {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: {\n accept: \"*/*\",\n \"content-type\": \"application/json\",\n },\n });\n\n try {\n const res = await api.post(\"/api/iam/authenticate\", {\n data: {\n email: TEST_USER_EMAIL,\n username: \"\",\n password: TEST_USER_PASSWORD,\n },\n });\n\n expect(res.status()).toBe(200);\n const json = await res.json();\n\n expect(json.statusCode).toBe(200);\n expect(Array.isArray(json.message)).toBe(true);\n expect(json.message.length).toBe(0);\n expect(json.error).toBe(\"\");\n\n const user = json.data?.user as Record<string, unknown> | undefined;\n expect(user, \"Expected data.user to be an object.\").toBeTruthy();\n expect(typeof user).toBe(\"object\");\n\n const email = user?.email;\n expect(typeof email).toBe(\"string\");\n if (email === TEST_USER_EMAIL) {\n expect(email).toBe(TEST_USER_EMAIL);\n } else {\n // If your API returns a fixed system email, replace this with an exact match.\n expect((email as string).length).toBeGreaterThan(0);\n }\n\n expect(typeof user?.mobile).toBe(\"string\");\n expect(typeof user?.username).toBe(\"string\");\n expect(typeof user?.forcePasswordChange).toBe(\"boolean\");\n expect(typeof user?.id).toBe(\"number\");\n\n const roles = user?.roles;\n expect(Array.isArray(roles)).toBe(true);\n if (Array.isArray(roles)) {\n expect(roles.every((role) => typeof role === \"string\")).toBe(true);\n expect(roles).toContain(\"Admin\");\n }\n\n const accessToken = json.data?.accessToken;\n const refreshToken = json.data?.refreshToken;\n expect(typeof accessToken).toBe(\"string\");\n expect(typeof refreshToken).toBe(\"string\");\n\n const accessPayload = validateJwt(accessToken as string);\n const refreshPayload = validateJwt(refreshToken as string);\n\n expect(typeof accessPayload.exp).toBe(\"number\");\n expect(typeof refreshPayload.exp).toBe(\"number\");\n } finally {\n await api.dispose();\n }\n});\n\ntest(\"API: authenticate fails with wrong password\", async () => {\n const api = await request.newContext({\n baseURL,\n extraHTTPHeaders: {\n accept: \"*/*\",\n \"content-type\": \"application/json\",\n },\n });\n\n try {\n const res = await api.post(\"/api/iam/authenticate\", {\n data: {\n email: TEST_USER_EMAIL,\n username: \"\",\n password: `${TEST_USER_PASSWORD}__wrong`,\n },\n });\n\n expect(res.status()).toBe(401);\n const json = await res.json();\n\n expect(json.statusCode).toBe(401);\n expect(json.statusCodeMessage).toBe(\"Unauthorized\");\n expect(json.message).toBe(\"Invalid credentials\");\n expect(json.error).toBe(\"Invalid credentials\");\n expect(json.data?.statusCode).toBe(401);\n expect(json.data?.error).toBe(\"Unauthorized\");\n expect(json.data?.message).toBe(\"Invalid credentials\");\n } finally {\n await api.dispose();\n }\n});\n"]}
|