diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..4a7ea303 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/workflows/bedrock-release.yaml b/.github/workflows/bedrock-release.yaml index a701cd40..0f05b146 100644 --- a/.github/workflows/bedrock-release.yaml +++ b/.github/workflows/bedrock-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - bedrock/** + paths-ignore: + - bedrock/package-lock.json jobs: build-bedrock: runs-on: ubuntu-latest diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml new file mode 100644 index 00000000..8f39d30d --- /dev/null +++ b/.github/workflows/canary.yaml @@ -0,0 +1,195 @@ +name: Canary Workflow +on: + schedule: + - cron: 0 * * * * + workflow_dispatch: {} +jobs: + canary-bedrock: + name: Test bedrock + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: bedrock + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: bedrock + - name: Test + run: wing test + working-directory: bedrock + canary-checks: + name: Test checks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: checks + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: checks + - name: Test + run: wing test + working-directory: checks + canary-fifoqueue: + name: Test fifoqueue + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: fifoqueue + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: fifoqueue + - name: Test + run: wing test + working-directory: fifoqueue + canary-github: + name: Test github + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: github + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: github + - name: Test + run: wing test + working-directory: github + canary-ngrok: + name: Test ngrok + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: ngrok + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: ngrok + - name: Test + run: wing test + working-directory: ngrok + canary-postgres: + name: Test postgres + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: postgres + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: postgres + - name: Test + run: wing test + working-directory: postgres + canary-redis: + name: Test redis + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: redis + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: redis + - name: Test + run: wing test + working-directory: redis + canary-sagemaker: + name: Test sagemaker + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: sagemaker + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: sagemaker + - name: Test + run: wing test + working-directory: sagemaker + canary-websockets: + name: Test websockets + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: websockets + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: websockets + - name: Test + run: wing test + working-directory: websockets diff --git a/.github/workflows/checks-release.yaml b/.github/workflows/checks-release.yaml index b8b6ac5e..0296264a 100644 --- a/.github/workflows/checks-release.yaml +++ b/.github/workflows/checks-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - checks/** + paths-ignore: + - checks/package-lock.json jobs: build-checks: runs-on: ubuntu-latest diff --git a/.github/workflows/containers-release.yaml b/.github/workflows/containers-release.yaml index 70bdc7e0..9f3db2bb 100644 --- a/.github/workflows/containers-release.yaml +++ b/.github/workflows/containers-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - containers/** + paths-ignore: + - containers/package-lock.json jobs: build-containers: runs-on: ubuntu-latest diff --git a/.github/workflows/fifoqueue-release.yaml b/.github/workflows/fifoqueue-release.yaml index 7e890257..b4274a46 100644 --- a/.github/workflows/fifoqueue-release.yaml +++ b/.github/workflows/fifoqueue-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - fifoqueue/** + paths-ignore: + - fifoqueue/package-lock.json jobs: build-fifoqueue: runs-on: ubuntu-latest diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 7aea3c70..b2f78f12 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - github/** + paths-ignore: + - github/package-lock.json jobs: build-github: runs-on: ubuntu-latest diff --git a/.github/workflows/ngrok-release.yaml b/.github/workflows/ngrok-release.yaml index 3f6b77f4..7dc2296b 100644 --- a/.github/workflows/ngrok-release.yaml +++ b/.github/workflows/ngrok-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - ngrok/** + paths-ignore: + - ngrok/package-lock.json jobs: build-ngrok: runs-on: ubuntu-latest diff --git a/.github/workflows/postgres-release.yaml b/.github/workflows/postgres-release.yaml index b87bdd89..2f7f0deb 100644 --- a/.github/workflows/postgres-release.yaml +++ b/.github/workflows/postgres-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - postgres/** + paths-ignore: + - postgres/package-lock.json jobs: build-postgres: runs-on: ubuntu-latest diff --git a/.github/workflows/redis-release.yaml b/.github/workflows/redis-release.yaml index 21d64019..e09d48e7 100644 --- a/.github/workflows/redis-release.yaml +++ b/.github/workflows/redis-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - redis/** + paths-ignore: + - redis/package-lock.json jobs: build-redis: runs-on: ubuntu-latest diff --git a/.github/workflows/sagemaker-pull.yaml b/.github/workflows/sagemaker-pull.yaml new file mode 100644 index 00000000..71fa42fe --- /dev/null +++ b/.github/workflows/sagemaker-pull.yaml @@ -0,0 +1,29 @@ +name: sagemaker-pull +on: + pull_request: + paths: + - sagemaker/** +jobs: + build-sagemaker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: sagemaker + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: sagemaker + - name: Test + run: wing test + working-directory: sagemaker + - name: Pack + run: wing pack + working-directory: sagemaker diff --git a/.github/workflows/sagemaker-release.yaml b/.github/workflows/sagemaker-release.yaml new file mode 100644 index 00000000..d4c8269e --- /dev/null +++ b/.github/workflows/sagemaker-release.yaml @@ -0,0 +1,55 @@ +name: sagemaker-release +on: + push: + branches: + - main + paths: + - sagemaker/** + paths-ignore: + - sagemaker/package-lock.json +jobs: + build-sagemaker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: sagemaker + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: sagemaker + - name: Test + run: wing test + working-directory: sagemaker + - name: Pack + run: wing pack + working-directory: sagemaker + - name: Get package version + run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >> + "$GITHUB_ENV" + working-directory: sagemaker + - name: Publish + run: npm publish --access=public --registry https://registry.npmjs.org --tag + latest *.tgz + working-directory: sagemaker + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Tag commit + uses: tvdias/github-tagger@v0.0.1 + with: + repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} + tag: sagemaker-v${{ env.WINGLIB_VERSION }} + - name: GitHub release + uses: softprops/action-gh-release@v1 + with: + name: sagemaker v${{ env.WINGLIB_VERSION }} + tag_name: sagemaker-v${{ env.WINGLIB_VERSION }} + files: "*.tgz" + token: ${{ secrets.PROJEN_GITHUB_TOKEN }} diff --git a/.github/workflows/vite-pull.yaml b/.github/workflows/vite-pull.yaml new file mode 100644 index 00000000..e3ad1aef --- /dev/null +++ b/.github/workflows/vite-pull.yaml @@ -0,0 +1,26 @@ +name: vite-pull +on: + pull_request: + paths: + - vite/** +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: vite + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install + working-directory: vite + - name: Test + run: wing test + working-directory: vite diff --git a/.github/workflows/vite-release.yaml b/.github/workflows/vite-release.yaml new file mode 100644 index 00000000..2d738831 --- /dev/null +++ b/.github/workflows/vite-release.yaml @@ -0,0 +1,38 @@ +name: vite-release +on: + push: + branches: + - main + paths: + - vite/** +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: vite + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install + working-directory: vite + - name: Test + run: wing test + working-directory: vite + - name: Pack + run: wing pack + working-directory: vite + - name: Publish + run: + npm publish --access=public --registry https://registry.npmjs.org --tag + latest *.tgz + working-directory: vite + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/websockets-release.yaml b/.github/workflows/websockets-release.yaml index e5a9d2e8..f6416a70 100644 --- a/.github/workflows/websockets-release.yaml +++ b/.github/workflows/websockets-release.yaml @@ -5,6 +5,8 @@ on: - main paths: - websockets/** + paths-ignore: + - websockets/package-lock.json jobs: build-websockets: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index f74125a9..783e1112 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/node_modules/** target/ +**/.env diff --git a/.mergify.yml b/.mergify.yml index 160e661f..db73261a 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -23,6 +23,7 @@ pull_request_rules: - -label~=(🚧 pr/do-not-merge|⚠️ pr/review-mutation) - -merged - -closed + - -draft - branch-protection-review-decision=APPROVED - "#approved-reviews-by>=1" - "#changes-requested-reviews-by=0" @@ -72,6 +73,7 @@ pull_request_rules: mergify/review-config) - -merged - -closed + - -draft - "#approved-reviews-by>=1" - "#changes-requested-reviews-by=0" - "#review-threads-unresolved=0" diff --git a/canary.w b/canary.w new file mode 100644 index 00000000..354189bf --- /dev/null +++ b/canary.w @@ -0,0 +1,62 @@ +bring fs; + +pub class CanaryWorkflow { + new(workflowdir: str, libs: Array, skipLibs: Array?) { + let testLibSteps = (lib: str): Array => { + return [ + { + name: "Checkout", + uses: "actions/checkout@v3", + with: { + "sparse-checkout": lib + } + }, + { + name: "Setup Node.js", + uses: "actions/setup-node@v3", + with: { + "node-version": "20.x", + "registry-url": "https://registry.npmjs.org", + }, + }, + { + name: "Install winglang", + run: "npm i -g winglang", + }, + { + name: "Install dependencies", + run: "npm install --include=dev", + "working-directory": lib, + }, + { + name: "Test", + run: "wing test", + "working-directory": lib, + }, + ]; + }; + + let jobs = MutJson {}; + for lib in libs { + if (skipLibs ?? []).contains(lib) { + continue; + } + jobs.set("canary-{lib}", { + name: "Test {lib}", + "runs-on": "ubuntu-latest", + steps: testLibSteps(lib), + }); + } + + fs.writeYaml("{workflowdir}/canary.yaml", { + name: "Canary Workflow", + on: { + schedule: [{ + cron: "0 * * * *" + }], + workflow_dispatch: {}, + }, + jobs: Json.deepCopy(jobs), + }); + } +} diff --git a/checks/check.w b/checks/check.w index 49334705..62b46298 100644 --- a/checks/check.w +++ b/checks/check.w @@ -88,7 +88,7 @@ pub class Check impl ICheck { * Invokes the check and returns it's result */ pub inflight run(): r.CheckResult { - let result = this.invoker.invoke(""); + let result = this.invoker.invoke("")!; return r.CheckResult.fromJson(Json.parse(result)); } @@ -98,4 +98,4 @@ pub class Check impl ICheck { pub inflight latest(): r.CheckResult? { return this.results.latest(this.checkid); } -} \ No newline at end of file +} diff --git a/checks/package-lock.json b/checks/package-lock.json index b3546245..f4057063 100644 --- a/checks/package-lock.json +++ b/checks/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/checks", - "version": "0.0.6", + "version": "0.0.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/checks", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT" }, "node_modules/.pnpm/constructs@10.0.0/node_modules/constructs": { diff --git a/checks/package.json b/checks/package.json index 95778b5a..ecbc0614 100644 --- a/checks/package.json +++ b/checks/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/checks", - "version": "0.0.6", + "version": "0.0.7", "description": "Cloud checks", "publishConfig": { "access": "public", @@ -21,4 +21,4 @@ "name": "Elad Ben-Israel" }, "license": "MIT" -} \ No newline at end of file +} diff --git a/containers/aws.w b/containers/aws.w index 056d9aa1..f256431c 100644 --- a/containers/aws.w +++ b/containers/aws.w @@ -3,7 +3,7 @@ bring "@cdktf/provider-aws" as aws; pub class Aws { pub static getOrCreate(scope: std.IResource): Aws { - let stack = cdktf.TerraformStack.of(scope); + let stack = nodeof(scope).root; let id = "WingAwsUtil"; let existing: Aws? = unsafeCast(stack.node.tryFindChild(id)); return (existing ?? new Aws() as id in stack); diff --git a/containers/containers.test.w b/containers/containers.test.w index 104b19e6..0b01a385 100644 --- a/containers/containers.test.w +++ b/containers/containers.test.w @@ -35,6 +35,7 @@ let httpGet = inflight (url: str?): str => { test "access public url" { let helloBody = httpGet(hello.publicUrl); + log(helloBody); assert(helloBody.contains(message)); let echoBody = httpGet(echo.publicUrl); diff --git a/containers/ecr.main.w b/containers/ecr.main.w index e9db9a1e..fe313564 100644 --- a/containers/ecr.main.w +++ b/containers/ecr.main.w @@ -1,8 +1,12 @@ bring "./tfaws-ecr.w" as ecr; bring "./utils.w" as utils; +bring util; + +if util.env("WING_TARGET") == "tf-aws" { + new ecr.Repository( + name: "my-repository", + directory: utils.dirname() + "/test/my-app", + tag: "tag1" + ); +} -new ecr.Repository( - name: "my-repository", - directory: utils.dirname() + "/test/my-app", - tag: "tag1" -); diff --git a/containers/eks.main.w b/containers/eks.main.w index 8bdf1455..bc0cf2f0 100644 --- a/containers/eks.main.w +++ b/containers/eks.main.w @@ -1,4 +1,7 @@ bring "./tfaws-eks.w" as eks; +bring util; -// create an eks cluster -new eks.Cluster("wing-eks"); +if util.env("WING_TARGET") == "tf-aws" { + // create an eks cluster + new eks.Cluster("wing-eks"); +} \ No newline at end of file diff --git a/containers/package-lock.json b/containers/package-lock.json index 051e6d57..5a1aa38e 100644 --- a/containers/package-lock.json +++ b/containers/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/containers", - "version": "0.0.19", + "version": "0.0.21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/containers", - "version": "0.0.19", + "version": "0.0.21", "license": "MIT", "dependencies": { "@cdktf/provider-aws": "^18.0.5", @@ -18,8 +18,8 @@ "glob": "^10.3.10" }, "peerDependencies": { - "cdktf": "^0.19.1", - "winglang": "^0.54.39" + "cdktf": "*", + "winglang": "*" } }, "node_modules/@cdktf/provider-aws": { @@ -808,6 +808,15 @@ "@octokit/openapi-types": "^12.11.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -9759,6 +9768,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "optional": true, "engines": { "node": ">=10" } diff --git a/containers/package.json b/containers/package.json index f9906033..a36a3b4f 100644 --- a/containers/package.json +++ b/containers/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/containers", - "version": "0.0.19", + "version": "0.0.21", "description": "Container support for Wing", "repository": { "type": "git", @@ -13,8 +13,8 @@ }, "license": "MIT", "peerDependencies": { - "cdktf": "^0.19.1", - "winglang": "^0.54.39" + "cdktf": "*", + "winglang": "*" }, "dependencies": { "@cdktf/provider-aws": "^18.0.5", diff --git a/containers/tfaws-ecr.w b/containers/tfaws-ecr.w index e92f4892..fc0cff35 100644 --- a/containers/tfaws-ecr.w +++ b/containers/tfaws-ecr.w @@ -55,13 +55,12 @@ pub class Repository { let image = "{r.repositoryUrl}:{props.tag}"; let arch = "linux/amd64"; - // null provider singleton - let stack = cdktf.TerraformStack.of(this); + let root = nodeof(this).root; let nullProviderId = "NullProvider"; - if !stack.node.tryFindChild(nullProviderId)? { - new null_provider.provider.NullProvider() as nullProviderId in stack; - } + if !root.node.tryFindChild(nullProviderId)? { + new null_provider.provider.NullProvider() as nullProviderId in root; + } let publish = new null_provider.resource.Resource( dependsOn: [r], diff --git a/containers/tfaws-eks.w b/containers/tfaws-eks.w index 6aa96b89..3ea80539 100644 --- a/containers/tfaws-eks.w +++ b/containers/tfaws-eks.w @@ -28,10 +28,10 @@ pub class ClusterBase impl ICluster { } pub kubernetesProvider(): cdktf.TerraformProvider { - let stack = cdktf.TerraformStack.of(this); + let root = nodeof(this).root; let singletonKey = "WingKubernetesProvider"; let attributes = this.attributes(); - let existing = stack.node.tryFindChild(singletonKey); + let existing = root.node.tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } @@ -45,14 +45,14 @@ pub class ClusterBase impl ICluster { args: ["eks", "get-token", "--cluster-name", attributes.name], command: "aws", } - ) as singletonKey in stack; + ) as singletonKey in root; } pub helmProvider(): cdktf.TerraformProvider { - let stack = cdktf.TerraformStack.of(this); + let root = nodeof(this).root; let singletonKey = "WingHelmProvider"; let attributes = this.attributes(); - let existing = stack.node.tryFindChild(singletonKey); + let existing = root.node.tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } @@ -65,7 +65,7 @@ pub class ClusterBase impl ICluster { args: ["eks", "get-token", "--cluster-name", attributes.name], command: "aws", } - }) as singletonKey in stack; + }) as singletonKey in root; } } @@ -85,15 +85,15 @@ pub class Cluster extends ClusterBase impl ICluster { /** singleton */ pub static getOrCreate(scope: std.IResource): ICluster { - let stack = cdktf.TerraformStack.of(scope); + let root = nodeof(scope).root; let uid = "WingEksCluster"; - let existing: ICluster? = unsafeCast(stack.node.tryFindChild(uid)); + let existing: ICluster? = unsafeCast(root.node.tryFindChild(uid)); let newCluster = (): ICluster => { if let attrs = Cluster.tryGetClusterAttributes() { - return new ClusterRef(attrs) as uid in stack; + return new ClusterRef(attrs) as uid in root; } else { let clusterName = "wing-eks-{std.Node.of(scope).addr.substring(0, 6)}"; - return new Cluster(clusterName) as uid in stack; + return new Cluster(clusterName) as uid in root; } }; diff --git a/fifoqueue/api.w b/fifoqueue/api.w index 24b1ef77..fac4d631 100644 --- a/fifoqueue/api.w +++ b/fifoqueue/api.w @@ -9,6 +9,6 @@ pub struct PushOptions { pub struct SetConsumerOptions extends cloud.QueueSetConsumerOptions {} pub interface IFifoQueue { - setConsumer(handler: inflight (str): void, options: SetConsumerOptions?); - inflight push(message: str, options: PushOptions); + setConsumer(handler: inflight (str): void, options: SetConsumerOptions?): void; + inflight push(message: str, options: PushOptions): void; } diff --git a/fifoqueue/fifo-queue.aws.w b/fifoqueue/fifo-queue.aws.w index 74caeb05..e0964f4e 100644 --- a/fifoqueue/fifo-queue.aws.w +++ b/fifoqueue/fifo-queue.aws.w @@ -75,5 +75,5 @@ pub class FifoQueue_aws impl api.IFifoQueue { FifoQueue_aws._push(this.url, message, options.groupId); } - extern "./aws.js" static inflight _push(queueUrl: str, message: str, groupId: str); -} \ No newline at end of file + extern "./aws.js" static inflight _push(queueUrl: str, message: str, groupId: str): void; +} diff --git a/fifoqueue/package-lock.json b/fifoqueue/package-lock.json index 1e9bbc82..5148e430 100644 --- a/fifoqueue/package-lock.json +++ b/fifoqueue/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/fifoqueue", - "version": "0.0.2", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/fifoqueue", - "version": "0.0.2", + "version": "0.0.3", "license": "MIT", "dependencies": { "@aws-sdk/client-sqs": "^3.460.0", diff --git a/fifoqueue/package.json b/fifoqueue/package.json index bd2a091e..aa4a2294 100644 --- a/fifoqueue/package.json +++ b/fifoqueue/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/fifoqueue", - "version": "0.0.2", + "version": "0.0.3", "description": "A wing library to work with FIFO (first-in first-out) Queues", "author": { "name": "Elad Cohen", diff --git a/generate-workflows.main.w b/generate-workflows.main.w index 34b6878d..9a8bb3b9 100644 --- a/generate-workflows.main.w +++ b/generate-workflows.main.w @@ -1,13 +1,15 @@ bring fs; +bring "./canary.w" as canary; bring "./library.w" as l; -bring "./stale.w" as stale; bring "./mergify.w" as mergify; bring "./pr-lint.w" as prlint; +bring "./stale.w" as stale; -// clean up let workflowdir = ".github/workflows"; -fs.remove(".github/workflows"); -fs.mkdir(".github/workflows"); + +// clean up +fs.remove(workflowdir); +fs.mkdir(workflowdir); let libs = MutArray[]; @@ -24,3 +26,9 @@ for file in fs.readdir(".") { new stale.StaleWorkflow(workflowdir); new mergify.MergifyWorkflow(libs.copy()); new prlint.PullRequestLintWorkflow(workflowdir); + +let skipCanaryTests = [ + "containers" // https://github.com/winglang/wing/issues/5716 +]; + +new canary.CanaryWorkflow(workflowdir, libs.copy(), skipCanaryTests); diff --git a/github/package-lock.json b/github/package-lock.json index 473924a5..0f37db40 100644 --- a/github/package-lock.json +++ b/github/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/github", - "version": "0.0.4", + "version": "0.0.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/github", - "version": "0.0.4", + "version": "0.0.5", "license": "MIT", "dependencies": { "@probot/adapter-aws-lambda-serverless": "^3.0.4", diff --git a/github/package.json b/github/package.json index a4ae2c0f..a9108de0 100644 --- a/github/package.json +++ b/github/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/github", "description": "A Wing library for GitHub Probot", - "version": "0.0.4", + "version": "0.0.5", "author": { "name": "Elad Cohen", "email": "eladc@wing.cloud" diff --git a/github/probot/adapter.w b/github/probot/adapter.w index 2511594c..c1d3e207 100644 --- a/github/probot/adapter.w +++ b/github/probot/adapter.w @@ -22,7 +22,7 @@ pub class ProbotAdapter { extern "./probot.js" pub static inflight createProbotAdapter(options: CreateAdapterOptions): probot.ProbotInstance; credentialsSupplier: IProbotAppCredentialsSupplier; - inflight var instance: probot.ProbotInstance?; + inflight var instance: probot.ProbotInstance; new(props: ProbotAdapterProps) { this.credentialsSupplier = props.credentialsSupplier; @@ -37,34 +37,34 @@ pub class ProbotAdapter { } pub inflight handlePullRequstOpened(handler: inflight (probot.PullRequestOpenedContext): void) { - this.instance?.webhooks?.on("pull_request.opened", handler); + this.instance.webhooks?.on("pull_request.opened", handler); } pub inflight handlePullRequstReopened(handler: inflight (probot.PullRequestOpenedContext): void) { - this.instance?.webhooks?.on("pull_request.reopened", handler); + this.instance.webhooks?.on("pull_request.reopened", handler); } pub inflight handlePullRequstSync(handler: inflight (probot.PullRequestSyncContext): void) { - this.instance?.webhooks?.on("pull_request.synchronize", handler); + this.instance.webhooks?.on("pull_request.synchronize", handler); } pub inflight handlePullRequstClosed(handler: inflight (probot.PullRequestClosedContext): void) { - this.instance?.webhooks?.on("pull_request.closed", handler); + this.instance.webhooks?.on("pull_request.closed", handler); } pub inflight handlePush(handler: inflight (probot.PushContext): void) { - this.instance?.webhooks?.on("push", handler); + this.instance.webhooks?.on("push", handler); } pub inflight verifyAndReceive(props: probot.VerifyAndReceieveProps) { - this.instance?.webhooks?.verifyAndReceive(props); + this.instance.webhooks?.verifyAndReceive(props); } pub inflight auth(installationId: num): octokit.OctoKit { - if let kit = this.instance?.auth?.call(this.instance, installationId) { + if let kit = this.instance.auth?.call(this.instance, installationId) { return kit; } else { throw "auth: fail to get octokit"; } } -} \ No newline at end of file +} diff --git a/github/probot/types.w b/github/probot/types.w index f02ed857..ea588f1b 100644 --- a/github/probot/types.w +++ b/github/probot/types.w @@ -72,15 +72,15 @@ pub struct VerifyAndReceieveProps { } pub interface IProbotWebhooks { - inflight on(name: str, handler: inflight (): void); - inflight verifyAndReceive(props: VerifyAndReceieveProps); + inflight on(name: str, handler: inflight (): void): void; + inflight verifyAndReceive(props: VerifyAndReceieveProps): void; } pub interface IProbotAuth { - inflight call(ProbotInstance, installationId: num): octokit.OctoKit; + inflight call(instance: ProbotInstance, installationId: num): octokit.OctoKit; } pub struct ProbotInstance { webhooks: IProbotWebhooks; auth: IProbotAuth; -} \ No newline at end of file +} diff --git a/library.w b/library.w index 4e62eb04..488a14fe 100644 --- a/library.w +++ b/library.w @@ -113,7 +113,8 @@ pub class Library { on: { push: { branches: ["main"], - paths: ["{libdir}/**"] + paths: ["{libdir}/**"], + "paths-ignore": ["{libdir}/package-lock.json"], } }, jobs: Json.deepCopy(releaseJobs), @@ -128,7 +129,7 @@ pub class Library { name: "{base}-pull", on: { pull_request: { - paths: ["{libdir}/**"] + paths: ["{libdir}/**"], } }, jobs: Json.deepCopy(pullJobs), diff --git a/mergify.w b/mergify.w index e276a2fd..8c2643a1 100644 --- a/mergify.w +++ b/mergify.w @@ -39,6 +39,7 @@ pub class MergifyWorkflow { "-label~=(🚧 pr/do-not-merge|⚠️ pr/review-mutation)", "-merged", "-closed", + "-draft", "branch-protection-review-decision=APPROVED", "#approved-reviews-by>=1", "#changes-requested-reviews-by=0", @@ -56,6 +57,7 @@ pub class MergifyWorkflow { "-label~=(🚧 pr/do-not-merge|⚠️ pr/review-mutation|⚠️ mergify/review-config)", "-merged", "-closed", + "-draft", "#approved-reviews-by>=1", "#changes-requested-reviews-by=0", "#review-threads-unresolved=0", diff --git a/ngrok/ngrok.w b/ngrok/ngrok.w index cfaaed6e..f8db12d0 100644 --- a/ngrok/ngrok.w +++ b/ngrok/ngrok.w @@ -30,9 +30,10 @@ pub class Tunnel { throw "NGROK_AUTHTOKEN is not defined"; } + let dirname = Tunnel.dirname(); let s = new cloud.Service(inflight () => { try { - let child = Tunnel.spawn("node", Array["./ngrok.js", url, props?.domain]); + let child = Tunnel.spawn("node", Array["{dirname}/ngrok.js", url, props?.domain]); log("ngrok: {child.url()} => {url}"); let url = child.url(); this.state.set("url", url); @@ -63,4 +64,7 @@ pub class Tunnel { extern "./util.js" static inflight spawn(cmd: str, args: Array, opts: Json?): ChildProcess; + + extern "./util.js" + static dirname(): str; } \ No newline at end of file diff --git a/ngrok/package-lock.json b/ngrok/package-lock.json index 367e2b52..77fdd6fd 100644 --- a/ngrok/package-lock.json +++ b/ngrok/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/ngrok", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/ngrok", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "dependencies": { "@ngrok/ngrok": "^0.9.1" diff --git a/ngrok/package.json b/ngrok/package.json index 1fdd0aa4..c0ee94c8 100644 --- a/ngrok/package.json +++ b/ngrok/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/ngrok", - "version": "0.0.1", + "version": "0.0.2", "description": "ngrok library for Wing", "author": { "name": "Elad Ben-Israel", @@ -15,4 +15,4 @@ "dependencies": { "@ngrok/ngrok": "^0.9.1" } -} \ No newline at end of file +} diff --git a/ngrok/util.js b/ngrok/util.js index e7028dd8..365c82e2 100644 --- a/ngrok/util.js +++ b/ngrok/util.js @@ -1,5 +1,7 @@ const { spawn } = require("child_process"); +exports.dirname = () => __dirname; + exports.spawn = async (cmd, args, opts) => { const child = spawn(cmd, args, { stdio: "pipe", ...opts }); return new Promise((resolve, reject) => { diff --git a/postgres/package-lock.json b/postgres/package-lock.json index 7c7fce63..e7745e0d 100644 --- a/postgres/package-lock.json +++ b/postgres/package-lock.json @@ -597,6 +597,15 @@ "@octokit/openapi-types": "^12.11.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -9679,6 +9688,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "optional": true, "engines": { "node": ">=10" } diff --git a/redis/package-lock.json b/redis/package-lock.json index 9e511a4a..e019b384 100644 --- a/redis/package-lock.json +++ b/redis/package-lock.json @@ -799,6 +799,15 @@ "@octokit/openapi-types": "^12.11.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -9838,6 +9847,7 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "optional": true, "engines": { "node": ">=10" } @@ -11424,6 +11434,11 @@ "@octokit/openapi-types": "^12.11.0" } }, + "@opentelemetry/api": { + "version": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "peer": true + }, "@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -18009,7 +18024,8 @@ "safe-stable-stringify": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", - "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==" + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", + "optional": true }, "safer-buffer": { "version": "2.1.2", diff --git a/sagemaker/.gitignore b/sagemaker/.gitignore new file mode 100644 index 00000000..297fdef9 --- /dev/null +++ b/sagemaker/.gitignore @@ -0,0 +1,2 @@ +target/ +node_modules/ diff --git a/sagemaker/LICENSE b/sagemaker/LICENSE new file mode 100644 index 00000000..a875f479 --- /dev/null +++ b/sagemaker/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Wing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sagemaker/README.md b/sagemaker/README.md new file mode 100644 index 00000000..a690be8e --- /dev/null +++ b/sagemaker/README.md @@ -0,0 +1,71 @@ +# sagemaker + +## Prerequisites + +- [winglang](https://winglang.io). + +## Installation + +```sh +npm i @winglibs/sagemaker +``` + +## Usage + +The library enables owners of a trained sagemaker model, to access its Endpoints from a winglang inflight code. + +```wing +bring sagemaker; +bring cloud; + +let sm = new sagemaker.Endpoint("my-endpoint-name", "my-inference-name"); + +let handler = inflight () => { + let res = sm.invoke({ + inputs: "do AI stuff" + }, + ContentType: "application/json" + ); + log(res.Body); +}; + +new cloud.Function(handler); +``` + +## Troubleshooting + +Encountering issues? Here are some common problems and their solutions: + +### `Error: Region is missing` + +**Problem**: When trying to invoke the sagemaker model, the region reports missing +`Error: Region is missing` + +**Solution**: + +Add `AWS_REGION` to the cloud.Function environment variable: + +```wing +bring sagemaker; +bring cloud; + +let sm = new sagemaker.Endpoint("my-endpoint-name", "my-inference-name"); + +let handler = inflight () => { + let res = sm.invoke({ + inputs: "do AI stuff" + }, + ContentType: "application/json" + ); + log(res.Body); +}; + +new cloud.Function(handler, env: { + "AWS_REGION":"us-west-2" +}); +``` + + +## License + +This library is licensed under the [MIT License](./LICENSE). diff --git a/sagemaker/package-lock.json b/sagemaker/package-lock.json new file mode 100644 index 00000000..cc698a8b --- /dev/null +++ b/sagemaker/package-lock.json @@ -0,0 +1,1251 @@ +{ + "name": "@winglibs/sagemaker", + "version": "0.0.2", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@winglibs/sagemaker", + "version": "0.0.2", + "license": "MIT", + "dependencies": { + "@aws-sdk/client-sagemaker-runtime": "^3.507.0" + } + }, + "node_modules/@aws-crypto/crc32": { + "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==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "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==" + }, + "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==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "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==" + }, + "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==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "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==" + }, + "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==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "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==" + }, + "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==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "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==" + }, + "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==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "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==" + }, + "node_modules/@aws-sdk/client-sagemaker-runtime": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sagemaker-runtime/-/client-sagemaker-runtime-3.507.0.tgz", + "integrity": "sha512-4vk5l6MlhrsYAfK8XagQjqXkEGC6vPMfJYUEVlHibRCJU8wR3jDJ4PEG0eYCeY/o+JFE+oG7tThtzS0M8BIUYg==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.507.0", + "@aws-sdk/core": "3.496.0", + "@aws-sdk/credential-provider-node": "3.507.0", + "@aws-sdk/middleware-host-header": "3.502.0", + "@aws-sdk/middleware-logger": "3.502.0", + "@aws-sdk/middleware-recursion-detection": "3.502.0", + "@aws-sdk/middleware-signing": "3.502.0", + "@aws-sdk/middleware-user-agent": "3.502.0", + "@aws-sdk/region-config-resolver": "3.502.0", + "@aws-sdk/types": "3.502.0", + "@aws-sdk/util-endpoints": "3.502.0", + "@aws-sdk/util-user-agent-browser": "3.502.0", + "@aws-sdk/util-user-agent-node": "3.502.0", + "@smithy/config-resolver": "^2.1.1", + "@smithy/core": "^1.3.1", + "@smithy/eventstream-serde-browser": "^2.1.1", + "@smithy/eventstream-serde-config-resolver": "^2.1.1", + "@smithy/eventstream-serde-node": "^2.1.1", + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/hash-node": "^2.1.1", + "@smithy/invalid-dependency": "^2.1.1", + "@smithy/middleware-content-length": "^2.1.1", + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-retry": "^2.1.1", + "@smithy/middleware-serde": "^2.1.1", + "@smithy/middleware-stack": "^2.1.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "@smithy/util-base64": "^2.1.1", + "@smithy/util-body-length-browser": "^2.1.1", + "@smithy/util-body-length-node": "^2.2.1", + "@smithy/util-defaults-mode-browser": "^2.1.1", + "@smithy/util-defaults-mode-node": "^2.1.1", + "@smithy/util-endpoints": "^1.1.1", + "@smithy/util-retry": "^2.1.1", + "@smithy/util-stream": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.507.0.tgz", + "integrity": "sha512-pFeaKwqv4tXD6QVxWC2V4N62DUoP3bPSm/mCe2SPhaNjNsmwwA53viUHz/nwxIbs8w4vV44UQsygb0AgKm+HoQ==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/core": "3.496.0", + "@aws-sdk/middleware-host-header": "3.502.0", + "@aws-sdk/middleware-logger": "3.502.0", + "@aws-sdk/middleware-recursion-detection": "3.502.0", + "@aws-sdk/middleware-user-agent": "3.502.0", + "@aws-sdk/region-config-resolver": "3.502.0", + "@aws-sdk/types": "3.502.0", + "@aws-sdk/util-endpoints": "3.502.0", + "@aws-sdk/util-user-agent-browser": "3.502.0", + "@aws-sdk/util-user-agent-node": "3.502.0", + "@smithy/config-resolver": "^2.1.1", + "@smithy/core": "^1.3.1", + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/hash-node": "^2.1.1", + "@smithy/invalid-dependency": "^2.1.1", + "@smithy/middleware-content-length": "^2.1.1", + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-retry": "^2.1.1", + "@smithy/middleware-serde": "^2.1.1", + "@smithy/middleware-stack": "^2.1.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "@smithy/util-base64": "^2.1.1", + "@smithy/util-body-length-browser": "^2.1.1", + "@smithy/util-body-length-node": "^2.2.1", + "@smithy/util-defaults-mode-browser": "^2.1.1", + "@smithy/util-defaults-mode-node": "^2.1.1", + "@smithy/util-endpoints": "^1.1.1", + "@smithy/util-retry": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso-oidc": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso-oidc/-/client-sso-oidc-3.507.0.tgz", + "integrity": "sha512-ms5CH2ImhqqCIbo5irxayByuPOlVAmSiqDVfjZKwgIziqng2bVgNZMeKcT6t0bmrcgScEAVnZwY7j/iZTIw73g==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.507.0", + "@aws-sdk/core": "3.496.0", + "@aws-sdk/middleware-host-header": "3.502.0", + "@aws-sdk/middleware-logger": "3.502.0", + "@aws-sdk/middleware-recursion-detection": "3.502.0", + "@aws-sdk/middleware-signing": "3.502.0", + "@aws-sdk/middleware-user-agent": "3.502.0", + "@aws-sdk/region-config-resolver": "3.502.0", + "@aws-sdk/types": "3.502.0", + "@aws-sdk/util-endpoints": "3.502.0", + "@aws-sdk/util-user-agent-browser": "3.502.0", + "@aws-sdk/util-user-agent-node": "3.502.0", + "@smithy/config-resolver": "^2.1.1", + "@smithy/core": "^1.3.1", + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/hash-node": "^2.1.1", + "@smithy/invalid-dependency": "^2.1.1", + "@smithy/middleware-content-length": "^2.1.1", + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-retry": "^2.1.1", + "@smithy/middleware-serde": "^2.1.1", + "@smithy/middleware-stack": "^2.1.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "@smithy/util-base64": "^2.1.1", + "@smithy/util-body-length-browser": "^2.1.1", + "@smithy/util-body-length-node": "^2.2.1", + "@smithy/util-defaults-mode-browser": "^2.1.1", + "@smithy/util-defaults-mode-node": "^2.1.1", + "@smithy/util-endpoints": "^1.1.1", + "@smithy/util-retry": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@aws-sdk/credential-provider-node": "^3.507.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.507.0.tgz", + "integrity": "sha512-TOWBe0ApEh32QOib0R+irWGjd1F9wnhbGV5PcB9SakyRwvqwG5MKOfYxG7ocoDqLlaRwzZMidcy/PV8/OEVNKg==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/core": "3.496.0", + "@aws-sdk/middleware-host-header": "3.502.0", + "@aws-sdk/middleware-logger": "3.502.0", + "@aws-sdk/middleware-recursion-detection": "3.502.0", + "@aws-sdk/middleware-user-agent": "3.502.0", + "@aws-sdk/region-config-resolver": "3.502.0", + "@aws-sdk/types": "3.502.0", + "@aws-sdk/util-endpoints": "3.502.0", + "@aws-sdk/util-user-agent-browser": "3.502.0", + "@aws-sdk/util-user-agent-node": "3.502.0", + "@smithy/config-resolver": "^2.1.1", + "@smithy/core": "^1.3.1", + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/hash-node": "^2.1.1", + "@smithy/invalid-dependency": "^2.1.1", + "@smithy/middleware-content-length": "^2.1.1", + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-retry": "^2.1.1", + "@smithy/middleware-serde": "^2.1.1", + "@smithy/middleware-stack": "^2.1.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "@smithy/util-base64": "^2.1.1", + "@smithy/util-body-length-browser": "^2.1.1", + "@smithy/util-body-length-node": "^2.2.1", + "@smithy/util-defaults-mode-browser": "^2.1.1", + "@smithy/util-defaults-mode-node": "^2.1.1", + "@smithy/util-endpoints": "^1.1.1", + "@smithy/util-middleware": "^2.1.1", + "@smithy/util-retry": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@aws-sdk/credential-provider-node": "^3.507.0" + } + }, + "node_modules/@aws-sdk/core": { + "version": "3.496.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/core/-/core-3.496.0.tgz", + "integrity": "sha512-yT+ug7Cw/3eJi7x2es0+46x12+cIJm5Xv+GPWsrTFD1TKgqO/VPEgfDtHFagDNbFmjNQA65Ygc/kEdIX9ICX/A==", + "dependencies": { + "@smithy/core": "^1.3.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/signature-v4": "^2.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.502.0.tgz", + "integrity": "sha512-KIB8Ae1Z7domMU/jU4KiIgK4tmYgvuXlhR54ehwlVHxnEoFPoPuGHFZU7oFn79jhhSLUFQ1lRYMxP0cEwb7XeQ==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-http": { + "version": "3.503.1", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-http/-/credential-provider-http-3.503.1.tgz", + "integrity": "sha512-rTdlFFGoPPFMF2YjtlfRuSgKI+XsF49u7d98255hySwhsbwd3Xp+utTTPquxP+CwDxMHbDlI7NxDzFiFdsoZug==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/property-provider": "^2.1.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/util-stream": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.507.0.tgz", + "integrity": "sha512-2CnyduoR9COgd7qH1LPYK8UggGqVs8R4ASDMB5bwGxbg9ZerlStDiHpqvJNNg1k+VlejBr++utxfmHd236XgmQ==", + "dependencies": { + "@aws-sdk/client-sts": "3.507.0", + "@aws-sdk/credential-provider-env": "3.502.0", + "@aws-sdk/credential-provider-process": "3.502.0", + "@aws-sdk/credential-provider-sso": "3.507.0", + "@aws-sdk/credential-provider-web-identity": "3.507.0", + "@aws-sdk/types": "3.502.0", + "@smithy/credential-provider-imds": "^2.2.1", + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.507.0.tgz", + "integrity": "sha512-tkQnmOLkRBXfMLgDYHzogrqTNdtl0Im0ipzJb2IV5hfM5NoTfCf795e9A9isgwjSP/g/YEU0xQWxa4lq8LRtuA==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.502.0", + "@aws-sdk/credential-provider-http": "3.503.1", + "@aws-sdk/credential-provider-ini": "3.507.0", + "@aws-sdk/credential-provider-process": "3.502.0", + "@aws-sdk/credential-provider-sso": "3.507.0", + "@aws-sdk/credential-provider-web-identity": "3.507.0", + "@aws-sdk/types": "3.502.0", + "@smithy/credential-provider-imds": "^2.2.1", + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.502.0.tgz", + "integrity": "sha512-fJJowOjQ4infYQX0E1J3xFVlmuwEYJAFk0Mo1qwafWmEthsBJs+6BR2RiWDELHKrSK35u4Pf3fu3RkYuCtmQFw==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.507.0.tgz", + "integrity": "sha512-6WBjou52QukFpDi4ezb19bcAx/bM8ge8qnJnRT02WVRmU6zFQ5yLD2fW1MFsbX3cwbey+wSqKd5FGE1Hukd5wQ==", + "dependencies": { + "@aws-sdk/client-sso": "3.507.0", + "@aws-sdk/token-providers": "3.507.0", + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.507.0.tgz", + "integrity": "sha512-f+aGMfazBimX7S06224JRYzGTaMh1uIhfj23tZylPJ05KxTVi5IO1RoqeI/uHLJ+bDOx+JHBC04g/oCdO4kHvw==", + "dependencies": { + "@aws-sdk/client-sts": "3.507.0", + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.502.0.tgz", + "integrity": "sha512-EjnG0GTYXT/wJBmm5/mTjDcAkzU8L7wQjOzd3FTXuTCNNyvAvwrszbOj5FlarEw5XJBbQiZtBs+I5u9+zy560w==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/protocol-http": "^3.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.502.0.tgz", + "integrity": "sha512-FDyv6K4nCoHxbjLGS2H8ex8I0KDIiu4FJgVRPs140ZJy6gE5Pwxzv6YTzZGLMrnqcIs9gh065Lf6DjwMelZqaw==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.502.0.tgz", + "integrity": "sha512-hvbyGJbxeuezxOu8VfFmcV4ql1hKXLxHTe5FNYfEBat2KaZXVhc1Hg+4TvB06/53p+E8J99Afmumkqbxs2esUA==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/protocol-http": "^3.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.502.0.tgz", + "integrity": "sha512-4hF08vSzJ7L6sB+393gOFj3s2N6nLusYS0XrMW6wYNFU10IDdbf8Z3TZ7gysDJJHEGQPmTAesPEDBsasGWcMxg==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/signature-v4": "^2.1.1", + "@smithy/types": "^2.9.1", + "@smithy/util-middleware": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.502.0.tgz", + "integrity": "sha512-TxbBZbRiXPH0AUxegqiNd9aM9zNSbfjtBs5MEfcBsweeT/B2O7K1EjP9+CkB8Xmk/5FLKhAKLr19b1TNoE27rw==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@aws-sdk/util-endpoints": "3.502.0", + "@smithy/protocol-http": "^3.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.502.0.tgz", + "integrity": "sha512-mxmsX2AGgnSM+Sah7mcQCIneOsJQNiLX0COwEttuf8eO+6cLMAZvVudH3BnWTfea4/A9nuri9DLCqBvEmPrilg==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/types": "^2.9.1", + "@smithy/util-config-provider": "^2.2.1", + "@smithy/util-middleware": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.507.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.507.0.tgz", + "integrity": "sha512-ehOINGjoGJc6Puzon7ev4bXckkaZx18WNgMTNttYJhj3vTpj5LPSQbI/5SS927bEbpGMFz1+hJ6Ra5WGfbTcEQ==", + "dependencies": { + "@aws-sdk/client-sso-oidc": "3.507.0", + "@aws-sdk/types": "3.502.0", + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.502.0.tgz", + "integrity": "sha512-M0DSPYe/gXhwD2QHgoukaZv5oDxhW3FfvYIrJptyqUq3OnPJBcDbihHjrE0PBtfh/9kgMZT60/fQ2NVFANfa2g==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.502.0.tgz", + "integrity": "sha512-6LKFlJPp2J24r1Kpfoz5ESQn+1v5fEjDB3mtUKRdpwarhm3syu7HbKlHCF3KbcCOyahobvLvhoedT78rJFEeeg==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/types": "^2.9.1", + "@smithy/util-endpoints": "^1.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.502.0.tgz", + "integrity": "sha512-v8gKyCs2obXoIkLETAeEQ3AM+QmhHhst9xbM1cJtKUGsRlVIak/XyyD+kVE6kmMm1cjfudHpHKABWk9apQcIZQ==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/types": "^2.9.1", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.502.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.502.0.tgz", + "integrity": "sha512-9RjxpkGZKbTdl96tIJvAo+vZoz4P/cQh36SBUt9xfRfW0BtsaLyvSrvlR5wyUYhvRcC12Axqh/8JtnAPq//+Vw==", + "dependencies": { + "@aws-sdk/types": "3.502.0", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "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==", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@smithy/abort-controller": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-2.1.1.tgz", + "integrity": "sha512-1+qdrUqLhaALYL0iOcN43EP6yAXXQ2wWZ6taf4S2pNGowmOc5gx+iMQv+E42JizNJjB0+gEadOXeV1Bf7JWL1Q==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-2.1.1.tgz", + "integrity": "sha512-lxfLDpZm+AWAHPFZps5JfDoO9Ux1764fOgvRUBpHIO8HWHcSN1dkgsago1qLRVgm1BZ8RCm8cgv99QvtaOWIhw==", + "dependencies": { + "@smithy/node-config-provider": "^2.2.1", + "@smithy/types": "^2.9.1", + "@smithy/util-config-provider": "^2.2.1", + "@smithy/util-middleware": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/core": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@smithy/core/-/core-1.3.1.tgz", + "integrity": "sha512-tf+NIu9FkOh312b6M9G4D68is4Xr7qptzaZGZUREELF8ysE1yLKphqt7nsomjKZVwW7WE5pDDex9idowNGRQ/Q==", + "dependencies": { + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-retry": "^2.1.1", + "@smithy/middleware-serde": "^2.1.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/util-middleware": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-2.2.1.tgz", + "integrity": "sha512-7XHjZUxmZYnONheVQL7j5zvZXga+EWNgwEAP6OPZTi7l8J4JTeNh9aIOfE5fKHZ/ee2IeNOh54ZrSna+Vc6TFA==", + "dependencies": { + "@smithy/node-config-provider": "^2.2.1", + "@smithy/property-provider": "^2.1.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-2.1.1.tgz", + "integrity": "sha512-E8KYBxBIuU4c+zrpR22VsVrOPoEDzk35bQR3E+xm4k6Pa6JqzkDOdMyf9Atac5GPNKHJBdVaQ4JtjdWX2rl/nw==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@smithy/types": "^2.9.1", + "@smithy/util-hex-encoding": "^2.1.1", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-2.1.1.tgz", + "integrity": "sha512-JvEdCmGlZUay5VtlT8/kdR6FlvqTDUiJecMjXsBb0+k1H/qc9ME5n2XKPo8q/MZwEIA1GmGgYMokKGjVvMiDow==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-2.1.1.tgz", + "integrity": "sha512-EqNqXYp3+dk//NmW3NAgQr9bEQ7fsu/CcxQmTiq07JlaIcne/CBWpMZETyXm9w5LXkhduBsdXdlMscfDUDn2fA==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-2.1.1.tgz", + "integrity": "sha512-LF882q/aFidFNDX7uROAGxq3H0B7rjyPkV6QDn6/KDQ+CG7AFkRccjxRf1xqajq/Pe4bMGGr+VKAaoF6lELIQw==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-2.1.1.tgz", + "integrity": "sha512-LR0mMT+XIYTxk4k2fIxEA1BPtW3685QlqufUEUAX1AJcfFfxNDKEvuCRZbO8ntJb10DrIFVJR9vb0MhDCi0sAQ==", + "dependencies": { + "@smithy/eventstream-codec": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-2.4.1.tgz", + "integrity": "sha512-VYGLinPsFqH68lxfRhjQaSkjXM7JysUOJDTNjHBuN/ykyRb2f1gyavN9+VhhPTWCy32L4yZ2fdhpCs/nStEicg==", + "dependencies": { + "@smithy/protocol-http": "^3.1.1", + "@smithy/querystring-builder": "^2.1.1", + "@smithy/types": "^2.9.1", + "@smithy/util-base64": "^2.1.1", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-2.1.1.tgz", + "integrity": "sha512-Qhoq0N8f2OtCnvUpCf+g1vSyhYQrZjhSwvJ9qvR8BUGOtTXiyv2x1OD2e6jVGmlpC4E4ax1USHoyGfV9JFsACg==", + "dependencies": { + "@smithy/types": "^2.9.1", + "@smithy/util-buffer-from": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-2.1.1.tgz", + "integrity": "sha512-7WTgnKw+VPg8fxu2v9AlNOQ5yaz6RA54zOVB4f6vQuR0xFKd+RzlCpt0WidYTsye7F+FYDIaS/RnJW4pxjNInw==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-2.1.1.tgz", + "integrity": "sha512-rSr9ezUl9qMgiJR0UVtVOGEZElMdGFyl8FzWEF5iEKTlcWxGr2wTqGfDwtH3LAB7h+FPkxqv4ZU4cpuCN9Kf/g==", + "dependencies": { + "@smithy/protocol-http": "^3.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-2.4.1.tgz", + "integrity": "sha512-XPZTb1E2Oav60Ven3n2PFx+rX9EDsU/jSTA8VDamt7FXks67ekjPY/XrmmPDQaFJOTUHJNKjd8+kZxVO5Ael4Q==", + "dependencies": { + "@smithy/middleware-serde": "^2.1.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/url-parser": "^2.1.1", + "@smithy/util-middleware": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-2.1.1.tgz", + "integrity": "sha512-eMIHOBTXro6JZ+WWzZWd/8fS8ht5nS5KDQjzhNMHNRcG5FkNTqcKpYhw7TETMYzbLfhO5FYghHy1vqDWM4FLDA==", + "dependencies": { + "@smithy/node-config-provider": "^2.2.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/service-error-classification": "^2.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/util-middleware": "^2.1.1", + "@smithy/util-retry": "^2.1.1", + "tslib": "^2.5.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-2.1.1.tgz", + "integrity": "sha512-D8Gq0aQBeE1pxf3cjWVkRr2W54t+cdM2zx78tNrVhqrDykRA7asq8yVJij1u5NDtKzKqzBSPYh7iW0svUKg76g==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-2.1.1.tgz", + "integrity": "sha512-KPJhRlhsl8CjgGXK/DoDcrFGfAqoqvuwlbxy+uOO4g2Azn1dhH+GVfC3RAp+6PoL5PWPb+vt6Z23FP+Mr6qeCw==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-2.2.1.tgz", + "integrity": "sha512-epzK3x1xNxA9oJgHQ5nz+2j6DsJKdHfieb+YgJ7ATWxzNcB7Hc+Uya2TUck5MicOPhDV8HZImND7ZOecVr+OWg==", + "dependencies": { + "@smithy/property-provider": "^2.1.1", + "@smithy/shared-ini-file-loader": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-2.3.1.tgz", + "integrity": "sha512-gLA8qK2nL9J0Rk/WEZSvgin4AppvuCYRYg61dcUo/uKxvMZsMInL5I5ZdJTogOvdfVug3N2dgI5ffcUfS4S9PA==", + "dependencies": { + "@smithy/abort-controller": "^2.1.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/querystring-builder": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-2.1.1.tgz", + "integrity": "sha512-FX7JhhD/o5HwSwg6GLK9zxrMUrGnb3PzNBrcthqHKBc3dH0UfgEAU24xnJ8F0uow5mj17UeBEOI6o3CF2k7Mhw==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-3.1.1.tgz", + "integrity": "sha512-6ZRTSsaXuSL9++qEwH851hJjUA0OgXdQFCs+VDw4tGH256jQ3TjYY/i34N4vd24RV3nrjNsgd1yhb57uMoKbzQ==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-2.1.1.tgz", + "integrity": "sha512-C/ko/CeEa8jdYE4gt6nHO5XDrlSJ3vdCG0ZAc6nD5ZIE7LBp0jCx4qoqp7eoutBu7VrGMXERSRoPqwi1WjCPbg==", + "dependencies": { + "@smithy/types": "^2.9.1", + "@smithy/util-uri-escape": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-2.1.1.tgz", + "integrity": "sha512-H4+6jKGVhG1W4CIxfBaSsbm98lOO88tpDWmZLgkJpt8Zkk/+uG0FmmqMuCAc3HNM2ZDV+JbErxr0l5BcuIf/XQ==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-2.1.1.tgz", + "integrity": "sha512-txEdZxPUgM1PwGvDvHzqhXisrc5LlRWYCf2yyHfvITWioAKat7srQvpjMAvgzf0t6t7j8yHrryXU9xt7RZqFpw==", + "dependencies": { + "@smithy/types": "^2.9.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-2.3.1.tgz", + "integrity": "sha512-2E2kh24igmIznHLB6H05Na4OgIEilRu0oQpYXo3LCNRrawHAcfDKq9004zJs+sAMt2X5AbY87CUCJ7IpqpSgdw==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-2.1.1.tgz", + "integrity": "sha512-Hb7xub0NHuvvQD3YwDSdanBmYukoEkhqBjqoxo+bSdC0ryV9cTfgmNjuAQhTPYB6yeU7hTR+sPRiFMlxqv6kmg==", + "dependencies": { + "@smithy/eventstream-codec": "^2.1.1", + "@smithy/is-array-buffer": "^2.1.1", + "@smithy/types": "^2.9.1", + "@smithy/util-hex-encoding": "^2.1.1", + "@smithy/util-middleware": "^2.1.1", + "@smithy/util-uri-escape": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-2.3.1.tgz", + "integrity": "sha512-YsTdU8xVD64r2pLEwmltrNvZV6XIAC50LN6ivDopdt+YiF/jGH6PY9zUOu0CXD/d8GMB8gbhnpPsdrjAXHS9QA==", + "dependencies": { + "@smithy/middleware-endpoint": "^2.4.1", + "@smithy/middleware-stack": "^2.1.1", + "@smithy/protocol-http": "^3.1.1", + "@smithy/types": "^2.9.1", + "@smithy/util-stream": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-2.9.1.tgz", + "integrity": "sha512-vjXlKNXyprDYDuJ7UW5iobdmyDm6g8dDG+BFUncAg/3XJaN45Gy5RWWWUVgrzIK7S4R1KWgIX5LeJcfvSI24bw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-2.1.1.tgz", + "integrity": "sha512-qC9Bv8f/vvFIEkHsiNrUKYNl8uKQnn4BdhXl7VzQRP774AwIjiSMMwkbT+L7Fk8W8rzYVifzJNYxv1HwvfBo3Q==", + "dependencies": { + "@smithy/querystring-parser": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-base64": { + "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==", + "dependencies": { + "@smithy/util-buffer-from": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-buffer-from": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.1.1.tgz", + "integrity": "sha512-clhNjbyfqIv9Md2Mg6FffGVrJxw7bgK7s3Iax36xnfVj6cg0fUG7I4RH0XgXJF8bxi+saY5HR21g2UPKSxVCXg==", + "dependencies": { + "@smithy/is-array-buffer": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-config-provider": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-2.1.1.tgz", + "integrity": "sha512-lqLz/9aWRO6mosnXkArtRuQqqZBhNpgI65YDpww4rVQBuUT7qzKbDLG5AmnQTCiU4rOquaZO/Kt0J7q9Uic7MA==", + "dependencies": { + "@smithy/property-provider": "^2.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-2.1.1.tgz", + "integrity": "sha512-tYVrc+w+jSBfBd267KDnvSGOh4NMz+wVH7v4CClDbkdPfnjvImBZsOURncT5jsFwR9KCuDyPoSZq4Pa6+eCUrA==", + "dependencies": { + "@smithy/config-resolver": "^2.1.1", + "@smithy/credential-provider-imds": "^2.2.1", + "@smithy/node-config-provider": "^2.2.1", + "@smithy/property-provider": "^2.1.1", + "@smithy/smithy-client": "^2.3.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@smithy/util-endpoints": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-endpoints/-/util-endpoints-1.1.1.tgz", + "integrity": "sha512-sI4d9rjoaekSGEtq3xSb2nMjHMx8QXcz2cexnVyRWsy4yQ9z3kbDpX+7fN0jnbdOp0b3KSTZJZ2Yb92JWSanLw==", + "dependencies": { + "@smithy/node-config-provider": "^2.2.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@smithy/util-hex-encoding": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-middleware": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-2.1.1.tgz", + "integrity": "sha512-mKNrk8oz5zqkNcbcgAAepeJbmfUW6ogrT2Z2gDbIUzVzNAHKJQTYmH9jcy0jbWb+m7ubrvXKb6uMjkSgAqqsFA==", + "dependencies": { + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-retry": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-2.1.1.tgz", + "integrity": "sha512-Mg+xxWPTeSPrthpC5WAamJ6PW4Kbo01Fm7lWM1jmGRvmrRdsd3192Gz2fBXAMURyXpaNxyZf6Hr/nQ4q70oVEA==", + "dependencies": { + "@smithy/service-error-classification": "^2.1.1", + "@smithy/types": "^2.9.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@smithy/util-stream": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-2.1.1.tgz", + "integrity": "sha512-J7SMIpUYvU4DQN55KmBtvaMc7NM3CZ2iWICdcgaovtLzseVhAqFRYqloT3mh0esrFw+3VEK6nQFteFsTqZSECQ==", + "dependencies": { + "@smithy/fetch-http-handler": "^2.4.1", + "@smithy/node-http-handler": "^2.3.1", + "@smithy/types": "^2.9.1", + "@smithy/util-base64": "^2.1.1", + "@smithy/util-buffer-from": "^2.1.1", + "@smithy/util-hex-encoding": "^2.1.1", + "@smithy/util-utf8": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-uri-escape": { + "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==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-utf8": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.1.1.tgz", + "integrity": "sha512-BqTpzYEcUMDwAKr7/mVRUtHDhs6ZoXDi9NypMvMfOr/+u1NW7JgqodPDECiiLboEm6bobcPcECxzjtQh865e9A==", + "dependencies": { + "@smithy/util-buffer-from": "^2.1.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "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==" + }, + "node_modules/fast-xml-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz", + "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==", + "funding": [ + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + }, + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "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==", + "bin": { + "uuid": "dist/bin/uuid" + } + } + } +} diff --git a/sagemaker/package.json b/sagemaker/package.json new file mode 100644 index 00000000..645a278b --- /dev/null +++ b/sagemaker/package.json @@ -0,0 +1,18 @@ +{ + "name": "@winglibs/sagemaker", + "version": "0.0.2", + "description": "The library enables owners of a trained sagemaker model, to access its Endpoints from a winglang inflight code.", + "repository": { + "type": "git", + "url": "https://github.com/winglang/winglibs.git", + "directory": "sagemaker" + }, + "author": { + "name": "Tsuf Cohen", + "email": "tsufc@wing.cloud" + }, + "license": "MIT", + "dependencies": { + "@aws-sdk/client-sagemaker-runtime": "^3.507.0" + } +} diff --git a/sagemaker/sagemaker.js b/sagemaker/sagemaker.js new file mode 100644 index 00000000..5f07bc91 --- /dev/null +++ b/sagemaker/sagemaker.js @@ -0,0 +1,17 @@ +import {InvokeEndpointCommand, SageMakerRuntimeClient} from "@aws-sdk/client-sagemaker-runtime"; + +exports._invoke = async (endpointName, body, inferenceComponentName, options = {}) => { + const client = new SageMakerRuntimeClient(); + const command = new InvokeEndpointCommand({ + ...options, + InferenceComponentName: inferenceComponentName, + EndpointName: endpointName, + Body: JSON.stringify(body), + }); + let res = await client.send(command); + + return { + ...res, + Body: Buffer.from(res.Body).toString('utf8') + }; +}; diff --git a/sagemaker/sagemaker.sim.w b/sagemaker/sagemaker.sim.w new file mode 100644 index 00000000..30775da8 --- /dev/null +++ b/sagemaker/sagemaker.sim.w @@ -0,0 +1,25 @@ +bring "./types.w" as types; + +pub class SageMaker_sim impl types.ISageMaker { + endpointName: str; + inferenceName: str; + var mockResponse: inflight (Json, types.InvocationOptions? ): types.InvocationOutput; + + new(endpointName: str, inferenceName: str) { + this.endpointName = endpointName; + this.inferenceName = inferenceName; + this.mockResponse = inflight (body: Json, options: types.InvocationOptions? ) => { + return { + Body: "This is an example" + }; + }; + } + + pub setMockResponse(fn: inflight (Json, types.InvocationOptions? ): types.InvocationOutput) { + this.mockResponse = fn; + } + + pub inflight invoke(body: Json, options: types.InvocationOptions? ): types.InvocationOutput { + return this.mockResponse(body, options); + } +} \ No newline at end of file diff --git a/sagemaker/sagemaker.test.w b/sagemaker/sagemaker.test.w new file mode 100644 index 00000000..1f286861 --- /dev/null +++ b/sagemaker/sagemaker.test.w @@ -0,0 +1,18 @@ +bring cloud; +bring expect; +bring "./sagemaker.w" as sageMaker; +bring util; + +let sm = new sageMaker.Endpoint(util.tryEnv("ENDPOINT_NAME") ?? "Example-endopint", util.tryEnv("INFERENCE_NAME") ?? "Example-inference"); + +let invokeModel = inflight (input: str?) => { + let var s = input ?? "Hi There!"; + let res = sm.invoke( { inputs: "{s}" }, { ContentType: "application/json" }); + log(res.Body); +}; + +new cloud.Function(invokeModel); + +test "main" { + invokeModel("Hello there!"); +} diff --git a/sagemaker/sagemaker.tfaws.w b/sagemaker/sagemaker.tfaws.w new file mode 100644 index 00000000..d69b294d --- /dev/null +++ b/sagemaker/sagemaker.tfaws.w @@ -0,0 +1,32 @@ +bring "./types.w" as types; +bring aws; + +pub class SageMaker_tfaws impl types.ISageMaker { + pub endpointName: str; + pub inferenceComponentName: str; + + new(endpointName: str, inferenceComponentName: str) { + this.endpointName = endpointName; + this.inferenceComponentName = inferenceComponentName; + } + + pub inflight invoke(body: Json, options: types.InvocationOptions?): types.InvocationOutput{ + return SageMaker_tfaws._invoke(this.endpointName, body, this.inferenceComponentName, options); + } + + pub onLift(host: std.IInflightHost, ops: Array) { + if let lambda = aws.Function.from(host) { + lambda.addPolicyStatements({ + actions: ["sagemaker:InvokeEndpoint"], + effect: aws.Effect.ALLOW, + resources: [ + "arn:aws:sagemaker:*:*:endpoint/{this.endpointName.lowercase()}", + "arn:aws:sagemaker:*:*:inference-component/{this.inferenceComponentName.lowercase()}" + ] + }); + } + } + + extern "./sagemaker.js" + static inflight _invoke(endpointName: str, body: Json, inferenceComponentName: str, options: types.InvocationOptions?): types.InvocationOutput; +} diff --git a/sagemaker/sagemaker.w b/sagemaker/sagemaker.w new file mode 100644 index 00000000..08ee7738 --- /dev/null +++ b/sagemaker/sagemaker.w @@ -0,0 +1,37 @@ +bring aws; +bring util; +bring "./types.w" as types; +bring "./sagemaker.sim.w" as s; +bring "./sagemaker.tfaws.w" as t; + +pub class Endpoint impl types.ISageMaker { + pub endpointName: str; + + + inner: types.ISageMaker; + + new(endpointName: str, inferenceComponentName: str) { + this.endpointName = endpointName; + + + let target = util.env("WING_TARGET"); + if target == "sim" { + if std.Node.of(this).app.isTestEnvironment { + // in case of test running on sim, use simulator version + this.inner = new s.SageMaker_sim(endpointName, inferenceComponentName) as "sim"; + } else { + // in case of running on sim interactively (in development mode), use AWS version + this.inner = new t.SageMaker_tfaws(endpointName, inferenceComponentName) as "tf-aws"; + } + } elif target == "tf-aws" { + this.inner = new t.SageMaker_tfaws(endpointName, inferenceComponentName) as "tf-aws"; + } else { + throw "Unsupported target {target}"; + } + } + + pub inflight invoke(body: Json, options: types.InvocationOptions?): types.InvocationOutput { + return this.inner.invoke(body, options); + } +} + diff --git a/sagemaker/types.w b/sagemaker/types.w new file mode 100644 index 00000000..1b419d90 --- /dev/null +++ b/sagemaker/types.w @@ -0,0 +1,22 @@ +pub struct InvocationOptions { + ContentType: str?; + Accept: str?; + CustomAttributes: str?; + TargetModel: str?; + TargetVariant: str?; + TargetContainerHostname: str?; + InferenceId: str?; + EnableExplanations: str?; + InferenceComponentName: str?; +} + +pub struct InvocationOutput { + Body: str; + ContentType: str?; + InvokedProductionVariant: str?; + CustomAttributes: str?; +} + +pub interface ISageMaker { + inflight invoke(body: Json, InvocationOptions: InvocationOptions?): InvocationOutput; +} \ No newline at end of file diff --git a/test-all.sh b/test-all.sh index 9bef4483..beb0e2b5 100755 --- a/test-all.sh +++ b/test-all.sh @@ -9,7 +9,7 @@ for i in $(ls -F); do ( cd $i npm i - wing test **/*.test.w + wing test ) fi -done \ No newline at end of file +done diff --git a/vite/.gitignore b/vite/.gitignore new file mode 100644 index 00000000..297fdef9 --- /dev/null +++ b/vite/.gitignore @@ -0,0 +1,2 @@ +target/ +node_modules/ diff --git a/vite/LICENSE b/vite/LICENSE new file mode 100644 index 00000000..a875f479 --- /dev/null +++ b/vite/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Wing + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vite/README.md b/vite/README.md new file mode 100644 index 00000000..e46686a0 --- /dev/null +++ b/vite/README.md @@ -0,0 +1,40 @@ +# vite + +`@winglibs/vite` allows using a [Vite](https://vitejs.dev/) project with Wing. + +## Prerequisites + +- [winglang](https://winglang.io). + +## Installation + +```sh +npm i @winglibs/vite +``` + +## Usage + +```js +bring cloud; +bring vite; + +let api = new cloud.Api(); + +let website = new vite.Vite( + // The path to the website root. + root: "../website", + + // Environment variables passed to the Vite project. + // They'll available through the global `wing` object. + publicEnv: { + API_URL: api.url, + }, +); + +// Get the URL of the website. +let url = website.url; +``` + +## License + +This library is licensed under the [MIT License](./LICENSE). diff --git a/vite/example/.gitignore b/vite/example/.gitignore new file mode 100644 index 00000000..96a34942 --- /dev/null +++ b/vite/example/.gitignore @@ -0,0 +1,2 @@ +/.winglibs/ +/dist/ diff --git a/vite/example/index.html b/vite/example/index.html new file mode 100644 index 00000000..3c51c56c --- /dev/null +++ b/vite/example/index.html @@ -0,0 +1,11 @@ + + + + + + Example + + +

