diff --git a/.ghjk/lock.json b/.ghjk/lock.json
index 42b6632380..b6d7d950ac 100644
--- a/.ghjk/lock.json
+++ b/.ghjk/lock.json
@@ -724,6 +724,55 @@
"crateName": "cargo-udeps",
"locked": true,
"specifiedVersion": true
+ },
+ "bciqk32ytmretqjmmjadp4n5737sifnbyxdqkvkq6lvg3w5rxmsku57y": {
+ "version": "1.1.388",
+ "buildDepConfigs": {
+ "cpy_bs_ghrel": {
+ "version": "3.12.5",
+ "buildDepConfigs": {
+ "tar_aa": {
+ "version": "1.34",
+ "buildDepConfigs": {},
+ "portRef": "tar_aa@0.1.0",
+ "specifiedVersion": false
+ },
+ "zstd_aa": {
+ "version": "v1.4.8,",
+ "buildDepConfigs": {},
+ "portRef": "zstd_aa@0.1.0",
+ "specifiedVersion": false
+ }
+ },
+ "portRef": "cpy_bs_ghrel@0.1.0",
+ "releaseTag": "20240814",
+ "specifiedVersion": true
+ }
+ },
+ "portRef": "pipi_pypi@0.1.0",
+ "packageName": "pyright",
+ "specifiedVersion": true
+ },
+ "bciqon5lanvscx2pvfxplu3yftfwyqb2sc7d7ju7veqbfhraw2okw4xa": {
+ "version": "1.1.388",
+ "buildDepConfigs": {
+ "node_org": {
+ "version": "v20.8.0",
+ "buildDepConfigs": {
+ "tar_aa": {
+ "version": "1.34",
+ "buildDepConfigs": {},
+ "portRef": "tar_aa@0.1.0",
+ "specifiedVersion": false
+ }
+ },
+ "portRef": "node_org@0.1.0",
+ "specifiedVersion": true
+ }
+ },
+ "portRef": "npmi_npm@0.1.0",
+ "packageName": "pyright",
+ "specifiedVersion": true
}
}
},
@@ -770,6 +819,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
@@ -806,6 +856,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
@@ -830,6 +881,7 @@
"installs": [
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a"
],
@@ -870,6 +922,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
@@ -884,6 +937,7 @@
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
@@ -898,6 +952,7 @@
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
@@ -925,6 +980,7 @@
"bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
@@ -951,6 +1007,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
@@ -2798,6 +2855,41 @@
},
"packageName": "ruff"
},
+ "bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi": {
+ "version": "1.1.388",
+ "port": {
+ "ty": "denoWorker@v1",
+ "name": "npmi_npm",
+ "platforms": [
+ "x86_64-linux",
+ "aarch64-linux",
+ "x86_64-darwin",
+ "aarch64-darwin",
+ "x86_64-windows",
+ "aarch64-windows",
+ "x86_64-freebsd",
+ "aarch64-freebsd",
+ "x86_64-netbsd",
+ "aarch64-netbsd",
+ "x86_64-aix",
+ "aarch64-aix",
+ "x86_64-solaris",
+ "aarch64-solaris",
+ "x86_64-illumos",
+ "aarch64-illumos",
+ "x86_64-android",
+ "aarch64-android"
+ ],
+ "version": "0.1.0",
+ "buildDeps": [
+ {
+ "name": "node_org"
+ }
+ ],
+ "moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts"
+ },
+ "packageName": "pyright"
+ },
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy": {
"version": "1.8.3",
"port": {
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b3b0e85b3f..63bc51f0b7 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -28,19 +28,25 @@ repos:
- id: deno-fmt
name: Deno format
language: system
- entry: bash -c 'cd src/typegate && deno fmt --ignore=native,src/typegraphs,tmp,tests/e2e/nextjs,tests/metagen/typegraphs/sample/ts/client.ts && cd ../../tools && deno fmt && cd ../src/typegraph/deno && deno fmt --ignore=node_modules,dist && cd ../../../src/metagen/src && deno fmt'
+ entry: bash -c 'deno fmt'
pass_filenames: false
types:
+ - javascript
- ts
- files: ^(src/typegate|tools|src/typegraph/deno)/
+ - tsx
+ - json
+ - yaml
- id: deno-lint
name: Deno lint
language: system
- entry: bash -c 'cd src/typegate && deno lint --rules-exclude=no-explicit-any --ignore=native,tmp,tests/e2e/nextjs && cd ../../tools && deno lint && cd ../src/metagen/src/ && deno lint'
+ entry: bash -c 'deno lint'
pass_filenames: false
types:
+ - javascript
- ts
- files: ^(src/typegate|tools)/
+ - tsx
+ - json
+ - yaml
- id: es-lint
name: Eslint website
language: system
@@ -49,16 +55,7 @@ repos:
types_or:
- ts
- tsx
- files: ^website/
- exclude: ^website/typegraphs/
- - id: devtools-lint
- name: ESLint meta-lsp
- language: system
- entry: bash -c 'cd meta-lsp && pnpm lint'
- pass_filenames: false
- types:
- - ts
- files: ^meta-lsp/
+ files: ^docs/metatype.dev
#- id: cargo-udeps
# name: Check for unused cargo dependencies
# language: system
@@ -66,6 +63,13 @@ repos:
# pass_filenames: false
# types:
# - toml
+ # - id: pyright
+ # name: Pyright type check
+ # language: system
+ # entry: bash -c 'pyright'
+ # pass_filenames: false
+ # types:
+ # - python
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
@@ -87,9 +91,9 @@ repos:
.*deno.lock|
CHANGELOG.md|
.*\.snap$|
- typegate/src/typegraphs/.*\.json|
- website/docs/reference/|
- libs/pyrt_wit_wire/pyrt|
+ src/typegate/src/typegraphs/.*\.json|
+ docs/metatype.dev/reference/|
+ src/pyrt_wit_wire/pyrt|
migration_lock.toml|
tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py]
)
@@ -105,7 +109,7 @@ repos:
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- python
- files: ^typegraph/
+ exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 rust"
args:
@@ -116,38 +120,7 @@ repos:
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
- files: ^(typegate|libs!(/metagen/.*))/
- - id: insert-license
- name: "License MPL-2.0 rust"
- args:
- #- --remove-header
- - --license-filepath=tools/license-header-MPL-2.0.txt
- - "--comment-style=//"
- - "--skip-license-insertion-comment=no-auto-license-header"
- types_or:
- - rust
- files: ^(meta-cli|typegraph|libs/metagen)/
- - id: insert-license
- name: "License MPL-2.0 deno"
- args:
- #- --remove-header
- - --license-filepath=tools/license-header-MPL-2.0.txt
- - "--comment-style=//"
- - "--skip-license-insertion-comment=no-auto-license-header"
- - "--skip-license-insertion-comment=@generated"
- types_or:
- - ts
- files: ^(typegate|tools)/
- - id: insert-license
- name: "License MPL-2.0 deno"
- args:
- #- --remove-header
- - --license-filepath=tools/license-header-MPL-2.0.txt
- - "--comment-style=//"
- - "--skip-license-insertion-comment=no-auto-license-header"
- types_or:
- - ts
- files: ^typegraph/
+ exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 typescript"
args:
@@ -158,8 +131,7 @@ repos:
types_or:
- ts
- tsx
- files: ^website/
- exclude: website/typegraphs
+ exclude: ^examples/
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index e93f836096..fcada10e0c 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,19 +1,19 @@
{
- "recommendations": [
- "charliermarsh.ruff",
- "rust-lang.rust-analyzer",
- "ms-python.black-formatter",
- "denoland.vscode-deno",
- "ms-vscode-remote.remote-containers",
- "dbaeumer.vscode-eslint",
- "graphql.vscode-graphql-syntax",
- "unifiedjs.vscode-mdx",
- "ms-python.vscode-pylance",
- "ms-python.python",
- "chrischinchilla.vale-vscode",
- "hediet.vscode-drawio",
- "davidlday.languagetool-linter",
- "dtsvet.vscode-wasm",
- "bierner.comment-tagged-templates"
- ]
+ "recommendations": [
+ "charliermarsh.ruff",
+ "rust-lang.rust-analyzer",
+ "ms-python.black-formatter",
+ "denoland.vscode-deno",
+ "ms-vscode-remote.remote-containers",
+ "dbaeumer.vscode-eslint",
+ "graphql.vscode-graphql-syntax",
+ "unifiedjs.vscode-mdx",
+ "ms-python.vscode-pylance",
+ "ms-python.python",
+ "chrischinchilla.vale-vscode",
+ "hediet.vscode-drawio",
+ "davidlday.languagetool-linter",
+ "dtsvet.vscode-wasm",
+ "bierner.comment-tagged-templates"
+ ]
}
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 147a4fe4df..65afc1ad85 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,33 +1,33 @@
-// A launch configuration that compiles the extension and then opens it inside a new window
-{
- "version": "0.2.0",
- "configurations": [
- {
- "type": "extensionHost",
- "request": "launch",
- "name": "Launch Client",
- "runtimeExecutable": "${execPath}",
- "args": [
- "--extensionDevelopmentPath=${workspaceRoot}/meta-lsp"
- ],
- "outFiles": [
- "${workspaceRoot}/meta-lsp/vscode-metatype-support/out/**/*.js"
- ],
- "preLaunchTask": "vscode-ext:build"
- },
- {
- "name": "Language Server E2E Test",
- "type": "extensionHost",
- "request": "launch",
- "runtimeExecutable": "${execPath}",
- "args": [
- "--extensionDevelopmentPath=${workspaceRoot}",
- "--extensionTestsPath=${workspaceRoot}/client/out/test/index",
- "${workspaceRoot}/client/testFixture"
- ],
- "outFiles": [
- "${workspaceRoot}/client/out/test/**/*.js"
- ]
- }
- ]
+// A launch configuration that compiles the extension and then opens it inside a new window
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "extensionHost",
+ "request": "launch",
+ "name": "Launch Client",
+ "runtimeExecutable": "${execPath}",
+ "args": [
+ "--extensionDevelopmentPath=${workspaceRoot}/meta-lsp"
+ ],
+ "outFiles": [
+ "${workspaceRoot}/meta-lsp/vscode-metatype-support/out/**/*.js"
+ ],
+ "preLaunchTask": "vscode-ext:build"
+ },
+ {
+ "name": "Language Server E2E Test",
+ "type": "extensionHost",
+ "request": "launch",
+ "runtimeExecutable": "${execPath}",
+ "args": [
+ "--extensionDevelopmentPath=${workspaceRoot}",
+ "--extensionTestsPath=${workspaceRoot}/client/out/test/index",
+ "${workspaceRoot}/client/testFixture"
+ ],
+ "outFiles": [
+ "${workspaceRoot}/client/out/test/**/*.js"
+ ]
+ }
+ ]
}
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 007fee01bc..554966b00d 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -1,46 +1,46 @@
-{
- "version": "2.0.0",
- "tasks": [
- {
- "label": "vscode-ext:build",
- "type": "shell",
- "command": "pnpm",
- "args": [
- "compile:vscode"
- ],
- "group": "build",
- "presentation": {
- "panel": "dedicated",
- "reveal": "never"
- },
- "problemMatcher": [
- "$tsc"
- ],
- "options": {
- "cwd": "${workspaceFolder}/meta-lsp"
- }
- },
- {
- "label": "vscode-ext:build:watch",
- "type": "shell",
- "command": "pnpm",
- "args": [
- "watch"
- ],
- "isBackground": true,
- "group": {
- "kind": "build"
- },
- "presentation": {
- "panel": "dedicated",
- "reveal": "never"
- },
- "problemMatcher": [
- "$tsc-watch"
- ],
- "options": {
- "cwd": "${workspaceFolder}/meta-lsp/vscode-metatype-support"
- }
- }
- ]
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "vscode-ext:build",
+ "type": "shell",
+ "command": "pnpm",
+ "args": [
+ "compile:vscode"
+ ],
+ "group": "build",
+ "presentation": {
+ "panel": "dedicated",
+ "reveal": "never"
+ },
+ "problemMatcher": [
+ "$tsc"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/meta-lsp"
+ }
+ },
+ {
+ "label": "vscode-ext:build:watch",
+ "type": "shell",
+ "command": "pnpm",
+ "args": [
+ "watch"
+ ],
+ "isBackground": true,
+ "group": {
+ "kind": "build"
+ },
+ "presentation": {
+ "panel": "dedicated",
+ "reveal": "never"
+ },
+ "problemMatcher": [
+ "$tsc-watch"
+ ],
+ "options": {
+ "cwd": "${workspaceFolder}/meta-lsp/vscode-metatype-support"
+ }
+ }
+ ]
}
diff --git a/deno.jsonc b/deno.jsonc
index 582d271d36..152c6ec454 100644
--- a/deno.jsonc
+++ b/deno.jsonc
@@ -10,10 +10,23 @@
"./examples/" // needed for published_test
]
},
+ "fmt": {
+ "exclude": [
+ "target",
+ "src/typegraph/deno/src/gen",
+ "src/typegraph/node",
+ "*.md",
+ "**/*.md",
+ ".ghjk/**",
+ ".git",
+ "vendor/**",
+ "node_modules",
+ "docs/metatype.dev/docusaurus.config.js"
+ ]
+ },
"compilerOptions": {
"allowJs": false,
"strict": true,
- "experimentalDecorators": true,
"types": [
"./src/typegate/engine/runtime.d.ts"
],
@@ -26,13 +39,22 @@
"nodeModulesDir": false,
"lock": "deno.lock",
"lint": {
+ "exclude": [
+ ".git",
+ "node_modules",
+ "./src/typegraph/deno/src/gen",
+ "./docs/metatype.dev",
+ "./src/typegraph/node",
+ "./src/meta-lsp",
+ "target"
+ ],
"rules": {
"include": [
"no-sync-fn-in-async-fn",
- "no-external-import",
"no-inferrable-types",
"no-self-compare",
"no-throw-literal"
+ // "no-external-import",
// "verbatim-module-syntax"
// "no-await-in-loop"
// "ban-untagged-todo"
diff --git a/deno.lock b/deno.lock
index 756ca5d198..aa1b3b2474 100644
--- a/deno.lock
+++ b/deno.lock
@@ -2641,6 +2641,122 @@
"https://raw.githubusercontent.com/metatypedev/metatype/770ca5fc5e328fc88633101934bdeea989b26628/src/typegate/src/types.ts": "a36918c2bfab397edec906c23d2cd7558246337bb16fdf1ea4e353cffea5f2b4",
"https://raw.githubusercontent.com/metatypedev/metatype/770ca5fc5e328fc88633101934bdeea989b26628/src/typegate/src/utils.ts": "de1a17260e76607e1a8fd6d7384cbc21bb26e08f64bffc41d6508bf5a8359311",
"https://raw.githubusercontent.com/metatypedev/metatype/770ca5fc5e328fc88633101934bdeea989b26628/src/typegate/src/utils/hash.ts": "df6cf462c7a6a805b91dce9d3e7bbbd00ea3bfd8dcc973fb3e6c94e48e33d9b9",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/engine/bindings.ts": "7c3e28ec60a0381030310228be6c02f1a434046b4cbcf793a537aaef47be949f",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/engine/runtime.js": "1ae55e76d3de8e79c37054d9127c92af496ce10aa905ea64021893048bb33794",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/config.ts": "63ea402f9a993888a9e3ec88d35112186f8f13bcd3a5fe358e69e0bb603311a5",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/config/loader.ts": "91cc2b67cc9bee413b0b44f9aa2ea7814f50e2465e6bc114eece248554d7477d",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/config/shared.ts": "252b42038eb68059b2cac85c792e36f5849b8e7392b98452341ccc3ee680a774",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/config/types.ts": "73357168542ef041da67997acdd98097444d92f0a1663be03ad1523fd20f768c",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/crypto.ts": "f550775b9e5bf9e7ec286a1596246a631b117fd91e093169bcad4898fb729634",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/computation_engine.ts": "07a3826fcf0bb13eb3912b8e5cbf69932848cd28c1c4ebda7042f977510d00a5",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/args.ts": "de16ba5c087afae319f65d02ab39779146da37ea925f610da8887cffe7828060",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/dependency_resolver.ts": "b851f4a6e2d500f9427dd1a59920d6c71f10904b31863bb1fac4d26e01d02b67",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/injection_utils.ts": "6f9ad0f8f9cde9a985b6ad36bf58418637a85f50749abe6870c792ade7dc45a2",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/mod.ts": "9a4429e7a579903f4f67ab53bd602b2d05a58138bdbd91c7cc5b1b44cf714b68",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/parameter_transformer.ts": "3ba3b9603c6d28c0d54648f8177bce30b8b667e0e1be903d468af3f2645649ff",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/planner/policies.ts": "caf3cfd8a46e21a5d09fdb46882d6ea4ffb376c56070bdb1ccff92fa70989d63",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/query_engine.ts": "39281c309b3d72123fcd8695700bd2831956e09d2b1c082ef899886beea6ae82",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/stage_id.ts": "b3b3c62215ff421103788079b77943af8f0026a56eafaa929415cb39ccde3cca",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/code_generator.ts": "edb77e2b98da2f040d3f7567d204dba2a3d8c66ae1a7c2709c049e464763f0cd",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/common.ts": "b585975e1a978dfa966df1a549261049ab159077bc90203a33bfe8ae055b3c6f",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/common.ts": "112f56c8e590215b0af0c1b46dc84b85cb5b9b43621a52646876c35a43103499",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/constraints.ts": "3237d0acce31aca8b2f2bbc0cae8a82d86f3671fcc7fabc3158037c4f79008f5",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/list.ts": "bd70fef3bc3840cfb6255a518de5fdb3db79a68a4481594475aebcbdd6a10102",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/number.ts": "9890c8af998dca2e573fc2ad02e63d9abc9b506b4a0c451d31f5916a8888e401",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/object.ts": "bd4f8891ee823bf82481df2ee181256514fd7299b5fe4fd7cd7194defa228f57",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/inline_validators/string.ts": "914a2b809a344075279578cb35ac3d03cb6025eb9f62c1f9f86958191b9857da",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/input.ts": "cf24fcffa1891dfc2f2af941a64aade9da069a6ef92baa432e2d7dcf5f9a8b86",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/matching_variant.ts": "aca8db649194921a01aca42b02113d0735262bb63d41ec44174e61c4cfa85369",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/engine/typecheck/result.ts": "6544f206b67c32015950ec96134415c261a60f54c469c1cd73f8accadf87fff6",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/errors.ts": "29dfbfdc8b7a85ee9551831d6db882e50a4e0104102b5885b2bd9a42878365f6",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/libs/jsonpath.ts": "f6851288fb8600dec0e62d5f804f41332b6197b255b6497360ba7e4b7f375cba",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/log.ts": "1330c01d489956c7530e2f2e2e60967f30c6b3a0c5c1d6c18d161ea2cf44fa0e",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/main.ts": "f390cfd2b5b836f1a54fa9ea7d8a5f5ba80430b6e849032145c0a7c0ae7216f3",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/Runtime.ts": "cc476f09f7d32d10dec3812a9a589da2866247e2064ce149ea2dc68fca833730",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/deno.ts": "c893dcf170b38547239d550080a856aca46a788de9922f282bbacf9b5841b5fe",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/deno/deno.ts": "bb0cdad8e785d43f6c59232e214fab82d43476acbcef740f561708b064bae172",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/deno/deno_messenger.ts": "81160c8a9c9817b46b52c4eee15cde880fb3f6b013c3b5110ee07a4c9c7f7a5e",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/deno/shared_types.ts": "34d56aa89c5a34e943a34b623b20d13ca54ab5466ea5313e0543da68b7aebcb1",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/deno/worker.ts": "ffeabab915301a666ac06b28989d5be4b29e600fb2932e25005ec1c9f48aac1d",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/graphql.ts": "5f0f4125367fd5fc43ccb2b8c9e8ba1f9c84348595e70e5ed9870e776d2efed3",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/grpc.ts": "92b2f5214ebe0f7b61e582faa67d6759641feaf788166a939ec6db8d819708da",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/http.ts": "f598a33aa3cafcf37a1f33d84c06bfd0ef5fd768f72837042c83ac6ae1d90762",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/kv.ts": "7d87409d8f93a4f684e1a0aabd020e5f3e559669fe3ca8efee9cd5045fde99dd",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/mod.ts": "26c06f1bff03255c20df97e1a109944b6fd2872acbb27aa97ab38b081fb19d7e",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/patterns/messenger/async_messenger.ts": "40644e011e3a258138ff1fb7a5323754a547016da9c1deb2114cfc471ee28bf0",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/patterns/messenger/lazy_async_messenger.ts": "b93d5e7252231d27d6b76ec4172d67cc23880b78411fb371d0cba2db712e2161",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma.ts": "e4b679c3b5e28a323d72bde5ebbcc113abe0efc8da82d70b3b2e390149c57d84",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/hooks/generate_schema.ts": "f55ffcb6fdfdfcb29eb5543ac23f89e224fc7e233f4ec598f7c5f44f05eefed2",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/hooks/mod.ts": "3e33752e3676b538c7016f3ddd4f1f49d75e217c410bcaa6319d33ed987d3c60",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/hooks/run_migrations.ts": "b94b09ecdc7d81ddcfd7596ae8cfb1ebbc8896d4c67207da627dcd79d19c658c",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/migration.ts": "f501540557b13a32f7b57e5a87f4ae1794cdd95214a49b34a429d7a33a96d5d8",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/mod.ts": "a0e44e86a45aad8b2bb0357ddbe8ba02802e6979451553940ec3688be571127f",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/prisma.ts": "bc370cfcb0f2aad520b8d2fd082e18dad5d41386225b50c9ce577b6c45df55b3",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/prisma/types.ts": "b4912f164aa8cdb1db3a98238a0271882864ff2778c10920dd7f0f3d59165dd6",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/python.ts": "77e7f683830962365ce7ce0af5fc5d326e11bc9751ab33d7add16d27feb32633",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/random.ts": "e7651e262ef5857e777ad46877c66f9098a2dfe774c13720a4cd38be327b53ff",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/s3.ts": "d7a0372faf555180bd4326550c1c6a07b156d3c5f0bbbcf9c0f6eb4b0f2bfff1",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/substantial.ts": "175644d75911d09919c06577bfa86239b3a44b1217664035551ff0989e22882a",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/substantial/agent.ts": "223288cb3d7baa02fa2d4e37207da7fa69cf4f16eb04ed7810d3e91ac725615b",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/substantial/types.ts": "8255ea84c5129ffc049d6fa88ad57eadf298d420ff11782c43eae9d2031efed1",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts": "589611456b82df0637db5f63af0881a459747d7c8963684bdcde291af13515cd",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/temporal.ts": "fef8a8f70d3f75957a5a741c275abea96cc492722784ea4aadffd9fce9cbff3f",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/typegate.ts": "52d49471d2682c1be323b53e4cca9866f2babb93708a855daa8c471ba4174b64",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/typegraph.ts": "e5808e5a20080fc260e54113e5941e5dffaeead5e3b7448dc17a48031d4799cf",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/utils/graphql_forward_vars.ts": "f0bb091aadd191eb1491dd86b7abd311ab60e09f532d226c8328b2cfa6025d9e",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/utils/graphql_inline_vars.ts": "9c3c339ee596c93cf65cda696d756c9ef08d34b78e4136472e27a92f2254ec8a",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/utils/http.ts": "842af99040fd0e3456690f7674311da3a0b9ea64c608d7bc588df1ab28f163a3",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/wasm_reflected.ts": "99d59cdd0c4b228c42ac90099036ecf5d2e14d6758916b27e4017d53b69cf481",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/wasm_wire.ts": "d10c891f12c9521bcd1a7e1cb459f642a5f4e0936f25f4e04174141691ba06d1",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/runtimes/wit_wire/mod.ts": "b40ab7bbdb225bff8738a743385251cc54a1ef44652e783a31ef7f85ed4efb18",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/artifact_service.ts": "282a9a6c3d89afc8955aabab6b3b242edccba664f5f41558e9c9b07d43dd8d13",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/cookies.ts": "ee17535cb19eab884732cefcdc46e63a2905041d5b5942e9ad6783c50a1f8624",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/mod.ts": "5b15823ec19cec1c985a77d525ee2e9e5c5aa367f5e24c96e305e485b6c633a9",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/protocols/basic.ts": "3c233ae1ccd0d3a8ff47a32c74682921abaf84e0de7c096f220f63b05756fc58",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/protocols/internal.ts": "7a9173406fbc1b885e08dd74a8dd34f168de2f1e9bedef4cdd88dad613e59166",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/protocols/jwt.ts": "e39249df7c2d088da07af1ccf5e97815addb46a994469efd4a335f6ae8618bc5",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/protocols/oauth2.ts": "7172cc6da5ecba71775bbc2d467d52d1f78505204e55452170f35004923b847b",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/protocols/protocol.ts": "158c55618be6165a9ee393ccd1a9da267b084ff04df7e627af1e4fc8fe636644",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/routes/mod.ts": "8fe85c16feb3da7086d3d6fd19a4579585b632893f3534c533c60aed84b9413a",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/routes/take.ts": "bc343c5d34870aeeaf9b0cc9473ba18fe7b324a23a630a57c9fd41eea4418a46",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/auth/routes/validate.ts": "56e52bb6d1660735683bdd398a86936f24ad8a00e402b7d88790867ad559e476",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/graphql_service.ts": "458e3cedcd22a44e166e531bcac4c65972916d81f3776c8161b2440ad212626f",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/info_service.ts": "a9a1f6ebdcbe64d55806597b879dd5714c32b8b861bed695a944f5e2f1213beb",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/middlewares.ts": "8af6277ce67c940564538f4def8e6567b5783b51f7c5f38c902736d620ffe405",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/playground_service.ts": "2cc8689899be7c31ad6c2e9c2c5adde0c6cc1f1442b27a55e8ead830e867dbe5",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/responses.ts": "5c45923c1374aab1ac8dd5b1a09ae69062ab34a448f8e92630678a236e38b2ba",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/services/rest_service.ts": "ae6ffdbddaccdbc7ed11dfb86511f2917332dcf5ae22ed814e1059e640ff7b08",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/sync/replicated_map.ts": "6b94fb884ce81d7e17572ae0abbeb91ceadb31f9356c4e9255982a00edcfe729",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/sync/typegraph.ts": "78120bc4d35e728ed86a98781c5d60996050fa8b35fa91f563c3c8b2a964b5dd",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/system_typegraphs.ts": "51299d60c1bb75b3e74998eb77bdf1680ee9d4a2f29a267d3ca90b2867c577fb",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/graphql/gq.ts": "78435e53ec1c5b7aec29364c051eb8f10802714050d24ee68a65e1e263495d7d",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/graphql/graphql.ts": "9f4aa79276e05acc6020da2a18472a1cc54c0ecf42efcbf017d67a88b0b90af2",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/graphql/request_parser.ts": "afbc95debcb1bbfa6fc2b88937d7abedbed1f4335bb2d17bf98c7293761cfdb0",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/graphql/typegraph.ts": "fc0ba3f62e1dd687a0545adb1dbaf7185176e0f1e938bfdd29cfef7f85951635",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/graphql/utils.ts": "d09147add80f5e53a643ed3126ee8675a1655480728311de2def04ffe6262a4b",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/transports/rest/rest_schema_generator.ts": "c776e83c6a55e9bee3ec72c36c1d771b3ca711e4086b3728e4983ab866472624",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/artifacts/local.ts": "d36ece0f53a56922744dd4d3e170101466b3816ba136f9574e799880e27d1a4b",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/artifacts/mod.ts": "fc931ffd49dc168da12882acf1055d3252e0cb3b666928e67d08d2a6c5be3447",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/artifacts/shared.ts": "5061a07eb880e33c1543e7397e945d50b476ed51d81fc01d109c53295f089131",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/hooks.ts": "ea97c08285388300802676d03dbc06caadf060093736abce07ef8f99a60e9a04",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/memory_register.ts": "6eab24914a941f85c233037013dc13749d8b689c5f9ffb38600df4c7b00a94f0",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/mod.ts": "d9f10b53a40192863a431c6be541effb4fd3c012ed8a716712d5176eba8c884a",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/no_limiter.ts": "1e98610a737bd74668f80b7014c64669a59a801355340eaa14411e07f4a8a94e",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/rate_limiter.ts": "b5718ab9e718314f11f5d88d84795bd0e61575856470793f1fe83d499f4a9d40",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegate/register.ts": "d7a8732386ad019d4dcee0372b6cab93bfc55e0146729842db2aaecf1411b15d",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/mod.ts": "27c917783dd8cf99d06290c0768e852ab348c3e989e47c77e648ffcc564b79fb",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/type_node.ts": "7f721cd5f6da2cbc7e66b804e0f81e0429aa2893e0a93244f9e66b39cb96b1a0",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/types.ts": "fc813b5f18e71b58e5f7904cd7fe3d6cae38b3c7055a8875042588c1561df160",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/utils.ts": "66fe8e1b5072f52ea2efebc5cf42001c3b858068b2d970ee3c8558032ff53103",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/versions.ts": "cdab4b07960f78c1f18511a8cc464a7e97c4c1fd15c6e8678c109483d3c26508",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraph/visitor.ts": "0fb0f89d92cb1654c1b010494a14c1aad88c7923102ea3e89866b232d3bcdf04",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraphs/introspection.json": "bbcf2c4233371c7f36052e5fe9e1cb1d18a46d3f31391cfcba2a3063c9141adb",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraphs/prisma_migration.json": "dfc346ff8fc2cef611c8f172b90e9d13eae6fed8b3dd65dea8631f9533159173",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/typegraphs/typegate.json": "bc0cbf4cd2c5de34410779994240993db4f1dd3d1eeda10b6045efdc37eb48a4",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/types.ts": "a36918c2bfab397edec906c23d2cd7558246337bb16fdf1ea4e353cffea5f2b4",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/utils.ts": "de1a17260e76607e1a8fd6d7384cbc21bb26e08f64bffc41d6508bf5a8359311",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/utils/hash.ts": "df6cf462c7a6a805b91dce9d3e7bbbd00ea3bfd8dcc973fb3e6c94e48e33d9b9",
+ "https://raw.githubusercontent.com/metatypedev/metatype/bb42c00169a34c4282317d50800993eea781a69d/src/typegate/src/worker_utils.ts": "19f686d729b947ab3eb2f29e99ccd07578037a3bccced65fc0dce42d5338cd31",
"https://raw.githubusercontent.com/metatypedev/metatype/db616a6ae26eb6fe04e356a777c11185613d97ad/typegate/engine/bindings.ts": "e9391491bf5c4f682267a5cb4ae384ef33ed7c15273fcada13bea7b064cf1270",
"https://raw.githubusercontent.com/metatypedev/metatype/db616a6ae26eb6fe04e356a777c11185613d97ad/typegate/engine/runtime.js": "1ae55e76d3de8e79c37054d9127c92af496ce10aa905ea64021893048bb33794",
"https://raw.githubusercontent.com/metatypedev/metatype/db616a6ae26eb6fe04e356a777c11185613d97ad/typegate/src/config.ts": "289820b743711beb9139bca83556f60774521f3c58addd5c441ae3205ef49e61",
diff --git a/docs/metatype.dev/docs/guides/securing-requests/cors.py b/docs/metatype.dev/docs/guides/securing-requests/cors.py
index 58cf3b9372..90728a1d6d 100644
--- a/docs/metatype.dev/docs/guides/securing-requests/cors.py
+++ b/docs/metatype.dev/docs/guides/securing-requests/cors.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.random import RandomRuntime
diff --git a/docs/metatype.dev/docs/reference/graphql/index.mdx b/docs/metatype.dev/docs/reference/graphql/index.mdx
new file mode 100644
index 0000000000..cd3e283190
--- /dev/null
+++ b/docs/metatype.dev/docs/reference/graphql/index.mdx
@@ -0,0 +1,183 @@
+---
+sidebar_position: 50
+---
+
+import TGExample from "@site/src/components/TGExample";
+
+# GraphQL
+
+[GraphQL](https://graphql.org/) is the primary means of querying your typegraph.
+This page documents all the semantics of how your typegraph translates into a GraphQL schema.
+
+## `Query` and `Mutation`
+
+The root functions passed to the `expose` function will be added as fields to the [special `query` and `mutation`](https://graphql.org/learn/schema/#the-query-and-mutation-types) GraphQL objects.
+Under which object a function is assigned depends on it's [effect](/docs/reference/types/functions).
+Note that this assignment still holds for deeply nested functions so be sure to avoid including functions that have mutating effects under query responses or vice versa.
+
+## Variables
+
+While [GraphQL Variables](https://graphql.org/learn/queries/#variables) work as expected for the most part, the typegate currently does not do type validation of variables for the provided query documents.
+
+```graphql
+query ($varRight: String!, $varWrong: Int!) {
+ foo1: foo(in: $varRight)
+ foo2: foo(in: $varWrong)
+}
+{
+ "varRight": "string",
+ # request will work as long as varWrong is string
+ # even if variable above was annotated as Int
+ "varWrong": "AlsoString",
+}
+```
+
+## Types
+
+### Scalars
+
+The simple primitive typegraph types translate directly to their [GraphQL equivalent](https://graphql.org/learn/schema/#scalar-types).
+This includes standard scalar variants like `t.uuid` or any user declared aliases with custom configurations.
+No custom GraphQL scalars are generated for such types.
+
+
+| Type | GraphQL type | Description |
+| -------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------- |
+| `t.integer()` | `Int` | Represents signed 32-bit integers. |
+| `t.float()` | `Float` | Represents signed double-precision values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_754). |
+| `t.boolean()` | `Boolean` | Represents `true` or `false`. |
+| `t.string()` | `String` | Represents textual data as UTF-8 character sequences. |
+
+### Files
+
+File types, primarily used through the [`S3Runtime`](/docs/reference/runtimes/s3), translate to a custom scalar called `File` in the GraphQL schema.
+The `S3Runtime` provides a set of helpers for all your file needs including support for [multipart HTTP requests](/docs/guides/files-upload) for file upload.
+
+### Structs
+
+`t.structs` types translate to:
+- [GraphQL input types](https://graphql.org/learn/schema/#input-types) when used as inputs to functions
+- [GraphQL object types](https://graphql.org/learn/schema/#object-types-and-fields) in any other place.
+
+### Lists
+
+`t.list` types simply convert to [GraphQL list types](https://graphql.org/learn/schema/#lists-and-non-null).
+
+### Functions
+
+`t.func` types are represented by their output type in the GraphQL schema.
+If their input struct has fields present, these are converted to [arguments](https://graphql.org/learn/schema/#arguments) for the field.
+
+### Unions and Eithers
+
+Unions and either translate to a number of different forms depending on their usage in the graph and their composition.
+
+When used as a field in an input struct, unions/eithers are converted to custom scalars since the GraphQL spec doesn't allow GraphQL unions on input types.
+These scalars expect the standard JSON representation of your value and that is all.
+
+When querying union/either values, there are a few more details.
+For struct variants, the standard GraphQL rules apply and [inline fragments](https://graphql.org/learn/queries/#inline-fragments) must be used.
+Currently, all struct variants must have inline fragments present even if the user is not interested in them.
+And as per GraphQL spec, common field querying is not supported and any fields must be part of the inline fragment.
+Unlike the GraphQL spec, this includes the `__typename` field which must be included in the fragments instead.
+
+```graphql
+# introspection schema
+union MyUnion = Struct1 | Struct2
+
+type Struct1 {
+ foo: String!
+ bar: String!
+}
+
+type Struct2 {
+ foo: String!
+ baz: String!
+}
+
+# introspection expected query (THIS IS WRONG)
+query {
+ myUnion {
+ # common fields are not supported
+ __typename
+ foo
+ ... on Struct1 {
+ bar
+ }
+ ... on Struct2 {
+ baz
+ }
+ }
+}
+
+# actual expected query (THIS IS RIGHT)
+query {
+ myUnion {
+ ... on Struct1 {
+ # common fields must be included each time
+ __typename
+ foo
+ bar
+ }
+ ... on Struct2 {
+ __typename
+ foo
+ baz
+ }
+ }
+}
+```
+
+For scalar variant, the introspected GraphQL schema will include a `_NameOfScalar` variant in the introspection schema **but** the value is returned at the field level as a simple scalar.
+That is, GraphQL API explorers will show union __object__ members that include the scalar values and they'll prompt you to use [inline fragments](https://graphql.org/learn/queries/#inline-fragments) for querying the scalar members.
+But the typegate will reject these kind of queries in preference to simple fields.
+Look at the following example:
+
+```graphql
+# introspection schema
+union MyUnion = _String | _Integer
+
+type _String {
+ string: String!
+}
+
+type _Integer {
+ integer: Int!
+}
+
+# introspection expected query (THIS IS WRONG)
+query {
+ myUnion {
+ ... on _String {
+ string
+ }
+ ... on _Integer {
+ integer
+ }
+ }
+}
+
+# actual expected query (THIS IS RIGHT)
+query {
+ # no subfield selection at all required
+ # since all members are scalars
+ myUnion
+}
+
+# received json
+{
+ "myUnion": "string"
+}
+```
+
+List members act accordingly to their wrapped times.
+Lists of scalars are treated as scalars and lists of composites as a standard GraphQL composites list.
+
+The following playground shows all the different types of unions/eithers:
+
+
diff --git a/docs/metatype.dev/docs/reference/graphql/union-either.graphql b/docs/metatype.dev/docs/reference/graphql/union-either.graphql
new file mode 100644
index 0000000000..405bb5067c
--- /dev/null
+++ b/docs/metatype.dev/docs/reference/graphql/union-either.graphql
@@ -0,0 +1,33 @@
+{
+ outer {
+ # scalar 1 and 2 don't need
+ # type inline fragments
+ unionList {
+ ... on comp_1 {
+ field1
+ }
+ ... on comp_2 {
+ field2
+ }
+ }
+ # we must include fragments
+ # for all composites or it will fail
+ union {
+ ... on comp_1 {
+ field1
+ }
+ ... on comp_2 {
+ field2
+ }
+ }
+ # rules are the same between unions and eithers
+ either {
+ ... on comp_1 {
+ field1
+ }
+ ... on comp_2 {
+ field2
+ }
+ }
+ }
+}
diff --git a/docs/metatype.dev/docs/reference/typegate/authentication/oauth2.tsx b/docs/metatype.dev/docs/reference/typegate/authentication/oauth2.tsx
index a555e6a6b2..a358ca2e54 100644
--- a/docs/metatype.dev/docs/reference/typegate/authentication/oauth2.tsx
+++ b/docs/metatype.dev/docs/reference/typegate/authentication/oauth2.tsx
@@ -26,13 +26,15 @@ function OAuth2({ name, typegraph }) {
}
}, [setToken, tgUrl]);
- const url = `${tgUrl}/${typegraph}/auth/${name}?redirect_uri=${encodeURIComponent(
- window.location.href,
- )}`;
+ const url = `${tgUrl}/${typegraph}/auth/${name}?redirect_uri=${
+ encodeURIComponent(
+ window.location.href,
+ )
+ }`;
return (
- Start the flow via {url} and take token by
- clicking{" "}
+ Start the flow via {url}{" "}
+ and take token by clicking{" "}
here
diff --git a/docs/metatype.dev/src/components/Features/index.tsx b/docs/metatype.dev/src/components/Features/index.tsx
index be240d5c25..e1a76fd86c 100644
--- a/docs/metatype.dev/src/components/Features/index.tsx
+++ b/docs/metatype.dev/src/components/Features/index.tsx
@@ -14,9 +14,9 @@ export default function Features(props: {
| React.JSX.Element
| FeatureDeets
| {
- content: string;
- path: string;
- }
+ content: string;
+ path: string;
+ }
)[][];
}): JSX.Element {
return (
diff --git a/docs/metatype.dev/src/components/Newsletter/index.tsx b/docs/metatype.dev/src/components/Newsletter/index.tsx
index 5c3f8b5720..b86440df47 100644
--- a/docs/metatype.dev/src/components/Newsletter/index.tsx
+++ b/docs/metatype.dev/src/components/Newsletter/index.tsx
@@ -60,7 +60,8 @@ export default function Newsletter() {
type="email"
className="px-2 py-2 font-sans bg-slate-100 border-none text-base"
value={email}
- onChange={(event) => setEmail(event.target.value)}
+ onChange={(event) =>
+ setEmail(event.target.value)}
/>
{
const vertical = px - x < py - my;
- const sx =
- px < x
- ? x - (vertical ? 0 : width / 2 + 10)
- : x + (vertical ? 0 : width / 2 + 10);
- const sy =
- py < y
- ? y - (!vertical ? 0 : height / 2 + 10)
- : y + (!vertical ? 0 : height / 2 + 10);
+ const sx = px < x
+ ? x - (vertical ? 0 : width / 2 + 10)
+ : x + (vertical ? 0 : width / 2 + 10);
+ const sy = py < y
+ ? y - (!vertical ? 0 : height / 2 + 10)
+ : y + (!vertical ? 0 : height / 2 + 10);
return (
{
.fromLambda(
t.struct({ first: t.float(), second: t.float() }),
t.float(),
- { code: "lambda x: x['first'] + x['second']" }
+ { code: "lambda x: x['first'] + x['second']" },
)
.withPolicy(pub),
multiply: deno
diff --git a/examples/templates/node/tsconfig.json b/examples/templates/node/tsconfig.json
index 999217dd3c..8654230394 100644
--- a/examples/templates/node/tsconfig.json
+++ b/examples/templates/node/tsconfig.json
@@ -1,8 +1,8 @@
{
- "compilerOptions": {
- "strict": true,
- "moduleResolution": "node16",
- "module": "Node16",
- "esModuleInterop": true
- }
+ "compilerOptions": {
+ "strict": true,
+ "moduleResolution": "node16",
+ "module": "Node16",
+ "esModuleInterop": true
+ }
}
diff --git a/examples/templates/python/api/example.py b/examples/templates/python/api/example.py
index 0ba10790e9..cea2ceacf5 100644
--- a/examples/templates/python/api/example.py
+++ b/examples/templates/python/api/example.py
@@ -1,4 +1,7 @@
-from typegraph import typegraph, Policy, t, Graph
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.runtimes import PythonRuntime
diff --git a/examples/typegraphs/authentication.py b/examples/typegraphs/authentication.py
index 31622c945e..59fead18d5 100644
--- a/examples/typegraphs/authentication.py
+++ b/examples/typegraphs/authentication.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Auth, Cors
@@ -24,7 +27,7 @@ def authentication(g: Graph):
get_context=deno.identity(ctx).apply(
{
"username": g.from_context("username"),
- }
+ },
),
get_full_context=deno.func(
t.struct({}),
diff --git a/examples/typegraphs/authentication.ts b/examples/typegraphs/authentication.ts
index d32b3b990c..740e5c51e9 100644
--- a/examples/typegraphs/authentication.ts
+++ b/examples/typegraphs/authentication.ts
@@ -32,9 +32,9 @@ await typegraph(
code: "(_: any, ctx: any) => Deno.inspect(ctx.context)",
}),
},
- Policy.public()
+ Policy.public(),
);
// skip:start
- }
+ },
);
// skip:end
diff --git a/examples/typegraphs/backend-for-frontend.py b/examples/typegraphs/backend-for-frontend.py
index 358a5137f3..ec6d2c7091 100644
--- a/examples/typegraphs/backend-for-frontend.py
+++ b/examples/typegraphs/backend-for-frontend.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import HttpRuntime
@@ -22,7 +25,7 @@ def backend_for_frontend(g: Graph):
t.struct({"user": t.string().from_parent("login")}),
t.struct({"name": t.string().optional()}),
),
- }
+ },
)
g.expose(
diff --git a/examples/typegraphs/basic.py b/examples/typegraphs/basic.py
index 8b9a02564d..94af64656f 100644
--- a/examples/typegraphs/basic.py
+++ b/examples/typegraphs/basic.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Auth, Cors
from typegraph.runtimes.deno import DenoRuntime
@@ -25,6 +28,6 @@ def basic_authentication(g: Graph):
get_context=deno.identity(ctx).apply(
{
"username": g.from_context("username"),
- }
+ },
),
)
diff --git a/examples/typegraphs/basic.ts b/examples/typegraphs/basic.ts
index 529e49c669..86edbe9f34 100644
--- a/examples/typegraphs/basic.ts
+++ b/examples/typegraphs/basic.ts
@@ -30,5 +30,5 @@ await typegraph(
})
.withPolicy(pub),
});
- }
+ },
);
diff --git a/examples/typegraphs/cors.py b/examples/typegraphs/cors.py
index 26b376b409..20ff44b535 100644
--- a/examples/typegraphs/cors.py
+++ b/examples/typegraphs/cors.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.random import RandomRuntime
diff --git a/examples/typegraphs/cors.ts b/examples/typegraphs/cors.ts
index dedb2c5bdf..296ba3cc77 100644
--- a/examples/typegraphs/cors.ts
+++ b/examples/typegraphs/cors.ts
@@ -24,7 +24,7 @@ await typegraph(
{
catch_me_if_you_can: random.gen(t.string()),
},
- Policy.public()
+ Policy.public(),
);
- }
+ },
);
diff --git a/examples/typegraphs/database.py b/examples/typegraphs/database.py
index 8fa996b1b0..c9b1ace93f 100644
--- a/examples/typegraphs/database.py
+++ b/examples/typegraphs/database.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
# isort: off
diff --git a/examples/typegraphs/database.ts b/examples/typegraphs/database.ts
index 1e08a76bcb..364a34a220 100644
--- a/examples/typegraphs/database.ts
+++ b/examples/typegraphs/database.ts
@@ -24,7 +24,7 @@ await typegraph(
body: t.string(),
},
// highlight-next-line
- { name: "message" }
+ { name: "message" },
);
g.expose(
@@ -33,7 +33,7 @@ await typegraph(
create_message: db.create(message),
list_messages: db.findMany(message),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/deno.py b/examples/typegraphs/deno.py
index d03e1bd6be..4119a54932 100644
--- a/examples/typegraphs/deno.py
+++ b/examples/typegraphs/deno.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.deno import DenoRuntime
diff --git a/examples/typegraphs/deno.ts b/examples/typegraphs/deno.ts
index be47cd8f14..c69762936e 100644
--- a/examples/typegraphs/deno.ts
+++ b/examples/typegraphs/deno.ts
@@ -33,14 +33,14 @@ await typegraph(
};
}
`,
- }
+ },
);
g.expose(
{
compute_fib: fib,
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/docs.py b/examples/typegraphs/docs.py
index 21ed1bd074..baa7b024e9 100644
--- a/examples/typegraphs/docs.py
+++ b/examples/typegraphs/docs.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
from typegraph import Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import HttpRuntime
@@ -20,7 +23,7 @@ def docs(g):
"email": t.email(),
"listIds": t.list(t.integer()).set([8]),
"header#api-key": t.string().from_secret("SENDINBLUE_KEY"),
- }
+ },
),
t.struct({"id": t.integer().optional()}),
).with_policy(public)
diff --git a/examples/typegraphs/example_rest.py b/examples/typegraphs/example_rest.py
index d4b66c981a..612471ad85 100644
--- a/examples/typegraphs/example_rest.py
+++ b/examples/typegraphs/example_rest.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
@@ -43,6 +46,6 @@ def example_rest(g: Graph):
}
}
}
- """
+ """,
)
# highlight-end
diff --git a/examples/typegraphs/example_rest.ts b/examples/typegraphs/example_rest.ts
index a9280af9be..b0a5c3c81a 100644
--- a/examples/typegraphs/example_rest.ts
+++ b/examples/typegraphs/example_rest.ts
@@ -19,7 +19,7 @@ await typegraph(
id: t.integer(),
author: user,
},
- { name: "Post" }
+ { name: "Post" },
);
// skip:end
@@ -41,9 +41,9 @@ await typegraph(
}
}
}
- `
+ `,
);
// highlight-end
// skip:start
- }
+ },
);
diff --git a/examples/typegraphs/execute.py b/examples/typegraphs/execute.py
index ed46b99712..45c47c647f 100644
--- a/examples/typegraphs/execute.py
+++ b/examples/typegraphs/execute.py
@@ -1,9 +1,11 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
-from typegraph.graph.params import Auth
-from typegraph.providers.prisma import PrismaRuntime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.gen.exports.runtimes import EffectUpdate
-from typegraph.graph.params import Cors
+from typegraph.graph.params import Auth, Cors
+from typegraph.providers.prisma import PrismaRuntime
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
@@ -70,8 +72,8 @@ def roadmap(g: Graph):
"authorEmail": g.inherit(),
"votes": g.inherit(),
"bucket": {"connect": g.inherit()},
- }
- }
+ },
+ },
),
create_vote=db.create(vote),
set_vote_importance=db.execute(
@@ -80,13 +82,13 @@ def roadmap(g: Graph):
{
"vote_id": t.uuid(),
"importance": t.enum(["medium", "important", "critical"]),
- }
+ },
),
EffectUpdate(True),
),
get_context=deno.identity(t.struct({"username": t.string().optional()})).apply(
{
"username": g.from_context("username"),
- }
+ },
),
)
diff --git a/examples/typegraphs/faas-runner.py b/examples/typegraphs/faas-runner.py
index e69ae257ec..9c88ec46fc 100644
--- a/examples/typegraphs/faas-runner.py
+++ b/examples/typegraphs/faas-runner.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import DenoRuntime, PythonRuntime
diff --git a/examples/typegraphs/faas-runner.ts b/examples/typegraphs/faas-runner.ts
index 933a0e500a..5d840c82b7 100644
--- a/examples/typegraphs/faas-runner.ts
+++ b/examples/typegraphs/faas-runner.ts
@@ -26,10 +26,11 @@ typegraph(
code: `lambda inp: sum(range(inp['n']))`,
}),
tscumsum: deno.func(inp, out, {
- code: "({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",
+ code:
+ "({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",
}),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/files-upload.py b/examples/typegraphs/files-upload.py
index d61ebc3367..9dad3500ec 100644
--- a/examples/typegraphs/files-upload.py
+++ b/examples/typegraphs/files-upload.py
@@ -1,8 +1,11 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.providers.aws import S3Runtime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
# skip-next-line
from typegraph.graph.params import Cors
+from typegraph.providers.aws import S3Runtime
@typegraph(
diff --git a/examples/typegraphs/files-upload.ts b/examples/typegraphs/files-upload.ts
index 047bc52b39..aea8bc1edf 100644
--- a/examples/typegraphs/files-upload.ts
+++ b/examples/typegraphs/files-upload.ts
@@ -23,11 +23,11 @@ await typegraph(
signUploadUrl: s3.presignPut({ bucket: "examples" }),
upload: s3.upload(
"examples",
- t.file({ allow: ["image/png", "image/jpeg"] })
+ t.file({ allow: ["image/png", "image/jpeg"] }),
),
uploadMany: s3.uploadAll("examples"),
},
- Policy.public()
+ Policy.public(),
);
- }
+ },
);
diff --git a/examples/typegraphs/first-typegraph.py b/examples/typegraphs/first-typegraph.py
index c1dc355194..ed443a098b 100644
--- a/examples/typegraphs/first-typegraph.py
+++ b/examples/typegraphs/first-typegraph.py
@@ -1,4 +1,7 @@
-from typegraph import typegraph, Policy, t, Graph
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import RandomRuntime
@@ -19,7 +22,7 @@ def first_typegraph(g: Graph):
"id": t.integer(),
"title": t.string(),
"user_id": t.integer(),
- }
+ },
)
# expose them with policies
diff --git a/examples/typegraphs/first-typegraph.ts b/examples/typegraphs/first-typegraph.ts
index b7ad5b7855..3d46e76c5d 100644
--- a/examples/typegraphs/first-typegraph.ts
+++ b/examples/typegraphs/first-typegraph.ts
@@ -25,7 +25,7 @@ await typegraph(
// input → output via runtime function
get_message: random.gen(message),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/func-ctx.py b/examples/typegraphs/func-ctx.py
index 8bb2240e61..dd72483b15 100644
--- a/examples/typegraphs/func-ctx.py
+++ b/examples/typegraphs/func-ctx.py
@@ -1,7 +1,9 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors, Rate
-
from typegraph.runtimes.deno import DenoRuntime
@@ -30,7 +32,7 @@ def func_ctx(g: Graph):
"url": t.string(),
# token for accessing host typegraph
"token": t.string(),
- }
+ },
),
# http headers
"headers": t.list(t.list(t.string())),
@@ -39,7 +41,7 @@ def func_ctx(g: Graph):
# FIXME: explanation
"parent": t.string(),
"context": t.string(),
- }
+ },
),
# modeling arbitrary associative arrays in
# graphql is difficult so we return a listified format.
diff --git a/examples/typegraphs/func-ctx.ts b/examples/typegraphs/func-ctx.ts
index 2e7f8c5ff7..1e388fcb59 100644
--- a/examples/typegraphs/func-ctx.ts
+++ b/examples/typegraphs/func-ctx.ts
@@ -48,11 +48,11 @@ await typegraph(
headers: Object.entries(ctx.headers),
secrets: Object.entries(ctx.secrets),
}),
- }
+ },
),
},
- Policy.public()
+ Policy.public(),
);
// skip:start
- }
+ },
);
diff --git a/examples/typegraphs/func-gql.py b/examples/typegraphs/func-gql.py
index 1a9b123dcd..6d789fc3e1 100644
--- a/examples/typegraphs/func-gql.py
+++ b/examples/typegraphs/func-gql.py
@@ -1,9 +1,11 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph, fx
+from typegraph import Graph, Policy, fx, t, typegraph
from typegraph.graph.params import Cors, Rate
-
-from typegraph.runtimes.deno import DenoRuntime
from typegraph.providers.prisma import PrismaRuntime
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
@@ -45,7 +47,7 @@ def func_gql(g: Graph):
createIdea=db.create(idea),
createVote=deno.import_(
t.struct({"ideaId": t.uuid(), "authorEmail": t.email()}).rename(
- "CreateVoteInput"
+ "CreateVoteInput",
),
t.struct(
{
@@ -59,9 +61,9 @@ def func_gql(g: Graph):
"where": {
"id": g.inherit().from_parent("voteId"),
},
- }
+ },
),
- }
+ },
).rename("CreateVoteOutput"),
module="scripts/createVote.ts",
name="handle", # name the exported function to run
diff --git a/examples/typegraphs/func.py b/examples/typegraphs/func.py
index 831fd82f58..c2f0e5a3b5 100644
--- a/examples/typegraphs/func.py
+++ b/examples/typegraphs/func.py
@@ -1,10 +1,13 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
# skip:start
-from typegraph.graph.params import Auth
+from typegraph.graph.params import Auth, Cors
from typegraph.providers.prisma import PrismaRuntime
-from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
+
# skip:end
@@ -75,8 +78,8 @@ def roadmap(g: Graph):
"authorEmail": g.inherit(),
"votes": g.inherit(),
"bucket": {"connect": g.inherit()},
- }
- }
+ },
+ },
),
create_vote=db.create(vote),
# skip:end
@@ -102,7 +105,7 @@ def roadmap(g: Graph):
}
}
}
- """
+ """,
)
g.rest(
@@ -120,6 +123,6 @@ def roadmap(g: Graph):
}
}
}
- """
+ """,
)
# skip:end
diff --git a/examples/typegraphs/func.ts b/examples/typegraphs/func.ts
index e010cb8aec..9f44056ff6 100644
--- a/examples/typegraphs/func.ts
+++ b/examples/typegraphs/func.ts
@@ -27,7 +27,7 @@ await typegraph(
name: t.string(),
ideas: t.list(g.ref("idea")),
},
- { name: "bucket" }
+ { name: "bucket" },
);
const idea = t.struct(
@@ -38,7 +38,7 @@ await typegraph(
votes: t.list(g.ref("vote")),
bucket: g.ref("bucket"),
},
- { name: "idea" }
+ { name: "idea" },
);
const vote = t.struct(
@@ -49,14 +49,14 @@ await typegraph(
desc: t.string().optional(),
idea: g.ref("idea"),
},
- { name: "vote" }
+ { name: "vote" },
);
g.auth(Auth.basic(["andim"]));
const admins = deno.policy(
"admins",
- "(_args, { context }) => !!context.username"
+ "(_args, { context }) => !!context.username",
);
// skip:end
@@ -82,7 +82,7 @@ await typegraph(
name: "parse",
}),
},
- pub
+ pub,
);
// skip:start
@@ -99,7 +99,7 @@ await typegraph(
}
}
}
- `
+ `,
);
g.rest(
@@ -117,8 +117,8 @@ await typegraph(
}
}
}
- `
+ `,
);
// skip:end
- }
+ },
);
diff --git a/examples/typegraphs/functions.py b/examples/typegraphs/functions.py
index 59a8ff029f..d3e62d6224 100644
--- a/examples/typegraphs/functions.py
+++ b/examples/typegraphs/functions.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, t, Graph
+from typegraph import Graph, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import DenoRuntime, HttpRuntime
diff --git a/examples/typegraphs/graphql-server.py b/examples/typegraphs/graphql-server.py
index 6ff06b2d0a..59463144ef 100644
--- a/examples/typegraphs/graphql-server.py
+++ b/examples/typegraphs/graphql-server.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.http import HttpRuntime
@@ -23,7 +26,7 @@ def graphql_server(g: Graph):
t.struct({"user": t.string().from_parent("login")}),
t.struct({"name": t.string().optional()}),
),
- }
+ },
)
g.expose(
diff --git a/examples/typegraphs/graphql.py b/examples/typegraphs/graphql.py
index 0f53236cec..5cbc73620a 100644
--- a/examples/typegraphs/graphql.py
+++ b/examples/typegraphs/graphql.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.providers.prisma import PrismaRuntime
@@ -36,8 +39,8 @@ def graphql(g: Graph):
t.struct(
{
# highlight-next-line
- "id": t.string(as_id=True).from_parent("user_id")
- }
+ "id": t.string(as_id=True).from_parent("user_id"),
+ },
),
t.optional(user),
),
diff --git a/examples/typegraphs/http-runtime.py b/examples/typegraphs/http-runtime.py
index 30d8212d02..6067bab118 100644
--- a/examples/typegraphs/http-runtime.py
+++ b/examples/typegraphs/http-runtime.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
# skip:end
@@ -31,7 +34,7 @@ def http_runtime(g: Graph):
"source_url": t.string(),
"language": t.string(),
"permalink": t.string(),
- }
+ },
),
),
facts_as_text=facts.get(
@@ -40,7 +43,7 @@ def http_runtime(g: Graph):
{
"header_accept": t.string().set("text/plain"),
"language": t.enum(["en", "de"]),
- }
+ },
),
t.string(),
header_prefix="header_",
diff --git a/examples/typegraphs/http-runtime.ts b/examples/typegraphs/http-runtime.ts
index 2090af3984..9bb2374523 100644
--- a/examples/typegraphs/http-runtime.ts
+++ b/examples/typegraphs/http-runtime.ts
@@ -33,7 +33,7 @@ await typegraph(
}),
{
path: "/random",
- }
+ },
),
facts_as_text: facts.get(
t.struct({
@@ -41,10 +41,10 @@ await typegraph(
language: t.enum_(["en", "de"]),
}),
t.string(),
- { path: "/random", headerPrefix: "header_" }
+ { path: "/random", headerPrefix: "header_" },
),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/iam-provider.py b/examples/typegraphs/iam-provider.py
index edee4048fa..dac792de3d 100644
--- a/examples/typegraphs/iam-provider.py
+++ b/examples/typegraphs/iam-provider.py
@@ -1,9 +1,12 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
from os import environ
from urllib.parse import quote_plus
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.graph.params import Cors, Auth
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Auth, Cors
from typegraph.runtimes import DenoRuntime
diff --git a/examples/typegraphs/iam-provider.ts b/examples/typegraphs/iam-provider.ts
index 86c74f7b2b..6b25e8a26b 100644
--- a/examples/typegraphs/iam-provider.ts
+++ b/examples/typegraphs/iam-provider.ts
@@ -27,9 +27,11 @@ typegraph(
const deno = new DenoRuntime();
const host = getEnvOrDefault("TG_URL", "http://localhost:7890");
- const url = `${host}/iam-provider/auth/github?redirect_uri=${encodeURIComponent(
- host
- )}`;
+ const url = `${host}/iam-provider/auth/github?redirect_uri=${
+ encodeURIComponent(
+ host,
+ )
+ }`;
g.expose(
{
@@ -39,11 +41,12 @@ typegraph(
t.struct({}),
t.struct({ username: t.string() }).optional(),
{
- code: "(_, { context }) => Object.keys(context).length === 0 ? null : context",
- }
+ code:
+ "(_, { context }) => Object.keys(context).length === 0 ? null : context",
+ },
),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/index.py b/examples/typegraphs/index.py
index 30f2ff9879..686bf786f1 100644
--- a/examples/typegraphs/index.py
+++ b/examples/typegraphs/index.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
import re
@@ -44,7 +47,7 @@ def homepage(g: Graph):
t.struct({"user": t.string().from_parent("login")}),
t.struct({"name": t.string().optional()}),
),
- }
+ },
)
# out of the box authenfication support
diff --git a/examples/typegraphs/injections.py b/examples/typegraphs/injections.py
index dcb2602463..a16880b191 100644
--- a/examples/typegraphs/injections.py
+++ b/examples/typegraphs/injections.py
@@ -1,4 +1,7 @@
-from typegraph import Policy, typegraph, t, Graph
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.deno import DenoRuntime
@@ -20,7 +23,7 @@ def injection_example(g: Graph):
"context_value": t.uuid().from_context("profile.userId"),
"secret_value": t.string().from_secret("secret_name"),
"dynamic_value": t.datetime().inject("now"),
- }
+ },
).rename("Input"),
t.struct(
{
@@ -29,14 +32,14 @@ def injection_example(g: Graph):
"secret_value": t.string(),
"nested": deno.identity(
t.struct(
- {"parent_value": t.integer().from_parent("static_value")}
+ {"parent_value": t.integer().from_parent("static_value")},
),
),
"dynamic_value": t.datetime(),
- }
+ },
).rename("Output"),
code="""
({ static_value, context_value, secret_value, dynamic_value }) => ({ static_value, context_value, secret_value, dynamic_value })
""",
- ).with_policy(pub)
+ ).with_policy(pub),
)
diff --git a/examples/typegraphs/jwt.py b/examples/typegraphs/jwt.py
index 4186f5f571..042a26b759 100644
--- a/examples/typegraphs/jwt.py
+++ b/examples/typegraphs/jwt.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Auth, Cors
from typegraph.runtimes.deno import DenoRuntime
@@ -23,7 +26,7 @@ def jwt_authentication(g: Graph):
get_context=deno.identity(ctx).apply(
{
"your_own_content": g.from_context("your_own_content"),
- }
+ },
),
default_policy=[public],
)
diff --git a/examples/typegraphs/jwt.ts b/examples/typegraphs/jwt.ts
index 82fd389973..cc396ae5ed 100644
--- a/examples/typegraphs/jwt.ts
+++ b/examples/typegraphs/jwt.ts
@@ -27,7 +27,7 @@ typegraph(
your_own_content: g.fromContext("your_own_content"),
}),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/math.py b/examples/typegraphs/math.py
index 054954b87e..f94d347b40 100644
--- a/examples/typegraphs/math.py
+++ b/examples/typegraphs/math.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors, Rate
# skip:end
diff --git a/examples/typegraphs/math.ts b/examples/typegraphs/math.ts
index bdec25bdfe..45db028804 100644
--- a/examples/typegraphs/math.ts
+++ b/examples/typegraphs/math.ts
@@ -24,7 +24,7 @@ await typegraph(
// the policy implementation is based on functions itself
const restrict_referer = deno.policy(
"restrict_referer_policy",
- '(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)'
+ '(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)',
);
// or we can point to a local file that's accessible to the meta-cli
@@ -42,15 +42,15 @@ await typegraph(
randomItem: deno.func(
t.struct({ items: t.list(t.string()) }),
t.string(),
- { code: random_item_fn }
+ { code: random_item_fn },
),
random: deno.func(
t.struct({}),
t.float(),
- { code: "() => Math.random()" } // more inline code
+ { code: "() => Math.random()" }, // more inline code
),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/metagen-deno.py b/examples/typegraphs/metagen-deno.py
index 7ef4e8bce7..b16dcf8180 100644
--- a/examples/typegraphs/metagen-deno.py
+++ b/examples/typegraphs/metagen-deno.py
@@ -1,7 +1,11 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.deno import DenoRuntime
+
# skip:end
@@ -18,7 +22,7 @@ def metagen_deno(g: Graph):
"releaseTime": t.datetime(),
"mp3Url": t.uri(),
# explicit type names help when generating code
- }
+ },
).rename("idv3")
deno = DenoRuntime()
diff --git a/examples/typegraphs/metagen-py.py b/examples/typegraphs/metagen-py.py
index de69d7baf1..282a11d184 100644
--- a/examples/typegraphs/metagen-py.py
+++ b/examples/typegraphs/metagen-py.py
@@ -1,7 +1,11 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.python import PythonRuntime
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
+from typegraph.runtimes.python import PythonRuntime
+
# skip:end
@@ -17,7 +21,7 @@ def metagen_py(g: Graph):
"artist": t.string(),
"releaseTime": t.datetime(),
"mp3Url": t.uri(),
- }
+ },
).rename("idv3")
python = PythonRuntime()
diff --git a/examples/typegraphs/metagen-py.ts b/examples/typegraphs/metagen-py.ts
index 5de27f2490..924932199b 100644
--- a/examples/typegraphs/metagen-py.ts
+++ b/examples/typegraphs/metagen-py.ts
@@ -32,7 +32,7 @@ await typegraph(
})
.rename("remix_track"), // explicit names help
},
- Policy.public()
+ Policy.public(),
);
- }
+ },
);
diff --git a/examples/typegraphs/metagen-rs.py b/examples/typegraphs/metagen-rs.py
index 5e7fae8a6c..507ae6a52f 100644
--- a/examples/typegraphs/metagen-rs.py
+++ b/examples/typegraphs/metagen-rs.py
@@ -1,7 +1,11 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.wasm import WasmRuntime
+
# skip:end
@@ -18,7 +22,7 @@ def metagen_rs(g: Graph):
"releaseTime": t.datetime(),
"mp3Url": t.uri(),
# explicit type names help when generating code
- }
+ },
).rename("idv3")
# the wire flavour is availible through a static
diff --git a/examples/typegraphs/metagen-rs.ts b/examples/typegraphs/metagen-rs.ts
index 3d0142d801..e4e3f74c3e 100644
--- a/examples/typegraphs/metagen-rs.ts
+++ b/examples/typegraphs/metagen-rs.ts
@@ -32,13 +32,13 @@ await typegraph(
idv3,
{
name: "remix_track",
- }
+ },
// the traits will map to the name of the materializer
// and also the the name of the handler mentioned above
)
.rename("remix_track"),
},
- Policy.public()
+ Policy.public(),
);
- }
+ },
);
diff --git a/examples/typegraphs/metagen-sdk.py b/examples/typegraphs/metagen-sdk.py
index a4fc2cbbc8..c7dc3bc1de 100644
--- a/examples/typegraphs/metagen-sdk.py
+++ b/examples/typegraphs/metagen-sdk.py
@@ -1,11 +1,14 @@
-# skip:start
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
-from typegraph.graph.params import Cors
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+# skip:start
# skip:end
import os
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.metagen import Metagen
+from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
@@ -20,7 +23,7 @@ def metagen_sdk(g: Graph):
"artist": t.string(),
"releaseTime": t.datetime(),
"mp3Url": t.uri(),
- }
+ },
).rename("idv3")
deno = DenoRuntime()
@@ -36,7 +39,8 @@ def metagen_sdk(g: Graph):
)
-if __name__ == "__main__" and False:
+# if __name__ == "__main__" and False:
+if False:
metagen = Metagen(
# the workspace root that our config is relative to
os.path.dirname(os.path.abspath(__file__)),
diff --git a/examples/typegraphs/metagen-sdk.ts b/examples/typegraphs/metagen-sdk.ts
index 4e429514fa..130a1691ab 100644
--- a/examples/typegraphs/metagen-sdk.ts
+++ b/examples/typegraphs/metagen-sdk.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// skip:start
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
@@ -38,6 +41,7 @@ const tg = await typegraph(
},
);
+// deno-lint-ignore no-constant-condition
if (false) {
const myPath = import.meta.url.replace("file://", "");
const metagen = new Metagen(
diff --git a/examples/typegraphs/metagen/py/remix.py b/examples/typegraphs/metagen/py/remix.py
index 5992ea744d..455f9806d0 100644
--- a/examples/typegraphs/metagen/py/remix.py
+++ b/examples/typegraphs/metagen/py/remix.py
@@ -1,4 +1,7 @@
-from .remix_types import typed_remix_track, Idv3
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from .remix_types import Idv3, typed_remix_track
# the following decorator makes sure your function
diff --git a/examples/typegraphs/metagen/py/remix_types.py b/examples/typegraphs/metagen/py/remix_types.py
index 83d667e0ef..3a95c7c2d8 100644
--- a/examples/typegraphs/metagen/py/remix_types.py
+++ b/examples/typegraphs/metagen/py/remix_types.py
@@ -1,6 +1,9 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from dataclasses import asdict, dataclass, fields
from types import NoneType
-from typing import Callable, List, Union, get_origin, ForwardRef, Any
-from dataclasses import dataclass, asdict, fields
+from typing import Any, Callable, ForwardRef, List, Union, get_origin
FORWARD_REFS = {}
diff --git a/examples/typegraphs/metagen/ts/fdk.ts b/examples/typegraphs/metagen/ts/fdk.ts
index b34231aaa1..223bec680a 100644
--- a/examples/typegraphs/metagen/ts/fdk.ts
+++ b/examples/typegraphs/metagen/ts/fdk.ts
@@ -42,5 +42,4 @@ export type Idv3 = {
mp3Url: StringUri;
};
-
export type RemixTrackHandler = Handler;
diff --git a/examples/typegraphs/metagen/ts/remix.ts b/examples/typegraphs/metagen/ts/remix.ts
index 0d0ecbac02..b69a0b4a53 100644
--- a/examples/typegraphs/metagen/ts/remix.ts
+++ b/examples/typegraphs/metagen/ts/remix.ts
@@ -1,4 +1,4 @@
-import type { RemixTrackHandler, Ctx, Idv3 } from "./fdk.ts";
+import type { Ctx, Idv3, RemixTrackHandler } from "./fdk.ts";
// the name of the export must match the one referred int he typegraph
export const remix_track: RemixTrackHandler = (inp, cx: Ctx) => {
diff --git a/examples/typegraphs/oauth2.py b/examples/typegraphs/oauth2.py
index cfff1214e0..b83f84a1ae 100644
--- a/examples/typegraphs/oauth2.py
+++ b/examples/typegraphs/oauth2.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Auth, Cors
from typegraph.runtimes.deno import DenoRuntime
@@ -26,6 +29,6 @@ def oauth2_authentication(g: Graph):
get_context=deno.identity(ctx).apply(
{
"exp": g.from_context("exp"),
- }
+ },
),
)
diff --git a/examples/typegraphs/oauth2.ts b/examples/typegraphs/oauth2.ts
index 96172d572b..4164497f84 100644
--- a/examples/typegraphs/oauth2.ts
+++ b/examples/typegraphs/oauth2.ts
@@ -27,7 +27,7 @@ typegraph(
exp: g.fromContext("exp"),
}),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/policies.py b/examples/typegraphs/policies.py
index 35a53d0773..0ecd99ce82 100644
--- a/examples/typegraphs/policies.py
+++ b/examples/typegraphs/policies.py
@@ -1,6 +1,9 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.graph.params import Cors, Auth
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Auth, Cors
from typegraph.runtimes.deno import DenoRuntime
from typegraph.runtimes.random import RandomRuntime
diff --git a/examples/typegraphs/policies.ts b/examples/typegraphs/policies.ts
index e128ff32df..46651fc6b0 100644
--- a/examples/typegraphs/policies.ts
+++ b/examples/typegraphs/policies.ts
@@ -19,11 +19,11 @@ typegraph(
const admin_only = deno.policy(
"admin_only",
// note: policies either return true | false | null
- "(args, { context }) => context.username ? context.username === 'admin' : null"
+ "(args, { context }) => context.username ? context.username === 'admin' : null",
);
const user_only = deno.policy(
"user_only",
- "(args, { context }) => context.username ? context.username === 'user' : null"
+ "(args, { context }) => context.username ? context.username === 'user' : null",
);
g.auth(Auth.basic(["admin", "user"]));
@@ -37,9 +37,9 @@ typegraph(
both: random.gen(t.string()).withPolicy([user_only, admin_only]),
// set default policy for the exposed functions
},
- pub
+ pub,
);
// skip:start
- }
+ },
);
// skip:end
diff --git a/examples/typegraphs/prisma-no-sugar.py.disabled b/examples/typegraphs/prisma-no-sugar.py.disabled
index 869b2be4cd..1061f9ef7c 100644
--- a/examples/typegraphs/prisma-no-sugar.py.disabled
+++ b/examples/typegraphs/prisma-no-sugar.py.disabled
@@ -1,30 +1,30 @@
-# # skip:start
-# from typegraph import typegraph, effects, t, Graph
-# from typegraph.providers.prisma import PrismaRuntime
-#
-#
-# @typegraph()
-# def prisma_no_sugar(g: Graph):
-# db = PrismaRuntime("database", "POSTGRES_CONN")
-# message = t.struct({})
-# skip: end
-# t.func(
-# t.struct(
-# {
-# "data": t.struct(
-# {
-# # notice to absence of `id` as automatically generated
-# "title": t.string(),
-# "body": t.string(),
-# }
-# )
-# }
-# ),
-# t.list(message),
-# PrismaOperationMat(
-# db,
-# "Message",
-# "createOne",
-# effect=effects.create(),
-# ),
-# )
+# skip:start
+from typegraph import typegraph, effects, t, Graph
+from typegraph.providers.prisma import PrismaRuntime
+
+
+@typegraph()
+def prisma_no_sugar(g: Graph):
+ db = PrismaRuntime("database", "POSTGRES_CONN")
+ message = t.struct({})
+ skip: end
+ t.func(
+ t.struct(
+ {
+ "data": t.struct(
+ {
+ # notice to absence of `id` as automatically generated
+ "title": t.string(),
+ "body": t.string(),
+ }
+ )
+ }
+ ),
+ t.list(message),
+ PrismaOperationMat(
+ db,
+ "Message",
+ "createOne",
+ effect=effects.create(),
+ ),
+ )
diff --git a/examples/typegraphs/prisma-runtime.py b/examples/typegraphs/prisma-runtime.py
index a77bd4ed88..c17b25aa8c 100644
--- a/examples/typegraphs/prisma-runtime.py
+++ b/examples/typegraphs/prisma-runtime.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
from typegraph import Policy, t
from typegraph.graph.params import Cors
@@ -41,7 +44,7 @@ def prisma_runtime(g: Graph):
{
"id": t.string(),
"term": t.string(),
- }
+ },
),
t.list(user),
),
diff --git a/examples/typegraphs/prisma-runtime.ts b/examples/typegraphs/prisma-runtime.ts
index c6bb7b2977..e446afc640 100644
--- a/examples/typegraphs/prisma-runtime.ts
+++ b/examples/typegraphs/prisma-runtime.ts
@@ -29,7 +29,7 @@ typegraph(
email: t.email(),
firstname: t.string({ min: 2, max: 2000 }, {}),
},
- { name: "user" }
+ { name: "user" },
);
g.expose(
@@ -42,10 +42,10 @@ typegraph(
id: t.string(),
term: t.string(),
}),
- t.list(user)
+ t.list(user),
),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/prisma.py b/examples/typegraphs/prisma.py
index 80ad32e42a..8b8f717c68 100644
--- a/examples/typegraphs/prisma.py
+++ b/examples/typegraphs/prisma.py
@@ -1,6 +1,9 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.providers.prisma import PrismaRuntime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
+from typegraph.providers.prisma import PrismaRuntime
@typegraph(
diff --git a/examples/typegraphs/programmable-api-gateway.py b/examples/typegraphs/programmable-api-gateway.py
index 284c01b0d9..c4b0dbb697 100644
--- a/examples/typegraphs/programmable-api-gateway.py
+++ b/examples/typegraphs/programmable-api-gateway.py
@@ -1,7 +1,9 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
import yaml
-
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.deno import DenoRuntime
diff --git a/examples/typegraphs/programmable-api-gateway.ts b/examples/typegraphs/programmable-api-gateway.ts
index 9180126fd7..7f372f885d 100644
--- a/examples/typegraphs/programmable-api-gateway.ts
+++ b/examples/typegraphs/programmable-api-gateway.ts
@@ -17,7 +17,7 @@ typegraph(
const pub = Policy.public();
const roulette_access = deno.policy(
"roulette",
- "() => Math.random() < 0.5"
+ "() => Math.random() < 0.5",
);
// skip:next-line
@@ -34,8 +34,8 @@ typegraph(
foo: static_vals["foo"],
}),
},
- policy
+ policy,
);
}
- }
+ },
);
diff --git a/examples/typegraphs/quick-start-project.py b/examples/typegraphs/quick-start-project.py
index 7339e1c806..4e5a458200 100644
--- a/examples/typegraphs/quick-start-project.py
+++ b/examples/typegraphs/quick-start-project.py
@@ -1,7 +1,10 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.providers.prisma import PrismaRuntime
-from typegraph.runtimes import PythonRuntime, DenoRuntime
+from typegraph.runtimes import DenoRuntime, PythonRuntime
@typegraph(
diff --git a/examples/typegraphs/quick-start-project.ts b/examples/typegraphs/quick-start-project.ts
index 887b68b351..4b968de079 100644
--- a/examples/typegraphs/quick-start-project.ts
+++ b/examples/typegraphs/quick-start-project.ts
@@ -24,19 +24,19 @@ typegraph(
title: t.string(),
body: t.string(),
},
- { name: "message" } // the name of our type
+ { name: "message" }, // the name of our type
);
// custom functions
const add = deno.func(
t.struct({ first: t.float(), second: t.float() }),
t.float(),
- { code: "({first, second}) => first + second" }
+ { code: "({first, second}) => first + second" },
);
const hello = python.fromLambda(
t.struct({ world: t.string() }),
t.string(),
- { code: `lambda x: f"Hello {x['world']}!"` }
+ { code: `lambda x: f"Hello {x['world']}!"` },
);
g.expose(
@@ -46,7 +46,7 @@ typegraph(
create_message: db.create(message),
list_messages: db.findMany(message),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/random-field.py b/examples/typegraphs/random-field.py
index 3bb1a071a9..c6dff64059 100644
--- a/examples/typegraphs/random-field.py
+++ b/examples/typegraphs/random-field.py
@@ -1,8 +1,11 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
# skip:start
from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
# skip:end
@@ -22,7 +25,7 @@ def random_field(g: Graph):
{
"performance": t.integer(),
"bonus": bonus_items.from_random(), # this field is now generated randomly
- }
+ },
)
# set a custom seed
diff --git a/examples/typegraphs/random-field.ts b/examples/typegraphs/random-field.ts
index 0b2e4eb9b7..53c4b2f71b 100644
--- a/examples/typegraphs/random-field.ts
+++ b/examples/typegraphs/random-field.ts
@@ -27,7 +27,7 @@ typegraph(
`Daily bonus: ${(performance > 100 ? bonus : ["none"]).join(", ")}`,
}),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/rate.py b/examples/typegraphs/rate.py
index bffaf3edce..bf41d310a5 100644
--- a/examples/typegraphs/rate.py
+++ b/examples/typegraphs/rate.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors, Rate
from typegraph.runtimes.random import RandomRuntime
diff --git a/examples/typegraphs/rate.ts b/examples/typegraphs/rate.ts
index a3115c1d84..608c04c00b 100644
--- a/examples/typegraphs/rate.ts
+++ b/examples/typegraphs/rate.ts
@@ -39,7 +39,7 @@ typegraph(
.gen(t.list(t.string()))
.rate({ calls: false, weight: 2 }), // increment by # of results returned
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/reduce.py b/examples/typegraphs/reduce.py
index f8e0993216..c7d5217b89 100644
--- a/examples/typegraphs/reduce.py
+++ b/examples/typegraphs/reduce.py
@@ -1,8 +1,10 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
-from typegraph.graph.params import Auth
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Auth, Cors
from typegraph.providers.prisma import PrismaRuntime
-from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
@@ -67,8 +69,8 @@ def roadmap(g: Graph):
"authorEmail": g.inherit(),
"votes": g.inherit(),
"bucket": {"connect": g.inherit()},
- }
- }
+ },
+ },
),
create_vote=db.create(vote),
)
diff --git a/examples/typegraphs/reduce.ts b/examples/typegraphs/reduce.ts
index def512775c..00cdb815ee 100644
--- a/examples/typegraphs/reduce.ts
+++ b/examples/typegraphs/reduce.ts
@@ -20,7 +20,7 @@ typegraph(
name: t.string(),
ideas: t.list(g.ref("idea")),
},
- { name: "bucket" }
+ { name: "bucket" },
);
const idea = t.struct(
@@ -31,7 +31,7 @@ typegraph(
votes: t.list(g.ref("vote")),
bucket: g.ref("bucket"),
},
- { name: "idea" }
+ { name: "idea" },
);
const vote = t.struct(
@@ -42,14 +42,14 @@ typegraph(
desc: t.string().optional(),
idea: g.ref("idea"),
},
- { name: "vote" }
+ { name: "vote" },
);
g.auth(Auth.basic(["andim"]));
const admins = deno.policy(
"admins",
- "(_args, { context }) => !!context.username"
+ "(_args, { context }) => !!context.username",
);
g.expose(
@@ -68,7 +68,7 @@ typegraph(
}),
create_vote: db.create(vote),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/rest.py b/examples/typegraphs/rest.py
index c0b62c8dce..088bf0a5f3 100644
--- a/examples/typegraphs/rest.py
+++ b/examples/typegraphs/rest.py
@@ -1,8 +1,10 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
-from typegraph.graph.params import Auth
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Auth, Cors
from typegraph.providers.prisma import PrismaRuntime
-from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
@@ -67,8 +69,8 @@ def roadmap(g: Graph):
"authorEmail": g.inherit(),
"votes": g.inherit(),
"bucket": {"connect": g.inherit()},
- }
- }
+ },
+ },
),
create_vote=db.create(vote),
)
@@ -86,7 +88,7 @@ def roadmap(g: Graph):
}
}
}
- """
+ """,
)
g.rest(
@@ -104,5 +106,5 @@ def roadmap(g: Graph):
}
}
}
- """
+ """,
)
diff --git a/examples/typegraphs/rest.ts b/examples/typegraphs/rest.ts
index c99aa80abb..60672ac706 100644
--- a/examples/typegraphs/rest.ts
+++ b/examples/typegraphs/rest.ts
@@ -20,7 +20,7 @@ typegraph(
name: t.string(),
ideas: t.list(g.ref("idea")),
},
- { name: "bucket" }
+ { name: "bucket" },
);
const idea = t.struct(
@@ -31,7 +31,7 @@ typegraph(
votes: t.list(g.ref("vote")),
bucket: g.ref("bucket"),
},
- { name: "idea" }
+ { name: "idea" },
);
const vote = t.struct(
@@ -42,14 +42,14 @@ typegraph(
desc: t.string().optional(),
idea: g.ref("idea"),
},
- { name: "vote" }
+ { name: "vote" },
);
g.auth(Auth.basic(["andim"]));
const admins = deno.policy(
"admins",
- "(_args, { context }) => !!context.username"
+ "(_args, { context }) => !!context.username",
);
g.expose(
@@ -68,7 +68,7 @@ typegraph(
}),
create_vote: db.create(vote),
},
- pub
+ pub,
);
g.rest(
@@ -84,7 +84,7 @@ typegraph(
}
}
}
- `
+ `,
);
g.rest(
@@ -102,7 +102,7 @@ typegraph(
}
}
}
- `
+ `,
);
- }
+ },
);
diff --git a/examples/typegraphs/roadmap-policies.py b/examples/typegraphs/roadmap-policies.py
index 791355c2b6..9e740dd923 100644
--- a/examples/typegraphs/roadmap-policies.py
+++ b/examples/typegraphs/roadmap-policies.py
@@ -1,8 +1,10 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.deno import DenoRuntime
-from typegraph.graph.params import Auth
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Auth, Cors
from typegraph.providers.prisma import PrismaRuntime
-from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
@typegraph(
diff --git a/examples/typegraphs/roadmap-policies.ts b/examples/typegraphs/roadmap-policies.ts
index e526e195e3..7902f05033 100644
--- a/examples/typegraphs/roadmap-policies.ts
+++ b/examples/typegraphs/roadmap-policies.ts
@@ -21,7 +21,7 @@ typegraph(
name: t.string(),
ideas: t.list(g.ref("idea")),
},
- { name: "bucket" }
+ { name: "bucket" },
);
const idea = t.struct(
@@ -32,7 +32,7 @@ typegraph(
votes: t.list(g.ref("vote")),
bucket: g.ref("bucket"),
},
- { name: "idea" }
+ { name: "idea" },
);
const vote = t.struct(
@@ -43,14 +43,14 @@ typegraph(
desc: t.string().optional(),
idea: g.ref("idea"),
},
- { name: "vote" }
+ { name: "vote" },
);
g.auth(Auth.basic(["andim"]));
const admins = deno.policy(
"admins",
- "(_args, { context }) => !!context.username"
+ "(_args, { context }) => !!context.username",
);
g.expose(
@@ -61,7 +61,7 @@ typegraph(
create_idea: db.create(idea),
create_vote: db.create(vote),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/roadmap-random.py b/examples/typegraphs/roadmap-random.py
index ef07107f5a..2332c621f3 100644
--- a/examples/typegraphs/roadmap-random.py
+++ b/examples/typegraphs/roadmap-random.py
@@ -1,8 +1,12 @@
-from typegraph import typegraph, Policy, t, Graph
-from typegraph.runtimes.random import RandomRuntime
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+from typegraph import Graph, Policy, t, typegraph
# skip:start
from typegraph.graph.params import Cors
+from typegraph.runtimes.random import RandomRuntime
+
# skip:end
@@ -18,28 +22,28 @@ def roadmap(g: Graph):
{
"id": t.integer(as_id=True),
"name": t.string(),
- }
+ },
)
_vote = t.struct(
{
"id": t.uuid(),
"authorEmail": t.email(),
"importance": t.enum(
- ["medium", "important", "critical"]
+ ["medium", "important", "critical"],
).optional(), # `enum_` is also a shorthand over `t.string`
"createdAt": t.datetime(),
"desc": t.string().optional(), # makes it optional
- }
+ },
)
# skip:end
idea = t.struct(
{
"id": t.uuid(
- as_id=True
+ as_id=True,
), # uuid is just a shorthand alias for `t.string({format: "uuid"})`
"name": t.string(),
"authorEmail": t.email(), # another string shorthand
- }
+ },
)
random = RandomRuntime(reset=None, seed=1)
pub = Policy.public()
diff --git a/examples/typegraphs/roadmap-random.ts b/examples/typegraphs/roadmap-random.ts
index 02172f617d..628c666344 100644
--- a/examples/typegraphs/roadmap-random.ts
+++ b/examples/typegraphs/roadmap-random.ts
@@ -34,5 +34,5 @@ typegraph(
const random = new RandomRuntime({ seed: 1 });
const pub = Policy.public();
g.expose({ get_idea: random.gen(idea) }, pub);
- }
+ },
);
diff --git a/examples/typegraphs/runtimes.py b/examples/typegraphs/runtimes.py
index 64983d2039..af3f307e08 100644
--- a/examples/typegraphs/runtimes.py
+++ b/examples/typegraphs/runtimes.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, t, Graph
+from typegraph import Graph, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes import HttpRuntime
@@ -13,5 +16,7 @@ def runtimes(g: Graph):
# same func as above
http.get(
- "/flip_coin", t.struct({}), t.enum(["head", "tail"])
+ "/flip_coin",
+ t.struct({}),
+ t.enum(["head", "tail"]),
) # implicitly attaches runtime to all types
diff --git a/examples/typegraphs/temporal.py b/examples/typegraphs/temporal.py
index 571d2596fa..32037a7a68 100644
--- a/examples/typegraphs/temporal.py
+++ b/examples/typegraphs/temporal.py
@@ -1,7 +1,11 @@
-from typegraph import t, typegraph, Policy, Graph
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+import os
+
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.providers.temporal import TemporalRuntime
-import os
@typegraph(
diff --git a/examples/typegraphs/temporal.ts b/examples/typegraphs/temporal.ts
index b56afac5ea..89ff00055c 100644
--- a/examples/typegraphs/temporal.ts
+++ b/examples/typegraphs/temporal.ts
@@ -1,18 +1,9 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { TemporalRuntime } from "@typegraph/sdk/providers/temporal.ts";
-
-// skip:start
-function getEnvVariable(
- key: string,
- defaultValue?: string
-): string | undefined {
- const glob = globalThis as any;
- const value = glob?.process
- ? glob?.process.env?.[key]
- : glob?.Deno.env.get(key);
- return value ?? defaultValue;
-}
-// skip:end
+import process from "process";
typegraph(
{
@@ -29,7 +20,7 @@ typegraph(
namespaceSecret: "NAMESPACE",
});
- const workflow_id = getEnvVariable("ID_FROM_ENV");
+ const workflow_id = process.env["ID_FROM_ENV"];
const arg = t.struct({ some_field: t.string() });
g.expose(
@@ -41,7 +32,7 @@ typegraph(
? temporal.describeWorkflow().reduce({ workflow_id })
: temporal.describeWorkflow(),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/triggers.py b/examples/typegraphs/triggers.py
index 851ca038e8..37993ead34 100644
--- a/examples/typegraphs/triggers.py
+++ b/examples/typegraphs/triggers.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, Policy, t, Graph
+from typegraph import Graph, Policy, t, typegraph
from typegraph.graph.params import Cors
from typegraph.runtimes.http import HttpRuntime
diff --git a/examples/typegraphs/triggers.ts b/examples/typegraphs/triggers.ts
index ca4f92ba23..ac82710602 100644
--- a/examples/typegraphs/triggers.ts
+++ b/examples/typegraphs/triggers.ts
@@ -7,6 +7,7 @@ import { HttpRuntime } from "@typegraph/sdk/runtimes/http.ts";
typegraph(
{
name: "triggers",
+ // skip:next-line
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
},
(g) => {
@@ -21,7 +22,7 @@ typegraph(
path: "/flip_coin",
}),
},
- pub
+ pub,
);
- }
+ },
);
diff --git a/examples/typegraphs/typecheck.py b/examples/typegraphs/typecheck.py
index fb66b002b3..8b5ae9103d 100644
--- a/examples/typegraphs/typecheck.py
+++ b/examples/typegraphs/typecheck.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, t, Graph
+from typegraph import Graph, t, typegraph
from typegraph.graph.params import Cors
@@ -13,15 +16,15 @@ def typecheck(g: Graph):
"name": t.string(max=200),
"age": t.optional(t.integer()), # or t.integer().optional()
"messages": t.list(t.struct({"text": t.string(), "sentAt": t.datetime()})),
- }
+ },
)
# the typegate will accept data as follow
- {
+ _ = {
"name": "Alan",
"age": 28,
"messages": [{"text": "Hello!", "sentAt": "2022-12-28T01:11:10Z"}],
}
# and reject invalid data
- {"name": "Turing", "messages": [{"sentAt": 1}]}
+ _ = {"name": "Turing", "messages": [{"sentAt": 1}]}
diff --git a/examples/typegraphs/types.py b/examples/typegraphs/types.py
index ea01834206..c4f644b4eb 100644
--- a/examples/typegraphs/types.py
+++ b/examples/typegraphs/types.py
@@ -1,5 +1,8 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
# skip:start
-from typegraph import typegraph, t, Graph
+from typegraph import Graph, t, typegraph
from typegraph.graph.params import Cors
@@ -17,8 +20,8 @@ def types(g: Graph):
{
"model": t.string(),
"name": t.string().optional(),
- }
- )
+ },
+ ),
),
- }
+ },
)
diff --git a/examples/typegraphs/union-either.py b/examples/typegraphs/union-either.py
new file mode 100644
index 0000000000..2a01f47ee8
--- /dev/null
+++ b/examples/typegraphs/union-either.py
@@ -0,0 +1,72 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
+# skip:start
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.graph.params import Cors
+from typegraph.runtimes.deno import DenoRuntime
+
+
+# skip:end
+@typegraph(
+ # skip:start
+ cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),
+ # skip:end
+)
+def union_either(g: Graph):
+ deno = DenoRuntime()
+ members = [
+ t.string().rename("scalar_1"),
+ t.integer().rename("scalar_2"),
+ t.struct(
+ {
+ "field1": t.string(),
+ },
+ ).rename("comp_1"),
+ t.struct(
+ {
+ "field2": t.string(),
+ },
+ ).rename("comp_2"),
+ t.list(t.string()).rename("scalar_list"),
+ # # FIXME: list of composites is broken
+ # t.list(
+ # t.struct(
+ # {
+ # "listField": t.string(),
+ # }
+ # ),
+ # ),
+ ]
+ g.expose(
+ Policy.public(),
+ outer=deno.func(
+ t.struct(),
+ t.struct(
+ {
+ "union": t.union(members),
+ "either": t.either(members),
+ "unionList": t.list(t.union(members)),
+ },
+ ),
+ code="""() => ({
+ either: {
+ field1: "1",
+ },
+ union: {
+ field2: "2",
+ },
+ unionList: [
+ "scalar",
+ 2,
+ {
+ field1: "1",
+ },
+ {
+ field2: "2",
+ },
+ ["scalar_1", "scalar_2"],
+ ],
+ })""",
+ ),
+ )
diff --git a/examples/typegraphs/union-either.ts b/examples/typegraphs/union-either.ts
new file mode 100644
index 0000000000..ec4d93bda8
--- /dev/null
+++ b/examples/typegraphs/union-either.ts
@@ -0,0 +1,65 @@
+// skip:start
+import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
+import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
+
+// skip:end
+typegraph(
+ {
+ name: "union-either",
+ // skip:next-line
+ cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
+ },
+ (g) => {
+ const deno = new DenoRuntime();
+ const members = [
+ t.string().rename("scalar_1"),
+ t.integer().rename("scalar_2"),
+ t.struct({
+ field1: t.string(),
+ }).rename("comp_1"),
+ t.struct({
+ field2: t.string(),
+ }).rename("comp_2"),
+ t.list(t.string()).rename("scalar_list"),
+ /* FIXME: list of composites is broken
+ t.list(
+ t.struct({
+ listField: t.string(),
+ }),
+ ), */
+ ];
+ g.expose({
+ outer: deno.func(
+ // input
+ t.struct({}),
+ // output
+ t.struct({
+ union: t.union(members),
+ either: t.either(members),
+ unionList: t.list(t.union(members)),
+ }),
+ {
+ code: () => ({
+ either: {
+ field1: "1",
+ },
+ union: {
+ field2: "2",
+ },
+ unionList: [
+ "scalar",
+ 2,
+ {
+ field1: "1",
+ },
+ {
+ field2: "2",
+ },
+ ["scalar_1", "scalar_2"],
+ ],
+ }),
+ },
+ ),
+ }, Policy.public());
+ },
+);
diff --git a/ghjk.ts b/ghjk.ts
index 324ada15b9..67d63a6321 100644
--- a/ghjk.ts
+++ b/ghjk.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// @ts-nocheck: Deno file
import { METATYPE_VERSION, PUBLISHED_VERSION } from "./tools/consts.ts";
@@ -57,6 +60,10 @@ env("_python").install(
packageName: "ruff",
version: "0.4.7",
})[0],
+ ports.npmi({
+ packageName: "pyright",
+ version: "1.1.388",
+ })[0],
ports.pipi({
packageName: "poetry",
version: "1.8.3",
diff --git a/pyproject.toml b/pyproject.toml
index 3286edbfcd..f1ff2e17d6 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,3 +23,24 @@ pyyaml = "^6.0.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
+
+[tool.ruff.lint]
+select = [
+ # pycodestyle
+ "E",
+ # Pyflakes
+ "F",
+ # pyupgrade
+ "UP",
+ # flake8-bugbear
+ "B",
+ # flake8-simplify
+ "SIM",
+ # isort
+ "I",
+]
+ignore = [
+ # line too long
+ "E501",
+ "UP013"
+]
diff --git a/src/common/src/typegraph/validator/injection.rs b/src/common/src/typegraph/validator/injection.rs
index cfdee4c4c2..09bd9cf381 100644
--- a/src/common/src/typegraph/validator/injection.rs
+++ b/src/common/src/typegraph/validator/injection.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use indexmap::IndexMap;
use serde_json::Value;
diff --git a/src/meta-cli/src/cli/fdk_template.rs b/src/meta-cli/src/cli/fdk_template.rs
index 7d363f114d..b7c8529111 100644
--- a/src/meta-cli/src/cli/fdk_template.rs
+++ b/src/meta-cli/src/cli/fdk_template.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use async_trait::async_trait;
use clap::{Parser, ValueEnum};
diff --git a/src/meta-cli/src/utils/shell_words.rs b/src/meta-cli/src/utils/shell_words.rs
index 5c00018f2e..4e2df60909 100644
--- a/src/meta-cli/src/utils/shell_words.rs
+++ b/src/meta-cli/src/utils/shell_words.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// no-auto-license-header
/*
diff --git a/src/meta-cli/tests/graphs/nested/graph0.py b/src/meta-cli/tests/graphs/nested/graph0.py
index e69de29bb2..8e55187b7a 100644
--- a/src/meta-cli/tests/graphs/nested/graph0.py
+++ b/src/meta-cli/tests/graphs/nested/graph0.py
@@ -0,0 +1,2 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
diff --git a/src/meta-lsp/ts-language-server/src/analysis/diagnostics/context.ts b/src/meta-lsp/ts-language-server/src/analysis/diagnostics/context.ts
index 71322451ee..ad90f9619e 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/diagnostics/context.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/diagnostics/context.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Diagnostic, DiagnosticSeverity } from "vscode-languageserver-types";
import { ScopeManager } from "../typescript-semantic/scope.ts";
import {
diff --git a/src/meta-lsp/ts-language-server/src/analysis/exposed_function.ts b/src/meta-lsp/ts-language-server/src/analysis/exposed_function.ts
index dc82d9e0c2..712996a101 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/exposed_function.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/exposed_function.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser } from "../parser.ts";
import { ModuleDiagnosticsContext } from "./diagnostics/context.ts";
import { InputType, Runtime } from "./runtimes/mod.ts";
diff --git a/src/meta-lsp/ts-language-server/src/analysis/runtimes/mod.ts b/src/meta-lsp/ts-language-server/src/analysis/runtimes/mod.ts
index 29b1f2168b..f382675346 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/runtimes/mod.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/runtimes/mod.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";
import { TgType } from "../typescript-semantic/semantic-node.ts";
@@ -8,7 +11,7 @@ export type InputType = {
};
export abstract class Runtime {
- protected constructor(public node: Parser.SyntaxNode) { }
+ protected constructor(public node: Parser.SyntaxNode) {}
static analyze(
node: Parser.SyntaxNode,
diff --git a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/scope.ts b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/scope.ts
index 6f0d87bf4c..490e403769 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/scope.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/scope.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser, queryMatches } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";
diff --git a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/semantic-node.ts b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/semantic-node.ts
index 864f35a100..e563519dea 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/semantic-node.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/semantic-node.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser } from "../../parser.ts";
import { ModuleDiagnosticsContext } from "../diagnostics/context.ts";
import { asMethodCall } from "./utils/mod.ts";
@@ -28,7 +31,7 @@ export type TgTypeName =
// ];
export abstract class SemanticNode {
- protected constructor(public node: Parser.SyntaxNode) { }
+ protected constructor(public node: Parser.SyntaxNode) {}
asType(): TgType | null {
if (this instanceof TgType) {
@@ -54,9 +57,10 @@ export abstract class TgType extends SemanticNode {
}
toString(): string {
- return `TgType(${this.type}${this.children
- .map((c) => `, ${c.key} => ${c.type.toString()}`)
- .join("")
+ return `TgType(${this.type}${
+ this.children
+ .map((c) => `, ${c.key} => ${c.type.toString()}`)
+ .join("")
})`;
}
diff --git a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/symbols.ts b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/symbols.ts
index 02f75a3658..f810e8065a 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/symbols.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/symbols.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { ScopeManager } from "./scope.ts";
import { SemanticNode } from "./semantic-node.ts";
@@ -9,7 +12,7 @@ export abstract class Symbol {
public name: string,
public node: Parser.SyntaxNode,
private scopeManager: ScopeManager,
- ) { }
+ ) {}
}
export class ImportSymbol extends Symbol {
diff --git a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/utils/mod.ts b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/utils/mod.ts
index 387d64c9f0..c6f23ba7cd 100644
--- a/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/utils/mod.ts
+++ b/src/meta-lsp/ts-language-server/src/analysis/typescript-semantic/utils/mod.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser } from "../../../parser.ts";
export type MethodCall = {
diff --git a/src/meta-lsp/ts-language-server/src/lsp_client.ts b/src/meta-lsp/ts-language-server/src/lsp_client.ts
index c9e7848ef6..c7518160e6 100644
--- a/src/meta-lsp/ts-language-server/src/lsp_client.ts
+++ b/src/meta-lsp/ts-language-server/src/lsp_client.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import child_process from "node:child_process";
import { JSONRPCEndpoint, LspClient } from "ts-lsp-client";
diff --git a/src/meta-lsp/ts-language-server/src/parser.ts b/src/meta-lsp/ts-language-server/src/parser.ts
index 8fdc918c46..7de6247d5f 100644
--- a/src/meta-lsp/ts-language-server/src/parser.ts
+++ b/src/meta-lsp/ts-language-server/src/parser.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import Parser = require("tree-sitter");
import { typescript as TypeScript } from "tree-sitter-typescript";
import {
diff --git a/src/meta-lsp/ts-language-server/src/server.ts b/src/meta-lsp/ts-language-server/src/server.ts
index d05c00b2ae..7a379f1bd6 100644
--- a/src/meta-lsp/ts-language-server/src/server.ts
+++ b/src/meta-lsp/ts-language-server/src/server.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { LspServer } from "./server/index.ts";
const server = new LspServer(["deno", "lsp"]);
diff --git a/src/meta-lsp/ts-language-server/src/server/documents.ts b/src/meta-lsp/ts-language-server/src/server/documents.ts
index 40b2582844..11a0534c84 100644
--- a/src/meta-lsp/ts-language-server/src/server/documents.ts
+++ b/src/meta-lsp/ts-language-server/src/server/documents.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Connection, TextDocuments } from "vscode-languageserver";
import { TextDocument } from "vscode-languageserver-textdocument";
import { ClientCapabilities } from "./mod.ts";
diff --git a/src/meta-lsp/ts-language-server/src/server/index.ts b/src/meta-lsp/ts-language-server/src/server/index.ts
index 93166a06ca..e71540edd6 100644
--- a/src/meta-lsp/ts-language-server/src/server/index.ts
+++ b/src/meta-lsp/ts-language-server/src/server/index.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { LspClient } from "ts-lsp-client";
import { createLspClient } from "../lsp_client.ts";
import {
diff --git a/src/meta-lsp/ts-language-server/src/types.ts b/src/meta-lsp/ts-language-server/src/types.ts
index 4dfd84a17e..bbfd219d3d 100644
--- a/src/meta-lsp/ts-language-server/src/types.ts
+++ b/src/meta-lsp/ts-language-server/src/types.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Parser } from "../parser.ts";
export type TypegraphDefinition = {
diff --git a/src/meta-lsp/ts-language-server/tests/expose_analysis.test.ts b/src/meta-lsp/ts-language-server/tests/expose_analysis.test.ts
index d9660c561e..0e312c33e4 100644
--- a/src/meta-lsp/ts-language-server/tests/expose_analysis.test.ts
+++ b/src/meta-lsp/ts-language-server/tests/expose_analysis.test.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { typescript } from "tree-sitter-typescript";
import {
findTypegraphDefinitions,
diff --git a/src/meta-lsp/ts-language-server/tests/typegraphs/deno_types.ts b/src/meta-lsp/ts-language-server/tests/typegraphs/deno_types.ts
index b2ae684dc0..1e36f95d1a 100644
--- a/src/meta-lsp/ts-language-server/tests/typegraphs/deno_types.ts
+++ b/src/meta-lsp/ts-language-server/tests/typegraphs/deno_types.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// TODO use deployed version of metatype in the import map
import { Policy, t, typegraph } from "npm:@typegraph/sdk@0.2.4";
import { PythonRuntime } from "npm:@typegraph/sdk@0.2.4/runtimes/python";
diff --git a/src/meta-lsp/ts-language-server/tests/utils.ts b/src/meta-lsp/ts-language-server/tests/utils.ts
index e69de29bb2..23d9e15ccf 100644
--- a/src/meta-lsp/ts-language-server/tests/utils.ts
+++ b/src/meta-lsp/ts-language-server/tests/utils.ts
@@ -0,0 +1,2 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
diff --git a/src/meta-lsp/vscode-metatype-support/src/extension.ts b/src/meta-lsp/vscode-metatype-support/src/extension.ts
index 2cf821b9ed..c0a373c0af 100644
--- a/src/meta-lsp/vscode-metatype-support/src/extension.ts
+++ b/src/meta-lsp/vscode-metatype-support/src/extension.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { join } from "node:path";
import { ExtensionContext } from "vscode";
diff --git a/src/metagen/fixtures/tg.ts b/src/metagen/fixtures/tg.ts
index 12fbe189ba..e0e4dae44e 100644
--- a/src/metagen/fixtures/tg.ts
+++ b/src/metagen/fixtures/tg.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { WasmRuntime } from "@typegraph/sdk/runtimes/wasm.ts";
diff --git a/src/metagen/src/client_py/static/client.py b/src/metagen/src/client_py/static/client.py
index d943e26f9f..445b4048a3 100644
--- a/src/metagen/src/client_py/static/client.py
+++ b/src/metagen/src/client_py/static/client.py
@@ -1,9 +1,12 @@
-import typing
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
import dataclasses as dc
+import http.client as http_c
import json
-import urllib.request as request
+import typing
import urllib.error
-import http.client as http_c
+from urllib import request
def selection_to_nodes(
@@ -15,9 +18,9 @@ def selection_to_nodes(
flags = selection.get("_")
if flags is not None and not isinstance(flags, SelectionFlags):
raise Exception(
- f"selection field '_' should be of type SelectionFlags but found {type(flags)}"
+ f"selection field '_' should be of type SelectionFlags but found {type(flags)}",
)
- select_all = True if flags is not None and flags.select_all else False
+ select_all = flags is not None and flags.select_all
found_nodes = set(selection.keys())
for node_name, meta_fn in metas.items():
found_nodes.discard(node_name)
@@ -45,7 +48,7 @@ def selection_to_nodes(
continue
if isinstance(instance_selection, Alias):
raise Exception(
- f"nested Alias node discovered at {parent_path}.{instance_name}"
+ f"nested Alias node discovered at {parent_path}.{instance_name}",
)
instance_args: typing.Optional[NodeArgs] = None
@@ -60,7 +63,7 @@ def selection_to_nodes(
raise Exception(
f"node at {parent_path}.{instance_name} is a node that "
+ "requires arguments "
- + f"but detected argument is typeof {type(arg)}"
+ + f"but detected argument is typeof {type(arg)}",
)
# convert arg dict to NodeArgs
@@ -70,7 +73,7 @@ def selection_to_nodes(
ty_name = expected_args.pop(key)
if ty_name is None:
raise Exception(
- f"unexpected argument ${key} at {parent_path}.{instance_name}"
+ f"unexpected argument ${key} at {parent_path}.{instance_name}",
)
instance_args[key] = NodeArgValue(ty_name, val)
@@ -85,7 +88,7 @@ def selection_to_nodes(
raise Exception(
f"node at {parent_path}.{instance_name} is a composite "
+ "that requires an argument object "
- + f"but selection is typeof {type(sub_selections)}"
+ + f"but selection is typeof {type(sub_selections)}",
)
sub_selections = sub_selections[1]
@@ -112,7 +115,7 @@ def selection_to_nodes(
if meta.sub_nodes is not None:
if meta.variants is not None:
raise Exception(
- "unreachable: union/either NodeMetas can't have subnodes"
+ "unreachable: union/either NodeMetas can't have subnodes",
)
sub_nodes = selection_to_nodes(
typing.cast("SelectionErased", sub_selections),
@@ -148,7 +151,7 @@ def selection_to_nodes(
instance_name="__typename",
args=None,
sub_nodes=None,
- )
+ ),
)
union_selections[variant_ty] = nodes
@@ -259,8 +262,7 @@ def get(self, key: str) -> PlaceholderValue:
class Alias(typing.Generic[SelectionT]):
- """
- Request multiple instances of a single node under different
+ """Request multiple instances of a single node under different
aliases.
"""
@@ -277,7 +279,10 @@ def __init__(self, **aliases: SelectionT):
None,
]
CompositeSelectNoArgs = typing.Union[
- SelectionT, Alias[SelectionT], typing.Literal[False], None
+ SelectionT,
+ Alias[SelectionT],
+ typing.Literal[False],
+ None,
]
CompositeSelectArgs = typing.Union[
typing.Tuple[typing.Union[ArgT, PlaceholderArgs], SelectionT],
@@ -367,7 +372,7 @@ def convert_query_node_gql(
gql_ty = ty_to_gql_ty_map[variant_ty]
if gql_ty is None:
raise Exception(
- f"unreachable: no graphql type found for variant {variant_ty}"
+ f"unreachable: no graphql type found for variant {variant_ty}",
)
gql_ty = gql_ty.strip("!")
@@ -380,9 +385,9 @@ def convert_query_node_gql(
out += f" {{ {sub_node_list}}}"
elif isinstance(node.sub_nodes, list):
sub_node_list = ""
- for node in node.sub_nodes:
+ for sub_node in node.sub_nodes:
sub_node_list += (
- f"{convert_query_node_gql(ty_to_gql_ty_map, node, variables)} "
+ f"{convert_query_node_gql(ty_to_gql_ty_map, sub_node, variables)} "
)
out += f" {{ {sub_node_list}}}"
return out
@@ -402,7 +407,7 @@ def __init__(
def build_gql(
self,
query: typing.Mapping[str, SelectNode],
- ty: typing.Union[typing.Literal["query"], typing.Literal["mutation"]],
+ ty: typing.Literal["query", "mutation"],
name: str = "",
):
variables: typing.Dict[str, NodeArgValue] = {}
@@ -436,7 +441,7 @@ def build_req(
{
"accept": "application/json",
"content-type": "application/json",
- }
+ },
)
data = json.dumps({"query": doc, "variables": variables}).encode("utf-8")
return GraphQLRequest(
@@ -468,8 +473,11 @@ def fetch(
try:
with request.urlopen(
request.Request(
- url=req.addr, method=req.method, headers=req.headers, data=req.body
- )
+ url=req.addr,
+ method=req.method,
+ headers=req.headers,
+ data=req.body,
+ ),
) as res:
http_res: http_c.HTTPResponse = res
return self.handle_response(
@@ -478,7 +486,7 @@ def fetch(
status=http_res.status,
body=http_res.read(),
headers={key: val for key, val in http_res.headers.items()},
- )
+ ),
)
except request.HTTPError as res:
return self.handle_response(
@@ -487,10 +495,10 @@ def fetch(
status=res.status or 599,
body=res.read(),
headers={key: val for key, val in res.headers.items()},
- )
+ ),
)
except urllib.error.URLError as err:
- raise Exception(f"URL error: {err.reason}")
+ raise Exception(f"URL error: {err.reason}") from err
def query(
self,
@@ -499,7 +507,9 @@ def query(
name: str = "",
) -> typing.Dict[str, Out]:
doc, variables = self.build_gql(
- {key: val for key, val in inp.items()}, "query", name
+ {key: val for key, val in inp.items()},
+ "query",
+ name,
)
return self.fetch(doc, variables, opts)
@@ -510,7 +520,9 @@ def mutation(
name: str = "",
) -> typing.Dict[str, Out]:
doc, variables = self.build_gql(
- {key: val for key, val in inp.items()}, "mutation", name
+ {key: val for key, val in inp.items()},
+ "mutation",
+ name,
)
return self.fetch(doc, variables, opts)
@@ -534,7 +546,7 @@ def __init__(
self,
transport: GraphQLTransportBase,
fun: typing.Callable[[PreparedArgs], typing.Mapping[str, SelectNode[Out]]],
- ty: typing.Union[typing.Literal["query"], typing.Literal["mutation"]],
+ ty: typing.Literal["query", "mutation"],
name: str = "",
):
dry_run_node = fun(PreparedArgs())
@@ -564,7 +576,7 @@ def __init__(
self,
transport: GraphQLTransportUrlib,
fun: typing.Callable[[PreparedArgs], typing.Mapping[str, SelectNode[Out]]],
- ty: typing.Union[typing.Literal["query"], typing.Literal["mutation"]],
+ ty: typing.Literal["query", "mutation"],
name: str = "",
):
super().__init__(transport, fun, ty, name)
@@ -589,10 +601,14 @@ def __init__(self, ty_to_gql_ty_map: typing.Dict[str, str]):
self.ty_to_gql_ty_map = ty_to_gql_ty_map
def graphql_sync(
- self, addr: str, opts: typing.Optional[GraphQLTransportOptions] = None
+ self,
+ addr: str,
+ opts: typing.Optional[GraphQLTransportOptions] = None,
):
return GraphQLTransportUrlib(
- addr, opts or GraphQLTransportOptions({}), self.ty_to_gql_ty_map
+ addr,
+ opts or GraphQLTransportOptions({}),
+ self.ty_to_gql_ty_map,
)
diff --git a/src/metagen/src/client_ts/static/mod.ts b/src/metagen/src/client_ts/static/mod.ts
index 3c7ba074fa..3a075fb461 100644
--- a/src/metagen/src/client_ts/static/mod.ts
+++ b/src/metagen/src/client_ts/static/mod.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
function _selectionToNodeSet(
selection: Selection,
metas: [string, () => NodeMeta][],
diff --git a/src/metagen/src/fdk_substantial/mod.rs b/src/metagen/src/fdk_substantial/mod.rs
index 494d76ee87..26f80816ea 100644
--- a/src/metagen/src/fdk_substantial/mod.rs
+++ b/src/metagen/src/fdk_substantial/mod.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// TODO: keyword filtering
use crate::interlude::*;
diff --git a/src/metagen/src/fdk_substantial/static/substantial.py b/src/metagen/src/fdk_substantial/static/substantial.py
index 621b0bdb4d..1a64363118 100644
--- a/src/metagen/src/fdk_substantial/static/substantial.py
+++ b/src/metagen/src/fdk_substantial/static/substantial.py
@@ -1,6 +1,9 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
from datetime import timedelta
-from typing import Any, Callable, Optional
from types import RetryStrategy
+from typing import Any, Callable, Optional
class Context:
diff --git a/src/metagen/src/fdk_substantial/static/types.py b/src/metagen/src/fdk_substantial/static/types.py
index e10d852ca0..af87fe6058 100644
--- a/src/metagen/src/fdk_substantial/static/types.py
+++ b/src/metagen/src/fdk_substantial/static/types.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
from dataclasses import dataclass
from typing import Union
diff --git a/src/metagen/src/fdk_substantial/static/workflow.py b/src/metagen/src/fdk_substantial/static/workflow.py
index 285844fa3c..377591f45a 100644
--- a/src/metagen/src/fdk_substantial/static/workflow.py
+++ b/src/metagen/src/fdk_substantial/static/workflow.py
@@ -1,3 +1,6 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
from substantial import workflow, Context # noqa
from substantial.types import RetryStrategy # noqa
diff --git a/src/metagen/src/fdk_typescript/static/fdk.ts b/src/metagen/src/fdk_typescript/static/fdk.ts
index ef276b7d43..28361dcebc 100644
--- a/src/metagen/src/fdk_typescript/static/fdk.ts
+++ b/src/metagen/src/fdk_typescript/static/fdk.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
export type Ctx = {
parent?: Record;
/**
diff --git a/src/pyrt_wit_wire/main.py b/src/pyrt_wit_wire/main.py
index 28689e3fc9..ef5c268929 100644
--- a/src/pyrt_wit_wire/main.py
+++ b/src/pyrt_wit_wire/main.py
@@ -1,10 +1,13 @@
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
+
import importlib
import importlib.abc
import importlib.machinery
import importlib.util
+import inspect
import json
import os
-import inspect
import sys
import traceback
import types
@@ -42,7 +45,7 @@
class Ctx:
def gql(self, query: str, variables: str) -> Any:
data = json.loads(
- hostcall("gql", json=json.dumps({"query": query, "variables": variables}))
+ hostcall("gql", json=json.dumps({"query": query, "variables": variables})),
)
return data["data"]
@@ -57,24 +60,24 @@ def init(self, args: InitArgs):
raise err
except Exception as err:
traceback.print_exc()
- raise Err(InitError_Other(str(err)))
+ raise Err(InitError_Other(str(err))) from err
return InitResponse(ok=True)
def handle(self, req: HandleReq):
handler = handlers.get(req.op_name)
if handler is None:
print(
- f"no handler found for {req.op_name}, registered handlers: {[op for op in handlers]}"
+ f"no handler found for {req.op_name}, registered handlers: {[op for op in handlers]}",
)
raise Err(HandleErr_NoHandler())
try:
return handler.handle(req)
except json.JSONDecodeError as err:
traceback.print_exc()
- raise Err(HandleErr_InJsonErr(str(err)))
+ raise Err(HandleErr_InJsonErr(str(err))) from err
except Exception as err:
traceback.print_exc()
- raise Err(HandleErr_HandlerErr(str(err)))
+ raise Err(HandleErr_HandlerErr(str(err))) from err
class ErasedHandler:
@@ -103,19 +106,19 @@ def op_to_handler(op: MatInfo) -> ErasedHandler:
modules_raw = data_parsed["sources"]
finder = ThePathFinder(
- {os.path.join(prefix, path): modules_raw[path] for path in modules_raw}
+ {os.path.join(prefix, path): modules_raw[path] for path in modules_raw},
)
sys.meta_path.append(finder)
try:
module = importlib.import_module(
ThePathFinder.path_to_module(
- os.path.join(prefix, data_parsed["root_src_path"])
- )
+ os.path.join(prefix, data_parsed["root_src_path"]),
+ ),
)
except Exception as err:
finder.debug()
- raise Err(InitError_Other(f"{err}"))
+ raise Err(InitError_Other(f"{err}")) from err
return ErasedHandler(handler_fn=getattr(module, data_parsed["func_name"]))
elif data_parsed["ty"] == "lambda":
fn = eval(data_parsed["source"])
@@ -127,7 +130,7 @@ def op_to_handler(op: MatInfo) -> ErasedHandler:
class ThePathFinder(importlib.abc.MetaPathFinder):
@staticmethod
def path_to_module(path: str):
- return os.path.splitext((os.path.normpath(path)))[0].replace("/", ".")
+ return os.path.splitext(os.path.normpath(path))[0].replace("/", ".")
def debug(self):
print("= Loaded modules summary == == == ==")
@@ -165,7 +168,10 @@ def find_spec(self, fullname: str, _path, target=None):
# our fake loader will give out the raw module src
# when asked
FakeFileLoader(
- fullname, path, src=self._mods_raw[path], is_package=False
+ fullname,
+ path,
+ src=self._mods_raw[path],
+ is_package=False,
),
)
# when one imports foo.bar.keg
@@ -177,7 +183,8 @@ def find_spec(self, fullname: str, _path, target=None):
if fullname in self._pkg_names:
path = self._pkg_names[fullname]
return importlib.util.spec_from_loader(
- fullname, FakeFileLoader(fullname, path, src="", is_package=True)
+ fullname,
+ FakeFileLoader(fullname, path, src="", is_package=True),
)
diff --git a/src/substantial/src/backends/fs.rs b/src/substantial/src/backends/fs.rs
index f154dd7fa5..373c9e76c7 100644
--- a/src/substantial/src/backends/fs.rs
+++ b/src/substantial/src/backends/fs.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::key_value::{Item, KeyValueBackend, KeyValueLike};
use anyhow::{Context, Result};
use chrono::{DateTime, Utc};
diff --git a/src/substantial/src/backends/key_value.rs b/src/substantial/src/backends/key_value.rs
index be0d9a65c4..cd6cfce7ad 100644
--- a/src/substantial/src/backends/key_value.rs
+++ b/src/substantial/src/backends/key_value.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::{Backend, BackendMetadataWriter, NextRun};
use crate::{
converters::{MetadataEvent, MetadataPayload},
diff --git a/src/substantial/src/backends/memory.rs b/src/substantial/src/backends/memory.rs
index 40c2fa0912..0c23871968 100644
--- a/src/substantial/src/backends/memory.rs
+++ b/src/substantial/src/backends/memory.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::key_value::{Item, KeyValueBackend, KeyValueLike};
use anyhow::Result;
use chrono::{DateTime, Utc};
diff --git a/src/substantial/src/backends/mod.rs b/src/substantial/src/backends/mod.rs
index f6541f64ff..6a4a8841f6 100644
--- a/src/substantial/src/backends/mod.rs
+++ b/src/substantial/src/backends/mod.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
diff --git a/src/substantial/src/backends/redis.rs b/src/substantial/src/backends/redis.rs
index 72a4b5139e..cee8ff228e 100644
--- a/src/substantial/src/backends/redis.rs
+++ b/src/substantial/src/backends/redis.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use std::sync::Mutex;
use super::{Backend, BackendMetadataWriter, NextRun};
diff --git a/src/substantial/src/converters.rs b/src/substantial/src/converters.rs
index 3c146ca090..ea346d1288 100644
--- a/src/substantial/src/converters.rs
+++ b/src/substantial/src/converters.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use std::collections::HashMap;
use anyhow::{bail, Context, Ok, Result};
diff --git a/src/substantial/src/lib.rs b/src/substantial/src/lib.rs
index 89fe1cf78e..81b09d8a52 100644
--- a/src/substantial/src/lib.rs
+++ b/src/substantial/src/lib.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
pub mod backends;
pub mod converters;
pub mod protocol;
diff --git a/src/substantial/tests/mod.rs b/src/substantial/tests/mod.rs
index 26e5469297..e218f9a887 100644
--- a/src/substantial/tests/mod.rs
+++ b/src/substantial/tests/mod.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
#[cfg(test)]
mod tests {
use std::{collections::HashMap, fmt::Debug, path::PathBuf, thread::sleep, time::Duration};
diff --git a/src/typegate/src/runtimes/substantial/agent.ts b/src/typegate/src/runtimes/substantial/agent.ts
index 78439d637c..4fe0b4b7eb 100644
--- a/src/typegate/src/runtimes/substantial/agent.ts
+++ b/src/typegate/src/runtimes/substantial/agent.ts
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
import {
AddScheduleInput,
Backend,
@@ -16,7 +19,7 @@ import {
} from "./types.ts";
import { RunId, WorkerManager } from "./workflow_worker_manager.ts";
-const logger = getLogger();
+const logger = getLogger(import.meta, "WARN");
export interface StdKwargs {
taskContext: TaskContext;
@@ -117,8 +120,6 @@ export class Agent {
}
async #nextIteration() {
- logger.warn("POLL");
-
// Note: in multiple agents/typegate scenario, a single node may acquire all runs for itself within a tick span
// To account for that, keep this reasonable
const acquireMaxForThisAgent = this.config.maxAcquirePerTick;
@@ -169,7 +170,7 @@ export class Agent {
lease_seconds: this.config.leaseLifespanSec,
});
- logger.info(`Active leases: ${activeRunIds.join(", ")}`);
+ logger.debug(`Active leases: ${activeRunIds.join(", ")}`);
const next = await Meta.substantial.agentNextRun({
backend: this.backend,
@@ -342,7 +343,7 @@ export class Agent {
) {
this.workerManager.destroyWorker(workflowName, runId); // !
- logger.warn(`Interrupt "${workflowName}": ${result}"`);
+ logger.debug(`Interrupt "${workflowName}": ${result}"`);
// TODO: make all of these transactional
diff --git a/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts b/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts
index 62ff176d53..f40a299d4d 100644
--- a/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts
+++ b/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts
@@ -13,7 +13,7 @@ import {
WorkerEventHandler,
} from "./types.ts";
-const logger = getLogger();
+const logger = getLogger(import.meta, "WARN");
export type WorkerRecord = {
worker: Worker;
diff --git a/src/typegate/src/typegraph/mod.ts b/src/typegate/src/typegraph/mod.ts
index aaec624dba..83b6a4ffcc 100644
--- a/src/typegate/src/typegraph/mod.ts
+++ b/src/typegate/src/typegraph/mod.ts
@@ -68,7 +68,9 @@ export class SecretManager {
const value = this.secretOrNull(name);
ensure(
value != null,
- `cannot find secret "${name}" for "${this.typegraphName}"`,
+ `cannot find secret "${name}" for "${this.typegraphName}". Availaible secrets include: [${
+ Object.keys(this.secrets)
+ }]`,
);
return value as string;
}
diff --git a/src/typegate/src/typegraphs/introspection.json b/src/typegate/src/typegraphs/introspection.json
index 71997398b4..eeabf338f6 100644
--- a/src/typegate/src/typegraphs/introspection.json
+++ b/src/typegate/src/typegraphs/introspection.json
@@ -635,4 +635,4 @@
"randomSeed": null,
"artifacts": {}
}
-}
\ No newline at end of file
+}
diff --git a/src/typegate/src/typegraphs/introspection.py b/src/typegate/src/typegraphs/introspection.py
index 1cef3dbe91..8b68f51b8d 100644
--- a/src/typegate/src/typegraphs/introspection.py
+++ b/src/typegate/src/typegraphs/introspection.py
@@ -13,21 +13,24 @@
@typegraph()
def introspection(g: Graph):
resolver_mat_id = runtimes.register_typegraph_materializer(
- store, TypegraphOperation.RESOLVER
+ store,
+ TypegraphOperation.RESOLVER,
)
if isinstance(resolver_mat_id, Err):
raise Exception(resolver_mat_id.value)
resolver_mat = Materializer(resolver_mat_id.value, effect=fx.read())
type_mat_id = runtimes.register_typegraph_materializer(
- store, TypegraphOperation.GET_TYPE
+ store,
+ TypegraphOperation.GET_TYPE,
)
if isinstance(type_mat_id, Err):
raise Exception(type_mat_id.value)
type_mat = Materializer(type_mat_id.value, effect=fx.read())
schema_mat_id = runtimes.register_typegraph_materializer(
- store, TypegraphOperation.GET_SCHEMA
+ store,
+ TypegraphOperation.GET_SCHEMA,
)
if isinstance(schema_mat_id, Err):
raise Exception(schema_mat_id.value)
@@ -66,7 +69,7 @@ def introspection(g: Graph):
# injection test
# "fieldName": g.proxy("field", lambda x: x.name),
# "parent": g.proxy("type", lambda x: x.name),
- }
+ },
),
t.list(input_value),
resolver_mat,
@@ -163,7 +166,9 @@ def introspection(g: Graph):
public = Policy.public()
get_type = t.func(
- t.struct({"name": t.string()}), type.optional(), type_mat
+ t.struct({"name": t.string()}),
+ type.optional(),
+ type_mat,
).with_policy(public)
g.expose(__type=get_type)
diff --git a/src/typegate/src/typegraphs/prisma_migration.json b/src/typegate/src/typegraphs/prisma_migration.json
index c44d6428ba..6d5d98040d 100644
--- a/src/typegate/src/typegraphs/prisma_migration.json
+++ b/src/typegate/src/typegraphs/prisma_migration.json
@@ -411,4 +411,4 @@
"randomSeed": null,
"artifacts": {}
}
-}
\ No newline at end of file
+}
diff --git a/src/typegate/src/typegraphs/prisma_migration.py b/src/typegate/src/typegraphs/prisma_migration.py
index ddc96df004..5f7a80a21a 100644
--- a/src/typegate/src/typegraphs/prisma_migration.py
+++ b/src/typegate/src/typegraphs/prisma_migration.py
@@ -26,7 +26,8 @@
def prisma_migration(g: Graph):
deno = DenoRuntime()
admin_only = deno.policy(
- "admin_only", code="(_args, { context }) => context.username === 'admin'"
+ "admin_only",
+ code="(_args, { context }) => context.username === 'admin'",
)
g.auth(Auth.basic(["admin"]))
diff --git a/src/typegate/src/typegraphs/typegate.json b/src/typegate/src/typegraphs/typegate.json
index 8d1e0881a3..391ec404f0 100644
--- a/src/typegate/src/typegraphs/typegate.json
+++ b/src/typegate/src/typegraphs/typegate.json
@@ -956,4 +956,4 @@
"randomSeed": null,
"artifacts": {}
}
-}
\ No newline at end of file
+}
diff --git a/src/typegate/src/typegraphs/typegate.py b/src/typegate/src/typegraphs/typegate.py
index 2b65527830..00e5ef827b 100644
--- a/src/typegate/src/typegraphs/typegate.py
+++ b/src/typegate/src/typegraphs/typegate.py
@@ -70,9 +70,9 @@
"repeatableread",
"snapshot",
"serializable",
- ]
+ ],
).optional(),
- }
+ },
).optional(),
},
name="PrismaBatchQuery",
@@ -97,39 +97,45 @@
def typegate(g: Graph):
deno = DenoRuntime()
admin_only = deno.policy(
- "admin_only", code="(_args, { context }) => context.username === 'admin'"
+ "admin_only",
+ code="(_args, { context }) => context.username === 'admin'",
)
g.auth(Auth.basic(["admin"]))
list_typegraphs_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.LIST_TYPEGRAPHS
+ store,
+ TypegateOperation.LIST_TYPEGRAPHS,
)
if isinstance(list_typegraphs_mat_id, Err):
raise Exception(list_typegraphs_mat_id.value)
list_typegraphs_mat = Materializer(list_typegraphs_mat_id.value, effect=fx.read())
find_typegraph_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.FIND_TYPEGRAPH
+ store,
+ TypegateOperation.FIND_TYPEGRAPH,
)
if isinstance(find_typegraph_mat_id, Err):
raise Exception(find_typegraph_mat_id.value)
find_typegraph_mat = Materializer(find_typegraph_mat_id.value, effect=fx.read())
add_typegraph_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.ADD_TYPEGRAPH
+ store,
+ TypegateOperation.ADD_TYPEGRAPH,
)
if isinstance(add_typegraph_mat_id, Err):
raise Exception(add_typegraph_mat_id.value)
add_typegraph_mat = Materializer(add_typegraph_mat_id.value, effect=fx.create(True))
remove_typegraphs_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.REMOVE_TYPEGRAPHS
+ store,
+ TypegateOperation.REMOVE_TYPEGRAPHS,
)
if isinstance(remove_typegraphs_mat_id, Err):
raise Exception(remove_typegraphs_mat_id.value)
remove_typegraphs_mat = Materializer(
- remove_typegraphs_mat_id.value, effect=fx.delete(True)
+ remove_typegraphs_mat_id.value,
+ effect=fx.delete(True),
)
serialized_typegraph_mat_id = runtimes.register_typegate_materializer(
@@ -139,7 +145,8 @@ def typegate(g: Graph):
if isinstance(serialized_typegraph_mat_id, Err):
raise Exception(serialized_typegraph_mat_id.value)
serialized_typegraph_mat = Materializer(
- serialized_typegraph_mat_id.value, effect=fx.read()
+ serialized_typegraph_mat_id.value,
+ effect=fx.read(),
)
arg_info_by_path_id = runtimes.register_typegate_materializer(
@@ -166,7 +173,7 @@ def typegate(g: Graph):
"queryType": t.string(),
"fn": t.string(),
"argPaths": t.list(path),
- }
+ },
)
shallow_type_info = t.struct(
@@ -185,16 +192,16 @@ def typegate(g: Graph):
type_info = shallow_type_info.extend(
{
"fields": t.list(
- t.struct({"subPath": path, "termNode": g.ref("TypeInfo")})
+ t.struct({"subPath": path, "termNode": g.ref("TypeInfo")}),
).optional(),
- }
+ },
).rename("TypeInfo")
operation_parameter = t.struct(
{
"name": t.string(),
"type": type_info,
- }
+ },
)
operation_info = t.struct(
@@ -215,7 +222,8 @@ def typegate(g: Graph):
if isinstance(find_available_operations_mat_id, Err):
raise Exception(find_available_operations_mat_id.value)
find_list_queries_mat = Materializer(
- find_available_operations_mat_id.value, effect=fx.read()
+ find_available_operations_mat_id.value,
+ effect=fx.read(),
)
find_available_operations = t.func(
# TODO filters: query/mutation
@@ -235,8 +243,8 @@ def typegate(g: Graph):
"name": t.string(),
"as_id": t.boolean(),
"type": shallow_type_info,
- }
- )
+ },
+ ),
),
},
name="PrismaModelInfo",
@@ -249,7 +257,8 @@ def typegate(g: Graph):
if isinstance(find_prisma_models_mat_id, Err):
raise Exception(find_prisma_models_mat_id.value)
find_prisma_models_mat = Materializer(
- find_prisma_models_mat_id.value, effect=fx.read()
+ find_prisma_models_mat_id.value,
+ effect=fx.read(),
)
find_prisma_models = t.func(
t.struct({"typegraph": t.string()}),
@@ -259,7 +268,8 @@ def typegate(g: Graph):
)
raw_prisma_read_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.RAW_PRISMA_READ
+ store,
+ TypegateOperation.RAW_PRISMA_READ,
)
if isinstance(raw_prisma_read_mat_id, Err):
raise Exception(raw_prisma_read_mat_id.value)
@@ -269,7 +279,8 @@ def typegate(g: Graph):
)
raw_prisma_create_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.RAW_PRISMA_CREATE
+ store,
+ TypegateOperation.RAW_PRISMA_CREATE,
)
if isinstance(raw_prisma_create_mat_id, Err):
raise Exception(raw_prisma_create_mat_id.value)
@@ -279,7 +290,8 @@ def typegate(g: Graph):
)
raw_prisma_update_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.RAW_PRISMA_UPDATE
+ store,
+ TypegateOperation.RAW_PRISMA_UPDATE,
)
if isinstance(raw_prisma_update_mat_id, Err):
raise Exception(raw_prisma_update_mat_id.value)
@@ -289,7 +301,8 @@ def typegate(g: Graph):
)
raw_prisma_delete_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.RAW_PRISMA_DELETE
+ store,
+ TypegateOperation.RAW_PRISMA_DELETE,
)
if isinstance(raw_prisma_delete_mat_id, Err):
raise Exception(raw_prisma_delete_mat_id.value)
@@ -305,12 +318,13 @@ def typegate(g: Graph):
# prisma runtime name
"runtime": t.string(),
"query": prisma_query,
- }
+ },
)
raw_prisma_op_out = t.json()
query_prisma_model_mat_id = runtimes.register_typegate_materializer(
- store, TypegateOperation.QUERY_PRISMA_MODEL
+ store,
+ TypegateOperation.QUERY_PRISMA_MODEL,
)
if isinstance(query_prisma_model_mat_id, Err):
raise Exception(query_prisma_model_mat_id.value)
@@ -322,7 +336,7 @@ def typegate(g: Graph):
"model": t.string(),
"offset": t.integer(),
"limit": t.integer(),
- }
+ },
),
t.struct(
{
@@ -332,12 +346,12 @@ def typegate(g: Graph):
"name": t.string(),
"as_id": t.boolean(),
"type": shallow_type_info,
- }
- )
+ },
+ ),
),
"rowCount": t.integer(),
"data": t.list(t.json()),
- }
+ },
),
Materializer(query_prisma_model_mat_id.value, effect=fx.read()),
)
@@ -362,7 +376,7 @@ def typegate(g: Graph):
"fromString": t.json(),
"secrets": t.json(),
"targetVersion": t.string(),
- }
+ },
),
t.struct(
{
@@ -372,19 +386,19 @@ def typegate(g: Graph):
{
"type": t.enum(["info", "warning", "error"]),
"text": t.string(),
- }
- )
+ },
+ ),
),
"migrations": t.list(
t.struct(
{
"runtime": t.string(),
"migrations": t.string(),
- }
- )
+ },
+ ),
),
"failure": t.json().optional(),
- }
+ },
),
add_typegraph_mat,
rate_calls=True,
@@ -396,7 +410,10 @@ def typegate(g: Graph):
rate_calls=True,
),
argInfoByPath=t.func(
- arg_info_inp, t.list(type_info), arg_info_by_path_mat, rate_calls=True
+ arg_info_inp,
+ t.list(type_info),
+ arg_info_by_path_mat,
+ rate_calls=True,
),
findAvailableOperations=find_available_operations,
findPrismaModels=find_prisma_models,
diff --git a/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs b/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
index d273666cdc..5a2f26e9dc 100644
--- a/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
+++ b/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
//
// SPDX-License-Identifier: MPL-2.0
diff --git a/src/typegraph/core/src/types/type_ref.rs b/src/typegraph/core/src/types/type_ref.rs
index aa4a0b09ac..57cd33b591 100644
--- a/src/typegraph/core/src/types/type_ref.rs
+++ b/src/typegraph/core/src/types/type_ref.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use std::hash::Hash;
use std::rc::Rc;
diff --git a/src/typegraph/core/src/types/type_ref/as_id.rs b/src/typegraph/core/src/types/type_ref/as_id.rs
index c5d2160eae..8b2c578b37 100644
--- a/src/typegraph/core/src/types/type_ref/as_id.rs
+++ b/src/typegraph/core/src/types/type_ref/as_id.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use serde::{Deserialize, Serialize};
use super::{ExtendedTypeDef, FindAttribute as _, RefAttr, TypeRef};
diff --git a/src/typegraph/core/src/types/type_ref/injection.rs b/src/typegraph/core/src/types/type_ref/injection.rs
index 9ae2846057..7296cc758b 100644
--- a/src/typegraph/core/src/types/type_ref/injection.rs
+++ b/src/typegraph/core/src/types/type_ref/injection.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::{RefAttr, TypeRef};
use crate::types::Type;
use crate::wit::utils::ReduceEntry;
diff --git a/src/typegraph/core/src/types/type_ref/policy.rs b/src/typegraph/core/src/types/type_ref/policy.rs
index 18e965fc23..6995a8b331 100644
--- a/src/typegraph/core/src/types/type_ref/policy.rs
+++ b/src/typegraph/core/src/types/type_ref/policy.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use crate::errors::{Result, TgError};
use crate::types::Type;
use serde::{Deserialize, Serialize};
diff --git a/src/typegraph/core/src/types/type_ref/runtime_config.rs b/src/typegraph/core/src/types/type_ref/runtime_config.rs
index fc26313706..bcd2438f13 100644
--- a/src/typegraph/core/src/types/type_ref/runtime_config.rs
+++ b/src/typegraph/core/src/types/type_ref/runtime_config.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::{RefAttr, TypeRef};
use crate::errors::{Result, TgError};
use crate::types::Type;
diff --git a/src/typegraph/core/src/types/type_ref/xdef.rs b/src/typegraph/core/src/types/type_ref/xdef.rs
index 0cf7ce5960..613c5c9635 100644
--- a/src/typegraph/core/src/types/type_ref/xdef.rs
+++ b/src/typegraph/core/src/types/type_ref/xdef.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use super::{FlatTypeRef, FlatTypeRefTarget, RefAttr, RefAttrs, TypeRef};
use crate::errors::Result;
use crate::global_store::Store;
diff --git a/src/typegraph/core/src/utils/postprocess/naming.rs b/src/typegraph/core/src/utils/postprocess/naming.rs
index 708a38581a..ab636ae38a 100644
--- a/src/typegraph/core/src/utils/postprocess/naming.rs
+++ b/src/typegraph/core/src/utils/postprocess/naming.rs
@@ -1,3 +1,6 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
use std::{
collections::{HashMap, HashSet},
rc::Rc,
diff --git a/src/typegraph/deno/deno.json b/src/typegraph/deno/deno.json
index 960caa6de9..ad7121212f 100644
--- a/src/typegraph/deno/deno.json
+++ b/src/typegraph/deno/deno.json
@@ -8,6 +8,13 @@
"!README.md"
]
},
+ "lint": {
+ "rules": {
+ "exclude": [
+ "no-external-import"
+ ]
+ }
+ },
"exports": {
"./deps/_import.ts": "./src/deps/_import.ts",
"./deps/mod.ts": "./src/deps/mod.ts",
@@ -25,6 +32,7 @@
"./providers/temporal.ts": "./src/providers/temporal.ts",
"./runtimes/deno.ts": "./src/runtimes/deno.ts",
"./runtimes/graphql.ts": "./src/runtimes/graphql.ts",
+ "./runtimes/grpc.ts": "./src/runtimes/grpc.ts",
"./runtimes/http.ts": "./src/runtimes/http.ts",
"./runtimes/kv.ts": "./src/runtimes/kv.ts",
"./runtimes/mod.ts": "./src/runtimes/mod.ts",
@@ -37,9 +45,6 @@
"./tg_manage.ts": "./src/tg_manage.ts",
"./typegraph.ts": "./src/typegraph.ts",
"./types.ts": "./src/types.ts",
- "./utils/func_utils.ts": "./src/utils/func_utils.ts",
- "./utils/injection_utils.ts": "./src/utils/injection_utils.ts",
- "./utils/type_utils.ts": "./src/utils/type_utils.ts",
"./wit.ts": "./src/wit.ts"
}
}
diff --git a/src/typegraph/deno/src/deps/_import.ts b/src/typegraph/deno/src/deps/_import.ts
index b21c30e5ab..855c2d0015 100644
--- a/src/typegraph/deno/src/deps/_import.ts
+++ b/src/typegraph/deno/src/deps/_import.ts
@@ -31,6 +31,7 @@ export interface Bind {
export const up = 3;
+// deno-lint-ignore no-explicit-any
export function caller(this: Bind | any, levelUp = up): string | undefined {
const err = new Error();
const stack = err.stack?.split("\n")[levelUp];
@@ -39,6 +40,7 @@ export function caller(this: Bind | any, levelUp = up): string | undefined {
}
}
+// deno-lint-ignore no-explicit-any
export function getFile(this: Bind | any, stack: string): string {
stack = stack.substr(stack.indexOf("at ") + 3);
if (!stack.startsWith("file://")) {
@@ -48,7 +50,7 @@ export function getFile(this: Bind | any, stack: string): string {
let file = `${path[0]}:${path[1]}`;
if ((this as Bind)?.cb) {
- const cb = (this as Bind).cb as any;
+ const cb = (this as Bind).cb!;
file = cb(file);
}
return file;
diff --git a/src/typegraph/deno/src/deps/mod.ts b/src/typegraph/deno/src/deps/mod.ts
index 1c558b0f17..0ad837fc8c 100644
--- a/src/typegraph/deno/src/deps/mod.ts
+++ b/src/typegraph/deno/src/deps/mod.ts
@@ -2,13 +2,16 @@
// SPDX-License-Identifier: MPL-2.0
export { caller } from "./_import.ts";
-export function mapValues(
- object: object,
- fn: (value: any, key: string, object: object) => any,
-): any {
+export function mapValues<
+ O extends Record,
+ T,
+>(
+ object: O,
+ fn: (value: O[keyof O], key: keyof O, object: O) => T,
+): Record {
const newEntries = Object.entries(object).map(([k, v]) => [
k,
- fn(v, k, object),
+ fn(v as O[keyof O], k, object),
]);
return Object.fromEntries(newEntries);
}
diff --git a/src/typegraph/deno/src/effects.ts b/src/typegraph/deno/src/effects.ts
index 8c5dbcdf7e..92bd6edd92 100644
--- a/src/typegraph/deno/src/effects.ts
+++ b/src/typegraph/deno/src/effects.ts
@@ -1,7 +1,7 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import {
+import type {
EffectCreate,
EffectDelete,
EffectRead,
diff --git a/src/typegraph/deno/src/envs/cli.ts b/src/typegraph/deno/src/envs/cli.ts
index 62e0295150..03c3dc0bc7 100644
--- a/src/typegraph/deno/src/envs/cli.ts
+++ b/src/typegraph/deno/src/envs/cli.ts
@@ -43,7 +43,7 @@ export function loadCliEnv(): CliEnv | null {
} else {
switch (key) {
case "command":
- if (!COMMANDS.includes(envValue as any)) {
+ if (!(COMMANDS as readonly string[]).includes(envValue)) {
throw new Error(
`${name} env value should be one of: serialize, deploy`,
);
@@ -93,7 +93,7 @@ export function loadCliEnv(): CliEnv | null {
return record as CliEnv;
}
-export const CLI_ENV = loadCliEnv();
+export const CLI_ENV: CliEnv | null = loadCliEnv();
/** check if running in the meta cli */
export function hasCliEnv(): boolean {
diff --git a/src/typegraph/deno/src/io.ts b/src/typegraph/deno/src/io.ts
index e11fab63ab..a572c7e258 100644
--- a/src/typegraph/deno/src/io.ts
+++ b/src/typegraph/deno/src/io.ts
@@ -30,6 +30,7 @@ type RpcNotificationMethod =
| "Success"
| "Failure";
+// deno-lint-ignore no-explicit-any
const rpcNotify = (method: RpcNotificationMethod, params: any = null) => {
const message = JSON.stringify({
jsonrpc: JSONRPC_VERSION,
@@ -39,6 +40,7 @@ const rpcNotify = (method: RpcNotificationMethod, params: any = null) => {
writeRpcMessage(message);
};
+// deno-lint-ignore no-explicit-any
function getOutput(args: any[]) {
return args
.map((arg) => {
@@ -53,24 +55,36 @@ function getOutput(args: any[]) {
.join(" ");
}
-export const log = {
- debug(...args: any[]) {
+export const log: {
+ // deno-lint-ignore no-explicit-any
+ debug(...args: any[]): void;
+ // deno-lint-ignore no-explicit-any
+ info(...args: any[]): void;
+ // deno-lint-ignore no-explicit-any
+ warn(...args: any[]): void;
+ // deno-lint-ignore no-explicit-any
+ error(...args: any[]): void;
+ // deno-lint-ignore no-explicit-any
+ failure(data: any): void;
+ // deno-lint-ignore no-explicit-any
+ success(data: any, noEncode?: boolean): void;
+} = {
+ debug(...args): void {
rpcNotify("Debug", { message: getOutput(args) });
},
- info(...args: any[]) {
+ info(...args): void {
rpcNotify("Info", { message: getOutput(args) });
},
- warn(...args: any[]) {
+ warn(...args): void {
rpcNotify("Warning", { message: getOutput(args) });
},
- error(...args: any[]) {
+ error(...args): void {
rpcNotify("Error", { message: getOutput(args) });
},
-
- failure(data: any) {
+ failure(data): void {
rpcNotify("Failure", { data: data });
},
- success(data: any, noEncode = false) {
+ success(data, noEncode = false): void {
if (noEncode) {
rpcNotify("Success", { data: JSON.parse(data) });
} else {
@@ -80,7 +94,7 @@ export const log = {
};
class RpcResponseReader {
- private buffer: string = "";
+ private buffer = "";
constructor() {
process.stdin.setEncoding("utf-8");
@@ -109,7 +123,7 @@ class RpcResponseReader {
resolve(message.result);
break;
}
- } catch (e) {
+ } catch {
reject("invalid message");
}
}
@@ -124,6 +138,7 @@ const rpcCall = (() => {
const responseReader = new RpcResponseReader();
let latestRpcId = 0;
+ // deno-lint-ignore no-explicit-any
return (method: string, params: any = null) => {
const rpcId = latestRpcId++;
const rpcMessage = JSON.stringify({
diff --git a/src/typegraph/deno/src/metagen.ts b/src/typegraph/deno/src/metagen.ts
index ac347c11f1..d0bd191e83 100644
--- a/src/typegraph/deno/src/metagen.ts
+++ b/src/typegraph/deno/src/metagen.ts
@@ -1,12 +1,12 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import {
+import type {
FdkConfig,
FdkOutput,
SerializeParams,
} from "./gen/typegraph_core.d.ts";
-import { TypegraphOutput } from "./typegraph.ts";
+import type { TypegraphOutput } from "./typegraph.ts";
import { wit_utils } from "./wit.ts";
import { freezeTgOutput } from "./utils/func_utils.ts";
@@ -46,7 +46,7 @@ export class Metagen {
overwrite?: false,
): Array {
const fdkConfig = this.getFdkConfig(tgOutput, targetName);
- return wit_utils.metagenExec(fdkConfig).map((value: any) => ({
+ return wit_utils.metagenExec(fdkConfig).map((value) => ({
...value,
overwrite: overwrite ?? value.overwrite,
})) as Array;
diff --git a/src/typegraph/deno/src/params.ts b/src/typegraph/deno/src/params.ts
index 669cc40279..25cbd2d7d0 100644
--- a/src/typegraph/deno/src/params.ts
+++ b/src/typegraph/deno/src/params.ts
@@ -2,12 +2,13 @@
// SPDX-License-Identifier: MPL-2.0
import { RawAuth } from "./typegraph.ts";
-import { Auth as Auth_, wit_utils } from "./wit.ts";
-import * as t from "./types.ts";
+import { type Auth as Auth_, wit_utils } from "./wit.ts";
+import type * as t from "./types.ts";
export type StdOauth2Profiler =
| { profiler: "default" }
| { profiler: "none" }
+ // deno-lint-ignore no-explicit-any
| { profiler: "extended"; extension: any }
| { profiler: "custom"; id: number };
@@ -19,6 +20,7 @@ export function defaultProfiler(): StdOauth2Profiler {
return { profiler: "default" };
}
+// deno-lint-ignore no-explicit-any
export function extendedProfiler(extension: any): StdOauth2Profiler {
return { profiler: "extended", extension };
}
@@ -28,13 +30,13 @@ export function customProfiler(func: t.Typedef): StdOauth2Profiler {
}
export class Auth {
- static jwt(name: string, format: string, algorithm?: any): Auth_ {
- if (!algorithm) {
- algorithm = {};
+ static jwt(name: string, format: string, algorithmParams?: object): Auth_ {
+ if (!algorithmParams) {
+ algorithmParams = {};
}
const authData = [
["format", JSON.stringify(format)],
- ["algorithm", JSON.stringify(algorithm)],
+ ["algorithm", JSON.stringify(algorithmParams)],
] as [string, string][];
return {
diff --git a/src/typegraph/deno/src/policy.ts b/src/typegraph/deno/src/policy.ts
index 8059b87508..13454f192c 100644
--- a/src/typegraph/deno/src/policy.ts
+++ b/src/typegraph/deno/src/policy.ts
@@ -1,15 +1,15 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { ContextCheck, MaterializerId } from "./gen/typegraph_core.d.ts";
+import type { ContextCheck, MaterializerId } from "./gen/typegraph_core.d.ts";
import { core } from "./wit.ts";
-interface PolicyPerEffectAlt {
+type PolicyPerEffectAlt = {
update?: Policy;
delete?: Policy;
create?: Policy;
read?: Policy;
-}
+};
export class PolicyPerEffectObject {
constructor(public readonly value: PolicyPerEffectAlt) {}
diff --git a/src/typegraph/deno/src/providers/aws.ts b/src/typegraph/deno/src/providers/aws.ts
index 25cb62b2b6..e71ddaa12c 100644
--- a/src/typegraph/deno/src/providers/aws.ts
+++ b/src/typegraph/deno/src/providers/aws.ts
@@ -1,9 +1,9 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { Materializer, Runtime } from "../runtimes/mod.ts";
+import { type Materializer, Runtime } from "../runtimes/mod.ts";
import { aws } from "../wit.ts";
-import {
+import type {
S3PresignGetParams,
S3PresignPutParams,
S3RuntimeData,
diff --git a/src/typegraph/deno/src/providers/prisma.ts b/src/typegraph/deno/src/providers/prisma.ts
index 790d59d07a..137a8f81e9 100644
--- a/src/typegraph/deno/src/providers/prisma.ts
+++ b/src/typegraph/deno/src/providers/prisma.ts
@@ -5,7 +5,7 @@ import { Runtime } from "../runtimes/mod.ts";
import { runtimes } from "../wit.ts";
import { Typedef } from "../types.ts";
import { t } from "../index.ts";
-import { Effect } from "../gen/typegraph_core.d.ts";
+import type { Effect } from "../gen/typegraph_core.d.ts";
import { genRef } from "./../typegraph.ts";
type PrismaLinkArg = {
diff --git a/src/typegraph/deno/src/providers/temporal.ts b/src/typegraph/deno/src/providers/temporal.ts
index 729a1d1ff2..b2184affe0 100644
--- a/src/typegraph/deno/src/providers/temporal.ts
+++ b/src/typegraph/deno/src/providers/temporal.ts
@@ -3,8 +3,8 @@
import { Runtime } from "../runtimes/mod.ts";
import { runtimes } from "../wit.ts";
-import { Func, Typedef } from "../types.ts";
-import {
+import { Func, type Typedef } from "../types.ts";
+import type {
TemporalOperationData,
TemporalOperationType,
} from "../gen/typegraph_core.d.ts";
diff --git a/src/typegraph/deno/src/runtimes/deno.ts b/src/typegraph/deno/src/runtimes/deno.ts
index ebf68b35a4..f72cc9b6e3 100644
--- a/src/typegraph/deno/src/runtimes/deno.ts
+++ b/src/typegraph/deno/src/runtimes/deno.ts
@@ -26,6 +26,7 @@ interface PredefinedFuncMat extends Materializer {
}
export interface DenoFunc {
+ // deno-lint-ignore no-explicit-any
code: string | ((...args: any[]) => any);
secrets?: Array;
effect?: Effect;
@@ -39,6 +40,7 @@ export interface DenoImport {
effect?: Effect;
}
+// deno-lint-ignore no-explicit-any
function stringifyFn(code: string | ((...any: []) => any)) {
if (typeof code == "function") {
const source = code.toString();
@@ -115,6 +117,7 @@ export class DenoRuntime extends Runtime {
}
/** use a static function already registered on the typegate */
+ // deno-lint-ignore no-explicit-any
static(out: P, value: any): t.Func {
const mat = {
_id: runtimes.registerDenoStatic(
diff --git a/src/typegraph/deno/src/runtimes/graphql.ts b/src/typegraph/deno/src/runtimes/graphql.ts
index e53fa2abc1..4e89980417 100644
--- a/src/typegraph/deno/src/runtimes/graphql.ts
+++ b/src/typegraph/deno/src/runtimes/graphql.ts
@@ -1,10 +1,10 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { Effect } from "../gen/typegraph_core.d.ts";
+import type { Effect } from "../gen/typegraph_core.d.ts";
import * as t from "../types.ts";
import { runtimes } from "../wit.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
export class GraphQLRuntime extends Runtime {
diff --git a/src/typegraph/deno/src/runtimes/grpc.ts b/src/typegraph/deno/src/runtimes/grpc.ts
index d75be27f79..c32635d401 100644
--- a/src/typegraph/deno/src/runtimes/grpc.ts
+++ b/src/typegraph/deno/src/runtimes/grpc.ts
@@ -14,7 +14,7 @@ export class GrpcRuntime extends Runtime {
super(id);
}
- call(method: string) {
+ call(method: string): Func {
const funcData = runtimes.callGrpcMethod(this._id, { method: method });
return Func.fromTypeFunc(funcData);
}
diff --git a/src/typegraph/deno/src/runtimes/http.ts b/src/typegraph/deno/src/runtimes/http.ts
index 992ad7ac93..7965bfadff 100644
--- a/src/typegraph/deno/src/runtimes/http.ts
+++ b/src/typegraph/deno/src/runtimes/http.ts
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: MPL-2.0
import * as t from "../types.ts";
-import {
+import type {
Effect,
HttpMethod,
MaterializerHttpRequest,
} from "../gen/typegraph_core.d.ts";
import { runtimes } from "../wit.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
type HttpRequestMat =
diff --git a/src/typegraph/deno/src/runtimes/kv.ts b/src/typegraph/deno/src/runtimes/kv.ts
index d3965b3a65..4c29222ae0 100644
--- a/src/typegraph/deno/src/runtimes/kv.ts
+++ b/src/typegraph/deno/src/runtimes/kv.ts
@@ -1,10 +1,10 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { Materializer, Runtime } from "./mod.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import * as t from "../types.ts";
import { runtimes } from "../wit.ts";
-import { Effect, KvMaterializer } from "../gen/typegraph_core.d.ts";
+import type { Effect, KvMaterializer } from "../gen/typegraph_core.d.ts";
import { fx } from "../index.ts";
@@ -34,7 +34,11 @@ export class KvRuntime extends Runtime {
return new KvOperationMat(mad_id, operation);
}
- set() {
+ set(): t.Func<
+ t.Struct<{ key: t.String; value: t.String }>,
+ t.String,
+ KvOperationMat
+ > {
const mat = this.#operation("set", fx.update());
return t.func(
t.struct({ "key": t.string(), "value": t.string() }),
@@ -43,18 +47,18 @@ export class KvRuntime extends Runtime {
);
}
- get() {
+ get(): t.Func, t.Optional, KvOperationMat> {
const mat = this.#operation("get", fx.read());
// FIXME: consolidate response type construction inside tg_core
return t.func(t.struct({ "key": t.string() }), t.string().optional(), mat);
}
- delete() {
+ delete(): t.Func, t.Integer, KvOperationMat> {
const mat = this.#operation("delete", fx.delete_());
return t.func(t.struct({ "key": t.string() }), t.integer(), mat);
}
- keys() {
+ keys(): t.Func, t.List, KvOperationMat> {
const mat = this.#operation("keys", fx.read());
return t.func(
t.struct({ "filter": t.string().optional() }),
@@ -63,7 +67,7 @@ export class KvRuntime extends Runtime {
);
}
- values() {
+ values(): t.Func, t.List, KvOperationMat> {
const mat = this.#operation("values", fx.read());
return t.func(
t.struct({ "filter": t.string().optional() }),
diff --git a/src/typegraph/deno/src/runtimes/python.ts b/src/typegraph/deno/src/runtimes/python.ts
index 791a59306f..391afac0d2 100644
--- a/src/typegraph/deno/src/runtimes/python.ts
+++ b/src/typegraph/deno/src/runtimes/python.ts
@@ -3,10 +3,9 @@
import * as t from "../types.ts";
import { runtimes } from "../wit.ts";
-import { Effect, SubstantialBackend } from "../gen/typegraph_core.d.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import type { Effect } from "../gen/typegraph_core.d.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
-import { SubstantialRuntime } from "../runtimes/substantial.ts";
interface LambdaMat extends Materializer {
fn: string;
diff --git a/src/typegraph/deno/src/runtimes/random.ts b/src/typegraph/deno/src/runtimes/random.ts
index 330944e561..1c57a5f4f8 100644
--- a/src/typegraph/deno/src/runtimes/random.ts
+++ b/src/typegraph/deno/src/runtimes/random.ts
@@ -3,8 +3,8 @@
import * as t from "../types.ts";
import { runtimes } from "../wit.ts";
-import { RandomRuntimeData } from "../gen/typegraph_core.d.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import type { RandomRuntimeData } from "../gen/typegraph_core.d.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
interface RandomMat extends Materializer {
diff --git a/src/typegraph/deno/src/runtimes/wasm.ts b/src/typegraph/deno/src/runtimes/wasm.ts
index 462f8a261c..cf42c433e2 100644
--- a/src/typegraph/deno/src/runtimes/wasm.ts
+++ b/src/typegraph/deno/src/runtimes/wasm.ts
@@ -3,8 +3,8 @@
import * as t from "../types.ts";
import { runtimes } from "../wit.ts";
-import { Effect } from "../gen/typegraph_core.d.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import type { Effect } from "../gen/typegraph_core.d.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
export class WasmRuntime extends Runtime {
diff --git a/src/typegraph/deno/src/tg_artifact_upload.ts b/src/typegraph/deno/src/tg_artifact_upload.ts
index d762f9623f..f552588be7 100644
--- a/src/typegraph/deno/src/tg_artifact_upload.ts
+++ b/src/typegraph/deno/src/tg_artifact_upload.ts
@@ -1,8 +1,8 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { BasicAuth } from "./tg_deploy.ts";
-import { Artifact } from "./gen/typegraph_core.d.ts";
+import type { BasicAuth } from "./tg_deploy.ts";
+import type { Artifact } from "./gen/typegraph_core.d.ts";
import { dirname, join } from "node:path";
import * as fsp from "node:fs/promises";
import { log } from "./io.ts";
@@ -60,7 +60,7 @@ export class ArtifactUploader {
private async upload(
token: string | null,
meta: UploadArtifactMeta,
- ): Promise {
+ ): Promise