@justworkflowit/cdk-constructs 0.0.1 → 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 JustWorkflowIt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,4 +1,8 @@
1
1
  import { Construct } from 'constructs';
2
+ export interface JustWorkflowItConstructProps {
3
+ disambiguator: string;
4
+ }
2
5
  export declare class JustWorkflowItConstruct extends Construct {
3
- constructor(scope: Construct, id: string);
6
+ private static readonly CONSTRUCT_ID_PREFIX;
7
+ constructor(scope: Construct, props: JustWorkflowItConstructProps);
4
8
  }
@@ -7,13 +7,15 @@ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
7
7
  const aws_iam_1 = require("aws-cdk-lib/aws-iam");
8
8
  const aws_secretsmanager_1 = require("aws-cdk-lib/aws-secretsmanager");
9
9
  class JustWorkflowItConstruct extends constructs_1.Construct {
10
- constructor(scope, id) {
11
- super(scope, id);
10
+ constructor(scope, props) {
11
+ super(scope, `${JustWorkflowItConstruct.CONSTRUCT_ID_PREFIX}${props.disambiguator}`);
12
+ const secretName = '/justworkflowit/api/authToken';
12
13
  const secret = new aws_secretsmanager_1.Secret(this, 'JustWorkflowItAuthTokenSecret', {
13
- secretName: '/justworkflowit/api/authToken',
14
+ secretName,
14
15
  description: 'Paste your JustWorkflowIt API auth token here to enable secure communication.',
15
16
  });
16
- const integrationLambda = new aws_lambda_1.Function(this, 'IntegrationLambda', {
17
+ const integrationLambda = new aws_lambda_1.Function(this, 'JustWorkflowItAutomationIntegrationLambda', {
18
+ functionName: 'JustWorkflowItAutomationIntegrationLambda',
17
19
  runtime: aws_lambda_1.Runtime.NODEJS_18_X,
18
20
  handler: 'index.handler',
19
21
  code: aws_lambda_1.Code.fromInline(`
@@ -23,14 +25,14 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
23
25
  `),
24
26
  timeout: aws_cdk_lib_1.Duration.seconds(10),
25
27
  environment: {
26
- AUTH_SECRET_NAME: '/justworkflowit/api/authToken',
28
+ AUTH_SECRET_NAME: secretName,
27
29
  API_BASE_URL: 'https://api.justworkflowit.com',
28
30
  },
29
31
  });
30
32
  secret.grantRead(integrationLambda);
31
- const executionRole = new aws_iam_1.Role(this, 'JustWorkflowItExecutionRole', {
32
- roleName: 'JustWorkflowItExecutionRole',
33
- assumedBy: new aws_iam_1.AccountPrincipal('588738588052'), // <-- Replace this with your actual account ID
33
+ const executionRole = new aws_iam_1.Role(this, 'JustWorkflowItAutomationExecutionRole', {
34
+ roleName: 'JustWorkflowItAutomationExecutionRole',
35
+ assumedBy: new aws_iam_1.AccountPrincipal('588738588052'),
34
36
  description: 'Role assumed by JustWorkflowIt backend to perform actions inside this account.',
35
37
  });
36
38
  executionRole.addToPolicy(new aws_iam_1.PolicyStatement({
@@ -48,3 +50,4 @@ class JustWorkflowItConstruct extends constructs_1.Construct {
48
50
  }
49
51
  }
50
52
  exports.JustWorkflowItConstruct = JustWorkflowItConstruct;
53
+ JustWorkflowItConstruct.CONSTRUCT_ID_PREFIX = "JustWorkflowItConstruct";
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@justworkflowit/cdk-constructs",
3
3
  "description": "",
4
- "version": "0.0.1",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
4
+ "version": "0.0.3",
5
+ "main": "dist/src/index.js",
6
+ "types": "dist/src/index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
9
  "prepare": "npm run build",
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "keywords": [],
17
17
  "author": "",
18
- "license": "ISC",
18
+ "license": "MIT",
19
19
  "type": "commonjs",
20
20
  "dependencies": {
21
21
  "aws-cdk-lib": "^2.202.0",