,
I extends t.Struct = t.Struct
,
- O extends t.Typedef = t.Typedef
+ O extends t.Typedef = t.Typedef,
>(inp: I, out: O, { code }: { code: string }): t.Func {
const matId = runtimes.fromPythonLambda(
{
@@ -51,7 +51,7 @@ export class PythonRuntime extends Runtime {
{
fn: code, // not formatted
runtime: this._id,
- }
+ },
);
return t.func(inp, out, {
@@ -64,7 +64,7 @@ export class PythonRuntime extends Runtime {
fromDef<
P extends Record = Record,
I extends t.Struct = t.Struct
,
- O extends t.Typedef = t.Typedef
+ O extends t.Typedef = t.Typedef,
>(inp: I, out: O, { code }: { code: string }): t.Func {
const name = code.trim().match(/def\s+([A-Za-z0-9_]+)/)?.[1];
if (name == undefined) {
@@ -79,7 +79,7 @@ export class PythonRuntime extends Runtime {
name: name,
fn: code,
runtime: this._id,
- }
+ },
);
return t.func(inp, out, {
@@ -92,7 +92,7 @@ export class PythonRuntime extends Runtime {
import(
inp: I,
out: O,
- { name, module, deps = [], effect = fx.read(), secrets = [] }: PythonImport
+ { name, module, deps = [], effect = fx.read(), secrets = [] }: PythonImport,
): t.Func {
const base = {
runtime: this._id,
diff --git a/src/typegraph/deno/src/runtimes/substantial.ts b/src/typegraph/deno/src/runtimes/substantial.ts
index 4ad4145d6f..7e9c81f858 100644
--- a/src/typegraph/deno/src/runtimes/substantial.ts
+++ b/src/typegraph/deno/src/runtimes/substantial.ts
@@ -7,28 +7,12 @@ import { Func, type Typedef } from "../types.ts";
import type {
SubstantialBackend,
SubstantialOperationData,
- SubstantialOperationType,
WorkflowFileDescription,
WorkflowKind,
} from "../gen/typegraph_core.d.ts";
-export class Backend {
- static devMemory(): SubstantialBackend {
- return { tag: "memory" };
- }
-
- static devFs(): SubstantialBackend {
- return { tag: "fs" };
- }
-
- static redis(connectionStringSecret: string): SubstantialBackend {
- return {
- tag: "redis",
- val: {
- connectionStringSecret,
- },
- };
- }
+interface StartFunc {
+ secrets?: string[];
}
export class SubstantialRuntime extends Runtime {
@@ -36,7 +20,7 @@ export class SubstantialRuntime extends Runtime {
constructor(
backend: SubstantialBackend,
- fileDescriptions: Array
+ fileDescriptions: Array,
) {
const id = runtimes.registerSubstantialRuntime({
backend,
@@ -47,31 +31,30 @@ export class SubstantialRuntime extends Runtime {
}
_genericSubstantialFunc(
- operation: SubstantialOperationType,
- funcArg?: Typedef,
- funcOut?: Typedef
+ data: SubstantialOperationData,
): Func {
- const data = {
- funcArg: funcArg?._id,
- funcOut: funcOut?._id,
- operation,
- } as SubstantialOperationData;
const funcData = runtimes.generateSubstantialOperation(this._id, data);
return Func.fromTypeFunc(funcData);
}
- start(kwargs: Typedef): Func {
+ start(
+ kwargs: Typedef,
+ { secrets }: StartFunc = {},
+ ): Func {
return this._genericSubstantialFunc(
{
tag: "start",
+ val: { secrets: secrets ?? [], funcArg: kwargs._id },
},
- kwargs
);
}
- startRaw(): Func {
+ startRaw(
+ { secrets }: StartFunc = {},
+ ): Func {
return this._genericSubstantialFunc({
tag: "start-raw",
+ val: { secrets: secrets ?? [] },
});
}
@@ -85,8 +68,8 @@ export class SubstantialRuntime extends Runtime {
return this._genericSubstantialFunc(
{
tag: "send",
+ val: payload._id,
},
- payload
);
}
@@ -106,9 +89,8 @@ export class SubstantialRuntime extends Runtime {
return this._genericSubstantialFunc(
{
tag: "results",
+ val: output._id,
},
- undefined,
- output
);
}
@@ -135,13 +117,32 @@ export class SubstantialRuntime extends Runtime {
}
}
+export class Backend {
+ static devMemory(): SubstantialBackend {
+ return { tag: "memory" };
+ }
+
+ static devFs(): SubstantialBackend {
+ return { tag: "fs" };
+ }
+
+ static redis(connectionStringSecret: string): SubstantialBackend {
+ return {
+ tag: "redis",
+ val: {
+ connectionStringSecret,
+ },
+ };
+ }
+}
+
export class WorkflowFile {
private workflows: Array = [];
private constructor(
public readonly file: string,
public readonly kind: WorkflowKind,
- public deps: Array = []
+ public deps: Array = [],
) {}
static deno(file: string, deps: Array = []): WorkflowFile {
diff --git a/src/typegraph/deno/src/tg_deploy.ts b/src/typegraph/deno/src/tg_deploy.ts
index a748bd99d3..0443cae334 100644
--- a/src/typegraph/deno/src/tg_deploy.ts
+++ b/src/typegraph/deno/src/tg_deploy.ts
@@ -119,9 +119,9 @@ export async function tgDeploy(
const addTypegraph = response.data.addTypegraph;
- /*
+ /*
// FIXME: failure field is used by interactive deployment
- // which means errors need to be ignored here but this
+ // which means errors need to be ignored here but this
// allows deployment errors in non-interactive scenarios
if (addTypegraph.failure) {
console.error(addTypegraph.failure);
diff --git a/src/typegraph/deno/src/tg_manage.ts b/src/typegraph/deno/src/tg_manage.ts
index cc682ef7e4..57bcfc6e17 100644
--- a/src/typegraph/deno/src/tg_manage.ts
+++ b/src/typegraph/deno/src/tg_manage.ts
@@ -115,7 +115,7 @@ export class Manager {
} as TypegraphOutput;
const deployTarget = await rpc.getDeployTarget();
- const { response } = await tgDeploy(reusableTgOutput, {
+ const { response, serialized } = await tgDeploy(reusableTgOutput, {
typegate: {
url: deployTarget.baseUrl,
auth: new BasicAuth(
@@ -131,7 +131,14 @@ export class Manager {
defaultMigrationAction: deployData.defaultMigrationAction,
});
- log.success({ typegraph: this.#typegraph.name, ...response });
+ log.success({
+ typegraph: {
+ name: this.#typegraph.name,
+ path: env.typegraph_path,
+ value: serialized,
+ },
+ ...response,
+ });
} catch (err: any) {
log.failure({
typegraph: this.#typegraph.name,
diff --git a/src/typegraph/deno/src/typegraph.ts b/src/typegraph/deno/src/typegraph.ts
index efb015183a..1d7a4fd4e9 100644
--- a/src/typegraph/deno/src/typegraph.ts
+++ b/src/typegraph/deno/src/typegraph.ts
@@ -187,7 +187,6 @@ export async function typegraph(
rate: rate ? { ...defaultRateFields, ...rate } : undefined,
};
-
core.initTypegraph({ name, dynamic, path, ...tgParams });
const g: TypegraphBuilderArgs = {
diff --git a/src/typegraph/deno/src/utils/func_utils.ts b/src/typegraph/deno/src/utils/func_utils.ts
index b227f4875a..bd02a69214 100644
--- a/src/typegraph/deno/src/utils/func_utils.ts
+++ b/src/typegraph/deno/src/utils/func_utils.ts
@@ -167,7 +167,10 @@ export async function execRequest(
try {
const response = await fetch(url, reqInit);
if (!response.ok) {
- log.error("error response json", await response.json().catch(_err => 'non json response'));
+ log.error(
+ "error response json",
+ await response.json().catch((_err) => "non json response"),
+ );
throw Error(
`${errMsg}: request failed with status ${response.status} (${response.statusText})`,
);
diff --git a/src/typegraph/python/pyproject.toml b/src/typegraph/python/pyproject.toml
index bdddb1e818..582d73e186 100644
--- a/src/typegraph/python/pyproject.toml
+++ b/src/typegraph/python/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "typegraph"
-version = "0.5.0-rc.4"
+version = "0.5.0-rc.6"
description = "Declarative API development platform. Build backend components with WASM, Typescript and Python, no matter where and how your (legacy) systems are."
authors = ["Metatype Contributors "]
license = "MPL-2.0"
diff --git a/src/typegraph/python/typegraph/__init__.py b/src/typegraph/python/typegraph/__init__.py
index b73ccef9b1..d6b9ef3382 100644
--- a/src/typegraph/python/typegraph/__init__.py
+++ b/src/typegraph/python/typegraph/__init__.py
@@ -5,4 +5,4 @@
from typegraph.policy import Policy # noqa
from typegraph import effects as fx # noqa
-version = "0.5.0-rc.4"
+version = "0.5.0-rc.6"
diff --git a/src/typegraph/python/typegraph/graph/tg_deploy.py b/src/typegraph/python/typegraph/graph/tg_deploy.py
index e5fbdc6afe..af5d01e311 100644
--- a/src/typegraph/python/typegraph/graph/tg_deploy.py
+++ b/src/typegraph/python/typegraph/graph/tg_deploy.py
@@ -126,17 +126,17 @@ def tg_deploy(tg: TypegraphOutput, params: TypegraphDeployParams) -> DeployResul
response = response.read().decode()
response = handle_response(response)
- if response.get("errors") is not None:
- for err in response.errors:
- Log.error(err.message)
+ if "errors" in response:
+ for err in response["errors"]:
+ Log.error(err["message"])
raise Exception(f"failed to deploy typegraph {tg.name}")
add_typegraph = response.get("data").get("addTypegraph")
"""
# FIXME: read comments in similar section of typescript
- if add_typegraph.get("failure") is not None:
- Log.error(add_typegraph.failure)
+ if "failure" in add_typegraph:
+ Log.error(add_typegraph["failure"])
raise Exception(f"failed to deploy typegraph {tg.name}") """
return DeployResult(serialized=tg_json, response=add_typegraph)
diff --git a/src/typegraph/python/typegraph/graph/tg_manage.py b/src/typegraph/python/typegraph/graph/tg_manage.py
index 1d71cd921f..d2ab111606 100644
--- a/src/typegraph/python/typegraph/graph/tg_manage.py
+++ b/src/typegraph/python/typegraph/graph/tg_manage.py
@@ -121,7 +121,16 @@ def deploy(self):
if not isinstance(response, dict):
raise Exception("unexpected")
- Log.success({"typegraph": self.typegraph.name, **response})
+ Log.success(
+ {
+ "typegraph": {
+ "name": self.typegraph.name,
+ "path": env.typegraph_path,
+ "value": ret.serialized,
+ },
+ **response,
+ }
+ )
except Exception as err:
Log.debug(traceback.format_exc())
if isinstance(err, ErrorStack):
diff --git a/src/typegraph/python/typegraph/io.py b/src/typegraph/python/typegraph/io.py
index 92bb66f384..df43374bf2 100644
--- a/src/typegraph/python/typegraph/io.py
+++ b/src/typegraph/python/typegraph/io.py
@@ -12,6 +12,22 @@
_JSONRPC_VERSION = "2.0"
+def write_rpc_message(message: str):
+ # we do not chunk the message as Python's print function supports long lines
+ print(f"jsonrpc$: {message}")
+
+
+def rpc_notify(method: str, params: Any):
+ message = json.dumps(
+ {
+ "jsonrpc": _JSONRPC_VERSION,
+ "method": method,
+ "params": params,
+ }
+ )
+ write_rpc_message(message)
+
+
class Log:
@staticmethod
def __format(*largs: Any):
@@ -19,30 +35,31 @@ def __format(*largs: Any):
@staticmethod
def debug(*largs: Any):
- print("debug:", Log.__format(*largs))
+ rpc_notify("Debug", {"message": Log.__format(*largs)})
@staticmethod
def info(*largs: Any):
- print("info:", Log.__format(*largs))
+ rpc_notify("Info", {"message": Log.__format(*largs)})
@staticmethod
def warn(*largs: Any):
- print("warning:", Log.__format(*largs))
+ rpc_notify("Warning", {"message": Log.__format(*largs)})
@staticmethod
def error(*largs: Any):
- print("error:", Log.__format(*largs))
+ rpc_notify("Error", {"message": Log.__format(*largs)})
@staticmethod
def failure(data: Any):
- print("failure:", json.dumps(data))
+ rpc_notify("Failure", {"data": data})
@staticmethod
def success(data: Any, noencode: bool = False):
if noencode:
- print("success:", data)
+ parsed = json.loads(data)
+ rpc_notify("Success", {"data": parsed})
else:
- print("success:", json.dumps(data))
+ rpc_notify("Success", {"data": data})
class _RpcResponseReader:
@@ -90,7 +107,7 @@ def call(cls, method: str, params: Any):
}
)
- print(f"jsonrpc: {rpc_message}")
+ write_rpc_message(rpc_message)
return cls.response_reader.read(rpc_id)
diff --git a/src/typegraph/python/typegraph/runtimes/deno.py b/src/typegraph/python/typegraph/runtimes/deno.py
index 99a9c7e51d..58657df4a9 100644
--- a/src/typegraph/python/typegraph/runtimes/deno.py
+++ b/src/typegraph/python/typegraph/runtimes/deno.py
@@ -159,7 +159,7 @@ def import_policy(
res = runtimes.import_deno_function(
store,
MaterializerDenoImport(
- func_name=func_name, module=module, secrets=secrets or []
+ func_name=func_name, module=module, secrets=secrets or [], deps=[]
),
EffectRead(),
)
diff --git a/src/typegraph/python/typegraph/runtimes/substantial.py b/src/typegraph/python/typegraph/runtimes/substantial.py
index 836d35ccdd..f0cb7a80c6 100644
--- a/src/typegraph/python/typegraph/runtimes/substantial.py
+++ b/src/typegraph/python/typegraph/runtimes/substantial.py
@@ -1,7 +1,7 @@
# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
# SPDX-License-Identifier: MPL-2.0
-from typing import List, Union
+from typing import List, Optional
from typegraph import t
from typegraph.gen.exports.runtimes import (
RedisBackend,
@@ -10,17 +10,17 @@
SubstantialBackendMemory,
SubstantialBackendRedis,
SubstantialOperationData,
- SubstantialOperationType,
- SubstantialOperationTypeSend,
- SubstantialOperationTypeSendRaw,
- SubstantialOperationTypeStart,
- SubstantialOperationTypeStartRaw,
- SubstantialOperationTypeStop,
- SubstantialOperationTypeResources,
- SubstantialOperationTypeResults,
- SubstantialOperationTypeResultsRaw,
- SubstantialOperationTypeInternalLinkParentChild,
+ SubstantialOperationDataInternalLinkParentChild,
+ SubstantialOperationDataResources,
+ SubstantialOperationDataResults,
+ SubstantialOperationDataResultsRaw,
+ SubstantialOperationDataSend,
+ SubstantialOperationDataSendRaw,
+ SubstantialOperationDataStart,
+ SubstantialOperationDataStartRaw,
+ SubstantialOperationDataStop,
SubstantialRuntimeData,
+ SubstantialStartData,
WorkflowFileDescription,
WorkflowKind,
)
@@ -29,17 +29,6 @@
from typegraph.wit import runtimes, store
-class Backend:
- def dev_memory():
- return SubstantialBackendMemory()
-
- def dev_fs():
- return SubstantialBackendFs()
-
- def redis(connection_string_secret: str):
- return SubstantialBackendRedis(value=RedisBackend(connection_string_secret))
-
-
class SubstantialRuntime(Runtime):
def __init__(
self,
@@ -47,62 +36,59 @@ def __init__(
file_descriptions: List[WorkflowFileDescription],
):
data = SubstantialRuntimeData(backend, file_descriptions)
- super().__init__(runtimes.register_substantial_runtime(store, data))
+ res = runtimes.register_substantial_runtime(store, data)
+ if isinstance(res, Err):
+ raise Exception(res.value)
+ super().__init__(res.value)
self.backend = backend
def _generic_substantial_func(
self,
- operation: SubstantialOperationType,
- func_arg: Union[None, "t.typedef"] = None,
- func_out: Union[None, "t.typedef"] = None,
+ data: SubstantialOperationData,
):
- data = SubstantialOperationData(
- func_arg=None if func_arg is None else func_arg._id,
- func_out=None if func_out is None else func_out._id,
- operation=operation,
- )
- func_data = runtimes.generate_substantial_operation(store, self.id.value, data)
+ func_data = runtimes.generate_substantial_operation(store, self.id, data)
if isinstance(func_data, Err):
raise Exception(func_data.value)
return t.func.from_type_func(func_data.value)
- def start(self, kwargs: "t.struct"):
- operation = SubstantialOperationTypeStart()
- return self._generic_substantial_func(operation, kwargs, None)
+ def start(self, kwargs: "t.struct", *, secrets: Optional[List[str]] = None):
+ return self._generic_substantial_func(
+ SubstantialOperationDataStart(
+ SubstantialStartData(kwargs._id, secrets or [])
+ )
+ )
- def start_raw(self):
- operation = SubstantialOperationTypeStartRaw()
- return self._generic_substantial_func(operation, None, None)
+ def start_raw(self, *, secrets: Optional[List[str]] = None):
+ return self._generic_substantial_func(
+ SubstantialOperationDataStartRaw(SubstantialStartData(None, secrets or []))
+ )
def stop(self):
- operation = SubstantialOperationTypeStop()
- return self._generic_substantial_func(operation, None, None)
+ return self._generic_substantial_func(SubstantialOperationDataStop())
def send(self, payload: "t.typedef"):
- operation = SubstantialOperationTypeSend()
- return self._generic_substantial_func(operation, payload, None)
+ return self._generic_substantial_func(SubstantialOperationDataSend(payload._id))
def send_raw(self):
- operation = SubstantialOperationTypeSendRaw()
- return self._generic_substantial_func(operation, None, None)
+ return self._generic_substantial_func(SubstantialOperationDataSendRaw())
def query_resources(self):
- operation = SubstantialOperationTypeResources()
- return self._generic_substantial_func(operation, None, None)
+ return self._generic_substantial_func(SubstantialOperationDataResources())
def query_results(self, output: "t.typedef"):
- operation = SubstantialOperationTypeResults()
- return self._generic_substantial_func(operation, None, output)
+ return self._generic_substantial_func(
+ SubstantialOperationDataResults(output._id)
+ )
def query_results_raw(self):
- operation = SubstantialOperationTypeResultsRaw()
- return self._generic_substantial_func(operation, None, None)
+ return self._generic_substantial_func(SubstantialOperationDataResultsRaw())
def _internal_link_parent_child(self):
- operation = SubstantialOperationTypeInternalLinkParentChild()
- return self._generic_substantial_func(operation, None, None)
+ return self._generic_substantial_func(
+ SubstantialOperationDataInternalLinkParentChild()
+ )
def internals(self):
return {
@@ -114,6 +100,20 @@ def internals(self):
}
+class Backend:
+ @staticmethod
+ def dev_memory():
+ return SubstantialBackendMemory()
+
+ @staticmethod
+ def dev_fs():
+ return SubstantialBackendFs()
+
+ @staticmethod
+ def redis(connection_string_secret: str):
+ return SubstantialBackendRedis(value=RedisBackend(connection_string_secret))
+
+
class WorkflowFile:
def __init__(self, file: str, kind: WorkflowKind, deps: List[str] = []):
self.file = file
diff --git a/src/xtask/Cargo.toml b/src/xtask/Cargo.toml
index da75373dd1..a792626bb1 100644
--- a/src/xtask/Cargo.toml
+++ b/src/xtask/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "xtask"
-version = "0.5.0-rc.4"
+version = "0.5.0-rc.6"
edition = "2021"
# this allows us to exclude the rust files
diff --git a/src/xtask/src/deno.rs b/src/xtask/src/deno.rs
index c757a09264..2b94b6dbc0 100644
--- a/src/xtask/src/deno.rs
+++ b/src/xtask/src/deno.rs
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
use anyhow::Result;
use clap::{Parser, Subcommand};
diff --git a/src/xtask/src/main.rs b/src/xtask/src/main.rs
index 2c2081da0f..8c0d266ffa 100644
--- a/src/xtask/src/main.rs
+++ b/src/xtask/src/main.rs
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
mod deno;
diff --git a/tests/artifacts/artifacts_test.ts b/tests/artifacts/artifacts_test.ts
index cf88e10768..17fafc273b 100644
--- a/tests/artifacts/artifacts_test.ts
+++ b/tests/artifacts/artifacts_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { join } from "@std/path/join";
diff --git a/tests/auth/auth_test.ts b/tests/auth/auth_test.ts
index 830066e01f..1ee2f7502c 100644
--- a/tests/auth/auth_test.ts
+++ b/tests/auth/auth_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals, assertStringIncludes } from "@std/assert";
import { execute, gql, Meta, sleep } from "../utils/mod.ts";
diff --git a/tests/auto/auto_test.ts_ b/tests/auto/auto_test.ts_
index 9f956d595b..ee91d22a1d 100644
--- a/tests/auto/auto_test.ts_
+++ b/tests/auto/auto_test.ts_
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dirname, fromFileUrl, join } from "std/path/mod.ts";
import { Meta } from "../utils/mod.ts";
diff --git a/tests/auto/test/test.py b/tests/auto/test/test.py
index bd655961c2..c71dccec53 100644
--- a/tests/auto/test/test.py
+++ b/tests/auto/test/test.py
@@ -1,4 +1,5 @@
-# Copyright Metatype under the Elastic License 2.0.
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import typegraph, Policy, t, Graph
from typegraph.runtimes.deno import DenoRuntime
diff --git a/tests/common_utils/proposition_test.ts b/tests/common_utils/proposition_test.ts
index fa891fb704..0d67b0b5be 100644
--- a/tests/common_utils/proposition_test.ts
+++ b/tests/common_utils/proposition_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals } from "@std/assert";
import { closestWord } from "@metatype/typegate/utils.ts";
diff --git a/tests/common_utils/url_test.ts b/tests/common_utils/url_test.ts
index 85f8892759..b9917e9b3f 100644
--- a/tests/common_utils/url_test.ts
+++ b/tests/common_utils/url_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals } from "@std/assert";
import { createUrl } from "@metatype/typegate/utils.ts";
diff --git a/tests/crypto/crypto_test.ts b/tests/crypto/crypto_test.ts
index a77acc2472..fe794b1763 100644
--- a/tests/crypto/crypto_test.ts
+++ b/tests/crypto/crypto_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
defaultTypegateConfigBase,
diff --git a/tests/dedup/tg.ts b/tests/dedup/tg.ts
index 19aaa2eec6..fcc495725c 100644
--- a/tests/dedup/tg.ts
+++ b/tests/dedup/tg.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";
diff --git a/tests/docs/how-tos/prog_deploy/prog_deploy.ts b/tests/docs/how-tos/prog_deploy/prog_deploy.ts
index e19234d1e8..2f58409edf 100644
--- a/tests/docs/how-tos/prog_deploy/prog_deploy.ts
+++ b/tests/docs/how-tos/prog_deploy/prog_deploy.ts
@@ -1,6 +1,6 @@
// skip:start
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// skip:end
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
diff --git a/tests/docs/how-tos/prog_deploy/prog_deploy_test.ts b/tests/docs/how-tos/prog_deploy/prog_deploy_test.ts
index e9f11bdbee..b771a9fa29 100644
--- a/tests/docs/how-tos/prog_deploy/prog_deploy_test.ts
+++ b/tests/docs/how-tos/prog_deploy/prog_deploy_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { MetaTest } from "../../../utils/test.ts";
diff --git a/tests/docs/how-tos/prog_deploy/prog_remove.ts b/tests/docs/how-tos/prog_deploy/prog_remove.ts
index 7fdd936ae6..244aa5aa82 100644
--- a/tests/docs/how-tos/prog_deploy/prog_remove.ts
+++ b/tests/docs/how-tos/prog_deploy/prog_remove.ts
@@ -1,6 +1,6 @@
// skip:start
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// skip:end
import { typegraph } from "@typegraph/sdk/index.ts";
diff --git a/tests/docs/how-tos/prog_deploy/scripts/say_hello.ts b/tests/docs/how-tos/prog_deploy/scripts/say_hello.ts
index 620c7b8971..35e84061e2 100644
--- a/tests/docs/how-tos/prog_deploy/scripts/say_hello.ts
+++ b/tests/docs/how-tos/prog_deploy/scripts/say_hello.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function sayHello() {
return "Hell0";
diff --git a/tests/e2e/cli/artifacts/ops.ts b/tests/e2e/cli/artifacts/ops.ts
new file mode 100644
index 0000000000..cbd08ebe39
--- /dev/null
+++ b/tests/e2e/cli/artifacts/ops.ts
@@ -0,0 +1,3 @@
+export function add({ lhs, rhs }: { lhs: number; rhs: number }) {
+ return lhs + rhs;
+}
diff --git a/tests/e2e/cli/deploy_test.ts b/tests/e2e/cli/deploy_test.ts
index e45312c34a..18f783487e 100644
--- a/tests/e2e/cli/deploy_test.ts
+++ b/tests/e2e/cli/deploy_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
import { TestModule } from "../../utils/test_module.ts";
diff --git a/tests/e2e/cli/dev_test.ts b/tests/e2e/cli/dev_test.ts
index b55555bd34..245ae1838b 100644
--- a/tests/e2e/cli/dev_test.ts
+++ b/tests/e2e/cli/dev_test.ts
@@ -1,13 +1,21 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
-import { gql, Meta } from "test-utils/mod.ts";
+import { gql, Meta, sleep } from "test-utils/mod.ts";
import { join, resolve } from "@std/path";
import { assert, assertEquals, assertRejects } from "@std/assert";
import { randomSchema, reset } from "test-utils/database.ts";
import { TestModule } from "test-utils/test_module.ts";
import { $ } from "@david/dax";
-import { killProcess, Lines, LineWriter } from "../../utils/process.ts";
+import {
+ termProcess,
+ Lines,
+ LineWriter,
+ enumerateAllChildUNIX,
+ isPIDAliveUNIX,
+ killProcess,
+ ctrlcProcess,
+} from "../../utils/process.ts";
import { workspaceDir } from "../../utils/dir.ts";
const m = new TestModule(import.meta);
@@ -24,7 +32,7 @@ const tgName = `migration-failure-test-${testCode}`;
async function writeTypegraph(
version: number | null,
- target = `migration_${testCode}.py`,
+ target = `migration_${testCode}.py`
) {
if (version == null) {
await m.shell([
@@ -81,13 +89,13 @@ Meta.test(
t.addCleanup(async () => {
await stderr.close();
await stdin.close();
- await killProcess(metadev);
+ await termProcess(metadev);
});
await stderr.readWhile((line) => {
// console.log("meta dev>", line);
return !$.stripAnsi(line).includes(
- `successfully deployed typegraph ${tgName} from migration.py`,
+ `successfully deployed typegraph ${tgName} from migration.py`
);
});
@@ -124,7 +132,7 @@ Meta.test(
await stderr.readWhile((line) => {
// console.log("meta dev>", line);
return !$.stripAnsi(line).includes(
- `successfully deployed typegraph ${tgName}`,
+ `successfully deployed typegraph ${tgName}`
);
});
@@ -146,7 +154,7 @@ Meta.test(
})
.on(e);
});
- },
+ }
);
async function listSubdirs(path: string): Promise {
@@ -202,13 +210,13 @@ Meta.test(
t.addCleanup(async () => {
await stderr.close();
await stdin.close();
- await killProcess(metadev);
+ await termProcess(metadev);
});
await stderr.readWhile((line) => {
console.log("line:", line);
return !$.stripAnsi(line).includes(
- `successfully deployed typegraph ${tgName}`,
+ `successfully deployed typegraph ${tgName}`
);
});
@@ -239,7 +247,7 @@ Meta.test(
const migrationsDir = resolve(
t.workingDir,
"prisma-migrations",
- `${tgName}/main`,
+ `${tgName}/main`
);
console.log("Typegate migration dir", migrationsDir);
@@ -263,114 +271,145 @@ Meta.test(
await t.should("have removed latest migration", async () => {
assert((await listSubdirs(migrationsDir)).length === 1);
});
- },
+ }
);
const examplesDir = $.path(workspaceDir).join("examples");
-Meta.test({
- name: "meta dev with typegate",
-}, async (t) => {
- await $`bash build.sh`.cwd(examplesDir.join("typegraphs/metagen/rs"));
-
- const metadev = new Deno.Command("meta-full", {
- cwd: examplesDir.toString(),
- args: [
- "dev",
- `--main-url`,
- import.meta.resolve("../../../src/typegate/src/main.ts"),
- `--import-map-url`,
- import.meta.resolve("../../../import_map.json"),
- `--gate=http://localhost:0`,
- ],
- stdout: "piped",
- stderr: "piped",
- env: {
- MCLI_LOADER_CMD: "deno run -A --config deno.jsonc",
- },
- }).spawn();
- const stderr = new Lines(metadev.stderr);
- const stdout = new Lines(metadev.stdout);
- t.addCleanup(async () => {
- await stderr.close();
- await stdout.close();
- // FIXME: it still leaks the child typegate process even
- // though we the cli has a ctrl_c handler
- metadev.kill("SIGTERM");
- await metadev.status;
- });
- const deployed: [string, string][] = [];
-
- console.log(new Date());
- stdout.readWhile((line) => {
- console.log("meta-full dev>", line);
- return true;
- }, null);
-
- await stderr.readWhile((rawLine) => {
- const line = $.stripAnsi(rawLine);
- console.log("meta-full dev[E]>", line);
- if (line.match(/failed to deploy/i)) {
- throw new Error("error detected on line: " + rawLine);
- }
- const match = line.match(
- /successfully deployed typegraph ([\w_-]+) from (.+)$/,
- );
- if (match) {
- const prefix = "typegraphs/";
- if (!match[2].startsWith(prefix)) {
- throw new Error("unexpected");
+Meta.test(
+ {
+ name: "meta dev with typegate",
+ },
+ async (t) => {
+ await $`bash build.sh`.cwd(examplesDir.join("typegraphs/metagen/rs"));
+
+ const metadev = new Deno.Command("meta-full", {
+ cwd: examplesDir.toString(),
+ args: [
+ "dev",
+ `--main-url`,
+ import.meta.resolve("../../../src/typegate/src/main.ts"),
+ `--import-map-url`,
+ import.meta.resolve("../../../import_map.json"),
+ `--gate=http://localhost:0`,
+ ],
+ stdout: "piped",
+ stderr: "piped",
+ stdin: "piped",
+ env: {
+ MCLI_LOADER_CMD: "deno run -A --config deno.jsonc",
+ },
+ }).spawn();
+ const stderr = new Lines(metadev.stderr);
+ const stdout = new Lines(metadev.stdout);
+
+ const deployed: [string, string][] = [];
+
+ console.log(new Date());
+ stdout.readWhile((line) => {
+ console.log("meta-full dev>", line);
+ return true;
+ }, null);
+
+ await stderr.readWhile((rawLine) => {
+ const line = $.stripAnsi(rawLine);
+ console.log("meta-full dev[E]>", line);
+ if (line.match(/failed to deploy/i)) {
+ throw new Error("error detected on line: " + rawLine);
}
- deployed.push([match[2].slice(prefix.length), match[1]]);
- }
- return deployed.length < 42;
- }, 3 * 60 * 1000);
-
- await t.should("have deployed all the typegraphs", () => {
- // TODO use `meta list`
- assertEquals(deployed.sort(), [
- ["authentication.ts", "authentication"],
- ["backend-for-frontend.ts", "backend-for-frontend"],
- ["basic.ts", "basic-authentication"],
- ["cors.ts", "cors"],
- ["database.ts", "database"],
- ["deno.ts", "deno"],
- ["example_rest.ts", "example-rest"],
- ["execute.ts", "roadmap-execute"],
- ["faas-runner.ts", "faas-runner"],
- ["files-upload.ts", "files-upload"],
- ["first-typegraph.ts", "first-typegraph"],
- ["func-ctx.ts", "func-ctx"],
- ["func-gql.ts", "func-gql"],
- ["func.ts", "roadmap-func"],
- ["graphql-server.ts", "graphql-server"],
- ["graphql.ts", "graphql"],
- ["grpc.ts", "grpc"],
- ["http-runtime.ts", "http-runtime"],
- ["iam-provider.ts", "iam-provider"],
- ["index.ts", "homepage"],
- ["injections.ts", "injection-example"],
- ["jwt.ts", "jwt-authentication"],
- ["math.ts", "math"],
- ["metagen-deno.ts", "metagen-deno"],
- ["metagen-py.ts", "metagen-py"],
- ["metagen-rs.ts", "metagen-rs"],
- ["metagen-sdk.ts", "metagen-sdk"],
- ["microservice-orchestration.ts", "team-a"],
- ["microservice-orchestration.ts", "team-b"],
- ["oauth2.ts", "oauth2-authentication"],
- ["policies.ts", "policies"],
- ["prisma-runtime.ts", "prisma-runtime"],
- ["prisma.ts", "roadmap-prisma"],
- ["programmable-api-gateway.ts", "programmable-api-gateway"],
- ["quick-start-project.ts", "quick-start-project"],
- ["random-field.ts", "random-field"],
- ["rate.ts", "rate"],
- ["reduce.ts", "roadmap-reduce"],
- ["rest.ts", "roadmap-rest"],
- ["roadmap-policies.ts", "roadmap-policies"],
- ["roadmap-random.ts", "roadmap-random"],
- ["triggers.ts", "triggers"],
- ]);
- });
-});
+ const match = line.match(
+ /successfully deployed typegraph ([\w_-]+) from (.+)$/
+ );
+ if (match) {
+ const prefix = "typegraphs/";
+ if (!match[2].startsWith(prefix)) {
+ throw new Error("unexpected");
+ }
+ deployed.push([match[2].slice(prefix.length), match[1]]);
+ }
+ return deployed.length < 42;
+ }, 3 * 60 * 1000);
+
+ await t.should("have deployed all the typegraphs", () => {
+ // TODO use `meta list`
+ assertEquals(deployed.sort(), [
+ ["authentication.ts", "authentication"],
+ ["backend-for-frontend.ts", "backend-for-frontend"],
+ ["basic.ts", "basic-authentication"],
+ ["cors.ts", "cors"],
+ ["database.ts", "database"],
+ ["deno.ts", "deno"],
+ ["example_rest.ts", "example-rest"],
+ ["execute.ts", "roadmap-execute"],
+ ["faas-runner.ts", "faas-runner"],
+ ["files-upload.ts", "files-upload"],
+ ["first-typegraph.ts", "first-typegraph"],
+ ["func-ctx.ts", "func-ctx"],
+ ["func-gql.ts", "func-gql"],
+ ["func.ts", "roadmap-func"],
+ ["graphql-server.ts", "graphql-server"],
+ ["graphql.ts", "graphql"],
+ ["grpc.ts", "grpc"],
+ ["http-runtime.ts", "http-runtime"],
+ ["iam-provider.ts", "iam-provider"],
+ ["index.ts", "homepage"],
+ ["injections.ts", "injection-example"],
+ ["jwt.ts", "jwt-authentication"],
+ ["math.ts", "math"],
+ ["metagen-deno.ts", "metagen-deno"],
+ ["metagen-py.ts", "metagen-py"],
+ ["metagen-rs.ts", "metagen-rs"],
+ ["metagen-sdk.ts", "metagen-sdk"],
+ ["microservice-orchestration.ts", "team-a"],
+ ["microservice-orchestration.ts", "team-b"],
+ ["oauth2.ts", "oauth2-authentication"],
+ ["policies.ts", "policies"],
+ ["prisma-runtime.ts", "prisma-runtime"],
+ ["prisma.ts", "roadmap-prisma"],
+ ["programmable-api-gateway.ts", "programmable-api-gateway"],
+ ["quick-start-project.ts", "quick-start-project"],
+ ["random-field.ts", "random-field"],
+ ["rate.ts", "rate"],
+ ["reduce.ts", "roadmap-reduce"],
+ ["rest.ts", "roadmap-rest"],
+ ["roadmap-policies.ts", "roadmap-policies"],
+ ["roadmap-random.ts", "roadmap-random"],
+ ["triggers.ts", "triggers"],
+ ]);
+ });
+
+ await t.should("kill meta-full process", async () => {
+ const parentPID = metadev.pid;
+ console.log("meta-full PID", parentPID);
+
+ await metadev.stdin.close();
+ await stdout.close();
+ await stderr.close();
+
+ const childrenPIDs = await enumerateAllChildUNIX(parentPID);
+ console.log("children", childrenPIDs);
+
+ // FIXME: SIGTERM not working in tests
+ // Also tried a manual kill -SIGTERM PID_THIS_META_FULL, same issue.
+ // But it will work with "./target/debug/meta dev" or "cargo run --features typegate -p meta-cli -- dev"
+ // await termProcess(metadev);
+
+ await ctrlcProcess(metadev);
+
+ // No handle for the children status
+ // This is the simplest way to get around it
+ await sleep(10000);
+ assert(
+ (await isPIDAliveUNIX(parentPID)) == false,
+ `Parent ${parentPID} should be cleaned up`
+ );
+
+ for (const child of childrenPIDs) {
+ assert(
+ (await isPIDAliveUNIX(child)) == false,
+ `Child PID ${child} should be cleaned up`
+ );
+ }
+ });
+ }
+);
diff --git a/tests/e2e/cli/typegraphs/deps.ts b/tests/e2e/cli/typegraphs/deps.ts
new file mode 100644
index 0000000000..b5b9472d5c
--- /dev/null
+++ b/tests/e2e/cli/typegraphs/deps.ts
@@ -0,0 +1,19 @@
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
+
+await typegraph("deps", (g) => {
+ const pub = Policy.public();
+ const deno = new DenoRuntime();
+
+ g.expose({
+ add: deno
+ .import(t.struct({ lhs: t.integer(), rhs: t.integer() }), t.integer(), {
+ name: "add",
+ module: "../deps/ops.ts",
+ })
+ .withPolicy(pub),
+ });
+});
diff --git a/tests/e2e/cli/undeploy_test.ts b/tests/e2e/cli/undeploy_test.ts
index 2a2494f2df..7fb63a9f66 100644
--- a/tests/e2e/cli/undeploy_test.ts
+++ b/tests/e2e/cli/undeploy_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { TestModule } from "test-utils/test_module.ts";
diff --git a/tests/e2e/cli/watch_test.ts b/tests/e2e/cli/watch_test.ts
new file mode 100644
index 0000000000..e0c58c7b9d
--- /dev/null
+++ b/tests/e2e/cli/watch_test.ts
@@ -0,0 +1,76 @@
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
+
+import * as path from "@std/path";
+import { Meta } from "test-utils/mod.ts";
+import { MetaTest } from "test-utils/test.ts";
+import { killProcess, Lines } from "test-utils/process.ts";
+
+const typegraphConfig = `
+typegraphs:
+ typescript:
+ include: "api/example.ts"`;
+
+async function setupDirectory(t: MetaTest, dir: string) {
+ await t.shell([
+ "bash",
+ "-c",
+ `
+ rm -rf ./tmp && mkdir -p tmp/deps
+ meta new --template deno ${dir}
+ cp ./e2e/cli/typegraphs/deps.ts ${path.join(dir, "api", "example.ts")}
+ cp ./e2e/cli/artifacts/ops.ts ${path.join(dir, "deps", "ops.ts")}
+ echo "${typegraphConfig}" >> ${path.join(dir, "metatype.yaml")}
+ `,
+ ]);
+}
+
+Meta.test({ name: "meta dev: watch artifacts" }, async (t) => {
+ const targetDir = path.join(t.workingDir, "tmp");
+
+ console.log("Preparing test directory...");
+
+ await setupDirectory(t, targetDir);
+
+ const metadev = new Deno.Command("meta", {
+ cwd: targetDir,
+ args: ["dev", `--gate=http://localhost:${t.port}`],
+ stderr: "piped",
+ }).spawn();
+
+ const stderr = new Lines(metadev.stderr);
+
+ await t.should("upload artifact", async () => {
+ await stderr.readWhile((line) => !line.includes("artifact uploaded"));
+ });
+
+ await t.should("deploy typegraph", async () => {
+ await stderr.readWhile(
+ (line) => !line.includes("successfully deployed typegraph")
+ );
+ });
+
+ await t.shell(["bash", "-c", "echo '' >> deps/ops.ts"], {
+ currentDir: targetDir,
+ });
+
+ await t.should("watch modified file", async () => {
+ await stderr.readWhile((line) => !line.includes("File modified"));
+ });
+
+ await t.should("re-upload artifact", async () => {
+ await stderr.readWhile((line) => !line.includes("artifact uploaded"));
+ });
+
+ await t.should("re-deploy typegraph", async () => {
+ await stderr.readWhile(
+ (line) => !line.includes("successfully deployed typegraph")
+ );
+ });
+
+ t.addCleanup(async () => {
+ await stderr.close();
+ await killProcess(metadev);
+ await t.shell(["rm", "-rf", targetDir]);
+ });
+});
diff --git a/tests/e2e/nextjs/apollo/pages/api/apollo.ts b/tests/e2e/nextjs/apollo/pages/api/apollo.ts
index 918934cbf1..098ffa0411 100644
--- a/tests/e2e/nextjs/apollo/pages/api/apollo.ts
+++ b/tests/e2e/nextjs/apollo/pages/api/apollo.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { NextApiRequest, NextApiResponse } from "next";
import { ApolloClient, gql, InMemoryCache } from "@apollo/client/index";
diff --git a/tests/e2e/nextjs/apollo/tailwind.config.ts b/tests/e2e/nextjs/apollo/tailwind.config.ts
index ee2151538d..e82281f92c 100644
--- a/tests/e2e/nextjs/apollo/tailwind.config.ts
+++ b/tests/e2e/nextjs/apollo/tailwind.config.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { Config } from "tailwindcss";
diff --git a/tests/e2e/nextjs/apollo_test.ts b/tests/e2e/nextjs/apollo_test.ts
index fd7437109f..4021afb168 100644
--- a/tests/e2e/nextjs/apollo_test.ts
+++ b/tests/e2e/nextjs/apollo_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "../../utils/mod.ts";
import {
diff --git a/tests/e2e/published/published_test.ts b/tests/e2e/published/published_test.ts
index 338a70c0c4..e7f6092cb1 100644
--- a/tests/e2e/published/published_test.ts
+++ b/tests/e2e/published/published_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { projectDir } from "@local/tools/utils.ts";
diff --git a/tests/e2e/self_deploy/scripts/main.ts b/tests/e2e/self_deploy/scripts/main.ts
index fb47d1a825..c1a6b3126f 100644
--- a/tests/e2e/self_deploy/scripts/main.ts
+++ b/tests/e2e/self_deploy/scripts/main.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function sayHello({ name }: any) {
return `Hello ${name}`;
diff --git a/tests/e2e/self_deploy/self_deploy.ts b/tests/e2e/self_deploy/self_deploy.ts
index 72c085184c..c039be3c09 100644
--- a/tests/e2e/self_deploy/self_deploy.ts
+++ b/tests/e2e/self_deploy/self_deploy.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/e2e/self_deploy/self_deploy_test.ts b/tests/e2e/self_deploy/self_deploy_test.ts
index 933cee8668..2361ad0a32 100644
--- a/tests/e2e/self_deploy/self_deploy_test.ts
+++ b/tests/e2e/self_deploy/self_deploy_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { BasicAuth, tgDeploy, tgRemove } from "@typegraph/sdk/tg_deploy.ts";
import { Meta } from "test-utils/mod.ts";
diff --git a/tests/e2e/templates/templates_test.ts b/tests/e2e/templates/templates_test.ts
index b7f2760fa8..1de81e336a 100644
--- a/tests/e2e/templates/templates_test.ts
+++ b/tests/e2e/templates/templates_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { newTempDir, workspaceDir } from "test-utils/dir.ts";
diff --git a/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap b/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap
index 2f6d86db09..555023cea5 100644
--- a/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap
+++ b/tests/e2e/typegraph/__snapshots__/typegraph_test.ts.snap
@@ -654,8 +654,8 @@ snapshot[`typegraphs creation 3`] = `
"artifacts": {
"scripts/three.ts": {
"path": "scripts/three.ts",
- "hash": "564fe4792102c50aac9801faeb3c6402c49b1f7c7cbb22dc6d54886e45cfa3b2",
- "size": 307
+ "hash": "16352d61551cb6d6a8c54efb8179858a4aadb1110517a8dbbf9932a5d71bb51a",
+ "size": 318
}
}
}
@@ -1317,8 +1317,8 @@ snapshot[`typegraphs creation 6`] = `
"artifacts": {
"scripts/three.ts": {
"path": "scripts/three.ts",
- "hash": "564fe4792102c50aac9801faeb3c6402c49b1f7c7cbb22dc6d54886e45cfa3b2",
- "size": 307
+ "hash": "16352d61551cb6d6a8c54efb8179858a4aadb1110517a8dbbf9932a5d71bb51a",
+ "size": 318
}
}
}
diff --git a/tests/e2e/typegraph/typegraph_test.ts b/tests/e2e/typegraph/typegraph_test.ts
index 203cdce594..174b361f3e 100644
--- a/tests/e2e/typegraph/typegraph_test.ts
+++ b/tests/e2e/typegraph/typegraph_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { expandGlob } from "@std/fs/expand-glob";
import { dirname, fromFileUrl } from "@std/path";
diff --git a/tests/e2e/typegraph/typegraphs/deno/complex.ts b/tests/e2e/typegraph/typegraphs/deno/complex.ts
index b72fefd211..12cb5c0ced 100644
--- a/tests/e2e/typegraph/typegraphs/deno/complex.ts
+++ b/tests/e2e/typegraph/typegraphs/deno/complex.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fx, Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/e2e/typegraph/typegraphs/deno/multiple_runtimes.ts b/tests/e2e/typegraph/typegraphs/deno/multiple_runtimes.ts
index 965492d8f8..656c075689 100644
--- a/tests/e2e/typegraph/typegraphs/deno/multiple_runtimes.ts
+++ b/tests/e2e/typegraph/typegraphs/deno/multiple_runtimes.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/e2e/typegraph/typegraphs/deno/scripts/three.ts b/tests/e2e/typegraph/typegraphs/deno/scripts/three.ts
index c47af049a1..9f1c8a9005 100644
--- a/tests/e2e/typegraph/typegraphs/deno/scripts/three.ts
+++ b/tests/e2e/typegraph/typegraphs/deno/scripts/three.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
interface ThreeInput {
b: number;
diff --git a/tests/e2e/typegraph/typegraphs/deno/simple.ts b/tests/e2e/typegraph/typegraphs/deno/simple.ts
index 866c26a154..6f86e40797 100644
--- a/tests/e2e/typegraph/typegraphs/deno/simple.ts
+++ b/tests/e2e/typegraph/typegraphs/deno/simple.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/e2e/typegraph/typegraphs/python/scripts/three.ts b/tests/e2e/typegraph/typegraphs/python/scripts/three.ts
index c47af049a1..9f1c8a9005 100644
--- a/tests/e2e/typegraph/typegraphs/python/scripts/three.ts
+++ b/tests/e2e/typegraph/typegraphs/python/scripts/three.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
interface ThreeInput {
b: number;
diff --git a/tests/e2e/typegraph/validator_test.ts b/tests/e2e/typegraph/validator_test.ts
index b86a816488..6ddf7e2428 100644
--- a/tests/e2e/typegraph/validator_test.ts
+++ b/tests/e2e/typegraph/validator_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { TestModule } from "test-utils/test_module.ts";
import { Meta } from "test-utils/mod.ts";
diff --git a/tests/e2e/website/website_test.ts b/tests/e2e/website/website_test.ts
index 665fdf0f0c..fedb6c0b12 100644
--- a/tests/e2e/website/website_test.ts
+++ b/tests/e2e/website/website_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { expandGlob } from "@std/fs/expand-glob";
import { basename, dirname, fromFileUrl, join } from "@std/path";
diff --git a/tests/graphql/graphql_test.ts b/tests/graphql/graphql_test.ts
index 67d6583b25..efc9b90663 100644
--- a/tests/graphql/graphql_test.ts
+++ b/tests/graphql/graphql_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/graphql/request_parser_test.ts b/tests/graphql/request_parser_test.ts
index eff6a8c7f0..997312038b 100644
--- a/tests/graphql/request_parser_test.ts
+++ b/tests/graphql/request_parser_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { FormDataParser } from "@metatype/typegate/transports/graphql/request_parser.ts";
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/http_utils/http_utils_test.ts b/tests/http_utils/http_utils_test.ts
index 8c157d8286..2bd76dab7f 100644
--- a/tests/http_utils/http_utils_test.ts
+++ b/tests/http_utils/http_utils_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals } from "@std/assert";
import { replaceDynamicPathParams } from "@metatype/typegate/runtimes/utils/http.ts";
diff --git a/tests/importers/importers_test.ts.disabled b/tests/importers/importers_test.ts.disabled
index ccac4cdf81..ee87b91ab5 100644
--- a/tests/importers/importers_test.ts.disabled
+++ b/tests/importers/importers_test.ts.disabled
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { copyFile, gql, Meta } from "../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/injection/injection.ts b/tests/injection/injection.ts
index 42cabf36e0..fc8bceebc9 100644
--- a/tests/injection/injection.ts
+++ b/tests/injection/injection.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { CREATE, DELETE, READ, UPDATE } from "@typegraph/sdk/effects.ts";
diff --git a/tests/injection/injection_test.ts b/tests/injection/injection_test.ts
index 8831ebad1f..9612b7222d 100644
--- a/tests/injection/injection_test.ts
+++ b/tests/injection/injection_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import { assertRejects } from "@std/assert";
diff --git a/tests/injection/random_injection.ts b/tests/injection/random_injection.ts
index dec1a051e0..2033b1eb81 100644
--- a/tests/injection/random_injection.ts
+++ b/tests/injection/random_injection.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/injection/random_injection_test.ts b/tests/injection/random_injection_test.ts
index 285ae8ff93..93061d16c4 100644
--- a/tests/injection/random_injection_test.ts
+++ b/tests/injection/random_injection_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/internal/internal_test.ts b/tests/internal/internal_test.ts
index 73643c224b..63aedcacce 100644
--- a/tests/internal/internal_test.ts
+++ b/tests/internal/internal_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import { join } from "@std/path/join";
diff --git a/tests/internal/py/logic.py b/tests/internal/py/logic.py
index c8ea39393c..f5d37da715 100644
--- a/tests/internal/py/logic.py
+++ b/tests/internal/py/logic.py
@@ -1,5 +1,5 @@
-# Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-# SPDX-License-Identifier: Elastic-2.0
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from .logic_types import Ctx
import json
diff --git a/tests/internal/ts/logic.ts b/tests/internal/ts/logic.ts
index 607b1e6b27..541b7e2333 100644
--- a/tests/internal/ts/logic.ts
+++ b/tests/internal/ts/logic.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export const remoteSum = async (
{ first, second }: any,
diff --git a/tests/introspection/introspection_test.ts b/tests/introspection/introspection_test.ts
index 2bb2212c87..5a7f8cea88 100644
--- a/tests/introspection/introspection_test.ts
+++ b/tests/introspection/introspection_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/introspection/union_either_test.ts b/tests/introspection/union_either_test.ts
index b1381ec320..38f0150257 100644
--- a/tests/introspection/union_either_test.ts
+++ b/tests/introspection/union_either_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/metagen/__snapshots__/metagen_test.ts.snap b/tests/metagen/__snapshots__/metagen_test.ts.snap
index 63a65f5e2b..8631459cdf 100644
--- a/tests/metagen/__snapshots__/metagen_test.ts.snap
+++ b/tests/metagen/__snapshots__/metagen_test.ts.snap
@@ -448,7 +448,7 @@ impl Router {
}
pub fn init(&self, args: InitArgs) -> Result {
- static MT_VERSION: &str = "0.5.0-rc.4";
+ static MT_VERSION: &str = "0.5.0-rc.6";
if args.metatype_version != MT_VERSION {
return Err(InitError::VersionMismatch(MT_VERSION.into()));
}
@@ -1254,7 +1254,7 @@ impl Router {
}
pub fn init(&self, args: InitArgs) -> Result {
- static MT_VERSION: &str = "0.5.0-rc.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/tests/metagen/metagen_test.ts b/tests/metagen/metagen_test.ts
index 12ad310f80..59f16ed76e 100644
--- a/tests/metagen/metagen_test.ts
+++ b/tests/metagen/metagen_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { join } from "@std/path/join";
diff --git a/tests/metagen/typegraphs/identities/rs/lib.rs b/tests/metagen/typegraphs/identities/rs/lib.rs
index 0214d4a872..ac085da35b 100644
--- a/tests/metagen/typegraphs/identities/rs/lib.rs
+++ b/tests/metagen/typegraphs/identities/rs/lib.rs
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
mod fdk;
pub use fdk::*;
diff --git a/tests/metagen/typegraphs/identities/ts/handlers.ts b/tests/metagen/typegraphs/identities/ts/handlers.ts
index 3f9fad44c9..34e9c92c19 100644
--- a/tests/metagen/typegraphs/identities/ts/handlers.ts
+++ b/tests/metagen/typegraphs/identities/ts/handlers.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type {
Composites,
diff --git a/tests/metagen/typegraphs/metagen.ts b/tests/metagen/typegraphs/metagen.ts
index 6f2b34d66a..82f82958b2 100644
--- a/tests/metagen/typegraphs/metagen.ts
+++ b/tests/metagen/typegraphs/metagen.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
diff --git a/tests/metagen/typegraphs/sample.ts b/tests/metagen/typegraphs/sample.ts
index 1ab9422a47..2699b7373f 100644
--- a/tests/metagen/typegraphs/sample.ts
+++ b/tests/metagen/typegraphs/sample.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fx, Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/metagen/typegraphs/sample/py/client.py b/tests/metagen/typegraphs/sample/py/client.py
index 10a2eb34dc..935d695e9a 100644
--- a/tests/metagen/typegraphs/sample/py/client.py
+++ b/tests/metagen/typegraphs/sample/py/client.py
@@ -608,7 +608,7 @@ class NodeDescs:
@staticmethod
def scalar():
return NodeMeta()
-
+
@staticmethod
def Post():
return NodeMeta(
@@ -736,29 +736,42 @@ def RootMixedUnionFn():
},
)
+
UserIdStringUuid = str
PostSlugString = str
-Post = typing.TypedDict("Post", {
- "id": UserIdStringUuid,
- "slug": PostSlugString,
- "title": PostSlugString,
-}, total=False)
-
-RootCompositeArgsFnInput = typing.TypedDict("RootCompositeArgsFnInput", {
- "id": PostSlugString,
-}, total=False)
+Post = typing.TypedDict(
+ "Post",
+ {
+ "id": UserIdStringUuid,
+ "slug": PostSlugString,
+ "title": PostSlugString,
+ },
+ total=False,
+)
+
+RootCompositeArgsFnInput = typing.TypedDict(
+ "RootCompositeArgsFnInput",
+ {
+ "id": PostSlugString,
+ },
+ total=False,
+)
UserEmailStringEmail = str
UserPostsPostList = typing.List[Post]
-User = typing.TypedDict("User", {
- "id": UserIdStringUuid,
- "email": UserEmailStringEmail,
- "posts": UserPostsPostList,
-}, total=False)
+User = typing.TypedDict(
+ "User",
+ {
+ "id": UserIdStringUuid,
+ "email": UserEmailStringEmail,
+ "posts": UserPostsPostList,
+ },
+ total=False,
+)
RootScalarUnionFnOutputT1Integer = int
@@ -782,111 +795,140 @@ def RootMixedUnionFn():
]
-
-PostSelections = typing.TypedDict("PostSelections", {
- "_": SelectionFlags,
- "id": ScalarSelectNoArgs,
- "slug": ScalarSelectNoArgs,
- "title": ScalarSelectNoArgs,
-}, total=False)
-
-UserSelections = typing.TypedDict("UserSelections", {
- "_": SelectionFlags,
- "id": ScalarSelectNoArgs,
- "email": ScalarSelectNoArgs,
- "posts": CompositeSelectNoArgs["PostSelections"],
-}, total=False)
-
-RootCompositeUnionFnOutputSelections = typing.TypedDict("RootCompositeUnionFnOutputSelections", {
- "_": SelectionFlags,
- "post": CompositeSelectNoArgs["PostSelections"],
- "user": CompositeSelectNoArgs["UserSelections"],
-}, total=False)
-
-RootMixedUnionFnOutputSelections = typing.TypedDict("RootMixedUnionFnOutputSelections", {
- "_": SelectionFlags,
- "post": CompositeSelectNoArgs["PostSelections"],
- "user": CompositeSelectNoArgs["UserSelections"],
-}, total=False)
+PostSelections = typing.TypedDict(
+ "PostSelections",
+ {
+ "_": SelectionFlags,
+ "id": ScalarSelectNoArgs,
+ "slug": ScalarSelectNoArgs,
+ "title": ScalarSelectNoArgs,
+ },
+ total=False,
+)
+
+UserSelections = typing.TypedDict(
+ "UserSelections",
+ {
+ "_": SelectionFlags,
+ "id": ScalarSelectNoArgs,
+ "email": ScalarSelectNoArgs,
+ "posts": CompositeSelectNoArgs["PostSelections"],
+ },
+ total=False,
+)
+
+RootCompositeUnionFnOutputSelections = typing.TypedDict(
+ "RootCompositeUnionFnOutputSelections",
+ {
+ "_": SelectionFlags,
+ "post": CompositeSelectNoArgs["PostSelections"],
+ "user": CompositeSelectNoArgs["UserSelections"],
+ },
+ total=False,
+)
+
+RootMixedUnionFnOutputSelections = typing.TypedDict(
+ "RootMixedUnionFnOutputSelections",
+ {
+ "_": SelectionFlags,
+ "post": CompositeSelectNoArgs["PostSelections"],
+ "user": CompositeSelectNoArgs["UserSelections"],
+ },
+ total=False,
+)
class QueryGraph(QueryGraphBase):
def __init__(self):
- super().__init__({
- "UserIdStringUuid": "String!",
- "PostSlugString": "String!",
- "post": "post!",
- "user": "user!",
- })
-
+ super().__init__(
+ {
+ "UserIdStringUuid": "String!",
+ "PostSlugString": "String!",
+ "post": "post!",
+ "user": "user!",
+ }
+ )
+
def get_user(self, select: UserSelections) -> QueryNode[User]:
node = selection_to_nodes(
- {"getUser": select},
- {"getUser": NodeDescs.RootGetUserFn},
- "$q"
+ {"getUser": select}, {"getUser": NodeDescs.RootGetUserFn}, "$q"
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
def get_posts(self, select: PostSelections) -> QueryNode[Post]:
node = selection_to_nodes(
- {"getPosts": select},
- {"getPosts": NodeDescs.RootGetPostsFn},
- "$q"
+ {"getPosts": select}, {"getPosts": NodeDescs.RootGetPostsFn}, "$q"
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
def scalar_no_args(self) -> QueryNode[PostSlugString]:
node = selection_to_nodes(
- {"scalarNoArgs": True},
- {"scalarNoArgs": NodeDescs.RootScalarNoArgsFn},
- "$q"
+ {"scalarNoArgs": True}, {"scalarNoArgs": NodeDescs.RootScalarNoArgsFn}, "$q"
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
- def scalar_args(self, args: typing.Union[Post, PlaceholderArgs]) -> MutationNode[PostSlugString]:
+ def scalar_args(
+ self, args: typing.Union[Post, PlaceholderArgs]
+ ) -> MutationNode[PostSlugString]:
node = selection_to_nodes(
- {"scalarArgs": args},
- {"scalarArgs": NodeDescs.RootScalarArgsFn},
- "$q"
+ {"scalarArgs": args}, {"scalarArgs": NodeDescs.RootScalarArgsFn}, "$q"
)[0]
- return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
+ return MutationNode(
+ node.node_name, node.instance_name, node.args, node.sub_nodes
+ )
def composite_no_args(self, select: PostSelections) -> MutationNode[Post]:
node = selection_to_nodes(
- {"compositeNoArgs": select},
- {"compositeNoArgs": NodeDescs.RootCompositeNoArgsFn},
- "$q"
+ {"compositeNoArgs": select},
+ {"compositeNoArgs": NodeDescs.RootCompositeNoArgsFn},
+ "$q",
)[0]
- return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
+ return MutationNode(
+ node.node_name, node.instance_name, node.args, node.sub_nodes
+ )
- def composite_args(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: PostSelections) -> MutationNode[Post]:
+ def composite_args(
+ self,
+ args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs],
+ select: PostSelections,
+ ) -> MutationNode[Post]:
node = selection_to_nodes(
- {"compositeArgs": (args, select)},
- {"compositeArgs": NodeDescs.RootCompositeArgsFn},
- "$q"
+ {"compositeArgs": (args, select)},
+ {"compositeArgs": NodeDescs.RootCompositeArgsFn},
+ "$q",
)[0]
- return MutationNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
+ return MutationNode(
+ node.node_name, node.instance_name, node.args, node.sub_nodes
+ )
- def scalar_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs]) -> QueryNode[RootScalarUnionFnOutput]:
+ def scalar_union(
+ self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs]
+ ) -> QueryNode[RootScalarUnionFnOutput]:
node = selection_to_nodes(
- {"scalarUnion": args},
- {"scalarUnion": NodeDescs.RootScalarUnionFn},
- "$q"
+ {"scalarUnion": args}, {"scalarUnion": NodeDescs.RootScalarUnionFn}, "$q"
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
- def composite_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: RootCompositeUnionFnOutputSelections) -> QueryNode[RootCompositeUnionFnOutput]:
+ def composite_union(
+ self,
+ args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs],
+ select: RootCompositeUnionFnOutputSelections,
+ ) -> QueryNode[RootCompositeUnionFnOutput]:
node = selection_to_nodes(
- {"compositeUnion": (args, select)},
- {"compositeUnion": NodeDescs.RootCompositeUnionFn},
- "$q"
+ {"compositeUnion": (args, select)},
+ {"compositeUnion": NodeDescs.RootCompositeUnionFn},
+ "$q",
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
- def mixed_union(self, args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs], select: RootMixedUnionFnOutputSelections) -> QueryNode[RootMixedUnionFnOutput]:
+ def mixed_union(
+ self,
+ args: typing.Union[RootCompositeArgsFnInput, PlaceholderArgs],
+ select: RootMixedUnionFnOutputSelections,
+ ) -> QueryNode[RootMixedUnionFnOutput]:
node = selection_to_nodes(
- {"mixedUnion": (args, select)},
- {"mixedUnion": NodeDescs.RootMixedUnionFn},
- "$q"
+ {"mixedUnion": (args, select)},
+ {"mixedUnion": NodeDescs.RootMixedUnionFn},
+ "$q",
)[0]
return QueryNode(node.node_name, node.instance_name, node.args, node.sub_nodes)
diff --git a/tests/metagen/typegraphs/sample/ts/main.ts b/tests/metagen/typegraphs/sample/ts/main.ts
index 987577de1d..6416ac3ccf 100644
--- a/tests/metagen/typegraphs/sample/ts/main.ts
+++ b/tests/metagen/typegraphs/sample/ts/main.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { alias, PreparedArgs, QueryGraph } from "./client.ts";
diff --git a/tests/misc/publish_test.ts b/tests/misc/publish_test.ts
index c9aaf38b70..be4f50d7ce 100644
--- a/tests/misc/publish_test.ts
+++ b/tests/misc/publish_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assert } from "@std/assert/assert";
import { exists } from "@std/fs/exists";
import { Meta } from "test-utils/mod.ts";
diff --git a/tests/misc/typegate_config_test.ts.disabled b/tests/misc/typegate_config_test.ts.disabled
index 9ad04c7967..c9e02cfd6a 100644
--- a/tests/misc/typegate_config_test.ts.disabled
+++ b/tests/misc/typegate_config_test.ts.disabled
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { assert } from "std/assert/mod.ts";
diff --git a/tests/multi_typegraph/multi_typegraph.ts b/tests/multi_typegraph/multi_typegraph.ts
index 34957744b0..214030deaf 100644
--- a/tests/multi_typegraph/multi_typegraph.ts
+++ b/tests/multi_typegraph/multi_typegraph.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";
diff --git a/tests/multi_typegraph/multi_typegraph_test.ts b/tests/multi_typegraph/multi_typegraph_test.ts
index 485dd4ef24..58d76bfa30 100644
--- a/tests/multi_typegraph/multi_typegraph_test.ts
+++ b/tests/multi_typegraph/multi_typegraph_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/nesting/nesting_test.ts b/tests/nesting/nesting_test.ts
index cc387f9a17..d71c0c5b23 100644
--- a/tests/nesting/nesting_test.ts
+++ b/tests/nesting/nesting_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/params/apply_test.ts b/tests/params/apply_test.ts
index 78e41f716f..217a9b4fb5 100644
--- a/tests/params/apply_test.ts
+++ b/tests/params/apply_test.ts
@@ -1,7 +1,10 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
-import { gql, Meta } from "../utils/mod.ts";
+import { randomPGConnStr } from "test-utils/database.ts";
+import { gql, Meta } from "test-utils/mod.ts";
+import { dropSchemas, recreateMigrations } from "test-utils/migrations.ts";
+import { assertEquals } from "@std/assert/equals";
Meta.test("(python (sdk): apply)", async (t) => {
const e = await t.engine("params/apply.py", {
@@ -253,3 +256,66 @@ Meta.test("nested context access", async (t) => {
.on(e);
});
});
+
+Meta.test("apply with prisma generated types", async (t) => {
+ const { connStr, schema: _ } = randomPGConnStr();
+ const e = await t.engine("params/prisma_apply.py", {
+ secrets: {
+ "POSTGRES": connStr,
+ },
+ });
+ await dropSchemas(e);
+ await recreateMigrations(e);
+
+ let id: string = null!;
+
+ await t.should("create user", async () => {
+ await gql`
+ mutation {
+ createUser(
+ name: "Alice"
+ email: "alice@example.com"
+ age: 30
+ ) {
+ id
+ name
+ email
+ age
+ }
+ }
+ `
+ .expectBody((body) => {
+ id = body.data.createUser.id;
+ assertEquals(body.data.createUser, {
+ id: id,
+ name: "Alice",
+ email: "alice@example.com",
+ age: 30,
+ });
+ })
+ .on(e);
+ });
+
+ await t.should("find user by id", async () => {
+ await gql`
+ query Q($id: ID!) {
+ findUser(id: $id) {
+ id
+ name
+ email
+ age
+ }
+ }
+ `
+ .withVars({ id })
+ .expectData({
+ findUser: {
+ id,
+ name: "Alice",
+ email: "alice@example.com",
+ age: 30,
+ },
+ })
+ .on(e);
+ });
+});
diff --git a/tests/params/prisma_apply.py b/tests/params/prisma_apply.py
new file mode 100644
index 0000000000..78afba91b7
--- /dev/null
+++ b/tests/params/prisma_apply.py
@@ -0,0 +1,38 @@
+from typegraph import Graph, Policy, t, typegraph
+from typegraph.providers import PrismaRuntime
+
+
+@typegraph()
+def prisma_apply(g: Graph):
+ prisma = PrismaRuntime("db", "POSTGRES")
+ public = Policy.public()
+
+ user = t.struct(
+ {
+ "id": t.uuid(config=["auto"]).id(),
+ "name": t.string(),
+ "email": t.email(config=["unique"]),
+ "age": t.integer(),
+ },
+ name="user",
+ )
+
+ g.expose(
+ public,
+ createUser=prisma.create(user).apply(
+ {
+ "data": {
+ "name": g.as_arg(),
+ "email": g.as_arg(),
+ "age": g.as_arg(),
+ }
+ }
+ ),
+ findUser=prisma.find_unique(user).apply(
+ {
+ "where": {
+ "id": g.as_arg(),
+ }
+ }
+ ),
+ )
diff --git a/tests/planner/default_args_test.ts b/tests/planner/default_args_test.ts
index 4a0bb847e6..6df4c5bfe6 100644
--- a/tests/planner/default_args_test.ts
+++ b/tests/planner/default_args_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "test-utils/migrations.ts";
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/planner/planner_test.ts b/tests/planner/planner_test.ts
index d6e37985f4..c0797c6a32 100644
--- a/tests/planner/planner_test.ts
+++ b/tests/planner/planner_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import { mapValues } from "@std/collections/map-values";
diff --git a/tests/policies/policies_jwt_test.ts b/tests/policies/policies_jwt_test.ts
index 35b9802505..12f9b88cce 100644
--- a/tests/policies/policies_jwt_test.ts
+++ b/tests/policies/policies_jwt_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
import * as jwt from "jwt";
diff --git a/tests/policies/policies_test.ts b/tests/policies/policies_test.ts
index a2c40bfe15..988734b6a5 100644
--- a/tests/policies/policies_test.ts
+++ b/tests/policies/policies_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { TypegateConfig } from "@metatype/typegate/config.ts";
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/policies/ts/effects.ts b/tests/policies/ts/effects.ts
index 96dfdacdb7..5e4ba665fd 100644
--- a/tests/policies/ts/effects.ts
+++ b/tests/policies/ts/effects.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function currentUserOnly(
args: Record>,
diff --git a/tests/policies/ts/policies.ts b/tests/policies/ts/policies.ts
index 97d71ea27c..f6ed021293 100644
--- a/tests/policies/ts/policies.ts
+++ b/tests/policies/ts/policies.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
interface ReadSecretInput {
username: string;
diff --git a/tests/prisma_migrate/prisma_migrate_test.ts b/tests/prisma_migrate/prisma_migrate_test.ts
index 6f899508ca..b145bb8738 100644
--- a/tests/prisma_migrate/prisma_migrate_test.ts
+++ b/tests/prisma_migrate/prisma_migrate_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
assert,
diff --git a/tests/query_parsers/query_parsers_test.ts b/tests/query_parsers/query_parsers_test.ts
index 1430f4ca2d..5198892175 100644
--- a/tests/query_parsers/query_parsers_test.ts
+++ b/tests/query_parsers/query_parsers_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/rate_limiter/rate_limiter_test.ts b/tests/rate_limiter/rate_limiter_test.ts
index dc5e6c8aee..8186954b7a 100644
--- a/tests/rate_limiter/rate_limiter_test.ts
+++ b/tests/rate_limiter/rate_limiter_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
decrPosCmd,
diff --git a/tests/regression/invalid_ref_error_message/invalid_ref_test.ts b/tests/regression/invalid_ref_error_message/invalid_ref_test.ts
index f9633fb9c6..035a82cb59 100644
--- a/tests/regression/invalid_ref_error_message/invalid_ref_test.ts
+++ b/tests/regression/invalid_ref_error_message/invalid_ref_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { assertRejects } from "@std/assert";
diff --git a/tests/rest/custom/custom_loader.ts b/tests/rest/custom/custom_loader.ts
index 3db39d6999..9443d773cb 100644
--- a/tests/rest/custom/custom_loader.ts
+++ b/tests/rest/custom/custom_loader.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dirname } from "@std/path/dirname";
import { resolve } from "@std/path/resolve";
diff --git a/tests/rest/rest_custom_loader.ts b/tests/rest/rest_custom_loader.ts
index c4c10ed890..cd99d8628c 100644
--- a/tests/rest/rest_custom_loader.ts
+++ b/tests/rest/rest_custom_loader.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fx, Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/rest/rest_schema.ts b/tests/rest/rest_schema.ts
index 5f3cca2843..81b6029431 100644
--- a/tests/rest/rest_schema.ts
+++ b/tests/rest/rest_schema.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fx, Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/rest/rest_test.ts b/tests/rest/rest_test.ts
index 41a2e3e954..4e2a86a8d5 100644
--- a/tests/rest/rest_test.ts
+++ b/tests/rest/rest_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals, assertStringIncludes } from "@std/assert";
import { gql, Meta, rest } from "../utils/mod.ts";
diff --git a/tests/runtimes/deno/deno_dep.ts b/tests/runtimes/deno/deno_dep.ts
index a0f2be5763..b7e87da08c 100644
--- a/tests/runtimes/deno/deno_dep.ts
+++ b/tests/runtimes/deno/deno_dep.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/runtimes/deno/deno_dir.ts b/tests/runtimes/deno/deno_dir.ts
index 635090512c..11b352ebbd 100644
--- a/tests/runtimes/deno/deno_dir.ts
+++ b/tests/runtimes/deno/deno_dir.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/runtimes/deno/deno_dir_test.ts b/tests/runtimes/deno/deno_dir_test.ts
index 9139ee1a8d..04cea044c5 100644
--- a/tests/runtimes/deno/deno_dir_test.ts
+++ b/tests/runtimes/deno/deno_dir_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/deno/deno_duplicate_artifact.ts b/tests/runtimes/deno/deno_duplicate_artifact.ts
index 5705581152..077cef9327 100644
--- a/tests/runtimes/deno/deno_duplicate_artifact.ts
+++ b/tests/runtimes/deno/deno_duplicate_artifact.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/runtimes/deno/deno_glob_test.ts b/tests/runtimes/deno/deno_glob_test.ts
index ce5783aebe..6745dd7a37 100644
--- a/tests/runtimes/deno/deno_glob_test.ts
+++ b/tests/runtimes/deno/deno_glob_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/deno/deno_globs.ts b/tests/runtimes/deno/deno_globs.ts
index f95f7c7847..a4f2b6d1ee 100644
--- a/tests/runtimes/deno/deno_globs.ts
+++ b/tests/runtimes/deno/deno_globs.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/runtimes/deno/deno_sync_test.ts b/tests/runtimes/deno/deno_sync_test.ts
index a9e2477833..00278d92fc 100644
--- a/tests/runtimes/deno/deno_sync_test.ts
+++ b/tests/runtimes/deno/deno_sync_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta, sleep } from "../../utils/mod.ts";
import * as path from "@std/path";
diff --git a/tests/runtimes/deno/deno_test.ts b/tests/runtimes/deno/deno_test.ts
index 3e7498623d..cf18f285d7 100644
--- a/tests/runtimes/deno/deno_test.ts
+++ b/tests/runtimes/deno/deno_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta, sleep } from "../../utils/mod.ts";
import * as path from "@std/path";
diff --git a/tests/runtimes/deno/deno_typescript.ts b/tests/runtimes/deno/deno_typescript.ts
index f89bfdd1da..f6ef827028 100644
--- a/tests/runtimes/deno/deno_typescript.ts
+++ b/tests/runtimes/deno/deno_typescript.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/runtimes/deno/dynamic/1.ts b/tests/runtimes/deno/dynamic/1.ts
index f48fff673e..6bc53565e1 100644
--- a/tests/runtimes/deno/dynamic/1.ts
+++ b/tests/runtimes/deno/dynamic/1.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function fire() {
return 1;
diff --git a/tests/runtimes/deno/dynamic/2.ts b/tests/runtimes/deno/dynamic/2.ts
index 2504caf7f9..b733db6994 100644
--- a/tests/runtimes/deno/dynamic/2.ts
+++ b/tests/runtimes/deno/dynamic/2.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function fire() {
return 2;
diff --git a/tests/runtimes/deno/reload/template.ts b/tests/runtimes/deno/reload/template.ts
index 59f158c270..ac626f8a1d 100644
--- a/tests/runtimes/deno/reload/template.ts
+++ b/tests/runtimes/deno/reload/template.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function fire() {
return "REWRITE_ME";
diff --git a/tests/runtimes/deno/ts/deno.ts b/tests/runtimes/deno/ts/deno.ts
index d35ef40976..5da50ea679 100644
--- a/tests/runtimes/deno/ts/deno.ts
+++ b/tests/runtimes/deno/ts/deno.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
let count = 0;
diff --git a/tests/runtimes/deno/ts/dep/main.ts b/tests/runtimes/deno/ts/dep/main.ts
index e7dd4ccde1..ca26d7b12e 100644
--- a/tests/runtimes/deno/ts/dep/main.ts
+++ b/tests/runtimes/deno/ts/dep/main.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { add } from "./nested/dep.ts";
diff --git a/tests/runtimes/deno/ts/dep/nested/dep.ts b/tests/runtimes/deno/ts/dep/nested/dep.ts
index 14d1e32252..ce1ce3940c 100644
--- a/tests/runtimes/deno/ts/dep/nested/dep.ts
+++ b/tests/runtimes/deno/ts/dep/nested/dep.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function add(a: number, b: number) {
return a + b;
diff --git a/tests/runtimes/deno/ts/math-npm.ts b/tests/runtimes/deno/ts/math-npm.ts
index d1fc05e5e5..9c423f3f86 100644
--- a/tests/runtimes/deno/ts/math-npm.ts
+++ b/tests/runtimes/deno/ts/math-npm.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// deno-lint-ignore no-external-import
import * as MathJS from "npm:mathjs@11.11.1";
diff --git a/tests/runtimes/deno/ts/math.ts b/tests/runtimes/deno/ts/math.ts
index 10871f4243..61ff5ef0f6 100644
--- a/tests/runtimes/deno/ts/math.ts
+++ b/tests/runtimes/deno/ts/math.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// deno-lint-ignore no-external-import
import * as MathLib from "https://deno.land/x/math@v1.1.0/mod.ts";
diff --git a/tests/runtimes/graphql/graphql_test.ts b/tests/runtimes/graphql/graphql_test.ts
index 42fa61f826..81ce8c353f 100644
--- a/tests/runtimes/graphql/graphql_test.ts
+++ b/tests/runtimes/graphql/graphql_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { QueryEngine } from "@metatype/typegate/engine/query_engine.ts";
import { removeMigrations } from "../../utils/migrations.ts";
diff --git a/tests/runtimes/graphql/typegraphs/deno/graphql.ts b/tests/runtimes/graphql/typegraphs/deno/graphql.ts
index 3a71eb3537..a084eea1c3 100644
--- a/tests/runtimes/graphql/typegraphs/deno/graphql.ts
+++ b/tests/runtimes/graphql/typegraphs/deno/graphql.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { GraphQLRuntime } from "@typegraph/sdk/runtimes/graphql.ts";
diff --git a/tests/runtimes/grpc/geography.py b/tests/runtimes/grpc/geography.py
index b5d6432bec..b6aa3fcc0d 100644
--- a/tests/runtimes/grpc/geography.py
+++ b/tests/runtimes/grpc/geography.py
@@ -1,5 +1,5 @@
-# Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-# SPDX-License-Identifier: Elastic-2.0
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import Graph, Policy, typegraph
from typegraph.runtimes.grpc import GrpcRuntime
diff --git a/tests/runtimes/grpc/grpc_test.ts b/tests/runtimes/grpc/grpc_test.ts
index a58c14e5df..c44c4a030b 100644
--- a/tests/runtimes/grpc/grpc_test.ts
+++ b/tests/runtimes/grpc/grpc_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { MetaTest } from "../../utils/test.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/grpc/helloworld.py b/tests/runtimes/grpc/helloworld.py
index 6888a2c1c1..d6fc480ab4 100644
--- a/tests/runtimes/grpc/helloworld.py
+++ b/tests/runtimes/grpc/helloworld.py
@@ -1,5 +1,5 @@
-# Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-# SPDX-License-Identifier: Elastic-2.0
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import Graph, Policy, typegraph
from typegraph.runtimes.grpc import GrpcRuntime
diff --git a/tests/runtimes/grpc/helloworld.ts b/tests/runtimes/grpc/helloworld.ts
index 58f2ccd6d1..4766b9f184 100644
--- a/tests/runtimes/grpc/helloworld.ts
+++ b/tests/runtimes/grpc/helloworld.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Policy, typegraph } from "@typegraph/sdk/index.ts";
import { GrpcRuntime } from "@typegraph/sdk/runtimes/grpc.ts";
diff --git a/tests/runtimes/grpc/maths.py b/tests/runtimes/grpc/maths.py
index 216f185de0..d2e6a4ec53 100644
--- a/tests/runtimes/grpc/maths.py
+++ b/tests/runtimes/grpc/maths.py
@@ -1,5 +1,5 @@
-# Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-# SPDX-License-Identifier: Elastic-2.0
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import Graph, Policy, typegraph
from typegraph.runtimes.grpc import GrpcRuntime
diff --git a/tests/runtimes/http/http_content_type_test.ts b/tests/runtimes/http/http_content_type_test.ts
index 70dd0b5c77..0379013783 100644
--- a/tests/runtimes/http/http_content_type_test.ts
+++ b/tests/runtimes/http/http_content_type_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/runtimes/http/http_test.ts b/tests/runtimes/http/http_test.ts
index b0b0ef2c23..8d6505e7ce 100644
--- a/tests/runtimes/http/http_test.ts
+++ b/tests/runtimes/http/http_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
import * as mf from "test/mock_fetch";
diff --git a/tests/runtimes/kv/kv.py b/tests/runtimes/kv/kv.py
index b93a71ee08..45510c9991 100644
--- a/tests/runtimes/kv/kv.py
+++ b/tests/runtimes/kv/kv.py
@@ -1,5 +1,5 @@
-# Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-# SPDX-License-Identifier: Elastic-2.0
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import Graph, Policy, typegraph
from typegraph.runtimes.kv import KvRuntime
diff --git a/tests/runtimes/kv/kv.ts b/tests/runtimes/kv/kv.ts
index 5425c363a2..c238cfd098 100644
--- a/tests/runtimes/kv/kv.ts
+++ b/tests/runtimes/kv/kv.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Policy, typegraph } from "@typegraph/sdk/index.ts";
import { KvRuntime } from "@typegraph/sdk/runtimes/kv.ts";
diff --git a/tests/runtimes/kv/kv_test.ts b/tests/runtimes/kv/kv_test.ts
index 3a1f9b2508..1bf6132a6d 100644
--- a/tests/runtimes/kv/kv_test.ts
+++ b/tests/runtimes/kv/kv_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { MetaTest } from "../../utils/test.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/full_prisma_mapping_test.ts b/tests/runtimes/prisma/full_prisma_mapping_test.ts
index 1cbc92e6f5..0fbda9e3bd 100644
--- a/tests/runtimes/prisma/full_prisma_mapping_test.ts
+++ b/tests/runtimes/prisma/full_prisma_mapping_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/graphql_variables_test.ts b/tests/runtimes/prisma/graphql_variables_test.ts
index 47a3d20cb0..8036ce1694 100644
--- a/tests/runtimes/prisma/graphql_variables_test.ts
+++ b/tests/runtimes/prisma/graphql_variables_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { v4 } from "@std/uuid";
import { assert } from "@std/assert";
diff --git a/tests/runtimes/prisma/mixed_runtime_test.ts b/tests/runtimes/prisma/mixed_runtime_test.ts
index 8c1607dd45..6640f09d4b 100644
--- a/tests/runtimes/prisma/mixed_runtime_test.ts
+++ b/tests/runtimes/prisma/mixed_runtime_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/multi_relations_test.ts b/tests/runtimes/prisma/multi_relations_test.ts
index 17a8037ede..542adfb3ca 100644
--- a/tests/runtimes/prisma/multi_relations_test.ts
+++ b/tests/runtimes/prisma/multi_relations_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/multiple_runtimes_test.ts b/tests/runtimes/prisma/multiple_runtimes_test.ts
index a4f1edc916..1bb3d8676a 100644
--- a/tests/runtimes/prisma/multiple_runtimes_test.ts
+++ b/tests/runtimes/prisma/multiple_runtimes_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/normal_1_1.ts b/tests/runtimes/prisma/normal_1_1.ts
index a0524fda84..74cee34d56 100644
--- a/tests/runtimes/prisma/normal_1_1.ts
+++ b/tests/runtimes/prisma/normal_1_1.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";
diff --git a/tests/runtimes/prisma/one_to_many_test.ts b/tests/runtimes/prisma/one_to_many_test.ts
index 8bb9457063..2e850243dc 100644
--- a/tests/runtimes/prisma/one_to_many_test.ts
+++ b/tests/runtimes/prisma/one_to_many_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { randomPGConnStr } from "../../utils/database.ts";
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
diff --git a/tests/runtimes/prisma/one_to_one_test.ts b/tests/runtimes/prisma/one_to_one_test.ts
index d919d6f032..24eac6f4cf 100644
--- a/tests/runtimes/prisma/one_to_one_test.ts
+++ b/tests/runtimes/prisma/one_to_one_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { QueryEngine } from "@metatype/typegate/engine/query_engine.ts";
import { randomPGConnStr } from "../../utils/database.ts";
diff --git a/tests/runtimes/prisma/optional_1_n.ts b/tests/runtimes/prisma/optional_1_n.ts
index c03321e5d1..e0fbdd0021 100644
--- a/tests/runtimes/prisma/optional_1_n.ts
+++ b/tests/runtimes/prisma/optional_1_n.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";
diff --git a/tests/runtimes/prisma/prisma_edgecases_test.ts b/tests/runtimes/prisma/prisma_edgecases_test.ts
index d021316c9e..97bb0e75c1 100644
--- a/tests/runtimes/prisma/prisma_edgecases_test.ts
+++ b/tests/runtimes/prisma/prisma_edgecases_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/prisma/prisma_test.ts b/tests/runtimes/prisma/prisma_test.ts
index bf2e3b5b49..e774abb407 100644
--- a/tests/runtimes/prisma/prisma_test.ts
+++ b/tests/runtimes/prisma/prisma_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { v4 } from "@std/uuid";
import { assert } from "@std/assert";
diff --git a/tests/runtimes/prisma/query_builder_test.ts b/tests/runtimes/prisma/query_builder_test.ts
index 52c5115240..3f1b4dd971 100644
--- a/tests/runtimes/prisma/query_builder_test.ts
+++ b/tests/runtimes/prisma/query_builder_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals } from "@std/assert";
import { PrismaRuntime } from "@metatype/typegate/runtimes/prisma/prisma.ts";
diff --git a/tests/runtimes/prisma/schema_generation_test.ts b/tests/runtimes/prisma/schema_generation_test.ts
index dabbe3ea6e..44e8b3267b 100644
--- a/tests/runtimes/prisma/schema_generation_test.ts
+++ b/tests/runtimes/prisma/schema_generation_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "../../utils/mod.ts";
import { serialize } from "../../utils/meta.ts";
diff --git a/tests/runtimes/python/python.ts b/tests/runtimes/python/python.ts
index 807352bf34..f1f10930fc 100644
--- a/tests/runtimes/python/python.ts
+++ b/tests/runtimes/python/python.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
diff --git a/tests/runtimes/python/python_dir.ts b/tests/runtimes/python/python_dir.ts
index d3780fc927..81bde6d6ee 100644
--- a/tests/runtimes/python/python_dir.ts
+++ b/tests/runtimes/python/python_dir.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
diff --git a/tests/runtimes/python/python_dir_test.ts b/tests/runtimes/python/python_dir_test.ts
index 395c3a64e1..1303573e3e 100644
--- a/tests/runtimes/python/python_dir_test.ts
+++ b/tests/runtimes/python/python_dir_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/python/python_duplicate_artifact.ts b/tests/runtimes/python/python_duplicate_artifact.ts
index 2176fffa22..0e3c25a3de 100644
--- a/tests/runtimes/python/python_duplicate_artifact.ts
+++ b/tests/runtimes/python/python_duplicate_artifact.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
diff --git a/tests/runtimes/python/python_glob_test.ts b/tests/runtimes/python/python_glob_test.ts
index ebcf91f0dc..883bb61677 100644
--- a/tests/runtimes/python/python_glob_test.ts
+++ b/tests/runtimes/python/python_glob_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/python/python_globs.ts b/tests/runtimes/python/python_globs.ts
index c643e72ad3..a75d3c09cf 100644
--- a/tests/runtimes/python/python_globs.ts
+++ b/tests/runtimes/python/python_globs.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";
diff --git a/tests/runtimes/python/python_no_artifact.ts b/tests/runtimes/python/python_no_artifact.ts
index dd67a90deb..42498207c3 100644
--- a/tests/runtimes/python/python_no_artifact.ts
+++ b/tests/runtimes/python/python_no_artifact.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";
diff --git a/tests/runtimes/python/python_sync_test.ts b/tests/runtimes/python/python_sync_test.ts
index 0ad6a0c522..159d7c89c4 100644
--- a/tests/runtimes/python/python_sync_test.ts
+++ b/tests/runtimes/python/python_sync_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta, sleep } from "../../utils/mod.ts";
import { connect } from "redis";
diff --git a/tests/runtimes/python/python_test.ts b/tests/runtimes/python/python_test.ts
index 0e2bdf8c5f..93b378dd62 100644
--- a/tests/runtimes/python/python_test.ts
+++ b/tests/runtimes/python/python_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assert, assertEquals } from "@std/assert";
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/runtimes/random/random.ts b/tests/runtimes/random/random.ts
index 15be0e5000..1e8be8c5ff 100644
--- a/tests/runtimes/random/random.ts
+++ b/tests/runtimes/random/random.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";
diff --git a/tests/runtimes/random/random_test.ts b/tests/runtimes/random/random_test.ts
index 4975ca6e0e..b932a2839e 100644
--- a/tests/runtimes/random/random_test.ts
+++ b/tests/runtimes/random/random_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/runtimes/s3/s3.ts b/tests/runtimes/s3/s3.ts
index 4349502c54..25100ffc32 100644
--- a/tests/runtimes/s3/s3.ts
+++ b/tests/runtimes/s3/s3.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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 { S3Runtime } from "@typegraph/sdk/providers/aws.ts";
diff --git a/tests/runtimes/s3/s3_test.ts b/tests/runtimes/s3/s3_test.ts
index 715fa45cdf..77089c9e22 100644
--- a/tests/runtimes/s3/s3_test.ts
+++ b/tests/runtimes/s3/s3_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertEquals, assertExists } from "@std/assert";
import { execute, gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/substantial/common.ts b/tests/runtimes/substantial/common.ts
index 3cc42b1f5d..5aca8d3dda 100644
--- a/tests/runtimes/substantial/common.ts
+++ b/tests/runtimes/substantial/common.ts
@@ -47,7 +47,10 @@ export function basicTestTemplate(
cleanup && t.addCleanup(cleanup);
const e = await t.engine("runtimes/substantial/substantial.py", {
- secrets,
+ secrets: {
+ MY_SECRET: "Hello",
+ ...secrets,
+ },
});
let currentRunId: string | null = null;
@@ -173,7 +176,10 @@ export function concurrentWorkflowTestTemplate(
cleanup && t.addCleanup(cleanup);
const e = await t.engine("runtimes/substantial/substantial.py", {
- secrets,
+ secrets: {
+ MY_SECRET: "Hello",
+ ...secrets,
+ },
});
const emails = [
@@ -349,7 +355,10 @@ export function retrySaveTestTemplate(
cleanup && t.addCleanup(cleanup);
const e = await t.engine("runtimes/substantial/substantial.py", {
- secrets,
+ secrets: {
+ MY_SECRET: "Hello",
+ ...secrets,
+ },
});
let resolvedId: string,
diff --git a/tests/runtimes/substantial/imports/common_types.ts b/tests/runtimes/substantial/imports/common_types.ts
index 3e40785083..b3c0130651 100644
--- a/tests/runtimes/substantial/imports/common_types.ts
+++ b/tests/runtimes/substantial/imports/common_types.ts
@@ -1,7 +1,7 @@
// TODO: include this as part of the metagen generated code
-// TODO:
-export type Workflow = (ctx: Context) => Promise;
+// TODO: merge these
+export type Workflow = (ctx: Context, ctx2: TaskCtx) => Promise;
export interface SerializableWorkflowHandle {
runId?: string;
@@ -45,6 +45,21 @@ export interface Context {
): ChildWorkflowHandle;
}
+export type TaskCtx = {
+ parent?: Record;
+ /**
+ * Request context extracted by auth extractors.
+ */
+ context?: Record;
+ secrets: Record;
+ effect: "create" | "update" | "delete" | "read" | undefined | null;
+ meta: {
+ url: string;
+ token: string;
+ };
+ headers: Record;
+};
+
export interface SaveOption {
timeoutMs?: number;
retry?: {
diff --git a/tests/runtimes/substantial/kv_like_test.ts b/tests/runtimes/substantial/kv_like_test.ts
index 33e66b7774..efc3606dc6 100644
--- a/tests/runtimes/substantial/kv_like_test.ts
+++ b/tests/runtimes/substantial/kv_like_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
basicTestTemplate,
diff --git a/tests/runtimes/substantial/redis_test.ts b/tests/runtimes/substantial/redis_test.ts
index 1732898635..daaccc953c 100644
--- a/tests/runtimes/substantial/redis_test.ts
+++ b/tests/runtimes/substantial/redis_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
basicTestTemplate,
diff --git a/tests/runtimes/substantial/substantial.py b/tests/runtimes/substantial/substantial.py
index f079980563..55c2b82a9c 100644
--- a/tests/runtimes/substantial/substantial.py
+++ b/tests/runtimes/substantial/substantial.py
@@ -19,7 +19,14 @@ def substantial(g: Graph):
file = (
WorkflowFile.deno(file="workflow.ts", deps=["imports/common_types.ts"])
- .import_(["saveAndSleepExample", "eventsAndExceptionExample", "retryExample"])
+ .import_(
+ [
+ "saveAndSleepExample",
+ "eventsAndExceptionExample",
+ "retryExample",
+ "secretsExample",
+ ]
+ )
.build()
)
@@ -55,5 +62,9 @@ def substantial(g: Graph):
start_retry=sub.start(
t.struct({"fail": t.boolean(), "timeout": t.boolean()})
).reduce({"name": "retryExample"}),
+ # secret
+ start_secret=sub.start(t.struct({}), secrets=["MY_SECRET"]).reduce(
+ {"name": "secretsExample"}
+ ),
**sub.internals(),
)
diff --git a/tests/runtimes/substantial/substantial_test.ts b/tests/runtimes/substantial/substantial_test.ts
new file mode 100644
index 0000000000..f071401015
--- /dev/null
+++ b/tests/runtimes/substantial/substantial_test.ts
@@ -0,0 +1,6 @@
+import { basicTestTemplate } from "./common.ts";
+
+basicTestTemplate("memory", {
+ secrets: { MY_SECRET: "Hello" },
+ delays: { awaitSleepCompleteSec: 10 },
+});
diff --git a/tests/runtimes/substantial/workflow.ts b/tests/runtimes/substantial/workflow.ts
index b4df2cb5f4..59d7a70737 100644
--- a/tests/runtimes/substantial/workflow.ts
+++ b/tests/runtimes/substantial/workflow.ts
@@ -3,9 +3,12 @@ import {
queryThatTakesAWhile,
sendSubscriptionEmail,
sleep,
+ Workflow,
} from "./imports/common_types.ts";
-export async function eventsAndExceptionExample(ctx: Context) {
+export const eventsAndExceptionExample: Workflow = async (
+ ctx: Context,
+) => {
const { to } = ctx.kwargs;
const messageDialog = await ctx.save(() => sendSubscriptionEmail(to));
@@ -17,7 +20,7 @@ export async function eventsAndExceptionExample(ctx: Context) {
}
return `${messageDialog}: confirmed!`;
-}
+};
export async function saveAndSleepExample(ctx: Context) {
const { a, b } = ctx.kwargs;
@@ -28,18 +31,18 @@ export async function saveAndSleepExample(ctx: Context) {
const sum = await ctx.save(async () => {
const remoteAdd = new Date().getTime();
- const { data } = await ctx.gql/**/ `query { remote_add(a: $a, b: $b) }`.run(
+ const { data } = await ctx.gql /**/`query { remote_add(a: $a, b: $b) }`.run(
{
a: newA,
b: newB,
- }
+ },
);
const remoteAddEnd = new Date().getTime();
console.log(
"Remote add:",
(remoteAddEnd - remoteAdd) / 1000,
", Response:",
- data
+ data,
);
return (data as any)?.remote_add as number;
@@ -67,7 +70,7 @@ export async function retryExample(ctx: Context) {
maxBackoffMs: 5000,
maxRetries: 4,
},
- }
+ },
);
const timeoutRet = await ctx.save(
@@ -86,8 +89,19 @@ export async function retryExample(ctx: Context) {
maxBackoffMs: 3000,
maxRetries: 5,
},
- }
+ },
);
return [timeoutRet, retryRet].join(", ");
}
+
+export const secretsExample: Workflow = (_, { secrets }) => {
+ const { MY_SECRET, ...rest } = secrets;
+ if (!MY_SECRET) {
+ throw new Error("unable to read secret");
+ }
+ if (Object.keys(rest).length > 0) {
+ throw new Error("unexpected secrets found: ", rest);
+ }
+ return Promise.resolve();
+};
diff --git a/tests/runtimes/temporal/temporal.ts b/tests/runtimes/temporal/temporal.ts
index ed9a5b15f8..abc7d7b3b5 100644
--- a/tests/runtimes/temporal/temporal.ts
+++ b/tests/runtimes/temporal/temporal.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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";
diff --git a/tests/runtimes/temporal/temporal_test.ts b/tests/runtimes/temporal/temporal_test.ts
index 1f1937d72f..548f0a945c 100644
--- a/tests/runtimes/temporal/temporal_test.ts
+++ b/tests/runtimes/temporal/temporal_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assertExists } from "@std/assert";
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/runtimes/temporal/worker/activities.ts b/tests/runtimes/temporal/worker/activities.ts
index aa73554274..55279b5518 100644
--- a/tests/runtimes/temporal/worker/activities.ts
+++ b/tests/runtimes/temporal/worker/activities.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export function greet(name: string): Promise {
return Promise.resolve(`Hello, ${name}!`);
diff --git a/tests/runtimes/temporal/worker/worker.ts b/tests/runtimes/temporal/worker/worker.ts
index e00a856049..122bea637a 100644
--- a/tests/runtimes/temporal/worker/worker.ts
+++ b/tests/runtimes/temporal/worker/worker.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { NativeConnection, Worker } from "@temporalio/worker";
import * as activities from "./activities.js";
diff --git a/tests/runtimes/temporal/worker/workflows.ts b/tests/runtimes/temporal/worker/workflows.ts
index cae07d2d8e..d7a45d3c9c 100644
--- a/tests/runtimes/temporal/worker/workflows.ts
+++ b/tests/runtimes/temporal/worker/workflows.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import * as workflow from "@temporalio/workflow";
diff --git a/tests/runtimes/typegate/typegate_prisma_test.ts b/tests/runtimes/typegate/typegate_prisma_test.ts
index bd85fff456..9f15a224d6 100644
--- a/tests/runtimes/typegate/typegate_prisma_test.ts
+++ b/tests/runtimes/typegate/typegate_prisma_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/typegate/typegate_runtime_test.ts b/tests/runtimes/typegate/typegate_runtime_test.ts
index 951661bfae..b6af04bf29 100644
--- a/tests/runtimes/typegate/typegate_runtime_test.ts
+++ b/tests/runtimes/typegate/typegate_runtime_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dropSchemas, recreateMigrations } from "../../utils/migrations.ts";
import { gql, Meta } from "../../utils/mod.ts";
diff --git a/tests/runtimes/wasm_reflected/rust/Cargo.toml b/tests/runtimes/wasm_reflected/rust/Cargo.toml
index 1a09a8c835..7ffa7b88b9 100644
--- a/tests/runtimes/wasm_reflected/rust/Cargo.toml
+++ b/tests/runtimes/wasm_reflected/rust/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "rust"
-version = "0.5.0-rc.4"
+version = "0.5.0-rc.6"
edition = "2021"
[lib]
diff --git a/tests/runtimes/wasm_reflected/rust/src/lib.rs b/tests/runtimes/wasm_reflected/rust/src/lib.rs
index 062dbe9f29..cd55df4bda 100644
--- a/tests/runtimes/wasm_reflected/rust/src/lib.rs
+++ b/tests/runtimes/wasm_reflected/rust/src/lib.rs
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
wit_bindgen::generate!({ world: "host" });
diff --git a/tests/runtimes/wasm_reflected/wasm_reflected.ts b/tests/runtimes/wasm_reflected/wasm_reflected.ts
index 3666bb28fa..a27601fbe8 100644
--- a/tests/runtimes/wasm_reflected/wasm_reflected.ts
+++ b/tests/runtimes/wasm_reflected/wasm_reflected.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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/tests/runtimes/wasm_reflected/wasm_reflected_test.ts b/tests/runtimes/wasm_reflected/wasm_reflected_test.ts
index 5e4f979c5e..d7b65cedaf 100644
--- a/tests/runtimes/wasm_reflected/wasm_reflected_test.ts
+++ b/tests/runtimes/wasm_reflected/wasm_reflected_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
diff --git a/tests/runtimes/wasm_reflected/wasm_sync_test.ts b/tests/runtimes/wasm_reflected/wasm_sync_test.ts
index 4e317dea61..d2a72381e3 100644
--- a/tests/runtimes/wasm_reflected/wasm_sync_test.ts
+++ b/tests/runtimes/wasm_reflected/wasm_sync_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
import { connect } from "redis";
diff --git a/tests/runtimes/wasm_wire/rust/lib.rs b/tests/runtimes/wasm_wire/rust/lib.rs
index 712feac172..2520126106 100644
--- a/tests/runtimes/wasm_wire/rust/lib.rs
+++ b/tests/runtimes/wasm_wire/rust/lib.rs
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
mod fdk;
use anyhow::Context;
diff --git a/tests/runtimes/wasm_wire/wasm_duplicate.ts b/tests/runtimes/wasm_wire/wasm_duplicate.ts
index e6df4f8cda..6bc76fe1ae 100644
--- a/tests/runtimes/wasm_wire/wasm_duplicate.ts
+++ b/tests/runtimes/wasm_wire/wasm_duplicate.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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/tests/runtimes/wasm_wire/wasm_sync_test.ts b/tests/runtimes/wasm_wire/wasm_sync_test.ts
index d22f4a9240..14f0414cf9 100644
--- a/tests/runtimes/wasm_wire/wasm_sync_test.ts
+++ b/tests/runtimes/wasm_wire/wasm_sync_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
import { connect } from "redis";
diff --git a/tests/runtimes/wasm_wire/wasm_wire.ts b/tests/runtimes/wasm_wire/wasm_wire.ts
index ed37fc4362..27bd7a34fe 100644
--- a/tests/runtimes/wasm_wire/wasm_wire.ts
+++ b/tests/runtimes/wasm_wire/wasm_wire.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// 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/tests/runtimes/wasm_wire/wasm_wire_test.ts b/tests/runtimes/wasm_wire/wasm_wire_test.ts
index 93f4a31436..0a669e5b60 100644
--- a/tests/runtimes/wasm_wire/wasm_wire_test.ts
+++ b/tests/runtimes/wasm_wire/wasm_wire_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
import { assert, assertEquals } from "@std/assert";
import { MetaTest } from "../../utils/test.ts";
diff --git a/tests/schema_validation/circular_test.ts b/tests/schema_validation/circular_test.ts
index ae2c0abd7e..506f380a81 100644
--- a/tests/schema_validation/circular_test.ts
+++ b/tests/schema_validation/circular_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/schema_validation/ts/circular.ts b/tests/schema_validation/ts/circular.ts
index e6f3dd77f0..a9d015c440 100644
--- a/tests/schema_validation/ts/circular.ts
+++ b/tests/schema_validation/ts/circular.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
type Stars = { count: string };
type Medals = { title: string; count: number };
diff --git a/tests/simple/class_syntax_test.ts b/tests/simple/class_syntax_test.ts
index d2ae66f7f4..a9307836ae 100644
--- a/tests/simple/class_syntax_test.ts
+++ b/tests/simple/class_syntax_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/simple/error_message_test.ts b/tests/simple/error_message_test.ts
index 63aad337bb..5936d91e1a 100644
--- a/tests/simple/error_message_test.ts
+++ b/tests/simple/error_message_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/simple/simple_test.ts b/tests/simple/simple_test.ts
index fb3519ec26..d4d4358500 100644
--- a/tests/simple/simple_test.ts
+++ b/tests/simple/simple_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/sync/sync_config_test.ts b/tests/sync/sync_config_test.ts
index 81ab66a516..411654d319 100644
--- a/tests/sync/sync_config_test.ts
+++ b/tests/sync/sync_config_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { assert, assertEquals } from "@std/assert";
import {
diff --git a/tests/sync/typegraph_sync_test.ts.disable b/tests/sync/typegraph_sync_test.ts.disable
index f97f39fb73..0005743b4d 100644
--- a/tests/sync/typegraph_sync_test.ts.disable
+++ b/tests/sync/typegraph_sync_test.ts.disable
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Meta } from "test-utils/mod.ts";
import { connect } from "redis";
diff --git a/tests/type_nodes/array_of_optional_test.ts b/tests/type_nodes/array_of_optional_test.ts
index 3164934d20..45267b3f7c 100644
--- a/tests/type_nodes/array_of_optional_test.ts
+++ b/tests/type_nodes/array_of_optional_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/type_nodes/either_test.ts b/tests/type_nodes/either_test.ts
index 467aa13807..19fe8a952b 100644
--- a/tests/type_nodes/either_test.ts
+++ b/tests/type_nodes/either_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/type_nodes/ts/either/user_register.ts b/tests/type_nodes/ts/either/user_register.ts
index b4265890f1..4e8a2a8788 100644
--- a/tests/type_nodes/ts/either/user_register.ts
+++ b/tests/type_nodes/ts/either/user_register.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
interface Regist_userInput {
user: {
diff --git a/tests/type_nodes/ts/union/color_converter.ts b/tests/type_nodes/ts/union/color_converter.ts
index c60ca19335..09fa6d256a 100644
--- a/tests/type_nodes/ts/union/color_converter.ts
+++ b/tests/type_nodes/ts/union/color_converter.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// deno-lint-ignore no-external-import
import {
diff --git a/tests/type_nodes/ts/union/phone_register.ts b/tests/type_nodes/ts/union/phone_register.ts
index 510d93f25d..6ab15157ec 100644
--- a/tests/type_nodes/ts/union/phone_register.ts
+++ b/tests/type_nodes/ts/union/phone_register.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
type OS = "Android" | "iOS";
diff --git a/tests/type_nodes/ts/union/vec_normalizer.ts b/tests/type_nodes/ts/union/vec_normalizer.ts
index ab069ca5db..0d5d6633d3 100644
--- a/tests/type_nodes/ts/union/vec_normalizer.ts
+++ b/tests/type_nodes/ts/union/vec_normalizer.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
type Color = {
R: number;
diff --git a/tests/type_nodes/union_node_attr_test.ts b/tests/type_nodes/union_node_attr_test.ts
index 59e4f8646a..b1a004bc6d 100644
--- a/tests/type_nodes/union_node_attr_test.ts
+++ b/tests/type_nodes/union_node_attr_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/type_nodes/union_node_quantifier_test.ts b/tests/type_nodes/union_node_quantifier_test.ts
index 8836ce4e6b..f03f4433ff 100644
--- a/tests/type_nodes/union_node_quantifier_test.ts
+++ b/tests/type_nodes/union_node_quantifier_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/type_nodes/union_test.ts b/tests/type_nodes/union_test.ts
index e1ec8a5546..300eeeb4b8 100644
--- a/tests/type_nodes/union_test.ts
+++ b/tests/type_nodes/union_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { JSONValue } from "@metatype/typegate/utils.ts";
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/typecheck/input_validator_test.ts b/tests/typecheck/input_validator_test.ts
index 54341c1d1a..67dc29b4e0 100644
--- a/tests/typecheck/input_validator_test.ts
+++ b/tests/typecheck/input_validator_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/typecheck/reduce.ts b/tests/typecheck/reduce.ts
index 735a780b77..5008e61c85 100644
--- a/tests/typecheck/reduce.ts
+++ b/tests/typecheck/reduce.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fx, Policy, t, typegraph } from "@typegraph/sdk/index.ts";
import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";
diff --git a/tests/typecheck/reduce_syntax_test.ts b/tests/typecheck/reduce_syntax_test.ts
index 6c63fa1f43..07f7e6f8fd 100644
--- a/tests/typecheck/reduce_syntax_test.ts
+++ b/tests/typecheck/reduce_syntax_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/typecheck/type_alias_test.ts b/tests/typecheck/type_alias_test.ts
index b0a7691a1d..4233d0cdc8 100644
--- a/tests/typecheck/type_alias_test.ts
+++ b/tests/typecheck/type_alias_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "test-utils/mod.ts";
import { dropSchemas, recreateMigrations } from "test-utils/migrations.ts";
diff --git a/tests/typecheck/typecheck.py b/tests/typecheck/typecheck.py
index e01195b6da..dd42e8c9a5 100644
--- a/tests/typecheck/typecheck.py
+++ b/tests/typecheck/typecheck.py
@@ -1,4 +1,5 @@
-# Copyright Metatype under the Elastic License 2.0.
+# Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+# SPDX-License-Identifier: MPL-2.0
from typegraph import typegraph, effects, Policy, t, Graph
from typegraph.runtimes.deno import DenoRuntime
diff --git a/tests/typecheck/typecheck_test.ts b/tests/typecheck/typecheck_test.ts
index c351fd5186..653723be1c 100644
--- a/tests/typecheck/typecheck_test.ts
+++ b/tests/typecheck/typecheck_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
import { assertThrows } from "@std/assert";
diff --git a/tests/typegraph/version_test.ts b/tests/typegraph/version_test.ts
index b5b8530bbd..24e484c5f0 100644
--- a/tests/typegraph/version_test.ts
+++ b/tests/typegraph/version_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { expandGlob } from "@std/fs/expand-glob";
import { Meta } from "../utils/mod.ts";
diff --git a/tests/typename/typename_test.ts b/tests/typename/typename_test.ts
index 98a3bdc862..18a9912c0e 100644
--- a/tests/typename/typename_test.ts
+++ b/tests/typename/typename_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { recreateMigrations } from "../utils/migrations.ts";
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tests/utils/assert.ts b/tests/utils/assert.ts
index 98cf7a2291..60a4de1b3e 100644
--- a/tests/utils/assert.ts
+++ b/tests/utils/assert.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
export interface LazyAssertOptions {
timeoutMs: number;
diff --git a/tests/utils/autotest.ts b/tests/utils/autotest.ts
index 59486e3b83..2e9538d055 100644
--- a/tests/utils/autotest.ts
+++ b/tests/utils/autotest.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dirname, join } from "@std/path";
diff --git a/tests/utils/bindings_test.ts b/tests/utils/bindings_test.ts
index 4c9a0477b4..616c906034 100644
--- a/tests/utils/bindings_test.ts
+++ b/tests/utils/bindings_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
get_version,
diff --git a/tests/utils/database.ts b/tests/utils/database.ts
index 74dc7d57d3..cda2649004 100644
--- a/tests/utils/database.ts
+++ b/tests/utils/database.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import pg from "pg";
import { removeMigrations } from "test-utils/migrations.ts";
diff --git a/tests/utils/date.ts b/tests/utils/date.ts
index 96ab452262..fab3f1241b 100644
--- a/tests/utils/date.ts
+++ b/tests/utils/date.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
const OriginalDate = Date;
diff --git a/tests/utils/dir.ts b/tests/utils/dir.ts
index 2b5381c7b6..c090e54f5c 100644
--- a/tests/utils/dir.ts
+++ b/tests/utils/dir.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { fromFileUrl, join } from "@std/path";
diff --git a/tests/utils/hooks.ts b/tests/utils/hooks.ts
index 2e226c1b82..6f8c501b8c 100644
--- a/tests/utils/hooks.ts
+++ b/tests/utils/hooks.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { SyncConfig } from "@metatype/typegate/config.ts";
import { createBucket, tryDeleteBucket } from "test-utils/s3.ts";
diff --git a/tests/utils/meta.ts b/tests/utils/meta.ts
index 59e4c24a58..203371adbc 100644
--- a/tests/utils/meta.ts
+++ b/tests/utils/meta.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { shell, ShellOptions, ShellOutput } from "./shell.ts";
diff --git a/tests/utils/migrations.ts b/tests/utils/migrations.ts
index f5f42026ae..8d788a050d 100644
--- a/tests/utils/migrations.ts
+++ b/tests/utils/migrations.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { QueryEngine } from "@metatype/typegate/engine/query_engine.ts";
import { join } from "@std/path";
diff --git a/tests/utils/mock_fetch.ts b/tests/utils/mock_fetch.ts
index 080218b2a8..152464d196 100644
--- a/tests/utils/mock_fetch.ts
+++ b/tests/utils/mock_fetch.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
/*
Lifted from https://github.com/clo4/deno_mock_fetch/blob/1ef9476b43b1b2b4cab0aaa576f713e8339f46b6/mod.ts
diff --git a/tests/utils/mod.ts b/tests/utils/mod.ts
index 4e6121c0b9..86567aa7e5 100644
--- a/tests/utils/mod.ts
+++ b/tests/utils/mod.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// import { SingleRegister } from "test-utils/single_register.ts";
// import { Typegate } from "@metatype/typegate/typegate/mod.ts";
diff --git a/tests/utils/process.ts b/tests/utils/process.ts
index bb844a436f..7a36add6bf 100644
--- a/tests/utils/process.ts
+++ b/tests/utils/process.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { TextLineStream } from "@local/tools/deps.ts";
import { deadline } from "@std/async/deadline";
@@ -22,11 +22,12 @@ export class Lines {
// return true if the stream is exhausted
async readWhile(
check: Consumer,
- timeoutMs: number | null = 30_000,
+ timeoutMs: number | null = 30_000
): Promise {
- const next = timeoutMs == null
- ? () => this.#reader.read()
- : () => deadline(this.#reader.read(), timeoutMs);
+ const next =
+ timeoutMs == null
+ ? () => this.#reader.read()
+ : () => deadline(this.#reader.read(), timeoutMs);
let shouldContinue = true;
while (shouldContinue) {
const { value: line, done } = await next();
@@ -63,3 +64,54 @@ export async function killProcess(proc: Deno.ChildProcess) {
proc.kill("SIGKILL");
return await proc.status;
}
+
+export async function termProcess(proc: Deno.ChildProcess) {
+ proc.kill("SIGTERM");
+ return await proc.status;
+}
+
+export async function ctrlcProcess(proc: Deno.ChildProcess) {
+ proc.kill("SIGINT");
+ return await proc.status;
+}
+
+export async function enumerateAllChildUNIX(pid: number) {
+ const command = new Deno.Command("bash", {
+ args: ["-c", `ps --ppid ${pid} -o pid=`],
+ stderr: "piped",
+ stdout: "piped",
+ });
+
+ const child = command.spawn();
+ const output = await child.output();
+ const decoder = new TextDecoder();
+ const result = decoder.decode(output.stdout).trim();
+
+ const directChildren = result
+ .split("\n")
+ .map((line) => line.trim())
+ .filter((line) => line != "")
+ .map((pid) => parseInt(pid));
+
+ const all = [...directChildren];
+
+ for (const childPID of directChildren) {
+ const childChildPIDs = await enumerateAllChildUNIX(childPID);
+ all.push(...childChildPIDs);
+ }
+
+ return all;
+}
+
+export async function isPIDAliveUNIX(pid: number) {
+ const command = new Deno.Command("bash", {
+ args: ["-c", `kill -0 ${pid}`], // no-op
+ stderr: "piped",
+ stdout: "piped",
+ });
+
+ const child = command.spawn();
+ const output = await child.output();
+
+ return output.success;
+}
diff --git a/tests/utils/query/file_extractor.ts b/tests/utils/query/file_extractor.ts
index a0c1c65495..30834cb81c 100644
--- a/tests/utils/query/file_extractor.ts
+++ b/tests/utils/query/file_extractor.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { Variables } from "./mod.ts";
diff --git a/tests/utils/query/graphql_query.ts b/tests/utils/query/graphql_query.ts
index e2fea956e0..a47695f8c5 100644
--- a/tests/utils/query/graphql_query.ts
+++ b/tests/utils/query/graphql_query.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { QueryEngine } from "@metatype/typegate/engine/query_engine.ts";
import { FileExtractor } from "./file_extractor.ts";
diff --git a/tests/utils/query/mod.ts b/tests/utils/query/mod.ts
index 9c198ad0f9..d2ffb92a04 100644
--- a/tests/utils/query/mod.ts
+++ b/tests/utils/query/mod.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
assert,
diff --git a/tests/utils/query/rest_query.ts b/tests/utils/query/rest_query.ts
index d087be46d9..bcc64e7d88 100644
--- a/tests/utils/query/rest_query.ts
+++ b/tests/utils/query/rest_query.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
Context,
diff --git a/tests/utils/router@0.0.5.ts b/tests/utils/router@0.0.5.ts
index 3576698489..b7c2522ba8 100644
--- a/tests/utils/router@0.0.5.ts
+++ b/tests/utils/router@0.0.5.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// Copyright 2021 denosaurs. All rights reserved. MIT license.
diff --git a/tests/utils/s3.ts b/tests/utils/s3.ts
index d9e4747bab..4a6ac61b80 100644
--- a/tests/utils/s3.ts
+++ b/tests/utils/s3.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
CreateBucketCommand,
diff --git a/tests/utils/shell.ts b/tests/utils/shell.ts
index 4d2c82a567..3824090044 100644
--- a/tests/utils/shell.ts
+++ b/tests/utils/shell.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { testDir } from "./dir.ts";
diff --git a/tests/utils/single_register.ts b/tests/utils/single_register.ts
index 8bb631b806..448fbbc4e3 100644
--- a/tests/utils/single_register.ts
+++ b/tests/utils/single_register.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { QueryEngine } from "@metatype/typegate/engine/query_engine.ts";
import { Register } from "@metatype/typegate/typegate/register.ts";
diff --git a/tests/utils/test.ts b/tests/utils/test.ts
index 12fef6bb04..78993d9f74 100644
--- a/tests/utils/test.ts
+++ b/tests/utils/test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { SystemTypegraph } from "@metatype/typegate/system_typegraphs.ts";
import { dirname, extname, join } from "@std/path";
diff --git a/tests/utils/test_module.ts b/tests/utils/test_module.ts
index 99da40cab8..6a7003c758 100644
--- a/tests/utils/test_module.ts
+++ b/tests/utils/test_module.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { dirname, fromFileUrl } from "@std/path";
import { shell, ShellOptions, ShellOutput } from "./shell.ts";
diff --git a/tests/utils/tg_deploy_script.ts b/tests/utils/tg_deploy_script.ts
index ed4be2fa65..229781d3a8 100644
--- a/tests/utils/tg_deploy_script.ts
+++ b/tests/utils/tg_deploy_script.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { BasicAuth, tgDeploy } from "@typegraph/sdk/tg_deploy.ts";
import * as path from "@std/path";
diff --git a/tests/vars/vars_test.ts b/tests/vars/vars_test.ts
index 008aa0d8ef..31692567b2 100644
--- a/tests/vars/vars_test.ts
+++ b/tests/vars/vars_test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { gql, Meta } from "../utils/mod.ts";
diff --git a/tools/Dockerfile b/tools/Dockerfile
index aa99c54dc8..468d2e6fbb 100644
--- a/tools/Dockerfile
+++ b/tools/Dockerfile
@@ -53,7 +53,7 @@ RUN set -eux; \
apt clean autoclean; apt autoremove --yes; rm -rf /var/lib/{apt,dpkg,cache,log}/;
ARG GHJK_VERSION=v0.2.1
-RUN GHJK_INSTALL_EXE_DIR=/usr/bin GHJK_INSTALL_HOOK_SHELLS=bash \
+RUN GHJK_INSTALL_EXE_DIR=/usr/bin \
deno run -A https://raw.github.com/metatypedev/ghjk/$GHJK_VERSION/install.ts
COPY tools/ tools/
@@ -62,33 +62,31 @@ ENV GHJK_ENV=oci
ENV GHJK_ACTIVATE=.ghjk/envs/$GHJK_ENV/activate.sh
RUN ghjk envs cook
+SHELL ["/bin/sh", "-c", ". .ghjk/envs/oci/activate.sh && sh -c \"$*\"", "sh"]
+
COPY --from=plan /app/recipe.json recipe.json
ARG CARGO_PROFILE=release
-RUN . "$GHJK_ACTIVATE" \
- && cargo chef cook --recipe-path recipe.json --profile $CARGO_PROFILE --package typegate \
+RUN cargo chef cook --recipe-path recipe.json --profile $CARGO_PROFILE --package typegate \
&& rm recipe.json
COPY . .
-RUN . "$GHJK_ACTIVATE" \
- && cargo build --profile $CARGO_PROFILE --package typegate --locked \
+RUN cargo build --profile $CARGO_PROFILE --package typegate --locked \
&& ( \
- [ $CARGO_PROFILE = 'release' ] \
- && cp target/release/typegate typegate-bin \
- || cp target/debug/typegate typegate-bin \
+ [ $CARGO_PROFILE = 'release' ] \
+ && cp target/release/typegate typegate-bin \
+ || cp target/debug/typegate typegate-bin \
)
-RUN . "$GHJK_ACTIVATE" \
- && deno run -A tools/update.ts --cache-only --src-only \
+RUN deno run -A tools/update.ts --cache-only --src-only \
&& mkdir -p .metatype
#
FROM builder AS dev
-RUN . "$GHJK_ACTIVATE" \
- && mv target /tmp/target \
+RUN mv target /tmp/target \
&& rm -rf * \
&& mv /tmp/target .
@@ -100,8 +98,7 @@ ARG TARGETARCH
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
-RUN . "$GHJK_ACTIVATE" \
- && chmod +x /tini \
+RUN chmod +x /tini \
&& mkdir -p /lib/sym \
&& ln -s /lib/aarch64-linux-gnu /lib/sym/arm64 \
&& ln -s /lib/x86_64-linux-gnu /lib/sym/amd64
@@ -131,7 +128,7 @@ COPY --from=builder /app/src/typegate/deno.jsonc ./src/typegate/
COPY --from=builder /app/src/typegraph/deno/deno.json ./src/typegraph/deno/
COPY --from=builder /app/tests/deno.jsonc ./tests/
COPY --from=builder /app/examples/deno.jsonc ./examples/
-COPY tools/LICENSE-Elastic-2.0.md LICENSE.md
+COPY tools/LICENSE-MPL-2.0.md LICENSE.md
# writeable
COPY --from=builder --chown=nonroot:nonroot /deno-dir /deno-dir
diff --git a/tools/Dockerfile.dockerignore b/tools/Dockerfile.dockerignore
index 9f797defd5..009d0d863c 100644
--- a/tools/Dockerfile.dockerignore
+++ b/tools/Dockerfile.dockerignore
@@ -2,14 +2,16 @@
!tools/*.ts
!tools/tasks/
-!tools/LICENSE-Elastic-2.0.md
+!tools/LICENSE-MPL-2.0.md
!src/common
!src/meta-cli/Cargo.toml
!src/metagen/Cargo.toml
!src/metagen/src/fdk_rust/static/Cargo.toml
+!src/metagen/src/client_rs/static/Cargo.toml
!src/mt_deno
!src/pyrt_wit_wire
+!src/substantial/
!src/typegate/
!src/typegraph/core/
!src/wit/
diff --git a/tools/LICENSE-Elastic-2.0.md b/tools/LICENSE-Elastic-2.0.md
deleted file mode 100644
index e9e68bb9c3..0000000000
--- a/tools/LICENSE-Elastic-2.0.md
+++ /dev/null
@@ -1,91 +0,0 @@
-## Elastic License 2.0 (Elastic-2.0)
-
-### Acceptance
-
-By using the software, you agree to all of the terms and conditions below.
-
-### Copyright License
-
-The licensor grants you a non-exclusive, royalty-free, worldwide,
-non-sublicensable, non-transferable license to use, copy, distribute, make
-available, and prepare derivative works of the software, in each case subject to
-the limitations and conditions below.
-
-### Limitations
-
-You may not provide the software to third parties as a hosted or managed
-service, where the service provides users with access to any substantial set of
-the features or functionality of the software.
-
-You may not move, change, disable, or circumvent the license key functionality
-in the software, and you may not remove or obscure any functionality in the
-software that is protected by the license key.
-
-You may not alter, remove, or obscure any licensing, copyright, or other notices
-of the licensor in the software. Any use of the licensor’s trademarks is subject
-to applicable law.
-
-### Patents
-
-The licensor grants you a license, under any patent claims the licensor can
-license, or becomes able to license, to make, have made, use, sell, offer for
-sale, import and have imported the software, in each case subject to the
-limitations and conditions in this license. This license does not cover any
-patent claims that you cause to be infringed by modifications or additions to
-the software. If you or your company make any written claim that the software
-infringes or contributes to infringement of any patent, your patent license for
-the software granted under these terms ends immediately. If your company makes
-such a claim, your patent license ends immediately for work on behalf of your
-company.
-
-### Notices
-
-You must ensure that anyone who gets a copy of any part of the software from you
-also gets a copy of these terms.
-
-If you modify the software, you must include in any modified copies of the
-software prominent notices stating that you have modified the software.
-
-### No Other Rights
-
-These terms do not imply any licenses other than those expressly granted in
-these terms.
-
-### Termination
-
-If you use the software in violation of these terms, such use is not licensed,
-and your licenses will automatically terminate. If the licensor provides you
-with a notice of your violation, and you cease all violation of this license no
-later than 30 days after you receive that notice, your licenses will be
-reinstated retroactively. However, if you violate these terms after such
-reinstatement, any additional violation of these terms will cause your licenses
-to terminate automatically and permanently.
-
-### No Liability
-
-_As far as the law allows, the software comes as is, without any warranty or
-condition, and the licensor will not be liable to you for any damages arising
-out of these terms or the use or nature of the software, under any kind of legal
-claim._
-
-### Definitions
-
-The **licensor** is the entity offering these terms, and the **software** is the
-software the licensor makes available under these terms, including any portion
-of it.
-
-**you** refers to the individual or entity agreeing to these terms.
-
-**your company** is any legal entity, sole proprietorship, or other kind of
-organization that you work for, plus all organizations that have control over,
-are under the control of, or are under common control with that organization.
-**control** means ownership of substantially all the assets of an entity, or the
-power to direct its management and policies by vote, contract, or otherwise.
-Control can be direct or indirect.
-
-**your licenses** are all the licenses granted to you for the software under
-these terms.
-
-**use** means anything you do with the software requiring one of your licenses.
-
-**trademark** means trademarks, service marks, and similar rights.
diff --git a/tools/consts.ts b/tools/consts.ts
index da8edbb205..01707f3ba9 100644
--- a/tools/consts.ts
+++ b/tools/consts.ts
@@ -1,8 +1,8 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
-export const METATYPE_VERSION = "0.5.0-rc.4";
-export const PUBLISHED_VERSION = "0.5.0-rc.3";
+export const METATYPE_VERSION = "0.5.0-rc.6";
+export const PUBLISHED_VERSION = "0.5.0-rc.5";
export const GHJK_VERSION = "v0.2.1";
export const GHJK_ACTION_VERSION = "318209a9d215f70716a4ac89dbeb9653a2deb8bc";
export const RUST_VERSION = "1.80.1";
diff --git a/tools/deps.ts b/tools/deps.ts
index 8e7069d80b..2bd2bfb1e7 100644
--- a/tools/deps.ts
+++ b/tools/deps.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
// FIXME: we can't use the import map in ghjk so we must
// rely on a deps.ts
diff --git a/tools/installs.ts b/tools/installs.ts
index 0e99b20525..8fce5111a2 100644
--- a/tools/installs.ts
+++ b/tools/installs.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { DENO_VERSION, PYTHON_VERSION, RUST_VERSION } from "./consts.ts";
import { ports } from "./deps.ts";
diff --git a/tools/license-header-Elastic-2.0.txt b/tools/license-header-Elastic-2.0.txt
deleted file mode 100644
index cd12e09928..0000000000
--- a/tools/license-header-Elastic-2.0.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-SPDX-License-Identifier: Elastic-2.0
diff --git a/tools/tasks/build.ts b/tools/tasks/build.ts
index b285c7918c..c7b02aaa42 100644
--- a/tools/tasks/build.ts
+++ b/tools/tasks/build.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { DenoTaskDefArgs } from "../deps.ts";
diff --git a/tools/tasks/dev.ts b/tools/tasks/dev.ts
index cdaeadcb5f..3d4c43296f 100644
--- a/tools/tasks/dev.ts
+++ b/tools/tasks/dev.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { DenoTaskDefArgs } from "../deps.ts";
diff --git a/tools/tasks/fetch.ts b/tools/tasks/fetch.ts
index 72c02c8099..8c625bf182 100644
--- a/tools/tasks/fetch.ts
+++ b/tools/tasks/fetch.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { DenoTaskDefArgs } from "../deps.ts";
diff --git a/tools/tasks/gen.ts b/tools/tasks/gen.ts
index 79af794885..bab72d4f4b 100644
--- a/tools/tasks/gen.ts
+++ b/tools/tasks/gen.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import type { DenoTaskDefArgs } from "../deps.ts";
import { ports } from "../deps.ts";
diff --git a/tools/tasks/install.ts b/tools/tasks/install.ts
index 09d4bbdd64..bf8e3943af 100644
--- a/tools/tasks/install.ts
+++ b/tools/tasks/install.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { type DenoTaskDefArgs, std_url } from "../deps.ts";
import { WASMTIME_VERSION } from "../consts.ts";
diff --git a/tools/tasks/lint.ts b/tools/tasks/lint.ts
index 6837ea2def..7b19c02fdb 100644
--- a/tools/tasks/lint.ts
+++ b/tools/tasks/lint.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { type DenoTaskDefArgs, ports } from "../deps.ts";
import installs from "../installs.ts";
diff --git a/tools/tasks/lock.ts b/tools/tasks/lock.ts
index 8dc229d72d..c18325210c 100644
--- a/tools/tasks/lock.ts
+++ b/tools/tasks/lock.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { copyLock, type DenoTaskDefArgs, parseArgs, sedLock } from "../deps.ts";
import * as consts from "../consts.ts";
diff --git a/tools/tasks/mod.ts b/tools/tasks/mod.ts
index dd0274222f..1d5f38e19f 100644
--- a/tools/tasks/mod.ts
+++ b/tools/tasks/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 type { DenoTaskDefArgs } from "../deps.ts";
import tasksBuild from "./build.ts";
@@ -10,12 +13,12 @@ import tasksLock from "./lock.ts";
import tasksTest from "./test.ts";
export default {
- ...tasksBuild,
- ...tasksDev,
- ...tasksFetch,
- ...tasksGen,
- ...tasksInstall,
- ...tasksLint,
- ...tasksLock,
- ...tasksTest,
+ ...tasksBuild,
+ ...tasksDev,
+ ...tasksFetch,
+ ...tasksGen,
+ ...tasksInstall,
+ ...tasksLint,
+ ...tasksLock,
+ ...tasksTest,
} satisfies Record;
diff --git a/tools/tasks/test.ts b/tools/tasks/test.ts
index df197b7a9f..b497440b44 100644
--- a/tools/tasks/test.ts
+++ b/tools/tasks/test.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { testE2eCli } from "../test.ts";
import type { DenoTaskDefArgs } from "../deps.ts";
diff --git a/tools/test.ts b/tools/test.ts
index 2f616b621f..014ca1c32d 100755
--- a/tools/test.ts
+++ b/tools/test.ts
@@ -1,7 +1,7 @@
#!/bin/env -S ghjk deno run -A
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
/**
* A utility script to run tests.
diff --git a/tools/tree-view-web.ts b/tools/tree-view-web.ts
index e8e036deb6..26b2a2b5fe 100755
--- a/tools/tree-view-web.ts
+++ b/tools/tree-view-web.ts
@@ -1,7 +1,7 @@
#!/bin/env -S ghjk deno run -A
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
/**
* Usage:
diff --git a/tools/tree-view.ts b/tools/tree-view.ts
index 200fc71d10..22ef1b83e3 100755
--- a/tools/tree-view.ts
+++ b/tools/tree-view.ts
@@ -1,7 +1,7 @@
#!/bin/env -S ghjk deno run -A
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
/**
* Usage:
diff --git a/tools/typegraph-size.ts b/tools/typegraph-size.ts
index 1a153c909f..c730e12a59 100644
--- a/tools/typegraph-size.ts
+++ b/tools/typegraph-size.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { projectDir, runOrExit } from "./utils.ts";
import { bytes, formatDuration, resolve } from "./deps.ts";
diff --git a/tools/update.ts b/tools/update.ts
index 149e3fbb89..a3718003f1 100755
--- a/tools/update.ts
+++ b/tools/update.ts
@@ -1,7 +1,7 @@
#!/bin/env -S ghjk deno run -A --config=typegate/deno.jsonc
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import {
$,
diff --git a/tools/utils.ts b/tools/utils.ts
index 172c7efda5..96558d1f19 100644
--- a/tools/utils.ts
+++ b/tools/utils.ts
@@ -1,5 +1,5 @@
-// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
-// SPDX-License-Identifier: Elastic-2.0
+// Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0.
+// SPDX-License-Identifier: MPL-2.0
import { copySync, dirname, fromFileUrl, join, resolve } from "./deps.ts";