diff --git a/f/examples/astounding_script.script.yaml b/f/examples/astounding_script.script.yaml new file mode 100644 index 0000000..56281fa --- /dev/null +++ b/f/examples/astounding_script.script.yaml @@ -0,0 +1,38 @@ +summary: '' +description: '' +lock: | + { + "version": "3", + "remote": {} + } +kind: script +schema: + $schema: 'https://json-schema.org/draft/2020-12/schema' + type: object + properties: + a: + type: number + description: '' + default: null + b: + type: string + description: '' + default: null + enum: + - my + - enum + d: + type: string + description: '' + default: inferred type string from default arg + e: + type: object + description: '' + default: + nested: object + properties: + nested: + type: string + required: + - a + - b diff --git a/f/examples/astounding_script.ts b/f/examples/astounding_script.ts new file mode 100644 index 0000000..4a7a464 --- /dev/null +++ b/f/examples/astounding_script.ts @@ -0,0 +1,19 @@ +// Ctrl/CMD+. to cache dependencies on imports hover. + +// Deno uses "npm:" prefix to import from npm (https://deno.land/manual@v1.36.3/node/npm_specifiers) +// import * as wmill from "npm:windmill-client@1.251.1" + +// fill the type, or use the +Resource type to get a type-safe reference to a resource +// type Postgresql = object + +export async function main( + a: number, + b: "my" | "enum", + //c: Postgresql, + d = "inferred type string from default arg", + e = { nested: "object" }, + //e: wmill.Base64 +) { + // let x = await wmill.getVariable('u/user/foo') + return { foo: a }; +}