From 826065cff518dc2d026c6034b7ee5b77265b7006 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Mon, 17 Jun 2024 10:40:22 +0300 Subject: [PATCH] chore: update libraries to use nodeof --- .gitattributes | 3 + .mkrepo/gitattributes.w | 3 + bedrock/bedrock.w | 2 +- bedrock/joke.test.w | 6 +- bedrock/package.json | 2 +- cdk8s/package-lock.json | 20 +- cdk8s/package.json | 2 +- checks/check.w | 2 +- checks/package.json | 4 +- checks/results.w | 8 +- cognito/package.json | 2 +- cognito/platform/sim.w | 2 +- containers/aws.w | 4 +- containers/helm.extern.d.ts | 7 +- containers/package-lock.json | 4 +- containers/package.json | 2 +- containers/tfaws-ecr.w | 2 +- containers/tfaws-eks.w | 8 +- dynamodb/dynamodb.sim.w | 6 +- dynamodb/dynamodb.tf-aws.w | 2 +- dynamodb/package.json | 2 +- eventbridge/package.json | 2 +- eventbridge/platform/awscdk/eventbridge.w | 2 +- eventbridge/platform/sim/bus.w | 4 +- eventbridge/platform/sim/eventbridge.w | 4 +- eventbridge/platform/tfaws/eventbridge.w | 2 +- github/lib.w | 2 +- github/ngrok/ngrok.w | 2 +- github/package.json | 2 +- postgres/lib.w | 6 +- postgres/package.json | 4 +- python/package.json | 6 +- python/sim/containers.w | 10 +- react/package-lock.json | 4 +- react/package.json | 2 +- redis/package.json | 4 +- redis/redis.extern.d.ts | 12 +- sagemaker/package.json | 2 +- sagemaker/sagemaker.w | 2 +- ses/lib.w | 2 +- ses/package.json | 2 +- slack/package-lock.json | 656 ++++++++++++++++++++++ sns/lib.w | 2 +- sns/package.json | 2 +- tf/README.md | 2 +- tf/package-lock.json | 4 +- tf/package.json | 2 +- tsoa/lib.extern.d.ts | 11 +- tsoa/package-lock.json | 4 +- tsoa/package.json | 2 +- tsoa/tfaws.w | 2 +- vite/package.json | 2 +- vite/vite.tf-aws.w | 4 +- websockets/package.json | 4 +- 54 files changed, 769 insertions(+), 97 deletions(-) create mode 100644 slack/package-lock.json diff --git a/.gitattributes b/.gitattributes index f6948154..71874bf3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,9 @@ /.github/workflows/*-pull.yaml linguist-generated /.github/workflows/*-release.yaml linguist-generated +/.github/workflows/canary.yaml linguist-generated /**/package-lock.json linguist-generated /**/*.extern.d.ts linguist-generated /package-lock.json linguist-generated +/.mergify.yml linguist-generated +/.gitattributes linguist-generated diff --git a/.mkrepo/gitattributes.w b/.mkrepo/gitattributes.w index 347470d0..bd36f639 100644 --- a/.mkrepo/gitattributes.w +++ b/.mkrepo/gitattributes.w @@ -7,9 +7,12 @@ pub class GitAttributes { lines.push(""); lines.push("/.github/workflows/*-pull.yaml linguist-generated"); lines.push("/.github/workflows/*-release.yaml linguist-generated"); + lines.push("/.github/workflows/canary.yaml linguist-generated"); lines.push("/**/package-lock.json linguist-generated"); lines.push("/**/*.extern.d.ts linguist-generated"); lines.push("/package-lock.json linguist-generated"); + lines.push("/.mergify.yml linguist-generated"); + lines.push("/.gitattributes linguist-generated"); lines.push(""); fs.writeFile(".gitattributes", lines.join("\n")); } diff --git a/bedrock/bedrock.w b/bedrock/bedrock.w index a042eb1f..f4ac671f 100644 --- a/bedrock/bedrock.w +++ b/bedrock/bedrock.w @@ -14,7 +14,7 @@ pub class Model impl a.IModel { let target = util.env("WING_TARGET"); if target == "sim" { - if std.Node.of(this).app.isTestEnvironment { + if nodeof(this).app.isTestEnvironment { // in case of test running on sim, use simulator version this.inner = new s.Model_sim(modelId) as "sim"; } else { diff --git a/bedrock/joke.test.w b/bedrock/joke.test.w index 9d0be99d..541637d6 100644 --- a/bedrock/joke.test.w +++ b/bedrock/joke.test.w @@ -6,8 +6,8 @@ let joke = new j.JokeMaker(); // an experimental pattern for mocking responses // this will only kick in if is in sim and test mode -if util.env("WING_TARGET") == "sim" && std.Node.of(joke).app.isTestEnvironment { - let model = std.Node.of(joke).findChild("claude").node.findChild("sim"); +if util.env("WING_TARGET") == "sim" && nodeof(joke).app.isTestEnvironment { + let model = nodeof(nodeof(joke).findChild("claude")).findChild("sim"); let sim: s.Model_sim = unsafeCast(model); sim.setMockResponse(inflight (body) => { return { @@ -21,4 +21,4 @@ if util.env("WING_TARGET") == "sim" && std.Node.of(joke).app.isTestEnvironment { test "make a joke" { let res = joke.makeJoke("oranges"); log(res); -} \ No newline at end of file +} diff --git a/bedrock/package.json b/bedrock/package.json index a79a652a..24f76364 100644 --- a/bedrock/package.json +++ b/bedrock/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/bedrock", "description": "A Wing library for Amazon Bedrock", - "version": "0.0.6", + "version": "0.0.7", "author": { "name": "Eyal Keren", "email": "eyalk@wing.cloud" diff --git a/cdk8s/package-lock.json b/cdk8s/package-lock.json index 71ba6d30..bee17fc1 100644 --- a/cdk8s/package-lock.json +++ b/cdk8s/package-lock.json @@ -8,11 +8,11 @@ "name": "@winglibs/cdk8s", "version": "0.0.1", "license": "MIT", - "dependencies": { - "cdk8s": "^2.68.61" - }, "devDependencies": { "cdk8s-plus-27": "^2.9.0" + }, + "peerDependencies": { + "cdk8s": "^2" } }, "node_modules/@colors/colors": { @@ -329,7 +329,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "devOptional": true + "optional": true }, "node_modules/base64-js": { "version": "1.5.1", @@ -372,7 +372,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, + "optional": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -423,6 +423,7 @@ "follow-redirects", "yaml" ], + "peer": true, "dependencies": { "fast-json-patch": "^3.1.1", "follow-redirects": "^1.15.6", @@ -497,7 +498,8 @@ "node_modules/cdk8s/node_modules/fast-json-patch": { "version": "3.1.1", "inBundle": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/cdk8s/node_modules/follow-redirects": { "version": "1.15.6", @@ -509,6 +511,7 @@ ], "inBundle": true, "license": "MIT", + "peer": true, "engines": { "node": ">=4.0" }, @@ -522,6 +525,7 @@ "version": "2.4.1", "inBundle": true, "license": "ISC", + "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -712,7 +716,7 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "devOptional": true + "optional": true }, "node_modules/constructs": { "version": "10.3.0", @@ -1394,7 +1398,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, + "optional": true, "dependencies": { "brace-expansion": "^1.1.7" }, diff --git a/cdk8s/package.json b/cdk8s/package.json index 6234824b..31827aac 100644 --- a/cdk8s/package.json +++ b/cdk8s/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/cdk8s", "description": "cdk8s library for Wing", - "version": "0.0.1", + "version": "0.0.2", "author": { "name": "Elad Ben-Israel", "email": "eladb@wing.cloud" diff --git a/checks/check.w b/checks/check.w index cb7f84e6..a99ce704 100644 --- a/checks/check.w +++ b/checks/check.w @@ -78,7 +78,7 @@ pub class Check impl ICheck { } if props?.testing ?? true { - new std.Test(handler) as "check {this.node.id}"; + new std.Test(handler) as "check {nodeof(this).id}"; } this.invoker = new cloud.Function(wrapper) as "run"; diff --git a/checks/package.json b/checks/package.json index 0ed885bd..63b7d560 100644 --- a/checks/package.json +++ b/checks/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/checks", - "version": "0.0.11", + "version": "0.0.12", "description": "Cloud checks", "publishConfig": { "access": "public", @@ -26,4 +26,4 @@ ] }, "license": "MIT" -} \ No newline at end of file +} diff --git a/checks/results.w b/checks/results.w index 2086188e..6e8913f8 100644 --- a/checks/results.w +++ b/checks/results.w @@ -20,8 +20,8 @@ pub struct CheckResult { /** Centralized storage for check results */ pub class Results { pub static of(scope: std.IResource): Results { - let var root = std.Node.of(scope).root; - let rootNode = std.Node.of(root); + let var root = nodeof(scope).root; + let rootNode = nodeof(root); // special case where the root is an app with a test runner (which means we are running inside a test context) // in this case our app is actually the child called "Default". yes this is horribly hacky. @@ -33,7 +33,7 @@ pub class Results { } let id = "checks.Results"; - let exists: Results? = unsafeCast(std.Node.of(root).tryFindChild(id)); + let exists: Results? = unsafeCast(nodeof(root).tryFindChild(id)); let rootAsResource: Results = unsafeCast(root); return exists ?? new Results() as id in rootAsResource; } @@ -69,4 +69,4 @@ pub class Results { inflight makeLatestKey(checkid: str): str { return this.makeKey(checkid, "latest.json"); } -} \ No newline at end of file +} diff --git a/cognito/package.json b/cognito/package.json index ec63d2c4..7a176dbd 100644 --- a/cognito/package.json +++ b/cognito/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/cognito", - "version": "0.0.10", + "version": "0.0.11", "description": "A wing library to work with AWS Cognito", "author": { "name": "Elad Cohen", diff --git a/cognito/platform/sim.w b/cognito/platform/sim.w index 6a7033d1..568a1c27 100644 --- a/cognito/platform/sim.w +++ b/cognito/platform/sim.w @@ -161,7 +161,7 @@ pub class Cognito_sim impl types.ICognito { return cloud.ApiResponse.parseJson(res!); }); - this.api.node.tryRemoveChild(handler.mapping.node.id); + nodeof(this.api).tryRemoveChild(handler.mapping.node.id); return; } diff --git a/containers/aws.w b/containers/aws.w index f256431c..5220cbd8 100644 --- a/containers/aws.w +++ b/containers/aws.w @@ -5,7 +5,7 @@ pub class Aws { pub static getOrCreate(scope: std.IResource): Aws { let stack = nodeof(scope).root; let id = "WingAwsUtil"; - let existing: Aws? = unsafeCast(stack.node.tryFindChild(id)); + let existing: Aws? = unsafeCast(nodeof(stack).tryFindChild(id)); return (existing ?? new Aws() as id in stack); } @@ -25,4 +25,4 @@ pub class Aws { pub accountId(): str { return this.accountData.accountId; } -} \ No newline at end of file +} diff --git a/containers/helm.extern.d.ts b/containers/helm.extern.d.ts index 4eb3253c..b5ee8be5 100644 --- a/containers/helm.extern.d.ts +++ b/containers/helm.extern.d.ts @@ -131,7 +131,7 @@ export class Node { readonly setContext: (key: string, value?: any) => void; /** Return a direct child by id, or undefined. @returns the child if found, or undefined */ - readonly tryFindChild: (id: string) => (IConstruct) | undefined; + readonly tryFindChild: (id: string) => IConstruct | void; /** Retrieves a value from tree context. Context is usually initialized at the root, but can be overridden at any point in the tree. @returns The context value or `undefined` if there is no context value for this key. */ @@ -207,9 +207,8 @@ export class ApiObjectMetadataDefinition { readonly addLabel: (key: string, value: string) => void; /** Add an owner. */ readonly addOwnerReference: (owner: OwnerReference) => void; - /** - @returns a value of a label or undefined */ - readonly getLabel: (key: string) => (string) | undefined; + /** @returns a value of a label or undefined */ + readonly getLabel: (key: string) => string | void; /** The name of the API object. If a name is specified in `metadata.name` this will be the name returned. Otherwise, a name will be generated by calling diff --git a/containers/package-lock.json b/containers/package-lock.json index 891c3a8b..45e6be55 100644 --- a/containers/package-lock.json +++ b/containers/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/containers", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/containers", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "peerDependencies": { "@cdktf/provider-aws": "^19.12.0", diff --git a/containers/package.json b/containers/package.json index 5d9a60d4..0f9bee42 100644 --- a/containers/package.json +++ b/containers/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/containers", - "version": "0.1.1", + "version": "0.1.2", "description": "Container support for Wing", "repository": { "type": "git", diff --git a/containers/tfaws-ecr.w b/containers/tfaws-ecr.w index fc0cff35..13dead1d 100644 --- a/containers/tfaws-ecr.w +++ b/containers/tfaws-ecr.w @@ -58,7 +58,7 @@ pub class Repository { // null provider singleton let root = nodeof(this).root; let nullProviderId = "NullProvider"; - if !root.node.tryFindChild(nullProviderId)? { + if !nodeof(root).tryFindChild(nullProviderId)? { new null_provider.provider.NullProvider() as nullProviderId in root; } diff --git a/containers/tfaws-eks.w b/containers/tfaws-eks.w index 124cfaf8..7530bff3 100644 --- a/containers/tfaws-eks.w +++ b/containers/tfaws-eks.w @@ -28,7 +28,7 @@ pub class ClusterBase impl ICluster { let root = nodeof(this).root; let singletonKey = "WingKubernetesProvider"; let attributes = this.attributes(); - let existing = root.node.tryFindChild(singletonKey); + let existing = nodeof(root).tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } @@ -49,7 +49,7 @@ pub class ClusterBase impl ICluster { let root = nodeof(this).root; let singletonKey = "WingHelmProvider"; let attributes = this.attributes(); - let existing = root.node.tryFindChild(singletonKey); + let existing = nodeof(root).tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } @@ -85,7 +85,7 @@ pub class Cluster extends ClusterBase impl ICluster { pub static getOrCreate(scope: std.IResource): ICluster { let root = nodeof(scope).root; let uid = "WingEksCluster"; - let existing: ICluster? = unsafeCast(root.node.tryFindChild(uid)); + let existing: ICluster? = unsafeCast(nodeof(root).tryFindChild(uid)); let newCluster = (): ICluster => { if let attrs = Cluster.tryReadParameters(scope) { @@ -189,7 +189,7 @@ pub class Cluster extends ClusterBase impl ICluster { let lbRole = new cdktf.TerraformHclModule( source: "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks", variables: { - role_name: "eks-lb-role-{this.node.addr}", + role_name: "eks-lb-role-{nodeof(this).addr}", attach_load_balancer_controller_policy: true, oidc_providers: { main: { diff --git a/dynamodb/dynamodb.sim.w b/dynamodb/dynamodb.sim.w index a19277dc..dd35d5ed 100644 --- a/dynamodb/dynamodb.sim.w +++ b/dynamodb/dynamodb.sim.w @@ -93,8 +93,8 @@ class Host { pub static of(scope: std.IResource): Host { let uid = "DynamodbHost-7JOQ92VWh6OavMXYpWx9O"; - let root = std.Node.of(scope).root; - let rootNode = std.Node.of(root); + let root = nodeof(scope).root; + let rootNode = nodeof(root); let host = unsafeCast(rootNode.tryFindChild(uid)) ?? new Host() as uid in root; nodeof(host).hidden = true; return host; @@ -111,7 +111,7 @@ pub class Table_sim impl dynamodb_types.ITable { this.host = Host.of(this); this.adminEndpoint = this.host.ui?.endpoint; - let tableName = props.name ?? this.node.addr; + let tableName = props.name ?? nodeof(this).addr; let state = new sim.State(); this.tableName = state.token("tableName"); diff --git a/dynamodb/dynamodb.tf-aws.w b/dynamodb/dynamodb.tf-aws.w index 89c7fb03..8700300a 100644 --- a/dynamodb/dynamodb.tf-aws.w +++ b/dynamodb/dynamodb.tf-aws.w @@ -52,7 +52,7 @@ pub class Table_tfaws impl dynamodb_types.ITable { // - Get rid of the initial "root/Default/Default/" part (21 characters) // - Make room for the last 8 digits of the address (9 characters including hyphen). 255 is the maximum length of an AWS resource name // - Add the last 8 digits of the address - name: props.name ?? "{this.node.path.replaceAll("/", "-").substring(21, (255+21)-9)}-{this.node.addr.substring(42-8)}", + name: props.name ?? "{nodeof(this).path.replaceAll("/", "-").substring(21, (255+21)-9)}-{nodeof(this).addr.substring(42-8)}", attribute: props.attributes, hashKey: props.hashKey, rangeKey: props.rangeKey, diff --git a/dynamodb/package.json b/dynamodb/package.json index 192f2be7..6d84dbd1 100644 --- a/dynamodb/package.json +++ b/dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/dynamodb", - "version": "0.1.11", + "version": "0.1.12", "description": "DynamoDB library for Wing", "author": { "name": "Cristian Pallarés", diff --git a/eventbridge/package.json b/eventbridge/package.json index 542f2376..1764c32f 100644 --- a/eventbridge/package.json +++ b/eventbridge/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/eventbridge", "description": "Amazon EventBridge library for Wing", - "version": "0.1.3", + "version": "0.1.4", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/eventbridge/platform/awscdk/eventbridge.w b/eventbridge/platform/awscdk/eventbridge.w index eb0f1fc6..21fcba1e 100644 --- a/eventbridge/platform/awscdk/eventbridge.w +++ b/eventbridge/platform/awscdk/eventbridge.w @@ -15,7 +15,7 @@ pub class Bus impl types.IBus { if let eventBridgeName = app.parameters.value("eventBridgeName") { this.eventBridge = cdk.aws_events.EventBus.fromEventBusName(this, "EventBridge", eventBridgeName); } else { - this.eventBridge = new cdk.aws_events.EventBus(eventBusName: props?.name ?? "eventbridge-{this.node.addr.substring(0, 8)}") as "EventBridge"; + this.eventBridge = new cdk.aws_events.EventBus(eventBusName: props?.name ?? "eventbridge-{nodeof(this).addr.substring(0, 8)}") as "EventBridge"; } } diff --git a/eventbridge/platform/sim/bus.w b/eventbridge/platform/sim/bus.w index 507d25f6..ba64eb2d 100644 --- a/eventbridge/platform/sim/bus.w +++ b/eventbridge/platform/sim/bus.w @@ -49,9 +49,9 @@ pub class EventBridgeBus { } let handler = new MyHandler(this.topic) as "EventBridgeOnMessageHandler{this.handlerCount}"; - let node = std.Node.of(handler); + let node = nodeof(handler); - let handlerNode = std.Node.of(handler.onMessageHandler); + let handlerNode = nodeof(handler.onMessageHandler); this.handlerCount += 1; return handler.onMessageHandler; diff --git a/eventbridge/platform/sim/eventbridge.w b/eventbridge/platform/sim/eventbridge.w index 0a390394..8818393b 100644 --- a/eventbridge/platform/sim/eventbridge.w +++ b/eventbridge/platform/sim/eventbridge.w @@ -16,7 +16,7 @@ pub class Bus impl types.IBus { handler(event); }, pattern); - let node = std.Node.of(this); + let node = nodeof(this); } } @@ -34,7 +34,7 @@ pub class Bus impl types.IBus { queue.push(Json.stringify(json)); }, pattern); - let node = std.Node.of(this); + let node = nodeof(this); node.addConnection( name: "event rule", diff --git a/eventbridge/platform/tfaws/eventbridge.w b/eventbridge/platform/tfaws/eventbridge.w index c239f519..9da36b3f 100644 --- a/eventbridge/platform/tfaws/eventbridge.w +++ b/eventbridge/platform/tfaws/eventbridge.w @@ -19,7 +19,7 @@ pub class Bus impl types.IBus { this.busName = bus.name; this.busArn = bus.arn; } else { - let bus = new tfAws.cloudwatchEventBus.CloudwatchEventBus(name: props?.name ?? "eventbridge-{this.node.addr.substring(0, 8)}") as "EventBridge"; + let bus = new tfAws.cloudwatchEventBus.CloudwatchEventBus(name: props?.name ?? "eventbridge-{nodeof(this).addr.substring(0, 8)}") as "EventBridge"; this.busName = bus.name; this.busArn = bus.arn; } diff --git a/github/lib.w b/github/lib.w index 0a512417..699887c4 100644 --- a/github/lib.w +++ b/github/lib.w @@ -44,7 +44,7 @@ pub class ProbotApp { status: 200 }; }); - if !std.Node.of(this).app.isTestEnvironment { + if !nodeof(this).app.isTestEnvironment { let target = util.env("WING_TARGET"); if target == "sim" { let devNgrok = new ngrok.Ngrok( diff --git a/github/ngrok/ngrok.w b/github/ngrok/ngrok.w index e494a7b7..b9b4cec0 100644 --- a/github/ngrok/ngrok.w +++ b/github/ngrok/ngrok.w @@ -54,6 +54,6 @@ pub class Ngrok { } throw "Couldn't find the ngrok tunnel for {props.url}"; }); - urlRetriever.node.addDependency(ngrok); + nodeof(urlRetriever).addDependency(ngrok); } } diff --git a/github/package.json b/github/package.json index 9f2981c1..922914cf 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.10", + "version": "0.0.11", "author": { "name": "Elad Cohen", "email": "eladc@wing.cloud" diff --git a/postgres/lib.w b/postgres/lib.w index 766868aa..0189a9f6 100644 --- a/postgres/lib.w +++ b/postgres/lib.w @@ -65,7 +65,7 @@ pub class DatabaseRef { new() { // For database refs, we just need to have a secret connection string to use for queries - this.connectionSecret = new cloud.Secret(name: "connectionString_{this.node.id}"); + this.connectionSecret = new cloud.Secret(name: "connectionString_{nodeof(this).id}"); let target = util.env("WING_TARGET"); if target == "tf-aws" { @@ -240,7 +240,7 @@ class DatabaseRDS impl IDatabase { ); let proxy = new tfaws.dbProxy.DbProxy( - name: "proxy{this.node.addr.substring(0, -8)}", + name: "proxy{nodeof(this).addr.substring(0, -8)}", engineFamily: "POSTGRESQL", auth: { secret_arn: cluster.masterUserSecret.get(0).secretArn @@ -383,7 +383,7 @@ class DatabaseNeon impl IDatabase { neonProvider(): cdktf.TerraformProvider { let stack = cdktf.TerraformStack.of(this); let singletonKey = "WingNeonProvider"; - let existing = stack.node.tryFindChild(singletonKey); + let existing = nodeof(stack).tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } diff --git a/postgres/package.json b/postgres/package.json index 9d3cace0..c9179800 100644 --- a/postgres/package.json +++ b/postgres/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/postgres", - "version": "0.1.7", + "version": "0.1.8", "description": "Postgres support for Wing", "repository": { "type": "git", @@ -14,7 +14,7 @@ "peerDependencies": { "@rybickic/cdktf-provider-neon": "^2.0.0", "@cdktf/provider-aws": "^19.12.0", - "@winglibs/containers": "^0.1.0", + "@winglibs/containers": "^0.1.2", "pg": "^8.11.3", "cdktf": "^0.20.6" }, diff --git a/python/package.json b/python/package.json index 39404ebd..94ec1be1 100644 --- a/python/package.json +++ b/python/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/python", "description": "python library for Wing", - "version": "0.0.10", + "version": "0.0.11", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", @@ -23,8 +23,8 @@ "@cdktf/provider-aws": "^19.13.0", "@smithy/util-utf8": "^2.3.0", "@winglibs/dynamodb": "^0.1.10", - "@winglibs/ses": "^0.0.2", - "@winglibs/sns": "^0.1.0", + "@winglibs/ses": "^0.0.3", + "@winglibs/sns": "^0.1.1", "cdktf": "^0.20.6", "glob": "^10.3.12" } diff --git a/python/sim/containers.w b/python/sim/containers.w index bc17f6f3..443cd982 100644 --- a/python/sim/containers.w +++ b/python/sim/containers.w @@ -8,7 +8,7 @@ pub class Util { pub extern "./util.js" inflight static _spawn(command: str, args: Array, options: Map): void; pub static entrypointDir(scope: std.IResource): str { - return std.Node.of(scope).app.entrypointDir; + return nodeof(scope).app.entrypointDir; } pub static isPath(s: str): bool { @@ -228,7 +228,7 @@ pub class Container { util.exec("docker", ["rm", "-f", containerName], { env: { PATH: pathEnv } }); }; }, {autoStart: false}) as "ContainerService"; - std.Node.of(this.containerService).hidden = true; + nodeof(this.containerService).hidden = true; this.readinessService = new cloud.Service(inflight () => { let opts = this.props; @@ -295,9 +295,9 @@ pub class Container { } } }, {autoStart: false}) as "ReadinessService"; - std.Node.of(this.readinessService).hidden = true; + nodeof(this.readinessService).hidden = true; - std.Node.of(this.state).hidden = true; + nodeof(this.state).hidden = true; } pub inflight start(env: Map) { @@ -308,4 +308,4 @@ pub class Container { this.containerService.start(); this.readinessService.start(); } -} \ No newline at end of file +} diff --git a/react/package-lock.json b/react/package-lock.json index 88c2f71a..3f8220b3 100644 --- a/react/package-lock.json +++ b/react/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/react", - "version": "0.0.2", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/react", - "version": "0.0.2", + "version": "0.1.0", "license": "MIT", "peerDependencies": { "finalhandler": "^1.2.0", diff --git a/react/package.json b/react/package.json index 790df27b..2499fe71 100644 --- a/react/package.json +++ b/react/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/react", "description": "React library for Wing", - "version": "0.1.0", + "version": "0.1.1", "author": { "name": "Meir Elbaz", "email": "maornet@gmail.com" diff --git a/redis/package.json b/redis/package.json index 195e6e8a..9dfa8d11 100644 --- a/redis/package.json +++ b/redis/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/redis", - "version": "0.0.8", + "version": "0.0.9", "description": "Redis resource for Wing", "repository": { "type": "git", @@ -18,7 +18,7 @@ }, "license": "MIT", "peerDependencies": { - "@winglibs/containers": "^0.0.27", + "@winglibs/containers": "^0.1.2", "redis": "^4.6.11" } } diff --git a/redis/redis.extern.d.ts b/redis/redis.extern.d.ts index a85cf519..27a6ea0a 100644 --- a/redis/redis.extern.d.ts +++ b/redis/redis.extern.d.ts @@ -3,11 +3,11 @@ export default interface extern { } export interface IRedis$Inflight { readonly del: (key: string) => Promise; - readonly get: (key: string) => Promise<(string) | undefined>; - readonly hGet: (key: string, field: string) => Promise<(string) | undefined>; + readonly get: (key: string) => Promise; + readonly hGet: (key: string, field: string) => Promise; readonly hSet: (key: string, field: string, value: string) => Promise; readonly sAdd: (key: string, value: string) => Promise; - readonly sMembers: (key: string) => Promise<((readonly (string)[])) | undefined>; + readonly sMembers: (key: string) => Promise<(readonly (string)[]) | void>; readonly set: (key: string, value: string) => Promise; readonly url: () => Promise; } @@ -15,11 +15,11 @@ export interface IRedisClient$Inflight extends IRedis$Inflight { readonly connect: () => Promise; readonly del: (key: string) => Promise; readonly disconnect: () => Promise; - readonly get: (key: string) => Promise<(string) | undefined>; - readonly hGet: (key: string, field: string) => Promise<(string) | undefined>; + readonly get: (key: string) => Promise; + readonly hGet: (key: string, field: string) => Promise; readonly hSet: (key: string, field: string, value: string) => Promise; readonly sAdd: (key: string, value: string) => Promise; - readonly sMembers: (key: string) => Promise<((readonly (string)[])) | undefined>; + readonly sMembers: (key: string) => Promise<(readonly (string)[]) | void>; readonly set: (key: string, value: string) => Promise; readonly url: () => Promise; } \ No newline at end of file diff --git a/sagemaker/package.json b/sagemaker/package.json index 4466aeda..1e31917c 100644 --- a/sagemaker/package.json +++ b/sagemaker/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/sagemaker", - "version": "0.0.4", + "version": "0.0.5", "description": "The library enables owners of a trained sagemaker model, to access its Endpoints from a winglang inflight code.", "repository": { "type": "git", diff --git a/sagemaker/sagemaker.w b/sagemaker/sagemaker.w index 08ee7738..15f92220 100644 --- a/sagemaker/sagemaker.w +++ b/sagemaker/sagemaker.w @@ -16,7 +16,7 @@ pub class Endpoint impl types.ISageMaker { let target = util.env("WING_TARGET"); if target == "sim" { - if std.Node.of(this).app.isTestEnvironment { + if nodeof(this).app.isTestEnvironment { // in case of test running on sim, use simulator version this.inner = new s.SageMaker_sim(endpointName, inferenceComponentName) as "sim"; } else { diff --git a/ses/lib.w b/ses/lib.w index e2cb4ec3..8500315d 100644 --- a/ses/lib.w +++ b/ses/lib.w @@ -11,7 +11,7 @@ pub class EmailService impl types.IEmailService { new(props: types.EmailServiceProps) { let target = util.env("WING_TARGET"); if target == "sim" { - if std.Node.of(this).app.isTestEnvironment { + if nodeof(this).app.isTestEnvironment { this.inner = new sim.EmailService_sim(props); } else { this.inner = new tfaws.EmailService_tfaws(props); diff --git a/ses/package.json b/ses/package.json index 2c0ed309..5af06760 100644 --- a/ses/package.json +++ b/ses/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/ses", "description": "Wing library for interacting with AWS SES", - "version": "0.0.2", + "version": "0.0.3", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/slack/package-lock.json b/slack/package-lock.json new file mode 100644 index 00000000..1d7319a0 --- /dev/null +++ b/slack/package-lock.json @@ -0,0 +1,656 @@ +{ + "name": "@winglibs/slack", + "version": "0.1.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@winglibs/slack", + "version": "0.1.1", + "license": "MIT", + "peerDependencies": { + "cdktf": "0.20.7" + } + }, + "node_modules/cdktf": { + "version": "0.20.7", + "resolved": "https://registry.npmjs.org/cdktf/-/cdktf-0.20.7.tgz", + "integrity": "sha512-7za8QQYM1G0/6JUCYY+5smwNfNfbiZVPCMD7SeX2rTYmOLaGEkHZtMvuUTEKSqsE56fKudnfVd2J2edz2CETFg==", + "bundleDependencies": [ + "archiver", + "json-stable-stringify", + "semver" + ], + "peer": true, + "dependencies": { + "archiver": "6.0.2", + "json-stable-stringify": "1.1.1", + "semver": "7.6.0" + }, + "peerDependencies": { + "constructs": "^10.0.25" + } + }, + "node_modules/cdktf/node_modules/archiver": { + "version": "6.0.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/b4a": { + "version": "1.6.6", + "inBundle": true, + "license": "Apache-2.0", + "peer": true + }, + "node_modules/cdktf/node_modules/balanced-match": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/bare-events": { + "version": "2.2.1", + "inBundle": true, + "license": "Apache-2.0", + "optional": true, + "peer": true + }, + "node_modules/cdktf/node_modules/brace-expansion": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/cdktf/node_modules/buffer-crc32": { + "version": "0.2.13", + "inBundle": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/cdktf/node_modules/call-bind": { + "version": "1.0.7", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/compress-commons": { + "version": "5.0.3", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/crc-32": { + "version": "1.2.2", + "inBundle": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cdktf/node_modules/crc32-stream": { + "version": "5.0.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "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.4", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/es-define-property": { + "version": "1.0.0", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/es-errors": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/fast-fifo": { + "version": "1.3.2", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/fs.realpath": { + "version": "1.0.0", + "inBundle": true, + "license": "ISC", + "peer": true + }, + "node_modules/cdktf/node_modules/function-bind": { + "version": "1.1.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/get-intrinsic": { + "version": "1.2.4", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/glob": { + "version": "8.1.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "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", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/has-property-descriptors": { + "version": "1.0.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/has-proto": { + "version": "1.0.3", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/hasown": { + "version": "2.0.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/inflight": { + "version": "1.0.6", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/inherits": { + "version": "2.0.4", + "inBundle": true, + "license": "ISC", + "peer": true + }, + "node_modules/cdktf/node_modules/isarray": { + "version": "2.0.5", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/json-stable-stringify": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/cdktf/node_modules/lazystream": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/cdktf/node_modules/lodash": { + "version": "4.17.21", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/lru-cache": { + "version": "6.0.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/minimatch": { + "version": "5.1.6", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/normalize-path": { + "version": "3.0.0", + "inBundle": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cdktf/node_modules/object-keys": { + "version": "1.1.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/once": { + "version": "1.4.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/cdktf/node_modules/process-nextick-args": { + "version": "2.0.1", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/queue-tick": { + "version": "1.0.1", + "inBundle": true, + "license": "MIT", + "peer": true + }, + "node_modules/cdktf/node_modules/readable-stream": { + "version": "3.6.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/semver": { + "version": "7.6.0", + "inBundle": true, + "license": "ISC", + "peer": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cdktf/node_modules/set-function-length": { + "version": "1.2.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cdktf/node_modules/streamx": { + "version": "2.16.1", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/cdktf/node_modules/string_decoder": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "peer": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/cdktf/node_modules/tar-stream": { + "version": "3.1.7", + "inBundle": true, + "license": "MIT", + "peer": true, + "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", + "peer": true + }, + "node_modules/cdktf/node_modules/wrappy": { + "version": "1.0.2", + "inBundle": true, + "license": "ISC", + "peer": true + }, + "node_modules/cdktf/node_modules/yallist": { + "version": "4.0.0", + "inBundle": true, + "license": "ISC", + "peer": true + }, + "node_modules/cdktf/node_modules/zip-stream": { + "version": "5.0.2", + "inBundle": true, + "license": "MIT", + "peer": true, + "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" + } + } + } +} diff --git a/sns/lib.w b/sns/lib.w index e193925c..f5accdf3 100644 --- a/sns/lib.w +++ b/sns/lib.w @@ -12,7 +12,7 @@ pub class MobileNotifications impl types.IMobileNotifications { new() { let target = util.env("WING_TARGET"); if target == "sim" { - if std.Node.of(this).app.isTestEnvironment { + if nodeof(this).app.isTestEnvironment { this.inner = new sim.MobileNotifications_sim(); } else { this.inner = new aws.MobileNotifications_aws(); diff --git a/sns/package.json b/sns/package.json index b2f21aa1..f3506d2b 100644 --- a/sns/package.json +++ b/sns/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/sns", "description": "Wing library for interacting with AWS SNS", - "version": "0.1.0", + "version": "0.1.1", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/tf/README.md b/tf/README.md index 2ac4bc76..fc708760 100644 --- a/tf/README.md +++ b/tf/README.md @@ -169,7 +169,7 @@ class DnsimpleProvider { pub static getOrCreate(scope: std.IResource): tf.Provider { let root = nodeof(scope).root; let singletonKey = "WingDnsimpleProvider"; - let existing = root.node.tryFindChild(singletonKey); + let existing = nodeof(root).tryFindChild(singletonKey); if existing? { return unsafeCast(existing); } diff --git a/tf/package-lock.json b/tf/package-lock.json index 8ab72f2c..e73be096 100644 --- a/tf/package-lock.json +++ b/tf/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/tf", - "version": "0.0.1", + "version": "0.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/tf", - "version": "0.0.1", + "version": "0.0.3", "license": "MIT", "peerDependencies": { "cdktf": "*" diff --git a/tf/package.json b/tf/package.json index 1346ed6f..5d28d729 100644 --- a/tf/package.json +++ b/tf/package.json @@ -5,7 +5,7 @@ "email": "eladb@wing.cloud", "name": "Elad Ben-Israel" }, - "version": "0.0.3", + "version": "0.0.4", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", diff --git a/tsoa/lib.extern.d.ts b/tsoa/lib.extern.d.ts index 0e06f6a1..b5d316ab 100644 --- a/tsoa/lib.extern.d.ts +++ b/tsoa/lib.extern.d.ts @@ -48,7 +48,7 @@ export interface MetadataEntry { export class Node { /** Add an ordering dependency on another construct. An `IDependable` */ - readonly addDependency: (deps?: ((readonly (IDependable)[])) | undefined) => void; + readonly addDependency: (deps: (readonly (IDependable)[])) => void; /** Adds a metadata entry to this construct. Entries are arbitrary values and will also include a stack trace to allow tracing back to the code location for when the entry was added. It can be used, for example, to include source @@ -133,7 +133,7 @@ export class Node { readonly setContext: (key: string, value?: any) => void; /** Return a direct child by id, or undefined. @returns the child if found, or undefined */ - readonly tryFindChild: (id: string) => (IConstruct) | undefined; + readonly tryFindChild: (id: string) => IConstruct | void; /** Retrieves a value from tree context. Context is usually initialized at the root, but can be overridden at any point in the tree. @returns The context value or `undefined` if there is no context value for this key. */ @@ -184,7 +184,14 @@ export interface IHostedLiftable extends ILiftable { } /** Abstract interface for `Resource`. */ export interface IResource extends IConstruct, IHostedLiftable { + /** The tree node. */ readonly node: Node; + /** A hook called by the Wing compiler once for each inflight host that needs to use this object inflight. + The list of requested inflight methods + needed by the inflight host are given by `ops`. + + This method is commonly used for adding permissions, environment variables, or + other capabilities to the inflight host. */ readonly onLift: (host: IInflightHost, ops: (readonly (string)[])) => void; } /** Shared behavior between all Wing SDK resources. */ diff --git a/tsoa/package-lock.json b/tsoa/package-lock.json index bbd9777b..1168fc92 100644 --- a/tsoa/package-lock.json +++ b/tsoa/package-lock.json @@ -1,12 +1,12 @@ { "name": "@winglibs/tsoa", - "version": "0.1.7", + "version": "0.1.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@winglibs/tsoa", - "version": "0.1.7", + "version": "0.1.8", "license": "MIT", "peerDependencies": { "@cdktf/provider-aws": "^19.13.0", diff --git a/tsoa/package.json b/tsoa/package.json index 57c4f141..fb02efe4 100644 --- a/tsoa/package.json +++ b/tsoa/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/tsoa", "description": "TSOA library for Wing", - "version": "0.1.8", + "version": "0.1.9", "author": { "email": "eyalk@wing.cloud", "name": "Eyal Keren" diff --git a/tsoa/tfaws.w b/tsoa/tfaws.w index 913e859f..212516ef 100644 --- a/tsoa/tfaws.w +++ b/tsoa/tfaws.w @@ -93,7 +93,7 @@ pub class Service_tfaws impl types.IService { let handlerInvokeArn: str = unsafeCast(awsFn)?.invokeArn; this.api = new awsProvider.apiGatewayRestApi.ApiGatewayRestApi( - name: "wing-tsoa-api-{this.node.addr.substring(42-8)}", + name: "wing-tsoa-api-{nodeof(this).addr.substring(42-8)}", endpointConfiguration: { types: ["EDGE"] } diff --git a/vite/package.json b/vite/package.json index 2a608279..ef0b7846 100644 --- a/vite/package.json +++ b/vite/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/vite", - "version": "0.2.0", + "version": "0.2.1", "description": "Wing resource that allows deploying a Vite application to the cloud", "repository": { "type": "git", diff --git a/vite/vite.tf-aws.w b/vite/vite.tf-aws.w index e26b1160..4bb52159 100644 --- a/vite/vite.tf-aws.w +++ b/vite/vite.tf-aws.w @@ -42,7 +42,7 @@ pub class Vite_tf_aws { let bucket = new cloud.Bucket(); - let terraformBucket: aws.s3Bucket.S3Bucket = unsafeCast(bucket.node.defaultChild); + let terraformBucket: aws.s3Bucket.S3Bucket = unsafeCast(nodeof(bucket).defaultChild); Util.listAllFiles(distDir, (file) => { let key = "/{file}"; let filename = fs.absolute("{distDir}/{file}"); @@ -83,7 +83,7 @@ pub class Vite_tf_aws { ); let originAccessControl = new aws.cloudfrontOriginAccessControl.CloudfrontOriginAccessControl( - name: "{this.node.path.substring(0, 64 - 4)}-oac", + name: "{nodeof(this).path.substring(0, 64 - 4)}-oac", originAccessControlOriginType: "s3", signingBehavior: "always", signingProtocol: "sigv4", diff --git a/websockets/package.json b/websockets/package.json index cf98056a..abf3d6aa 100644 --- a/websockets/package.json +++ b/websockets/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/websockets", "description": "WebSocket library for Wing", - "version": "0.3.7", + "version": "0.3.8", "repository": { "type": "git", "url": "https://github.com/winglang/winglibs.git", @@ -29,6 +29,6 @@ }, "devDependencies": { "@types/ws": "^8.5.10", - "@winglibs/dynamodb": "^0.1.6" + "@winglibs/dynamodb": "^0.1.12" } }