From bb42c00169a34c4282317d50800993eea781a69d Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:49:09 +0300 Subject: [PATCH] fix: minor bug fixes (#894) - Bug with typegraph context reset around deno_modules - Bug with typegate onPush hook error detection and typegraph parsing of such errors - Bug with artifact resolution when they're reused. - Bug with return type of the KvRuntime get functions - Bumps metatype to 0.5.0-rc.3 #### Migration notes N/A --- - [x] The change comes with new or modified tests - [ ] Hard-to-understand functions have explanatory comments - [ ] End-user documentation is updated to reflect the change --- .ghjk/lock.json | 421 ++++++++++-------- .github/pull_request_template.md | 2 +- .github/workflows/release.yml | 8 + .pre-commit-config.yaml | 12 +- Cargo.lock | 18 +- Cargo.toml | 2 +- deno.lock | 81 ++++ .../index.mdx | 1 - .../docs/tutorials/metatype-basics/index.mdx | 3 +- docs/metatype.dev/src/pages/index.tsx | 8 +- examples/templates/deno/api/example.ts | 6 +- examples/templates/deno/compose.yml | 17 +- examples/templates/deno/metatype.yaml | 2 - examples/templates/node/compose.yml | 17 +- examples/templates/node/metatype.yaml | 4 +- examples/templates/node/package.json | 2 +- examples/templates/python/compose.yml | 17 +- examples/templates/python/metatype.yaml | 2 - examples/templates/python/pyproject.toml | 4 +- examples/typegraphs/metagen/rs/fdk.rs | 2 +- pyproject.toml | 2 +- src/meta-lsp/package.json | 2 +- src/meta-lsp/ts-language-server/package.json | 2 +- .../vscode-metatype-support/package.json | 2 +- src/pyrt_wit_wire/pyproject.toml | 2 +- src/typegate/engine/bindings.ts | 3 +- src/typegate/src/engine/typecheck/input.ts | 7 +- src/typegate/src/runtimes/deno/deno.ts | 4 +- src/typegate/src/runtimes/deno/worker.ts | 3 +- src/typegate/src/runtimes/kv.ts | 42 +- .../runtimes/prisma/hooks/run_migrations.ts | 2 - src/typegate/src/runtimes/prisma/prisma.ts | 8 +- src/typegate/src/runtimes/python.ts | 3 - src/typegate/src/runtimes/temporal.ts | 2 - src/typegate/src/runtimes/wit_wire/mod.ts | 2 +- src/typegate/src/typegate/artifacts/mod.ts | 8 +- src/typegate/src/typegate/mod.ts | 4 +- src/typegate/src/typegraph/mod.ts | 18 +- src/typegraph/core/Cargo.toml | 2 +- src/typegraph/core/src/global_store.rs | 7 +- .../core/src/runtimes/prisma/context.rs | 4 +- src/typegraph/core/src/typegraph.rs | 3 +- src/typegraph/core/src/utils/archive.rs | 1 - src/typegraph/core/wit/typegraph.wit | 1 + src/typegraph/deno/deno.json | 2 +- src/typegraph/deno/src/runtimes/kv.ts | 3 +- src/typegraph/deno/src/tg_deploy.ts | 13 +- src/typegraph/deno/src/typegraph.ts | 1 + src/typegraph/deno/src/utils/func_utils.ts | 4 +- src/typegraph/python/pyproject.toml | 2 +- src/typegraph/python/typegraph/__init__.py | 2 +- .../python/typegraph/graph/tg_deploy.py | 21 +- src/typegraph/python/typegraph/runtimes/kv.py | 2 +- src/xtask/Cargo.toml | 2 +- .../__snapshots__/metagen_test.ts.snap | 4 +- tests/metagen/typegraphs/identities/rs/fdk.rs | 2 +- tests/metagen/typegraphs/sample/py/client.py | 223 ++++------ tests/metagen/typegraphs/sample/rs/client.rs | 179 ++++---- tests/metagen/typegraphs/sample/ts/client.ts | 18 +- .../runtimes/kv/__snapshots__/kv_test.ts.snap | 66 +-- tests/runtimes/kv/kv_test.ts | 12 + tests/runtimes/wasm_reflected/rust/Cargo.toml | 2 +- tests/runtimes/wasm_wire/rust/fdk.rs | 2 +- .../array_of_optional_test.ts.snap | 2 +- .../__snapshots__/either_test.ts.snap | 2 +- .../__snapshots__/union_test.ts.snap | 2 +- .../input_validator_test.ts.snap | 16 +- tools/compose/compose.base.yml | 2 +- tools/consts.ts | 4 +- 69 files changed, 731 insertions(+), 620 deletions(-) diff --git a/.ghjk/lock.json b/.ghjk/lock.json index e56de2426d..f038249500 100644 --- a/.ghjk/lock.json +++ b/.ghjk/lock.json @@ -1,6 +1,6 @@ { "version": "0", - "platform": "aarch64-darwin", + "platform": "x86_64-linux", "moduleEntries": { "ports": { "version": "0", @@ -919,11 +919,51 @@ "ghjkEnvProvInstSet____rust": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a" ], "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" }, + "ghjkEnvProvInstSet___dev": { + "installs": [ + "bciqbx637744bfiyvprs77xdnvdt7uuwmtlntfjpwmkda672gklkbpmi", + "bciqdoqocirh7aseu5o5hfqaj3sb3pfd3z3rlvig26xttmcmsoljuz6i", + "bciqjsjvkjm6xvoovs6y3y6me32422zr5wc5njs4kwfmmyf6nt6jzv2i", + "bciqdf7jtq3zzhn676t2dr7fyve47fj7coajtymmye353lrrluskjk7q", + "bciqeaqeduyhykw7s7gq6ney6ci7deheq3etgdwkvg55mwbzdhz2opra", + "bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q", + "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq", + "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma", + "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy", + "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", + "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", + "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", + "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa", + "bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy", + "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", + "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq", + "bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa", + "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", + "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", + "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la", + "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq" + ], + "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" + }, + "ghjkEnvProvInstSet___oci": { + "installs": [ + "bciqbx637744bfiyvprs77xdnvdt7uuwmtlntfjpwmkda672gklkbpmi", + "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", + "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", + "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", + "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", + "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la", + "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq" + ], + "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" + }, "ghjkEnvProvInstSet____ecma": { "installs": [ "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", @@ -959,33 +999,7 @@ "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma", "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy", "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", - "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", - "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", - "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa", - "bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy", - "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", - "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq", - "bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa", - "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", - "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", - "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la", - "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq" - ], - "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" - }, - "ghjkEnvProvInstSet___dev": { - "installs": [ - "bciqdoqocirh7aseu5o5hfqaj3sb3pfd3z3rlvig26xttmcmsoljuz6i", - "bciqjsjvkjm6xvoovs6y3y6me32422zr5wc5njs4kwfmmyf6nt6jzv2i", - "bciqdf7jtq3zzhn676t2dr7fyve47fj7coajtymmye353lrrluskjk7q", - "bciqeaqeduyhykw7s7gq6ney6ci7deheq3etgdwkvg55mwbzdhz2opra", - "bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q", - "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq", - "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma", - "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy", - "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa", @@ -1004,7 +1018,7 @@ "installs": [ "bciqm2rvnfe77sj6jekrm65oayuywt5lbrw33qezqjcg5rzaioc6uszy", "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a" ], "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" @@ -1032,7 +1046,7 @@ "ghjkEnvProvInstSet_______task_env_test-rust": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq", @@ -1046,7 +1060,7 @@ "ghjkEnvProvInstSet_______task_env_dev-eg-tgraphs": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy", "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq", @@ -1060,7 +1074,7 @@ "ghjkEnvProvInstSet_______task_env_build-tgraph-core": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", @@ -1072,7 +1086,7 @@ "ghjkEnvProvInstSet_______task_env_build-tgraph-py": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", @@ -1087,7 +1101,7 @@ "ghjkEnvProvInstSet_______task_env_build-tgraph-ts": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", @@ -1102,25 +1116,13 @@ "ghjkEnvProvInstSet_______task_env_build-sys-tgraphs": { "installs": [ "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y", "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla", "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa", "bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy" ], "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" - }, - "ghjkEnvProvInstSet___oci": { - "installs": [ - "bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy", - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui", - "bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a", - "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba", - "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y", - "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la", - "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq" - ], - "allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y" } } } @@ -2568,52 +2570,64 @@ "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/protoc.ts" } }, - "bciqbas5ccadnnnvdp2mtkt7xjmhvdtkgqeib5c2ir74cmyyrwfgfvui": { + "bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y": { + "buildDepConfigs": { + "asdf_plugin_git": { + "pluginRepo": "https://github.com/asdf-community/asdf-cmake", + "portRef": "asdf_plugin_git@0.1.0" + } + }, + "resolutionDepConfigs": { + "asdf_plugin_git": { + "pluginRepo": "https://github.com/asdf-community/asdf-cmake", + "portRef": "asdf_plugin_git@0.1.0" + } + }, "port": { "ty": "denoWorker@v1", - "name": "pipi_pypi", + "name": "asdf", "platforms": [ "x86_64-linux", "aarch64-linux", "x86_64-darwin", - "aarch64-darwin", - "x86_64-windows", - "aarch64-windows", - "x86_64-freebsd", - "aarch64-freebsd", - "x86_64-netbsd", - "aarch64-netbsd", - "x86_64-aix", - "aarch64-aix", - "x86_64-solaris", - "aarch64-solaris", - "x86_64-illumos", - "aarch64-illumos", - "x86_64-android", - "aarch64-android" + "aarch64-darwin" ], "version": "0.1.0", "buildDeps": [ { - "name": "cpy_bs_ghrel" + "name": "curl_aa" + }, + { + "name": "git_aa" + }, + { + "name": "asdf_plugin_git" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" + "resolutionDeps": [ + { + "name": "curl_aa" + }, + { + "name": "git_aa" + }, + { + "name": "asdf_plugin_git" + } + ], + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/asdf.ts" }, - "packageName": "cmake" + "pluginRepo": "https://github.com/asdf-community/asdf-cmake", + "installType": "version" }, - "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy": { - "version": "20.8.0", + "bciqbx637744bfiyvprs77xdnvdt7uuwmtlntfjpwmkda672gklkbpmi": { + "version": "v2.4.0", "port": { "ty": "denoWorker@v1", - "name": "node_org", + "name": "mold_ghrel", "platforms": [ "aarch64-linux", - "x86_64-linux", - "aarch64-darwin", - "x86_64-darwin", - "aarch64-windows", - "x86_64-windows" + "x86_64-linux" ], "version": "0.1.0", "buildDeps": [ @@ -2621,14 +2635,14 @@ "name": "tar_aa" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/node.ts" - } + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/mold.ts" + }, + "replaceLd": true }, - "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq": { - "version": "v9.4.0", + "bciqdoqocirh7aseu5o5hfqaj3sb3pfd3z3rlvig26xttmcmsoljuz6i": { "port": { "ty": "denoWorker@v1", - "name": "pnpm_ghrel", + "name": "act_ghrel", "platforms": [ "aarch64-linux", "x86_64-linux", @@ -2638,14 +2652,13 @@ "x86_64-windows" ], "version": "0.1.0", - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pnpm.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/act.ts" } }, - "bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa": { - "version": "10.0.1", + "bciqjsjvkjm6xvoovs6y3y6me32422zr5wc5njs4kwfmmyf6nt6jzv2i": { "port": { "ty": "denoWorker@v1", - "name": "npmi_npm", + "name": "cargobi_cratesio", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -2669,44 +2682,59 @@ "version": "0.1.0", "buildDeps": [ { - "name": "node_org" + "name": "cargo_binstall_ghrel" + }, + { + "name": "rust_rustup" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "packageName": "node-gyp" + "crateName": "whiz", + "locked": true }, - "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla": { - "version": "3.9.19", + "bciqdf7jtq3zzhn676t2dr7fyve47fj7coajtymmye353lrrluskjk7q": { "port": { "ty": "denoWorker@v1", - "name": "cpy_bs_ghrel", + "name": "cargobi_cratesio", "platforms": [ "x86_64-linux", "aarch64-linux", "x86_64-darwin", "aarch64-darwin", "x86_64-windows", - "aarch64-windows" + "aarch64-windows", + "x86_64-freebsd", + "aarch64-freebsd", + "x86_64-netbsd", + "aarch64-netbsd", + "x86_64-aix", + "aarch64-aix", + "x86_64-solaris", + "aarch64-solaris", + "x86_64-illumos", + "aarch64-illumos", + "x86_64-android", + "aarch64-android" ], "version": "0.1.0", "buildDeps": [ { - "name": "tar_aa" + "name": "cargo_binstall_ghrel" }, { - "name": "zstd_aa" + "name": "rust_rustup" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cpy_bs.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "releaseTag": "20240814" + "crateName": "wit-deps-cli", + "locked": true }, - "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa": { - "version": "0.4.7", + "bciqeaqeduyhykw7s7gq6ney6ci7deheq3etgdwkvg55mwbzdhz2opra": { "port": { "ty": "denoWorker@v1", - "name": "pipi_pypi", + "name": "cargobi_cratesio", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -2730,15 +2758,19 @@ "version": "0.1.0", "buildDeps": [ { - "name": "cpy_bs_ghrel" + "name": "cargo_binstall_ghrel" + }, + { + "name": "rust_rustup" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "packageName": "ruff" + "crateName": "git-cliff", + "locked": true }, - "bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy": { - "version": "1.8.3", + "bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q": { + "version": "3.7.1", "port": { "ty": "denoWorker@v1", "name": "pipi_pypi", @@ -2770,10 +2802,27 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" }, - "packageName": "poetry" + "packageName": "pre-commit" }, - "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba": { - "version": "0.116.1", + "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq": { + "version": "v0.13.1", + "port": { + "ty": "denoWorker@v1", + "name": "temporal_cli_ghrel", + "platforms": [ + "aarch64-linux", + "x86_64-linux", + "aarch64-darwin", + "x86_64-darwin", + "aarch64-windows", + "x86_64-windows" + ], + "version": "0.1.0", + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/temporal_cli.ts" + } + }, + "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma": { + "version": "1.33.0", "port": { "ty": "denoWorker@v1", "name": "cargobi_cratesio", @@ -2808,11 +2857,11 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "crateName": "wasm-opt", + "crateName": "cargo-insta", "locked": true }, - "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y": { - "version": "1.208.1", + "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy": { + "version": "0.2.5", "port": { "ty": "denoWorker@v1", "name": "cargobi_cratesio", @@ -2847,49 +2896,40 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "crateName": "wasm-tools", + "crateName": "cross", "locked": true }, - "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la": { - "version": "0.13.4", + "bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla": { + "version": "3.9.19", "port": { "ty": "denoWorker@v1", - "name": "pipi_pypi", + "name": "cpy_bs_ghrel", "platforms": [ "x86_64-linux", "aarch64-linux", "x86_64-darwin", "aarch64-darwin", "x86_64-windows", - "aarch64-windows", - "x86_64-freebsd", - "aarch64-freebsd", - "x86_64-netbsd", - "aarch64-netbsd", - "x86_64-aix", - "aarch64-aix", - "x86_64-solaris", - "aarch64-solaris", - "x86_64-illumos", - "aarch64-illumos", - "x86_64-android", - "aarch64-android" + "aarch64-windows" ], "version": "0.1.0", "buildDeps": [ { - "name": "cpy_bs_ghrel" + "name": "tar_aa" + }, + { + "name": "zstd_aa" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cpy_bs.ts" }, - "packageName": "componentize-py" + "releaseTag": "20240814" }, - "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq": { - "version": "1.3.0", + "bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa": { + "version": "0.4.7", "port": { "ty": "denoWorker@v1", - "name": "npmi_npm", + "name": "pipi_pypi", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -2913,15 +2953,15 @@ "version": "0.1.0", "buildDeps": [ { - "name": "node_org" + "name": "cpy_bs_ghrel" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" }, - "packageName": "@bytecodealliance/jco" + "packageName": "ruff" }, - "bciqdtuhf425g6prb5fyupbcokttmkill6wyqk7bkphx3ueltl5mvu4q": { - "version": "3.7.1", + "bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy": { + "version": "1.8.3", "port": { "ty": "denoWorker@v1", "name": "pipi_pypi", @@ -2953,13 +2993,13 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" }, - "packageName": "pre-commit" + "packageName": "poetry" }, - "bciqmvgsg7h3ohj3m7das4bznahgt6tyq7mamta3n2vorulqvml7mywq": { - "version": "v0.13.1", + "bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy": { + "version": "20.8.0", "port": { "ty": "denoWorker@v1", - "name": "temporal_cli_ghrel", + "name": "node_org", "platforms": [ "aarch64-linux", "x86_64-linux", @@ -2969,14 +3009,36 @@ "x86_64-windows" ], "version": "0.1.0", - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/temporal_cli.ts" + "buildDeps": [ + { + "name": "tar_aa" + } + ], + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/node.ts" } }, - "bciqicdqw36v63cbrscwsgtu2htrmwmgtfoxexv4rx5d2y24vytxbuma": { - "version": "1.33.0", + "bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq": { + "version": "v9.4.0", "port": { "ty": "denoWorker@v1", - "name": "cargobi_cratesio", + "name": "pnpm_ghrel", + "platforms": [ + "aarch64-linux", + "x86_64-linux", + "aarch64-darwin", + "x86_64-darwin", + "aarch64-windows", + "x86_64-windows" + ], + "version": "0.1.0", + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pnpm.ts" + } + }, + "bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa": { + "version": "10.0.1", + "port": { + "ty": "denoWorker@v1", + "name": "npmi_npm", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -3000,19 +3062,15 @@ "version": "0.1.0", "buildDeps": [ { - "name": "cargo_binstall_ghrel" - }, - { - "name": "rust_rustup" + "name": "node_org" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts" }, - "crateName": "cargo-insta", - "locked": true + "packageName": "node-gyp" }, - "bciqe33uhsuaesrjk6luzxrbbimwg5ydt6x2lrieelwbr7aft4g2qwsy": { - "version": "0.2.5", + "bciqojan3zglnfctnmqyxvnxaha46yrnlhj77j3kw4mxadvauqepqdba": { + "version": "0.116.1", "port": { "ty": "denoWorker@v1", "name": "cargobi_cratesio", @@ -3047,26 +3105,11 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "crateName": "cross", + "crateName": "wasm-opt", "locked": true }, - "bciqdoqocirh7aseu5o5hfqaj3sb3pfd3z3rlvig26xttmcmsoljuz6i": { - "port": { - "ty": "denoWorker@v1", - "name": "act_ghrel", - "platforms": [ - "aarch64-linux", - "x86_64-linux", - "aarch64-darwin", - "x86_64-darwin", - "aarch64-windows", - "x86_64-windows" - ], - "version": "0.1.0", - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/act.ts" - } - }, - "bciqjsjvkjm6xvoovs6y3y6me32422zr5wc5njs4kwfmmyf6nt6jzv2i": { + "bciqcnbruy2q6trpvia52n2yis4t27taoz4mxkeguqz5aif7ex6rp26y": { + "version": "1.208.1", "port": { "ty": "denoWorker@v1", "name": "cargobi_cratesio", @@ -3101,13 +3144,14 @@ ], "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" }, - "crateName": "whiz", + "crateName": "wasm-tools", "locked": true }, - "bciqdf7jtq3zzhn676t2dr7fyve47fj7coajtymmye353lrrluskjk7q": { + "bciqpu7gxs3zm7i4gwp3m3cfdxwz27ixvsykdnbxrl5m5mt3xbb3b4la": { + "version": "0.13.4", "port": { "ty": "denoWorker@v1", - "name": "cargobi_cratesio", + "name": "pipi_pypi", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -3131,21 +3175,18 @@ "version": "0.1.0", "buildDeps": [ { - "name": "cargo_binstall_ghrel" - }, - { - "name": "rust_rustup" + "name": "cpy_bs_ghrel" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/pipi.ts" }, - "crateName": "wit-deps-cli", - "locked": true + "packageName": "componentize-py" }, - "bciqeaqeduyhykw7s7gq6ney6ci7deheq3etgdwkvg55mwbzdhz2opra": { + "bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq": { + "version": "1.3.0", "port": { "ty": "denoWorker@v1", - "name": "cargobi_cratesio", + "name": "npmi_npm", "platforms": [ "x86_64-linux", "aarch64-linux", @@ -3169,16 +3210,12 @@ "version": "0.1.0", "buildDeps": [ { - "name": "cargo_binstall_ghrel" - }, - { - "name": "rust_rustup" + "name": "node_org" } ], - "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/cargobi.ts" + "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts" }, - "crateName": "git-cliff", - "locked": true + "packageName": "@bytecodealliance/jco" }, "bciqm2rvnfe77sj6jekrm65oayuywt5lbrw33qezqjcg5rzaioc6uszy": { "version": "3.5.1", diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a8ff9b25a0..cb9d567e83 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,7 +18,7 @@ Having a good title and description is important for the users to get readable c #### Migration notes -... +--- - [ ] The change comes with new or modified tests - [ ] Hard-to-understand functions have explanatory comments diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69eda3d166..711d3433fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -337,6 +337,9 @@ jobs: - build-docker - pub-docker runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 with: @@ -357,3 +360,8 @@ jobs: title: "chore(release): prepare for ${{ steps.bump.outputs.version }}" body: "Automatic suggested bump" base: main + # since PRs created from workflows won't have actions run + # on them, we create it as a draft PR + # the actions will then run when it's readied for review + # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + draft: always-true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 78514a30e9..d0d648d2c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -82,7 +82,17 @@ repos: - id: check-merge-conflict - id: end-of-file-fixer # exclude all generated files - exclude: (?x)( .ghjk/.* |.*deno.lock |.*\.snap$|typegate/src/typegraphs/.*\.json |website/docs/reference/ |libs/pyrt_wit_wire/pyrt | migration_lock.toml | tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py]) + exclude: (?x)( + .ghjk/.*| + .*deno.lock| + CHANGELOG.md| + .*\.snap$| + typegate/src/typegraphs/.*\.json| + website/docs/reference/| + libs/pyrt_wit_wire/pyrt| + migration_lock.toml| + tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py] + ) - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 hooks: diff --git a/Cargo.lock b/Cargo.lock index 78a09ccaca..a62097cdd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "common" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "async-trait", @@ -6891,7 +6891,7 @@ dependencies = [ [[package]] name = "meta-cli" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "actix", "assert_cmd", @@ -6957,7 +6957,7 @@ dependencies = [ [[package]] name = "metagen" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "color-eyre", "common", @@ -7306,7 +7306,7 @@ dependencies = [ [[package]] name = "mt_deno" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "deno", @@ -11267,7 +11267,7 @@ dependencies = [ [[package]] name = "substantial" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "chrono", @@ -12755,7 +12755,7 @@ dependencies = [ [[package]] name = "typegate" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "colored", "env_logger 0.11.0", @@ -12768,7 +12768,7 @@ dependencies = [ [[package]] name = "typegate_engine" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "base64 0.22.1", @@ -12813,7 +12813,7 @@ dependencies = [ [[package]] name = "typegraph_core" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "color-eyre", @@ -14566,7 +14566,7 @@ checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xtask" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 92024645b7..5317e120b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ exclude = [ ] [workspace.package] -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" edition = "2021" [workspace.dependencies] diff --git a/deno.lock b/deno.lock index 4124d6e754..9a679f2d84 100644 --- a/deno.lock +++ b/deno.lock @@ -9,6 +9,7 @@ "jsr:@std/assert@^1.0.2": "jsr:@std/assert@1.0.4", "jsr:@std/assert@^1.0.4": "jsr:@std/assert@1.0.6", "jsr:@std/assert@^1.0.6": "jsr:@std/assert@1.0.6", + "jsr:@std/async@^1.0.3": "jsr:@std/async@1.0.3", "jsr:@std/bytes@^0.221.0": "jsr:@std/bytes@0.221.0", "jsr:@std/bytes@^1.0.2": "jsr:@std/bytes@1.0.2", "jsr:@std/bytes@^1.0.2-rc.3": "jsr:@std/bytes@1.0.2", @@ -46,6 +47,7 @@ "jsr:@std/semver@^1.0.1": "jsr:@std/semver@1.0.2", "jsr:@std/streams@0.221.0": "jsr:@std/streams@0.221.0", "jsr:@std/streams@1": "jsr:@std/streams@1.0.4", + "jsr:@std/streams@^1.0.2": "jsr:@std/streams@1.0.4", "jsr:@std/testing@^1.0.1": "jsr:@std/testing@1.0.2", "jsr:@std/url@^0.225.0": "jsr:@std/url@0.225.0", "jsr:@std/uuid@^1.0.1": "jsr:@std/uuid@1.0.2", @@ -59,6 +61,7 @@ "npm:lodash@4.17.21": "npm:lodash@4.17.21", "npm:mathjs@11.11.1": "npm:mathjs@11.11.1", "npm:multiformats@13.1.0": "npm:multiformats@13.1.0", + "npm:pg@8.12.0": "npm:pg@8.12.0", "npm:validator@13.12.0": "npm:validator@13.12.0", "npm:zod-validation-error@3.3.0": "npm:zod-validation-error@3.3.0_zod@3.23.8", "npm:zod@3.23.8": "npm:zod@3.23.8" @@ -111,6 +114,9 @@ "jsr:@std/internal@^1.0.4" ] }, + "@std/async@1.0.3": { + "integrity": "6ed64678db43451683c6c176a21426a2ccd21ba0269ebb2c36133ede3f165792" + }, "@std/bytes@0.221.0": { "integrity": "64a047011cf833890a4a2ab7293ac55a1b4f5a050624ebc6a0159c357de91966" }, @@ -438,6 +444,73 @@ "integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==", "dependencies": {} }, + "pg-cloudflare@1.1.1": { + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "dependencies": {} + }, + "pg-connection-string@2.6.4": { + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "dependencies": {} + }, + "pg-int8@1.0.1": { + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "dependencies": {} + }, + "pg-pool@3.6.2_pg@8.12.0": { + "integrity": "sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==", + "dependencies": { + "pg": "pg@8.12.0" + } + }, + "pg-protocol@1.6.1": { + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==", + "dependencies": {} + }, + "pg-types@2.2.0": { + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "dependencies": { + "pg-int8": "pg-int8@1.0.1", + "postgres-array": "postgres-array@2.0.0", + "postgres-bytea": "postgres-bytea@1.0.0", + "postgres-date": "postgres-date@1.0.7", + "postgres-interval": "postgres-interval@1.2.0" + } + }, + "pg@8.12.0": { + "integrity": "sha512-A+LHUSnwnxrnL/tZ+OLfqR1SxLN3c/pgDztZ47Rpbsd4jUytsTtwQo/TLPRzPJMp/1pbhYVhH9cuSZLAajNfjQ==", + "dependencies": { + "pg-cloudflare": "pg-cloudflare@1.1.1", + "pg-connection-string": "pg-connection-string@2.6.4", + "pg-pool": "pg-pool@3.6.2_pg@8.12.0", + "pg-protocol": "pg-protocol@1.6.1", + "pg-types": "pg-types@2.2.0", + "pgpass": "pgpass@1.0.5" + } + }, + "pgpass@1.0.5": { + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "dependencies": { + "split2": "split2@4.2.0" + } + }, + "postgres-array@2.0.0": { + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "dependencies": {} + }, + "postgres-bytea@1.0.0": { + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "dependencies": {} + }, + "postgres-date@1.0.7": { + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "dependencies": {} + }, + "postgres-interval@1.2.0": { + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "dependencies": { + "xtend": "xtend@4.0.2" + } + }, "regenerator-runtime@0.14.1": { "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", "dependencies": {} @@ -446,6 +519,10 @@ "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==", "dependencies": {} }, + "split2@4.2.0": { + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dependencies": {} + }, "tiny-emitter@2.1.0": { "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", "dependencies": {} @@ -462,6 +539,10 @@ "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", "dependencies": {} }, + "xtend@4.0.2": { + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dependencies": {} + }, "zod-validation-error@3.3.0_zod@3.23.8": { "integrity": "sha512-Syib9oumw1NTqEv4LT0e6U83Td9aVRk9iTXPUQr1otyV1PuXQKOvOwhMNqZIq5hluzHP2pMgnOmHEo7kPdI2mw==", "dependencies": { diff --git a/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx b/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx index c023251111..1546215f5c 100644 --- a/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx +++ b/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx @@ -366,7 +366,6 @@ typegate: secrets: example: POSTGRES: "postgresql://postgres:password@postgres:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" HOST: "http://localhost:7233" NAMESPACE: "default" ``` diff --git a/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx b/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx index b4649e99f3..97297a73dc 100644 --- a/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx +++ b/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx @@ -123,7 +123,8 @@ docker compose version ...and if not, the official installation guide can be found [here](https://docs.docker.com/compose/install/). -If you have your docker runtime installed and running correctly, you will be able to launch the `compose.yml` file that's bundled in every template. The compose file by default includes the `postgres` and `mongo` databases. You can disable the latter by commenting it out or removing it as we'll not be needing it for this tutorial. +If you have your docker runtime installed and running correctly, you will be able to launch the `compose.yml` file that's bundled in every template. +The compose file also includes the `postgres` databases that we'll be using. To launch the services, navigate your shell to the project directory and run the following command: diff --git a/docs/metatype.dev/src/pages/index.tsx b/docs/metatype.dev/src/pages/index.tsx index 85b78f8bdd..b17d926a3c 100644 --- a/docs/metatype.dev/src/pages/index.tsx +++ b/docs/metatype.dev/src/pages/index.tsx @@ -301,10 +301,10 @@ function TryIt(): JSX.Element { } const runtimeList = [ - { + /* { name: "MongoDB", logo: "/images/runtimes/mongodb.svg", - }, + }, */ { name: "GraphQL", logo: "/images/runtimes/graphql.svg", @@ -333,10 +333,10 @@ const runtimeList = [ name: "Google APIs Explorer", logo: "/images/runtimes/google-apis-explorer.svg", }, - { + /* { name: "MariaDB", logo: "/images/runtimes/mariadb.svg", - }, + }, */ { name: "Python", logo: "/images/runtimes/python.svg", diff --git a/examples/templates/deno/api/example.ts b/examples/templates/deno/api/example.ts index 42fe0f6ae9..0668d7c991 100644 --- a/examples/templates/deno/api/example.ts +++ b/examples/templates/deno/api/example.ts @@ -1,6 +1,6 @@ -import { Policy, t, typegraph } from "jsr:@typegraph/sdk@0.5.0-rc.2/index.ts"; -import { PythonRuntime } from "jsr:@typegraph/sdk@0.5.0-rc.2/runtimes/python.ts"; -import { DenoRuntime } from "jsr:@typegraph/sdk@0.5.0-rc.2/runtimes/deno.ts"; +import { Policy, t, typegraph } from "jsr:@typegraph/sdk@0.5.0-rc.3/index.ts"; +import { PythonRuntime } from "jsr:@typegraph/sdk@0.5.0-rc.3/runtimes/python.ts"; +import { DenoRuntime } from "jsr:@typegraph/sdk@0.5.0-rc.3/runtimes/deno.ts"; await typegraph("example", (g) => { const pub = Policy.public(); diff --git a/examples/templates/deno/compose.yml b/examples/templates/deno/compose.yml index b19ee177dc..26bdac6ca7 100644 --- a/examples/templates/deno/compose.yml +++ b/examples/templates/deno/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.5.0-rc.2 + image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3 restart: always ports: - "7890:7890" @@ -35,20 +35,5 @@ services: volumes: - pgdata:/var/lib/postgresql/data - # for prisma runtime with mongo - # mongodb://root:password@mongo:27017/db - # see metatype.yml - mongo: - image: mongo:7 - restart: always - environment: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: password - ports: - - "27017:27017" - volumes: - - mongodata:/data/db - volumes: pgdata: - mongodata: diff --git a/examples/templates/deno/metatype.yaml b/examples/templates/deno/metatype.yaml index 03084f4f71..f42f7911d4 100644 --- a/examples/templates/deno/metatype.yaml +++ b/examples/templates/deno/metatype.yaml @@ -6,7 +6,6 @@ typegates: secrets: example: POSTGRES: "postgresql://postgres:password@postgres:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" deploy: url: "https://cloud.metatype.dev" username: admin @@ -14,4 +13,3 @@ typegates: secrets: example: POSTGRES: "postgresql://postgres:password@localhost:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" diff --git a/examples/templates/node/compose.yml b/examples/templates/node/compose.yml index 99bdf6f3a3..0509dfbdbf 100644 --- a/examples/templates/node/compose.yml +++ b/examples/templates/node/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.5.0-rc.2 + image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3 restart: always ports: - "7890:7890" @@ -34,20 +34,5 @@ services: volumes: - pgdata:/var/lib/postgresql/data - # for prisma runtime with mongo - # mongodb://root:password@mongo:27017/db - # see metatype.yml - mongo: - image: mongo:7 - restart: always - environment: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: password - ports: - - "27017:27017" - volumes: - - mongodata:/data/db - volumes: pgdata: - mongodata: diff --git a/examples/templates/node/metatype.yaml b/examples/templates/node/metatype.yaml index b66298cc78..f42f7911d4 100644 --- a/examples/templates/node/metatype.yaml +++ b/examples/templates/node/metatype.yaml @@ -3,10 +3,9 @@ typegates: url: "http://localhost:7890" username: admin password: password - secrets": + secrets: example: POSTGRES: "postgresql://postgres:password@postgres:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" deploy: url: "https://cloud.metatype.dev" username: admin @@ -14,4 +13,3 @@ typegates: secrets: example: POSTGRES: "postgresql://postgres:password@localhost:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" diff --git a/examples/templates/node/package.json b/examples/templates/node/package.json index dce90bee8d..98c0c0e60c 100644 --- a/examples/templates/node/package.json +++ b/examples/templates/node/package.json @@ -6,7 +6,7 @@ "dev": "MCLI_LOADER_CMD='npm x tsx' meta dev" }, "dependencies": { - "@typegraph/sdk": "^0.5.0-rc.2" + "@typegraph/sdk": "^0.5.0-rc.3" }, "devDependencies": { "tsx": "^3.13.0", diff --git a/examples/templates/python/compose.yml b/examples/templates/python/compose.yml index 99bdf6f3a3..0509dfbdbf 100644 --- a/examples/templates/python/compose.yml +++ b/examples/templates/python/compose.yml @@ -1,6 +1,6 @@ services: typegate: - image: ghcr.io/metatypedev/typegate:v0.5.0-rc.2 + image: ghcr.io/metatypedev/typegate:v0.5.0-rc.3 restart: always ports: - "7890:7890" @@ -34,20 +34,5 @@ services: volumes: - pgdata:/var/lib/postgresql/data - # for prisma runtime with mongo - # mongodb://root:password@mongo:27017/db - # see metatype.yml - mongo: - image: mongo:7 - restart: always - environment: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: password - ports: - - "27017:27017" - volumes: - - mongodata:/data/db - volumes: pgdata: - mongodata: diff --git a/examples/templates/python/metatype.yaml b/examples/templates/python/metatype.yaml index 03084f4f71..f42f7911d4 100644 --- a/examples/templates/python/metatype.yaml +++ b/examples/templates/python/metatype.yaml @@ -6,7 +6,6 @@ typegates: secrets: example: POSTGRES: "postgresql://postgres:password@postgres:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" deploy: url: "https://cloud.metatype.dev" username: admin @@ -14,4 +13,3 @@ typegates: secrets: example: POSTGRES: "postgresql://postgres:password@localhost:5432/db" - MONGO: "mongodb://root:password@mongo:27017/db" diff --git a/examples/templates/python/pyproject.toml b/examples/templates/python/pyproject.toml index 8e4ca3ab64..1775d71bfa 100644 --- a/examples/templates/python/pyproject.toml +++ b/examples/templates/python/pyproject.toml @@ -1,12 +1,12 @@ [tool.poetry] name = "example" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" description = "" authors = [] [tool.poetry.dependencies] python = ">=3.8,<4.0" -typegraph = "0.5.0-rc.2" +typegraph = "0.5.0-rc.3" [build-system] requires = ["poetry-core"] diff --git a/examples/typegraphs/metagen/rs/fdk.rs b/examples/typegraphs/metagen/rs/fdk.rs index ea3c02629f..06e8b0b0a3 100644 --- a/examples/typegraphs/metagen/rs/fdk.rs +++ b/examples/typegraphs/metagen/rs/fdk.rs @@ -109,7 +109,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.5.0-rc.1"; + static MT_VERSION: &str = "0.5.0-rc.3"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } diff --git a/pyproject.toml b/pyproject.toml index 5dac4dd3bc..9f4eeb3b4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ [tool.poetry] name = "metatype" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" description = "" authors = [] diff --git a/src/meta-lsp/package.json b/src/meta-lsp/package.json index d834ed70ec..b9e8a999af 100644 --- a/src/meta-lsp/package.json +++ b/src/meta-lsp/package.json @@ -4,7 +4,7 @@ "description": "VSCode extension for Metatype support", "icon": "logo.png", "author": "Metatype Team", - "version": "0.5.0-rc.2", + "version": "0.5.0-rc.3", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/src/meta-lsp/ts-language-server/package.json b/src/meta-lsp/ts-language-server/package.json index 6bec9f60fa..452699155f 100644 --- a/src/meta-lsp/ts-language-server/package.json +++ b/src/meta-lsp/ts-language-server/package.json @@ -2,7 +2,7 @@ "name": "typegraph-ts-server", "description": "TypeScript language server for TypeGraph", "author": "Metatype Team", - "version": "0.5.0-rc.2", + "version": "0.5.0-rc.3", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/src/meta-lsp/vscode-metatype-support/package.json b/src/meta-lsp/vscode-metatype-support/package.json index 264815ccfd..cad77aa27b 100644 --- a/src/meta-lsp/vscode-metatype-support/package.json +++ b/src/meta-lsp/vscode-metatype-support/package.json @@ -2,7 +2,7 @@ "name": "vscode-metatype-support", "description": "VSCode extension for Metatype support", "author": "Metatype Team", - "version": "0.5.0-rc.2", + "version": "0.5.0-rc.3", "repository": { "type": "git", "url": "https://github.com/metatypedev/metatype" diff --git a/src/pyrt_wit_wire/pyproject.toml b/src/pyrt_wit_wire/pyproject.toml index 079f0fdf16..9c5769482c 100644 --- a/src/pyrt_wit_wire/pyproject.toml +++ b/src/pyrt_wit_wire/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyrt_wit_wire" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" description = "Wasm component implementing the PythonRuntime host using wit_wire protocol." license = "Elastic-2.0" readme = "README.md" diff --git a/src/typegate/engine/bindings.ts b/src/typegate/engine/bindings.ts index 444edc38e1..3c125c6fcb 100644 --- a/src/typegate/engine/bindings.ts +++ b/src/typegate/engine/bindings.ts @@ -20,8 +20,7 @@ import type { } from "./runtime.js"; export function get_version() { - return "0.4.10"; - // return Meta.version(); + return Meta.version(); } export function init_native() { diff --git a/src/typegate/src/engine/typecheck/input.ts b/src/typegate/src/engine/typecheck/input.ts index 00d71f90fa..f128d04129 100644 --- a/src/typegate/src/engine/typecheck/input.ts +++ b/src/typegate/src/engine/typecheck/input.ts @@ -13,7 +13,8 @@ import { } from "./common.ts"; export function generateValidator(tg: TypeGraph, typeIdx: number): Validator { - const validatorName = (typeIdx: number) => `validate_${typeIdx}`; + const validatorName = (typeIdx: number) => + `validate_${tg.type(typeIdx).title.replace(/[^1-9a-zA-Z_$]/g, "_")}`; const validatorCode = new InputValidationCompiler(tg, validatorName) .generate(typeIdx); @@ -24,7 +25,9 @@ export function generateValidator(tg: TypeGraph, typeIdx: number): Validator { if (errors.length > 0) { const messages = errors.map(([path, msg]) => ` - at ${path}: ${msg}\n`) .join(""); - throw new Error(`Validation errors:\n${messages}`); + throw new Error( + `Validation errors on ${tg.type(typeIdx).title}:\n${messages}`, + ); } }; } diff --git a/src/typegate/src/runtimes/deno/deno.ts b/src/typegate/src/runtimes/deno/deno.ts index b710fdf940..92c4af3a8d 100644 --- a/src/typegate/src/runtimes/deno/deno.ts +++ b/src/typegate/src/runtimes/deno/deno.ts @@ -110,8 +110,6 @@ export class DenoRuntime extends Runtime { depMetas, ); - logger.info(`Resolved runtime artifacts at ${basePath}`); - // Note: // Worker destruction seems to have no effect on the import cache? (deinit() => stop(worker)) // hence the use of contentHash @@ -140,7 +138,7 @@ export class DenoRuntime extends Runtime { ); if (Deno.env.get("DENO_TESTING") === "true") { - await w.disableLazyness(); + w.disableLazyness(); } const rt = new DenoRuntime( diff --git a/src/typegate/src/runtimes/deno/worker.ts b/src/typegate/src/runtimes/deno/worker.ts index ddfc87dde1..b2f76a4419 100644 --- a/src/typegate/src/runtimes/deno/worker.ts +++ b/src/typegate/src/runtimes/deno/worker.ts @@ -7,6 +7,7 @@ import { getLogger } from "../../log.ts"; import { make_internal } from "../../worker_utils.ts"; import type { Answer, Message } from "../patterns/messenger/types.ts"; +import { toFileUrl } from "@std/path/to-file-url"; import type { FuncTask, @@ -65,7 +66,7 @@ async function register_import_func(_: null, task: RegisterImportFuncTask) { verbose && logger.info(`register import func "${op}" from "${modulePath.toString()}`); - registry.set(op, await import(modulePath)); + registry.set(op, await import(toFileUrl(modulePath).toString())); } function register_func(_: null, task: RegisterFuncTask) { diff --git a/src/typegate/src/runtimes/kv.ts b/src/typegate/src/runtimes/kv.ts index ca5175b6ab..7ceec77696 100644 --- a/src/typegate/src/runtimes/kv.ts +++ b/src/typegate/src/runtimes/kv.ts @@ -24,8 +24,6 @@ export class KvRuntime extends Runtime { } static async init(params: RuntimeInitParams): Promise { - logger.info("Initializing KvRuntime"); - logger.debug(`Init params: ${JSON.stringify(params)}`); const { typegraph, args, secretManager } = params as RuntimeInitParams< KvRuntimeData >; @@ -51,39 +49,43 @@ export class KvRuntime extends Runtime { ): ComputeStage[] | Promise { const name = stage.props.materializer?.name; - const resolver: Resolver = async (args) => { - if (name == "kv_set") { + let resolver: Resolver; + if (name == "kv_set") { + resolver = async (args) => { const { key, value } = args; return await this.redis.set(key, value); - } - - if (name == "kv_get") { + }; + } else if (name == "kv_get") { + resolver = async (args) => { const { key } = args; - return await this.redis.get(key); - } - - if (name == "kv_delete") { + const resp = await this.redis.get(key); + return resp; + }; + } else if (name == "kv_delete") { + resolver = async (args) => { const { key } = args; return await this.redis.del(key); - } - - if (name == "kv_keys") { + }; + } else if (name == "kv_keys") { + resolver = async (args) => { const { filter } = args; return await this.redis.keys(filter ?? "*"); - } - - if (name === "kv_values") { + }; + } else if (name === "kv_values") { + resolver = async (args) => { const { filter } = args; const keys = await this.redis.keys(filter ?? "*"); const values = await Promise.all( - keys.map(async (key) => { + keys.map(async (key: string) => { const value = await this.redis.get(key); return value; }), ); return values; - } - }; + }; + } else { + throw new Error(`unrecognized mat name: ${name}`); + } return [new ComputeStage({ ...stage.props, resolver })]; } } diff --git a/src/typegate/src/runtimes/prisma/hooks/run_migrations.ts b/src/typegate/src/runtimes/prisma/hooks/run_migrations.ts index 35a647bcf1..31ccf54572 100644 --- a/src/typegate/src/runtimes/prisma/hooks/run_migrations.ts +++ b/src/typegate/src/runtimes/prisma/hooks/run_migrations.ts @@ -44,8 +44,6 @@ export class MigrationFailure extends Error { ) { const err = new MigrationFailure(message, runtimeName); - console.log({ message }); - const prefix = "ERROR: "; const prefixLen = prefix.length; err.errors = message diff --git a/src/typegate/src/runtimes/prisma/prisma.ts b/src/typegate/src/runtimes/prisma/prisma.ts index c6c4c35d37..9daf9cb847 100644 --- a/src/typegate/src/runtimes/prisma/prisma.ts +++ b/src/typegate/src/runtimes/prisma/prisma.ts @@ -158,7 +158,7 @@ export class PrismaRuntime extends Runtime { return ret; } - execute( + #executeResolver( q: GenQuery, path: string[], renames: Record, @@ -286,11 +286,11 @@ export class PrismaRuntime extends Runtime { const fields = [stage, ...Runtime.collectRelativeStages(stage, waitlist)]; - const [query, renames] = this.buildQuery(fields); + const [queryFn, renames] = this.buildQuery(fields); const queryStage = stage.withResolver( - this.execute( - query, + this.#executeResolver( + queryFn, stage.props.materializer?.data.path as string[] ?? [stage.props.node], renames, diff --git a/src/typegate/src/runtimes/python.ts b/src/typegate/src/runtimes/python.ts index aa3ac4d081..0514eefea7 100644 --- a/src/typegate/src/runtimes/python.ts +++ b/src/typegate/src/runtimes/python.ts @@ -31,8 +31,6 @@ export class PythonRuntime extends Runtime { } static async init(params: RuntimeInitParams): Promise { - logger.info("initializing PythonRuntime"); - logger.debug("init params: " + JSON.stringify(params)); const { materializers, typegraphName, typegraph, typegate } = params; const artifacts = typegraph.meta.artifacts; @@ -139,7 +137,6 @@ export class PythonRuntime extends Runtime { typegraphUrl: new URL(`internal+witwire://typegate/${typegraphName}`), }, ); - logger.info("WitWireMessenger initialized"); return new PythonRuntime(typegraphName, typegraph, uuid, wire); } diff --git a/src/typegate/src/runtimes/temporal.ts b/src/typegate/src/runtimes/temporal.ts index 33d2db0390..7c4687a1f9 100644 --- a/src/typegate/src/runtimes/temporal.ts +++ b/src/typegate/src/runtimes/temporal.ts @@ -27,8 +27,6 @@ export class TemporalRuntime extends Runtime { static async init( params: RuntimeInitParams, ): Promise { - logger.info("initializing TemporalRuntime"); - logger.debug(`init params: ${JSON.stringify(params)}`); const { typegraph, args, secretManager } = params as RuntimeInitParams< TemporalRuntimeData >; diff --git a/src/typegate/src/runtimes/wit_wire/mod.ts b/src/typegate/src/runtimes/wit_wire/mod.ts index 1c7be1be54..5917f46505 100644 --- a/src/typegate/src/runtimes/wit_wire/mod.ts +++ b/src/typegate/src/runtimes/wit_wire/mod.ts @@ -9,7 +9,7 @@ import { getLogger } from "../../log.ts"; const logger = getLogger(import.meta); -const METATYPE_VERSION = "0.5.0-rc.2"; +const METATYPE_VERSION = "0.5.0-rc.3"; export class WitWireMessenger { static async init( diff --git a/src/typegate/src/typegate/artifacts/mod.ts b/src/typegate/src/typegate/artifacts/mod.ts index 7e5fed2d48..e7ede30440 100644 --- a/src/typegate/src/typegate/artifacts/mod.ts +++ b/src/typegate/src/typegate/artifacts/mod.ts @@ -169,10 +169,14 @@ export class ArtifactStore implements AsyncDisposable { } #resolveLocalPath(dep: ArtifactMeta, parentDirName: string) { - let promise = this.#localPathMemo.get(dep.hash); + // we combine the parentDirName with the hash for the local + // memo since the same artifact might be by different + // relative solutions + // FIXME: use the artifact set solution from substantial for Deno rt + let promise = this.#localPathMemo.get(dep.hash + parentDirName); if (!promise) { promise = readyLocalPath(dep, parentDirName, this.persistence.dirs); - this.#localPathMemo.set(dep.hash, promise); + this.#localPathMemo.set(dep.hash + parentDirName, promise); } return promise; } diff --git a/src/typegate/src/typegate/mod.ts b/src/typegate/src/typegate/mod.ts index 24dd65b8a6..0deb05fc9a 100644 --- a/src/typegate/src/typegate/mod.ts +++ b/src/typegate/src/typegate/mod.ts @@ -195,7 +195,9 @@ export class Typegate implements AsyncDisposable { res = await handler(res, secretManager, response); } catch (e) { logger.error(`Error in onPush hook: ${e}`); - if (e instanceof MigrationFailure) { + // FIXME: MigrationFailur err message parser doesn't support all errors like + // can't reach database errs + if (e instanceof MigrationFailure && e.errors[0]) { response.setFailure(e.errors[0]); } else { response.setFailure({ diff --git a/src/typegate/src/typegraph/mod.ts b/src/typegate/src/typegraph/mod.ts index 4b6df1fe6f..77d50c45ae 100644 --- a/src/typegate/src/typegraph/mod.ts +++ b/src/typegate/src/typegraph/mod.ts @@ -42,6 +42,9 @@ import { initRuntime } from "../runtimes/mod.ts"; import randomizeRecursively, { GeneratorNode } from "../runtimes/random.ts"; import type { Typegate } from "../typegate/mod.ts"; import { TypeUtils } from "./utils.ts"; +import { getLogger } from "../log.ts"; + +const logger = getLogger(import.meta); export type { Cors, @@ -219,6 +222,7 @@ export class TypeGraph implements AsyncDisposable { (mat) => mat.runtime === idx, ); + logger.info("initializing runtime {}", { name: runtime.name }) return initRuntime(runtime.name, { typegate, typegraph, @@ -380,13 +384,13 @@ export class TypeGraph implements AsyncDisposable { } ensure( isObject(type) || - isInteger(type) || - isNumber(type) || - isBoolean(type) || - isFunction(type) || - isString(type) || - isUnion(type) || - isEither(type), + isInteger(type) || + isNumber(type) || + isBoolean(type) || + isFunction(type) || + isString(type) || + isUnion(type) || + isEither(type), `object expected but got ${type.type}`, ); return (x: any) => { diff --git a/src/typegraph/core/Cargo.toml b/src/typegraph/core/Cargo.toml index 569df10d32..f33bb12786 100644 --- a/src/typegraph/core/Cargo.toml +++ b/src/typegraph/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "typegraph_core" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" edition = "2021" [lib] diff --git a/src/typegraph/core/src/global_store.rs b/src/typegraph/core/src/global_store.rs index f46a194e3d..395674ad25 100644 --- a/src/typegraph/core/src/global_store.rs +++ b/src/typegraph/core/src/global_store.rs @@ -39,6 +39,7 @@ pub struct SavedState { runtimes: usize, materializers: usize, policies: usize, + deno_modules: usize, } #[derive(Default)] @@ -54,7 +55,7 @@ pub struct Store { deno_runtime: RuntimeId, predefined_deno_functions: HashMap, - deno_modules: HashMap, + deno_modules: IndexMap, public_policy_id: PolicyId, @@ -106,7 +107,7 @@ const PREDEFINED_DENO_FUNCTIONS: &[&str] = &["identity", "true"]; thread_local! { pub static STORE: RefCell = RefCell::new(Store::new()); - pub static SDK_VERSION: String = "0.5.0-rc.2".to_owned(); + pub static SDK_VERSION: String = "0.5.0-rc.3".to_owned(); } fn with_store T>(f: F) -> T { @@ -137,6 +138,7 @@ impl Store { runtimes: s.runtimes.len(), materializers: s.materializers.len(), policies: s.policies.len(), + deno_modules: s.deno_modules.len(), }) } @@ -147,6 +149,7 @@ impl Store { s.runtimes.truncate(saved_state.runtimes); s.materializers.truncate(saved_state.materializers); s.policies.truncate(saved_state.policies); + s.deno_modules.truncate(saved_state.deno_modules); }) } diff --git a/src/typegraph/core/src/runtimes/prisma/context.rs b/src/typegraph/core/src/runtimes/prisma/context.rs index 6b55be95e3..c1067e7272 100644 --- a/src/typegraph/core/src/runtimes/prisma/context.rs +++ b/src/typegraph/core/src/runtimes/prisma/context.rs @@ -209,8 +209,8 @@ impl PrismaContext { if let Entry::Vacant(e) = self.models.entry(model_id) { let model: ModelRef = Rc::new(RefCell::new(model_id.try_into()?)).into(); e.insert(model.clone()); - self.models_by_name - .insert(model.borrow().model_type.name(), model_id); + let model_name = model.borrow().model_type.name(); + self.models_by_name.insert(model_name, model_id); let mut res = vec![model_id]; diff --git a/src/typegraph/core/src/typegraph.rs b/src/typegraph/core/src/typegraph.rs index e9f7b79ae7..4a5afd9a40 100644 --- a/src/typegraph/core/src/typegraph.rs +++ b/src/typegraph/core/src/typegraph.rs @@ -397,7 +397,8 @@ impl TypegraphContext { let idx = self.materializers.len(); e.insert(idx as u32); self.materializers.push(None); - let converted = convert_materializer(self, Store::get_materializer(id)?)?; + let mat_internal = Store::get_materializer(id)?; + let converted = convert_materializer(self, mat_internal)?; self.materializers[idx] = Some(converted); Ok(idx as MaterializerId) } diff --git a/src/typegraph/core/src/utils/archive.rs b/src/typegraph/core/src/utils/archive.rs index b8de8ffd0c..e33a8cb4e0 100644 --- a/src/typegraph/core/src/utils/archive.rs +++ b/src/typegraph/core/src/utils/archive.rs @@ -36,7 +36,6 @@ impl FsContext { impl ArchiveExt for FsContext { fn compress_and_encode(&self, path: impl AsRef) -> Result { let path = path.as_ref(); - crate::logger::debug!("compress_and_encode: {path:?}"); let ignore = { let tg_ignore_path = Path::new(".tgignore"); let mut ignore = self.load_tg_ignore(tg_ignore_path)?; diff --git a/src/typegraph/core/wit/typegraph.wit b/src/typegraph/core/wit/typegraph.wit index 766757e8bf..611fe47393 100644 --- a/src/typegraph/core/wit/typegraph.wit +++ b/src/typegraph/core/wit/typegraph.wit @@ -49,6 +49,7 @@ interface core { } record prisma-migration-config { + // Path towards the migrations for the specific typegraph. migrations-dir: string, migration-actions: list>, default-migration-action: migration-action, diff --git a/src/typegraph/deno/deno.json b/src/typegraph/deno/deno.json index 6d368cd926..82eefbb127 100644 --- a/src/typegraph/deno/deno.json +++ b/src/typegraph/deno/deno.json @@ -1,6 +1,6 @@ { "name": "@typegraph/sdk", - "version": "0.5.0-rc.2", + "version": "0.5.0-rc.3", "publish": { "exclude": [ "!src/gen", diff --git a/src/typegraph/deno/src/runtimes/kv.ts b/src/typegraph/deno/src/runtimes/kv.ts index 14d5a81597..d3965b3a65 100644 --- a/src/typegraph/deno/src/runtimes/kv.ts +++ b/src/typegraph/deno/src/runtimes/kv.ts @@ -45,7 +45,8 @@ export class KvRuntime extends Runtime { get() { const mat = this.#operation("get", fx.read()); - return t.func(t.struct({ "key": t.string() }), t.string(), mat); + // FIXME: consolidate response type construction inside tg_core + return t.func(t.struct({ "key": t.string() }), t.string().optional(), mat); } delete() { diff --git a/src/typegraph/deno/src/tg_deploy.ts b/src/typegraph/deno/src/tg_deploy.ts index 868ed18027..a748bd99d3 100644 --- a/src/typegraph/deno/src/tg_deploy.ts +++ b/src/typegraph/deno/src/tg_deploy.ts @@ -117,9 +117,20 @@ export async function tgDeploy( throw new Error(`failed to deploy typegraph ${typegraph.name}`); } + const addTypegraph = response.data.addTypegraph; + + /* + // FIXME: failure field is used by interactive deployment + // which means errors need to be ignored here but this + // allows deployment errors in non-interactive scenarios + if (addTypegraph.failure) { + console.error(addTypegraph.failure); + throw new Error(`failed to deploy typegraph ${typegraph.name}`); + } */ + return { serialized: tgJson, - response: response.data.addTypegraph, + response: addTypegraph, }; } diff --git a/src/typegraph/deno/src/typegraph.ts b/src/typegraph/deno/src/typegraph.ts index 1d7a4fd4e9..efb015183a 100644 --- a/src/typegraph/deno/src/typegraph.ts +++ b/src/typegraph/deno/src/typegraph.ts @@ -187,6 +187,7 @@ export async function typegraph( rate: rate ? { ...defaultRateFields, ...rate } : undefined, }; + core.initTypegraph({ name, dynamic, path, ...tgParams }); const g: TypegraphBuilderArgs = { diff --git a/src/typegraph/deno/src/utils/func_utils.ts b/src/typegraph/deno/src/utils/func_utils.ts index 7f39df0c2b..b227f4875a 100644 --- a/src/typegraph/deno/src/utils/func_utils.ts +++ b/src/typegraph/deno/src/utils/func_utils.ts @@ -167,7 +167,7 @@ export async function execRequest( try { const response = await fetch(url, reqInit); if (!response.ok) { - log.debug("error", response.json()); + log.error("error response json", await response.json().catch(_err => 'non json response')); throw Error( `${errMsg}: request failed with status ${response.status} (${response.statusText})`, ); @@ -176,7 +176,7 @@ export async function execRequest( if (response.headers.get("Content-Type") == "application/json") { return await response.json(); } - log.debug("response", response); + log.error("non json response", response); throw Error( `${errMsg}: expected json object, got "${await response.text()}"`, ); diff --git a/src/typegraph/python/pyproject.toml b/src/typegraph/python/pyproject.toml index 0e112e67c0..b51836e82a 100644 --- a/src/typegraph/python/pyproject.toml +++ b/src/typegraph/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "typegraph" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are." authors = ["Metatype Contributors "] license = "MPL-2.0" diff --git a/src/typegraph/python/typegraph/__init__.py b/src/typegraph/python/typegraph/__init__.py index 8755acca68..e6bb4a8db7 100644 --- a/src/typegraph/python/typegraph/__init__.py +++ b/src/typegraph/python/typegraph/__init__.py @@ -5,4 +5,4 @@ from typegraph.policy import Policy # noqa from typegraph import effects as fx # noqa -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" diff --git a/src/typegraph/python/typegraph/graph/tg_deploy.py b/src/typegraph/python/typegraph/graph/tg_deploy.py index b300f46393..e5fbdc6afe 100644 --- a/src/typegraph/python/typegraph/graph/tg_deploy.py +++ b/src/typegraph/python/typegraph/graph/tg_deploy.py @@ -15,6 +15,7 @@ from typegraph.graph.typegraph import TypegraphOutput from typegraph.wit import ErrorStack, SerializeParams, store, wit_utils from typegraph import version as sdk_version +from typegraph.io import Log @dataclass @@ -123,10 +124,22 @@ def tg_deploy(tg: TypegraphOutput, params: TypegraphDeployParams) -> DeployResul response = exec_request(req) response = response.read().decode() - return DeployResult( - serialized=tg_json, - response=handle_response(response).get("data").get("addTypegraph"), - ) + response = handle_response(response) + + if response.get("errors") is not None: + for err in response.errors: + Log.error(err.message) + raise Exception(f"failed to deploy typegraph {tg.name}") + + add_typegraph = response.get("data").get("addTypegraph") + + """ + # FIXME: read comments in similar section of typescript + if add_typegraph.get("failure") is not None: + Log.error(add_typegraph.failure) + raise Exception(f"failed to deploy typegraph {tg.name}") """ + + return DeployResult(serialized=tg_json, response=add_typegraph) def tg_remove(typegraph_name: str, params: TypegraphRemoveParams): diff --git a/src/typegraph/python/typegraph/runtimes/kv.py b/src/typegraph/python/typegraph/runtimes/kv.py index 4c7090ce14..653adc33a4 100644 --- a/src/typegraph/python/typegraph/runtimes/kv.py +++ b/src/typegraph/python/typegraph/runtimes/kv.py @@ -29,7 +29,7 @@ def __init__(self, url: str): def get(self): mat = self.__operation(KvMaterializer.GET, fx.read()) - return t.func(t.struct({"key": t.string()}), t.string(), mat) + return t.func(t.struct({"key": t.string()}), t.string().optional(), mat) def set(self): mat = self.__operation(KvMaterializer.SET, fx.update()) diff --git a/src/xtask/Cargo.toml b/src/xtask/Cargo.toml index a7ff09e091..8112185b0e 100644 --- a/src/xtask/Cargo.toml +++ b/src/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" edition = "2021" # this allows us to exclude the rust files diff --git a/tests/metagen/__snapshots__/metagen_test.ts.snap b/tests/metagen/__snapshots__/metagen_test.ts.snap index 6b6c159d94..56a75cdc17 100644 --- a/tests/metagen/__snapshots__/metagen_test.ts.snap +++ b/tests/metagen/__snapshots__/metagen_test.ts.snap @@ -448,7 +448,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.5.0-rc.2"; + static MT_VERSION: &str = "0.5.0-rc.3"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } @@ -1254,7 +1254,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.5.0-rc.2"; + static MT_VERSION: &str = "0.5.0-rc.3"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } diff --git a/tests/metagen/typegraphs/identities/rs/fdk.rs b/tests/metagen/typegraphs/identities/rs/fdk.rs index a4a6616e6a..fc9bdd9610 100644 --- a/tests/metagen/typegraphs/identities/rs/fdk.rs +++ b/tests/metagen/typegraphs/identities/rs/fdk.rs @@ -109,7 +109,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.4.11-rc.0"; + static MT_VERSION: &str = "0.5.0-rc.3"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } diff --git a/tests/metagen/typegraphs/sample/py/client.py b/tests/metagen/typegraphs/sample/py/client.py index e976188f26..10a2eb34dc 100644 --- a/tests/metagen/typegraphs/sample/py/client.py +++ b/tests/metagen/typegraphs/sample/py/client.py @@ -608,7 +608,7 @@ class NodeDescs: @staticmethod def scalar(): return NodeMeta() - + @staticmethod def Post(): return NodeMeta( @@ -681,7 +681,7 @@ def RootCompositeArgsFn(): sub_nodes=return_node.sub_nodes, variants=return_node.variants, arg_types={ - "id": "RootScalarArgsFnOutput", + "id": "PostSlugString", }, ) @@ -692,7 +692,7 @@ def RootScalarUnionFn(): sub_nodes=return_node.sub_nodes, variants=return_node.variants, arg_types={ - "id": "RootScalarArgsFnOutput", + "id": "PostSlugString", }, ) @@ -712,7 +712,7 @@ def RootCompositeUnionFn(): sub_nodes=return_node.sub_nodes, variants=return_node.variants, arg_types={ - "id": "RootScalarArgsFnOutput", + "id": "PostSlugString", }, ) @@ -732,53 +732,38 @@ def RootMixedUnionFn(): sub_nodes=return_node.sub_nodes, variants=return_node.variants, arg_types={ - "id": "RootScalarArgsFnOutput", + "id": "PostSlugString", }, ) - UserIdStringUuid = str PostSlugString = str -Post = typing.TypedDict( - "Post", - { - "id": UserIdStringUuid, - "slug": PostSlugString, - "title": PostSlugString, - }, - total=False, -) - -RootScalarArgsFnOutput = str - -RootCompositeArgsFnInput = typing.TypedDict( - "RootCompositeArgsFnInput", - { - "id": RootScalarArgsFnOutput, - }, - total=False, -) +Post = typing.TypedDict("Post", { + "id": UserIdStringUuid, + "slug": PostSlugString, + "title": PostSlugString, +}, total=False) + +RootCompositeArgsFnInput = typing.TypedDict("RootCompositeArgsFnInput", { + "id": PostSlugString, +}, total=False) UserEmailStringEmail = str UserPostsPostList = typing.List[Post] -User = typing.TypedDict( - "User", - { - "id": UserIdStringUuid, - "email": UserEmailStringEmail, - "posts": UserPostsPostList, - }, - total=False, -) +User = typing.TypedDict("User", { + "id": UserIdStringUuid, + "email": UserEmailStringEmail, + "posts": UserPostsPostList, +}, total=False) RootScalarUnionFnOutputT1Integer = int RootScalarUnionFnOutput = typing.Union[ - RootScalarArgsFnOutput, + PostSlugString, RootScalarUnionFnOutputT1Integer, ] @@ -792,146 +777,116 @@ def RootMixedUnionFn(): RootMixedUnionFnOutput = typing.Union[ Post, User, - RootScalarArgsFnOutput, + PostSlugString, RootScalarUnionFnOutputT1Integer, ] -PostSelections = typing.TypedDict( - "PostSelections", - { - "_": SelectionFlags, - "id": ScalarSelectNoArgs, - "slug": ScalarSelectNoArgs, - "title": ScalarSelectNoArgs, - }, - total=False, -) - -UserSelections = typing.TypedDict( - "UserSelections", - { - "_": SelectionFlags, - "id": ScalarSelectNoArgs, - "email": ScalarSelectNoArgs, - "posts": CompositeSelectNoArgs["PostSelections"], - }, - total=False, -) - -RootCompositeUnionFnOutputSelections = typing.TypedDict( - "RootCompositeUnionFnOutputSelections", - { - "_": SelectionFlags, - "post": CompositeSelectNoArgs["PostSelections"], - "user": CompositeSelectNoArgs["UserSelections"], - }, - total=False, -) - -RootMixedUnionFnOutputSelections = typing.TypedDict( - "RootMixedUnionFnOutputSelections", - { - "_": SelectionFlags, - "post": CompositeSelectNoArgs["PostSelections"], - "user": CompositeSelectNoArgs["UserSelections"], - }, - total=False, -) + +PostSelections = typing.TypedDict("PostSelections", { + "_": SelectionFlags, + "id": ScalarSelectNoArgs, + "slug": ScalarSelectNoArgs, + "title": ScalarSelectNoArgs, +}, total=False) + +UserSelections = typing.TypedDict("UserSelections", { + "_": SelectionFlags, + "id": ScalarSelectNoArgs, + "email": ScalarSelectNoArgs, + "posts": CompositeSelectNoArgs["PostSelections"], +}, total=False) + +RootCompositeUnionFnOutputSelections = typing.TypedDict("RootCompositeUnionFnOutputSelections", { + "_": SelectionFlags, + "post": CompositeSelectNoArgs["PostSelections"], + "user": CompositeSelectNoArgs["UserSelections"], +}, total=False) + +RootMixedUnionFnOutputSelections = typing.TypedDict("RootMixedUnionFnOutputSelections", { + "_": SelectionFlags, + "post": CompositeSelectNoArgs["PostSelections"], + "user": CompositeSelectNoArgs["UserSelections"], +}, total=False) class QueryGraph(QueryGraphBase): def __init__(self): - super().__init__( - { - "UserIdStringUuid": "String!", - "PostSlugString": "String!", - "RootScalarArgsFnOutput": "String!", - "post": "post!", - "user": "user!", - } - ) - + super().__init__({ + "UserIdStringUuid": "String!", + "PostSlugString": "String!", + "post": "post!", + "user": "user!", + }) + def get_user(self, select: UserSelections) -> QueryNode[User]: node = selection_to_nodes( - {"getUser": select}, {"getUser": NodeDescs.RootGetUserFn}, "$q" + {"getUser": select}, + {"getUser": NodeDescs.RootGetUserFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) def get_posts(self, select: PostSelections) -> QueryNode[Post]: node = selection_to_nodes( - {"getPosts": select}, {"getPosts": NodeDescs.RootGetPostsFn}, "$q" + {"getPosts": select}, + {"getPosts": NodeDescs.RootGetPostsFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) def scalar_no_args(self) -> QueryNode[PostSlugString]: node = selection_to_nodes( - {"scalarNoArgs": True}, {"scalarNoArgs": NodeDescs.RootScalarNoArgsFn}, "$q" + {"scalarNoArgs": True}, + {"scalarNoArgs": NodeDescs.RootScalarNoArgsFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) - def scalar_args( - self, args: typing.Union[Post, PlaceholderArgs] - ) -> MutationNode[RootScalarArgsFnOutput]: + def scalar_args(self, args: typing.Union[Post, PlaceholderArgs]) -> MutationNode[PostSlugString]: node = selection_to_nodes( - {"scalarArgs": args}, {"scalarArgs": NodeDescs.RootScalarArgsFn}, "$q" + {"scalarArgs": args}, + {"scalarArgs": NodeDescs.RootScalarArgsFn}, + "$q" )[0] - return MutationNode( - node.node_name, node.instance_name, node.args, node.sub_nodes - ) + return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes) def composite_no_args(self, select: PostSelections) -> MutationNode[Post]: node = selection_to_nodes( - {"compositeNoArgs": select}, - {"compositeNoArgs": NodeDescs.RootCompositeNoArgsFn}, - "$q", + {"compositeNoArgs": select}, + {"compositeNoArgs": NodeDescs.RootCompositeNoArgsFn}, + "$q" )[0] - return MutationNode( - node.node_name, node.instance_name, node.args, node.sub_nodes - ) + return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes) - def composite_args( - self, - args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], - select: PostSelections, - ) -> MutationNode[Post]: + def composite_args(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: PostSelections) -> MutationNode[Post]: node = selection_to_nodes( - {"compositeArgs": (args, select)}, - {"compositeArgs": NodeDescs.RootCompositeArgsFn}, - "$q", + {"compositeArgs": (args, select)}, + {"compositeArgs": NodeDescs.RootCompositeArgsFn}, + "$q" )[0] - return MutationNode( - node.node_name, node.instance_name, node.args, node.sub_nodes - ) + return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes) - def scalar_union( - self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs] - ) -> QueryNode[RootScalarUnionFnOutput]: + def scalar_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs]) -> QueryNode[RootScalarUnionFnOutput]: node = selection_to_nodes( - {"scalarUnion": args}, {"scalarUnion": NodeDescs.RootScalarUnionFn}, "$q" + {"scalarUnion": args}, + {"scalarUnion": NodeDescs.RootScalarUnionFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) - def composite_union( - self, - args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], - select: RootCompositeUnionFnOutputSelections, - ) -> QueryNode[RootCompositeUnionFnOutput]: + def composite_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: RootCompositeUnionFnOutputSelections) -> QueryNode[RootCompositeUnionFnOutput]: node = selection_to_nodes( - {"compositeUnion": (args, select)}, - {"compositeUnion": NodeDescs.RootCompositeUnionFn}, - "$q", + {"compositeUnion": (args, select)}, + {"compositeUnion": NodeDescs.RootCompositeUnionFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) - def mixed_union( - self, - args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], - select: RootMixedUnionFnOutputSelections, - ) -> QueryNode[RootMixedUnionFnOutput]: + def mixed_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: RootMixedUnionFnOutputSelections) -> QueryNode[RootMixedUnionFnOutput]: node = selection_to_nodes( - {"mixedUnion": (args, select)}, - {"mixedUnion": NodeDescs.RootMixedUnionFn}, - "$q", + {"mixedUnion": (args, select)}, + {"mixedUnion": NodeDescs.RootMixedUnionFn}, + "$q" )[0] return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes) diff --git a/tests/metagen/typegraphs/sample/rs/client.rs b/tests/metagen/typegraphs/sample/rs/client.rs index 3aba33fade..a056463c78 100644 --- a/tests/metagen/typegraphs/sample/rs/client.rs +++ b/tests/metagen/typegraphs/sample/rs/client.rs @@ -2172,6 +2172,7 @@ impl QueryGraph { // --- --- Typegraph types --- --- // // + #[allow(non_snake_case)] mod node_metas { use super::*; @@ -2181,7 +2182,7 @@ mod node_metas { sub_nodes: None, variants: None, } - } + } pub fn Post() -> NodeMeta { NodeMeta { arg_types: None, @@ -2191,8 +2192,7 @@ mod node_metas { ("id".into(), scalar as NodeMetaFn), ("slug".into(), scalar as NodeMetaFn), ("title".into(), scalar as NodeMetaFn), - ] - .into(), + ].into() ), } } @@ -2205,19 +2205,24 @@ mod node_metas { ("id".into(), scalar as NodeMetaFn), ("email".into(), scalar as NodeMetaFn), ("posts".into(), Post as NodeMetaFn), - ] - .into(), + ].into() ), } } pub fn RootGetUserFn() -> NodeMeta { - NodeMeta { ..User() } + NodeMeta { + ..User() + } } pub fn RootGetPostsFn() -> NodeMeta { - NodeMeta { ..Post() } + NodeMeta { + ..Post() + } } pub fn RootScalarNoArgsFn() -> NodeMeta { - NodeMeta { ..scalar() } + NodeMeta { + ..scalar() + } } pub fn RootScalarArgsFn() -> NodeMeta { NodeMeta { @@ -2226,24 +2231,33 @@ mod node_metas { ("id".into(), "UserIdStringUuid".into()), ("slug".into(), "PostSlugString".into()), ("title".into(), "PostSlugString".into()), - ] - .into(), + ].into() ), ..scalar() } } pub fn RootCompositeNoArgsFn() -> NodeMeta { - NodeMeta { ..Post() } + NodeMeta { + ..Post() + } } pub fn RootCompositeArgsFn() -> NodeMeta { NodeMeta { - arg_types: Some([("id".into(), "RootScalarArgsFnOutput".into())].into()), + arg_types: Some( + [ + ("id".into(), "PostSlugString".into()), + ].into() + ), ..Post() } } pub fn RootScalarUnionFn() -> NodeMeta { NodeMeta { - arg_types: Some([("id".into(), "RootScalarArgsFnOutput".into())].into()), + arg_types: Some( + [ + ("id".into(), "PostSlugString".into()), + ].into() + ), ..scalar() } } @@ -2255,14 +2269,17 @@ mod node_metas { [ ("post".into(), Post as NodeMetaFn), ("user".into(), User as NodeMetaFn), - ] - .into(), + ].into() ), } } pub fn RootCompositeUnionFn() -> NodeMeta { NodeMeta { - arg_types: Some([("id".into(), "RootScalarArgsFnOutput".into())].into()), + arg_types: Some( + [ + ("id".into(), "PostSlugString".into()), + ].into() + ), ..RootCompositeUnionFnOutput() } } @@ -2274,17 +2291,21 @@ mod node_metas { [ ("post".into(), Post as NodeMetaFn), ("user".into(), User as NodeMetaFn), - ] - .into(), + ].into() ), } } pub fn RootMixedUnionFn() -> NodeMeta { NodeMeta { - arg_types: Some([("id".into(), "RootScalarArgsFnOutput".into())].into()), + arg_types: Some( + [ + ("id".into(), "PostSlugString".into()), + ].into() + ), ..RootMixedUnionFnOutput() } } + } use types::*; pub mod types { @@ -2296,10 +2317,9 @@ pub mod types { pub slug: Option, pub title: Option, } - pub type RootScalarArgsFnOutput = String; #[derive(Debug, serde::Serialize, serde::Deserialize)] pub struct RootCompositeArgsFnInputPartial { - pub id: Option, + pub id: Option, } pub type UserEmailStringEmail = String; pub type UserPostsPostList = Vec; @@ -2313,7 +2333,7 @@ pub mod types { #[derive(Debug, serde::Serialize, serde::Deserialize)] #[serde(untagged)] pub enum RootScalarUnionFnOutput { - RootScalarArgsFnOutput(RootScalarArgsFnOutput), + PostSlugString(PostSlugString), RootScalarUnionFnOutputT1Integer(RootScalarUnionFnOutputT1Integer), } #[derive(Debug, serde::Serialize, serde::Deserialize)] @@ -2327,7 +2347,7 @@ pub mod types { pub enum RootMixedUnionFnOutput { PostPartial(PostPartial), UserPartial(UserPartial), - RootScalarArgsFnOutput(RootScalarArgsFnOutput), + PostSlugString(PostSlugString), RootScalarUnionFnOutputT1Integer(RootScalarUnionFnOutputT1Integer), } } @@ -2350,42 +2370,33 @@ pub struct RootCompositeUnionFnOutputSelections { pub post: CompositeSelect, NoAlias>, pub user: CompositeSelect, NoAlias>, } -impl_union_selection_traits!( - RootCompositeUnionFnOutputSelections, - ("post", post), - ("user", user) -); +impl_union_selection_traits!(RootCompositeUnionFnOutputSelections, ("post", post), ("user", user)); #[derive(Default, Debug)] pub struct RootMixedUnionFnOutputSelections { pub post: CompositeSelect, NoAlias>, pub user: CompositeSelect, NoAlias>, } -impl_union_selection_traits!( - RootMixedUnionFnOutputSelections, - ("post", post), - ("user", user) -); +impl_union_selection_traits!(RootMixedUnionFnOutputSelections, ("post", post), ("user", user)); impl QueryGraph { + pub fn new(addr: Url) -> Self { Self { addr, - ty_to_gql_ty_map: std::sync::Arc::new( - [ - ("UserIdStringUuid".into(), "String!".into()), - ("PostSlugString".into(), "String!".into()), - ("RootScalarArgsFnOutput".into(), "String!".into()), - ("post".into(), "post!".into()), - ("user".into(), "user!".into()), - ] - .into(), - ), + ty_to_gql_ty_map: std::sync::Arc::new([ + + ("UserIdStringUuid".into(), "String!".into()), + ("PostSlugString".into(), "String!".into()), + ("post".into(), "post!".into()), + ("user".into(), "user!".into()), + ].into()), } } - + pub fn get_user( &self, - ) -> UnselectedNode, QueryMarker, UserPartial> { + ) -> UnselectedNode, QueryMarker, UserPartial> + { UnselectedNode { root_name: "getUser".into(), root_meta: node_metas::RootGetUserFn, @@ -2395,7 +2406,8 @@ impl QueryGraph { } pub fn get_posts( &self, - ) -> UnselectedNode, QueryMarker, PostPartial> { + ) -> UnselectedNode, QueryMarker, PostPartial> + { UnselectedNode { root_name: "getPosts".into(), root_meta: node_metas::RootGetPostsFn, @@ -2403,14 +2415,21 @@ impl QueryGraph { _marker: PhantomData, } } - pub fn scalar_no_args(&self) -> QueryNode { + pub fn scalar_no_args( + &self, + ) -> QueryNode + { let nodes = selection_to_node_set( - SelectionErasedMap([("scalarNoArgs".into(), SelectionErased::Scalar)].into()), - &[( - "scalarNoArgs".into(), - node_metas::RootScalarNoArgsFn as NodeMetaFn, - )] - .into(), + SelectionErasedMap( + [( + "scalarNoArgs".into(), + SelectionErased::Scalar, + )] + .into(), + ), + &[ + ("scalarNoArgs".into(), node_metas::RootScalarNoArgsFn as NodeMetaFn), + ].into(), "$q".into(), ) .unwrap(); @@ -2418,8 +2437,9 @@ impl QueryGraph { } pub fn scalar_args( &self, - args: impl Into>, - ) -> MutationNode { + args: impl Into> + ) -> MutationNode + { let nodes = selection_to_node_set( SelectionErasedMap( [( @@ -2428,11 +2448,9 @@ impl QueryGraph { )] .into(), ), - &[( - "scalarArgs".into(), - node_metas::RootScalarArgsFn as NodeMetaFn, - )] - .into(), + &[ + ("scalarArgs".into(), node_metas::RootScalarArgsFn as NodeMetaFn), + ].into(), "$q".into(), ) .unwrap(); @@ -2440,7 +2458,8 @@ impl QueryGraph { } pub fn composite_no_args( &self, - ) -> UnselectedNode, MutationMarker, PostPartial> { + ) -> UnselectedNode, MutationMarker, PostPartial> + { UnselectedNode { root_name: "compositeNoArgs".into(), root_meta: node_metas::RootCompositeNoArgsFn, @@ -2450,8 +2469,9 @@ impl QueryGraph { } pub fn composite_args( &self, - args: impl Into>, - ) -> UnselectedNode, MutationMarker, PostPartial> { + args: impl Into> + ) -> UnselectedNode, MutationMarker, PostPartial> + { UnselectedNode { root_name: "compositeArgs".into(), root_meta: node_metas::RootCompositeArgsFn, @@ -2461,8 +2481,9 @@ impl QueryGraph { } pub fn scalar_union( &self, - args: impl Into>, - ) -> QueryNode { + args: impl Into> + ) -> QueryNode + { let nodes = selection_to_node_set( SelectionErasedMap( [( @@ -2471,11 +2492,9 @@ impl QueryGraph { )] .into(), ), - &[( - "scalarUnion".into(), - node_metas::RootScalarUnionFn as NodeMetaFn, - )] - .into(), + &[ + ("scalarUnion".into(), node_metas::RootScalarUnionFn as NodeMetaFn), + ].into(), "$q".into(), ) .unwrap(); @@ -2483,13 +2502,9 @@ impl QueryGraph { } pub fn composite_union( &self, - args: impl Into>, - ) -> UnselectedNode< - RootCompositeUnionFnOutputSelections, - RootCompositeUnionFnOutputSelections, - QueryMarker, - RootCompositeUnionFnOutput, - > { + args: impl Into> + ) -> UnselectedNode, QueryMarker, RootCompositeUnionFnOutput> + { UnselectedNode { root_name: "compositeUnion".into(), root_meta: node_metas::RootCompositeUnionFn, @@ -2499,13 +2514,9 @@ impl QueryGraph { } pub fn mixed_union( &self, - args: impl Into>, - ) -> UnselectedNode< - RootMixedUnionFnOutputSelections, - RootMixedUnionFnOutputSelections, - QueryMarker, - RootMixedUnionFnOutput, - > { + args: impl Into> + ) -> UnselectedNode, QueryMarker, RootMixedUnionFnOutput> + { UnselectedNode { root_name: "mixedUnion".into(), root_meta: node_metas::RootMixedUnionFn, diff --git a/tests/metagen/typegraphs/sample/ts/client.ts b/tests/metagen/typegraphs/sample/ts/client.ts index 4992f54021..25f0bb1d91 100644 --- a/tests/metagen/typegraphs/sample/ts/client.ts +++ b/tests/metagen/typegraphs/sample/ts/client.ts @@ -770,7 +770,7 @@ const nodeMetas = { return { ...nodeMetas.Post(), argumentTypes: { - id: "RootScalarArgsFnOutput", + id: "PostSlugString", }, }; }, @@ -778,7 +778,7 @@ const nodeMetas = { return { ...nodeMetas.scalar(), argumentTypes: { - id: "RootScalarArgsFnOutput", + id: "PostSlugString", }, }; }, @@ -794,7 +794,7 @@ const nodeMetas = { return { ...nodeMetas.RootCompositeUnionFnOutput(), argumentTypes: { - id: "RootScalarArgsFnOutput", + id: "PostSlugString", }, }; }, @@ -810,7 +810,7 @@ const nodeMetas = { return { ...nodeMetas.RootMixedUnionFnOutput(), argumentTypes: { - id: "RootScalarArgsFnOutput", + id: "PostSlugString", }, }; }, @@ -822,9 +822,8 @@ export type Post = { slug: PostSlugString; title: PostSlugString; }; -export type RootScalarArgsFnOutput = string; export type RootCompositeArgsFnInput = { - id: RootScalarArgsFnOutput; + id: PostSlugString; }; export type UserEmailStringEmail = string; export type UserPostsPostList = Array; @@ -835,7 +834,7 @@ export type User = { }; export type RootScalarUnionFnOutputT1Integer = number; export type RootScalarUnionFnOutput = - | (RootScalarArgsFnOutput) + | (PostSlugString) | (RootScalarUnionFnOutputT1Integer); export type RootCompositeUnionFnOutput = | (Post) @@ -843,7 +842,7 @@ export type RootCompositeUnionFnOutput = export type RootMixedUnionFnOutput = | (Post) | (User) - | (RootScalarArgsFnOutput) + | (PostSlugString) | (RootScalarUnionFnOutputT1Integer); export type PostSelections = { @@ -874,7 +873,6 @@ export class QueryGraph extends _QueryGraphBase { super({ "UserIdStringUuid": "String!", "PostSlugString": "String!", - "RootScalarArgsFnOutput": "String!", "post": "post!", "user": "user!", }); @@ -910,7 +908,7 @@ export class QueryGraph extends _QueryGraphBase { [["scalarArgs", nodeMetas.RootScalarArgsFn]], "$q", )[0]; - return new MutationNode(inner) as MutationNode; + return new MutationNode(inner) as MutationNode; } compositeNoArgs(select: PostSelections) { const inner = _selectionToNodeSet( diff --git a/tests/runtimes/kv/__snapshots__/kv_test.ts.snap b/tests/runtimes/kv/__snapshots__/kv_test.ts.snap index 4501a8ab5f..64b059222e 100644 --- a/tests/runtimes/kv/__snapshots__/kv_test.ts.snap +++ b/tests/runtimes/kv/__snapshots__/kv_test.ts.snap @@ -10,10 +10,10 @@ snapshot[`Typegraph using kv 1`] = ` "policies": [], "properties": { "get": 1, - "set": 4, - "delete": 6, - "keys": 8, - "values": 12 + "set": 5, + "delete": 7, + "keys": 9, + "values": 13 }, "id": [], "required": [ @@ -31,7 +31,7 @@ snapshot[`Typegraph using kv 1`] = ` 0 ], "input": 2, - "output": 3, + "output": 4, "injections": {}, "runtimeConfig": null, "materializer": 0, @@ -53,13 +53,20 @@ snapshot[`Typegraph using kv 1`] = ` "title": "root_get_fn_input_key_string", "policies": [] }, + { + "type": "optional", + "title": "root_get_fn_output", + "policies": [], + "item": 3, + "default_value": null + }, { "type": "function", "title": "root_set_fn", "policies": [ 0 ], - "input": 5, + "input": 6, "output": 3, "injections": {}, "runtimeConfig": null, @@ -85,7 +92,7 @@ snapshot[`Typegraph using kv 1`] = ` 0 ], "input": 2, - "output": 7, + "output": 8, "injections": {}, "runtimeConfig": null, "materializer": 3, @@ -103,8 +110,8 @@ snapshot[`Typegraph using kv 1`] = ` "policies": [ 0 ], - "input": 9, - "output": 11, + "input": 10, + "output": 12, "injections": {}, "runtimeConfig": null, "materializer": 4, @@ -116,7 +123,7 @@ snapshot[`Typegraph using kv 1`] = ` "title": "root_keys_fn_input", "policies": [], "properties": { - "filter": 10 + "filter": 11 }, "id": [], "required": [] @@ -140,8 +147,8 @@ snapshot[`Typegraph using kv 1`] = ` "policies": [ 0 ], - "input": 13, - "output": 15, + "input": 14, + "output": 16, "injections": {}, "runtimeConfig": null, "materializer": 5, @@ -153,7 +160,7 @@ snapshot[`Typegraph using kv 1`] = ` "title": "root_values_fn_input", "policies": [], "properties": { - "filter": 14 + "filter": 15 }, "id": [], "required": [] @@ -286,10 +293,10 @@ snapshot[`Typegraph using kv 2`] = ` "policies": [], "properties": { "get": 1, - "set": 4, - "delete": 6, - "keys": 8, - "values": 12 + "set": 5, + "delete": 7, + "keys": 9, + "values": 13 }, "id": [], "required": [ @@ -307,7 +314,7 @@ snapshot[`Typegraph using kv 2`] = ` 0 ], "input": 2, - "output": 3, + "output": 4, "injections": {}, "runtimeConfig": null, "materializer": 0, @@ -329,13 +336,20 @@ snapshot[`Typegraph using kv 2`] = ` "title": "root_get_fn_input_key_string", "policies": [] }, + { + "type": "optional", + "title": "root_get_fn_output", + "policies": [], + "item": 3, + "default_value": null + }, { "type": "function", "title": "root_set_fn", "policies": [ 0 ], - "input": 5, + "input": 6, "output": 3, "injections": {}, "runtimeConfig": null, @@ -361,7 +375,7 @@ snapshot[`Typegraph using kv 2`] = ` 0 ], "input": 2, - "output": 7, + "output": 8, "injections": {}, "runtimeConfig": null, "materializer": 3, @@ -379,8 +393,8 @@ snapshot[`Typegraph using kv 2`] = ` "policies": [ 0 ], - "input": 9, - "output": 11, + "input": 10, + "output": 12, "injections": {}, "runtimeConfig": null, "materializer": 4, @@ -392,7 +406,7 @@ snapshot[`Typegraph using kv 2`] = ` "title": "root_keys_fn_input", "policies": [], "properties": { - "filter": 10 + "filter": 11 }, "id": [], "required": [] @@ -416,8 +430,8 @@ snapshot[`Typegraph using kv 2`] = ` "policies": [ 0 ], - "input": 13, - "output": 15, + "input": 14, + "output": 16, "injections": {}, "runtimeConfig": null, "materializer": 5, @@ -429,7 +443,7 @@ snapshot[`Typegraph using kv 2`] = ` "title": "root_values_fn_input", "policies": [], "properties": { - "filter": 14 + "filter": 15 }, "id": [], "required": [] diff --git a/tests/runtimes/kv/kv_test.ts b/tests/runtimes/kv/kv_test.ts index 9cefe67a6b..3a1f9b2508 100644 --- a/tests/runtimes/kv/kv_test.ts +++ b/tests/runtimes/kv/kv_test.ts @@ -51,6 +51,18 @@ Meta.test( .on(e); }); + await t.should("return null when key not found", async () => { + await gql` + query { + get(key: "INEXISTENT") + } + ` + .expectData({ + get: null, + }) + .on(e); + }); + await t.should("get all keys from redis", async () => { await gql` query { diff --git a/tests/runtimes/wasm_reflected/rust/Cargo.toml b/tests/runtimes/wasm_reflected/rust/Cargo.toml index 6b972c9783..205930032c 100644 --- a/tests/runtimes/wasm_reflected/rust/Cargo.toml +++ b/tests/runtimes/wasm_reflected/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" edition = "2021" [lib] diff --git a/tests/runtimes/wasm_wire/rust/fdk.rs b/tests/runtimes/wasm_wire/rust/fdk.rs index c2b9ff4707..7b3e201923 100644 --- a/tests/runtimes/wasm_wire/rust/fdk.rs +++ b/tests/runtimes/wasm_wire/rust/fdk.rs @@ -109,7 +109,7 @@ impl Router { } pub fn init(&self, args: InitArgs) -> Result { - static MT_VERSION: &str = "0.4.11-rc.0"; + static MT_VERSION: &str = "0.5.0-rc.3"; if args.metatype_version != MT_VERSION { return Err(InitError::VersionMismatch(MT_VERSION.into())); } diff --git a/tests/type_nodes/__snapshots__/array_of_optional_test.ts.snap b/tests/type_nodes/__snapshots__/array_of_optional_test.ts.snap index ebf9187e2d..22773921b3 100644 --- a/tests/type_nodes/__snapshots__/array_of_optional_test.ts.snap +++ b/tests/type_nodes/__snapshots__/array_of_optional_test.ts.snap @@ -2,7 +2,7 @@ export const snapshot = {}; snapshot[`array of optional 1`] = ` [ - "Validation errors: + "Validation errors on root_testNonNull_fn_input: - at .struct_array[2]: exptected a non-null object, got null - at .string_array[2]: expected a string, got object - at .integer_array[2]: expected number, got object diff --git a/tests/type_nodes/__snapshots__/either_test.ts.snap b/tests/type_nodes/__snapshots__/either_test.ts.snap index e9f0801b3c..02891807f6 100644 --- a/tests/type_nodes/__snapshots__/either_test.ts.snap +++ b/tests/type_nodes/__snapshots__/either_test.ts.snap @@ -2,7 +2,7 @@ export const snapshot = {}; snapshot[`Either type 1`] = ` [ - "Validation errors: + "Validation errors on root_regist_user_fn_input: - at .user: Value does not match to any variant of the either type #0 .user.school,expected a string, got undefined, .user,unexpected fields: company #1 .user.age,expected minimum value: 17, got 5, .user.college,expected a string, got undefined, .user,unexpected fields: company diff --git a/tests/type_nodes/__snapshots__/union_test.ts.snap b/tests/type_nodes/__snapshots__/union_test.ts.snap index 24658291be..241810400c 100644 --- a/tests/type_nodes/__snapshots__/union_test.ts.snap +++ b/tests/type_nodes/__snapshots__/union_test.ts.snap @@ -2,7 +2,7 @@ export const snapshot = {}; snapshot[`Union type 1`] = ` [ - "Validation errors: + "Validation errors on root_convert_fn_input: - at .color: Value does not match to any variant of the union type #0 .color,expected an array, got string #1 .color,expected an object, got string diff --git a/tests/typecheck/__snapshots__/input_validator_test.ts.snap b/tests/typecheck/__snapshots__/input_validator_test.ts.snap index 51a9673cf2..0cad272f18 100644 --- a/tests/typecheck/__snapshots__/input_validator_test.ts.snap +++ b/tests/typecheck/__snapshots__/input_validator_test.ts.snap @@ -95,7 +95,7 @@ return validate_32" `; snapshot[`input validator compiler 2`] = ` -"Validation errors: +"Validation errors on root_createPost_fn_input: - at .title: expected minimum length: 10, got 6 - at .content: expected minimum length: 100, got 13 - at .authorId: string does not statisfy the required format 'uuid' @@ -105,7 +105,7 @@ snapshot[`input validator compiler 2`] = ` snapshot[`input validator compiler 3`] = ` [ - "Validation errors: + "Validation errors on User: - at .username: string does not match to the pattern /^[a-z]+\$/ - at .email: string does not statisfy the required format 'email' - at .website: string does not statisfy the required format 'uri' @@ -165,7 +165,7 @@ return validate_36" snapshot[`input validator compiler 5`] = ` [ - "Validation errors: + "Validation errors on root_enums_fn_input: - at .userRole: value did not match to any of the enum values ", ] @@ -173,7 +173,7 @@ snapshot[`input validator compiler 5`] = ` snapshot[`input validator compiler 6`] = ` [ - "Validation errors: + "Validation errors on root_enums_fn_input: - at .availableItems[0]: value did not match to any of the enum values - at .availableItems[2]: value did not match to any of the enum values ", @@ -393,7 +393,7 @@ return validate_9" snapshot[`input validator compiler 8`] = ` [ - "Validation errors: + "Validation errors on root_posts_fn_input: - at .authorId: string does not statisfy the required format 'uuid' ", ] @@ -401,7 +401,7 @@ snapshot[`input validator compiler 8`] = ` snapshot[`input validator compiler 9`] = ` [ - "Validation errors: + "Validation errors on root_posts_fn_input: - at .tag: Value does not match to any variant of the union type #0 .tag,expected a string, got object #1 .tag[1],expected maximum length: 10, got 11 @@ -410,7 +410,7 @@ snapshot[`input validator compiler 9`] = ` `; snapshot[`input validator compiler 10`] = ` -"Validation errors: +"Validation errors on root_posts_fn_input: - at .search: Value does not match to any variant of the either type #0 .search.title,Value match to more than one variant of the either type #1 .search.content,Value does not match to any variant of the either type @@ -420,7 +420,7 @@ snapshot[`input validator compiler 10`] = ` `; snapshot[`input validator compiler 11`] = ` -"Validation errors: +"Validation errors on root_posts_fn_input: - at .search: Value does not match to any variant of the either type #0 .search.title,Value does not match to any variant of the either type #0 .search.title,expected a string, got undefined diff --git a/tools/compose/compose.base.yml b/tools/compose/compose.base.yml index 9c902066bc..855d48dd3f 100644 --- a/tools/compose/compose.base.yml +++ b/tools/compose/compose.base.yml @@ -19,7 +19,7 @@ services: REDIS_PASSWORD: password minio: - image: bitnami/minio:2024 + image: docker.io/bitnami/minio:2024 platform: linux/amd64 restart: unless-stopped ports: diff --git a/tools/consts.ts b/tools/consts.ts index 26f38d8454..88154dba7e 100644 --- a/tools/consts.ts +++ b/tools/consts.ts @@ -1,8 +1,8 @@ // Copyright Metatype OÜ, licensed under the Elastic License 2.0. // SPDX-License-Identifier: Elastic-2.0 -export const METATYPE_VERSION = "0.5.0-rc.2"; -export const PUBLISHED_VERSION = "0.5.0-rc.1"; +export const METATYPE_VERSION = "0.5.0-rc.3"; +export const PUBLISHED_VERSION = "0.5.0-rc.2"; export const GHJK_VERSION = "v0.2.1"; export const GHJK_ACTION_VERSION = "318209a9d215f70716a4ac89dbeb9653a2deb8bc"; export const RUST_VERSION = "1.80.1";