Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: upload url path and add logging in the SDK #740

Merged
merged 38 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
74d7210
update deployed version
Natoandro May 25, 2024
a346331
(cli) new actors
Natoandro May 29, 2024
be00039
(doc) update actor model diagram
Natoandro May 29, 2024
f5ef1c3
(typegraph/sdk) implement logging system
Natoandro May 30, 2024
af6066b
fix summary, TS sdk fetch
Natoandro May 30, 2024
4c3abcc
use relative typegraph paths for display
Natoandro May 30, 2024
1e8b9ce
(python sdk) add logging
Natoandro May 30, 2024
a8c2b36
unpack migrations
Natoandro May 31, 2024
9217921
feat: task io protocol
Natoandro Jun 5, 2024
9b19d19
feat: task source, task queue, task ref
Natoandro Jun 6, 2024
0a898f2
fix python sdk
Natoandro Jun 7, 2024
08770af
fix python typegraph deployment, oauth2 example
Natoandro Jun 7, 2024
5650b06
custom rpc handlers
Natoandro Jun 8, 2024
99ef7d3
task i/o actor, new cli envs, followup process
Natoandro Jun 11, 2024
f98adbf
fix migrations
Natoandro Jun 11, 2024
ea2e4e8
cleanup, remove server store
Natoandro Jun 11, 2024
8f52978
Merge branch 'main' into deployment
Natoandro Jun 11, 2024
c005bd2
fix
Natoandro Jun 11, 2024
19aad79
lint, fix tg_deploy test
Natoandro Jun 11, 2024
82bc03d
fix pre-commit
Natoandro Jun 11, 2024
3ac7d14
fix metagen test
Natoandro Jun 11, 2024
dbe7e15
pass error stack to the cli
Natoandro Jun 12, 2024
6ffb4cb
fix injection test
Natoandro Jun 12, 2024
e84a37e
fix template_test
Natoandro Jun 12, 2024
a40e920
artifact resolution env, path only artifact data in materializers
Natoandro Jun 13, 2024
f677bad
fix website test
Natoandro Jun 14, 2024
834ab6f
Merge branch 'main' into deployment
Natoandro Jun 14, 2024
1653602
fix metagen
Natoandro Jun 14, 2024
df6a52f
display debugging info
Natoandro Jun 14, 2024
9abbe0c
upload tokens
Natoandro Jun 14, 2024
e8c9e86
fix e2e dev_test.ts
Natoandro Jun 17, 2024
eaf3719
update snapshot for typegraph_test
Natoandro Jun 17, 2024
66a21b1
(ci/debug) try deployment with `pnpm dlx tsx`
Natoandro Jun 17, 2024
778e3bc
update actor-model diagram
Natoandro Jun 17, 2024
d2d4d75
remove com module
Natoandro Jun 17, 2024
671ab4f
process wait timeout
Natoandro Jun 17, 2024
8c666c8
update CLI docs
Natoandro Jun 17, 2024
11400dd
Merge branch 'main' into deployment
Natoandro Jun 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .ghjk/lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "0",
"platform": "aarch64-darwin",
"platform": "x86_64-linux",
"moduleEntries": {
"ports": {
"version": "0",
Expand Down Expand Up @@ -809,6 +809,7 @@
"69cc04434a8b51a9d34210383f1a931646772e3b",
"8e5e02544073c4733d8f2156c404a0dd524cdaaf",
"54eba38cb79f88fca14cd3185e5bec0c3dd02682",
"e05f859f4a734a85fd3439f9b0fc0de1e733bdac",
"38285a3b335e394ccce5ac5d59e15f660bfa4cc9",
"7bbf00da8e265c56c2bff5bb7d89ba806e2590d2",
"14fd3752a984c5d82e1451f7388c73a21fcce705",
Expand Down Expand Up @@ -1352,6 +1353,25 @@
"crateName": "cross",
"locked": true
},
"e05f859f4a734a85fd3439f9b0fc0de1e733bdac": {
"version": "v2.4.0",
"port": {
"ty": "denoWorker@v1",
"name": "mold_ghrel",
"platforms": [
"aarch64-linux",
"x86_64-linux"
],
"version": "0.1.0",
"deps": [
{
"name": "tar_aa"
}
],
"moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/2725af8/ports/mold.ts"
},
"replaceLd": false
},
"38285a3b335e394ccce5ac5d59e15f660bfa4cc9": {
"version": "3.8.18",
"port": {
Expand Down
12 changes: 3 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"website/.docusaurus": true,
"website/node_modules": true
},
"deno.enablePaths": [
"typegate",
"dev",
"examples/templates/deno",
],
"deno.enablePaths": ["typegate", "dev", "examples/templates/deno"],
"deno.unstable": true,
"typescript.suggest.completeFunctionCalls": true,
"typescript.inlayHints.variableTypes.enabled": true,
Expand Down Expand Up @@ -56,8 +52,6 @@
"wasmedge"
],
"python.languageServer": "Pylance",
"python.analysis.extraPaths": [
"typegraph/python"
],
"prettier.proseWrap": "never",
"python.analysis.extraPaths": ["typegraph/python"],
"prettier.proseWrap": "never"
}
47 changes: 46 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dev/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ dev:
examples/**/pyproject.toml:
(typegraph = ").+("): METATYPE_VERSION
examples/**/package.json:
'(\s*"@typegraph\/sdk"\s*:\s*"\^).+(",?)': PUBLISHED_VERSION
'(\s*"@typegraph\/sdk"\s*:\s*"\^).+(",?)': METATYPE_VERSION
examples/**/*.ts:
'(import\s+.+\s+from "npm:@typegraph\/sdk@)[^\/]+(\/.+";)': PUBLISHED_VERSION
'(import\s+.+\s+from "npm:@typegraph\/sdk@)[^\/]+(\/.+";)': METATYPE_VERSION
typegate/import_map.json:
'(\s*"@typegraph\/sdk"\s*:\s*"npm:@typegraph\/sdk@).+(",?)': METATYPE_VERSION
'(\s*"@typegraph\/sdk\/"\s*:\s*"npm:/@typegraph\/sdk@).+(\/",?)': METATYPE_VERSION
Expand Down
25 changes: 20 additions & 5 deletions examples/metatype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ typegates:
username: admin
password: password
secrets:
quick-start-project:
POSTGRES: postgresql://postgres:password@localhost:5432/db?schema=quick_start_project
basic-authentication:
BASIC_admin: "password"
jwt-authentication:
Expand Down Expand Up @@ -67,13 +69,15 @@ typegates:
roadmap:
BASIC_andim: hunter2
func-gql:
POSTGRES: "postgresql://postgres:password@localhost:5432/db?schema=func_ctx"
POSTGRES: "postgresql://postgres:password@localhost:5432/db?schema=func_gql"

