@justworkflowit/cdk-constructs 0.0.199 → 0.0.201

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.
@@ -46,6 +46,7 @@ const aws_s3_deployment_1 = require("aws-cdk-lib/aws-s3-deployment");
46
46
  const path = __importStar(require("path"));
47
47
  const uuid_1 = require("uuid");
48
48
  const engine_1 = require("@justworkflowit/engine");
49
+ const json_schema_faker_1 = require("json-schema-faker");
49
50
  class JustWorkflowItConstructs extends constructs_1.Construct {
50
51
  constructor(scope, props) {
51
52
  super(scope, `${JustWorkflowItConstructs.CONSTRUCT_ID_PREFIX}${props.disambiguator}`);
@@ -67,10 +68,20 @@ class JustWorkflowItConstructs extends constructs_1.Construct {
67
68
  type,
68
69
  execute: async () => ({ status: 'success', payload: {} }),
69
70
  }));
71
+ // Generate fake workflow input if a workflowInput definition exists
72
+ let fakeWorkflowInputForTypeValidation = undefined;
73
+ if (parsedWorkflow.definitions?.workflowInput) {
74
+ const jsonSchemaFakerRefs = Object.entries(parsedWorkflow.definitions).reduce((acc, [key, value]) => {
75
+ acc[`#/definitions/${key}`] = value;
76
+ return acc;
77
+ }, {});
78
+ fakeWorkflowInputForTypeValidation = json_schema_faker_1.JSONSchemaFaker.generate(parsedWorkflow.definitions.workflowInput, jsonSchemaFakerRefs);
79
+ }
70
80
  // This will throw if the workflow definition is invalid
71
81
  new engine_1.JustWorkflowItEngine({
72
82
  workflowDefinition: definition,
73
83
  stepExecutors: dummyExecutors,
84
+ workflowInput: fakeWorkflowInputForTypeValidation,
74
85
  });
75
86
  }
76
87
  catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justworkflowit/cdk-constructs",
3
3
  "description": "",
4
- "version": "0.0.199",
4
+ "version": "0.0.201",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "publishConfig": {
@@ -26,7 +26,8 @@
26
26
  "@justworkflowit/api-client": "*",
27
27
  "@justworkflowit/engine": "^0.0.74",
28
28
  "aws-cdk-lib": "^2.0.0",
29
- "constructs": "^10.0.0"
29
+ "constructs": "^10.0.0",
30
+ "json-schema-faker": "^0.5.6"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@types/jest": "^29.5.12",