Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/404.html b/404.html index b357dc2612..ee50f23470 100644 --- a/404.html +++ b/404.html @@ -17,8 +17,8 @@ - - + +
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
dev
subcommand",id:"1-dev-subcommand",level:3},{value:"2. typegate
subcommand",id:"2-typegate-subcommand",level:3}];function r(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.em,{children:"Meta CLI"})," comes with an embedded typegate packaged inside it. A ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"typegate"})," instance is where you deploy your ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"typegraphs"})," where any logic written in them is exposed via an HTTP or GraphQL endpoints. You can run an embedded typegate node from the terminal. There are two ways to launch the embedded typegate"]}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If you have not installed ",(0,s.jsx)(n.em,{children:"Meta CLI"})," or you have downloaded the ",(0,s.jsx)(n.em,{children:"thin"})," version, you can check ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli#Installation",children:"this"})," installation guide of the ",(0,s.jsx)(n.em,{children:"CLI"}),"."]})}),"\n",(0,s.jsxs)(n.h3,{id:"1-dev-subcommand",children:["1. ",(0,s.jsx)(n.code,{children:"dev"})," subcommand"]}),"\n",(0,s.jsx)(n.p,{children:"You can start the embedded typegatxe easily with default configs using the following command."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsx)(n.p,{children:"The above command can be a good gateway to get started and also for development purposes. But if you want more granular control, you can use the second approach."}),"\n",(0,s.jsxs)(n.h3,{id:"2-typegate-subcommand",children:["2. ",(0,s.jsx)(n.code,{children:"typegate"})," subcommand"]}),"\n",(0,s.jsxs)(n.p,{children:["Set the ",(0,s.jsx)(n.code,{children:"tg_admin_password"})," and ",(0,s.jsx)(n.code,{children:"tg_secret"})," environment variables. You can use the following command to configure a sample value for the variables and test the embedded typegate."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"export tg_secret=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw== tg_admin_password=password\n"})}),"\n",(0,s.jsx)(n.p,{children:"Run the instance"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta typegate\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The typegate instance runs on port ",(0,s.jsx)(n.code,{children:"7890"})," by default. You can check if the typegate node is running by accessing ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"http://localhost:7890"})," in your browser."]})]})}function i(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},49447:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>v,contentTitle:()=>b,default:()=>T,frontMatter:()=>j,metadata:()=>w,toc:()=>k});var s=t(86070),a=t(25710),o=t(14344),r=t(96503),i=t(22356),c=t(65480),d=t(27676),l=t(7871),p=t(65671);function h(e){const n={a:"a",code:"code",em:"em",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["To bootstrap a python ",(0,s.jsx)(n.code,{children:"Metatype"})," project, run the following commands on your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# create startup files\nmeta new --template python\n\n# install dependencies\npoetry install\n\n# create and activate virtual environment\npoetry shell\n"})}),"\n",(0,s.jsx)(n.p,{children:"This will create the necessary files for development, some of which are:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".graphqlrc.yaml"}),": configuration file to define settings and options related to GraphQL."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compose.yml"}),": is where the typegate node and similar services are setup."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"metatype.yaml"}),": is where you configure different variables such as authentication, secrets... used by the backend."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The command also creates a directory called ",(0,s.jsx)(n.code,{children:"api"})," where you will be building much of your applications's business logic. Inside the ",(0,s.jsx)(n.code,{children:"api"})," directory, you will find a single file called ",(0,s.jsx)(n.code,{children:"example.py"})," which defines a simple ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"python",children:t(25063).content}),"\n",(0,s.jsxs)(n.p,{children:["Let's break down the above code snippet. The ",(0,s.jsx)(n.code,{children:"example"})," function is where most of the logic lives. You need to decorate the function with ",(0,s.jsx)(n.code,{children:"@typegraph()"})," from the typegraph SDK. Inside the function, you have different components of your application."]}),"\n",(0,s.jsxs)(n.p,{children:["Metatype uses Policy Based ",(0,s.jsx)(n.a,{href:"/docs/reference/policies",children:"Access Control"})," for accessing resources in your backend and here you have defined a public access."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"public = Policy.public()\n"})}),"\n",(0,s.jsxs)(n.p,{children:["There is a runtime defined namely ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/python",children:"PythonRuntime"}),". You will be using the runtime to perform different data operations along with the other ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes",children:"runtimes"})," Metatype provides."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"python = PythonRuntime()\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have runtimes to process data and you have specified access control, you need to define endpoints to communicate with your backend. This is where you use the ",(0,s.jsx)(n.code,{children:"g.expose"})," method to enumerate the endpoints you want in your application. From the starter file, you can see that you have defined an endpoint ",(0,s.jsx)(n.code,{children:"hello"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'# custom functions\nhello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n)\n\ng.expose(public, hello=hello)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"hello"})," endpoint is mapped with a ",(0,s.jsx)(n.code,{children:"custom function"})," which accepts a ",(0,s.jsx)(n.code,{children:"string"})," and returns ",(0,s.jsx)(n.strong,{children:"hello"})," concatinated with the ",(0,s.jsx)(n.code,{children:"string"}),". The processing of data is done using the ",(0,s.jsx)(n.code,{children:"PythonRuntime"}),". When you are defining the custom function, you pass the input type, output type and then a ",(0,s.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"function"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You have created your first ",(0,s.jsx)(n.code,{children:"Metatype"})," app. It's as easy as this. Before you go ahead and test your app, let's add two more endpoints which peform basic ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," database operation."]}),"\n",(0,s.jsxs)(n.p,{children:["In order to exercise database capabilities, you need to build a table schema or a model. The typegraph SDK provides rich ",(0,s.jsx)(n.a,{href:"/docs/reference/types",children:"Types"})," which you can use to create any database table that fits to your usecase. Let's create a simple Message table which has fields ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"title"})," and ",(0,s.jsx)(n.code,{children:"body"}),". This is what it will look like in code."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'message = t.struct(\n {\n id"": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n name="message",\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Great! Now you need a runtime which processes database requests. You will be using another runtime that comes out of the box with ",(0,s.jsx)(n.code,{children:"Metatype"}),". i.e the ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"PrismaRuntime"}),". Let's go ahead and introduce the ",(0,s.jsx)(n.code,{children:"PrismaRuntime"})," to your app. You can add the following code below the ",(0,s.jsx)(n.code,{children:"PythonRuntime"})," that was predefined."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'...\npython = PythonRuntime()\ndb = PrismaRuntime("database", "POSTGRES_CONN")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Last, you need to expose a ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," endpoints to your database table. Let's add these two lines to ",(0,s.jsx)(n.code,{children:"g.expose"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"...\ng.expose(\n public,\n hello=hello,\n create_message=db.create(message),\n list_messages=db.find_many(message),\n)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["With these simple steps, you were able to build a basic backend with database capabilities. Finally, this is what your typegraph looks like in ",(0,s.jsx)(n.code,{children:"example.py"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"python",children:t(12599).content}),"\n",(0,s.jsxs)(n.p,{children:["You are almost there to test your first ",(0,s.jsx)(n.code,{children:"Metatype"})," application. You now need to spin a ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"Tyepgate"})," and deploy your typegraph to the instance. You can leverage the embedded typegate that comes with the ",(0,s.jsx)(n.em,{children:"Meta CLI"}),". To run the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"embedded typegate"}),", execute the following command from your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once you started your typegate instance using one of the available choice, if you open ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"localhost:7890"})," in your browser, you will get a webpage similar to this one."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/running-typegate.png",alt:"running typegate"}),"\n",(0,s.jsxs)(n.p,{children:["To deploy your typegraph to the typegate engine, there are two approaces you can follow. You can either use ",(0,s.jsx)(n.a,{href:"/docs/guides/programmatic-deployment",children:"self-deploy"})," which comes with the typegraph SDK or the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"Meta CLI"}),". For now, you will be deploying your typegraph using the ",(0,s.jsx)(n.code,{children:"Meta CLI"}),". Execute the command below on your terminal to deploy the typegraph."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n"})}),"\n",(0,s.jsx)(n.p,{children:"Upon successful deployment of the typegraph, you should recieve a response similar like this."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:'(example-py3.11) user@pc first-project % meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n[INFO] Loading module "/Users/user/Documents/metatype-playground/projects/first-project/api/example.py"\n[INFO] Loaded 1 typegraph from "/Users/user/Documents/metatype-playground/projects/first-project/api/example.py": example\n[INFO] All modules have been loaded. Stopping the loader.\n[INFO] Pushing typegraph example (from \'/Users/user/Documents/metatype-playground/projects/first-project/api/example.py\')\n[INFO] \u2713 Successfully pushed typegraph example.\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You have deployed your first typegraph. It's time to run and test your backend which is running on your typegate instance. Click ",(0,s.jsx)(n.a,{href:"http://localhost:7890/example",children:"here"})," to open a ",(0,s.jsx)(n.code,{children:"GraphiQL"})," interface and interact with your backend through ",(0,s.jsx)(n.code,{children:"graphql"})," queries from your browser. You should get a page similar to the one below."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/tg-on-typegate.png",alt:"typegraph on typegate"}),"\n",(0,s.jsxs)(n.p,{children:["Now you can play with your app through the interface. You can try this ",(0,s.jsx)(n.code,{children:"graphql"})," query as a start."]}),"\n",(0,s.jsx)(n.p,{children:"Create a message using the following mutation."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"Then, fetch the created message using the query below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:"query {\n list_messages\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:"You should get a response from the typegate similar to then one below."}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/query-result.png",alt:"query result"}),"\n",(0,s.jsx)(n.p,{children:"You can also try out what you have built so far here on this playground."}),"\n",(0,s.jsx)(p.A,{typegraph:"quick-start-project",python:t(12599),query:t(84443)})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}function m(e){const n={a:"a",code:"code",em:"em",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["There are two variations to write your app using Typescript. You can either use ",(0,s.jsx)(n.code,{children:"node"})," or ",(0,s.jsx)(n.code,{children:"deno"})," as the TypeScript runtime. For now, you will be using ",(0,s.jsx)(n.code,{children:"node"}),". To bootstrap a node ",(0,s.jsx)(n.code,{children:"Metatype"})," project, you can run the following commands."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# create startup files\nmeta new --template node\n\n# install dependencies\nnpm install\n"})}),"\n",(0,s.jsx)(n.p,{children:"This will create the necessary files for development, some of which are:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".graphqlrc.yaml"}),": configuration file to define settings and options related to GraphQL."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compose.yml"}),": is where the typegate node and similar services are setup."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"metatype.yaml"}),": is where you configure different variables such as authentication, secrets... used by the backend."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The command also creates a directory called ",(0,s.jsx)(n.code,{children:"api"})," where you will be building much of your applications's business logic. Inside the ",(0,s.jsx)(n.code,{children:"api"})," directory, you will find a single file called ",(0,s.jsx)(n.code,{children:"example.ts"})," which defines a simple ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"typescript",children:t(1755).content}),"\n",(0,s.jsxs)(n.p,{children:["Let's break down the above code snippet. The ",(0,s.jsx)(n.code,{children:"typegraph"})," function is your building block and it encompasses most of the app logic inside. It takes a name and a callback function as an argument. All the magic is done inside the callback function."]}),"\n",(0,s.jsxs)(n.p,{children:["Metatype uses Policy Based ",(0,s.jsx)(n.a,{href:"/docs/reference/policies",children:"Access Control"})," for accessing resources in your backend and here you have defined a public access."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"const pub = Policy.public();\n"})}),"\n",(0,s.jsxs)(n.p,{children:["There are two runtimes defined namely ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/python",children:"PythonRuntime"})," and ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/deno",children:"DenoRuntime"}),". You will be using these two runtimes to perform different data operations along with the other ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes",children:"runtimes"})," Metatype provides."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"const deno = new DenoRuntime();\nconst python = new PythonRuntime();\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have runtimes to process data and you have specified your access control, you need to define endpoints to communicate with your backend. This is where you use the ",(0,s.jsx)(n.code,{children:"g.expose"})," method to enumerate the endpoints you want in your application. From the starter file, you can see that you have defined two endpoints, ",(0,s.jsx)(n.code,{children:"add"})," and ",(0,s.jsx)(n.code,{children:"multiply"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"g.expose({\n add: python\n .fromLambda(t.struct({ first: t.float(), second: t.float() }), t.float(), {\n code: \"lambda x: x['first'] + x['second']\",\n })\n .withPolicy(pub),\n multiply: deno\n .func(t.struct({ first: t.float(), second: t.float() }), t.float(), {\n code: \"({first, second}) => first * second\",\n })\n .withPolicy(pub),\n});\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Let's dive into what the ",(0,s.jsx)(n.code,{children:"add"})," endpoint is doing. The ",(0,s.jsx)(n.code,{children:"add"})," endpoint defines a ",(0,s.jsx)(n.code,{children:"custom function"})," which does data processing using the ",(0,s.jsx)(n.code,{children:"PythonRuntime"}),". When you are defining the custom function, you pass the input type, output type and then a ",(0,s.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"function"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You have created your first ",(0,s.jsx)(n.code,{children:"Metatype"})," app. It's as easy as this. Before you go ahead and test your app, let's add two more endpoints which peform basic ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," database operation."]}),"\n",(0,s.jsxs)(n.p,{children:["In order to exercise database capabilities, you need to build a table schema or a model. The typegraph SDK provides rich ",(0,s.jsx)(n.a,{href:"/docs/reference/types",children:"Types"})," which you can use to create any database table that fits to your usecase. Let's create a simple Message table which has fields ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"title"})," and ",(0,s.jsx)(n.code,{children:"body"}),". This is what it will look like in code."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const message = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }), // configuring your primary key\n title: t.string(),\n body: t.string(),\n },\n { name: "message" }, // the name of your type\n);\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Great! Now you need a runtime which processes database requests. You will be using another runtime that comes out of the box with ",(0,s.jsx)(n.code,{children:"Metatype"}),". i.e the ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"PrismaRuntime"}),". Let's go ahead and introduce the ",(0,s.jsx)(n.code,{children:"PrismaRuntime"})," to your app. You can add the following code below the two runtimes that were predefined."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'...\nconst python = new PythonRuntime();\nconst db = new PrismaRuntime("database", "POSTGRES_CONN");\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Last, you need to expose a ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," endpoints to your database table. Let's add these two lines to ",(0,s.jsx)(n.code,{children:"g.expose"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"...\ng.expose({\n ...,\n // add following to your typegraph\n create_message: db.create(message).withPolicy(pub),\n list_messages: db.findMany(message).withPolicy(pub),\n});\n"})}),"\n",(0,s.jsxs)(n.p,{children:["With these three simple steps, you were able to build a basic backend with database capabilities. Finally, this is what your typegraph looks like in ",(0,s.jsx)(n.code,{children:"example.ts"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"typescript",children:t(5641).content}),"\n",(0,s.jsxs)(n.p,{children:["You are almost there to test your first ",(0,s.jsx)(n.code,{children:"Metatype"})," application. You now need to spin a ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"Tyepgate"})," and deploy your typegraph to the instance. You can leverage the embedded typegate that comes with the ",(0,s.jsx)(n.em,{children:"Meta CLI"}),". To run the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"embedded typegate"}),", execute the following command from your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta dev\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once you started your typegate instance using one of the available choice, if you open ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"localhost:7890"})," in your browser, you will get a webpage similar to this one."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/running-typegate.png",alt:"running typegate"}),"\n",(0,s.jsxs)(n.p,{children:["To deploy your typegraph to the typegate engine, there are two approaces you can follow. You can either use ",(0,s.jsx)(n.code,{children:"self-deploy"})," which comes with the typegraph SDK or the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"Meta CLI"}),". For now, you will be deploying your typegraph using the ",(0,s.jsx)(n.code,{children:"Meta CLI"}),". Execute the command below on your terminal to deploy the typegraph."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta deploy -f api/example.ts --allow-dirty --create-migration --target dev --gate http://localhost:7890\n"})}),"\n",(0,s.jsx)(n.p,{children:"Upon successful deployment of the typegraph, you should recieve a response similar like this."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:'(example-py3.11) user@pc first-project % meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n[INFO] Loading module "/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts"\n[INFO] Loaded 1 typegraph from "/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts": example\n[INFO] All modules have been loaded. Stopping the loader.\n[INFO] Pushing typegraph example (from \'/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts\')\n[INFO] \u2713 Successfully pushed typegraph example.\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You have deployed your first typegraph. It's time to run and test your backend which is running on the typegate instance. Click ",(0,s.jsx)(n.a,{href:"http://localhost:7890/example",children:"here"})," to open a ",(0,s.jsx)(n.code,{children:"GraphiQL"})," interface and interact with your backend through ",(0,s.jsx)(n.code,{children:"graphql"})," queries from your browser. You should get a page similar to the one below."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/tg-on-typegate.png",alt:"typegraph on typegate"}),"\n",(0,s.jsxs)(n.p,{children:["Now you can play with your app through the interface. You can try this ",(0,s.jsx)(n.code,{children:"graphql"})," query as a start."]}),"\n",(0,s.jsx)(n.p,{children:"Create a message using the following mutation."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"Then, fetch the created message using the query below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:"query {\n list_messages\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:"You should get a response from the typegate similar to then one below."}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/query-result.png",alt:"query result"}),"\n",(0,s.jsx)(n.p,{children:"You can also try out what you have built so far here on this playground."}),"\n",(0,s.jsx)(p.A,{typegraph:"quick-start-project",typescript:t(5641),query:t(84443)})]})}function y(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}const g=[];function x(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Now you are ready to develop for your first app! You can use ",(0,s.jsx)(n.a,{href:"#4-verify-your-installation",children:"meta doctor"})," to check if neccessary components are installed. Let's start by creating a working directory for the project. Open your terminal and run the following commands."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"mkdir first-project\ncd first-project\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have your workspace and development environment setup, let's start building a simple ",(0,s.jsx)(n.code,{children:"CRUD"})," application."]}),"\n",(0,s.jsxs)(n.p,{children:["The SDK used for developing ",(0,s.jsx)(n.code,{children:"Metatype"})," applications is the ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),". Currently, it's available through Typescript and Python."]}),"\n",(0,s.jsxs)(c.Ay,{children:[(0,s.jsx)(d.A,{value:"typescript",children:(0,s.jsx)(y,{})}),(0,s.jsx)(d.A,{value:"python",children:(0,s.jsx)(u,{})})]})]})}function f(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}const j={sidebar_position:1},b="Quick-start",w={id:"tutorials/quick-start/index",title:"Quick-start",description:"This page will show you how to install the different components used by Metatype. It will also go over a simple application to get you started.",source:"@site/docs/tutorials/quick-start/index.mdx",sourceDirName:"tutorials/quick-start",slug:"/tutorials/quick-start/",permalink:"/docs/tutorials/quick-start/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/tutorials/quick-start/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",previous:{title:"Getting started",permalink:"/docs/"},next:{title:"Metatype Basics",permalink:"/docs/tutorials/metatype-basics/"}},v={},k=[{value:"1. Meta CLI",id:"1-meta-cli",level:2},...o.RM,{value:"2. Typegraph SDK",id:"2-typegraph-sdk",level:2},...i.RM,{value:"3. Typegate node",id:"3-typegate-node",level:2},...r.RM,{value:"4. Verify your installation",id:"4-verify-your-installation",level:2},{value:"Writing your First App",id:"writing-your-first-app",level:2},...g];function N(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"quick-start",children:"Quick-start"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"This page will show you how to install the different components used by Metatype. It will also go over a simple application to get you started."})}),"\n",(0,s.jsx)(n.admonition,{title:"You will learn",type:"note",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"how to install the Metatype SDKs and tools."}),"\n",(0,s.jsx)(n.li,{children:"how to create and run a Metatype app."}),"\n"]})}),"\n",(0,s.jsx)(n.h2,{id:"1-meta-cli",children:"1. Meta CLI"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"2-typegraph-sdk",children:"2. Typegraph SDK"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"3-typegate-node",children:"3. Typegate node"}),"\n",(0,s.jsx)(r.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"4-verify-your-installation",children:"4. Verify your installation"}),"\n",(0,s.jsx)(n.p,{children:"The doctor subcommand will attempt to detect all the components and report any potential issue. Please make sure to run it before opening an issue and include the output in your report."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta doctor\n"})}),"\n",(0,s.jsx)(n.p,{children:"After Sucessful installation, the above command produces an output somewhat similar to the one below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:"user@first-project:~$ meta doctor\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Global \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\ncurr. directory /Users/user/Documents/metatype-playground/projects/first-project\nglobal config /Users/user/Library/Application Support/dev.metatype.meta/config.json\nmeta-cli version 0.3.6\ndocker version Docker version 24.0.7, build afdd53b\ncontainers bitnami/minio:2022 (Up 3 days), postgres:15 (Up 3 days), bitnami/redis:7.0 (Up 3 days), envoyproxy/envoy:v1.26-latest (Up 3 days), redis:7 (Up 3 days), rabbitmq:3-management (Up 45 hours)\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Project \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\nmetatype file metatype.yaml\ntargets [2] deploy (remote, 3 secrets), dev (local, 3 secrets)\ntypegraphs [0]\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Python SDK \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\npython version Python 3.11.3\npython bin ../../../../../../Library/Caches/pypoetry/virtualenvs/example-paIt3smx-py3.11/bin/python\nvenv folder not found\npyproject file pyproject.toml\npipfile file not found\nrequirements file not found\ntypegraph version 0.3.6\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Typescript SDK \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\ndeno version deno 1.39.4\nnode version v18.16.0\n\n\u250c\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2510\n| In case of issue or question, please raise a ticket on: |\n| https://github.com/metatypedev/metatype/issues |\n| Or browse the documentation: |\n| https://metatype.dev/docs |\n\u2514\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2518\n"})}),"\n",(0,s.jsx)(n.h2,{id:"writing-your-first-app",children:"Writing your First App"}),"\n",(0,s.jsx)(f,{})]})}function T(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(N,{...e})}):N(e)}},25459:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});t(30758);var s=t(54133),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.d)();return(0,o.jsx)(a.mS,{choices:{poetry:"poetry",pip:"pip"},choice:t,onChange:r,children:n})}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,gc:()=>i});t(30758);var s=t(3733),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.e)();return(0,o.jsx)(a.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:r,children:n})}function i(e){let{children:n}=e;const[t]=(0,s.e)();return(0,o.jsx)(a.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var s=t(98302),a=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...r}=e;const i=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,a.jsx)(s.A,{code:0==i.length?void 0:i,...r})}},9234:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});t(30758);var s=t(54133),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.a)();return(0,o.jsx)(a.mS,{choices:{pnpm:"pnpm",npm:"npm",jsr:"jsr",deno:"deno",yarn:"yarn",bun:"bun"},choice:t,onChange:r,children:n})}},54133:(e,n,t)=>{"use strict";t.d(n,{a:()=>y,d:()=>g});var s=t(62104),a=t(12452),o=t(58346),r=t(40006),i=t(30758);const c="tsPackageManager",d="pythonPackageManager",l=(0,o.N)(),p=(0,s.eU)((e=>e(l).searchParams?.get(c)),((e,n,t)=>{const s=e(l).searchParams??new URLSearchParams;s.set(c,t),n(l,(e=>({...e,searchParams:s})))})),h=(0,s.eU)((e=>e(l).searchParams?.get(d)),((e,n,t)=>{const s=e(l).searchParams??new URLSearchParams;s.set(d,t),n(l,(e=>({...e,searchParams:s})))})),u=(0,r.tG)(c,"npm",(0,r.KU)((()=>sessionStorage))),m=(0,r.tG)(d,"poetry",(0,r.KU)((()=>sessionStorage)));function y(){const[e,n]=(0,a.fp)(p),[t,s]=(0,a.fp)(u);(0,i.useEffect)((()=>{e&&e!==t&&s(e)}),[e,s]);const o=(0,i.useCallback)((e=>{n(e),s(e)}),[n,s]);return[e??t,o]}function g(){const[e,n]=(0,a.fp)(h),[t,s]=(0,a.fp)(m);(0,i.useEffect)((()=>{e&&e!==t&&s(e)}),[e,s]);const o=(0,i.useCallback)((e=>{n(e),s(e)}),[n,s]);return[e??t,o]}},84443:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMessage"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"First typegraph",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"body"},value:{kind:"StringValue",value:"Congrats on your first typegraph.",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListMessages"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_messages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:231}};n.loc.source={body:'mutation CreateMessage {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n\nquery ListMessages {\n list_messages {\n id\n title\n body\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var s=e.type;"NamedType"===s.kind&&n.add(s.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var s={};function a(e,n){for(var t=0;tdev
subcommand",id:"1-dev-subcommand",level:3},{value:"2. typegate
subcommand",id:"2-typegate-subcommand",level:3}];function r(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.em,{children:"Meta CLI"})," comes with an embedded typegate packaged inside it. A ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"typegate"})," instance is where you deploy your ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"typegraphs"})," where any logic written in them is exposed via an HTTP or GraphQL endpoints. You can run an embedded typegate node from the terminal. There are two ways to launch the embedded typegate"]}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["If you have not installed ",(0,s.jsx)(n.em,{children:"Meta CLI"})," or you have downloaded the ",(0,s.jsx)(n.em,{children:"thin"})," version, you can check ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli#Installation",children:"this"})," installation guide of the ",(0,s.jsx)(n.em,{children:"CLI"}),"."]})}),"\n",(0,s.jsxs)(n.h3,{id:"1-dev-subcommand",children:["1. ",(0,s.jsx)(n.code,{children:"dev"})," subcommand"]}),"\n",(0,s.jsx)(n.p,{children:"You can start the embedded typegatxe easily with default configs using the following command."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsx)(n.p,{children:"The above command can be a good gateway to get started and also for development purposes. But if you want more granular control, you can use the second approach."}),"\n",(0,s.jsxs)(n.h3,{id:"2-typegate-subcommand",children:["2. ",(0,s.jsx)(n.code,{children:"typegate"})," subcommand"]}),"\n",(0,s.jsxs)(n.p,{children:["Set the ",(0,s.jsx)(n.code,{children:"tg_admin_password"})," and ",(0,s.jsx)(n.code,{children:"tg_secret"})," environment variables. You can use the following command to configure a sample value for the variables and test the embedded typegate."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"export tg_secret=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw== tg_admin_password=password\n"})}),"\n",(0,s.jsx)(n.p,{children:"Run the instance"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta typegate\n"})}),"\n",(0,s.jsxs)(n.p,{children:["The typegate instance runs on port ",(0,s.jsx)(n.code,{children:"7890"})," by default. You can check if the typegate node is running by accessing ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"http://localhost:7890"})," in your browser."]})]})}function i(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(r,{...e})}):r(e)}},49447:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>v,contentTitle:()=>b,default:()=>T,frontMatter:()=>j,metadata:()=>w,toc:()=>k});var s=t(86070),a=t(25710),o=t(14344),r=t(96503),i=t(22356),c=t(65480),d=t(27676),l=t(7871),p=t(65671);function h(e){const n={a:"a",code:"code",em:"em",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["To bootstrap a python ",(0,s.jsx)(n.code,{children:"Metatype"})," project, run the following commands on your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# create startup files\nmeta new --template python\n\n# install dependencies\npoetry install\n\n# create and activate virtual environment\npoetry shell\n"})}),"\n",(0,s.jsx)(n.p,{children:"This will create the necessary files for development, some of which are:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".graphqlrc.yaml"}),": configuration file to define settings and options related to GraphQL."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compose.yml"}),": is where the typegate node and similar services are setup."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"metatype.yaml"}),": is where you configure different variables such as authentication, secrets... used by the backend."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The command also creates a directory called ",(0,s.jsx)(n.code,{children:"api"})," where you will be building much of your applications's business logic. Inside the ",(0,s.jsx)(n.code,{children:"api"})," directory, you will find a single file called ",(0,s.jsx)(n.code,{children:"example.py"})," which defines a simple ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"python",children:t(25063).content}),"\n",(0,s.jsxs)(n.p,{children:["Let's break down the above code snippet. The ",(0,s.jsx)(n.code,{children:"example"})," function is where most of the logic lives. You need to decorate the function with ",(0,s.jsx)(n.code,{children:"@typegraph()"})," from the typegraph SDK. Inside the function, you have different components of your application."]}),"\n",(0,s.jsxs)(n.p,{children:["Metatype uses Policy Based ",(0,s.jsx)(n.a,{href:"/docs/reference/policies",children:"Access Control"})," for accessing resources in your backend and here you have defined a public access."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"public = Policy.public()\n"})}),"\n",(0,s.jsxs)(n.p,{children:["There is a runtime defined namely ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/python",children:"PythonRuntime"}),". You will be using the runtime to perform different data operations along with the other ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes",children:"runtimes"})," Metatype provides."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"python = PythonRuntime()\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have runtimes to process data and you have specified access control, you need to define endpoints to communicate with your backend. This is where you use the ",(0,s.jsx)(n.code,{children:"g.expose"})," method to enumerate the endpoints you want in your application. From the starter file, you can see that you have defined an endpoint ",(0,s.jsx)(n.code,{children:"hello"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'# custom functions\nhello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n)\n\ng.expose(public, hello=hello)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"hello"})," endpoint is mapped with a ",(0,s.jsx)(n.code,{children:"custom function"})," which accepts a ",(0,s.jsx)(n.code,{children:"string"})," and returns ",(0,s.jsx)(n.strong,{children:"hello"})," concatinated with the ",(0,s.jsx)(n.code,{children:"string"}),". The processing of data is done using the ",(0,s.jsx)(n.code,{children:"PythonRuntime"}),". When you are defining the custom function, you pass the input type, output type and then a ",(0,s.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"function"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You have created your first ",(0,s.jsx)(n.code,{children:"Metatype"})," app. It's as easy as this. Before you go ahead and test your app, let's add two more endpoints which peform basic ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," database operation."]}),"\n",(0,s.jsxs)(n.p,{children:["In order to exercise database capabilities, you need to build a table schema or a model. The typegraph SDK provides rich ",(0,s.jsx)(n.a,{href:"/docs/reference/types",children:"Types"})," which you can use to create any database table that fits to your usecase. Let's create a simple Message table which has fields ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"title"})," and ",(0,s.jsx)(n.code,{children:"body"}),". This is what it will look like in code."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'message = t.struct(\n {\n id"": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n name="message",\n)\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Great! Now you need a runtime which processes database requests. You will be using another runtime that comes out of the box with ",(0,s.jsx)(n.code,{children:"Metatype"}),". i.e the ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"PrismaRuntime"}),". Let's go ahead and introduce the ",(0,s.jsx)(n.code,{children:"PrismaRuntime"})," to your app. You can add the following code below the ",(0,s.jsx)(n.code,{children:"PythonRuntime"})," that was predefined."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:'...\npython = PythonRuntime()\ndb = PrismaRuntime("database", "POSTGRES_CONN")\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Last, you need to expose a ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," endpoints to your database table. Let's add these two lines to ",(0,s.jsx)(n.code,{children:"g.expose"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python3",children:"...\ng.expose(\n public,\n hello=hello,\n create_message=db.create(message),\n list_messages=db.find_many(message),\n)\n"})}),"\n",(0,s.jsxs)(n.p,{children:["With these simple steps, you were able to build a basic backend with database capabilities. Finally, this is what your typegraph looks like in ",(0,s.jsx)(n.code,{children:"example.py"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"python",children:t(12599).content}),"\n",(0,s.jsxs)(n.p,{children:["You are almost there to test your first ",(0,s.jsx)(n.code,{children:"Metatype"})," application. You now need to spin a ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"Tyepgate"})," and deploy your typegraph to the instance. You can leverage the embedded typegate that comes with the ",(0,s.jsx)(n.em,{children:"Meta CLI"}),". To run the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"embedded typegate"}),", execute the following command from your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once you started your typegate instance using one of the available choice, if you open ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"localhost:7890"})," in your browser, you will get a webpage similar to this one."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/running-typegate.png",alt:"running typegate"}),"\n",(0,s.jsxs)(n.p,{children:["To deploy your typegraph to the typegate engine, there are two approaces you can follow. You can either use ",(0,s.jsx)(n.a,{href:"/docs/guides/programmatic-deployment",children:"self-deploy"})," which comes with the typegraph SDK or the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"Meta CLI"}),". For now, you will be deploying your typegraph using the ",(0,s.jsx)(n.code,{children:"Meta CLI"}),". Execute the command below on your terminal to deploy the typegraph."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n"})}),"\n",(0,s.jsx)(n.p,{children:"Upon successful deployment of the typegraph, you should recieve a response similar like this."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:'(example-py3.11) user@pc first-project % meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n[INFO] Loading module "/Users/user/Documents/metatype-playground/projects/first-project/api/example.py"\n[INFO] Loaded 1 typegraph from "/Users/user/Documents/metatype-playground/projects/first-project/api/example.py": example\n[INFO] All modules have been loaded. Stopping the loader.\n[INFO] Pushing typegraph example (from \'/Users/user/Documents/metatype-playground/projects/first-project/api/example.py\')\n[INFO] \u2713 Successfully pushed typegraph example.\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You have deployed your first typegraph. It's time to run and test your backend which is running on your typegate instance. Click ",(0,s.jsx)(n.a,{href:"http://localhost:7890/example",children:"here"})," to open a ",(0,s.jsx)(n.code,{children:"GraphiQL"})," interface and interact with your backend through ",(0,s.jsx)(n.code,{children:"graphql"})," queries from your browser. You should get a page similar to the one below."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/tg-on-typegate.png",alt:"typegraph on typegate"}),"\n",(0,s.jsxs)(n.p,{children:["Now you can play with your app through the interface. You can try this ",(0,s.jsx)(n.code,{children:"graphql"})," query as a start."]}),"\n",(0,s.jsx)(n.p,{children:"Create a message using the following mutation."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"Then, fetch the created message using the query below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:"query {\n list_messages\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:"You should get a response from the typegate similar to then one below."}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/query-result.png",alt:"query result"}),"\n",(0,s.jsx)(n.p,{children:"You can also try out what you have built so far here on this playground."}),"\n",(0,s.jsx)(p.A,{typegraph:"quick-start-project",python:t(12599),query:t(84443)})]})}function u(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}function m(e){const n={a:"a",code:"code",em:"em",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["There are two variations to write your app using Typescript. You can either use ",(0,s.jsx)(n.code,{children:"node"})," or ",(0,s.jsx)(n.code,{children:"deno"})," as the TypeScript runtime. For now, you will be using ",(0,s.jsx)(n.code,{children:"node"}),". To bootstrap a node ",(0,s.jsx)(n.code,{children:"Metatype"})," project, you can run the following commands."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# create startup files\nmeta new --template node\n\n# install dependencies\nnpm install\n"})}),"\n",(0,s.jsx)(n.p,{children:"This will create the necessary files for development, some of which are:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:".graphqlrc.yaml"}),": configuration file to define settings and options related to GraphQL."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"compose.yml"}),": is where the typegate node and similar services are setup."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"metatype.yaml"}),": is where you configure different variables such as authentication, secrets... used by the backend."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["The command also creates a directory called ",(0,s.jsx)(n.code,{children:"api"})," where you will be building much of your applications's business logic. Inside the ",(0,s.jsx)(n.code,{children:"api"})," directory, you will find a single file called ",(0,s.jsx)(n.code,{children:"example.ts"})," which defines a simple ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"typescript",children:t(1755).content}),"\n",(0,s.jsxs)(n.p,{children:["Let's break down the above code snippet. The ",(0,s.jsx)(n.code,{children:"typegraph"})," function is your building block and it encompasses most of the app logic inside. It takes a name and a callback function as an argument. All the magic is done inside the callback function."]}),"\n",(0,s.jsxs)(n.p,{children:["Metatype uses Policy Based ",(0,s.jsx)(n.a,{href:"/docs/reference/policies",children:"Access Control"})," for accessing resources in your backend and here you have defined a public access."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"const pub = Policy.public();\n"})}),"\n",(0,s.jsxs)(n.p,{children:["There are two runtimes defined namely ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/python",children:"PythonRuntime"})," and ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/deno",children:"DenoRuntime"}),". You will be using these two runtimes to perform different data operations along with the other ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes",children:"runtimes"})," Metatype provides."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"const deno = new DenoRuntime();\nconst python = new PythonRuntime();\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have runtimes to process data and you have specified your access control, you need to define endpoints to communicate with your backend. This is where you use the ",(0,s.jsx)(n.code,{children:"g.expose"})," method to enumerate the endpoints you want in your application. From the starter file, you can see that you have defined two endpoints, ",(0,s.jsx)(n.code,{children:"add"})," and ",(0,s.jsx)(n.code,{children:"multiply"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"g.expose({\n add: python\n .fromLambda(t.struct({ first: t.float(), second: t.float() }), t.float(), {\n code: \"lambda x: x['first'] + x['second']\",\n })\n .withPolicy(pub),\n multiply: deno\n .func(t.struct({ first: t.float(), second: t.float() }), t.float(), {\n code: \"({first, second}) => first * second\",\n })\n .withPolicy(pub),\n});\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Let's dive into what the ",(0,s.jsx)(n.code,{children:"add"})," endpoint is doing. The ",(0,s.jsx)(n.code,{children:"add"})," endpoint defines a ",(0,s.jsx)(n.code,{children:"custom function"})," which does data processing using the ",(0,s.jsx)(n.code,{children:"PythonRuntime"}),". When you are defining the custom function, you pass the input type, output type and then a ",(0,s.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"function"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You have created your first ",(0,s.jsx)(n.code,{children:"Metatype"})," app. It's as easy as this. Before you go ahead and test your app, let's add two more endpoints which peform basic ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," database operation."]}),"\n",(0,s.jsxs)(n.p,{children:["In order to exercise database capabilities, you need to build a table schema or a model. The typegraph SDK provides rich ",(0,s.jsx)(n.a,{href:"/docs/reference/types",children:"Types"})," which you can use to create any database table that fits to your usecase. Let's create a simple Message table which has fields ",(0,s.jsx)(n.code,{children:"id"}),", ",(0,s.jsx)(n.code,{children:"title"})," and ",(0,s.jsx)(n.code,{children:"body"}),". This is what it will look like in code."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'const message = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }), // configuring your primary key\n title: t.string(),\n body: t.string(),\n },\n { name: "message" }, // the name of your type\n);\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Great! Now you need a runtime which processes database requests. You will be using another runtime that comes out of the box with ",(0,s.jsx)(n.code,{children:"Metatype"}),". i.e the ",(0,s.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"PrismaRuntime"}),". Let's go ahead and introduce the ",(0,s.jsx)(n.code,{children:"PrismaRuntime"})," to your app. You can add the following code below the two runtimes that were predefined."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'...\nconst python = new PythonRuntime();\nconst db = new PrismaRuntime("database", "POSTGRES_CONN");\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Last, you need to expose a ",(0,s.jsx)(n.code,{children:"Create"})," and ",(0,s.jsx)(n.code,{children:"Read"})," endpoints to your database table. Let's add these two lines to ",(0,s.jsx)(n.code,{children:"g.expose"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:"...\ng.expose({\n ...,\n // add following to your typegraph\n create_message: db.create(message).withPolicy(pub),\n list_messages: db.findMany(message).withPolicy(pub),\n});\n"})}),"\n",(0,s.jsxs)(n.p,{children:["With these three simple steps, you were able to build a basic backend with database capabilities. Finally, this is what your typegraph looks like in ",(0,s.jsx)(n.code,{children:"example.ts"}),"."]}),"\n",(0,s.jsx)(l.A,{language:"typescript",children:t(5641).content}),"\n",(0,s.jsxs)(n.p,{children:["You are almost there to test your first ",(0,s.jsx)(n.code,{children:"Metatype"})," application. You now need to spin a ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate",children:"Tyepgate"})," and deploy your typegraph to the instance. You can leverage the embedded typegate that comes with the ",(0,s.jsx)(n.em,{children:"Meta CLI"}),". To run the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"embedded typegate"}),", execute the following command from your terminal."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta dev\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Once you started your typegate instance using one of the available choice, if you open ",(0,s.jsx)(n.a,{href:"http://localhost:7890",children:"localhost:7890"})," in your browser, you will get a webpage similar to this one."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/running-typegate.png",alt:"running typegate"}),"\n",(0,s.jsxs)(n.p,{children:["To deploy your typegraph to the typegate engine, there are two approaces you can follow. You can either use ",(0,s.jsx)(n.code,{children:"self-deploy"})," which comes with the typegraph SDK or the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"Meta CLI"}),". For now, you will be deploying your typegraph using the ",(0,s.jsx)(n.code,{children:"Meta CLI"}),". Execute the command below on your terminal to deploy the typegraph."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta deploy -f api/example.ts --allow-dirty --create-migration --target dev --gate http://localhost:7890\n"})}),"\n",(0,s.jsx)(n.p,{children:"Upon successful deployment of the typegraph, you should recieve a response similar like this."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:'(example-py3.11) user@pc first-project % meta deploy -f api/example.py --allow-dirty --create-migration --target dev --gate http://localhost:7890\n[INFO] Loading module "/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts"\n[INFO] Loaded 1 typegraph from "/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts": example\n[INFO] All modules have been loaded. Stopping the loader.\n[INFO] Pushing typegraph example (from \'/Users/user/Documents/metatype-playground/projects/first-project/api/example.ts\')\n[INFO] \u2713 Successfully pushed typegraph example.\n'})}),"\n",(0,s.jsxs)(n.p,{children:["You have deployed your first typegraph. It's time to run and test your backend which is running on the typegate instance. Click ",(0,s.jsx)(n.a,{href:"http://localhost:7890/example",children:"here"})," to open a ",(0,s.jsx)(n.code,{children:"GraphiQL"})," interface and interact with your backend through ",(0,s.jsx)(n.code,{children:"graphql"})," queries from your browser. You should get a page similar to the one below."]}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/tg-on-typegate.png",alt:"typegraph on typegate"}),"\n",(0,s.jsxs)(n.p,{children:["Now you can play with your app through the interface. You can try this ",(0,s.jsx)(n.code,{children:"graphql"})," query as a start."]}),"\n",(0,s.jsx)(n.p,{children:"Create a message using the following mutation."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"Then, fetch the created message using the query below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-graphql",children:"query {\n list_messages\n}\n"})}),"\n",(0,s.jsx)(n.p,{children:"You should get a response from the typegate similar to then one below."}),"\n",(0,s.jsx)("img",{src:"/images/tutorial/query-result.png",alt:"query result"}),"\n",(0,s.jsx)(n.p,{children:"You can also try out what you have built so far here on this playground."}),"\n",(0,s.jsx)(p.A,{typegraph:"quick-start-project",typescript:t(5641),query:t(84443)})]})}function y(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}const g=[];function x(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.p,{children:["Now you are ready to develop for your first app! You can use ",(0,s.jsx)(n.a,{href:"#4-verify-your-installation",children:"meta doctor"})," to check if neccessary components are installed. Let's start by creating a working directory for the project. Open your terminal and run the following commands."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"mkdir first-project\ncd first-project\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Now that you have your workspace and development environment setup, let's start building a simple ",(0,s.jsx)(n.code,{children:"CRUD"})," application."]}),"\n",(0,s.jsxs)(n.p,{children:["The SDK used for developing ",(0,s.jsx)(n.code,{children:"Metatype"})," applications is the ",(0,s.jsx)(n.a,{href:"/docs/reference/typegraph",children:"Typegraph"}),". Currently, it's available through Typescript and Python."]}),"\n",(0,s.jsxs)(c.Ay,{children:[(0,s.jsx)(d.A,{value:"typescript",children:(0,s.jsx)(y,{})}),(0,s.jsx)(d.A,{value:"python",children:(0,s.jsx)(u,{})})]})]})}function f(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(x,{...e})}):x(e)}const j={sidebar_position:1},b="Quick-start",w={id:"tutorials/quick-start/index",title:"Quick-start",description:"This page will show you how to install the different components used by Metatype. It will also go over a simple application to get you started.",source:"@site/docs/tutorials/quick-start/index.mdx",sourceDirName:"tutorials/quick-start",slug:"/tutorials/quick-start/",permalink:"/docs/tutorials/quick-start/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/tutorials/quick-start/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",previous:{title:"Getting started",permalink:"/docs/"},next:{title:"Metatype Basics",permalink:"/docs/tutorials/metatype-basics/"}},v={},k=[{value:"1. Meta CLI",id:"1-meta-cli",level:2},...o.RM,{value:"2. Typegraph SDK",id:"2-typegraph-sdk",level:2},...i.RM,{value:"3. Typegate node",id:"3-typegate-node",level:2},...r.RM,{value:"4. Verify your installation",id:"4-verify-your-installation",level:2},{value:"Writing your First App",id:"writing-your-first-app",level:2},...g];function N(e){const n={admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"quick-start",children:"Quick-start"}),"\n",(0,s.jsx)(n.p,{children:(0,s.jsx)(n.strong,{children:"This page will show you how to install the different components used by Metatype. It will also go over a simple application to get you started."})}),"\n",(0,s.jsx)(n.admonition,{title:"You will learn",type:"note",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"how to install the Metatype SDKs and tools."}),"\n",(0,s.jsx)(n.li,{children:"how to create and run a Metatype app."}),"\n"]})}),"\n",(0,s.jsx)(n.h2,{id:"1-meta-cli",children:"1. Meta CLI"}),"\n",(0,s.jsx)(o.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"2-typegraph-sdk",children:"2. Typegraph SDK"}),"\n",(0,s.jsx)(i.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"3-typegate-node",children:"3. Typegate node"}),"\n",(0,s.jsx)(r.Ay,{}),"\n",(0,s.jsx)(n.h2,{id:"4-verify-your-installation",children:"4. Verify your installation"}),"\n",(0,s.jsx)(n.p,{children:"The doctor subcommand will attempt to detect all the components and report any potential issue. Please make sure to run it before opening an issue and include the output in your report."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta doctor\n"})}),"\n",(0,s.jsx)(n.p,{children:"After Sucessful installation, the above command produces an output somewhat similar to the one below."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-console",children:"user@first-project:~$ meta doctor\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Global \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\ncurr. directory /Users/user/Documents/metatype-playground/projects/first-project\nglobal config /Users/user/Library/Application Support/dev.metatype.meta/config.json\nmeta-cli version 0.3.6\ndocker version Docker version 24.0.7, build afdd53b\ncontainers bitnami/minio:2022 (Up 3 days), postgres:15 (Up 3 days), bitnami/redis:7.0 (Up 3 days), envoyproxy/envoy:v1.26-latest (Up 3 days), redis:7 (Up 3 days), rabbitmq:3-management (Up 45 hours)\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Project \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\nmetatype file metatype.yaml\ntargets [2] deploy (remote, 3 secrets), dev (local, 3 secrets)\ntypegraphs [0]\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Python SDK \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\npython version Python 3.11.3\npython bin ../../../../../../Library/Caches/pypoetry/virtualenvs/example-paIt3smx-py3.11/bin/python\nvenv folder not found\npyproject file pyproject.toml\npipfile file not found\nrequirements file not found\ntypegraph version 0.3.6\n\n\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 Typescript SDK \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\ndeno version deno 1.39.4\nnode version v18.16.0\n\n\u250c\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2510\n| In case of issue or question, please raise a ticket on: |\n| https://github.com/metatypedev/metatype/issues |\n| Or browse the documentation: |\n| https://metatype.dev/docs |\n\u2514\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2518\n"})}),"\n",(0,s.jsx)(n.h2,{id:"writing-your-first-app",children:"Writing your First App"}),"\n",(0,s.jsx)(f,{})]})}function T(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(N,{...e})}):N(e)}},25459:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});t(30758);var s=t(54133),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.d)();return(0,o.jsx)(a.mS,{choices:{poetry:"poetry",pip:"pip"},choice:t,onChange:r,children:n})}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,gc:()=>i});t(30758);var s=t(3733),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.e)();return(0,o.jsx)(a.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:r,children:n})}function i(e){let{children:n}=e;const[t]=(0,s.e)();return(0,o.jsx)(a.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var s=t(98302),a=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...r}=e;const i=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,a.jsx)(s.A,{code:0==i.length?void 0:i,...r})}},9234:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});t(30758);var s=t(54133),a=t(56315),o=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,s.a)();return(0,o.jsx)(a.mS,{choices:{pnpm:"pnpm",npm:"npm",jsr:"jsr",deno:"deno",yarn:"yarn",bun:"bun"},choice:t,onChange:r,children:n})}},54133:(e,n,t)=>{"use strict";t.d(n,{a:()=>y,d:()=>g});var s=t(62104),a=t(12452),o=t(58346),r=t(40006),i=t(30758);const c="tsPackageManager",d="pythonPackageManager",l=(0,o.N)(),p=(0,s.eU)((e=>e(l).searchParams?.get(c)),((e,n,t)=>{const s=e(l).searchParams??new URLSearchParams;s.set(c,t),n(l,(e=>({...e,searchParams:s})))})),h=(0,s.eU)((e=>e(l).searchParams?.get(d)),((e,n,t)=>{const s=e(l).searchParams??new URLSearchParams;s.set(d,t),n(l,(e=>({...e,searchParams:s})))})),u=(0,r.tG)(c,"npm",(0,r.KU)((()=>sessionStorage))),m=(0,r.tG)(d,"poetry",(0,r.KU)((()=>sessionStorage)));function y(){const[e,n]=(0,a.fp)(p),[t,s]=(0,a.fp)(u);(0,i.useEffect)((()=>{e&&e!==t&&s(e)}),[e,s]);const o=(0,i.useCallback)((e=>{n(e),s(e)}),[n,s]);return[e??t,o]}function g(){const[e,n]=(0,a.fp)(h),[t,s]=(0,a.fp)(m);(0,i.useEffect)((()=>{e&&e!==t&&s(e)}),[e,s]);const o=(0,i.useCallback)((e=>{n(e),s(e)}),[n,s]);return[e??t,o]}},84443:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateMessage"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"First typegraph",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"body"},value:{kind:"StringValue",value:"Congrats on your first typegraph.",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListMessages"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_messages"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:231}};n.loc.source={body:'mutation CreateMessage {\n create_message(\n data: {\n title: "First typegraph"\n body: "Congrats on your first typegraph."\n }\n ) {\n id\n }\n}\n\nquery ListMessages {\n list_messages {\n id\n title\n body\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var s=e.type;"NamedType"===s.kind&&n.add(s.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var s={};function a(e,n){for(var t=0;tYour Docusaurus site did not load properly.
\nA very common reason is a wrong site baseUrl configuration.
\nCurrent configured baseUrl = ${e} ${"/"===e?" (default value)":""}
\nWe suggest trying baseUrl =
\n.comment
can become .namespace--comment
) or replace them with your defined ones (like .editor__comment
). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll
and highlightAllUnder
methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},46532:(e,t,n)=>{const r=n(39227),o=n(29670),a=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...a,...Object.keys(Prism.languages)];o(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(57507).resolve(t)],delete Prism.languages[e],n(57507)(t),a.add(e)}))}i.silent=!1,e.exports=i},1274:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,s=i.length;-1!==n.code.indexOf(o=t(r,s));)++s;return i[s]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(s){for(var l=0;l{const a=t.toLowerCase(),i=((e,t)=>{const[n,r]=(0,u.useState)(K(t,e)),o=(0,u.useRef)(),a=(0,u.useRef)();return(0,u.useEffect)((()=>{t===o.current&&e===a.current||(o.current=t,a.current=e,r(K(t,e)))}),[e,t]),n})(a,r),s=(e=>(0,u.useCallback)((t=>{var n=t,{className:r,style:o,line:a}=n,i=E(n,["className","style","line"]);const s=C(S({},i),{className:(0,d.A)("token-line",r)});return"object"==typeof e&&"plain"in e&&(s.style=e.plain),"object"==typeof o&&(s.style=S(S({},s.style||{}),o)),s}),[e]))(i),l=(e=>{const t=(0,u.useCallback)((({types:t,empty:n})=>{if(null!=e)return 1===t.length&&"plain"===t[0]?null!=n?{display:"inline-block"}:void 0:1===t.length&&null!=n?e[t[0]]:Object.assign(null!=n?{display:"inline-block"}:{},...t.map((t=>e[t])))}),[e]);return(0,u.useCallback)((e=>{var n=e,{token:r,className:o,style:a}=n,i=E(n,["token","className","style"]);const s=C(S({},i),{className:(0,d.A)("token",...r.types,o),children:r.content,style:t(r)});return null!=a&&(s.style=S(S({},s.style||{}),a)),s}),[t])})(i),c=(({prism:e,code:t,grammar:n,language:r})=>{const o=(0,u.useRef)(e);return(0,u.useMemo)((()=>{if(null==n)return J([t]);const e={code:t,grammar:n,language:r,tokens:[]};return o.current.hooks.run("before-tokenize",e),e.tokens=o.current.tokenize(t,n),o.current.hooks.run("after-tokenize",e),J(e.tokens)}),[t,n,r])})({prism:o,language:a,code:n,grammar:o.languages[a]});return e({tokens:c,className:`prism-code language-${a}`,style:null!=i?i.root:{},getLineProps:s,getTokenProps:l})},ee=e=>(0,u.createElement)(Q,C(S({},e),{prism:e.prism||L,theme:e.theme||q,code:e.code,language:e.language}))},25385:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=!0,o="Invariant failed";function a(e,t){if(!e){if(r)throw new Error(o);var n="function"==typeof t?t():t,a=n?"".concat(o,": ").concat(n):o;throw new Error(a)}}},22654:e=>{"use strict";e.exports={}},84054:e=>{"use strict";e.exports=JSON.parse('{"/blog-f31":{"__comp":"a6aa9e1f","__context":{"plugin":"f1c506b7"},"sidebar":"95b96bb9","items":[{"content":"fbf1744f"},{"content":"4f68146b"},{"content":"127f5bd6"},{"content":"9cca6528"},{"content":"5622ed62"},{"content":"068acb3c"},{"content":"da9cdc83"}],"__props":"97787cbd"},"/blog/2023/03/15/emulating-servers-0e6":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"80eba989"},"/blog/2023/06/18/programmable-glue-3bd":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"9ef5846e"},"/blog/2023/11/27/node-compatibility-b09":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"d2f8c7b3"},"/blog/2024/05/09/programmatic-deployment-c79":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"ac075c54"},"/blog/2024/08/26/python-on-webassembly-d29":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"6c5c337a"},"/blog/2024/08/27/distributed-execution-flow-paradigms-ca6":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"6e544dd5"},"/blog/2024/09/26/introducing-grpc-runtime-e1c":{"__comp":"ccc49370","__context":{"data":{"blogMetadata":"49f06b57"},"plugin":"f1c506b7"},"sidebar":"95b96bb9","content":"6b5a7be1"},"/blog/archive-d1d":{"__comp":"9e4087bc","__context":{"plugin":"f1c506b7"},"__props":"b3219b4c"},"/legal/privacy-policy-4fe":{"__comp":"1f391b9e","__context":{"plugin":"a7456010"},"content":"e8113c3c"},"/legal/terms-aed":{"__comp":"1f391b9e","__context":{"plugin":"a7456010"},"content":"dce22fdb"},"/docs-ba5":{"__comp":"5e95c892","__context":{"plugin":"4b100ba1"}},"/docs-2fc":{"__comp":"a7bd4aaa","__props":"878e8ee7"},"/docs-124":{"__comp":"a94703ab"},"/docs-e81":{"__comp":"17896441","content":"4edc808e"},"/docs/concepts/architecture-5a3":{"__comp":"17896441","content":"9f09fab9"},"/docs/concepts/comparisons-c09":{"__comp":"17896441","content":"10a64d3a"},"/docs/concepts/features-overview-196":{"__comp":"17896441","content":"8cfb3d68"},"/docs/concepts/mental-model-0a9":{"__comp":"17896441","content":"98537bc7"},"/docs/concepts/RFCs-301":{"__comp":"17896441","content":"1d6f08a2"},"/docs/concepts/RFCs/M0-template-c4e":{"__comp":"17896441","content":"2fbc816e"},"/docs/guides/contributing-39f":{"__comp":"17896441","content":"aac7f9f5"},"/docs/guides/external-functions-bde":{"__comp":"17896441","content":"1f54f6f7"},"/docs/guides/files-upload-0b9":{"__comp":"17896441","content":"26137cf5"},"/docs/guides/import-external-modules-495":{"__comp":"17896441","content":"6dc80b66"},"/docs/guides/programmatic-deployment-0b9":{"__comp":"17896441","content":"95183ce9"},"/docs/guides/rest-433":{"__comp":"17896441","content":"a0248338"},"/docs/guides/securing-requests-86e":{"__comp":"17896441","content":"42ecd3be"},"/docs/guides/self-hosting-f2f":{"__comp":"17896441","content":"062e3798"},"/docs/guides/test-your-typegraph-abf":{"__comp":"17896441","content":"fd15d584"},"/docs/guides/wasm-functions-c76":{"__comp":"17896441","content":"e1da19f3"},"/docs/reference/changelog-783":{"__comp":"17896441","content":"a70287ac"},"/docs/reference/ecosystem-343":{"__comp":"17896441","content":"ad20ab3b"},"/docs/reference/graphql-ad6":{"__comp":"17896441","content":"5e3d8afa"},"/docs/reference/meta-cli-b6c":{"__comp":"17896441","content":"4ab57ea6"},"/docs/reference/meta-cli/available-commands-a05":{"__comp":"17896441","content":"295b9a18"},"/docs/reference/meta-cli/configuration-file-549":{"__comp":"17896441","content":"aafba6b7"},"/docs/reference/meta-cli/embedded-typegate-86d":{"__comp":"17896441","content":"eb6f68a0"},"/docs/reference/metagen-293":{"__comp":"17896441","content":"cd86e9b3"},"/docs/reference/policies-113":{"__comp":"17896441","content":"2df24393"},"/docs/reference/rest-870":{"__comp":"17896441","content":"5e023c59"},"/docs/reference/runtimes-86b":{"__comp":"17896441","content":"5360c792"},"/docs/reference/runtimes/deno-7ef":{"__comp":"17896441","content":"474845f3"},"/docs/reference/runtimes/graphql-cfd":{"__comp":"17896441","content":"3f66bcd5"},"/docs/reference/runtimes/grpc-dae":{"__comp":"17896441","content":"c367b882"},"/docs/reference/runtimes/http-d1d":{"__comp":"17896441","content":"3169f45d"},"/docs/reference/runtimes/kv-927":{"__comp":"17896441","content":"05cbd4da"},"/docs/reference/runtimes/prisma-637":{"__comp":"17896441","content":"929c1f2b"},"/docs/reference/runtimes/python-c7a":{"__comp":"17896441","content":"5a33aa61"},"/docs/reference/runtimes/random-a6c":{"__comp":"17896441","content":"e66bdb87"},"/docs/reference/runtimes/s3-5f4":{"__comp":"17896441","content":"18b50fbb"},"/docs/reference/runtimes/substantial-a9d":{"__comp":"17896441","content":"a4f64869"},"/docs/reference/runtimes/temporal-0d3":{"__comp":"17896441","content":"b8f4db82"},"/docs/reference/runtimes/wasm-b3e":{"__comp":"17896441","content":"c02ff0d2"},"/docs/reference/typegate-1fd":{"__comp":"17896441","content":"6f622e55"},"/docs/reference/typegate/authentication-e71":{"__comp":"17896441","content":"0c88aa32"},"/docs/reference/typegate/cors-a93":{"__comp":"17896441","content":"d89a9c00"},"/docs/reference/typegate/rate-limiting-5b3":{"__comp":"17896441","content":"d8f8b671"},"/docs/reference/typegate/synchronization-de4":{"__comp":"17896441","content":"c523e930"},"/docs/reference/typegraph-6d7":{"__comp":"17896441","content":"e3ef7410"},"/docs/reference/typegraph/client-4cb":{"__comp":"17896441","content":"56e37303"},"/docs/reference/types-eb9":{"__comp":"17896441","content":"9d3370bc"},"/docs/reference/types/comparison-67a":{"__comp":"17896441","content":"c2bbfad4"},"/docs/reference/types/functions-ee1":{"__comp":"17896441","content":"c1c441c4"},"/docs/reference/types/injections-5c1":{"__comp":"17896441","content":"efb264ae"},"/docs/reference/types/parameter-transformations-8e5":{"__comp":"17896441","content":"16d8d440"},"/docs/tutorials/metatype-basics-35a":{"__comp":"17896441","content":"ad5e0346"},"/docs/tutorials/quick-start-1ba":{"__comp":"17896441","content":"6c4588a6"},"/use-cases-922":{"__comp":"5e95c892","__context":{"plugin":"32f95329"}},"/use-cases-4f9":{"__comp":"a7bd4aaa","__props":"058898d2"},"/use-cases-e5c":{"__comp":"a94703ab"},"/use-cases/automatic-crud-validation-da8":{"__comp":"17896441","content":"6baad3d0"},"/use-cases/backend-for-frontend-9b1":{"__comp":"17896441","content":"af072c69"},"/use-cases/faas-runner-cfd":{"__comp":"17896441","content":"c843538e"},"/use-cases/graphql-server-68c":{"__comp":"17896441","content":"33e4627d"},"/use-cases/iam-provider-940":{"__comp":"17896441","content":"99c4cb86"},"/use-cases/microservice-orchestration-c6e":{"__comp":"17896441","content":"cda5b2c7"},"/use-cases/orm-for-the-edge-e3f":{"__comp":"17896441","content":"bbc54dbf"},"/use-cases/programmable-api-gateway-a64":{"__comp":"17896441","content":"289ade6e"},"/-e5f":{"__comp":"1df93b7f","__context":{"plugin":"a7456010"},"config":"5e9f5e1a"}}')}},e=>{e.O(0,[1869],(()=>{return t=7881,e(e.s=t);var t}));e.O()}]);
\ No newline at end of file
+/*! For license information please see main.35bb5011.js.LICENSE.txt */
+(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8792],{45433:(e,t,n)=>{var r={"./":46532};function o(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}o.keys=function(){return Object.keys(r)},o.resolve=a,e.exports=o,o.id=45433},68384:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});n(30758);var r=n(57316),o=n.n(r),a=n(84054);const i={"058898d2":[()=>n.e(8595).then(n.t.bind(n,50568,19)),"@generated/docusaurus-plugin-content-docs/use-cases/p/use-cases-fc6.json",50568],"05cbd4da":[()=>Promise.all([n.e(1869),n.e(2076),n.e(9568)]).then(n.bind(n,17981)),"@site/docs/reference/runtimes/kv/index.mdx",17981],"062e3798":[()=>Promise.all([n.e(2076),n.e(2311)]).then(n.bind(n,66578)),"@site/docs/guides/self-hosting.md",66578],"068acb3c":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8789)]).then(n.bind(n,31281)),"@site/blog/2023-06-18-programmable-glue/index.mdx?truncated=true",31281],"0c88aa32":[()=>Promise.all([n.e(1869),n.e(2076),n.e(1201)]).then(n.bind(n,88079)),"@site/docs/reference/typegate/authentication/index.mdx",88079],"10a64d3a":[()=>Promise.all([n.e(2076),n.e(8977)]).then(n.bind(n,68234)),"@site/docs/concepts/comparisons/index.mdx",68234],"127f5bd6":[()=>Promise.all([n.e(2076),n.e(3610)]).then(n.bind(n,13543)),"@site/blog/2024-08-26-python-on-webassembly/index.mdx?truncated=true",13543],"16d8d440":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7330)]).then(n.bind(n,90079)),"@site/docs/reference/types/parameter-transformations.mdx",90079],17896441:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4145),n.e(8401)]).then(n.bind(n,75936)),"@theme/DocItem",75936],"18b50fbb":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7401)]).then(n.bind(n,42684)),"@site/docs/reference/runtimes/s3/index.mdx",42684],"1d6f08a2":[()=>Promise.all([n.e(2076),n.e(8461)]).then(n.bind(n,95370)),"@site/docs/concepts/RFCs/index.mdx",95370],"1df93b7f":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8271),n.e(4583)]).then(n.bind(n,26175)),"@site/src/pages/index.tsx",26175],"1f391b9e":[()=>Promise.all([n.e(1869),n.e(2076),n.e(4145),n.e(6061)]).then(n.bind(n,43685)),"@theme/MDXPage",43685],"1f54f6f7":[()=>Promise.all([n.e(1869),n.e(2076),n.e(4404)]).then(n.bind(n,43053)),"@site/docs/guides/external-functions/index.mdx",43053],"26137cf5":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7050)]).then(n.bind(n,52897)),"@site/docs/guides/files-upload/index.mdx",52897],"289ade6e":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7525)]).then(n.bind(n,92809)),"@site/use-cases/programmable-api-gateway/index.mdx",92809],"295b9a18":[()=>Promise.all([n.e(2076),n.e(3052)]).then(n.bind(n,18668)),"@site/docs/reference/meta-cli/available-commands.mdx",18668],"2df24393":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8598)]).then(n.bind(n,77162)),"@site/docs/reference/policies/index.mdx",77162],"2fbc816e":[()=>Promise.all([n.e(2076),n.e(3680)]).then(n.bind(n,31940)),"@site/docs/concepts/RFCs/M0-template.mdx",31940],"3169f45d":[()=>Promise.all([n.e(1869),n.e(2076),n.e(3597)]).then(n.bind(n,16678)),"@site/docs/reference/runtimes/http/index.mdx",16678],"32f95329":[()=>n.e(7956).then(n.t.bind(n,93279,19)),"@generated/docusaurus-plugin-content-docs/use-cases/__plugin.json",93279],"33e4627d":[()=>Promise.all([n.e(1869),n.e(2076),n.e(2731)]).then(n.bind(n,62719)),"@site/use-cases/graphql-server/index.mdx",62719],"3f66bcd5":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7868)]).then(n.bind(n,34801)),"@site/docs/reference/runtimes/graphql/index.mdx",34801],"42ecd3be":[()=>Promise.all([n.e(1869),n.e(2076),n.e(2829)]).then(n.bind(n,23233)),"@site/docs/guides/securing-requests/index.mdx",23233],"474845f3":[()=>Promise.all([n.e(1869),n.e(2076),n.e(5364)]).then(n.bind(n,16086)),"@site/docs/reference/runtimes/deno/index.mdx",16086],"49f06b57":[()=>n.e(912).then(n.t.bind(n,82028,19)),"~blog/blog/blogMetadata-blog.json",82028],"4ab57ea6":[()=>Promise.all([n.e(1869),n.e(2076),n.e(96)]).then(n.bind(n,88570)),"@site/docs/reference/meta-cli/index.mdx",88570],"4b100ba1":[()=>n.e(6838).then(n.t.bind(n,54415,19)),"@generated/docusaurus-plugin-content-docs/docs/__plugin.json",54415],"4edc808e":[()=>Promise.all([n.e(1869),n.e(2076),n.e(308)]).then(n.bind(n,39223)),"@site/docs/index.mdx",39223],"4f68146b":[()=>Promise.all([n.e(1869),n.e(2076),n.e(1732)]).then(n.bind(n,53919)),"@site/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx?truncated=true",53919],"5360c792":[()=>Promise.all([n.e(2076),n.e(986)]).then(n.bind(n,73519)),"@site/docs/reference/runtimes/index.mdx",73519],"5622ed62":[()=>Promise.all([n.e(2076),n.e(7417)]).then(n.bind(n,36037)),"@site/blog/2023-11-27-node-compatibility/index.mdx?truncated=true",36037],"56e37303":[()=>Promise.all([n.e(1869),n.e(2076),n.e(2903)]).then(n.bind(n,68962)),"@site/docs/reference/typegraph/client/index.mdx",68962],"5a33aa61":[()=>Promise.all([n.e(2076),n.e(4902)]).then(n.bind(n,99848)),"@site/docs/reference/runtimes/python/index.mdx",99848],"5e023c59":[()=>Promise.all([n.e(1869),n.e(2076),n.e(2091)]).then(n.bind(n,2738)),"@site/docs/reference/rest/index.mdx",2738],"5e3d8afa":[()=>Promise.all([n.e(1869),n.e(2076),n.e(3862)]).then(n.bind(n,75627)),"@site/docs/reference/graphql/index.mdx",75627],"5e95c892":[()=>n.e(9647).then(n.bind(n,77704)),"@theme/DocsRoot",77704],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"6b5a7be1":[()=>Promise.all([n.e(2076),n.e(2920)]).then(n.bind(n,65977)),"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx",65977],"6baad3d0":[()=>Promise.all([n.e(1869),n.e(2076),n.e(7010)]).then(n.bind(n,51092)),"@site/use-cases/automatic-crud-validation/index.mdx",51092],"6c4588a6":[()=>Promise.all([n.e(1869),n.e(2076),n.e(6686)]).then(n.bind(n,49447)),"@site/docs/tutorials/quick-start/index.mdx",49447],"6c5c337a":[()=>Promise.all([n.e(2076),n.e(2280)]).then(n.bind(n,2597)),"@site/blog/2024-08-26-python-on-webassembly/index.mdx",2597],"6dc80b66":[()=>Promise.all([n.e(1869),n.e(2076),n.e(6650)]).then(n.bind(n,87409)),"@site/docs/guides/import-external-modules/index.mdx",87409],"6e544dd5":[()=>Promise.all([n.e(1869),n.e(2076),n.e(3126)]).then(n.bind(n,2845)),"@site/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx",2845],"6f622e55":[()=>Promise.all([n.e(2076),n.e(2606)]).then(n.bind(n,36233)),"@site/docs/reference/typegate/index.mdx",36233],"80eba989":[()=>Promise.all([n.e(1869),n.e(2076),n.e(6101)]).then(n.bind(n,21153)),"@site/blog/2023-03-15-emulating-servers/index.mdx",21153],"878e8ee7":[()=>n.e(6800).then(n.t.bind(n,49362,19)),"@generated/docusaurus-plugin-content-docs/docs/p/docs-175.json",49362],"8cfb3d68":[()=>Promise.all([n.e(1869),n.e(2076),n.e(3599)]).then(n.bind(n,37214)),"@site/docs/concepts/features-overview/index.mdx",37214],"929c1f2b":[()=>Promise.all([n.e(1869),n.e(2076),n.e(619)]).then(n.bind(n,68642)),"@site/docs/reference/runtimes/prisma/index.mdx",68642],"95183ce9":[()=>Promise.all([n.e(1869),n.e(2076),n.e(6574)]).then(n.bind(n,28350)),"@site/docs/guides/programmatic-deployment/index.mdx",28350],"95b96bb9":[()=>n.e(6405).then(n.t.bind(n,7057,19)),"~blog/blog/blog-post-list-prop-blog.json",7057],"97787cbd":[()=>n.e(1922).then(n.t.bind(n,63961,19)),"@generated/docusaurus-plugin-content-blog/blog/p/blog-bd9.json",63961],"98537bc7":[()=>Promise.all([n.e(1869),n.e(2076),n.e(4877)]).then(n.bind(n,77031)),"@site/docs/concepts/mental-model/index.mdx",77031],"99c4cb86":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8237)]).then(n.bind(n,68305)),"@site/use-cases/iam-provider/index.mdx",68305],"9cca6528":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8102)]).then(n.bind(n,67076)),"@site/blog/2024-05-09-programmatic-deployment/index.mdx?truncated=true",67076],"9d3370bc":[()=>Promise.all([n.e(1869),n.e(2076),n.e(9594)]).then(n.bind(n,49079)),"@site/docs/reference/types/index.mdx",49079],"9e4087bc":[()=>n.e(2711).then(n.bind(n,95028)),"@theme/BlogArchivePage",95028],"9ef5846e":[()=>Promise.all([n.e(1869),n.e(2076),n.e(8097)]).then(n.bind(n,39615)),"@site/blog/2023-06-18-programmable-glue/index.mdx",39615],"9f09fab9":[()=>Promise.all([n.e(2076),n.e(9835)]).then(n.bind(n,99481)),"@site/docs/concepts/architecture/index.mdx",99481],a0248338:[()=>Promise.all([n.e(1869),n.e(2076),n.e(5028)]).then(n.bind(n,3894)),"@site/docs/guides/rest/index.mdx",3894],a4f64869:[()=>Promise.all([n.e(1869),n.e(2076),n.e(1723)]).then(n.bind(n,33454)),"@site/docs/reference/runtimes/substantial/index.mdx",33454],a6aa9e1f:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4145),n.e(8860),n.e(7643)]).then(n.bind(n,42938)),"@theme/BlogListPage",42938],a70287ac:[()=>Promise.all([n.e(2076),n.e(2058)]).then(n.bind(n,77487)),"@site/docs/reference/changelog.mdx",77487],a7456010:[()=>n.e(1235).then(n.t.bind(n,88552,19)),"@generated/docusaurus-plugin-content-pages/default/__plugin.json",88552],a7bd4aaa:[()=>n.e(7098).then(n.bind(n,35861)),"@theme/DocVersionRoot",35861],a94703ab:[()=>Promise.all([n.e(1869),n.e(9048)]).then(n.bind(n,7173)),"@theme/DocRoot",7173],aac7f9f5:[()=>Promise.all([n.e(2076),n.e(1995)]).then(n.bind(n,94508)),"@site/docs/guides/contributing.mdx",94508],aafba6b7:[()=>Promise.all([n.e(2076),n.e(681)]).then(n.bind(n,42321)),"@site/docs/reference/meta-cli/configuration-file.mdx",42321],ac075c54:[()=>Promise.all([n.e(1869),n.e(2076),n.e(3855)]).then(n.bind(n,12728)),"@site/blog/2024-05-09-programmatic-deployment/index.mdx",12728],ad20ab3b:[()=>Promise.all([n.e(2076),n.e(3916)]).then(n.bind(n,11040)),"@site/docs/reference/ecosystem/index.mdx",11040],ad5e0346:[()=>Promise.all([n.e(1869),n.e(2076),n.e(11)]).then(n.bind(n,95459)),"@site/docs/tutorials/metatype-basics/index.mdx",95459],af072c69:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4039)]).then(n.bind(n,31285)),"@site/use-cases/backend-for-frontend/index.mdx",31285],b3219b4c:[()=>n.e(3099).then(n.t.bind(n,83890,19)),"@generated/docusaurus-plugin-content-blog/blog/p/blog-archive-f05.json",83890],b8f4db82:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4619)]).then(n.bind(n,96996)),"@site/docs/reference/runtimes/temporal/index.mdx",96996],bbc54dbf:[()=>Promise.all([n.e(1869),n.e(2076),n.e(2427)]).then(n.bind(n,10148)),"@site/use-cases/orm-for-the-edge/index.mdx",10148],c02ff0d2:[()=>Promise.all([n.e(1869),n.e(2076),n.e(5190)]).then(n.bind(n,78294)),"@site/docs/reference/runtimes/wasm/index.mdx",78294],c1c441c4:[()=>Promise.all([n.e(2076),n.e(8958)]).then(n.bind(n,12)),"@site/docs/reference/types/functions.mdx",12],c2bbfad4:[()=>Promise.all([n.e(2076),n.e(8103)]).then(n.bind(n,29836)),"@site/docs/reference/types/comparison.mdx",29836],c367b882:[()=>Promise.all([n.e(1869),n.e(2076),n.e(7100)]).then(n.bind(n,66922)),"@site/docs/reference/runtimes/grpc/index.mdx",66922],c523e930:[()=>Promise.all([n.e(2076),n.e(6941)]).then(n.bind(n,88156)),"@site/docs/reference/typegate/synchronization/index.mdx",88156],c843538e:[()=>Promise.all([n.e(1869),n.e(2076),n.e(2384)]).then(n.bind(n,15404)),"@site/use-cases/faas-runner/index.mdx",15404],ccc49370:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4145),n.e(8860),n.e(3249)]).then(n.bind(n,57440)),"@theme/BlogPostPage",57440],cd86e9b3:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4947)]).then(n.bind(n,98143)),"@site/docs/reference/metagen/index.mdx",98143],cda5b2c7:[()=>Promise.all([n.e(1869),n.e(2076),n.e(9742)]).then(n.bind(n,75431)),"@site/use-cases/microservice-orchestration/index.mdx",75431],d2f8c7b3:[()=>Promise.all([n.e(2076),n.e(5140)]).then(n.bind(n,95411)),"@site/blog/2023-11-27-node-compatibility/index.mdx",95411],d89a9c00:[()=>Promise.all([n.e(1869),n.e(2076),n.e(5253)]).then(n.bind(n,24331)),"@site/docs/reference/typegate/cors/index.mdx",24331],d8f8b671:[()=>Promise.all([n.e(1869),n.e(2076),n.e(8349)]).then(n.bind(n,37860)),"@site/docs/reference/typegate/rate-limiting/index.mdx",37860],da9cdc83:[()=>Promise.all([n.e(1869),n.e(2076),n.e(2378)]).then(n.bind(n,18224)),"@site/blog/2023-03-15-emulating-servers/index.mdx?truncated=true",18224],dce22fdb:[()=>Promise.all([n.e(2076),n.e(8343)]).then(n.bind(n,90707)),"@site/src/pages/legal/terms.md",90707],e1da19f3:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4191)]).then(n.bind(n,48372)),"@site/docs/guides/wasm-functions/index.mdx",48372],e3ef7410:[()=>Promise.all([n.e(1869),n.e(2076),n.e(9164)]).then(n.bind(n,22004)),"@site/docs/reference/typegraph/index.mdx",22004],e66bdb87:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4591)]).then(n.bind(n,4391)),"@site/docs/reference/runtimes/random/index.mdx",4391],e8113c3c:[()=>Promise.all([n.e(2076),n.e(2254)]).then(n.bind(n,46127)),"@site/src/pages/legal/privacy-policy.md",46127],eb6f68a0:[()=>Promise.all([n.e(2076),n.e(4991)]).then(n.bind(n,38189)),"@site/docs/reference/meta-cli/embedded-typegate/index.mdx",38189],efb264ae:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4834)]).then(n.bind(n,97649)),"@site/docs/reference/types/injections.mdx",97649],f1c506b7:[()=>n.e(2467).then(n.t.bind(n,6737,19)),"@generated/docusaurus-plugin-content-blog/blog/__plugin.json",6737],fbf1744f:[()=>Promise.all([n.e(2076),n.e(6959)]).then(n.bind(n,77275)),"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx?truncated=true",77275],fd15d584:[()=>Promise.all([n.e(1869),n.e(2076),n.e(4762)]).then(n.bind(n,55303)),"@site/docs/guides/test-your-typegraph/index.mdx",55303]};var s=n(86070);function l(e){let{error:t,retry:n,pastDelay:r}=e;return t?(0,s.jsxs)("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"},children:[(0,s.jsx)("p",{children:String(t)}),(0,s.jsx)("div",{children:(0,s.jsx)("button",{type:"button",onClick:n,children:"Retry"})})]}):r?(0,s.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,s.jsx)("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb",children:(0,s.jsxs)("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2",children:[(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsxs)("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0",children:[(0,s.jsx)("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:"22",cy:"22",r:"8",children:(0,s.jsx)("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"})})]})})}):null}var c=n(7771),u=n(17832);function d(e,t){if("*"===e)return o()({loading:l,loader:()=>n.e(2940).then(n.bind(n,32940)),modules:["@theme/NotFound"],webpack:()=>[32940],render(e,t){const n=e.default;return(0,s.jsx)(u.W,{value:{plugin:{name:"native",id:"default"}},children:(0,s.jsx)(n,{...t})})}});const r=a[`${e}-${t}`],d={},p=[],f=[],h=(0,c.A)(r);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=i[n];r&&(d[t]=r[0],p.push(r[1]),f.push(r[2]))})),o().Map({loading:l,loader:d,modules:p,webpack:()=>f,render(t,n){const o=JSON.parse(JSON.stringify(r));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let i=o;const s=n.split(".");s.slice(0,-1).forEach((e=>{i=i[e]})),i[s[s.length-1]]=a}));const a=o.__comp;delete o.__comp;const i=o.__context;delete o.__context;const l=o.__props;return delete o.__props,(0,s.jsx)(u.W,{value:i,children:(0,s.jsx)(a,{...o,...l,...n})})}})}const p=[{path:"/blog",component:d("/blog","f31"),exact:!0},{path:"/blog/2023/03/15/emulating-servers",component:d("/blog/2023/03/15/emulating-servers","0e6"),exact:!0},{path:"/blog/2023/06/18/programmable-glue",component:d("/blog/2023/06/18/programmable-glue","3bd"),exact:!0},{path:"/blog/2023/11/27/node-compatibility",component:d("/blog/2023/11/27/node-compatibility","b09"),exact:!0},{path:"/blog/2024/05/09/programmatic-deployment",component:d("/blog/2024/05/09/programmatic-deployment","c79"),exact:!0},{path:"/blog/2024/08/26/python-on-webassembly",component:d("/blog/2024/08/26/python-on-webassembly","d29"),exact:!0},{path:"/blog/2024/08/27/distributed-execution-flow-paradigms",component:d("/blog/2024/08/27/distributed-execution-flow-paradigms","ca6"),exact:!0},{path:"/blog/2024/09/26/introducing-grpc-runtime",component:d("/blog/2024/09/26/introducing-grpc-runtime","e1c"),exact:!0},{path:"/blog/archive",component:d("/blog/archive","d1d"),exact:!0},{path:"/legal/privacy-policy",component:d("/legal/privacy-policy","4fe"),exact:!0},{path:"/legal/terms",component:d("/legal/terms","aed"),exact:!0},{path:"/docs",component:d("/docs","ba5"),routes:[{path:"/docs",component:d("/docs","2fc"),routes:[{path:"/docs",component:d("/docs","124"),routes:[{path:"/docs",component:d("/docs","e81"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/architecture",component:d("/docs/concepts/architecture","5a3"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/comparisons",component:d("/docs/concepts/comparisons","c09"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/features-overview",component:d("/docs/concepts/features-overview","196"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/mental-model",component:d("/docs/concepts/mental-model","0a9"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/RFCs",component:d("/docs/concepts/RFCs","301"),exact:!0,sidebar:"docs"},{path:"/docs/concepts/RFCs/M0-template",component:d("/docs/concepts/RFCs/M0-template","c4e"),exact:!0,sidebar:"docs"},{path:"/docs/guides/contributing",component:d("/docs/guides/contributing","39f"),exact:!0,sidebar:"docs"},{path:"/docs/guides/external-functions",component:d("/docs/guides/external-functions","bde"),exact:!0,sidebar:"docs"},{path:"/docs/guides/files-upload",component:d("/docs/guides/files-upload","0b9"),exact:!0,sidebar:"docs"},{path:"/docs/guides/import-external-modules",component:d("/docs/guides/import-external-modules","495"),exact:!0,sidebar:"docs"},{path:"/docs/guides/programmatic-deployment",component:d("/docs/guides/programmatic-deployment","0b9"),exact:!0,sidebar:"docs"},{path:"/docs/guides/rest",component:d("/docs/guides/rest","433"),exact:!0,sidebar:"docs"},{path:"/docs/guides/securing-requests",component:d("/docs/guides/securing-requests","86e"),exact:!0,sidebar:"docs"},{path:"/docs/guides/self-hosting",component:d("/docs/guides/self-hosting","f2f"),exact:!0,sidebar:"docs"},{path:"/docs/guides/test-your-typegraph",component:d("/docs/guides/test-your-typegraph","abf"),exact:!0,sidebar:"docs"},{path:"/docs/guides/wasm-functions",component:d("/docs/guides/wasm-functions","c76"),exact:!0,sidebar:"docs"},{path:"/docs/reference/changelog",component:d("/docs/reference/changelog","783"),exact:!0,sidebar:"docs"},{path:"/docs/reference/ecosystem",component:d("/docs/reference/ecosystem","343"),exact:!0,sidebar:"docs"},{path:"/docs/reference/graphql",component:d("/docs/reference/graphql","ad6"),exact:!0,sidebar:"docs"},{path:"/docs/reference/meta-cli",component:d("/docs/reference/meta-cli","b6c"),exact:!0,sidebar:"docs"},{path:"/docs/reference/meta-cli/available-commands",component:d("/docs/reference/meta-cli/available-commands","a05"),exact:!0,sidebar:"docs"},{path:"/docs/reference/meta-cli/configuration-file",component:d("/docs/reference/meta-cli/configuration-file","549"),exact:!0,sidebar:"docs"},{path:"/docs/reference/meta-cli/embedded-typegate",component:d("/docs/reference/meta-cli/embedded-typegate","86d"),exact:!0,sidebar:"docs"},{path:"/docs/reference/metagen",component:d("/docs/reference/metagen","293"),exact:!0,sidebar:"docs"},{path:"/docs/reference/policies",component:d("/docs/reference/policies","113"),exact:!0,sidebar:"docs"},{path:"/docs/reference/rest",component:d("/docs/reference/rest","870"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes",component:d("/docs/reference/runtimes","86b"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/deno",component:d("/docs/reference/runtimes/deno","7ef"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/graphql",component:d("/docs/reference/runtimes/graphql","cfd"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/grpc",component:d("/docs/reference/runtimes/grpc","dae"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/http",component:d("/docs/reference/runtimes/http","d1d"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/kv",component:d("/docs/reference/runtimes/kv","927"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/prisma",component:d("/docs/reference/runtimes/prisma","637"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/python",component:d("/docs/reference/runtimes/python","c7a"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/random",component:d("/docs/reference/runtimes/random","a6c"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/s3",component:d("/docs/reference/runtimes/s3","5f4"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/substantial",component:d("/docs/reference/runtimes/substantial","a9d"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/temporal",component:d("/docs/reference/runtimes/temporal","0d3"),exact:!0,sidebar:"docs"},{path:"/docs/reference/runtimes/wasm",component:d("/docs/reference/runtimes/wasm","b3e"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegate",component:d("/docs/reference/typegate","1fd"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegate/authentication",component:d("/docs/reference/typegate/authentication","e71"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegate/cors",component:d("/docs/reference/typegate/cors","a93"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegate/rate-limiting",component:d("/docs/reference/typegate/rate-limiting","5b3"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegate/synchronization",component:d("/docs/reference/typegate/synchronization","de4"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegraph",component:d("/docs/reference/typegraph","6d7"),exact:!0,sidebar:"docs"},{path:"/docs/reference/typegraph/client",component:d("/docs/reference/typegraph/client","4cb"),exact:!0,sidebar:"docs"},{path:"/docs/reference/types",component:d("/docs/reference/types","eb9"),exact:!0,sidebar:"docs"},{path:"/docs/reference/types/comparison",component:d("/docs/reference/types/comparison","67a"),exact:!0,sidebar:"docs"},{path:"/docs/reference/types/functions",component:d("/docs/reference/types/functions","ee1"),exact:!0,sidebar:"docs"},{path:"/docs/reference/types/injections",component:d("/docs/reference/types/injections","5c1"),exact:!0,sidebar:"docs"},{path:"/docs/reference/types/parameter-transformations",component:d("/docs/reference/types/parameter-transformations","8e5"),exact:!0,sidebar:"docs"},{path:"/docs/tutorials/metatype-basics",component:d("/docs/tutorials/metatype-basics","35a"),exact:!0,sidebar:"docs"},{path:"/docs/tutorials/quick-start",component:d("/docs/tutorials/quick-start","1ba"),exact:!0,sidebar:"docs"}]}]}]},{path:"/use-cases",component:d("/use-cases","922"),routes:[{path:"/use-cases",component:d("/use-cases","4f9"),routes:[{path:"/use-cases",component:d("/use-cases","e5c"),routes:[{path:"/use-cases/automatic-crud-validation",component:d("/use-cases/automatic-crud-validation","da8"),exact:!0,sidebar:"useCases"},{path:"/use-cases/backend-for-frontend",component:d("/use-cases/backend-for-frontend","9b1"),exact:!0,sidebar:"useCases"},{path:"/use-cases/faas-runner",component:d("/use-cases/faas-runner","cfd"),exact:!0,sidebar:"useCases"},{path:"/use-cases/graphql-server",component:d("/use-cases/graphql-server","68c"),exact:!0,sidebar:"useCases"},{path:"/use-cases/iam-provider",component:d("/use-cases/iam-provider","940"),exact:!0,sidebar:"useCases"},{path:"/use-cases/microservice-orchestration",component:d("/use-cases/microservice-orchestration","c6e"),exact:!0,sidebar:"useCases"},{path:"/use-cases/orm-for-the-edge",component:d("/use-cases/orm-for-the-edge","e3f"),exact:!0,sidebar:"useCases"},{path:"/use-cases/programmable-api-gateway",component:d("/use-cases/programmable-api-gateway","a64"),exact:!0,sidebar:"useCases"}]}]}]},{path:"/",component:d("/","e5f"),exact:!0},{path:"*",component:d("*")}]},95143:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>i});var r=n(30758),o=n(86070);const a=r.createContext(!1);function i(e){let{children:t}=e;const[n,i]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{i(!0)}),[]),(0,o.jsx)(a.Provider,{value:n,children:t})}},7881:(e,t,n)=>{"use strict";var r=n(30758),o=n(99576),a=n(70248),i=n(41742),l=n(4784),c=n(25283);const u=[n(94127),n(16636),n(58493),n(96213),n(98222)];var d=n(68384),p=n(25557),f=n(70389),h={561:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["id","class","length"],n=e.attributes;return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t{Object.defineProperty(t,"__esModule",{value:!0}),t.getParents=function(e){for(var t=[],n=e;(0,r.isElement)(n);)t.push(n),n=n.parentNode;return t};var r=n(440)},970:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getTag=function(e){return e.tagName.toLowerCase().replace(/:/g,"\\:")}},924:(e,t,n)=>{t.A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.selectorTypes,r=void 0===n?["ID","Class","Tag","NthChild"]:n,o=t.attributesToIgnore,a=void 0===o?["id","class","length"]:o,i=t.excludeRegex,s=void 0===i?null:i,l=[],d=(0,u.getParents)(e),p=!0,f=!1,m=void 0;try{for(var g,v=d[Symbol.iterator]();!(p=(g=v.next()).done);p=!0){var y=h(g.value,r,a,s);Boolean(y)&&l.push(y)}}catch(L){f=!0,m=L}finally{try{!p&&v.return&&v.return()}finally{if(f)throw m}}var b=[],w=!0,x=!1,k=void 0;try{for(var S,C=l[Symbol.iterator]();!(w=(S=C.next()).done);w=!0){var E=S.value;b.unshift(E);var T=b.join(" > ");if((0,c.isUnique)(e,T))return T}}catch(L){x=!0,k=L}finally{try{!w&&C.return&&C.return()}finally{if(x)throw k}}return null};var r=n(169),o=n(770),a=n(584),i=n(561),s=n(64),l=n(970),c=n(213),u=n(175);function d(e,t){var n=e.parentNode.querySelectorAll(t);return 1===n.length&&n[0]===e}function p(e,t){return t.find(d.bind(null,e))}function f(e,t,n){var r=(0,a.getCombinations)(t,3),o=p(e,r);return Boolean(o)||Boolean(n)&&(o=p(e,r=r.map((function(e){return n+e}))),Boolean(o))?o:null}function h(e,t,n,a){var c=void 0,u=function(e,t,n){var a={Tag:l.getTag,NthChild:s.getNthChild,Attributes:function(e){return(0,i.getAttributes)(e,n)},Class:o.getClassSelectors,ID:r.getID};return t.reduce((function(t,n){return t[n]=a[n](e),t}),{})}(e,t,n);a&&a instanceof RegExp&&(u.ID=a.test(u.ID)?null:u.ID,u.Class=u.Class.filter((function(e){return!a.test(e)})));var p=!0,h=!1,m=void 0;try{for(var g,v=t[Symbol.iterator]();!(p=(g=v.next()).done);p=!0){var y=g.value,b=u.ID,w=u.Tag,x=u.Class,k=u.Attributes,S=u.NthChild;switch(y){case"ID":if(Boolean(b)&&d(e,b))return b;break;case"Tag":if(Boolean(w)&&d(e,w))return w;break;case"Class":if(Boolean(x)&&x.length&&(c=f(e,x,w)))return c;break;case"Attributes":if(Boolean(k)&&k.length&&(c=f(e,k,w)))return c;break;case"NthChild":if(Boolean(S))return S}}}catch(C){h=!0,m=C}finally{try{!p&&v.return&&v.return()}finally{if(h)throw m}}return"*"}},440:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.isElement=function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":n(HTMLElement))?e instanceof HTMLElement:!!e&&"object"===(void 0===e?"undefined":n(e))&&1===e.nodeType&&"string"==typeof e.nodeName}},213:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isUnique=function(e,t){if(!Boolean(t))return!1;var n=e.ownerDocument.querySelectorAll(t);return 1===n.length&&n[0]===e}}},m={};function g(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return h[e](n,n.exports,g),n.exports}g.d=(e,t)=>{for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var v={};(()=>{function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var n=0;n'):u("button","#fff"),this.feedbackButton.className="bb-feedback-button gleap-font gl-block",this.feedbackButton.setAttribute("dir",Zn.getInstance().isRTLLayout?"rtl":"ltr"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||n.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT?(this.feedbackButton.classList.add("bb-feedback-button--classic-button-style"),this.feedbackButton.innerHTML=' ")):t!==this.lastButtonIcon&&(this.feedbackButton.innerHTML=' ')),this.lastButtonIcon=t;var r=!1;null===e.getInstance().buttonHidden?n.feedbackButtonPosition===e.FEEDBACK_BUTTON_NONE&&(r=!0):e.getInstance().buttonHidden&&(r=!0),r&&this.feedbackButton.classList.add("bb-feedback-button--disabled"),n.feedbackButtonPosition===e.FEEDBACK_BUTTON_BOTTOM_LEFT&&this.feedbackButton.classList.add("bb-feedback-button--bottomleft"),It.getInstance().isOpened()&&this.feedbackButton.classList.add("bb-feedback-button--open");var o=It.getInstance().appMode;"survey"!==o&&"survey_full"!==o&&"survey_web"!==o||this.feedbackButton.classList.add("bb-feedback-button--survey"),!0!==n.hideForGuests||qe.getInstance().isUser()||this.feedbackButton.classList.add("bb-feedback-button--hidden")}}}])&&t(r.prototype,o),a&&t(r,a),Object.defineProperty(r,"prototype",{writable:!1}),e}();function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,s=[],l=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n
'),document.body.appendChild(t);var n=function(){t.remove()};t.querySelector(".gleap-image-view-close").addEventListener("click",(function(){n()})),t.addEventListener("click",(function(e){e.target===t&&n()}))}))})),Tt(this,"updateFrameStyle",(function(){if(t.gleapFrameContainer){for(var e="gleap-frame-container--survey",n="gleap-frame-container--extended",r="gleap-frame-container--survey-full",a="gleap-frame-container--classic",i="gleap-frame-container--classic-left",s="gleap-frame-container--modern-left",l="gleap-frame-container--no-button",c=[a,i,n,s,l,e,r],u=0;u
'):"",'\n
')," ").concat(t.data.sender.name,"
'),'\n
0&&M[0].focus()}function T(){var e=c("popover");if(null==e?void 0:e.wrapper){var t=e.wrapper.getBoundingClientRect(),r=n("stagePadding")||0,o=n("popoverOffset")||0;return{width:t.width+r+o,height:t.height+r+o,realWidth:t.width,realHeight:t.height}}}function L(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,a=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.top-o,window.innerHeight-r.realHeight-a.width),a.width):"end"===e?Math.max(Math.min(n.top-(null==r?void 0:r.realHeight)+n.height+o,window.innerHeight-(null==r?void 0:r.realHeight)-a.width),a.width):"center"===e?Math.max(Math.min(n.top+n.height/2-(null==r?void 0:r.realHeight)/2,window.innerHeight-(null==r?void 0:r.realHeight)-a.width),a.width):0}function I(e,t){var n=t.elementDimensions,r=t.popoverDimensions,o=t.popoverPadding,a=t.popoverArrowDimensions;return"start"===e?Math.max(Math.min(n.left-o,window.innerWidth-r.realWidth-a.width),a.width):"end"===e?Math.max(Math.min(n.left-(null==r?void 0:r.realWidth)+n.width+o,window.innerWidth-(null==r?void 0:r.realWidth)-a.width),a.width):"center"===e?Math.max(Math.min(n.left+n.width/2-(null==r?void 0:r.realWidth)/2,window.innerWidth-(null==r?void 0:r.realWidth)-a.width),a.width):0}function A(e,t){var r=c("popover");if(r){var o=(null==t?void 0:t.popover)||{},a=o.align,i=void 0===a?"start":a,s=o.side,l=void 0===s?"left":s,u=i,d="gleap-tour-dummy-element"===e.id?"over":l,p=n("stagePadding")||0,f=T(),h=r.arrow.getBoundingClientRect(),m=e.getBoundingClientRect(),g=m.top-f.height,v=g>=0,y=window.innerHeight-(m.bottom+f.height),b=y>=0,w=m.left-f.width,x=w>=0,k=window.innerWidth-(m.right+f.width),S=k>=0,C=!(v||b||x||S),E=d;if("top"===d&&v?S=x=b=!1:"bottom"===d&&b?S=x=v=!1:"left"===d&&x?S=v=b=!1:"right"===d&&S&&(x=v=b=!1),"over"===d){var A=window.innerWidth/2-f.realWidth/2,O=window.innerHeight/2-f.realHeight/2;r.wrapper.style.left="".concat(A,"px"),r.wrapper.style.right="auto",r.wrapper.style.top="".concat(O,"px"),r.wrapper.style.bottom="auto"}else if(C){var _=window.innerWidth/2-(null==f?void 0:f.realWidth)/2;r.wrapper.style.left="".concat(_,"px"),r.wrapper.style.right="auto",r.wrapper.style.bottom="".concat(10,"px"),r.wrapper.style.top="auto"}else if(x){var P=Math.min(w,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),M=L(u,{elementDimensions:m,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(P,"px"),r.wrapper.style.top="".concat(M,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="left"}else if(S){var R=Math.min(k,window.innerWidth-(null==f?void 0:f.realWidth)-h.width),N=L(u,{elementDimensions:m,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.right="".concat(R,"px"),r.wrapper.style.top="".concat(N,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.left="auto",E="right"}else if(v){var j=Math.min(g,window.innerHeight-f.realHeight-h.width),D=I(u,{elementDimensions:m,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.top="".concat(j,"px"),r.wrapper.style.left="".concat(D,"px"),r.wrapper.style.bottom="auto",r.wrapper.style.right="auto",E="top"}else if(b){var F=Math.min(y,window.innerHeight-(null==f?void 0:f.realHeight)-h.width),B=I(u,{elementDimensions:m,popoverDimensions:f,popoverPadding:p,popoverArrowDimensions:h});r.wrapper.style.left="".concat(B,"px"),r.wrapper.style.bottom="".concat(F,"px"),r.wrapper.style.top="auto",r.wrapper.style.right="auto",E="bottom"}C?r.arrow.classList.add("gleap-tour-popover-arrow-none"):function(e,t,n){var r=c("popover");if(r){var o=n.getBoundingClientRect(),a=T(),i=r.arrow,s=a.width,l=window.innerWidth,u=o.width,d=o.left,p=a.height,f=window.innerHeight,h=o.top,m=o.height;i.className="gleap-tour-popover-arrow";var g=t,v=e;"top"===t?(d+u<=0?(g="right",v="end"):d+u-s<=0&&(g="top",v="start"),d>=l?(g="left",v="end"):d+s>=l&&(g="top",v="end")):"bottom"===t?(d+u<=0?(g="right",v="start"):d+u-s<=0&&(g="bottom",v="start"),d>=l?(g="left",v="start"):d+s>=l&&(g="bottom",v="end")):"left"===t?(h+m<=0?(g="bottom",v="end"):h+m-p<=0&&(g="left",v="start"),h>=f?(g="top",v="end"):h+p>=f&&(g="left",v="end")):"right"===t&&(h+m<=0?(g="bottom",v="start"):h+m-p<=0&&(g="right",v="start"),h>=f?(g="top",v="start"):h+p>=f&&(g="right",v="end")),g?(i.classList.add("gleap-tour-popover-arrow-side-".concat(g)),i.classList.add("gleap-tour-popover-arrow-align-".concat(v))):i.classList.add("gleap-tour-popover-arrow-none")}}(u,E,e)}}return function(){function e(){n("allowClose")&&h()}function r(){var e=c("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e+1;t[r]?f(r):h()}}function o(){var e=c("activeIndex"),t=n("steps")||[];if(void 0!==e){var r=e-1;t[r]?f(r):h()}}function a(){var e;if(!c("__transitionCallback")){var t=c("activeIndex"),r=c("__activeStep"),a=c("__activeElement");if(void 0!==t&&void 0!==r&&void 0!==c("activeIndex")){var i=(null==(e=r.popover)?void 0:e.onPrevClick)||n("onPrevClick");if(i)return i(a,r,{config:n(),state:c()});o()}}}function i(){var e;if(!c("__transitionCallback")){var t=c("activeIndex"),o=c("__activeStep"),a=c("__activeElement");if(void 0!==t&&void 0!==o){var i=(null==(e=o.popover)?void 0:e.onNextClick)||n("onNextClick");if(i)return i(a,o,{config:n(),state:c()});r()}}}function s(){c("isInitialized")||(l("isInitialized",!0),document.body.classList.add("gleap-tour-active",n("animate")?"gleap-tour-fade":"gleap-tour-simple"),window.addEventListener("keyup",k,!1),window.addEventListener("keydown",x,!1),window.addEventListener("resize",w),window.addEventListener("scroll",w),p("overlayClick",e),p("escapePress",e),p("arrowLeftPress",a),p("arrowRightPress",i))}function f(){var e,t,r,o,a,i,s,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,d=n("steps");if(!d)return console.error("No steps to drive through"),void h();if(d[u]){l("__activeOnDestroyed",document.activeElement),l("activeIndex",u);var p=d[u],m=d[u+1],g=d[u-1],v=(null==(e=p.popover)?void 0:e.doneBtnText)||n("doneBtnText")||"Done",b=n("allowClose"),w=void 0!==(null==(t=p.popover)?void 0:t.showProgress)?null==(r=p.popover)?void 0:r.showProgress:n("showProgress"),x=((null==(o=p.popover)?void 0:o.progressText)||n("progressText")||"{{current}} of {{total}}").replace("{{current}}","".concat(u+1)).replace("{{total}}","".concat(d.length)),k=(null==(a=p.popover)?void 0:a.showButtons)||n("showButtons"),S=["next","previous"].concat(Wr(b?["close"]:[])).filter((function(e){return!(null==k?void 0:k.length)||k.includes(e)})),C=(null==(i=p.popover)?void 0:i.onNextClick)||n("onNextClick"),E=(null==(s=p.popover)?void 0:s.onPrevClick)||n("onPrevClick"),T=(null==(c=p.popover)?void 0:c.onCloseClick)||n("onCloseClick");y(Vr(Vr({},p),{},{popover:Vr({showButtons:S,nextBtnText:m?void 0:v,disableButtons:Wr(g?[]:["previous"]),showProgress:w,progressText:x,onNextClick:C||function(){m?f(u+1):h()},onPrevClick:E||function(){f(u-1)},onCloseClick:T||function(){h()}},(null==p?void 0:p.popover)||{})}))}else h()}function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=c("__activeElement"),r=c("__activeStep"),o=c("__activeOnDestroyed"),a=n("onDestroyStarted");if(e&&a)a(t&&"gleap-tour-dummy-element"!==(null==t?void 0:t.id)?t:void 0,r,{config:n(),state:c()});else{var i,s,l,p=(null==r?void 0:r.onDeselected)||n("onDeselected"),f=n("onDestroyed");if(document.body.classList.remove("gleap-tour-active","gleap-tour-fade","gleap-tour-simple"),window.removeEventListener("keyup",k),window.removeEventListener("resize",w),window.removeEventListener("scroll",w),(s=c("popover"))&&(null==(i=s.wrapper.parentElement)||i.removeChild(s.wrapper)),function(){var e;null==(e=document.getElementById("gleap-tour-dummy-element"))||e.remove(),document.querySelectorAll(".gleap-tour-active-element").forEach((function(e){e.classList.remove("gleap-tour-active-element","gleap-tour-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}))}(),(l=c("__overlaySvg"))&&l.remove(),d={},u(),t&&r){var h="gleap-tour-dummy-element"===t.id;p&&p(h?void 0:t,r,{config:n(),state:c()}),f&&f(h?void 0:t,r,{config:n(),state:c()})}o&&o.focus()}}return t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{isActive:function(){return c("isInitialized")||!1},refresh:w,drive:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;s(),f(e)},setConfig:t,setSteps:function(e){u(),t(Vr(Vr({},n()),{},{steps:e}))},getConfig:n,getState:c,getActiveIndex:function(){return c("activeIndex")},isFirstStep:function(){return 0===c("activeIndex")},isLastStep:function(){var e=n("steps")||[],t=c("activeIndex");return void 0!==t&&t===e.length-1},getActiveStep:function(){return c("activeStep")},getActiveElement:function(){return c("activeElement")},getPreviousElement:function(){return c("previousElement")},getPreviousStep:function(){return c("previousStep")},moveNext:r,movePrevious:o,moveTo:function(e){(n("steps")||[])[e]?f(e):h()},hasNextStep:function(){var e=n("steps")||[],t=c("activeIndex");return void 0!==t&&e[t+1]},hasPreviousStep:function(){var e=n("steps")||[],t=c("activeIndex");return void 0!==t&&e[t-1]},highlight:function(e){s(),y(Vr(Vr({},e),{},{popover:e.popover?Vr({showButtons:[],showProgress:!1,progressText:""},e.popover):void 0}))},destroy:function(){h(!1)}}}}();const Yr=Zr;function Xr(e){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xr(e)}function Jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t