From 42171cc14df52520903758b6330b83a2e99b56f8 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:23:17 -0700 Subject: [PATCH 1/9] Final changes to fix out v0.4.0 Signed-off-by: Shivansh Vij --- compile/typescript/manifest_test.go | 2 + config.go | 14 +- config.ts | 6 + integration/integration_test.go | 15 + log/log.go | 44 ++ log/log.ts | 23 + module.go | 12 +- module.ts | 19 +- scale.go | 8 +- scale_test.go | 832 ---------------------------- 10 files changed, 133 insertions(+), 842 deletions(-) create mode 100644 log/log.go create mode 100644 log/log.ts delete mode 100644 scale_test.go diff --git a/compile/typescript/manifest_test.go b/compile/typescript/manifest_test.go index 1f5bb597..bc31e83b 100644 --- a/compile/typescript/manifest_test.go +++ b/compile/typescript/manifest_test.go @@ -1,3 +1,5 @@ +//go:build !integration && !generate + /* Copyright 2022 Loophole Labs diff --git a/config.go b/config.go index 12fdeb73..3372ba8b 100644 --- a/config.go +++ b/config.go @@ -47,8 +47,9 @@ type Config[T interfaces.Signature] struct { newSignature interfaces.New[T] functions []configFunction context context.Context - Stdout io.Writer - Stderr io.Writer + stdout io.Writer + stderr io.Writer + rawOutput bool } // NewConfig returns a new Scale Runtime Config @@ -115,12 +116,17 @@ func (c *Config[T]) WithContext(ctx context.Context) *Config[T] { } func (c *Config[T]) WithStdout(w io.Writer) *Config[T] { - c.Stdout = w + c.stdout = w return c } func (c *Config[T]) WithStderr(w io.Writer) *Config[T] { - c.Stderr = w + c.stderr = w + return c +} + +func (c *Config[T]) WithRawOutput(rawOutput bool) *Config[T] { + c.rawOutput = rawOutput return c } diff --git a/config.ts b/config.ts index d630087f..c6872113 100644 --- a/config.ts +++ b/config.ts @@ -37,6 +37,7 @@ export class Config { public functions: ConfigFunction[] = []; stdout: Writer | undefined; stderr: Writer | undefined; + rawOutput: boolean = false; constructor(newSignature: New) { this.newSignature = newSignature; @@ -95,6 +96,11 @@ export class Config { this.stderr = writer return this; } + + public WithRawOutput(rawOutput: boolean): Config { + this.rawOutput = rawOutput + return this; + } } // Helper function diff --git a/integration/integration_test.go b/integration/integration_test.go index 4cfa2b45..725ff1ab 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -214,6 +214,7 @@ func compileTypescriptGuest(t *testing.T) *scalefunc.Schema { } func TestGolangHostGolangGuest(t *testing.T) { + t.Log("Starting TestGolangHostGolangGuest") schema := compileGolangGuest(t) cfg := scale.NewConfig(hostSignature.New).WithFunction(schema).WithStdout(os.Stdout).WithStderr(os.Stderr) runtime, err := scale.New(cfg) @@ -232,6 +233,7 @@ func TestGolangHostGolangGuest(t *testing.T) { } func TestGolangHostRustGuest(t *testing.T) { + t.Log("Starting TestGolangHostRustGuest") schema := compileRustGuest(t) cfg := scale.NewConfig(hostSignature.New).WithFunction(schema).WithStdout(os.Stdout).WithStderr(os.Stderr) runtime, err := scale.New(cfg) @@ -250,6 +252,7 @@ func TestGolangHostRustGuest(t *testing.T) { } func TestGolangHostTypescriptGuest(t *testing.T) { + t.Log("Starting TestGolangHostTypescriptGuest") schema := compileTypescriptGuest(t) cfg := scale.NewConfig(hostSignature.New).WithFunction(schema).WithStdout(os.Stdout).WithStderr(os.Stderr) runtime, err := scale.New(cfg) @@ -270,6 +273,7 @@ func TestGolangHostTypescriptGuest(t *testing.T) { } func TestTypescriptHostTypescriptGuest(t *testing.T) { + t.Log("Starting TestTypescriptHostTypescriptGuest") wd, err := os.Getwd() require.NoError(t, err) @@ -289,6 +293,7 @@ func TestTypescriptHostTypescriptGuest(t *testing.T) { } func TestTypescriptHostGolangGuest(t *testing.T) { + t.Log("Starting TestTypescriptHostGolangGuest") wd, err := os.Getwd() require.NoError(t, err) @@ -308,6 +313,7 @@ func TestTypescriptHostGolangGuest(t *testing.T) { } func TestTypescriptHostRustGuest(t *testing.T) { + t.Log("Starting TestTypescriptHostRustGuest") wd, err := os.Getwd() require.NoError(t, err) @@ -327,6 +333,7 @@ func TestTypescriptHostRustGuest(t *testing.T) { } func TestGolangToGolang(t *testing.T) { + t.Log("Starting TestGolangToGolang") wd, err := os.Getwd() require.NoError(t, err) @@ -355,6 +362,7 @@ func TestGolangToGolang(t *testing.T) { } func TestRustToRust(t *testing.T) { + t.Log("Starting TestRustToRust") wd, err := os.Getwd() require.NoError(t, err) @@ -377,6 +385,7 @@ func TestRustToRust(t *testing.T) { } func TestTypescriptToTypescript(t *testing.T) { + t.Log("Starting TestTypescriptToTypescript") wd, err := os.Getwd() require.NoError(t, err) @@ -399,6 +408,7 @@ func TestTypescriptToTypescript(t *testing.T) { } func TestGolangToRust(t *testing.T) { + t.Log("Starting TestGolangToRust") wd, err := os.Getwd() require.NoError(t, err) @@ -435,6 +445,7 @@ func TestGolangToRust(t *testing.T) { } func TestGolangToTypescript(t *testing.T) { + t.Log("Starting TestGolangToTypescript") wd, err := os.Getwd() require.NoError(t, err) @@ -470,6 +481,7 @@ func TestGolangToTypescript(t *testing.T) { } func TestRustToGolang(t *testing.T) { + t.Log("Starting TestRustToGolang") wd, err := os.Getwd() require.NoError(t, err) @@ -506,6 +518,7 @@ func TestRustToGolang(t *testing.T) { } func TestRustToTypescript(t *testing.T) { + t.Log("Starting TestRustToTypescript") wd, err := os.Getwd() require.NoError(t, err) @@ -541,6 +554,7 @@ func TestRustToTypescript(t *testing.T) { } func TestTypescriptToGolang(t *testing.T) { + t.Log("Starting TestTypescriptToGolang") wd, err := os.Getwd() require.NoError(t, err) @@ -576,6 +590,7 @@ func TestTypescriptToGolang(t *testing.T) { } func TestTypescriptToRust(t *testing.T) { + t.Log("Starting TestTypescriptToRust") wd, err := os.Getwd() require.NoError(t, err) diff --git a/log/log.go b/log/log.go new file mode 100644 index 00000000..f299801e --- /dev/null +++ b/log/log.go @@ -0,0 +1,44 @@ +/* + Copyright 2023 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package log + +import ( + "fmt" + "io" +) + +var _ io.Writer = (*NamedLogger)(nil) + +type NamedLogger struct { + nameTemplate string + nameTemplateBytes []byte + writer io.Writer +} + +func NewNamedLogger(name string, writer io.Writer) *NamedLogger { + nameTemplate := fmt.Sprintf("%s: ", name) + return &NamedLogger{ + nameTemplate: nameTemplate, + nameTemplateBytes: []byte(nameTemplate), + writer: writer, + } +} + +func (l *NamedLogger) Write(p []byte) (int, error) { + _, err := l.writer.Write(append(append(l.nameTemplateBytes, p...), '\n')) + return len(p), err +} diff --git a/log/log.ts b/log/log.ts new file mode 100644 index 00000000..4db88e36 --- /dev/null +++ b/log/log.ts @@ -0,0 +1,23 @@ +/* + Copyright 2023 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +import {Writer} from "../config"; + +export function NamedLogger(name: string, writer: Writer): Writer { + return (message: string) => { + writer(`${name}: ${message}`); + } +} \ No newline at end of file diff --git a/module.go b/module.go index 96927f8b..435c7aa8 100644 --- a/module.go +++ b/module.go @@ -19,6 +19,7 @@ package scale import ( "context" "fmt" + "github.com/loopholelabs/scale/log" interfaces "github.com/loopholelabs/scale-signature-interfaces" @@ -51,11 +52,20 @@ type module[T interfaces.Signature] struct { // newModule creates a new module func newModule[T interfaces.Signature](ctx context.Context, template *template[T]) (*module[T], error) { - config := template.runtime.moduleConfig.WithName(fmt.Sprintf("%s.%s", template.identifier, uuid.New().String())) + name := fmt.Sprintf("%s.%s", template.identifier, uuid.New().String()) + config := template.runtime.moduleConfig.WithName(name) for k, v := range template.env { config = config.WithEnv(k, v) } + if template.runtime.config.stdout != nil && !template.runtime.config.rawOutput { + config = config.WithStdout(log.NewNamedLogger(name, template.runtime.config.stdout)) + } + + if template.runtime.config.stderr != nil && !template.runtime.config.rawOutput { + config = config.WithStderr(log.NewNamedLogger(name, template.runtime.config.stderr)) + } + instantiatedModule, err := template.runtime.runtime.InstantiateModule(ctx, template.compiled, config) if err != nil { return nil, fmt.Errorf("failed to instantiate module '%s': %w", template.identifier, err) diff --git a/module.ts b/module.ts index 1abc341a..ba311514 100644 --- a/module.ts +++ b/module.ts @@ -13,12 +13,15 @@ See the License for the specific language governing permissions and limitations under the License. */ + import {Signature} from "@loopholelabs/scale-signature-interfaces"; import {Func} from "./function"; import {Template} from "./template"; import {UnpackUint32} from "./utils"; import {Decoder} from "@loopholelabs/polyglot"; import {DisabledWASI} from "./wasi"; +import {v4 as uuid} from "uuid"; +import {NamedLogger} from "./log/log"; export async function NewModule(template: Template): Promise> { const m = new Module(template); @@ -45,7 +48,21 @@ export class Module { constructor(template: Template) { this.template = template; - this.wasi = new DisabledWASI(this.template.env, this.template.runtime.config.stdout, this.template.runtime.config.stderr); + + const name = `${this.template.identifier}.${uuid()}` + + let stdout = this.template.runtime.config.stdout; + let stderr = this.template.runtime.config.stderr; + + if (stdout !== undefined && !this.template.runtime.config.rawOutput) { + stdout = NamedLogger(name, stdout); + } + + if (stderr !== undefined && !this.template.runtime.config.rawOutput) { + stderr = NamedLogger(name, stderr); + } + + this.wasi = new DisabledWASI(this.template.env, stdout, stderr); const moduleConfig = { wasi_snapshot_preview1: this.wasi.GetImports(), diff --git a/scale.go b/scale.go index 0ca8d7c3..40a3c977 100644 --- a/scale.go +++ b/scale.go @@ -74,12 +74,12 @@ func (r *Scale[T]) init() error { return err } - if r.config.Stdout != nil { - r.moduleConfig = r.moduleConfig.WithStdout(r.config.Stdout) + if r.config.stdout != nil && r.config.rawOutput { + r.moduleConfig = r.moduleConfig.WithStdout(r.config.stdout) } - if r.config.Stderr != nil { - r.moduleConfig = r.moduleConfig.WithStderr(r.config.Stderr) + if r.config.stderr != nil && r.config.rawOutput { + r.moduleConfig = r.moduleConfig.WithStderr(r.config.stderr) } envHostModuleBuilder := r.runtime.NewHostModuleBuilder("env"). diff --git a/scale_test.go b/scale_test.go deleted file mode 100644 index 43fd2fbd..00000000 --- a/scale_test.go +++ /dev/null @@ -1,832 +0,0 @@ -//go:build !tinygo && !js && !wasm - -/* - Copyright 2022 Loophole Labs - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package scale - -// import ( -// "context" -// "encoding/json" -// "errors" -// "fmt" -// "os" -// "testing" -// "time" -// -// httpSignature "github.com/loopholelabs/scale-signature-http" -// "github.com/loopholelabs/scale/go/tests/harness" -// signature "github.com/loopholelabs/scale/go/tests/signature/example-signature" -// "github.com/loopholelabs/scalefile" -// "github.com/loopholelabs/scalefile/scalefunc" -// "github.com/stretchr/testify/assert" -// "github.com/stretchr/testify/require" -//) -// -// type TestCase struct { -// Name string -// Module *harness.Module -// Run func(*scalefunc.Schema, *testing.T) -//} -// -// func TestRuntimeGo(t *testing.T) { -// passthroughModule := &harness.Module{ -// Name: "passthrough", -// Path: "tests/modules/passthrough/passthrough.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// modifyModule := &harness.Module{ -// Name: "modify", -// Path: "tests/modules/modify/modify.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// nextModule := &harness.Module{ -// Name: "next", -// Path: "tests/modules/next/next.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// modifyNextModule := &harness.Module{ -// Name: "modifynext", -// Path: "tests/modules/modifynext/modifynext.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// fileModule := &harness.Module{ -// Name: "file", -// Path: "tests/modules/file/file.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// networkModule := &harness.Module{ -// Name: "network", -// Path: "tests/modules/network/network.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// panicModule := &harness.Module{ -// Name: "panic", -// Path: "tests/modules/panic/panic.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// badSignatureModule := &harness.Module{ -// Name: "bad-signature", -// Path: "tests/modules/bad-signature/bad-signature.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/bad-signature", -// } -// -// modules := []*harness.Module{passthroughModule, modifyModule, nextModule, modifyNextModule, fileModule, networkModule, panicModule, badSignatureModule} -// -// generatedModules := harness.GoSetup(t, modules, "github.com/loopholelabs/scale/go/tests/modules") -// -// var testCases = []TestCase{ -// { -// Name: "Passthrough", -// Module: passthroughModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data", i.Context().Data) -// }, -// }, -// { -// Name: "Modify", -// Module: modifyModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "modified", i.Context().Data) -// }, -// }, -// { -// Name: "Next", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// ctx.Data = "Hello, World!" -// return ctx, nil -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Hello, World!", i.Context().Data) -// }, -// }, -// { -// Name: "ModifyNext", -// Module: modifyNextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// ctx.Data = ctx.Data + "-next" -// return ctx, nil -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "modified-next", i.Context().Data) -// }, -// }, -// { -// Name: "NextError", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// return nil, errors.New("next error") -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.ErrorIs(t, err, errors.New("next error")) -// }, -// }, -// { -// Name: "File", -// Module: fileModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.Error(t, err) -// }, -// }, -// { -// Name: "Network", -// Module: networkModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.Error(t, err) -// }, -// }, -// { -// Name: "Panic", -// Module: panicModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.Error(t, err) -// }, -// }, -// { -// Name: "BadSignature", -// Module: badSignatureModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// assert.Error(t, err) -// }, -// }, -// } -// -// for _, testCase := range testCases { -// t.Run(testCase.Name, func(t *testing.T) { -// module, err := os.ReadFile(generatedModules[testCase.Module]) -// require.NoError(t, err) -// -// scaleFunc := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName", -// Tag: "TestTag", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Go, -// Function: module, -// } -// testCase.Run(scaleFunc, t) -// }) -// } -//} -// -// func TestRuntimeGoTracing(t *testing.T) { -// tracingModule := &harness.Module{ -// Name: "tracing", -// Path: "tests/modules/tracing/tracing.go", -// Signature: "github.com/loopholelabs/scale/go/tests/signature/example-signature", -// } -// -// modules := []*harness.Module{tracingModule} -// generatedModules := harness.GoSetup(t, modules, "github.com/loopholelabs/scale/go/tests/modules") -// -// // Now run it and see... -// module, err := os.ReadFile(generatedModules[tracingModule]) -// require.NoError(t, err) -// -// scaleFunc1 := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName1", -// Tag: "TestTag1", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Go, -// Function: module, -// } -// -// scaleFunc2 := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName2", -// Tag: "TestTag2", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Go, -// Function: module, -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc1, scaleFunc2}) -// require.NoError(t, err) -// -// traceData := make([]string, 0) -// -// r.TraceDataCallback = func(data string) { -// traceData = append(traceData, data) -// -// // Slightly hacky, but we want to make sure time has moved on -// t1 := time.Now().UnixNano() -// t2 := t1 -// for { -// if t2 > t1 { -// break -// } -// t2 = time.Now().UnixNano() -// } -// -// } -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// // Assert that the trace data is there and as expected... -// assert.Equal(t, 2, len(traceData)) -// -// data1 := traceData[0] -// trace1 := &TraceData{} -// err = json.Unmarshal([]byte(data1), trace1) -// require.NoError(t, err) -// // Json decode, and check it -// -// assert.Equal(t, "TestName1:TestTag1", trace1.ServiceName) -// assert.Equal(t, fmt.Sprintf("%x", r.InvocationID), trace1.InvocationId) -// -// data2 := traceData[1] -// trace2 := &TraceData{} -// err = json.Unmarshal([]byte(data2), trace2) -// require.NoError(t, err) -// // Json decode, and check it -// -// assert.Equal(t, "TestName2:TestTag2", trace2.ServiceName) -// assert.Equal(t, fmt.Sprintf("%x", r.InvocationID), trace2.InvocationId) -// -// // Make sure we can get time -// assert.True(t, trace2.Timestamp > trace1.Timestamp) -// -// // Run it again and make sure it's a new invocationID -// i, err = r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// // Assert that the trace data is there and as expected but a different invocationID from previous Run -// assert.Equal(t, 4, len(traceData)) -// -// data3 := traceData[2] -// trace3 := &TraceData{} -// err = json.Unmarshal([]byte(data3), trace3) -// require.NoError(t, err) -// // Json decode, and check it -// -// assert.NotEqual(t, trace3.InvocationId, trace2.InvocationId) -//} -// -// type TraceData struct { -// ServiceName string `json:"serviceName"` -// InvocationId string `json:"invocationId"` -// Timestamp uint64 `json:"timestamp"` -//} -// -// func TestRuntimeHTTPSignatureGo(t *testing.T) { -// passthroughModule := &harness.Module{ -// Name: "http-passthrough", -// Path: "tests/modules/http-passthrough/http-passthrough.go", -// Signature: "github.com/loopholelabs/scale-signature-http", -// } -// -// handlerModule := &harness.Module{ -// Name: "http-handler", -// Path: "tests/modules/http-handler/http-handler.go", -// Signature: "github.com/loopholelabs/scale-signature-http", -// } -// -// nextModule := &harness.Module{ -// Name: "http-next", -// Path: "tests/modules/http-next/http-next.go", -// Signature: "github.com/loopholelabs/scale-signature-http", -// } -// -// modules := []*harness.Module{passthroughModule, handlerModule, nextModule} -// -// generatedModules := harness.GoSetup(t, modules, "github.com/loopholelabs/scale/go/tests/modules") -// -// var testCases = []TestCase{ -// { -// Name: "Passthrough", -// Module: passthroughModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data", string(i.Context().Response.Body)) -// }, -// }, -// { -// Name: "Handler", -// Module: handlerModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data-modified", string(i.Context().Response.Body)) -// }, -// }, -// { -// Name: "Next", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(func(ctx *httpSignature.Context) (*httpSignature.Context, error) { -// ctx.Response.Body = append(ctx.Response.Body, []byte("-next")...) -// return ctx, nil -// }) -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data-modified-next", string(i.Context().Response.Body)) -// }, -// }, -// } -// -// for _, testCase := range testCases { -// t.Run(testCase.Name, func(t *testing.T) { -// module, err := os.ReadFile(generatedModules[testCase.Module]) -// require.NoError(t, err) -// -// scaleFunc := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName", -// Tag: "TestTag", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Go, -// Function: module, -// } -// testCase.Run(scaleFunc, t) -// }) -// } -//} -// -// func TestRuntimeRs(t *testing.T) { -// passthroughModule := &harness.Module{ -// Name: "passthrough", -// Path: "../rust/tests/modules/passthrough/passthrough.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// modifyModule := &harness.Module{ -// Name: "modify", -// Path: "../rust/tests/modules/modify/modify.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// nextModule := &harness.Module{ -// Name: "next", -// Path: "../rust/tests/modules/next/next.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// modifyNextModule := &harness.Module{ -// Name: "modifynext", -// Path: "../rust/tests/modules/modifynext/modifynext.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// fileModule := &harness.Module{ -// Name: "file", -// Path: "../rust/tests/modules/file/file.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// networkModule := &harness.Module{ -// Name: "network", -// Path: "../rust/tests/modules/network/network.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// panicModule := &harness.Module{ -// Name: "panic", -// Path: "../rust/tests/modules/panic/panic.rs", -// Signature: "example_signature", -// SignaturePath: "../../../signature/example-signature", -// } -// -// badSignatureModule := &harness.Module{ -// Name: "bad_signature", -// Path: "../rust/tests/modules/bad_signature/bad_signature.rs", -// Signature: "bad_signature", -// SignaturePath: "../../../signature/bad-signature", -// } -// -// modules := []*harness.Module{passthroughModule, modifyModule, nextModule, modifyNextModule, fileModule, networkModule, panicModule, badSignatureModule} -// -// dependencies := []*scalefile.Dependency{ -// { -// Name: "scale_signature", -// Version: "0.2.11", -// }, -// } -// -// generatedModules := harness.RustSetup(t, modules, dependencies) -// -// var testCases = []TestCase{ -// { -// Name: "Passthrough", -// Module: passthroughModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data", i.Context().Data) -// }, -// }, -// { -// Name: "Modify", -// Module: modifyModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "modified", i.Context().Data) -// }, -// }, -// { -// Name: "Next", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// ctx.Data = "Hello, World!" -// return ctx, nil -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Hello, World!", i.Context().Data) -// }, -// }, -// { -// Name: "ModifyNext", -// Module: modifyNextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// ctx.Data = ctx.Data + "-next" -// return ctx, nil -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// i.Context().Data = "Test Data" -// -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "modified-next", i.Context().Data) -// }, -// }, -// { -// Name: "NextError", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// next := func(ctx *signature.Context) (*signature.Context, error) { -// return nil, errors.New("next error") -// } -// -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(next) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.ErrorIs(t, err, errors.New("next error")) -// }, -// }, -// { -// Name: "File", -// Module: fileModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.ErrorContains(t, err, "operation not supported on this platform") -// }, -// }, -// { -// Name: "Network", -// Module: networkModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.ErrorContains(t, err, "operation not supported on this platform") -// }, -// }, -// { -// Name: "Panic", -// Module: panicModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// require.Error(t, err) -// }, -// }, -// { -// Name: "BadSignature", -// Module: badSignatureModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := NewWithSignature(context.Background(), signature.New, []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(nil) -// require.NoError(t, err) -// -// err = i.Run(context.Background()) -// assert.Error(t, err) -// }, -// }, -// } -// -// for _, testCase := range testCases { -// t.Run(testCase.Name, func(t *testing.T) { -// module, err := os.ReadFile(generatedModules[testCase.Module]) -// require.NoError(t, err) -// -// scaleFunc := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName", -// Tag: "TestTag", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Rust, -// Function: module, -// } -// testCase.Run(scaleFunc, t) -// }) -// } -//} -// -// func TestRuntimeHTTPSignatureRs(t *testing.T) { -// passthroughModule := &harness.Module{ -// Name: "http_passthrough", -// Path: "../rust/tests/modules/http_passthrough/http_passthrough.rs", -// Signature: "scale_signature_http", -// } -// -// handlerModule := &harness.Module{ -// Name: "http_handler", -// Path: "../rust/tests/modules/http_handler/http_handler.rs", -// Signature: "scale_signature_http", -// } -// -// nextModule := &harness.Module{ -// Name: "http_next", -// Path: "../rust/tests/modules/http_next/http_next.rs", -// Signature: "scale_signature_http", -// } -// -// modules := []*harness.Module{passthroughModule, handlerModule, nextModule} -// -// dependencies := []*scalefile.Dependency{ -// { -// Name: "scale_signature", -// Version: "0.2.11", -// }, -// { -// Name: "scale_signature_http", -// Version: "0.3.8", -// }, -// } -// -// generatedModules := harness.RustSetup(t, modules, dependencies) -// -// var testCases = []TestCase{ -// { -// Name: "Passthrough", -// Module: passthroughModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data", string(i.Context().Response.Body)) -// }, -// }, -// { -// Name: "Handler", -// Module: handlerModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance() -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data-modified", string(i.Context().Response.Body)) -// }, -// }, -// { -// Name: "Next", -// Module: nextModule, -// Run: func(scaleFunc *scalefunc.Schema, t *testing.T) { -// r, err := New(context.Background(), []*scalefunc.Schema{scaleFunc}) -// require.NoError(t, err) -// -// i, err := r.Instance(func(ctx *httpSignature.Context) (*httpSignature.Context, error) { -// ctx.Response.Body = append(ctx.Response.Body, []byte("-next")...) -// return ctx, nil -// }) -// require.NoError(t, err) -// -// i.Context().Response.Body = []byte("Test Data") -// err = i.Run(context.Background()) -// assert.NoError(t, err) -// -// assert.Equal(t, "Test Data-modified-next", string(i.Context().Response.Body)) -// }, -// }, -// } -// -// for _, testCase := range testCases { -// t.Run(testCase.Name, func(t *testing.T) { -// module, err := os.ReadFile(generatedModules[testCase.Module]) -// require.NoError(t, err) -// -// scaleFunc := &scalefunc.Schema{ -// Version: scalefunc.V1Alpha, -// Name: "TestName", -// Tag: "TestTag", -// Signature: "ExampleName@ExampleVersion", -// Language: scalefunc.Go, -// Function: module, -// } -// testCase.Run(scaleFunc, t) -// }) -// } -//} From fdd14d3cc9246a79cc43bc19a16e1fca9bd8512c Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:32:39 -0700 Subject: [PATCH 2/9] Fixing lint Signed-off-by: Shivansh Vij --- module.go | 1 + 1 file changed, 1 insertion(+) diff --git a/module.go b/module.go index 435c7aa8..e1a6d196 100644 --- a/module.go +++ b/module.go @@ -19,6 +19,7 @@ package scale import ( "context" "fmt" + "github.com/loopholelabs/scale/log" interfaces "github.com/loopholelabs/scale-signature-interfaces" From 9a3f68cfb642ab6cbccbbcdd3d3fb36e728386fe Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:36:02 -0700 Subject: [PATCH 3/9] Updating versions for release Signed-off-by: Shivansh Vij --- Cargo.toml | 4 ++-- README.md | 9 ++++++--- package.json | 4 ++-- version/current_version | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9d3c8670..92b6ea02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "scale_rs" -version = "0.3.20" +version = "0.4.0" edition = "2021" -description = "A High-Performance WebAssembly Function Runtime" +description = "Scale is a framework for building high-performance plugin systems into any application, all powered by WebAssembly." homepage = "https://scale.sh" repository = "https://github.com/loopholelabs/scale" license = "Apache-2.0" diff --git a/README.md b/README.md index 5f717067..925f53e6 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,16 @@ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Discord](https://dcbadge.vercel.app/api/server/JYmFhtdPeu?style=flat)](https://loopholelabs.io/discord) -[Scale](https://scale.sh) is a highly-performant WebAssembly function runtime that enables composable, language-agnostic software development. +[Scale](https://scale.sh) is a framework for building high-performance plugin systems into any application, all powered by WebAssembly. -With Scale Functions you can write code in any language, then use it from any other language, environment, or runtime, with state-of-the-art sandboxing qualities, startup times, and overall performance. This initial release includes client support for [Golang](https://golang.org) and [Rust](https://www.rust-lang.org/), with runtimes for [Golang](https://golang.org) and [Typescript](https://www.typescriptlang.org/). +With Scale Functions your users can write fully typed plugins in any language they choose, and your application can easily and safely +run those plugins with the Scale Runtime, which provides state-of-the-art sandboxing, low startup times, and extremely high performance. + +Currently, guest plugins can be written in [Golang](https://golang.org), [Rust](https://www.rust-lang.org/), and [Typescript](https://www.typescriptlang.org/), with the Runtime supporting [Golang](https://golang.org) and [Typescript](https://www.typescriptlang.org/) host applications. ## Usage and Documentation -Usage instructions and documentation for the Scale Runtime is available at [https://scale.sh/docs](https://scale.sh/docs). +Usage instructions and documentation for Scale is available at [https://scale.sh/docs](https://scale.sh/docs). ## Contributing diff --git a/package.json b/package.json index 2088d4ea..aa324901 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@loopholelabs/scale", - "version": "0.3.20", - "description": "A Framework for writing High-Performance WebAssembly Functions and Runtime", + "version": "0.4.0", + "description": "Scale is a framework for building high-performance plugin systems into any application, all powered by WebAssembly.", "source": "scale.ts", "types": "types.d.ts", "license": "Apache-2.0", diff --git a/version/current_version b/version/current_version index 54799567..01e994d3 100644 --- a/version/current_version +++ b/version/current_version @@ -1 +1 @@ -v0.3.20 \ No newline at end of file +v0.4.0 \ No newline at end of file From 2041a0f238b3df2bfced6692c766ab9bad6d1ca5 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:38:17 -0700 Subject: [PATCH 4/9] Updating CHANGELOG.md Signed-off-by: Shivansh Vij --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f5af046..375161ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [v0.4.0] - 2023-09-20 + +### Features + +- Added support for scale signatures +- Consolidated build pipeline into the `build` package +- Consolidated the compiler for golang, typescript, and rust guest functions into the `compile` package + +### Changes + +- Merged various signature repositories into this repository +- Added integration tests to the `scale` package + ## [v0.3.19] - 2023-05-15 ### Features @@ -236,7 +249,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Initial release of the Scale Runtime library. -[unreleased]: https://github.com/loopholelabs/scale/compare/v0.3.19...HEAD +[unreleased]: https://github.com/loopholelabs/scale/compare/v0.4.0...HEAD +[v0.4.0]: https://github.com/loopholelabs/scale/compare/v0.4.0 [v0.3.19]: https://github.com/loopholelabs/scale/compare/v0.3.19 [v0.3.18]: https://github.com/loopholelabs/scale/compare/v0.3.18 [v0.3.17]: https://github.com/loopholelabs/scale/compare/v0.3.17 From 61e3ac5ffd262b52e417c5ad05bdc46f9282600f Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:39:04 -0700 Subject: [PATCH 5/9] Fixing master tests Signed-off-by: Shivansh Vij --- signature/generator/golang/generated.txt | 2 +- signature/generator/rust/generated.txt | 2 +- signature/generator/typescript/generated.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/signature/generator/golang/generated.txt b/signature/generator/golang/generated.txt index cf9e9387..ae3f70d4 100644 --- a/signature/generator/golang/generated.txt +++ b/signature/generator/golang/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: types package types diff --git a/signature/generator/rust/generated.txt b/signature/generator/rust/generated.txt index 8ec6861d..8afa59ae 100755 --- a/signature/generator/rust/generated.txt +++ b/signature/generator/rust/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: types #![allow(dead_code)] diff --git a/signature/generator/typescript/generated.txt b/signature/generator/typescript/generated.txt index 1e0f31c5..1c1d3e25 100755 --- a/signature/generator/typescript/generated.txt +++ b/signature/generator/typescript/generated.txt @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: types import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" From 32b19c40cc4bb733b98ea0723aade2a05a3e27fe Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:48:29 -0700 Subject: [PATCH 6/9] Modifying test framework slightly to release properly and to build properly Signed-off-by: Shivansh Vij --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ go.mod | 4 +-- go.sum | 8 +++--- package.json | 1 - tsconfig.json | 2 +- 5 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ee609896 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + npm: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + - name: Cache the dependency directories + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-${{ hashFiles('*.json') }} + - name: Install dependencies with npm + run: npm install --save-dev + - name: Build with npm + run: npm run build + - name: Publish to npm + run: npm publish --access public + working-directory: ./dist + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + cargo: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Rust + run: | + rustup toolchain install stable --profile minimal --no-self-update + rustup default stable + shell: bash + - name: Cargo build + run: cargo build --release + - name: Publish to crates.io + run: cargo publish --token $CARGO_REGISTRY_TOKEN + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file diff --git a/go.mod b/go.mod index 84703ffe..919c6588 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/BurntSushi/toml v1.3.2 - github.com/evanw/esbuild v0.19.2 + github.com/evanw/esbuild v0.19.3 github.com/google/uuid v1.3.1 github.com/hashicorp/hcl/v2 v2.18.0 github.com/loopholelabs/polyglot v1.1.3 @@ -12,7 +12,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tetratelabs/wazero v1.5.0 golang.org/x/mod v0.12.0 - golang.org/x/text v0.12.0 + golang.org/x/text v0.13.0 ) require ( diff --git a/go.sum b/go.sum index 3e46875e..5924c588 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmms github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/evanw/esbuild v0.19.2 h1:Ju+VvhVepfXW+sNQ189j9aLK4brlN36lEZUajJaK3Ig= -github.com/evanw/esbuild v0.19.2/go.mod h1:iINY06rn799hi48UqEnaQvVfZWe6W9bET78LbvN8VWk= +github.com/evanw/esbuild v0.19.3 h1:foPr0xwQM3lBWKBtscauTN9FrmJzRDVI2+EGOs82H/I= +github.com/evanw/esbuild v0.19.3/go.mod h1:iINY06rn799hi48UqEnaQvVfZWe6W9bET78LbvN8VWk= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -51,8 +51,8 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901 h1:0wxTF6pSjIIhNt7mo9GvjDfzyCOiWhmICgtO/Ah948s= golang.org/x/tools v0.8.1-0.20230428195545-5283a0178901/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/package.json b/package.json index aa324901..9e030321 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "license": "Apache-2.0", "scripts": { "build": "rm -rf dist && tsc --outDir dist && cp package.json dist", - "test": "node --experimental-wasi-unstable-preview1 --trace-warnings node_modules/.bin/jest --no-cache", "lint": "eslint . --ext .ts" }, "dependencies": { diff --git a/tsconfig.json b/tsconfig.json index 953630b3..031cdde3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "include": ["**/*.ts"], - "exclude": ["node_modules", "dist", "target", "**/*.go", "**/*.rs", "*.go", "*.rs"], + "exclude": ["node_modules", "dist", "target","compile/typescript/builder", "integration", "**/*.go", "**/*.rs", "*.go", "*.rs"], "compilerOptions": { "target": "es2020", "module": "commonjs", From e145f7ec357488389f144ef32ce4d238548dd0a9 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 11:48:52 -0700 Subject: [PATCH 7/9] Commenting out rust host release since it's not ready yet Signed-off-by: Shivansh Vij --- .github/workflows/release.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee609896..9bfd778a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,19 +30,19 @@ jobs: working-directory: ./dist env: NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - cargo: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Rust - run: | - rustup toolchain install stable --profile minimal --no-self-update - rustup default stable - shell: bash - - name: Cargo build - run: cargo build --release - - name: Publish to crates.io - run: cargo publish --token $CARGO_REGISTRY_TOKEN - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file +# cargo: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# - name: Set up Rust +# run: | +# rustup toolchain install stable --profile minimal --no-self-update +# rustup default stable +# shell: bash +# - name: Cargo build +# run: cargo build --release +# - name: Publish to crates.io +# run: cargo publish --token $CARGO_REGISTRY_TOKEN +# env: +# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file From eac300f439abf09b2791f03ed5321ea05a6cfb91 Mon Sep 17 00:00:00 2001 From: Shivansh Vij Date: Wed, 20 Sep 2023 12:17:56 -0700 Subject: [PATCH 8/9] Making requested changes around undefined checks in typescript Signed-off-by: Shivansh Vij --- compile/typescript/templates/index.ts.templ | 2 +- function.go | 2 +- function.ts | 8 +- instance.ts | 12 +- integration/golang_tests/function/example.go | 16 ++ .../golang_tests/generated/generated.go | 2 +- .../golang_tests/host_signature/host.go | 2 +- .../golang_tests/host_signature/types.go | 2 +- integration/golang_tests/signature/guest.go | 2 +- integration/golang_tests/signature/types.go | 2 +- integration/rust_tests/generated/generated.rs | 18 +- integration/rust_tests/signature/guest.rs | 16 +- integration/rust_tests/signature/types.rs | 179 +++++++----------- .../typescript_tests/function/index.ts | 2 +- .../typescript_tests/generated/generated.d.ts | 2 +- .../typescript_tests/generated/generated.js | 4 +- .../generated/generated.js.map | 4 +- .../host_signature/index.d.ts | 2 +- .../typescript_tests/host_signature/index.js | 2 +- .../host_signature/index.js.map | 2 +- .../typescript_tests/host_signature/index.ts | 2 +- .../host_signature/types.d.ts | 2 +- .../typescript_tests/host_signature/types.js | 72 +++---- .../host_signature/types.js.map | 4 +- .../typescript_tests/host_signature/types.ts | 72 +++---- .../typescript_tests/signature/index.d.ts | 2 +- .../typescript_tests/signature/index.js | 4 +- .../typescript_tests/signature/index.js.map | 4 +- .../typescript_tests/signature/index.ts | 4 +- .../typescript_tests/signature/types.d.ts | 2 +- .../typescript_tests/signature/types.js | 72 +++---- .../typescript_tests/signature/types.js.map | 4 +- .../typescript_tests/signature/types.ts | 72 +++---- module.ts | 31 +-- package.json | 3 +- pool.ts | 2 +- scale.ts | 16 +- scalefunc/scaleFunc.test.ts | 2 +- .../converter/converter_tests/generated.go | 2 +- signature/generator/typescript/generated.txt | 70 +++---- .../generator/typescript/generator_test.go | 2 +- .../typescript/templates/guest.ts.templ | 2 +- .../typescript/templates/maps.ts.templ | 4 +- .../typescript/templates/modelarrays.ts.templ | 4 +- .../typescript/templates/models.ts.templ | 4 +- .../typescript/templates/types.ts.templ | 2 +- template.ts | 4 - tracing.ts | 33 ++-- wasi.ts | 10 +- 49 files changed, 372 insertions(+), 416 deletions(-) diff --git a/compile/typescript/templates/index.ts.templ b/compile/typescript/templates/index.ts.templ index 886fcb6b..1f143e56 100644 --- a/compile/typescript/templates/index.ts.templ +++ b/compile/typescript/templates/index.ts.templ @@ -18,7 +18,7 @@ class TextEncoder { let i = 0; while (i < length) { const codePoint = s.codePointAt(i); - if (codePoint !== undefined) { + if (typeof codePoint !== "undefined") { let c = 0; let bits = 0; if (codePoint <= 0x0000007F) { diff --git a/function.go b/function.go index d76105b9..07b8e665 100644 --- a/function.go +++ b/function.go @@ -23,7 +23,7 @@ import ( interfaces "github.com/loopholelabs/scale-signature-interfaces" ) -// function is an instantiated function that can be run +// function is an instantiated function that can run a module type function[T interfaces.Signature] struct { // instance is the instance that this function belongs to instance *Instance[T] diff --git a/function.ts b/function.ts index 61b0fa94..ca5c7c0e 100644 --- a/function.ts +++ b/function.ts @@ -31,7 +31,7 @@ export class Func { this.template = template; this.ready = new Promise(async (resolve) => { // eslint-disable-line no-async-promise-executor - if (template.modulePool === undefined) { + if (typeof template.modulePool === "undefined") { this.module = await NewModule(template); this.module.Register(this); } @@ -44,11 +44,11 @@ export class Func { } public async GetModule(signature: T): Promise> { - if (this.module !== undefined) { + if (typeof this.module !== "undefined") { this.module.SetSignature(signature); return this.module; } - if (this.template.modulePool === undefined) { + if (typeof this.template.modulePool === "undefined") { throw new Error(`cannot get module from pool for function ${this.template.identifier}: module pool is undefined`); } const m = await this.template.modulePool.Get(); @@ -58,7 +58,7 @@ export class Func { } public PutModule(m: Module){ - if (this.template.modulePool !== undefined) { + if (typeof this.template.modulePool !== "undefined") { m.Cleanup() this.template.modulePool.Put(m); } diff --git a/instance.ts b/instance.ts index 80137961..7b23b4b6 100644 --- a/instance.ts +++ b/instance.ts @@ -32,14 +32,14 @@ export class Instance { private readonly ready: Promise; private runtime: Scale; - private identifier: Buffer; + public identifier: Buffer; private head: undefined | Func; next: NextFn; constructor(runtime: Scale, next?: NextFn) { this.runtime = runtime; this.identifier = randomBytes(16); - if (next !== undefined) { + if (typeof next !== "undefined") { this.next = next; } else { this.next = (ctx: T) => ctx; @@ -49,12 +49,12 @@ export class Instance { let previousFunction = this.head; let nextTemplate = this.runtime.head; - while (nextTemplate !== undefined) { + while (typeof nextTemplate !== "undefined") { const fn = await NewFunc(this, nextTemplate); - if (this.head === undefined) { + if (typeof this.head === "undefined") { this.head = fn; } - if (previousFunction !== undefined) { + if (typeof previousFunction !== "undefined") { previousFunction.next = fn; } previousFunction = fn; @@ -71,7 +71,7 @@ export class Instance { } public async Run(signature: T) { - if (this.head === undefined) { + if (typeof this.head === "undefined") { throw ErrNoCompiledFunctions; } const m = await this.head.GetModule(signature); diff --git a/integration/golang_tests/function/example.go b/integration/golang_tests/function/example.go index 8d281ecb..ddb6ff9f 100644 --- a/integration/golang_tests/function/example.go +++ b/integration/golang_tests/function/example.go @@ -1,3 +1,19 @@ +/* + Copyright 2023 Loophole Labs + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + package example import ( diff --git a/integration/golang_tests/generated/generated.go b/integration/golang_tests/generated/generated.go index 37b38f67..50a43bd3 100644 --- a/integration/golang_tests/generated/generated.go +++ b/integration/golang_tests/generated/generated.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: generated package generated diff --git a/integration/golang_tests/host_signature/host.go b/integration/golang_tests/host_signature/host.go index bab665b3..ce521217 100644 --- a/integration/golang_tests/host_signature/host.go +++ b/integration/golang_tests/host_signature/host.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/host_signature/types.go b/integration/golang_tests/host_signature/types.go index c14a9139..58e48635 100644 --- a/integration/golang_tests/host_signature/types.go +++ b/integration/golang_tests/host_signature/types.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/signature/guest.go b/integration/golang_tests/signature/guest.go index 828f85f7..38071333 100644 --- a/integration/golang_tests/signature/guest.go +++ b/integration/golang_tests/signature/guest.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: signature package signature diff --git a/integration/golang_tests/signature/types.go b/integration/golang_tests/signature/types.go index 12068159..2a52f40e 100644 --- a/integration/golang_tests/signature/types.go +++ b/integration/golang_tests/signature/types.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: signature package signature diff --git a/integration/rust_tests/generated/generated.rs b/integration/rust_tests/generated/generated.rs index f32cda33..20fd42b3 100644 --- a/integration/rust_tests/generated/generated.rs +++ b/integration/rust_tests/generated/generated.rs @@ -1,16 +1,16 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: generated #![allow(dead_code)] #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] -use std::io::Cursor; -use polyglot_rs::{DecodingError, Encoder, Decoder, Kind}; use num_enum::TryFromPrimitive; -use std::convert::TryFrom; -use std::collections::HashMap; +use polyglot_rs::{Decoder, DecodingError, Encoder, Kind}; use regex::Regex; +use std::collections::HashMap; +use std::convert::TryFrom; +use std::io::Cursor; pub trait Encode { fn encode<'a>( a: Option<&Self>, @@ -26,9 +26,7 @@ trait EncodeSelf { ) -> Result<&'a mut Cursor>, Box>; } pub trait Decode { - fn decode( - b: &mut Cursor<&mut Vec>, - ) -> Result, Box> + fn decode(b: &mut Cursor<&mut Vec>) -> Result, Box> where Self: Sized; } @@ -89,9 +87,7 @@ impl EncodeSelf for Option { } } impl Decode for Context { - fn decode( - d: &mut Cursor<&mut Vec>, - ) -> Result, Box> { + fn decode(d: &mut Cursor<&mut Vec>) -> Result, Box> { if d.decode_none() { return Ok(None); } diff --git a/integration/rust_tests/signature/guest.rs b/integration/rust_tests/signature/guest.rs index 3d5ffc0d..70d38e1e 100644 --- a/integration/rust_tests/signature/guest.rs +++ b/integration/rust_tests/signature/guest.rs @@ -1,10 +1,10 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local_example_latest_guest pub mod types; -use crate::types::{Encode, Decode}; -use std::io::Cursor; +use crate::types::{Decode, Encode}; use polyglot_rs::Encoder; +use std::io::Cursor; static HASH: &'static str = "3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5"; static mut READ_BUFFER: Vec = Vec::new(); static mut WRITE_BUFFER: Vec = Vec::new(); @@ -12,10 +12,7 @@ pub unsafe fn write(ctx: Option<&mut types::ModelWithAllFieldTypes>) -> (u32, u3 let mut cursor = Cursor::new(Vec::new()); match ctx { Some(ctx) => { - cursor = match types::ModelWithAllFieldTypes::encode( - Some(ctx), - &mut cursor, - ) { + cursor = match types::ModelWithAllFieldTypes::encode(Some(ctx), &mut cursor) { Ok(_) => cursor, Err(err) => return error(err), }; @@ -32,10 +29,7 @@ pub unsafe fn write(ctx: Option<&mut types::ModelWithAllFieldTypes>) -> (u32, u3 WRITE_BUFFER.copy_from_slice(&vec); return (WRITE_BUFFER.as_ptr() as u32, WRITE_BUFFER.len() as u32); } -pub unsafe fn read() -> Result< - Option, - Box, -> { +pub unsafe fn read() -> Result, Box> { let mut cursor = Cursor::new(&mut READ_BUFFER); types::ModelWithAllFieldTypes::decode(&mut cursor) } diff --git a/integration/rust_tests/signature/types.rs b/integration/rust_tests/signature/types.rs index b2185c59..861249ca 100644 --- a/integration/rust_tests/signature/types.rs +++ b/integration/rust_tests/signature/types.rs @@ -1,16 +1,16 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local_example_latest_guest #![allow(dead_code)] #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] -use std::io::Cursor; -use polyglot_rs::{DecodingError, Encoder, Decoder, Kind}; use num_enum::TryFromPrimitive; -use std::convert::TryFrom; -use std::collections::HashMap; +use polyglot_rs::{Decoder, DecodingError, Encoder, Kind}; use regex::Regex; +use std::collections::HashMap; +use std::convert::TryFrom; +use std::io::Cursor; pub trait Encode { fn encode<'a>( a: Option<&Self>, @@ -26,9 +26,7 @@ trait EncodeSelf { ) -> Result<&'a mut Cursor>, Box>; } pub trait Decode { - fn decode( - b: &mut Cursor<&mut Vec>, - ) -> Result, Box> + fn decode(b: &mut Cursor<&mut Vec>) -> Result, Box> where Self: Sized; } @@ -291,10 +289,7 @@ impl EncodeSelf for Option { impl Decode for ModelWithSingleStringFieldAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> { if d.decode_none() { return Ok(None); } @@ -428,10 +423,7 @@ impl EncodeSelf for Option { impl Decode for ModelWithSingleInt32FieldAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> { if d.decode_none() { return Ok(None); } @@ -576,10 +568,7 @@ impl EncodeSelf for Option { impl Decode for ModelWithMultipleFieldsAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> { if d.decode_none() { return Ok(None); } @@ -657,8 +646,7 @@ impl Decode for ModelWithEnum { return Err(error); } let mut x = ModelWithEnum::new(); - x - .enum_field = GenericEnum::try_from(d.decode_u32()?) + x.enum_field = GenericEnum::try_from(d.decode_u32()?) .ok() .ok_or(DecodingError::InvalidEnum)?; Ok(Some(x)) @@ -729,8 +717,7 @@ impl Decode for ModelWithEnumAndDescription { return Err(error); } let mut x = ModelWithEnumAndDescription::new(); - x - .enum_field = GenericEnum::try_from(d.decode_u32()?) + x.enum_field = GenericEnum::try_from(d.decode_u32()?) .ok() .ok_or(DecodingError::InvalidEnum)?; Ok(Some(x)) @@ -801,8 +788,7 @@ impl Decode for ModelWithEnumAccessor { return Err(error); } let mut x = ModelWithEnumAccessor::new(); - x - .enum_field = GenericEnum::try_from(d.decode_u32()?) + x.enum_field = GenericEnum::try_from(d.decode_u32()?) .ok() .ok_or(DecodingError::InvalidEnum)?; Ok(Some(x)) @@ -873,10 +859,7 @@ impl EncodeSelf for Option { impl Decode for ModelWithEnumAccessorAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> { if d.decode_none() { return Ok(None); } @@ -884,8 +867,7 @@ impl Decode for ModelWithEnumAccessorAndDescription { return Err(error); } let mut x = ModelWithEnumAccessorAndDescription::new(); - x - .enum_field = GenericEnum::try_from(d.decode_u32()?) + x.enum_field = GenericEnum::try_from(d.decode_u32()?) .ok() .ok_or(DecodingError::InvalidEnum)?; Ok(Some(x)) @@ -914,21 +896,16 @@ impl ModelWithMultipleFieldsAccessor { pub fn get_string_field(&self) -> String { self.string_field.clone() } - pub fn set_string_field( - &mut self, - mut v: String, - ) -> Result<(), Box> { + pub fn set_string_field(&mut self, mut v: String) -> Result<(), Box> { if !Regex::new("^[a-zA-Z0-9]*$")?.is_match(v.as_str()) { - return Err( - Box::::from("value must match ^[a-zA-Z0-9]*$"), - ); + return Err(Box::::from( + "value must match ^[a-zA-Z0-9]*$", + )); } if v.len() > 20 || v.len() < 1 { - return Err( - Box::< - dyn std::error::Error, - >::from("value must be between { .Minimum }} and 20"), - ); + return Err(Box::::from( + "value must be between { .Minimum }} and 20", + )); } v = v.to_uppercase(); self.string_field = v; @@ -939,11 +916,9 @@ impl ModelWithMultipleFieldsAccessor { } pub fn set_int32_field(&mut self, v: i32) -> Result<(), Box> { if v > 100 || v < 0 { - return Err( - Box::< - dyn std::error::Error, - >::from("value must be between { .Minimum }} and 100"), - ); + return Err(Box::::from( + "value must be between { .Minimum }} and 100", + )); } self.int32_field = v; Ok(()) @@ -1024,10 +999,7 @@ impl ModelWithMultipleFieldsAccessorAndDescription { pub fn get_string_field(&self) -> String { self.string_field.clone() } - pub fn set_string_field( - &mut self, - mut v: String, - ) -> Result<(), Box> { + pub fn set_string_field(&mut self, mut v: String) -> Result<(), Box> { self.string_field = v; Ok(()) } @@ -1086,10 +1058,8 @@ impl EncodeSelf for Option { impl Decode for ModelWithMultipleFieldsAccessorAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> + { if d.decode_none() { return Ok(None); } @@ -1105,9 +1075,7 @@ impl Decode for ModelWithMultipleFieldsAccessorAndDescription { #[derive(Clone, Debug, PartialEq)] pub struct ModelWithEmbeddedModels { pub embedded_empty_model: Option, - pub embedded_model_array_with_multiple_fields_accessor: Vec< - ModelWithMultipleFieldsAccessor, - >, + pub embedded_model_array_with_multiple_fields_accessor: Vec, } impl ModelWithEmbeddedModels { pub fn new() -> Self { @@ -1132,7 +1100,8 @@ impl EncodeSelf for ModelWithEmbeddedModels { ) -> Result<&'a mut Cursor>, Box> { self.embedded_empty_model.encode_self(e)?; e.encode_array( - self.embedded_model_array_with_multiple_fields_accessor.len(), + self.embedded_model_array_with_multiple_fields_accessor + .len(), Kind::Any, )?; for a in &self.embedded_model_array_with_multiple_fields_accessor { @@ -1179,14 +1148,11 @@ impl Decode for ModelWithEmbeddedModels { } let mut x = ModelWithEmbeddedModels::new(); x.embedded_empty_model = EmptyModel::decode(d)?; - let size_embedded_model_array_with_multiple_fields_accessor = d - .decode_array(Kind::Any)?; + let size_embedded_model_array_with_multiple_fields_accessor = d.decode_array(Kind::Any)?; for _ in 0..size_embedded_model_array_with_multiple_fields_accessor { - x.embedded_model_array_with_multiple_fields_accessor - .push( - ModelWithMultipleFieldsAccessor::decode(d)? - .ok_or(DecodingError::InvalidArray)?, - ); + x.embedded_model_array_with_multiple_fields_accessor.push( + ModelWithMultipleFieldsAccessor::decode(d)?.ok_or(DecodingError::InvalidArray)?, + ); } Ok(Some(x)) } @@ -1194,9 +1160,7 @@ impl Decode for ModelWithEmbeddedModels { #[derive(Clone, Debug, PartialEq)] pub struct ModelWithEmbeddedModelsAndDescription { pub embedded_empty_model: Option, - pub embedded_model_array_with_multiple_fields_accessor: Vec< - ModelWithMultipleFieldsAccessor, - >, + pub embedded_model_array_with_multiple_fields_accessor: Vec, } impl ModelWithEmbeddedModelsAndDescription { pub fn new() -> Self { @@ -1221,7 +1185,8 @@ impl EncodeSelf for ModelWithEmbeddedModelsAndDescription { ) -> Result<&'a mut Cursor>, Box> { self.embedded_empty_model.encode_self(e)?; e.encode_array( - self.embedded_model_array_with_multiple_fields_accessor.len(), + self.embedded_model_array_with_multiple_fields_accessor + .len(), Kind::Any, )?; for a in &self.embedded_model_array_with_multiple_fields_accessor { @@ -1259,10 +1224,7 @@ impl EncodeSelf for Option { impl Decode for ModelWithEmbeddedModelsAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> { if d.decode_none() { return Ok(None); } @@ -1271,14 +1233,11 @@ impl Decode for ModelWithEmbeddedModelsAndDescription { } let mut x = ModelWithEmbeddedModelsAndDescription::new(); x.embedded_empty_model = EmptyModel::decode(d)?; - let size_embedded_model_array_with_multiple_fields_accessor = d - .decode_array(Kind::Any)?; + let size_embedded_model_array_with_multiple_fields_accessor = d.decode_array(Kind::Any)?; for _ in 0..size_embedded_model_array_with_multiple_fields_accessor { - x.embedded_model_array_with_multiple_fields_accessor - .push( - ModelWithMultipleFieldsAccessor::decode(d)? - .ok_or(DecodingError::InvalidArray)?, - ); + x.embedded_model_array_with_multiple_fields_accessor.push( + ModelWithMultipleFieldsAccessor::decode(d)?.ok_or(DecodingError::InvalidArray)?, + ); } Ok(Some(x)) } @@ -1286,9 +1245,7 @@ impl Decode for ModelWithEmbeddedModelsAndDescription { #[derive(Clone, Debug, PartialEq)] pub struct ModelWithEmbeddedModelsAccessor { embedded_empty_model: Option, - embedded_model_array_with_multiple_fields_accessor: Vec< - ModelWithMultipleFieldsAccessor, - >, + embedded_model_array_with_multiple_fields_accessor: Vec, } impl ModelWithEmbeddedModelsAccessor { pub fn new() -> Self { @@ -1313,7 +1270,8 @@ impl EncodeSelf for ModelWithEmbeddedModelsAccessor { ) -> Result<&'a mut Cursor>, Box> { self.embedded_empty_model.encode_self(e)?; e.encode_array( - self.embedded_model_array_with_multiple_fields_accessor.len(), + self.embedded_model_array_with_multiple_fields_accessor + .len(), Kind::Any, )?; for a in &self.embedded_model_array_with_multiple_fields_accessor { @@ -1360,14 +1318,11 @@ impl Decode for ModelWithEmbeddedModelsAccessor { } let mut x = ModelWithEmbeddedModelsAccessor::new(); x.embedded_empty_model = EmptyModel::decode(d)?; - let size_embedded_model_array_with_multiple_fields_accessor = d - .decode_array(Kind::Any)?; + let size_embedded_model_array_with_multiple_fields_accessor = d.decode_array(Kind::Any)?; for _ in 0..size_embedded_model_array_with_multiple_fields_accessor { - x.embedded_model_array_with_multiple_fields_accessor - .push( - ModelWithMultipleFieldsAccessor::decode(d)? - .ok_or(DecodingError::InvalidArray)?, - ); + x.embedded_model_array_with_multiple_fields_accessor.push( + ModelWithMultipleFieldsAccessor::decode(d)?.ok_or(DecodingError::InvalidArray)?, + ); } Ok(Some(x)) } @@ -1396,9 +1351,7 @@ impl ModelWithEmbeddedModelsAccessor { #[derive(Clone, Debug, PartialEq)] pub struct ModelWithEmbeddedModelsAccessorAndDescription { embedded_empty_model: Option, - embedded_model_array_with_multiple_fields_accessor: Vec< - ModelWithMultipleFieldsAccessor, - >, + embedded_model_array_with_multiple_fields_accessor: Vec, } impl ModelWithEmbeddedModelsAccessorAndDescription { pub fn new() -> Self { @@ -1423,7 +1376,8 @@ impl EncodeSelf for ModelWithEmbeddedModelsAccessorAndDescription { ) -> Result<&'a mut Cursor>, Box> { self.embedded_empty_model.encode_self(e)?; e.encode_array( - self.embedded_model_array_with_multiple_fields_accessor.len(), + self.embedded_model_array_with_multiple_fields_accessor + .len(), Kind::Any, )?; for a in &self.embedded_model_array_with_multiple_fields_accessor { @@ -1461,10 +1415,8 @@ impl EncodeSelf for Option { impl Decode for ModelWithEmbeddedModelsAccessorAndDescription { fn decode( d: &mut Cursor<&mut Vec>, - ) -> Result< - Option, - Box, - > { + ) -> Result, Box> + { if d.decode_none() { return Ok(None); } @@ -1473,14 +1425,11 @@ impl Decode for ModelWithEmbeddedModelsAccessorAndDescription { } let mut x = ModelWithEmbeddedModelsAccessorAndDescription::new(); x.embedded_empty_model = EmptyModel::decode(d)?; - let size_embedded_model_array_with_multiple_fields_accessor = d - .decode_array(Kind::Any)?; + let size_embedded_model_array_with_multiple_fields_accessor = d.decode_array(Kind::Any)?; for _ in 0..size_embedded_model_array_with_multiple_fields_accessor { - x.embedded_model_array_with_multiple_fields_accessor - .push( - ModelWithMultipleFieldsAccessor::decode(d)? - .ok_or(DecodingError::InvalidArray)?, - ); + x.embedded_model_array_with_multiple_fields_accessor.push( + ModelWithMultipleFieldsAccessor::decode(d)?.ok_or(DecodingError::InvalidArray)?, + ); } Ok(Some(x)) } @@ -1611,7 +1560,11 @@ impl EncodeSelf for ModelWithAllFieldTypes { e.encode_string(&k)?; e.encode_string(&v)?; } - e.encode_map(self.string_map_field_embedded.len(), Kind::String, Kind::Any)?; + e.encode_map( + self.string_map_field_embedded.len(), + Kind::String, + Kind::Any, + )?; for (k, v) in &self.string_map_field_embedded { e.encode_string(&k)?; v.encode_self(e)?; @@ -1852,13 +1805,13 @@ impl Decode for ModelWithAllFieldTypes { for _ in 0..size_float64_array_field { x.float64_array_field.push(d.decode_f64()?); } - x - .enum_field = GenericEnum::try_from(d.decode_u32()?) + x.enum_field = GenericEnum::try_from(d.decode_u32()?) .ok() .ok_or(DecodingError::InvalidEnum)?; let size_enum_array_field = d.decode_array(Kind::U32)?; for _ in 0..size_enum_array_field { - x.enum_array_field.push(GenericEnum::try_from(d.decode_u32()?)?); + x.enum_array_field + .push(GenericEnum::try_from(d.decode_u32()?)?); } let size_enum_map_field = d.decode_map(Kind::U32, Kind::String)?; for _ in 0..size_enum_map_field { diff --git a/integration/typescript_tests/function/index.ts b/integration/typescript_tests/function/index.ts index 6ad83994..5f3c121a 100644 --- a/integration/typescript_tests/function/index.ts +++ b/integration/typescript_tests/function/index.ts @@ -2,7 +2,7 @@ import * as signature from "signature"; export function example(ctx?: signature.ModelWithAllFieldTypes): signature.ModelWithAllFieldTypes | undefined { console.log("This is a Typescript Function"); - if (ctx !== undefined) { + if (typeof ctx !== "undefined") { ctx.stringField = "This is a Typescript Function" } return signature.Next(ctx); diff --git a/integration/typescript_tests/generated/generated.d.ts b/integration/typescript_tests/generated/generated.d.ts index 419a6670..fb63375c 100644 --- a/integration/typescript_tests/generated/generated.d.ts +++ b/integration/typescript_tests/generated/generated.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: generated import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/generated/generated.js b/integration/typescript_tests/generated/generated.js index 0f23489b..2542d30d 100644 --- a/integration/typescript_tests/generated/generated.js +++ b/integration/typescript_tests/generated/generated.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: generated "use strict"; @@ -35,7 +35,7 @@ class Context { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.a = decoder.int32(); diff --git a/integration/typescript_tests/generated/generated.js.map b/integration/typescript_tests/generated/generated.js.map index dce0b1c2..43815889 100644 --- a/integration/typescript_tests/generated/generated.js.map +++ b/integration/typescript_tests/generated/generated.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "generated.js", - "sourcesContent": ["// Code generated by scale-signature 0.3.20, DO NOT EDIT.\n// output: generated\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport class Context {\n a: number;\n b: number;\n c: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.a = decoder.int32();\n this.b = decoder.int32();\n this.c = decoder.int32();\n } else {\n this.a = 0;\n this.b = 0;\n this.c = 0;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.a);\n encoder.int32(this.b);\n encoder.int32(this.c);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): Context | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new Context(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], - "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA,EAQnB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,QAAQ,QAAW;AACrB,cAAM;AAAA,MACR;AACA,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AAAA,IACzB,OAAO;AACL,WAAK,IAAI;AACT,WAAK,IAAI;AACT,WAAK,IAAI;AAAA,IACX;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AACxB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAuC;AACpD,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", + "sourcesContent": ["// Code generated by scale-signature 0.4.0, DO NOT EDIT.\n// output: generated\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport class Context {\n a: number;\n b: number;\n c: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.a = decoder.int32();\n this.b = decoder.int32();\n this.c = decoder.int32();\n } else {\n this.a = 0;\n this.b = 0;\n this.c = 0;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.a);\n encoder.int32(this.b);\n encoder.int32(this.c);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): Context | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new Context(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA,EAQnB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;AACA,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AACvB,WAAK,IAAI,QAAQ,MAAM;AAAA,IACzB,OAAO;AACL,WAAK,IAAI;AACT,WAAK,IAAI;AACT,WAAK,IAAI;AAAA,IACX;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AACxB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AACpB,YAAQ,MAAM,KAAK,CAAC;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAuC;AACpD,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,QAAQ,OAAO;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": [] } diff --git a/integration/typescript_tests/host_signature/index.d.ts b/integration/typescript_tests/host_signature/index.d.ts index 5e7f9287..9ef199fa 100644 --- a/integration/typescript_tests/host_signature/index.d.ts +++ b/integration/typescript_tests/host_signature/index.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host import { Signature as SignatureInterface } from "@loopholelabs/scale-signature-interfaces"; diff --git a/integration/typescript_tests/host_signature/index.js b/integration/typescript_tests/host_signature/index.js index 74d48dfa..78a61017 100644 --- a/integration/typescript_tests/host_signature/index.js +++ b/integration/typescript_tests/host_signature/index.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host "use strict"; diff --git a/integration/typescript_tests/host_signature/index.js.map b/integration/typescript_tests/host_signature/index.js.map index 185e65f3..bcc51f6e 100644 --- a/integration/typescript_tests/host_signature/index.js.map +++ b/integration/typescript_tests/host_signature/index.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "index.js", - "sourcesContent": ["// Code generated by scale-signature 0.3.20, DO NOT EDIT.\n// output: local-example-latest-host\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface } from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// New returns a new signature and tells the Scale Runtime how to use it\n//\n// This function should be passed into the scale runtime config as an argument\nexport function New(): Signature {\n return new Signature();\n}\n\n// Signature is the host representation of the signature\n//\n// Users should not use this type directly, but instead pass the New() function\n// to the Scale Runtime\nexport class Signature implements SignatureInterface {\n public context: ModelWithAllFieldTypes;\n\n constructor() {\n this.context = new ModelWithAllFieldTypes();\n }\n\n // Read reads the context from the given Uint8Array and returns an error if one occurred\n //\n // This method is meant to be used by the Scale Runtime to deserialize the Signature\n Read(b: Uint8Array): Error | undefined {\n const dec = new Decoder(b);\n try {\n Object.assign(this.context, ModelWithAllFieldTypes.decode(dec));\n } catch (err) {\n return err as Error;\n }\n return undefined;\n }\n\n // Write writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to serialize the Signature\n Write(): Uint8Array {\n const enc = new Encoder();\n this.context.encode(enc);\n return enc.bytes;\n }\n\n // Error writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to return an error\n Error(err: Error): Uint8Array {\n const enc = new Encoder();\n enc.error(err);\n return enc.bytes;\n }\n\n // Hash returns the hash of the signature\n //\n // This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility\n Hash(): string {\n return hash;\n }\n}\n"], + "sourcesContent": ["// Code generated by scale-signature 0.4.0, DO NOT EDIT.\n// output: local-example-latest-host\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface } from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// New returns a new signature and tells the Scale Runtime how to use it\n//\n// This function should be passed into the scale runtime config as an argument\nexport function New(): Signature {\n return new Signature();\n}\n\n// Signature is the host representation of the signature\n//\n// Users should not use this type directly, but instead pass the New() function\n// to the Scale Runtime\nexport class Signature implements SignatureInterface {\n public context: ModelWithAllFieldTypes;\n\n constructor() {\n this.context = new ModelWithAllFieldTypes();\n }\n\n // Read reads the context from the given Uint8Array and returns an error if one occurred\n //\n // This method is meant to be used by the Scale Runtime to deserialize the Signature\n Read(b: Uint8Array): Error | undefined {\n const dec = new Decoder(b);\n try {\n Object.assign(this.context, ModelWithAllFieldTypes.decode(dec));\n } catch (err) {\n return err as Error;\n }\n return undefined;\n }\n\n // Write writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to serialize the Signature\n Write(): Uint8Array {\n const enc = new Encoder();\n this.context.encode(enc);\n return enc.bytes;\n }\n\n // Error writes the signature into a Uint8Array and returns it\n //\n // This method is meant to be used by the Scale Runtime to return an error\n Error(err: Error): Uint8Array {\n const enc = new Encoder();\n enc.error(err);\n return enc.bytes;\n }\n\n // Hash returns the hash of the signature\n //\n // This method is meant to be used by the Scale Runtime to validate Signature and Function compatibility\n Hash(): string {\n return hash;\n }\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,sBAAuC;AAEvC,0BAAc,oBARd;AASA,mBAAuC;AAEvC,MAAM,OAAO;AAKN,SAAS,MAAiB;AAC/B,SAAO,IAAI,UAAU;AACvB;AAMO,MAAM,UAAwC;AAAA,EAGnD,cAAc;AACZ,SAAK,UAAU,IAAI,oCAAuB;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA,EAKA,KAAK,GAAkC;AACrC,UAAM,MAAM,IAAI,wBAAQ,CAAC;AACzB,QAAI;AACF,aAAO,OAAO,KAAK,SAAS,oCAAuB,OAAO,GAAG,CAAC;AAAA,IAChE,SAAS,KAAK;AACZ,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,QAAoB;AAClB,UAAM,MAAM,IAAI,wBAAQ;AACxB,SAAK,QAAQ,OAAO,GAAG;AACvB,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,KAAwB;AAC5B,UAAM,MAAM,IAAI,wBAAQ;AACxB,QAAI,MAAM,GAAG;AACb,WAAO,IAAI;AAAA,EACb;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe;AACb,WAAO;AAAA,EACT;AACF;", "names": [] } diff --git a/integration/typescript_tests/host_signature/index.ts b/integration/typescript_tests/host_signature/index.ts index 9b0f33be..e3d96165 100644 --- a/integration/typescript_tests/host_signature/index.ts +++ b/integration/typescript_tests/host_signature/index.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host /* eslint no-bitwise: off */ diff --git a/integration/typescript_tests/host_signature/types.d.ts b/integration/typescript_tests/host_signature/types.d.ts index e38ce582..42b316cf 100644 --- a/integration/typescript_tests/host_signature/types.d.ts +++ b/integration/typescript_tests/host_signature/types.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/host_signature/types.js b/integration/typescript_tests/host_signature/types.js index 1075f970..8e430c80 100644 --- a/integration/typescript_tests/host_signature/types.js +++ b/integration/typescript_tests/host_signature/types.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host "use strict"; @@ -61,7 +61,7 @@ class EmptyModel { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } } else { @@ -99,7 +99,7 @@ class EmptyModelWithDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } } else { @@ -137,7 +137,7 @@ class ModelWithSingleStringField { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -178,7 +178,7 @@ class ModelWithSingleStringFieldAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -219,7 +219,7 @@ class ModelWithSingleInt32Field { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -260,7 +260,7 @@ class ModelWithSingleInt32FieldAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -301,7 +301,7 @@ class ModelWithMultipleFields { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -345,7 +345,7 @@ class ModelWithMultipleFieldsAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -389,7 +389,7 @@ class ModelWithEnum { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -430,7 +430,7 @@ class ModelWithEnumAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -471,7 +471,7 @@ class ModelWithEnumAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -512,7 +512,7 @@ class ModelWithEnumAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -553,7 +553,7 @@ class ModelWithMultipleFieldsAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -597,7 +597,7 @@ class ModelWithMultipleFieldsAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -641,7 +641,7 @@ class ModelWithEmbeddedModels { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -649,7 +649,7 @@ class ModelWithEmbeddedModels { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -662,7 +662,7 @@ class ModelWithEmbeddedModels { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -701,7 +701,7 @@ class ModelWithEmbeddedModelsAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -709,7 +709,7 @@ class ModelWithEmbeddedModelsAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -722,7 +722,7 @@ class ModelWithEmbeddedModelsAndDescription { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -761,7 +761,7 @@ class ModelWithEmbeddedModelsAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -769,7 +769,7 @@ class ModelWithEmbeddedModelsAccessor { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -782,7 +782,7 @@ class ModelWithEmbeddedModelsAccessor { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -821,7 +821,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -829,7 +829,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -842,7 +842,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -881,7 +881,7 @@ class ModelWithAllFieldTypes { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.modelField = EmptyModel.decode(decoder); @@ -889,7 +889,7 @@ class ModelWithAllFieldTypes { this.modelArrayField = new Array(modelArrayFieldSize); for (let i = 0; i < modelArrayFieldSize; i += 1) { const x = EmptyModel.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.modelArrayField[i] = x; } } @@ -911,7 +911,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < stringMapFieldEmbeddedSize; i++) { let key = decoder.string(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.stringMapFieldEmbedded.set(key, val); } } @@ -933,7 +933,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < int32MapFieldEmbeddedSize; i++) { let key = decoder.int32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.int32MapFieldEmbedded.set(key, val); } } @@ -955,7 +955,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < int64MapFieldEmbeddedSize; i++) { let key = decoder.int64(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.int64MapFieldEmbedded.set(key, val); } } @@ -977,7 +977,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.uint32MapFieldEmbedded.set(key, val); } } @@ -999,7 +999,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) { let key = decoder.uint64(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.uint64MapFieldEmbedded.set(key, val); } } @@ -1033,7 +1033,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < enumMapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.enumMapFieldEmbedded.set(key, val); } } @@ -1090,7 +1090,7 @@ class ModelWithAllFieldTypes { * @throws {Error} */ encode(encoder) { - if (this.modelField === void 0) { + if (typeof this.modelField === "undefined") { encoder.null(); } else { this.modelField.encode(encoder); diff --git a/integration/typescript_tests/host_signature/types.js.map b/integration/typescript_tests/host_signature/types.js.map index 95136695..cddb5aef 100644 --- a/integration/typescript_tests/host_signature/types.js.map +++ b/integration/typescript_tests/host_signature/types.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "types.js", - "sourcesContent": ["// Code generated by scale-signature 0.3.20, DO NOT EDIT.\n// output: local-example-latest-host\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (x !== undefined) {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.modelField === undefined) {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], - "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuC;AAEhC,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,gBAAa,KAAb;AAEA,EAAAA,0BAAA,iBAAc,KAAd;AAEA,EAAAA,0BAAA,kBAAe,KAAf;AALU,SAAAA;AAAA,GAAA;AAQL,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAItB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,QAAQ,QAAW;AACrB,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AAAA,IACP;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,O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qB,QAAQ,CAAC,KAAK,QAAQ;AAC9C,cAAQ,OAAO,GAAG;AAClB,UAAI,OAAO,OAAO;AAAA,IACpB,CAAC;AACD,YAAQ,WAAW,KAAK,UAAU;AAClC,UAAM,wBAAwB,KAAK,gBAAgB;AACnD,YAAQ,MAAM,uBAAuB,qBAAK,UAAU;AACpD,aAAS,IAAI,GAAG,IAAI,uBAAuB,KAAK,GAAG;AACjD,cAAQ,WAAW,KAAK,gBAAgB,CAAC,CAAC;AAAA,IAC5C;AACA,YAAQ,QAAQ,KAAK,SAAS;AAC9B,UAAM,uBAAuB,KAAK,eAAe;AACjD,YAAQ,MAAM,sBAAsB,qBAAK,OAAO;AAChD,aAAS,IAAI,GAAG,IAAI,sBAAsB,KAAK,GAAG;AAChD,cAAQ,QAAQ,KAAK,eAAe,CAAC,CAAC;AAAA,IACxC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAsD;AACnE,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,uBAAuB,OAAO;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", + "sourcesContent": ["// Code generated by scale-signature 0.4.0, DO NOT EDIT.\n// output: local-example-latest-host\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuC;AAEhC,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,gBAAa,KAAb;AAEA,EAAAA,0BAAA,iBAAc,KAAd;AAEA,EAAAA,0BAAA,kBAAe,KAAf;AALU,SAAAA;AAAA,GAAA;AAQL,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAItB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AAAA,IACP;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAA0C;AACvD,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,WAAW,OAAO;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;AAGO,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA,EAIrC,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;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MAAM,uBAAuB,qBAAK,UAAU;AACpD,aAAS,IAAI,GAAG,IAAI,uBAAuB,KAAK,GAAG;AACjD,cAAQ,WAAW,KAAK,gBAAgB,CAAC,CAAC;AAAA,IAC5C;AACA,YAAQ,QAAQ,KAAK,SAAS;AAC9B,UAAM,uBAAuB,KAAK,eAAe;AACjD,YAAQ,MAAM,sBAAsB,qBAAK,OAAO;AAChD,aAAS,IAAI,GAAG,IAAI,sBAAsB,KAAK,GAAG;AAChD,cAAQ,QAAQ,KAAK,eAAe,CAAC,CAAC;AAAA,IACxC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAAsD;AACnE,QAAI,QAAQ,KAAK,GAAG;AAClB,aAAO;AAAA,IACT;AACA,WAAO,IAAI,uBAAuB,OAAO;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": ["GenericEnum"] } diff --git a/integration/typescript_tests/host_signature/types.ts b/integration/typescript_tests/host_signature/types.ts index 28148ccd..19ae0845 100644 --- a/integration/typescript_tests/host_signature/types.ts +++ b/integration/typescript_tests/host_signature/types.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-host import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" @@ -21,7 +21,7 @@ export class EmptyModel { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -63,7 +63,7 @@ export class EmptyModelWithDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -106,7 +106,7 @@ export class ModelWithSingleStringField { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -153,7 +153,7 @@ export class ModelWithSingleStringFieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -199,7 +199,7 @@ export class ModelWithSingleInt32Field { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -246,7 +246,7 @@ export class ModelWithSingleInt32FieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -294,7 +294,7 @@ export class ModelWithMultipleFields { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -346,7 +346,7 @@ export class ModelWithMultipleFieldsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -395,7 +395,7 @@ export class ModelWithEnum { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -442,7 +442,7 @@ export class ModelWithEnumAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -488,7 +488,7 @@ export class ModelWithEnumAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -535,7 +535,7 @@ export class ModelWithEnumAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -583,7 +583,7 @@ export class ModelWithMultipleFieldsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -635,7 +635,7 @@ export class ModelWithMultipleFieldsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -686,7 +686,7 @@ export class ModelWithEmbeddedModels { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -694,7 +694,7 @@ export class ModelWithEmbeddedModels { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -708,7 +708,7 @@ export class ModelWithEmbeddedModels { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -754,7 +754,7 @@ export class ModelWithEmbeddedModelsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -762,7 +762,7 @@ export class ModelWithEmbeddedModelsAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -776,7 +776,7 @@ export class ModelWithEmbeddedModelsAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -821,7 +821,7 @@ export class ModelWithEmbeddedModelsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -829,7 +829,7 @@ export class ModelWithEmbeddedModelsAccessor { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -843,7 +843,7 @@ export class ModelWithEmbeddedModelsAccessor { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -889,7 +889,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -897,7 +897,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -911,7 +911,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -1020,7 +1020,7 @@ export class ModelWithAllFieldTypes { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.modelField = EmptyModel.decode(decoder); @@ -1028,7 +1028,7 @@ export class ModelWithAllFieldTypes { this.modelArrayField = new Array(modelArrayFieldSize); for (let i = 0; i < modelArrayFieldSize; i += 1) { const x = EmptyModel.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.modelArrayField[i] = x; } } @@ -1050,7 +1050,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < stringMapFieldEmbeddedSize; i++) { let key = decoder.string(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.stringMapFieldEmbedded.set(key, val); } } @@ -1072,7 +1072,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int32MapFieldEmbeddedSize; i++) { let key = decoder.int32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int32MapFieldEmbedded.set(key, val); } } @@ -1094,7 +1094,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int64MapFieldEmbeddedSize; i++) { let key = decoder.int64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int64MapFieldEmbedded.set(key, val); } } @@ -1116,7 +1116,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint32MapFieldEmbedded.set(key, val); } } @@ -1138,7 +1138,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) { let key = decoder.uint64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint64MapFieldEmbedded.set(key, val); } } @@ -1172,7 +1172,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < enumMapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.enumMapFieldEmbedded.set(key, val); } } @@ -1230,7 +1230,7 @@ export class ModelWithAllFieldTypes { * @throws {Error} */ encode (encoder: Encoder) { - if (this.modelField === undefined) { + if (typeof this.modelField === "undefined") { encoder.null(); } else { this.modelField.encode(encoder); diff --git a/integration/typescript_tests/signature/index.d.ts b/integration/typescript_tests/signature/index.d.ts index 8a9f944d..1fee345a 100644 --- a/integration/typescript_tests/signature/index.d.ts +++ b/integration/typescript_tests/signature/index.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest export * from "./types"; diff --git a/integration/typescript_tests/signature/index.js b/integration/typescript_tests/signature/index.js index f7959ace..fd1bcb45 100644 --- a/integration/typescript_tests/signature/index.js +++ b/integration/typescript_tests/signature/index.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest "use strict"; @@ -39,7 +39,7 @@ global.READ_BUFFER = new Uint8Array().buffer; const hash = "3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5"; function Write(ctx) { const enc = new import_polyglot.Encoder(); - if (ctx === void 0) { + if (typeof ctx === "undefined") { enc.null(); } else { ctx.encode(enc); diff --git a/integration/typescript_tests/signature/index.js.map b/integration/typescript_tests/signature/index.js.map index 809c4e3c..85d5dd0f 100644 --- a/integration/typescript_tests/signature/index.js.map +++ b/integration/typescript_tests/signature/index.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "index.js", - "sourcesContent": ["// Code generated by scale-signature 0.3.20, DO NOT EDIT.\n// output: local-example-latest-guest\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface, TYPESCRIPT_ADDRESS_OF, TYPESCRIPT_NEXT} from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\n(global as any).WRITE_BUFFER = new Uint8Array().buffer;\n(global as any).READ_BUFFER = new Uint8Array().buffer;\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// Write serializes the signature into the global WRITE_BUFFER and returns the pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Write(ctx?: ModelWithAllFieldTypes): number[] {\n const enc = new Encoder();\n if (ctx === undefined) {\n enc.null();\n } else {\n ctx.encode(enc);\n }\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Read deserializes signature from the global READ_BUFFER\n//\n// Users should not use this method.\nexport function Read(): ModelWithAllFieldTypes | undefined {\n const dec = new Decoder(new Uint8Array((global as any).READ_BUFFER));\n return ModelWithAllFieldTypes.decode(dec);\n}\n\n// Error serializes an error into the global writeBuffer and returns a pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Error(err: Error): number[] {\n const enc = new Encoder();\n enc.error(err);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Resize resizes the global READ_BUFFER to the given size and returns the pointer to the buffer\n//\n// Users should not use this method.\nexport function Resize(size: number): number {\n (global as any).READ_BUFFER = new Uint8Array(size).buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n return addrof((global as any).READ_BUFFER);\n}\n\n// Hash returns the hash of the Scale Signature\n//\n// Users should not use this method.\nexport function Hash(): number[] {\n const enc = new Encoder();\n enc.string(hash);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Next calls the next function in the Scale Function Chain\nexport function Next(ctx?: ModelWithAllFieldTypes): ModelWithAllFieldTypes | undefined {\n const [ptr, len] = Write(ctx);\n const next = (global as any)[TYPESCRIPT_NEXT];\n next([ptr, len]);\n return Read();\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,wCAAuF;AACvF,sBAAuC;AAKvC,0BAAc,oBAXd;AAYA,mBAAuC;AAJtC,OAAe,eAAe,IAAI,WAAW,EAAE;AAC/C,OAAe,cAAc,IAAI,WAAW,EAAE;AAK/C,MAAM,OAAO;AAKN,SAAS,MAAM,KAAwC;AAC5D,QAAM,MAAM,IAAI,wBAAQ;AACxB,MAAI,QAAQ,QAAW;AACrB,QAAI,KAAK;AAAA,EACX,OAAO;AACL,QAAI,OAAO,GAAG;AAAA,EAChB;AACA,QAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,EAAC,OAAe,eAAe,IAAI,MAAM;AACzC,QAAM,SAAU,OAAe,uDAAqB;AACpD,QAAM,MAAM,OAAQ,OAAe,YAAY;AAC/C,SAAO,CAAC,KAAK,GAAG;AAClB;AAKO,SAAS,OAA2C;AACzD,QAAM,MAAM,IAAI,wBAAQ,IAAI,WAAY,OAAe,WAAW,CAAC;AACnE,SAAO,oCAAuB,OAAO,GAAG;AAC1C;AAKO,SAASA,OAAM,KAAsB;AAC1C,QAAM,MAAM,IAAI,wBAAQ;AACxB,MAAI,MAAM,GAAG;AACb,QAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,EAAC,OAAe,eAAe,IAAI,MAAM;AACzC,QAAM,SAAU,OAAe,uDAAqB;AACpD,QAAM,MAAM,OAAQ,OAAe,YAAY;AAC/C,SAAO,CAAC,KAAK,GAAG;AAClB;AAKO,SAAS,OAAO,MAAsB;AAC3C,EAAC,OAAe,cAAc,IAAI,WAAW,IAAI,EAAE;AACnD,QAAM,SAAU,OAAe,uDAAqB;AACpD,SAAO,OAAQ,OAAe,WAAW;AAC3C;AAKO,SAAS,OAAiB;AAC/B,QAAM,MAAM,IAAI,wBAAQ;AACxB,MAAI,OAAO,IAAI;AACf,QAAM,MAAM,IAAI,MAAM,OAAO;AAC7B,EAAC,OAAe,eAAe,IAAI,MAAM;AACzC,QAAM,SAAU,OAAe,uDAAqB;AACpD,QAAM,MAAM,OAAQ,OAAe,YAAY;AAC/C,SAAO,CAAC,KAAK,GAAG;AAClB;AAGO,SAAS,KAAK,KAAkE;AACrF,QAAM,CAAC,KAAK,GAAG,IAAI,MAAM,GAAG;AAC5B,QAAM,OAAQ,OAAe,iDAAe;AAC5C,OAAK,CAAC,KAAK,GAAG,CAAC;AACf,SAAO,KAAK;AACd;", + "sourcesContent": ["// Code generated by scale-signature 0.4.0, DO NOT EDIT.\n// output: local-example-latest-guest\n\n/* eslint no-bitwise: off */\n\nimport { Signature as SignatureInterface, TYPESCRIPT_ADDRESS_OF, TYPESCRIPT_NEXT} from \"@loopholelabs/scale-signature-interfaces\";\nimport { Decoder, Encoder, Kind } from \"@loopholelabs/polyglot\";\n\n(global as any).WRITE_BUFFER = new Uint8Array().buffer;\n(global as any).READ_BUFFER = new Uint8Array().buffer;\n\nexport * from \"./types\";\nimport { ModelWithAllFieldTypes } from \"./types\";\n\nconst hash = \"3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5\"\n\n// Write serializes the signature into the global WRITE_BUFFER and returns the pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Write(ctx?: ModelWithAllFieldTypes): number[] {\n const enc = new Encoder();\n if (typeof ctx === \"undefined\") {\n enc.null();\n } else {\n ctx.encode(enc);\n }\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Read deserializes signature from the global READ_BUFFER\n//\n// Users should not use this method.\nexport function Read(): ModelWithAllFieldTypes | undefined {\n const dec = new Decoder(new Uint8Array((global as any).READ_BUFFER));\n return ModelWithAllFieldTypes.decode(dec);\n}\n\n// Error serializes an error into the global writeBuffer and returns a pointer to the buffer and its size\n//\n// Users should not use this method.\nexport function Error(err: Error): number[] {\n const enc = new Encoder();\n enc.error(err);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Resize resizes the global READ_BUFFER to the given size and returns the pointer to the buffer\n//\n// Users should not use this method.\nexport function Resize(size: number): number {\n (global as any).READ_BUFFER = new Uint8Array(size).buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n return addrof((global as any).READ_BUFFER);\n}\n\n// Hash returns the hash of the Scale Signature\n//\n// Users should not use this method.\nexport function Hash(): number[] {\n const enc = new Encoder();\n enc.string(hash);\n const len = enc.bytes.buffer.byteLength;\n (global as any).WRITE_BUFFER = enc.bytes.buffer;\n const addrof = (global as any)[TYPESCRIPT_ADDRESS_OF];\n const ptr = addrof((global as any).WRITE_BUFFER);\n return [ptr, len];\n}\n\n// Next calls the next function in the Scale Function Chain\nexport function Next(ctx?: ModelWithAllFieldTypes): ModelWithAllFieldTypes | undefined {\n const [ptr, len] = Write(ctx);\n const next = (global as any)[TYPESCRIPT_NEXT];\n next([ptr, len]);\n return Read();\n}\n"], + "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,wCAAuF;AACvF,sBAAuC;AAKvC,0BAAc,oBAXd;AAYA,mBAAuC;AAJtC,OAAe,eAAe,IAAI,WAAW,EAAE;AAC/C,OAAe,cAAc,IAAI,WAAW,EAAE;AAK/C,MAAM,OAAO;AAKN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5C,OAAK,CAAC,KAAK,GAAG,CAAC;AACf,SAAO,KAAK;AACd;", "names": ["Error"] } diff --git a/integration/typescript_tests/signature/index.ts b/integration/typescript_tests/signature/index.ts index 1762d953..16edddda 100644 --- a/integration/typescript_tests/signature/index.ts +++ b/integration/typescript_tests/signature/index.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest /* eslint no-bitwise: off */ @@ -19,7 +19,7 @@ const hash = "3a592aa345d412faa2e6285ee048ca2ab5aa64b0caa2f9ca67b2c1e0792101e5" // Users should not use this method. export function Write(ctx?: ModelWithAllFieldTypes): number[] { const enc = new Encoder(); - if (ctx === undefined) { + if (typeof ctx === "undefined") { enc.null(); } else { ctx.encode(enc); diff --git a/integration/typescript_tests/signature/types.d.ts b/integration/typescript_tests/signature/types.d.ts index 9518701e..3c761f1d 100644 --- a/integration/typescript_tests/signature/types.d.ts +++ b/integration/typescript_tests/signature/types.d.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" diff --git a/integration/typescript_tests/signature/types.js b/integration/typescript_tests/signature/types.js index 1653e533..8283a9bf 100644 --- a/integration/typescript_tests/signature/types.js +++ b/integration/typescript_tests/signature/types.js @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest "use strict"; @@ -61,7 +61,7 @@ class EmptyModel { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } } else { @@ -99,7 +99,7 @@ class EmptyModelWithDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } } else { @@ -137,7 +137,7 @@ class ModelWithSingleStringField { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -178,7 +178,7 @@ class ModelWithSingleStringFieldAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -219,7 +219,7 @@ class ModelWithSingleInt32Field { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -260,7 +260,7 @@ class ModelWithSingleInt32FieldAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -301,7 +301,7 @@ class ModelWithMultipleFields { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -345,7 +345,7 @@ class ModelWithMultipleFieldsAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -389,7 +389,7 @@ class ModelWithEnum { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -430,7 +430,7 @@ class ModelWithEnumAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -472,7 +472,7 @@ class ModelWithEnumAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -520,7 +520,7 @@ class ModelWithEnumAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -569,7 +569,7 @@ class ModelWithMultipleFieldsAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -637,7 +637,7 @@ class ModelWithMultipleFieldsAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -693,7 +693,7 @@ class ModelWithEmbeddedModels { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -701,7 +701,7 @@ class ModelWithEmbeddedModels { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -714,7 +714,7 @@ class ModelWithEmbeddedModels { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -753,7 +753,7 @@ class ModelWithEmbeddedModelsAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -761,7 +761,7 @@ class ModelWithEmbeddedModelsAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -774,7 +774,7 @@ class ModelWithEmbeddedModelsAndDescription { * @throws {Error} */ encode(encoder) { - if (this.embeddedEmptyModel === void 0) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -815,7 +815,7 @@ class ModelWithEmbeddedModelsAccessor { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -823,7 +823,7 @@ class ModelWithEmbeddedModelsAccessor { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -848,7 +848,7 @@ class ModelWithEmbeddedModelsAccessor { * @throws {Error} */ encode(encoder) { - if (this.#embeddedEmptyModel === void 0) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -889,7 +889,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -897,7 +897,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -922,7 +922,7 @@ class ModelWithEmbeddedModelsAccessorAndDescription { * @throws {Error} */ encode(encoder) { - if (this.#embeddedEmptyModel === void 0) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -961,7 +961,7 @@ class ModelWithAllFieldTypes { err = decoder.error(); } catch (_) { } - if (err !== void 0) { + if (typeof err !== "undefined") { throw err; } this.modelField = EmptyModel.decode(decoder); @@ -969,7 +969,7 @@ class ModelWithAllFieldTypes { this.modelArrayField = new Array(modelArrayFieldSize); for (let i = 0; i < modelArrayFieldSize; i += 1) { const x = EmptyModel.decode(decoder); - if (x !== void 0) { + if (typeof x !== "undefined") { this.modelArrayField[i] = x; } } @@ -991,7 +991,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < stringMapFieldEmbeddedSize; i++) { let key = decoder.string(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.stringMapFieldEmbedded.set(key, val); } } @@ -1013,7 +1013,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < int32MapFieldEmbeddedSize; i++) { let key = decoder.int32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.int32MapFieldEmbedded.set(key, val); } } @@ -1035,7 +1035,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < int64MapFieldEmbeddedSize; i++) { let key = decoder.int64(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.int64MapFieldEmbedded.set(key, val); } } @@ -1057,7 +1057,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.uint32MapFieldEmbedded.set(key, val); } } @@ -1079,7 +1079,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) { let key = decoder.uint64(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.uint64MapFieldEmbedded.set(key, val); } } @@ -1113,7 +1113,7 @@ class ModelWithAllFieldTypes { for (let i = 0; i < enumMapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== void 0) { + if (typeof val !== "undefined") { this.enumMapFieldEmbedded.set(key, val); } } @@ -1170,7 +1170,7 @@ class ModelWithAllFieldTypes { * @throws {Error} */ encode(encoder) { - if (this.modelField === void 0) { + if (typeof this.modelField === "undefined") { encoder.null(); } else { this.modelField.encode(encoder); diff --git a/integration/typescript_tests/signature/types.js.map b/integration/typescript_tests/signature/types.js.map index b9eab2c2..9cb6da99 100644 --- a/integration/typescript_tests/signature/types.js.map +++ b/integration/typescript_tests/signature/types.js.map @@ -2,7 +2,7 @@ "version": 3, "sources": [""], "sourceRoot": "types.js", - "sourcesContent": ["// Code generated by scale-signature 0.3.20, DO NOT EDIT.\n// output: local-example-latest-guest\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n if (!/^[a-zA-Z0-9]*$/.test(val)) {\n throw new Error(\"value must match ^[a-zA-Z0-9]*$\");\n }\n if (val.length > 20 || val.length < 1) {\n throw new Error(\"length must be between 1 and 20\");\n }\n val = val.toUpperCase();\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n if (val > 100 || val < 0) {\n throw new Error(\"value must be between 0 and 100\");\n }\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.#embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (x !== undefined) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.#embeddedEmptyModel === undefined) {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (err !== undefined) {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (x !== undefined) {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (val !== undefined) {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (this.modelField === undefined) {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], - "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuC;AAEhC,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,gBAAa,KAAb;AAEA,EAAAA,0BAAA,iBAAc,KAAd;AAEA,EAAAA,0BAAA,kBAAe,KAAf;AALU,SAAAA;AAAA,GAAA;AAQL,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAItB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,QAAQ,QAAW;AACrB,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AAAA,IACP;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AAA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local-example-latest-guest\n\nimport { Encoder, Decoder, Kind } from \"@loopholelabs/polyglot\"\n\nexport enum GenericEnum {\n FirstValue = 0,\n\n SecondValue = 1,\n\n DefaultValue = 2,\n\n}\nexport class EmptyModel {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModel | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModel(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// EmptyModelWithDescription: Test Description\nexport class EmptyModelWithDescription {\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n } else {\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): EmptyModelWithDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new EmptyModelWithDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleStringField {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringField | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringField(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleStringFieldAndDescription: Test Description\nexport class ModelWithSingleStringFieldAndDescription {\n stringField: string;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n } else {\n this.stringField = \"DefaultValue\";\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleStringFieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleStringFieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithSingleInt32Field {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32Field | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32Field(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithSingleInt32FieldAndDescription: Test Description\nexport class ModelWithSingleInt32FieldAndDescription {\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.int32Field = decoder.int32();\n } else {\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithSingleInt32FieldAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithSingleInt32FieldAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFields {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFields | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFields(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAndDescription: Test Description\nexport class ModelWithMultipleFieldsAndDescription {\n stringField: string;\n\n int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.stringField = decoder.string();\n this.int32Field = decoder.int32();\n } else {\n this.stringField = \"DefaultValue\";\n this.int32Field = 32;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.stringField);\n encoder.int32(this.int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnum {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnum | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnum(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAndDescription: Test Description\nexport class ModelWithEnumAndDescription {\n enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.enumField = decoder.uint32();\n } else {\n this.enumField = GenericEnum.DefaultValue;\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEnumAccessor {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEnumAccessorAndDescription: Test Description\nexport class ModelWithEnumAccessorAndDescription {\n #enumField: GenericEnum;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#enumField = decoder.uint32();\n } else {\n this.#enumField = GenericEnum.DefaultValue;\n }\n }\n\n get enumField(): GenericEnum {\n return this.#enumField;\n }\n\n set enumField(val: GenericEnum) {\n this.#enumField = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.uint32(this.#enumField);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEnumAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEnumAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithMultipleFieldsAccessor {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n if (!/^[a-zA-Z0-9]*$/.test(val)) {\n throw new Error(\"value must match ^[a-zA-Z0-9]*$\");\n }\n if (val.length > 20 || val.length < 1) {\n throw new Error(\"length must be between 1 and 20\");\n }\n val = val.toUpperCase();\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n if (val > 100 || val < 0) {\n throw new Error(\"value must be between 0 and 100\");\n }\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithMultipleFieldsAccessorAndDescription: Test Description\nexport class ModelWithMultipleFieldsAccessorAndDescription {\n #stringField: string;\n\n #int32Field: number;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#stringField = decoder.string();\n this.#int32Field = decoder.int32();\n } else {\n this.#stringField = \"DefaultValue\";\n this.#int32Field = 32;\n }\n }\n\n get stringField(): string {\n return this.#stringField;\n }\n\n set stringField(val: string) {\n this.#stringField = val;\n }\n\n get int32Field(): number {\n return this.#int32Field;\n }\n\n set int32Field (val: number) {\n this.#int32Field = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n encoder.string(this.#stringField);\n encoder.int32(this.#int32Field);\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithMultipleFieldsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithMultipleFieldsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModels {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModels | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModels(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAndDescription {\n embeddedEmptyModel: EmptyModel | undefined;\n\n embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.embeddedEmptyModel = new EmptyModel();\n this.embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithEmbeddedModelsAccessor {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessor | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessor(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n// ModelWithEmbeddedModelsAccessorAndDescription: Test Description\nexport class ModelWithEmbeddedModelsAccessorAndDescription {\n #embeddedEmptyModel: EmptyModel | undefined;\n\n #embeddedModelArrayWithMultipleFieldsAccessor: Array;\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.#embeddedEmptyModel = EmptyModel.decode(decoder);\n const embeddedModelArrayWithMultipleFieldsAccessorSize = decoder.array(Kind.Any);\n this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) {\n const x = ModelWithMultipleFieldsAccessor.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x;\n }\n }\n } else {\n this.#embeddedEmptyModel = new EmptyModel();\n this.#embeddedModelArrayWithMultipleFieldsAccessor = [];\n }\n }\n\n get embeddedEmptyModel(): EmptyModel | undefined {\n return this.#embeddedEmptyModel;\n }\n\n set embeddedEmptyModel(val: EmptyModel | undefined) {\n this.#embeddedEmptyModel = val;\n }\n\n get embeddedModelArrayWithMultipleFieldsAccessor(): Array {\n return this.#embeddedModelArrayWithMultipleFieldsAccessor;\n }\n\n set EmbeddedModelArrayWithMultipleFieldsAccessor(val: Array) {\n this.#embeddedModelArrayWithMultipleFieldsAccessor = val;\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.#embeddedEmptyModel === \"undefined\") {\n encoder.null();\n } else {\n this.#embeddedEmptyModel.encode(encoder);\n }\n const embeddedModelArrayWithMultipleFieldsAccessorLength = this.#embeddedModelArrayWithMultipleFieldsAccessor.length;\n encoder.array(embeddedModelArrayWithMultipleFieldsAccessorLength, Kind.Any);\n for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorLength; i += 1) {\n const el = this.#embeddedModelArrayWithMultipleFieldsAccessor[i];\n el.encode(encoder);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithEmbeddedModelsAccessorAndDescription | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithEmbeddedModelsAccessorAndDescription(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\nexport class ModelWithAllFieldTypes {\n modelField: EmptyModel | undefined;\n\n modelArrayField: Array;\n\n stringField: string;\n\n stringArrayField: string[];\n\n stringMapField: Map;\n\n stringMapFieldEmbedded: Map;\n\n int32Field: number;\n\n int32ArrayField: number[];\n\n int32MapField: Map;\n\n int32MapFieldEmbedded: Map;\n\n int64Field: bigint;\n\n int64ArrayField: bigint[];\n\n int64MapField: Map;\n\n int64MapFieldEmbedded: Map;\n\n uint32Field: number;\n\n uint32ArrayField: number[];\n\n uint32MapField: Map;\n\n uint32MapFieldEmbedded: Map;\n\n uint64Field: bigint;\n\n uint64ArrayField: bigint[];\n\n uint64MapField: Map;\n\n uint64MapFieldEmbedded: Map;\n\n float32Field: number;\n\n float32ArrayField: number[];\n\n float64Field: number;\n\n float64ArrayField: number[];\n\n enumField: GenericEnum;\n\n enumArrayField: GenericEnum[];\n\n enumMapField: Map;\n\n enumMapFieldEmbedded: Map;\n\n bytesField: Uint8Array;\n\n bytesArrayField: Uint8Array[];\n\n boolField: boolean;\n\n boolArrayField: boolean[];\n\n /**\n * @throws {Error}\n */\n constructor (decoder?: Decoder) {\n if (decoder) {\n let err: Error | undefined;\n try {\n err = decoder.error();\n } catch (_) {}\n if (typeof err !== \"undefined\") {\n throw err;\n }\n this.modelField = EmptyModel.decode(decoder);\n const modelArrayFieldSize = decoder.array(Kind.Any);\n this.modelArrayField = new Array(modelArrayFieldSize);\n for (let i = 0; i < modelArrayFieldSize; i += 1) {\n const x = EmptyModel.decode(decoder);\n if (typeof x !== \"undefined\") {\n this.modelArrayField[i] = x;\n }\n }\n this.stringField = decoder.string();\n const stringArrayFieldSize = decoder.array(Kind.String);\n this.stringArrayField = new Array(stringArrayFieldSize);\n for (let i = 0; i < stringArrayFieldSize; i += 1) {\n this.stringArrayField[i] = decoder.string();\n }\n this.stringMapField = new Map();\n let stringMapFieldSize = decoder.map(Kind.String, Kind.String);\n for (let i = 0; i < stringMapFieldSize; i++) {\n let key = decoder.string();\n let val = decoder.string();\n this.stringMapField.set(key, val);\n }\n this.stringMapFieldEmbedded = new Map();\n let stringMapFieldEmbeddedSize = decoder.map(Kind.String, Kind.Any);\n for (let i = 0; i < stringMapFieldEmbeddedSize; i++) {\n let key = decoder.string();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.stringMapFieldEmbedded.set(key, val);\n }\n }\n this.int32Field = decoder.int32();\n const int32ArrayFieldSize = decoder.array(Kind.Int32);\n this.int32ArrayField = new Array(int32ArrayFieldSize);\n for (let i = 0; i < int32ArrayFieldSize; i += 1) {\n this.int32ArrayField[i] = decoder.int32();\n }\n this.int32MapField = new Map();\n let int32MapFieldSize = decoder.map(Kind.Int32, Kind.Int32);\n for (let i = 0; i < int32MapFieldSize; i++) {\n let key = decoder.int32();\n let val = decoder.int32();\n this.int32MapField.set(key, val);\n }\n this.int32MapFieldEmbedded = new Map();\n let int32MapFieldEmbeddedSize = decoder.map(Kind.Int32, Kind.Any);\n for (let i = 0; i < int32MapFieldEmbeddedSize; i++) {\n let key = decoder.int32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int32MapFieldEmbedded.set(key, val);\n }\n }\n this.int64Field = decoder.int64();\n const int64ArrayFieldSize = decoder.array(Kind.Int64);\n this.int64ArrayField = new Array(int64ArrayFieldSize);\n for (let i = 0; i < int64ArrayFieldSize; i += 1) {\n this.int64ArrayField[i] = decoder.int64();\n }\n this.int64MapField = new Map();\n let int64MapFieldSize = decoder.map(Kind.Int64, Kind.Int64);\n for (let i = 0; i < int64MapFieldSize; i++) {\n let key = decoder.int64();\n let val = decoder.int64();\n this.int64MapField.set(key, val);\n }\n this.int64MapFieldEmbedded = new Map();\n let int64MapFieldEmbeddedSize = decoder.map(Kind.Int64, Kind.Any);\n for (let i = 0; i < int64MapFieldEmbeddedSize; i++) {\n let key = decoder.int64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.int64MapFieldEmbedded.set(key, val);\n }\n }\n this.uint32Field = decoder.uint32();\n const uint32ArrayFieldSize = decoder.array(Kind.Uint32);\n this.uint32ArrayField = new Array(uint32ArrayFieldSize);\n for (let i = 0; i < uint32ArrayFieldSize; i += 1) {\n this.uint32ArrayField[i] = decoder.uint32();\n }\n this.uint32MapField = new Map();\n let uint32MapFieldSize = decoder.map(Kind.Uint32, Kind.Uint32);\n for (let i = 0; i < uint32MapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.uint32();\n this.uint32MapField.set(key, val);\n }\n this.uint32MapFieldEmbedded = new Map();\n let uint32MapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint32MapFieldEmbedded.set(key, val);\n }\n }\n this.uint64Field = decoder.uint64();\n const uint64ArrayFieldSize = decoder.array(Kind.Uint64);\n this.uint64ArrayField = new Array(uint64ArrayFieldSize);\n for (let i = 0; i < uint64ArrayFieldSize; i += 1) {\n this.uint64ArrayField[i] = decoder.uint64();\n }\n this.uint64MapField = new Map();\n let uint64MapFieldSize = decoder.map(Kind.Uint64, Kind.Uint64);\n for (let i = 0; i < uint64MapFieldSize; i++) {\n let key = decoder.uint64();\n let val = decoder.uint64();\n this.uint64MapField.set(key, val);\n }\n this.uint64MapFieldEmbedded = new Map();\n let uint64MapFieldEmbeddedSize = decoder.map(Kind.Uint64, Kind.Any);\n for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) {\n let key = decoder.uint64();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.uint64MapFieldEmbedded.set(key, val);\n }\n }\n this.float32Field = decoder.float32();\n const float32ArrayFieldSize = decoder.array(Kind.Float32);\n this.float32ArrayField = new Array(float32ArrayFieldSize);\n for (let i = 0; i < float32ArrayFieldSize; i += 1) {\n this.float32ArrayField[i] = decoder.float32();\n }\n this.float64Field = decoder.float64();\n const float64ArrayFieldSize = decoder.array(Kind.Float64);\n this.float64ArrayField = new Array(float64ArrayFieldSize);\n for (let i = 0; i < float64ArrayFieldSize; i += 1) {\n this.float64ArrayField[i] = decoder.float64();\n }\n this.enumField = decoder.uint32();\n const enumArrayFieldSize = decoder.array(Kind.Uint32);\n this.enumArrayField = new Array(enumArrayFieldSize);\n for (let i = 0; i < enumArrayFieldSize; i += 1) {\n this.enumArrayField[i] = decoder.uint32();\n }\n this.enumMapField = new Map();\n let enumMapFieldSize = decoder.map(Kind.Uint32, Kind.String);\n for (let i = 0; i < enumMapFieldSize; i++) {\n let key = decoder.uint32();\n let val = decoder.string();\n this.enumMapField.set(key, val);\n }\n this.enumMapFieldEmbedded = new Map();\n let enumMapFieldEmbeddedSize = decoder.map(Kind.Uint32, Kind.Any);\n for (let i = 0; i < enumMapFieldEmbeddedSize; i++) {\n let key = decoder.uint32();\n let val = EmptyModel.decode(decoder);\n if (typeof val !== \"undefined\") {\n this.enumMapFieldEmbedded.set(key, val);\n }\n }\n this.bytesField = decoder.uint8Array();\n const bytesArrayFieldSize = decoder.array(Kind.Uint8Array);\n this.bytesArrayField = new Array(bytesArrayFieldSize);\n for (let i = 0; i < bytesArrayFieldSize; i += 1) {\n this.bytesArrayField[i] = decoder.uint8Array();\n }\n this.boolField = decoder.boolean();\n const boolArrayFieldSize = decoder.array(Kind.Boolean);\n this.boolArrayField = new Array(boolArrayFieldSize);\n for (let i = 0; i < boolArrayFieldSize; i += 1) {\n this.boolArrayField[i] = decoder.boolean();\n }\n } else {\n this.modelField = new EmptyModel();\n this.modelArrayField = [];\n this.stringField = \"DefaultValue\";\n this.stringArrayField = [];\n this.stringMapField = new Map();\n this.stringMapFieldEmbedded = new Map();\n this.int32Field = 32;\n this.int32ArrayField = [];\n this.int32MapField = new Map();\n this.int32MapFieldEmbedded = new Map();\n this.int64Field = 64n;\n this.int64ArrayField = [];\n this.int64MapField = new Map();\n this.int64MapFieldEmbedded = new Map();\n this.uint32Field = 32;\n this.uint32ArrayField = [];\n this.uint32MapField = new Map();\n this.uint32MapFieldEmbedded = new Map();\n this.uint64Field = 64n;\n this.uint64ArrayField = [];\n this.uint64MapField = new Map();\n this.uint64MapFieldEmbedded = new Map();\n this.float32Field = 32.32;\n this.float32ArrayField = [];\n this.float64Field = 64.64;\n this.float64ArrayField = [];\n this.enumField = GenericEnum.DefaultValue;\n this.enumArrayField = [];\n this.enumMapField = new Map();\n this.enumMapFieldEmbedded = new Map();\n this.bytesField = new Uint8Array(512);\n this.bytesArrayField = [];\n this.boolField = true;\n this.boolArrayField = [];\n }\n }\n\n /**\n * @throws {Error}\n */\n encode (encoder: Encoder) {\n if (typeof this.modelField === \"undefined\") {\n encoder.null();\n } else {\n this.modelField.encode(encoder);\n }\n const modelArrayFieldLength = this.modelArrayField.length;\n encoder.array(modelArrayFieldLength, Kind.Any);\n for (let i = 0; i < modelArrayFieldLength; i += 1) {\n const el = this.modelArrayField[i];\n el.encode(encoder);\n }\n encoder.string(this.stringField);\n const stringArrayFieldLength = this.stringArrayField.length;\n encoder.array(stringArrayFieldLength, Kind.String);\n for (let i = 0; i < stringArrayFieldLength; i += 1) {\n encoder.string(this.stringArrayField[i]);\n }\n encoder.map(this.stringMapField.size, Kind.String, Kind.String);\n this.stringMapField.forEach((val, key) => {\n encoder.string(key);\n encoder.string(val);\n });\n encoder.map(this.stringMapFieldEmbedded.size, Kind.String, Kind.Any);\n this.stringMapFieldEmbedded.forEach((val, key) => {\n encoder.string(key);\n val.encode(encoder);\n });\n encoder.int32(this.int32Field);\n const int32ArrayFieldLength = this.int32ArrayField.length;\n encoder.array(int32ArrayFieldLength, Kind.Int32);\n for (let i = 0; i < int32ArrayFieldLength; i += 1) {\n encoder.int32(this.int32ArrayField[i]);\n }\n encoder.map(this.int32MapField.size, Kind.Int32, Kind.Int32);\n this.int32MapField.forEach((val, key) => {\n encoder.int32(key);\n encoder.int32(val);\n });\n encoder.map(this.int32MapFieldEmbedded.size, Kind.Int32, Kind.Any);\n this.int32MapFieldEmbedded.forEach((val, key) => {\n encoder.int32(key);\n val.encode(encoder);\n });\n encoder.int64(this.int64Field);\n const int64ArrayFieldLength = this.int64ArrayField.length;\n encoder.array(int64ArrayFieldLength, Kind.Int64);\n for (let i = 0; i < int64ArrayFieldLength; i += 1) {\n encoder.int64(this.int64ArrayField[i]);\n }\n encoder.map(this.int64MapField.size, Kind.Int64, Kind.Int64);\n this.int64MapField.forEach((val, key) => {\n encoder.int64(key);\n encoder.int64(val);\n });\n encoder.map(this.int64MapFieldEmbedded.size, Kind.Int64, Kind.Any);\n this.int64MapFieldEmbedded.forEach((val, key) => {\n encoder.int64(key);\n val.encode(encoder);\n });\n encoder.uint32(this.uint32Field);\n const uint32ArrayFieldLength = this.uint32ArrayField.length;\n encoder.array(uint32ArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < uint32ArrayFieldLength; i += 1) {\n encoder.uint32(this.uint32ArrayField[i]);\n }\n encoder.map(this.uint32MapField.size, Kind.Uint32, Kind.Uint32);\n this.uint32MapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.uint32(val);\n });\n encoder.map(this.uint32MapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.uint32MapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint64(this.uint64Field);\n const uint64ArrayFieldLength = this.uint64ArrayField.length;\n encoder.array(uint64ArrayFieldLength, Kind.Uint64);\n for (let i = 0; i < uint64ArrayFieldLength; i += 1) {\n encoder.uint64(this.uint64ArrayField[i]);\n }\n encoder.map(this.uint64MapField.size, Kind.Uint64, Kind.Uint64);\n this.uint64MapField.forEach((val, key) => {\n encoder.uint64(key);\n encoder.uint64(val);\n });\n encoder.map(this.uint64MapFieldEmbedded.size, Kind.Uint64, Kind.Any);\n this.uint64MapFieldEmbedded.forEach((val, key) => {\n encoder.uint64(key);\n val.encode(encoder);\n });\n encoder.float32(this.float32Field);\n const float32ArrayFieldLength = this.float32ArrayField.length;\n encoder.array(float32ArrayFieldLength, Kind.Float32);\n for (let i = 0; i < float32ArrayFieldLength; i += 1) {\n encoder.float32(this.float32ArrayField[i]);\n }\n encoder.float64(this.float64Field);\n const float64ArrayFieldLength = this.float64ArrayField.length;\n encoder.array(float64ArrayFieldLength, Kind.Float64);\n for (let i = 0; i < float64ArrayFieldLength; i += 1) {\n encoder.float64(this.float64ArrayField[i]);\n }\n encoder.uint32(this.enumField);\n const enumArrayFieldLength = this.enumArrayField.length;\n encoder.array(enumArrayFieldLength, Kind.Uint32);\n for (let i = 0; i < enumArrayFieldLength; i += 1) {\n encoder.uint32(this.enumArrayField[i]);\n }\n encoder.map(this.enumMapField.size, Kind.Uint32, Kind.String);\n this.enumMapField.forEach((val, key) => {\n encoder.uint32(key);\n encoder.string(val);\n });\n encoder.map(this.enumMapFieldEmbedded.size, Kind.Uint32, Kind.Any);\n this.enumMapFieldEmbedded.forEach((val, key) => {\n encoder.uint32(key);\n val.encode(encoder);\n });\n encoder.uint8Array(this.bytesField);\n const bytesArrayFieldLength = this.bytesArrayField.length;\n encoder.array(bytesArrayFieldLength, Kind.Uint8Array);\n for (let i = 0; i < bytesArrayFieldLength; i += 1) {\n encoder.uint8Array(this.bytesArrayField[i]);\n }\n encoder.boolean(this.boolField);\n const boolArrayFieldLength = this.boolArrayField.length;\n encoder.array(boolArrayFieldLength, Kind.Boolean);\n for (let i = 0; i < boolArrayFieldLength; i += 1) {\n encoder.boolean(this.boolArrayField[i]);\n }\n }\n\n /**\n * @throws {Error}\n */\n static decode (decoder: Decoder): ModelWithAllFieldTypes | undefined {\n if (decoder.null()) {\n return undefined\n }\n return new ModelWithAllFieldTypes(decoder);\n }\n\n /**\n * @throws {Error}\n */\n static encode_undefined (encoder: Encoder) {\n encoder.null();\n }\n}\n\n"], + "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,sBAAuC;AAEhC,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,0BAAA,gBAAa,KAAb;AAEA,EAAAA,0BAAA,iBAAc,KAAd;AAEA,EAAAA,0BAAA,kBAAe,KAAf;AALU,SAAAA;AAAA,GAAA;AAQL,MAAM,WAAW;AAAA;AAAA;AAAA;AAAA,EAItB,YAAa,SAAmB;AAC9B,QAAI,SAAS;AACX,UAAI;AACJ,UAAI;AACF,cAAM,QAAQ,MAAM;AAAA,MACtB,SAAS,GAAG;AAAA,MAAC;AACb,UAAI,OAAO,QAAQ,aAAa;AAC9B,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AAAA,IACP;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,OAAQ,SAAkB;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,OAAQ,SAA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,WAAO,IAAI,uBAAuB,OAAO;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,iBAAkB,SAAkB;AACzC,YAAQ,KAAK;AAAA,EACf;AACF;", "names": ["GenericEnum"] } diff --git a/integration/typescript_tests/signature/types.ts b/integration/typescript_tests/signature/types.ts index 4f5dc0b0..9de789e5 100644 --- a/integration/typescript_tests/signature/types.ts +++ b/integration/typescript_tests/signature/types.ts @@ -1,4 +1,4 @@ -// Code generated by scale-signature 0.3.20, DO NOT EDIT. +// Code generated by scale-signature 0.4.0, DO NOT EDIT. // output: local-example-latest-guest import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" @@ -21,7 +21,7 @@ export class EmptyModel { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -63,7 +63,7 @@ export class EmptyModelWithDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -106,7 +106,7 @@ export class ModelWithSingleStringField { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -153,7 +153,7 @@ export class ModelWithSingleStringFieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -199,7 +199,7 @@ export class ModelWithSingleInt32Field { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -246,7 +246,7 @@ export class ModelWithSingleInt32FieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -294,7 +294,7 @@ export class ModelWithMultipleFields { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -346,7 +346,7 @@ export class ModelWithMultipleFieldsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -395,7 +395,7 @@ export class ModelWithEnum { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -442,7 +442,7 @@ export class ModelWithEnumAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -488,7 +488,7 @@ export class ModelWithEnumAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -543,7 +543,7 @@ export class ModelWithEnumAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -599,7 +599,7 @@ export class ModelWithMultipleFieldsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -677,7 +677,7 @@ export class ModelWithMultipleFieldsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -744,7 +744,7 @@ export class ModelWithEmbeddedModels { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -752,7 +752,7 @@ export class ModelWithEmbeddedModels { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -766,7 +766,7 @@ export class ModelWithEmbeddedModels { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -812,7 +812,7 @@ export class ModelWithEmbeddedModelsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -820,7 +820,7 @@ export class ModelWithEmbeddedModelsAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -834,7 +834,7 @@ export class ModelWithEmbeddedModelsAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -879,7 +879,7 @@ export class ModelWithEmbeddedModelsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -887,7 +887,7 @@ export class ModelWithEmbeddedModelsAccessor { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -917,7 +917,7 @@ export class ModelWithEmbeddedModelsAccessor { * @throws {Error} */ encode (encoder: Encoder) { - if (this.#embeddedEmptyModel === undefined) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -963,7 +963,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -971,7 +971,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -1001,7 +1001,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.#embeddedEmptyModel === undefined) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -1110,7 +1110,7 @@ export class ModelWithAllFieldTypes { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.modelField = EmptyModel.decode(decoder); @@ -1118,7 +1118,7 @@ export class ModelWithAllFieldTypes { this.modelArrayField = new Array(modelArrayFieldSize); for (let i = 0; i < modelArrayFieldSize; i += 1) { const x = EmptyModel.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.modelArrayField[i] = x; } } @@ -1140,7 +1140,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < stringMapFieldEmbeddedSize; i++) { let key = decoder.string(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.stringMapFieldEmbedded.set(key, val); } } @@ -1162,7 +1162,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int32MapFieldEmbeddedSize; i++) { let key = decoder.int32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int32MapFieldEmbedded.set(key, val); } } @@ -1184,7 +1184,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int64MapFieldEmbeddedSize; i++) { let key = decoder.int64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int64MapFieldEmbedded.set(key, val); } } @@ -1206,7 +1206,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint32MapFieldEmbedded.set(key, val); } } @@ -1228,7 +1228,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) { let key = decoder.uint64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint64MapFieldEmbedded.set(key, val); } } @@ -1262,7 +1262,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < enumMapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.enumMapFieldEmbedded.set(key, val); } } @@ -1320,7 +1320,7 @@ export class ModelWithAllFieldTypes { * @throws {Error} */ encode (encoder: Encoder) { - if (this.modelField === undefined) { + if (typeof this.modelField === "undefined") { encoder.null(); } else { this.modelField.encode(encoder); diff --git a/module.ts b/module.ts index ba311514..813fb88e 100644 --- a/module.ts +++ b/module.ts @@ -22,6 +22,7 @@ import {Decoder} from "@loopholelabs/polyglot"; import {DisabledWASI} from "./wasi"; import {v4 as uuid} from "uuid"; import {NamedLogger} from "./log/log"; +import {Tracing} from "./tracing"; export async function NewModule(template: Template): Promise> { const m = new Module(template); @@ -32,9 +33,10 @@ export async function NewModule(template: Template): Pro export class Module { private readonly ready: Promise; - private template: Template; + public template: Template; private readonly wasi: DisabledWASI; + private readonly tracing: Tracing; private instantiatedModule: WebAssembly.Instance | undefined; private run: undefined | ((ptr: number, len: number) => bigint); @@ -54,43 +56,44 @@ export class Module { let stdout = this.template.runtime.config.stdout; let stderr = this.template.runtime.config.stderr; - if (stdout !== undefined && !this.template.runtime.config.rawOutput) { + if (typeof stdout !== "undefined" && !this.template.runtime.config.rawOutput) { stdout = NamedLogger(name, stdout); } - if (stderr !== undefined && !this.template.runtime.config.rawOutput) { + if (typeof stderr !== "undefined" && !this.template.runtime.config.rawOutput) { stderr = NamedLogger(name, stderr); } this.wasi = new DisabledWASI(this.template.env, stdout, stderr); + this.tracing = new Tracing(this, this.template.runtime.TraceDataCallback); const moduleConfig = { wasi_snapshot_preview1: this.wasi.GetImports(), - scale: this.template.tracing.GetImports(), + scale: this.tracing.GetImports(), env: { next: this.template.runtime.Next(this), }, } this.ready = new Promise(async (resolve) => { // eslint-disable-line no-async-promise-executor - if (this.template.compiled !== undefined) { + if (typeof this.template.compiled !== "undefined") { this.instantiatedModule = await WebAssembly.instantiate(this.template.compiled, moduleConfig); this.wasi.SetInstance(this.instantiatedModule); this.run = this.instantiatedModule.exports.run as ((ptr: number, len: number) => bigint) | undefined; - if (this.run === undefined) { + if (typeof this.run === "undefined") { throw new Error("no run function found in module"); } this.resize = this.instantiatedModule.exports.resize as ((len: number) => number) | undefined; - if (this.resize === undefined) { + if (typeof this.resize === "undefined") { throw new Error("no resize function found in module"); } this.initialize = this.instantiatedModule.exports.initialize as (() => bigint) | undefined; - if (this.initialize === undefined) { + if (typeof this.initialize === "undefined") { throw new Error("no initialize function found in module"); } this.memory = this.instantiatedModule.exports.memory as WebAssembly.Memory | undefined; - if (this.memory === undefined) { + if (typeof this.memory === "undefined") { throw new Error("no memory found in module"); } @@ -116,19 +119,19 @@ export class Module { } public Run() { - if (this.signature === undefined) { + if (typeof this.signature === "undefined") { throw new Error("no signature found in module"); } - if (this.resize === undefined) { + if (typeof this.resize === "undefined") { throw new Error("no resize function found in module"); } - if (this.run === undefined) { + if (typeof this.run === "undefined") { throw new Error("no run function found in module"); } - if (this.memory === undefined) { + if (typeof this.memory === "undefined") { throw new Error("no memory found in module"); } @@ -144,7 +147,7 @@ export class Module { const readBuffer = readBufferPointer.slice(ptr, ptr + len); const err = this.signature.Read(readBuffer); - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } diff --git a/package.json b/package.json index 9e030321..27152965 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "license": "Apache-2.0", "scripts": { "build": "rm -rf dist && tsc --outDir dist && cp package.json dist", - "lint": "eslint . --ext .ts" + "lint": "eslint . --ext .ts", + "test": "node --experimental-wasi-unstable-preview1 --trace-warnings node_modules/.bin/jest --no-cache" }, "dependencies": { "@loopholelabs/polyglot": "^1.1.3", diff --git a/pool.ts b/pool.ts index 3755cab9..bcb99662 100644 --- a/pool.ts +++ b/pool.ts @@ -31,7 +31,7 @@ export class ModulePool { public async Get(): Promise> { if (this.objects.length > 0) { const t = this.objects.pop(); - if (t !== undefined) { + if (typeof t !== "undefined") { return t; } } diff --git a/scale.ts b/scale.ts index d07a3082..a3c4085c 100644 --- a/scale.ts +++ b/scale.ts @@ -55,11 +55,11 @@ export class Scale { throw new Error(`failed to pre-compile function ${sf.function.Name}:${sf.function.Tag}: ${e}`); } - if (this.head === undefined) { + if (typeof this.head === "undefined") { this.head = t; } - if (this.tail !== undefined) { + if (typeof this.tail !== "undefined") { this.tail.next = t; } @@ -79,16 +79,16 @@ export class Scale { public Next(m: Module): (ptr: number, len: number) => void { return (ptr: number, len: number): void => { - if (m.memory === undefined) { + if (typeof m.memory === "undefined") { throw new Error("no memory found in module"); } - if (m.resize === undefined) { + if (typeof m.resize === "undefined") { throw new Error("no resize function found in module"); } - if (m.signature === undefined) { + if (typeof m.signature === "undefined") { throw new Error("no signature found in module"); } - if (m.function === undefined) { + if (typeof m.function === "undefined") { throw new Error("no function found in module"); } let buf: Uint8Array; @@ -97,10 +97,10 @@ export class Scale { const inContextBuff = memDataOut.slice(ptr, ptr + len); m.signature.Read(inContextBuff); - if (m.function.next !== undefined) { + if (typeof m.function.next !== "undefined") { m.function.next.GetModule(m.signature).then((nextModule) => { nextModule.Run(); - if (m.function !== undefined && m.function.next !== undefined) { + if (typeof m.function !== "undefined" && typeof m.function.next !== "undefined") { m.function.next.PutModule(nextModule); } }); diff --git a/scalefunc/scaleFunc.test.ts b/scalefunc/scaleFunc.test.ts index 7e65a72f..6ecbf985 100644 --- a/scalefunc/scaleFunc.test.ts +++ b/scalefunc/scaleFunc.test.ts @@ -95,7 +95,7 @@ describe("scaleFunc", () => { expect(sf.Language).toBe(sf2.Language); expect(sf.Function).toStrictEqual(sf2.Function); - if (sf2.Size !== undefined && sf2.Hash !== undefined) { + if (typeof sf2.Size !== "undefined" && typeof sf2.Hash !== "undefined") { buff[buff.length - 1]++; // This increments the last byte of the hash // Now try to decode again with a bad checksum... expect(() => { diff --git a/signature/converter/converter_tests/generated.go b/signature/converter/converter_tests/generated.go index 6a2fae8b..508dbd22 100644 --- a/signature/converter/converter_tests/generated.go +++ b/signature/converter/converter_tests/generated.go @@ -1,4 +1,4 @@ -// Code generated by scale-signature v0.3.20, DO NOT EDIT. +// Code generated by scale-signature v0.4.0, DO NOT EDIT. // output: generated package generated diff --git a/signature/generator/typescript/generated.txt b/signature/generator/typescript/generated.txt index 1c1d3e25..e5ffaf8d 100755 --- a/signature/generator/typescript/generated.txt +++ b/signature/generator/typescript/generated.txt @@ -21,7 +21,7 @@ export class EmptyModel { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -63,7 +63,7 @@ export class EmptyModelWithDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } } else { @@ -106,7 +106,7 @@ export class ModelWithSingleStringField { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -153,7 +153,7 @@ export class ModelWithSingleStringFieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -199,7 +199,7 @@ export class ModelWithSingleInt32Field { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -246,7 +246,7 @@ export class ModelWithSingleInt32FieldAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.int32Field = decoder.int32(); @@ -294,7 +294,7 @@ export class ModelWithMultipleFields { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -346,7 +346,7 @@ export class ModelWithMultipleFieldsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.stringField = decoder.string(); @@ -395,7 +395,7 @@ export class ModelWithEnum { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -442,7 +442,7 @@ export class ModelWithEnumAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.enumField = decoder.uint32(); @@ -488,7 +488,7 @@ export class ModelWithEnumAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -543,7 +543,7 @@ export class ModelWithEnumAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#enumField = decoder.uint32(); @@ -599,7 +599,7 @@ export class ModelWithMultipleFieldsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -677,7 +677,7 @@ export class ModelWithMultipleFieldsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#stringField = decoder.string(); @@ -744,7 +744,7 @@ export class ModelWithEmbeddedModels { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -752,7 +752,7 @@ export class ModelWithEmbeddedModels { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -766,7 +766,7 @@ export class ModelWithEmbeddedModels { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -812,7 +812,7 @@ export class ModelWithEmbeddedModelsAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.embeddedEmptyModel = EmptyModel.decode(decoder); @@ -820,7 +820,7 @@ export class ModelWithEmbeddedModelsAndDescription { this.embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -834,7 +834,7 @@ export class ModelWithEmbeddedModelsAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.embeddedEmptyModel === undefined) { + if (typeof this.embeddedEmptyModel === "undefined") { encoder.null(); } else { this.embeddedEmptyModel.encode(encoder); @@ -879,7 +879,7 @@ export class ModelWithEmbeddedModelsAccessor { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -887,7 +887,7 @@ export class ModelWithEmbeddedModelsAccessor { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -917,7 +917,7 @@ export class ModelWithEmbeddedModelsAccessor { * @throws {Error} */ encode (encoder: Encoder) { - if (this.#embeddedEmptyModel === undefined) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -963,7 +963,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.#embeddedEmptyModel = EmptyModel.decode(decoder); @@ -971,7 +971,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { this.#embeddedModelArrayWithMultipleFieldsAccessor = new Array(embeddedModelArrayWithMultipleFieldsAccessorSize); for (let i = 0; i < embeddedModelArrayWithMultipleFieldsAccessorSize; i += 1) { const x = ModelWithMultipleFieldsAccessor.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.#embeddedModelArrayWithMultipleFieldsAccessor[i] = x; } } @@ -1001,7 +1001,7 @@ export class ModelWithEmbeddedModelsAccessorAndDescription { * @throws {Error} */ encode (encoder: Encoder) { - if (this.#embeddedEmptyModel === undefined) { + if (typeof this.#embeddedEmptyModel === "undefined") { encoder.null(); } else { this.#embeddedEmptyModel.encode(encoder); @@ -1110,7 +1110,7 @@ export class ModelWithAllFieldTypes { try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } this.modelField = EmptyModel.decode(decoder); @@ -1118,7 +1118,7 @@ export class ModelWithAllFieldTypes { this.modelArrayField = new Array(modelArrayFieldSize); for (let i = 0; i < modelArrayFieldSize; i += 1) { const x = EmptyModel.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.modelArrayField[i] = x; } } @@ -1140,7 +1140,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < stringMapFieldEmbeddedSize; i++) { let key = decoder.string(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.stringMapFieldEmbedded.set(key, val); } } @@ -1162,7 +1162,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int32MapFieldEmbeddedSize; i++) { let key = decoder.int32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int32MapFieldEmbedded.set(key, val); } } @@ -1184,7 +1184,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < int64MapFieldEmbeddedSize; i++) { let key = decoder.int64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.int64MapFieldEmbedded.set(key, val); } } @@ -1206,7 +1206,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint32MapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint32MapFieldEmbedded.set(key, val); } } @@ -1228,7 +1228,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < uint64MapFieldEmbeddedSize; i++) { let key = decoder.uint64(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.uint64MapFieldEmbedded.set(key, val); } } @@ -1262,7 +1262,7 @@ export class ModelWithAllFieldTypes { for (let i = 0; i < enumMapFieldEmbeddedSize; i++) { let key = decoder.uint32(); let val = EmptyModel.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.enumMapFieldEmbedded.set(key, val); } } @@ -1320,7 +1320,7 @@ export class ModelWithAllFieldTypes { * @throws {Error} */ encode (encoder: Encoder) { - if (this.modelField === undefined) { + if (typeof this.modelField === "undefined") { encoder.null(); } else { this.modelField.encode(encoder); diff --git a/signature/generator/typescript/generator_test.go b/signature/generator/typescript/generator_test.go index 6bab3c99..569b7d05 100644 --- a/signature/generator/typescript/generator_test.go +++ b/signature/generator/typescript/generator_test.go @@ -32,7 +32,7 @@ func TestGenerator(t *testing.T) { formatted, err := GenerateTypes(s, "types") require.NoError(t, err) - // os.WriteFile("./generated.txt", formatted, 0644) + //os.WriteFile("./generated.txt", formatted, 0644) master, err := os.ReadFile("./generated.txt") require.NoError(t, err) diff --git a/signature/generator/typescript/templates/guest.ts.templ b/signature/generator/typescript/templates/guest.ts.templ index 4201fdfb..a1932ce3 100644 --- a/signature/generator/typescript/templates/guest.ts.templ +++ b/signature/generator/typescript/templates/guest.ts.templ @@ -19,7 +19,7 @@ const hash = "{{ .signature_hash }}" // Users should not use this method. export function Write(ctx?: {{ .signature_schema.Context }}): number[] { const enc = new Encoder(); - if (ctx === undefined) { + if (typeof ctx === "undefined") { enc.null(); } else { ctx.encode(enc); diff --git a/signature/generator/typescript/templates/maps.ts.templ b/signature/generator/typescript/templates/maps.ts.templ index 4b3a129a..1efbeb81 100644 --- a/signature/generator/typescript/templates/maps.ts.templ +++ b/signature/generator/typescript/templates/maps.ts.templ @@ -96,7 +96,7 @@ for (let i = 0; i < {{ CamelCase .Name }}Size; i++) { let key = decoder.{{ PolyglotPrimitiveDecode $type }}(); let val = {{ .Value }}.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.#{{ CamelCase .Name }}.set(key, val); } } @@ -118,7 +118,7 @@ for (let i = 0; i < {{ CamelCase .Name }}Size; i++) { let key = decoder.{{ PolyglotPrimitiveDecode $type }}(); let val = {{ .Value }}.decode(decoder); - if (val !== undefined) { + if (typeof val !== "undefined") { this.{{ CamelCase .Name }}.set(key, val); } } diff --git a/signature/generator/typescript/templates/modelarrays.ts.templ b/signature/generator/typescript/templates/modelarrays.ts.templ index 255c69a7..e42794c6 100644 --- a/signature/generator/typescript/templates/modelarrays.ts.templ +++ b/signature/generator/typescript/templates/modelarrays.ts.templ @@ -46,7 +46,7 @@ for (let i = 0; i < {{ CamelCase .Name }}Size; i += 1) { const x = {{ .Reference }}.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.#{{ CamelCase .Name }}[i] = x; } } @@ -56,7 +56,7 @@ for (let i = 0; i < {{ CamelCase .Name }}Size; i += 1) { const x = {{ .Reference }}.decode(decoder); - if (x !== undefined) { + if (typeof x !== "undefined") { this.{{ CamelCase .Name }}[i] = x; } } diff --git a/signature/generator/typescript/templates/models.ts.templ b/signature/generator/typescript/templates/models.ts.templ index 7763cf36..aec02e0f 100644 --- a/signature/generator/typescript/templates/models.ts.templ +++ b/signature/generator/typescript/templates/models.ts.templ @@ -21,13 +21,13 @@ {{ define "ts_models_encode" }} {{- range .Models }} {{- if .Accessor }} - if (this.#{{ CamelCase .Name }} === undefined) { + if (typeof this.#{{ CamelCase .Name }} === "undefined") { encoder.null(); } else { this.#{{ CamelCase .Name }}.encode(encoder); } {{- else }} - if (this.{{ CamelCase .Name }} === undefined) { + if (typeof this.{{ CamelCase .Name }} === "undefined") { encoder.null(); } else { this.{{ CamelCase .Name }}.encode(encoder); diff --git a/signature/generator/typescript/templates/types.ts.templ b/signature/generator/typescript/templates/types.ts.templ index a43ef7c0..1e7ee48c 100644 --- a/signature/generator/typescript/templates/types.ts.templ +++ b/signature/generator/typescript/templates/types.ts.templ @@ -63,7 +63,7 @@ import { Encoder, Decoder, Kind } from "@loopholelabs/polyglot" try { err = decoder.error(); } catch (_) {} - if (err !== undefined) { + if (typeof err !== "undefined") { throw err; } {{ template "ts_models_decode" . }} diff --git a/template.ts b/template.ts index 58a6737b..a504a028 100644 --- a/template.ts +++ b/template.ts @@ -17,7 +17,6 @@ import { Signature } from "@loopholelabs/scale-signature-interfaces"; import { Scale } from "./scale"; import {ScaleFunc} from "./scalefunc/scalefunc"; -import {Tracing} from "./tracing"; import {ModulePool} from "./pool"; export async function NewTemplate(runtime: Scale, scaleFunc: ScaleFunc, env?: { [key: string]: string }): Promise> { @@ -36,15 +35,12 @@ export class Template { public modulePool: ModulePool | undefined; public env: { [key: string]: string } | undefined; - public tracing: Tracing; constructor(runtime: Scale, scaleFunc: ScaleFunc, env?: { [key: string]: string }) { this.runtime = runtime; this.identifier = `${scaleFunc.Name}:${scaleFunc.Tag}`; this.env = env; - this.tracing = new Tracing(this.identifier, Buffer.alloc(16), this.runtime.TraceDataCallback); - if (scaleFunc.Stateless) { this.modulePool = new ModulePool(this); } diff --git a/tracing.ts b/tracing.ts index 3c5aa7a2..22827d66 100644 --- a/tracing.ts +++ b/tracing.ts @@ -14,6 +14,9 @@ limitations under the License. */ +import {Module} from "./module"; +import {Signature} from "@loopholelabs/scale-signature-interfaces"; + const ErrNoInstance = Error("no webassembly instance") const ErrNoMemory = Error("no exported memory in webassembly instance") @@ -26,49 +29,48 @@ export interface HostFunctions extends WebAssembly.ModuleImports { export type CallbackFunction = (data: string) => void -export class Tracing { +export class Tracing { private exports: WebAssembly.Exports | undefined; - private invocationId: Buffer; - private readonly functionName: string; + private readonly module: Module; private readonly traceCallback: CallbackFunction | undefined; - constructor(functionName: string, invocationId: Buffer, traceCallback: CallbackFunction | undefined) { - this.invocationId = invocationId; - this.functionName = functionName; + constructor(module: Module, traceCallback: CallbackFunction | undefined) { + this.module = module; this.traceCallback = traceCallback; } getFunctionNameLen(): number { const enc = new TextEncoder(); - const data = enc.encode(this.functionName); + const data = enc.encode(this.module.template.identifier); return data.length; } getFunctionName(ptr: number) { const enc = new TextEncoder(); - const data = enc.encode(this.functionName); + const data = enc.encode(this.module.template.identifier); const buffer = this.getDataView(); for (let i=0;i Date: Wed, 20 Sep 2023 12:19:04 -0700 Subject: [PATCH 9/9] Fixing lint for golang Signed-off-by: Shivansh Vij --- signature/generator/typescript/generator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signature/generator/typescript/generator_test.go b/signature/generator/typescript/generator_test.go index 569b7d05..6bab3c99 100644 --- a/signature/generator/typescript/generator_test.go +++ b/signature/generator/typescript/generator_test.go @@ -32,7 +32,7 @@ func TestGenerator(t *testing.T) { formatted, err := GenerateTypes(s, "types") require.NoError(t, err) - //os.WriteFile("./generated.txt", formatted, 0644) + // os.WriteFile("./generated.txt", formatted, 0644) master, err := os.ReadFile("./generated.txt") require.NoError(t, err)