mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix: rename ResourceType -> Resource
This commit is contained in:
@@ -3122,10 +3122,10 @@ components:
|
||||
enum: ["str", "float", "int", "bool", "unknown"]
|
||||
- type: object
|
||||
properties:
|
||||
resourcetype:
|
||||
resource:
|
||||
type: string
|
||||
required:
|
||||
- resourcetype
|
||||
- resource
|
||||
has_default:
|
||||
type: boolean
|
||||
default: {}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub enum Typ {
|
||||
List,
|
||||
Bytes,
|
||||
Datetime,
|
||||
ResourceType(String),
|
||||
Resource(String),
|
||||
Unknown,
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ fn binding_ident_to_arg(
|
||||
TsEntityName::TsQualifiedName(p) => &*p.right.sym,
|
||||
};
|
||||
match sym.to_string().as_str() {
|
||||
"ResourceType" => Typ::ResourceType(
|
||||
"Resource" => Typ::Resource(
|
||||
type_params
|
||||
.as_ref()
|
||||
.and_then(|x| {
|
||||
@@ -755,7 +755,7 @@ def main():
|
||||
let code = "
|
||||
|
||||
export function main(test1: string, test2: string = \"burkina\",
|
||||
test3: wmill.ResourceType<'rt'>, email: email_string) {
|
||||
test3: wmill.Resource<'postgres'>, email: email_string) {
|
||||
console.log(42)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export {
|
||||
export type string_regex<S extends string> = String
|
||||
export type string_email = String
|
||||
|
||||
export type ResourceType<S extends string> = {}
|
||||
export type Resource<S extends string> = {}
|
||||
|
||||
/**
|
||||
* Create a client configuration from env variables
|
||||
|
||||
@@ -44,7 +44,7 @@ export async function inferArgs(
|
||||
}
|
||||
}
|
||||
|
||||
function argSigToJsonSchemaType(t: string | { resourcetype: string }, s: SchemaProperty): void {
|
||||
function argSigToJsonSchemaType(t: string | { resource: string }, s: SchemaProperty): void {
|
||||
if (t === 'int') {
|
||||
s.type = 'integer'
|
||||
} else if (t === 'float') {
|
||||
@@ -63,9 +63,9 @@ function argSigToJsonSchemaType(t: string | { resourcetype: string }, s: SchemaP
|
||||
} else if (t === 'datetime') {
|
||||
s.type = 'string'
|
||||
s.format = 'date-time'
|
||||
} else if (typeof t !== 'string' && t.resourcetype != undefined) {
|
||||
} else if (typeof t !== 'string' && t.resource != undefined) {
|
||||
s.type = 'object'
|
||||
s.format = `resource-${t.resourcetype}`
|
||||
s.format = `resource-${t.resource}`
|
||||
} else {
|
||||
s.type = undefined
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user