diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 148ad382e3..8e5aae951a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -28,37 +28,35 @@ 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 && ghjk x lint-deno'
pass_filenames: false
types:
+ - javascript
- ts
+ - tsx
+ - json
+ - yaml
files: ^(src/typegate|tools)/
- id: es-lint
name: Eslint website
language: system
- entry: bash -c 'cd website && [ -f node_modules/.bin/eslint ] && pnpm lint && pnpm prettier'
+ entry: bash -c 'cd ./docs/metatype.dev/ && [ -f node_modules/.bin/eslint ] && pnpm lint && pnpm prettier'
pass_filenames: false
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
@@ -87,10 +85,9 @@ repos:
.*deno.lock|
CHANGELOG.md|
.*\.snap$|
- typegate/src/typegraphs/.*\.json|
- src/typegraph/core/src/types/sdk/.*\.rs|
- 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]
)
@@ -104,9 +101,10 @@ repos:
- --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:
- python
- files: ^typegraph/
+ exclude: ^examples/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License MPL-2.0 rust"
args:
@@ -117,38 +115,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/|src/metagen/src/.*/static/.*
- id: insert-license
name: "License MPL-2.0 typescript"
args:
@@ -156,11 +123,11 @@ repos:
- --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
- tsx
- files: ^website/
- exclude: website/typegraphs
+ exclude: ^examples/|src/metagen/src/.*/static/.*
- 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 237e94ee93..e1b787b1eb 100644
--- a/deno.jsonc
+++ b/deno.jsonc
@@ -11,10 +11,26 @@
"./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",
+ "docs/metatype.dev/**/*.js",
+ "docs/metatype.dev/**/*.ts",
+ "docs/metatype.dev/**/*.tsx"
+ ]
+ },
"compilerOptions": {
"allowJs": false,
"strict": true,
- "experimentalDecorators": true,
"types": [
"./src/typegate/engine/runtime.d.ts"
],
@@ -27,13 +43,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 29a8f32c71..61d002f35d 100644
--- a/deno.lock
+++ b/deno.lock
@@ -10,6 +10,7 @@
"jsr:@std/assert@^1.0.2": "jsr:@std/assert@1.0.4",
"jsr:@std/assert@^1.0.4": "jsr:@std/assert@1.0.6",
"jsr:@std/assert@^1.0.6": "jsr:@std/assert@1.0.6",
+ "jsr:@std/async@^1.0.3": "jsr:@std/async@1.0.3",
"jsr:@std/bytes@^0.221.0": "jsr:@std/bytes@0.221.0",
"jsr:@std/bytes@^1.0.2": "jsr:@std/bytes@1.0.2",
"jsr:@std/bytes@^1.0.2-rc.3": "jsr:@std/bytes@1.0.2",
@@ -48,6 +49,7 @@
"jsr:@std/semver@^1.0.1": "jsr:@std/semver@1.0.2",
"jsr:@std/streams@0.221.0": "jsr:@std/streams@0.221.0",
"jsr:@std/streams@1": "jsr:@std/streams@1.0.4",
+ "jsr:@std/streams@^1.0.2": "jsr:@std/streams@1.0.4",
"jsr:@std/testing@^1.0.1": "jsr:@std/testing@1.0.2",
"jsr:@std/text@^1.0.7": "jsr:@std/text@1.0.8",
"jsr:@std/url@^0.225.0": "jsr:@std/url@0.225.0",
@@ -118,6 +120,9 @@
"jsr:@std/internal@^1.0.4"
]
},
+ "@std/async@1.0.3": {
+ "integrity": "6ed64678db43451683c6c176a21426a2ccd21ba0269ebb2c36133ede3f165792"
+ },
"@std/bytes@0.221.0": {
"integrity": "64a047011cf833890a4a2ab7293ac55a1b4f5a050624ebc6a0159c357de91966"
},
@@ -492,14 +497,6 @@
"integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==",
"dependencies": {}
},
- "node-addon-api@8.2.1": {
- "integrity": "sha512-vmEOvxwiH8tlOcv4SyE8RH34rI5/nWVaigUeAUPawC6f0+HoDthwI0vkMu4tbtsZrXq6QXFfrkhjofzKEs5tpA==",
- "dependencies": {}
- },
- "node-gyp-build@4.8.2": {
- "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==",
- "dependencies": {}
- },
"ono@4.0.11": {
"integrity": "sha512-jQ31cORBFE6td25deYeD80wxKBMj+zBmHTrVxnc6CKhx8gho6ipmWM5zj/oeoqioZ99yqBls9Z/9Nss7J26G2g==",
"dependencies": {
@@ -2727,6 +2724,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/blog/2024-08-26-python-on-webassembly/index.mdx b/docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx
index 6804243e9f..cb376e6c10 100644
--- a/docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx
+++ b/docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx
@@ -4,21 +4,21 @@ Metatype's different language runtimes are nice, but integrating one is an entir
## Why?
-You have probably heard of "Function as a Service" or FaaS.
-In simple terms, FaaS are platforms that allow users to run code in response to events without the hassle of managing the underlying infrastructure.
+You have probably heard of "Function as a Service" or FaaS.
+In simple terms, FaaS are platforms that allow users to run code in response to events without the hassle of managing the underlying infrastructure.
Users submit their programs and the platform takes care of the rest including, usually, scaling, availability, and configuration.
AWS Lambda is one such example and FaaS as a whole are a popular implementation of the serverless model.
-Metatype has this model at heart with applications composed of small functions that respond to events like http requests and authorization checks.
-This is achieved through runtimes like the [`DenoRuntime`](/docs/reference/runtimes/deno) which implements a way to execute functions authored in Typescript using Web Workers as implemented by [Deno](https://docs.deno.com/runtime/manual/runtime/workers/) (not based on Deno Deploy).
+Metatype has this model at heart with applications composed of small functions that respond to events like http requests and authorization checks.
+This is achieved through runtimes like the [`DenoRuntime`](/docs/reference/runtimes/deno) which implements a way to execute functions authored in Typescript using Web Workers as implemented by [Deno](https://docs.deno.com/runtime/manual/runtime/workers/) (not based on Deno Deploy).
:::note
-Metatype supports running multiple apps or typegraphs on a single deployed cluster but we're still in the kitchen on a hosted cloud solution.
+Metatype supports running multiple apps or typegraphs on a single deployed cluster but we're still in the kitchen on a hosted cloud solution.
Subscribe to the [blog](https://metatype.dev/blog/rss.xml) or the [Github](https://github.com/metatypedev/metatype) repository for updates.
:::
Implementing the `DenoRuntime` was a very straightforward affair as the Typegate (the engine at the heart of Metatype) is primarily written in Typescript and runs on a slightly modified version of the Deno runtime.
-What's more, JavaScript has single threaded and asynchronous semantics and the v8 engine that it commonly runs on is of very high-quality by all regards.
+What's more, JavaScript has single threaded and asynchronous semantics and the v8 engine that it commonly runs on is of very high-quality by all regards.
These qualities lend themselves very well to the requirements of running a serverless platform like security (good sandboxing) and performance (low start-up latencies).
This fact is reflected in the dominance of JavaScript in the serverless market though it doesn't hurt that it's also the most popular language in use today.
@@ -34,23 +34,23 @@ There are a number of Python runtimes available but a set of extra factors limit
3. **User-friendliness**: functionalities provided in any of the languages supported by Metatype should, within reason, mirror each other and maintain a degree of uniformity. We support inline code snippets and external file references for `DenoRuntime` and this should be the case for Python as well.
4. **Interoperability**: functions running in Python will need to have access to other parts of the app running on the Typegate like being able to invoke other functions.
-The Typegate is a TypeScript program with a bit of Rust sprinkled in.
-It runs as a traditional POSIX process.
-Think Linux containers.
+The Typegate is a TypeScript program with a bit of Rust sprinkled in.
+It runs as a traditional POSIX process.
+Think Linux containers.
This fact renders multi-processing, one of the readily apparent approaches, undesirable as it would require investing is robust worker process management and distribution schemes.
It'd be great if we could keep everything inside the Typegate process.
One solution that presents itself here is the [PyO3](https://pyo3.rs/) project which provide Rust bindings to different Python runtimes like CPython and PyPy.
-It'd not only allow us to run Python code in-process but it also provide an easy way to expose the functions written in Rust to Python and vice-versa.
+It'd not only allow us to run Python code in-process but it also provide an easy way to expose the functions written in Rust to Python and vice-versa.
A good solution for the bidirectional communication needed for our interoperability requirements.
Unfortunately, PyO3 doesn't have any provisions for sandboxing which is critical for our use case.
-This is where WebAssembly enters into the picture.
-WebAssembly or Wasm for short is a executable bytecode format that originates from the web world and is designed for applications that run inside web-browsers.
+This is where WebAssembly enters into the picture.
+WebAssembly or Wasm for short is a executable bytecode format that originates from the web world and is designed for applications that run inside web-browsers.
This use case shares most of our requirements and the Wasm world promises excellent sandboxing properties that should be perfect for our use case.
We just have to find a way to run Python inside of it.
-## An aside on WASI
+## An aside on WASI
WebAssembly System Interface (WASI) is an additional spec for the bytecode format that formalizes how Wasm programs access their host environment.
A lot like POSIX, this generally means OS capabilities such as file system access and networking but also, in it's latest iteration extends to any custom host defined functionality.
@@ -74,7 +74,7 @@ This approach is well described as the [Reactor pattern](https://wasmcloud.com/b
### File system access
Since the PyO3 project doesn't support [statically linking](https://github.com/PyO3/pyo3/issues/416) the Python runtime, we'll need to find a way dynamically link `libpython`.
-Thankfully, Wasm does support [dynamic linking](https://github.com/WebAssembly/design/blob/main/DynamicLinking.md) and wasm builds of [`libpython`](https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/python) are available curtsy of the WebAssembly Language Runtimes project.
+Thankfully, Wasm does support [dynamic linking](https://github.com/WebAssembly/design/blob/main/DynamicLinking.md) and wasm builds of [`libpython`](https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/python) are available curtsy of the WebAssembly Language Runtimes project.
Bringing all of this together isn't as simple though as PyO3's tries to load `libpython` from certain _paths_, a concept that isn't exactly clearly defined in Wasm's post POSIX webtopia.
Our first solution was to use [wasi-vfs](https://github.com/kateinoigakukun/wasi-vfs), a tool which allows you to embed a virtual file system, accessible through preview1 APIs, directly into your wasm binaries.
@@ -118,7 +118,7 @@ The solution described above worked well to an extent but the limitations of pre
This was exactly what we did after the Bytecode Alliance finalized [WASI 0.2](https://bytecodealliance.org/articles/WASI-0.2) back in January 2024 and with it, a slew of new opportunuties.
WASI 0.2 introduces a whole new concept of components, wasm modules that come with pre-specifed interfaces using the [Wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) format and based on a whole new [ABI](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md) to boot.
-These new capabilities suggest that it should possible to replace our PyO3 based glue code with the WASI based layer.
+These new capabilities suggest that it should possible to replace our PyO3 based glue code with the WASI based layer.
Let's see how.
We first used the new found WASI powers to implement support for Wasm based functions through the [`WasmRuntime`](/docs/reference/runtimes/wasm).
@@ -196,7 +196,7 @@ In the case of the [`PythonRuntime`](/docs/reference/runtimes/python), this woul
Now that we have the `wit_wire` implementation taking care of bidirectional communication, we have little reason to keep the PyO3 based glue code around.
This glue was doing a bit more than acting as a boundary though.
It was also responsible for setting up the operating environment for the Python code.
-For example, we'd need some kind of initialization to execute the user's Python snippets which are in free standing `lambda` form.
+For example, we'd need some kind of initialization to execute the user's Python snippets which are in free standing `lambda` form.
How does one create components out of Python anyways?
[componentize-py](https://github.com/bytecodealliance/componentize-py) is a tool authored by the Bytecode Alliance that allows you to produce WASI components that are authored in Python.
diff --git a/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx b/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx
index b5773abc52..bf12f616b5 100644
--- a/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx
+++ b/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx
@@ -9,6 +9,7 @@ gRPC, or **g**oogle **R**emote **P**rocedure **C**all, is a high-performance, op
Unlike traditional HTTP APIs that use JSON, gRPC relies on **Protocol Buffers** (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems.
Key benefits of gRPC include:
+
- **Cross-language support**: gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly.
- **Strong type safety**: Protocol Buffers ensure type-safe communication, catching errors early and improving reliability.
- **Bidirectional streaming**: gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics.
@@ -20,17 +21,17 @@ In short, gRPC is well-suited for high-performance, scalable backend systems whe
Metatype is a platform that enables developers to create **typegraphs**—strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform’s versatility.
By integrating gRPC, Metatype empowers developers to:
+
- **Expose gRPC services via GraphQL or HTTP endpoints**, making them accessible to clients in a way that best suits their needs.
- **Compose gRPC services with other backend components**, such as databases or other APIs, to create powerful and cohesive backend systems.
## Diagram: gRPC and Metatype Integration
- ![gRPC and Metatype Integration Diagram](./GrpcMetatype.drawio.png)
+ ![gRPC and Metatype Integration Diagram](./GrpcMetatype.drawio.png)
- Build backend components with WASM,
- {" "}
- Typescript and{" "}
- Python, no matter where and how your (legacy) systems
- are.
+ Build backend components with WASM,{" "}
+ Typescript and Python, no matter
+ where and how your (legacy) systems are.
castle building
- And castle building is{" "}
- hard. Even the best teams can struggle to build
- according to the plans, especially with the ever evolving needs and
- the tech landscape complexities.
+ And castle building is hard. Even the best teams can
+ struggle to build according to the plans, especially with the ever
+ evolving needs and the tech landscape complexities.
}>
@@ -111,9 +108,9 @@ function Stability(): JSX.Element {
typegraphs
- Typegraphs are programmable virtual graphs{" "}
- describing all the components of your stack. They enable you to
- compose APIs, storage and business logic in a type safe manner.
+ Typegraphs are programmable virtual graphs describing
+ all the components of your stack. They enable you to compose APIs,
+ storage and business logic in a type safe manner.
}>
@@ -135,8 +132,8 @@ function Modularity(): JSX.Element {
typegate
- Typegate is a GraphQL/REST composition engine{" "}
- that compiles, optimizes, runs and caches queries over typegraphs. It
+ Typegate is a GraphQL/REST composition engine that
+ compiles, optimizes, runs and caches queries over typegraphs. It
enforces authentication, authorization and security for you.
@@ -159,10 +156,9 @@ function Reusability(): JSX.Element {
Metatype
- Install third parties as dependencies{" "}
- and start reusing components. The Meta CLI offers you live reloading
- and one-command deployment to Metatype cloud or your self-hosted
- instance.
+ Install third parties as dependencies and start
+ reusing components. The Meta CLI offers you live reloading and
+ one-command deployment to Metatype cloud or your self-hosted instance.
}>
@@ -283,12 +279,8 @@ function TryIt(): JSX.Element {
in hours
- Watch the 3 minutes introduction{" "}
- of the Metatype platform and start designing your own typegraph. Once
- you have understood the basics, you already feel productive.
+ Watch the 3 minutes introduction of the Metatype
+ platform and start designing your own typegraph. Once you have
+ understood the basics, you already feel productive.
diff --git a/docs/metatype.dev/src/states/package_manager.ts b/docs/metatype.dev/src/states/package_manager.ts
index d369d7a644..b8a9cd59a5 100644
--- a/docs/metatype.dev/src/states/package_manager.ts
+++ b/docs/metatype.dev/src/states/package_manager.ts
@@ -20,8 +20,8 @@ const tsPmQueryAtom = atom(
(get) =>
get(locationAtom).searchParams?.get(tsKey) as TsPackageManager | null,
(get, set, value: TsPackageManager) => {
- const searchParams = get(locationAtom).searchParams ??
- new URLSearchParams();
+ const searchParams =
+ get(locationAtom).searchParams ?? new URLSearchParams();
searchParams.set(tsKey, value);
set(locationAtom, (prev) => ({
...prev,
@@ -36,8 +36,8 @@ const pythonPmQueryAtom = atom(
pythonKey,
) as PythonPackageManager | null,
(get, set, value: TsPackageManager) => {
- const searchParams = get(locationAtom).searchParams ??
- new URLSearchParams();
+ const searchParams =
+ get(locationAtom).searchParams ?? new URLSearchParams();
searchParams.set(pythonKey, value);
set(locationAtom, (prev) => ({
...prev,
diff --git a/docs/metatype.dev/src/states/sdk.ts b/docs/metatype.dev/src/states/sdk.ts
index 7724b28c7e..800735dde7 100644
--- a/docs/metatype.dev/src/states/sdk.ts
+++ b/docs/metatype.dev/src/states/sdk.ts
@@ -15,8 +15,8 @@ const locationAtom = atomWithLocation();
const sdkQueryAtom = atom(
(get) => get(locationAtom).searchParams?.get(key) as SDK | null,
(get, set, value: SDK) => {
- const searchParams = get(locationAtom).searchParams ??
- new URLSearchParams();
+ const searchParams =
+ get(locationAtom).searchParams ?? new URLSearchParams();
searchParams.set(key, value);
set(locationAtom, (prev) => ({
...prev,
diff --git a/examples/deno.jsonc b/examples/deno.jsonc
index 1ce1410442..9d5290c1b3 100644
--- a/examples/deno.jsonc
+++ b/examples/deno.jsonc
@@ -1,5 +1,12 @@
{
"imports": {
"@typegraph/sdk/": "../src/typegraph/deno/src/"
+ },
+ "lint": {
+ "rules": {
+ "exclude": [
+ "no-explicit-any"
+ ]
+ }
}
}
diff --git a/examples/deploy/deploy.ts b/examples/deploy/deploy.ts
index fd1891080b..d120f887c2 100644
--- a/examples/deploy/deploy.ts
+++ b/examples/deploy/deploy.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";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno";
import { PythonRuntime } from "@typegraph/sdk/runtimes/python";
@@ -20,7 +23,7 @@ const tg = await typegraph(
id: t.integer({}, { asId: true }),
name: t.string(),
},
- { name: "Student" }
+ { name: "Student" },
);
g.expose(
@@ -38,7 +41,7 @@ const tg = await typegraph(
sayHelloPyLambda: python.fromLambda(
t.struct({ name: t.string() }),
t.string(),
- { code: `lambda obj: f"Hello {obj['name']} from python lambda"` }
+ { code: `lambda obj: f"Hello {obj['name']} from python lambda"` },
),
sayHelloPyMod: python.import(
t.struct({ name: t.string() }),
@@ -47,15 +50,15 @@ const tg = await typegraph(
module: "scripts/python/say_hello.py",
name: "sayHello",
deps: ["scripts/python/import_.py"],
- }
+ },
),
// Prisma
createStudent: prisma.create(student),
findManyStudent: prisma.findMany(student),
},
- pub
+ pub,
);
- }
+ },
);
const artifactsConfig = {
@@ -70,7 +73,7 @@ const artifactsConfig = {
const baseUrl = "http://localhost:7890";
const auth = new BasicAuth("admin", "password");
-const { response, serialized } = await tgDeploy(tg, {
+const { response, serialized: _ } = await tgDeploy(tg, {
typegate: {
url: baseUrl,
auth,
@@ -81,8 +84,6 @@ const { response, serialized } = await tgDeploy(tg, {
typegraphPath: "./deploy.ts",
});
-// console.log(serialized);
-
const { migrations, messages } = response;
// migration status.. etc
diff --git a/examples/templates/node/api/example.ts b/examples/templates/node/api/example.ts
index 206b3529be..094c04136e 100644
--- a/examples/templates/node/api/example.ts
+++ b/examples/templates/node/api/example.ts
@@ -12,7 +12,7 @@ typegraph("example", (g) => {
.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/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/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.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.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.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/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/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.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.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.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.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/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.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/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.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-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.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.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/rs/fdk.rs b/examples/typegraphs/metagen/rs/fdk.rs
index 4969ee6017..c03038436c 100644
--- a/examples/typegraphs/metagen/rs/fdk.rs
+++ b/examples/typegraphs/metagen/rs/fdk.rs
@@ -109,7 +109,7 @@ impl Router {
}
pub fn init(&self, args: InitArgs) -> Result {
- static MT_VERSION: &str = "0.5.0-rc.4";
+ static MT_VERSION: &str = "0.5.0-rc.6";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
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.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.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.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/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.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.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.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.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.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.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.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/temporal.ts b/examples/typegraphs/temporal.ts
index b56afac5ea..851fb8a0fe 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 "node: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.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/union-either.py b/examples/typegraphs/union-either.py
new file mode 100644
index 0000000000..21c2f16598
--- /dev/null
+++ b/examples/typegraphs/union-either.py
@@ -0,0 +1,69 @@
+# skip:start
+from typegraph import typegraph, Policy, t, Graph
+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..ea1c538a51 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";
@@ -16,7 +19,7 @@ env("main")
.install(installs.deno)
.vars({
RUST_LOG:
- "info,typegate=debug,deno=warn,swc_ecma_codegen=off,tracing::span=off",
+ "info,typegate=debug,deno=warn,swc_ecma_codegen=off,tracing::span=off,quaint=off",
TYPEGRAPH_VERSION: "0.0.3",
CLICOLOR_FORCE: "1",
CROSS_CONFIG: "tools/Cross.toml",
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/cli/gen.rs b/src/meta-cli/src/cli/gen.rs
index 9d3c7236a2..cdf4fcd97c 100644
--- a/src/meta-cli/src/cli/gen.rs
+++ b/src/meta-cli/src/cli/gen.rs
@@ -185,6 +185,7 @@ async fn load_tg_at(
let init = TaskManagerInit::::new(
config.clone(),
SerializeActionGenerator::new(
+ None,
config_dir.clone(),
dir.into(),
config
diff --git a/src/meta-cli/src/cli/list.rs b/src/meta-cli/src/cli/list.rs
index c13128b583..60e4e29fb3 100644
--- a/src/meta-cli/src/cli/list.rs
+++ b/src/meta-cli/src/cli/list.rs
@@ -50,6 +50,7 @@ impl Action for List {
let console = ConsoleActor::new(Arc::clone(&config)).start();
let action_generator = ListActionGenerator::new(
+ node.prefix.clone(),
config.dir().unwrap_or_log().into(),
dir.clone().into(),
config
diff --git a/src/meta-cli/src/cli/serialize.rs b/src/meta-cli/src/cli/serialize.rs
index 82acf8c207..cbafa6d2fa 100644
--- a/src/meta-cli/src/cli/serialize.rs
+++ b/src/meta-cli/src/cli/serialize.rs
@@ -67,6 +67,7 @@ impl Action for Serialize {
let console = ConsoleActor::new(Arc::clone(&config)).start();
let action_generator = SerializeActionGenerator::new(
+ self.prefix.clone(),
config.dir().unwrap_or_log().into(),
dir.into(),
config
diff --git a/src/meta-cli/src/deploy/actors/task/action.rs b/src/meta-cli/src/deploy/actors/task/action.rs
index 010f569937..6a175b1ec6 100644
--- a/src/meta-cli/src/deploy/actors/task/action.rs
+++ b/src/meta-cli/src/deploy/actors/task/action.rs
@@ -12,6 +12,7 @@ use tokio::process::Command;
#[derive(Debug, Clone)]
pub struct SharedActionConfig {
pub command: &'static str,
+ pub prefix: Option,
pub config_dir: Arc,
pub working_dir: Arc,
pub migrations_dir: Arc,
diff --git a/src/meta-cli/src/deploy/actors/task/command.rs b/src/meta-cli/src/deploy/actors/task/command.rs
index 6aabfe64dd..22d5878d18 100644
--- a/src/meta-cli/src/deploy/actors/task/command.rs
+++ b/src/meta-cli/src/deploy/actors/task/command.rs
@@ -100,6 +100,8 @@ impl CommandContext {
path,
} = self;
+ let optional_envs = [("MCLI_PREFIX", shared_config.prefix.clone())];
+
command
.current_dir(shared_config.working_dir.to_str().unwrap())
.env("MCLI_VERSION", crate::build::PKG_VERSION)
@@ -122,6 +124,11 @@ impl CommandContext {
"MCLI_ARTIFACT_RESOLUTION",
shared_config.artifact_resolution.to_string(),
)
+ .envs(
+ optional_envs
+ .into_iter()
+ .filter_map(|(k, v)| v.map(|v| (k, v))),
+ )
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped());
diff --git a/src/meta-cli/src/deploy/actors/task/deploy.rs b/src/meta-cli/src/deploy/actors/task/deploy.rs
index 1e1f5e4ca8..69695f93d0 100644
--- a/src/meta-cli/src/deploy/actors/task/deploy.rs
+++ b/src/meta-cli/src/deploy/actors/task/deploy.rs
@@ -62,10 +62,10 @@ impl DeployActionGenerator {
destructive_migrations: bool, // TODO enum { Fail, Reset, Ask }
) -> Self {
Self {
- node,
secrets,
shared_config: SharedActionConfig {
command: "deploy",
+ prefix: node.prefix.clone(),
config_dir,
working_dir,
migrations_dir,
@@ -77,6 +77,7 @@ impl DeployActionGenerator {
artifact_resolution: true,
}
.into(),
+ node,
}
}
}
diff --git a/src/meta-cli/src/deploy/actors/task/list.rs b/src/meta-cli/src/deploy/actors/task/list.rs
index c057dd84b9..dac69080ed 100644
--- a/src/meta-cli/src/deploy/actors/task/list.rs
+++ b/src/meta-cli/src/deploy/actors/task/list.rs
@@ -31,6 +31,7 @@ pub struct ListActionGenerator {
impl ListActionGenerator {
pub fn new(
+ prefix: Option,
config_dir: Arc,
working_dir: Arc,
migrations_dir: Arc,
@@ -39,6 +40,7 @@ impl ListActionGenerator {
Self {
shared_config: SharedActionConfig {
command: "list",
+ prefix,
config_dir,
working_dir,
migrations_dir,
diff --git a/src/meta-cli/src/deploy/actors/task/serialize.rs b/src/meta-cli/src/deploy/actors/task/serialize.rs
index ccfe5ec89c..0bcc8858e2 100644
--- a/src/meta-cli/src/deploy/actors/task/serialize.rs
+++ b/src/meta-cli/src/deploy/actors/task/serialize.rs
@@ -33,6 +33,7 @@ pub struct SerializeActionGenerator {
impl SerializeActionGenerator {
pub fn new(
+ prefix: Option,
config_dir: Arc,
working_dir: Arc,
migrations_dir: Arc,
@@ -41,6 +42,7 @@ impl SerializeActionGenerator {
Self {
shared_config: SharedActionConfig {
command: "serialize",
+ prefix,
config_dir,
working_dir,
migrations_dir,
diff --git a/src/meta-cli/src/utils/shell_words.rs b/src/meta-cli/src/utils/shell_words.rs
index 5c00018f2e..0b77bdca5e 100644
--- a/src/meta-cli/src/utils/shell_words.rs
+++ b/src/meta-cli/src/utils/shell_words.rs
@@ -1,4 +1,4 @@
-// no-auto-license-header
+// no-auto-license-header | @generated (pre-commit doesn't support two headers)
/*
Copyright (c) 2016 Tomasz Miąsko
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_rs/static/client.rs b/src/metagen/src/client_rs/static/client.rs
index 06ef4b9f2e..a848896a8a 100644
--- a/src/metagen/src/client_rs/static/client.rs
+++ b/src/metagen/src/client_rs/static/client.rs
@@ -1,6 +1,3 @@
-// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
-// SPDX-License-Identifier: MPL-2.0
-
use std::{collections::HashMap, marker::PhantomData};
use reqwest::Url;
diff --git a/src/metagen/src/client_rs/static/lib.rs b/src/metagen/src/client_rs/static/lib.rs
index 34b00f4242..b9babe5bc1 100644
--- a/src/metagen/src/client_rs/static/lib.rs
+++ b/src/metagen/src/client_rs/static/lib.rs
@@ -1,4 +1 @@
-// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
-// SPDX-License-Identifier: MPL-2.0
-
pub mod client;
diff --git a/src/metagen/src/client_ts/static/mod.ts b/src/metagen/src/client_ts/static/mod.ts
index 3c7ba074fa..cc9485f6fb 100644
--- a/src/metagen/src/client_ts/static/mod.ts
+++ b/src/metagen/src/client_ts/static/mod.ts
@@ -350,7 +350,7 @@ function convertQueryNodeGql(
: `${node.instanceName}: ${node.nodeName}`;
const args = node.args;
- if (args) {
+ if (args && Object.keys(args).length > 0) {
out = `${out} (${
Object.entries(args)
.map(([key, val]) => {
diff --git a/src/metagen/src/fdk_python/static/types.py.jinja b/src/metagen/src/fdk_python/static/types.py.jinja
index b7df7ec36e..d8dd4c2e1e 100644
--- a/src/metagen/src/fdk_python/static/types.py.jinja
+++ b/src/metagen/src/fdk_python/static/types.py.jinja
@@ -1,3 +1,6 @@
+# This file was @generated by metagen and is intended
+# to be generated again on subsequent metagen runs.
+
from types import NoneType
from typing import Callable, List, Union, get_origin, ForwardRef, Any
from dataclasses import dataclass, asdict, fields
diff --git a/src/metagen/src/fdk_rust/static/fdk.rs b/src/metagen/src/fdk_rust/static/fdk.rs
index 6ad4ec62bf..6454d3d2b6 100644
--- a/src/metagen/src/fdk_rust/static/fdk.rs
+++ b/src/metagen/src/fdk_rust/static/fdk.rs
@@ -1,4 +1,3 @@
-// no-auto-license-header | @generated (pre-commit doesn't support two headers)
// gen-start
#![allow(dead_code)]
diff --git a/src/metagen/src/fdk_rust/static/lib.rs b/src/metagen/src/fdk_rust/static/lib.rs
index 3f6c2c8242..7b55348d1e 100644
--- a/src/metagen/src/fdk_rust/static/lib.rs
+++ b/src/metagen/src/fdk_rust/static/lib.rs
@@ -1,4 +1 @@
-// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
-// SPDX-License-Identifier: MPL-2.0
-
mod fdk;
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..b3530cfab9 100644
--- a/src/metagen/src/fdk_substantial/static/substantial.py
+++ b/src/metagen/src/fdk_substantial/static/substantial.py
@@ -10,20 +10,11 @@ async def save(
*,
timeout: Optional[timedelta] = None,
retry_strategy: Optional[RetryStrategy] = None,
- ):
- pass
-
- def handle(self, event_name: str, cb: Callable[[Any], Any]):
- pass
-
- async def ensure(self, f: Callable[[], bool]):
- pass
-
- async def sleep(self, duration: timedelta) -> Any:
- pass
-
- async def receive(name: str):
- pass
+ ): ...
+ def handle(self, event_name: str, cb: Callable[[Any], Any]): ...
+ async def ensure(self, f: Callable[[], bool]): ...
+ async def sleep(self, duration: timedelta) -> Any: ...
+ async def receive(name: str): ...
def workflow():
diff --git a/src/pyrt_wit_wire/main.py b/src/pyrt_wit_wire/main.py
index 28689e3fc9..91c941e7a4 100644
--- a/src/pyrt_wit_wire/main.py
+++ b/src/pyrt_wit_wire/main.py
@@ -1,3 +1,6 @@
+# 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
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/log.ts b/src/typegate/src/log.ts
index d1dbeef25f..42879e7571 100644
--- a/src/typegate/src/log.ts
+++ b/src/typegate/src/log.ts
@@ -15,7 +15,7 @@ if (!sharedConfig.rust_log) {
break;
case "DEBUG":
set(
- "info,native=trace,sql_schema_connector=warn,tracing=warn,schema_core=warn",
+ "info,native=trace,sql_schema_connector=warn,tracing=warn,schema_core=warn,quaint=warn",
);
break;
case "WARNING":
@@ -27,7 +27,7 @@ if (!sharedConfig.rust_log) {
break;
case "INFO":
default:
- set("info");
+ set("info,quaint=warn");
break;
}
}
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/worker.ts b/src/typegate/src/runtimes/substantial/worker.ts
index 61f7a5dec5..b74b8921ea 100644
--- a/src/typegate/src/runtimes/substantial/worker.ts
+++ b/src/typegate/src/runtimes/substantial/worker.ts
@@ -3,6 +3,7 @@
import { errorToString } from "../../worker_utils.ts";
import { Context } from "./deno_context.ts";
+import { toFileUrl } from "@std/path/to-file-url";
import { Err, Msg, Ok, WorkerData, WorkflowResult } from "./types.ts";
let runCtx: Context | undefined;
@@ -15,7 +16,7 @@ self.onmessage = async function (event) {
data;
// FIXME: handle case when script is missing and notify WorkerManager so it cleans up
// its registry.
- const module = await import(modulePath);
+ const module = await import(toFileUrl(modulePath).toString());
// TODO: for python use the same strategy but instead call from native
const workflowFn = module[functionName];
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/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/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/standalone/src/logger.rs b/src/typegate/standalone/src/logger.rs
index 991efe4c6c..1a5c303e6c 100644
--- a/src/typegate/standalone/src/logger.rs
+++ b/src/typegate/standalone/src/logger.rs
@@ -1,9 +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
-
use colored::Colorize;
use log::Level;
use std::io::Write;
@@ -18,7 +15,10 @@ fn optional_module_path(path: &str) -> String {
pub fn init() {
if std::env::var("RUST_LOG").is_err() {
- std::env::set_var("RUST_LOG", "info,swc_ecma_codegen=off,tracing::span=off");
+ std::env::set_var(
+ "RUST_LOG",
+ "info,swc_ecma_codegen=off,tracing::span=off,quaint=off",
+ );
}
let mut builder = env_logger::Builder::from_default_env();
builder
diff --git a/src/typegraph/core/src/runtimes/mod.rs b/src/typegraph/core/src/runtimes/mod.rs
index bab48909b5..70d311d29e 100644
--- a/src/typegraph/core/src/runtimes/mod.rs
+++ b/src/typegraph/core/src/runtimes/mod.rs
@@ -445,10 +445,6 @@ impl crate::sdk::runtimes::Handler for crate::Lib {
prisma_op!(runtime, model, Aggregate, "aggregate")
}
- fn prisma_count(runtime: RuntimeId, model: CoreTypeId) -> Result {
- prisma_op!(runtime, model, Count, "count")
- }
-
fn prisma_group_by(runtime: RuntimeId, model: CoreTypeId) -> Result {
prisma_op!(runtime, model, GroupBy, "groupBy")
}
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..757ec162ad 100644
--- a/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
+++ b/src/typegraph/core/src/runtimes/prisma/type_generation/mod.rs
@@ -1,5 +1,4 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
-//
// SPDX-License-Identifier: MPL-2.0
//! This module is responsible for generating the types for prisma operations.
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 cfa3c54697..75002dd38c 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::sdk::utils::ReduceEntry;
use crate::types::Type;
diff --git a/src/typegraph/core/src/types/type_ref/policy.rs b/src/typegraph/core/src/types/type_ref/policy.rs
index 0673eb6022..bfa8064476 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/core/wit/typegraph.wit b/src/typegraph/core/wit/typegraph.wit
index 19ff85ccfa..763ce9b2fe 100644
--- a/src/typegraph/core/wit/typegraph.wit
+++ b/src/typegraph/core/wit/typegraph.wit
@@ -409,7 +409,6 @@ interface runtimes {
prisma-find-many: func(runtime: runtime-id, model: type-id) -> result;
prisma-find-first: func(runtime: runtime-id, model: type-id) -> result;
prisma-aggregate: func(runtime: runtime-id, model: type-id) -> result;
- prisma-count: func(runtime: runtime-id, model: type-id) -> result;
prisma-group-by: func(runtime: runtime-id, model: type-id) -> result;
prisma-create-one: func(runtime: runtime-id, model: type-id) -> result;
prisma-create-many: func(runtime: runtime-id, model: type-id) -> result;
diff --git a/src/typegraph/deno/deno.json b/src/typegraph/deno/deno.json
index 712b670d69..ff0a429405 100644
--- a/src/typegraph/deno/deno.json
+++ b/src/typegraph/deno/deno.json
@@ -4,6 +4,13 @@
"publish": {
"exclude": ["!src/gen", "!LICENSE.md", "!README.md"]
},
+ "lint": {
+ "rules": {
+ "exclude": [
+ "no-external-import"
+ ]
+ }
+ },
"exports": {
"./deps/_import.ts": "./src/deps/_import.ts",
"./deps/mod.ts": "./src/deps/mod.ts",
@@ -19,6 +26,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",
diff --git a/src/typegraph/deno/src/deps/_import.ts b/src/typegraph/deno/src/deps/_import.ts
index b21c30e5ab..eb6a58283a 100644
--- a/src/typegraph/deno/src/deps/_import.ts
+++ b/src/typegraph/deno/src/deps/_import.ts
@@ -1,4 +1,4 @@
-// no-auto-license-header
+// no-auto-license-header | @generated (pre-commit doesn't support two headers)
/*
The MIT License (MIT)
@@ -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 c7947f64ff..36d3959738 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 { Effect } from "./gen/runtimes.ts";
+import type { Effect } from "./gen/runtimes.ts";
export function read(): Effect {
return "read";
diff --git a/src/typegraph/deno/src/envs/cli.ts b/src/typegraph/deno/src/envs/cli.ts
index 62e0295150..d9315ef1d1 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`,
);
@@ -78,7 +78,7 @@ export function loadCliEnv(): CliEnv | null {
for (const key of optionalCliEnvs) {
const name = `MCLI_${key.toLocaleUpperCase()}`;
const envValue = env[name];
- if (envValue != null) {
+ if (envValue) {
record[key] = envValue;
}
}
@@ -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 a4684de526..147b617cc7 100644
--- a/src/typegraph/deno/src/io.ts
+++ b/src/typegraph/deno/src/io.ts
@@ -31,6 +31,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,
@@ -40,6 +41,7 @@ const rpcNotify = (method: RpcNotificationMethod, params: any = null) => {
writeRpcMessage(message);
};
+// deno-lint-ignore no-explicit-any
function getOutput(args: any[]) {
return args
.map((arg) => {
@@ -54,24 +56,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,10 +94,6 @@ export const log = {
},
};
-const rpcCall = (() => {
- return (method: string, params: any = null) => rpcRequest(method, params);
-})();
-
export interface DeployTarget {
baseUrl: string;
auth: {
@@ -105,7 +115,7 @@ export interface DeployData {
}
export const rpc = {
- getDeployTarget: () => rpcCall("GetDeployTarget") as Promise,
+ getDeployTarget: () => rpcRequest("GetDeployTarget") as DeployTarget,
getDeployData: (typegraph: string) =>
rpcRequest(
"GetDeployData",
diff --git a/src/typegraph/deno/src/metagen.ts b/src/typegraph/deno/src/metagen.ts
index e0c790a8a8..f17774e757 100644
--- a/src/typegraph/deno/src/metagen.ts
+++ b/src/typegraph/deno/src/metagen.ts
@@ -1,11 +1,11 @@
// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
// SPDX-License-Identifier: MPL-2.0
-import { SerializeParams } from "./gen/core.ts";
+import type { SerializeParams } from "./gen/core.ts";
import { TypegraphOutput } from "./typegraph.ts";
import { sdkUtils } from "./sdk.ts";
import { freezeTgOutput } from "./utils/func_utils.ts";
-import { FdkConfig, FdkOutput } from "./gen/utils.ts";
+import type { FdkConfig, FdkOutput } from "./gen/utils.ts";
export class Metagen {
constructor(
diff --git a/src/typegraph/deno/src/params.ts b/src/typegraph/deno/src/params.ts
index 1d0551aa72..f6300b2e4c 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_, sdkUtils } from "./sdk.ts";
+import { type Auth as Auth_, sdkUtils } from "./sdk.ts";
import * 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 6e5b67f181..ffabdb72ec 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/core.ts";
+import type { ContextCheck, MaterializerId } from "./gen/core.ts";
import { core } from "./sdk.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 659181c4db..2f519cb825 100644
--- a/src/typegraph/deno/src/providers/aws.ts
+++ b/src/typegraph/deno/src/providers/aws.ts
@@ -3,7 +3,7 @@
import { Materializer, Runtime } from "../runtimes/mod.ts";
import { aws } from "../sdk.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 37a690ea6e..0a27c72c48 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 "../sdk.ts";
import { Typedef } from "../types.ts";
import { t } from "../index.ts";
-import { Effect } from "../gen/runtimes.ts";
+import type { Effect } from "../gen/runtimes.ts";
import { genRef } from "./../typegraph.ts";
type PrismaLinkArg = {
@@ -63,15 +63,6 @@ export class PrismaRuntime extends Runtime {
return t.Func.fromTypeFunc(type);
}
- /** create a function for a prisma `count` query */
- count(model: string | Typedef): t.Func {
- if (typeof model == "string") {
- model = genRef(model);
- }
- const type = runtimes.prismaCount(this._id, model._id);
- return t.Func.fromTypeFunc(type);
- }
-
/** create a function for a prisma `groupBy` query */
groupBy(model: string | Typedef): t.Func {
if (typeof model == "string") {
diff --git a/src/typegraph/deno/src/providers/temporal.ts b/src/typegraph/deno/src/providers/temporal.ts
index 4fbbedac89..ad380967b8 100644
--- a/src/typegraph/deno/src/providers/temporal.ts
+++ b/src/typegraph/deno/src/providers/temporal.ts
@@ -4,7 +4,7 @@
import { Runtime } from "../runtimes/mod.ts";
import { runtimes } from "../sdk.ts";
import { Func, Typedef } from "../types.ts";
-import {
+import type {
TemporalOperationData,
TemporalOperationType,
} from "../gen/runtimes.ts";
diff --git a/src/typegraph/deno/src/runtimes/deno.ts b/src/typegraph/deno/src/runtimes/deno.ts
index 56bd6dcb87..c87bb06be7 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 d98a790da3..7f4dfa0252 100644
--- a/src/typegraph/deno/src/runtimes/graphql.ts
+++ b/src/typegraph/deno/src/runtimes/graphql.ts
@@ -4,7 +4,7 @@
import { Effect } from "../gen/runtimes.ts";
import * as t from "../types.ts";
import { runtimes } from "../sdk.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 3c88caf0bd..664a92490f 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 009e285ac8..41643d70b3 100644
--- a/src/typegraph/deno/src/runtimes/http.ts
+++ b/src/typegraph/deno/src/runtimes/http.ts
@@ -2,19 +2,17 @@
// SPDX-License-Identifier: MPL-2.0
import * as t from "../types.ts";
-import {
+import type {
Effect,
HttpMethod,
MaterializerHttpRequest,
} from "../gen/runtimes.ts";
import { runtimes } from "../sdk.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
-type HttpRequestMat =
- & Materializer
- & Omit
- & {
+type HttpRequestMat = Materializer &
+ Omit & {
method: M;
};
diff --git a/src/typegraph/deno/src/runtimes/kv.ts b/src/typegraph/deno/src/runtimes/kv.ts
index 993681b44e..7365a5d7c7 100644
--- a/src/typegraph/deno/src/runtimes/kv.ts
+++ b/src/typegraph/deno/src/runtimes/kv.ts
@@ -1,11 +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 "../sdk.ts";
-import { Effect, KvMaterializer } from "../gen/runtimes.ts";
-
+import type { Effect, KvMaterializer } from "../gen/runtimes.ts";
import { fx } from "../index.ts";
class KvOperationMat implements Materializer {
@@ -37,7 +36,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() }),
@@ -46,18 +49,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);
+ 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() }),
@@ -66,7 +69,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 00cd0fa4db..06ea4b41b9 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 "../sdk.ts";
-import { Effect, SubstantialBackend } from "../gen/runtimes.ts";
-import { Materializer, Runtime } from "./mod.ts";
+import type { Effect } from "../gen/runtimes.ts";
+import { type Materializer, Runtime } from "./mod.ts";
import { fx } from "../index.ts";
-import { SubstantialRuntime } from "../runtimes/substantial.ts";
interface LambdaMat extends Materializer {
function: string;
diff --git a/src/typegraph/deno/src/runtimes/random.ts b/src/typegraph/deno/src/runtimes/random.ts
index 25c365f966..425d10d7fb 100644
--- a/src/typegraph/deno/src/runtimes/random.ts
+++ b/src/typegraph/deno/src/runtimes/random.ts
@@ -4,7 +4,7 @@
import * as t from "../types.ts";
import { runtimes } from "../sdk.ts";
import { RandomRuntimeData } from "../gen/runtimes.ts";
-import { Materializer, Runtime } from "./mod.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 62dc745a66..d5098a6d71 100644
--- a/src/typegraph/deno/src/runtimes/wasm.ts
+++ b/src/typegraph/deno/src/runtimes/wasm.ts
@@ -4,7 +4,7 @@
import * as t from "../types.ts";
import { runtimes } from "../sdk.ts";
import { Effect } from "../gen/runtimes.ts";
-import { Materializer, Runtime } from "./mod.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 2d3c1ae44c..23dadd6d81 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/core.ts";
+import type { BasicAuth } from "./tg_deploy.ts";
+import type { Artifact } from "./gen/core.ts";
import { dirname, join } from "node:path";
import * as fsp from "node:fs/promises";
import { log } from "./io.ts";
@@ -49,8 +49,7 @@ export class ArtifactUploader {
// const uploadUrls: Array = await response.json();
if (uploadUrls.length !== artifactMetas.length) {
- const diff =
- `array length mismatch: ${uploadUrls.length} !== ${artifactMetas.length}`;
+ const diff = `array length mismatch: ${uploadUrls.length} !== ${artifactMetas.length}`;
throw new Error(`Failed to get upload URLs for all artifacts: ${diff}`);
}
@@ -60,7 +59,7 @@ export class ArtifactUploader {
private async upload(
token: string | null,
meta: UploadArtifactMeta,
- ): Promise {
+ ): Promise