Example

+ + diff --git a/vite/package-lock.json b/vite/package-lock.json new file mode 100644 index 00000000..58ead9f9 --- /dev/null +++ b/vite/package-lock.json @@ -0,0 +1,1251 @@ +{ + "name": "@winglibs/vite", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@winglibs/vite", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "@cdktf/provider-aws": "^19.6.0", + "cdktf": "^0.20.3", + "mime-types": "^2.1.35", + "vite": "^5.1.3" + } + }, + "node_modules/@cdktf/provider-aws": { + "version": "19.6.0", + "resolved": "https://registry.npmjs.org/@cdktf/provider-aws/-/provider-aws-19.6.0.tgz", + "integrity": "sha512-OnY3z9PA4ZMVT3P/4QdOF8PeMv06ROfSEGLmLOPINArEnBs1RdU51ZwD3uZH9fX3gFHBMvqdMLneWOw5JrVQnA==", + "engines": { + "node": ">= 18.12.0" + }, + "peerDependencies": { + "cdktf": "^0.20.0", + "constructs": "^10.3.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.7.tgz", + "integrity": "sha512-YGSPnndkcLo4PmVl2tKatEn+0mlVMr3yEpOOT0BeMria87PhvoJb5dg5f5Ft9fbCVgtAz4pWMzZVgSEGpDAlww==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.7.tgz", + "integrity": "sha512-YEDcw5IT7hW3sFKZBkCAQaOCJQLONVcD4bOyTXMZz5fr66pTHnAet46XAtbXAkJRfIn2YVhdC6R9g4xa27jQ1w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.7.tgz", + "integrity": "sha512-jhINx8DEjz68cChFvM72YzrqfwJuFbfvSxZAk4bebpngGfNNRm+zRl4rtT9oAX6N9b6gBcFaJHFew5Blf6CvUw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.7.tgz", + "integrity": "sha512-dr81gbmWN//3ZnBIm6YNCl4p3pjnabg1/ZVOgz2fJoUO1a3mq9WQ/1iuEluMs7mCL+Zwv7AY5e3g1hjXqQZ9Iw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.7.tgz", + "integrity": "sha512-Lc0q5HouGlzQEwLkgEKnWcSazqr9l9OdV2HhVasWJzLKeOt0PLhHaUHuzb8s/UIya38DJDoUm74GToZ6Wc7NGQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.7.tgz", + "integrity": "sha512-+y2YsUr0CxDFF7GWiegWjGtTUF6gac2zFasfFkRJPkMAuMy9O7+2EH550VlqVdpEEchWMynkdhC9ZjtnMiHImQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.7.tgz", + "integrity": "sha512-CdXOxIbIzPJmJhrpmJTLx+o35NoiKBIgOvmvT+jeSadYiWJn0vFKsl+0bSG/5lwjNHoIDEyMYc/GAPR9jxusTA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.7.tgz", + "integrity": "sha512-Y+SCmWxsJOdQtjcBxoacn/pGW9HDZpwsoof0ttL+2vGcHokFlfqV666JpfLCSP2xLxFpF1lj7T3Ox3sr95YXww==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.7.tgz", + "integrity": "sha512-inHqdOVCkUhHNvuQPT1oCB7cWz9qQ/Cz46xmVe0b7UXcuIJU3166aqSunsqkgSGMtUCWOZw3+KMwI6otINuC9g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.7.tgz", + "integrity": "sha512-2BbiL7nLS5ZO96bxTQkdO0euGZIUQEUXMTrqLxKUmk/Y5pmrWU84f+CMJpM8+EHaBPfFSPnomEaQiG/+Gmh61g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.7.tgz", + "integrity": "sha512-BVFQla72KXv3yyTFCQXF7MORvpTo4uTA8FVFgmwVrqbB/4DsBFWilUm1i2Oq6zN36DOZKSVUTb16jbjedhfSHw==", + "cpu": [ + "loong64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.7.tgz", + "integrity": "sha512-DzAYckIaK+pS31Q/rGpvUKu7M+5/t+jI+cdleDgUwbU7KdG2eC3SUbZHlo6Q4P1CfVKZ1lUERRFP8+q0ob9i2w==", + "cpu": [ + "mips64el" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.7.tgz", + "integrity": "sha512-JQ1p0SmUteNdUaaiRtyS59GkkfTW0Edo+e0O2sihnY4FoZLz5glpWUQEKMSzMhA430ctkylkS7+vn8ziuhUugQ==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.7.tgz", + "integrity": "sha512-xGwVJ7eGhkprY/nB7L7MXysHduqjpzUl40+XoYDGC4UPLbnG+gsyS1wQPJ9lFPcxYAaDXbdRXd1ACs9AE9lxuw==", + "cpu": [ + "riscv64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.7.tgz", + "integrity": "sha512-U8Rhki5PVU0L0nvk+E8FjkV8r4Lh4hVEb9duR6Zl21eIEYEwXz8RScj4LZWA2i3V70V4UHVgiqMpszXvG0Yqhg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.7.tgz", + "integrity": "sha512-ZYZopyLhm4mcoZXjFt25itRlocKlcazDVkB4AhioiL9hOWhDldU9n38g62fhOI4Pth6vp+Mrd5rFKxD0/S+7aQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.7.tgz", + "integrity": "sha512-/yfjlsYmT1O3cum3J6cmGG16Fd5tqKMcg5D+sBYLaOQExheAJhqr8xOAEIuLo8JYkevmjM5zFD9rVs3VBcsjtQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.7.tgz", + "integrity": "sha512-MYDFyV0EW1cTP46IgUJ38OnEY5TaXxjoDmwiTXPjezahQgZd+j3T55Ht8/Q9YXBM0+T9HJygrSRGV5QNF/YVDQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.7.tgz", + "integrity": "sha512-JcPvgzf2NN/y6X3UUSqP6jSS06V0DZAV/8q0PjsZyGSXsIGcG110XsdmuWiHM+pno7/mJF6fjH5/vhUz/vA9fw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.7.tgz", + "integrity": "sha512-ZA0KSYti5w5toax5FpmfcAgu3ZNJxYSRm0AW/Dao5up0YV1hDVof1NvwLomjEN+3/GMtaWDI+CIyJOMTRSTdMw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.7.tgz", + "integrity": "sha512-CTOnijBKc5Jpk6/W9hQMMvJnsSYRYgveN6O75DTACCY18RA2nqka8dTZR+x/JqXCRiKk84+5+bRKXUSbbwsS0A==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.7.tgz", + "integrity": "sha512-gRaP2sk6hc98N734luX4VpF318l3w+ofrtTu9j5L8EQXF+FzQKV6alCOHMVoJJHvVK/mGbwBXfOL1HETQu9IGQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.5.2.tgz", + "integrity": "sha512-ee7BudTwwrglFYSc3UnqInDDjCLWHKrFmGNi4aK7jlEyg4CyPa1DCMrZfsN1O13YT76UFEqXz2CoN7BCGpUlJw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.5.2.tgz", + "integrity": "sha512-xOuhj9HHtn8128ir8veoQsBbAUBasDbHIBniYTEx02pAmu9EXL+ZjJqngnNEy6ZgZ4h1JwL33GMNu3yJL5Mzow==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.5.2.tgz", + "integrity": "sha512-NTGJWoL8bKyqyWFn9/RzSv4hQ4wTbaAv0lHHRwf4OnpiiP4P8W0jiXbm8Nc5BCXKmWAwuvJY82mcIU2TayC20g==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.5.2.tgz", + "integrity": "sha512-hlKqj7bpPvU15sZo4za14u185lpMzdwWLMc9raMqPK4wywt0wR23y1CaVQ4oAFXat3b5/gmRntyfpwWTKl+vvA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.5.2.tgz", + "integrity": "sha512-7ZIZx8c3u+pfI0ohQsft/GywrXez0uR6dUP0JhBuCK3sFO5TfdLn/YApnVkvPxuTv3+YKPIZend9Mt7Cz6sS3Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.5.2.tgz", + "integrity": "sha512-7Pk/5mO11JW/cH+a8lL/i0ZxmRGrbpYqN0VwO2DHhU+SJWWOH2zE1RAcPaj8KqiwC8DCDIJOSxjV9+9lLb6aeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.5.2.tgz", + "integrity": "sha512-KrRnuG5phJx756e62wxvWH2e+TK84MP2IVuPwfge+GBvWqIUfVzFRn09TKruuQBXzZp52Vyma7FjMDkwlA9xpg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.5.2.tgz", + "integrity": "sha512-My+53GasPa2D2tU5dXiyHYwrELAUouSfkNlZ3bUKpI7btaztO5vpALEs3mvFjM7aKTvEbc7GQckuXeXIDKQ0fg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.5.2.tgz", + "integrity": "sha512-/f0Q6Sc+Vw54Ws6N8fxaEe4R7at3b8pFyv+O/F2VaQ4hODUJcRUcCBJh6zuqtgQQt7w845VTkGLFgWZkP3tUoQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.5.2.tgz", + "integrity": "sha512-NCKuuZWLht6zj7s6EIFef4BxCRX1GMr83S2W4HPCA0RnJ4iHE4FS1695q6Ewoa6A9nFjJe1//yUu0kgBU07Edw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.5.2.tgz", + "integrity": "sha512-J5zL3riR4AOyU/J3M/i4k/zZ8eP1yT+nTmAKztCXJtnI36jYH0eepvob22mAQ/kLwfsK2TB6dbyVY1F8c/0H5A==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.5.2.tgz", + "integrity": "sha512-pL0RXRHuuGLhvs7ayX/SAHph1hrDPXOM5anyYUQXWJEENxw3nfHkzv8FfVlEVcLyKPAEgDRkd6RKZq2SMqS/yg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/cdktf": { + "version": "0.20.3", + "resolved": "https://registry.npmjs.org/cdktf/-/cdktf-0.20.3.tgz", + "integrity": "sha512-y8F3pjYzbMHy9ZG3yXSSerx2Yv9dr2i2j2842IKT1tpN74CBfuuPrselTNdI6QoaMvlQJQQB2l93cJmL6eIkaw==", + "bundleDependencies": [ + "archiver", + "json-stable-stringify", + "semver" + ], + "dependencies": { + "archiver": "6.0.1", + "json-stable-stringify": "1.1.0", + "semver": "7.5.4" + }, + "peerDependencies": { + "constructs": "^10.0.25" + } + }, + "node_modules/cdktf/node_modules/archiver": { + "version": "6.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^3.0.0", + "zip-stream": "^5.0.1" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/cdktf/node_modules/archiver-utils": { + "version": "4.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "glob": "^8.0.0", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash": "^4.17.15", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/cdktf/node_modules/async": { + "version": "3.2.5", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/b4a": { + "version": "1.6.4", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/balanced-match": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/brace-expansion": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cdktf/node_modules/buffer-crc32": { + "version": "0.2.13", + "inBundle": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/cdktf/node_modules/call-bind": { + "version": "1.0.5", + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/compress-commons": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^5.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/cdktf/node_modules/core-util-is": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/crc-32": { + "version": "1.2.2", + "inBundle": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cdktf/node_modules/crc32-stream": { + "version": "5.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/cdktf/node_modules/define-data-property": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/fast-fifo": { + "version": "1.3.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/fs.realpath": { + "version": "1.0.0", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/function-bind": { + "version": "1.1.2", + "inBundle": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/get-intrinsic": { + "version": "1.2.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/glob": { + "version": "8.1.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/cdktf/node_modules/gopd": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/graceful-fs": { + "version": "4.2.11", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/has-property-descriptors": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/has-proto": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/has-symbols": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/hasown": { + "version": "2.0.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/inflight": { + "version": "1.0.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/inherits": { + "version": "2.0.4", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/isarray": { + "version": "2.0.5", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/json-stable-stringify": { + "version": "1.1.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/jsonify": { + "version": "0.0.1", + "inBundle": true, + "license": "Public Domain", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/lazystream": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/isarray": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "inBundle": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/cdktf/node_modules/lodash": { + "version": "4.17.21", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/lru-cache": { + "version": "6.0.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/minimatch": { + "version": "5.1.6", + "inBundle": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/normalize-path": { + "version": "3.0.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cdktf/node_modules/object-keys": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/once": { + "version": "1.4.0", + "inBundle": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/process-nextick-args": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/queue-tick": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/readable-stream": { + "version": "3.6.2", + "inBundle": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/cdktf/node_modules/readdir-glob": { + "version": "1.1.3", + "inBundle": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.1.0" + } + }, + "node_modules/cdktf/node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/semver": { + "version": "7.5.4", + "inBundle": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/set-function-length": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/streamx": { + "version": "2.15.6", + "inBundle": true, + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, + "node_modules/cdktf/node_modules/string_decoder": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/cdktf/node_modules/tar-stream": { + "version": "3.1.6", + "inBundle": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/cdktf/node_modules/util-deprecate": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT" + }, + "node_modules/cdktf/node_modules/wrappy": { + "version": "1.0.2", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/yallist": { + "version": "4.0.0", + "inBundle": true, + "license": "ISC" + }, + "node_modules/cdktf/node_modules/zip-stream": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "dependencies": { + "archiver-utils": "^4.0.1", + "compress-commons": "^5.0.1", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/constructs": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.3.0.tgz", + "integrity": "sha512-vbK8i3rIb/xwZxSpTjz3SagHn1qq9BChLEfy5Hf6fB3/2eFbrwt2n9kHwQcS0CPTRBesreeAcsJfMq2229FnbQ==", + "peer": true, + "engines": { + "node": ">= 16.14.0" + } + }, + "node_modules/esbuild": { + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.7.tgz", + "integrity": "sha512-6brbTZVqxhqgbpqBR5MzErImcpA0SQdoKOkcWK/U30HtQxnokIpG3TX2r0IJqbFUzqLjhU/zC1S5ndgakObVCQ==", + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.7", + "@esbuild/android-arm64": "0.19.7", + "@esbuild/android-x64": "0.19.7", + "@esbuild/darwin-arm64": "0.19.7", + "@esbuild/darwin-x64": "0.19.7", + "@esbuild/freebsd-arm64": "0.19.7", + "@esbuild/freebsd-x64": "0.19.7", + "@esbuild/linux-arm": "0.19.7", + "@esbuild/linux-arm64": "0.19.7", + "@esbuild/linux-ia32": "0.19.7", + "@esbuild/linux-loong64": "0.19.7", + "@esbuild/linux-mips64el": "0.19.7", + "@esbuild/linux-ppc64": "0.19.7", + "@esbuild/linux-riscv64": "0.19.7", + "@esbuild/linux-s390x": "0.19.7", + "@esbuild/linux-x64": "0.19.7", + "@esbuild/netbsd-x64": "0.19.7", + "@esbuild/openbsd-x64": "0.19.7", + "@esbuild/sunos-x64": "0.19.7", + "@esbuild/win32-arm64": "0.19.7", + "@esbuild/win32-ia32": "0.19.7", + "@esbuild/win32-x64": "0.19.7" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/postcss": { + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.5.2.tgz", + "integrity": "sha512-CRK1uoROBfkcqrZKyaFcqCcZWNsvJ6yVYZkqTlRocZhO2s5yER6Z3f/QaYtO8RGyloPnmhwgzuPQpNGeK210xQ==", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.5.2", + "@rollup/rollup-android-arm64": "4.5.2", + "@rollup/rollup-darwin-arm64": "4.5.2", + "@rollup/rollup-darwin-x64": "4.5.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.5.2", + "@rollup/rollup-linux-arm64-gnu": "4.5.2", + "@rollup/rollup-linux-arm64-musl": "4.5.2", + "@rollup/rollup-linux-x64-gnu": "4.5.2", + "@rollup/rollup-linux-x64-musl": "4.5.2", + "@rollup/rollup-win32-arm64-msvc": "4.5.2", + "@rollup/rollup-win32-ia32-msvc": "4.5.2", + "@rollup/rollup-win32-x64-msvc": "4.5.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.3.tgz", + "integrity": "sha512-UfmUD36DKkqhi/F75RrxvPpry+9+tTkrXfMNZD+SboZqBCMsxKtO52XeGzzuh7ioz+Eo/SYDBbdb0Z7vgcDJew==", + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.35", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + } + } +} diff --git a/vite/package.json b/vite/package.json new file mode 100644 index 00000000..47285cd5 --- /dev/null +++ b/vite/package.json @@ -0,0 +1,26 @@ +{ + "name": "@winglibs/vite", + "version": "0.0.3", + "description": "Wing resource that allows deploying a Vite application to the cloud", + "repository": { + "type": "git", + "url": "https://github.com/winglang/winglibs.git", + "directory": "vite" + }, + "author": { + "name": "Cristian Pallarés", + "email": "cristianp@wing.cloud" + }, + "license": "MIT", + "files": [ + "./*.cjs", + "./*.mjs", + "./*.w" + ], + "dependencies": { + "@cdktf/provider-aws": "^19.6.0", + "cdktf": "^0.20.3", + "mime-types": "^2.1.35", + "vite": "^5.1.3" + } +} diff --git a/vite/util.cjs b/vite/util.cjs new file mode 100644 index 00000000..289c7b60 --- /dev/null +++ b/vite/util.cjs @@ -0,0 +1,19 @@ +const PAYLOAD_PREFIX = "__WINGLIBS_VITE_0WgrTtVXAiskivf2cIM-Z__"; + +exports.stringifyPayload = (payload) => { + return `${PAYLOAD_PREFIX}${JSON.stringify(payload)}`; +}; + +exports.parsePayload = (payload) => { + if (!payload.startsWith(PAYLOAD_PREFIX)) { + return undefined; + } + + return JSON.parse(payload.substring(PAYLOAD_PREFIX.length)); +}; + +const { contentType } = require("mime-types"); +const { extname } = require("node:path"); +exports.contentType = (filename) => { + return contentType(extname(filename)); +}; diff --git a/vite/vite-cli.mjs b/vite/vite-cli.mjs new file mode 100644 index 00000000..c68cc7cf --- /dev/null +++ b/vite/vite-cli.mjs @@ -0,0 +1,55 @@ +import { parseArgs } from "node:util"; +import { createServer, build, resolveConfig } from "vite"; +import { createRequire } from "node:module"; +import { plugin } from "./vite-plugin.mjs"; +const { stringifyPayload } = createRequire(import.meta.url)("./util.cjs"); + +const args = parseArgs({ + allowPositionals: true, + options: { + options: { + type: "string", + }, + }, +}); + +const options = JSON.parse(args.values.options); + +/** @type {import("vite").InlineConfig} */ +const config = { + plugins: [plugin(options)], + clearScreen: false, +}; + +const command = args.positionals[0]; +if (!command) { + throw new Error("Command is missing"); +} + +if (command === "dev") { + const server = await createServer(config); + + await server.listen(); + + console.log( + stringifyPayload({ + url: server.resolvedUrls.local[0], + }) + ); + + if (options.openBrowser) { + server.openBrowser(); + } +} else if (command === "build") { + const resolvedConfig = await resolveConfig(config); + console.log( + stringifyPayload({ + outDir: resolvedConfig.build.outDir, + }) + ); + console.log("build start"); + await build(config); + console.log("build finished"); +} else { + throw new Error(`Unknown command: ${command}`); +} diff --git a/vite/vite-plugin.mjs b/vite/vite-plugin.mjs new file mode 100644 index 00000000..2a8e0d29 --- /dev/null +++ b/vite/vite-plugin.mjs @@ -0,0 +1,75 @@ +import { mkdir, writeFile } from "node:fs/promises"; +import { dirname } from "node:path"; + +const PLUGIN_NAME = "@winglibs/vite"; + +/** + * @return {import("vite").Plugin} + */ +export const plugin = (options) => { + /** + * @type {{ + * root?: string; + * }} + */ + const context = {}; + return { + name: PLUGIN_NAME, + configResolved(config) { + context.root = config.root; + }, + transformIndexHtml(html) { + return html.replace( + "", + ` \n` + ); + }, + async buildStart() { + if (!options.generateTypeDefinitions) { + return; + } + + if (!context.root) { + throw new Error("[root] is missing"); + } + + const root = `file://${context.root}/`; + + this.info("Generating type definitions..."); + let dts = [ + `// Generated by \`${PLUGIN_NAME}\`. Do not edit.`, + `/** Holds environment variables generated from Wing. */`, + "interface WingEnv {", + ]; + try { + for (const [key, value] of Object.entries(options.publicEnv)) { + const type = typeof value === "string" ? "string" : "unknown"; + dts.push(`\treadonly ${key}: ${type};`); + } + } catch (error) { + this.error( + error instanceof Error + ? error + : new Error("Unknown error", { cause: error }) + ); + } + dts.push( + "}", + "interface Wing { env: WingEnv; }", + `declare var ${options.publicEnvName}: Wing;`, + "interface Window {", + `\treadonly ${options.publicEnvName}: Wing;`, + "}", + "" + ); + + const dtsFilename = new URL(options.typeDefinitionsFilename, root); + await mkdir(dirname(dtsFilename.pathname), { recursive: true }); + await writeFile(dtsFilename, dts.join("\n")); + }, + }; +}; diff --git a/vite/vite-types.w b/vite/vite-types.w new file mode 100644 index 00000000..6c4e61c6 --- /dev/null +++ b/vite/vite-types.w @@ -0,0 +1,29 @@ +pub struct ViteProps { + /** + * The root directory of the Vite project. + */ + root: str; + + /** + * The variables that will be passed to the browser. + */ + publicEnv: Map?; + + /** + * Whether to generate type definitions or not. + */ + generateTypeDefinitions: bool?; + + /** + * The name of the browser variable that will be used to + * access environment variables passed from the wing program. + * + * @default `wing` + */ + publicEnvName: str?; + + /** + * The name of the file that will be used to generate type definitions. + */ + typeDefinitionsFilename: str?; +} diff --git a/vite/vite.cjs b/vite/vite.cjs new file mode 100644 index 00000000..e484b26f --- /dev/null +++ b/vite/vite.cjs @@ -0,0 +1,51 @@ +const { spawnSync, spawn } = require("node:child_process"); +const { parsePayload } = require("./util.cjs"); + +exports.cliFilename = () => `${__dirname}/vite-cli.mjs`; + +exports.build = (options) => { + const args = [ + options.cliFilename, + "build", + "--options", + JSON.stringify(options), + ]; + + const buffer = spawnSync("node", args, { + cwd: options.root, + env: { + HOME: options.homeEnv, + PATH: options.pathEnv, + }, + }); + const output = buffer.stdout.toString().split("\n"); + console.log(output.slice(1).join("\n")); + return parsePayload(output[0]).outDir; +}; + +exports.dev = async (options) => { + const args = [ + options.cliFilename, + "dev", + "--options", + JSON.stringify(options), + ]; + + const child = spawn("node", args, { + cwd: options.root, + env: { + HOME: options.homeEnv, + PATH: options.pathEnv, + }, + }); + + return new Promise((resolve) => { + child.stdout.on("data", (chunk) => { + const payload = parsePayload(chunk.toString()); + if (payload) { + resolve(payload.url); + child.stdout.removeAllListeners("data"); + } + }); + }); +}; diff --git a/vite/vite.sim.w b/vite/vite.sim.w new file mode 100644 index 00000000..83a5e0f1 --- /dev/null +++ b/vite/vite.sim.w @@ -0,0 +1,37 @@ +bring cloud; +bring sim; +bring util; +bring fs; +bring "./vite-types.w" as vite_types; + +pub class Vite_sim { + pub url: str; + + new(props: vite_types.ViteProps) { + let state = new sim.State(); + this.url = state.token("url"); + + let cliFilename = Vite_sim.cliFilename(); + let homeEnv = util.env("HOME"); + let pathEnv = util.env("PATH"); + let openBrowser = util.env("WING_IS_TEST") != "true"; + + new cloud.Service(inflight () => { + let url = Vite_sim.dev({ + root: props.root, + publicEnv: props.publicEnv ?? {}, + generateTypeDefinitions: props.generateTypeDefinitions ?? true, + publicEnvName: props.publicEnvName ?? "wing", + typeDefinitionsFilename: props.typeDefinitionsFilename ?? ".winglibs/wing-env.d.ts", + cliFilename: cliFilename, + homeEnv: homeEnv, + pathEnv: pathEnv, + openBrowser: openBrowser, + }); + state.set("url", url); + }); + } + + extern "./vite.cjs" static cliFilename(): str; + extern "./vite.cjs" static inflight dev(options: Json): str; +} diff --git a/vite/vite.test.w b/vite/vite.test.w new file mode 100644 index 00000000..a4097628 --- /dev/null +++ b/vite/vite.test.w @@ -0,0 +1,33 @@ +bring cloud; +bring expect; +bring util; +bring fs; +bring "./vite.w" as vite; + +test "noop" { + assert(true); +} + +if util.env("WING_TARGET") == "tf-aws" { + let api = new cloud.Api(); + + let website = new vite.Vite( + root: "./example", + publicEnv: { + HELLO: "world", + API_URL: api.url, + }, + ); + + test "build() generates an index.html file" { + expect.equal(fs.exists("./example/dist/index.html"), true); + } + + test "build() exposes environment variables to the index.html file" { + let html = fs.readFile("./example/dist/index.html"); + expect.equal(html.contains(Json.stringify({ + HELLO: "world", + API_URL: api.url, + })), true); + } +} diff --git a/vite/vite.tf-aws.w b/vite/vite.tf-aws.w new file mode 100644 index 00000000..aeb71087 --- /dev/null +++ b/vite/vite.tf-aws.w @@ -0,0 +1,183 @@ +bring cloud; +bring util; +bring fs; +bring "cdktf" as cdktf; +bring "@cdktf/provider-aws" as aws; +bring "./vite-types.w" as vite_types; + +class Util { + extern "./util.cjs" pub static contentType(filename: str): str; + pub static listAllFiles(directory: str, handler: (str): void, cwd: str?): void { + let files = fs.readdir(directory); + let cwdLength = (cwd ?? directory).length + 1; + for file in files { + let path = "{directory}/{file}"; + if (fs.isDir(path)) { + Util.listAllFiles(path, handler, cwd ?? directory); + } else { + handler(path.substring(cwdLength)); + } + } + } +} + +pub class Vite_tf_aws { + pub url: str; + + new(props: vite_types.ViteProps) { + let cliFilename = Vite_tf_aws.cliFilename(); + let homeEnv = util.env("HOME"); + let pathEnv = util.env("PATH"); + let outDir = Vite_tf_aws.build({ + root: props.root, + publicEnv: props.publicEnv ?? {}, + generateTypeDefinitions: props.generateTypeDefinitions ?? true, + publicEnvName: props.publicEnvName ?? "wing", + typeDefinitionsFilename: props.typeDefinitionsFilename ?? ".winglibs/wing-env.d.ts", + cliFilename: cliFilename, + homeEnv: homeEnv, + pathEnv: pathEnv, + }); + let distDir = "{props.root}/{outDir}"; + + let bucket = new cloud.Bucket(); + + let terraformBucket: aws.s3Bucket.S3Bucket = unsafeCast(bucket.node.defaultChild); + Util.listAllFiles(distDir, (file) => { + let key = "/{file}"; + let filename = fs.absolute("{distDir}/{file}"); + let var cacheControl = "public, max-age={1m.seconds}"; + if key.startsWith("/assets/") { + cacheControl = "public, max-age={1y.seconds}"; + } + if file == "index.html" { + new aws.s3Object.S3Object( + dependsOn: [terraformBucket], + key: key, + bucket: terraformBucket.bucket, + content: fs.readFile(filename), + contentType: Util.contentType(filename), + cacheControl: cacheControl, + ) as "File{key.replace("/", "--")}"; + } else { + new aws.s3Object.S3Object( + dependsOn: [terraformBucket], + key: key, + bucket: terraformBucket.bucket, + source: filename, + sourceHash: cdktf.Fn.md5(filename), + contentType: Util.contentType(filename), + cacheControl: cacheControl, + ) as "File{key.replace("/", "--")}"; + } + }); + + new aws.s3BucketWebsiteConfiguration.S3BucketWebsiteConfiguration( + bucket: terraformBucket.bucket, + indexDocument: { + suffix: "index.html", + }, + errorDocument: { + key: "index.html", + }, + ); + + let originAccessControl = new aws.cloudfrontOriginAccessControl.CloudfrontOriginAccessControl( + name: "{this.node.path.substring(0, 64 - 4)}-oac", + originAccessControlOriginType: "s3", + signingBehavior: "always", + signingProtocol: "sigv4", + ); + + let distribution = new aws.cloudfrontDistribution.CloudfrontDistribution( + enabled: true, + defaultRootObject: "index.html", + customErrorResponse: [ + { + errorCode: 403, + responseCode: 200, + responsePagePath: "/index.html", + }, + { + errorCode: 404, + responseCode: 200, + responsePagePath: "/index.html", + }, + ], + origin: [ + { + domainName: terraformBucket.bucketRegionalDomainName, + originId: "s3Origin", + originAccessControlId: originAccessControl.id, + }, + ], + defaultCacheBehavior: { + allowedMethods: ["GET", "HEAD"], + cachedMethods: ["GET", "HEAD"], + targetOriginId: "s3Origin", + forwardedValues: { + queryString: false, + cookies: { forward: "none" }, + }, + viewerProtocolPolicy: "redirect-to-https", + compress: true, + minTtl: 5m.seconds, + defaultTtl: 5m.seconds, + maxTtl: 1y.seconds, + }, + priceClass: "PriceClass_100", + restrictions: { + geoRestriction: { + restrictionType: "none", + }, + }, + viewerCertificate: { + cloudfrontDefaultCertificate: true, + }, + orderedCacheBehavior: [ + { + pathPattern: "/assets/*", + allowedMethods: ["GET", "HEAD"], + cachedMethods: ["GET", "HEAD"], + targetOriginId: "s3Origin", + // See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html#managed-cache-caching-optimized. + cachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6", + compress: true, + viewerProtocolPolicy: "redirect-to-https", + }, + ], + ); + + let allowDistributionReadOnly = new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument( + statement: [ + { + actions: ["s3:GetObject"], + condition: [ + { + test: "StringEquals", + values: [distribution.arn], + variable: "AWS:SourceArn", + }, + ], + principals: [ + { + identifiers: ["cloudfront.amazonaws.com"], + type: "Service", + }, + ], + resources: ["{terraformBucket.arn}/*"], + }, + ], + ); + + new aws.s3BucketPolicy.S3BucketPolicy({ + bucket: terraformBucket.id, + policy: allowDistributionReadOnly.json, + }); + + this.url = "https://{distribution.domainName}"; + } + + extern "./vite.cjs" static cliFilename(): str; + extern "./vite.cjs" static build(options: Json): str; +} diff --git a/vite/vite.w b/vite/vite.w new file mode 100644 index 00000000..6fe41071 --- /dev/null +++ b/vite/vite.w @@ -0,0 +1,24 @@ +bring cloud; +bring sim; +bring util; +bring fs; +bring "./vite-types.w" as vite_types; +bring "./vite.sim.w" as vite_sim; +bring "./vite.tf-aws.w" as vite_tf_aws; + +pub class Vite { + pub url: str; + + new(props: vite_types.ViteProps) { + let target = util.env("WING_TARGET"); + if target == "sim" { + let implementation = new vite_sim.Vite_sim(props); + this.url = implementation.url; + } elif target == "tf-aws" { + let implementation = new vite_tf_aws.Vite_tf_aws(props); + this.url = implementation.url; + } else { + throw "Unsupported WING_TARGET ${target}"; + } + } +} diff --git a/websockets/commons/api.w b/websockets/commons/api.w index a222d1a0..89cec6f9 100644 --- a/websockets/commons/api.w +++ b/websockets/commons/api.w @@ -23,7 +23,7 @@ pub interface IWebSocket extends std.IResource { /** * Sends a message through the WebSocket with inflight handling. */ - inflight sendMessage(connectionId: str, message: str); + inflight sendMessage(connectionId: str, message: str): void; } /** diff --git a/websockets/lib.test.w b/websockets/lib.test.w index f0fce0da..0408a431 100644 --- a/websockets/lib.test.w +++ b/websockets/lib.test.w @@ -39,7 +39,7 @@ wb.onMessage(inflight (id: str, body: str): void => { wb.initialize(); interface IWebSocketJS { - inflight on(cmd: str, handler: inflight(str):void); + inflight on(cmd: str, handler: inflight(str):void): void; inflight send(e: str): void; inflight close(): void; } diff --git a/websockets/package-lock.json b/websockets/package-lock.json index ec5b8b73..faeb2426 100644 --- a/websockets/package-lock.json +++ b/websockets/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/websockets", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/websockets", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "@aws-sdk/client-apigatewaymanagementapi": "^3.451.0", @@ -885,6 +885,15 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@opentelemetry/api": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.7.0.tgz", + "integrity": "sha512-AdY5wvN0P2vXBi3b29hxZgSFvdhdxPB9+f0B6s//P9Q8nibRWeA3cHm8UmLpio9ABigkVHJ5NMPk+Mz8VCCyrw==", + "peer": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", diff --git a/websockets/package.json b/websockets/package.json index 1e6c92d2..6d34fa1d 100644 --- a/websockets/package.json +++ b/websockets/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/websockets", "description": "WebSocket library for Wing", - "version": "0.1.1", + "version": "0.1.2", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/websockets/platform/tf-aws.w b/websockets/platform/tf-aws.w index f5a575ef..c7bd5502 100644 --- a/websockets/platform/tf-aws.w +++ b/websockets/platform/tf-aws.w @@ -145,7 +145,10 @@ pub class WebSocket_tfaws impl awsapi.IAwsWebSocket { } extern "../inflight/websocket.aws.js" static inflight _postToConnection(endpointUrl: str, connectionId: str, message: str): void; - pub inflight sendMessage(connectionId: str, message: str) { - WebSocket_tfaws._postToConnection(this.url.replace("wss://", "https://"), connectionId, message); + pub inflight sendMessage(connectionId: str, message: str): void { + // TODO: str.replace does not work when applied to the class property `this.url`, so we need to use a local var for now. + let var url = this.url; + url = url.replace("wss://", "https://"); + WebSocket_tfaws._postToConnection(url, connectionId, message); } }