From 7ccae17e1770636ac507c00df574da60b08fc4cf Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Thu, 2 May 2024 13:37:05 -0500 Subject: [PATCH] Lots of uml2ts stuff (#33) * Guess what? More restructuring! * Update workflow paths * Just stuff and things * It kinda does the thing in a way * Buf stuff * Regen stuff * Little tidbits in the TS * Fix lockfile again * Taking the stuff from the other thing * Working on the thing or something. Idfk * Make it all pretty and compilable * Refactor generator test for simplicity The generator test has been simplified by removing the use of a Writable stream. The 'gen' function now directly returns the result, which is then tested for null and emptiness. This change makes the test more straightforward and easier to understand. * Added test command to Makefile A new 'test' command has been added to the Makefile. This allows for running tests directly from the make utility, improving the testing workflow. * Added nested fields to 'test' type The 'test' type in the Generator now supports nested fields. A new field named 'test' of type string has been added under the existing 'test' type. This enhancement provides more flexibility and depth when defining types. * Refactored Makefile for better organization The Makefile has been restructured to improve readability and maintainability. Changes include: - Separated build and test targets into dotnet-specific and package-specific ones - Reordered clean targets for logical consistency - Moved proto-related operations into their own targets with dependencies - Added explicit touch commands to ensure correct timestamp updates on build artifacts * Expanded MIME type support in UML generator The UML generator's read function now supports a wider range of MIME types. A new 'SupportedMimeType' type has been introduced to handle this change. The function will now throw an error for unrecognized media types, improving the robustness of the code. * Updated package.json in UML package The package.json file in the UML package has been updated. The 'module' field was moved under the 'type' field for better organization. Additionally, two new fields were added: 'main', which points to the main JavaScript file, and 'types', which points to the TypeScript definition file. * Added fast-check to devDependencies The package.json file in the UML package has been updated. The main change is the addition of "fast-check" to the list of development dependencies, which will help with property-based testing. * Added test step to build action A new testing step has been added to the GitHub Actions workflow for building. This step runs after the build process and before linting, ensuring that tests are executed as part of the continuous integration pipeline. * Added tests and updated MIME types handling - Introduced new tests for the 'read' function in the UML package, checking its ability to handle different data types. - Refactored SupportedMimeType from a union type to an array constant and derived tuple type. This change enhances code maintainability by centralizing MIME type definitions. * Refactored UML to TypeScript conversion logic The code has been refactored to improve the structure and readability. The main changes include: - Extracted the generation logic into a separate command file. - Introduced an Io interface for better handling of input/output operations. - Simplified index.ts by using a new app function that applies commands. - Created a new program.ts file to handle command-related operations, including options and actions. * Updated dependencies in package.json Added 'fast-check' to the devDependencies in the package.json file. This new dependency will help improve testing capabilities. Also, there's a binary change in bun.lockb file. * Updated MIME type in test cases The MIME type 'application/protobuf' was replaced with 'application/x-protobuf' in the unit tests. This change ensures that our tests are aligned with the correct and updated MIME types. * Refactor IO interface and streamline gen function Significant changes include: - Replaced 'BunFile' with 'ArrayBufferSink' and 'Blob' in the Io interface - Removed check for stdin readability in the gen function - Simplified writing to stdout in the gen function * Added support for protobuf and JSON data Implemented functionality to read protobuf and JSON data in the 'gen' function. This includes creating arbitrary fields and types, converting them into binary or JSON format, and then reading them back. Also added tests to verify this functionality for different mime types of protobuf as well as JSON data. * Updated dependencies in package.json Added 'testcontainers' to the devDependencies in the package.json file. This new dependency will aid in managing test environments. * Add Docker support for uml2ts Introduced Docker support for the uml2ts project. This includes: - A new Makefile to build the Docker image - A .dockerignore file to exclude unnecessary files from the Docker context - A multi-stage Dockerfile that sets up the necessary environment, copies over required files, installs dependencies, and builds the application. * Updated package.json and bun.lockb Removed 'src/*' from the workspaces array in package.json. Also, updated the binary file bun.lockb. * Refactor IO handling in uml2ts package Significant changes include: - Removed the Io interface and its usage from command.ts and program.ts - Directly used Bun's stdin and stdout for buffer reading and writing in gen function - Simplified action call in gen command by removing io() argument * Added Makefile and updated package.json A new Makefile has been added to the uml2ts package, introducing build, test, clean, and docker commands. The package.json file in the same package has also been updated with a removal of the "prestart" script. * Updated Docker build process The Docker build process has been updated to include a new test target. This change introduces a new 'uml2ts_test' target in the Makefile, which builds a Docker image for testing purposes. Additionally, the Dockerfile now includes an extra stage that uses Ubuntu as its base image for this test build. * Added test_image target to Makefile A new target, 'test_image', has been added to the Makefile. This allows for the creation of a test image using the existing docker setup. * Updated Dockerfile for uml2ts The Dockerfile for uml2ts has been updated to include a build platform argument. The base image for the test stage has also been changed to a specific version of Ubuntu, and the final stage now includes an alias. * Updated test setup and command execution The testing setup has been updated to include a `beforeAll` block that builds the necessary binary file for tests. The way commands are executed in tests has also been changed, replacing the previous IO-based approach with spawning processes. This change simplifies the code and makes it easier to manage input/output streams. In addition, there's a minor refactor in how commands are applied in the main application logic, making it more functional by passing root as a function instead of an object. * Refactor test setup and simplify tests The test setup has been refactored to ensure a clean environment before each run. The 'Field' and 'Type' imports have been removed, as well as the corresponding arbitrary generators. Tests have been simplified by removing the use of fast-check library and instead using static values for testing. An 'afterAll' cleanup function has also been added to remove any residual files after tests are completed. * Fixes * More fixes * Format * And some more --- .github/actions/build-bun/action.yml | 5 + .github/workflows/packages.yml | 8 +- Makefile | 59 +- buf.gen.yaml | 2 + bun.lockb | Bin 60368 -> 97552 bytes docker/Makefile | 15 + docker/uml2ts/.dockerignore | 22 + docker/uml2ts/Dockerfile | 35 + eslint.config.mjs | 7 +- .../es/unmango/dev/tdl/v1alpha1/uml_pb.ts | 289 ++- .../go/unmango/dev/tdl/v1alpha1/uml.pb.go | 861 ++++++- gen/proto/ts/google/protobuf/any.ts | 242 ++ gen/proto/ts/index.ts | 1 + gen/proto/ts/package.json | 3 +- gen/proto/ts/unmango/dev/tdl/v1alpha1/uml.ts | 2127 ++++++++++++++++- package.json | 3 +- packages/Makefile | 29 +- packages/ts/converter.ts | 12 + packages/ts/generator.spec.ts | 33 + packages/ts/generator.ts | 40 + packages/ts/index.ts | 42 +- packages/ts/package.json | 16 +- packages/ts/tsconfig.json | 26 +- packages/uml/README.md | 15 + packages/uml/index.spec.ts | 42 + packages/uml/index.ts | 45 + packages/uml/package.json | 23 + packages/uml/tsconfig.json | 3 + packages/uml2ts/Makefile | 18 + packages/uml2ts/README.md | 15 + packages/uml2ts/command.spec.ts | 65 + packages/uml2ts/command.ts | 9 + packages/uml2ts/index.ts | 10 + packages/uml2ts/package.json | 29 + packages/uml2ts/program.ts | 20 + packages/uml2ts/tsconfig.json | 3 + pkg/pcl/convert.go | 7 +- pkg/pcl/convert_test.go | 10 +- proto/buf.lock | 8 + proto/buf.yaml | 4 +- proto/unmango/dev/tdl/v1alpha1/uml.proto | 42 +- 41 files changed, 3992 insertions(+), 253 deletions(-) create mode 100644 docker/Makefile create mode 100644 docker/uml2ts/.dockerignore create mode 100644 docker/uml2ts/Dockerfile create mode 100644 gen/proto/ts/google/protobuf/any.ts create mode 100644 gen/proto/ts/index.ts create mode 100644 packages/ts/converter.ts create mode 100644 packages/ts/generator.spec.ts create mode 100644 packages/ts/generator.ts create mode 100644 packages/uml/README.md create mode 100644 packages/uml/index.spec.ts create mode 100644 packages/uml/index.ts create mode 100644 packages/uml/package.json create mode 100644 packages/uml/tsconfig.json create mode 100644 packages/uml2ts/Makefile create mode 100644 packages/uml2ts/README.md create mode 100644 packages/uml2ts/command.spec.ts create mode 100644 packages/uml2ts/command.ts create mode 100644 packages/uml2ts/index.ts create mode 100644 packages/uml2ts/package.json create mode 100644 packages/uml2ts/program.ts create mode 100644 packages/uml2ts/tsconfig.json create mode 100644 proto/buf.lock diff --git a/.github/actions/build-bun/action.yml b/.github/actions/build-bun/action.yml index 665c255e..f8c14ed2 100644 --- a/.github/actions/build-bun/action.yml +++ b/.github/actions/build-bun/action.yml @@ -24,6 +24,11 @@ runs: working-directory: ${{ inputs.path }} run: bun run build + - name: Test + shell: bash + working-directory: ${{ inputs.path }} + run: bun test + - name: Lint shell: bash # This will likely error on unrelated linting errors... diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 654bf1c8..daa07b80 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -29,12 +29,18 @@ jobs: build-bun: runs-on: ubuntu-latest + strategy: + matrix: + path: + - ts + - uml + - uml2ts steps: - uses: actions/checkout@v4 - uses: ./.github/actions/build-bun with: - path: packages/ts + path: packages/${{ matrix.path }} build-go: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index f465eaff..6d681cec 100644 --- a/Makefile +++ b/Makefile @@ -23,28 +23,33 @@ CLI_BIN := $(CLI_DIR)/$(BIN_PATH)/um.dll LANG_DIR := src/Language LANG_SRC := $(shell find $(LANG_DIR) -name '*.fs' -not -path '*obj*' -type f) -.PHONY: build test gen lint -build: $(LANG_SRC) $(CLI_SRC) $(BROKER_SRC) build_proto +.PHONY: build build_dotnet +build: build_dotnet @touch .make/build_lang - dotnet build +build_dotnet: .make/build_dotnet -test: build +.PHONY: test test_dotnet +test: test_dotnet test_packages +test_dotnet: build_dotnet dotnet test --no-build +test_packages: + @$(MAKE) -C packages test -gen: clean_gen build_proto - buf generate +.PHONY: gen +gen: gen_proto +.PHONY: lint lint: .make/lint_proto .make/lint_lang .PHONY: clean clean_gen clean_src clean_dist clean: clean_gen clean_src clean_dist rm -rf .make -clean_src: - @$(MAKE) -C src clean clean_cli: @$(MAKE) -C cli clean clean_gen: @$(MAKE) -C gen clean +clean_src: + @$(MAKE) -C src clean clean_dist: @find . -type d -name dist \ -not -path '*node_modules*' \ @@ -61,12 +66,10 @@ tidy: gen release: goreleaser release --snapshot --clean -.PHONY: build_proto -build_proto: - buf build - -$(BROKER_BIN): $(BROKER_SRC) - dotnet build ${BROKER_DIR} +.PHONY: proto gen_proto build_proto +proto: build_proto gen_proto +gen_proto: .make/gen_proto +build_proto: .make/build_proto # The naming is kinda silly but its short .PHONY: work @@ -87,22 +90,30 @@ go.work.sum: go.work dotnet tool restore @touch $@ +PROTO_SRC := $(shell find proto -type f -name '*.proto') +.make/gen_proto: .make/build_proto $(PROTO_SRC) + buf generate + @touch $@ +.make/build_proto: $(PROTO_SRC) + buf build + @touch $@ +.make/lint_proto: $(PROTO_SRC) + buf lint proto + @touch $@ + +.make/build_dotnet: $(LANG_SRC) $(BROKER_SRC) $(CLI_SRC) .make/gen_proto + dotnet build + @touch $@ .make/build_lang .make/build_broker .make/build_cli .make/build_lang: $(LANG_SRC) dotnet build ${LANG_DIR} @touch $@ - -.make/build_cli: $(CLI_SRC) - dotnet build ${CLI_DIR} +.make/build_broker: $(BROKER_SRC) .make/gen_proto + dotnet build ${BROKER_DIR} @touch $@ - -.make/lint_proto: - buf lint proto +.make/build_cli: $(CLI_SRC) .make/gen_proto + dotnet build ${CLI_DIR} @touch $@ .make/lint_lang: .make/tool_restore $(LANG_SRC) dotnet fantomas ${LANG_DIR} @touch $@ - -.make/build_plugin_gen_ts: - cd plugin/gen/ts && bun run build - @touch $@ diff --git a/buf.gen.yaml b/buf.gen.yaml index 1551ee01..d2f4fc2e 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -4,6 +4,8 @@ managed: enabled: true go_package_prefix: default: github.com/unstoppablemango/tdl/gen/proto/go + except: + - buf.build/googleapis/googleapis plugins: - plugin: buf.build/connectrpc/go:v1.16.1 diff --git a/bun.lockb b/bun.lockb index 51b880e480bc5796a785878f55d661bc85f958ef..e0c1bd470cec19411f6169b612dc17f90ff7b321 100755 GIT binary patch delta 32802 zcmeIbc|29$_c(m-b;&hL88VZEkeOtN=AseJx#lbLP^7w=H7GfyL8LUH6q;2^X)ckQm__x^l8zvuM~|9sD@W$m^0-fOSD_S(Za_q0yc1F^K9;%R2aCByTA zoCmMl|LUyYotJxd#|3aF?>TJKY!+T@_J%21!i60qLI06qv66Ek ztq3?UHcSu^$71yqW3i-wmZb4U8h3Cgz7?0nQh@xhz_}49#t3LEuS{bdz&xM>0t2H= z1+lCTP){D{*MNCpkkFT)7%Kr|#YDhzfFD5tROl#R1Hk(LBVQ0}8XOks$8wUS%5Mk0 zH1dNZB4YwstPM0BB!~zwjgMl*LF;5b!Dp)o1<(Xii=h;%{S#=mXZe4SZ-hS*Irv%Fz-Y>Pa=S32+}^_XXkD+aP{yTr>&| zjE@xrC9?W}Ca852VARsCH`Ulp*x|aKKG+~Y|x)lq>-kxXu65UPXS|3{fwx3 zgFqlE7#|TJ@E5RH1C6PMWq=QzO}+^oo3fKjkB@R9bj=7Ut2tnt_aixnB+k9}j! zi{VE_C9+sA%%~x#FoE{bbg{7^mRKNyAAyKvJ&@|rA;2iGKTX?MPz~{8BOt|M<-uRH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|5Qa1P2-;~!rYLKZ;3oNwt@{8_f$?vt??q&9kN-X28kADxo!RK z&ggR^U2I}u1G7%v_+bHK!fLPC`5A1V3yg+D8+(XwGBQ_j!JT=?abD`xoU(Kcy05&1 zw+HhaYq`{1S+y&y@T9&BjZNWk;qmx}Yg9LlBHx>PPJQ-7!lSJr01{7hSbw%3+j3&m zi;pChtJ_z6&K)|nrO)3i60y>gd5gC_m={|mPI$1Gn8(|&T)*l*f8m*Bb7G1tHYAZ3 z!ra9`Pt5vT;zdt{X0doci;vy~c$?O)3asrMI;&u`BTMQY8&0Y6yWYuZHn6dnxIG3WgXI!^Pv;e95;HyfYtw_pJ51a(pr3jX~ul)ct6 z>$)qF@bY2NF^|hREIYiJC{O?46^8dKWs+)IO(AjFojJ?7@!@gU=cM-Hm=9K*@wVLTTQ0$sOo|T2sq5EHqBfFwcClQ^2Zr>$SY32VujFPFZ5@_Nd*h+G(<6Tk z*bND7PY73Rkobt&TCV#q-Ab7K!j$i^&np`ewhYT30v_DFJa_i(Uf(N{NU~ZKB)p@T zr}wi#>R$>r98NPeN=us`^;;h#(n+I9)3BXbv~K?kv(G-VzBx!dABAPsDOfoA#z=-7^2G0&~*)^=H>+^~cE=+=aa)xI#YDO6ksjd^?vtIS9$h(hbYf^wM4 z_F2Q(AVvdgBcg_}T-}s%;a`QJ{&g604pzg8?<<4KQp?lxdVTh-T612b?YdQViB0m0 z7yi-A!yU5fJL}&J`f1$p;H#=)_Elv@CVS4-DpqUs?^=ot)0x5ciYAh-N#g8umg!RQ YROQnZeR_|Hzor_)U--n+&#>M93%Q0{P5=M^ diff --git a/docker/Makefile b/docker/Makefile new file mode 100644 index 00000000..006d957f --- /dev/null +++ b/docker/Makefile @@ -0,0 +1,15 @@ +CONTEXT := $(shell git rev-parse --show-toplevel) + +.PHONY: uml2ts uml2ts_test +uml2ts: + docker build \ + -f uml2ts/Dockerfile \ + -t unstoppablemango/uml2ts \ + ${CONTEXT} + +uml2ts_test: + docker build \ + -f uml2ts/Dockerfile \ + -t unstoppablemango/uml2ts_test \ + --target test \ + ${CONTEXT} diff --git a/docker/uml2ts/.dockerignore b/docker/uml2ts/.dockerignore new file mode 100644 index 00000000..34d728dd --- /dev/null +++ b/docker/uml2ts/.dockerignore @@ -0,0 +1,22 @@ +node_modules +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode +Makefile +.env +.editorconfig +.idea +coverage* +.config +.github +.make +cli +docker +pkg +proto +src diff --git a/docker/uml2ts/Dockerfile b/docker/uml2ts/Dockerfile new file mode 100644 index 00000000..9bd4fa04 --- /dev/null +++ b/docker/uml2ts/Dockerfile @@ -0,0 +1,35 @@ +FROM oven/bun:1 AS base +ARG BUILDPLATFORM +WORKDIR /build + +FROM base AS install + +RUN mkdir -p gen/proto/{es,ts} packages/{ts,uml,uml2ts} + +COPY package.json . +COPY gen/proto/es/package.json gen/proto/es/ +COPY gen/proto/ts/package.json gen/proto/ts/ +COPY packages/ts/package.json packages/ts/ +COPY packages/uml/package.json packages/uml/ +COPY packages/uml2ts/package.json packages/uml2ts/ +COPY bun.lockb . + +RUN bun install --frozen-lockfile --production + +FROM --platform=$BUILDPLATFORM install AS build +COPY --from=install /build/node_modules . + +COPY gen/proto/es/ gen/proto/es/ +COPY gen/proto/ts/ gen/proto/ts/ +COPY packages/ts/ packages/ts/ +COPY packages/uml/ packages/uml/ +COPY packages/uml2ts/ . + +RUN bun run build + +FROM ubuntu:noble-20240429 AS test +COPY --from=build /build/dist/uml2ts . + +FROM --platform=$BUILDPLATFORM scratch AS dist +COPY --from=build /build/dist/uml2ts . +ENTRYPOINT ["uml2ts"] diff --git a/eslint.config.mjs b/eslint.config.mjs index 4572dc63..b0e8a2fb 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,10 +12,11 @@ export default tslint.config( '.idea/', '.make', '.vscode/', - 'bin/', - 'gen/', - 'obj/', 'proto/', + '**/bin/', + '**/gen/', + '**/obj/', + '**/dist/', ], }, { diff --git a/gen/proto/es/unmango/dev/tdl/v1alpha1/uml_pb.ts b/gen/proto/es/unmango/dev/tdl/v1alpha1/uml_pb.ts index 357ace10..2a1ffed1 100644 --- a/gen/proto/es/unmango/dev/tdl/v1alpha1/uml_pb.ts +++ b/gen/proto/es/unmango/dev/tdl/v1alpha1/uml_pb.ts @@ -4,7 +4,7 @@ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; +import { Any, Message, proto3 } from "@bufbuild/protobuf"; /** * @generated from message unmango.dev.tdl.v1alpha1.FromRequest @@ -238,9 +238,9 @@ export class Spec extends Message { name = ""; /** - * @generated from field: string repository = 2; + * @generated from field: string source = 2; */ - repository = ""; + source = ""; /** * @generated from field: string version = 3; @@ -258,15 +258,25 @@ export class Spec extends Message { description = ""; /** - * @generated from field: repeated string tags = 6; + * @generated from field: map labels = 6; */ - tags: string[] = []; + labels: { [key: string]: string } = {}; /** * @generated from field: map types = 7; */ types: { [key: string]: Type } = {}; + /** + * @generated from field: map functions = 8; + */ + functions: { [key: string]: Function } = {}; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -276,12 +286,14 @@ export class Spec extends Message { static readonly typeName = "unmango.dev.tdl.v1alpha1.Spec"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "repository", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "source", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "display_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "tags", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 6, name: "labels", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, { no: 7, name: "types", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Type} }, + { no: 8, name: "functions", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Function} }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Spec { @@ -306,9 +318,34 @@ export class Spec extends Message { */ export class Type extends Message { /** - * @generated from field: string name = 1; + * @generated from field: string type = 1; */ - name = ""; + type = ""; + + /** + * @generated from field: map fields = 2; + */ + fields: { [key: string]: Field } = {}; + + /** + * @generated from field: map methods = 3; + */ + methods: { [key: string]: Function } = {}; + + /** + * @generated from field: map generic_parameters = 4; + */ + genericParameters: { [key: string]: GenericParameter } = {}; + + /** + * @generated from field: optional unmango.dev.tdl.v1alpha1.Constructor constructor = 5; + */ + constructor$?: Constructor; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; constructor(data?: PartialMessage) { super(); @@ -318,7 +355,12 @@ export class Type extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "unmango.dev.tdl.v1alpha1.Type"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "fields", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Field} }, + { no: 3, name: "methods", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Function} }, + { no: 4, name: "generic_parameters", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: GenericParameter} }, + { no: 5, name: "constructor", kind: "message", T: Constructor, opt: true }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Type { @@ -338,3 +380,230 @@ export class Type extends Message { } } +/** + * @generated from message unmango.dev.tdl.v1alpha1.Field + */ +export class Field extends Message { + /** + * @generated from field: string type = 1; + */ + type = ""; + + /** + * @generated from field: bool readonly = 2; + */ + readonly = false; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "unmango.dev.tdl.v1alpha1.Field"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "readonly", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Field { + return new Field().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Field { + return new Field().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Field { + return new Field().fromJsonString(jsonString, options); + } + + static equals(a: Field | PlainMessage | undefined, b: Field | PlainMessage | undefined): boolean { + return proto3.util.equals(Field, a, b); + } +} + +/** + * @generated from message unmango.dev.tdl.v1alpha1.Function + */ +export class Function extends Message { + /** + * @generated from field: unmango.dev.tdl.v1alpha1.Type return_type = 1; + */ + returnType?: Type; + + /** + * @generated from field: map parameters = 2; + */ + parameters: { [key: string]: Type } = {}; + + /** + * @generated from field: map generic_parameters = 3; + */ + genericParameters: { [key: string]: GenericParameter } = {}; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "unmango.dev.tdl.v1alpha1.Function"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "return_type", kind: "message", T: Type }, + { no: 2, name: "parameters", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Type} }, + { no: 3, name: "generic_parameters", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: GenericParameter} }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Function { + return new Function().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Function { + return new Function().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Function { + return new Function().fromJsonString(jsonString, options); + } + + static equals(a: Function | PlainMessage | undefined, b: Function | PlainMessage | undefined): boolean { + return proto3.util.equals(Function, a, b); + } +} + +/** + * @generated from message unmango.dev.tdl.v1alpha1.GenericParameter + */ +export class GenericParameter extends Message { + /** + * @generated from field: repeated unmango.dev.tdl.v1alpha1.Modifier modifiers = 1; + */ + modifiers: Modifier[] = []; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "unmango.dev.tdl.v1alpha1.GenericParameter"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "modifiers", kind: "message", T: Modifier, repeated: true }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GenericParameter { + return new GenericParameter().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GenericParameter { + return new GenericParameter().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GenericParameter { + return new GenericParameter().fromJsonString(jsonString, options); + } + + static equals(a: GenericParameter | PlainMessage | undefined, b: GenericParameter | PlainMessage | undefined): boolean { + return proto3.util.equals(GenericParameter, a, b); + } +} + +/** + * @generated from message unmango.dev.tdl.v1alpha1.Modifier + */ +export class Modifier extends Message { + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "unmango.dev.tdl.v1alpha1.Modifier"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Modifier { + return new Modifier().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Modifier { + return new Modifier().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Modifier { + return new Modifier().fromJsonString(jsonString, options); + } + + static equals(a: Modifier | PlainMessage | undefined, b: Modifier | PlainMessage | undefined): boolean { + return proto3.util.equals(Modifier, a, b); + } +} + +/** + * @generated from message unmango.dev.tdl.v1alpha1.Constructor + */ +export class Constructor extends Message { + /** + * @generated from field: map parameters = 1; + */ + parameters: { [key: string]: Type } = {}; + + /** + * @generated from field: map meta = 128; + */ + meta: { [key: string]: Any } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "unmango.dev.tdl.v1alpha1.Constructor"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parameters", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Type} }, + { no: 128, name: "meta", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Any} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Constructor { + return new Constructor().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Constructor { + return new Constructor().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Constructor { + return new Constructor().fromJsonString(jsonString, options); + } + + static equals(a: Constructor | PlainMessage | undefined, b: Constructor | PlainMessage | undefined): boolean { + return proto3.util.equals(Constructor, a, b); + } +} + diff --git a/gen/proto/go/unmango/dev/tdl/v1alpha1/uml.pb.go b/gen/proto/go/unmango/dev/tdl/v1alpha1/uml.pb.go index b52eee27..f27b94f7 100644 --- a/gen/proto/go/unmango/dev/tdl/v1alpha1/uml.pb.go +++ b/gen/proto/go/unmango/dev/tdl/v1alpha1/uml.pb.go @@ -9,6 +9,7 @@ package tdlv1alpha1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -307,13 +308,15 @@ type Spec struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - Tags []string `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"` - Types map[string]*Type `protobuf:"bytes,7,rep,name=types,proto3" json:"types,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + DisplayName string `protobuf:"bytes,4,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Labels map[string]string `protobuf:"bytes,6,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Types map[string]*Type `protobuf:"bytes,7,rep,name=types,proto3" json:"types,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Functions map[string]*Function `protobuf:"bytes,8,rep,name=functions,proto3" json:"functions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Spec) Reset() { @@ -355,9 +358,9 @@ func (x *Spec) GetName() string { return "" } -func (x *Spec) GetRepository() string { +func (x *Spec) GetSource() string { if x != nil { - return x.Repository + return x.Source } return "" } @@ -383,9 +386,9 @@ func (x *Spec) GetDescription() string { return "" } -func (x *Spec) GetTags() []string { +func (x *Spec) GetLabels() map[string]string { if x != nil { - return x.Tags + return x.Labels } return nil } @@ -397,12 +400,31 @@ func (x *Spec) GetTypes() map[string]*Type { return nil } +func (x *Spec) GetFunctions() map[string]*Function { + if x != nil { + return x.Functions + } + return nil +} + +func (x *Spec) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + type Type struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Fields map[string]*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Methods map[string]*Function `protobuf:"bytes,3,rep,name=methods,proto3" json:"methods,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + GenericParameters map[string]*GenericParameter `protobuf:"bytes,4,rep,name=generic_parameters,json=genericParameters,proto3" json:"generic_parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Constructor *Constructor `protobuf:"bytes,5,opt,name=constructor,proto3,oneof" json:"constructor,omitempty"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *Type) Reset() { @@ -437,95 +459,596 @@ func (*Type) Descriptor() ([]byte, []int) { return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{7} } -func (x *Type) GetName() string { +func (x *Type) GetType() string { if x != nil { - return x.Name + return x.Type } return "" } +func (x *Type) GetFields() map[string]*Field { + if x != nil { + return x.Fields + } + return nil +} + +func (x *Type) GetMethods() map[string]*Function { + if x != nil { + return x.Methods + } + return nil +} + +func (x *Type) GetGenericParameters() map[string]*GenericParameter { + if x != nil { + return x.GenericParameters + } + return nil +} + +func (x *Type) GetConstructor() *Constructor { + if x != nil { + return x.Constructor + } + return nil +} + +func (x *Type) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + +type Field struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Readonly bool `protobuf:"varint,2,opt,name=readonly,proto3" json:"readonly,omitempty"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{8} +} + +func (x *Field) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Field) GetReadonly() bool { + if x != nil { + return x.Readonly + } + return false +} + +func (x *Field) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + +type Function struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReturnType *Type `protobuf:"bytes,1,opt,name=return_type,json=returnType,proto3" json:"return_type,omitempty"` + Parameters map[string]*Type `protobuf:"bytes,2,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + GenericParameters map[string]*GenericParameter `protobuf:"bytes,3,rep,name=generic_parameters,json=genericParameters,proto3" json:"generic_parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Function) Reset() { + *x = Function{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Function) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Function) ProtoMessage() {} + +func (x *Function) ProtoReflect() protoreflect.Message { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Function.ProtoReflect.Descriptor instead. +func (*Function) Descriptor() ([]byte, []int) { + return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{9} +} + +func (x *Function) GetReturnType() *Type { + if x != nil { + return x.ReturnType + } + return nil +} + +func (x *Function) GetParameters() map[string]*Type { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *Function) GetGenericParameters() map[string]*GenericParameter { + if x != nil { + return x.GenericParameters + } + return nil +} + +func (x *Function) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + +type GenericParameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Modifiers []*Modifier `protobuf:"bytes,1,rep,name=modifiers,proto3" json:"modifiers,omitempty"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GenericParameter) Reset() { + *x = GenericParameter{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GenericParameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenericParameter) ProtoMessage() {} + +func (x *GenericParameter) ProtoReflect() protoreflect.Message { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenericParameter.ProtoReflect.Descriptor instead. +func (*GenericParameter) Descriptor() ([]byte, []int) { + return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{10} +} + +func (x *GenericParameter) GetModifiers() []*Modifier { + if x != nil { + return x.Modifiers + } + return nil +} + +func (x *GenericParameter) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + +type Modifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Modifier) Reset() { + *x = Modifier{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Modifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Modifier) ProtoMessage() {} + +func (x *Modifier) ProtoReflect() protoreflect.Message { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Modifier.ProtoReflect.Descriptor instead. +func (*Modifier) Descriptor() ([]byte, []int) { + return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{11} +} + +func (x *Modifier) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + +type Constructor struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Parameters map[string]*Type `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Meta map[string]*anypb.Any `protobuf:"bytes,128,rep,name=meta,proto3" json:"meta,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Constructor) Reset() { + *x = Constructor{} + if protoimpl.UnsafeEnabled { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Constructor) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Constructor) ProtoMessage() {} + +func (x *Constructor) ProtoReflect() protoreflect.Message { + mi := &file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Constructor.ProtoReflect.Descriptor instead. +func (*Constructor) Descriptor() ([]byte, []int) { + return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP(), []int{12} +} + +func (x *Constructor) GetParameters() map[string]*Type { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *Constructor) GetMeta() map[string]*anypb.Any { + if x != nil { + return x.Meta + } + return nil +} + var File_unmango_dev_tdl_v1alpha1_uml_proto protoreflect.FileDescriptor var file_unmango_dev_tdl_v1alpha1_uml_proto_rawDesc = []byte{ 0x0a, 0x22, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x74, 0x64, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x75, 0x6d, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x21, - 0x0a, 0x0b, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x42, 0x0a, 0x0c, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, - 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, - 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x40, 0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, - 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, - 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x21, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3f, 0x0a, 0x09, 0x54, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, - 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x20, 0x0a, 0x0a, 0x54, - 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xc8, 0x02, - 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x3f, 0x0a, - 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x75, + 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x19, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x21, 0x0a, 0x0b, 0x46, 0x72, 0x6f, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x42, 0x0a, 0x0c, + 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, + 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x22, 0x40, 0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, + 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, + 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, + 0x65, 0x63, 0x22, 0x21, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3f, 0x0a, 0x09, 0x54, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x32, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x20, 0x0a, 0x0a, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe8, 0x05, 0x0a, 0x04, 0x53, 0x70, 0x65, + 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, + 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x58, - 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x12, 0x3f, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, + 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x12, 0x4b, 0x0a, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x53, 0x70, 0x65, 0x63, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x09, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3d, + 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x32, 0x8e, 0x02, 0x0a, 0x0a, 0x55, 0x6d, 0x6c, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x25, 0x2e, 0x75, 0x6e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x58, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x60, 0x0a, 0x0e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xa5, 0x06, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x42, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x12, 0x45, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x64, 0x0a, 0x12, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x12, 0x4c, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x48, 0x00, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, + 0x3d, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x5a, + 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5e, 0x0a, 0x0c, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, - 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x72, - 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x54, 0x0a, 0x03, - 0x47, 0x65, 0x6e, 0x12, 0x24, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, - 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, - 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x30, 0x01, 0x12, 0x51, 0x0a, 0x02, 0x54, 0x6f, 0x12, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, - 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x70, 0x0a, 0x16, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4d, 0x0a, 0x09, + 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, + 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x22, 0xc6, 0x01, 0x0a, 0x05, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, + 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, + 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x3e, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x80, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0xec, 0x04, 0x0a, 0x08, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x52, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x68, 0x0a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x75, + 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, + 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, + 0x65, 0x74, 0x61, 0x1a, 0x5d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x70, 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0xfe, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xee, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x40, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x08, 0x55, 0x6d, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, - 0x6e, 0x73, 0x74, 0x6f, 0x70, 0x70, 0x61, 0x62, 0x6c, 0x65, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, - 0x74, 0x64, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x74, 0x64, 0x6c, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x74, 0x64, 0x6c, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x55, 0x44, 0x54, 0xaa, 0x02, 0x18, 0x55, 0x6e, - 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x44, 0x65, 0x76, 0x2e, 0x54, 0x64, 0x6c, 0x2e, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x18, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, - 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x64, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xe2, 0x02, 0x24, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x44, 0x65, 0x76, 0x5c, - 0x54, 0x64, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x55, 0x6e, 0x6d, 0x61, 0x6e, - 0x67, 0x6f, 0x3a, 0x3a, 0x44, 0x65, 0x76, 0x3a, 0x3a, 0x54, 0x64, 0x6c, 0x3a, 0x3a, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, + 0x09, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, 0x49, 0x0a, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x75, 0x6e, 0x6d, 0x61, + 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x04, 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9c, 0x01, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, + 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, + 0x6d, 0x65, 0x74, 0x61, 0x1a, 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0xd8, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, + 0x74, 0x6f, 0x72, 0x12, 0x55, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x44, 0x0a, 0x04, 0x6d, 0x65, + 0x74, 0x61, 0x18, 0x80, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x75, 0x6e, 0x6d, 0x61, + 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, + 0x1a, 0x5d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, + 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x4d, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x41, 0x6e, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x8e, + 0x02, 0x0a, 0x0a, 0x55, 0x6d, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x57, 0x0a, + 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x75, + 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x54, 0x0a, 0x03, 0x47, 0x65, 0x6e, 0x12, 0x24, 0x2e, + 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, + 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x51, 0x0a, 0x02, + 0x54, 0x6f, 0x12, 0x23, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x64, 0x65, 0x76, + 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, + 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, + 0xfe, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x64, 0x65, 0x76, 0x2e, 0x74, 0x64, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x42, 0x08, 0x55, 0x6d, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x51, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x73, 0x74, 0x6f, 0x70, 0x70, + 0x61, 0x62, 0x6c, 0x65, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x74, 0x64, 0x6c, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, + 0x67, 0x6f, 0x2f, 0x64, 0x65, 0x76, 0x2f, 0x74, 0x64, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x3b, 0x74, 0x64, 0x6c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, + 0x02, 0x03, 0x55, 0x44, 0x54, 0xaa, 0x02, 0x18, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, + 0x44, 0x65, 0x76, 0x2e, 0x54, 0x64, 0x6c, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0xca, 0x02, 0x18, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, + 0x64, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x24, 0x55, 0x6e, + 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x44, 0x65, 0x76, 0x5c, 0x54, 0x64, 0x6c, 0x5c, 0x56, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x1b, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x3a, 0x3a, 0x44, 0x65, + 0x76, 0x3a, 0x3a, 0x54, 0x64, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -540,35 +1063,88 @@ func file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescGZIP() []byte { return file_unmango_dev_tdl_v1alpha1_uml_proto_rawDescData } -var file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_unmango_dev_tdl_v1alpha1_uml_proto_goTypes = []interface{}{ - (*FromRequest)(nil), // 0: unmango.dev.tdl.v1alpha1.FromRequest - (*FromResponse)(nil), // 1: unmango.dev.tdl.v1alpha1.FromResponse - (*GenRequest)(nil), // 2: unmango.dev.tdl.v1alpha1.GenRequest - (*GenResponse)(nil), // 3: unmango.dev.tdl.v1alpha1.GenResponse - (*ToRequest)(nil), // 4: unmango.dev.tdl.v1alpha1.ToRequest - (*ToResponse)(nil), // 5: unmango.dev.tdl.v1alpha1.ToResponse - (*Spec)(nil), // 6: unmango.dev.tdl.v1alpha1.Spec - (*Type)(nil), // 7: unmango.dev.tdl.v1alpha1.Type - nil, // 8: unmango.dev.tdl.v1alpha1.Spec.TypesEntry + (*FromRequest)(nil), // 0: unmango.dev.tdl.v1alpha1.FromRequest + (*FromResponse)(nil), // 1: unmango.dev.tdl.v1alpha1.FromResponse + (*GenRequest)(nil), // 2: unmango.dev.tdl.v1alpha1.GenRequest + (*GenResponse)(nil), // 3: unmango.dev.tdl.v1alpha1.GenResponse + (*ToRequest)(nil), // 4: unmango.dev.tdl.v1alpha1.ToRequest + (*ToResponse)(nil), // 5: unmango.dev.tdl.v1alpha1.ToResponse + (*Spec)(nil), // 6: unmango.dev.tdl.v1alpha1.Spec + (*Type)(nil), // 7: unmango.dev.tdl.v1alpha1.Type + (*Field)(nil), // 8: unmango.dev.tdl.v1alpha1.Field + (*Function)(nil), // 9: unmango.dev.tdl.v1alpha1.Function + (*GenericParameter)(nil), // 10: unmango.dev.tdl.v1alpha1.GenericParameter + (*Modifier)(nil), // 11: unmango.dev.tdl.v1alpha1.Modifier + (*Constructor)(nil), // 12: unmango.dev.tdl.v1alpha1.Constructor + nil, // 13: unmango.dev.tdl.v1alpha1.Spec.LabelsEntry + nil, // 14: unmango.dev.tdl.v1alpha1.Spec.TypesEntry + nil, // 15: unmango.dev.tdl.v1alpha1.Spec.FunctionsEntry + nil, // 16: unmango.dev.tdl.v1alpha1.Spec.MetaEntry + nil, // 17: unmango.dev.tdl.v1alpha1.Type.FieldsEntry + nil, // 18: unmango.dev.tdl.v1alpha1.Type.MethodsEntry + nil, // 19: unmango.dev.tdl.v1alpha1.Type.GenericParametersEntry + nil, // 20: unmango.dev.tdl.v1alpha1.Type.MetaEntry + nil, // 21: unmango.dev.tdl.v1alpha1.Field.MetaEntry + nil, // 22: unmango.dev.tdl.v1alpha1.Function.ParametersEntry + nil, // 23: unmango.dev.tdl.v1alpha1.Function.GenericParametersEntry + nil, // 24: unmango.dev.tdl.v1alpha1.Function.MetaEntry + nil, // 25: unmango.dev.tdl.v1alpha1.GenericParameter.MetaEntry + nil, // 26: unmango.dev.tdl.v1alpha1.Modifier.MetaEntry + nil, // 27: unmango.dev.tdl.v1alpha1.Constructor.ParametersEntry + nil, // 28: unmango.dev.tdl.v1alpha1.Constructor.MetaEntry + (*anypb.Any)(nil), // 29: google.protobuf.Any } var file_unmango_dev_tdl_v1alpha1_uml_proto_depIdxs = []int32{ - 6, // 0: unmango.dev.tdl.v1alpha1.FromResponse.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec - 6, // 1: unmango.dev.tdl.v1alpha1.GenRequest.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec - 6, // 2: unmango.dev.tdl.v1alpha1.ToRequest.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec - 8, // 3: unmango.dev.tdl.v1alpha1.Spec.types:type_name -> unmango.dev.tdl.v1alpha1.Spec.TypesEntry - 7, // 4: unmango.dev.tdl.v1alpha1.Spec.TypesEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Type - 0, // 5: unmango.dev.tdl.v1alpha1.UmlService.From:input_type -> unmango.dev.tdl.v1alpha1.FromRequest - 2, // 6: unmango.dev.tdl.v1alpha1.UmlService.Gen:input_type -> unmango.dev.tdl.v1alpha1.GenRequest - 4, // 7: unmango.dev.tdl.v1alpha1.UmlService.To:input_type -> unmango.dev.tdl.v1alpha1.ToRequest - 1, // 8: unmango.dev.tdl.v1alpha1.UmlService.From:output_type -> unmango.dev.tdl.v1alpha1.FromResponse - 3, // 9: unmango.dev.tdl.v1alpha1.UmlService.Gen:output_type -> unmango.dev.tdl.v1alpha1.GenResponse - 5, // 10: unmango.dev.tdl.v1alpha1.UmlService.To:output_type -> unmango.dev.tdl.v1alpha1.ToResponse - 8, // [8:11] is the sub-list for method output_type - 5, // [5:8] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 6, // 0: unmango.dev.tdl.v1alpha1.FromResponse.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec + 6, // 1: unmango.dev.tdl.v1alpha1.GenRequest.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec + 6, // 2: unmango.dev.tdl.v1alpha1.ToRequest.spec:type_name -> unmango.dev.tdl.v1alpha1.Spec + 13, // 3: unmango.dev.tdl.v1alpha1.Spec.labels:type_name -> unmango.dev.tdl.v1alpha1.Spec.LabelsEntry + 14, // 4: unmango.dev.tdl.v1alpha1.Spec.types:type_name -> unmango.dev.tdl.v1alpha1.Spec.TypesEntry + 15, // 5: unmango.dev.tdl.v1alpha1.Spec.functions:type_name -> unmango.dev.tdl.v1alpha1.Spec.FunctionsEntry + 16, // 6: unmango.dev.tdl.v1alpha1.Spec.meta:type_name -> unmango.dev.tdl.v1alpha1.Spec.MetaEntry + 17, // 7: unmango.dev.tdl.v1alpha1.Type.fields:type_name -> unmango.dev.tdl.v1alpha1.Type.FieldsEntry + 18, // 8: unmango.dev.tdl.v1alpha1.Type.methods:type_name -> unmango.dev.tdl.v1alpha1.Type.MethodsEntry + 19, // 9: unmango.dev.tdl.v1alpha1.Type.generic_parameters:type_name -> unmango.dev.tdl.v1alpha1.Type.GenericParametersEntry + 12, // 10: unmango.dev.tdl.v1alpha1.Type.constructor:type_name -> unmango.dev.tdl.v1alpha1.Constructor + 20, // 11: unmango.dev.tdl.v1alpha1.Type.meta:type_name -> unmango.dev.tdl.v1alpha1.Type.MetaEntry + 21, // 12: unmango.dev.tdl.v1alpha1.Field.meta:type_name -> unmango.dev.tdl.v1alpha1.Field.MetaEntry + 7, // 13: unmango.dev.tdl.v1alpha1.Function.return_type:type_name -> unmango.dev.tdl.v1alpha1.Type + 22, // 14: unmango.dev.tdl.v1alpha1.Function.parameters:type_name -> unmango.dev.tdl.v1alpha1.Function.ParametersEntry + 23, // 15: unmango.dev.tdl.v1alpha1.Function.generic_parameters:type_name -> unmango.dev.tdl.v1alpha1.Function.GenericParametersEntry + 24, // 16: unmango.dev.tdl.v1alpha1.Function.meta:type_name -> unmango.dev.tdl.v1alpha1.Function.MetaEntry + 11, // 17: unmango.dev.tdl.v1alpha1.GenericParameter.modifiers:type_name -> unmango.dev.tdl.v1alpha1.Modifier + 25, // 18: unmango.dev.tdl.v1alpha1.GenericParameter.meta:type_name -> unmango.dev.tdl.v1alpha1.GenericParameter.MetaEntry + 26, // 19: unmango.dev.tdl.v1alpha1.Modifier.meta:type_name -> unmango.dev.tdl.v1alpha1.Modifier.MetaEntry + 27, // 20: unmango.dev.tdl.v1alpha1.Constructor.parameters:type_name -> unmango.dev.tdl.v1alpha1.Constructor.ParametersEntry + 28, // 21: unmango.dev.tdl.v1alpha1.Constructor.meta:type_name -> unmango.dev.tdl.v1alpha1.Constructor.MetaEntry + 7, // 22: unmango.dev.tdl.v1alpha1.Spec.TypesEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Type + 9, // 23: unmango.dev.tdl.v1alpha1.Spec.FunctionsEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Function + 29, // 24: unmango.dev.tdl.v1alpha1.Spec.MetaEntry.value:type_name -> google.protobuf.Any + 8, // 25: unmango.dev.tdl.v1alpha1.Type.FieldsEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Field + 9, // 26: unmango.dev.tdl.v1alpha1.Type.MethodsEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Function + 10, // 27: unmango.dev.tdl.v1alpha1.Type.GenericParametersEntry.value:type_name -> unmango.dev.tdl.v1alpha1.GenericParameter + 29, // 28: unmango.dev.tdl.v1alpha1.Type.MetaEntry.value:type_name -> google.protobuf.Any + 29, // 29: unmango.dev.tdl.v1alpha1.Field.MetaEntry.value:type_name -> google.protobuf.Any + 7, // 30: unmango.dev.tdl.v1alpha1.Function.ParametersEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Type + 10, // 31: unmango.dev.tdl.v1alpha1.Function.GenericParametersEntry.value:type_name -> unmango.dev.tdl.v1alpha1.GenericParameter + 29, // 32: unmango.dev.tdl.v1alpha1.Function.MetaEntry.value:type_name -> google.protobuf.Any + 29, // 33: unmango.dev.tdl.v1alpha1.GenericParameter.MetaEntry.value:type_name -> google.protobuf.Any + 29, // 34: unmango.dev.tdl.v1alpha1.Modifier.MetaEntry.value:type_name -> google.protobuf.Any + 7, // 35: unmango.dev.tdl.v1alpha1.Constructor.ParametersEntry.value:type_name -> unmango.dev.tdl.v1alpha1.Type + 29, // 36: unmango.dev.tdl.v1alpha1.Constructor.MetaEntry.value:type_name -> google.protobuf.Any + 0, // 37: unmango.dev.tdl.v1alpha1.UmlService.From:input_type -> unmango.dev.tdl.v1alpha1.FromRequest + 2, // 38: unmango.dev.tdl.v1alpha1.UmlService.Gen:input_type -> unmango.dev.tdl.v1alpha1.GenRequest + 4, // 39: unmango.dev.tdl.v1alpha1.UmlService.To:input_type -> unmango.dev.tdl.v1alpha1.ToRequest + 1, // 40: unmango.dev.tdl.v1alpha1.UmlService.From:output_type -> unmango.dev.tdl.v1alpha1.FromResponse + 3, // 41: unmango.dev.tdl.v1alpha1.UmlService.Gen:output_type -> unmango.dev.tdl.v1alpha1.GenResponse + 5, // 42: unmango.dev.tdl.v1alpha1.UmlService.To:output_type -> unmango.dev.tdl.v1alpha1.ToResponse + 40, // [40:43] is the sub-list for method output_type + 37, // [37:40] is the sub-list for method input_type + 37, // [37:37] is the sub-list for extension type_name + 37, // [37:37] is the sub-list for extension extendee + 0, // [0:37] is the sub-list for field type_name } func init() { file_unmango_dev_tdl_v1alpha1_uml_proto_init() } @@ -673,14 +1249,75 @@ func file_unmango_dev_tdl_v1alpha1_uml_proto_init() { return nil } } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Function); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GenericParameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Modifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Constructor); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } + file_unmango_dev_tdl_v1alpha1_uml_proto_msgTypes[7].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_unmango_dev_tdl_v1alpha1_uml_proto_rawDesc, NumEnums: 0, - NumMessages: 9, + NumMessages: 29, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/proto/ts/google/protobuf/any.ts b/gen/proto/ts/google/protobuf/any.ts new file mode 100644 index 00000000..5cca936e --- /dev/null +++ b/gen/proto/ts/google/protobuf/any.ts @@ -0,0 +1,242 @@ +/* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Uint8Array; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: new Uint8Array(0) }; +} + +export const Any = { + encode(message: Any, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Any { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.typeUrl = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.bytes(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "", + value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + if (message.typeUrl !== "") { + obj.typeUrl = message.typeUrl; + } + if (message.value.length !== 0) { + obj.value = base64FromBytes(message.value); + } + return obj; + }, + + create, I>>(base?: I): Any { + return Any.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? new Uint8Array(0); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + if ((globalThis as any).Buffer) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); + } else { + const bin = globalThis.atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; + } +} + +function base64FromBytes(arr: Uint8Array): string { + if ((globalThis as any).Buffer) { + return globalThis.Buffer.from(arr).toString("base64"); + } else { + const bin: string[] = []; + arr.forEach((byte) => { + bin.push(globalThis.String.fromCharCode(byte)); + }); + return globalThis.btoa(bin.join("")); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/gen/proto/ts/index.ts b/gen/proto/ts/index.ts new file mode 100644 index 00000000..669754a0 --- /dev/null +++ b/gen/proto/ts/index.ts @@ -0,0 +1 @@ +export * from './unmango/dev/tdl/v1alpha1/uml'; diff --git a/gen/proto/ts/package.json b/gen/proto/ts/package.json index 41a74821..ef3dd868 100644 --- a/gen/proto/ts/package.json +++ b/gen/proto/ts/package.json @@ -2,7 +2,8 @@ "name": "@unmango/tdl-ts", "author": "UnstoppableMango", "dependencies": { - "protobufjs": "^7.2.6" + "protobufjs": "^7.2.6", + "rxjs": "^7.8.1" }, "trustedDependencies": [ "protobufjs" diff --git a/gen/proto/ts/unmango/dev/tdl/v1alpha1/uml.ts b/gen/proto/ts/unmango/dev/tdl/v1alpha1/uml.ts index 98425d65..8c11c0d8 100644 --- a/gen/proto/ts/unmango/dev/tdl/v1alpha1/uml.ts +++ b/gen/proto/ts/unmango/dev/tdl/v1alpha1/uml.ts @@ -2,6 +2,7 @@ import * as _m0 from "protobufjs/minimal"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; +import { Any } from "../../../../google/protobuf/any"; export const protobufPackage = "unmango.dev.tdl.v1alpha1"; @@ -31,12 +32,19 @@ export interface ToResponse { export interface Spec { name: string; - repository: string; + source: string; version: string; displayName: string; description: string; - tags: string[]; + labels: { [key: string]: string }; types: { [key: string]: Type }; + functions: { [key: string]: Function }; + meta: { [key: string]: Any }; +} + +export interface Spec_LabelsEntry { + key: string; + value: string; } export interface Spec_TypesEntry { @@ -44,8 +52,110 @@ export interface Spec_TypesEntry { value: Type | undefined; } +export interface Spec_FunctionsEntry { + key: string; + value: Function | undefined; +} + +export interface Spec_MetaEntry { + key: string; + value: Any | undefined; +} + export interface Type { - name: string; + type: string; + fields: { [key: string]: Field }; + methods: { [key: string]: Function }; + genericParameters: { [key: string]: GenericParameter }; + constructor?: Constructor | undefined; + meta: { [key: string]: Any }; +} + +export interface Type_FieldsEntry { + key: string; + value: Field | undefined; +} + +export interface Type_MethodsEntry { + key: string; + value: Function | undefined; +} + +export interface Type_GenericParametersEntry { + key: string; + value: GenericParameter | undefined; +} + +export interface Type_MetaEntry { + key: string; + value: Any | undefined; +} + +export interface Field { + type: string; + readonly: boolean; + meta: { [key: string]: Any }; +} + +export interface Field_MetaEntry { + key: string; + value: Any | undefined; +} + +export interface Function { + returnType: Type | undefined; + parameters: { [key: string]: Type }; + genericParameters: { [key: string]: GenericParameter }; + meta: { [key: string]: Any }; +} + +export interface Function_ParametersEntry { + key: string; + value: Type | undefined; +} + +export interface Function_GenericParametersEntry { + key: string; + value: GenericParameter | undefined; +} + +export interface Function_MetaEntry { + key: string; + value: Any | undefined; +} + +export interface GenericParameter { + modifiers: Modifier[]; + meta: { [key: string]: Any }; +} + +export interface GenericParameter_MetaEntry { + key: string; + value: Any | undefined; +} + +export interface Modifier { + meta: { [key: string]: Any }; +} + +export interface Modifier_MetaEntry { + key: string; + value: Any | undefined; +} + +export interface Constructor { + parameters: { [key: string]: Type }; + meta: { [key: string]: Any }; +} + +export interface Constructor_ParametersEntry { + key: string; + value: Type | undefined; +} + +export interface Constructor_MetaEntry { + key: string; + value: Any | undefined; } function createBaseFromRequest(): FromRequest { @@ -391,7 +501,17 @@ export const ToResponse = { }; function createBaseSpec(): Spec { - return { name: "", repository: "", version: "", displayName: "", description: "", tags: [], types: {} }; + return { + name: "", + source: "", + version: "", + displayName: "", + description: "", + labels: {}, + types: {}, + functions: {}, + meta: {}, + }; } export const Spec = { @@ -399,8 +519,8 @@ export const Spec = { if (message.name !== "") { writer.uint32(10).string(message.name); } - if (message.repository !== "") { - writer.uint32(18).string(message.repository); + if (message.source !== "") { + writer.uint32(18).string(message.source); } if (message.version !== "") { writer.uint32(26).string(message.version); @@ -411,12 +531,18 @@ export const Spec = { if (message.description !== "") { writer.uint32(42).string(message.description); } - for (const v of message.tags) { - writer.uint32(50).string(v!); - } + Object.entries(message.labels).forEach(([key, value]) => { + Spec_LabelsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).ldelim(); + }); Object.entries(message.types).forEach(([key, value]) => { Spec_TypesEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).ldelim(); }); + Object.entries(message.functions).forEach(([key, value]) => { + Spec_FunctionsEntry.encode({ key: key as any, value }, writer.uint32(66).fork()).ldelim(); + }); + Object.entries(message.meta).forEach(([key, value]) => { + Spec_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); return writer; }, @@ -439,7 +565,7 @@ export const Spec = { break; } - message.repository = reader.string(); + message.source = reader.string(); continue; case 3: if (tag !== 26) { @@ -467,7 +593,10 @@ export const Spec = { break; } - message.tags.push(reader.string()); + const entry6 = Spec_LabelsEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.labels[entry6.key] = entry6.value; + } continue; case 7: if (tag !== 58) { @@ -479,6 +608,26 @@ export const Spec = { message.types[entry7.key] = entry7.value; } continue; + case 8: + if (tag !== 66) { + break; + } + + const entry8 = Spec_FunctionsEntry.decode(reader, reader.uint32()); + if (entry8.value !== undefined) { + message.functions[entry8.key] = entry8.value; + } + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Spec_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -491,17 +640,34 @@ export const Spec = { fromJSON(object: any): Spec { return { name: isSet(object.name) ? globalThis.String(object.name) : "", - repository: isSet(object.repository) ? globalThis.String(object.repository) : "", + source: isSet(object.source) ? globalThis.String(object.source) : "", version: isSet(object.version) ? globalThis.String(object.version) : "", displayName: isSet(object.displayName) ? globalThis.String(object.displayName) : "", description: isSet(object.description) ? globalThis.String(object.description) : "", - tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e: any) => globalThis.String(e)) : [], + labels: isObject(object.labels) + ? Object.entries(object.labels).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, types: isObject(object.types) ? Object.entries(object.types).reduce<{ [key: string]: Type }>((acc, [key, value]) => { acc[key] = Type.fromJSON(value); return acc; }, {}) : {}, + functions: isObject(object.functions) + ? Object.entries(object.functions).reduce<{ [key: string]: Function }>((acc, [key, value]) => { + acc[key] = Function.fromJSON(value); + return acc; + }, {}) + : {}, + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, }; }, @@ -510,8 +676,8 @@ export const Spec = { if (message.name !== "") { obj.name = message.name; } - if (message.repository !== "") { - obj.repository = message.repository; + if (message.source !== "") { + obj.source = message.source; } if (message.version !== "") { obj.version = message.version; @@ -522,8 +688,14 @@ export const Spec = { if (message.description !== "") { obj.description = message.description; } - if (message.tags?.length) { - obj.tags = message.tags; + if (message.labels) { + const entries = Object.entries(message.labels); + if (entries.length > 0) { + obj.labels = {}; + entries.forEach(([k, v]) => { + obj.labels[k] = v; + }); + } } if (message.types) { const entries = Object.entries(message.types); @@ -534,6 +706,24 @@ export const Spec = { }); } } + if (message.functions) { + const entries = Object.entries(message.functions); + if (entries.length > 0) { + obj.functions = {}; + entries.forEach(([k, v]) => { + obj.functions[k] = Function.toJSON(v); + }); + } + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } return obj; }, @@ -543,17 +733,111 @@ export const Spec = { fromPartial, I>>(object: I): Spec { const message = createBaseSpec(); message.name = object.name ?? ""; - message.repository = object.repository ?? ""; + message.source = object.source ?? ""; message.version = object.version ?? ""; message.displayName = object.displayName ?? ""; message.description = object.description ?? ""; - message.tags = object.tags?.map((e) => e) || []; + message.labels = Object.entries(object.labels ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); message.types = Object.entries(object.types ?? {}).reduce<{ [key: string]: Type }>((acc, [key, value]) => { if (value !== undefined) { acc[key] = Type.fromPartial(value); } return acc; }, {}); + message.functions = Object.entries(object.functions ?? {}).reduce<{ [key: string]: Function }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Function.fromPartial(value); + } + return acc; + }, + {}, + ); + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseSpec_LabelsEntry(): Spec_LabelsEntry { + return { key: "", value: "" }; +} + +export const Spec_LabelsEntry = { + encode(message: Spec_LabelsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Spec_LabelsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpec_LabelsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Spec_LabelsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Spec_LabelsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create, I>>(base?: I): Spec_LabelsEntry { + return Spec_LabelsEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Spec_LabelsEntry { + const message = createBaseSpec_LabelsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; return message; }, }; @@ -632,22 +916,25 @@ export const Spec_TypesEntry = { }, }; -function createBaseType(): Type { - return { name: "" }; +function createBaseSpec_FunctionsEntry(): Spec_FunctionsEntry { + return { key: "", value: undefined }; } -export const Type = { - encode(message: Type, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); +export const Spec_FunctionsEntry = { + encode(message: Spec_FunctionsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Function.encode(message.value, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): Type { + decode(input: _m0.Reader | Uint8Array, length?: number): Spec_FunctionsEntry { const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseType(); + const message = createBaseSpec_FunctionsEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -656,7 +943,14 @@ export const Type = { break; } - message.name = reader.string(); + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Function.decode(reader, reader.uint32()); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -667,24 +961,1781 @@ export const Type = { return message; }, - fromJSON(object: any): Type { - return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; + fromJSON(object: any): Spec_FunctionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Function.fromJSON(object.value) : undefined, + }; }, - toJSON(message: Type): unknown { + toJSON(message: Spec_FunctionsEntry): unknown { const obj: any = {}; - if (message.name !== "") { - obj.name = message.name; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Function.toJSON(message.value); } return obj; }, - create, I>>(base?: I): Type { - return Type.fromPartial(base ?? ({} as any)); + create, I>>(base?: I): Spec_FunctionsEntry { + return Spec_FunctionsEntry.fromPartial(base ?? ({} as any)); }, - fromPartial, I>>(object: I): Type { - const message = createBaseType(); - message.name = object.name ?? ""; + fromPartial, I>>(object: I): Spec_FunctionsEntry { + const message = createBaseSpec_FunctionsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Function.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSpec_MetaEntry(): Spec_MetaEntry { + return { key: "", value: undefined }; +} + +export const Spec_MetaEntry = { + encode(message: Spec_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Spec_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSpec_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Spec_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Spec_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Spec_MetaEntry { + return Spec_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Spec_MetaEntry { + const message = createBaseSpec_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseType(): Type { + return { type: "", fields: {}, methods: {}, genericParameters: {}, constructor: undefined, meta: {} }; +} + +export const Type = { + encode(message: Type, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + Object.entries(message.fields).forEach(([key, value]) => { + Type_FieldsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); + }); + Object.entries(message.methods).forEach(([key, value]) => { + Type_MethodsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).ldelim(); + }); + Object.entries(message.genericParameters).forEach(([key, value]) => { + Type_GenericParametersEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim(); + }); + if (message.constructor !== undefined) { + Constructor.encode(message.constructor, writer.uint32(42).fork()).ldelim(); + } + Object.entries(message.meta).forEach(([key, value]) => { + Type_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Type { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + const entry2 = Type_FieldsEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.fields[entry2.key] = entry2.value; + } + continue; + case 3: + if (tag !== 26) { + break; + } + + const entry3 = Type_MethodsEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.methods[entry3.key] = entry3.value; + } + continue; + case 4: + if (tag !== 34) { + break; + } + + const entry4 = Type_GenericParametersEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.genericParameters[entry4.key] = entry4.value; + } + continue; + case 5: + if (tag !== 42) { + break; + } + + message.constructor = Constructor.decode(reader, reader.uint32()); + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Type_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + fields: isObject(object.fields) + ? Object.entries(object.fields).reduce<{ [key: string]: Field }>((acc, [key, value]) => { + acc[key] = Field.fromJSON(value); + return acc; + }, {}) + : {}, + methods: isObject(object.methods) + ? Object.entries(object.methods).reduce<{ [key: string]: Function }>((acc, [key, value]) => { + acc[key] = Function.fromJSON(value); + return acc; + }, {}) + : {}, + genericParameters: isObject(object.genericParameters) + ? Object.entries(object.genericParameters).reduce<{ [key: string]: GenericParameter }>((acc, [key, value]) => { + acc[key] = GenericParameter.fromJSON(value); + return acc; + }, {}) + : {}, + constructor: isSet(object.constructor) ? Constructor.fromJSON(object.constructor) : undefined, + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Type): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.fields) { + const entries = Object.entries(message.fields); + if (entries.length > 0) { + obj.fields = {}; + entries.forEach(([k, v]) => { + obj.fields[k] = Field.toJSON(v); + }); + } + } + if (message.methods) { + const entries = Object.entries(message.methods); + if (entries.length > 0) { + obj.methods = {}; + entries.forEach(([k, v]) => { + obj.methods[k] = Function.toJSON(v); + }); + } + } + if (message.genericParameters) { + const entries = Object.entries(message.genericParameters); + if (entries.length > 0) { + obj.genericParameters = {}; + entries.forEach(([k, v]) => { + obj.genericParameters[k] = GenericParameter.toJSON(v); + }); + } + } + if (message.constructor !== undefined) { + obj.constructor = Constructor.toJSON(message.constructor); + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Type { + return Type.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Type { + const message = createBaseType(); + message.type = object.type ?? ""; + message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: Field }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Field.fromPartial(value); + } + return acc; + }, {}); + message.methods = Object.entries(object.methods ?? {}).reduce<{ [key: string]: Function }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Function.fromPartial(value); + } + return acc; + }, {}); + message.genericParameters = Object.entries(object.genericParameters ?? {}).reduce< + { [key: string]: GenericParameter } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = GenericParameter.fromPartial(value); + } + return acc; + }, {}); + message.constructor = (object.constructor !== undefined && object.constructor !== null) + ? Constructor.fromPartial(object.constructor) + : undefined; + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseType_FieldsEntry(): Type_FieldsEntry { + return { key: "", value: undefined }; +} + +export const Type_FieldsEntry = { + encode(message: Type_FieldsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Field.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Type_FieldsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_FieldsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Field.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_FieldsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Field.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Type_FieldsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Field.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Type_FieldsEntry { + return Type_FieldsEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Type_FieldsEntry { + const message = createBaseType_FieldsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Field.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseType_MethodsEntry(): Type_MethodsEntry { + return { key: "", value: undefined }; +} + +export const Type_MethodsEntry = { + encode(message: Type_MethodsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Function.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Type_MethodsEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_MethodsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Function.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_MethodsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Function.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Type_MethodsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Function.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Type_MethodsEntry { + return Type_MethodsEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Type_MethodsEntry { + const message = createBaseType_MethodsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Function.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseType_GenericParametersEntry(): Type_GenericParametersEntry { + return { key: "", value: undefined }; +} + +export const Type_GenericParametersEntry = { + encode(message: Type_GenericParametersEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + GenericParameter.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Type_GenericParametersEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_GenericParametersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = GenericParameter.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_GenericParametersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? GenericParameter.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Type_GenericParametersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = GenericParameter.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Type_GenericParametersEntry { + return Type_GenericParametersEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Type_GenericParametersEntry { + const message = createBaseType_GenericParametersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? GenericParameter.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseType_MetaEntry(): Type_MetaEntry { + return { key: "", value: undefined }; +} + +export const Type_MetaEntry = { + encode(message: Type_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Type_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Type_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Type_MetaEntry { + return Type_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Type_MetaEntry { + const message = createBaseType_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseField(): Field { + return { type: "", readonly: false, meta: {} }; +} + +export const Field = { + encode(message: Field, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.readonly === true) { + writer.uint32(16).bool(message.readonly); + } + Object.entries(message.meta).forEach(([key, value]) => { + Field_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Field { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseField(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.readonly = reader.bool(); + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Field_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Field { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + readonly: isSet(object.readonly) ? globalThis.Boolean(object.readonly) : false, + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Field): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.readonly === true) { + obj.readonly = message.readonly; + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Field { + return Field.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Field { + const message = createBaseField(); + message.type = object.type ?? ""; + message.readonly = object.readonly ?? false; + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseField_MetaEntry(): Field_MetaEntry { + return { key: "", value: undefined }; +} + +export const Field_MetaEntry = { + encode(message: Field_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Field_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseField_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Field_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Field_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Field_MetaEntry { + return Field_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Field_MetaEntry { + const message = createBaseField_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseFunction(): Function { + return { returnType: undefined, parameters: {}, genericParameters: {}, meta: {} }; +} + +export const Function = { + encode(message: Function, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.returnType !== undefined) { + Type.encode(message.returnType, writer.uint32(10).fork()).ldelim(); + } + Object.entries(message.parameters).forEach(([key, value]) => { + Function_ParametersEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); + }); + Object.entries(message.genericParameters).forEach(([key, value]) => { + Function_GenericParametersEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).ldelim(); + }); + Object.entries(message.meta).forEach(([key, value]) => { + Function_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Function { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFunction(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.returnType = Type.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + const entry2 = Function_ParametersEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.parameters[entry2.key] = entry2.value; + } + continue; + case 3: + if (tag !== 26) { + break; + } + + const entry3 = Function_GenericParametersEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.genericParameters[entry3.key] = entry3.value; + } + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Function_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Function { + return { + returnType: isSet(object.returnType) ? Type.fromJSON(object.returnType) : undefined, + parameters: isObject(object.parameters) + ? Object.entries(object.parameters).reduce<{ [key: string]: Type }>((acc, [key, value]) => { + acc[key] = Type.fromJSON(value); + return acc; + }, {}) + : {}, + genericParameters: isObject(object.genericParameters) + ? Object.entries(object.genericParameters).reduce<{ [key: string]: GenericParameter }>((acc, [key, value]) => { + acc[key] = GenericParameter.fromJSON(value); + return acc; + }, {}) + : {}, + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Function): unknown { + const obj: any = {}; + if (message.returnType !== undefined) { + obj.returnType = Type.toJSON(message.returnType); + } + if (message.parameters) { + const entries = Object.entries(message.parameters); + if (entries.length > 0) { + obj.parameters = {}; + entries.forEach(([k, v]) => { + obj.parameters[k] = Type.toJSON(v); + }); + } + } + if (message.genericParameters) { + const entries = Object.entries(message.genericParameters); + if (entries.length > 0) { + obj.genericParameters = {}; + entries.forEach(([k, v]) => { + obj.genericParameters[k] = GenericParameter.toJSON(v); + }); + } + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Function { + return Function.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Function { + const message = createBaseFunction(); + message.returnType = (object.returnType !== undefined && object.returnType !== null) + ? Type.fromPartial(object.returnType) + : undefined; + message.parameters = Object.entries(object.parameters ?? {}).reduce<{ [key: string]: Type }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Type.fromPartial(value); + } + return acc; + }, + {}, + ); + message.genericParameters = Object.entries(object.genericParameters ?? {}).reduce< + { [key: string]: GenericParameter } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = GenericParameter.fromPartial(value); + } + return acc; + }, {}); + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseFunction_ParametersEntry(): Function_ParametersEntry { + return { key: "", value: undefined }; +} + +export const Function_ParametersEntry = { + encode(message: Function_ParametersEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Type.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Function_ParametersEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFunction_ParametersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Type.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Function_ParametersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Type.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Function_ParametersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Type.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Function_ParametersEntry { + return Function_ParametersEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Function_ParametersEntry { + const message = createBaseFunction_ParametersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Type.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseFunction_GenericParametersEntry(): Function_GenericParametersEntry { + return { key: "", value: undefined }; +} + +export const Function_GenericParametersEntry = { + encode(message: Function_GenericParametersEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + GenericParameter.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Function_GenericParametersEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFunction_GenericParametersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = GenericParameter.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Function_GenericParametersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? GenericParameter.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Function_GenericParametersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = GenericParameter.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Function_GenericParametersEntry { + return Function_GenericParametersEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>( + object: I, + ): Function_GenericParametersEntry { + const message = createBaseFunction_GenericParametersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? GenericParameter.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseFunction_MetaEntry(): Function_MetaEntry { + return { key: "", value: undefined }; +} + +export const Function_MetaEntry = { + encode(message: Function_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Function_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFunction_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Function_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Function_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Function_MetaEntry { + return Function_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Function_MetaEntry { + const message = createBaseFunction_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseGenericParameter(): GenericParameter { + return { modifiers: [], meta: {} }; +} + +export const GenericParameter = { + encode(message: GenericParameter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.modifiers) { + Modifier.encode(v!, writer.uint32(10).fork()).ldelim(); + } + Object.entries(message.meta).forEach(([key, value]) => { + GenericParameter_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenericParameter { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenericParameter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.modifiers.push(Modifier.decode(reader, reader.uint32())); + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = GenericParameter_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenericParameter { + return { + modifiers: globalThis.Array.isArray(object?.modifiers) + ? object.modifiers.map((e: any) => Modifier.fromJSON(e)) + : [], + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: GenericParameter): unknown { + const obj: any = {}; + if (message.modifiers?.length) { + obj.modifiers = message.modifiers.map((e) => Modifier.toJSON(e)); + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): GenericParameter { + return GenericParameter.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GenericParameter { + const message = createBaseGenericParameter(); + message.modifiers = object.modifiers?.map((e) => Modifier.fromPartial(e)) || []; + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseGenericParameter_MetaEntry(): GenericParameter_MetaEntry { + return { key: "", value: undefined }; +} + +export const GenericParameter_MetaEntry = { + encode(message: GenericParameter_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GenericParameter_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGenericParameter_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): GenericParameter_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: GenericParameter_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): GenericParameter_MetaEntry { + return GenericParameter_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GenericParameter_MetaEntry { + const message = createBaseGenericParameter_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseModifier(): Modifier { + return { meta: {} }; +} + +export const Modifier = { + encode(message: Modifier, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + Object.entries(message.meta).forEach(([key, value]) => { + Modifier_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Modifier { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModifier(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Modifier_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Modifier { + return { + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Modifier): unknown { + const obj: any = {}; + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Modifier { + return Modifier.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Modifier { + const message = createBaseModifier(); + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseModifier_MetaEntry(): Modifier_MetaEntry { + return { key: "", value: undefined }; +} + +export const Modifier_MetaEntry = { + encode(message: Modifier_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Modifier_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseModifier_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Modifier_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Modifier_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Modifier_MetaEntry { + return Modifier_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Modifier_MetaEntry { + const message = createBaseModifier_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseConstructor(): Constructor { + return { parameters: {}, meta: {} }; +} + +export const Constructor = { + encode(message: Constructor, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + Object.entries(message.parameters).forEach(([key, value]) => { + Constructor_ParametersEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).ldelim(); + }); + Object.entries(message.meta).forEach(([key, value]) => { + Constructor_MetaEntry.encode({ key: key as any, value }, writer.uint32(1026).fork()).ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Constructor { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConstructor(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + const entry1 = Constructor_ParametersEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.parameters[entry1.key] = entry1.value; + } + continue; + case 128: + if (tag !== 1026) { + break; + } + + const entry128 = Constructor_MetaEntry.decode(reader, reader.uint32()); + if (entry128.value !== undefined) { + message.meta[entry128.key] = entry128.value; + } + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Constructor { + return { + parameters: isObject(object.parameters) + ? Object.entries(object.parameters).reduce<{ [key: string]: Type }>((acc, [key, value]) => { + acc[key] = Type.fromJSON(value); + return acc; + }, {}) + : {}, + meta: isObject(object.meta) + ? Object.entries(object.meta).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Constructor): unknown { + const obj: any = {}; + if (message.parameters) { + const entries = Object.entries(message.parameters); + if (entries.length > 0) { + obj.parameters = {}; + entries.forEach(([k, v]) => { + obj.parameters[k] = Type.toJSON(v); + }); + } + } + if (message.meta) { + const entries = Object.entries(message.meta); + if (entries.length > 0) { + obj.meta = {}; + entries.forEach(([k, v]) => { + obj.meta[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create, I>>(base?: I): Constructor { + return Constructor.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Constructor { + const message = createBaseConstructor(); + message.parameters = Object.entries(object.parameters ?? {}).reduce<{ [key: string]: Type }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Type.fromPartial(value); + } + return acc; + }, + {}, + ); + message.meta = Object.entries(object.meta ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseConstructor_ParametersEntry(): Constructor_ParametersEntry { + return { key: "", value: undefined }; +} + +export const Constructor_ParametersEntry = { + encode(message: Constructor_ParametersEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Type.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Constructor_ParametersEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConstructor_ParametersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Type.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Constructor_ParametersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Type.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Constructor_ParametersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Type.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Constructor_ParametersEntry { + return Constructor_ParametersEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Constructor_ParametersEntry { + const message = createBaseConstructor_ParametersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Type.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseConstructor_MetaEntry(): Constructor_MetaEntry { + return { key: "", value: undefined }; +} + +export const Constructor_MetaEntry = { + encode(message: Constructor_MetaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Constructor_MetaEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConstructor_MetaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + fromJSON(object: any): Constructor_MetaEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Constructor_MetaEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create, I>>(base?: I): Constructor_MetaEntry { + return Constructor_MetaEntry.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): Constructor_MetaEntry { + const message = createBaseConstructor_MetaEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; return message; }, }; diff --git a/package.json b/package.json index 78846d47..b1a302dc 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,7 @@ "packageManager": "bun@1.1.5", "workspaces": [ "gen/proto/*", - "packages/*", - "src/*" + "packages/*" ], "scripts": { "lint": "eslint" diff --git a/packages/Makefile b/packages/Makefile index 56a8d252..8a3ed0d0 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -1,5 +1,30 @@ -build: +.PHONY: build build_ts build_uml build_uml2ts +build: build_ts build_uml build_uml2ts + +build_ts: cd ts && bun run build +build_uml: + cd uml && bun run build + +build_uml2ts: + cd uml2ts && bun run build + +test: + bun test . + +.PHONY: clean clean_ts clean_uml clean_uml2ts +clean: clean_ts clean_uml clean_uml2ts + +clean_ts: + cd ts && bun clean + +clean_uml: + cd uml && bun clean + +clean_uml2ts: + cd uml2ts && bun clean + +.PHONY: lint lint: - cd ts && bun lint + bun eslint . diff --git a/packages/ts/converter.ts b/packages/ts/converter.ts new file mode 100644 index 00000000..bf256004 --- /dev/null +++ b/packages/ts/converter.ts @@ -0,0 +1,12 @@ +import * as tdl from '@unmango/tdl-ts'; +import * as uml from '@unmango/uml'; +import { Readable, Writable } from 'node:stream'; + +export class Converter implements uml.Converter { + from(reader: Readable): Promise { + throw new Error('Method not implemented.'); + } + to(spec: tdl.Spec, writer: Writable): Promise { + throw new Error('Method not implemented.'); + } +} diff --git a/packages/ts/generator.spec.ts b/packages/ts/generator.spec.ts new file mode 100644 index 00000000..d6708c3e --- /dev/null +++ b/packages/ts/generator.spec.ts @@ -0,0 +1,33 @@ +import * as tdl from '@unmango/tdl-es'; +import { describe, expect, it } from 'bun:test'; +import { generator } from '.'; + +describe('Generator', () => { + it('should work', async () => { + const spec = new tdl.Spec({ + name: 'test-name', + description: 'Some description', + displayName: 'Test Name', + source: 'https://github.com/UnstoppableMango/tdl', + labels: { + test: 'label', + }, + types: { + 'test': { + type: 'string', + fields: { + test: { + type: 'string', + }, + }, + }, + }, + version: '0.1.0', + }); + + const actual = await generator.gen(spec); + + expect(actual).not.toBeNull(); + expect(actual).toEqual(`export interface test {\n readonly test: string;\n}\n`); + }); +}); diff --git a/packages/ts/generator.ts b/packages/ts/generator.ts new file mode 100644 index 00000000..78a5127e --- /dev/null +++ b/packages/ts/generator.ts @@ -0,0 +1,40 @@ +import * as tdl from '@unmango/tdl-es'; +import * as uml from '@unmango/uml'; +import ts from 'typescript'; + +export class Generator implements uml.Generator { + gen(spec: tdl.Spec): Promise { + const source = ts.createSourceFile('types.d.ts', '', ts.ScriptTarget.ES2019, undefined, ts.ScriptKind.TS); + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const result = printer.printList(ts.ListFormat.MultiLine, gen(spec), source); + return Promise.resolve(result); + } +} + +function gen(spec: tdl.Spec): ts.NodeArray { + const types = Object.entries(spec.types).map(x => genType(...x)); + return ts.factory.createNodeArray(types); +} + +function genType(name: string, type: tdl.Type): ts.Node { + const props = Object.entries(type.fields).map(x => genProps(...x)); + + return ts.factory.createInterfaceDeclaration( + [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)], + name, + undefined, + undefined, + props, + ); +} + +function genProps(name: string, field: tdl.Field): ts.PropertySignature { + const type = ts.factory.createTypeReferenceNode(field.type); + + return ts.factory.createPropertySignature( + [ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword)], + name, + undefined, + type, + ); +} diff --git a/packages/ts/index.ts b/packages/ts/index.ts index 9dbac40f..6d5d14cf 100644 --- a/packages/ts/index.ts +++ b/packages/ts/index.ts @@ -1,39 +1,5 @@ -import { Command } from '@commander-js/extra-typings'; -import { createPromiseClient } from '@connectrpc/connect'; -import { createGrpcTransport } from '@connectrpc/connect-node'; -import { UmlService } from '@unmango/tdl-es'; -import * as net from 'node:net'; -import { name, version } from './package.json'; +import { Converter } from './converter'; +import { Generator } from './generator'; -const program = new Command() - .name(name) - .description('Plugin to convert UML to typescript.') - .version(version) - .helpOption() - .argument('', 'The thing to do the stuff with') - .option('--broker ', 'address of the broker'); - -program.parse(process.argv); -const opts = program.opts(); - -if (!opts.broker) { - throw new Error('Broker URI is required'); -} - -const transport = createGrpcTransport({ - httpVersion: '2', - baseUrl: opts.broker, - nodeOptions: { - createConnection() { - if (!opts.broker) { - throw new Error('Broker URI is required'); - } - - return net.connect(opts.broker); - }, - }, -}); - -const client = createPromiseClient(UmlService, transport); -// const result = await client.from({ }); -// console.log(result.uml); +export const converter = new Converter(); +export const generator = new Generator(); diff --git a/packages/ts/package.json b/packages/ts/package.json index f76c9cdd..abe6475a 100644 --- a/packages/ts/package.json +++ b/packages/ts/package.json @@ -1,21 +1,17 @@ { "name": "@unmango/2ts", - "version": "0.1.0", "module": "index.ts", "type": "module", "scripts": { - "build": "bun build index.ts --compile --outfile dist/app", + "build": "bun build index.ts --outdir dist", + "clean": "rm -rf dist", "lint": "eslint .", - "lint:fix": "eslint . --fix", - "prestart": "cd ../../../ && make gen", - "start": "bun run index.ts --help" + "lint:fix": "eslint . --fix" }, "dependencies": { - "@commander-js/extra-typings": "^12.0.1", - "@connectrpc/connect": "^1.4.0", - "@connectrpc/connect-node": "^1.4.0", - "typescript": "^5.4.5", - "@unmango/tdl-es": "workspace:*" + "@unmango/uml": "workspace:*", + "@unmango/tdl-es": "workspace:*", + "typescript": "5.4.5" }, "devDependencies": { "@types/bun": "latest" diff --git a/packages/ts/tsconfig.json b/packages/ts/tsconfig.json index b361441c..ffc08abf 100644 --- a/packages/ts/tsconfig.json +++ b/packages/ts/tsconfig.json @@ -1,3 +1,27 @@ { - "extends": "../../tsconfig.base.json" + "compilerOptions": { + // Enable latest features + "lib": ["ESNext", "DOM"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } } diff --git a/packages/uml/README.md b/packages/uml/README.md new file mode 100644 index 00000000..ec2cec19 --- /dev/null +++ b/packages/uml/README.md @@ -0,0 +1,15 @@ +# @unmango/uml + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.1.5. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/packages/uml/index.spec.ts b/packages/uml/index.spec.ts new file mode 100644 index 00000000..06e32629 --- /dev/null +++ b/packages/uml/index.spec.ts @@ -0,0 +1,42 @@ +import { Spec } from '@unmango/tdl-es'; +import { describe, expect, it } from 'bun:test'; +import fc from 'fast-check'; +import { read, type SupportedMimeType } from './index'; + +const arbSpec = () => + fc.gen().map(g => + new Spec({ + name: g(fc.string), + description: g(fc.string), + displayName: g(fc.string), + source: g(fc.string), + version: g(fc.string), + }) + ); + +describe('read', () => { + it.each([ + 'application/protobuf', + 'application/x-protobuf', + 'application/vnd.google.protobuf', + ])('should read %s data', (type) => { + fc.assert(fc.property(arbSpec(), (spec): void => { + const bytes = spec.toBinary(); + + const actual = read(bytes, type); + + expect(actual).toEqual(spec); + })); + }); + + it('should read json data', () => { + fc.assert(fc.property(arbSpec(), (spec): void => { + const json = spec.toJsonString(); + const bytes = Buffer.from(json, 'utf-8'); + + const actual = read(bytes, 'application/json'); + + expect(actual).toEqual(spec); + })); + }); +}); diff --git a/packages/uml/index.ts b/packages/uml/index.ts new file mode 100644 index 00000000..d7da1ac6 --- /dev/null +++ b/packages/uml/index.ts @@ -0,0 +1,45 @@ +import * as tdl from '@unmango/tdl-es'; +import { Readable, Writable } from 'node:stream'; + +export interface ConverterFrom { + from(reader: Readable): Promise; +} + +export interface ConverterTo { + to(spec: tdl.Spec, writer: Writable): Promise; +} + +export interface Converter extends ConverterFrom, ConverterTo {} + +export interface Generator { + gen(spec: tdl.Spec): Promise; +} + +export const SUPPORTED_MIME_TYPES = [ + 'application/json', + 'application/x-protobuf', + 'application/protobuf', + 'application/vnd.google.protobuf', +] as const; + +export type SupportedMimeTypeTuple = typeof SUPPORTED_MIME_TYPES; +export type SupportedMimeType = SupportedMimeTypeTuple[number]; + +export function read(data: Uint8Array, type?: SupportedMimeType): tdl.Spec { + switch (type) { + case 'application/json': { + const decoder = new TextDecoder(); + const json = decoder.decode(data); + return tdl.Spec.fromJsonString(json); + } + case 'application/x-protobuf': + case 'application/protobuf': + case 'application/vnd.google.protobuf': + return tdl.Spec.fromBinary(data); + case undefined: + case null: + return tdl.Spec.fromBinary(data); + default: + throw new Error('unrecognized media type'); + } +} diff --git a/packages/uml/package.json b/packages/uml/package.json new file mode 100644 index 00000000..4c0977ff --- /dev/null +++ b/packages/uml/package.json @@ -0,0 +1,23 @@ +{ + "name": "@unmango/uml", + "type": "module", + "module": "index.ts", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "bun build index.ts --outdir dist", + "clean": "rm -rf dist", + "lint": "eslint .", + "lint:fix": "eslint . --fix" + }, + "dependencies": { + "@unmango/tdl-es": "workspace:*" + }, + "devDependencies": { + "@types/bun": "latest", + "fast-check": "^3.18.0" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } +} diff --git a/packages/uml/tsconfig.json b/packages/uml/tsconfig.json new file mode 100644 index 00000000..b361441c --- /dev/null +++ b/packages/uml/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/packages/uml2ts/Makefile b/packages/uml2ts/Makefile new file mode 100644 index 00000000..0bddb3ef --- /dev/null +++ b/packages/uml2ts/Makefile @@ -0,0 +1,18 @@ +ROOT := $(shell git rev-parse --show-toplevel) + +.PHONY: build test clean docker + +build: + bun run build + +test: + bun test + +clean: + rm -rf dist + +docker: + @$(MAKE) -C ${ROOT}/docker uml2ts + +test_image: + @$(MAKE) -C ${ROOT}/docker uml2ts_test diff --git a/packages/uml2ts/README.md b/packages/uml2ts/README.md new file mode 100644 index 00000000..cd696126 --- /dev/null +++ b/packages/uml2ts/README.md @@ -0,0 +1,15 @@ +# @unmango/2ts + +To install dependencies: + +```bash +bun install +``` + +To run: + +```bash +bun run index.ts +``` + +This project was created using `bun init` in bun v1.1.5. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. diff --git a/packages/uml2ts/command.spec.ts b/packages/uml2ts/command.spec.ts new file mode 100644 index 00000000..48584e09 --- /dev/null +++ b/packages/uml2ts/command.spec.ts @@ -0,0 +1,65 @@ +import { Spec } from '@unmango/tdl-es'; +import type { SupportedMimeType } from '@unmango/uml'; +import { afterAll, beforeAll, describe, expect, it } from 'bun:test'; +import fs from 'node:fs/promises'; +import path from 'node:path'; + +const binPath = path.join( + __dirname, + 'dist', + 'uml2ts_test', +); + +const ensureClean = async () => { + if (await fs.exists(binPath)) { + await fs.unlink(binPath); + } +}; + +beforeAll(async () => { + await ensureClean(); + const proc = Bun.spawn([ + 'bun', + 'build', + 'index.ts', + '--compile', + '--outfile', + binPath, + ], { cwd: __dirname }); + await proc.exited; +}); + +afterAll(ensureClean); + +describe('gen', () => { + it.each([ + 'application/protobuf', + 'application/x-protobuf', + 'application/vnd.google.protobuf', + ])('should read %s data', async (mime) => { + const name = 'testType'; + const spec = new Spec({ types: { [name]: {} } }); + const bytes = spec.toBinary(); + + const proc = Bun.spawn([binPath, 'gen', '--type', mime], { + stdin: new Blob([bytes]), + }); + + const actual = await Bun.readableStreamToText(proc.stdout); + expect(actual).toEqual(`export interface ${name} {\n}\n`); + }); + + it('should read json data', async () => { + const name = 'testType'; + const spec = new Spec({ types: { [name]: {} } }); + const json = spec.toJsonString(); + const mime: SupportedMimeType = 'application/json'; + + const proc = Bun.spawn([binPath, 'gen', '--type', mime], { + stdin: Buffer.from(json, 'utf-8'), + }); + + const actual = await Bun.readableStreamToText(proc.stdout); + expect(actual).toEqual(`export interface ${name} {\n}\n`); + }); +}); diff --git a/packages/uml2ts/command.ts b/packages/uml2ts/command.ts new file mode 100644 index 00000000..7aaa2ed8 --- /dev/null +++ b/packages/uml2ts/command.ts @@ -0,0 +1,9 @@ +import { generator } from '@unmango/2ts'; +import * as uml from '@unmango/uml'; + +export async function gen(type?: uml.SupportedMimeType): Promise { + const buffer = await Bun.stdin.arrayBuffer(); + const spec = uml.read(new Uint8Array(buffer), type); + const ts = await generator.gen(spec); + await Bun.write(Bun.stdout, ts); +} diff --git a/packages/uml2ts/index.ts b/packages/uml2ts/index.ts new file mode 100644 index 00000000..5cc9d6dc --- /dev/null +++ b/packages/uml2ts/index.ts @@ -0,0 +1,10 @@ +import type { Command } from '@commander-js/extra-typings'; +import { gen, program } from './program'; + +type ApplyCommand = (c: Command) => Command; + +const app = (root: () => Command, ...commands: ApplyCommand[]) => { + return commands.reduce((x, c) => c(x), root()); +}; + +await app(program, gen).parseAsync(); diff --git a/packages/uml2ts/package.json b/packages/uml2ts/package.json new file mode 100644 index 00000000..60a75a61 --- /dev/null +++ b/packages/uml2ts/package.json @@ -0,0 +1,29 @@ +{ + "name": "@unmango/uml2ts", + "version": "0.1.0", + "module": "index.ts", + "type": "module", + "scripts": { + "build": "bun build index.ts --compile --outfile dist/uml2ts", + "clean": "rm -rf dist", + "lint": "eslint .", + "lint:fix": "eslint . --fix", + "start": "bun run index.ts --help", + "test": "bun test" + }, + "dependencies": { + "@commander-js/extra-typings": "^12.0.1", + "@connectrpc/connect": "^1.4.0", + "@connectrpc/connect-node": "^1.4.0", + "@unmango/tdl-es": "workspace:*", + "@unmango/2ts": "workspace:*" + }, + "devDependencies": { + "@types/bun": "latest", + "fast-check": "^3.18.0", + "testcontainers": "^10.9.0" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } +} diff --git a/packages/uml2ts/program.ts b/packages/uml2ts/program.ts new file mode 100644 index 00000000..94f2f6ea --- /dev/null +++ b/packages/uml2ts/program.ts @@ -0,0 +1,20 @@ +import { Command, Option } from '@commander-js/extra-typings'; +import * as uml from '@unmango/uml'; +import * as cmd from './command'; +import { name, version } from './package.json'; + +const mimeTypeOption = new Option('--type ', 'The media type of the input.') + .choices(uml.SUPPORTED_MIME_TYPES); + +export const gen = (program: Command): Command => + program.command('gen') + .description('Generate typescript.') + .addOption(mimeTypeOption) + .action((opts) => cmd.gen(opts.type)); + +export const program = (): Command => + new Command() + .name(name) + .description('Plugin to convert UML to typescript.') + .version(version) + .helpOption(); diff --git a/packages/uml2ts/tsconfig.json b/packages/uml2ts/tsconfig.json new file mode 100644 index 00000000..b361441c --- /dev/null +++ b/packages/uml2ts/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/pkg/pcl/convert.go b/pkg/pcl/convert.go index 170a81ef..9e59e60b 100644 --- a/pkg/pcl/convert.go +++ b/pkg/pcl/convert.go @@ -3,6 +3,7 @@ package pcl import ( "context" "io" + "strings" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" tdl "github.com/unstoppablemango/tdl/gen/proto/go/unmango/dev/tdl/v1alpha1" @@ -28,11 +29,13 @@ func (c *converter) From(ctx context.Context, reader io.Reader, opts ...uml.Conv func (c *converter) FromPcl(ctx context.Context, pcl schema.PackageSpec) (*tdl.Spec, error) { spec := tdl.Spec{ Name: pcl.Name, - Repository: pcl.Repository, + Source: pcl.Repository, Version: pcl.Version, DisplayName: pcl.DisplayName, Description: pcl.Description, - Tags: pcl.Keywords, + Labels: map[string]string{ + "keywords": strings.Join(pcl.Keywords, ","), + }, } return &spec, nil diff --git a/pkg/pcl/convert_test.go b/pkg/pcl/convert_test.go index 8a1fc067..4c4122f6 100644 --- a/pkg/pcl/convert_test.go +++ b/pkg/pcl/convert_test.go @@ -21,7 +21,7 @@ var _ = Describe("Convert", func() { Description: "test-description", DisplayName: "Test Name", Repository: "github.com/UnstoppableMango/tdl", - Keywords: []string{"pulumi"}, + Keywords: []string{"pulumi", "thing"}, Version: "v0.1.0", } @@ -38,11 +38,11 @@ var _ = Describe("Convert", func() { Expect(spec.DisplayName).NotTo(BeEmpty()) Expect(spec.DisplayName).To(Equal(pcl.DisplayName)) - Expect(spec.Repository).NotTo(BeEmpty()) - Expect(spec.Repository).To(Equal(pcl.Repository)) + Expect(spec.Source).NotTo(BeEmpty()) + Expect(spec.Source).To(Equal(pcl.Repository)) - Expect(spec.Tags).NotTo(BeEmpty()) - Expect(spec.Tags).To(BeEquivalentTo(pcl.Keywords)) + Expect(spec.Labels).NotTo(BeEmpty()) + Expect(spec.Labels["keywords"]).To(BeEquivalentTo("pulumi,thing")) Expect(spec.Version).NotTo(BeEmpty()) Expect(spec.Version).To(Equal(pcl.Version)) diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 00000000..1b0eba1c --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,8 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 4ed3bc159a8b4ac68fe253218760d035 + digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13 diff --git a/proto/buf.yaml b/proto/buf.yaml index efae92df..c521254a 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -1,5 +1,7 @@ version: v1 -name: github.com/unstoppablemango/tdl +# name: github.com/unstoppablemango/tdl +deps: + - buf.build/googleapis/googleapis breaking: use: - FILE diff --git a/proto/unmango/dev/tdl/v1alpha1/uml.proto b/proto/unmango/dev/tdl/v1alpha1/uml.proto index 845ca592..22a310b3 100644 --- a/proto/unmango/dev/tdl/v1alpha1/uml.proto +++ b/proto/unmango/dev/tdl/v1alpha1/uml.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package unmango.dev.tdl.v1alpha1; +import "google/protobuf/any.proto"; + option csharp_namespace = "UnMango.Tdl"; service UmlService { @@ -36,14 +38,48 @@ message ToResponse { message Spec { string name = 1; - string repository = 2; + string source = 2; string version = 3; string display_name = 4; string description = 5; - repeated string tags = 6; + map labels = 6; map types = 7; + map functions = 8; + map meta = 128; } message Type { - string name = 1; + string type = 1; + map fields = 2; + map methods = 3; + map generic_parameters = 4; + optional Constructor constructor = 5; + map meta = 128; +} + +message Field { + string type = 1; + bool readonly = 2; + map meta = 128; +} + +message Function { + Type return_type = 1; + map parameters = 2; + map generic_parameters = 3; + map meta = 128; +} + +message GenericParameter { + repeated Modifier modifiers = 1; + map meta = 128; +} + +message Modifier { + map meta = 128; +} + +message Constructor { + map parameters = 1; + map meta = 128; }