Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eladcon committed May 27, 2024
1 parent a16df45 commit 4c0ca82
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
20 changes: 15 additions & 5 deletions python/lib.w
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ pub class InflightFunction impl cloud.IFunctionHandler {

let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new sim.Inflight(props);
let implementation = new sim.Inflight(props);
nodeof(implementation).hidden = true;
this.inner = implementation;
} elif target == "tf-aws" {
this.inner = new aws.Inflight_tfaws(props);
} else {
Expand All @@ -43,7 +45,9 @@ pub class InflightQueueConsumer impl cloud.IQueueSetConsumerHandler {

let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new sim.Inflight(props);
let implementation = new sim.Inflight(props);
nodeof(implementation).hidden = true;
this.inner = implementation;
} elif target == "tf-aws" {
this.inner = new aws.Inflight_tfaws(props);
} else {
Expand All @@ -70,7 +74,9 @@ pub class InflightTopicOnMessage impl cloud.ITopicOnMessageHandler {

let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new sim.Inflight(props);
let implementation = new sim.Inflight(props);
nodeof(implementation).hidden = true;
this.inner = implementation;
} elif target == "tf-aws" {
this.inner = new aws.Inflight_tfaws(props);
} else {
Expand All @@ -97,7 +103,9 @@ pub class InflightBucketEvent impl cloud.IBucketEventHandler {

let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new sim.BucketEventInflight(props);
let implementation = new sim.BucketEventInflight(props);
nodeof(implementation).hidden = true;
this.inner = implementation;
} elif target == "tf-aws" {
this.inner = new aws.Inflight_tfaws(props);
} else {
Expand All @@ -124,7 +132,9 @@ pub class InflightApiEndpointHandler impl cloud.IApiEndpointHandler {

let target = util.env("WING_TARGET");
if target == "sim" {
this.inner = new simapi.InflightApiEndpointHandler(props);
let implementation = new simapi.InflightApiEndpointHandler(props);
nodeof(implementation).hidden = true;
this.inner = implementation;
} elif target == "tf-aws" {
this.inner = new tfawsapi.InflightApiEndpointHandler_aws(props);
} else {
Expand Down
8 changes: 8 additions & 0 deletions python/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const { execSync } = require("node:child_process");
const { tmpdir } = require("node:os");
const glob = require("glob");
const { App, Lifting } = require("@winglang/sdk/lib/core");
const { Node } = require("@winglang/sdk/lib/std");

exports.dirname = () => __dirname;

Expand Down Expand Up @@ -50,6 +51,13 @@ exports.liftSim = (resource, options, host, clients, wingClients) => {

if (lifted) {
Lifting.lift(resource, host, options.allow);
for (let op of options.allow) {
Node.of(resource).addConnection({
name: op.endsWith("()") ? op : `${op}()`,
source: host,
target: resource,
});
}
clients[options.id] = lifted;
}
};
Expand Down

0 comments on commit 4c0ca82

Please sign in to comment.