From 8b0c27043cc825a8586028cda66ca2120709c8a4 Mon Sep 17 00:00:00 2001 From: namesty Date: Fri, 18 Nov 2022 02:08:52 +0100 Subject: [PATCH 1/8] (feat): added rust plugin bindings. Missing module test --- .../lib/project/manifests/plugin/languages.ts | 3 + packages/schema/bind/src/bindings/index.ts | 2 + .../schema/bind/src/bindings/rust/index.ts | 1 + .../bind/src/bindings/rust/plugin/index.ts | 80 + .../rust/plugin/templates/mod-rs.mustache | 7 + .../rust/plugin/templates/module-rs.mustache | 42 + .../rust/plugin/templates/types-rs.mustache | 69 + .../plugin/templates/wrap.info-rs.mustache | 15 + .../bindings/rust/plugin/transforms/byRef.ts | 24 + .../bindings/rust/plugin/transforms/index.ts | 2 + .../rust/plugin/transforms/propertyDeps.ts | 171 ++ packages/schema/bind/src/types.ts | 7 +- .../cases/bind/sanity/output/plugin-rs/mod.rs | 7 + .../bind/sanity/output/plugin-rs/module.rs | 3 + .../bind/sanity/output/plugin-rs/types.rs | 125 + .../bind/sanity/output/plugin-rs/wrap.info.rs | 2317 +++++++++++++++++ yarn.lock | 441 ++-- 17 files changed, 3097 insertions(+), 219 deletions(-) create mode 100644 packages/schema/bind/src/bindings/rust/plugin/index.ts create mode 100644 packages/schema/bind/src/bindings/rust/plugin/templates/mod-rs.mustache create mode 100644 packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache create mode 100644 packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache create mode 100644 packages/schema/bind/src/bindings/rust/plugin/templates/wrap.info-rs.mustache create mode 100644 packages/schema/bind/src/bindings/rust/plugin/transforms/byRef.ts create mode 100644 packages/schema/bind/src/bindings/rust/plugin/transforms/index.ts create mode 100644 packages/schema/bind/src/bindings/rust/plugin/transforms/propertyDeps.ts create mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs create mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs create mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs create mode 100644 packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs diff --git a/packages/cli/src/lib/project/manifests/plugin/languages.ts b/packages/cli/src/lib/project/manifests/plugin/languages.ts index c89c084ee0..0ec5ac4c80 100644 --- a/packages/cli/src/lib/project/manifests/plugin/languages.ts +++ b/packages/cli/src/lib/project/manifests/plugin/languages.ts @@ -4,6 +4,7 @@ import { BindLanguage } from "@polywrap/schema-bind"; export const pluginManifestLanguages = { "plugin/typescript": "plugin/typescript", + "plugin/rust": "plugin/rust", }; export type PluginManifestLanguages = typeof pluginManifestLanguages; @@ -22,6 +23,8 @@ export function pluginManifestLanguageToBindLanguage( switch (manifestLanguage) { case "plugin/typescript": return "plugin-ts"; + case "plugin/rust": + return "plugin-rs"; default: throw Error( intlMsg.lib_language_unsupportedManifestLanguage({ diff --git a/packages/schema/bind/src/bindings/index.ts b/packages/schema/bind/src/bindings/index.ts index 61e4cfa78e..69b641af5d 100644 --- a/packages/schema/bind/src/bindings/index.ts +++ b/packages/schema/bind/src/bindings/index.ts @@ -18,6 +18,8 @@ export function getGenerateBindingFn( return Rust.Wasm.generateBinding; case "plugin-ts": return TypeScript.Plugin.generateBinding; + case "plugin-rs": + return Rust.Plugin.generateBinding; case "app-ts": return TypeScript.App.generateBinding; default: diff --git a/packages/schema/bind/src/bindings/rust/index.ts b/packages/schema/bind/src/bindings/rust/index.ts index a01310ad9e..7bdebbf2d4 100644 --- a/packages/schema/bind/src/bindings/rust/index.ts +++ b/packages/schema/bind/src/bindings/rust/index.ts @@ -1,3 +1,4 @@ export * as Wasm from "./wasm"; +export * as Plugin from "./plugin"; export * as Functions from "./functions"; export * as Types from "./types"; diff --git a/packages/schema/bind/src/bindings/rust/plugin/index.ts b/packages/schema/bind/src/bindings/rust/plugin/index.ts new file mode 100644 index 0000000000..e8ab399913 --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/index.ts @@ -0,0 +1,80 @@ +import * as Transforms from "./transforms"; +import { Functions } from "../"; +import { GenerateBindingFn, renderTemplates } from "../.."; +import { BindOptions, BindOutput } from "../../.."; + +import { + transformAbi, + extendType, + addFirstLast, + toPrefixedGraphQLType, + hasImports, + methodParentPointers, + latestWrapManifestVersion, +} from "@polywrap/schema-parse"; +import path from "path"; +import { WrapAbi } from "@polywrap/wrap-manifest-types-js/src"; + +const templatePath = (subpath: string) => + path.join(__dirname, "./templates", subpath); + +const sort = (obj: Record) => + Object.keys(obj) + .sort() + .reduce((map: Record, key: string) => { + if (typeof obj[key] === "object") { + map[key] = sort(obj[key] as Record); + + if (Array.isArray(obj[key])) { + map[key] = Object.values(map[key] as Record); + } + } else { + map[key] = obj[key]; + } + return map; + }, {}); + +export const generateBinding: GenerateBindingFn = ( + options: BindOptions +): BindOutput => { + const result: BindOutput = { + output: { + entries: [], + }, + outputDirAbs: options.outputDirAbs, + }; + const output = result.output; + const abi = applyTransforms(options.abi); + + const manifest = { + name: options.projectName, + type: "plugin", + version: latestWrapManifestVersion, + abi: JSON.stringify( + sort((options.abi as unknown) as Record), + null, + 2 + ), + }; + + output.entries = renderTemplates(templatePath(""), { ...abi, manifest }, {}); + + return result; +}; + +function applyTransforms(abi: WrapAbi): WrapAbi { + const transforms = [ + extendType(Functions), + addFirstLast, + toPrefixedGraphQLType, + hasImports, + methodParentPointers(), + Transforms.propertyDeps(), + Transforms.byRef(), + ]; + + for (const transform of transforms) { + abi = transformAbi(abi, transform); + } + return abi; +} diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/mod-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/mod-rs.mustache new file mode 100644 index 0000000000..88b7de7bdf --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/mod-rs.mustache @@ -0,0 +1,7 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + +pub mod types; +#[path = "wrap.info.rs"] +pub mod wrap_info; +pub mod module; \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache new file mode 100644 index 0000000000..8524b7994b --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -0,0 +1,42 @@ +use std::sync::Arc; +use polywrap_core::{error::Error, invoke::Invoker}; +use polywrap_plugin::module::PluginModule; +use serde::{Serialize, Deserialize}; +use super::types::*; +pub use polywrap_plugin::base_impl_plugin_module; + +#[macro_export] +macro_rules! impl_plugin_module { + ($plugin_type:ty) => { + $crate::wrap::module::base_impl_plugin_module!( + $plugin_type, + {{#moduleType}} + {{#methods}} + ({{#toLower}}{{name}}{{/toLower}}, $crate::wrap::module::Args{{#toUpper}}{{name}}{{/toUpper}}), + {{/methods}} + {{/moduleType}} + ); + }; +} + +{{#moduleType}} +{{#methods}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { + {{#arguments}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/arguments}} +} +{{/methods}} +{{/moduleType}} + +pub trait Module: PluginModule { + {{#moduleType}} + {{#methods}} + fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; + {{^last}} + + {{/last}} + {{/methods}} + {{/moduleType}} +} diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache new file mode 100644 index 0000000000..48dd498bfe --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -0,0 +1,69 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. +use serde::{Serialize, Deserialize}; +use num_bigint::BigInt; +use bigdecimal::BigDecimal as BigNumber; +use serde_json as JSON; +use std::collections::BTreeMap as Map; + +// OBJECT +{{#objectTypes}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#properties}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/properties}} +} +{{/objectTypes}} + +// ENV +{{#envType}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#properties}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/properties}} +} +{{/envType}} + +// ENUM +{{#enumTypes}} +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#constants}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}{{#detectKeyword}}{{.}}{{/detectKeyword}}, + {{/constants}} + _MAX_ +} +{{/enumTypes}} + +// Imported OBJECT +{{#importedObjectTypes}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#properties}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/properties}} +} +{{/importedObjectTypes}} + +// Imported ENV +{{#importedEnvType}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#properties}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/properties}} +} +{{/importedEnvType}} + +// Imported ENUM +{{#importedEnumTypes}} +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#constants}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}{{#detectKeyword}}{{.}}{{/detectKeyword}}, + {{/constants}} + _MAX_ +} +{{/importedEnumTypes}} \ No newline at end of file diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/wrap.info-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/wrap.info-rs.mustache new file mode 100644 index 0000000000..384d029035 --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/wrap.info-rs.mustache @@ -0,0 +1,15 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. +use polywrap_manifest::versions::{WrapManifest, WrapManifestAbi}; +use serde_json::{json, from_value}; + +{{#manifest}} +pub fn get_manifest() -> WrapManifest { + WrapManifest { + name: "{{name}}".to_string(), + type_: "{{type}}".to_string(), + version: "{{version}}".to_string(), + abi: from_value::(json!({{abi}})).unwrap() + } +} +{{/manifest}} diff --git a/packages/schema/bind/src/bindings/rust/plugin/transforms/byRef.ts b/packages/schema/bind/src/bindings/rust/plugin/transforms/byRef.ts new file mode 100644 index 0000000000..b5f87a673c --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/transforms/byRef.ts @@ -0,0 +1,24 @@ +import { AbiTransforms } from "@polywrap/schema-parse"; +import { AnyDefinition } from "@polywrap/wrap-manifest-types-js"; + +export function byRef(): AbiTransforms { + return { + enter: { + // eslint-disable-next-line @typescript-eslint/naming-convention + AnyDefinition: (def: AnyDefinition) => { + const byRefScalars = ["String", "BigInt", "BigNumber", "Map", "Bytes"]; + + if (def.scalar) { + if (byRefScalars.indexOf(def.scalar.type) > -1 || !def.required) { + return { + ...def, + byRef: true, + }; + } + } + + return def; + }, + }, + }; +} diff --git a/packages/schema/bind/src/bindings/rust/plugin/transforms/index.ts b/packages/schema/bind/src/bindings/rust/plugin/transforms/index.ts new file mode 100644 index 0000000000..56b11478c3 --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/transforms/index.ts @@ -0,0 +1,2 @@ +export * from "./byRef"; +export * from "./propertyDeps"; diff --git a/packages/schema/bind/src/bindings/rust/plugin/transforms/propertyDeps.ts b/packages/schema/bind/src/bindings/rust/plugin/transforms/propertyDeps.ts new file mode 100644 index 0000000000..793ef1f641 --- /dev/null +++ b/packages/schema/bind/src/bindings/rust/plugin/transforms/propertyDeps.ts @@ -0,0 +1,171 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +/* eslint-disable no-useless-escape */ +import { isBaseType, isBuiltInType } from "../../types"; + +import { + ImportedModuleDefinition, + ObjectDefinition, + AnyDefinition, + ModuleDefinition, + EnvDefinition, +} from "@polywrap/wrap-manifest-types-js"; +import { AbiTransforms } from "@polywrap/schema-parse"; + +interface PropertyDep { + crate: string; + type: string; + isEnum: boolean; +} + +interface PropertyDepsState { + envDefinition?: EnvDefinition; + objectDefinition?: ObjectDefinition; + moduleDefinition?: ModuleDefinition; + importedModuleDefinition?: ImportedModuleDefinition; + propertyDeps?: PropertyDep[]; +} + +export function propertyDeps(): AbiTransforms { + const state: PropertyDepsState = {}; + + return { + enter: { + EnvDefinition: (def: EnvDefinition) => { + state.envDefinition = def; + state.propertyDeps = []; + return def; + }, + ObjectDefinition: (def: ObjectDefinition) => { + state.objectDefinition = def; + state.propertyDeps = []; + return def; + }, + ModuleDefinition: (def: ModuleDefinition) => { + state.moduleDefinition = def; + state.propertyDeps = []; + return def; + }, + ImportedModuleDefinition: (def: ImportedModuleDefinition) => { + state.importedModuleDefinition = def; + state.propertyDeps = []; + return def; + }, + AnyDefinition: (def: AnyDefinition) => { + const appendPropertyDep = ( + rootType: string, + array: PropertyDep[] + ): PropertyDep[] => { + let typeName = def.type; + + if (typeName.indexOf("[") === 0) { + typeName = typeName.replace(/\[|\]|\!|\?/g, ""); + } + + const appendUnique = (item: PropertyDep) => { + if ( + array.findIndex( + (i) => i.crate === item.crate && i.type === item.type + ) === -1 + ) { + array.push(item); + } + }; + + const isKnownType = (name: string) => + isBaseType(name) || isBuiltInType(name) || name === rootType; + + // if type is map and the value is custom, + // we need to add it into property dependency + if (typeName.startsWith("Map<")) { + const valueName = def.map?.object?.type ?? def.map?.enum?.type; + if (valueName && !isKnownType(valueName)) { + appendUnique({ + crate: "crate", + type: valueName, + isEnum: valueName === def.map?.enum?.type, + }); + + return array; + } + + return array; + } + + if (isKnownType(typeName)) { + return array; + } + + appendUnique({ + crate: "crate", + type: typeName, + isEnum: !!def.enum || !!def.array?.enum, + }); + + return array; + }; + + if (state.envDefinition && state.propertyDeps) { + state.propertyDeps = appendPropertyDep( + state.envDefinition.type, + state.propertyDeps + ); + } else if (state.objectDefinition && state.propertyDeps) { + state.propertyDeps = appendPropertyDep( + state.objectDefinition.type, + state.propertyDeps + ); + } else if (state.moduleDefinition && state.propertyDeps) { + state.propertyDeps = appendPropertyDep( + state.moduleDefinition.type, + state.propertyDeps + ); + } else if (state.importedModuleDefinition && state.propertyDeps) { + state.propertyDeps = appendPropertyDep( + state.importedModuleDefinition.type, + state.propertyDeps + ); + } + + return def; + }, + }, + leave: { + EnvDefinition: (def: EnvDefinition) => { + const propertyDeps = state.propertyDeps; + state.propertyDeps = undefined; + state.envDefinition = undefined; + return { + ...def, + propertyDeps, + }; + }, + ObjectDefinition: (def: ObjectDefinition) => { + const propertyDeps = state.propertyDeps; + state.propertyDeps = undefined; + state.objectDefinition = undefined; + return { + ...def, + propertyDeps, + }; + }, + ModuleDefinition: (def: ModuleDefinition) => { + const propertyDeps = state.propertyDeps; + state.propertyDeps = undefined; + state.moduleDefinition = undefined; + return { + ...def, + propertyDeps, + }; + }, + ImportedModuleDefinition: (def: ImportedModuleDefinition) => { + const propertyDeps = state.propertyDeps; + state.propertyDeps = undefined; + state.importedModuleDefinition = undefined; + return { + ...def, + propertyDeps, + }; + }, + }, + }; +} diff --git a/packages/schema/bind/src/types.ts b/packages/schema/bind/src/types.ts index 3ae6aa13dc..64a2894739 100644 --- a/packages/schema/bind/src/types.ts +++ b/packages/schema/bind/src/types.ts @@ -1,7 +1,12 @@ import { OutputDirectory } from "@polywrap/os-js"; import { WrapAbi } from "@polywrap/schema-parse"; -export type BindLanguage = "wasm-as" | "wasm-rs" | "plugin-ts" | "app-ts"; +export type BindLanguage = + | "wasm-as" + | "wasm-rs" + | "plugin-ts" + | "plugin-rs" + | "app-ts"; export interface BindOutput { output: OutputDirectory; diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs new file mode 100644 index 0000000000..88b7de7bdf --- /dev/null +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/mod.rs @@ -0,0 +1,7 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + +pub mod types; +#[path = "wrap.info.rs"] +pub mod wrap_info; +pub mod module; \ No newline at end of file diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs new file mode 100644 index 0000000000..a954fd33e9 --- /dev/null +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -0,0 +1,3 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs new file mode 100644 index 0000000000..94519a1640 --- /dev/null +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs @@ -0,0 +1,125 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. +use serde::{Serialize, Deserialize}; +use num_bigint::BigInt; +use bigdecimal::BigDecimal as BigNumber; +use serde_json as JSON; +use std::collections::BTreeMap as Map; + +// OBJECT +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct CustomType { + pub str: String, + pub opt_str: Option, + pub u: u32, + pub opt_u: Option, + pub u8: u8, + pub u16: u16, + pub u32: u32, + pub i: i32, + pub i8: i8, + pub i16: i16, + pub i32: i32, + pub bigint: BigInt, + pub opt_bigint: Option, + pub bignumber: BigNumber, + pub opt_bignumber: Option, + pub json: JSON::Value, + pub opt_json: Option, + pub bytes: Vec, + pub opt_bytes: Option>, + pub boolean: bool, + pub opt_boolean: Option, + pub u_array: Vec, + pub u_opt_array: Option>, + pub opt_u_opt_array: Option>>, + pub opt_str_opt_array: Option>>, + pub u_array_array: Vec>, + pub u_opt_array_opt_array: Vec>>>, + pub u_array_opt_array_array: Vec>>>, + pub crazy_array: Option>>>>>>, + pub object: AnotherType, + pub opt_object: Option, + pub object_array: Vec, + pub opt_object_array: Option>>, + pub en: CustomEnum, + pub opt_enum: Option, + pub enum_array: Vec, + pub opt_enum_array: Option>>, + pub map: Map, + pub map_of_arr: Map>, + pub map_of_obj: Map, + pub map_of_arr_of_obj: Map>, + pub map_custom_value: Map>, +} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct AnotherType { + pub prop: Option, + pub circular: Option, + #[serde(rename = "const")] + pub _const: Option, +} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct CustomMapValue { + pub foo: String, +} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Else { + #[serde(rename = "else")] + pub _else: String, +} + +// ENV +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Env { + pub prop: String, + pub opt_prop: Option, + pub opt_map: Option>>, +} + +// ENUM +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum CustomEnum { + STRING, + BYTES, + _MAX_ +} +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum While { + _for, + _in, + _MAX_ +} + +// Imported OBJECT +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportObject { + pub object: TestImportAnotherObject, + pub opt_object: Option, + pub object_array: Vec, + pub opt_object_array: Option>>, + pub en: TestImportEnum, + pub opt_enum: Option, + pub enum_array: Vec, + pub opt_enum_array: Option>>, +} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportAnotherObject { + pub prop: String, +} + +// Imported ENV + +// Imported ENUM +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum TestImportEnum { + STRING, + BYTES, + _MAX_ +} +#[derive(Clone, Copy, Debug, Deserialize, Serialize)] +pub enum TestImportEnumReturn { + STRING, + BYTES, + _MAX_ +} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs new file mode 100644 index 0000000000..f14426ced7 --- /dev/null +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs @@ -0,0 +1,2317 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. +use polywrap_manifest::{WrapManifest, WrapManifestAbi}; +use serde_json::{from_value, json}; + +pub fn get_manifest() -> WrapManifest { + WrapManifest { + name: "Test".to_string(), + type_: "plugin".to_string(), + version: "0.1".to_string(), + abi: from_value::(json!({ + "enumTypes": [ + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 8, + "type": "CustomEnum" + }, + { + "constants": [ + "for", + "in" + ], + "kind": 8, + "type": "while" + } + ], + "envType": { + "kind": 65536, + "properties": [ + { + "kind": 34, + "name": "prop", + "required": true, + "scalar": { + "kind": 4, + "name": "prop", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optProp", + "scalar": { + "kind": 4, + "name": "optProp", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "optMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "optMap", + "scalar": { + "kind": 4, + "name": "optMap", + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "optMap", + "type": "Int" + } + }, + "name": "optMap", + "type": "Map" + } + ], + "type": "Env" + }, + "importedEnumTypes": [ + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 520, + "namespace": "TestImport", + "nativeType": "Enum", + "type": "TestImport_Enum", + "uri": "testimport.uri.eth" + }, + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 520, + "namespace": "TestImport", + "nativeType": "Enum", + "type": "TestImport_Enum_Return", + "uri": "testimport.uri.eth" + } + ], + "importedEnvTypes": [ + { + "kind": 524288, + "namespace": "TestImport", + "nativeType": "Env", + "properties": [ + { + "kind": 34, + "name": "enviroProp", + "required": true, + "scalar": { + "kind": 4, + "name": "enviroProp", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "TestImport_Env", + "uri": "testimport.uri.eth" + } + ], + "importedModuleTypes": [ + { + "isInterface": true, + "kind": 256, + "methods": [ + { + "arguments": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "u", + "required": true, + "scalar": { + "kind": 4, + "name": "u", + "required": true, + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "optU", + "scalar": { + "kind": 4, + "name": "optU", + "type": "UInt" + }, + "type": "UInt" + }, + { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uArrayArray", + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "scalar": { + "kind": 4, + "name": "uArrayArray", + "type": "UInt" + }, + "type": "[UInt]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayArray", + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "scalar": { + "kind": 4, + "name": "uArrayArray", + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + "kind": 34, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "TestImport_Object" + }, + "required": true, + "type": "TestImport_Object" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "TestImport_Object" + }, + "type": "TestImport_Object" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_Object" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_Object" + }, + "required": true, + "type": "[TestImport_Object]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[TestImport_Object]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_Object" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_Object" + }, + "type": "[TestImport_Object]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[TestImport_Object]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "optEnum", + "type": "TestImport_Enum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + } + ], + "env": { + "required": true + }, + "kind": 64, + "name": "importedMethod", + "required": true, + "return": { + "kind": 34, + "name": "importedMethod", + "object": { + "kind": 8192, + "name": "importedMethod", + "type": "TestImport_Object" + }, + "type": "TestImport_Object" + }, + "type": "Method" + }, + { + "arguments": [ + { + "array": { + "item": { + "kind": 4, + "name": "arg", + "required": true, + "type": "String" + }, + "kind": 18, + "name": "arg", + "required": true, + "scalar": { + "kind": 4, + "name": "arg", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "arg", + "required": true, + "type": "[String]" + } + ], + "kind": 64, + "name": "anotherMethod", + "required": true, + "return": { + "kind": 34, + "name": "anotherMethod", + "required": true, + "scalar": { + "kind": 4, + "name": "anotherMethod", + "required": true, + "type": "Int32" + }, + "type": "Int32" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "arg", + "required": true, + "scalar": { + "kind": 4, + "name": "arg", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "kind": 64, + "name": "returnsArrayOfEnums", + "required": true, + "return": { + "array": { + "enum": { + "kind": 16384, + "name": "returnsArrayOfEnums", + "type": "TestImport_Enum_Return" + }, + "item": { + "kind": 16384, + "name": "returnsArrayOfEnums", + "type": "TestImport_Enum_Return" + }, + "kind": 18, + "name": "returnsArrayOfEnums", + "required": true, + "type": "[TestImport_Enum_Return]" + }, + "kind": 34, + "name": "returnsArrayOfEnums", + "required": true, + "type": "[TestImport_Enum_Return]" + }, + "type": "Method" + } + ], + "namespace": "TestImport", + "nativeType": "Module", + "type": "TestImport_Module", + "uri": "testimport.uri.eth" + } + ], + "importedObjectTypes": [ + { + "kind": 1025, + "namespace": "TestImport", + "nativeType": "Object", + "properties": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "TestImport_AnotherObject" + }, + "required": true, + "type": "TestImport_AnotherObject" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "TestImport_AnotherObject" + }, + "type": "TestImport_AnotherObject" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_AnotherObject" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_AnotherObject" + }, + "required": true, + "type": "[TestImport_AnotherObject]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[TestImport_AnotherObject]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_AnotherObject" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_AnotherObject" + }, + "type": "[TestImport_AnotherObject]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[TestImport_AnotherObject]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "optEnum", + "type": "TestImport_Enum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + } + ], + "type": "TestImport_Object", + "uri": "testimport.uri.eth" + }, + { + "kind": 1025, + "namespace": "TestImport", + "nativeType": "AnotherObject", + "properties": [ + { + "kind": 34, + "name": "prop", + "required": true, + "scalar": { + "kind": 4, + "name": "prop", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "TestImport_AnotherObject", + "uri": "testimport.uri.eth" + } + ], + "interfaceTypes": [ + { + "capabilities": { + "getImplementations": { + "enabled": true + } + }, + "kind": 32768, + "namespace": "TestImport", + "nativeType": "Interface", + "type": "TestImport", + "uri": "testimport.uri.eth" + } + ], + "moduleType": { + "imports": [ + { + "type": "TestImport_Module" + }, + { + "type": "TestImport_Object" + }, + { + "type": "TestImport_AnotherObject" + }, + { + "type": "TestImport_Enum" + }, + { + "type": "TestImport_Enum_Return" + } + ], + "kind": 128, + "methods": [ + { + "arguments": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "CustomEnum" + }, + "kind": 34, + "name": "optEnum", + "type": "CustomEnum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "map", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "map", + "required": true, + "scalar": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + } + }, + "name": "map", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + }, + "key": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArr", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + } + }, + "name": "mapOfArr", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "map": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfMap", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + } + }, + "name": "mapOfMap", + "required": true, + "type": "Map>", + "value": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfMap", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + } + } + }, + "name": "mapOfMap", + "required": true, + "type": "Map>" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfObj", + "object": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + } + }, + "name": "mapOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "key": { + "kind": 4, + "name": "mapOfArrOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + } + }, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map" + } + ], + "kind": 64, + "name": "moduleMethod", + "required": true, + "return": { + "kind": 34, + "name": "moduleMethod", + "required": true, + "scalar": { + "kind": 4, + "name": "moduleMethod", + "required": true, + "type": "Int" + }, + "type": "Int" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + } + ], + "env": { + "required": true + }, + "kind": 64, + "name": "objectMethod", + "required": true, + "return": { + "kind": 34, + "name": "objectMethod", + "object": { + "kind": 8192, + "name": "objectMethod", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + } + ], + "env": { + "required": false + }, + "kind": 64, + "name": "optionalEnvMethod", + "required": true, + "return": { + "kind": 34, + "name": "optionalEnvMethod", + "object": { + "kind": 8192, + "name": "optionalEnvMethod", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "if", + "object": { + "kind": 8192, + "name": "if", + "required": true, + "type": "else" + }, + "required": true, + "type": "else" + } + ], + "kind": 64, + "name": "if", + "required": true, + "return": { + "kind": 34, + "name": "if", + "object": { + "kind": 8192, + "name": "if", + "required": true, + "type": "else" + }, + "required": true, + "type": "else" + }, + "type": "Method" + } + ], + "type": "Module" + }, + "objectTypes": [ + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "u", + "required": true, + "scalar": { + "kind": 4, + "name": "u", + "required": true, + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "optU", + "scalar": { + "kind": 4, + "name": "optU", + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "u8", + "required": true, + "scalar": { + "kind": 4, + "name": "u8", + "required": true, + "type": "UInt8" + }, + "type": "UInt8" + }, + { + "kind": 34, + "name": "u16", + "required": true, + "scalar": { + "kind": 4, + "name": "u16", + "required": true, + "type": "UInt16" + }, + "type": "UInt16" + }, + { + "kind": 34, + "name": "u32", + "required": true, + "scalar": { + "kind": 4, + "name": "u32", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "i", + "required": true, + "scalar": { + "kind": 4, + "name": "i", + "required": true, + "type": "Int" + }, + "type": "Int" + }, + { + "kind": 34, + "name": "i8", + "required": true, + "scalar": { + "kind": 4, + "name": "i8", + "required": true, + "type": "Int8" + }, + "type": "Int8" + }, + { + "kind": 34, + "name": "i16", + "required": true, + "scalar": { + "kind": 4, + "name": "i16", + "required": true, + "type": "Int16" + }, + "type": "Int16" + }, + { + "kind": 34, + "name": "i32", + "required": true, + "scalar": { + "kind": 4, + "name": "i32", + "required": true, + "type": "Int32" + }, + "type": "Int32" + }, + { + "kind": 34, + "name": "bigint", + "required": true, + "scalar": { + "kind": 4, + "name": "bigint", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "optBigint", + "scalar": { + "kind": 4, + "name": "optBigint", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "bignumber", + "required": true, + "scalar": { + "kind": 4, + "name": "bignumber", + "required": true, + "type": "BigNumber" + }, + "type": "BigNumber" + }, + { + "kind": 34, + "name": "optBignumber", + "scalar": { + "kind": 4, + "name": "optBignumber", + "type": "BigNumber" + }, + "type": "BigNumber" + }, + { + "kind": 34, + "name": "json", + "required": true, + "scalar": { + "kind": 4, + "name": "json", + "required": true, + "type": "JSON" + }, + "type": "JSON" + }, + { + "kind": 34, + "name": "optJson", + "scalar": { + "kind": 4, + "name": "optJson", + "type": "JSON" + }, + "type": "JSON" + }, + { + "kind": 34, + "name": "bytes", + "required": true, + "scalar": { + "kind": 4, + "name": "bytes", + "required": true, + "type": "Bytes" + }, + "type": "Bytes" + }, + { + "kind": 34, + "name": "optBytes", + "scalar": { + "kind": 4, + "name": "optBytes", + "type": "Bytes" + }, + "type": "Bytes" + }, + { + "kind": 34, + "name": "boolean", + "required": true, + "scalar": { + "kind": 4, + "name": "boolean", + "required": true, + "type": "Boolean" + }, + "type": "Boolean" + }, + { + "kind": 34, + "name": "optBoolean", + "scalar": { + "kind": 4, + "name": "optBoolean", + "type": "Boolean" + }, + "type": "Boolean" + }, + { + "array": { + "item": { + "kind": 4, + "name": "uArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "uArray", + "required": true, + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "uOptArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uOptArray", + "scalar": { + "kind": 4, + "name": "uOptArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "uOptArray", + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "optUOptArray", + "type": "UInt" + }, + "kind": 18, + "name": "optUOptArray", + "scalar": { + "kind": 4, + "name": "optUOptArray", + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "optUOptArray", + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "optStrOptArray", + "type": "String" + }, + "kind": 18, + "name": "optStrOptArray", + "scalar": { + "kind": 4, + "name": "optStrOptArray", + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "optStrOptArray", + "type": "[String]" + }, + { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + "kind": 34, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "scalar": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "scalar": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 34, + "name": "uOptArrayOptArray", + "required": true, + "type": "[[UInt32]]" + }, + { + "array": { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "type": "[[[UInt32]]]" + }, + "kind": 34, + "name": "uArrayOptArrayArray", + "required": true, + "type": "[[[UInt32]]]" + }, + { + "array": { + "array": { + "array": { + "array": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "crazyArray", + "type": "[[[UInt32]]]" + }, + "item": { + "array": { + "array": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "kind": 18, + "name": "crazyArray", + "scalar": { + "kind": 4, + "name": "crazyArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "crazyArray", + "type": "[[[UInt32]]]" + }, + "kind": 18, + "name": "crazyArray", + "type": "[[[[UInt32]]]]" + }, + "kind": 34, + "name": "crazyArray", + "type": "[[[[UInt32]]]]" + }, + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "CustomEnum" + }, + "kind": 34, + "name": "optEnum", + "type": "CustomEnum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "map", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "map", + "required": true, + "scalar": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + } + }, + "name": "map", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + }, + "key": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArr", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + } + }, + "name": "mapOfArr", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfObj", + "object": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + } + }, + "name": "mapOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "key": { + "kind": 4, + "name": "mapOfArrOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + } + }, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapCustomValue", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapCustomValue", + "object": { + "kind": 8192, + "name": "mapCustomValue", + "type": "CustomMapValue" + }, + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapCustomValue", + "type": "CustomMapValue" + } + }, + "name": "mapCustomValue", + "required": true, + "type": "Map" + } + ], + "type": "CustomType" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "prop", + "scalar": { + "kind": 4, + "name": "prop", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "circular", + "object": { + "kind": 8192, + "name": "circular", + "type": "CustomType" + }, + "type": "CustomType" + }, + { + "kind": 34, + "name": "const", + "scalar": { + "kind": 4, + "name": "const", + "type": "String" + }, + "type": "String" + } + ], + "type": "AnotherType" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "foo", + "required": true, + "scalar": { + "kind": 4, + "name": "foo", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "CustomMapValue" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "else", + "required": true, + "scalar": { + "kind": 4, + "name": "else", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "else" + } + ], + "version": "0.1" + })) + .unwrap(), + } +} diff --git a/yarn.lock b/yarn.lock index 5dd9b586d4..93b0ddeeaf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -124,7 +124,7 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.19.4", "@babel/compat-data@^7.20.0", "@babel/compat-data@^7.9.0": +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.0", "@babel/compat-data@^7.20.1", "@babel/compat-data@^7.9.0": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== @@ -152,32 +152,32 @@ source-map "^0.5.0" "@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.4.5", "@babel/core@^7.7.5": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.6.tgz#7122ae4f5c5a37c0946c066149abd8e75f81540f" - integrity sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" + integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== dependencies: "@ampproject/remapping" "^2.1.0" "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.19.6" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-module-transforms" "^7.19.6" - "@babel/helpers" "^7.19.4" - "@babel/parser" "^7.19.6" + "@babel/generator" "^7.20.2" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-module-transforms" "^7.20.2" + "@babel/helpers" "^7.20.1" + "@babel/parser" "^7.20.2" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.6" - "@babel/types" "^7.19.4" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.1" semver "^6.3.0" -"@babel/generator@^7.19.6", "@babel/generator@^7.20.1", "@babel/generator@^7.4.0", "@babel/generator@^7.9.0": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.1.tgz#ef32ecd426222624cbd94871a7024639cf61a9fa" - integrity sha512-u1dMdBUmA7Z0rBB97xh8pIhviK7oItYOkjbsCxTWMknyvbQRBwX7/gn4JXurRdirWMFh+ZtYARqkA6ydogVZpg== +"@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.4.0", "@babel/generator@^7.9.0": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== dependencies: - "@babel/types" "^7.20.0" + "@babel/types" "^7.20.2" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" @@ -196,7 +196,7 @@ "@babel/helper-explode-assignable-expression" "^7.18.6" "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3", "@babel/helper-compilation-targets@^7.8.7": +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.0", "@babel/helper-compilation-targets@^7.8.7": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== @@ -206,17 +206,17 @@ browserslist "^4.21.3" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.19.0", "@babel/helper-create-class-features-plugin@^7.8.3": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz#bfd6904620df4e46470bae4850d66be1054c404b" - integrity sha512-NRz8DwF4jT3UfrmUoZjd0Uph9HQnP30t7Ash+weACcyNkiYTywpIjDBgReJMKgr+n86sn2nPVVmJ28Dm053Kqw== +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.2", "@babel/helper-create-class-features-plugin@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.2.tgz#3c08a5b5417c7f07b5cf3dfb6dc79cbec682e8c2" + integrity sha512-k22GoYRAHPYr9I+Gvy2ZQlAe5mGy8BqWst2wRt8cwIufWTxrsVshhIBvYNqC80N0GSFWTsqRVexOtfzlgOEDvA== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-member-expression-to-functions" "^7.18.9" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0": @@ -280,19 +280,19 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.9.0": - version "7.19.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.19.6.tgz#6c52cc3ac63b70952d33ee987cbee1c9368b533f" - integrity sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw== +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.6", "@babel/helper-module-transforms@^7.20.2", "@babel/helper-module-transforms@^7.9.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" + integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== dependencies: "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.19.4" + "@babel/helper-simple-access" "^7.20.2" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.18.10" - "@babel/traverse" "^7.19.6" - "@babel/types" "^7.19.4" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" @@ -301,10 +301,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" - integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== "@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": version "7.18.9" @@ -316,7 +316,7 @@ "@babel/helper-wrap-function" "^7.18.9" "@babel/types" "^7.18.9" -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.18.9": +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.19.1.tgz#e1592a9b4b368aa6bdb8784a711e0bcbf0612b78" integrity sha512-T7ahH7wV0Hfs46SFh5Jz3s0B6+o8g3c+7TMxu7xKfmHikg7EAZ3I2Qk9LFhjxXq8sL7UkP5JflezNwoZa8WvWw== @@ -327,12 +327,12 @@ "@babel/traverse" "^7.19.1" "@babel/types" "^7.19.0" -"@babel/helper-simple-access@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.19.4.tgz#be553f4951ac6352df2567f7daa19a0ee15668e7" - integrity sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg== +"@babel/helper-simple-access@^7.19.4", "@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== dependencies: - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.2" "@babel/helper-skip-transparent-expression-wrappers@^7.18.9": version "7.20.0" @@ -373,7 +373,7 @@ "@babel/traverse" "^7.19.0" "@babel/types" "^7.19.0" -"@babel/helpers@^7.19.4", "@babel/helpers@^7.9.0": +"@babel/helpers@^7.20.1", "@babel/helpers@^7.9.0": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== @@ -391,10 +391,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.19.6", "@babel/parser@^7.20.1", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.1.tgz#3e045a92f7b4623cafc2425eddcb8cf2e54f9cc5" - integrity sha512-hp0AYxaZJhxULfM1zyp7Wgr+pSUKBcP3M+PHnSzWGdXOzg/kHWIgiUWARvubhUKGOEw3xqY4x+lyZ9ytBVcELw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.9.0": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" + integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -412,7 +412,7 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" "@babel/plugin-proposal-optional-chaining" "^7.18.9" -"@babel/plugin-proposal-async-generator-functions@^7.19.1", "@babel/plugin-proposal-async-generator-functions@^7.8.3": +"@babel/plugin-proposal-async-generator-functions@^7.20.1", "@babel/plugin-proposal-async-generator-functions@^7.8.3": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.1.tgz#352f02baa5d69f4e7529bdac39aaa02d41146af9" integrity sha512-Gh5rchzSwE4kC+o/6T8waD0WHEQIsDmjltY8WnWRXHUdH8axZhuH86Ov9M72YhJfDrZseQwuuWaaIT/TmePp3g== @@ -520,16 +520,16 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.19.4", "@babel/plugin-proposal-object-rest-spread@^7.9.0": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.19.4.tgz#a8fc86e8180ff57290c91a75d83fe658189b642d" - integrity sha512-wHmj6LDxVDnL+3WhXteUBaoM1aVILZODAUjg11kHqG4cOlfgMQGxw6aCgvrXrmaJR3Bn14oZhImyCPZzRpC93Q== +"@babel/plugin-proposal-object-rest-spread@^7.20.2", "@babel/plugin-proposal-object-rest-spread@^7.9.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.2.tgz#a556f59d555f06961df1e572bb5eca864c84022d" + integrity sha512-Ks6uej9WFK+fvIMesSqbAto5dD8Dz4VuuFvGJFKgIGSkJuRGcrwGECPA1fDgQK3/DbExBJpEkTeYeB8geIFCSQ== dependencies: - "@babel/compat-data" "^7.19.4" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/compat-data" "^7.20.1" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-parameters" "^7.20.1" "@babel/plugin-proposal-optional-catch-binding@^7.18.6", "@babel/plugin-proposal-optional-catch-binding@^7.8.3": version "7.18.6" @@ -638,7 +638,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-syntax-import-assertions@^7.18.6": +"@babel/plugin-syntax-import-assertions@^7.20.0": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== @@ -752,25 +752,25 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-block-scoping@^7.19.4", "@babel/plugin-transform-block-scoping@^7.8.3": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.0.tgz#91fe5e6ffc9ba13cb6c95ed7f0b1204f68c988c5" - integrity sha512-sXOohbpHZSk7GjxK9b3dKB7CfqUD5DwOH+DggKzOQ7TXYP+RCSbRykfjQmn/zq+rBjycVRtLf9pYhAaEJA786w== +"@babel/plugin-transform-block-scoping@^7.20.2", "@babel/plugin-transform-block-scoping@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.2.tgz#f59b1767e6385c663fd0bce655db6ca9c8b236ed" + integrity sha512-y5V15+04ry69OV2wULmwhEA6jwSWXO1TwAtIwiPXcvHcoOQUqpyMVd2bDsQJMW8AurjulIyUV8kDqtjSwHy1uQ== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" -"@babel/plugin-transform-classes@^7.19.0", "@babel/plugin-transform-classes@^7.9.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz#0e61ec257fba409c41372175e7c1e606dc79bb20" - integrity sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A== +"@babel/plugin-transform-classes@^7.20.2", "@babel/plugin-transform-classes@^7.9.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.2.tgz#c0033cf1916ccf78202d04be4281d161f6709bb2" + integrity sha512-9rbPp0lCVVoagvtEyQKSo5L8oo0nQS/iif+lwlAz29MccX2642vWDlSZK+2T2buxbopotId2ld7zZAzRfz9j1g== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-compilation-targets" "^7.20.0" "@babel/helper-environment-visitor" "^7.18.9" "@babel/helper-function-name" "^7.19.0" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-plugin-utils" "^7.19.0" - "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-replace-supers" "^7.19.1" "@babel/helper-split-export-declaration" "^7.18.6" globals "^11.1.0" @@ -781,12 +781,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-destructuring@^7.19.4", "@babel/plugin-transform-destructuring@^7.8.3": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.0.tgz#712829ef4825d9cc04bb379de316f981e9a6f648" - integrity sha512-1dIhvZfkDVx/zn2S1aFwlruspTt4189j7fEkH0Y0VyuDM6bQt7bD6kLcz3l4IlLG+e5OReaBz9ROAbttRtUHqA== +"@babel/plugin-transform-destructuring@^7.20.2", "@babel/plugin-transform-destructuring@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.2.tgz#c23741cfa44ddd35f5e53896e88c75331b8b2792" + integrity sha512-mENM+ZHrvEgxLTBXUiQ621rRXZes3KWUv6NdQlrnr1TkWVw+hUjQBZuP2X32qKlrlG2BzgR95gkuCRSkJl8vIw== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4", "@babel/plugin-transform-dotall-regex@^7.8.3": version "7.18.6" @@ -849,7 +849,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-modules-amd@^7.18.6", "@babel/plugin-transform-modules-amd@^7.9.0": +"@babel/plugin-transform-modules-amd@^7.19.6", "@babel/plugin-transform-modules-amd@^7.9.0": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.19.6.tgz#aca391801ae55d19c4d8d2ebfeaa33df5f2a2cbd" integrity sha512-uG3od2mXvAtIFQIh0xrpLH6r5fpSQN04gIVovl+ODLdUMANokxQLZnPBHcjmv3GxRjnqwLuHvppjjcelqUFZvg== @@ -857,7 +857,7 @@ "@babel/helper-module-transforms" "^7.19.6" "@babel/helper-plugin-utils" "^7.19.0" -"@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.9.0": +"@babel/plugin-transform-modules-commonjs@^7.19.6", "@babel/plugin-transform-modules-commonjs@^7.9.0": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.19.6.tgz#25b32feef24df8038fc1ec56038917eacb0b730c" integrity sha512-8PIa1ym4XRTKuSsOUXqDG0YaOlEuTVvHMe5JCfgBMOtHvJKw/4NGovEGN33viISshG/rZNVrACiBmPQLvWN8xQ== @@ -866,7 +866,7 @@ "@babel/helper-plugin-utils" "^7.19.0" "@babel/helper-simple-access" "^7.19.4" -"@babel/plugin-transform-modules-systemjs@^7.19.0", "@babel/plugin-transform-modules-systemjs@^7.9.0": +"@babel/plugin-transform-modules-systemjs@^7.19.6", "@babel/plugin-transform-modules-systemjs@^7.9.0": version "7.19.6" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.6.tgz#59e2a84064b5736a4471b1aa7b13d4431d327e0d" integrity sha512-fqGLBepcc3kErfR9R3DnVpURmckXP7gj7bAlrTQyBxrigFqszZCkFkcoxzCp2v32XmwXLvbw+8Yq9/b+QqksjQ== @@ -907,12 +907,12 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/helper-replace-supers" "^7.18.6" -"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.8.7": - version "7.20.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.1.tgz#9a5aa370fdcce36f110455e9369db7afca0f9eeb" - integrity sha512-nDvKLrAvl+kf6BOy1UJ3MGwzzfTMgppxwiD2Jb4LO3xjYyZq30oQzDNJbCQpMdG9+j2IXHoiMrw5Cm/L6ZoxXQ== +"@babel/plugin-transform-parameters@^7.20.1", "@babel/plugin-transform-parameters@^7.8.7": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.3.tgz#7b3468d70c3c5b62e46be0a47b6045d8590fb748" + integrity sha512-oZg/Fpx0YDrj13KsLyO8I/CX3Zdw7z0O9qOd95SqcoIzuqy/WTGWvePeHAnZCN54SfdyjHcb1S30gc8zlzlHcA== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-property-literals@^7.18.6", "@babel/plugin-transform-property-literals@^7.8.3": version "7.18.6" @@ -922,11 +922,11 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-react-constant-elements@^7.0.0": - version "7.18.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.18.12.tgz#edf3bec47eb98f14e84fa0af137fcc6aad8e0443" - integrity sha512-Q99U9/ttiu+LMnRU8psd23HhvwXmKWDQIpocm0JKaICcZHnw+mdQbHm6xnSy7dOl8I5PELakYtNBubNQlBXbZw== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.20.2.tgz#3f02c784e0b711970d7d8ccc96c4359d64e27ac7" + integrity sha512-KS/G8YI8uwMGKErLFOHS/ekhqdHhpEloxs43NecQHVgo2QuQSyJhGIY1fL8UGl9wy5ItVwwoUL4YxVqsplGq2g== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-react-display-name@7.8.3": version "7.8.3" @@ -1044,12 +1044,12 @@ "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-transform-typescript@^7.9.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.0.tgz#2c7ec62b8bfc21482f3748789ba294a46a375169" - integrity sha512-xOAsAFaun3t9hCwZ13Qe7gq423UgMZ6zAgmLxeGGapFqlT/X3L5qT2btjiVLlFn7gWtMaVyceS5VxGAuKbgizw== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.2.tgz#91515527b376fc122ba83b13d70b01af8fe98f3f" + integrity sha512-jvS+ngBfrnTUBfOQq8NfGnSbF9BrqlR6hjJ2yVxMkmO5nL/cdifNbI30EfjRlN4g5wYWNnMPyj5Sa6R1pbLeag== dependencies: - "@babel/helper-create-class-features-plugin" "^7.19.0" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-create-class-features-plugin" "^7.20.2" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-typescript" "^7.20.0" "@babel/plugin-transform-unicode-escapes@^7.18.10": @@ -1134,17 +1134,17 @@ semver "^5.5.0" "@babel/preset-env@^7.4.5": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.4.tgz#4c91ce2e1f994f717efb4237891c3ad2d808c94b" - integrity sha512-5QVOTXUdqTCjQuh2GGtdd7YEhoRXBMVGROAtsBeLGIbIz3obCBIfRMT1I3ZKkMgNzwkyCkftDXSSkHxnfVf4qg== + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.20.2.tgz#9b1642aa47bb9f43a86f9630011780dab7f86506" + integrity sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg== dependencies: - "@babel/compat-data" "^7.19.4" - "@babel/helper-compilation-targets" "^7.19.3" - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/compat-data" "^7.20.1" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-validator-option" "^7.18.6" "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" - "@babel/plugin-proposal-async-generator-functions" "^7.19.1" + "@babel/plugin-proposal-async-generator-functions" "^7.20.1" "@babel/plugin-proposal-class-properties" "^7.18.6" "@babel/plugin-proposal-class-static-block" "^7.18.6" "@babel/plugin-proposal-dynamic-import" "^7.18.6" @@ -1153,7 +1153,7 @@ "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" "@babel/plugin-proposal-numeric-separator" "^7.18.6" - "@babel/plugin-proposal-object-rest-spread" "^7.19.4" + "@babel/plugin-proposal-object-rest-spread" "^7.20.2" "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" "@babel/plugin-proposal-optional-chaining" "^7.18.9" "@babel/plugin-proposal-private-methods" "^7.18.6" @@ -1164,7 +1164,7 @@ "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.18.6" + "@babel/plugin-syntax-import-assertions" "^7.20.0" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -1177,10 +1177,10 @@ "@babel/plugin-transform-arrow-functions" "^7.18.6" "@babel/plugin-transform-async-to-generator" "^7.18.6" "@babel/plugin-transform-block-scoped-functions" "^7.18.6" - "@babel/plugin-transform-block-scoping" "^7.19.4" - "@babel/plugin-transform-classes" "^7.19.0" + "@babel/plugin-transform-block-scoping" "^7.20.2" + "@babel/plugin-transform-classes" "^7.20.2" "@babel/plugin-transform-computed-properties" "^7.18.9" - "@babel/plugin-transform-destructuring" "^7.19.4" + "@babel/plugin-transform-destructuring" "^7.20.2" "@babel/plugin-transform-dotall-regex" "^7.18.6" "@babel/plugin-transform-duplicate-keys" "^7.18.9" "@babel/plugin-transform-exponentiation-operator" "^7.18.6" @@ -1188,14 +1188,14 @@ "@babel/plugin-transform-function-name" "^7.18.9" "@babel/plugin-transform-literals" "^7.18.9" "@babel/plugin-transform-member-expression-literals" "^7.18.6" - "@babel/plugin-transform-modules-amd" "^7.18.6" - "@babel/plugin-transform-modules-commonjs" "^7.18.6" - "@babel/plugin-transform-modules-systemjs" "^7.19.0" + "@babel/plugin-transform-modules-amd" "^7.19.6" + "@babel/plugin-transform-modules-commonjs" "^7.19.6" + "@babel/plugin-transform-modules-systemjs" "^7.19.6" "@babel/plugin-transform-modules-umd" "^7.18.6" "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" "@babel/plugin-transform-new-target" "^7.18.6" "@babel/plugin-transform-object-super" "^7.18.6" - "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-parameters" "^7.20.1" "@babel/plugin-transform-property-literals" "^7.18.6" "@babel/plugin-transform-regenerator" "^7.18.6" "@babel/plugin-transform-reserved-words" "^7.18.6" @@ -1207,7 +1207,7 @@ "@babel/plugin-transform-unicode-escapes" "^7.18.10" "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.19.4" + "@babel/types" "^7.20.2" babel-plugin-polyfill-corejs2 "^0.3.3" babel-plugin-polyfill-corejs3 "^0.6.0" babel-plugin-polyfill-regenerator "^0.4.1" @@ -1288,7 +1288,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.19.6", "@babel/traverse@^7.20.1", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.0": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.20.1", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.9.0": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== @@ -1304,10 +1304,10 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.4", "@babel/types@^7.20.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.0.tgz#52c94cf8a7e24e89d2a194c25c35b17a64871479" - integrity sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg== +"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.9.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" + integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== dependencies: "@babel/helper-string-parser" "^7.19.4" "@babel/helper-validator-identifier" "^7.19.1" @@ -3201,11 +3201,16 @@ dependencies: "@opentelemetry/api" "^1.0.0" -"@opentelemetry/api@1.2.0", "@opentelemetry/api@^1.0.0": +"@opentelemetry/api@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.2.0.tgz#89ef99401cde6208cff98760b67663726ef26686" integrity sha512-0nBr+VZNKm9tvNDZFstI3Pq1fCTEDK5OZTnVKNvBNAKgd0yIvmwsP4m61rEv7ZP+tOUjWJhROpxK5MsnlF911g== +"@opentelemetry/api@^1.0.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.3.0.tgz#27c6f776ac3c1c616651e506a89f438a0ed6a055" + integrity sha512-YveTnGNsFFixTKJz09Oi4zYkiLT5af3WpZDu4aIUM7xX+2bHAkOJayFTVQd6zB8kkWPpbua4Ha6Ql00grdLlJQ== + "@opentelemetry/core@1.6.0": version "1.6.0" resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.6.0.tgz#c55f8ab7496acef7dbd8c4eedef6a4d4a0143c95" @@ -3310,9 +3315,9 @@ integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== "@sinonjs/commons@^1.7.0": - version "1.8.4" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.4.tgz#d1f2d80f1bd0f2520873f161588bd9b7f8567120" - integrity sha512-RpmQdHVo8hCEHDVpO39zToS9jOhR6nw+/lQAzRNq9ErrGV9IeHM71XCn68svVl/euFeVW6BWX4p35gkhbOcSIQ== + version "1.8.5" + resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.5.tgz#e280c94c95f206dcfd5aca00a43f2156b758c764" + integrity sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA== dependencies: type-detect "4.0.8" @@ -3482,9 +3487,9 @@ integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.0", "@types/babel__core@^7.1.7": - version "7.1.19" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" - integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== + version "7.1.20" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.20.tgz#e168cdd612c92a2d335029ed62ac94c95b362359" + integrity sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -3635,9 +3640,9 @@ integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== "@types/lodash@^4.14.182": - version "4.14.187" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.187.tgz#122ff0a7192115b4c1a19444ab4482caa77e2c9d" - integrity sha512-MrO/xLXCaUgZy3y96C/iOsaIqZSeupyTImKClHunL5GrmaiII2VwvWmLBu2hwa0Kp0sV19CsyjtrTc/Fx8rg/A== + version "4.14.189" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.189.tgz#975ff8c38da5ae58b751127b19ad5e44b5b7f6d2" + integrity sha512-kb9/98N6X8gyME9Cf7YaqIMvYGnBSWqEci6tiettE6iJWH1XdJz/PO8LB0GtLCG7x8dU3KWhZT+lA1a35127tA== "@types/minimatch@*": version "5.1.2" @@ -4247,9 +4252,9 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.3, ajv@^6.12.4: uri-js "^4.2.2" ajv@^8.0.1: - version "8.11.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" - integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== + version "8.11.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.2.tgz#aecb20b50607acf2569b6382167b65a96008bb78" + integrity sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" @@ -4458,14 +4463,14 @@ array-ify@^1.0.0: integrity sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng== array-includes@^3.0.3, array-includes@^3.1.1: - version "3.1.5" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" - integrity sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ== + version "3.1.6" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.6.tgz#9e9e720e194f198266ba9e18c29e6a9b0e4b225f" + integrity sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" - get-intrinsic "^1.1.1" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" is-string "^1.0.7" array-union@^1.0.1: @@ -4500,7 +4505,7 @@ array.prototype.flat@^1.2.1, array.prototype.flat@^1.2.3: es-abstract "^1.20.4" es-shim-unscopables "^1.0.0" -array.prototype.reduce@^1.0.4: +array.prototype.reduce@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz#6b20b0daa9d9734dd6bc7ea66b5bbce395471eac" integrity sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q== @@ -5501,9 +5506,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001035, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001400: - version "1.0.30001430" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001430.tgz#638a8ae00b5a8a97e66ff43733b2701f81b101fa" - integrity sha512-IB1BXTZKPDVPM7cnV4iaKaHxckvdr/3xtctB3f7Hmenx3qYBhGtTZ//7EllK66aKXW98Lx0+7Yr0kxBtIt3tzg== + version "1.0.30001431" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795" + integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== capture-exit@^2.0.0: version "2.0.0" @@ -6199,16 +6204,16 @@ copyfiles@2.4.1: yargs "^16.1.0" core-js-compat@^3.25.1, core-js-compat@^3.6.2: - version "3.26.0" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.0.tgz#94e2cf8ba3e63800c4956ea298a6473bc9d62b44" - integrity sha512-piOX9Go+Z4f9ZiBFLnZ5VrOpBl0h7IGCkiFUN11QTe6LjAvOT3ifL/5TdoizMh99hcGy5SoLyWbapIY/PIb/3A== + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.26.1.tgz#0e710b09ebf689d719545ac36e49041850f943df" + integrity sha512-622/KzTudvXCDLRw70iHW4KKs1aGpcRcowGWyYJr2DEBfRrd6hNJybxSWJFuZYD4ma86xhrwDDHxmDaIq4EA8A== dependencies: browserslist "^4.21.4" core-js-pure@^3.25.1: - version "3.26.0" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.26.0.tgz#7ad8a5dd7d910756f3124374b50026e23265ca9a" - integrity sha512-LiN6fylpVBVwT8twhhluD9TzXmZQQsr2I2eIKtWNbZI1XMfBT7CV18itaN6RA7EtQd/SDdRx/wzvAShX2HvhQA== + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.26.1.tgz#653f4d7130c427820dcecd3168b594e8bb095a33" + integrity sha512-VVXcDpp/xJ21KdULRq/lXdLzQAtX7+37LzpyfFM973il0tWSsDEoyzG38G14AjTpK9VTfiNM9jnFauq/CpaWGQ== core-js@^2.4.0: version "2.6.12" @@ -6216,9 +6221,9 @@ core-js@^2.4.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.5.0: - version "3.26.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.0.tgz#a516db0ed0811be10eac5d94f3b8463d03faccfe" - integrity sha512-+DkDrhoR4Y0PxDz6rurahuB+I45OsEUv8E1maPTB6OuHRohMMcznBq9TMpdpDMm/hUPob/mJJS3PqgbHpMTQgw== + version "3.26.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.26.1.tgz#7a9816dabd9ee846c1c0fe0e8fcad68f3709134e" + integrity sha512-21491RRQVzUn0GGM9Z1Jrpr6PNPxPi+Za8OM9q4tksTSnlbXXGKK1nXNg/QvwFYettXvSX6zWKCtHHfjN4puyA== core-util-is@1.0.2: version "1.0.2" @@ -6252,9 +6257,9 @@ cosmiconfig@^6.0.0: yaml "^1.7.2" cosmiconfig@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" - integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.1.0.tgz#1443b9afa596b670082ea46cbd8f6a62b84635f6" + integrity sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA== dependencies: "@types/parse-json" "^4.0.0" import-fresh "^3.2.1" @@ -7252,7 +7257,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.5, es-abstract@^1.20.1, es-abstract@^1.20.4: +es-abstract@^1.17.2, es-abstract@^1.19.0, es-abstract@^1.20.4: version "1.20.4" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.4.tgz#1d103f9f8d78d4cf0713edcd6d0ed1a46eed5861" integrity sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA== @@ -10692,9 +10697,9 @@ jest-mock@^26.6.2: "@types/node" "*" jest-pnp-resolver@^1.2.1, jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== + version "1.2.3" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz#930b1546164d4ad5937d5540e711d4d38d4cad2e" + integrity sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w== jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: version "24.9.0" @@ -11264,11 +11269,11 @@ json-stable-stringify-without-jsonify@^1.0.1: integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - integrity sha512-i/J297TW6xyj7sDFa7AmBPkQvLIxWr2kKPWI26tXydnZrzVAocNqn5DMNT1Mzk0vit1V5UkRM7C1KdVNp7Lmcg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz#e06f23128e0bbe342dc996ed5a19e28b57b580e0" + integrity sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g== dependencies: - jsonify "~0.0.0" + jsonify "^0.0.1" json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" @@ -11320,7 +11325,7 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonify@~0.0.0: +jsonify@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== @@ -11570,18 +11575,18 @@ loader-utils@1.2.3: json5 "^1.0.1" loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" json5 "^1.0.1" loader-utils@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.3.tgz#d4b15b8504c63d1fc3f2ade52d41bc8459d6ede1" - integrity sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A== + version "2.0.4" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.4.tgz#8b5cb38b5c34a9a018ee1fc0e6a066d1dfcc528c" + integrity sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -11681,9 +11686,9 @@ lodash@4.x, "lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14 integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== loglevel@^1.6.6: - version "1.8.0" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.0.tgz#e7ec73a57e1e7b419cb6c6ac06bf050b67356114" - integrity sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA== + version "1.8.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.8.1.tgz#5c621f83d5b48c54ae93b6156353f555963377b4" + integrity sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg== long@^4.0.0: version "4.0.0" @@ -12986,32 +12991,32 @@ object.assign@^4.1.0, object.assign@^4.1.4: object-keys "^1.1.1" object.entries@^1.1.0, object.entries@^1.1.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" - integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" + integrity sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" object.fromentries@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" - integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== + version "2.0.6" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.6.tgz#cdb04da08c539cffa912dcd368b886e0904bfa73" + integrity sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" object.getownpropertydescriptors@^2.0.3, object.getownpropertydescriptors@^2.1.0, object.getownpropertydescriptors@^2.1.1: - version "2.1.4" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.4.tgz#7965e6437a57278b587383831a9b829455a4bc37" - integrity sha512-sccv3L/pMModT6dJAYF3fzGMVcb38ysQ0tEE6ixv2yXJDtEIPph268OlAdJj5/qZMZDq2g/jqvwppt36uS/uQQ== + version "2.1.5" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz#db5a9002489b64eef903df81d6623c07e5b4b4d3" + integrity sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw== dependencies: - array.prototype.reduce "^1.0.4" + array.prototype.reduce "^1.0.5" call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.20.1" + es-abstract "^1.20.4" object.pick@^1.3.0: version "1.3.0" @@ -13021,13 +13026,13 @@ object.pick@^1.3.0: isobject "^3.0.1" object.values@^1.1.0, object.values@^1.1.1: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" - integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + version "1.1.6" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" + integrity sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" obuf@^1.0.0, obuf@^1.1.2: version "1.1.2" @@ -15103,14 +15108,14 @@ regenerator-runtime@^0.11.0: integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== regenerator-runtime@^0.13.10, regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4: - version "0.13.10" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" - integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw== + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== regenerator-transform@^0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.0.tgz#cbd9ead5d77fae1a48d957cf889ad0586adb6537" - integrity sha512-LsrGtPmbYg19bcPHwdtmXwbW+TqNvtY4riE3P83foeHRroMbH6/2ddFBfab3t7kbzc7v7p4wbkIecHImqt0QNg== + version "0.15.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" + integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== dependencies: "@babel/runtime" "^7.8.4" @@ -15132,7 +15137,7 @@ regex-parser@2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== -regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: +regexp.prototype.flags@^1.2.0, regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== @@ -15152,16 +15157,16 @@ regexpp@^3.0.0, regexpp@^3.1.0: integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== regexpu-core@^5.1.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.1.tgz#a69c26f324c1e962e9ffd0b88b055caba8089139" - integrity sha512-HrnlNtpvqP1Xkb28tMhBUO2EbyUHdQlsnlAhzWcwHy8WJR53UWr7/MAvqrsQKMbV4qdpv03oTMG8iIhfsPFktQ== + version "5.2.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" + integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== dependencies: regenerate "^1.4.2" regenerate-unicode-properties "^10.1.0" regjsgen "^0.7.1" regjsparser "^0.9.1" unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" regjsgen@^0.7.1: version "0.7.1" @@ -16110,9 +16115,9 @@ stack-utils@^1.0.1: escape-string-regexp "^2.0.0" stack-utils@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== + version "2.0.6" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.6.tgz#aaf0748169c02fc33c8232abccf933f54a1cc34f" + integrity sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ== dependencies: escape-string-regexp "^2.0.0" @@ -16255,36 +16260,36 @@ string-width@^3.0.0, string-width@^3.1.0: strip-ansi "^5.1.0" string.prototype.matchall@^4.0.2: - version "4.0.7" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" - integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== + version "4.0.8" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" + integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - get-intrinsic "^1.1.1" + define-properties "^1.1.4" + es-abstract "^1.20.4" + get-intrinsic "^1.1.3" has-symbols "^1.0.3" internal-slot "^1.0.3" - regexp.prototype.flags "^1.4.1" + regexp.prototype.flags "^1.4.3" side-channel "^1.0.4" string.prototype.trimend@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" - integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" + integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string.prototype.trimstart@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" - integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== + version "1.0.6" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" + integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== dependencies: call-bind "^1.0.2" define-properties "^1.1.4" - es-abstract "^1.19.5" + es-abstract "^1.20.4" string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@^1.2.0: version "1.3.0" @@ -16995,9 +17000,9 @@ typescript@4.1.6: integrity sha512-pxnwLxeb/Z5SP80JDRzVjh58KsM6jZHRAOtTpS7sXLS4ogXNKC9ANxHHZqLLeVHZN35jCtI4JdmLLbLiC1kBow== typescript@^4.0: - version "4.8.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" - integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== + version "4.9.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" + integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== uglify-js@^3.1.4: version "3.17.4" @@ -17064,10 +17069,10 @@ unicode-match-property-ecmascript@^2.0.0: unicode-canonical-property-names-ecmascript "^2.0.0" unicode-property-aliases-ecmascript "^2.0.0" -unicode-match-property-value-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz#1a01aa57247c14c568b89775a54938788189a714" - integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw== +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== unicode-property-aliases-ecmascript@^2.0.0: version "2.1.0" From 4e952ecdb9b4f1252838dc699616bc7ccb901dd1 Mon Sep 17 00:00:00 2001 From: namesty Date: Fri, 18 Nov 2022 23:50:14 +0100 Subject: [PATCH 2/8] (chore): escaping reserved words. Module tests --- .../rust/plugin/templates/module-rs.mustache | 9 +- .../bind/sanity/output/plugin-rs/module.rs | 66 + .../bind/sanity/output/plugin-rs/wrap.info.rs | 4335 ++++++++--------- 3 files changed, 2239 insertions(+), 2171 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache index 8524b7994b..b26554d41f 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -1,3 +1,6 @@ +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. + use std::sync::Arc; use polywrap_core::{error::Error, invoke::Invoker}; use polywrap_plugin::module::PluginModule; @@ -12,7 +15,7 @@ macro_rules! impl_plugin_module { $plugin_type, {{#moduleType}} {{#methods}} - ({{#toLower}}{{name}}{{/toLower}}, $crate::wrap::module::Args{{#toUpper}}{{name}}{{/toUpper}}), + ({{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, $crate::wrap::module::Args{{#toUpper}}{{name}}{{/toUpper}}), {{/methods}} {{/moduleType}} ); @@ -27,13 +30,13 @@ pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, {{/arguments}} } + {{/methods}} {{/moduleType}} - pub trait Module: PluginModule { {{#moduleType}} {{#methods}} - fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; + fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(&mut self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; {{^last}} {{/last}} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs index a954fd33e9..809df91315 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -1,3 +1,69 @@ /// NOTE: This is an auto-generated file. /// All modifications will be overwritten. +use std::sync::Arc; +use polywrap_core::{error::Error, invoke::Invoker}; +use polywrap_plugin::module::PluginModule; +use serde::{Serialize, Deserialize}; +use super::types::*; +pub use polywrap_plugin::base_impl_plugin_module; + +#[macro_export] +macro_rules! impl_plugin_module { + ($plugin_type:ty) => { + $crate::wrap::module::base_impl_plugin_module!( + $plugin_type, + (module_method, $crate::wrap::module::ArgsModuleMethod), + (object_method, $crate::wrap::module::ArgsObjectMethod), + (optional_env_method, $crate::wrap::module::ArgsOptionalEnvMethod), + (_if, $crate::wrap::module::ArgsIf), + ); + }; +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsModuleMethod { + pub str: String, + pub opt_str: Option, + pub en: CustomEnum, + pub opt_enum: Option, + pub enum_array: Vec, + pub opt_enum_array: Option>>, + pub map: Map, + pub map_of_arr: Map>, + pub map_of_map: Map>, + pub map_of_obj: Map, + pub map_of_arr_of_obj: Map>, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsObjectMethod { + pub object: AnotherType, + pub opt_object: Option, + pub object_array: Vec, + pub opt_object_array: Option>>, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsOptionalEnvMethod { + pub object: AnotherType, + pub opt_object: Option, + pub object_array: Vec, + pub opt_object_array: Option>>, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct ArgsIf { + #[serde(rename = "if")] + pub _if: Else, +} + +pub trait Module: PluginModule { + fn module_method(&mut self, args: &ArgsModuleMethod, invoker: Arc) -> Result; + + fn object_method(&mut self, args: &ArgsObjectMethod, invoker: Arc) -> Result, Error>; + + fn optional_env_method(&mut self, args: &ArgsOptionalEnvMethod, invoker: Arc) -> Result, Error>; + + fn _if(&mut self, args: &ArgsIf, invoker: Arc) -> Result; +} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs index f14426ced7..e0c68ed5c9 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/wrap.info.rs @@ -1,2317 +1,2316 @@ /// NOTE: This is an auto-generated file. /// All modifications will be overwritten. -use polywrap_manifest::{WrapManifest, WrapManifestAbi}; -use serde_json::{from_value, json}; +use polywrap_manifest::versions::{WrapManifest, WrapManifestAbi}; +use serde_json::{json, from_value}; pub fn get_manifest() -> WrapManifest { - WrapManifest { - name: "Test".to_string(), - type_: "plugin".to_string(), - version: "0.1".to_string(), - abi: from_value::(json!({ - "enumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 8, - "type": "CustomEnum" - }, + WrapManifest { + name: "Test".to_string(), + type_: "plugin".to_string(), + version: "0.1".to_string(), + abi: from_value::(json!({ + "enumTypes": [ + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 8, + "type": "CustomEnum" + }, + { + "constants": [ + "for", + "in" + ], + "kind": 8, + "type": "while" + } + ], + "envType": { + "kind": 65536, + "properties": [ + { + "kind": 34, + "name": "prop", + "required": true, + "scalar": { + "kind": 4, + "name": "prop", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optProp", + "scalar": { + "kind": 4, + "name": "optProp", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "optMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "optMap", + "scalar": { + "kind": 4, + "name": "optMap", + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "optMap", + "type": "Int" + } + }, + "name": "optMap", + "type": "Map" + } + ], + "type": "Env" + }, + "importedEnumTypes": [ + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 520, + "namespace": "TestImport", + "nativeType": "Enum", + "type": "TestImport_Enum", + "uri": "testimport.uri.eth" + }, + { + "constants": [ + "STRING", + "BYTES" + ], + "kind": 520, + "namespace": "TestImport", + "nativeType": "Enum", + "type": "TestImport_Enum_Return", + "uri": "testimport.uri.eth" + } + ], + "importedEnvTypes": [ + { + "kind": 524288, + "namespace": "TestImport", + "nativeType": "Env", + "properties": [ + { + "kind": 34, + "name": "enviroProp", + "required": true, + "scalar": { + "kind": 4, + "name": "enviroProp", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "TestImport_Env", + "uri": "testimport.uri.eth" + } + ], + "importedModuleTypes": [ + { + "isInterface": true, + "kind": 256, + "methods": [ + { + "arguments": [ { - "constants": [ - "for", - "in" - ], - "kind": 8, - "type": "while" - } - ], - "envType": { - "kind": 65536, - "properties": [ - { - "kind": 34, - "name": "prop", + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, "type": "String" }, - { - "kind": 34, - "name": "optProp", - "scalar": { - "kind": 4, - "name": "optProp", - "type": "String" - }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", "type": "String" }, - { - "kind": 34, - "map": { - "key": { + "type": "String" + }, + { + "kind": 34, + "name": "u", + "required": true, + "scalar": { + "kind": 4, + "name": "u", + "required": true, + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "optU", + "scalar": { + "kind": 4, + "name": "optU", + "type": "UInt" + }, + "type": "UInt" + }, + { + "array": { + "array": { + "item": { "kind": 4, - "name": "optMap", - "required": true, - "type": "String" + "name": "uArrayArray", + "type": "UInt" }, - "kind": 262146, - "name": "optMap", + "kind": 18, + "name": "uArrayArray", "scalar": { "kind": 4, - "name": "optMap", - "type": "Int" + "name": "uArrayArray", + "type": "UInt" }, - "type": "Map", - "value": { + "type": "[UInt]" + }, + "item": { + "item": { "kind": 4, - "name": "optMap", - "type": "Int" - } + "name": "uArrayArray", + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "scalar": { + "kind": 4, + "name": "uArrayArray", + "type": "UInt" + }, + "type": "[UInt]" }, - "name": "optMap", - "type": "Map" - } - ], - "type": "Env" - }, - "importedEnumTypes": [ - { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum", - "uri": "testimport.uri.eth" + "kind": 18, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + "kind": 34, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" }, { - "constants": [ - "STRING", - "BYTES" - ], - "kind": 520, - "namespace": "TestImport", - "nativeType": "Enum", - "type": "TestImport_Enum_Return", - "uri": "testimport.uri.eth" - } - ], - "importedEnvTypes": [ + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "TestImport_Object" + }, + "required": true, + "type": "TestImport_Object" + }, { - "kind": 524288, - "namespace": "TestImport", - "nativeType": "Env", - "properties": [ - { - "kind": 34, - "name": "enviroProp", - "required": true, - "scalar": { - "kind": 4, - "name": "enviroProp", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "TestImport_Env", - "uri": "testimport.uri.eth" - } - ], - "importedModuleTypes": [ + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "TestImport_Object" + }, + "type": "TestImport_Object" + }, { - "isInterface": true, - "kind": 256, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "u", - "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" - }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "scalar": { - "kind": 4, - "name": "uArrayArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "TestImport_Object" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_Object" - }, - "required": true, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_Object]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_Object" - }, - "type": "[TestImport_Object]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[TestImport_Object]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "env": { - "required": true - }, - "kind": 64, - "name": "importedMethod", + "array": { + "item": { + "kind": 8192, + "name": "objectArray", "required": true, - "return": { - "kind": 34, - "name": "importedMethod", - "object": { - "kind": 8192, - "name": "importedMethod", - "type": "TestImport_Object" - }, - "type": "TestImport_Object" - }, - "type": "Method" + "type": "TestImport_Object" }, - { - "arguments": [ - { - "array": { - "item": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "kind": 18, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "arg", - "required": true, - "type": "[String]" - } - ], - "kind": 64, - "name": "anotherMethod", + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", "required": true, - "return": { - "kind": 34, - "name": "anotherMethod", - "required": true, - "scalar": { - "kind": 4, - "name": "anotherMethod", - "required": true, - "type": "Int32" - }, - "type": "Int32" - }, - "type": "Method" + "type": "TestImport_Object" }, - { - "arguments": [ - { - "kind": 34, - "name": "arg", - "required": true, - "scalar": { - "kind": 4, - "name": "arg", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "kind": 64, - "name": "returnsArrayOfEnums", - "required": true, - "return": { - "array": { - "enum": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "item": { - "kind": 16384, - "name": "returnsArrayOfEnums", - "type": "TestImport_Enum_Return" - }, - "kind": 18, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "kind": 34, - "name": "returnsArrayOfEnums", - "required": true, - "type": "[TestImport_Enum_Return]" - }, - "type": "Method" - } - ], - "namespace": "TestImport", - "nativeType": "Module", - "type": "TestImport_Module", - "uri": "testimport.uri.eth" - } - ], - "importedObjectTypes": [ + "required": true, + "type": "[TestImport_Object]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[TestImport_Object]" + }, { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "Object", - "properties": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "TestImport_AnotherObject" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "TestImport_AnotherObject" - }, - "type": "TestImport_AnotherObject" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "TestImport_AnotherObject" - }, - "required": true, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[TestImport_AnotherObject]" + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_Object" }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "TestImport_AnotherObject" - }, - "type": "[TestImport_AnotherObject]" - }, - "kind": 34, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, "name": "optObjectArray", - "type": "[TestImport_AnotherObject]" + "type": "TestImport_Object" }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "en", + "type": "[TestImport_Object]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[TestImport_Object]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "optEnum", + "type": "TestImport_Enum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", "required": true, "type": "TestImport_Enum" }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "TestImport_Enum" - }, - "kind": 34, - "name": "optEnum", - "type": "TestImport_Enum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[TestImport_Enum]" - }, - "kind": 34, + "item": { + "kind": 16384, "name": "enumArray", "required": true, - "type": "[TestImport_Enum]" + "type": "TestImport_Enum" }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "TestImport_Enum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[TestImport_Enum]" - }, - "kind": 34, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + { + "array": { + "enum": { + "kind": 16384, "name": "optEnumArray", - "type": "[TestImport_Enum]" - } - ], - "type": "TestImport_Object", - "uri": "testimport.uri.eth" + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + } + ], + "env": { + "required": true + }, + "kind": 64, + "name": "importedMethod", + "required": true, + "return": { + "kind": 34, + "name": "importedMethod", + "object": { + "kind": 8192, + "name": "importedMethod", + "type": "TestImport_Object" }, + "type": "TestImport_Object" + }, + "type": "Method" + }, + { + "arguments": [ { - "kind": 1025, - "namespace": "TestImport", - "nativeType": "AnotherObject", - "properties": [ - { - "kind": 34, - "name": "prop", + "array": { + "item": { + "kind": 4, + "name": "arg", "required": true, - "scalar": { - "kind": 4, - "name": "prop", - "required": true, - "type": "String" - }, "type": "String" - } - ], - "type": "TestImport_AnotherObject", - "uri": "testimport.uri.eth" + }, + "kind": 18, + "name": "arg", + "required": true, + "scalar": { + "kind": 4, + "name": "arg", + "required": true, + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "arg", + "required": true, + "type": "[String]" } ], - "interfaceTypes": [ + "kind": 64, + "name": "anotherMethod", + "required": true, + "return": { + "kind": 34, + "name": "anotherMethod", + "required": true, + "scalar": { + "kind": 4, + "name": "anotherMethod", + "required": true, + "type": "Int32" + }, + "type": "Int32" + }, + "type": "Method" + }, + { + "arguments": [ { - "capabilities": { - "getImplementations": { - "enabled": true - } + "kind": 34, + "name": "arg", + "required": true, + "scalar": { + "kind": 4, + "name": "arg", + "required": true, + "type": "String" }, - "kind": 32768, - "namespace": "TestImport", - "nativeType": "Interface", - "type": "TestImport", - "uri": "testimport.uri.eth" + "type": "String" } ], - "moduleType": { - "imports": [ - { - "type": "TestImport_Module" + "kind": 64, + "name": "returnsArrayOfEnums", + "required": true, + "return": { + "array": { + "enum": { + "kind": 16384, + "name": "returnsArrayOfEnums", + "type": "TestImport_Enum_Return" }, - { - "type": "TestImport_Object" + "item": { + "kind": 16384, + "name": "returnsArrayOfEnums", + "type": "TestImport_Enum_Return" }, - { - "type": "TestImport_AnotherObject" + "kind": 18, + "name": "returnsArrayOfEnums", + "required": true, + "type": "[TestImport_Enum_Return]" + }, + "kind": 34, + "name": "returnsArrayOfEnums", + "required": true, + "type": "[TestImport_Enum_Return]" + }, + "type": "Method" + } + ], + "namespace": "TestImport", + "nativeType": "Module", + "type": "TestImport_Module", + "uri": "testimport.uri.eth" + } + ], + "importedObjectTypes": [ + { + "kind": 1025, + "namespace": "TestImport", + "nativeType": "Object", + "properties": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "TestImport_AnotherObject" + }, + "required": true, + "type": "TestImport_AnotherObject" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "TestImport_AnotherObject" + }, + "type": "TestImport_AnotherObject" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_AnotherObject" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "TestImport_AnotherObject" + }, + "required": true, + "type": "[TestImport_AnotherObject]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[TestImport_AnotherObject]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_AnotherObject" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "TestImport_AnotherObject" + }, + "type": "[TestImport_AnotherObject]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[TestImport_AnotherObject]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "TestImport_Enum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "TestImport_Enum" + }, + "kind": 34, + "name": "optEnum", + "type": "TestImport_Enum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[TestImport_Enum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "TestImport_Enum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[TestImport_Enum]" + } + ], + "type": "TestImport_Object", + "uri": "testimport.uri.eth" + }, + { + "kind": 1025, + "namespace": "TestImport", + "nativeType": "AnotherObject", + "properties": [ + { + "kind": 34, + "name": "prop", + "required": true, + "scalar": { + "kind": 4, + "name": "prop", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "TestImport_AnotherObject", + "uri": "testimport.uri.eth" + } + ], + "interfaceTypes": [ + { + "capabilities": { + "getImplementations": { + "enabled": true + } + }, + "kind": 32768, + "namespace": "TestImport", + "nativeType": "Interface", + "type": "TestImport", + "uri": "testimport.uri.eth" + } + ], + "moduleType": { + "imports": [ + { + "type": "TestImport_Module" + }, + { + "type": "TestImport_Object" + }, + { + "type": "TestImport_AnotherObject" + }, + { + "type": "TestImport_Enum" + }, + { + "type": "TestImport_Enum_Return" + } + ], + "kind": 128, + "methods": [ + { + "arguments": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "CustomEnum" + }, + "kind": 34, + "name": "optEnum", + "type": "CustomEnum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" }, - { - "type": "TestImport_Enum" + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" }, - { - "type": "TestImport_Enum_Return" + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "map", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "map", + "required": true, + "scalar": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" } - ], - "kind": 128, - "methods": [ - { - "arguments": [ - { - "kind": 34, - "name": "str", - "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "map": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>", - "value": { - "key": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfMap", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "mapOfMap", - "required": true, - "type": "Int" - } - } - }, - "name": "mapOfMap", - "required": true, - "type": "Map>" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } - }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" - } - ], - "kind": 64, - "name": "moduleMethod", + }, + "name": "map", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", "required": true, - "return": { - "kind": 34, - "name": "moduleMethod", + "scalar": { + "kind": 4, + "name": "mapOfArr", "required": true, - "scalar": { - "kind": 4, - "name": "moduleMethod", - "required": true, - "type": "Int" - }, "type": "Int" }, - "type": "Method" + "type": "[Int]" }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": true + "key": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArr", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" }, - "kind": 64, - "name": "objectMethod", + "kind": 18, + "name": "mapOfArr", "required": true, - "return": { - "kind": 34, - "name": "objectMethod", - "object": { - "kind": 8192, - "name": "objectMethod", - "type": "AnotherType" - }, - "type": "AnotherType" + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" }, - "type": "Method" + "type": "[Int]" + } + }, + "name": "mapOfArr", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" }, - { - "arguments": [ - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - } - ], - "env": { - "required": false + "kind": 262146, + "map": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" }, - "kind": 64, - "name": "optionalEnvMethod", + "kind": 262146, + "name": "mapOfMap", "required": true, - "return": { - "kind": 34, - "name": "optionalEnvMethod", - "object": { - "kind": 8192, - "name": "optionalEnvMethod", - "type": "AnotherType" - }, + "scalar": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + } + }, + "name": "mapOfMap", + "required": true, + "type": "Map>", + "value": { + "key": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfMap", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "mapOfMap", + "required": true, + "type": "Int" + } + } + }, + "name": "mapOfMap", + "required": true, + "type": "Map>" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfObj", + "object": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + } + }, + "name": "mapOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, "type": "AnotherType" }, - "type": "Method" + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" }, - { - "arguments": [ - { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, - "required": true, - "type": "else" - } - ], - "kind": 64, - "name": "if", + "key": { + "kind": 4, + "name": "mapOfArrOfObj", "required": true, - "return": { - "kind": 34, - "name": "if", - "object": { - "kind": 8192, - "name": "if", - "required": true, - "type": "else" - }, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", "required": true, - "type": "else" + "type": "AnotherType" }, - "type": "Method" + "required": true, + "type": "[AnotherType]" } - ], - "type": "Module" + }, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map" + } + ], + "kind": 64, + "name": "moduleMethod", + "required": true, + "return": { + "kind": 34, + "name": "moduleMethod", + "required": true, + "scalar": { + "kind": 4, + "name": "moduleMethod", + "required": true, + "type": "Int" }, - "objectTypes": [ - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "str", + "type": "Int" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + } + ], + "env": { + "required": true + }, + "kind": 64, + "name": "objectMethod", + "required": true, + "return": { + "kind": 34, + "name": "objectMethod", + "object": { + "kind": 8192, + "name": "objectMethod", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + } + ], + "env": { + "required": false + }, + "kind": 64, + "name": "optionalEnvMethod", + "required": true, + "return": { + "kind": 34, + "name": "optionalEnvMethod", + "object": { + "kind": 8192, + "name": "optionalEnvMethod", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + "type": "Method" + }, + { + "arguments": [ + { + "kind": 34, + "name": "if", + "object": { + "kind": 8192, + "name": "if", + "required": true, + "type": "else" + }, + "required": true, + "type": "else" + } + ], + "kind": 64, + "name": "if", + "required": true, + "return": { + "kind": 34, + "name": "if", + "object": { + "kind": 8192, + "name": "if", + "required": true, + "type": "else" + }, + "required": true, + "type": "else" + }, + "type": "Method" + } + ], + "type": "Module" + }, + "objectTypes": [ + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "str", + "required": true, + "scalar": { + "kind": 4, + "name": "str", + "required": true, + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "optStr", + "scalar": { + "kind": 4, + "name": "optStr", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "u", + "required": true, + "scalar": { + "kind": 4, + "name": "u", + "required": true, + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "optU", + "scalar": { + "kind": 4, + "name": "optU", + "type": "UInt" + }, + "type": "UInt" + }, + { + "kind": 34, + "name": "u8", + "required": true, + "scalar": { + "kind": 4, + "name": "u8", + "required": true, + "type": "UInt8" + }, + "type": "UInt8" + }, + { + "kind": 34, + "name": "u16", + "required": true, + "scalar": { + "kind": 4, + "name": "u16", + "required": true, + "type": "UInt16" + }, + "type": "UInt16" + }, + { + "kind": 34, + "name": "u32", + "required": true, + "scalar": { + "kind": 4, + "name": "u32", + "required": true, + "type": "UInt32" + }, + "type": "UInt32" + }, + { + "kind": 34, + "name": "i", + "required": true, + "scalar": { + "kind": 4, + "name": "i", + "required": true, + "type": "Int" + }, + "type": "Int" + }, + { + "kind": 34, + "name": "i8", + "required": true, + "scalar": { + "kind": 4, + "name": "i8", + "required": true, + "type": "Int8" + }, + "type": "Int8" + }, + { + "kind": 34, + "name": "i16", + "required": true, + "scalar": { + "kind": 4, + "name": "i16", + "required": true, + "type": "Int16" + }, + "type": "Int16" + }, + { + "kind": 34, + "name": "i32", + "required": true, + "scalar": { + "kind": 4, + "name": "i32", + "required": true, + "type": "Int32" + }, + "type": "Int32" + }, + { + "kind": 34, + "name": "bigint", + "required": true, + "scalar": { + "kind": 4, + "name": "bigint", + "required": true, + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "optBigint", + "scalar": { + "kind": 4, + "name": "optBigint", + "type": "BigInt" + }, + "type": "BigInt" + }, + { + "kind": 34, + "name": "bignumber", + "required": true, + "scalar": { + "kind": 4, + "name": "bignumber", + "required": true, + "type": "BigNumber" + }, + "type": "BigNumber" + }, + { + "kind": 34, + "name": "optBignumber", + "scalar": { + "kind": 4, + "name": "optBignumber", + "type": "BigNumber" + }, + "type": "BigNumber" + }, + { + "kind": 34, + "name": "json", + "required": true, + "scalar": { + "kind": 4, + "name": "json", + "required": true, + "type": "JSON" + }, + "type": "JSON" + }, + { + "kind": 34, + "name": "optJson", + "scalar": { + "kind": 4, + "name": "optJson", + "type": "JSON" + }, + "type": "JSON" + }, + { + "kind": 34, + "name": "bytes", + "required": true, + "scalar": { + "kind": 4, + "name": "bytes", + "required": true, + "type": "Bytes" + }, + "type": "Bytes" + }, + { + "kind": 34, + "name": "optBytes", + "scalar": { + "kind": 4, + "name": "optBytes", + "type": "Bytes" + }, + "type": "Bytes" + }, + { + "kind": 34, + "name": "boolean", + "required": true, + "scalar": { + "kind": 4, + "name": "boolean", + "required": true, + "type": "Boolean" + }, + "type": "Boolean" + }, + { + "kind": 34, + "name": "optBoolean", + "scalar": { + "kind": 4, + "name": "optBoolean", + "type": "Boolean" + }, + "type": "Boolean" + }, + { + "array": { + "item": { + "kind": 4, + "name": "uArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "uArray", + "required": true, + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "uOptArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uOptArray", + "scalar": { + "kind": 4, + "name": "uOptArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "uOptArray", + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "optUOptArray", + "type": "UInt" + }, + "kind": 18, + "name": "optUOptArray", + "scalar": { + "kind": 4, + "name": "optUOptArray", + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 34, + "name": "optUOptArray", + "type": "[UInt]" + }, + { + "array": { + "item": { + "kind": 4, + "name": "optStrOptArray", + "type": "String" + }, + "kind": 18, + "name": "optStrOptArray", + "scalar": { + "kind": 4, + "name": "optStrOptArray", + "type": "String" + }, + "type": "[String]" + }, + "kind": 34, + "name": "optStrOptArray", + "type": "[String]" + }, + { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayArray", + "required": true, + "type": "UInt" + }, + "type": "[UInt]" + }, + "kind": 18, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + "kind": 34, + "name": "uArrayArray", + "required": true, + "type": "[[UInt]]" + }, + { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "scalar": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "scalar": { + "kind": 4, + "name": "uOptArrayOptArray", + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uOptArrayOptArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 34, + "name": "uOptArrayOptArray", + "required": true, + "type": "[[UInt32]]" + }, + { + "array": { + "array": { + "array": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", "required": true, - "scalar": { - "kind": 4, - "name": "str", - "required": true, - "type": "String" - }, - "type": "String" + "type": "UInt32" }, - { - "kind": 34, - "name": "optStr", - "scalar": { - "kind": 4, - "name": "optStr", - "type": "String" - }, - "type": "String" + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" }, - { - "kind": 34, - "name": "u", + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", "required": true, - "scalar": { - "kind": 4, - "name": "u", - "required": true, - "type": "UInt" - }, - "type": "UInt" + "type": "UInt32" }, - { - "kind": 34, - "name": "optU", - "scalar": { - "kind": 4, - "name": "optU", - "type": "UInt" - }, - "type": "UInt" + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" }, - { - "kind": 34, - "name": "u8", + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", "required": true, - "scalar": { - "kind": 4, - "name": "u8", - "required": true, - "type": "UInt8" - }, - "type": "UInt8" + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "item": { + "item": { + "kind": 4, + "name": "uArrayOptArrayArray", + "required": true, + "type": "UInt32" }, - { - "kind": 34, - "name": "u16", + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "scalar": { + "kind": 4, + "name": "uArrayOptArrayArray", "required": true, - "scalar": { + "type": "UInt32" + }, + "type": "[UInt32]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "uArrayOptArrayArray", + "required": true, + "type": "[[[UInt32]]]" + }, + "kind": 34, + "name": "uArrayOptArrayArray", + "required": true, + "type": "[[[UInt32]]]" + }, + { + "array": { + "array": { + "array": { + "array": { + "item": { "kind": 4, - "name": "u16", + "name": "crazyArray", "required": true, - "type": "UInt16" + "type": "UInt32" }, - "type": "UInt16" - }, - { - "kind": 34, - "name": "u32", - "required": true, + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "u32", + "name": "crazyArray", "required": true, "type": "UInt32" }, - "type": "UInt32" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "i", - "required": true, - "scalar": { + "item": { + "item": { "kind": 4, - "name": "i", + "name": "crazyArray", "required": true, - "type": "Int" + "type": "UInt32" }, - "type": "Int" - }, - { - "kind": 34, - "name": "i8", - "required": true, + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "i8", + "name": "crazyArray", "required": true, - "type": "Int8" + "type": "UInt32" }, - "type": "Int8" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "i16", - "required": true, - "scalar": { + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { "kind": 4, - "name": "i16", + "name": "crazyArray", "required": true, - "type": "Int16" + "type": "UInt32" }, - "type": "Int16" - }, - { - "kind": 34, - "name": "i32", - "required": true, + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "i32", + "name": "crazyArray", "required": true, - "type": "Int32" + "type": "UInt32" }, - "type": "Int32" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "bigint", - "required": true, - "scalar": { + "item": { + "item": { "kind": 4, - "name": "bigint", + "name": "crazyArray", "required": true, - "type": "BigInt" + "type": "UInt32" }, - "type": "BigInt" - }, - { - "kind": 34, - "name": "optBigint", + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "optBigint", - "type": "BigInt" + "name": "crazyArray", + "required": true, + "type": "UInt32" }, - "type": "BigInt" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "bignumber", - "required": true, - "scalar": { + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "crazyArray", + "type": "[[[UInt32]]]" + }, + "item": { + "array": { + "array": { + "item": { "kind": 4, - "name": "bignumber", + "name": "crazyArray", "required": true, - "type": "BigNumber" + "type": "UInt32" }, - "type": "BigNumber" - }, - { - "kind": 34, - "name": "optBignumber", + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "optBignumber", - "type": "BigNumber" + "name": "crazyArray", + "required": true, + "type": "UInt32" }, - "type": "BigNumber" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "json", - "required": true, - "scalar": { + "item": { + "item": { "kind": 4, - "name": "json", + "name": "crazyArray", "required": true, - "type": "JSON" + "type": "UInt32" }, - "type": "JSON" - }, - { - "kind": 34, - "name": "optJson", + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "optJson", - "type": "JSON" + "name": "crazyArray", + "required": true, + "type": "UInt32" }, - "type": "JSON" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "bytes", - "required": true, - "scalar": { + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "item": { + "array": { + "item": { "kind": 4, - "name": "bytes", + "name": "crazyArray", "required": true, - "type": "Bytes" + "type": "UInt32" }, - "type": "Bytes" - }, - { - "kind": 34, - "name": "optBytes", + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "optBytes", - "type": "Bytes" + "name": "crazyArray", + "required": true, + "type": "UInt32" }, - "type": "Bytes" + "type": "[UInt32]" }, - { - "kind": 34, - "name": "boolean", - "required": true, - "scalar": { + "item": { + "item": { "kind": 4, - "name": "boolean", + "name": "crazyArray", "required": true, - "type": "Boolean" + "type": "UInt32" }, - "type": "Boolean" - }, - { - "kind": 34, - "name": "optBoolean", + "kind": 18, + "name": "crazyArray", "scalar": { "kind": 4, - "name": "optBoolean", - "type": "Boolean" - }, - "type": "Boolean" - }, - { - "array": { - "item": { - "kind": 4, - "name": "uArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "uArray", - "required": true, - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "uOptArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uOptArray", - "scalar": { - "kind": 4, - "name": "uOptArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "uOptArray", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "optUOptArray", - "type": "UInt" - }, - "kind": 18, - "name": "optUOptArray", - "scalar": { - "kind": 4, - "name": "optUOptArray", - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 34, - "name": "optUOptArray", - "type": "[UInt]" - }, - { - "array": { - "item": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "kind": 18, - "name": "optStrOptArray", - "scalar": { - "kind": 4, - "name": "optStrOptArray", - "type": "String" - }, - "type": "[String]" - }, - "kind": 34, - "name": "optStrOptArray", - "type": "[String]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayArray", - "required": true, - "type": "UInt" - }, - "type": "[UInt]" - }, - "kind": 18, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - "kind": 34, - "name": "uArrayArray", - "required": true, - "type": "[[UInt]]" - }, - { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "scalar": { - "kind": 4, - "name": "uOptArrayOptArray", - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 34, - "name": "uOptArrayOptArray", - "required": true, - "type": "[[UInt32]]" - }, - { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "scalar": { - "kind": 4, - "name": "uArrayOptArrayArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - "kind": 34, - "name": "uArrayOptArrayArray", - "required": true, - "type": "[[[UInt32]]]" - }, - { - "array": { - "array": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "item": { - "array": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "item": { - "array": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "item": { - "item": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "kind": 18, - "name": "crazyArray", - "scalar": { - "kind": 4, - "name": "crazyArray", - "required": true, - "type": "UInt32" - }, - "type": "[UInt32]" - }, - "kind": 18, - "name": "crazyArray", - "required": true, - "type": "[[UInt32]]" - }, - "kind": 18, - "name": "crazyArray", - "type": "[[[UInt32]]]" - }, - "kind": 18, "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - "kind": 34, - "name": "crazyArray", - "type": "[[[[UInt32]]]]" - }, - { - "kind": 34, - "name": "object", - "object": { - "kind": 8192, - "name": "object", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "AnotherType" - }, - { - "kind": 34, - "name": "optObject", - "object": { - "kind": 8192, - "name": "optObject", - "type": "AnotherType" - }, - "type": "AnotherType" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "objectArray", - "object": { - "kind": 8192, - "name": "objectArray", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "objectArray", - "required": true, - "type": "[AnotherType]" - }, - { - "array": { - "item": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "kind": 18, - "name": "optObjectArray", - "object": { - "kind": 8192, - "name": "optObjectArray", - "type": "AnotherType" - }, - "type": "[AnotherType]" - }, - "kind": 34, - "name": "optObjectArray", - "type": "[AnotherType]" - }, - { - "enum": { - "kind": 16384, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - "kind": 34, - "name": "en", - "required": true, - "type": "CustomEnum" - }, - { - "enum": { - "kind": 16384, - "name": "optEnum", - "type": "CustomEnum" - }, - "kind": 34, - "name": "optEnum", - "type": "CustomEnum" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "enumArray", - "required": true, - "type": "CustomEnum" - }, - "kind": 18, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "enumArray", - "required": true, - "type": "[CustomEnum]" - }, - { - "array": { - "enum": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "item": { - "kind": 16384, - "name": "optEnumArray", - "type": "CustomEnum" - }, - "kind": 18, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - "kind": 34, - "name": "optEnumArray", - "type": "[CustomEnum]" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "map", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "map", - "required": true, - "scalar": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - }, - "type": "Map", - "value": { - "kind": 4, - "name": "map", - "required": true, - "type": "Int" - } - }, - "name": "map", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - }, - "key": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArr", - "required": true, - "type": "Map", - "value": { - "item": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "kind": 18, - "name": "mapOfArr", - "required": true, - "scalar": { - "kind": 4, - "name": "mapOfArr", - "required": true, - "type": "Int" - }, - "type": "[Int]" - } - }, - "name": "mapOfArr", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfObj", - "object": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapOfObj", - "required": true, - "type": "AnotherType" - } - }, - "name": "mapOfObj", - "required": true, - "type": "Map" - }, - { - "kind": 34, - "map": { - "array": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - }, - "key": { - "kind": 4, - "name": "mapOfArrOfObj", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapOfArrOfObj", "required": true, - "type": "Map", - "value": { - "item": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "kind": 18, - "name": "mapOfArrOfObj", - "object": { - "kind": 8192, - "name": "mapOfArrOfObj", - "required": true, - "type": "AnotherType" - }, - "required": true, - "type": "[AnotherType]" - } + "type": "UInt32" }, - "name": "mapOfArrOfObj", - "required": true, - "type": "Map" + "type": "[UInt32]" }, - { - "kind": 34, - "map": { - "key": { - "kind": 4, - "name": "mapCustomValue", - "required": true, - "type": "String" - }, - "kind": 262146, - "name": "mapCustomValue", - "object": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - }, - "required": true, - "type": "Map", - "value": { - "kind": 8192, - "name": "mapCustomValue", - "type": "CustomMapValue" - } - }, - "name": "mapCustomValue", - "required": true, - "type": "Map" - } - ], - "type": "CustomType" + "kind": 18, + "name": "crazyArray", + "required": true, + "type": "[[UInt32]]" + }, + "kind": 18, + "name": "crazyArray", + "type": "[[[UInt32]]]" }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "prop", - "scalar": { - "kind": 4, - "name": "prop", - "type": "String" - }, - "type": "String" - }, - { - "kind": 34, - "name": "circular", - "object": { - "kind": 8192, - "name": "circular", - "type": "CustomType" - }, - "type": "CustomType" - }, - { - "kind": 34, - "name": "const", - "scalar": { - "kind": 4, - "name": "const", - "type": "String" - }, - "type": "String" - } - ], + "kind": 18, + "name": "crazyArray", + "type": "[[[[UInt32]]]]" + }, + "kind": 34, + "name": "crazyArray", + "type": "[[[[UInt32]]]]" + }, + { + "kind": 34, + "name": "object", + "object": { + "kind": 8192, + "name": "object", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "AnotherType" + }, + { + "kind": 34, + "name": "optObject", + "object": { + "kind": 8192, + "name": "optObject", + "type": "AnotherType" + }, + "type": "AnotherType" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "objectArray", + "required": true, "type": "AnotherType" }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "foo", - "required": true, - "scalar": { - "kind": 4, - "name": "foo", - "required": true, - "type": "String" - }, - "type": "String" - } - ], + "kind": 18, + "name": "objectArray", + "object": { + "kind": 8192, + "name": "objectArray", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "objectArray", + "required": true, + "type": "[AnotherType]" + }, + { + "array": { + "item": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "kind": 18, + "name": "optObjectArray", + "object": { + "kind": 8192, + "name": "optObjectArray", + "type": "AnotherType" + }, + "type": "[AnotherType]" + }, + "kind": 34, + "name": "optObjectArray", + "type": "[AnotherType]" + }, + { + "enum": { + "kind": 16384, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + "kind": 34, + "name": "en", + "required": true, + "type": "CustomEnum" + }, + { + "enum": { + "kind": 16384, + "name": "optEnum", + "type": "CustomEnum" + }, + "kind": 34, + "name": "optEnum", + "type": "CustomEnum" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "enumArray", + "required": true, + "type": "CustomEnum" + }, + "kind": 18, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "enumArray", + "required": true, + "type": "[CustomEnum]" + }, + { + "array": { + "enum": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "item": { + "kind": 16384, + "name": "optEnumArray", + "type": "CustomEnum" + }, + "kind": 18, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + "kind": 34, + "name": "optEnumArray", + "type": "[CustomEnum]" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "map", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "map", + "required": true, + "scalar": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + }, + "type": "Map", + "value": { + "kind": 4, + "name": "map", + "required": true, + "type": "Int" + } + }, + "name": "map", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + }, + "key": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArr", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "kind": 18, + "name": "mapOfArr", + "required": true, + "scalar": { + "kind": 4, + "name": "mapOfArr", + "required": true, + "type": "Int" + }, + "type": "[Int]" + } + }, + "name": "mapOfArr", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfObj", + "object": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapOfObj", + "required": true, + "type": "AnotherType" + } + }, + "name": "mapOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "array": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + }, + "key": { + "kind": 4, + "name": "mapOfArrOfObj", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map", + "value": { + "item": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "kind": 18, + "name": "mapOfArrOfObj", + "object": { + "kind": 8192, + "name": "mapOfArrOfObj", + "required": true, + "type": "AnotherType" + }, + "required": true, + "type": "[AnotherType]" + } + }, + "name": "mapOfArrOfObj", + "required": true, + "type": "Map" + }, + { + "kind": 34, + "map": { + "key": { + "kind": 4, + "name": "mapCustomValue", + "required": true, + "type": "String" + }, + "kind": 262146, + "name": "mapCustomValue", + "object": { + "kind": 8192, + "name": "mapCustomValue", "type": "CustomMapValue" }, - { - "kind": 1, - "properties": [ - { - "kind": 34, - "name": "else", - "required": true, - "scalar": { - "kind": 4, - "name": "else", - "required": true, - "type": "String" - }, - "type": "String" - } - ], - "type": "else" + "required": true, + "type": "Map", + "value": { + "kind": 8192, + "name": "mapCustomValue", + "type": "CustomMapValue" } - ], - "version": "0.1" - })) - .unwrap(), + }, + "name": "mapCustomValue", + "required": true, + "type": "Map" + } + ], + "type": "CustomType" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "prop", + "scalar": { + "kind": 4, + "name": "prop", + "type": "String" + }, + "type": "String" + }, + { + "kind": 34, + "name": "circular", + "object": { + "kind": 8192, + "name": "circular", + "type": "CustomType" + }, + "type": "CustomType" + }, + { + "kind": 34, + "name": "const", + "scalar": { + "kind": 4, + "name": "const", + "type": "String" + }, + "type": "String" + } + ], + "type": "AnotherType" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "foo", + "required": true, + "scalar": { + "kind": 4, + "name": "foo", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "CustomMapValue" + }, + { + "kind": 1, + "properties": [ + { + "kind": 34, + "name": "else", + "required": true, + "scalar": { + "kind": 4, + "name": "else", + "required": true, + "type": "String" + }, + "type": "String" + } + ], + "type": "else" } + ], + "version": "0.1" +})).unwrap() + } } From 5af642b9e959403b1c0984b22b9a89ae09ea4c06 Mon Sep 17 00:00:00 2001 From: namesty Date: Tue, 22 Nov 2022 00:24:52 +0100 Subject: [PATCH 3/8] (chore): updated plugin macro names --- .../src/bindings/rust/plugin/templates/module-rs.mustache | 6 +++--- .../test-cases/cases/bind/sanity/output/plugin-rs/module.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache index b26554d41f..914af20e4c 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -6,12 +6,12 @@ use polywrap_core::{error::Error, invoke::Invoker}; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; -pub use polywrap_plugin::base_impl_plugin_module; +pub use polywrap_plugin::impl_plugin_traits; #[macro_export] -macro_rules! impl_plugin_module { +macro_rules! impl_traits { ($plugin_type:ty) => { - $crate::wrap::module::base_impl_plugin_module!( + $crate::wrap::module::impl_plugin_traits!( $plugin_type, {{#moduleType}} {{#methods}} diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs index 809df91315..2f87ae99b7 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -6,12 +6,12 @@ use polywrap_core::{error::Error, invoke::Invoker}; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; -pub use polywrap_plugin::base_impl_plugin_module; +pub use polywrap_plugin::base_impl_plugin_traits; #[macro_export] -macro_rules! impl_plugin_module { +macro_rules! impl_traits { ($plugin_type:ty) => { - $crate::wrap::module::base_impl_plugin_module!( + $crate::wrap::module::base_impl_plugin_traits!( $plugin_type, (module_method, $crate::wrap::module::ArgsModuleMethod), (object_method, $crate::wrap::module::ArgsObjectMethod), From 46ef559579c5ce0399451d5eb7d10b5531751255 Mon Sep 17 00:00:00 2001 From: namesty Date: Tue, 22 Nov 2022 01:32:50 +0100 Subject: [PATCH 4/8] (chore): updated bindings for imported modules --- .../rust/plugin/templates/types-rs.mustache | 98 ++++++++++++++++--- .../bind/sanity/output/plugin-rs/module.rs | 4 +- .../bind/sanity/output/plugin-rs/types.rs | 35 ++++--- 3 files changed, 112 insertions(+), 25 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache index 48dd498bfe..6345c546b0 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -6,27 +6,32 @@ use bigdecimal::BigDecimal as BigNumber; use serde_json as JSON; use std::collections::BTreeMap as Map; -// OBJECT -{{#objectTypes}} +/// Env START /// + +{{#envType}} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { {{#properties}} {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, {{/properties}} } -{{/objectTypes}} +{{/envType}} +/// Env END /// -// ENV -{{#envType}} +/// Objects START /// + +{{#objectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { {{#properties}} {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, {{/properties}} } -{{/envType}} +{{/objectTypes}} +/// Objects END /// + +/// Enums START /// -// ENUM {{#enumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { @@ -36,8 +41,10 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { _MAX_ } {{/enumTypes}} +/// Enums END /// + +/// Imported objects START /// -// Imported OBJECT {{#importedObjectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { @@ -46,8 +53,10 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedObjectTypes}} +/// Imported objects END /// + +/// Imported envs START /// -// Imported ENV {{#importedEnvType}} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { @@ -56,8 +65,10 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedEnvType}} +/// Imported envs END /// + +/// Imported enums START /// -// Imported ENUM {{#importedEnumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { @@ -66,4 +77,69 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { {{/constants}} _MAX_ } -{{/importedEnumTypes}} \ No newline at end of file +{{/importedEnumTypes}} +/// Imported enums END /// + +/// Imported Modules START /// + +{{#importedModuleTypes}} +{{^isInterface}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {} + +impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + pub const URI: &'static str = "{{uri}}"; + + pub fn new() -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { + {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {} + } + + {{#methods}} + pub fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + let uri = {{#parent}}{{#toUpper}}{{type}}{{/toUpper}}{{/parent}}::URI; + let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; + let result = subinvoke::wrap_subinvoke( + uri, + "{{name}}", + args, + )?; + deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) + } + {{^last}} + + {{/last}} + {{/methods}} +} +{{/isInterface}} +{{#isInterface}} +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a> { + {{#isInterface}}uri: &'a str{{/isInterface}} +} + +impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a> { + pub const INTERFACE_URI: &'static str = "{{uri}}"; + + pub fn new(uri: &'a str) -> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a> { + {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { uri: uri } + } + + {{#methods}} + pub fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + let uri = self.uri; + let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; + let result = subinvoke::wrap_subinvoke( + uri, + "{{name}}", + args, + )?; + deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) + } + {{^last}} + + {{/last}} + {{/methods}} +} +{{/isInterface}} +{{/importedModuleTypes}} +/// Imported Modules END /// \ No newline at end of file diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs index 2f87ae99b7..3fd0bd8894 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -6,12 +6,12 @@ use polywrap_core::{error::Error, invoke::Invoker}; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; -pub use polywrap_plugin::base_impl_plugin_traits; +pub use polywrap_plugin::impl_plugin_traits; #[macro_export] macro_rules! impl_traits { ($plugin_type:ty) => { - $crate::wrap::module::base_impl_plugin_traits!( + $crate::wrap::module::impl_plugin_traits!( $plugin_type, (module_method, $crate::wrap::module::ArgsModuleMethod), (object_method, $crate::wrap::module::ArgsObjectMethod), diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs index 94519a1640..df9fbc6524 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs @@ -6,7 +6,18 @@ use bigdecimal::BigDecimal as BigNumber; use serde_json as JSON; use std::collections::BTreeMap as Map; -// OBJECT +/// Env START /// + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct Env { + pub prop: String, + pub opt_prop: Option, + pub opt_map: Option>>, +} +/// Env END /// + +/// Objects START /// + #[derive(Clone, Debug, Deserialize, Serialize)] pub struct CustomType { pub str: String, @@ -68,16 +79,10 @@ pub struct Else { #[serde(rename = "else")] pub _else: String, } +/// Objects END /// -// ENV -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Env { - pub prop: String, - pub opt_prop: Option, - pub opt_map: Option>>, -} +/// Enums START /// -// ENUM #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum CustomEnum { STRING, @@ -90,8 +95,10 @@ pub enum While { _in, _MAX_ } +/// Enums END /// + +/// Imported objects START /// -// Imported OBJECT #[derive(Clone, Debug, Deserialize, Serialize)] pub struct TestImportObject { pub object: TestImportAnotherObject, @@ -107,10 +114,13 @@ pub struct TestImportObject { pub struct TestImportAnotherObject { pub prop: String, } +/// Imported objects END /// + +/// Imported envs START /// +/// Imported envs END /// -// Imported ENV +/// Imported enums START /// -// Imported ENUM #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum TestImportEnum { STRING, @@ -123,3 +133,4 @@ pub enum TestImportEnumReturn { BYTES, _MAX_ } +/// Imported enums END /// \ No newline at end of file From 308878defa8179b20825f3427abbf43a085844b2 Mon Sep 17 00:00:00 2001 From: namesty Date: Wed, 23 Nov 2022 11:28:38 +0100 Subject: [PATCH 5/8] (chore): importing and namespacing modules and args --- .../rust/plugin/templates/module-rs.mustache | 4 +- .../rust/plugin/templates/types-rs.mustache | 81 ++++++++++++------- 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache index 914af20e4c..5707f58f12 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -6,6 +6,7 @@ use polywrap_core::{error::Error, invoke::Invoker}; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; +use async_trait::async_trait; pub use polywrap_plugin::impl_plugin_traits; #[macro_export] @@ -33,10 +34,11 @@ pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { {{/methods}} {{/moduleType}} +#[async_trait] pub trait Module: PluginModule { {{#moduleType}} {{#methods}} - fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(&mut self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; + async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(&mut self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; {{^last}} {{/last}} diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache index 6345c546b0..c8e3f4b9fe 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -1,12 +1,20 @@ -/// NOTE: This is an auto-generated file. -/// All modifications will be overwritten. +#![allow(unused_imports)] +#![allow(non_camel_case_types)] + +// NOTE: This is an auto-generated file. +// All modifications will be overwritten. use serde::{Serialize, Deserialize}; use num_bigint::BigInt; use bigdecimal::BigDecimal as BigNumber; use serde_json as JSON; use std::collections::BTreeMap as Map; +{{#importedModuleTypes}} +use std::sync::Arc; +use polywrap_msgpack::{decode, serialize}; +use polywrap_core::{error::Error, invoke::{Invoker, InvokeArgs}, uri::Uri}; +{{/importedModuleTypes}} -/// Env START /// +// Env START // {{#envType}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -16,9 +24,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/envType}} -/// Env END /// +// Env END // -/// Objects START /// +// Objects START // {{#objectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -28,9 +36,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/objectTypes}} -/// Objects END /// +// Objects END // -/// Enums START /// +// Enums START // {{#enumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] @@ -41,9 +49,9 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { _MAX_ } {{/enumTypes}} -/// Enums END /// +// Enums END // -/// Imported objects START /// +// Imported objects START // {{#importedObjectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -53,9 +61,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedObjectTypes}} -/// Imported objects END /// +// Imported objects END // -/// Imported envs START /// +// Imported envs START // {{#importedEnvType}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -65,9 +73,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedEnvType}} -/// Imported envs END /// +// Imported envs END // -/// Imported enums START /// +// Imported enums START // {{#importedEnumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] @@ -78,11 +86,21 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { _MAX_ } {{/importedEnumTypes}} -/// Imported enums END /// +// Imported enums END // -/// Imported Modules START /// +// Imported Modules START // {{#importedModuleTypes}} +{{#methods}} +// URI: "{{parent.uri}}" // +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct {{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}} { + {{#arguments}} + {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, + {{/arguments}} +} + +{{/methods}} {{^isInterface}} #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {} @@ -95,15 +113,20 @@ impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { } {{#methods}} - pub fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &{{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { let uri = {{#parent}}{{#toUpper}}{{type}}{{/toUpper}}{{/parent}}::URI; - let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( - uri, + let serialized_args = InvokeArgs::UIntArray(serialize(args).unwrap()); + let args = Some(&serialized_args); + let result = invoker.invoke( + &Uri::try_from(uri).unwrap(), "{{name}}", args, - )?; - deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) + None, + None + ).await.map_err(|e| e.to_string())?; + + Ok(Some(decode(result.as_slice()) + .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap())) } {{^last}} @@ -125,15 +148,19 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a } {{#methods}} - pub fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { let uri = self.uri; - let args = serialize_{{#toLower}}{{name}}{{/toLower}}_args(args).map_err(|e| e.to_string())?; - let result = subinvoke::wrap_subinvoke( + let args = InvokeArgs::UIntArray(serialize(args).unwrap()); + let result = invoker.invoke( uri, "{{name}}", args, - )?; - deserialize_{{#toLower}}{{name}}{{/toLower}}_result(result.as_slice()).map_err(|e| e.to_string()) + None, + None + ).await?; + + Ok(Some(decode(result.as_slice()) + .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap())) } {{^last}} @@ -142,4 +169,4 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a } {{/isInterface}} {{/importedModuleTypes}} -/// Imported Modules END /// \ No newline at end of file +// Imported Modules END // From 1365033375f928495bfd05ca3d6607b237520e80 Mon Sep 17 00:00:00 2001 From: namesty Date: Fri, 25 Nov 2022 17:39:24 +0100 Subject: [PATCH 6/8] (chore): camel-casing args names. Only add some when result optional --- .../rust/plugin/templates/module-rs.mustache | 1 + .../rust/plugin/templates/types-rs.mustache | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache index 5707f58f12..efb12c16d3 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -14,6 +14,7 @@ macro_rules! impl_traits { ($plugin_type:ty) => { $crate::wrap::module::impl_plugin_traits!( $plugin_type, + $crate::wrap::wrap_info::get_manifest(), {{#moduleType}} {{#methods}} ({{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}, $crate::wrap::module::Args{{#toUpper}}{{name}}{{/toUpper}}), diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache index c8e3f4b9fe..4b9b9246c1 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -94,7 +94,7 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { {{#methods}} // URI: "{{parent.uri}}" // #[derive(Clone, Debug, Deserialize, Serialize)] -pub struct {{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}} { +pub struct {{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}} { {{#arguments}} {{#serdeKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/serdeKeyword}}pub {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}: {{#toWasm}}{{toGraphQLType}}{{/toWasm}}, {{/arguments}} @@ -113,7 +113,7 @@ impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { } {{#methods}} - pub async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &{{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { let uri = {{#parent}}{{#toUpper}}{{type}}{{/toUpper}}{{/parent}}::URI; let serialized_args = InvokeArgs::UIntArray(serialize(args).unwrap()); let args = Some(&serialized_args); @@ -125,8 +125,8 @@ impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { None ).await.map_err(|e| e.to_string())?; - Ok(Some(decode(result.as_slice()) - .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap())) + Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice()) + .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap(){{#return}}{{^required}}){{/required}}{{/return}}) } {{^last}} @@ -148,7 +148,8 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a } {{#methods}} - pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{parent.type}}_Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + {{#return}}{{required}}{{/return}} let uri = self.uri; let args = InvokeArgs::UIntArray(serialize(args).unwrap()); let result = invoker.invoke( @@ -159,8 +160,8 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a None ).await?; - Ok(Some(decode(result.as_slice()) - .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap())) + Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice()) + .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap(){{#return}}{{^required}}){{/required}}{{/return}}) } {{^last}} From 3a8e45f4e84158000e573ced23ea443b866eeeb0 Mon Sep 17 00:00:00 2001 From: namesty Date: Wed, 7 Dec 2022 01:09:59 +0100 Subject: [PATCH 7/8] (chore): plugin bindings now using error classes --- .../rust/plugin/templates/module-rs.mustache | 5 +- .../rust/plugin/templates/types-rs.mustache | 47 ++++++++++++------- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache index efb12c16d3..fc418e4cb8 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/module-rs.mustache @@ -2,7 +2,8 @@ /// All modifications will be overwritten. use std::sync::Arc; -use polywrap_core::{error::Error, invoke::Invoker}; +use polywrap_core::invoke::Invoker; +use polywrap_plugin::error::PluginError; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; @@ -39,7 +40,7 @@ pub struct Args{{#toUpper}}{{name}}{{/toUpper}} { pub trait Module: PluginModule { {{#moduleType}} {{#methods}} - async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(&mut self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, Error>; + async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(&mut self, args: &Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, PluginError>; {{^last}} {{/last}} diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache index 4b9b9246c1..dd728138da 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -11,7 +11,8 @@ use std::collections::BTreeMap as Map; {{#importedModuleTypes}} use std::sync::Arc; use polywrap_msgpack::{decode, serialize}; -use polywrap_core::{error::Error, invoke::{Invoker, InvokeArgs}, uri::Uri}; +use polywrap_core::{invoke::{Invoker, InvokeArgs}, uri::Uri}; +use polywrap_plugin::error::PluginError; {{/importedModuleTypes}} // Env START // @@ -113,20 +114,27 @@ impl {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { } {{#methods}} - pub async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#detectKeyword}}{{#toLower}}{{name}}{{/toLower}}{{/detectKeyword}}(args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}, invoker: Arc) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, PluginError> { let uri = {{#parent}}{{#toUpper}}{{type}}{{/toUpper}}{{/parent}}::URI; - let serialized_args = InvokeArgs::UIntArray(serialize(args).unwrap()); - let args = Some(&serialized_args); + let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); + let opt_args = Some(&serialized_args); + let uri = Uri::try_from(uri).unwrap(); let result = invoker.invoke( - &Uri::try_from(uri).unwrap(), + &uri, "{{name}}", - args, + opt_args, None, None - ).await.map_err(|e| e.to_string())?; - - Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice()) - .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap(){{#return}}{{^required}}){{/required}}{{/return}}) + ) + .await + .map_err(|e| PluginError::SubinvocationError { + uri: uri.to_string(), + method: "{{name}}".to_string(), + args: serde_json::to_string(&args).unwrap(), + exception: e.to_string(), + })?; + + Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice())?{{#return}}{{^required}}){{/required}}{{/return}}) } {{^last}} @@ -148,20 +156,25 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a } {{#methods}} - pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, String> { + pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, PluginError> { {{#return}}{{required}}{{/return}} let uri = self.uri; - let args = InvokeArgs::UIntArray(serialize(args).unwrap()); + let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); let result = invoker.invoke( uri, "{{name}}", - args, + serialized_args, None, None - ).await?; - - Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice()) - .map_err(|e| Error::InvokeError(format!("Failed to decode result: {}", e))).unwrap(){{#return}}{{^required}}){{/required}}{{/return}}) + .await + .map_err(|e| PluginError::SubinvocationError { + uri: uri.to_string(), + method: "{{name}}".to_string(), + args: serde_json::to_string(&args).unwrap(), + exception: e.to_string(), + })?; + + Ok({{#return}}{{^required}}Some({{/required}}{{/return}}decode(result.as_slice())?{{#return}}{{^required}}){{/required}}{{/return}}) } {{^last}} From d510ad5e2eb27ffaf90ea93dc45ccac70ddb6d50 Mon Sep 17 00:00:00 2001 From: Cesar Date: Wed, 7 Dec 2022 16:09:23 +0100 Subject: [PATCH 8/8] chore: binding tests for rust plugins fixed --- .../rust/plugin/templates/types-rs.mustache | 35 +++--- .../bind/sanity/output/plugin-rs/module.rs | 14 ++- .../bind/sanity/output/plugin-rs/types.rs | 116 +++++++++++++++++- 3 files changed, 141 insertions(+), 24 deletions(-) diff --git a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache index dd728138da..9f4a08f780 100644 --- a/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache +++ b/packages/schema/bind/src/bindings/rust/plugin/templates/types-rs.mustache @@ -1,8 +1,8 @@ #![allow(unused_imports)] #![allow(non_camel_case_types)] -// NOTE: This is an auto-generated file. -// All modifications will be overwritten. +/// NOTE: This is an auto-generated file. +/// All modifications will be overwritten. use serde::{Serialize, Deserialize}; use num_bigint::BigInt; use bigdecimal::BigDecimal as BigNumber; @@ -15,7 +15,7 @@ use polywrap_core::{invoke::{Invoker, InvokeArgs}, uri::Uri}; use polywrap_plugin::error::PluginError; {{/importedModuleTypes}} -// Env START // +/// Env START /// {{#envType}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -25,9 +25,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/envType}} -// Env END // +/// Env END /// -// Objects START // +/// Objects START /// {{#objectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -37,9 +37,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/objectTypes}} -// Objects END // +/// Objects END /// -// Enums START // +/// Enums START /// {{#enumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] @@ -50,9 +50,9 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { _MAX_ } {{/enumTypes}} -// Enums END // +/// Enums END /// -// Imported objects START // +/// Imported objects START /// {{#importedObjectTypes}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -62,9 +62,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedObjectTypes}} -// Imported objects END // +/// Imported objects END /// -// Imported envs START // +/// Imported envs START /// {{#importedEnvType}} #[derive(Clone, Debug, Deserialize, Serialize)] @@ -74,9 +74,9 @@ pub struct {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} {{/properties}} } {{/importedEnvType}} -// Imported envs END // +/// Imported envs END /// -// Imported enums START // +/// Imported enums START /// {{#importedEnumTypes}} #[derive(Clone, Copy, Debug, Deserialize, Serialize)] @@ -87,13 +87,13 @@ pub enum {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}} { _MAX_ } {{/importedEnumTypes}} -// Imported enums END // +/// Imported enums END /// -// Imported Modules START // +/// Imported Modules START /// {{#importedModuleTypes}} {{#methods}} -// URI: "{{parent.uri}}" // +/// URI: "{{parent.uri}}" /// #[derive(Clone, Debug, Deserialize, Serialize)] pub struct {{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}} { {{#arguments}} @@ -157,7 +157,6 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a {{#methods}} pub async fn {{#toLower}}{{name}}{{/toLower}}(&self, args: &{{#toUpper}}{{parent.type}}{{/toUpper}}Args{{#toUpper}}{{name}}{{/toUpper}}) -> Result<{{#return}}{{#toWasm}}{{toGraphQLType}}{{/toWasm}}{{/return}}, PluginError> { - {{#return}}{{required}}{{/return}} let uri = self.uri; let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); let result = invoker.invoke( @@ -183,4 +182,4 @@ impl<'a> {{#detectKeyword}}{{#toUpper}}{{type}}{{/toUpper}}{{/detectKeyword}}<'a } {{/isInterface}} {{/importedModuleTypes}} -// Imported Modules END // +/// Imported Modules END /// diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs index 3fd0bd8894..dca382da71 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/module.rs @@ -2,10 +2,12 @@ /// All modifications will be overwritten. use std::sync::Arc; -use polywrap_core::{error::Error, invoke::Invoker}; +use polywrap_core::invoke::Invoker; +use polywrap_plugin::error::PluginError; use polywrap_plugin::module::PluginModule; use serde::{Serialize, Deserialize}; use super::types::*; +use async_trait::async_trait; pub use polywrap_plugin::impl_plugin_traits; #[macro_export] @@ -13,6 +15,7 @@ macro_rules! impl_traits { ($plugin_type:ty) => { $crate::wrap::module::impl_plugin_traits!( $plugin_type, + $crate::wrap::wrap_info::get_manifest(), (module_method, $crate::wrap::module::ArgsModuleMethod), (object_method, $crate::wrap::module::ArgsObjectMethod), (optional_env_method, $crate::wrap::module::ArgsOptionalEnvMethod), @@ -58,12 +61,13 @@ pub struct ArgsIf { pub _if: Else, } +#[async_trait] pub trait Module: PluginModule { - fn module_method(&mut self, args: &ArgsModuleMethod, invoker: Arc) -> Result; + async fn module_method(&mut self, args: &ArgsModuleMethod, invoker: Arc) -> Result; - fn object_method(&mut self, args: &ArgsObjectMethod, invoker: Arc) -> Result, Error>; + async fn object_method(&mut self, args: &ArgsObjectMethod, invoker: Arc) -> Result, PluginError>; - fn optional_env_method(&mut self, args: &ArgsOptionalEnvMethod, invoker: Arc) -> Result, Error>; + async fn optional_env_method(&mut self, args: &ArgsOptionalEnvMethod, invoker: Arc) -> Result, PluginError>; - fn _if(&mut self, args: &ArgsIf, invoker: Arc) -> Result; + async fn _if(&mut self, args: &ArgsIf, invoker: Arc) -> Result; } diff --git a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs index df9fbc6524..fddb5bd880 100644 --- a/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs +++ b/packages/test-cases/cases/bind/sanity/output/plugin-rs/types.rs @@ -1,3 +1,6 @@ +#![allow(unused_imports)] +#![allow(non_camel_case_types)] + /// NOTE: This is an auto-generated file. /// All modifications will be overwritten. use serde::{Serialize, Deserialize}; @@ -5,6 +8,10 @@ use num_bigint::BigInt; use bigdecimal::BigDecimal as BigNumber; use serde_json as JSON; use std::collections::BTreeMap as Map; +use std::sync::Arc; +use polywrap_msgpack::{decode, serialize}; +use polywrap_core::{invoke::{Invoker, InvokeArgs}, uri::Uri}; +use polywrap_plugin::error::PluginError; /// Env START /// @@ -117,6 +124,7 @@ pub struct TestImportAnotherObject { /// Imported objects END /// /// Imported envs START /// + /// Imported envs END /// /// Imported enums START /// @@ -133,4 +141,110 @@ pub enum TestImportEnumReturn { BYTES, _MAX_ } -/// Imported enums END /// \ No newline at end of file +/// Imported enums END /// + +/// Imported Modules START /// + +/// URI: "testimport.uri.eth" /// +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportModuleArgsImportedMethod { + pub str: String, + pub opt_str: Option, + pub u: u32, + pub opt_u: Option, + pub u_array_array: Vec>>>, + pub object: TestImportObject, + pub opt_object: Option, + pub object_array: Vec, + pub opt_object_array: Option>>, + pub en: TestImportEnum, + pub opt_enum: Option, + pub enum_array: Vec, + pub opt_enum_array: Option>>, +} + +/// URI: "testimport.uri.eth" /// +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportModuleArgsAnotherMethod { + pub arg: Vec, +} + +/// URI: "testimport.uri.eth" /// +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportModuleArgsReturnsArrayOfEnums { + pub arg: String, +} + +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct TestImportModule<'a> { + uri: &'a str +} + +impl<'a> TestImportModule<'a> { + pub const INTERFACE_URI: &'static str = "testimport.uri.eth"; + + pub fn new(uri: &'a str) -> TestImportModule<'a> { + TestImportModule { uri: uri } + } + + pub async fn imported_method(&self, args: &TestImportModuleArgsImportedMethod) -> Result, PluginError> { + let uri = self.uri; + let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); + let result = invoker.invoke( + uri, + "importedMethod", + serialized_args, + None, + None + .await + .map_err(|e| PluginError::SubinvocationError { + uri: uri.to_string(), + method: "importedMethod".to_string(), + args: serde_json::to_string(&args).unwrap(), + exception: e.to_string(), + })?; + + Ok(Some(decode(result.as_slice())?)) + } + + pub async fn another_method(&self, args: &TestImportModuleArgsAnotherMethod) -> Result { + let uri = self.uri; + let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); + let result = invoker.invoke( + uri, + "anotherMethod", + serialized_args, + None, + None + .await + .map_err(|e| PluginError::SubinvocationError { + uri: uri.to_string(), + method: "anotherMethod".to_string(), + args: serde_json::to_string(&args).unwrap(), + exception: e.to_string(), + })?; + + Ok(decode(result.as_slice())?) + } + + pub async fn returns_array_of_enums(&self, args: &TestImportModuleArgsReturnsArrayOfEnums) -> Result>, PluginError> { + let uri = self.uri; + let serialized_args = InvokeArgs::UIntArray(serialize(args.clone()).unwrap()); + let result = invoker.invoke( + uri, + "returnsArrayOfEnums", + serialized_args, + None, + None + .await + .map_err(|e| PluginError::SubinvocationError { + uri: uri.to_string(), + method: "returnsArrayOfEnums".to_string(), + args: serde_json::to_string(&args).unwrap(), + exception: e.to_string(), + })?; + + Ok(decode(result.as_slice())?) + } +} +/// Imported Modules END ///