prd:
url: https://demo.metatype.dev
username: admin
password: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/TG_ADMIN_PASSWORD
secrets:
quick-start-project:
POSTGRES: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/TG_QUICK_START_PROJECT_POSTGRES
basic-authentication:
BASIC_admin: "password"
jwt-authentication:
Expand Down Expand Up @@ -112,10 +116,10 @@ typegates:
GITHUB_CLIENT_ID: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/GITHUB_CLIENT_SECRET
files-upload:
S3_HOST: http://localhost:9000
S3_REGION: local
S3_ACCESS_KEY: minio
S3_SECRET_KEY: password
S3_HOST: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/S3_HOST
S3_REGION: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/S3_REGION
S3_ACCESS_KEY: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/S3_ACCESS_KEY
S3_SECRET_KEY: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/S3_SECRET_KEY
roadmap-prisma:
POSTGRES: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/TG_ROADMAP_PRISMA_POSTGRES
BASIC_andim: hunter2
Expand All @@ -136,11 +140,22 @@ typegates:
BASIC_andim: hunter2
roadmap:
BASIC_andim: hunter2
func-gql:
POSTGRES: infisical://app.infisical.com/643057c5bb17b13ef6e73d99/prod/TG_FUNC_GQL_POSTGRES

typegraphs:
materializers:
prisma:
migrations_path: "migrations"
python:
exclude:
- "**/*"
- "typegraphs/temporal.py"
typescript:
exclude:
- "typegraphs/temporal.ts"
include:
- "typegraphs/*.ts"

