Skip to content

[WM] Script 'f/user/happy_script' deployed #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions f/user/happy_script.script.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {}
}
//bun.lock
<empty>
69 changes: 69 additions & 0 deletions f/user/happy_script.script.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
summary: ''
description: ''
lock: '!inline f/user/happy_script.script.lock'
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
originalType: enum
e:
type: string
description: ''
default: inferred type string from default arg
originalType: string
f:
type: object
description: ''
default:
nested: object
properties:
nested:
type: string
description: ''
originalType: string
g:
type: object
description: ''
default: null
oneOf:
- type: object
properties:
foo:
type: string
description: ''
originalType: string
label:
type: string
description: ''
enum:
- Variant 1
originalType: enum
title: Variant 1
- type: object
properties:
bar:
type: number
description: ''
label:
type: string
description: ''
enum:
- Variant 2
originalType: enum
title: Variant 2
required:
- a
- b
- g
29 changes: 29 additions & 0 deletions f/user/happy_script.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// there are multiple modes to add as header: //nobundling //native //npm //nodejs
// https://www.windmill.dev/docs/getting_started/scripts_quickstart/typescript#modes

// import { toWords } from "number-to-words@1"
import * as wmill from "windmill-client"

// fill the type, or use the +Resource type to get a type-safe reference to a resource
// type Postgresql = object
//foo

export async function main(
a: number,
b: "my" | "enum",
//c: Postgresql,
//d: wmill.S3Object, // https://www.windmill.dev/docs/core_concepts/persistent_storage/large_data_files
//d: DynSelect_foo, // https://www.windmill.dev/docs/core_concepts/json_schema_and_parsing#dynamic-select
e = "inferred type string from default arg",
f = { nested: "object" },
g: {
label: "Variant 1",
foo: string
} | {
label: "Variant 2",
bar: number
}
) {
// let x = await wmill.getVariable('u/user/foo')
return { foo: a };
}
1 change: 1 addition & 0 deletions wmill-lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ locks:
f/o/fortunate_script: d95a08b011d3dd9e280f9955895bd48ff88c9d90273f30e051f1034f86409518
f/user/ambitious_script: f2d061ef379d829407222c8e74c61e0935f96d661edb1649dc021df25befddda
f/user/foo: 21e74f8089e3f036b30a9b0dbc5d8094e301c5e99cc5bba126a4cbf92221614b
f/user/happy_script: f574b114d4f43f15ed341302c6334ac699d942b416e15e4980d933ce74c9f339
f/user/innocuous_script: 184116bf717a969b227fdd5871ed1b1806e4623681f5f5cd5137ac50975487ae