From 0a72274168728ba16a2805d7353964df2c098799 Mon Sep 17 00:00:00 2001 From: Elad Cohen Date: Wed, 13 Mar 2024 12:41:46 +0200 Subject: [PATCH] wip --- eventbridge/README.md | 4 +- eventbridge/lib.test.w | 8 +- eventbridge/lib.w | 6 +- eventbridge/package-lock.json | 107 +++++++++++++++++++--- eventbridge/package.json | 4 +- eventbridge/platform/aws/publish.js | 20 +--- eventbridge/platform/aws/publish.w | 34 +++++++ eventbridge/platform/awscdk/eventbridge.w | 8 +- eventbridge/platform/sim/bus.w | 34 +++---- eventbridge/platform/sim/eventbridge.w | 4 +- eventbridge/platform/tfaws/eventbridge.w | 9 +- eventbridge/types.w | 2 +- 12 files changed, 173 insertions(+), 67 deletions(-) create mode 100644 eventbridge/platform/aws/publish.w diff --git a/eventbridge/README.md b/eventbridge/README.md index 1b130c1e..77c34a2d 100644 --- a/eventbridge/README.md +++ b/eventbridge/README.md @@ -27,7 +27,7 @@ bus.subscribeFunction("github.pull-request.created", inflight (event) => { }); new cloud.Function(inflight () => { - bus.publish( + bus.putEvents([{ detailType: "pull-request.created", resources: ["test"], source: "github.com", @@ -35,7 +35,7 @@ new cloud.Function(inflight () => { detail: { "test": "test", }, - ); + }]); }); ``` diff --git a/eventbridge/lib.test.w b/eventbridge/lib.test.w index 73ee279d..5fe6833d 100644 --- a/eventbridge/lib.test.w +++ b/eventbridge/lib.test.w @@ -46,7 +46,7 @@ let env = new Environments(); test "publish to eventbridge" { log("publishing to eventbridge"); - eventBridge.publish( + eventBridge.putEvents([{ detailType: "pull-request.created", resources: ["test"], source: "github.com", @@ -54,7 +54,7 @@ test "publish to eventbridge" { detail: { "test": "test", }, - ); + }]); log("published"); @@ -73,7 +73,7 @@ test "publish to eventbridge" { expect.equal(0, env.bucket.list().length); - eventBridge.publish( + eventBridge.putEvents([{ detailType: "myTest.check", resources: ["test"], source: "myTest", @@ -81,7 +81,7 @@ test "publish to eventbridge" { detail: { "fake": "env", }, - ); + }]); log("published 2nd event"); diff --git a/eventbridge/lib.w b/eventbridge/lib.w index 8dbbcdb9..737f64ed 100644 --- a/eventbridge/lib.w +++ b/eventbridge/lib.w @@ -6,7 +6,7 @@ bring "./platform/tfaws" as aws; bring "./platform/awscdk" as awscdk; /** - Winglang resource for Amazon EventBridge. + Wing resource for Amazon EventBridge. */ pub class Bus impl types.IBus { inner: types.IBus; @@ -24,8 +24,8 @@ pub class Bus impl types.IBus { } } - pub inflight publish(event: types.PublishEvent): void { - this.inner.publish(event); + pub inflight putEvents(events: Array): void { + this.inner.putEvents(events); } pub subscribeFunction(name: str, handler: inflight (types.Event): void, pattern: Json): void { diff --git a/eventbridge/package-lock.json b/eventbridge/package-lock.json index dd80ce9f..ab5763f9 100644 --- a/eventbridge/package-lock.json +++ b/eventbridge/package-lock.json @@ -8,15 +8,13 @@ "name": "@winglibs/eventbridge", "version": "0.0.1", "license": "MIT", - "dependencies": { - "@aws-sdk/client-eventbridge": "^3.525.0" - }, "devDependencies": { "@cdktf/provider-aws": "^18.2.0", "cdktf": "^0.19.2", "constructs": "^10.3.0" }, "peerDependencies": { + "@aws-sdk/client-eventbridge": "^3.525.0", "@cdktf/provider-aws": "^18", "aws-cdk-lib": "^2.109.0", "cdktf": "^0.19", @@ -45,6 +43,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-3.0.0.tgz", "integrity": "sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==", + "peer": true, "dependencies": { "@aws-crypto/util": "^3.0.0", "@aws-sdk/types": "^3.222.0", @@ -54,12 +53,14 @@ "node_modules/@aws-crypto/crc32/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-crypto/ie11-detection": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "peer": true, "dependencies": { "tslib": "^1.11.1" } @@ -67,12 +68,14 @@ "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-crypto/sha256-browser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "peer": true, "dependencies": { "@aws-crypto/ie11-detection": "^3.0.0", "@aws-crypto/sha256-js": "^3.0.0", @@ -87,12 +90,14 @@ "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-crypto/sha256-js": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "peer": true, "dependencies": { "@aws-crypto/util": "^3.0.0", "@aws-sdk/types": "^3.222.0", @@ -102,12 +107,14 @@ "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-crypto/supports-web-crypto": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "peer": true, "dependencies": { "tslib": "^1.11.1" } @@ -115,12 +122,14 @@ "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-crypto/util": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "peer": true, "dependencies": { "@aws-sdk/types": "^3.222.0", "@aws-sdk/util-utf8-browser": "^3.0.0", @@ -130,12 +139,14 @@ "node_modules/@aws-crypto/util/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "peer": true }, "node_modules/@aws-sdk/client-eventbridge": { "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-eventbridge/-/client-eventbridge-3.525.0.tgz", "integrity": "sha512-yBDjS410rMiHv05YX7ap1E9wWnMo9fSTx8jDdzpOxS0c58QUgcSnANm5UA09aAE0doQDNYC6aPTu22tP7HSMdw==", + "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -186,6 +197,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.525.0.tgz", "integrity": "sha512-6KwGQWFoNLH1UupdWPFdKPfTgjSz1kN8/r8aCzuvvXBe4Pz+iDUZ6FEJzGWNc9AapjvZDNO1hs23slomM9rTaA==", + "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -234,6 +246,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.525.0.tgz", "integrity": "sha512-zz13k/6RkjPSLmReSeGxd8wzGiiZa4Odr2Tv3wTcxClM4wOjD+zOgGv4Fe32b9AMqaueiCdjbvdu7AKcYxFA4A==", + "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -286,6 +299,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.525.0.tgz", "integrity": "sha512-a8NUGRvO6rkfTZCbMaCsjDjLbERCwIUU9dIywFYcRgbFhkupJ7fSaZz3Het98U51M9ZbTEpaTa3fz0HaJv8VJw==", + "peer": true, "dependencies": { "@aws-crypto/sha256-browser": "3.0.0", "@aws-crypto/sha256-js": "3.0.0", @@ -338,6 +352,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.525.0.tgz", "integrity": "sha512-E3LtEtMWCriQOFZpVKpLYzbdw/v2PAOEAMhn2VRRZ1g0/g1TXzQrfhEU2yd8l/vQEJaCJ82ooGGg7YECviBUxA==", + "peer": true, "dependencies": { "@smithy/core": "^1.3.5", "@smithy/protocol-http": "^3.2.1", @@ -354,6 +369,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.523.0.tgz", "integrity": "sha512-Y6DWdH6/OuMDoNKVzZlNeBc6f1Yjk1lYMjANKpIhMbkRCvLJw/PYZKOZa8WpXbTYdgg9XLjKybnLIb3ww3uuzA==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/property-provider": "^2.1.3", @@ -368,6 +384,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.525.0.tgz", "integrity": "sha512-RNWQGuSBQZhl3iqklOslUEfQ4br1V3DCPboMpeqFtddUWJV3m2u2extFur9/4Uy+1EHVF120IwZUKtd8dF+ibw==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/fetch-http-handler": "^2.4.3", @@ -387,6 +404,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.525.0.tgz", "integrity": "sha512-JDnccfK5JRb9jcgpc9lirL9PyCwGIqY0nKdw3LlX5WL5vTpTG4E1q7rLAlpNh7/tFD1n66Itarfv2tsyHMIqCw==", + "peer": true, "dependencies": { "@aws-sdk/client-sts": "3.525.0", "@aws-sdk/credential-provider-env": "3.523.0", @@ -408,6 +426,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.525.0.tgz", "integrity": "sha512-RJXlO8goGXpnoHQAyrCcJ0QtWEOFa34LSbfdqBIjQX/fwnjUuEmiGdXTV3AZmwYQ7juk49tfBneHbtOP3AGqsQ==", + "peer": true, "dependencies": { "@aws-sdk/credential-provider-env": "3.523.0", "@aws-sdk/credential-provider-http": "3.525.0", @@ -430,6 +449,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.523.0.tgz", "integrity": "sha512-f0LP9KlFmMvPWdKeUKYlZ6FkQAECUeZMmISsv6NKtvPCI9e4O4cLTeR09telwDK8P0HrgcRuZfXM7E30m8re0Q==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/property-provider": "^2.1.3", @@ -445,6 +465,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.525.0.tgz", "integrity": "sha512-7V7ybtufxdD3plxeIeB6aqHZeFIUlAyPphXIUgXrGY10iNcosL970rQPBeggsohe4gCM6UvY2TfMeEcr+ZE8FA==", + "peer": true, "dependencies": { "@aws-sdk/client-sso": "3.525.0", "@aws-sdk/token-providers": "3.525.0", @@ -462,6 +483,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.525.0.tgz", "integrity": "sha512-sAukOjR1oKb2JXG4nPpuBFpSwGUhrrY17PG/xbTy8NAoLLhrqRwnErcLfdTfmj6tH+3094k6ws/Sh8a35ae7fA==", + "peer": true, "dependencies": { "@aws-sdk/client-sts": "3.525.0", "@aws-sdk/types": "3.523.0", @@ -477,6 +499,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.523.0.tgz", "integrity": "sha512-4g3q7Ta9sdD9TMUuohBAkbx/e3I/juTqfKi7TPgP+8jxcYX72MOsgemAMHuP6CX27eyj4dpvjH+w4SIVDiDSmg==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/protocol-http": "^3.2.1", @@ -491,6 +514,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.523.0.tgz", "integrity": "sha512-PeDNJNhfiaZx54LBaLTXzUaJ9LXFwDFFIksipjqjvxMafnoVcQwKbkoPUWLe5ytT4nnL1LogD3s55mERFUsnwg==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/types": "^2.10.1", @@ -504,6 +528,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.523.0.tgz", "integrity": "sha512-nZ3Vt7ehfSDYnrcg/aAfjjvpdE+61B3Zk68i6/hSUIegT3IH9H1vSW67NDKVp+50hcEfzWwM2HMPXxlzuyFyrw==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/protocol-http": "^3.2.1", @@ -518,6 +543,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.525.0.tgz", "integrity": "sha512-ewFyyFM6wdFTOqCiId5GQNi7owDdLEonQhB4h8tF6r3HV52bRlDvZA4aDos+ft6N/XY2J6L0qlFTFq+/oiurXw==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@aws-sdk/util-arn-parser": "3.495.0", @@ -537,6 +563,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.523.0.tgz", "integrity": "sha512-pFXV4don6qcmew/OvEjLUr2foVjzoJ8o5k57Oz9yAHz8INx3RHK8MP/K4mVhHo6n0SquRcWrm4kY/Tw+89gkEA==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/property-provider": "^2.1.3", @@ -554,6 +581,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.525.0.tgz", "integrity": "sha512-4al/6uO+t/QIYXK2OgqzDKQzzLAYJza1vWFS+S0lJ3jLNGyLB5BMU5KqWjDzevYZ4eCnz2Nn7z0FveUTNz8YdQ==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@aws-sdk/util-endpoints": "3.525.0", @@ -569,6 +597,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.525.0.tgz", "integrity": "sha512-8kFqXk6UyKgTMi7N7QlhA6qM4pGPWbiUXqEY2RgUWngtxqNFGeM9JTexZeuavQI+qLLe09VPShPNX71fEDcM6w==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/node-config-provider": "^2.2.4", @@ -585,6 +614,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.525.0.tgz", "integrity": "sha512-j8gkdfiokaherRgokfZBl2azYBMHlegT7pOnR/3Y79TSz6G+bJeIkuNk8aUbJArr6R8nvAM1j4dt1rBM+efolQ==", + "peer": true, "dependencies": { "@aws-sdk/middleware-sdk-s3": "3.525.0", "@aws-sdk/types": "3.523.0", @@ -601,6 +631,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.525.0.tgz", "integrity": "sha512-puVjbxuK0Dq7PTQ2HdddHy2eQjOH8GZbump74yWJa6JVpRW84LlOcNmP+79x4Kscvz2ldWB8XDFw/pcCiSDe5A==", + "peer": true, "dependencies": { "@aws-sdk/client-sso-oidc": "3.525.0", "@aws-sdk/types": "3.523.0", @@ -617,6 +648,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.523.0.tgz", "integrity": "sha512-AqGIu4u+SxPiUuNBp2acCVcq80KDUFjxe6e3cMTvKWTzCbrVk1AXv0dAaJnCmdkWIha6zJDWxpIk/aL4EGhZ9A==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -629,6 +661,7 @@ "version": "3.495.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.495.0.tgz", "integrity": "sha512-hwdA3XAippSEUxs7jpznwD63YYFR+LtQvlEcebPTgWR9oQgG9TfS+39PUfbnEeje1ICuOrN3lrFqFbmP9uzbMg==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -640,6 +673,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.525.0.tgz", "integrity": "sha512-DIW7WWU5tIGkeeKX6NJUyrEIdWMiqjLQG3XBzaUj+ufIENwNjdAHhlD8l2vX7Yr3JZRT6yN/84wBCj7Tw1xd1g==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/types": "^2.10.1", @@ -654,6 +688,7 @@ "version": "3.495.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.495.0.tgz", "integrity": "sha512-MfaPXT0kLX2tQaR90saBT9fWQq2DHqSSJRzW+MZWsmF+y5LGCOhO22ac/2o6TKSQm7h0HRc2GaADqYYYor62yg==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -665,6 +700,7 @@ "version": "3.523.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.523.0.tgz", "integrity": "sha512-6ZRNdGHX6+HQFqTbIA5+i8RWzxFyxsZv8D3soRfpdyWIKkzhSz8IyRKXRciwKBJDaC7OX2jzGE90wxRQft27nA==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/types": "^2.10.1", @@ -676,6 +712,7 @@ "version": "3.525.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.525.0.tgz", "integrity": "sha512-88Wjt4efyUSBGcyIuh1dvoMqY1k15jpJc5A/3yi67clBQEFsu9QCodQCQPqmRjV3VRcMtBOk+jeCTiUzTY5dRQ==", + "peer": true, "dependencies": { "@aws-sdk/types": "3.523.0", "@smithy/node-config-provider": "^2.2.4", @@ -698,6 +735,7 @@ "version": "3.259.0", "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "peer": true, "dependencies": { "tslib": "^2.3.1" } @@ -719,6 +757,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-2.1.3.tgz", "integrity": "sha512-c2aYH2Wu1RVE3rLlVgg2kQOBJGM0WbjReQi5DnPTm2Zb7F0gk7J2aeQeaX2u/lQZoHl6gv8Oac7mt9alU3+f4A==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -731,6 +770,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-2.1.4.tgz", "integrity": "sha512-AW2WUZmBAzgO3V3ovKtsUbI3aBNMeQKFDumoqkNxaVDWF/xfnxAWqBKDr/NuG7c06N2Rm4xeZLPiJH/d+na0HA==", + "peer": true, "dependencies": { "@smithy/node-config-provider": "^2.2.4", "@smithy/types": "^2.10.1", @@ -746,6 +786,7 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/@smithy/core/-/core-1.3.5.tgz", "integrity": "sha512-Rrc+e2Jj6Gu7Xbn0jvrzZlSiP2CZocIOfZ9aNUA82+1sa6GBnxqL9+iZ9EKHeD9aqD1nU8EK4+oN2EiFpSv7Yw==", + "peer": true, "dependencies": { "@smithy/middleware-endpoint": "^2.4.4", "@smithy/middleware-retry": "^2.1.4", @@ -764,6 +805,7 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-2.2.4.tgz", "integrity": "sha512-DdatjmBZQnhGe1FhI8gO98f7NmvQFSDiZTwC3WMvLTCKQUY+Y1SVkhJqIuLu50Eb7pTheoXQmK+hKYUgpUWsNA==", + "peer": true, "dependencies": { "@smithy/node-config-provider": "^2.2.4", "@smithy/property-provider": "^2.1.3", @@ -779,6 +821,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-2.1.3.tgz", "integrity": "sha512-rGlCVuwSDv6qfKH4/lRxFjcZQnIE0LZ3D4lkMHg7ZSltK9rA74r0VuGSvWVQ4N/d70VZPaniFhp4Z14QYZsa+A==", + "peer": true, "dependencies": { "@aws-crypto/crc32": "3.0.0", "@smithy/types": "^2.10.1", @@ -790,6 +833,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-2.4.3.tgz", "integrity": "sha512-Fn/KYJFo6L5I4YPG8WQb2hOmExgRmNpVH5IK2zU3JKrY5FKW7y9ar5e0BexiIC9DhSKqKX+HeWq/Y18fq7Dkpw==", + "peer": true, "dependencies": { "@smithy/protocol-http": "^3.2.1", "@smithy/querystring-builder": "^2.1.3", @@ -802,6 +846,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-2.1.3.tgz", "integrity": "sha512-FsAPCUj7VNJIdHbSxMd5uiZiF20G2zdSDgrgrDrHqIs/VMxK85Vqk5kMVNNDMCZmMezp6UKnac0B4nAyx7HJ9g==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "@smithy/util-buffer-from": "^2.1.1", @@ -816,6 +861,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-2.1.3.tgz", "integrity": "sha512-wkra7d/G4CbngV4xsjYyAYOvdAhahQje/WymuQdVEnXFExJopEu7fbL5AEAlBPgWHXwu94VnCSG00gVzRfExyg==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -825,6 +871,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.1.1.tgz", "integrity": "sha512-xozSQrcUinPpNPNPds4S7z/FakDTh1MZWtRP/2vQtYB/u3HYrX2UXuZs+VhaKBd6Vc7g2XPr2ZtwGBNDN6fNKQ==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -836,6 +883,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-2.1.3.tgz", "integrity": "sha512-aJduhkC+dcXxdnv5ZpM3uMmtGmVFKx412R1gbeykS5HXDmRU6oSsyy2SoHENCkfOGKAQOjVE2WVqDJibC0d21g==", + "peer": true, "dependencies": { "@smithy/protocol-http": "^3.2.1", "@smithy/types": "^2.10.1", @@ -849,6 +897,7 @@ "version": "2.4.4", "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-2.4.4.tgz", "integrity": "sha512-4yjHyHK2Jul4JUDBo2sTsWY9UshYUnXeb/TAK/MTaPEb8XQvDmpwSFnfIRDU45RY1a6iC9LCnmJNg/yHyfxqkw==", + "peer": true, "dependencies": { "@smithy/middleware-serde": "^2.1.3", "@smithy/node-config-provider": "^2.2.4", @@ -866,6 +915,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-2.1.4.tgz", "integrity": "sha512-Cyolv9YckZTPli1EkkaS39UklonxMd08VskiuMhURDjC0HHa/AD6aK/YoD21CHv9s0QLg0WMLvk9YeLTKkXaFQ==", + "peer": true, "dependencies": { "@smithy/node-config-provider": "^2.2.4", "@smithy/protocol-http": "^3.2.1", @@ -885,6 +935,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-2.1.3.tgz", "integrity": "sha512-s76LId+TwASrHhUa9QS4k/zeXDUAuNuddKklQzRgumbzge5BftVXHXIqL4wQxKGLocPwfgAOXWx+HdWhQk9hTg==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -897,6 +948,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-2.1.3.tgz", "integrity": "sha512-opMFufVQgvBSld/b7mD7OOEBxF6STyraVr1xel1j0abVILM8ALJvRoFbqSWHGmaDlRGIiV9Q5cGbWi0sdiEaLQ==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -909,6 +961,7 @@ "version": "2.2.4", "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-2.2.4.tgz", "integrity": "sha512-nqazHCp8r4KHSFhRQ+T0VEkeqvA0U+RhehBSr1gunUuNW3X7j0uDrWBxB2gE9eutzy6kE3Y7L+Dov/UXT871vg==", + "peer": true, "dependencies": { "@smithy/property-provider": "^2.1.3", "@smithy/shared-ini-file-loader": "^2.3.4", @@ -923,6 +976,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-2.4.1.tgz", "integrity": "sha512-HCkb94soYhJMxPCa61wGKgmeKpJ3Gftx1XD6bcWEB2wMV1L9/SkQu/6/ysKBnbOzWRE01FGzwrTxucHypZ8rdg==", + "peer": true, "dependencies": { "@smithy/abort-controller": "^2.1.3", "@smithy/protocol-http": "^3.2.1", @@ -938,6 +992,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-2.1.3.tgz", "integrity": "sha512-bMz3se+ySKWNrgm7eIiQMa2HO/0fl2D0HvLAdg9pTMcpgp4SqOAh6bz7Ik6y7uQqSrk4rLjIKgbQ6yzYgGehCQ==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -950,6 +1005,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-3.2.1.tgz", "integrity": "sha512-KLrQkEw4yJCeAmAH7hctE8g9KwA7+H2nSJwxgwIxchbp/L0B5exTdOQi9D5HinPLlothoervGmhpYKelZ6AxIA==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -962,6 +1018,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-2.1.3.tgz", "integrity": "sha512-kFD3PnNqKELe6m9GRHQw/ftFFSZpnSeQD4qvgDB6BQN6hREHELSosVFUMPN4M3MDKN2jAwk35vXHLoDrNfKu0A==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "@smithy/util-uri-escape": "^2.1.1", @@ -975,6 +1032,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-2.1.3.tgz", "integrity": "sha512-3+CWJoAqcBMR+yvz6D+Fc5VdoGFtfenW6wqSWATWajrRMGVwJGPT3Vy2eb2bnMktJc4HU4bpjeovFa566P3knQ==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -987,6 +1045,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-2.1.3.tgz", "integrity": "sha512-iUrpSsem97bbXHHT/v3s7vaq8IIeMo6P6cXdeYHrx0wOJpMeBGQF7CB0mbJSiTm3//iq3L55JiEm8rA7CTVI8A==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1" }, @@ -998,6 +1057,7 @@ "version": "2.3.4", "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-2.3.4.tgz", "integrity": "sha512-CiZmPg9GeDKbKmJGEFvJBsJcFnh0AQRzOtQAzj1XEa8N/0/uSN/v1LYzgO7ry8hhO8+9KB7+DhSW0weqBra4Aw==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -1010,6 +1070,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-2.1.3.tgz", "integrity": "sha512-Jq4iPPdCmJojZTsPePn4r1ULShh6ONkokLuxp1Lnk4Sq7r7rJp4HlA1LbPBq4bD64TIzQezIpr1X+eh5NYkNxw==", + "peer": true, "dependencies": { "@smithy/eventstream-codec": "^2.1.3", "@smithy/is-array-buffer": "^2.1.1", @@ -1028,6 +1089,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-2.4.2.tgz", "integrity": "sha512-ntAFYN51zu3N3mCd95YFcFi/8rmvm//uX+HnK24CRbI6k5Rjackn0JhgKz5zOx/tbNvOpgQIwhSX+1EvEsBLbA==", + "peer": true, "dependencies": { "@smithy/middleware-endpoint": "^2.4.4", "@smithy/middleware-stack": "^2.1.3", @@ -1044,6 +1106,7 @@ "version": "2.10.1", "resolved": "https://registry.npmjs.org/@smithy/types/-/types-2.10.1.tgz", "integrity": "sha512-hjQO+4ru4cQ58FluQvKKiyMsFg0A6iRpGm2kqdH8fniyNd2WyanoOsYJfMX/IFLuLxEoW6gnRkNZy1y6fUUhtA==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -1055,6 +1118,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-2.1.3.tgz", "integrity": "sha512-X1NRA4WzK/ihgyzTpeGvI9Wn45y8HmqF4AZ/FazwAv8V203Ex+4lXqcYI70naX9ETqbqKVzFk88W6WJJzCggTQ==", + "peer": true, "dependencies": { "@smithy/querystring-parser": "^2.1.3", "@smithy/types": "^2.10.1", @@ -1065,6 +1129,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-2.1.1.tgz", "integrity": "sha512-UfHVpY7qfF/MrgndI5PexSKVTxSZIdz9InghTFa49QOvuu9I52zLPLUHXvHpNuMb1iD2vmc6R+zbv/bdMipR/g==", + "peer": true, "dependencies": { "@smithy/util-buffer-from": "^2.1.1", "tslib": "^2.5.0" @@ -1077,6 +1142,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-2.1.1.tgz", "integrity": "sha512-ekOGBLvs1VS2d1zM2ER4JEeBWAvIOUKeaFch29UjjJsxmZ/f0L3K3x0dEETgh3Q9bkZNHgT+rkdl/J/VUqSRag==", + "peer": true, "dependencies": { "tslib": "^2.5.0" } @@ -1085,6 +1151,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-2.2.1.tgz", "integrity": "sha512-/ggJG+ta3IDtpNVq4ktmEUtOkH1LW64RHB5B0hcr5ZaWBmo96UX2cIOVbjCqqDickTXqBWZ4ZO0APuaPrD7Abg==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -1096,6 +1163,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.1.1.tgz", "integrity": "sha512-clhNjbyfqIv9Md2Mg6FffGVrJxw7bgK7s3Iax36xnfVj6cg0fUG7I4RH0XgXJF8bxi+saY5HR21g2UPKSxVCXg==", + "peer": true, "dependencies": { "@smithy/is-array-buffer": "^2.1.1", "tslib": "^2.5.0" @@ -1108,6 +1176,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-2.2.1.tgz", "integrity": "sha512-50VL/tx9oYYcjJn/qKqNy7sCtpD0+s8XEBamIFo4mFFTclKMNp+rsnymD796uybjiIquB7VCB/DeafduL0y2kw==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -1119,6 +1188,7 @@ "version": "2.1.4", "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-2.1.4.tgz", "integrity": "sha512-J6XAVY+/g7jf03QMnvqPyU+8jqGrrtXoKWFVOS+n1sz0Lg8HjHJ1ANqaDN+KTTKZRZlvG8nU5ZrJOUL6VdwgcQ==", + "peer": true, "dependencies": { "@smithy/property-provider": "^2.1.3", "@smithy/smithy-client": "^2.4.2", @@ -1134,6 +1204,7 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-2.2.3.tgz", "integrity": "sha512-ttUISrv1uVOjTlDa3nznX33f0pthoUlP+4grhTvOzcLhzArx8qHB94/untGACOG3nlf8vU20nI2iWImfzoLkYA==", + "peer": true, "dependencies": { "@smithy/config-resolver": "^2.1.4", "@smithy/credential-provider-imds": "^2.2.4", @@ -1151,6 +1222,7 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-1.1.4.tgz", "integrity": "sha512-/qAeHmK5l4yQ4/bCIJ9p49wDe9rwWtOzhPHblu386fwPNT3pxmodgcs9jDCV52yK9b4rB8o9Sj31P/7Vzka1cg==", + "peer": true, "dependencies": { "@smithy/node-config-provider": "^2.2.4", "@smithy/types": "^2.10.1", @@ -1164,6 +1236,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-2.1.1.tgz", "integrity": "sha512-3UNdP2pkYUUBGEXzQI9ODTDK+Tcu1BlCyDBaRHwyxhA+8xLP8agEKQq4MGmpjqb4VQAjq9TwlCQX0kP6XDKYLg==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -1175,6 +1248,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-2.1.3.tgz", "integrity": "sha512-/+2fm7AZ2ozl5h8wM++ZP0ovE9/tiUUAHIbCfGfb3Zd3+Dyk17WODPKXBeJ/TnK5U+x743QmA0xHzlSm8I/qhw==", + "peer": true, "dependencies": { "@smithy/types": "^2.10.1", "tslib": "^2.5.0" @@ -1187,6 +1261,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-2.1.3.tgz", "integrity": "sha512-Kbvd+GEMuozbNUU3B89mb99tbufwREcyx2BOX0X2+qHjq6Gvsah8xSDDgxISDwcOHoDqUWO425F0Uc/QIRhYkg==", + "peer": true, "dependencies": { "@smithy/service-error-classification": "^2.1.3", "@smithy/types": "^2.10.1", @@ -1200,6 +1275,7 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-2.1.3.tgz", "integrity": "sha512-HvpEQbP8raTy9n86ZfXiAkf3ezp1c3qeeO//zGqwZdrfaoOpGKQgF2Sv1IqZp7wjhna7pvczWaGUHjcOPuQwKw==", + "peer": true, "dependencies": { "@smithy/fetch-http-handler": "^2.4.3", "@smithy/node-http-handler": "^2.4.1", @@ -1218,6 +1294,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-2.1.1.tgz", "integrity": "sha512-saVzI1h6iRBUVSqtnlOnc9ssU09ypo7n+shdQ8hBTZno/9rZ3AuRYvoHInV57VF7Qn7B+pFJG7qTzFiHxWlWBw==", + "peer": true, "dependencies": { "tslib": "^2.5.0" }, @@ -1229,6 +1306,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.1.1.tgz", "integrity": "sha512-BqTpzYEcUMDwAKr7/mVRUtHDhs6ZoXDi9NypMvMfOr/+u1NW7JgqodPDECiiLboEm6bobcPcECxzjtQh865e9A==", + "peer": true, "dependencies": { "@smithy/util-buffer-from": "^2.1.1", "tslib": "^2.5.0" @@ -1638,7 +1716,8 @@ "node_modules/bowser": { "version": "2.11.0", "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", - "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==", + "peer": true }, "node_modules/cdktf": { "version": "0.19.2", @@ -2257,6 +2336,7 @@ "url": "https://github.com/sponsors/NaturalIntelligence" } ], + "peer": true, "dependencies": { "strnum": "^1.0.5" }, @@ -2267,17 +2347,20 @@ "node_modules/strnum": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "peer": true }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "peer": true }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "peer": true, "bin": { "uuid": "dist/bin/uuid" } diff --git a/eventbridge/package.json b/eventbridge/package.json index 3e2cdb9b..d60f52cc 100644 --- a/eventbridge/package.json +++ b/eventbridge/package.json @@ -18,12 +18,10 @@ "constructs": "^10.3.0" }, "peerDependencies": { + "@aws-sdk/client-eventbridge": "^3.525.0", "@cdktf/provider-aws": "^18", "aws-cdk-lib": "^2.109.0", "cdktf": "^0.19", "constructs": "^10.3" - }, - "dependencies": { - "@aws-sdk/client-eventbridge": "^3.525.0" } } diff --git a/eventbridge/platform/aws/publish.js b/eventbridge/platform/aws/publish.js index 17628610..9ac38d75 100644 --- a/eventbridge/platform/aws/publish.js +++ b/eventbridge/platform/aws/publish.js @@ -1,23 +1,13 @@ const { EventBridgeClient, PutEventsCommand } = require("@aws-sdk/client-eventbridge"); -const putEvent = async (eventBridgeName, event) => { - console.log(`Publishing event to EventBridge: ${eventBridgeName} - ${JSON.stringify(event)}`); - const client = new EventBridgeClient({ region: process.env.AWS_REGION }); - const input = { - Entries: [ - { - Source: event.source, - DetailType: event.detailType, - Detail: JSON.stringify(event.detail), - EventBusName: eventBridgeName, - Resources: event.resources, - }, - ], - }; +const client = new EventBridgeClient(); + +const _putEvent = async (eventBridgeName, input) => { + console.log(`Publishing event to EventBridge: ${eventBridgeName} - ${JSON.stringify(input)}`); const command = new PutEventsCommand(input); await client.send(command); } module.exports = { - putEvent + _putEvent } diff --git a/eventbridge/platform/aws/publish.w b/eventbridge/platform/aws/publish.w new file mode 100644 index 00000000..83ac26a7 --- /dev/null +++ b/eventbridge/platform/aws/publish.w @@ -0,0 +1,34 @@ +bring "../../types.w" as types; + +pub struct PutEventCommandEntry { + Source: str; + DetailType: str; + Detail: str; + EventBusName: str; + Resources: Array; +} + +pub struct PutEventCommandInput { + Entries: Array; +} + +pub class Util { + pub static inflight putEvent(name: str, events: Array): void { + let entries = MutArray[]; + for event in events { + entries.push(PutEventCommandEntry{ + Source: event.source, + DetailType: event.detailType, + Detail: Json.stringify(event.detail), + EventBusName: name, + Resources: event.resources, + }); + } + let input = { + Entries: entries.copy(), + }; + Util._putEvent(name, input); + } + + extern "./publish.js" pub static inflight _putEvent(name: str, event: PutEventCommandInput): void; +} diff --git a/eventbridge/platform/awscdk/eventbridge.w b/eventbridge/platform/awscdk/eventbridge.w index a85c5dda..f6bc02a9 100644 --- a/eventbridge/platform/awscdk/eventbridge.w +++ b/eventbridge/platform/awscdk/eventbridge.w @@ -1,10 +1,10 @@ bring cloud; bring aws; bring "./../../types.w" as types; +bring "../aws/publish.w" as awsUtils; bring "aws-cdk-lib" as cdk; pub class Bus impl types.IBus { - extern "../aws/publish.js" pub static inflight putEvent(name: str, event: types.PublishEvent): void; extern "./helper.js" pub static addRulePermission(handler: str, arn: str): void; eventBridge: cdk.aws_events.IEventBus; @@ -65,14 +65,14 @@ pub class Bus impl types.IBus { cdkQueue.addToResourcePolicy(statement); } - pub inflight publish(event: types.PublishEvent): void { + pub inflight putEvents(events: Array): void { let name = this.eventBridge.eventBusName; - Bus.putEvent(name, event); + awsUtils.putEvent(name, events); } pub onLift(host: std.IInflightHost, ops: Array) { if let host = aws.Function.from(host) { - if ops.contains("publish") { + if ops.contains("putEvents") { host.addPolicyStatements(aws.PolicyStatement { effect: cdk.aws_iam.Effect.ALLOW, actions: ["events:PutEvents"], diff --git a/eventbridge/platform/sim/bus.w b/eventbridge/platform/sim/bus.w index 28812361..ba3cd07a 100644 --- a/eventbridge/platform/sim/bus.w +++ b/eventbridge/platform/sim/bus.w @@ -57,21 +57,23 @@ pub class EventBridgeBus { return handler.onMessageHandler; } - pub inflight publish(event: types.PublishEvent): void { - let fullEvent = Json { - id: util.uuidv4(), - time: "{datetime.utcNow().toIso()}", - region: "local", - account: "local", - resources: event.resources, - version: event.version, - source: event.source, - "detail-type": event.detailType, - detail: event.detail, - }; - - let stringified = Json.stringify(fullEvent); - log("EventBridge: published event: " + stringified); - this.topic.publish(stringified); + pub inflight putEvents(events: Array): void { + for event in events { + let fullEvent = Json { + id: util.uuidv4(), + time: "{datetime.utcNow().toIso()}", + region: "local", + account: "local", + resources: event.resources, + version: event.version, + source: event.source, + "detail-type": event.detailType, + detail: event.detail, + }; + + let stringified = Json.stringify(fullEvent); + log("EventBridge: published event: " + stringified); + this.topic.publish(stringified); + } } } \ No newline at end of file diff --git a/eventbridge/platform/sim/eventbridge.w b/eventbridge/platform/sim/eventbridge.w index eb8d72c8..2833c53a 100644 --- a/eventbridge/platform/sim/eventbridge.w +++ b/eventbridge/platform/sim/eventbridge.w @@ -47,7 +47,7 @@ pub class Bus impl types.IBus { let rule = new Rule(this.bus) as "Rule \"{name}\""; } - pub inflight publish(event: types.PublishEvent): void { - this.bus.publish(event); + pub inflight putEvents(events: Array): void { + this.bus.putEvents(events); } } \ No newline at end of file diff --git a/eventbridge/platform/tfaws/eventbridge.w b/eventbridge/platform/tfaws/eventbridge.w index eaa042d6..6eba158f 100644 --- a/eventbridge/platform/tfaws/eventbridge.w +++ b/eventbridge/platform/tfaws/eventbridge.w @@ -1,12 +1,11 @@ bring cloud; bring aws; bring "./../../types.w" as types; +bring "../aws/publish.w" as awsUtils; bring "cdktf" as cdktf; bring "@cdktf/provider-aws" as tfAws; pub class Bus impl types.IBus { - extern "../aws/publish.js" pub static inflight putEvent(name: str, event: types.PublishEvent): void; - busName: str; busArn: str; @@ -89,14 +88,14 @@ pub class Bus impl types.IBus { ) as "{name}-policy"; } - pub inflight publish(event: types.PublishEvent): void { + pub inflight putEvents(events: Array): void { let name = this.busName; - Bus.putEvent(name, event); + awsUtils.putEvent(name, events); } pub onLift(host: std.IInflightHost, ops: Array) { if let host = aws.Function.from(host) { - if ops.contains("publish") { + if ops.contains("putEvents") { host.addPolicyStatements(aws.PolicyStatement { actions: ["events:PutEvents"], resources: [this.busArn], diff --git a/eventbridge/types.w b/eventbridge/types.w index 94730126..ecfa82c2 100644 --- a/eventbridge/types.w +++ b/eventbridge/types.w @@ -26,7 +26,7 @@ pub struct PublishEvent { } pub interface IBus extends std.IResource { - inflight publish(event: PublishEvent): void; + inflight putEvents(events: Array): void; subscribeFunction(name: str, handler: inflight (Event): void, pattern: Json): void; subscribeQueue(name: str, queue: cloud.Queue, pattern: Json): void; }