metagen:
targets:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- CreateTable
CREATE TABLE "idea" (
"id" UUID NOT NULL,
"name" TEXT NOT NULL,
"desc" TEXT,
"authorEmail" TEXT NOT NULL,

CONSTRAINT "idea_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "vote" (
"id" UUID NOT NULL,
"authorEmail" TEXT NOT NULL,
"ideaId" UUID NOT NULL,

CONSTRAINT "vote_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "vote" ADD CONSTRAINT "vote_ideaId_fkey" FOREIGN KEY ("ideaId") REFERENCES "idea"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "message" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
"body" TEXT NOT NULL,

CONSTRAINT "message_pkey" PRIMARY KEY ("id")
);
3 changes: 3 additions & 0 deletions examples/migrations/roadmap-reduce/db/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
3 changes: 3 additions & 0 deletions examples/migrations/roadmap-rest/db/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
6 changes: 3 additions & 3 deletions examples/templates/deno/api/example.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Policy, t, typegraph } from "npm:@typegraph/sdk@0.4.2/index.js";
import { PythonRuntime } from "npm:@typegraph/sdk@0.4.2/runtimes/python.js";
import { DenoRuntime } from "npm:@typegraph/sdk@0.4.2/runtimes/deno.js";
import { Policy, t, typegraph } from "npm:@typegraph/sdk@0.4.3-0/index.js";
import { PythonRuntime } from "npm:@typegraph/sdk@0.4.3-0/runtimes/python.js";
import { DenoRuntime } from "npm:@typegraph/sdk@0.4.3-0/runtimes/deno.js";

await typegraph("example", (g) => {
const pub = Policy.public();
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "MCLI_LOADER_CMD='npm x tsx' meta dev"
},
"dependencies": {
"@typegraph/sdk": "^0.4.2"
"@typegraph/sdk": "^0.4.3-0"
},
"devDependencies": {
"tsx": "^3.13.0",
Expand Down
42 changes: 24 additions & 18 deletions examples/typegraphs/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@ import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";

// skip:end

await typegraph({
name: "basic-authentication",
// skip:next-line
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
}, (g) => {
const deno = new DenoRuntime();
const pub = Policy.public();
await typegraph(
{
name: "basic-authentication",
// skip:next-line
cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },
},
(g) => {
const deno = new DenoRuntime();
const pub = Policy.public();

const ctx = t.struct({
"username": t.string().optional(),
});
const ctx = t.struct({
username: t.string().optional(),
});

// highlight-next-line
g.auth(Auth.basic(["admin"]));
// highlight-next-line
g.auth(Auth.basic(["admin"]));

g.expose({
get_context: deno.identity(ctx).apply({
username: g.fromContext("username"),
}).withPolicy(pub),
});
});
g.expose({
get_context: deno
.identity(ctx)
.apply({
username: g.fromContext("username"),
})
.withPolicy(pub),
});
},
);
2 changes: 1 addition & 1 deletion examples/typegraphs/deno.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def deno(g: Graph):
t.struct({"n": t.float()}),
t.struct({"res": t.integer(), "ms": t.float()}),
code="""
({ n }) => {
({ n }) => {
let a = 0, b = 1, c;
const start = performance.now();
for (
Expand Down
Loading
Loading