├── .cargo └── config.toml ├── .env.sample ├── .ghjk ├── .gitignore ├── deno.jsonc ├── deno.lock └── lock.json ├── .git-branches.toml ├── .github ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── autoupdate.yml │ ├── nightly.yml │ ├── pr-title-check.yml │ ├── publish-website.yml │ ├── release.yml │ └── tests.yml ├── .gitignore ├── .gitlab-ci.yml ├── .pre-commit-config.yaml ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE.md ├── README.md ├── SECURITY.md ├── deno.jsonc ├── deno.lock ├── docs └── metatype.dev │ ├── .eslintignore │ ├── .eslintrc.cjs │ ├── .prettierignore │ ├── .vale.ini │ ├── babel.config.js │ ├── blog │ ├── 2023-03-15-emulating-servers │ │ └── index.mdx │ ├── 2023-06-18-programmable-glue │ │ └── index.mdx │ ├── 2023-11-27-node-compatibility │ │ └── index.mdx │ ├── 2024-05-09-programmatic-deployment │ │ └── index.mdx │ ├── 2024-08-26-python-on-webassembly │ │ └── index.mdx │ ├── 2024-08-27-distributed-execution-flow-paradigms │ │ ├── eda.drawio.svg │ │ ├── index.mdx │ │ └── saga.drawio.svg │ └── 2024-09-26-introducing-grpc-runtime │ │ ├── GrpcMetatype.drawio.png │ │ └── index.mdx │ ├── docs │ ├── concepts │ │ ├── RFCs │ │ │ ├── M0-template.mdx │ │ │ └── index.mdx │ │ ├── architecture │ │ │ ├── artifact_upload_protocol.drawio.svg │ │ │ └── index.mdx │ │ ├── comparisons │ │ │ └── index.mdx │ │ ├── features-overview │ │ │ └── index.mdx │ │ └── mental-model │ │ │ └── index.mdx │ ├── guides │ │ ├── contributing.mdx │ │ ├── external-functions │ │ │ ├── ctx.graphql │ │ │ ├── gql.graphql │ │ │ ├── index.mdx │ │ │ ├── math.graphql │ │ │ └── metagen.graphql │ │ ├── files-upload │ │ │ └── index.mdx │ │ ├── import-external-modules │ │ │ ├── func.graphql │ │ │ └── index.mdx │ │ ├── programmatic-deployment │ │ │ └── index.mdx │ │ ├── rest │ │ │ └── index.mdx │ │ ├── securing-requests │ │ │ ├── authentication.graphql │ │ │ ├── cors.graphql │ │ │ ├── cors.py │ │ │ ├── index.mdx │ │ │ └── policies.graphql │ │ ├── self-hosting.md │ │ ├── test-your-typegraph │ │ │ └── index.mdx │ │ └── wasm-functions │ │ │ ├── index.mdx │ │ │ └── metagen.graphql │ ├── index.mdx │ ├── reference │ │ ├── changelog.mdx │ │ ├── ecosystem │ │ │ └── index.mdx │ │ ├── graphql │ │ │ ├── index.mdx │ │ │ └── union-either.graphql │ │ ├── meta-cli │ │ │ ├── available-commands.mdx │ │ │ ├── configuration-file.mdx │ │ │ ├── embedded-typegate │ │ │ │ └── index.mdx │ │ │ └── index.mdx │ │ ├── metagen │ │ │ └── index.mdx │ │ ├── policies │ │ │ ├── index.mdx │ │ │ └── policies.graphql │ │ ├── rest │ │ │ └── index.mdx │ │ ├── runtimes │ │ │ ├── deno │ │ │ │ ├── deno.graphql │ │ │ │ └── index.mdx │ │ │ ├── graphql │ │ │ │ ├── graphql.graphql │ │ │ │ └── index.mdx │ │ │ ├── grpc │ │ │ │ ├── grpc.graphql │ │ │ │ └── index.mdx │ │ │ ├── http │ │ │ │ ├── http.graphql │ │ │ │ └── index.mdx │ │ │ ├── index.mdx │ │ │ ├── kv │ │ │ │ └── index.mdx │ │ │ ├── prisma │ │ │ │ ├── database.graphql │ │ │ │ └── index.mdx │ │ │ ├── python │ │ │ │ └── index.mdx │ │ │ ├── random │ │ │ │ ├── index.mdx │ │ │ │ ├── random-field.graphql │ │ │ │ └── random.graphql │ │ │ ├── s3 │ │ │ │ └── index.mdx │ │ │ ├── substantial │ │ │ │ └── index.mdx │ │ │ ├── temporal │ │ │ │ └── index.mdx │ │ │ └── wasm │ │ │ │ └── index.mdx │ │ ├── typegate │ │ │ ├── authentication │ │ │ │ ├── basic.graphql │ │ │ │ ├── index.mdx │ │ │ │ ├── jwt.graphql │ │ │ │ ├── oauth2.graphql │ │ │ │ └── oauth2.tsx │ │ │ ├── cors │ │ │ │ ├── cors.graphql │ │ │ │ └── index.mdx │ │ │ ├── index.mdx │ │ │ ├── rate-limiting │ │ │ │ ├── index.mdx │ │ │ │ └── rate.graphql │ │ │ └── synchronization │ │ │ │ └── index.mdx │ │ ├── typegraph │ │ │ ├── client │ │ │ │ └── index.mdx │ │ │ └── index.mdx │ │ └── types │ │ │ ├── comparison.mdx │ │ │ ├── functions.mdx │ │ │ ├── importers │ │ │ ├── google.py_ │ │ │ ├── google.pyi │ │ │ ├── importer.py_ │ │ │ ├── index.mdx.disabled │ │ │ └── typegraph_std.py_ │ │ │ ├── index.mdx │ │ │ ├── injections.mdx │ │ │ └── parameter-transformations.mdx │ ├── sidebars.js │ └── tutorials │ │ ├── metatype-basics │ │ ├── execute.graphql │ │ ├── index.mdx │ │ ├── md2html.ts.src │ │ ├── policies.graphql │ │ ├── prisma.graphql │ │ ├── query.graphql │ │ ├── random.graphql │ │ └── reduce.graphql │ │ └── quick-start │ │ └── index.mdx │ ├── docusaurus.config.js │ ├── globals.d.ts │ ├── package.json │ ├── packages │ ├── code-loader-transform.js │ ├── code-loader.js │ └── tailwindcss.js │ ├── pnpm-lock.yaml │ ├── shared │ ├── components.drawio.svg │ ├── cors │ │ ├── cors.graphql │ │ └── index.mdx │ ├── evolution.drawio.svg │ ├── install │ │ ├── meta-cli.mdx │ │ ├── typegate.mdx │ │ └── typegraph.mdx │ ├── meta-cli │ │ └── embedded-typegate.mdx │ ├── metatype-intro.mdx │ ├── projects │ │ ├── first-project.graphql │ │ ├── first-project.mdx │ │ ├── tab-first-project-python.mdx │ │ └── tab-first-project-ts.mdx │ ├── s3 │ │ ├── files.graphql │ │ └── index.mdx │ └── upgrade │ │ ├── index.mdx │ │ ├── meta-cli.mdx │ │ ├── python-sdk.mdx │ │ └── typescript-sdk.mdx │ ├── src │ ├── components │ │ ├── BlogIntro │ │ │ └── index.tsx │ │ ├── ChoicePicker │ │ │ └── index.tsx │ │ ├── CompareLandscape.tsx │ │ ├── DocButton │ │ │ ├── index.tsx │ │ │ └── styles.module.scss │ │ ├── Features │ │ │ └── index.tsx │ │ ├── Giscus │ │ │ └── index.tsx │ │ ├── MiniQL │ │ │ ├── graphiql.tsx │ │ │ ├── index.tsx │ │ │ └── memory_store.ts │ │ ├── Newsletter │ │ │ └── index.tsx │ │ ├── PythonPackageManagerTabs │ │ │ └── index.tsx │ │ ├── SDKTabs │ │ │ └── index.tsx │ │ ├── TGExample │ │ │ └── index.tsx │ │ ├── TsPackageManagerTabs │ │ │ └── index.tsx │ │ ├── animations │ │ │ ├── animated.tsx │ │ │ ├── animated_canvas.tsx │ │ │ ├── block.tsx │ │ │ ├── doublearrow.tsx │ │ │ ├── hooks.tsx │ │ │ └── textarrow.tsx │ │ └── castles.tsx │ ├── css │ │ └── custom.scss │ ├── pages │ │ ├── index.graphql │ │ ├── index.tsx │ │ └── legal │ │ │ ├── privacy-policy.md │ │ │ └── terms.md │ ├── states │ │ ├── package_manager.ts │ │ └── sdk.ts │ └── theme │ │ ├── DocItem │ │ └── Paginator │ │ │ ├── index.js │ │ │ └── styles.module.scss │ │ └── Root.js │ ├── static │ ├── .nojekyll │ ├── icons │ │ ├── bring-your-own-components.svg │ │ ├── commercial-support.svg │ │ ├── compose-api-blocks.svg │ │ ├── design-discover.svg │ │ ├── iterate-quickly.svg │ │ └── secure-by-default.svg │ ├── images │ │ ├── blog │ │ │ └── execution-flow-paradigms │ │ │ │ ├── durable-exec.svg │ │ │ │ ├── eda.png │ │ │ │ ├── saga-overview.png │ │ │ │ ├── saga-pattern-order-delivery.png │ │ │ │ ├── start-workflow-result.png │ │ │ │ └── temporal-web-ui.png │ │ ├── castles │ │ │ ├── building.png │ │ │ ├── modulable.png │ │ │ ├── reusable.png │ │ │ └── stable.png │ │ ├── demo-thumbnail.png │ │ ├── favicon.ico │ │ ├── homepage │ │ │ ├── devhunt_tab_dark.svg │ │ │ ├── devhunt_tab_dark_orange.svg │ │ │ ├── devhunt_tab_orange.svg │ │ │ ├── devhunt_tab_solid.svg │ │ │ └── tab_grey.svg │ │ ├── logo-bg.svg │ │ ├── logo.png │ │ ├── logo.svg │ │ ├── runtimes │ │ │ ├── deno.svg │ │ │ ├── google-apis-explorer.svg │ │ │ ├── graphql.svg │ │ │ ├── grpc.svg │ │ │ ├── http.svg │ │ │ ├── mariadb.svg │ │ │ ├── mongodb.svg │ │ │ ├── postgresql.svg │ │ │ ├── python.svg │ │ │ ├── s3.svg │ │ │ ├── sqlite.svg │ │ │ ├── temporal.svg │ │ │ └── wasmedge.svg │ │ ├── slack.png │ │ ├── system_setup.drawio.svg │ │ ├── tutorial │ │ │ ├── query-result.png │ │ │ ├── running-typegate.png │ │ │ └── tg-on-typegate.png │ │ └── wasi_vfs_python_and_rust.svg │ └── installer.sh │ ├── tailwind.config.js │ ├── tsconfig.json │ ├── use-cases │ ├── automatic-crud-validation │ │ ├── image.drawio.svg │ │ └── index.mdx │ ├── backend-for-frontend │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.graphql │ ├── faas-runner │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.gql │ ├── graphql-server │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.gql │ ├── iam-provider │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.gql │ ├── microservice-orchestration │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.gql │ ├── orm-for-the-edge │ │ ├── image.drawio.svg │ │ └── index.mdx │ ├── prisma.graphql │ ├── programmable-api-gateway │ │ ├── image.drawio.svg │ │ ├── index.mdx │ │ └── query.gql │ └── sidebars.js │ └── vale │ └── config │ └── vocabularies │ └── Metatype │ ├── accept.txt │ └── reject.txt ├── examples ├── demo │ ├── demo.py │ ├── metatype.yml │ ├── overview.drawio.svg │ └── prisma │ │ └── migrations │ │ └── public-api │ │ └── demo │ │ ├── 20230407213631_init │ │ └── migration.sql │ │ └── migration_lock.toml ├── deno.jsonc ├── deno.lock ├── deploy │ ├── .tgignore │ ├── deploy.py │ ├── deploy.ts │ ├── package.json │ ├── pnpm-lock.yaml │ └── scripts │ │ ├── deno │ │ ├── import.ts │ │ └── say_hello.ts │ │ └── python │ │ ├── import_.py │ │ └── say_hello.py ├── metatype.yaml ├── migrations │ ├── blog │ │ └── blog │ │ │ ├── 20230801223103_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── business-logic │ │ └── database │ │ │ ├── 20230407170041_init │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── database │ │ └── database │ │ │ ├── 20230407165539_init │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── fcm │ │ └── database │ │ │ ├── 20230407170028_init │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── func-gql │ │ └── db │ │ │ ├── 20240604132537_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── graphql │ │ └── database │ │ │ ├── 20230407170016_init │ │ │ └── migration.sql │ │ │ ├── 20230529111022_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── homepage │ │ └── demo │ │ │ ├── 20230204231405_init │ │ │ └── migration.sql │ │ │ ├── 20230204231612_change │ │ │ └── migration.sql │ │ │ ├── 20230801190752_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── orm-for-the-edge │ │ └── legacy │ │ │ ├── 20230407165628_init │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma-runtime │ │ └── legacy │ │ │ ├── 20230415233128_init │ │ │ └── migration.sql │ │ │ ├── 20230801221728_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── quick-start-project │ │ └── database │ │ │ ├── 20240604130842_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── roadmap-execute │ │ └── db │ │ │ ├── 20231115102057_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── roadmap-func │ │ └── db │ │ │ ├── 20231115133338_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── roadmap-policies │ │ └── db │ │ │ ├── 20231115102130_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── roadmap-prisma │ │ └── db │ │ │ ├── 20231115102159_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── roadmap-reduce │ │ └── db │ │ │ ├── 20231115102319_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ └── roadmap-rest │ │ └── db │ │ ├── 20231115110552_generated │ │ └── migration.sql │ │ └── migration_lock.toml ├── templates │ ├── deno │ │ ├── .graphqlrc.yaml │ │ ├── api │ │ │ └── example.ts │ │ ├── compose.yml │ │ └── metatype.yaml │ ├── node │ │ ├── .graphqlrc.yaml │ │ ├── api │ │ │ └── example.ts │ │ ├── compose.yml │ │ ├── metatype.yaml │ │ ├── package.json │ │ └── tsconfig.json │ └── python │ │ ├── .graphqlrc.yaml │ │ ├── api │ │ └── example.py │ │ ├── compose.yml │ │ ├── metatype.yaml │ │ └── pyproject.toml └── typegraphs │ ├── authentication.py │ ├── authentication.ts │ ├── backend-for-frontend.py │ ├── backend-for-frontend.ts │ ├── basic.py │ ├── basic.ts │ ├── cors.py │ ├── cors.ts │ ├── database.py │ ├── database.ts │ ├── deno-import.py │ ├── deno-import.ts │ ├── deno.py │ ├── deno.ts │ ├── docs.py │ ├── example_rest.py │ ├── example_rest.ts │ ├── execute.py │ ├── execute.ts │ ├── faas-runner.py │ ├── faas-runner.ts │ ├── files-upload.py │ ├── files-upload.ts │ ├── first-typegraph.py │ ├── first-typegraph.ts │ ├── func-ctx.py │ ├── func-ctx.ts │ ├── func-gql.py │ ├── func-gql.ts │ ├── func.py │ ├── func.ts │ ├── functions.py │ ├── graphql-server.py │ ├── graphql-server.ts │ ├── graphql.py │ ├── graphql.ts │ ├── grpc.py │ ├── grpc.ts │ ├── http-runtime.py │ ├── http-runtime.ts │ ├── iam-provider.py │ ├── iam-provider.ts │ ├── index.py │ ├── index.ts │ ├── injections.py │ ├── injections.ts │ ├── jwt.py │ ├── jwt.ts │ ├── kv.py │ ├── kv.ts │ ├── math.py │ ├── math.ts │ ├── metagen-deno.py │ ├── metagen-deno.ts │ ├── metagen-py.py │ ├── metagen-py.ts │ ├── metagen-rs.py │ ├── metagen-rs.ts │ ├── metagen-sdk.py │ ├── metagen-sdk.ts │ ├── metagen │ ├── py │ │ ├── fdk.py │ │ └── remix.py │ ├── rs │ │ ├── Cargo.toml │ │ ├── build.sh │ │ ├── fdk.rs │ │ └── lib.rs │ └── ts │ │ ├── fdk.ts │ │ └── remix.ts │ ├── microservice-orchestration.py │ ├── microservice-orchestration.ts │ ├── oauth2.py │ ├── oauth2.ts │ ├── policies-example.py │ ├── policies.py │ ├── policies.ts │ ├── prisma-no-sugar.py.disabled │ ├── prisma-runtime.py │ ├── prisma-runtime.ts │ ├── prisma.py │ ├── prisma.ts │ ├── programmable-api-gateway.py │ ├── programmable-api-gateway.ts │ ├── proto │ └── helloworld.proto │ ├── python.py │ ├── python.ts │ ├── quick-start-project.py │ ├── quick-start-project.ts │ ├── random-field.py │ ├── random-field.ts │ ├── rate.py │ ├── rate.ts │ ├── reduce.py │ ├── reduce.ts │ ├── rest.py │ ├── rest.ts │ ├── roadmap-policies.py │ ├── roadmap-policies.ts │ ├── roadmap-random.py │ ├── roadmap-random.ts │ ├── runtimes.py │ ├── scripts │ ├── createVote.ts │ ├── deps.py │ ├── deps.ts │ ├── fib.ts │ ├── hello.py │ ├── md2html.ts │ └── ops.ts │ ├── temporal.py │ ├── temporal.ts │ ├── triggers.py │ ├── triggers.ts │ ├── typecheck.py │ ├── types.py │ ├── union-either.py │ └── union-either.ts ├── ghjk.ts ├── import_map.json ├── poetry.lock ├── pyproject.toml ├── rust-toolchain.toml ├── rustfmt.toml ├── src ├── meta-cli │ ├── Cargo.toml │ ├── build.rs │ ├── src │ │ ├── cli │ │ │ ├── completion.rs │ │ │ ├── deploy.rs │ │ │ ├── dev.rs │ │ │ ├── doctor.rs │ │ │ ├── fdk_template.rs │ │ │ ├── gen.rs │ │ │ ├── list.rs │ │ │ ├── mod.rs │ │ │ ├── new.rs │ │ │ ├── serialize.rs │ │ │ ├── typegate.rs │ │ │ ├── ui │ │ │ │ └── mod.rs │ │ │ ├── undeploy.rs │ │ │ └── upgrade.rs │ │ ├── config.rs │ │ ├── deploy │ │ │ ├── actor-model.drawio.svg │ │ │ ├── actors │ │ │ │ ├── console.rs │ │ │ │ ├── console │ │ │ │ │ └── input.rs │ │ │ │ ├── discovery.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── push_manager │ │ │ │ │ └── state.rs │ │ │ │ ├── task.rs │ │ │ │ ├── task │ │ │ │ │ ├── action.rs │ │ │ │ │ ├── command.rs │ │ │ │ │ ├── command │ │ │ │ │ │ ├── python.rs │ │ │ │ │ │ └── typescript.rs │ │ │ │ │ ├── deploy.rs │ │ │ │ │ ├── deploy │ │ │ │ │ │ ├── artifacts.rs │ │ │ │ │ │ └── migrations.rs │ │ │ │ │ ├── list.rs │ │ │ │ │ └── serialize.rs │ │ │ │ ├── task_io.rs │ │ │ │ ├── task_manager.rs │ │ │ │ ├── task_manager │ │ │ │ │ ├── report.rs │ │ │ │ │ └── signal_handler.rs │ │ │ │ ├── typegate.rs │ │ │ │ └── watcher.rs │ │ │ ├── mod.rs │ │ │ └── push │ │ │ │ ├── mod.rs │ │ │ │ └── pusher.rs │ │ ├── fs.rs │ │ ├── global_config.rs │ │ ├── logger.rs │ │ ├── macros.rs │ │ ├── main.rs │ │ ├── secrets.rs │ │ ├── tests │ │ │ ├── mod.rs │ │ │ └── utils.rs │ │ ├── typegraph │ │ │ ├── dependency_graph.rs │ │ │ ├── loader │ │ │ │ ├── discovery.rs │ │ │ │ └── mod.rs │ │ │ ├── mod.rs │ │ │ └── rpc │ │ │ │ ├── aws.rs │ │ │ │ ├── core.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── runtimes.rs │ │ │ │ └── utils.rs │ │ └── utils │ │ │ ├── clap.rs │ │ │ ├── mod.rs │ │ │ └── shell_words.rs │ └── tests │ │ ├── graphs │ │ └── nested │ │ │ └── graph0.py │ │ └── metatype.yml ├── metagen-client-rs │ ├── Cargo.toml │ └── src │ │ ├── args.rs │ │ ├── common.rs │ │ ├── files.rs │ │ ├── graphql.rs │ │ ├── hostcall.rs │ │ ├── lib.rs │ │ ├── nodes.rs │ │ └── selection.rs ├── metagen │ ├── Cargo.toml │ ├── fixtures │ │ ├── client_rs │ │ │ ├── Cargo.lock │ │ │ └── main.rs │ │ ├── client_ts │ │ │ ├── deno.json │ │ │ └── main.ts │ │ ├── mat_rust │ │ │ └── lib.rs │ │ ├── placeholder │ │ ├── tg.ts │ │ └── tg2.ts │ ├── metatype.yaml │ └── src │ │ ├── client_py │ │ ├── mod.rs │ │ ├── node_metas.rs │ │ ├── selections.rs │ │ ├── static │ │ │ └── client.py │ │ └── utils.rs │ │ ├── client_rs │ │ ├── mod.rs │ │ ├── node_metas.rs │ │ ├── selections.rs │ │ └── static │ │ │ └── client.rs │ │ ├── client_ts │ │ ├── mod.rs │ │ ├── node_metas.rs │ │ ├── selections.rs │ │ └── static │ │ │ └── mod.ts │ │ ├── config.rs │ │ ├── fdk_py │ │ ├── mod.rs │ │ ├── static │ │ │ └── fdk.py │ │ └── types.rs │ │ ├── fdk_rs │ │ ├── mod.rs │ │ ├── static │ │ │ ├── Cargo.toml │ │ │ ├── fdk.rs │ │ │ └── lib.rs │ │ ├── stubs.rs │ │ ├── types.rs │ │ └── utils.rs │ │ ├── fdk_substantial │ │ ├── mod.rs │ │ └── static │ │ │ ├── substantial.py │ │ │ ├── types.py │ │ │ └── workflow.py │ │ ├── fdk_ts │ │ ├── mod.rs │ │ ├── static │ │ │ └── fdk.ts │ │ ├── types.rs │ │ └── utils.rs │ │ ├── lib.rs │ │ ├── macros.rs │ │ ├── shared │ │ ├── client.rs │ │ ├── files.rs │ │ ├── manifest.rs │ │ ├── mod.rs │ │ ├── node_metas.rs │ │ └── types.rs │ │ ├── tests │ │ ├── fixtures.rs │ │ └── mod.rs │ │ └── utils.rs ├── mt_deno │ ├── Cargo.toml │ └── src │ │ └── lib.rs ├── pyrt_wit_wire │ ├── main.py │ └── pyproject.toml ├── substantial │ ├── Cargo.toml │ ├── protocol │ │ ├── events.proto │ │ └── metadata.proto │ ├── src │ │ ├── backends │ │ │ ├── fs.rs │ │ │ ├── key_value.rs │ │ │ ├── memory.rs │ │ │ ├── mod.rs │ │ │ └── redis.rs │ │ ├── converters.rs │ │ ├── lib.rs │ │ └── protocol │ │ │ ├── events.rs │ │ │ ├── metadata.rs │ │ │ └── mod.rs │ └── tests │ │ └── mod.rs ├── typegate │ ├── deno.jsonc │ ├── engine │ │ ├── 00_runtime.js │ │ ├── Cargo.toml │ │ ├── bindings.ts │ │ ├── build.rs │ │ ├── runtime.d.ts │ │ ├── runtime.js │ │ └── src │ │ │ ├── ext.rs │ │ │ ├── lib.rs │ │ │ ├── py_validation.rs │ │ │ ├── runtimes.rs │ │ │ ├── runtimes │ │ │ ├── grpc.rs │ │ │ ├── prisma.rs │ │ │ ├── prisma │ │ │ │ ├── engine.rs │ │ │ │ ├── engine_import.rs │ │ │ │ ├── migration.rs │ │ │ │ └── utils.rs │ │ │ ├── substantial.rs │ │ │ ├── temporal.rs │ │ │ ├── wasm.rs │ │ │ ├── wasm │ │ │ │ └── conversion.rs │ │ │ └── wit_wire.rs │ │ │ └── typegraph.rs │ ├── src │ │ ├── config.ts │ │ ├── config │ │ │ ├── loader.ts │ │ │ ├── shared.ts │ │ │ └── types.ts │ │ ├── crypto.ts │ │ ├── engine │ │ │ ├── computation_engine.ts │ │ │ ├── injection │ │ │ │ └── dynamic.ts │ │ │ ├── planner │ │ │ │ ├── args.ts │ │ │ │ ├── dependency_resolver.ts │ │ │ │ ├── injection_utils.ts │ │ │ │ ├── mod.ts │ │ │ │ ├── parameter_transformer.ts │ │ │ │ └── policies.ts │ │ │ ├── query_engine.ts │ │ │ ├── stage_id.ts │ │ │ └── typecheck │ │ │ │ ├── code_generator.ts │ │ │ │ ├── common.ts │ │ │ │ ├── inline_validators │ │ │ │ ├── boolean.ts │ │ │ │ ├── common.ts │ │ │ │ ├── constraints.ts │ │ │ │ ├── file.ts │ │ │ │ ├── list.ts │ │ │ │ ├── mod.ts │ │ │ │ ├── number.ts │ │ │ │ ├── object.ts │ │ │ │ └── string.ts │ │ │ │ ├── input.ts │ │ │ │ ├── matching_variant.ts │ │ │ │ └── result.ts │ │ ├── errors.ts │ │ ├── libs │ │ │ └── jsonpath.ts │ │ ├── log.ts │ │ ├── main.ts │ │ ├── runtimes │ │ │ ├── Runtime.ts │ │ │ ├── deno.ts │ │ │ ├── deno │ │ │ │ ├── deno.ts │ │ │ │ ├── hooks │ │ │ │ │ ├── mod.ts │ │ │ │ │ └── worker.ts │ │ │ │ ├── shared_types.ts │ │ │ │ ├── types.ts │ │ │ │ ├── worker.ts │ │ │ │ └── worker_manager.ts │ │ │ ├── graphql.ts │ │ │ ├── grpc.ts │ │ │ ├── http.ts │ │ │ ├── kv.ts │ │ │ ├── mod.ts │ │ │ ├── patterns │ │ │ │ └── worker_manager │ │ │ │ │ ├── deno.ts │ │ │ │ │ ├── mod.ts │ │ │ │ │ ├── pooling.ts │ │ │ │ │ ├── types.ts │ │ │ │ │ └── wasm.ts │ │ │ ├── prisma.ts │ │ │ ├── prisma │ │ │ │ ├── hooks │ │ │ │ │ ├── generate_schema.ts │ │ │ │ │ ├── mod.ts │ │ │ │ │ └── run_migrations.ts │ │ │ │ ├── migration.ts │ │ │ │ ├── mod.ts │ │ │ │ ├── prisma.ts │ │ │ │ └── types.ts │ │ │ ├── python.ts │ │ │ ├── python │ │ │ │ └── hooks │ │ │ │ │ └── mod.ts │ │ │ ├── random.ts │ │ │ ├── s3.ts │ │ │ ├── substantial.ts │ │ │ ├── substantial │ │ │ │ ├── agent.ts │ │ │ │ ├── deno_context.ts │ │ │ │ ├── filter_utils.ts │ │ │ │ ├── types.ts │ │ │ │ ├── worker.ts │ │ │ │ └── workflow_worker_manager.ts │ │ │ ├── temporal.ts │ │ │ ├── typegate.ts │ │ │ ├── typegraph.ts │ │ │ ├── typegraph │ │ │ │ ├── helpers.ts │ │ │ │ ├── type_emitter.ts │ │ │ │ └── visibility.ts │ │ │ ├── utils │ │ │ │ ├── deno.ts │ │ │ │ ├── graphql_forward_vars.ts │ │ │ │ ├── graphql_inline_vars.ts │ │ │ │ └── http.ts │ │ │ ├── wasm │ │ │ │ ├── types.ts │ │ │ │ ├── worker.ts │ │ │ │ └── worker_manager.ts │ │ │ ├── wasm_reflected.ts │ │ │ ├── wasm_wire.ts │ │ │ └── wit_wire │ │ │ │ ├── hostcall.ts │ │ │ │ └── mod.ts │ │ ├── services │ │ │ ├── artifact_service.ts │ │ │ ├── auth │ │ │ │ ├── cookies.ts │ │ │ │ ├── mod.ts │ │ │ │ ├── protocols │ │ │ │ │ ├── basic.ts │ │ │ │ │ ├── internal.ts │ │ │ │ │ ├── jwt.ts │ │ │ │ │ ├── oauth2.ts │ │ │ │ │ └── protocol.ts │ │ │ │ └── routes │ │ │ │ │ ├── mod.ts │ │ │ │ │ ├── take.ts │ │ │ │ │ └── validate.ts │ │ │ ├── graphql_service.ts │ │ │ ├── info_service.ts │ │ │ ├── middlewares.ts │ │ │ ├── playground_service.ts │ │ │ ├── responses.ts │ │ │ └── rest_service.ts │ │ ├── sync │ │ │ ├── mod.ts │ │ │ ├── replicated_map.ts │ │ │ └── typegraph.ts │ │ ├── system_typegraphs.ts │ │ ├── transports │ │ │ ├── graphql │ │ │ │ ├── gq.ts │ │ │ │ ├── graphql.ts │ │ │ │ ├── request_parser.ts │ │ │ │ ├── typegraph.ts │ │ │ │ └── utils.ts │ │ │ └── rest │ │ │ │ └── rest_schema_generator.ts │ │ ├── typegate │ │ │ ├── artifacts │ │ │ │ ├── local.ts │ │ │ │ ├── mod.ts │ │ │ │ └── shared.ts │ │ │ ├── hooks.ts │ │ │ ├── memory_register.ts │ │ │ ├── mod.ts │ │ │ ├── no_limiter.ts │ │ │ ├── rate_limiter.ts │ │ │ └── register.ts │ │ ├── typegraph │ │ │ ├── mod.ts │ │ │ ├── type_node.ts │ │ │ ├── types.ts │ │ │ ├── utils.ts │ │ │ ├── versions.ts │ │ │ └── visitor.ts │ │ ├── typegraphs │ │ │ ├── introspection.json │ │ │ ├── introspection.py │ │ │ ├── prisma_migration.json │ │ │ ├── prisma_migration.py │ │ │ ├── typegate.json │ │ │ └── typegate.py │ │ ├── types.ts │ │ ├── utils.ts │ │ ├── utils │ │ │ └── hash.ts │ │ └── worker_utils.ts │ └── standalone │ │ ├── Cargo.toml │ │ └── src │ │ ├── config.rs │ │ ├── logger.rs │ │ └── main.rs ├── typegate_api │ ├── Cargo.toml │ └── src │ │ ├── graphql.rs │ │ ├── lib.rs │ │ └── node.rs ├── typegraph │ ├── core │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── conversion │ │ │ ├── hash.rs │ │ │ ├── mod.rs │ │ │ ├── parameter_transform.rs │ │ │ ├── params.rs │ │ │ ├── policies.rs │ │ │ ├── runtimes.rs │ │ │ └── types.rs │ │ │ ├── errors.rs │ │ │ ├── global_store.rs │ │ │ ├── lib.rs │ │ │ ├── params │ │ │ ├── apply.rs │ │ │ └── mod.rs │ │ │ ├── runtimes │ │ │ ├── aws │ │ │ │ └── mod.rs │ │ │ ├── deno.rs │ │ │ ├── graphql.rs │ │ │ ├── grpc │ │ │ │ ├── mod.rs │ │ │ │ └── type_generation.rs │ │ │ ├── mod.rs │ │ │ ├── prisma │ │ │ │ ├── constraints.rs │ │ │ │ ├── context.rs │ │ │ │ ├── errors.rs │ │ │ │ ├── migration.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── model.rs │ │ │ │ ├── relationship │ │ │ │ │ ├── discovery.rs │ │ │ │ │ └── mod.rs │ │ │ │ ├── type_generation │ │ │ │ │ ├── additional_filters.rs │ │ │ │ │ ├── aggregate.rs │ │ │ │ │ ├── count.rs │ │ │ │ │ ├── filters.rs │ │ │ │ │ ├── group_by.rs │ │ │ │ │ ├── input_type.rs │ │ │ │ │ ├── mod.rs │ │ │ │ │ ├── order_by.rs │ │ │ │ │ ├── out_type.rs │ │ │ │ │ ├── query_input_type.rs │ │ │ │ │ ├── query_where_expr.rs │ │ │ │ │ ├── snapshots │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__query_unique_where_expr__test__query_unique_where_expr user.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__query_where_expr__tests__Post__QueryWhereExpr.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__query_where_expr__tests__User__QueryWhereExpr.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__aggregate Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__aggregate Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__aggregate User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_many User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_one Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_one Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__create_one User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_first Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_first Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_first User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_many User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__find_unique User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by Post out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by Record out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__group_by User out.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_many Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_many Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_many User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_one Post inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_one Record inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__test__update_one User inp.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__where___test__where Post.snap │ │ │ │ │ │ ├── typegraph_core__runtimes__prisma__type_generation__where___test__where Record.snap │ │ │ │ │ │ └── typegraph_core__runtimes__prisma__type_generation__where___test__where User.snap │ │ │ │ │ ├── where_.rs │ │ │ │ │ └── with_nested_count.rs │ │ │ │ └── type_utils.rs │ │ │ ├── python.rs │ │ │ ├── random.rs │ │ │ ├── substantial │ │ │ │ ├── mod.rs │ │ │ │ └── type_utils.rs │ │ │ ├── temporal.rs │ │ │ ├── typegate.rs │ │ │ ├── typegraph.rs │ │ │ └── wasm.rs │ │ │ ├── snapshots │ │ │ └── typegraph_core__tests__successful_serialization.snap │ │ │ ├── t.rs │ │ │ ├── test_utils.rs │ │ │ ├── typedef │ │ │ ├── boolean.rs │ │ │ ├── either.rs │ │ │ ├── file.rs │ │ │ ├── float.rs │ │ │ ├── func.rs │ │ │ ├── integer.rs │ │ │ ├── list.rs │ │ │ ├── mod.rs │ │ │ ├── optional.rs │ │ │ ├── string.rs │ │ │ ├── struct_.rs │ │ │ └── union.rs │ │ │ ├── typegraph.rs │ │ │ ├── types │ │ │ ├── mod.rs │ │ │ ├── sdk │ │ │ │ ├── aws.rs │ │ │ │ ├── core.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── runtimes.rs │ │ │ │ └── utils.rs │ │ │ ├── type_def.rs │ │ │ ├── type_id.rs │ │ │ ├── type_ref.rs │ │ │ └── type_ref │ │ │ │ ├── as_id.rs │ │ │ │ ├── injection.rs │ │ │ │ ├── policy.rs │ │ │ │ ├── runtime_config.rs │ │ │ │ └── xdef.rs │ │ │ ├── utils │ │ │ ├── archive.rs │ │ │ ├── artifacts.rs │ │ │ ├── fs.rs │ │ │ ├── metagen_utils.rs │ │ │ ├── mod.rs │ │ │ ├── oauth2 │ │ │ │ ├── mod.rs │ │ │ │ └── std.rs │ │ │ ├── pathlib.rs │ │ │ └── postprocess │ │ │ │ ├── deno_rt.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── naming.rs │ │ │ │ ├── prisma_rt.rs │ │ │ │ ├── python_rt.rs │ │ │ │ ├── substantial_rt.rs │ │ │ │ ├── validation.rs │ │ │ │ └── wasm_rt.rs │ │ │ └── validation │ │ │ ├── errors.rs │ │ │ ├── materializers.rs │ │ │ ├── mod.rs │ │ │ └── types.rs │ ├── deno │ │ ├── LICENSE.md │ │ ├── deno.json │ │ └── src │ │ │ ├── deps │ │ │ ├── _import.ts │ │ │ └── mod.ts │ │ │ ├── effects.ts │ │ │ ├── envs │ │ │ └── cli.ts │ │ │ ├── index.ts │ │ │ ├── io.ts │ │ │ ├── metagen.ts │ │ │ ├── params.ts │ │ │ ├── policy.ts │ │ │ ├── providers │ │ │ ├── aws.ts │ │ │ ├── prisma.ts │ │ │ └── temporal.ts │ │ │ ├── runtimes │ │ │ ├── deno.ts │ │ │ ├── graphql.ts │ │ │ ├── grpc.ts │ │ │ ├── http.ts │ │ │ ├── kv.ts │ │ │ ├── mod.ts │ │ │ ├── python.ts │ │ │ ├── random.ts │ │ │ ├── substantial.ts │ │ │ └── wasm.ts │ │ │ ├── sdk.ts │ │ │ ├── tg_artifact_upload.ts │ │ │ ├── tg_deploy.ts │ │ │ ├── tg_manage.ts │ │ │ ├── typegraph.ts │ │ │ ├── types.ts │ │ │ └── utils │ │ │ ├── func_utils.ts │ │ │ ├── injection_utils.ts │ │ │ ├── module.ts │ │ │ └── type_utils.ts │ ├── graph │ │ ├── Cargo.toml │ │ ├── src │ │ │ ├── engines │ │ │ │ ├── duplication.rs │ │ │ │ ├── mod.rs │ │ │ │ └── naming.rs │ │ │ ├── expansion │ │ │ │ ├── map.rs │ │ │ │ ├── mod.rs │ │ │ │ └── step.rs │ │ │ ├── injection.rs │ │ │ ├── key.rs │ │ │ ├── lib.rs │ │ │ ├── path.rs │ │ │ ├── policies.rs │ │ │ ├── runtimes.rs │ │ │ ├── type_registry.rs │ │ │ ├── types │ │ │ │ ├── boolean.rs │ │ │ │ ├── file.rs │ │ │ │ ├── float.rs │ │ │ │ ├── function.rs │ │ │ │ ├── integer.rs │ │ │ │ ├── list.rs │ │ │ │ ├── mod.rs │ │ │ │ ├── object.rs │ │ │ │ ├── optional.rs │ │ │ │ ├── string.rs │ │ │ │ └── union.rs │ │ │ └── visitor.rs │ │ └── tests │ │ │ ├── expanded.rs │ │ │ └── snapshots │ │ │ ├── expanded__expanded_graph-2.snap │ │ │ ├── expanded__expanded_graph-3.snap │ │ │ ├── expanded__expanded_graph-4.snap │ │ │ └── expanded__expanded_graph.snap │ ├── python │ │ ├── LICENSE.md │ │ ├── poetry.lock │ │ ├── pyproject.toml │ │ └── typegraph │ │ │ ├── __init__.py │ │ │ ├── deploy │ │ │ └── request.py │ │ │ ├── effects.py │ │ │ ├── envs │ │ │ └── cli.py │ │ │ ├── g.py │ │ │ ├── graph │ │ │ ├── metagen.py │ │ │ ├── params.py │ │ │ ├── shared_types.py │ │ │ ├── tg_artifact_upload.py │ │ │ ├── tg_deploy.py │ │ │ ├── tg_manage.py │ │ │ └── typegraph.py │ │ │ ├── injection.py │ │ │ ├── io.py │ │ │ ├── policy.py │ │ │ ├── providers │ │ │ ├── __init__.py │ │ │ ├── aws.py │ │ │ ├── prisma.py │ │ │ └── temporal.py │ │ │ ├── runtimes │ │ │ ├── __init__.py │ │ │ ├── base.py │ │ │ ├── deno.py │ │ │ ├── graphql.py │ │ │ ├── grpc.py │ │ │ ├── http.py │ │ │ ├── kv.py │ │ │ ├── python.py │ │ │ ├── random.py │ │ │ ├── substantial.py │ │ │ └── wasm.py │ │ │ ├── sdk.py │ │ │ ├── t.py │ │ │ └── utils.py │ ├── schema │ │ ├── Cargo.toml │ │ └── src │ │ │ ├── lib.rs │ │ │ ├── parameter_transform.rs │ │ │ ├── runtimes │ │ │ ├── deno.rs │ │ │ ├── graphql.rs │ │ │ ├── grpc.rs │ │ │ ├── http.rs │ │ │ ├── kv.rs │ │ │ ├── mod.rs │ │ │ ├── prisma.rs │ │ │ ├── python.rs │ │ │ ├── random.rs │ │ │ ├── s3.rs │ │ │ ├── substantial.rs │ │ │ ├── temporal.rs │ │ │ └── wasm.rs │ │ │ ├── types.rs │ │ │ ├── utils.rs │ │ │ ├── validator │ │ │ ├── common.rs │ │ │ ├── injection.rs │ │ │ ├── input.rs │ │ │ ├── mod.rs │ │ │ ├── types.rs │ │ │ └── value.rs │ │ │ ├── visitor.rs │ │ │ └── visitor2.rs │ └── specs │ │ ├── .gitignore │ │ ├── codegen │ │ ├── deno.jsonc │ │ ├── rpc │ │ │ ├── python │ │ │ │ ├── __init__.py │ │ │ │ ├── client.py │ │ │ │ └── client_mock.py │ │ │ ├── tests │ │ │ │ ├── client.test.ts │ │ │ │ └── utils.ts │ │ │ └── typescript │ │ │ │ ├── client.ts │ │ │ │ └── client_mock.ts │ │ ├── src │ │ │ ├── cmd │ │ │ │ ├── main.ts │ │ │ │ └── utils.ts │ │ │ └── lib │ │ │ │ ├── base.ts │ │ │ │ ├── python.ts │ │ │ │ ├── rust_lib.ts │ │ │ │ ├── rust_rpc.ts │ │ │ │ ├── treesitter.ts │ │ │ │ └── typescript.ts │ │ ├── tests │ │ │ ├── python.test.ts │ │ │ ├── rust_lib.test.ts │ │ │ ├── treesitter.test.ts │ │ │ ├── typescript.test.ts │ │ │ └── utils.ts │ │ └── tg-codegen │ │ └── types │ │ ├── aws.d.ts │ │ ├── core.d.ts │ │ ├── primitives.d.ts │ │ ├── runtimes.d.ts │ │ └── utils.d.ts ├── utils │ ├── archive │ │ ├── Cargo.toml │ │ └── src │ │ │ └── lib.rs │ └── grpc │ │ ├── Cargo.toml │ │ └── src │ │ └── lib.rs ├── wit │ ├── deps.lock │ ├── deps.toml │ ├── deps │ │ ├── cli │ │ │ ├── command.wit │ │ │ ├── environment.wit │ │ │ ├── exit.wit │ │ │ ├── imports.wit │ │ │ ├── run.wit │ │ │ ├── stdio.wit │ │ │ └── terminal.wit │ │ ├── clocks │ │ │ ├── monotonic-clock.wit │ │ │ ├── wall-clock.wit │ │ │ └── world.wit │ │ ├── filesystem │ │ │ ├── preopens.wit │ │ │ ├── types.wit │ │ │ └── world.wit │ │ ├── io │ │ │ ├── error.wit │ │ │ ├── poll.wit │ │ │ ├── streams.wit │ │ │ └── world.wit │ │ ├── random │ │ │ ├── insecure-seed.wit │ │ │ ├── insecure.wit │ │ │ ├── random.wit │ │ │ └── world.wit │ │ └── sockets │ │ │ ├── instance-network.wit │ │ │ ├── ip-name-lookup.wit │ │ │ ├── network.wit │ │ │ ├── tcp-create-socket.wit │ │ │ ├── tcp.wit │ │ │ ├── udp-create-socket.wit │ │ │ ├── udp.wit │ │ │ └── world.wit │ └── wit-wire.wit └── xtask │ ├── Cargo.toml │ └── src │ ├── deno.rs │ └── main.rs ├── tests ├── artifacts │ └── artifacts_test.ts ├── auth │ ├── auth.py │ └── auth_test.ts ├── auto │ ├── __snapshots__ │ │ └── auto_test.ts.snap │ ├── auto_test.ts_ │ └── test │ │ ├── test-1.graphql │ │ └── test.py ├── common_utils │ ├── proposition_test.ts │ └── url_test.ts ├── crypto │ └── crypto_test.ts ├── dedup │ ├── dedup_test.ts │ └── tg.ts ├── deno.jsonc ├── docs │ └── how-tos │ │ └── prog_deploy │ │ ├── prog_deploy.py │ │ ├── prog_deploy.ts │ │ ├── prog_deploy_test.ts │ │ ├── prog_remove.py │ │ ├── prog_remove.ts │ │ └── scripts │ │ └── say_hello.ts ├── e2e │ ├── cli │ │ ├── .gitignore │ │ ├── artifacts │ │ │ └── ops.ts │ │ ├── deploy_test.ts │ │ ├── dev_test.ts │ │ ├── select.sh │ │ ├── templates │ │ │ └── migration.py │ │ ├── typegraphs │ │ │ └── deps.ts │ │ ├── undeploy_test.ts │ │ └── watch_test.ts │ ├── nextjs │ │ ├── apollo │ │ │ ├── .eslintrc.json │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ │ ├── favicon.ico │ │ │ │ ├── layout.tsx │ │ │ │ └── page.tsx │ │ │ ├── next.config.js │ │ │ ├── package.json │ │ │ ├── pages │ │ │ │ └── api │ │ │ │ │ └── apollo.ts │ │ │ ├── pnpm-lock.yaml │ │ │ ├── postcss.config.js │ │ │ ├── public │ │ │ │ └── .keep │ │ │ ├── tailwind.config.ts │ │ │ └── tsconfig.json │ │ ├── apollo_test.ts │ │ └── typegraph │ │ │ └── apollo.py │ ├── published │ │ ├── common.ts │ │ ├── config.ts │ │ ├── sdk_test.ts │ │ ├── typegate_upgrade_test.ts │ │ └── utils.ts │ ├── self_deploy │ │ ├── scripts │ │ │ └── main.ts │ │ ├── self_deploy.ts │ │ ├── self_deploy_bad_cred_test.ts │ │ └── self_deploy_test.ts │ ├── templates │ │ └── templates_test.ts │ ├── typegraph │ │ ├── __snapshots__ │ │ │ ├── typegraph_test.ts.snap │ │ │ └── validator_test.ts.snap │ │ ├── typegraph_test.ts │ │ ├── typegraphs │ │ │ ├── deno │ │ │ │ ├── complex.ts │ │ │ │ ├── multiple_runtimes.ts │ │ │ │ ├── scripts │ │ │ │ │ └── three.ts │ │ │ │ └── simple.ts │ │ │ └── python │ │ │ │ ├── complex.py │ │ │ │ ├── multiple_runtimes.py │ │ │ │ ├── scripts │ │ │ │ └── three.ts │ │ │ │ └── simple.py │ │ ├── validator.py │ │ └── validator_test.ts │ └── website │ │ └── website_test.ts ├── graphql │ ├── graphql.py │ ├── graphql_test.ts │ └── request_parser_test.ts ├── http_utils │ └── http_utils_test.ts ├── importers │ ├── gql_original.py │ ├── importers_test.ts.disabled │ ├── introspection.json │ ├── introspection.py │ ├── openapi_original.py │ ├── openapi_schema.json │ └── openapi_schema.py ├── injection │ ├── injection.py │ ├── injection.ts │ ├── injection_test.ts │ ├── nested_context.py │ ├── outjection.py │ ├── outjection_test.ts │ ├── random_injection.py │ ├── random_injection.ts │ └── random_injection_test.ts ├── internal │ ├── internal.py │ ├── internal_test.ts │ ├── metatype.yaml │ ├── py │ │ ├── fdk.py │ │ └── logic.py │ └── ts │ │ └── logic.ts ├── introspection │ ├── __snapshots__ │ │ ├── introspection_test.ts.snap │ │ ├── union_either_test.ts.snap │ │ ├── visibility_complex_test.ts.snap │ │ └── visibility_simple_test.ts.snap │ ├── common.ts │ ├── introspection_test.ts │ ├── union_either.py │ ├── union_either_test.ts │ ├── visibility_complex.py │ ├── visibility_complex_test.ts │ ├── visibility_simple.py │ └── visibility_simple_test.ts ├── metagen │ ├── __snapshots__ │ │ └── metagen_test.ts.snap │ ├── metagen_test.ts │ └── typegraphs │ │ ├── fdk_py_templates │ │ └── struct.py.jinja │ │ ├── file_upload_sample.ts │ │ ├── identities.py │ │ ├── identities │ │ ├── metatype.yml │ │ ├── py │ │ │ ├── fdk.py │ │ │ └── handlers.py │ │ ├── rs │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── build.sh │ │ │ ├── fdk.rs │ │ │ └── lib.rs │ │ └── ts │ │ │ ├── deno.json │ │ │ ├── fdk.ts │ │ │ └── handlers.ts │ │ ├── metagen.py │ │ ├── metagen.ts │ │ ├── other.py │ │ ├── python.py │ │ ├── sample.ts │ │ ├── sample │ │ ├── metatype.yml │ │ ├── py │ │ │ ├── client.py │ │ │ └── main.py │ │ ├── py_upload │ │ │ ├── client.py │ │ │ └── main.py │ │ ├── rs │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── client.rs │ │ │ └── main.rs │ │ ├── rs_upload │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── client.rs │ │ │ ├── hello.txt │ │ │ └── main.rs │ │ ├── ts │ │ │ ├── client.ts │ │ │ └── main.ts │ │ └── ts_upload │ │ │ ├── client.ts │ │ │ └── main.ts │ │ └── scripts │ │ └── same_hit.py ├── metatype.yml ├── misc │ ├── publish_test.ts │ └── typegate_config_test.ts.disabled ├── multi_typegraph │ ├── multi_typegraph.py │ ├── multi_typegraph.ts │ └── multi_typegraph_test.ts ├── nesting │ ├── nesting.py │ └── nesting_test.ts ├── params │ ├── apply.py │ ├── apply_nested_context.py │ ├── apply_test.ts │ └── prisma_apply.py ├── patterns │ └── worker_manager │ │ └── pooling_test.ts ├── planner │ ├── __snapshots__ │ │ └── planner_test.ts.snap │ ├── default_args_test.ts │ ├── planner.py │ └── planner_test.ts ├── policies │ ├── effects_py.py │ ├── policies.py │ ├── policies_composition.py │ ├── policies_composition_test.ts │ ├── policies_jwt.py │ ├── policies_jwt_format.py │ ├── policies_jwt_injection.py │ ├── policies_jwt_test.ts │ ├── policies_test.ts │ └── ts │ │ ├── effects.ts │ │ └── policies.ts ├── prisma-migrations │ ├── full-prisma-mapping │ │ └── prisma │ │ │ ├── 20241112104505_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── injection │ │ └── prisma │ │ │ ├── 20250107042713_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── migration-failure-test-1 │ │ └── main │ │ │ ├── 20250206060734_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── migration-failure-test-dev │ │ └── main │ │ │ ├── 20250528082719_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── mixed-runtime │ │ └── prisma │ │ │ ├── 20241112104922_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── multi-relations │ │ └── prisma │ │ │ ├── 20241112105926_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── multiple-runtimes │ │ ├── db1 │ │ │ ├── 20241112105121_generated │ │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ │ └── db2 │ │ │ ├── 20241112105122_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── normal-1-1 │ │ └── prisma │ │ │ ├── 20241112105451_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── optional-1-1 │ │ └── prisma │ │ │ ├── 20241112105454_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── optional-1-n │ │ └── prisma │ │ │ ├── 20241112105933_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma-apply │ │ └── db │ │ │ ├── 20250107064505_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma-edgecases │ │ └── prisma │ │ │ ├── 20241112105704_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma │ │ └── prisma │ │ │ ├── 20250528083633_initial_migration_renamed │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma_normal │ │ └── prisma │ │ │ ├── 20241112105453_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── prisma_opt_1 │ │ └── prisma │ │ │ ├── 20241112105936_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ ├── type-alias │ │ └── prisma │ │ │ ├── 20250107044040_generated │ │ │ └── migration.sql │ │ │ └── migration_lock.toml │ └── typename │ │ └── prisma │ │ ├── 20250107044110_generated │ │ └── migration.sql │ │ └── migration_lock.toml ├── prisma_migrate │ └── prisma_migrate_test.ts ├── query_parsers │ ├── __snapshots__ │ │ └── query_parsers_test.ts.snap │ ├── graphql_namespaces.py │ └── query_parsers_test.ts ├── rate_limiter │ └── rate_limiter_test.ts ├── regression │ └── invalid_ref_error_message │ │ ├── invalid_ref.py │ │ └── invalid_ref_test.ts ├── rest │ ├── __snapshots__ │ │ └── rest_test.ts.snap │ ├── custom │ │ ├── custom_loader.ts │ │ ├── m.gql │ │ └── q.graphql │ ├── rest_custom_loader.ts │ ├── rest_schema.ts │ ├── rest_simple.py │ └── rest_test.ts ├── runtimes │ ├── deno │ │ ├── deno.py │ │ ├── deno_dep.py │ │ ├── deno_dep.ts │ │ ├── deno_dir.py │ │ ├── deno_dir.ts │ │ ├── deno_dir_test.ts │ │ ├── deno_duplicate_artifact.py │ │ ├── deno_duplicate_artifact.ts │ │ ├── deno_glob_test.ts │ │ ├── deno_globs.py │ │ ├── deno_globs.ts │ │ ├── deno_no_artifact.py │ │ ├── deno_partial.py │ │ ├── deno_reload.py │ │ ├── deno_sync_test.ts │ │ ├── deno_test.ts │ │ ├── deno_typescript.ts │ │ ├── dynamic │ │ │ ├── 1.ts │ │ │ └── 2.ts │ │ ├── inexisting_dep.py │ │ ├── reload │ │ │ └── template.ts │ │ └── ts │ │ │ ├── deno.ts │ │ │ ├── dep │ │ │ ├── main.ts │ │ │ └── nested │ │ │ │ └── dep.ts │ │ │ ├── math-npm.ts │ │ │ └── math.ts │ ├── graphql │ │ ├── __snapshots__ │ │ │ └── graphql_test.ts.snap │ │ ├── graphql_test.ts │ │ └── typegraphs │ │ │ ├── deno │ │ │ └── graphql.ts │ │ │ └── python │ │ │ └── graphql.py │ ├── grpc │ │ ├── __snapshots__ │ │ │ └── grpc_test.ts.snap │ │ ├── geography.py │ │ ├── grpc_test.ts │ │ ├── helloworld.py │ │ ├── helloworld.ts │ │ ├── maths.py │ │ └── proto │ │ │ ├── geography.proto │ │ │ ├── helloworld.proto │ │ │ └── maths.proto │ ├── http │ │ ├── http_content_type.py │ │ ├── http_content_type_test.ts │ │ ├── http_py.py │ │ └── http_test.ts │ ├── kv │ │ ├── __snapshots__ │ │ │ └── kv_test.ts.snap │ │ ├── kv.py │ │ ├── kv.ts │ │ └── kv_test.ts │ ├── prisma │ │ ├── full_prisma_mapping.py │ │ ├── full_prisma_mapping_test.ts │ │ ├── graphql_variables_test.ts │ │ ├── mixed_runtime.py │ │ ├── mixed_runtime_test.ts │ │ ├── multi_relations.py │ │ ├── multi_relations_test.ts │ │ ├── multiple_runtimes.py │ │ ├── multiple_runtimes_test.ts │ │ ├── normal_1_1.py │ │ ├── normal_1_1.ts │ │ ├── one_to_many_test.ts │ │ ├── one_to_one_test.ts │ │ ├── optional_1_1.py │ │ ├── optional_1_n.py │ │ ├── optional_1_n.ts │ │ ├── prisma.py │ │ ├── prisma_edgecases.py │ │ ├── prisma_edgecases_test.ts │ │ ├── prisma_test.ts │ │ ├── query_builder_test.ts │ │ ├── schema_generation.py │ │ ├── schema_generation_test.ts │ │ ├── type_duplication.ts │ │ └── type_duplication_test.ts │ ├── python │ │ ├── py │ │ │ ├── hello.py │ │ │ └── nested │ │ │ │ └── dep.py │ │ ├── py_fail │ │ │ ├── dep_fail.py │ │ │ └── hello_fail.py │ │ ├── python.py │ │ ├── python.ts │ │ ├── python_dir.py │ │ ├── python_dir.ts │ │ ├── python_dir_test.ts │ │ ├── python_duplicate_artifact.py │ │ ├── python_duplicate_artifact.ts │ │ ├── python_glob_test.ts │ │ ├── python_globs.py │ │ ├── python_globs.ts │ │ ├── python_no_artifact.py │ │ ├── python_no_artifact.ts │ │ ├── python_sync_test.ts │ │ ├── python_test.ts │ │ └── python_validation.py │ ├── random │ │ ├── random.ts │ │ ├── random_.py │ │ └── random_test.ts │ ├── s3 │ │ ├── __snapshots__ │ │ │ └── s3_test.ts.snap │ │ ├── s3.py │ │ ├── s3.ts │ │ └── s3_test.ts │ ├── substantial │ │ ├── common.ts │ │ ├── filter_utils_test.ts │ │ ├── imports │ │ │ └── common_types.ts │ │ ├── kv_like_test.ts │ │ ├── redis_test.ts │ │ ├── substantial.py │ │ ├── substantial_child_workflow.py │ │ ├── substantial_test.ts │ │ └── workflows │ │ │ ├── child_workflow.ts │ │ │ └── workflow.ts │ ├── temporal │ │ ├── __snapshots__ │ │ │ └── temporal_test.ts.snap │ │ ├── temporal.py │ │ ├── temporal.ts │ │ ├── temporal_test.ts │ │ └── worker │ │ │ ├── activities.ts │ │ │ ├── package.json │ │ │ ├── pnpm-lock.yaml │ │ │ ├── tsconfig.json │ │ │ ├── worker.ts │ │ │ └── workflows.ts │ ├── typegate │ │ ├── __snapshots__ │ │ │ ├── typegate_prisma_test.ts.snap │ │ │ └── typegate_runtime_test.ts.snap │ │ ├── typegate_prisma_test.ts │ │ └── typegate_runtime_test.ts │ ├── wasm_reflected │ │ ├── rust │ │ │ ├── Cargo.lock │ │ │ ├── Cargo.toml │ │ │ ├── build.sh │ │ │ ├── src │ │ │ │ └── lib.rs │ │ │ └── wit │ │ │ │ └── example.wit │ │ ├── wasm_duplicate.py │ │ ├── wasm_reflected.py │ │ ├── wasm_reflected.ts │ │ ├── wasm_reflected_test.ts │ │ └── wasm_sync_test.ts │ └── wasm_wire │ │ ├── rust │ │ ├── Cargo.toml │ │ ├── build.sh │ │ ├── fdk.rs │ │ └── lib.rs │ │ ├── wasm_duplicate.ts │ │ ├── wasm_sync_test.ts │ │ ├── wasm_wire.py │ │ ├── wasm_wire.ts │ │ └── wasm_wire_test.ts ├── schema_validation │ ├── __snapshots__ │ │ └── type_comparison_test.ts.snap │ ├── circular.py │ ├── circular_test.ts │ ├── ts │ │ └── circular.ts │ ├── type_comparison.py │ └── type_comparison_test.ts ├── simple │ ├── __snapshots__ │ │ └── class_syntax_test.ts.snap │ ├── class_syntax.py │ ├── class_syntax_test.ts │ ├── error_message.py │ ├── error_message_test.ts │ ├── simple.py │ └── simple_test.ts ├── sync │ ├── scripts │ │ ├── hello.ts │ │ └── workflow.ts │ ├── sync.py │ ├── sync_config_test.ts │ ├── sync_force_remove_test.ts │ └── typegraph_sync_test.ts.disable ├── tools │ └── schema_test.ts ├── type_nodes │ ├── __snapshots__ │ │ ├── array_of_optional_test.ts.snap │ │ ├── either_test.ts.snap │ │ └── union_test.ts.snap │ ├── array_of_optional.py │ ├── array_of_optional_test.ts │ ├── either_node.py │ ├── either_test.ts │ ├── ts │ │ ├── either │ │ │ └── user_register.ts │ │ └── union │ │ │ ├── color_converter.ts │ │ │ ├── phone_register.ts │ │ │ └── vec_normalizer.ts │ ├── union_node.py │ ├── union_node_attr.py │ ├── union_node_attr_test.ts │ ├── union_node_quantifier.py │ ├── union_node_quantifier_test.ts │ └── union_test.ts ├── typecheck │ ├── __snapshots__ │ │ ├── input_validator_test.ts.snap │ │ └── typecheck_test.ts.snap │ ├── input_validator_test.ts │ ├── reduce.ts │ ├── reduce_py.py │ ├── reduce_syntax_test.ts │ ├── type_alias.py │ ├── type_alias_test.ts │ ├── typecheck.py │ └── typecheck_test.ts ├── typegraph │ └── version_test.ts ├── typename │ ├── typename.py │ └── typename_test.ts ├── utils │ ├── assert.ts │ ├── autotest.ts │ ├── bindings_test.ts │ ├── database.ts │ ├── date.ts │ ├── dir.ts │ ├── file.ts │ ├── hooks.ts │ ├── meta.ts │ ├── migrations.ts │ ├── mock_fetch.ts │ ├── mod.ts │ ├── process.ts │ ├── query │ │ ├── file_extractor.ts │ │ ├── graphql_query.ts │ │ ├── mod.ts │ │ └── rest_query.ts │ ├── router@0.0.5.ts │ ├── s3.ts │ ├── shell.ts │ ├── single_register.ts │ ├── test.ts │ └── test_module.ts └── vars │ ├── vars.py │ └── vars_test.ts ├── tools ├── Cross.toml ├── Dockerfile ├── Dockerfile.dockerignore ├── LICENSE-MPL-2.0.md ├── cliff.toml ├── codecov.yml ├── compose │ ├── compose.adminer.yml │ ├── compose.base.yml │ ├── compose.elastic.yml │ ├── compose.grpc.yml │ ├── compose.imgproxy.yml │ ├── compose.prisma.yml │ ├── compose.subredis.yml │ ├── proto │ │ ├── geography.proto │ │ ├── helloworld.proto │ │ └── maths.proto │ └── stub │ │ ├── geography.json │ │ ├── helloworld.json │ │ ├── maths.is_prime.json │ │ └── maths.sum.json ├── consts.ts ├── cross.Dockerfile ├── deps.ts ├── envoy.yaml ├── installs.ts ├── jsr │ ├── common.ts │ ├── deno2node.ts │ └── jsr-gen.ts ├── license-header-MPL-2.0.txt ├── list-duplicates.ts ├── ruff.toml ├── schema │ └── metatype.json ├── tasks │ ├── build.ts │ ├── dev.ts │ ├── fetch.ts │ ├── gen.ts │ ├── install.ts │ ├── lint.ts │ ├── lock.ts │ ├── mod.ts │ └── test.ts ├── test.ts ├── tree-view-web.ts ├── tree-view.ts ├── tree-view │ └── index.html ├── typegraph-size.ts ├── update.ts ├── utils.ts └── verdaccio │ └── config.yaml └── whiz.yaml /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | x = "run --package xtask --" 3 | 4 | [profile.typegraph_core.release] 5 | opt-level = "z" 6 | lto = true 7 | -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- 1 | DEBUG=true 2 | REDIS_URL=redis://:password@localhost:6379/0 3 | TG_SECRET="a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw==" 4 | TG_ADMIN_PASSWORD=password 5 | -------------------------------------------------------------------------------- /.ghjk/.gitignore: -------------------------------------------------------------------------------- 1 | envs 2 | hash.json -------------------------------------------------------------------------------- /.ghjk/deno.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "imports": { 3 | "@ghjk/ts/": "https://raw.githubusercontent.com/metatypedev/ghjk/33d82dece752d4e3fbcf955a1f48e54d7eefbbf8/src/ghjk_ts/", 4 | "@ghjk/ts": "https://raw.githubusercontent.com/metatypedev/ghjk/33d82dece752d4e3fbcf955a1f48e54d7eefbbf8/src/ghjk_ts/mod.ts", 5 | "@ghjk/ports_wip": "https://raw.githubusercontent.com/metatypedev/ghjk/33d82dece752d4e3fbcf955a1f48e54d7eefbbf8/ports/mod.ts", 6 | "@ghjk/ports_wip/": "https://raw.githubusercontent.com/metatypedev/ghjk/33d82dece752d4e3fbcf955a1f48e54d7eefbbf8/ports/" 7 | }, 8 | "lock": "./deno.lock" 9 | } -------------------------------------------------------------------------------- /.git-branches.toml: -------------------------------------------------------------------------------- 1 | push-hook = true 2 | push-new-branches = false 3 | ship-delete-tracking-branch = false 4 | sync-before-ship = true 5 | sync-upstream = true 6 | 7 | [branches] 8 | main = "main" 9 | perennials = [] 10 | perennial-regex = "" 11 | 12 | [hosting] 13 | # platform = "" 14 | # origin-hostname = "" 15 | 16 | [sync-strategy] 17 | 18 | feature-branches = "rebase" 19 | perennial-branches = "rebase" 20 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | - 12 | 13 | 14 | 15 | - 16 | 17 | 18 | 19 | #### Migration notes 20 | 21 | --- 22 | 23 | - [ ] The change comes with new or modified tests 24 | - [ ] Hard-to-understand functions have explanatory comments 25 | - [ ] End-user documentation is updated to reflect the change 26 | -------------------------------------------------------------------------------- /.github/workflows/autoupdate.yml: -------------------------------------------------------------------------------- 1 | name: pre-commit auto-updater 2 | on: 3 | schedule: 4 | - cron: "0 2 1 * *" 5 | workflow_dispatch: 6 | 7 | jobs: 8 | auto-update: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: actions/setup-python@v5 13 | - uses: browniebroke/pre-commit-autoupdate-action@main 14 | - uses: peter-evans/create-pull-request@v7 15 | with: 16 | token: ${{ secrets.GITHUB_TOKEN }} 17 | branch: update/pre-commit-hooks 18 | title: Update pre-commit hooks 19 | commit-message: "chore: update pre-commit hooks" 20 | body: Update versions of pre-commit hooks to latest version. 21 | -------------------------------------------------------------------------------- /.github/workflows/pr-title-check.yml: -------------------------------------------------------------------------------- 1 | name: pr title check 2 | run-name: checking pr title for ${{ github.event.pull_request.title || github.ref }} 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - synchronize 9 | - ready_for_review 10 | 11 | jobs: 12 | check: 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: amannn/action-semantic-pull-request@v5 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: 2 | - project: "metatypedev/cloud" 3 | ref: main 4 | file: "metatype-ci.yml" 5 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "charliermarsh.ruff", 4 | "rust-lang.rust-analyzer", 5 | "ms-python.black-formatter", 6 | "denoland.vscode-deno", 7 | "ms-vscode-remote.remote-containers", 8 | "dbaeumer.vscode-eslint", 9 | "graphql.vscode-graphql-syntax", 10 | "unifiedjs.vscode-mdx", 11 | "ms-python.vscode-pylance", 12 | "ms-python.python", 13 | "chrischinchilla.vale-vscode", 14 | "hediet.vscode-drawio", 15 | "davidlday.languagetool-linter", 16 | "dtsvet.vscode-wasm", 17 | "bierner.comment-tagged-templates" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security policy 2 | 3 | If you have a security issue to report, please reach us at 4 | [support@metatype.dev](mailto:support@metatype.dev). 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/.eslintignore: -------------------------------------------------------------------------------- 1 | .docusaurus 2 | build 3 | -------------------------------------------------------------------------------- /docs/metatype.dev/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: "@typescript-eslint/parser", 4 | plugins: ["@typescript-eslint", "@docusaurus"], 5 | extends: [ 6 | "eslint:recommended", 7 | "plugin:@typescript-eslint/recommended", 8 | "plugin:@docusaurus/recommended", 9 | "prettier", 10 | ], 11 | env: { 12 | browser: true, 13 | amd: true, 14 | node: true, 15 | }, 16 | }; 17 | -------------------------------------------------------------------------------- /docs/metatype.dev/.prettierignore: -------------------------------------------------------------------------------- 1 | .docusaurus 2 | build 3 | *.py 4 | -------------------------------------------------------------------------------- /docs/metatype.dev/.vale.ini: -------------------------------------------------------------------------------- 1 | StylesPath = vale 2 | MinAlertLevel = suggestion 3 | Packages = Google 4 | Vocab = Metatype 5 | 6 | [formats] 7 | mdx = md 8 | 9 | [*.{md,mdx}] 10 | BasedOnStyles = Vale, Google 11 | BlockIgnores = (?s) *(\{[^\}]*\}|<[^>!]*>|import.*?\n) 12 | -------------------------------------------------------------------------------- /docs/metatype.dev/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve("@docusaurus/core/lib/babel/preset")], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/GrpcMetatype.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/GrpcMetatype.drawio.png -------------------------------------------------------------------------------- /docs/metatype.dev/docs/concepts/RFCs/index.mdx: -------------------------------------------------------------------------------- 1 | # RFCs 2 | 3 | | N° | Name | Date | 4 | | --- | ------------------------------ | ---------- | 5 | | M0 | [Template](./RFCs/M0-template) | 2024-05-01 | 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/contributing.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contribute to Metatype 3 | sidebar_position: 100 4 | --- 5 | 6 | import Contributing from "../../../../CONTRIBUTING.md"; 7 | 8 | # 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/external-functions/ctx.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | ctx { 3 | parent 4 | context 5 | effect 6 | meta { 7 | url 8 | token 9 | } 10 | secrets 11 | headers 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/external-functions/gql.graphql: -------------------------------------------------------------------------------- 1 | # create idea first 2 | mutation createIdea { 3 | createIdea( 4 | data: { 5 | id: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5" 6 | name: "PATENT #12343" 7 | authorEmail: "corp@abc.xyz" 8 | desc: "Well, you can't use it so why do you care?" 9 | } 10 | ) { 11 | id 12 | authorEmail 13 | } 14 | } 15 | 16 | # now try to vote using same email 17 | mutation createVote { 18 | createVote( 19 | authorEmail: "corp@abc.xyz" 20 | ideaId: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5" 21 | ) { 22 | vote { 23 | id 24 | authorEmail 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/external-functions/math.graphql: -------------------------------------------------------------------------------- 1 | { 2 | fib(size: 50) 3 | random 4 | randomItem(items: ["ice", "advice", "gold", "flowers", "dirt"]) 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/external-functions/metagen.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | remix( 3 | title: "Lovefool" 4 | artist: "The Cardigans" 5 | releaseTime: "1996-06-29T10:30:40.340Z" 6 | mp3Url: "https://mus.ic/lovefool.mp3" 7 | ) { 8 | title 9 | artist 10 | releaseTime 11 | mp3Url 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/import-external-modules/func.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | parse_markdown(raw: "hello") 3 | } 4 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/securing-requests/authentication.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_full_context 3 | get_context { 4 | username 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/securing-requests/cors.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | catch_me_if_you_can 3 | # the results panel should show an error 4 | } 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/securing-requests/policies.graphql: -------------------------------------------------------------------------------- 1 | query A { 2 | public 3 | } 4 | 5 | query B { 6 | admin_only 7 | } 8 | 9 | query C { 10 | user_only 11 | } 12 | 13 | query D { 14 | both 15 | } 16 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/self-hosting.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 99 3 | --- 4 | 5 | # Self-host the Typegate 6 | 7 | ## Helm 8 | 9 | [Helm](https://helm.sh) must be installed to use the charts. Please refer to 10 | Helm's documentation to get started. The chart can be accessed on the dedicated 11 | [repository](https://github.com/metatypedev/charts). 12 | 13 | Once Helm has been set up correctly, add the repo as follows: 14 | 15 | ```shell 16 | helm repo add metatype https://charts.metatype.dev 17 | helm show values metatype/typegate > values.yml 18 | # customize values.yaml 19 | helm install my-gate --values values.yml metatype/typegate 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/guides/wasm-functions/metagen.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | remix( 3 | title: "Lovefool" 4 | artist: "The Cardigans" 5 | releaseTime: "1996-06-29T10:30:40.340Z" 6 | mp3Url: "https://mus.ic/lovefool.mp3" 7 | ) { 8 | title 9 | artist 10 | releaseTime 11 | mp3Url 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/changelog.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Changelog 3 | comments: false 4 | sidebar_position: 1000 5 | --- 6 | 7 | import Changelog from "../../../../CHANGELOG.md"; 8 | 9 | # 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/graphql/union-either.graphql: -------------------------------------------------------------------------------- 1 | { 2 | outer { 3 | # scalar 1 and 2 don't need 4 | # type inline fragments 5 | unionList { 6 | ... on comp_1 { 7 | field1 8 | } 9 | ... on comp_2 { 10 | field2 11 | } 12 | } 13 | # we must include fragments 14 | # for all composites or it will fail 15 | union { 16 | ... on comp_1 { 17 | field1 18 | } 19 | ... on comp_2 { 20 | field2 21 | } 22 | } 23 | # rules are the same between unions and eithers 24 | either { 25 | ... on comp_1 { 26 | field1 27 | } 28 | ... on comp_2 { 29 | field2 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/meta-cli/embedded-typegate/index.mdx: -------------------------------------------------------------------------------- 1 | import EmbeddedTypegate from "../../../../shared/meta-cli/embedded-typegate.mdx"; 2 | 3 | # Embedded Typegate 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/policies/policies.graphql: -------------------------------------------------------------------------------- 1 | query A { 2 | public 3 | } 4 | 5 | query B { 6 | admin_only 7 | } 8 | 9 | query C { 10 | user_only 11 | } 12 | 13 | query D { 14 | both 15 | } 16 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/deno/deno.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | compute_fib(n: 3) { 3 | res 4 | ms 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/graphql/graphql.graphql: -------------------------------------------------------------------------------- 1 | query A { 2 | users { 3 | data { 4 | id 5 | name 6 | } 7 | } 8 | } 9 | 10 | mutation B { 11 | create_message(data: { title: "Hey", user_id: "1" }) { 12 | id 13 | } 14 | } 15 | 16 | query C { 17 | messages(take: 2) { 18 | title 19 | user { 20 | name 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/grpc/grpc.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | greet(name: "Metatype") { 3 | message 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/http/http.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | facts(language: "en") { 3 | id 4 | text 5 | # source_url 6 | # permalink 7 | } 8 | facts_as_text(language: "en") 9 | } 10 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/prisma/database.graphql: -------------------------------------------------------------------------------- 1 | mutation A { 2 | create_message( 3 | data: { 4 | # id is autogenerated 5 | title: "Hello World" 6 | body: "This is a message" 7 | } 8 | ) { 9 | id 10 | } 11 | } 12 | 13 | query B { 14 | list_messages(where: { title: { equals: "Hello World" } }) { 15 | id 16 | body 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/python/index.mdx: -------------------------------------------------------------------------------- 1 | # Python 2 | 3 | import CodeBlock from "@theme/CodeBlock"; 4 | import TGExample from "@site/src/components/TGExample"; 5 | 6 | ## Python Runtime 7 | 8 | The PythonRuntime allows you to run short-lived code on a Python virtual machine. 9 | 10 | 16 | 17 | Where hello.py looks like: 18 | 19 | ```python 20 | # hello.py 21 | 22 | def say_hello(x: any): 23 | return f"Hello {x["name"]}" 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/random/random-field.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | bonus1: get_bonus(performance: 200) 3 | bonus2: get_bonus(performance: 27) 4 | } 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/random/random.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_idea { 3 | id 4 | # name 5 | authorEmail 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/runtimes/s3/index.mdx: -------------------------------------------------------------------------------- 1 | import S3Intro from "@site/shared/s3/index.mdx"; 2 | 3 | # S3 4 | 5 | ## S3 runtime 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/authentication/basic.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_context { 3 | username 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/authentication/jwt.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_context { 3 | your_own_content 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/authentication/oauth2.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_context { 3 | exp 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/cors/cors.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | catch_me_if_you_can 3 | # the results panel should show an error 4 | } 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/cors/index.mdx: -------------------------------------------------------------------------------- 1 | import Cors from "@site/shared/cors/index.mdx"; 2 | 3 | # CORS 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegate/rate-limiting/rate.graphql: -------------------------------------------------------------------------------- 1 | query A { 2 | lightweight_call 3 | } 4 | 5 | query B { 6 | medium_call 7 | } 8 | 9 | query C { 10 | heavy_call 11 | } 12 | 13 | query D { 14 | by_result_count 15 | } 16 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/typegraph/index.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | import InstallTypegraph from "../../../shared/install/typegraph.mdx"; 6 | 7 | # Typegraph 8 | 9 | Typegraphs are the main building blocks when writing some code using Metatype. They define the unit of development/deployment and expose under a define name a set of types and their relationships. 10 | 11 | ## SDKs 12 | 13 | You can author typegraphs using one of the SDKs available. 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/types/importers/importer.py_: -------------------------------------------------------------------------------- 1 | from typegraph.importers.google_discovery import GoogleDiscoveryImporter 2 | 3 | GoogleDiscoveryImporter( 4 | "googleapi", url="https://fcm.googleapis.com/$discovery/rest?version=v1" 5 | ).imp(False) 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/reference/types/importers/typegraph_std.py_: -------------------------------------------------------------------------------- 1 | from typegraph import TypeGraph, policies 2 | from typegraph_std.github import import_github 3 | from typegraph_std.google import import_gmail 4 | 5 | with TypeGraph( 6 | "emails", 7 | # skip:next-line 8 | cors=TypeGraph.Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 9 | ) as g: 10 | public = policies.public() 11 | 12 | # {protocol}://{hostname}/api/v3 13 | github = import_github({"protocol": "https", "hostname": "custom_host"}) 14 | 15 | gmail = import_gmail() 16 | 17 | g.expose( 18 | list_emails=github.functions.users_list_emails_for_authenticated_user, 19 | **gmail.functions, 20 | default_policy=[public] 21 | ) 22 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/execute.graphql: -------------------------------------------------------------------------------- 1 | mutation UVote { 2 | set_vote_importance( 3 | vote_id: "2f3207e0-6cb6-4aaf-a759-037cdfe48f0c" 4 | importance: "medium" 5 | ) 6 | } 7 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/md2html.ts.src: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import * as marked from "https://deno.land/x/marked/mod.ts"; 5 | 6 | export function parse({ raw }: { raw: string }): string { 7 | return marked.parse(raw); 8 | } 9 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/policies.graphql: -------------------------------------------------------------------------------- 1 | mutation CBucket { 2 | create_bucket(data: { name: "Backlog" }) { 3 | id 4 | name 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/prisma.graphql: -------------------------------------------------------------------------------- 1 | mutation CBucket { 2 | create_bucket(data: { name: "Backlog" }) { 3 | id 4 | name 5 | } 6 | } 7 | 8 | mutation CIdea { 9 | create_idea( 10 | data: { 11 | bucket: { connect: { id: 1 } } 12 | authorEmail: "deng@xi.ng" 13 | name: "Add support for WASM Gc" 14 | } 15 | ) { 16 | id 17 | name 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/query.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_message { 3 | id 4 | title 5 | # user_id 6 | } 7 | 8 | second_one: get_message { 9 | user_id 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/random.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | get_idea { 3 | id 4 | name 5 | authorEmail 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /docs/metatype.dev/docs/tutorials/metatype-basics/reduce.graphql: -------------------------------------------------------------------------------- 1 | mutation CBucket { 2 | create_bucket(data: { name: "Backlog" }) { 3 | id 4 | name 5 | } 6 | } 7 | 8 | mutation CIdea { 9 | create_idea( 10 | data: { 11 | bucket: { connect: { id: 1 } } 12 | authorEmail: "deng@xi.ng" 13 | name: "Add support for WASM Gc" 14 | } 15 | ) { 16 | id 17 | name 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs/metatype.dev/globals.d.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | declare module "*.scss"; 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/packages/tailwindcss.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/no-var-requires */ 2 | 3 | const tailwindcss = require("tailwindcss"); 4 | const autoprefixer = require("autoprefixer"); 5 | 6 | /** @type {import('@docusaurus/types').PluginModule} */ 7 | module.exports = () => ({ 8 | name: "tailwindcss", 9 | configurePostCss(postCssOptions) { 10 | postCssOptions.plugins.push(tailwindcss); 11 | postCssOptions.plugins.push(autoprefixer); 12 | return postCssOptions; 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/cors/cors.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | catch_me_if_you_can 3 | # the results panel should show an error 4 | } 5 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/projects/first-project.graphql: -------------------------------------------------------------------------------- 1 | mutation CreateMessage { 2 | create_message( 3 | data: { 4 | title: "First typegraph" 5 | body: "Congrats on your first typegraph." 6 | } 7 | ) { 8 | id 9 | } 10 | } 11 | 12 | query ListMessages { 13 | list_messages { 14 | id 15 | title 16 | body 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/s3/files.graphql: -------------------------------------------------------------------------------- 1 | { 2 | listObjects { 3 | keys { 4 | key 5 | size 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/upgrade/index.mdx: -------------------------------------------------------------------------------- 1 | import UpgradeMetaClI from "./meta-cli.mdx"; 2 | import UpgradePythonSDK from "./python-sdk.mdx"; 3 | import UpgradeTsSDK from "./typescript-sdk.mdx"; 4 | import SDKTabs from "@site/src/components/SDKTabs"; 5 | import TabItem from "@theme/TabItem"; 6 | 7 | # 8 | 9 | ## Upgrade your Metatype development environment 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/upgrade/meta-cli.mdx: -------------------------------------------------------------------------------- 1 | To Upgrade the _Meta CLI_ to the latest version, you can run the following command below. 2 | 3 | ```shell 4 | meta upgrade 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/upgrade/python-sdk.mdx: -------------------------------------------------------------------------------- 1 | To upgrade the _Python_ SDK of the typegraph package, you can run either of the following commands based on the dependency manager you are using. 2 | 3 | - pip 4 | 5 | ```shell 6 | pip3 install --upgrade typegraph 7 | ``` 8 | 9 | - poetry 10 | 11 | ```shell 12 | poetry add typegraph@latest 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/shared/upgrade/typescript-sdk.mdx: -------------------------------------------------------------------------------- 1 | To upgrade the _Typescript_ SDK of the typegraph package, you can use one of the following commands: 2 | 3 | - Node 4 | 5 | ```shell 6 | npm update @typegraph/sdk 7 | ``` 8 | 9 | - Deno 10 | 11 | ```shell 12 | deno cache --reload "npm:@typegraph/sdk" 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/components/BlogIntro/index.tsx: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import React from "react"; 5 | 6 | export default function BlogIntro({ text }: BlogIntroProps) { 7 | return ( 8 |
9 |

