From a610b975a85d324360be3117802b8200c861be99 Mon Sep 17 00:00:00 2001 From: Meir Date: Mon, 25 Mar 2024 18:30:55 +0200 Subject: [PATCH 1/2] fix(dynamodb): readme example (#145) --- dynamodb/README.md | 12 ++++++------ dynamodb/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dynamodb/README.md b/dynamodb/README.md index 3718bba6..e952e3e7 100644 --- a/dynamodb/README.md +++ b/dynamodb/README.md @@ -33,18 +33,18 @@ table.setStreamConsumer(inflight (record) => { // Put and query. test "put and query" { table.put( - item: { + Item: { id: "1", body: "hello", }, ); let response = table.query( - keyConditionExpression: "id = :id", - expressionAttributeValues: {":id": "1"}, + KeyConditionExpression: "id = :id", + ExpressionAttributeValues: {":id": "1"}, ); - assert(response.count == 1); - assert(response.items.at(0).get("id").asStr() == "1"); - assert(response.items.at(0).get("body").asStr() == "hello"); + assert(response.Count == 1); + assert(response.Items.at(0).get("id").asStr() == "1"); + assert(response.Items.at(0).get("body").asStr() == "hello"); } ``` diff --git a/dynamodb/package.json b/dynamodb/package.json index f2865e67..b3c6bbab 100644 --- a/dynamodb/package.json +++ b/dynamodb/package.json @@ -1,6 +1,6 @@ { "name": "@winglibs/dynamodb", - "version": "0.0.3", + "version": "0.0.4", "description": "DynamoDB library for Wing", "author": { "name": "Cristian Pallarés", From fa129e9f437e28a16e85792d376f5a0f89acf862 Mon Sep 17 00:00:00 2001 From: Hasan <45375125+hasanaburayyan@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:54:28 -0400 Subject: [PATCH 2/2] fix(eventbridge): use new platform parameter api (#146) Updates to library to use the new api for platform parameters. --- eventbridge/package.json | 2 +- eventbridge/platform/awscdk/eventbridge.w | 2 +- eventbridge/platform/tfaws/eventbridge.w | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eventbridge/package.json b/eventbridge/package.json index 5479abb9..8949205f 100644 --- a/eventbridge/package.json +++ b/eventbridge/package.json @@ -1,7 +1,7 @@ { "name": "@winglibs/eventbridge", "description": "Amazon EventBridge library for Wing", - "version": "0.0.3", + "version": "0.0.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 1e0bbf3b..517a54eb 100644 --- a/eventbridge/platform/awscdk/eventbridge.w +++ b/eventbridge/platform/awscdk/eventbridge.w @@ -12,7 +12,7 @@ pub class Bus impl types.IBus { new(props: types.BusProps) { let app = nodeof(this).app; // TODO: use typed properties when its available - if let eventBridgeName = unsafeCast(app)?.platformParameters?.getParameterValue("eventBridgeName") { + 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) as "EventBridge"; diff --git a/eventbridge/platform/tfaws/eventbridge.w b/eventbridge/platform/tfaws/eventbridge.w index d36988b1..f2bcdaf0 100644 --- a/eventbridge/platform/tfaws/eventbridge.w +++ b/eventbridge/platform/tfaws/eventbridge.w @@ -12,7 +12,7 @@ pub class Bus impl types.IBus { new(props: types.BusProps) { let app = nodeof(this).app; // TODO: use typed properties when its available - if let eventBridgeName = unsafeCast(app)?.platformParameters?.getParameterValue("eventBridgeName") { + if let eventBridgeName = app.parameters.value("eventBridgeName") { let bus = new tfAws.dataAwsCloudwatchEventBus.DataAwsCloudwatchEventBus( name: eventBridgeName, ) as "EventBridge";