From b6478b81130547c3063b5cdfcad6a0cca74d8a1e Mon Sep 17 00:00:00 2001 From: ruben Date: Wed, 24 Jan 2024 07:47:04 +0000 Subject: [PATCH] Script 'f/examples/astounding_script' deployed --- f/examples/astounding_script.script.yaml | 38 ++++++++++++++++++++++++ f/examples/astounding_script.ts | 19 ++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 f/examples/astounding_script.script.yaml create mode 100644 f/examples/astounding_script.ts 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 }; +}