{text}

10 |
11 | ); 12 | } 13 | 14 | interface BlogIntroProps { 15 | text: string; 16 | } 17 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/components/DocButton/index.tsx: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import React from "react"; 5 | import PaginatorNavLink from "@theme/PaginatorNavLink"; 6 | import styles from "./styles.module.scss"; 7 | 8 | interface DocButtonProps { 9 | next?: PaginatorNavLink; 10 | previous?: PaginatorNavLink; 11 | } 12 | 13 | export default function DocButton(props: DocButtonProps): JSX.Element { 14 | const { previous, next } = props; 15 | return ( 16 | 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/components/DocButton/styles.module.scss: -------------------------------------------------------------------------------- 1 | .link { 2 | a { 3 | text-align: center; 4 | max-width: 400px; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/components/animations/animated.tsx: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import React from "react"; 5 | import { a, WithAnimated } from "@react-spring/konva"; 6 | 7 | export function Animated(props: WithAnimated["Group"]["arguments"]) { 8 | // @ts-expect-error https://github.com/pmndrs/react-spring/issues/1784 9 | return ; 10 | } 11 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/components/animations/doublearrow.tsx: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { ArrowConfig } from "konva/lib/shapes/Arrow"; 5 | import React from "react"; 6 | import { Arrow } from "react-konva"; 7 | 8 | export function DoubleArrow(props: ArrowConfig) { 9 | return ( 10 | <> 11 | 12 | 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/pages/index.graphql: -------------------------------------------------------------------------------- 1 | query A { 2 | stargazers { 3 | login 4 | # composition 5 | user { 6 | name 7 | } 8 | } 9 | } 10 | 11 | mutation B { 12 | send_feedback( 13 | data: { 14 | email: "" # fill me 15 | message: "I love X!" 16 | } 17 | ) { 18 | id 19 | message 20 | } 21 | } 22 | 23 | query C { 24 | list_feedback { 25 | email # cannot be accessed, delete me 26 | message 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/theme/DocItem/Paginator/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Paginator from "@theme-original/DocItem/Paginator"; 3 | import Giscus from "@site/src/components/Giscus"; 4 | import styles from "./styles.module.scss"; 5 | import useFrontMatter from "@theme/useFrontMatter"; 6 | 7 | export default function PaginatorWrapper(props) { 8 | const fm = useFrontMatter(); 9 | 10 | return ( 11 | <> 12 | 13 | {fm.comments === false ? null : ( 14 |
15 | 16 |
17 | )} 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/theme/DocItem/Paginator/styles.module.scss: -------------------------------------------------------------------------------- 1 | .giscus { 2 | margin-top: 3em; 3 | } 4 | -------------------------------------------------------------------------------- /docs/metatype.dev/src/theme/Root.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from "react"; 2 | import Gleap from "gleap"; 3 | 4 | export default function Root({ children }) { 5 | useEffect(() => { 6 | Gleap.initialize("dyWs3yourDQZkNztYzV7yZgcyMcWGpaF"); 7 | }, []); 8 | 9 | return <>{children}; 10 | } 11 | -------------------------------------------------------------------------------- /docs/metatype.dev/static/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/.nojekyll -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/blog/execution-flow-paradigms/eda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/blog/execution-flow-paradigms/eda.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/blog/execution-flow-paradigms/saga-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/blog/execution-flow-paradigms/saga-overview.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/blog/execution-flow-paradigms/saga-pattern-order-delivery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/blog/execution-flow-paradigms/saga-pattern-order-delivery.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/blog/execution-flow-paradigms/start-workflow-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/blog/execution-flow-paradigms/start-workflow-result.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/blog/execution-flow-paradigms/temporal-web-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/blog/execution-flow-paradigms/temporal-web-ui.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/castles/building.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/castles/building.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/castles/modulable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/castles/modulable.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/castles/reusable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/castles/reusable.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/castles/stable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/castles/stable.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/demo-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/demo-thumbnail.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/favicon.ico -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/logo.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/slack.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/tutorial/query-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/tutorial/query-result.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/tutorial/running-typegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/tutorial/running-typegate.png -------------------------------------------------------------------------------- /docs/metatype.dev/static/images/tutorial/tg-on-typegate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/static/images/tutorial/tg-on-typegate.png -------------------------------------------------------------------------------- /docs/metatype.dev/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | corePlugins: { 4 | preflight: false, 5 | }, 6 | content: [ 7 | "./blog/**/*.{ts,tsx,mdx,md}", 8 | "./docs/**/*.{ts,tsx,mdx,md}", 9 | "./shared/**/*.{ts,tsx,mdx,md}", 10 | "./src/components/**/*.{ts,tsx,mdx,md}", 11 | "./src/pages/**/*.{ts,tsx,mdx,md}", 12 | "./use-cases/**/*.{ts,tsx,mdx,md}", 13 | ], 14 | theme: { 15 | extend: { 16 | colors: { 17 | metared: "rgb(152, 28, 93)", 18 | metablue: "rgb(16, 29, 81)", 19 | }, 20 | }, 21 | }, 22 | plugins: [require("@tailwindcss/container-queries")], 23 | }; 24 | -------------------------------------------------------------------------------- /docs/metatype.dev/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "//": "This file is not used in compilation. It is here just for a nice editor experience.", 3 | "extends": "@tsconfig/docusaurus/tsconfig.json", 4 | "compilerOptions": { 5 | "jsx": "react", 6 | "strict": true, 7 | "allowJs": false, 8 | "baseUrl": ".", 9 | "esModuleInterop": true, 10 | "types": ["docusaurus-theme-frontmatter", "docusaurus-plugin-sass"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/backend-for-frontend/query.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | stargazers { 3 | login 4 | user { 5 | name 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/faas-runner/query.gql: -------------------------------------------------------------------------------- 1 | query { 2 | pycumsum(n: 5) 3 | 4 | tscumsum(n: 5) 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/graphql-server/query.gql: -------------------------------------------------------------------------------- 1 | query { 2 | stargazers { 3 | login 4 | user { 5 | name 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/iam-provider/query.gql: -------------------------------------------------------------------------------- 1 | query { 2 | loginUrl 3 | 4 | context { 5 | username 6 | } 7 | 8 | logoutUrl 9 | } 10 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/microservice-orchestration/query.gql: -------------------------------------------------------------------------------- 1 | query { 2 | version_team_b 3 | 4 | version_team_a 5 | } 6 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/prisma.graphql: -------------------------------------------------------------------------------- 1 | mutation create { 2 | create_user( 3 | data: { 4 | firstname: "" # fill me 5 | email: "john@doe.com" 6 | } 7 | ) { 8 | id 9 | } 10 | } 11 | 12 | query read { 13 | read_user( 14 | where: { 15 | firstname: "" # fill me 16 | } 17 | ) { 18 | id 19 | } 20 | find_user(term: "%doe%", id: "") { 21 | email 22 | firstname 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/programmable-api-gateway/query.gql: -------------------------------------------------------------------------------- 1 | query A { 2 | static_a { 3 | foo 4 | } 5 | } 6 | 7 | query B { 8 | static_b { 9 | foo 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /docs/metatype.dev/use-cases/sidebars.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | 3 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 4 | const sidebars = { 5 | useCases: [{ type: "autogenerated", dirName: "." }], 6 | }; 7 | 8 | module.exports = sidebars; 9 | -------------------------------------------------------------------------------- /docs/metatype.dev/vale/config/vocabularies/Metatype/accept.txt: -------------------------------------------------------------------------------- 1 | Metatype 2 | [tT]ypegraph 3 | [tT]ypegate 4 | serverless 5 | materializer 6 | runtime 7 | will 8 | CLI 9 | [cC]loud 10 | BFF 11 | API 12 | FaaS 13 | Deno 14 | ORM 15 | HTTPs? 16 | GraphQL 17 | REST 18 | DDL 19 | RLS 20 | RSP 21 | typecheck 22 | DAG 23 | JWT 24 | Giscus 25 | Prisma 26 | GRPC 27 | boolean 28 | PATCH 29 | PUT 30 | PBAC 31 | CORS 32 | OAuth2 33 | sandboxed 34 | Infisical 35 | Zsh 36 | WASI 37 | [wW]asm 38 | monorepos? 39 | Github 40 | CPython 41 | sandboxing 42 | POSIX 43 | JIT 44 | -------------------------------------------------------------------------------- /docs/metatype.dev/vale/config/vocabularies/Metatype/reject.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/docs/metatype.dev/vale/config/vocabularies/Metatype/reject.txt -------------------------------------------------------------------------------- /examples/demo/metatype.yml: -------------------------------------------------------------------------------- 1 | typegates: 2 | dev: 3 | url: "http://localhost:7890" 4 | username: admin 5 | password: password 6 | secrets: 7 | public-api: 8 | POSTGRES: "postgresql://postgres:password@localhost:5432/db?schema=public-api" 9 | GITHUB_CLIENT_ID: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/GITHUB_CLIENT_ID 10 | GITHUB_CLIENT_SECRET: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/GITHUB_CLIENT_SECRET 11 | -------------------------------------------------------------------------------- /examples/demo/prisma/migrations/public-api/demo/20230407213631_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "user" ( 3 | "id" UUID NOT NULL, 4 | "user" TEXT NOT NULL, 5 | 6 | CONSTRAINT "user_pkey" PRIMARY KEY ("id") 7 | ); 8 | -------------------------------------------------------------------------------- /examples/demo/prisma/migrations/public-api/demo/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/deploy/.tgignore: -------------------------------------------------------------------------------- 1 | .git 2 | node_modules 3 | 4 | *.json 5 | *.y*ml 6 | .*ignore 7 | deploy.* 8 | -------------------------------------------------------------------------------- /examples/deploy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "deploy": "npx tsx deploy.ts", 7 | "deploy_python": "python3 deploy.py", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "type": "module", 14 | "dependencies": { 15 | "@typegraph/sdk": "link:../../typegraph/node" 16 | }, 17 | "devDependencies": { 18 | "tsx": "^3.13.0", 19 | "typescript": "^5.2.2" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /examples/deploy/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: "9.0" 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | .: 9 | dependencies: 10 | "@typegraph/sdk": 11 | specifier: link:../../typegraph/node/sdk/dist 12 | version: link:../../typegraph/node/sdk/dist 13 | -------------------------------------------------------------------------------- /examples/deploy/scripts/deno/import.ts: -------------------------------------------------------------------------------- 1 | export function concat(...args: unknown[]) { 2 | return args.join(""); 3 | } 4 | -------------------------------------------------------------------------------- /examples/deploy/scripts/deno/say_hello.ts: -------------------------------------------------------------------------------- 1 | import { concat } from "./import.ts"; 2 | 3 | export function sayHello({ name }: { name: string }) { 4 | return concat("Hello", " ", name, "!"); 5 | } 6 | -------------------------------------------------------------------------------- /examples/deploy/scripts/python/import_.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | 4 | def concat(args: List[any]): 5 | return "".join(str(args)) 6 | -------------------------------------------------------------------------------- /examples/deploy/scripts/python/say_hello.py: -------------------------------------------------------------------------------- 1 | from import_ import concat 2 | 3 | 4 | def say_hello(obj: any): 5 | return concat(["Hello", " ", obj["name"], " from python module"]) 6 | -------------------------------------------------------------------------------- /examples/migrations/blog/blog/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/business-logic/database/20230407170041_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "message" ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | "user_id" INTEGER NOT NULL, 6 | 7 | CONSTRAINT "message_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/business-logic/database/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/database/database/20230407165539_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "message" ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | "body" TEXT NOT NULL, 6 | 7 | CONSTRAINT "message_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/database/database/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/fcm/database/20230407170028_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "message" ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | 6 | CONSTRAINT "message_pkey" PRIMARY KEY ("id") 7 | ); 8 | -------------------------------------------------------------------------------- /examples/migrations/fcm/database/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/func-gql/db/20240604132537_generated/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "idea" ( 3 | "id" UUID NOT NULL, 4 | "name" TEXT NOT NULL, 5 | "desc" TEXT, 6 | "authorEmail" TEXT NOT NULL, 7 | 8 | CONSTRAINT "idea_pkey" PRIMARY KEY ("id") 9 | ); 10 | 11 | -- CreateTable 12 | CREATE TABLE "vote" ( 13 | "id" UUID NOT NULL, 14 | "authorEmail" TEXT NOT NULL, 15 | "ideaId" UUID NOT NULL, 16 | 17 | CONSTRAINT "vote_pkey" PRIMARY KEY ("id") 18 | ); 19 | 20 | -- AddForeignKey 21 | ALTER TABLE "vote" ADD CONSTRAINT "vote_ideaId_fkey" FOREIGN KEY ("ideaId") REFERENCES "idea"("id") ON DELETE RESTRICT ON UPDATE CASCADE; 22 | -------------------------------------------------------------------------------- /examples/migrations/func-gql/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/graphql/database/20230407170016_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "message" ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | "user_id" INTEGER NOT NULL, 6 | 7 | CONSTRAINT "message_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/graphql/database/20230529111022_generated/migration.sql: -------------------------------------------------------------------------------- 1 | -- AlterTable 2 | ALTER TABLE "message" ALTER COLUMN "user_id" SET DATA TYPE TEXT; 3 | -------------------------------------------------------------------------------- /examples/migrations/graphql/database/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/homepage/demo/20230204231405_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "feedback" ( 3 | "id" UUID NOT NULL, 4 | "email" TEXT, 5 | "message" TEXT NOT NULL, 6 | 7 | CONSTRAINT "feedback_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/homepage/demo/20230204231612_change/migration.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Warnings: 3 | 4 | - Made the column `email` on table `feedback` required. This step will fail if there are existing NULL values in that column. 5 | 6 | */ 7 | -- AlterTable 8 | ALTER TABLE "feedback" ALTER COLUMN "email" SET NOT NULL; 9 | -------------------------------------------------------------------------------- /examples/migrations/homepage/demo/20230801190752_generated/migration.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Warnings: 3 | 4 | - You are about to alter the column `message` on the `feedback` table. The data in that column could be lost. The data in that column will be cast from `Text` to `VarChar(2000)`. 5 | 6 | */ 7 | -- AlterTable 8 | ALTER TABLE "feedback" ALTER COLUMN "message" SET DATA TYPE VARCHAR(2000); 9 | -------------------------------------------------------------------------------- /examples/migrations/homepage/demo/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/orm-for-the-edge/legacy/20230407165628_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "user" ( 3 | "id" UUID NOT NULL, 4 | "email" TEXT NOT NULL, 5 | "firstname" TEXT NOT NULL, 6 | 7 | CONSTRAINT "user_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/orm-for-the-edge/legacy/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/prisma-runtime/legacy/20230415233128_init/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "user" ( 3 | "id" UUID NOT NULL, 4 | "email" TEXT NOT NULL, 5 | "firstname" TEXT NOT NULL, 6 | 7 | CONSTRAINT "user_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/prisma-runtime/legacy/20230801221728_generated/migration.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Warnings: 3 | 4 | - You are about to alter the column `firstname` on the `user` table. The data in that column could be lost. The data in that column will be cast from `Text` to `VarChar(2000)`. 5 | 6 | */ 7 | -- AlterTable 8 | ALTER TABLE "user" ALTER COLUMN "firstname" SET DATA TYPE VARCHAR(2000); 9 | -------------------------------------------------------------------------------- /examples/migrations/prisma-runtime/legacy/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/quick-start-project/database/20240604130842_generated/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "message" ( 3 | "id" SERIAL NOT NULL, 4 | "title" TEXT NOT NULL, 5 | "body" TEXT NOT NULL, 6 | 7 | CONSTRAINT "message_pkey" PRIMARY KEY ("id") 8 | ); 9 | -------------------------------------------------------------------------------- /examples/migrations/quick-start-project/database/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-execute/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-func/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-policies/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-prisma/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-reduce/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/migrations/roadmap-rest/db/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" 4 | -------------------------------------------------------------------------------- /examples/templates/deno/.graphqlrc.yaml: -------------------------------------------------------------------------------- 1 | schema: 2 | - http://localhost:7890/example 3 | -------------------------------------------------------------------------------- /examples/templates/deno/metatype.yaml: -------------------------------------------------------------------------------- 1 | typegates: 2 | dev: 3 | url: "http://localhost:7890" 4 | username: admin 5 | password: password 6 | secrets: 7 | example: 8 | POSTGRES: "postgresql://postgres:password@postgres:5432/db" 9 | deploy: 10 | url: "https://cloud.metatype.dev" 11 | username: admin 12 | password: password 13 | secrets: 14 | example: 15 | POSTGRES: "postgresql://postgres:password@localhost:5432/db" 16 | -------------------------------------------------------------------------------- /examples/templates/node/.graphqlrc.yaml: -------------------------------------------------------------------------------- 1 | schema: 2 | - http://localhost:7890/example 3 | -------------------------------------------------------------------------------- /examples/templates/node/metatype.yaml: -------------------------------------------------------------------------------- 1 | typegates: 2 | dev: 3 | url: "http://localhost:7890" 4 | username: admin 5 | password: password 6 | secrets: 7 | example: 8 | POSTGRES: "postgresql://postgres:password@postgres:5432/db" 9 | deploy: 10 | url: "https://cloud.metatype.dev" 11 | username: admin 12 | password: password 13 | secrets: 14 | example: 15 | POSTGRES: "postgresql://postgres:password@localhost:5432/db" 16 | -------------------------------------------------------------------------------- /examples/templates/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "type": "module", 4 | "version": "1.0.0", 5 | "scripts": { 6 | "dev": "MCLI_LOADER_CMD='npm x tsx' meta dev" 7 | }, 8 | "dependencies": { 9 | "@typegraph/sdk": "^0.5.1-rc.4" 10 | }, 11 | "devDependencies": { 12 | "tsx": "^3.13.0", 13 | "typescript": "^5.2.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/templates/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "moduleResolution": "node16", 5 | "module": "Node16", 6 | "esModuleInterop": true 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /examples/templates/python/.graphqlrc.yaml: -------------------------------------------------------------------------------- 1 | schema: 2 | - http://localhost:7890/example 3 | -------------------------------------------------------------------------------- /examples/templates/python/api/example.py: -------------------------------------------------------------------------------- 1 | from typegraph import typegraph, Policy, t, Graph 2 | from typegraph.runtimes import PythonRuntime 3 | 4 | 5 | @typegraph() 6 | def example(g: Graph): 7 | public = Policy.public() 8 | python = PythonRuntime() 9 | 10 | hello = python.from_lambda( 11 | t.struct({"world": t.string()}), 12 | t.string(), 13 | lambda x: f"Hello {x['world']}!", 14 | ) 15 | 16 | g.expose(public, hello=hello) 17 | -------------------------------------------------------------------------------- /examples/templates/python/metatype.yaml: -------------------------------------------------------------------------------- 1 | typegates: 2 | dev: 3 | url: "http://localhost:7890" 4 | username: admin 5 | password: password 6 | secrets: 7 | example: 8 | POSTGRES: "postgresql://postgres:password@postgres:5432/db" 9 | deploy: 10 | url: "https://cloud.metatype.dev" 11 | username: admin 12 | password: password 13 | secrets: 14 | example: 15 | POSTGRES: "postgresql://postgres:password@localhost:5432/db" 16 | -------------------------------------------------------------------------------- /examples/templates/python/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "example" 3 | version = "0.5.1-rc.4" 4 | description = "" 5 | authors = [] 6 | 7 | [tool.poetry.dependencies] 8 | python = ">=3.8,<4.0" 9 | typegraph = "0.5.1-rc.4" 10 | 11 | [build-system] 12 | requires = ["poetry-core"] 13 | build-backend = "poetry.core.masonry.api" 14 | -------------------------------------------------------------------------------- /examples/typegraphs/cors.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph, Policy, t, Graph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes.random import RandomRuntime 5 | 6 | 7 | # skip:end 8 | @typegraph( 9 | # highlight-start 10 | cors=Cors( 11 | allow_origin=["https://not-this.domain"], 12 | allow_headers=["x-custom-header"], 13 | expose_headers=["header-1"], 14 | allow_credentials=True, 15 | max_age_sec=60, 16 | ), 17 | # highlight-end 18 | ) 19 | def cors(g: Graph): 20 | random = RandomRuntime(seed=0, reset=None) 21 | 22 | g.expose( 23 | Policy.public(), 24 | catch_me_if_you_can=random.gen(t.string()), 25 | ) 26 | -------------------------------------------------------------------------------- /examples/typegraphs/cors.ts: -------------------------------------------------------------------------------- 1 | // skip:start 2 | import { Policy, t, typegraph } from "@typegraph/sdk"; 3 | import { RandomRuntime } from "@typegraph/sdk/runtimes/random"; 4 | 5 | // skip:end 6 | 7 | await typegraph( 8 | { 9 | name: "cors", 10 | // highlight-start 11 | cors: { 12 | allowOrigin: ["https://not-this.domain"], 13 | allowHeaders: ["x-custom-header"], 14 | exposeHeaders: ["header-1"], 15 | allowCredentials: true, 16 | maxAgeSec: 60, 17 | }, 18 | // highlight-end 19 | }, 20 | (g) => { 21 | const random = new RandomRuntime({ seed: 0 }); 22 | 23 | g.expose( 24 | { 25 | catch_me_if_you_can: random.gen(t.string()), 26 | }, 27 | Policy.public(), 28 | ); 29 | }, 30 | ); 31 | -------------------------------------------------------------------------------- /examples/typegraphs/functions.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph, t, Graph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes import DenoRuntime, HttpRuntime 5 | 6 | 7 | @typegraph( 8 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 9 | ) 10 | def functions(g: Graph): 11 | # skip:end 12 | deno = DenoRuntime() 13 | deno.func( 14 | t.struct({"input": t.string()}), 15 | t.string(), 16 | code="({ input }) => `hello ${input}`", # with logic 17 | ) 18 | 19 | http = HttpRuntime("https://random.org/api") 20 | http.get( 21 | "/flip_coin", 22 | t.struct({}), 23 | t.enum(["head", "tail"]), 24 | ) 25 | -------------------------------------------------------------------------------- /examples/typegraphs/grpc.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import Graph, Policy, typegraph 3 | from typegraph.graph.params import Cors 4 | 5 | # skip:end 6 | # highlight-next-line 7 | from typegraph.runtimes.grpc import GrpcRuntime 8 | 9 | 10 | @typegraph( 11 | # skip:start 12 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 13 | # skip:end 14 | ) 15 | def grpc(g: Graph): 16 | endpoint = "tcp://localhost:4770" 17 | proto_file = "proto/helloworld.proto" 18 | 19 | # highlight-next-line 20 | grpc_runtime = GrpcRuntime(proto_file, endpoint) 21 | 22 | g.expose( 23 | Policy.public(), 24 | greet=grpc_runtime.call("/helloworld.Greeter/SayHello"), 25 | ) 26 | -------------------------------------------------------------------------------- /examples/typegraphs/grpc.ts: -------------------------------------------------------------------------------- 1 | // skip:start 2 | import { Policy, typegraph } from "@typegraph/sdk"; 3 | import { GrpcRuntime } from "@typegraph/sdk/runtimes/grpc"; 4 | 5 | // skip:end 6 | 7 | export const tg = await typegraph( 8 | { 9 | name: "grpc", 10 | // skip:next-line 11 | cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] }, 12 | }, 13 | (g) => { 14 | const endpoint = "tcp://localhost:4770"; 15 | const proto_file = "proto/helloworld.proto"; 16 | 17 | // highlight-next-line 18 | const grpc_runtime = new GrpcRuntime(proto_file, endpoint); 19 | 20 | g.expose( 21 | { 22 | greet: grpc_runtime.call("/helloworld.Greeter/SayHello"), 23 | }, 24 | Policy.public(), 25 | ); 26 | }, 27 | ); 28 | -------------------------------------------------------------------------------- /examples/typegraphs/kv.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import Graph, Policy, typegraph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes.kv import KvRuntime 5 | 6 | # skip:end 7 | 8 | 9 | @typegraph( 10 | # skip:start 11 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 12 | # skip:end 13 | ) 14 | def key_value(g: Graph): 15 | kv = KvRuntime("REDIS") 16 | 17 | g.expose( 18 | Policy.public(), 19 | get=kv.get(), 20 | set=kv.set(), 21 | delete=kv.delete(), 22 | keys=kv.keys(), 23 | values=kv.values(), 24 | ) 25 | -------------------------------------------------------------------------------- /examples/typegraphs/kv.ts: -------------------------------------------------------------------------------- 1 | // skip:start 2 | import { Policy, typegraph } from "@typegraph/sdk"; 3 | import { KvRuntime } from "@typegraph/sdk/runtimes/kv"; 4 | 5 | // skip:end 6 | 7 | export const tg = await typegraph( 8 | { 9 | name: "key-value", 10 | // skip:next-line 11 | cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] }, 12 | }, 13 | (g) => { 14 | const kv = new KvRuntime("REDIS"); 15 | const pub = Policy.public(); 16 | g.expose({ 17 | get: kv.get(), 18 | set: kv.set(), 19 | delete: kv.delete(), 20 | keys: kv.keys(), 21 | values: kv.values(), 22 | }, pub); 23 | }, 24 | ); 25 | -------------------------------------------------------------------------------- /examples/typegraphs/metagen/py/remix.py: -------------------------------------------------------------------------------- 1 | from .fdk import handler_remix_track, Idv3, Ctx 2 | 3 | 4 | # the following decorator makes sure your function 5 | # adheres to the function types from the typegraph 6 | @handler_remix_track 7 | def remix_track(inp: Idv3, _cx: Ctx) -> Idv3: 8 | return { 9 | "title": f"{inp['title']} (Remix)", 10 | "artist": f"{inp['artist']} + DJ Cloud", 11 | "release_time": inp["release_time"], 12 | "mp3_url": "https://mp3.url/remix1", 13 | } 14 | -------------------------------------------------------------------------------- /examples/typegraphs/metagen/ts/remix.ts: -------------------------------------------------------------------------------- 1 | import type { Ctx, Idv3, RemixTrackHandler } from "./fdk.ts"; 2 | 3 | // the name of the export must match the one referred int he typegraph 4 | export const remix_track: RemixTrackHandler = (inp, cx: Ctx) => { 5 | const out: Idv3 = { 6 | title: `${inp.title} (Remix)`, 7 | artist: `${inp.artist} + DJ Cloud`, 8 | releaseTime: new Date().toISOString(), 9 | // S3Runtime could be used to really provide this service 10 | mp3Url: `${cx.meta.url}/get_mp3`, 11 | }; 12 | return out; 13 | }; 14 | -------------------------------------------------------------------------------- /examples/typegraphs/policies-example.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes.deno import DenoRuntime 5 | 6 | 7 | @typegraph( 8 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 9 | ) 10 | def policies_example(g): 11 | # skip:end 12 | deno = DenoRuntime() 13 | public = deno.policy("public", "() => 'PASS'") # noqa 14 | allow_all = deno.policy("allow_all", "() => 'ALLOW'") # noqa 15 | team_only = deno.policy( # noqa 16 | "team", "(ctx) => ctx.user.role === 'admin' ? 'ALLOW' : 'DENY' " 17 | ) 18 | -------------------------------------------------------------------------------- /examples/typegraphs/proto/helloworld.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package helloworld; 4 | 5 | service Greeter { 6 | rpc SayHello (HelloRequest) returns (HelloReply) {} 7 | } 8 | 9 | message HelloRequest { 10 | string name = 1; 11 | } 12 | 13 | message HelloReply { 14 | string message = 1; 15 | } 16 | -------------------------------------------------------------------------------- /examples/typegraphs/runtimes.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph, t, Graph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes import HttpRuntime 5 | 6 | 7 | @typegraph( 8 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 9 | ) 10 | def runtimes(g: Graph): 11 | # skip:end 12 | http = HttpRuntime("https://random.org/api") 13 | 14 | # same func as above 15 | http.get( 16 | "/flip_coin", t.struct({}), t.enum(["head", "tail"]) 17 | ) # implicitly attaches runtime to all types 18 | -------------------------------------------------------------------------------- /examples/typegraphs/scripts/deps.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/examples/typegraphs/scripts/deps.py -------------------------------------------------------------------------------- /examples/typegraphs/scripts/deps.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/examples/typegraphs/scripts/deps.ts -------------------------------------------------------------------------------- /examples/typegraphs/scripts/fib.ts: -------------------------------------------------------------------------------- 1 | const CACHE = [1, 1]; 2 | const MAX_CACHE_SIZE = 1000; 3 | 4 | export default function fib({ size }: { size: number }) { 5 | if (size > MAX_CACHE_SIZE) { 6 | throw new Error(`unsupported size ${size} > ${MAX_CACHE_SIZE}`); 7 | } 8 | let i = CACHE.length; 9 | while (i++ < size) { 10 | CACHE.push(CACHE[i - 2] + CACHE[i - 3]); 11 | } 12 | return CACHE.slice(0, size); 13 | } 14 | -------------------------------------------------------------------------------- /examples/typegraphs/scripts/hello.py: -------------------------------------------------------------------------------- 1 | def say_hello(x: any): 2 | return f"Hello {x["name"]}" 3 | -------------------------------------------------------------------------------- /examples/typegraphs/scripts/md2html.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import * as marked from "https://deno.land/x/marked/mod.ts"; 5 | 6 | export function parse({ raw }: { raw: string }): string { 7 | return marked.parse(raw); 8 | } 9 | -------------------------------------------------------------------------------- /examples/typegraphs/scripts/ops.ts: -------------------------------------------------------------------------------- 1 | interface AddInput { 2 | a: number; 3 | b: number; 4 | } 5 | export function doAddition({ a, b }: AddInput) { 6 | return a + b; 7 | } 8 | -------------------------------------------------------------------------------- /examples/typegraphs/triggers.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph, Policy, t, Graph 3 | from typegraph.graph.params import Cors 4 | from typegraph.runtimes.http import HttpRuntime 5 | 6 | 7 | # skip:end 8 | @typegraph( 9 | # skip:start 10 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 11 | # skip:end 12 | ) 13 | def triggers(g: Graph): 14 | # skip:start 15 | public = Policy.public() 16 | http = HttpRuntime("https://random.org/api") 17 | # skip:end 18 | # ... 19 | g.expose( 20 | public, 21 | flip=http.get("/flip_coin", t.struct({}), t.enum(["head", "tail"])), 22 | ) 23 | -------------------------------------------------------------------------------- /examples/typegraphs/triggers.ts: -------------------------------------------------------------------------------- 1 | // skip:start 2 | import { Policy, t, typegraph } from "@typegraph/sdk"; 3 | import { HttpRuntime } from "@typegraph/sdk/runtimes/http"; 4 | 5 | // skip:end 6 | 7 | typegraph( 8 | { 9 | name: "triggers", 10 | // skip:next-line 11 | cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] }, 12 | }, 13 | (g) => { 14 | // skip:start 15 | const pub = Policy.public(); 16 | const http = new HttpRuntime("https://random.org/api"); 17 | // skip:end 18 | // ... 19 | g.expose( 20 | { 21 | flip: http.get(t.struct({}), t.enum_(["head", "tail"]), { 22 | path: "/flip_coin", 23 | }), 24 | }, 25 | pub, 26 | ); 27 | }, 28 | ); 29 | -------------------------------------------------------------------------------- /examples/typegraphs/types.py: -------------------------------------------------------------------------------- 1 | # skip:start 2 | from typegraph import typegraph, t, Graph 3 | from typegraph.graph.params import Cors 4 | 5 | 6 | @typegraph( 7 | cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]), 8 | ) 9 | def types(g: Graph): 10 | # skip:end 11 | t.struct( 12 | { 13 | "id": t.uuid(), 14 | "age": t.integer(), 15 | "cars": t.list( 16 | t.struct( 17 | { 18 | "model": t.string(), 19 | "name": t.string().optional(), 20 | } 21 | ) 22 | ), 23 | } 24 | ) 25 | -------------------------------------------------------------------------------- /rust-toolchain.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | # this is currently tracking the version used by denoland/deno 3 | channel = "1.80.1" 4 | components = ["rustfmt", "clippy"] 5 | targets = ["wasm32-unknown-unknown", "wasm32-wasip1", "wasm32-wasi"] 6 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # format_generated_files=false 2 | -------------------------------------------------------------------------------- /src/meta-cli/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | fn main() -> shadow_rs::SdResult<()> { 5 | shadow_rs::new() 6 | } 7 | -------------------------------------------------------------------------------- /src/meta-cli/src/deploy/actors/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod console; 5 | pub mod discovery; 6 | pub mod task; 7 | mod task_io; 8 | pub mod task_manager; 9 | // #[cfg(feature = "typegate")] 10 | pub mod typegate; 11 | pub mod watcher; 12 | -------------------------------------------------------------------------------- /src/meta-cli/src/deploy/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod actors; 5 | pub mod push; 6 | -------------------------------------------------------------------------------- /src/meta-cli/src/deploy/push/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod pusher; 5 | -------------------------------------------------------------------------------- /src/meta-cli/src/macros.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | // Conversion that preserves source chain 5 | // but not backtraces. 6 | // This can be made a funciton but we have to 7 | // depend on anyhow directly to be able to refer 8 | // to it's Error type. 9 | // https://github.com/eyre-rs/eyre/issues/31 10 | #[macro_export] 11 | macro_rules! anyhow_to_eyre { 12 | () => { 13 | |err| eyre::format_err!(Box::new(err)) 14 | }; 15 | } 16 | 17 | #[macro_export] 18 | macro_rules! map_ferr { 19 | () => { 20 | |err| eyre::format_err!(err) 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /src/meta-cli/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod utils; 5 | -------------------------------------------------------------------------------- /src/meta-cli/src/typegraph/loader/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod discovery; 5 | -------------------------------------------------------------------------------- /src/meta-cli/src/typegraph/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod dependency_graph; 5 | pub mod loader; 6 | pub mod rpc; 7 | -------------------------------------------------------------------------------- /src/meta-cli/src/typegraph/rpc/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod aws; 5 | pub mod core; 6 | pub mod runtimes; 7 | pub mod utils; 8 | 9 | use enum_dispatch::enum_dispatch; 10 | use serde::{Deserialize, Serialize}; 11 | use serde_json::Value; 12 | use typegraph_core::errors::Result; 13 | 14 | #[enum_dispatch] 15 | pub trait RpcDispatch { 16 | fn dispatch(self) -> Result; 17 | } 18 | 19 | #[derive(Debug, Serialize, Deserialize)] 20 | #[enum_dispatch(RpcDispatch)] 21 | #[serde(untagged)] 22 | pub enum RpcCall { 23 | Runtimes(runtimes::RpcCall), 24 | Core(core::RpcCall), 25 | Aws(aws::RpcCall), 26 | Utils(utils::RpcCall), 27 | } 28 | -------------------------------------------------------------------------------- /src/meta-cli/tests/graphs/nested/graph0.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | -------------------------------------------------------------------------------- /src/meta-cli/tests/metatype.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/src/meta-cli/tests/metatype.yml -------------------------------------------------------------------------------- /src/metagen/fixtures/client_ts/deno.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/metagen/fixtures/mat_rust/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | #[rustfmt::skip] 5 | mod fdk; 6 | use fdk::stubs::*; 7 | use fdk::types::*; 8 | use fdk::*; 9 | 10 | init_mat! { 11 | hook: || MatBuilder::new().register_handler(FaasImpl::erased(FaasImpl)) 12 | } 13 | 14 | struct FaasImpl; 15 | 16 | impl MyFaas for FaasImpl { 17 | fn handle(&self, input: MyObj, _cx: Ctx) -> anyhow::Result { 18 | Ok(input) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/metagen/fixtures/placeholder: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/metatypedev/metatype/6f6851cdf8ddfc076a34dfba0fedf20a1d044229/src/metagen/fixtures/placeholder -------------------------------------------------------------------------------- /src/metagen/metatype.yaml: -------------------------------------------------------------------------------- 1 | # used by the fixture typegraphs 2 | # we don't actually need to fill this in since 3 | # we only ever serialize them 4 | -------------------------------------------------------------------------------- /src/metagen/src/fdk_rs/static/Cargo.toml: -------------------------------------------------------------------------------- 1 | package.name = "metagen_fdk_rs_static" 2 | package.edition = "2021" 3 | package.version = "0.0.1" 4 | 5 | [lib] 6 | path = "lib.rs" 7 | crate-type = ["cdylib", "rlib"] 8 | 9 | [dependencies] 10 | metagen-client = { workspace = true } 11 | anyhow.workspace = true 12 | serde.workspace = true 13 | serde_json.workspace = true 14 | wit-bindgen.workspace = true 15 | -------------------------------------------------------------------------------- /src/metagen/src/fdk_rs/static/lib.rs: -------------------------------------------------------------------------------- 1 | mod fdk; 2 | -------------------------------------------------------------------------------- /src/metagen/src/fdk_substantial/static/substantial.py: -------------------------------------------------------------------------------- 1 | from datetime import timedelta 2 | from typing import Any, Callable, Optional 3 | from types import RetryStrategy 4 | 5 | 6 | class Context: 7 | async def save( 8 | self, 9 | f: Callable, 10 | *, 11 | timeout: Optional[timedelta] = None, 12 | retry_strategy: Optional[RetryStrategy] = None, 13 | ): ... 14 | def handle(self, event_name: str, cb: Callable[[Any], Any]): ... 15 | async def ensure(self, f: Callable[[], bool]): ... 16 | async def sleep(self, duration: timedelta) -> Any: ... 17 | async def receive(name: str): ... 18 | 19 | 20 | def workflow(): 21 | def wrapper(f): 22 | pass 23 | 24 | return wrapper 25 | -------------------------------------------------------------------------------- /src/metagen/src/fdk_substantial/static/types.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import Union 3 | 4 | 5 | @dataclass 6 | class RetryStrategy: 7 | max_retries: int 8 | initial_backoff_interval: Union[int, None] 9 | max_backoff_interval: Union[int, None] 10 | -------------------------------------------------------------------------------- /src/metagen/src/fdk_substantial/static/workflow.py: -------------------------------------------------------------------------------- 1 | from substantial import workflow, Context # noqa 2 | from substantial.types import RetryStrategy # noqa 3 | 4 | 5 | @workflow() 6 | def workflow_name(c: Context): 7 | raise NotImplementedError 8 | -------------------------------------------------------------------------------- /src/metagen/src/macros.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | // Conversion that preserves source chain 5 | // but not backtraces. 6 | // This can be made a funciton but we have to 7 | // depend on anyhow directly to be able to refer 8 | // to it's Error type. 9 | // https://github.com/eyre-rs/eyre/issues/31 10 | #[macro_export] 11 | macro_rules! anyhow_to_eyre { 12 | () => { 13 | |err| eyre::format_err!(Box::new(err)) 14 | }; 15 | } 16 | 17 | #[macro_export] 18 | macro_rules! map_ferr { 19 | () => { 20 | |err| eyre::format_err!(err) 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /src/mt_deno/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mt_deno" 3 | edition.workspace = true 4 | version.workspace = true 5 | 6 | [dependencies] 7 | deno.workspace = true 8 | tracing.workspace = true 9 | anyhow.workspace = true 10 | -------------------------------------------------------------------------------- /src/pyrt_wit_wire/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "pyrt_wit_wire" 3 | version = "0.5.1-rc.4" 4 | description = "Wasm component implementing the PythonRuntime host using wit_wire protocol." 5 | license = "MPL-2.0" 6 | readme = "README.md" 7 | 8 | [tool.poetry.dependencies] 9 | python = "^3.9" 10 | 11 | [build-system] 12 | requires = ["poetry-core"] 13 | build-backend = "poetry.core.masonry.api" 14 | -------------------------------------------------------------------------------- /src/substantial/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "substantial" 3 | edition.workspace = true 4 | version.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | chrono.workspace = true 9 | serde.workspace = true 10 | serde_json.workspace = true 11 | uuid.workspace = true 12 | 13 | protobuf = "3.7.1" 14 | # pinned due to url 15 | redis = "=0.25.4" 16 | -------------------------------------------------------------------------------- /src/substantial/protocol/metadata.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package substantial.protos.metadata; 4 | 5 | import "google/protobuf/timestamp.proto"; 6 | 7 | message Info { 8 | string message = 1; 9 | } 10 | message Error { 11 | string message = 1; 12 | string stack = 2; 13 | string type = 3; 14 | } 15 | 16 | message Metadata { 17 | google.protobuf.Timestamp at = 1; 18 | oneof of { 19 | Info info = 10; 20 | Error error = 11; 21 | } 22 | }; 23 | 24 | message Records { 25 | string run_id = 1; 26 | repeated Metadata metadata = 2; 27 | } 28 | -------------------------------------------------------------------------------- /src/substantial/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod backends; 5 | pub mod converters; 6 | pub mod protocol; 7 | -------------------------------------------------------------------------------- /src/substantial/src/protocol/mod.rs: -------------------------------------------------------------------------------- 1 | // @generated 2 | 3 | pub mod events; 4 | pub mod metadata; 5 | -------------------------------------------------------------------------------- /src/typegate/deno.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | // NOTE: avoid adding imports or anything crtiical 3 | // at runtime here since we only have acccess to the import 4 | // map then 5 | "lint": { 6 | "exclude": [], 7 | "rules": { 8 | "include": [ 9 | // FIXME: replace console.log usage with logger 10 | // "no-console" 11 | ], 12 | "exclude": [ 13 | "no-explicit-any" 14 | ] 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/typegate/engine/runtime.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | //! This file provides the import point for types and values defined in: 4 | // - ./00_runtime.js: which is preloaded by the custom deno runtime 5 | // - ./runtime.d.ts: which types the objects from the preload 6 | // 7 | // The preload directly adds the Meta object the global scope but we can hide 8 | // that implementation detail and users will "import" `Meta` from this file instead. 9 | // Or at least that is what will appear to be happening to in the type system. 10 | -------------------------------------------------------------------------------- /src/typegate/engine/src/py_validation.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use std::{fs::File, io::Read}; 5 | 6 | use anyhow::Result; 7 | use rustpython_parser::{ast, Parse}; 8 | 9 | #[rustfmt::skip] 10 | use deno_core as deno_core; 11 | 12 | fn read_file(path: &str) -> Result { 13 | let mut output = String::new(); 14 | let mut file = File::open(path)?; 15 | file.read_to_string(&mut output)?; 16 | Ok(output) 17 | } 18 | 19 | #[deno_core::op2(fast)] 20 | pub fn op_validate(#[string] input: String) -> Result<()> { 21 | let python_source = read_file(&input)?; 22 | ast::Suite::parse(&python_source, "")?; 23 | Ok(()) 24 | } 25 | -------------------------------------------------------------------------------- /src/typegate/engine/src/runtimes.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod grpc; 5 | pub mod prisma; 6 | pub mod substantial; 7 | pub mod temporal; 8 | pub mod wasm; 9 | pub mod wit_wire; 10 | -------------------------------------------------------------------------------- /src/typegate/src/engine/injection/dynamic.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export default { 5 | "now": () => new Date().toISOString(), 6 | // "uuid": () => 7 | } as const; 8 | -------------------------------------------------------------------------------- /src/typegate/src/engine/typecheck/inline_validators/boolean.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import type { BooleanNode } from "../../../typegraph/types.ts"; 5 | import { check } from "./common.ts"; 6 | 7 | export function generateBooleanValidator( 8 | _typeNode: BooleanNode, 9 | varName: string, 10 | path: string, 11 | ): string[] { 12 | return [ 13 | check(`typeof ${varName} === "boolean"`, `Expected boolean at ${path}`), 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /src/typegate/src/engine/typecheck/inline_validators/common.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export function check(condition: string, message: string) { 5 | return `if (!(${condition})) throw new Error(${message});`; 6 | } 7 | -------------------------------------------------------------------------------- /src/typegate/src/engine/typecheck/inline_validators/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | /// These validators are used to generate validator code to be inlined into 5 | /// the generated code. 6 | /// Child nodes are not validated here. Their validators should be inlined. 7 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/deno.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { DenoRuntime } from "./deno/deno.ts"; 5 | import { registerRuntime } from "./mod.ts"; 6 | 7 | registerRuntime("deno")(DenoRuntime); 8 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/deno/hooks/worker.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { toFileUrl } from "@std/path/to-file-url"; 5 | 6 | self.onmessage = async ({ data }: MessageEvent<{ import: string }>) => { 7 | try { 8 | await import(toFileUrl(data.import).toString()); 9 | self.postMessage({ success: true }); 10 | } catch (error) { 11 | self.postMessage({ error }); 12 | } 13 | 14 | self.close(); 15 | }; 16 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/patterns/worker_manager/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export type TaskId = string; 5 | 6 | export interface BaseMessage { 7 | type: string; 8 | } 9 | 10 | export type EventHandler = ( 11 | message: E, 12 | ) => void | Promise; 13 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/prisma.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { registerRuntime } from "./mod.ts"; 5 | import { PrismaRuntime } from "./prisma/mod.ts"; 6 | 7 | registerRuntime("prisma")(PrismaRuntime); 8 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/prisma/hooks/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export { runMigrations } from "./run_migrations.ts"; 5 | export { generateSchema } from "./generate_schema.ts"; 6 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/prisma/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { PrismaRuntime } from "./prisma.ts"; 5 | import { PrismaMigrate, PrismaMigrationRuntime } from "./migration.ts"; 6 | import * as PrismaRT from "./types.ts"; 7 | 8 | export { PrismaMigrate, PrismaMigrationRuntime, PrismaRT, PrismaRuntime }; 9 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/utils/deno.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { ArtifactMeta } from "../../typegate/artifacts/mod.ts"; 5 | import { Artifact } from "../../typegraph/types.ts"; 6 | 7 | export function createArtifactMeta( 8 | typegraphName: string, 9 | artifact: Artifact, 10 | ): ArtifactMeta { 11 | return { 12 | typegraphName, 13 | hash: artifact.hash, 14 | sizeInBytes: artifact.size, 15 | relativePath: artifact.path, 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/typegate/src/runtimes/wasm/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import type { WitOpArgs } from "../../types.ts"; 5 | 6 | export type TaskSpec = { 7 | opName: string; 8 | componentPath: string; 9 | }; 10 | 11 | export type WasmCallMessage = { type: "CALL" } & WitOpArgs; 12 | 13 | export type WasmMessage = 14 | | WasmCallMessage 15 | | { type: "HOSTCALL"; result: any } 16 | | { type: "SHUTDOWN" }; 17 | 18 | export type WasmEvent = 19 | | { type: "SUCCESS"; result: unknown } 20 | | { type: "HOSTCALL"; opName: string; json: string } 21 | | { type: "SHUTDOWN" } 22 | | { type: "FAILURE"; error: string; exception: Error | undefined }; 23 | -------------------------------------------------------------------------------- /src/typegate/src/services/auth/protocols/protocol.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { notFound } from "../../../services/responses.ts"; 5 | 6 | export type TokenMiddlewareOutput = { 7 | claims: Record; 8 | nextToken: string | null; 9 | error: string | null; 10 | }; 11 | 12 | export abstract class Protocol { 13 | protected constructor(public typegraphName: string) {} 14 | 15 | authMiddleware(_request: Request): Promise { 16 | return Promise.resolve(notFound()); 17 | } 18 | 19 | abstract tokenMiddleware( 20 | token: string, 21 | request: Request, 22 | ): Promise; 23 | } 24 | -------------------------------------------------------------------------------- /src/typegate/src/services/auth/routes/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import type { QueryEngine } from "../../../engine/query_engine.ts"; 5 | 6 | export { validate } from "./validate.ts"; 7 | export { take } from "./take.ts"; 8 | 9 | export type RouteParams = { 10 | request: Request; 11 | engine: QueryEngine; 12 | headers: Headers; 13 | }; 14 | -------------------------------------------------------------------------------- /src/typegate/src/sync/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | // 5 | -------------------------------------------------------------------------------- /src/typegate/src/typegate/no_limiter.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { RateLimiter } from "../typegate/rate_limiter.ts"; 5 | 6 | export class NoLimiter extends RateLimiter { 7 | constructor() { 8 | super(); 9 | } 10 | decr(_id: string, n: number): number | null { 11 | return n; 12 | } 13 | currentTokens( 14 | _id: string, 15 | _windowSec: number, 16 | _windowBudget: number, 17 | _maxLocalHit: number, 18 | ): Promise { 19 | return Promise.resolve(1); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/typegate/src/utils/hash.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | // deno-lint-ignore no-external-import 5 | import type { Hash } from "node:crypto"; 6 | 7 | export class HashTransformStream extends TransformStream { 8 | constructor(hash: Hash) { 9 | super({ 10 | transform(chunk, controller) { 11 | hash.update(chunk); 12 | controller.enqueue(chunk); 13 | }, 14 | }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/typegate/standalone/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "typegate" 3 | edition.workspace = true 4 | version.workspace = true 5 | 6 | [dependencies] 7 | colored = "2.1.0" 8 | envconfig = "0.11.0" 9 | sentry = { version = "0.34.0", features = ["anyhow"] } 10 | env_logger.workspace = true 11 | log.workspace = true 12 | typegate_engine.workspace = true 13 | location-macros = "0.1.2" 14 | -------------------------------------------------------------------------------- /src/typegate_api/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "typegate_api" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | tg_schema.workspace = true 8 | anyhow.workspace = true 9 | itertools.workspace = true 10 | indoc.workspace = true 11 | thiserror.workspace = true 12 | serde.workspace = true 13 | serde_json = { workspace = true, features = ["preserve_order"] } 14 | reqwest = { workspace = true, features = ["json"] } 15 | url = { workspace = true, features = ["serde"] } 16 | colored.workspace = true 17 | async-trait.workspace = true 18 | -------------------------------------------------------------------------------- /src/typegate_api/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod graphql; 5 | pub mod node; 6 | 7 | pub use node::{BasicAuth, Node}; 8 | -------------------------------------------------------------------------------- /src/typegraph/core/src/conversion/hash.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::errors::Result; 5 | use crate::typegraph::TypegraphContext; 6 | pub use seahash::SeaHasher as Hasher; 7 | 8 | pub trait Hashable { 9 | fn hash(&self, hasher: &mut Hasher, tg: &mut TypegraphContext) -> Result<()>; 10 | } 11 | -------------------------------------------------------------------------------- /src/typegraph/core/src/conversion/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod hash; 5 | pub mod parameter_transform; 6 | pub mod params; 7 | pub mod policies; 8 | pub mod runtimes; 9 | pub mod types; 10 | -------------------------------------------------------------------------------- /src/typegraph/core/src/params/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod apply; 5 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/count.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::{ 5 | errors::Result, 6 | runtimes::prisma::context::PrismaContext, 7 | t::{self, TypeBuilder as _}, 8 | types::TypeId, 9 | }; 10 | 11 | use super::TypeGen; 12 | 13 | pub struct Count; 14 | 15 | impl TypeGen for Count { 16 | fn generate(&self, context: &PrismaContext) -> Result { 17 | t::optionalx(t::integer()).build_named(self.name(context)?) 18 | } 19 | 20 | fn name(&self, _context: &PrismaContext) -> Result { 21 | Ok("_count".to_string()) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__query_unique_where_expr__test__query_unique_where_expr user.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: typegraph/core/src/runtimes/prisma/type_generation/query_unique_where_expr.rs 3 | expression: "tree::print(ty)" 4 | --- 5 | root: struct 'QueryUniqueUserWhereInput' #9 6 | └─ [id]: optional #8 7 | └─ item: integer #0 8 | 9 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Post inp.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(inp) 4 | --- 5 | root: struct #119 6 | └─ [data]: list #118 7 | └─ item: &Post_create_input #33 8 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Post out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: struct #121 6 | └─ [count]: integer #120 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Record inp.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(inp) 4 | --- 5 | root: struct #15 6 | └─ [data]: list #14 7 | └─ item: struct 'Record_create_input' #13 8 | ├─ [age]: optional #7 9 | │ └─ item: integer #6 10 | ├─ [created_at]: string #1 11 | ├─ [id]: optional #11 12 | │ └─ item: string #4 13 | └─ [name]: string #5 14 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many Record out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: struct #17 6 | └─ [count]: integer #16 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_many User out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: struct #117 6 | └─ [count]: integer #116 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_one Post inp.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(inp) 4 | --- 5 | root: struct #112 6 | └─ [data]: &Post_create_input #30 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__create_one Record inp.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(inp) 4 | --- 5 | root: struct #14 6 | └─ [data]: struct 'Record_create_input' #13 7 | ├─ [age]: optional #7 8 | │ └─ item: integer #6 9 | ├─ [created_at]: string #1 10 | ├─ [id]: optional #11 11 | │ └─ item: string #4 12 | └─ [name]: string #5 13 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_first Post out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #37 6 | └─ item: &Post_output #29 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_first Record out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #13 6 | └─ item: struct 'Record_output' #12 7 | ├─ [age]: optional #7 8 | │ └─ item: integer #6 9 | ├─ [created_at]: string #1 10 | ├─ [id]: string #4 11 | └─ [name]: string #5 12 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_first User out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #36 6 | └─ item: struct 'User_output' #35 7 | ├─ [id]: integer #15 8 | ├─ [name]: string #16 9 | └─ [posts]: list #33 10 | └─ item: struct 'Post_output' #32 11 | ├─ [author]: optional #30 12 | │ └─ item: &User_output #28 13 | ├─ [id]: integer #23 14 | └─ [title]: string #24 15 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Post out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: list #219 6 | └─ item: &Post_with_nested_count #177 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many Record out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: list #109 6 | └─ item: struct 'Record_with_nested_count' #108 7 | ├─ [age]: optional #7 8 | │ └─ item: integer #6 9 | ├─ [created_at]: string #0 10 | ├─ [id]: string #2 11 | └─ [name]: string #5 12 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_many User out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: list #188 6 | └─ item: struct 'User_with_nested_count' #187 7 | ├─ [_count]: struct #185 8 | │ └─ [posts]: optional '_count' #184 9 | │ └─ item: integer #182 10 | ├─ [id]: integer #110 11 | ├─ [name]: string #112 12 | └─ [posts]: list #180 13 | └─ item: struct 'Post_with_nested_count' #179 14 | ├─ [author]: &User #121 15 | ├─ [id]: integer #117 16 | └─ [title]: string #120 17 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Post out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #130 6 | └─ item: &Post_with_nested_count #109 7 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique Record out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #65 6 | └─ item: struct 'Record_with_nested_count' #64 7 | ├─ [age]: optional #7 8 | │ └─ item: integer #6 9 | ├─ [created_at]: string #0 10 | ├─ [id]: string #2 11 | └─ [name]: string #5 12 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__test__find_unique User out.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs 3 | expression: tp.print(out) 4 | --- 5 | root: optional #120 6 | └─ item: struct 'User_with_nested_count' #119 7 | ├─ [_count]: struct #117 8 | │ └─ [posts]: optional '_count' #116 9 | │ └─ item: integer #114 10 | ├─ [id]: integer #66 11 | ├─ [name]: string #68 12 | └─ [posts]: list #112 13 | └─ item: struct 'Post_with_nested_count' #111 14 | ├─ [author]: &User #77 15 | ├─ [id]: integer #73 16 | └─ [title]: string #76 17 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/prisma/type_generation/snapshots/typegraph_core__runtimes__prisma__type_generation__where___test__where Post.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/core/src/runtimes/prisma/type_generation/where_.rs 3 | expression: "tree::print(context.generate(&Where::new(post))?)" 4 | --- 5 | root: &Post_where #70 6 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/python.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::sdk::runtimes::{self as sdk}; 5 | 6 | #[derive(Debug)] 7 | pub enum PythonMaterializer { 8 | Lambda(sdk::MaterializerPythonLambda), 9 | Def(sdk::MaterializerPythonDef), 10 | Module(sdk::MaterializerPythonModule), 11 | Import(sdk::MaterializerPythonImport), 12 | } 13 | -------------------------------------------------------------------------------- /src/typegraph/core/src/runtimes/wasm.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::sdk::runtimes as sdk; 5 | 6 | #[derive(Debug)] 7 | pub enum WasmMaterializer { 8 | ReflectedFunc(sdk::MaterializerWasmReflectedFunc), 9 | WireHandler(sdk::MaterializerWasmWireHandler), 10 | } 11 | -------------------------------------------------------------------------------- /src/typegraph/core/src/typedef/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod boolean; 5 | pub mod either; 6 | pub mod file; 7 | pub mod float; 8 | pub mod func; 9 | pub mod integer; 10 | pub mod list; 11 | pub mod optional; 12 | pub mod string; 13 | pub mod struct_; 14 | pub mod union; 15 | -------------------------------------------------------------------------------- /src/typegraph/core/src/types/sdk/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod aws; 5 | pub mod core; 6 | pub mod runtimes; 7 | pub mod utils; 8 | pub use self::core::Error; 9 | -------------------------------------------------------------------------------- /src/typegraph/core/src/types/type_ref/runtime_config.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use super::{RefAttr, TypeRef}; 5 | use crate::errors::{Result, TgError}; 6 | use crate::types::Type; 7 | 8 | pub trait WithRuntimeConfig { 9 | fn with_config(self, runtime_config: serde_json::Value) -> Result; 10 | } 11 | 12 | impl WithRuntimeConfig for T 13 | where 14 | T: TryInto, 15 | { 16 | fn with_config(self, runtime_config: serde_json::Value) -> Result { 17 | TypeRef::from_type(self.try_into()?, RefAttr::runtime("", runtime_config)).register() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/typegraph/core/src/utils/pathlib.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::errors::{Result, TgError}; 5 | use std::path::{Path, PathBuf}; 6 | 7 | #[derive(Clone, Debug)] 8 | pub struct PathLib { 9 | base_dir: PathBuf, 10 | } 11 | 12 | impl PathLib { 13 | pub fn new(base_dir: PathBuf) -> Self { 14 | Self { base_dir } 15 | } 16 | 17 | pub fn get_base_dir(&self) -> &PathBuf { 18 | &self.base_dir 19 | } 20 | 21 | pub fn relative(&self, path: &Path) -> Result { 22 | path.strip_prefix(&self.base_dir) 23 | .map(|r| r.to_path_buf()) 24 | .map_err(TgError::from_std) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/typegraph/core/src/validation/errors.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::sdk::core::Error; 5 | 6 | // pub fn invalid_runtime_type(runtime: &str, materializer: &str) -> Error { 7 | // format!( 8 | // "invalid runtime type {} for materializer {}", 9 | // runtime, materializer 10 | // ) 11 | // } 12 | 13 | pub fn invalid_output_type_predefined(name: &str, expected: &str, got: &str) -> Error { 14 | format!( 15 | "invalid output type for predefined function {}: expected {}, got {}", 16 | name, expected, got 17 | ) 18 | .into() 19 | } 20 | -------------------------------------------------------------------------------- /src/typegraph/core/src/validation/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | pub mod errors; 5 | pub mod materializers; 6 | pub mod types; 7 | 8 | use once_cell::sync::Lazy; 9 | use regex::Regex; 10 | 11 | static NAME_REGEX: Lazy = Lazy::new(|| Regex::new(r"^[_a-zA-Z0-9]+$").unwrap()); 12 | 13 | pub fn validate_name(name: &str) -> bool { 14 | NAME_REGEX.is_match(name) 15 | } 16 | -------------------------------------------------------------------------------- /src/typegraph/deno/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import * as t from "./types.ts"; 5 | import { typegraph } from "./typegraph.ts"; 6 | import Policy from "./policy.ts"; 7 | import * as fx from "./effects.ts"; 8 | 9 | export { fx, Policy, t, typegraph }; 10 | -------------------------------------------------------------------------------- /src/typegraph/deno/src/runtimes/grpc.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { Func } from "../types.ts"; 5 | import { runtimes } from "../sdk.ts"; 6 | import { Runtime } from "./mod.ts"; 7 | 8 | export class GrpcRuntime extends Runtime { 9 | constructor(protoFile: string, endpoint: string) { 10 | const id = runtimes.registerGrpcRuntime({ 11 | protoFile, 12 | endpoint, 13 | }); 14 | super(id); 15 | } 16 | 17 | call(method: string): Func { 18 | const funcData = runtimes.callGrpcMethod(this._id, { method: method }); 19 | return Func.fromTypeFunc(funcData); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/typegraph/deno/src/runtimes/mod.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export class Runtime { 5 | constructor(public readonly _id: number) {} 6 | } 7 | 8 | export interface Materializer { 9 | _id: number; 10 | } 11 | -------------------------------------------------------------------------------- /src/typegraph/deno/src/sdk.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import * as core from "./gen/core.ts"; 5 | import * as runtimes from "./gen/runtimes.ts"; 6 | import * as aws from "./gen/aws.ts"; 7 | import * as sdkUtils from "./gen/utils.ts"; 8 | 9 | export { aws, core, runtimes, sdkUtils }; 10 | 11 | export type { Cors, Rate } from "./gen/core.ts"; 12 | export type { Auth, AuthProtocol } from "./gen/utils.ts"; 13 | -------------------------------------------------------------------------------- /src/typegraph/graph/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "typegraph" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | tg_schema.workspace = true 8 | serde.workspace = true 9 | serde_json.workspace = true 10 | enum_dispatch.workspace = true 11 | indexmap.workspace = true 12 | paste.workspace = true 13 | color-eyre.workspace = true 14 | tracing.workspace = true 15 | derive_more.workspace = true 16 | 17 | [dev-dependencies] 18 | insta.workspace = true 19 | -------------------------------------------------------------------------------- /src/typegraph/graph/src/engines/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | mod duplication; 5 | mod naming; 6 | 7 | pub use duplication::*; 8 | pub use naming::*; 9 | -------------------------------------------------------------------------------- /src/typegraph/graph/src/key.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use crate::DupKey; 5 | 6 | #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] 7 | pub struct TypeKey(pub u32, pub u32); // Type idx and an variant id (duplicate id) 8 | 9 | impl TypeKey { 10 | pub fn original(&self) -> Self { 11 | Self(self.0, 0) 12 | } 13 | } 14 | 15 | impl std::fmt::Debug for TypeKey { 16 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 17 | write!(f, "Ty_{}/{}", self.0, self.1) 18 | } 19 | } 20 | 21 | #[derive(Debug, PartialEq)] 22 | pub struct TypeKeyEx(pub u32, pub K); 23 | -------------------------------------------------------------------------------- /src/typegraph/graph/src/types/boolean.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use super::interlude::*; 5 | 6 | #[derive(Debug)] 7 | pub struct BooleanType { 8 | pub base: TypeBase, 9 | } 10 | 11 | impl TypeNode for Arc { 12 | fn base(&self) -> &super::TypeBase { 13 | &self.base 14 | } 15 | 16 | fn tag(&self) -> &'static str { 17 | "boolean" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/typegraph/graph/tests/snapshots/expanded__expanded_graph-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/graph/tests/expanded.rs 3 | expression: "tg.functions.iter().map(|(idx, func)|\n { (idx, func.name()) }).collect::>()" 4 | --- 5 | { 6 | 1: "root_one_fn", 7 | 8: "root_two_fn", 8 | 10: "root_three_fn", 9 | } 10 | -------------------------------------------------------------------------------- /src/typegraph/graph/tests/snapshots/expanded__expanded_graph-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/graph/tests/expanded.rs 3 | expression: "tg.input_types.iter().map(|(idx, ty)|\n { (idx, (ty.tag(), ty.name())) }).collect::>()" 4 | --- 5 | { 6 | Ty_2/0: ( 7 | "object", 8 | "OneInput", 9 | ), 10 | Ty_3/0: ( 11 | "string", 12 | "string_3fb09", 13 | ), 14 | Ty_9/0: ( 15 | "object", 16 | "TwoInput", 17 | ), 18 | Ty_11/0: ( 19 | "object", 20 | "root_three_fn_input", 21 | ), 22 | } 23 | -------------------------------------------------------------------------------- /src/typegraph/graph/tests/snapshots/expanded__expanded_graph-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/graph/tests/expanded.rs 3 | expression: "tg.output_types.iter().map(|(idx, ty)|\n { (idx, (ty.tag(), ty.name())) }).collect::>()" 4 | --- 5 | { 6 | Ty_3/0: ( 7 | "string", 8 | "string_3fb09", 9 | ), 10 | Ty_4/0: ( 11 | "list", 12 | "root_one_fn_output", 13 | ), 14 | Ty_5/0: ( 15 | "object", 16 | "Student", 17 | ), 18 | Ty_6/0: ( 19 | "integer", 20 | "Student_id_integer", 21 | ), 22 | Ty_7/0: ( 23 | "optional", 24 | "Student_peers_placeholder_optional", 25 | ), 26 | } 27 | -------------------------------------------------------------------------------- /src/typegraph/graph/tests/snapshots/expanded__expanded_graph.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/typegraph/graph/tests/expanded.rs 3 | expression: "tg.namespace_objects.iter().map(|(ns, obj)|\n { (ns.join(\"/\"), obj.name()) }).collect::>()" 4 | --- 5 | { 6 | "": "example-metagen", 7 | } 8 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | from typegraph.graph.typegraph import typegraph, Graph # noqa 5 | from typegraph.policy import Policy # noqa 6 | from typegraph import effects as fx # noqa 7 | 8 | version = "0.5.1-rc.4" 9 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/g.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | from typegraph.policy import Policy # noqa 5 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/providers/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | from typegraph.providers.aws import S3Runtime # noqa 5 | from typegraph.providers.prisma import PrismaRuntime # noqa 6 | from typegraph.providers.temporal import TemporalRuntime # noqa 7 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/runtimes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | from typegraph.runtimes.deno import DenoRuntime # noqa 5 | from typegraph.runtimes.graphql import GraphQLRuntime # noqa 6 | from typegraph.runtimes.random import RandomRuntime # noqa 7 | from typegraph.runtimes.http import HttpRuntime # noqa 8 | from typegraph.runtimes.python import PythonRuntime # noqa 9 | from typegraph.runtimes.random import RandomRuntime # noqa 10 | from typegraph.runtimes.wasm import WasmRuntime # noqa 11 | from typegraph.runtimes.kv import KvRuntime # noqa 12 | from typegraph.runtimes.grpc import GrpcRuntime # noqa 13 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/runtimes/base.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | from dataclasses import dataclass 5 | 6 | from typegraph.gen.core import MaterializerId, RuntimeId 7 | from typegraph.gen.runtimes import Effect 8 | 9 | 10 | @dataclass 11 | class Runtime: 12 | id: RuntimeId 13 | 14 | 15 | @dataclass 16 | class Materializer: 17 | id: MaterializerId 18 | effect: Effect 19 | -------------------------------------------------------------------------------- /src/typegraph/python/typegraph/sdk.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | import typegraph.gen.aws as aws 5 | import typegraph.gen.core as core 6 | import typegraph.gen.runtimes as runtimes 7 | import typegraph.gen.utils as utils 8 | 9 | aws = aws 10 | core = core 11 | runtimes = runtimes 12 | sdk_utils = utils 13 | -------------------------------------------------------------------------------- /src/typegraph/schema/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tg_schema" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | # patterns 8 | anyhow.workspace = true 9 | # itertools.workspace = true 10 | # indoc.workspace = true 11 | # thiserror.workspace = true 12 | 13 | 14 | # encoding 15 | # base64.workspace = true 16 | # flate2.workspace = true 17 | # tar.workspace = true 18 | 19 | serde.workspace = true 20 | serde_json = { workspace = true, features = ["preserve_order"] } 21 | serde_with.workspace = true 22 | 23 | 24 | # ds 25 | indexmap.workspace = true 26 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/graphql.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct GraphQLRuntimeData { 8 | pub endpoint: String, // url?? 9 | } 10 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/grpc.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct GrpcRuntimeData { 8 | pub proto_file_content: String, 9 | pub endpoint: String, 10 | } 11 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/http.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct HTTPRuntimeData { 8 | pub endpoint: String, // URL 9 | pub cert_secret: Option, 10 | pub basic_auth_secret: Option, 11 | } 12 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/kv.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct KvRuntimeData { 8 | pub url: String, 9 | } 10 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/python.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use std::path::PathBuf; 5 | 6 | use serde::{Deserialize, Serialize}; 7 | 8 | #[derive(Serialize, Deserialize, Clone, Debug)] 9 | #[serde(rename_all = "camelCase")] 10 | pub struct ModuleMatData { 11 | pub entry_point: PathBuf, 12 | pub deps: Vec, 13 | } 14 | 15 | #[derive(Serialize, Deserialize, Clone, Debug)] 16 | pub struct PythonRuntimeData { 17 | pub config: Option, // (pre-commit fails on empty interfaces otherwise) 18 | } 19 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/random.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct RandomRuntimeData { 8 | pub seed: Option, 9 | pub reset: Option, 10 | } 11 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/temporal.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | 6 | #[derive(Serialize, Deserialize, Clone, Debug)] 7 | pub struct TemporalRuntimeData { 8 | pub name: String, 9 | pub host_secret: String, 10 | pub namespace_secret: Option, 11 | // pub task_queue_secret: Option, 12 | } 13 | -------------------------------------------------------------------------------- /src/typegraph/schema/src/runtimes/wasm.rs: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | use serde::{Deserialize, Serialize}; 5 | use std::path::PathBuf; 6 | 7 | #[derive(Serialize, Deserialize, Clone, Debug)] 8 | #[serde(rename_all = "camelCase")] 9 | pub struct WasmMatData { 10 | pub op_name: String, 11 | } 12 | 13 | #[derive(Serialize, Deserialize, Clone, Debug)] 14 | pub struct WasmRuntimeData { 15 | pub wasm_artifact: PathBuf, 16 | } 17 | -------------------------------------------------------------------------------- /src/typegraph/specs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | __pycache__ 3 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/deno.jsonc: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/rpc/python/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/rpc/python/client_mock.py: -------------------------------------------------------------------------------- 1 | # Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | # SPDX-License-Identifier: MPL-2.0 3 | 4 | import json 5 | 6 | from client import rpc_request 7 | 8 | 9 | first = rpc_request("hello", {"name": "world"}) 10 | second = rpc_request("foo") 11 | 12 | print(json.dumps({"first": first, "second": second})) 13 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/rpc/tests/utils.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | async function readOutput(reader: ReadableStreamDefaultReader) { 5 | const decoder = new TextDecoder("utf-8"); 6 | const buffer = await reader.read(); 7 | const decoded = decoder.decode(buffer.value); 8 | 9 | return decoded; 10 | } 11 | 12 | async function writeToInput( 13 | writer: WritableStreamDefaultWriter, 14 | value: string, 15 | ) { 16 | const encoder = new TextEncoder(); 17 | const encoded = encoder.encode(value); 18 | await writer.write(encoded); 19 | } 20 | 21 | export { readOutput, writeToInput }; 22 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/rpc/typescript/client_mock.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { rpcRequest } from "./client.ts"; 5 | 6 | const first = rpcRequest("hello", { name: "world" }); 7 | const second = rpcRequest("foo"); 8 | 9 | console.log(JSON.stringify({ first, second })); 10 | -------------------------------------------------------------------------------- /src/typegraph/specs/codegen/tg-codegen: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT_DIR=$(dirname "$(realpath "$0")") 4 | 5 | DENO_PERMISSIONS=( 6 | --allow-env 7 | --allow-write 8 | --allow-read 9 | --allow-ffi 10 | --allow-run 11 | ) 12 | 13 | deno run ${DENO_PERMISSIONS[*]} "$SCRIPT_DIR/src/cmd/main.ts" "$1" "$2" 14 | -------------------------------------------------------------------------------- /src/typegraph/specs/types/primitives.d.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | type UInt = number; 5 | type SInt = number; 6 | type Float = number; 7 | 8 | // TODO: Replace JSON represented by `string` with `any` 9 | // type Json = any; 10 | 11 | export type { UInt, Float, SInt }; 12 | -------------------------------------------------------------------------------- /src/utils/archive/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "archive_utils" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | base64.workspace = true 9 | flate2.workspace = true 10 | tar.workspace = true 11 | indexmap.workspace = true 12 | ignore.workspace = true 13 | -------------------------------------------------------------------------------- /src/utils/grpc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "grpc_utils" 3 | version.workspace = true 4 | edition.workspace = true 5 | 6 | [dependencies] 7 | anyhow.workspace = true 8 | protobuf.workspace = true 9 | proto-parser.workspace = true 10 | -------------------------------------------------------------------------------- /src/wit/deps.toml: -------------------------------------------------------------------------------- 1 | cli = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz" 2 | -------------------------------------------------------------------------------- /src/wit/deps/cli/command.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.0; 2 | 3 | world command { 4 | include imports; 5 | 6 | export run; 7 | } 8 | -------------------------------------------------------------------------------- /src/wit/deps/cli/exit.wit: -------------------------------------------------------------------------------- 1 | interface exit { 2 | /// Exit the current instance and any linked instances. 3 | exit: func(status: result); 4 | } 5 | -------------------------------------------------------------------------------- /src/wit/deps/cli/imports.wit: -------------------------------------------------------------------------------- 1 | package wasi:cli@0.2.0; 2 | 3 | world imports { 4 | include wasi:clocks/imports@0.2.0; 5 | include wasi:filesystem/imports@0.2.0; 6 | include wasi:sockets/imports@0.2.0; 7 | include wasi:random/imports@0.2.0; 8 | include wasi:io/imports@0.2.0; 9 | 10 | import environment; 11 | import exit; 12 | import stdin; 13 | import stdout; 14 | import stderr; 15 | import terminal-input; 16 | import terminal-output; 17 | import terminal-stdin; 18 | import terminal-stdout; 19 | import terminal-stderr; 20 | } 21 | -------------------------------------------------------------------------------- /src/wit/deps/cli/run.wit: -------------------------------------------------------------------------------- 1 | interface run { 2 | /// Run the program. 3 | run: func() -> result; 4 | } 5 | -------------------------------------------------------------------------------- /src/wit/deps/cli/stdio.wit: -------------------------------------------------------------------------------- 1 | interface stdin { 2 | use wasi:io/streams@0.2.0.{input-stream}; 3 | 4 | get-stdin: func() -> input-stream; 5 | } 6 | 7 | interface stdout { 8 | use wasi:io/streams@0.2.0.{output-stream}; 9 | 10 | get-stdout: func() -> output-stream; 11 | } 12 | 13 | interface stderr { 14 | use wasi:io/streams@0.2.0.{output-stream}; 15 | 16 | get-stderr: func() -> output-stream; 17 | } 18 | -------------------------------------------------------------------------------- /src/wit/deps/clocks/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:clocks@0.2.0; 2 | 3 | world imports { 4 | import monotonic-clock; 5 | import wall-clock; 6 | } 7 | -------------------------------------------------------------------------------- /src/wit/deps/filesystem/preopens.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.0; 2 | 3 | interface preopens { 4 | use types.{descriptor}; 5 | 6 | /// Return the set of preopened directories, and their path. 7 | get-directories: func() -> list>; 8 | } 9 | -------------------------------------------------------------------------------- /src/wit/deps/filesystem/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:filesystem@0.2.0; 2 | 3 | world imports { 4 | import types; 5 | import preopens; 6 | } 7 | -------------------------------------------------------------------------------- /src/wit/deps/io/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:io@0.2.0; 2 | 3 | world imports { 4 | import streams; 5 | import poll; 6 | } 7 | -------------------------------------------------------------------------------- /src/wit/deps/random/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:random@0.2.0; 2 | 3 | world imports { 4 | import random; 5 | import insecure; 6 | import insecure-seed; 7 | } 8 | -------------------------------------------------------------------------------- /src/wit/deps/sockets/instance-network.wit: -------------------------------------------------------------------------------- 1 | 2 | /// This interface provides a value-export of the default network handle.. 3 | interface instance-network { 4 | use network.{network}; 5 | 6 | /// Get a handle to the default network. 7 | instance-network: func() -> network; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/wit/deps/sockets/world.wit: -------------------------------------------------------------------------------- 1 | package wasi:sockets@0.2.0; 2 | 3 | world imports { 4 | import instance-network; 5 | import network; 6 | import udp; 7 | import udp-create-socket; 8 | import tcp; 9 | import tcp-create-socket; 10 | import ip-name-lookup; 11 | } 12 | -------------------------------------------------------------------------------- /src/xtask/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "xtask" 3 | version = "0.5.1-rc.4" 4 | edition = "2021" 5 | 6 | # this allows us to exclude the rust files 7 | # from the dockerfile while keeping the Cargo.toml 8 | # for cargo chef. Useful to improve cache hit in docker 9 | [[bin]] 10 | name = "xtask" 11 | path = "src/main.rs" 12 | 13 | [dependencies] 14 | anyhow.workspace = true 15 | clap = { workspace = true, features = ["derive"] } 16 | mt_deno.workspace = true 17 | typegate_engine.workspace = true 18 | log.workspace = true 19 | color-eyre.workspace = true 20 | tracing-subscriber.workspace = true 21 | tracing-error.workspace = true 22 | -------------------------------------------------------------------------------- /tests/auto/auto_test.ts_: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | import { dirname, fromFileUrl, join } from "std/path/mod.ts"; 5 | import { Meta } from "../utils/mod.ts"; 6 | 7 | const localDir = dirname(fromFileUrl(import.meta.url)); 8 | 9 | await Meta.autoTest(localDir); 10 | 11 | const websiteDir = join(localDir, "../../../docs/metatype.dev"); 12 | 13 | await Meta.autoTest(websiteDir); 14 | -------------------------------------------------------------------------------- /tests/auto/test/test-1.graphql: -------------------------------------------------------------------------------- 1 | query { 2 | test(a: 2) { 3 | a 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/docs/how-tos/prog_deploy/scripts/say_hello.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export function sayHello() { 5 | return "Hell0"; 6 | } 7 | -------------------------------------------------------------------------------- /tests/e2e/cli/.gitignore: -------------------------------------------------------------------------------- 1 | /migration*.py 2 | -------------------------------------------------------------------------------- /tests/e2e/cli/artifacts/ops.ts: -------------------------------------------------------------------------------- 1 | // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | export function add({ lhs, rhs }: { lhs: number; rhs: number }) { 5 | return lhs + rhs; 6 | } 7 | -------------------------------------------------------------------------------- /tests/e2e/cli/select.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # select option 4 | # usage: 5 | # > ./select.sh