//import any dependency from npm import * as wmill from "windmill-client" import * as cowsay from 'cowsay@1.5.0'; // fill the type, or use the +Resource type to get a type-safe reference to a resource type Postgresql = { host: string; port: number; user: string; dbname: string; sslmode: string; password: string; }; export async function main( a: number, b: "my" | "enum", c: Postgresql, d = "inferred type string from default arg", e = { nested: "object" } //f: wmill.Base64 ) { const email = process.env["WM_EMAIL"]; // variables are permissioned and by path let variable = await wmill.getVariable("f/company-folder/my_secret"); const lastTimeRun = await wmill.getState(); // logs are printed and always inspectable console.log(cowsay.say({ text: "hello " + email + " " + lastTimeRun })); await wmill.setState(Date.now()); // return is serialized as JSON return { foo: d, variable }; }