diff --git a/backend/openapi.yaml b/backend/openapi.yaml index 66227034c5..d07b82dff1 100644 --- a/backend/openapi.yaml +++ b/backend/openapi.yaml @@ -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: {} diff --git a/backend/src/parser.rs b/backend/src/parser.rs index 0c0db90b0c..719f92de67 100644 --- a/backend/src/parser.rs +++ b/backend/src/parser.rs @@ -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) } diff --git a/deno-client/index.ts b/deno-client/index.ts index 8124bf1467..bd40a8b609 100644 --- a/deno-client/index.ts +++ b/deno-client/index.ts @@ -10,7 +10,7 @@ export { export type string_regex = String export type string_email = String -export type ResourceType = {} +export type Resource = {} /** * Create a client configuration from env variables diff --git a/frontend/src/infer.ts b/frontend/src/infer.ts index a60025f6f0..3ab7f97550 100644 --- a/frontend/src/infer.ts +++ b/frontend/src/infer.ts @@ -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 }