diff --git a/404.html b/404.html index 2535ce636c..397dddac0f 100644 --- a/404.html +++ b/404.html @@ -17,8 +17,8 @@ - - + +
Skip to main content

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/assets/js/0c88aa32.1ecf4b7c.js b/assets/js/0c88aa32.5adef04f.js similarity index 88% rename from assets/js/0c88aa32.1ecf4b7c.js rename to assets/js/0c88aa32.5adef04f.js index c4e203ce05..9aba1dd84a 100644 --- a/assets/js/0c88aa32.1ecf4b7c.js +++ b/assets/js/0c88aa32.5adef04f.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1201],{88079:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>y,contentTitle:()=>p,default:()=>f,frontMatter:()=>u,metadata:()=>x,toc:()=>m});var i=n(86070),o=n(25710),a=n(65671),s=n(30758),r=n(92076),c=n(30340),d=n(45656);function h(e){let{name:t,typegraph:n}=e;const{siteConfig:{customFields:{tgUrl:o}}}=(0,c.A)(),[a,d]=(0,s.useState)(null),h=(0,s.useCallback)((async()=>{try{const e=await fetch(`${o}/${n}/auth/take`,{credentials:"include"}),{token:t}=await e.json();d(t)}catch{d("not token found")}}),[d,o]),l=`${o}/${n}/auth/${t}?redirect_uri=${encodeURIComponent(window.location.href)}`;return(0,i.jsxs)("p",{className:"mb-6",children:["Start the flow via ",(0,i.jsx)(r.A,{href:l,children:l})," and take token by clicking"," ",(0,i.jsx)(r.A,{className:"cursor-pointer",onClick:h,children:"here"}),":",(0,i.jsx)("br",{}),(0,i.jsx)("input",{className:"py-1 border-0 bg-slate-200 w-full",value:a??""})]})}const l=e=>(0,i.jsx)(d.A,{children:()=>(0,i.jsx)(h,{...e})}),u={},p="Authentication",x={id:"reference/typegate/authentication/index",title:"Authentication",description:'Authentication enable the typegate to identify the user making the request and share some contextual data (called later "context" or "claims"). This data can then be used by policies or injected into various fields. Authenticated requests must use the Authorization header to provide a token in one of the following format.',source:"@site/docs/reference/typegate/authentication/index.mdx",sourceDirName:"reference/typegate/authentication",slug:"/reference/typegate/authentication/",permalink:"/docs/reference/typegate/authentication/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/authentication/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Typegate",permalink:"/docs/reference/typegate/"},next:{title:"CORS",permalink:"/docs/reference/typegate/cors/"}},y={},m=[{value:"Basic authentication",id:"basic-authentication",level:2},{value:"JWT authentication",id:"jwt-authentication",level:2},{value:"OAuth2 authorization",id:"oauth2-authorization",level:2},{value:"Take flow",id:"take-flow",level:3},{value:"OpenID Connect",id:"openid-connect",level:3},{value:"Embedded providers",id:"embedded-providers",level:3}];function g(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"authentication",children:"Authentication"}),"\n",(0,i.jsxs)(t.p,{children:['Authentication enable the typegate to identify the user making the request and share some contextual data (called later "context" or "claims"). This data can then be used by policies or injected into various fields. Authenticated requests must use the ',(0,i.jsx)(t.code,{children:"Authorization"})," header to provide a token in one of the following format."]}),"\n",(0,i.jsx)(t.h2,{id:"basic-authentication",children:"Basic authentication"}),"\n",(0,i.jsxs)(t.p,{children:["Basic authentication is the simplest way to authenticate requests. It is done by sending a base64 encoded string of your username and password in the authorization header. Recall that base64 encoding is not encryption and can be easily reversed, thus ",(0,i.jsx)(t.strong,{children:"the traffic must be encrypted with SSL/TLS"})," when using basic authentication as your password will otherwise be visible."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"BASIC_[username]=password"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Basic base64(username:password)"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ username }"})})]})]})]}),"\n",(0,i.jsx)(a.A,{typegraph:"basic-authentication",python:n(33175),typescript:n(26217),query:n(3987),headers:{Authorization:"Basic YWRtaW46cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,i.jsx)(t.h2,{id:"jwt-authentication",children:"JWT authentication"}),"\n",(0,i.jsx)(t.p,{children:"A more secure way to authenticate requests is to use JSON Web Tokens. The context of a user is signed with a secret key and the typegate will verify the signature to ensure the context has not been tampered with. The JWT is then sent in the authorization header."}),"\n",(0,i.jsxs)(t.p,{children:["The JWT is usually generated by an external identity provider (IdP) such as Keycloak or Auth0 and limited in time. The typegate will check that the ",(0,i.jsx)(t.code,{children:"exp"})," (expiration time) and ",(0,i.jsx)(t.code,{children:"nbf"})," (not before) are valid if they exist in the context. The logic of refreshing expired tokens is left to the user or the IdP client library being used."]}),"\n",(0,i.jsxs)(t.p,{children:['The typegate supports the most frequently used algorithms for signing the JWT and can be imported as using "jwk", "raw", "pkcs8" or "spki" formats (see SubtleCrypto ',(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey",children:"documentation"}),"). For instance, an asymmetric key pair can be generated with the following command:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typescript",children:'const keys = await crypto.subtle.generateKey(\n { name: "ECDSA", namedCurve: "P-384" },\n true,\n ["sign", "verify"],\n);\nconst publicKey = await crypto.subtle.exportKey("jwk", keys.publicKey);\n// save keys.privateKey for later use\nconsole.log(JSON.stringify(publicKey));\n// in typegraph: Auth.jwt("keycloak", "jwk", {"name": "ECDSA", "namedCurve": "P-384"})\n'})}),"\n",(0,i.jsx)(t.p,{children:"Even though, asymmetric encryption is recommended, HMAC-SHA256 is so commonly used that an alias is provided for it."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"[authentication]_JWT=secret"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Bearer token"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ your_own_content }"})})]})]})]}),"\n",(0,i.jsx)(a.A,{typegraph:"jwt-authentification",python:n(8980),typescript:n(37538),query:n(36722),headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ5b3VyX293bl9jb250ZW50IjoiY3VzdG9tLXJvbGUifQ.r7sR34FQSJbZTz8PNHbnQBXaRlK9Mo3BM5Rd9R8XuNQ"},tab:"headers"}),"\n",(0,i.jsx)(t.p,{children:"Note that for the sake of the demo, the token has no expiration time. Tokens should always be shorted lived and refreshed frequently to reduce the risk of unexpected access."}),"\n",(0,i.jsx)(t.h2,{id:"oauth2-authorization",children:"OAuth2 authorization"}),"\n",(0,i.jsx)(t.p,{children:"OAuth2 allows a user to grant limited access to their resources on one site, to another site, without having to expose their credentials. It is commonly used when the typegate needed to access restricted information in third-parties such as Google or GitHub."}),"\n",(0,i.jsx)(t.p,{children:"Most of the time, the OAuth2 is managed by your identity provider and relies on the JWT authentication as explained above. However the typegate provides a simple way to handle the OAuth2 flow without IdP or when the system should be lightweight."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsxs)(t.td,{children:[(0,i.jsx)(t.code,{children:"[authentication]_CLIENT_ID=client_id"}),", ",(0,i.jsx)(t.code,{children:"[authentication]_CLIENT_SECRET=client_secret"})]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Bearer token"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ content_from_your_idp }"})})]})]})]}),"\n",(0,i.jsx)(t.h3,{id:"take-flow",children:"Take flow"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Redirect the user to ",(0,i.jsx)(t.code,{children:"https://[typegate].metatype.cloud/[typegraph]/auth/[authentication]?redirect_uri=https://your-website.com/login"})," and the OAuth2 starts for the user"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["When the user has completed the flow, the typegate will redirect the user to ",(0,i.jsx)(t.code,{children:"https://your-website.com/login"}),' and you can "take" the token from the typegate as follows. This can be only done once and is limited in time:']}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typescript",children:'const take = await fetch(\n "https://[typegate].metatype.cloud/[typegraph]/auth/take",\n {\n credentials: "include",\n },\n);\nconst { token } = await take.json();\n'})}),"\n",(0,i.jsxs)(t.ol,{start:"3",children:["\n",(0,i.jsxs)(t.li,{children:["The token can then be used as JWT in the ",(0,i.jsx)(t.code,{children:"Authorization"})," header of your requests, and the response of the typegate will contain a header ",(0,i.jsx)(t.code,{children:"Next-Authorization"}),". When this header is present, the value should be used in follow-up calls (value will be empty if the authentication has expired)."]}),"\n"]}),"\n",(0,i.jsx)(l,{name:"github",typegraph:"oauth2-authentication"}),"\n",(0,i.jsx)(a.A,{typegraph:"oauth2_authentication",python:n(42422),typescript:n(23680),query:n(64572),headers:{Authorization:"Bearer your-token"},tab:"headers"}),"\n",(0,i.jsx)(t.h3,{id:"openid-connect",children:"OpenID Connect"}),"\n",(0,i.jsxs)(t.p,{children:["OpenID Connect is an authentication layer on top of OAuth2. It is used to verify the identity of the user and retrieve basic information about them. You can add ",(0,i.jsx)(t.code,{children:"openid"})," to the OAuth2 scope and you will receive an ",(0,i.jsx)(t.code,{children:"id_token"})," in the response. The ",(0,i.jsx)(t.code,{children:"id_token"})," is a JWT that contains the user's information and is signed by the IdP."]}),"\n",(0,i.jsx)(t.h3,{id:"embedded-providers",children:"Embedded providers"}),"\n",(0,i.jsx)(t.p,{children:"Frequent OAuth2 providers are embedded and can be directly used in the typegraph."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'from typegraph.graph.auth import oauth2\noauth2.github("openid profile email")\n'})}),"\n",(0,i.jsxs)(t.p,{children:["The whole list is available ",(0,i.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/blob/main/typegraph/python/typegraph/graph/auth/oauth2.py",children:"here"}),"."]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(98302),o=(n(30758),n(86070));function a(e){let{python:t,typescript:n,rust:a,...s}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,o.jsx)(i.A,{code:0==r.length?void 0:r,...s})}},3987:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:43}};t.loc.source={body:"query {\n get_context {\n username\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},36722:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"your_own_content"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:51}};t.loc.source={body:"query {\n get_context {\n your_own_content\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},64572:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exp"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:38}};t.loc.source={body:"query {\n get_context {\n exp\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},33175:e=>{e.exports={content:'@typegraph(\n)\ndef basic_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"username": t.string().optional()})\n\n # highlight-next-line\n g.auth(Auth.basic(["admin"]))\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/basic.py"}},26217:e=>{e.exports={content:'await typegraph(\n {\n name: "basic-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n username: t.string().optional(),\n });\n\n // highlight-next-line\n g.auth(Auth.basic(["admin"]));\n\n g.expose({\n get_context: deno\n .identity(ctx)\n .apply({\n username: g.fromContext("username"),\n })\n .withPolicy(pub),\n });\n }\n);',path:"../examples/typegraphs/basic.ts"}},8980:e=>{e.exports={content:'@typegraph(\n)\ndef jwt_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"your_own_content": t.string().optional()})\n # highlight-next-line\n g.auth(Auth.hmac256("custom"))\n\n g.expose(\n get_context=deno.identity(ctx).apply(\n {\n "your_own_content": g.from_context("your_own_content"),\n }\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/jwt.py"}},37538:e=>{e.exports={content:'typegraph(\n {\n name: "jwt-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n your_own_content: t.string().optional(),\n });\n // highlight-next-line\n g.auth(Auth.hmac256("custom"));\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n your_own_content: g.fromContext("your_own_content"),\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/jwt.ts"}},42422:e=>{e.exports={content:'@typegraph(\n)\ndef oauth2_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"exp": t.integer().optional()})\n\n # highlight-start\n g.auth(Auth.oauth2_github("openid profile email"))\n # highlight-end\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "exp": g.from_context("exp"),\n }\n ),\n )',path:"../examples/typegraphs/oauth2.py"}},23680:e=>{e.exports={content:'typegraph(\n {\n name: "oauth2-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({ exp: t.integer().optional() });\n\n // highlight-start\n g.auth(Auth.oauth2Github("openid profile email"));\n // highlight-end\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n exp: g.fromContext("exp"),\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/oauth2.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1201],{88079:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>y,contentTitle:()=>p,default:()=>f,frontMatter:()=>u,metadata:()=>x,toc:()=>m});var i=n(86070),o=n(25710),a=n(65671),s=n(30758),r=n(92076),c=n(30340),d=n(45656);function h(e){let{name:t,typegraph:n}=e;const{siteConfig:{customFields:{tgUrl:o}}}=(0,c.A)(),[a,d]=(0,s.useState)(null),h=(0,s.useCallback)((async()=>{try{const e=await fetch(`${o}/${n}/auth/take`,{credentials:"include"}),{token:t}=await e.json();d(t)}catch{d("not token found")}}),[d,o]),l=`${o}/${n}/auth/${t}?redirect_uri=${encodeURIComponent(window.location.href)}`;return(0,i.jsxs)("p",{className:"mb-6",children:["Start the flow via ",(0,i.jsx)(r.A,{href:l,children:l})," and take token by clicking"," ",(0,i.jsx)(r.A,{className:"cursor-pointer",onClick:h,children:"here"}),":",(0,i.jsx)("br",{}),(0,i.jsx)("input",{className:"py-1 border-0 bg-slate-200 w-full",value:a??""})]})}const l=e=>(0,i.jsx)(d.A,{children:()=>(0,i.jsx)(h,{...e})}),u={},p="Authentication",x={id:"reference/typegate/authentication/index",title:"Authentication",description:'Authentication enable the typegate to identify the user making the request and share some contextual data (called later "context" or "claims"). This data can then be used by policies or injected into various fields. Authenticated requests must use the Authorization header to provide a token in one of the following format.',source:"@site/docs/reference/typegate/authentication/index.mdx",sourceDirName:"reference/typegate/authentication",slug:"/reference/typegate/authentication/",permalink:"/docs/reference/typegate/authentication/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/authentication/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Typegate",permalink:"/docs/reference/typegate/"},next:{title:"CORS",permalink:"/docs/reference/typegate/cors/"}},y={},m=[{value:"Basic authentication",id:"basic-authentication",level:2},{value:"JWT authentication",id:"jwt-authentication",level:2},{value:"OAuth2 authorization",id:"oauth2-authorization",level:2},{value:"Take flow",id:"take-flow",level:3},{value:"OpenID Connect",id:"openid-connect",level:3},{value:"Embedded providers",id:"embedded-providers",level:3}];function g(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"authentication",children:"Authentication"}),"\n",(0,i.jsxs)(t.p,{children:['Authentication enable the typegate to identify the user making the request and share some contextual data (called later "context" or "claims"). This data can then be used by policies or injected into various fields. Authenticated requests must use the ',(0,i.jsx)(t.code,{children:"Authorization"})," header to provide a token in one of the following format."]}),"\n",(0,i.jsx)(t.h2,{id:"basic-authentication",children:"Basic authentication"}),"\n",(0,i.jsxs)(t.p,{children:["Basic authentication is the simplest way to authenticate requests. It is done by sending a base64 encoded string of your username and password in the authorization header. Recall that base64 encoding is not encryption and can be easily reversed, thus ",(0,i.jsx)(t.strong,{children:"the traffic must be encrypted with SSL/TLS"})," when using basic authentication as your password will otherwise be visible."]}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"BASIC_[username]=password"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Basic base64(username:password)"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ username }"})})]})]})]}),"\n",(0,i.jsx)(a.A,{typegraph:"basic-authentication",python:n(33175),typescript:n(26217),query:n(3987),headers:{Authorization:"Basic YWRtaW46cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,i.jsx)(t.h2,{id:"jwt-authentication",children:"JWT authentication"}),"\n",(0,i.jsx)(t.p,{children:"A more secure way to authenticate requests is to use JSON Web Tokens. The context of a user is signed with a secret key and the typegate will verify the signature to ensure the context has not been tampered with. The JWT is then sent in the authorization header."}),"\n",(0,i.jsxs)(t.p,{children:["The JWT is usually generated by an external identity provider (IdP) such as Keycloak or Auth0 and limited in time. The typegate will check that the ",(0,i.jsx)(t.code,{children:"exp"})," (expiration time) and ",(0,i.jsx)(t.code,{children:"nbf"})," (not before) are valid if they exist in the context. The logic of refreshing expired tokens is left to the user or the IdP client library being used."]}),"\n",(0,i.jsxs)(t.p,{children:['The typegate supports the most frequently used algorithms for signing the JWT and can be imported as using "jwk", "raw", "pkcs8" or "spki" formats (see SubtleCrypto ',(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey",children:"documentation"}),"). For instance, an asymmetric key pair can be generated with the following command:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typescript",children:'const keys = await crypto.subtle.generateKey(\n { name: "ECDSA", namedCurve: "P-384" },\n true,\n ["sign", "verify"],\n);\nconst publicKey = await crypto.subtle.exportKey("jwk", keys.publicKey);\n// save keys.privateKey for later use\nconsole.log(JSON.stringify(publicKey));\n// in typegraph: Auth.jwt("keycloak", "jwk", {"name": "ECDSA", "namedCurve": "P-384"})\n'})}),"\n",(0,i.jsx)(t.p,{children:"Even though, asymmetric encryption is recommended, HMAC-SHA256 is so commonly used that an alias is provided for it."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"[authentication]_JWT=secret"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Bearer token"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ your_own_content }"})})]})]})]}),"\n",(0,i.jsx)(a.A,{typegraph:"jwt-authentification",python:n(8980),typescript:n(37538),query:n(36722),headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ5b3VyX293bl9jb250ZW50IjoiY3VzdG9tLXJvbGUifQ.r7sR34FQSJbZTz8PNHbnQBXaRlK9Mo3BM5Rd9R8XuNQ"},tab:"headers"}),"\n",(0,i.jsx)(t.p,{children:"Note that for the sake of the demo, the token has no expiration time. Tokens should always be shorted lived and refreshed frequently to reduce the risk of unexpected access."}),"\n",(0,i.jsx)(t.h2,{id:"oauth2-authorization",children:"OAuth2 authorization"}),"\n",(0,i.jsx)(t.p,{children:"OAuth2 allows a user to grant limited access to their resources on one site, to another site, without having to expose their credentials. It is commonly used when the typegate needed to access restricted information in third-parties such as Google or GitHub."}),"\n",(0,i.jsx)(t.p,{children:"Most of the time, the OAuth2 is managed by your identity provider and relies on the JWT authentication as explained above. However the typegate provides a simple way to handle the OAuth2 flow without IdP or when the system should be lightweight."}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{children:"Components"}),(0,i.jsx)(t.th,{children:"Values"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Secrets"}),(0,i.jsxs)(t.td,{children:[(0,i.jsx)(t.code,{children:"[authentication]_CLIENT_ID=client_id"}),", ",(0,i.jsx)(t.code,{children:"[authentication]_CLIENT_SECRET=client_secret"})]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Header"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"Authorization: Bearer token"})})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{children:"Context"}),(0,i.jsx)(t.td,{children:(0,i.jsx)(t.code,{children:"{ content_from_your_idp }"})})]})]})]}),"\n",(0,i.jsx)(t.h3,{id:"take-flow",children:"Take flow"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Redirect the user to ",(0,i.jsx)(t.code,{children:"https://[typegate].metatype.cloud/[typegraph]/auth/[authentication]?redirect_uri=https://your-website.com/login"})," and the OAuth2 starts for the user"]}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["When the user has completed the flow, the typegate will redirect the user to ",(0,i.jsx)(t.code,{children:"https://your-website.com/login"}),' and you can "take" the token from the typegate as follows. This can be only done once and is limited in time:']}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-typescript",children:'const take = await fetch(\n "https://[typegate].metatype.cloud/[typegraph]/auth/take",\n {\n credentials: "include",\n },\n);\nconst { token } = await take.json();\n'})}),"\n",(0,i.jsxs)(t.ol,{start:"3",children:["\n",(0,i.jsxs)(t.li,{children:["The token can then be used as JWT in the ",(0,i.jsx)(t.code,{children:"Authorization"})," header of your requests, and the response of the typegate will contain a header ",(0,i.jsx)(t.code,{children:"Next-Authorization"}),". When this header is present, the value should be used in follow-up calls (value will be empty if the authentication has expired)."]}),"\n"]}),"\n",(0,i.jsx)(l,{name:"github",typegraph:"oauth2-authentication"}),"\n",(0,i.jsx)(a.A,{typegraph:"oauth2_authentication",python:n(42422),typescript:n(23680),query:n(64572),headers:{Authorization:"Bearer your-token"},tab:"headers"}),"\n",(0,i.jsx)(t.h3,{id:"openid-connect",children:"OpenID Connect"}),"\n",(0,i.jsxs)(t.p,{children:["OpenID Connect is an authentication layer on top of OAuth2. It is used to verify the identity of the user and retrieve basic information about them. You can add ",(0,i.jsx)(t.code,{children:"openid"})," to the OAuth2 scope and you will receive an ",(0,i.jsx)(t.code,{children:"id_token"})," in the response. The ",(0,i.jsx)(t.code,{children:"id_token"})," is a JWT that contains the user's information and is signed by the IdP."]}),"\n",(0,i.jsx)(t.h3,{id:"embedded-providers",children:"Embedded providers"}),"\n",(0,i.jsx)(t.p,{children:"Frequent OAuth2 providers are embedded and can be directly used in the typegraph."}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{children:'from typegraph.graph.auth import oauth2\noauth2.github("openid profile email")\n'})}),"\n",(0,i.jsxs)(t.p,{children:["The whole list is available ",(0,i.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/blob/main/typegraph/python/typegraph/graph/auth/oauth2.py",children:"here"}),"."]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(g,{...e})}):g(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(98302),o=(n(30758),n(86070));function a(e){let{python:t,typescript:n,rust:a,...s}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,o.jsx)(i.A,{code:0==r.length?void 0:r,...s})}},3987:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:43}};t.loc.source={body:"query {\n get_context {\n username\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},36722:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"your_own_content"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:51}};t.loc.source={body:"query {\n get_context {\n your_own_content\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},64572:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"exp"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:38}};t.loc.source={body:"query {\n get_context {\n exp\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},33175:e=>{e.exports={content:'@typegraph(\n)\ndef basic_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"username": t.string().optional()})\n\n # highlight-next-line\n g.auth(Auth.basic(["admin"]))\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/basic.py"}},26217:e=>{e.exports={content:'await typegraph(\n {\n name: "basic-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n username: t.string().optional(),\n });\n\n // highlight-next-line\n g.auth(Auth.basic(["admin"]));\n\n g.expose({\n get_context: deno\n .identity(ctx)\n .apply({\n username: g.fromContext("username"),\n })\n .withPolicy(pub),\n });\n },\n);',path:"../examples/typegraphs/basic.ts"}},8980:e=>{e.exports={content:'@typegraph(\n)\ndef jwt_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"your_own_content": t.string().optional()})\n # highlight-next-line\n g.auth(Auth.hmac256("custom"))\n\n g.expose(\n get_context=deno.identity(ctx).apply(\n {\n "your_own_content": g.from_context("your_own_content"),\n }\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/jwt.py"}},37538:e=>{e.exports={content:'typegraph(\n {\n name: "jwt-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n your_own_content: t.string().optional(),\n });\n // highlight-next-line\n g.auth(Auth.hmac256("custom"));\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n your_own_content: g.fromContext("your_own_content"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/jwt.ts"}},42422:e=>{e.exports={content:'@typegraph(\n)\ndef oauth2_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"exp": t.integer().optional()})\n\n # highlight-start\n g.auth(Auth.oauth2_github("openid profile email"))\n # highlight-end\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "exp": g.from_context("exp"),\n }\n ),\n )',path:"../examples/typegraphs/oauth2.py"}},23680:e=>{e.exports={content:'typegraph(\n {\n name: "oauth2-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({ exp: t.integer().optional() });\n\n // highlight-start\n g.auth(Auth.oauth2Github("openid profile email"));\n // highlight-end\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n exp: g.fromContext("exp"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/oauth2.ts"}}}]); \ No newline at end of file diff --git a/assets/js/18b50fbb.8d37b7fe.js b/assets/js/18b50fbb.4be20b91.js similarity index 97% rename from assets/js/18b50fbb.8d37b7fe.js rename to assets/js/18b50fbb.4be20b91.js index e9679c2284..65c41aff47 100644 --- a/assets/js/18b50fbb.8d37b7fe.js +++ b/assets/js/18b50fbb.4be20b91.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7401],{9677:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>l,RM:()=>o});var i=t(86070),s=t(25710),r=t(65671);t(7871);const o=[];function a(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"S3Runtime"})," can be used to interact with object storage APIs that are S3 compatible. Object storages like S3 are commonly used to cover app needs around large blob data like uploading and serving images. Most object storage services provide S3 compatible APIs including the open-source ",(0,i.jsx)(n.a,{href:"https://min.io/",children:"MinIO"})," engine which you can run locally for development."]}),"\n",(0,i.jsx)(n.p,{children:"For the following example, you'll need to setup your S3 compatible store first. The following snippet can get you started using minio on docker compose:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'services:\n minio:\n image: bitnami/minio:2022\n platform: linux/amd64\n restart: always\n ports:\n - "9000:9000"\n - "9001:9001"\n environment:\n MINIO_REGION_NAME: local\n MINIO_ROOT_USER: minio\n MINIO_ROOT_PASSWORD: password\n MINIO_DEFAULT_BUCKETS: "bucket:none"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We then provide the following secrets to our typegraph through ",(0,i.jsx)(n.code,{children:"metatype.yml"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yml",children:'typegates:\n dev:\n secrets:\n # ..\n # replace "files-upload" by the name of your typegraph\n files-upload:\n S3_HOST: http://localhost:9000\n S3_REGION: local\n S3_ACCESS_KEY: minio\n S3_SECRET_KEY: password\n S3_PATH_STYLE: true\n'})}),"\n",(0,i.jsx)(n.p,{children:"Our typegraph will then look something like:"}),"\n",(0,i.jsx)(r.A,{typegraph:"files-upload",typescript:t(96144),python:t(2950),query:t(52852)}),"\n",(0,i.jsxs)(n.p,{children:["Peruse the ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"reference"})," on the ",(0,i.jsx)(n.code,{children:"S3Runtime"})," for more information."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},42684:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var i=t(86070),s=t(25710),r=t(9677);const o={},a="S3",l={id:"reference/runtimes/s3/index",title:"S3",description:"S3 runtime",source:"@site/docs/reference/runtimes/s3/index.mdx",sourceDirName:"reference/runtimes/s3",slug:"/reference/runtimes/s3/",permalink:"/docs/reference/runtimes/s3/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/s3/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Random",permalink:"/docs/reference/runtimes/random/"},next:{title:"Substantial",permalink:"/docs/reference/runtimes/substantial/"}},c={},p=[{value:"S3 runtime",id:"s3-runtime",level:2},...r.RM];function d(e){const n={h1:"h1",h2:"h2",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"s3",children:"S3"}),"\n",(0,i.jsx)(n.h2,{id:"s3-runtime",children:"S3 runtime"}),"\n",(0,i.jsx)(r.Ay,{})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(98302),s=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...o}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==a.length?void 0:a,...o})}},52852:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listObjects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"keys"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"size"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"{\n listObjects {\n keys {\n key\n size\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},2950:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.aws import S3Runtime\n\n# skip-next-line\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n name="files-upload",\n # skip-next-line\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef files_upload(g: Graph):\n s3 = S3Runtime(\n # we provide the name of the env vars\n # the typegate will read from\n "S3_HOST",\n "S3_REGION",\n "S3_ACCESS_KEY",\n "S3_SECRET_KEY",\n path_style_secret="S3_PATH_STYLE",\n )\n\n g.expose(\n Policy.public(),\n # we can then generate helpers for interacting with our runtime\n listObjects=s3.list("examples"),\n getDownloadUrl=s3.presign_get("examples"),\n signUploadUrl=s3.presign_put("examples"),\n upload=s3.upload("examples", t.file(allow=["image/png", "image/jpeg"])),\n uploadMany=s3.upload_all("examples"),\n )',path:"../examples/typegraphs/files-upload.py"}},96144:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { S3Runtime } from "@typegraph/sdk/providers/aws.ts";\n\nawait typegraph(\n {\n name: "files-upload",\n },\n (g) => {\n const s3 = new S3Runtime({\n hostSecret: "S3_HOST",\n regionSecret: "S3_REGION",\n accessKeySecret: "S3_ACCESS_KEY",\n secretKeySecret: "S3_SECRET_KEY",\n pathStyleSecret: "S3_PATH_STYLE",\n });\n\n g.expose(\n {\n listObjects: s3.list("examples"),\n getDownloadUrl: s3.presignGet({ bucket: "examples" }),\n signUploadUrl: s3.presignPut({ bucket: "examples" }),\n upload: s3.upload(\n "examples",\n t.file({ allow: ["image/png", "image/jpeg"] })\n ),\n uploadMany: s3.uploadAll("examples"),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/files-upload.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7401],{9677:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>l,RM:()=>o});var i=t(86070),s=t(25710),r=t(65671);t(7871);const o=[];function a(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"S3Runtime"})," can be used to interact with object storage APIs that are S3 compatible. Object storages like S3 are commonly used to cover app needs around large blob data like uploading and serving images. Most object storage services provide S3 compatible APIs including the open-source ",(0,i.jsx)(n.a,{href:"https://min.io/",children:"MinIO"})," engine which you can run locally for development."]}),"\n",(0,i.jsx)(n.p,{children:"For the following example, you'll need to setup your S3 compatible store first. The following snippet can get you started using minio on docker compose:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'services:\n minio:\n image: bitnami/minio:2022\n platform: linux/amd64\n restart: always\n ports:\n - "9000:9000"\n - "9001:9001"\n environment:\n MINIO_REGION_NAME: local\n MINIO_ROOT_USER: minio\n MINIO_ROOT_PASSWORD: password\n MINIO_DEFAULT_BUCKETS: "bucket:none"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We then provide the following secrets to our typegraph through ",(0,i.jsx)(n.code,{children:"metatype.yml"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yml",children:'typegates:\n dev:\n secrets:\n # ..\n # replace "files-upload" by the name of your typegraph\n files-upload:\n S3_HOST: http://localhost:9000\n S3_REGION: local\n S3_ACCESS_KEY: minio\n S3_SECRET_KEY: password\n S3_PATH_STYLE: true\n'})}),"\n",(0,i.jsx)(n.p,{children:"Our typegraph will then look something like:"}),"\n",(0,i.jsx)(r.A,{typegraph:"files-upload",typescript:t(96144),python:t(2950),query:t(52852)}),"\n",(0,i.jsxs)(n.p,{children:["Peruse the ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"reference"})," on the ",(0,i.jsx)(n.code,{children:"S3Runtime"})," for more information."]})]})}function l(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},42684:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>a,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>p});var i=t(86070),s=t(25710),r=t(9677);const o={},a="S3",l={id:"reference/runtimes/s3/index",title:"S3",description:"S3 runtime",source:"@site/docs/reference/runtimes/s3/index.mdx",sourceDirName:"reference/runtimes/s3",slug:"/reference/runtimes/s3/",permalink:"/docs/reference/runtimes/s3/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/s3/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Random",permalink:"/docs/reference/runtimes/random/"},next:{title:"Substantial",permalink:"/docs/reference/runtimes/substantial/"}},c={},p=[{value:"S3 runtime",id:"s3-runtime",level:2},...r.RM];function d(e){const n={h1:"h1",h2:"h2",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"s3",children:"S3"}),"\n",(0,i.jsx)(n.h2,{id:"s3-runtime",children:"S3 runtime"}),"\n",(0,i.jsx)(r.Ay,{})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(98302),s=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...o}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==a.length?void 0:a,...o})}},52852:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listObjects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"keys"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"size"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"{\n listObjects {\n keys {\n key\n size\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},2950:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.aws import S3Runtime\n\n# skip-next-line\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n name="files-upload",\n # skip-next-line\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef files_upload(g: Graph):\n s3 = S3Runtime(\n # we provide the name of the env vars\n # the typegate will read from\n "S3_HOST",\n "S3_REGION",\n "S3_ACCESS_KEY",\n "S3_SECRET_KEY",\n path_style_secret="S3_PATH_STYLE",\n )\n\n g.expose(\n Policy.public(),\n # we can then generate helpers for interacting with our runtime\n listObjects=s3.list("examples"),\n getDownloadUrl=s3.presign_get("examples"),\n signUploadUrl=s3.presign_put("examples"),\n upload=s3.upload("examples", t.file(allow=["image/png", "image/jpeg"])),\n uploadMany=s3.upload_all("examples"),\n )',path:"../examples/typegraphs/files-upload.py"}},96144:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { S3Runtime } from "@typegraph/sdk/providers/aws.ts";\n\nawait typegraph(\n {\n name: "files-upload",\n },\n (g) => {\n const s3 = new S3Runtime({\n hostSecret: "S3_HOST",\n regionSecret: "S3_REGION",\n accessKeySecret: "S3_ACCESS_KEY",\n secretKeySecret: "S3_SECRET_KEY",\n pathStyleSecret: "S3_PATH_STYLE",\n });\n\n g.expose(\n {\n listObjects: s3.list("examples"),\n getDownloadUrl: s3.presignGet({ bucket: "examples" }),\n signUploadUrl: s3.presignPut({ bucket: "examples" }),\n upload: s3.upload(\n "examples",\n t.file({ allow: ["image/png", "image/jpeg"] }),\n ),\n uploadMany: s3.uploadAll("examples"),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/files-upload.ts"}}}]); \ No newline at end of file diff --git a/assets/js/1df93b7f.397fa36d.js b/assets/js/1df93b7f.81af1794.js similarity index 94% rename from assets/js/1df93b7f.397fa36d.js rename to assets/js/1df93b7f.81af1794.js index 20f7de701a..586bf94169 100644 --- a/assets/js/1df93b7f.397fa36d.js +++ b/assets/js/1df93b7f.81af1794.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4583],{13201:(e,a,t)=>{"use strict";t.d(a,{A:()=>I});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B=t(30758);function W(){return W=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...I}=e;return B.createElement("svg",W({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 720 504","aria-labelledby":t},I),a?B.createElement("title",{id:t},a):null,l||(l=B.createElement("defs",null,B.createElement("linearGradient",{id:"linear-gradient",x1:553.61,x2:614.75,y1:64.53,y2:214.07,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:.05,stopColor:"#fbd15b"}),B.createElement("stop",{offset:1,stopColor:"#f9a45a"})),B.createElement("linearGradient",{id:"linear-gradient-2",x1:602.04,x2:655.31,y1:218.4,y2:414.44,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#ff9d5d"}),B.createElement("stop",{offset:.08,stopColor:"#ff985d"}),B.createElement("stop",{offset:.18,stopColor:"#ff8a5c"}),B.createElement("stop",{offset:.28,stopColor:"#ff725b"}),B.createElement("stop",{offset:.28,stopColor:"#ff725b"}),B.createElement("stop",{offset:.37,stopColor:"#ff825b"}),B.createElement("stop",{offset:.49,stopColor:"#ff8f5c"}),B.createElement("stop",{offset:.64,stopColor:"#ff965c"}),B.createElement("stop",{offset:1,stopColor:"#ff985c"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:66.88,x2:128.02,y1:64.53,y2:214.07}),B.createElement("linearGradient",{id:"linear-gradient-4",x1:454.49,x2:368.74,y1:501.92,y2:385.42,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#1252c4"}),B.createElement("stop",{offset:1,stopColor:"#3f87fe"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-5",x1:734.06,x2:767.6,y1:484.44,y2:329.47,gradientTransform:"matrix(-1 0 0 1 856.88 0)"}),B.createElement("linearGradient",{id:"linear-gradient-6",x1:658.13,x2:795.23,y1:464.45,y2:464.45,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#ff9d5c"}),B.createElement("stop",{offset:1,stopColor:"#ffc961"})),B.createElement("linearGradient",{id:"linear-gradient-7",x1:-205.8,x2:-198.21,y1:471.79,y2:444.79,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#f8a034"}),B.createElement("stop",{offset:1,stopColor:"#ffc546"})),B.createElement("linearGradient",{id:"linear-gradient-8",x1:-207.32,x2:-216.74,y1:472.78,y2:453.26,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#fcb72c"}),B.createElement("stop",{offset:1,stopColor:"#ffcf44"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-9",x1:-195.32,x2:-191.96,y1:474.01,y2:461.47}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-10",x1:-384.69,x2:-378.62,y1:467.88,y2:446.25,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-11",x1:-385.91,x2:-393.46,y1:468.67,y2:453.03,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-12",x1:-376.3,x2:-373.61,y1:469.66,y2:459.61,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-13",x1:285.38,x2:205.29,y1:277.13,y2:163.87}),B.createElement("style",null,".cls-3{fill:#f55662}.cls-44{opacity:.3;mix-blend-mode:multiply}.cls-6{fill:#fe845a}.cls-27,.cls-7,.cls-9{fill:none;stroke:#231f20;stroke-linecap:round;stroke-miterlimit:10}.cls-7{stroke-width:1.23px}.cls-9{stroke-width:1.17px}.cls-12{fill:#403881}.cls-13{fill:#fca080}.cls-14{fill:#e0e6ee}.cls-15{fill:#232059}.cls-16{fill:#201851}.cls-19{fill:#094081}.cls-21{fill:#f59d80}.cls-22{fill:#d07a62}.cls-27{stroke-width:1.1px}.cls-32{fill:#231f20}.cls-38{fill:#fda181}.cls-39{fill:#e1e7ef}.cls-40{fill:#403882}.cls-41{fill:#1150be}.cls-42{fill:#094082}"))),B.createElement("g",{style:{isolation:"isolate"}},B.createElement("g",{id:"Layer_2","data-name":"Layer 2"},B.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},B.createElement("path",{d:"M0 0h720v504H0z",style:{fill:"#fff"}}),B.createElement("g",{id:"chair"},r||(r=B.createElement("path",{d:"m287.77 469.08-35.26-99.86h9.71c2.3 0 4.18-1.17 4.18-2.61v-3.37c0-1.44-1.88-2.61-4.18-2.61h-123.1c-2.3 0-4.18 1.17-4.18 2.61v3.37c0 1.44 1.88 2.61 4.18 2.61h12.5l-35.26 99.86c-.47 1.34.9 2.68 3 3s4.29-.56 4.76-1.9l35.68-100.96h84.53L280 470.16c.47 1.34 2.61 2.2 4.76 1.9 2.11-.3 3.48-1.64 3.01-2.98",className:"cls-3"})),B.createElement("g",{style:{opacity:.3,mixBlendMode:"multiply"}},c||(c=B.createElement("path",{d:"M252.51 369.22h-8.18l9.68 27.41 8.25.19zM151.62 369.22l-8.79 24.89 8.12.19 8.85-25.08z"})))),B.createElement("g",{id:"trees"},B.createElement("ellipse",{cx:592.6,cy:159.9,rx:42.48,ry:88.52,style:{fill:"url(#linear-gradient)"}}),s||(s=B.createElement("path",{d:"M615.52 85.35c6.66 15.64 10.71 36.22 10.71 58.77 0 48.89-19 88.52-42.48 88.52-8.44 0-16.3-5.12-22.91-14 7.78 18.25 19.12 29.75 31.76 29.75 23.46 0 42.48-39.63 42.48-88.52 0-31.27-7.8-58.78-19.56-74.52",className:"cls-6"})),n||(n=B.createElement("g",{id:"TREE"},B.createElement("path",{d:"M593.18 106.98v361.24M593.18 146.98l16.56-20.21M593.18 188.53l16.56-20.2M593.18 170.36l-16.55-20.2M593.18 207.44l-16.55-20.21M593.18 231.64l16.56-20.21",className:"cls-7"}))),B.createElement("path",{id:"tree-2",d:"M669.76 324.27c-8-13.73 8.22-27.21 2.71-41-2.84-7.11-11.19-10.29-15.68-16.48-3.6-4.95-4.4-11.34-4.9-17.44s-.87-12.45-3.84-17.8a16 16 0 0 0-3.06-3.93c-3.31-3.14-7.9-4.9-12.13-3.46-5.38 1.84-8.05 7.76-9.74 13.18a125 125 0 0 0-4.23 18.31c-.91 5.91-1.55 12.27-5.37 16.86-4.19 5.05-11.27 6.78-15.94 11.39a17.39 17.39 0 0 0-4.84 15c.8 4.75 3.54 8.92 5.5 13.32s3.08 9.73.68 13.91c-2.11 3.68-6.38 5.5-9.34 8.55-3.78 3.89-5.19 9.69-4.51 15.08s3.24 10.38 6.47 14.74a51.05 51.05 0 0 0 16.36 14.22c9.53 5.2 21.33 7.81 27.46 16.78 4.78-10.34 22-17.52 28.7-23.23 7-6 13.47-14.09 14.82-23.52 1.51-10.55-4.26-16.19-9.12-24.48","data-name":"tree",style:{fill:"url(#linear-gradient-2)"}}),i||(i=B.createElement("path",{d:"M636.11 309.59v157.59M636.11 360.87l22.7-22.7M636.11 332.38l-19.51-19.51",className:"cls-9"})),B.createElement("ellipse",{cx:105.87,cy:159.9,rx:42.48,ry:88.52,style:{fill:"url(#linear-gradient-3)"}}),m||(m=B.createElement("path",{d:"M128.78 85.35c6.67 15.64 10.72 36.22 10.72 58.77 0 48.89-19 88.52-42.48 88.52-8.44 0-16.3-5.12-22.91-14 7.78 18.25 19.12 29.75 31.76 29.75 23.46 0 42.48-39.63 42.48-88.52 0-31.27-7.8-58.78-19.57-74.52",className:"cls-6"})),d||(d=B.createElement("g",{id:"TREE-3","data-name":"TREE"},B.createElement("path",{d:"M106.45 106.98v361.24M106.45 146.98l16.56-20.21M106.45 188.53l16.56-20.2M106.45 170.36l-16.56-20.2M106.45 207.44l-16.56-20.21M106.45 231.64l16.56-20.21",className:"cls-7"})))),B.createElement("g",{id:"man"},B.createElement("ellipse",{cx:556.31,cy:471.57,rx:64.23,ry:3.35,style:{fill:"#c7ccd1"}}),o||(o=B.createElement("g",{id:"legs"},B.createElement("path",{d:"M525.91 455.54c0-.87-4.18-1.24-4.18-1.24S504.63 460 501 462c-2.41 1.32-3.2 5-3.46 7.28a1.74 1.74 0 0 0 1.7 1.92c7.93.12 39 .56 39.33 0s-.55-14.43-.55-14.43-12.11-.35-12.11-1.23",className:"cls-12"}),B.createElement("path",{d:"m522.06 446.81-.33 7.49s4.18.37 4.18 1.24 12.15 1.18 12.15 1.18l.55-8Z",className:"cls-13"}),B.createElement("path",{d:"M497.58 469.26a1.74 1.74 0 0 0 1.7 1.92c7.93.12 39 .56 39.33 0a14.6 14.6 0 0 0 0-2.69l-31.6.2-.38-9A58 58 0 0 0 501 462c-2.37 1.3-3.16 5-3.42 7.26",className:"cls-14"}),B.createElement("path",{d:"M612.13 444.69s-9 3.49-9.45 3.14-2.58.8-2.58.8-.31 4.56-1 5.67-5.87 6.67-10.62 8.57c-3.36 1.35-4.4 5.07-4.71 7.14a1.26 1.26 0 0 0 1.25 1.44h12.86c2.43 0 22.35-13.61 22.65-15.33s-8.4-11.43-8.4-11.43",className:"cls-12"}),B.createElement("path",{d:"M602.68 447.83c.45.35 9.45-3.14 9.45-3.14l-2.93-7.18-12.73 5.68 3.63 5.44s2.12-1.16 2.58-.8",className:"cls-13"}),B.createElement("path",{d:"M583.76 470a1.26 1.26 0 0 0 1.25 1.44h12.86c2.43 0 22.35-13.61 22.65-15.33a3 3 0 0 0-.59-1.58c-4.34 3.56-20.18 13.6-21 14s-4.52 0-4.52 0c.14-4.18-3.46-7-3.46-7a15.2 15.2 0 0 1-2.47 1.27c-3.37 1.42-4.41 5.14-4.72 7.2",className:"cls-14"}),B.createElement("path",{d:"M561.52 284.21s5.71 13.85 2.27 28.82c0 0 13.35 51.27 15.17 53.69s9.31 10.42 11.23 16.69 19 54.1 19 54.1l-13 6.78s-31.68-54.29-34.67-59.36-17.14-30.14-17.14-30.14-2.73 16.28-2.43 17.5-1.16 5 0 6.17 2 10 1.54 19-4.86 51.27-4.86 51.27-14.46 1.72-17.49-1c0 0-5.6-70.34-6-75.06s0-10.12-.14-12.14-5.59-69.64-5.59-69.64Z",className:"cls-12"}),B.createElement("path",{d:"M534 294c.08-2.21.12-4.3.12-6.29l-24.7 3.16s5.46 67.62 5.59 69.64-.26 7.42.14 12.14 6 75.06 6 75.06c-2.43-34.88 8.7-55.31 10.72-67.85s12.54-25.08 12.54-25.08-18.61-35.93-21.31-44.56S534 294 534 294",className:"cls-15"}))),B.createElement("g",{id:"body"},h||(h=B.createElement("path",{d:"m467.39 141-106.53-16.93a8.31 8.31 0 0 0-9.51 6.9l-4.71 29.69a35 35 0 0 0 .13 5.24l3.84.58c.21 0 .44.08.66.1a5.2 5.2 0 0 0 2.15-.3 22 22 0 1 1-7.86 36.4 3.45 3.45 0 0 0-2.08-1l-4-.61-5 36.22a8.2 8.2 0 0 0 6.81 9.38l30.43 4.83a3.83 3.83 0 0 1 2.52 6A22 22 0 0 0 394 292.2c7.43-.53 15.83-6.77 18.52-13.72a22.18 22.18 0 0 0 .5-15 3.71 3.71 0 0 1 4.12-4.8l30.62 4.86a8.18 8.18 0 0 0 9.37-6.8L474 150.15a8 8 0 0 0-6.61-9.15",className:"cls-16"})),p||(p=B.createElement("path",{d:"M408.54 277.89a22.18 22.18 0 0 0 .5-14.95 3.71 3.71 0 0 1 4.12-4.8l30.63 4.86a8.19 8.19 0 0 0 9.37-6.8l16.93-106.65a8 8 0 0 0-6.64-9.15l-106.53-16.92a8.31 8.31 0 0 0-9.51 6.9l-4.71 29.69a5.12 5.12 0 0 0 6.78 5.62 21.95 21.95 0 1 1-7.86 36.39 3.51 3.51 0 0 0-5.91 2l-5.19 32.68a8.19 8.19 0 0 0 6.81 9.37l30.43 4.83a3.84 3.84 0 0 1 2.52 6A22 22 0 0 0 390 291.61c7.45-.54 15.85-6.77 18.54-13.72",className:"cls-3"})),B.createElement("path",{d:"M439 236.83c3.8 2 14.91 4 20.48 4.86l1.36-8.54-30.54-7s3.55 7.95 8.7 10.68",style:{mixBlendMode:"multiply",opacity:.5}}),B.createElement("path",{d:"M560 258.12c.61-7.69 2.23-46.18 1.28-52.38s-12.3-13.4-12.3-13.4-18.44 4.45-25.48 8.2c0 0-23 6.68-27.61 6.41-3.42-.2-21.11-4.12-29.86-6.1l-2.46 15.49c9.45 3 28 8.58 34.61 8.68 1.63 0 3.93-.13 6.59-.38l-3.76 2a100.9 100.9 0 0 0-23.59 0 101.6 101.6 0 0 1-15.58.57 40 40 0 0 1-5.59-.57l-1.89 11.06 5.68.89c11.33 1.74 36.34 5.38 44.07 4.94a38.4 38.4 0 0 0 5.9-1c.11 7.48.65 14.19.44 16.78-.4 5-1 31.56-1 31.56s6.07 3.44 17.8 3.82 34.33-10.49 34.33-10.49-2.24-18.4-1.58-26.08",style:{fill:"#1150bf"}}),f||(f=B.createElement("path",{d:"m512 221 17.8-9.1s-5.8-3.78-4.66-6.81 6.78-5.51 6.78-5.51l2.95-3.41a73.3 73.3 0 0 0-11.44 4.33C521 202.7 514 214 512 221M527.93 280.37c2.56-1-4.59-2.23-9.55-3.24s-4.88-18.67-3.53-23.26 31-22.35 31-22.35c-2 .91-35.93 11-35.93 11 .11 7.48.65 14.19.44 16.78-.4 5-1 31.56-1 31.56s6.07 3.44 17.8 3.82A31.6 31.6 0 0 0 534 294c-7.08 0-8.63-12.62-6.07-13.63",className:"cls-19"})),B.createElement("path",{d:"M514.72 203c-7.86 3.62-18.59 8.38-24.34 7.73-7.33-.82-18.6-3.61-25.12-5.32l-1.74 11c9.45 3 28 8.58 34.61 8.68 1.63 0 3.93-.13 6.59-.38L512 221s5.26-14 11.43-20.5c.01.04-3.84 1.16-8.71 2.5",style:{fill:"#073868"}}),E||(E=B.createElement("path",{d:"M456.2 226.68a20 20 0 0 1-2.41-.32c-.72-.2-3.06-3.33-4.3-4s-5.21-2.09-6.06-2.61-.45 1.44 0 2.15a16.6 16.6 0 0 0 2 2.09l-5.93-1.24s-4.11-3.52-5.8-3.91-1.69.91-1.69.91-1.5-1-2.15-.45.91 1.89.91 1.89-1-.66-1.45 0 2.05 3.75 2.05 3.75-1.95-.12-.73 1.77a48 48 0 0 0 4.49 5.56 29.3 29.3 0 0 0 7.62 4c2.3.64 11.6 1.4 11.6 1.4Z",className:"cls-21"}))),B.createElement("g",{id:"head"},g||(g=B.createElement("path",{d:"M525.06 160.38s-3.64 27.1 0 28.37 8.09 0 8.09 0-1.26 10-1.21 10.87 16.13-3.9 17-7.28l-1.57-18.56s5.46-9 .71-12.08-16.9-8.04-23.02-1.32",className:"cls-21"})),x||(x=B.createElement("path",{d:"m533.15 188.75 5.57-2.33-5.94 5.35zM542.81 175.35a3.14 3.14 0 0 0 4.55-1.57s-.28 6.6-4.55 1.57M528.83 162.88c1.67-2.07 3-1.78 3.19-.76s.93 1.88 3.28 1.22a5.18 5.18 0 0 1 4.36 1.07 13.6 13.6 0 0 0 2.1-5.78c-5.53-2-12.52-2.84-16.7 1.75 0 0-.21 1.57-.47 4a4.76 4.76 0 0 0 4.24-1.5",className:"cls-22"})),y||(y=B.createElement("path",{d:"M556.55 163.57c-.34-2.56-2-2.53-2-2.53s2.39-6.27-.77-8a22.1 22.1 0 0 0-7.89-1.88s-9.51-4.92-11.6-3.78c0 0-4-4-8.36-2.56s-10.4 4.3-6.13 14.22 9.17-.13 11.66 1.76.61 2.76 3.78 2.22 4.38 1.35 4.38 1.35-1.59 8 .77 7.62 4.12-4.86 6.54-5.09.39 6.84.39 6.84-1.9 4.08-1.33 4.85a3.64 3.64 0 0 0 1.83 1.08l6.18-11.42s2.88-2.12 2.55-4.68",className:"cls-12"})),B.createElement("path",{d:"M540.43 172c2.36-.41 4.12-4.86 6.54-5.09s.39 6.84.39 6.84-1.9 4.08-1.33 4.85a3.64 3.64 0 0 0 1.83 1.08l6.14-11.43s2.93-2.12 2.6-4.68-2-2.53-2-2.53 2.5.54.68 3.37-6.07 0-6.07 0a1.46 1.46 0 0 1-2 0s-4.45 3-7.58 0c.03 0-1.56 8.02.8 7.59",style:{fill:"#1e194f"}}))),B.createElement("g",{id:"puzzle_3","data-name":"puzzle 3"},u||(u=B.createElement("path",{d:"M446.85 348h-30.07a5.12 5.12 0 0 0-4.48 7.58c1.82 3.29-4.58 31.78-18 32.52a22 22 0 0 1-19.14-34.57 3.5 3.5 0 0 0-2.85-5.53h-33.1a8.19 8.19 0 0 0-8.18 8.19s-3 35.52-5.55 34.25a21.8 21.8 0 0 0-8.66-2.28h-1.11l-5.83-.09L309 432h4.73c4.5-.13 8.4-.55 11.87-2.32A3.72 3.72 0 0 1 331 433v31a8.18 8.18 0 0 0 8.18 8.18h108a8 8 0 0 0 8-8V356.35a8.3 8.3 0 0 0-8.33-8.35",className:"cls-16"})),B.createElement("path",{d:"M304.93 431.46a22.14 22.14 0 0 0 14.84-1.85 3.71 3.71 0 0 1 5.39 3.32v31a8.19 8.19 0 0 0 8.19 8.19h108a8 8 0 0 0 8-8V356.25A8.31 8.31 0 0 0 441 348h-30a5.11 5.11 0 0 0-4.48 7.58 22 22 0 1 1-37.18-2 3.5 3.5 0 0 0-2.86-5.53h-33.13a8.19 8.19 0 0 0-8.19 8.19V387a3.83 3.83 0 0 1-5.55 3.43 22 22 0 0 0-31.13 24.94c1.69 7.21 9.16 14.52 16.45 16.09",style:{fill:"url(#linear-gradient-4)"}})),B.createElement("g",{id:"plants"},B.createElement("path",{d:"M246.45 440.58c1.4-1.61 7.86-4.08 10.58-8.06s12.14-17.86 19.33-15.15-6.22 12.43-10.2 17.29-4.31 18.94-14.83 18.94-7.99-9.42-4.88-13.02",style:{fill:"#3d86fa"}}),B.createElement("path",{d:"M245.83 404.36s5 .15 4.57 7.24-2.38 12.38-2 16.16 3.84 18.31-2.57 19.28-13.79-1.21-10.58-11.65.29-33.07 10.58-31.03",style:{fill:"#1351be"}}),M||(M=B.createElement("path",{d:"M244.28 412.81s-4.66 42.86-4.66 57.55M241 470.36s2.7-26.35 32-49.13",className:"cls-27"})),B.createElement("g",{id:"plant"},_||(_=B.createElement("path",{d:"M55.54 376c1.49 37.9 25.34 98.74 48.35 91.62 6.06-1.88-1.73-30.12-24-55C63.8 394.69 59.58 381.54 55.54 376",className:"cls-6"})),v||(v=B.createElement("path",{d:"M123.49 462.91c-.14 2.39 33 5.43 48.3-19.57 12-19.47 19.38-21.22 25.78-24.67-43.57-.79-73.71 37.99-74.08 44.24",className:"cls-16"})),B.createElement("path",{d:"M135.33 411.47c-.21-2 1.86-16.68-.35-28.17-4.53 4.44-21.35 61.7-20.82 71 .2 3.43-1.81 12.86 5.37 14.56 7.57 1.8 21.55-16.49 26.5-29.1 16.38-41.7 4.6-39.94 18.25-63.66-5.43 3.9-26.09 27.9-28.95 35.37",style:{fill:"#413b8a"}}),N||(N=B.createElement("path",{d:"M144.08 395.33c-2.75 4-4 8.71-6.7 12.61-2.17 3.15-1.95 7.1-3.49 10.13-1.66 3.25-4.56 4.92-4.73 9.49-.08 2.13.46 3.9.27 5.83-.24 2.4-1.25 4.62-1.28 7.19 0 1.79.53 3.5.58 5.21.13 4.8-7.48 12.66-1.38 17-.33 4.05.41 5.49 2.5 5.55 4.46.13 4.29-4.42 5.17-6.92 1-2.89 4.28-4.77 4.59-8.74.16-2-1-4.45-.8-6.31.17-1.4 1.46-2.17 2.2-3.35 1.91-3 2-6.53 1.79-10-.12-2-1.72-5.26-1.47-7.09.48-3.51 4-4.4 3-9.46-.33-1.53-1.64-3.38-1.6-4.95s1.07-2.63 1.6-4.06c1.44-3.93-.2-8.06-.25-12.13",className:"cls-6"})),B.createElement("path",{d:"M127.11 453.37c-4.27-.17-9.66 3.86-12.5 8.31.06-2.79.2-5.59.39-8.4 3-2.77 8.2-2 11.21-5.55 3.18-3.76 0-8-4.5-5.73-2.19 1.1-4.74 4.77-6.44 7.8.16-2 .37-4.77.54-6.76.14-1.74.25-3.47.35-5.19 3.46-2.16 10.87-2 11.65-7.72.55-4-3.43-6.79-6.64-3.52a29.3 29.3 0 0 0-4.85 7.23c.1-3.22.09-6.43 0-9.62 3.8-3 12.48-2.12 14.17-7.73 1.38-4.58-4.45-5.64-7.77-3.38s-4.92 6.22-6.46 9.89c-.13-2.38-.33-4.75-.61-7.13 2.86-2.91 8.83-4.88 10-9.62s-2.56-9.69-7-5c-2.32 2.48-3.25 6.33-3.69 10-.43-2.61-1-5.21-1.58-7.78a32.6 32.6 0 0 1 2.81-5.06c1.42-2 3.51-4 3.28-6.61-.41-4.49-3.86-2.2-5.42.74a17.3 17.3 0 0 0-1.56 7.42c-.78-2.87-2.07-7.21-3.07-10 1.51-4.6 12.91-13.46 4.67-14-3.9-.27-5.47 7.42-5.57 12-.59-1.52-2.07-5-2.18-5.27 1.36-3.77 8-15.36 2.36-16-4.48-.51-4.44 7-4.08 10.65.05.46.08 1.14.14 1.87-1.07-2.29-2.21-4.58-3.44-6.84a21.2 21.2 0 0 0 2.56-5.2c.43-1.37 1.71-7.36-2-5.28-1.43.79-2 5.07-1.86 8.1q-1.37-2.37-2.86-4.64c-5.44-11.6-.08-26.27-9-24.85-10.55 1.68-7.55 10.38-5 13.63a41.4 41.4 0 0 0 11.72 10c1 1.69 4.81 9.16 5.29 10.14-4.2-5.2-12.65-15.46-16.08-9.84-3 5 11.77 8.84 16.88 11.51 1.39 2.95 4.48 10.54 4.77 11.33-1.91-2.16-3.5-5.42-6.06-6.92-2.28-1.33-7.65-2.44-7.7.94-.07 4.81 6.87 5.43 10.28 6.3 2.46.63 3.46 1.74 4.15 1.53q2 5.81 3.52 11.78c-2.6-4.78-10.27-15-14-9.53-4.85 7.09 9.47 7.29 14.29 10.6a122 122 0 0 1 2.3 12.35v.14c-1.67-3.79-3-7.64-6.32-10.54-3.05-2.64-8.56-4-8.62 2.25 0 4.54 7.92 5.41 11.56 7.62 1.61 1 2.79 2.26 3.63 2.79a114 114 0 0 1 .63 11.69c-6.4-5.52-11.18-21.63-16.87-14.27-5 6.45 10.29 7.9 16.83 15.75 0 3.56-.17 7.13-.41 10.71a40.6 40.6 0 0 0-3.52-8.26c-1-2-6.54-7.89-9.15-3.52s5.43 8 7.84 9.39a11.7 11.7 0 0 1 4.64 4.91c-.05.66-.78 8.81-1 12.24-1.57-5.92-15-27.81-20.56-15.91-3.57 7.63 13 9.53 16.67 12.26 2.51 1.86 3.37 3.48 3.79 5.18q-.18 3-.21 6c-3.15-5.54-11-16.22-15.23-8.26-5 9.41 8.35 7 10.83 8.44 2.16 1.24 4.59 2 4.51 5.07a60 60 0 0 0 .79 7c.3 1.64 2.91 1.08 2.73-.57a95 95 0 0 1-.5-9.66c3.82-2.23 12.25-2.2 14.82-4.27 3.6-2.99 2.39-6.94-2.29-7.13",style:{fill:"url(#linear-gradient-5)"}}),B.createElement("path",{d:"M61.65 478s4.78-14.14 15.85-9.59c0 0 5.53-17.9 19.12-3.9s9.41-16.06 22.94-13.36 9.51 13 9.51 13 12.93-6.67 10.09 4.85c0 0 30.41-15.17 30.91-2.34 0 0 20.38-3.77 16.86 6.79 0 0 11.82-3 11.82 4.53Z",style:{fill:"url(#linear-gradient-6)"}})),B.createElement("g",{id:"plant_3","data-name":"plant 3"},B.createElement("path",{d:"M462 465.72s-.78-27.18-10.34-29.19-10.93 17 0 35.68Z",style:{fill:"url(#linear-gradient-7)"}}),b||(b=B.createElement("path",{d:"M457 469a.17.17 0 0 1-.16-.12c-4.56-18.34-6.52-25.08-6.54-25.15a.18.18 0 0 1 .11-.2.17.17 0 0 1 .2.11c0 .07 2 6.82 6.55 25.16a.18.18 0 0 1-.12.2Z",className:"cls-32"})),B.createElement("path",{d:"M465.28 472.21s14.57-13.82 9.11-20.52-19.12 4.91-22.76 20.52Z",style:{fill:"url(#linear-gradient-8)"}}),k||(k=B.createElement("path",{d:"M459.59 470.36h-.06a.17.17 0 0 1-.09-.21c3.62-8.19 10.67-14.7 10.74-14.77a.16.16 0 0 1 .23 0 .15.15 0 0 1 0 .22c-.07.07-7.07 6.54-10.66 14.67a.15.15 0 0 1-.16.09",className:"cls-32"})),B.createElement("path",{d:"M453 472.21s-3.71-15.72-11.22-14.38 0 14.27 0 14.27Z",style:{fill:"url(#linear-gradient-9)"}}),j||(j=B.createElement("path",{d:"M445.59 470.25a.16.16 0 0 1-.15-.12l-2.51-9.13a.16.16 0 0 1 .12-.19.15.15 0 0 1 .2.11l2.5 9.14a.17.17 0 0 1-.11.2Z",className:"cls-32"}))),B.createElement("g",{id:"plant_3-2","data-name":"plant 3"},B.createElement("path",{d:"M637.2 463s.63-21.78 8.29-23.39 8.75 13.58 0 28.59Z",style:{fill:"url(#linear-gradient-10)"}}),Z||(Z=B.createElement("path",{d:"M641.16 465.63a.12.12 0 0 0 .12-.1c3.65-14.69 5.23-20.09 5.24-20.14a.13.13 0 1 0-.25-.07c0 .05-1.59 5.46-5.24 20.15a.13.13 0 0 0 .1.16Z",className:"cls-32"})),B.createElement("path",{d:"M634.54 468.22s-11.67-11.08-7.29-16.44 15.32 3.93 18.24 16.44Z",style:{fill:"url(#linear-gradient-11)"}}),w||(w=B.createElement("path",{d:"M639.1 466.74a.13.13 0 0 0 .07-.17 40.9 40.9 0 0 0-8.6-11.83.13.13 0 1 0-.18.18 40.7 40.7 0 0 1 8.61 11.74.14.14 0 0 0 .1.08",className:"cls-32"})),B.createElement("path",{d:"M644.42 468.22s3-12.6 9-11.53 0 11.44 0 11.44Z",style:{fill:"url(#linear-gradient-12)"}}),z||(z=B.createElement("path",{d:"M650.32 466.65a.13.13 0 0 0 .12-.1l2-7.32a.13.13 0 0 0-.09-.16.14.14 0 0 0-.16.09l-2 7.33a.13.13 0 0 0 .09.15Z",className:"cls-32"})))),B.createElement("g",{id:"lady"},D||(D=B.createElement("g",{id:"SHOES"},B.createElement("path",{d:"M218.67 347.36s10.16 5.73 13.22 6.43 4.41 2.44 4.5 3.95-.22 2.19-.48 2.29-29.76 1.19-30.07-.26 1.62-12 1.62-12Z",className:"cls-15"}),B.createElement("path",{d:"M218.67 347.36s-4.87.81-4.86 1.67-6.35-1.25-6.35-1.25l-.72-9.72 12.49.4Z",className:"cls-38"}),B.createElement("path",{d:"M205.84 359.77c.31 1.45 29.81.37 30.07.26s.57-.79.48-2.29-1.44-3.24-4.5-3.95a8.6 8.6 0 0 1-1.27-.41c-.86.55-2.2 5.51-2.2 5.51-2.19.13-18.8-.2-22.59-.28a4.6 4.6 0 0 0 .01 1.16",className:"cls-39"}),B.createElement("path",{d:"m161.65 332.29-1.06 9.38-3.61 9.5a1.5 1.5 0 0 0 .81 1.92c4.12 1.77 16.62 7 20.35 7.54a44.4 44.4 0 0 0 8.53.14 1.76 1.76 0 0 0 1.63-1.85c-.13-2.18-.85-5.75-4.18-6.66-4.88-1.33-12-8.86-12-8.86l2.14-7.45Z",className:"cls-40"}),B.createElement("path",{d:"M172.15 343.4s-4.21-.09-5.06.7-6.5-2.43-6.5-2.43l1.06-9.38 12.64 3.71Z",className:"cls-38"}),B.createElement("path",{d:"M157.79 353.09c4.12 1.77 16.62 7 20.35 7.54a44.4 44.4 0 0 0 8.53.14 1.76 1.76 0 0 0 1.63-1.85c-.13-2.18-.85-5.75-4.18-6.66-.28-.08-.56-.18-.85-.29-5.16.83-5.48 6.43-5.48 6.43-4.46-.95-16.93-6.2-20.6-7.77l-.2.54a1.5 1.5 0 0 0 .8 1.92",className:"cls-39"}))),G||(G=B.createElement("g",{id:"PANTS"},B.createElement("path",{d:"M220.91 158.58s6.56 38.76 5.38 73.5-6.62 107.3-6.62 107.3-10.34.65-13.62-.95c0 0-6.2-49.45-4.78-64.61s1.73-16.66 1.73-18.34-2.66-26.86-2.66-26.86-5.76 28.1-8.33 40S174.29 336 174.29 336s-10-.47-12.64-3.66c0 0 3.43-51.64 7-64.29s5.2-19.38 5-25.05-3.67-41.71.82-60.74 8.6-26.09 8.6-26.09Z",className:"cls-40"}),B.createElement("path",{d:"m205.88 195.56-5.59 33.06s2.71 25.17 2.71 26.86-.26 3.19-1.68 18.34c-.14 1.48-.21 3.28-.21 5.32l.07 4.68s2.47-18.21 4.75-27.18-.05-61.08-.05-61.08",className:"cls-15"}))),B.createElement("g",{id:"body-2","data-name":"body"},C||(C=B.createElement("path",{d:"M212.58 44.38s5.29-1.4 5.79 2.65-1.37 12.31 3.14 13.88 10.41 3.55 7.93 9-10.08 8.51-6.2 13.72 7.19 5.2 1.49 11.48-47.48 5.8-47.48 5.8-7.88-3.32-9.86-9.68-6-10.82-.08-13 10.69-1.62 11.15-10.3.56-19.31 6.85-23.78 20.5-9.84 23.56-6.95a14 14 0 0 1 3.71 7.18",className:"cls-40"})),H||(H=B.createElement("path",{d:"M220.27 75c1.07-5.87-.5-7.93-2.89-14.05a42.8 42.8 0 0 1-2.62-12.53s-12.21 18.23-18.89 19.06-9.07-3.61-9.07-3.61-3.63 3.2-4.7 10.38-19.09.64-17.4 10c.67 2 1.86 4.29 2.69 7a22.1 22.1 0 0 0 7.08 10.15s44.56 0 50.26-6.27c5.54-6.1 2.58-6.27-1.16-11a9.29 9.29 0 0 1-3.3-9.13",className:"cls-15"})),S||(S=B.createElement("path",{d:"M326.36 181.65c-3.17-6.72-12-12.28-19.43-12.28a22.1 22.1 0 0 0-14.08 4.92 3.71 3.71 0 0 1-6-2.11L280.39 142a8.16 8.16 0 0 0-9.7-6.26L165.4 158.35a8 8 0 0 0-6.12 9.48L181.92 273a8.28 8.28 0 0 0 5.59 6.15l-1.39.39h4.12a8 8 0 0 0 1.52-.18l2.29-.49 27-5.82a5.1 5.1 0 0 0 2.78-8.33 21.89 21.89 0 1 1 36.68-5.8 3.49 3.49 0 0 0 1 4.1l-1.58.77h3.65a3.6 3.6 0 0 0 .85-.08l32.26-6.94a8.18 8.18 0 0 0 6.27-9.71l-6.47-30a3.82 3.82 0 0 1 4.69-4.51 21.92 21.92 0 0 0 25.13-30.85Z",className:"cls-16"})),T||(T=B.createElement("path",{d:"M255.08 136.83c-3.12-5.12-7.42-12.14-12.35-20.08-10.12-16.28-14.37-20.92-14.37-20.92-1.54-1.48-15-4-15-4L196 91.07s-5.2-.62-13-.86c-5.64-.17-8.9 2.11-13.17 6.1 4.78-3.83 7.9 24.07 7.9 24.07s1.94 12.78 3.46 23.07L183 145c5.46 4.75 12.34 11.16 12.34 11.16l-3.72 4.75 1 .31c3.64 1.06 27.74-2.13 28.33-2.6s3.84-23.05 4.43-24.94 4-6.91 4-6.91l15.69 22.78 15.27-4s-1.98-3.35-5.26-8.72",className:"cls-41"})),U||(U=B.createElement("path",{d:"M204.88 132.72c-1.14-.91-9.88-1.61-14.74-2.73s-7-16.38-7-16.38l-5.39 6.77s1.94 12.78 3.46 23.07L183 145c5.46 4.75 12.34 11.16 12.34 11.16l-3.72 4.75 1 .31a26 26 0 0 0 6.26.08c-.69-3.76-2.94-16.15-3.54-19.74-.75-4.28 10.66-7.93 9.54-8.84M229.36 126.73s2-4.25 1.87-7a64 64 0 0 0-1.55-8.43s6.74 16.18 8.36 19.35 22.28 14.77 22.28 14.77l-15.27 4Z",className:"cls-42"})),B.createElement("path",{d:"M303.21 169.37a22.1 22.1 0 0 0-14.08 4.92 3.7 3.7 0 0 1-5.95-2.11L276.67 142a8.16 8.16 0 0 0-9.7-6.26l-105.29 22.61a8 8 0 0 0-6.12 9.48L178.2 273a8.28 8.28 0 0 0 9.84 6.35l29.31-6.35a5.11 5.11 0 0 0 2.79-8.33 21.66 21.66 0 0 1-5-10.28 21.9 21.9 0 1 1 41.66 4.48 3.5 3.5 0 0 0 3.95 4.79l32.25-6.9a8.18 8.18 0 0 0 6.27-9.71l-6.47-30a3.83 3.83 0 0 1 4.7-4.51 21.92 21.92 0 0 0 25.12-30.85c-3.15-6.76-11.98-12.32-19.41-12.32",style:{fill:"url(#linear-gradient-13)"}}),O||(O=B.createElement("path",{d:"M192.14 98.87c6.11 3.9 13.91 3.45 13.91 3.45-.27-5.18-1.06-8.15-4.19-11l-5.86-.25s-5.2-.62-13-.86a16.3 16.3 0 0 0-3.59.28c5.46-1.08 6.71 4.51 12.73 8.38",className:"cls-42"})),L||(L=B.createElement("path",{d:"M203.59 174.79c4.11 1.08 5.82.52 6.17-.4 0 0 2.56.49 3.15.13s1.48-1.06 1.89-1 1.26-.75 1.5-1.13-17.94-11.29-30.9-19.17L167.82 157c4.8 2.77 14.66 8.32 18.72 9.67 5.46 1.85 12.93 7.04 17.05 8.12",className:"cls-44"})),A||(A=B.createElement("path",{d:"m183 145-1.73-1.51c-5.34-4.62-12.12-10.42-12.12-10.42l8.66-12.65s-3.12-27.9-7.9-24.07c-.27.24-.54.5-.81.75-5.3 5.52-17.21 27.33-18.46 30.31s-.92 7.55.64 12.58l.17.56c1.72 5.26 37 24.37 37 24.37l3.16-4 3.72-4.75S188.42 149.71 183 145",className:"cls-41"})),B.createElement("g",{id:"FACE"},q||(q=B.createElement("path",{d:"M214.76 48.46c-13.44-14.81-24.68 15.48-24.68 15.48-3.19-2.42-6.5 2.86-3.74 5.84s5.29 1.7 5.29 1.7a23.4 23.4 0 0 0 4.51 5.23v14.36s3.06 11.73 10.58 11.23 5.53-10.49 5.53-10.49c-1.08-.45-2.2-8.24-2.67-11.83a12.4 12.4 0 0 0 2.92-1.34c6.17-3.85 2.26-30.18 2.26-30.18",className:"cls-38"})),B.createElement("path",{d:"M209.58 80a14 14 0 0 1-9.79-.94s3.11 3.7 10.21 3.74Z",style:{fill:"#d17a62"}}),P||(P=B.createElement("path",{d:"M190.08 63.94s1.88 4.68 2.48 4.68.61-5.51.61-5.51 7.16-.22 8.65-7.32 4.75-8.82 8.15-7c0 0 2.48-2.48 4.79-.33a10.42 10.42 0 0 0-9.28-6.1c-7.02-.29-18.85 13.54-15.4 21.58",className:"cls-40"}))),V||(V=B.createElement("path",{d:"m195.3 156.12 2.68 1.94s4.47-.05 5.68.42 4.52 2.39 5.76 2.63 2.23.54 1.72 1.38-5 .17-5 .17 3.81 3.1 4.38 3.47 5.7 2.19 6 2.7 0 1.41 0 1.78c0 0 .27 1.82-.54 2.16a3.87 3.87 0 0 1-2.06 0s-.3 1-.91.94-3.23-.7-3.23-.7.23 1.38-.88 1.21-6.57-1.92-7.42-2.19-4.88-3.81-5.49-4.49-7.07-3.23-7.07-3.23Z",className:"cls-38"})),F||(F=B.createElement("path",{d:"M276.59 170.93a2.65 2.65 0 0 0 2.1 2c1.81.35 5.26 1.25 6.42.94l2.21-.6a3.8 3.8 0 0 1-.43-1.1l-1-4.66-12.33.88s.06 1.73 3.03 2.54",className:"cls-44"})),R||(R=B.createElement("path",{d:"M284.62 161.63s-2.49 1.2-3.77 1.06-5.36-.92-6-.52-1.28 1.23-.5 2c0 0-1.72 0-1.72.6a2.76 2.76 0 0 0 1.55 2.33 1.18 1.18 0 0 0-.64 1.38c.17 1.08 3.24 1.38 3.24 1.38a1 1 0 0 0-.65 1c.11.81 1.32 1 2.13 1.18a54 54 0 0 0 5.93.54 6.44 6.44 0 0 0 3.37-2.23c.1-.43-.45-1.07-.42-1.56s.22-2-.22-2.26.17-1.74-.17-2.09-.38-2.51-.72-2.72-1.58-.85-1.58-.85Z",className:"cls-38"}))))))))}},17603:(e,a,t)=>{"use strict";t.d(a,{A:()=>Q});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y=t(30758);function X(){return X=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...Q}=e;return Y.createElement("svg",X({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},Q),a?Y.createElement("title",{id:t},a):null,l||(l=Y.createElement("defs",null,Y.createElement("linearGradient",{id:"linear-gradient",x1:231.74,x2:230.72,y1:383.25,y2:506.44,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#242259"}),Y.createElement("stop",{offset:1,stopColor:"#986dae"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-2",x1:193.04,x2:192.02,y1:382.93,y2:506.12}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:154.35,x2:153.33,y1:382.61,y2:505.8}),Y.createElement("linearGradient",{id:"linear-gradient-4",x1:132.36,x2:211.61,y1:401.63,y2:314.82,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#f79b5e"}),Y.createElement("stop",{offset:.29,stopColor:"#faad60"}),Y.createElement("stop",{offset:.71,stopColor:"#fec162"}),Y.createElement("stop",{offset:1,stopColor:"#ffc863"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-5",x1:174.74,x2:254,y1:440.69,y2:353.85}),Y.createElement("linearGradient",{id:"linear-gradient-6",x1:515.28,x2:319.04,y1:126.84,y2:269.63,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#fff4fb"}),Y.createElement("stop",{offset:1,stopColor:"#c6d6ee"})),Y.createElement("linearGradient",{id:"linear-gradient-7",x1:347.91,x2:276.31,y1:221.85,y2:300.59,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:.05,stopColor:"#fad05a"}),Y.createElement("stop",{offset:.33,stopColor:"#fac85a"}),Y.createElement("stop",{offset:.77,stopColor:"#f9b159"}),Y.createElement("stop",{offset:1,stopColor:"#f8a359"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-8",x1:366.39,x2:294.78,y1:238.66,y2:317.39}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-9",x1:83.68,x2:83.68,y1:494.43,y2:404.68}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-10",x1:96.2,x2:96.2,y1:494.43,y2:404.68}),Y.createElement("linearGradient",{id:"linear-gradient-11",x1:103.69,x2:94.11,y1:451.62,y2:485,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#fdf4b6"}),Y.createElement("stop",{offset:1,stopColor:"#d07e2b"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-12",x1:113.52,x2:103.95,y1:454.44,y2:487.82}),Y.createElement("style",null,".cls-1{fill:#fff}.cls-8{fill:#f69159}.cls-27,.cls-9{fill:#1f1a4e}.cls-11{fill:#cf7961}.cls-12{fill:#ffb84f}.cls-13{fill:#f79f81}.cls-14{fill:#403982}.cls-15{fill:#3960ac;opacity:.57}.cls-16{fill:#ade1f7}.cls-17{fill:#d1dbef;opacity:.25}.cls-18{fill:#3258a7}.cls-19{fill:#1e4380}.cls-20{fill:#d37444}.cls-22{fill:#e3e3e3}.cls-24{fill:#ffd788}.cls-25{fill:#f4825d}.cls-26{fill:#104ab2}.cls-27{opacity:.46}.cls-28{fill:#709480}.cls-29{fill:#b4c6b6}.cls-30{fill:#f1eadf}.cls-38{fill:none;stroke:#221f1f;stroke-linecap:round;stroke-miterlimit:10;stroke-width:.44px}.cls-39{fill:#f9fcff}"))),Y.createElement("g",{id:"Layer_2","data-name":"Layer 2"},Y.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=Y.createElement("path",{d:"M0 0h600v600H0z",className:"cls-1"})),Y.createElement("g",{id:"chair"},Y.createElement("path",{d:"M153.75 449.63h75.4v11.07h-75.4z",style:{fill:"#1f1950"}}),Y.createElement("path",{d:"M257.97 515.03h-9.39l-44.23-123.21h9.39z",style:{fill:"url(#linear-gradient)"}}),Y.createElement("path",{d:"M182.24 515.03h9.39l11.05-123.21h-9.39z",style:{fill:"url(#linear-gradient-2)"}}),Y.createElement("path",{d:"M126.95 515.03h9.39l44.23-123.21h-9.39z",style:{fill:"url(#linear-gradient-3)"}}),Y.createElement("path",{d:"M138.07 304.67h80.61a5.42 5.42 0 0 1 5.42 5.42v82.84h-84.71a3.55 3.55 0 0 1-3.55-3.55V306.9a2.23 2.23 0 0 1 2.23-2.23",style:{fill:"url(#linear-gradient-4)"}}),Y.createElement("path",{d:"M174.25 392.93h75.51a4.36 4.36 0 0 1 4.36 4.36v3a4.36 4.36 0 0 1-4.36 4.36h-75.51z",style:{fill:"url(#linear-gradient-5)"}}),c||(c=Y.createElement("path",{d:"M142.18 380.3v-70.66a5 5 0 0 0-5-5 5 5 0 0 0-5 5v71.59a23.45 23.45 0 0 0 23.45 23.45h17.23a5.87 5.87 0 0 0 5.88-5.87 5.88 5.88 0 0 0-5.88-5.88H154.8a12.62 12.62 0 0 1-12.62-12.63",className:"cls-8"}))),Y.createElement("g",{id:"customer"},s||(s=Y.createElement("path",{d:"M419.93 104.3a94.81 94.81 0 0 0-39.65 180.92 93.7 93.7 0 0 0 14.62 5.32l.53.15a94 94 0 0 0 10.41 2.16 96 96 0 0 0 14.09 1 94.8 94.8 0 0 0 0-189.59Z",className:"cls-9"})),Y.createElement("path",{d:"M513.82 196.89A94.8 94.8 0 1 0 379.37 283l.43-11.82-5.84-.65a2.55 2.55 0 0 1-1.68-4.16 4.47 4.47 0 0 0-.29-6l-.2-.19a6 6 0 0 1-1.53-5.92l10.74-36.9a27.07 27.07 0 0 1 21-19.08l29.19-5.44 6.27.4a21.78 21.78 0 0 1 20.39 20.62l2.4 47.16a12.49 12.49 0 0 1-6.67 11.69l-9.94 5.21-1.74 11a94.81 94.81 0 0 0 71.92-92.03",style:{fill:"url(#linear-gradient-6)"}}),n||(n=Y.createElement("g",{id:"body"},Y.createElement("path",{d:"m392.48 272.61-12.68-1.42-.43 11.81a94 94 0 0 0 14.63 5.34Z",className:"cls-11"}),Y.createElement("path",{d:"m460.26 261-2.4-47.16a21.78 21.78 0 0 0-20.39-20.62l-6.27-.4-29.2 5.46a27.07 27.07 0 0 0-21 19.08l-10.7 36.89a6 6 0 0 0 1.53 5.92l.2.19a4.47 4.47 0 0 1 .29 6 2.55 2.55 0 0 0 1.68 4.16l5.84.65 12.68 1.42-10.58-1.18 1.73-11.84 5-33.91c-.49 4.55 1.14 21.66 2.44 33.91.78 7.4 1.45 13 1.45 13l1.44 15.77.54.14a95 95 0 0 0 10.4 2.16c5.64-8.31 16.77-25.78 16-33.4-1-10.18 13.57-46.49 13.57-46.49s3.73 21.72 2.57 32.61-4.94 16.76-2.74 24.91a13.29 13.29 0 0 0 9.31 9.65l9.94-5.21a12.49 12.49 0 0 0 6.67-11.71",className:"cls-12"}),Y.createElement("path",{d:"m388.59 225.68-5 33.91-1.73 11.84 10.58 1.18s-.67-5.62-1.45-13c-1.26-12.27-2.89-29.38-2.4-33.93M434.34 268.27c-2.2-8.15 1.57-14 2.74-24.91s-2.57-32.61-2.57-32.61-14.59 36.31-13.57 46.49c.76 7.62-10.37 25.09-16 33.4a96 96 0 0 0 14.09 1 95 95 0 0 0 22.89-2.79l1.74-11a13.29 13.29 0 0 1-9.32-9.58",className:"cls-8"}))),i||(i=Y.createElement("g",{id:"head"},Y.createElement("g",{id:"face"},Y.createElement("path",{d:"M409.91 202.94c9.32 3 20.2-10.86 20.2-10.86l-6.27-24.7-21.36 2.47s3.23 31.74 7.43 33.09",className:"cls-13"}),Y.createElement("path",{d:"m405.46 190.68 10.6-13.22-14.3-7.16z",className:"cls-11"}),Y.createElement("path",{d:"M388.7 157.11c.57 11.74 3.05 26.17 11.9 26.75 11.73.77 25.88-12.89 26.92-24.61s5.36-31.18-10.53-32.59c-23.08-2.04-29.31 9.68-28.29 30.45",className:"cls-13"})),Y.createElement("g",{id:"hair"},Y.createElement("path",{d:"M423.91 149.15c2.71-3.65 13.57-4.49 11.28-9.84s-4-10.38-4-10.38-2-13.24-19.24-9c-26.64 6.57-25.64 8.25-22.61 23.49 0 0 14.36 1.85 25.95-4.93 0 0 .41 8.16 5.18 12.32l-.83 8.73 1.48.57s.07-7.31 2.79-10.96",className:"cls-14"}),Y.createElement("path",{d:"M431.2 128.93s1.7 5 4 10.38-8.57 6.19-11.28 9.84-2.77 11-2.77 11L431.2 164c14.55-17.38 20.09-21.14 0-35.07",className:"cls-9"})),Y.createElement("ellipse",{cx:427.52,cy:162.53,className:"cls-13",rx:8.78,ry:6.82,transform:"rotate(-69.29 427.482 162.541)"}))),m||(m=Y.createElement("g",{id:"cp"},Y.createElement("rect",{width:11.7,height:24.46,x:421.23,y:157.11,className:"cls-9",rx:1.31,transform:"rotate(17.31 427.137 169.37)"}),Y.createElement("rect",{width:12.12,height:24.46,x:422.96,y:157.71,className:"cls-14",rx:1.31,transform:"rotate(17.31 429.078 169.982)"}),Y.createElement("circle",{cx:429,cy:160.36,r:1.24,className:"cls-9"}))),d||(d=Y.createElement("g",{id:"arm"},Y.createElement("path",{d:"m453.82 257.92-15.45-61s-3.22-12.23-2.67-14 5.09-14.54 5-15.86-6.66-6.8-7.25-7.18-4.5.85-4.75 2.34 1.31 7.39 1.23 8.12c0 0-.64 7.13 0 9.7s7.34 88.12 14.38 90.25a8 8 0 0 0 4.32-.78 10 10 0 0 0 5.19-11.59",className:"cls-13"}),Y.createElement("path",{d:"M429.89 180c-.64-2.57 0-9.7 0-9.7-.09.74-3.13 6.26-2 9.35s.95 22.87.94 24.56c0 1.24 1.2 16.58 2.31 27.64v.42l.06.56.15 1.48c.32 3 .62 5.55.88 7.12a118.8 118.8 0 0 0 5.5 23.79 7.74 7.74 0 0 0 6.5 5c-7-2.1-13.71-87.64-14.34-90.22",className:"cls-11"}))),o||(o=Y.createElement("path",{d:"m461.09 146.69.35-.07c5.62 3.36 9.27 3.2 11.11.34l.06-.09c1.56-2.43.78-5.32-2.34-7.32-2.73-1.76-5.77-2-9.27-1.12l-1-5.55a15.69 15.69 0 0 1 13.54 1.9c6.06 3.89 8 9.92 4.53 15.34l-.06.09c-3.5 5.46-9 5.4-14.38 3.13l-2.63 3.19-3.51-2.26Zm-7.24 10.42 5.8 3.73-3.84 6-5.81-3.75Z",className:"cls-9"}))),h||(h=Y.createElement("path",{d:"M305.51 315.49c-1.75-.7-18.79 1.8-18.79 1.8L243.85 309l-15.95 2.73c16.07 14.91 44.49 11.52 54.25 9.81h.28c3.14 0 10.48 2.91 12.33 2.76s9 1.36 11 1.36 6.3-4.2 6.27-4.71-4.77-4.76-6.52-5.46",className:"cls-13"})),p||(p=Y.createElement("g",{id:"bubble_text","data-name":"bubble text"},Y.createElement("path",{d:"M242.77 211.7 254 200.61h71.15c4.74 0 8.58-4.74 8.58-10.58v-14.5c0-5.84-3.84-10.57-8.58-10.57h-73.8c-4.74 0-8.58 4.73-8.58 10.57Z",className:"cls-15"}),Y.createElement("path",{d:"M261.45 173.05h61.4v1.44h-61.4zM261.45 181.21h61.4v1.44h-61.4zM261.45 189.37h61.4v1.44h-61.4z",className:"cls-16"}),Y.createElement("path",{d:"m383.12 138.74-11.24-11.09h-71.16c-4.74 0-8.58-4.74-8.58-10.58v-14.5c0-5.84 3.84-10.58 8.58-10.58h73.81c4.74 0 8.59 4.74 8.59 10.58Z",className:"cls-15"}),Y.createElement("path",{d:"M303.03 100.09h61.4v1.44h-61.4zM303.03 108.25h61.4v1.44h-61.4zM303.03 116.4h61.4v1.44h-61.4z",className:"cls-16"}),Y.createElement("rect",{width:94.98,height:32.6,x:47.33,y:207.77,className:"cls-17",rx:6.39}),Y.createElement("path",{d:"M125.52 217H64.11a1.09 1.09 0 0 1 0-2.17h61.41a1.09 1.09 0 0 1 0 2.17M125.52 225.15H64.11a1.08 1.08 0 1 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16M125.52 233.31H64.11a1.08 1.08 0 1 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16",className:"cls-16"}),Y.createElement("rect",{width:94.98,height:32.6,x:438.4,y:310.64,className:"cls-17",rx:6.39}),Y.createElement("path",{d:"M516.59 319.87h-61.41a1.08 1.08 0 0 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16M516.59 328h-61.41a1.09 1.09 0 0 1 0-2.17h61.41a1.09 1.09 0 0 1 0 2.17M516.59 336.18h-61.41a1.08 1.08 0 0 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16",className:"cls-16"}))),f||(f=Y.createElement("g",{id:"pants"},Y.createElement("g",{id:"pants-2","data-name":"pants"},Y.createElement("path",{d:"M257.13 347.72h-26.51L214.09 489.1l10.37.26c30.77-82.3 36.77-119.33 39.31-133.75a6.73 6.73 0 0 0-6.64-7.89",className:"cls-18"}),Y.createElement("path",{d:"M214.09 489.1s33.32-80.83 25.75-132c-.48-3.25-9.22-9.39-9.22-9.39Z",className:"cls-19"}),Y.createElement("path",{d:"M231.46 347.72 217.3 347l-4-18.09-52.89 4.85-6.55 20.48c-5.65 17.67-.66 24 18.62 25.3l21.23 3.51-39.85 106.62h11.26c38.1-58.56 67.15-110.85 74.36-130.44a8.55 8.55 0 0 0-8.02-11.51",className:"cls-18"}),Y.createElement("path",{d:"M200.28 371.35c-12.87 3.16-26.42-1.32-29.07-9.38-3-9.15 4.65-14.25 4.65-14.25l-5.64-15.15-9.83 1.19-6.55 20.48c-5.65 17.67.77 24.7 18.94 27.21l20.91 1.6L156.08 484c54.71-87.09 44.2-112.65 44.2-112.65",className:"cls-19"})),Y.createElement("g",{id:"feet"},Y.createElement("path",{d:"m214.09 489.08 10.37.26-1.82 6.38h-9.67zM165.12 489.65l-2.92 5.64h-10.53l2.19-5.64z",className:"cls-13"})))),E||(E=Y.createElement("g",{id:"shoes"},Y.createElement("path",{d:"M217.83 511.41a11.5 11.5 0 0 0 6.33 5c1.4.2 6 .26 6 .26s-.56-6.94 3-8.29c-1.71-1-3.35-1.49-4.12-2-1.94-1.42-6-12-6-12l-10-.21-4.25 10.06s7.77 4.67 9.04 7.18",className:"cls-14"}),Y.createElement("path",{d:"M216.93 513.26c2.3 3.6 5.09 4.84 10.47 5.24a76.5 76.5 0 0 0 11.16-.15c0-5.83-2.77-8.5-5.38-10-3.57 1.35-3 8.29-3 8.29s-4.61-.06-6-.26a11.5 11.5 0 0 1-6.33-5c-1.27-2.51-9-7.28-9-7.28l-.57 1.33s6.34 4.23 8.65 7.83",className:"cls-1"}),Y.createElement("path",{d:"M153.35 507.09c1.65 1.45 5.34 7.13 6.83 8.57s7.21 1.32 7.21 1.32a9.33 9.33 0 0 1 5-8.46c-1.64-.88-3.18-1.33-3.92-1.87-1.94-1.42-5.83-12.07-5.83-12.07l-10.73-.16-3.81 9.71a25.4 25.4 0 0 1 5.25 2.96",className:"cls-14"}),Y.createElement("path",{d:"M156.34 513.62c2.3 3.6 5.09 4.85 10.47 5.25a63 63 0 0 0 11.16-.36c0-6-2.91-8.56-5.58-10a9.33 9.33 0 0 0-5 8.46s-5.73.13-7.21-1.32-5.18-7.12-6.83-8.57a25.4 25.4 0 0 0-5.25-3l-.63 1.6s6.53 4.32 8.87 7.94",className:"cls-1"}))),g||(g=Y.createElement("path",{d:"M243.73 303.63c-1.38-2.34-3.7-9-5.88-15.71-1.69-5.73-3.52-11.77-5.3-17.26-3.08-9.53-6-17.39-7.57-19-4.55-4.53-14.66 30.28-14.66 30.28l10.23 17.33c2.8 5.43 5.51 10.65 5.92 11.21.88 1.21 3 5.5 14.65 9.35s25.7 3.23 25.7 3.23l1.94-9.27s-21.3-3.79-25.03-10.16",className:"cls-9"})),x||(x=Y.createElement("path",{d:"m222.76 250.11-13.35-5.39h-21.84l-18.36 5.46a10.55 10.55 0 0 0-7.21 12.53l7.51 42.44-8.7 29.53h54.07l-4.15-29.95.13-.41a11.6 11.6 0 0 1 5.84-6.83c5-2.45 7.89-5.78 8.3-9.34a18.4 18.4 0 0 0-.32-5.23 51.36 51.36 0 0 1 1.55-25.46 5.94 5.94 0 0 0-3.47-7.35",className:"cls-14"})),y||(y=Y.createElement("path",{d:"M217.89 299a13 13 0 0 0 6.53-8.76s-6.63 6-29.62 3.81c-26.52-2.47-10 17.13-19.44 40.66h39.47s-3.79-27.8-3.24-29.43 3.46-4.88 6.3-6.28M173.61 284.96l-5.6 11.97-1.91-8.32z",className:"cls-9"})),u||(u=Y.createElement("path",{d:"M162.52 307.93c-.68-.25-1.2-4.13 1-7.62 2.31-3.69 10.1-15.35 10.1-15.35s-6-33.7-9.4-31.54-21.72 45.75-24.6 55.83c-.37 5.89 1.92 10.75 14.16 13a249 249 0 0 0 27 2.8c10.65.64 19.51.83 20.06.84l1.47-12.89s-38.39-4.56-39.79-5.07",className:"cls-14"})),M||(M=Y.createElement("g",{id:"mouse_x_keyboard","data-name":"mouse x keyboard"},Y.createElement("path",{d:"M218.38 320.96h77.88v5.53h-77.88z",className:"cls-12"}),Y.createElement("path",{d:"M264.59 326.5h-17.07a8.54 8.54 0 1 1 17.07 0",className:"cls-20"}))),_||(_=Y.createElement("path",{id:"hand",d:"M260.25 315.61c-1.95-.84-19.08 1.68-19.08 1.68L202.31 313l-1.45 12.86c23.64 0 43.34-3 44.27-2.86h.33a9.7 9.7 0 0 0 1.78.07 11.5 11.5 0 0 0 2.73-.42l.23-.07c.67-.18 1.18-.35 1.42-.41.69-.16 2.63 1.14 4 2.29s4.92.63 6.32.31 4-3.45 3.89-4.26-3.63-4.05-5.58-4.9",className:"cls-13"})),Y.createElement("g",{id:"pc"},v||(v=Y.createElement("path",{d:"M336.35 302.35h-75.88a8.28 8.28 0 0 1-8.26-8.74l3-49.28a8.28 8.28 0 0 1 8.26-7.81h75.88a8.27 8.27 0 0 1 8.26 8.74l-3 49.28a8.28 8.28 0 0 1-8.26 7.81",className:"cls-20"})),Y.createElement("path",{d:"M341.1 302.35h-75.88a8.28 8.28 0 0 1-8.26-8.74l3-49.28a8.28 8.28 0 0 1 8.26-7.81h75.88a8.27 8.27 0 0 1 8.26 8.74l-3 49.28a8.28 8.28 0 0 1-8.26 7.81",style:{fill:"url(#linear-gradient-7)"}}),N||(N=Y.createElement("path",{d:"m324.36 319-9.61-35.27h1.6v-8.4a5.86 5.86 0 0 0-5.86-5.86h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4l9.92 36.33a1.88 1.88 0 0 1-1.81 2.37H276.1v4.15h42.46a6 6 0 0 0 5.8-7.58m-11.42-5.46a5.36 5.36 0 1 1 5.35-5.36 5.36 5.36 0 0 1-5.35 5.35Z",className:"cls-20"})),b||(b=Y.createElement("path",{d:"M314.38 269.46h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4h25.27v-8.4a5.86 5.86 0 0 0-5.86-5.86M329.83 318.66l-9.51-34.94H295l1.42 5.23 8.94 32.82a3.82 3.82 0 0 1-3.42 4.81h21.88a6.27 6.27 0 0 0 6.01-7.92m-14.95-5.13a5.36 5.36 0 1 1 5.36-5.36 5.36 5.36 0 0 1-5.36 5.36",className:"cls-22"})),Y.createElement("path",{d:"m329.83 318.66-9.51-34.94h-.08v-8.4a5.86 5.86 0 0 0-5.86-5.86h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4l1.42 5.23 8.94 32.82a3.82 3.82 0 0 1-3.42 4.81h21.88a6.27 6.27 0 0 0 6.04-7.92m-14.95-5.13a5.36 5.36 0 1 1 5.36-5.36 5.36 5.36 0 0 1-5.36 5.36",style:{fill:"url(#linear-gradient-8)"}}),k||(k=Y.createElement("path",{d:"M329.83 319a.35.35 0 0 1-.34-.26L320 284a.36.36 0 0 1-.14-.29v-8.4a5.51 5.51 0 0 0-5.5-5.5h-13.54a.36.36 0 0 1 0-.72h13.56a6.23 6.23 0 0 1 6.22 6.22v8.18a.3.3 0 0 1 .06.12l9.52 34.95a.36.36 0 0 1-.25.44Z",className:"cls-24"})),j||(j=Y.createElement("path",{d:"M323.78 326.94a.36.36 0 1 1 0-.72 5.91 5.91 0 0 0 5.71-7.46L320 283.81a.36.36 0 0 1 .25-.44.35.35 0 0 1 .44.25l9.52 34.95a6.63 6.63 0 0 1-6.4 8.37Z",className:"cls-24"})),Z||(Z=Y.createElement("path",{d:"M327.63 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M331.52 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M335.4 280.47a.6.6 0 0 1-.56-.63l1.64-29.13a.57.57 0 0 1 .62-.56.6.6 0 0 1 .57.62L336 279.91a.59.59 0 0 1-.6.56M339.28 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.64 29.14a.59.59 0 0 1-.62.56M343.16 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.59.59 0 0 1 .63-.56.59.59 0 0 1 .56.62l-1.63 29.14a.6.6 0 0 1-.63.56M267.06 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M270.94 280.47a.6.6 0 0 1-.56-.63l1.62-29.13a.57.57 0 0 1 .62-.56.6.6 0 0 1 .57.62l-1.64 29.14a.6.6 0 0 1-.61.56M274.82 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.64 29.14a.59.59 0 0 1-.62.56M278.7 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M282.59 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56",className:"cls-25"}))),w||(w=Y.createElement("g",{id:"table"},Y.createElement("path",{d:"M104.19 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.35h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-16"}),Y.createElement("path",{d:"M96.45 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-26"}),Y.createElement("path",{d:"M96.45 343.58h54.25v9.99H96.45z",className:"cls-27"}),Y.createElement("path",{d:"M314.32 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-16"}),Y.createElement("path",{d:"M306.59 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.58a7.34 7.34 0 0 1-7.34-7.34V337.59z",className:"cls-26"}),Y.createElement("path",{d:"M306.59 343.58h54.25v9.99h-54.25z",className:"cls-27"}),Y.createElement("rect",{width:287.71,height:17.08,x:74.03,y:326.5,className:"cls-26",rx:4.65}),Y.createElement("rect",{width:204.55,height:17.08,x:198.67,y:326.5,className:"cls-16",rx:4.65}))),z||(z=Y.createElement("path",{d:"M227.23 196.18c-4.79-10.78-16.43-15.52-21-15.52a17.2 17.2 0 0 0-9.76 3.57l12.93 40.68 20 6.22c4.11-11.77 3.06-20.83-.55-31 7.85 15.17 2.21 31.52 2.13 31.72l.68.25c.01-.19 6.7-19.57-4.43-35.92",className:"cls-9"})),D||(D=Y.createElement("path",{d:"M206.05 259.34c-12.27 0-18.48-14.62-18.48-14.62l9.79-19.81H214Z",className:"cls-13"})),G||(G=Y.createElement("path",{d:"m209.93 242.47-9.04-11.28 13.07-6.28z",className:"cls-11"})),C||(C=Y.createElement("path",{d:"M224.7 214.31c-.24 10.33-3.56 21.8-10.22 22.52-10.28 1.1-25.67-11.34-26.58-21.64s-1.8-27.41 12.16-28.65c20.3-1.79 24.94 13.87 24.64 27.77",className:"cls-13"})),H||(H=Y.createElement("path",{d:"M222.53 199.29s2.31-12.93-12.89-14.93c-6.8-6-20.63-2.63-27.18 1.83a27.2 27.2 0 0 0-5.7 3.83c-12.23 10.67-13.35 30.2-13.36 30.4h.72c0-.19 1.12-19.42 13.12-29.89a27 27 0 0 1 2.35-1.83c-7.92 8.46-14.12 20.84-13.81 33.6 13 14.54 32.67 12 32.67 12-4.3-8.58-3.47-17.48-2.66-21.83 8.77-2.14 14.85-5.83 18.09-11a15.83 15.83 0 0 0 2.49-9.29c.81.23 3.14 1.28 6.16 7.11m-9.27 1.82c-2.49 4-6.75 7-12.69 9.18 6-2.66 12.18-7.47 15-16.17a15.14 15.14 0 0 1-2.31 6.99",className:"cls-14"})),S||(S=Y.createElement("path",{d:"M187.35 196.89h2.92v15.64h-2.92z",className:"cls-28"})),T||(T=Y.createElement("path",{d:"M185.4 196.89h2.92v15.64h-2.92z",className:"cls-29"})),U||(U=Y.createElement("path",{d:"M191.93 200.41v-7.57a9.8 9.8 0 0 1 4.69-8.13c1.44-.87 5.55-3.43 5.55-3.43s-7.12 0-10.28 1.22l-.84.32a8.67 8.67 0 0 0-5.55 8.08v9.51Z",className:"cls-28"})),O||(O=Y.createElement("path",{d:"M190 200.41v-7.57a8.65 8.65 0 0 1 4.68-7.69l7.5-3.87-2.3-.19a22.6 22.6 0 0 0-9.93 1.41l-.83.32a8.65 8.65 0 0 0-5.55 8.08v9.51Z",className:"cls-29"})),L||(L=Y.createElement("circle",{cx:188.16,cy:216.13,r:8.27,className:"cls-29"})),A||(A=Y.createElement("circle",{cx:186.53,cy:216.13,r:8.27,className:"cls-30"})),q||(q=Y.createElement("circle",{cx:186.53,cy:216.13,r:5.19,className:"cls-29"})),P||(P=Y.createElement("circle",{cx:186.53,cy:216.13,r:2.36,className:"cls-30"})),V||(V=Y.createElement("path",{d:"m215.94 232.68-19.68-2.26-10.27-13.89 1.08-.8 9.93 13.42 19.1 2.2z",className:"cls-30"})),F||(F=Y.createElement("rect",{width:6.56,height:3.63,x:210.68,y:229.73,className:"cls-29",rx:.64})),Y.createElement("g",{id:"plant"},Y.createElement("path",{d:"M86.35 409.87c-.55 2.61.26 5.72-.2 8.41-.57 3.37-2.71 4.34-4.16 6.46-1.71 2.52-2.5 7.23-1.87 11.25a60 60 0 0 0 1.88 6.86 16.06 16.06 0 0 1 .51 7.45c-.81 3.58-5.16 6.35-5.16 21.52 0 13.84 9.88 19.22 12.68 22.61v-89.75l-1.26 1.23a7.33 7.33 0 0 0-2.42 3.96",style:{fill:"url(#linear-gradient-9)"}}),Y.createElement("path",{d:"M97.89 442.85a58 58 0 0 0 1.87-6.85c.63-4-.15-8.73-1.87-11.25-1.45-2.12-3.58-3.09-4.16-6.46-.46-2.69.36-5.8-.2-8.41a7.32 7.32 0 0 0-2.4-4l-1.27-1.23v89.75c2.8-3.39 12.68-8.77 12.68-22.61 0-15.17-4.35-17.94-5.16-21.52a16.06 16.06 0 0 1 .51-7.42",style:{fill:"url(#linear-gradient-10)"}}),Y.createElement("path",{d:"M102.88 459.88c-.75 1-.41 2.47-1.09 3.5-.84 1.3-2.72 1.25-4.15 1.83a4.59 4.59 0 0 0-2.79 4.34 16.6 16.6 0 0 0 .8 3.29 3.76 3.76 0 0 1-.4 3.25c-1.06 1.34-5 1.57-6.63 8-1.52 5.84 6.07 10.24 8 12.27l9.85-37.84-1.18.25a3.92 3.92 0 0 0-2.41 1.11",style:{fill:"url(#linear-gradient-11)"}}),Y.createElement("path",{d:"M108.07 465c-.09-1.23.93-2.37.76-3.59a3.9 3.9 0 0 0-1.56-2.19l-.92-.79-9.85 37.86c2.69-.83 11.47-1 13-6.8 1.66-6.39-1.63-8.5-1.91-10.19a3.78 3.78 0 0 1 1.24-3 16 16 0 0 0 2.3-2.49 4.6 4.6 0 0 0-.31-5.14c-.98-1.24-2.64-2.11-2.75-3.67",style:{fill:"url(#linear-gradient-12)"}}),Y.createElement("path",{d:"M95.31 500.07c-3-4.42-21.63-7.91-21.63-7.91s6.16 6.61 6.16 11a19.6 19.6 0 0 1-1.06 5 10 10 0 0 0 9.53 13h.58c1.2-2.55 2.37-5.56 2.37-7.62 0-4.15 6.99-9.06 4.05-13.47",style:{fill:"#373175"}}),Y.createElement("path",{d:"M114.12 508.24a19.6 19.6 0 0 1-1.06-5c0-4.44 6.16-11 6.16-11H73.68s18.68 3.49 21.63 7.91-4 9.32-4 13.59c0 2.06-1.17 5.07-2.37 7.62h15.7a10 10 0 0 0 9.48-13.12",style:{fill:"#242259"}})),Y.createElement("g",{id:"plant-2","data-name":"plant"},Y.createElement("path",{d:"M501.26 424.64c.73 4-2 15.13 0 18.64s5.77 11.18 2.49 18-7.34 25.64 15 26.2 18.53-24.28 16-29.14-5.87-9.49-7-19.54-2.15-13.56-14.46-22.82-14.12-11.07-16.94-7.57 3.45 8.09 4.91 16.23",style:{fill:"#413a82"}}),R||(R=Y.createElement("path",{d:"M509.74 428.25s18.14 38.41 6.47 82M517 451.26l-10.2-10.92M519.09 463.48l6.35-10.49M520.12 478.59l-12.87-11.41",className:"cls-38"})),B||(B=Y.createElement("path",{d:"M404.88 482.31s10-3.5 11.19-11.09 3-18.66-1.85-17.69-14.59 12.74-9.34 28.78M395.65 491.45s3.3-10.5-2.34-14.88-24.31-2.82 2.34 14.88M401.87 499.42s20-1.65 22.66-10.6-18.48-1.45-22.66 10.6",className:"cls-39"})),W||(W=Y.createElement("path",{d:"M412.37 461.89a154 154 0 0 1-7.49 20.42c-4.37 9.33-8.27 26.74-8.27 26.74s-1.45-10.41 22-19.35",className:"cls-38"})),I||(I=Y.createElement("path",{d:"M390.11 481.53a40.86 40.86 0 0 1 8 21.22",className:"cls-38"}))))))}},78245:(e,a,t)=>{"use strict";t.d(a,{A:()=>Je});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee,ae,te,le,re,ce,se,ne,ie,me,de,oe,he,pe,fe,Ee,ge,xe,ye,ue,Me,_e,ve,Ne,be,ke,je,Ze,we,ze,De,Ge,Ce,He,Se,Te,Ue,Oe,Le,Ae,qe,Pe,Ve,Fe,Re,Be,We,Ie,Ye,Xe=t(30758);function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...Je}=e;return Xe.createElement("svg",Qe({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},Je),a?Xe.createElement("title",{id:t},a):null,l||(l=Xe.createElement("defs",null,Xe.createElement("linearGradient",{id:"linear-gradient",x1:462.92,x2:488.57,y1:229.21,y2:135.56,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#2272b9"}),Xe.createElement("stop",{offset:.41,stopColor:"#2851a5"}),Xe.createElement("stop",{offset:.77,stopColor:"#2c3a97"}),Xe.createElement("stop",{offset:1,stopColor:"#2d3292"})),Xe.createElement("linearGradient",{id:"linear-gradient-2",x1:481.52,x2:525.09,y1:133.62,y2:187.49,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#f79b5e"}),Xe.createElement("stop",{offset:.29,stopColor:"#faad60"}),Xe.createElement("stop",{offset:.71,stopColor:"#fec162"}),Xe.createElement("stop",{offset:1,stopColor:"#ffc863"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-3",x1:473.21,x2:516.78,y1:140.34,y2:194.21}),Xe.createElement("linearGradient",{id:"linear-gradient-4",x1:127.14,x2:89.91,y1:154.71,y2:283.04,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#1252c4"}),Xe.createElement("stop",{offset:1,stopColor:"#3f87fe"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-5",x1:500.28,x2:427.3,y1:145.4,y2:111.83}),Xe.createElement("linearGradient",{id:"linear-gradient-6",x1:362.04,x2:449.04,y1:126.58,y2:126.58,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:1,stopColor:"#2272b9"}),Xe.createElement("stop",{offset:1,stopColor:"#2851a5"}),Xe.createElement("stop",{offset:1,stopColor:"#2c3a97"}),Xe.createElement("stop",{offset:1,stopColor:"#2d3292"})),Xe.createElement("linearGradient",{id:"linear-gradient-7",x1:101.11,x2:214.99,y1:124.89,y2:124.89,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#f67447"}),Xe.createElement("stop",{offset:1,stopColor:"#f69159"})),Xe.createElement("linearGradient",{id:"linear-gradient-8",x1:524.73,x2:403.32,y1:143.99,y2:164.49,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:.05,stopColor:"#fad05a"}),Xe.createElement("stop",{offset:.33,stopColor:"#fac85a"}),Xe.createElement("stop",{offset:.77,stopColor:"#f9b159"}),Xe.createElement("stop",{offset:1,stopColor:"#f8a359"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-9",x1:362.04,x2:473.5,y1:249.06,y2:249.06}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-10",x1:210.97,x2:372.06,y1:186.7,y2:186.7}),Xe.createElement("linearGradient",{id:"linear-gradient-11",x1:213.32,x2:365.43,y1:214.07,y2:214.07,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#3159a7"}),Xe.createElement("stop",{offset:1,stopColor:"#557ebe"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-12",x1:213.15,x2:368.92,y1:371.84,y2:371.84}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-13",x1:182.86,x2:450.49,y1:376.4,y2:305.43}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-14",x1:210.49,x2:371.58,y1:97.29,y2:97.29}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-15",x1:327.03,x2:383.92,y1:387.06,y2:387.06}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-16",x1:231.54,x2:160.32,y1:212.58,y2:244.07}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-17",x1:288.92,x2:393.41,y1:165.36,y2:111.78}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-18",x1:315.24,x2:372.74,y1:228.98,y2:228.98}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-19",x1:306.93,x2:391.42,y1:317.46,y2:296.99}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-20",x1:217.15,x2:297.13,y1:333.24,y2:273.93}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-21",x1:297.44,x2:215.19,y1:477.89,y2:454.95}),Xe.createElement("style",null,".cls-1{fill:#fff}.cls-2{fill:#cccbcb}.cls-4,.cls-7{fill:#231f20}.cls-7{fill-rule:evenodd}.cls-10{fill:#1251c3}.cls-13{fill:#c6583e}.cls-18{fill:#413b8a}.cls-21{fill:#ddd}.cls-27{fill:#d17e2c}.cls-28{fill:#232059}.cls-29{fill:#373075}.cls-31{fill:#094082}.cls-33{fill:#1e4380}.cls-39{fill:#1e194f}.cls-41{fill:#cf7961}.cls-42{fill:#f79f81}.cls-45{fill:#373175}.cls-48{fill:#fda181}.cls-49{fill:#d17a62}.cls-50{fill:none;stroke:#e6e7e8;stroke-linecap:round;stroke-miterlimit:10;stroke-width:.48px}.cls-51{fill:#403882}"))),Xe.createElement("g",{id:"Layer_2","data-name":"Layer 2"},Xe.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=Xe.createElement("path",{d:"M0 0h600v600H0z",className:"cls-1"})),c||(c=Xe.createElement("g",{id:"shadow"},Xe.createElement("path",{d:"M322 516.69s75.69-1.49 75.93 8.06-78.27 10.5-95.3 11.15-84.32-2.08-95.52 4-112.56 5.89-103.52-4 64.41-1.42 79.87-5.83S278.79 516 322 516.69M469 482.36s43.83 3.3 34.83 9.9-52.58 7.72-71 9.41-114.53-.56-127.85 0-247.17 4.24-225.49-6 40.72-11.13 85.89-12.2S469 482.36 469 482.36",className:"cls-2"}))),Xe.createElement("g",{id:"plant"},Xe.createElement("path",{d:"M472.45 480.58c1.28.57 47.56-58.63 32.08-62.51s-16.41-9.92-8.38-20.69-6.77-12.78-14-7.71 7.75-18.23.33-20.88-14 7-12.65 20.84-10-2.37-12.31 5.33 13.93 24.05 3.4 24.17-18 1.67-11.61 17.23 23.14 44.22 23.14 44.22",style:{fill:"url(#linear-gradient)"}}),s||(s=Xe.createElement("path",{d:"M491.47 427.08a.28.28 0 0 0-.38-.09 62.2 62.2 0 0 0-18.57 20.57c.05-10 .23-21 .65-31.23A67 67 0 0 1 486 398.9a.27.27 0 0 0 0-.39.29.29 0 0 0-.33 0A68.2 68.2 0 0 0 473.22 415c.62-14.18 1.72-26.57 3.62-32a.27.27 0 0 0-.16-.35.26.26 0 0 0-.34.16c-1.47 4.23-2.47 12.59-3.13 22.72a31 31 0 0 0-10.25-7 .28.28 0 0 0-.36.15.28.28 0 0 0 .14.36 30.1 30.1 0 0 1 10.41 7.29c-.2 3.15-.37 6.46-.51 9.87a.5.5 0 0 0 0 .18c-.28 6.83-.45 14-.55 21.05-1.63-2.42-7.27-10-15-12a.28.28 0 0 0-.32.23.3.3 0 0 0 .18.31c8.72 2.27 14.73 11.76 15.17 12.46-.05 3.47-.08 6.89-.1 10.18a.3.3 0 0 0 0 .14c-.08 17.49.2 31.53.21 31.87a.29.29 0 0 0 .28.27.28.28 0 0 0 .27-.28c0-.34-.29-14.39-.21-31.88a61.64 61.64 0 0 1 18.87-21.25.26.26 0 0 0 .13-.34.24.24 0 0 0-.1-.06",className:"cls-4"})),Xe.createElement("path",{d:"m468.88 484.69-.62-.62c-.07.49.16.68.62.62",style:{fill:"url(#linear-gradient-2)"}}),Xe.createElement("path",{d:"M531.7 388.47c-4.61-16.53-20-7.24-26.41 7-1.94 4.3-4.62 12.36-7.77 21.91-7.3 22.11-17.12 52.25-26.15 62.36-2 2.19-2.91 3.59-3.07 4.32l.62.62a11.5 11.5 0 0 0 3.63-1.64c11.2-6.66 26.92-23.74 39.43-42.16 13.31-19.57 23.02-40.68 19.72-52.41",style:{fill:"url(#linear-gradient-3)"}}),n||(n=Xe.createElement("path",{d:"M468.29 484.11c-.15.74.55.77 1.87.21 35-30.23 53-97.15 53-97.36a.69.69 0 1 0-1.33-.37c-.05.22-18.3 68.1-53.54 97.52",className:"cls-7"})),Xe.createElement("path",{d:"M549.61 438.69c-8.43-2.54-23.34 3.46-37.83 12.36-15.85 9.74-31.19 22.95-37 32.26-2.23 3.58-1.9 4.8 2.56 1 11.52-9.86 55.11-20.3 66.35-25.1a26.3 26.3 0 0 0 3.79-2c8.94-5.52 13.45-15.12 2.13-18.52",style:{fill:"#598ac7"}}),i||(i=Xe.createElement("path",{d:"M473.88 486.61c-.58.11-.59-.44-.13-1.46 24.18-26.8 76.73-39.74 76.89-39.79a.54.54 0 0 1 .66.4.53.53 0 0 1-.39.65c-.16.04-53.42 13.17-77.03 40.2",className:"cls-7"}))),Xe.createElement("g",{id:"tree"},Xe.createElement("path",{d:"M89 407.43C112 406 138.37 380 131.39 364s-8.57-26.67-1.51-37.51c6.41-9.83-17.52-51.5-8.44-67.46-3.39-3.21-8.08-5-12.42-3.53-5.49 1.87-8.22 7.93-10 13.48a129 129 0 0 0-4.28 18.72c-.93 6.05-1.58 12.55-5.49 17.25C85 310.1 77.72 311.86 73 316.58a17.82 17.82 0 0 0-5 15.34c.82 4.87 3.62 9.12 5.62 13.63s3.16 9.95.7 14.22c-2.16 3.77-6.53 5.63-9.56 8.75-3.86 4-5.3 9.91-4.61 15.42s3.31 10.61 6.62 15.07a52 52 0 0 0 5.74 6.5A46.4 46.4 0 0 0 89 407.43",style:{fill:"url(#linear-gradient-4)"}}),m||(m=Xe.createElement("path",{d:"M111.59 430.69c4.89-10.57 22.52-17.92 29.35-23.75 7.19-6.16 13.78-14.42 15.16-24.06 1.54-10.8-4.36-16.57-9.33-25.05-8.22-14.05 8.41-27.83 2.77-41.93-2.9-7.26-11.44-10.51-16-16.84-3.68-5.07-4.5-11.61-5-17.85s-.89-12.73-3.92-18.2a16.8 16.8 0 0 0-3.13-4c-9.08 16 14.85 57.63 8.44 67.46-7.06 10.84-5.47 21.47 1.51 37.51S112 406 89 407.42a46.4 46.4 0 0 1-16.44-1.92 52 52 0 0 0 11 8.05c9.69 5.33 21.76 7.99 28.03 17.14",className:"cls-10"})),d||(d=Xe.createElement("path",{d:"m134.9 370.19-.46-.43-22.54 24.56v-59.6l14.7-18.62-.49-.39-14.21 18.01V273.7h-.62v31.48l-10.01-14.56-.51.35 10.52 15.31v48.14l-26.57-26.8-.44.44 27.01 27.25v57.52L77.1 378.78l-.44.44 34.62 34.49v62.9h.62v-81.37z",className:"cls-4"}))),Xe.createElement("g",{id:"back_boxes","data-name":"back boxes"},Xe.createElement("rect",{width:40.41,height:33.11,x:444.03,y:456.62,rx:4.15,style:{fill:"url(#linear-gradient-5)"}}),Xe.createElement("rect",{width:87,height:37.04,x:362.04,y:456.9,rx:4.59,style:{fill:"url(#linear-gradient-6)"}}),o||(o=Xe.createElement("path",{d:"M215 446.92h-84.3a4.2 4.2 0 0 0-1.8.42l-24.82 12.23 110.92-1Z",className:"cls-13"})),Xe.createElement("rect",{width:113.88,height:37.04,x:101.11,y:458.59,rx:6.75,style:{fill:"url(#linear-gradient-7)"}}),Xe.createElement("rect",{width:113.94,height:33.87,x:362.04,y:423.22,rx:5.82,style:{fill:"url(#linear-gradient-8)"}}),Xe.createElement("path",{d:"M447.35 348.19h-85.31v9.17l111.46.33z",style:{fill:"url(#linear-gradient-9)"}}),Xe.createElement("rect",{width:113.94,height:34.99,x:362.04,y:357.36,rx:3.36,style:{fill:"#2e89ff"}}),h||(h=Xe.createElement("rect",{width:101.59,height:30.95,x:362.04,y:392.27,className:"cls-18",rx:2.32}))),Xe.createElement("g",{id:"front_boxes","data-name":"front boxes"},Xe.createElement("path",{d:"M351.22 146.3H225.65l-14.19 9.53 155.88.08-12.75-8.58a6 6 0 0 0-3.37-1.03",style:{fill:"#cb8b3c"}}),Xe.createElement("rect",{width:161.09,height:41.5,x:208.81,y:154.69,rx:5.87,style:{fill:"#ffb953"}}),p||(p=Xe.createElement("ellipse",{cx:364.37,cy:189.93,className:"cls-21",rx:1.29,ry:1.23})),f||(f=Xe.createElement("ellipse",{cx:363.94,cy:160.7,className:"cls-21",rx:1.29,ry:1.23})),E||(E=Xe.createElement("ellipse",{cx:215.44,cy:190.19,className:"cls-21",rx:1.29,ry:1.23})),g||(g=Xe.createElement("ellipse",{cx:215.01,cy:160.96,className:"cls-21",rx:1.29,ry:1.23})),Xe.createElement("rect",{width:161.09,height:44.7,x:210.97,y:392.95,rx:8.59,style:{fill:"url(#linear-gradient-10)"}}),Xe.createElement("path",{d:"M355.22 380.71H227.81l-14.49 14.43 152.11-2.19z",style:{fill:"url(#linear-gradient-11)"}}),x||(x=Xe.createElement("circle",{cx:217.04,cy:399.35,r:1.29,className:"cls-21"})),y||(y=Xe.createElement("circle",{cx:217.04,cy:431.37,r:1.29,className:"cls-21"})),u||(u=Xe.createElement("circle",{cx:365.43,cy:399.29,r:1.29,className:"cls-21"})),M||(M=Xe.createElement("circle",{cx:365.43,cy:431.31,r:1.29,className:"cls-21"})),Xe.createElement("path",{d:"M354.74 225.44H227.33l-14.18 9.43h155.77z",style:{fill:"url(#linear-gradient-12)"}}),Xe.createElement("rect",{width:161.09,height:40.9,x:210.49,y:233.84,rx:5.53,style:{fill:"url(#linear-gradient-13)"}}),_||(_=Xe.createElement("ellipse",{cx:217.05,cy:238.81,className:"cls-21",rx:1.29,ry:1.25})),v||(v=Xe.createElement("ellipse",{cx:217.05,cy:269.81,className:"cls-21",rx:1.29,ry:1.25})),N||(N=Xe.createElement("ellipse",{cx:365.45,cy:238.76,className:"cls-21",rx:1.29,ry:1.25})),b||(b=Xe.createElement("ellipse",{cx:365.45,cy:269.76,className:"cls-21",rx:1.29,ry:1.25})),Xe.createElement("rect",{width:161.09,height:44.7,x:210.49,y:482.36,rx:8.59,style:{fill:"url(#linear-gradient-14)"}}),k||(k=Xe.createElement("path",{d:"M354.74 470.12H227.33l-9.93 12.24h147.55z",className:"cls-27"})),j||(j=Xe.createElement("circle",{cx:216.56,cy:488.76,r:1.29,className:"cls-21"})),Z||(Z=Xe.createElement("circle",{cx:216.56,cy:520.78,r:1.29,className:"cls-21"})),w||(w=Xe.createElement("circle",{cx:364.95,cy:488.7,r:1.29,className:"cls-21"})),z||(z=Xe.createElement("circle",{cx:364.95,cy:520.72,r:1.29,className:"cls-21"})),D||(D=Xe.createElement("path",{d:"M354.74 303.63H227.33l-14.88 10.25h157.18z",className:"cls-28"})),G||(G=Xe.createElement("rect",{width:161.09,height:41,x:210.49,y:312.02,className:"cls-29",rx:6.37})),C||(C=Xe.createElement("ellipse",{cx:217.32,cy:317.14,className:"cls-21",rx:1.29,ry:1.25})),H||(H=Xe.createElement("ellipse",{cx:217.32,cy:348.14,className:"cls-21",rx:1.29,ry:1.25})),S||(S=Xe.createElement("ellipse",{cx:365.71,cy:317.08,className:"cls-21",rx:1.29,ry:1.25})),T||(T=Xe.createElement("ellipse",{cx:365.71,cy:348.08,className:"cls-21",rx:1.29,ry:1.25})),U||(U=Xe.createElement("path",{d:"m330.24 232.63-9.87-6.13a6.17 6.17 0 0 1-2.93-5.42v-25h17.77Z",className:"cls-27"})),Xe.createElement("rect",{width:56.89,height:37.8,x:327.03,y:196.04,rx:6.39,style:{fill:"url(#linear-gradient-15)"}}),O||(O=Xe.createElement("ellipse",{cx:379.78,cy:230.23,className:"cls-21",rx:1.29,ry:1.23})),L||(L=Xe.createElement("ellipse",{cx:379.35,cy:201,className:"cls-21",rx:1.29,ry:1.23})),A||(A=Xe.createElement("ellipse",{cx:334.07,cy:230.49,className:"cls-21",rx:1.29,ry:1.23})),q||(q=Xe.createElement("ellipse",{cx:333.64,cy:201.26,className:"cls-21",rx:1.29,ry:1.23})),P||(P=Xe.createElement("path",{d:"m217.38 392.1 12.15-6.65a5.24 5.24 0 0 0 2.75-4.63v-27.9h-18.56Z",className:"cls-31"})),Xe.createElement("rect",{width:50.48,height:40.19,x:169.2,y:352.92,rx:4.52,style:{fill:"url(#linear-gradient-16)"}}),V||(V=Xe.createElement("circle",{cx:214.71,cy:388.77,r:1.29,className:"cls-21"})),F||(F=Xe.createElement("circle",{cx:214.28,cy:358.11,r:1.29,className:"cls-21"})),R||(R=Xe.createElement("circle",{cx:174.33,cy:388.48,r:1.29,className:"cls-21"})),B||(B=Xe.createElement("circle",{cx:173.9,cy:357.82,r:1.29,className:"cls-21"})),W||(W=Xe.createElement("path",{d:"m296.6 480.85-11.15-9.31a4.77 4.77 0 0 1-2-3.88v-30h21.09Z",className:"cls-33"})),Xe.createElement("rect",{width:80.96,height:44.7,x:293.99,y:437.65,rx:7.13,style:{fill:"url(#linear-gradient-17)"}}),I||(I=Xe.createElement("circle",{cx:368.54,cy:475.06,r:1.29,className:"cls-21"})),Y||(Y=Xe.createElement("circle",{cx:368.11,cy:444.4,r:1.29,className:"cls-21"})),X||(X=Xe.createElement("circle",{cx:301.92,cy:475.34,r:1.29,className:"cls-21"})),Q||(Q=Xe.createElement("circle",{cx:301.49,cy:444.68,r:1.29,className:"cls-21"})),Xe.createElement("path",{d:"m264.71 480.85 13.29-9.68a3.46 3.46 0 0 0 1.44-2.83v-30.65h-18.77Z",style:{fill:"#201851"}}),J||(J=Xe.createElement("rect",{width:59.71,height:44.7,x:207.12,y:437.66,className:"cls-18",rx:5.77})),$||($=Xe.createElement("circle",{cx:260.04,cy:475.2,r:1.29,className:"cls-21"})),K||(K=Xe.createElement("circle",{cx:259.61,cy:444.54,r:1.29,className:"cls-21"})),ee||(ee=Xe.createElement("circle",{cx:214.34,cy:475.47,r:1.29,className:"cls-21"})),ae||(ae=Xe.createElement("circle",{cx:213.91,cy:444.81,r:1.29,className:"cls-21"})),te||(te=Xe.createElement("path",{d:"m316.72 391.69-10.58-5.84a6.77 6.77 0 0 1-3.5-5.93v-27h18.1Z",className:"cls-27"})),Xe.createElement("rect",{width:57.5,height:40.19,x:315.24,y:352.92,rx:3.47,style:{fill:"url(#linear-gradient-18)"}}),le||(le=Xe.createElement("circle",{cx:366.99,cy:388.21,r:1.29,className:"cls-21"})),re||(re=Xe.createElement("circle",{cx:366.56,cy:357.55,r:1.29,className:"cls-21"})),ce||(ce=Xe.createElement("circle",{cx:321.29,cy:388.48,r:1.29,className:"cls-21"})),se||(se=Xe.createElement("circle",{cx:320.86,cy:357.82,r:1.29,className:"cls-21"})),ne||(ne=Xe.createElement("path",{d:"m317.17 311.41-8.75-6.28a6.63 6.63 0 0 1-2.82-5.57v-25.08h17.86Z",className:"cls-13"})),Xe.createElement("rect",{width:56.34,height:37.8,x:315.24,y:274.48,rx:3.02,style:{fill:"url(#linear-gradient-19)"}}),ie||(ie=Xe.createElement("ellipse",{cx:367.04,cy:308.03,className:"cls-21",rx:1.29,ry:1.23})),me||(me=Xe.createElement("ellipse",{cx:366.61,cy:278.8,className:"cls-21",rx:1.29,ry:1.23})),de||(de=Xe.createElement("ellipse",{cx:321.34,cy:308.29,className:"cls-21",rx:1.29,ry:1.23})),oe||(oe=Xe.createElement("ellipse",{cx:320.91,cy:279.06,className:"cls-21",rx:1.29,ry:1.23})),he||(he=Xe.createElement("path",{d:"M288.88 310.58s8.2-7.95 8.2-11.23v-24.87h-16.2Z",className:"cls-27"})),Xe.createElement("rect",{width:79.71,height:37.8,x:210.49,y:274.48,rx:3.87,style:{fill:"url(#linear-gradient-20)"}}),pe||(pe=Xe.createElement("ellipse",{cx:284.49,cy:307.3,className:"cls-21",rx:1.29,ry:1.2})),fe||(fe=Xe.createElement("ellipse",{cx:284.06,cy:278.69,className:"cls-21",rx:1.29,ry:1.2})),Ee||(Ee=Xe.createElement("ellipse",{cx:216.03,cy:307.55,className:"cls-21",rx:1.29,ry:1.2})),ge||(ge=Xe.createElement("ellipse",{cx:215.6,cy:278.95,className:"cls-21",rx:1.29,ry:1.2})),xe||(xe=Xe.createElement("path",{d:"m287.78 232.5 10.44-6.28a4.81 4.81 0 0 0 2.32-4.2V196H283.7Z",className:"cls-39"})),ye||(ye=Xe.createElement("rect",{width:82.23,height:37.8,x:207.12,y:196.04,className:"cls-29",rx:4.53})),ue||(ue=Xe.createElement("ellipse",{cx:283.92,cy:229.42,className:"cls-21",rx:1.29,ry:1.23})),Me||(Me=Xe.createElement("ellipse",{cx:283.49,cy:200.2,className:"cls-21",rx:1.29,ry:1.23})),_e||(_e=Xe.createElement("ellipse",{cx:212.86,cy:229.69,className:"cls-21",rx:1.29,ry:1.23})),ve||(ve=Xe.createElement("ellipse",{cx:212.43,cy:200.46,className:"cls-21",rx:1.29,ry:1.23}))),Xe.createElement("g",{id:"man_1","data-name":"man 1"},Xe.createElement("path",{d:"M153.8 356.29a27 27 0 0 0 1.83 17.71c4.35 9.12 13.61 12.49 13.61 12.49s.7 9-2 12.07a24.2 24.2 0 0 1-4.63-5c-2.73-3.84-12-10.16-12.73-18.3s3.92-18.97 3.92-18.97",style:{fill:"#303030",opacity:.17,isolation:"isolate"}}),Ne||(Ne=Xe.createElement("path",{d:"M169.32 333.45s1 5.31.37 6.81c-.44 1.14-2.67 2.78-3.72 3.51 2.66 2.62 6.8 6.5 6.76 5.18-.06-1.93 3.32-8.06 3.32-8.06s-4.32-2.38-5.26-4.38-1.47-3.06-1.47-3.06",className:"cls-41"})),be||(be=Xe.createElement("path",{d:"M186.36 318.37s-8.25.19-11.82.75-5.62 7.26-5.62 7.26-1.38-2.94-3.69-.19 2.44 5.08 2.44 5.08c.56 3-3.88 10.31-3.88 10.31s.92.95 2.18 2.19c1-.73 3.28-2.37 3.72-3.51.59-1.5-.37-6.81-.37-6.81s.53 1.06 1.47 3.06 5.35 4.61 5.35 4.61 3.34 1.71 6.1 1.36 3.36-1.78 3.36-1.78c3.68-5.51.76-22.33.76-22.33",className:"cls-42"})),ke||(ke=Xe.createElement("path",{d:"M174.54 319.12c3.57-.56 11.82-.75 11.82-.75-21.59-5.75-17.44 8-17.44 8s2.08-6.68 5.62-7.25",className:"cls-41"})),Xe.createElement("path",{d:"M164 319.45c1.6-1.17 1.92-1 4-.61s3.84-1.92 5.39-.47 5.4 3.19 8.4 2.68 4.22 1 6.3-1.87a5.5 5.5 0 0 0 0-.81s4.25-2.31 1.75-6.09a1.81 1.81 0 0 1-1.75 0c-1.12-.47-3.81-4.79-10.32-4.1s-9.94 3.57-9.94 3.57-3.19-1.13-4 1.56c-.52 1.72-2.8 2.77-4 4a4.2 4.2 0 0 0 .59 1.52c.99 1.47 1.98 1.8 3.58.62",style:{fill:"#403982"}}),Xe.createElement("path",{d:"M159.1 319.75c1.25 2.69.37 6.57 2.31 7.38s.67 7.31 5.56 8a9.15 9.15 0 0 0 .77-4.16s-3.54-1.36-3-3.61 3-3 4.2-1l.28 1.5s3-2.79 2.34-4.8a2.76 2.76 0 0 1 1.19-3.1s2.69 3.37 6 1.69c0 0 9 2.69 9.34-2.49-2.08 2.87-3.3 1.35-6.3 1.87s-6.85-1.22-8.4-2.68-3.33.9-5.39.47-2.39-.56-4 .61-2.58.85-3.66-.61a4.2 4.2 0 0 1-.59-1.52 2 2 0 0 0-.65 2.45",style:{fill:"#1f1a4e"}}),je||(je=Xe.createElement("path",{d:"M218.49 383.29c1.32-1.18 2.35-.66 3.14-3.15a22 22 0 0 1 1.17-2.92c-.53-.19-2.72 1.35-3.12 1.41a33 33 0 0 1-3.24-.41c1.07-.44 1.91-2.44 2.22-3s-.59-2.41-.87-2.2-2.38 2.61-3.19 3.33-6 .28-6 .28c-.8 0-1 1.85-1.09 3.51a31 31 0 0 0 4.74 1.74c2.35.56 4.93 2.58 6.24 1.41",className:"cls-42"})),Ze||(Ze=Xe.createElement("path",{d:"M207.56 382.82s3.26 1.22 4.82 1.75a50.5 50.5 0 0 0 7.3 1.38c.43-.07 3-3.19 3.58-4.29s-.06-3.91-.37-4.38a.15.15 0 0 0-.09-.06 22 22 0 0 0-1.17 2.92c-.79 2.49-1.82 2-3.14 3.15s-3.89-.85-6.24-1.41a31 31 0 0 1-4.74-1.74c-.04 1.4.05 2.68.05 2.68",className:"cls-41"})),we||(we=Xe.createElement("path",{d:"M132.66 514.05s-2.3 8.21-3.14 8.49 8.91 3.71 8.91 3.71 2.21-7.8 3-9.76-8.77-2.44-8.77-2.44M169.24 525.52l-.46-10.39-6.15 1.56c1.54.65 2.69 1.24 2.69 1.24l-1.14 8.67c1.82.14 3.95-.08 5.06-1.08",className:"cls-42"})),ze||(ze=Xe.createElement("path",{d:"m162.63 516.69-2.77.72s.82 7.57.61 8.21c-.11.33 1.66.85 3.71 1l1.14-8.67s-1.15-.59-2.69-1.26",className:"cls-41"})),De||(De=Xe.createElement("path",{d:"M160.4 531.77s-2.27 2.11-2.47 3.58-.83 3.37 1 4.42 6.81 1.9 8.87.85 1.86-3.37 3.1-2.11.41 2.74 2.48 2.74 14.65 1.47 17.33-.63 1.49-5.71.66-6.55-14.9-1.24-14.9-1.24l-8.25-2.74Z",className:"cls-1"})),Ge||(Ge=Xe.createElement("path",{d:"M190.08 532.89c-1.69 0-5.9.63-10.11-2.11s-7.48-7.23-10.85-7.87l-4.53.6s-.89.8 0 4-3.3 5.19 2.14 5.38 6 1.83 7.5 3c1 .73 5.82 2 9.24 2.83 2.13.08 4.13.1 5.55 0 4.42-.15 2.74-5.83 1.06-5.83",className:"cls-45"})),Ce||(Ce=Xe.createElement("path",{d:"M166.73 532.94c-5.44-.19-1.25-2.13-2.14-5.38s0-4 0-4l-4.12.54a27.1 27.1 0 0 0-1.76 7.15 52 52 0 0 0 0 6.11s6.74 1.68 8.84.63 1.69-2.32 2.74-2.32.21 1.9 2.32 2.32a104 104 0 0 0 10.86.81c-3.42-.83-8.28-2.1-9.24-2.83-1.5-1.2-2.06-2.85-7.5-3.03",className:"cls-39"})),He||(He=Xe.createElement("path",{d:"M125.6 524.77s-2.32 2.73-3.58 4.42 3.79 5 5.68 5.47a10.6 10.6 0 0 0 3.37.21 3.71 3.71 0 0 0 1.69 3c1.68 1 16.49 5.89 19.22 5.26s1.68-4.61 1.68-4.61l-9.78-5.33-7.16-5.69Z",className:"cls-1"})),Se||(Se=Xe.createElement("path",{d:"M143.88 533.19c-2.12-2.16-5-3.76-8.41-5.44-1.79-.89-1.46-3-.74-4.7a11.8 11.8 0 0 1-3.73-3.85s-4.77 1.41-5.61 3.93-2.53 4.21-1.41 5.9a6.62 6.62 0 0 0 5.06 3.08c2 0 2.8-3.36 4.2-.84s-.56 3.37 1.69 4.77 9 4.21 12.91 4.49 5.05.85 5.61 0a1.6 1.6 0 0 0 .23-.64c-.96-1.59-7.8-4.65-9.8-6.7",className:"cls-45"})),Te||(Te=Xe.createElement("path",{d:"M152.12 536.6c-1.69-.56-7.3-4.21-9-8.13a25.4 25.4 0 0 0-3.65-6.18 3.46 3.46 0 0 1-3.93 1.12 4.4 4.4 0 0 1-.8-.36c-.72 1.75-1 3.81.74 4.7 3.4 1.68 6.29 3.28 8.41 5.44s8.81 5.11 9.84 6.7c.15-1.09-.25-2.83-1.61-3.29",className:"cls-39"})),Xe.createElement("path",{d:"M172.88 451c0-7.86-7.86-43.5-9.83-48s-29.46-6.18-29.46-6.18a46.6 46.6 0 0 0-4.49 23.3c1.12 12.63 17.67 41.2 18.23 42.88s-3.19 8.82-3.75 11.07-12.24 40.34-11.4 41.75a13.85 13.85 0 0 0 8.42 3.36s14.33-26.17 15.74-31c0 0 9.88-20.23 9.1-26.6s-5.66-39.53-6.66-42.53a82 82 0 0 1-2-8.63s9.51 25 10.51 28.52 3.89 35.89 2 41.77-4 22-3.2 25.52c.64 3-.71 11.75-1.13 14.34a9.25 9.25 0 0 0 4.33-1.47s1.12-28.31 2.8-42.62.79-17.61.79-25.48",style:{fill:"#3258a7"}}),Ue||(Ue=Xe.createElement("path",{d:"M166 506.3c-.75-3.51 1.25-19.64 3.2-25.52s-1-38.27-2-41.77-10.46-28.52-10.46-28.52a82 82 0 0 0 2 8.63c1 3 5.87 36.15 6.66 42.53s-9.1 26.6-9.1 26.6l3.35 31.8a13.4 13.4 0 0 0 5.19.64c.49-2.64 1.84-11.42 1.16-14.39",className:"cls-33"})),Xe.createElement("path",{d:"M209.25 376.16s-16.32-3.6-21.57-5.76a91 91 0 0 0-12.89-3.71c-2.39-1.17 1.65-15.37 1.72-16.94s-5.06-4.79-5.06-4.79l-.44-.59c-4.85-4.08-8.25-3.16-12.11-3s-9.24 6.36-11.65 10.69-18.8 47-19.92 52.59c-.51 2.57.4 3.78 4.21 5.52 1.4-2.49 3.26-5.16 5.3-6.39 4.31-2.63 15.75-13.89 9.94-20.23s7.6-31.49 7.6-31.49.84 4.35.37 6.41 3.38 12.85 5.44 15.29 8.82 5.16 8.82 5.16l4.47 1.69c4.48 1.69 34.46 2.94 34.46 2.94 1.59-.75 1.31-7.39 1.31-7.39",style:{fill:"#ffc861"}}),Oe||(Oe=Xe.createElement("path",{d:"M160.19 373.69c-2.06-2.44-5.91-13.23-5.44-15.29s-.37-6.41-.37-6.41-13.42 25.15-7.6 31.49-5.63 17.6-9.94 20.23c-2 1.23-3.9 3.9-5.3 6.39a55 55 0 0 0 14.61 3.9c7.32.85 19.37-2.38 22-3.16s2.06-19.7.84-22.36 0-9.63 0-9.63-6.73-2.69-8.8-5.16",className:"cls-27"}))),Le||(Le=Xe.createElement("g",{id:"man_2","data-name":"man 2"},Xe.createElement("path",{d:"M398.88 334.92c1.14-1.37 3.06-1.27 4.66-.84l.63 7.83a47 47 0 0 1-5-.6ZM434.17 334.89l.57 8.5a17.7 17.7 0 0 1-3.14-.41l-.81-5.61c.09-1.92 1.66-2.46 3.38-2.48",className:"cls-48"}),Xe.createElement("path",{d:"m406.31 335.21-.5 6.46c-.17.21-.83.27-1.67.24l-.63-7.83a13 13 0 0 1 2.8 1.13M438.48 335.59v6.92a5.8 5.8 0 0 1-3.74.88l-.57-8.5a15.7 15.7 0 0 1 4.31.7",className:"cls-49"}),Xe.createElement("path",{d:"M431.52 342.41a10.3 10.3 0 0 0 3.17.28s.62 2.92 2.24 3.84 4.09 4 3.85 7.07a11 11 0 0 1-6 1.3c-4.73-.12-5-1.09-5-1.09-.42-3.12 1.74-11.4 1.74-11.4",className:"cls-29"}),Xe.createElement("path",{d:"M436.93 346.53c-1.62-.92-2.23-3.83-2.24-3.84 1.87 0 3.79-.18 3.79-.18a26.7 26.7 0 0 1 3.37 9.87c0 .29-.34.76-1.07 1.22.22-3.04-2.35-6.2-3.85-7.07",className:"cls-28"}),Xe.createElement("path",{d:"M438.27 347.69s-4.2-1.05-5.5.12M438.48 348.82s-3.92-.59-5.45.77M433 350.75s4.07-1.47 5.45-.38",className:"cls-50"}),Xe.createElement("path",{d:"M404.14 346.75c-1.24 1.52-2.86 3.81-5.29 5s-12.16 2.55-12.16 2.55c-.28-.15 0-1.74 0-1.74.19-2.91 7.86-5.15 9.34-6.1s3.13-5.11 3.13-5.11a24 24 0 0 0 5 .29s1.22 3.58-.02 5.11",className:"cls-29"}),Xe.createElement("path",{d:"M406.81 345c.81 1.81.52 5.72 0 7.44s-6.87 1.53-9.06 1.79a102 102 0 0 1-11.06 0s9.72-1.41 12.16-2.55 4-3.44 5.29-5 0-5.15 0-5.15a5.8 5.8 0 0 0 1.71-.29 13.6 13.6 0 0 0 .96 3.76",className:"cls-28"}),Xe.createElement("path",{d:"M399.51 347.78a4.62 4.62 0 0 0-3.14-1.63M397.94 348.82s-.67-1.31-3.55-1.63M395.63 349.59s-.1-1.14-3.17-1.58",className:"cls-50"}),Xe.createElement("path",{d:"M433.59 215.17c2.23 7 1.4 42.43.29 50.9s3.36 22.66 4.6 29.76 0 39.76 0 39.76c-.54 1.51-2.42 2-4.19 2s-1.4-29.35-.7-45.23-5.56-8.87-5.13-18.31-3.72-33.18-6.3-40.19-15.45-5.29-20.74-6.26-9.66-8.5-9.66-8.5 16.34-7.13 25.36-10.93 14.24.02 16.47 7",className:"cls-31"}),Xe.createElement("path",{d:"M401.42 227.63c5.29 1 18.17-.75 20.74 6.26s6.72 30.75 6.3 40.19 5.83 2.43 5.13 18.31.7 45.23.7 45.23a18 18 0 0 1-3.5-.25s-8.13-42.44-9.25-46.74-7.66-38.48-7.66-38.48.48-8.58-1.71-10.78-5-8.58-5-8.58-4.48 24.91-2 32.24-1.71 21.05-2.67 26.3c-.9 5 .87 41.07 1 44.62a23 23 0 0 1-4.75-1s-3.15-56.52-4.68-63-2.41-52.78-2.41-52.78 4.47 7.52 9.76 8.46",className:"cls-10"}),Xe.createElement("path",{d:"M402.56 291.33c1-5.25 5.15-19 2.67-26.3s2-32.24 2-32.24 2.76 6.39 5 8.58 1.65 10.78 1.65 10.78-2.85 21.06-3.87 27 .13 11 1.2 15.4-5 40.81-5 40.81a3.57 3.57 0 0 1-2.68.55c-.1-3.51-1.87-39.58-.97-44.58",className:"cls-31"}),Xe.createElement("path",{d:"m430.68 187.91-3.61-19.77s-3.14 20.5-4.1 24-6.1 10-7 11-31.24 18.47-31.24 18.47l5.94-3.38-.14 2.22s12.94 4.58 17.66 4.22S427.8 220 427.8 220s1-7.49 1-7.13 2.05 6.22 2.05 6.22 3-.65 3.89-1.64c-.06-.01-2.74-19.25-4.06-29.54",className:"cls-39"}),Xe.createElement("path",{d:"M411.88 190.9c.93-1.79 1.5-17 1.5-17s-7.86 6.08-8.86 12.37-12.74 21.53-12.74 21.53 19.15-15.11 20.1-16.9M385.52 165s-1.36 20.09-1.27 25c0 1.29-1.55 3.49-3.9 6l-.52.71a9.12 9.12 0 0 1 4 5.25l2.9-3.71a3.2 3.2 0 0 0 .43-.74l3-8.22s-4.65-21-4.64-24.29",className:"cls-39"}),Xe.createElement("path",{d:"M430.12 182.92c-.57-6.49-2.95-27.23-6.39-29.87s-16.84-5-16.84-5l-12.34 2.43s-9.78 3.73-10.22 6.1-5.16 33.67-5.87 35.1c-.19.38-1.51 2.08-3.34 4.35h.45a12.1 12.1 0 0 1 4.26.71l1-1.27c2.06-2.31 3.42-4.29 3.39-5.48-.09-4.94 1.27-25 1.27-25 0 3.32 4.6 24.36 4.6 24.36a97 97 0 0 1 2.36 12.74c.29 4.48-.72 5.71-.72 5.71s11.73-15.23 12.74-21.53 8.86-12.37 8.86-12.37-.57 15.23-1.5 17-20.1 16.88-20.1 16.88l-10.06 8.66s.91 5.39 3 5.16c0 0 30.28-17.51 31.24-18.47s6.1-7.44 7-11 4.1-24 4.1-24l3.61 19.77c-.2-2.12-.4-3.9-.5-4.98",className:"cls-51"}),Xe.createElement("path",{d:"M398.7 132.14s-.09-2.67 1.34-2.77c4.95-.33 1.71 5.67 1.71 5.67s2.31 11 5.14 13c0 0-1.46 4.83-5 6.88 0 0-4.57-2-4.57-4.27s2.07-7.58 2.07-7.58c-1.21 2.11-5.9 3.86-5.9 3.86a5.26 5.26 0 0 1-3.14.21c-3.72-1.21-8.39-18.41-8.39-18.41 14.04-8.73 16.74 3.41 16.74 3.41",className:"cls-48"}),Xe.createElement("path",{d:"M397.63 155.79c-3.43-.43-3.08-5.3-3.08-5.3l-1.07-3.49s4.69-1.75 5.9-3.86c0 0-2.07 5.29-2.07 7.58s4.56 4.27 4.57 4.27a6.7 6.7 0 0 1-4.25.8M393.48 147",className:"cls-49"}),Xe.createElement("path",{d:"M380.11 118.93c2.95-.62 12-5.93 14.67-6.14a12.5 12.5 0 0 1 2.21.07c2.48 1.3 5.21 3.36 4.22 5.88-1.72 4.36-3.73 6.36-3.76 7.86s1.59 6.68 1.59 6.68l-1.36-.59-.93-2.24-4.68-4.06s-5.07 3.61-10.15 2.34-6.48-6.48-6.48-6.48a8.15 8.15 0 0 1 4.67-3.32",className:"cls-51"}),Xe.createElement("path",{d:"M401.21 118.74c1-2.52-1.74-4.58-4.22-5.88 3.35.39 8.33 2.07 9 7 .86 6.2-1.77 18.31-1.86 19.36s-.42 3-.42 3-2.16-5.48-2-7.15c0 0 2.19-3.78-.57-5.1s-2.48 2.2-2.48 2.2l.34 1.14s-1.63-5.17-1.59-6.68 2.08-3.53 3.8-7.89",className:"cls-39"}),Xe.createElement("path",{d:"M382.29 222.27c-1.83 1.14-4.08 2.25-4.51 3.29s-6.66 3.82-11.41 3.36a8.2 8.2 0 0 1 .4-2.6c0-.44 2-.84 3.64-1.64a24 24 0 0 0 4.4-3.63c.22-.22-2.2-.07-2.92-.54s-1.9-1.43-1.33-2.11 4.08 0 7.15-.19 4-1.77 4-1.77c1.87-.14 2.69 2.83 3 4.29Z",className:"cls-48"}),Xe.createElement("path",{d:"M381.36 225.06c-.68 1.4-6 5-7.34 5.6s-6.29.15-7.25-.88a1.7 1.7 0 0 1-.4-.86c4.75.46 11-2.33 11.41-3.36s2.68-2.15 4.51-3.29 2.39-1.58 2.39-1.58c.1.48.14.79.14.79s-2.82 2.21-3.46 3.58",className:"cls-49"}))),Xe.createElement("g",{id:"lady"},Ae||(Ae=Xe.createElement("path",{d:"M235.57 89.22c2.58-1.36 5.48-6.58 6.08-8.56a47 47 0 0 1 2.28-5.37s11.12-4.6 12.57-6.25a53 53 0 0 0 4.16-6.66 8.35 8.35 0 0 1 4.22 4.71c1.48 3.67.23 10.73 2.54 11.13s8.19 3.86 8.19 3.86c1.58-3.76-4.06-5-6.54-5.84s1.68-8.22 3.66-12.38-4.55-6-4.55-6c1.88-3.47-4.06-4-10.6-6s-17.19 1.37-16.7 6.26-1.66 6.3-3.64 9 0 7.86 0 7.86c-1 3.27.45 6.14-4 8.42s-1.13 11.48-1.13 11.48.89-4.3 3.46-5.66",className:"cls-51"})),qe||(qe=Xe.createElement("path",{d:"M264.09 98c9.41-.39 12.28-3.07 15-8.06s-3.53-7.88-3.53-7.88-5.88-3.46-8.19-3.86-1-7.46-2.49-11.13a8.4 8.4 0 0 0-4.19-4.71 53 53 0 0 1-4.16 6.64c-1.45 1.69-12.53 6.29-12.53 6.29a48 48 0 0 0-2.31 5.4c-.6 2-3.5 7.2-6.08 8.56s-3.46 5.63-3.46 5.63 22.53 3.54 31.94 3.12",className:"cls-39"})),Xe.createElement("path",{d:"m283.5 153.69 10.95-6.85a3.81 3.81 0 0 0 1.79-3.24v-26.7h-16.86Z",style:{fill:"#bf4728"}}),Xe.createElement("rect",{width:59.71,height:37.8,x:225.65,y:116.9,rx:8.5,style:{fill:"url(#linear-gradient-21)"}}),Pe||(Pe=Xe.createElement("path",{d:"M299.24 112.38C297 104.06 275.58 89.51 274 89.22s-18-1.77-18-1.77c-10.11.91-16.75 2.11-22.66 6.12s-14.75 15.94-17.13 26.54a26.46 26.46 0 0 0 2.28 18.26c-.13-1.16 3.86-5.29 3.86-5.29-4.26-8 2-16 6.74-19.71s9.8-15.32 9.8-15.32c1.19 1.32-1.07 12.64-1.07 12.64l.2 6.21h12.26s2.73-9.24 11.07-9.24 12.3-12 12.3-12 .28 5.41 2.25 7 14.38 9.51 16.63 14l-19.43 21.73 5.22 5s23.2-22.7 20.92-31.01",className:"cls-10"})),Ve||(Ve=Xe.createElement("path",{d:"M275.88 102.69c-2-1.58-2.25-7-2.25-7s-4 12-12.3 12-11.07 9.24-11.07 9.24h24.29l.59-6.8 10.25 6.34c-2.5 1.88-12.31 21.93-12.31 21.93l19.4-21.71c-2.25-4.54-14.66-12.46-16.6-14M238.88 98.05s-5 11.66-9.8 15.32-11 11.69-6.74 19.71c-1.38-2.87 3.27-12 4.68-13.07s10.75-9.32 10.75-9.32 2.23-11.32 1.11-12.64",className:"cls-31"})),Fe||(Fe=Xe.createElement("g",{id:"head"},Xe.createElement("path",{d:"m248.39 85.17.11 4.65s4.11 5.61 13.14-.82l-.82-6.42Z",className:"cls-48"}),Xe.createElement("path",{d:"m248.39 84.8 12.43-2.22.48 3.73s-5.08 3.1-8.71 2.9-4.14-1.63-4.14-1.63Z",className:"cls-49"}),Xe.createElement("path",{d:"M244.62 66.47s-1.74 10.22.37 15.31 7.47 6.51 9.06 6.23 6.74-1.94 8.32-5.9 2.84-13 2.38-16.83-18.48-10.76-20.13 1.19",className:"cls-48"}),Xe.createElement("path",{d:"M260.62 62.38s-.6 4.62 1.23 5.8 2 8.22 2 8.22 4.51-7 2.54-12.11-5.72-8.71-5.77-1.91",className:"cls-51"}),Xe.createElement("path",{d:"M261.3 63.1a8.55 8.55 0 0 1-8.23 2.25c-5.29-1.19-6.87 11.47-10.7 10.19s.2-17 6.87-18.25 14.64-.6 12.06 5.81",className:"cls-51"}))),Re||(Re=Xe.createElement("path",{d:"M273.05 138.37a30 30 0 0 1-3.51 2.38c-.65.2-5.35 1.19-5.85 1.19s-.64 1.58.7 1.68a29 29 0 0 0 3.22 0s-4.16 3.91-5 4.11.1 2.46.6 2.76 4.41 2 7.62 0 5.08-3.21 7.45-7.17-5.23-4.95-5.23-4.95M222.3 133.08a10.9 10.9 0 0 0 3.77-.3c1.08-.49 2.12-.79 2.42-.45s-1.51 2-2.18 2.28a2.6 2.6 0 0 0-.9.6s.06 1.43 1.15 1.78a39 39 0 0 1 5.15 2.13c-.05.15-.25 3.17-1 3.66a16.6 16.6 0 0 1-7 .79 8.53 8.53 0 0 1-5.55-6.23c-.81-3.72 2.16-5.25 4.14-4.26",className:"cls-48"})),Be||(Be=Xe.createElement("ellipse",{cx:280.44,cy:149.78,className:"cls-21",rx:1.29,ry:1.23})),We||(We=Xe.createElement("ellipse",{cx:280.01,cy:120.55,className:"cls-21",rx:1.29,ry:1.23})),Ie||(Ie=Xe.createElement("ellipse",{cx:230.78,cy:150.04,className:"cls-21",rx:1.29,ry:1.23})),Ye||(Ye=Xe.createElement("ellipse",{cx:230.35,cy:120.81,className:"cls-21",rx:1.29,ry:1.23}))))))}},90803:(e,a,t)=>{"use strict";t.d(a,{A:()=>te});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee=t(30758);function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...te}=e;return ee.createElement("svg",ae({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},te),a?ee.createElement("title",{id:t},a):null,l||(l=ee.createElement("defs",null,ee.createElement("linearGradient",{id:"linear-gradient",x1:179.08,x2:252.06,y1:491.16,y2:408.29,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#f79b5e"}),ee.createElement("stop",{offset:1,stopColor:"#ffc863"})),ee.createElement("linearGradient",{id:"linear-gradient-2",x1:181.04,x2:78.66,y1:465.45,y2:402.61,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#3159a7"}),ee.createElement("stop",{offset:1,stopColor:"#557ebe"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:144.05,x2:144.05,y1:497.56,y2:321.7}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-4",x1:171.48,x2:110.16,y1:484.38,y2:462.59}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-5",x1:96.22,x2:300.71,y1:477.21,y2:477.21}),ee.createElement("linearGradient",{id:"linear-gradient-6",x1:312.33,x2:335.6,y1:222.99,y2:222.99,gradientTransform:"rotate(-14.31 324.066 223.066)",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:.05,stopColor:"#fad05a"}),ee.createElement("stop",{offset:.33,stopColor:"#fac85a"}),ee.createElement("stop",{offset:.77,stopColor:"#f9b159"}),ee.createElement("stop",{offset:1,stopColor:"#f8a359"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-7",x1:314.23,x2:365.43,y1:181.03,y2:117.88}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-8",x1:360.01,x2:498.34,y1:255.77,y2:255.77}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-9",x1:2019.17,x2:1994.62,y1:592.44,y2:505.25,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-10",x1:2092.42,x2:2098.89,y1:541.09,y2:518.99,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{id:"linear-gradient-11",x1:353.97,x2:409.21,y1:310.38,y2:310.38,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#3159a7"}),ee.createElement("stop",{offset:1,stopColor:"#4b8cca"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-12",x1:1987.72,x2:1989.82,y1:378.22,y2:361.34,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-13",x1:511.52,x2:529.69,y1:278.27,y2:278.27}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-14",x1:1964.24,x2:1966.6,y1:386.73,y2:376.51,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{id:"linear-gradient-15",x1:414.12,x2:538.61,y1:345.23,y2:345.23,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#6569af"}),ee.createElement("stop",{offset:1,stopColor:"#54abdf"})),ee.createElement("style",null,".cls-44,.cls-59{fill:#fff}.cls-9{fill:#201b51}.cls-13{fill:#2874bb}.cls-14{fill:#0a4872}.cls-16{fill:#f79f82}.cls-17{fill:#d17a62}.cls-20{fill:#4d77ae}.cls-23,.cls-42{fill:#242359}.cls-43{fill:#383176}.cls-26{fill:#1d4482}.cls-27{fill:#1f1b4f}.cls-28{fill:#3f3b84}.cls-41{fill:#f4825d}.cls-37{fill:#201c50}.cls-39{fill:#211b4e}.cls-41,.cls-42,.cls-43,.cls-44,.cls-45,.cls-47,.cls-50,.cls-53,.cls-59{fill-rule:evenodd}.cls-45{fill:#d0e4f5}.cls-47{fill:#4584c5}.cls-50,.cls-53{fill:#6669af}.cls-50{opacity:.25}.cls-59{opacity:.5}.cls-53{opacity:.2}"))),ee.createElement("g",{style:{isolation:"isolate"}},ee.createElement("g",{id:"Layer_2","data-name":"Layer 2"},ee.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},ee.createElement("path",{d:"M0 0h600v600H0z",style:{fill:"#fff"}}),ee.createElement("g",{id:"plant"},ee.createElement("path",{d:"M56.57 434.43c8.29-2.76 20.59-.42 25.26 8.14a40.7 40.7 0 0 1 8.58 5.49c-1.87-2.17-3.74-4.65-3.53-7.69.24-3.59 3.11-3.13 4.86-1.19s1 3.3 1 5.92c-.08 2.21.32 4.07.26 5 .86.71 1.72 1.42 2.59 2.12q2 1.57 3.94 3.12c-.38-.66-.76-1.31-.91-1.62-1.38-2.91-3.4-6.42-3.15-10s3.48-5.48 5.89-3.08c2 2 .12 5.44-.48 8.11-.74 3.3-.29 5.13-.39 7.36q3.36 2.6 6.76 5.09a22.2 22.2 0 0 1-3.79-8.87c-.51-4.41 4-4.2 6.2-2.44 2.45 1.93 1.66 5.12 1.42 8.09a32.4 32.4 0 0 0 .18 6.08c1.19.84 2.39 1.68 3.61 2.49.94.64 1.88 1.27 2.83 1.89a15.9 15.9 0 0 1-2.1-7.7c0-1.45 0-4.19 1.31-5.06 1.72-1.1 3.45.81 4 2.31 1.47 3.72-.7 8.88-.09 12.48 2.43 1.53 4.88 3 7.37 4.44a21.9 21.9 0 0 1-3.78-7.57c-.43-1.82-.36-4.17 1-5.37s3.74-.32 4.64 1.45.88 4 1 6.12.87 5.12.6 7.29c1.18.64 2.37 1.27 3.57 1.88l.66.33c-.4-.76-.72-1.53-1-2.06a8.56 8.56 0 0 1-.82-5.57c.49-1.92 2.39-3.55 3.93-2.87 1.29.57 1.76 2.41 1.64 4.06s-.7 3.24-.85 4.88a14.5 14.5 0 0 0 .17 3 172 172 0 0 0 8.3 3.5 22.5 22.5 0 0 1-2.25-6.55 7.66 7.66 0 0 1 .75-4.6c.79-1.35 2.4-2.19 3.59-1.53s1.54 2.59 1.27 4.22c-.17 1-.88 7.58-1.43 9.22 2.72 1.05 5.45 2.1 8.17 3.2 1 .41.61 2.14-.49 1.94a59.6 59.6 0 0 1-11-3.25c-.78.74-2 1.25-2.76 2.13-1.26 1.54-2.18 3.43-3.53 4.86s-3.42 2.32-4.86 1.29a2.4 2.4 0 0 1-.89-1.23c-.51-1.64.74-3.44 2-4.56a15 15 0 0 1 7.42-3.56c-2.26-1-4.48-2-6.66-3.05l-.72.14a8 8 0 0 0-3.38 1.24 14.3 14.3 0 0 0-2.14 2.31 16.8 16.8 0 0 1-3.21 2.95 5.83 5.83 0 0 1-4.09 1.34 3 3 0 0 1-2.34-3.32 4.73 4.73 0 0 1 1.87-2.75 14.17 14.17 0 0 1 8.4-3 24 24 0 0 1 3.86.19q-4.16-2.06-8.21-4.39a10.5 10.5 0 0 0-3.32 1.8l-4.14 3.22a16.1 16.1 0 0 1-4.2 2.63 6.55 6.55 0 0 1-6.7-1.38 3.2 3.2 0 0 1-1.17-2.67 4 4 0 0 1 2.2-2.69 20.9 20.9 0 0 1 9.26-3 27.5 27.5 0 0 1 4.62 0c-2.41-1.47-4.79-3-7.14-4.57a21.2 21.2 0 0 0-9.25 2.33c-1.7.93-3.31 2.12-5 3a8.16 8.16 0 0 1-5.43 1.11 3.12 3.12 0 0 1-2.56-3.22 4 4 0 0 1 .52-1.49c1.76-3.15 5.34-4.13 8.48-4.24s7.74 0 11.23 1.21c-3-2.07-6-4.24-8.89-6.47a18.2 18.2 0 0 0-6 2.18c-3.18 1.63-6.24 3.67-9.58 4.74-2.11.67-4.45.9-6.29-.25a1.76 1.76 0 0 1-.73-.75 2.39 2.39 0 0 1 .36-2.06 9.55 9.55 0 0 1 3.8-3.4 20.7 20.7 0 0 1 11.71-2.24 33.3 33.3 0 0 1 5.76 1c-2.81-2.17-5.59-4.4-8.34-6.66l-.56-.48c-2 1.31-4.18 2.44-6.24 3.66s-4.35 2.47-6.49 1.86a2.74 2.74 0 0 1-1.68-1.23 3.89 3.89 0 0 1 .47-3.89 6.83 6.83 0 0 1 3.13-2.24 20.2 20.2 0 0 1 7.47-1c-1.55-1.34-3.12-2.69-4.73-4v.14c-3.21 1.4-6.1 3.92-9.34 5.18a9 9 0 0 1-7.6-.43 2.06 2.06 0 0 1-1.25-1.71 2.62 2.62 0 0 1 1-1.67 14.2 14.2 0 0 1 9.08-3.45 23 23 0 0 1 6 .49 28.8 28.8 0 0 0-9-4.59l-.1-.05a23.8 23.8 0 0 0-6-.17c-2.47.28-4.94.88-7.42 1a10.23 10.23 0 0 1-7-1.84c-1.4-1.11-2.43-3.48-1.28-5.12a4.12 4.12 0 0 1 2.29-1.38",style:{fill:"#493e6b"}}),ee.createElement("path",{d:"M189.66 355.66c22 45.12 17.54 89.76 6.18 90.23-43.11 1.79-45.44-97.06-24.4-153.57 3.38 9.68 2.3 30.68 18.22 63.34",style:{fill:"#413b89"}}),ee.createElement("path",{d:"M220.78 421.15c22.9-20.15 23.51-30.31 26.6-39.52 10.93 57.09-33.23 105.61-41.38 107.52-3.11.73-14.63-42.15 14.78-68",style:{fill:"url(#linear-gradient)"}}),ee.createElement("path",{d:"M163.49 440c7.66 10.12 19.77 24.38 18.28 37.52-.54 4.68-6.68 13.17-10.79 9.29-12.56-7.34-65.91-18.14-87.35-71.74-4.9-12.23-7.58-36.85-38.34-55.64 40.5 2.39 97.77 53.63 118.2 80.57",style:{fill:"url(#linear-gradient-2)"}}),ee.createElement("path",{d:"M107.9 384.54c1.86 2.23 2.32 5.89 4.71 7.24 1.79 1 4.15.52 6.19 2.28a21.4 21.4 0 0 1 4.52 6c2.35 4.41 2.55 8.74 3.87 13.39 1.22 4.29 5.69 5.94 9.09 8.9a42.8 42.8 0 0 1 11.1 16.18c1.45 3.49 1.76 9.19 4.08 11.68 1.64 1.74 4.51 2.54 6.2 4.54 2 2.29 3 5.53 3.66 8.44 1.37 5.95-2.27 8.92-7.76 9.79-6.49-2.88-17.67-9.3-20.8-16.27-1.36-3-.27-3.35-2.69-4.89-4.14-2.62-8.38-3.28-11.09-7.91a30.1 30.1 0 0 1-3.86-12.25c-.2-2.95.87-4.33-.87-6.67-2.75-3.69-6.54-5.52-8.62-9.95a35.5 35.5 0 0 1-2.58-9.93c-.34-2.26.47-3.79.47-5.78 0-3.57-3.59-5.66-5-9-1.59-3.67-1.9-8.12-2.22-12.1 4.18-.62 9.05 3.26 11.6 6.31",style:{fill:"#1f1952"}}),ee.createElement("path",{d:"M192.53 414c1.55-10.56 21.49-47.82 27.4-54.55-10.87 34.9 4 29.16-5.21 88.27-2.78 17.88-15.65 45.78-26.05 45.65-9.85-.12-10-13-11.24-17.41-3.4-12 1.82-91.46 6.43-98.56 6.24 14.3 7.81 33.99 8.67 36.6",style:{fill:"#4f7fc0"}}),r||(r=ee.createElement("path",{d:"M194.56 413.31c2.36-5.87 2.62-12.38 5-18.38 1.25 5.28 4.6 10.19 3.83 15.79-.28 2-1.28 3.85-.91 5.76s2.66 4.08 3.54 6c2.89 6.27-1.51 8.48-1.1 13.19.21 2.45 3.23 6.2 4 8.82 1.26 4.44 2.18 9 .59 13.53-.63 1.75-2.09 3.13-1.9 5 .25 2.49 2.5 5.28 2.88 8 .75 5.25-3 8.67-3.44 12.72-.41 3.51 1.13 9.39-4.72 10.52-2.74.53-4.11-1.13-4.86-6.5-9.23-3.92-1.6-16.38-3.17-22.59-.57-2.21-1.79-4.28-2.28-6.62-.71-3.35 0-6.54-.43-9.74-.31-2.57-1.53-4.72-2.05-7.52-1.1-6 2.18-9 3.39-13.75 1.15-4.41-.28-9.54 1.63-14.23",className:"cls-9"})),c||(c=ee.createElement("path",{d:"M166 441.84c1.13 1.26 1.89 2.93 3 4.06a65.5 65.5 0 0 1-3.8-17.77c-.34-5.28-1.93-11.91-.64-17.09a67 67 0 0 1 9 14.07c3.27 6.58 6.51 13.2 9.75 19.8 4.9 10 8.24 20.18 11.4 30.82 1.36 4.55 6.43 14.25 1.9 18.29a4.07 4.07 0 0 1-4.86.78c-2.3-1.46-4.17-4.11-6-6.09a73.4 73.4 0 0 1-13.09-18.58c-2.78-6-5.71-12-8.1-18.21-1.77-4.59-4.26-10.22-3.77-15.23 1.7 1.69 3.55 3.31 5.21 5.15",className:"cls-9"})),ee.createElement("path",{d:"M110.76 322.05c11.57-3.25 6.72 17 15.73 31.57 1.57 1.85 3.07 3.76 4.52 5.72-.71-4-.56-9.76 1.21-11 4.63-3.34 3.85 4.8 3.49 6.68a28 28 0 0 1-2.58 7.29c2 2.81 3.84 5.68 5.61 8.55-.19-1-.33-1.86-.47-2.47-1.05-4.82-2.25-14.73 3.76-14.75 7.57 0 .56 16.38-.66 21.59.19.31 2.7 4.72 3.72 6.65-.58-6.13.3-16.57 5.52-16.81 11-.53-2.73 13-4 19.31 1.75 3.55 4.13 9.1 5.6 12.78-.28-3.5-.23-7.08.93-10.07 1.62-4.14 5.84-7.72 7.07-1.83.71 3.42-1.75 6.36-3.32 9.28a42.4 42.4 0 0 0-2.94 7.14q1.81 5 3.29 10.08c0-5 .65-10.23 3.35-13.89 5.14-6.95 10.84-.79 10 5.5-.83 6.47-8.45 10-11.79 14.31.74 3.1 1.37 6.22 1.91 9.36 1.47-5.1 3-10.67 7-14.12s11.94-3 10.82 3.28c-1.36 7.7-13 7.9-17.59 12.45.67 4.21 1.18 8.46 1.56 12.75a38.7 38.7 0 0 1 5.35-10.4c3.75-4.83 9.45-1.76 9.35 3.64-.15 7.71-10 8.64-14.27 12q.23 3.45.34 6.93c.09 2.68.24 6.39.34 9.05 1.78-4.28 4.6-9.54 7.33-11.33 5.67-3.72 10.49 1.42 6.86 6.9-3.45 5.22-10.42 4.95-14 9.09.18 3.75.42 7.49.77 11.21 3.08-6.34 9.61-12.52 15.29-12.95 6.25-.48 8.43 4.57 4.12 8.95-3.1 3.14-14.28 4.4-19 7.95a123 123 0 0 0 2.15 12.74c.49 2.16-2.88 3.31-3.53 1.17a79 79 0 0 1-2.13-9.13c-.36-4-3.71-4.71-6.77-6-3.5-1.51-20.82 3.74-15.67-9.51 4.36-11.21 16.44 1.74 21.48 8.59-.28-2.63-.49-5.28-.64-7.93-.82-2.19-2.21-4.21-5.83-6.28-5.34-3.06-27.56-3-24-13.69 5.55-16.64 26.73 10.32 29.72 17.93-.22-4.59-.51-15.52-.54-16.4a15.65 15.65 0 0 0-6.92-5.79c-3.42-1.48-14.58-5.12-11.84-11.24s11 .75 12.67 3.25c2.2 3.33 4.53 6.66 5.94 10.42-.23-4.79-.58-9.55-1.11-14.27-9.88-9.4-30.41-9-24.76-18.29 6.42-10.58 15.21 10.06 24.55 16.47a155 155 0 0 0-2.65-15.4c-1.2-.58-3-2.1-5.25-3.15-5.17-2.37-15.88-2.28-16.51-8.31-.88-8.28 6.64-7.35 11.08-4.32 4.9 3.33 7.21 8.23 10 13v-.19a166 166 0 0 0-5-16c-6.9-3.64-25.92-1.69-20.59-11.84 4.14-7.88 15.89 4.53 20.08 10.46q-2.88-7.69-6.48-15.07c-.89.38-2.4-.94-5.74-1.39-4.66-.63-14-.37-14.62-6.77-.46-4.49 6.84-3.84 10.07-2.43 3.63 1.59 6.24 5.66 9.11 8.24-.51-1-5.78-10.6-8.08-14.28-7.19-2.76-27.43-5.59-24.16-12.67 3.68-8 16.47 4.31 22.84 10.57-.79-1.23-7-10.55-8.58-12.63a55.1 55.1 0 0 1-17.08-11.41c-3.84-3.89-9.19-14.98 4.57-18.84",style:{fill:"url(#linear-gradient-3)"}}),ee.createElement("path",{d:"M124.57 459.32c31-2.35 38.4 23 37.7 24.93-12.22 4.33-25.86 4-47.66-11.38-11.73-8.26-19.9-21.55-20.42-22.37 5.98 5.07 19.95 9.61 30.38 8.82",style:{fill:"url(#linear-gradient-4)"}}),ee.createElement("path",{d:"M96.22 505.64h204.49s.25-18.15-17.23-17.82-21 7.56-21 7.56 21.8-33.57 4.06-32.56-28.38 12.45-34.72 1.54-15.34-23.84-24.14-8.64-2 29.14-11.84 26.86-24.86-11.11-25.86 1.67c0 0-22.53-2.68-18.23 7.2s-40.58-.45-55.53 14.19",style:{fill:"url(#linear-gradient-5)"}})),s||(s=ee.createElement("path",{d:"m99.67 232.94 47.65-3.31-8.89 6.84z",className:"cls-13"})),n||(n=ee.createElement("path",{d:"M138.43 236.47v8.72l-38.76-12.25z",className:"cls-14"})),i||(i=ee.createElement("path",{d:"m137.82 237.16-38.15-4.22 22.44 12.92zM164.53 248.49h-1.52a.47.47 0 0 1 0-.93h3.07a.47.47 0 0 1 .47.46.46.46 0 0 1-.45.47Zm-4.63-.15h-.05c-1-.07-2-.15-3-.26a.46.46 0 0 1-.41-.45v-.06a.45.45 0 0 1 .5-.4h.06c1 .1 2 .19 3 .24a.46.46 0 0 1 .41.46.48.48 0 0 1-.47.43Zm9.29 0a.46.46 0 0 1-.46-.43.47.47 0 0 1 .43-.47c1.08-.08 2.08-.18 3-.29a.49.49 0 0 1 .53.41.48.48 0 0 1-.42.47c-1 .12-2 .22-3.08.3Zm-15.41-.6h-.11c-1-.14-2-.29-3-.46a.44.44 0 0 1-.38-.46v-.08a.45.45 0 0 1 .53-.37c1 .18 2.05.33 3 .46a.47.47 0 0 1 .4.46.13.13 0 0 1 0 .06.47.47 0 0 1-.44.38Zm21.54-.15a.46.46 0 0 1-.46-.38.2.2 0 0 1 0-.07.46.46 0 0 1 .38-.46c1-.19 2.05-.39 3-.62a.46.46 0 0 1 .55.35s0 .06 0 .09a.46.46 0 0 1-.36.46c-1 .23-2 .44-3.05.62Zm-27.63-.89h-.08c-1-.2-2-.41-3-.65a.47.47 0 0 1-.36-.45.4.4 0 0 1 0-.11.47.47 0 0 1 .56-.35c1 .23 2 .46 3 .66a.44.44 0 0 1 .37.44.3.3 0 0 1 0 .1.45.45 0 0 1-.49.35Zm33.63-.52a.47.47 0 0 1-.45-.33.7.7 0 0 1 0-.14.45.45 0 0 1 .33-.44c1-.29 2-.62 2.9-1a.49.49 0 0 1 .6.28.5.5 0 0 1 0 .16.49.49 0 0 1-.31.44c-1 .36-2 .68-3 1a.3.3 0 0 1-.07.02Zm5.78-2.18a.47.47 0 0 1-.42-.27.6.6 0 0 1 0-.2.46.46 0 0 1 .27-.41c.9-.41 1.82-.86 2.73-1.36a.46.46 0 0 1 .62.18.4.4 0 0 1 .07.22.46.46 0 0 1-.25.41c-.93.52-1.87 1-2.79 1.4a.6.6 0 0 1-.23.03m5.43-2.94a.47.47 0 0 1-.39-.22.45.45 0 0 1-.08-.26.52.52 0 0 1 .21-.37c.86-.56 1.7-1.13 2.48-1.73a.5.5 0 0 1 .66.1.5.5 0 0 1 .08.27.46.46 0 0 1-.18.38c-.83.62-1.69 1.22-2.56 1.77a.5.5 0 0 1-.22.08Zm4.93-3.7a.42.42 0 0 1-.34-.17.4.4 0 0 1-.11-.31.47.47 0 0 1 .14-.33c.79-.69 1.53-1.38 2.2-2.08a.48.48 0 0 1 .67 0 .5.5 0 0 1 .13.33.46.46 0 0 1-.13.32c-.75.75-1.51 1.47-2.28 2.14a.5.5 0 0 1-.28.12Zm4.34-4.4a.42.42 0 0 1-.29-.11.43.43 0 0 1-.06-.65c.68-.8 1.3-1.62 1.86-2.41a.5.5 0 0 1 .66-.11.47.47 0 0 1 .18.39.44.44 0 0 1-.07.26c-.6.84-1.25 1.67-1.93 2.46a.44.44 0 0 1-.35.21Zm3.57-5a.5.5 0 0 1-.23-.07.45.45 0 0 1-.23-.39.5.5 0 0 1 .07-.24c.29-.5.58-1 .85-1.54l-.5-.06a.48.48 0 0 1-.39-.46.3.3 0 0 1 0-.08.46.46 0 0 1 .52-.38l.81.11.12-.26a.48.48 0 0 1 .61-.21.46.46 0 0 1 .26.41.7.7 0 0 1 0 .2c.45.05.87.11 1.26.14a.47.47 0 0 1 .41.47.47.47 0 0 1-.51.42l-1.6-.19c-.33.62-.66 1.26-1 1.86a.46.46 0 0 1-.45.31Zm12.36-1.5a.47.47 0 0 1-.33-.79.42.42 0 0 1 .32-.13c1 0 2-.06 3-.12h.08a.47.47 0 0 1 .46.43h-.06.06a.49.49 0 0 1-.44.47c-1 .06-2.08.1-3.1.12Zm-3.11 0c-1 0-2-.06-3.1-.14a.46.46 0 0 1-.43-.47.47.47 0 0 1 .49-.43c1 .07 2 .11 3.06.14a.45.45 0 0 1 .33.14.42.42 0 0 1 .13.32.48.48 0 0 1-.48.43Zm9.29-.36a.47.47 0 0 1-.47-.41v-.06a.46.46 0 0 1 .42-.45c1-.1 2-.23 3-.37a.46.46 0 0 1 .52.39v.07a.45.45 0 0 1-.39.45c-1 .15-2.06.27-3.09.38Zm6.08-.87a.47.47 0 0 1-.46-.38.3.3 0 0 1 0-.1.45.45 0 0 1 .38-.43c1-.19 2-.41 3-.64a.5.5 0 0 1 .56.35s0 .07 0 .1a.47.47 0 0 1-.35.46v-.05.05c-1.07.25-2.06.45-3 .63Zm-27.64-.09h-.08l-1-.21c-.7-.15-1.38-.31-2-.47a.46.46 0 0 1-.33-.44.4.4 0 0 1 0-.12.46.46 0 0 1 .55-.33h.06c.63.17 1.28.32 1.91.45l1 .21a.46.46 0 0 1 .38.44.3.3 0 0 1 0 .1.45.45 0 0 1-.49.36Zm33.65-1.3a.46.46 0 0 1-.44-.34.5.5 0 0 1 0-.12.45.45 0 0 1 .33-.45c1-.27 2-.56 2.94-.87a.45.45 0 0 1 .58.3.3.3 0 0 1 0 .14.45.45 0 0 1-.31.44c-1.06.33-2 .62-3 .89Zm-39.58-.35a.5.5 0 0 1-.18 0 15.8 15.8 0 0 1-2.81-1.5.43.43 0 0 1-.2-.38.47.47 0 0 1 .08-.26.48.48 0 0 1 .65-.12 15 15 0 0 0 2.63 1.41.43.43 0 0 1 .29.41.6.6 0 0 1 0 .19.46.46 0 0 1-.46.25m11.6-1.1a.4.4 0 0 1-.15 0 .46.46 0 0 1-.31-.44.4.4 0 0 1 0-.15 30 30 0 0 0 .9-2.91.48.48 0 0 1 .56-.34.47.47 0 0 1 .35.45s0 .07 0 .12c-.25 1-.57 2-.92 3a.47.47 0 0 1-.45.27ZM191.45 220a.45.45 0 0 1-.37-.19 8 8 0 0 1-.63-.92 9.2 9.2 0 0 1-.85-1.94.6.6 0 0 1 0-.13.46.46 0 0 1 .32-.45.47.47 0 0 1 .58.31 9 9 0 0 0 .76 1.74c.18.29.37.58.57.85a.38.38 0 0 1 .1.27.5.5 0 0 1-.18.37.42.42 0 0 1-.3.09m18.08-3.54h-.06a.46.46 0 0 1-.4-.46v-.06c.09-.67.17-1.34.21-2 0-.35.05-.68.06-1a.46.46 0 0 1 .92 0v1c0 .68-.12 1.38-.23 2.1a.45.45 0 0 1-.5.37Zm-19.94-2.24a.46.46 0 0 1-.47-.43v-.28a16.3 16.3 0 0 1 .28-2.9.46.46 0 0 1 .55-.37.47.47 0 0 1 .37.44v.1a13.4 13.4 0 0 0-.27 2.73v.25a.45.45 0 0 1-.45.45Zm20-3.92a.45.45 0 0 1-.46-.39 16.6 16.6 0 0 0-.67-2.92v-.14a.47.47 0 0 1 .32-.45.48.48 0 0 1 .59.29 17.3 17.3 0 0 1 .71 3.06s0 0 0 .07a.47.47 0 0 1-.4.45Zm-18.86-2.09a.4.4 0 0 1-.18 0 .48.48 0 0 1-.27-.43.4.4 0 0 1 0-.18 15 15 0 0 1 1.57-2.76.47.47 0 0 1 .63-.1.46.46 0 0 1 .2.36.55.55 0 0 1-.09.29 13.6 13.6 0 0 0-1.48 2.6.47.47 0 0 1-.36.17Zm16.86-3.7a.48.48 0 0 1-.4-.21 9.1 9.1 0 0 0-1.92-2.19.47.47 0 0 1-.18-.36.4.4 0 0 1 .1-.29.47.47 0 0 1 .65-.08 9.8 9.8 0 0 1 2.13 2.41.5.5 0 0 1 .06.24.44.44 0 0 1-.2.4.5.5 0 0 1-.22.03Zm-13.27-1.29a.47.47 0 0 1-.32-.22.46.46 0 0 1-.12-.3.45.45 0 0 1 .15-.35 12.3 12.3 0 0 1 2.64-1.82.47.47 0 0 1 .62.21.4.4 0 0 1 0 .19.45.45 0 0 1-.25.43 11.4 11.4 0 0 0-2.43 1.68.4.4 0 0 1-.27.13Zm8.51-2.43h-.12a6.9 6.9 0 0 0-2.83-.21.45.45 0 0 1-.51-.4.2.2 0 0 1 0-.08.48.48 0 0 1 .41-.44 8.3 8.3 0 0 1 3.24.26.45.45 0 0 1 .31.43.7.7 0 0 1 0 .14.45.45 0 0 1-.48.25Z",className:"cls-13"})),ee.createElement("path",{id:"shadow",d:"M225.14 522.41s159.65-2.89 162.51 5.57-57.5 20.56-76.38 20.71-50.8 8.72-77 4.43-108.27-24.26-9.13-30.71",style:{fill:"#cccbcc"}}),m||(m=ee.createElement("g",{id:"feet"},ee.createElement("path",{d:"m306.82 505.64-.79 12.86-15.14.96-.64-11.62zM261.88 509.4l-1.5 13.01-14.29-.99.21-13.16z",className:"cls-16"}),ee.createElement("path",{d:"m298.78 518.96-.49-10.44-.16-1.77-7.88 1.09.64 11.62zM254.77 522.02l-.15-10.99.08-2.15-8.4-.62-.21 13.16z",className:"cls-17"}))),ee.createElement("g",{id:"shoes"},ee.createElement("path",{d:"M264.51 532.72c-.22-1.06-3.94-11.94-3.94-11.94l-.19 1.63a2.65 2.65 0 0 1-.53-1.67c0-.76-2.21-1.47-5.12-1.81 0 0-1.25 6.9-2.6 7.75s-9.81 5.83-9.67 8.11 14.08 2.56 14.08 2.56-14.08 2.49-14.08 5.61a6.9 6.9 0 0 1-.94 2.93 28.8 28.8 0 0 0 8.55 2.55c7.47 1.07 14.37-3.91 15.22-6.45s-.57-8.2-.78-9.27",style:{fill:"#373272"}}),ee.createElement("path",{d:"M256.54 537.35s-13.93-.29-14.08-2.56 8.32-7.26 9.67-8.11 2.59-7.71 2.6-7.75a30 30 0 0 0-3.63-.21 6.92 6.92 0 0 0-6.18 3.3s-3.95 6.58-4.87 8.29-2.28 11-2.28 11a6.7 6.7 0 0 1 0 1.49c0 .64 1.34 1.89 3.75 3.07a6.9 6.9 0 0 0 .94-2.93c0-3.1 14.08-5.59 14.08-5.59",style:{fill:"#242355"}}),d||(d=ee.createElement("path",{d:"M265.52 540.76a18.2 18.2 0 0 1-.16 4.55c-.41 1.28-7.36 3.92-14.83 3.28s-12.93-2.49-13.08-3.78c-.19-1.63 0-4.33.32-4.62.9-.81 10.17 3.49 15.22 3a106 106 0 0 0 12.53-2.43",className:"cls-20"}))),ee.createElement("g",{id:"shoes-2","data-name":"shoes"},ee.createElement("path",{d:"M332.86 537.92s1.63 2.39 0 3.41c-1 .6-13.88 1-16.73.28a71 71 0 0 0-11.45-1.7 22.6 22.6 0 0 0-5.9 1.28s-8.46.38-9.31-.88a4.77 4.77 0 0 1-.4-3.25s9.14-1.21 11.42-.5 11.73.22 13.72.5 18.65.86 18.65.86",style:{fill:"#5080c0"}}),ee.createElement("path",{d:"M328.49 526.88c-2.51 0-22.08-8.59-22.38-9.61s-1.73-.9-4.29-.63a5.26 5.26 0 0 0-3 1.35s.85 8 3.7 8.48 15 6.75 26.1 3.55c0 0-5.41 3.7-8.54 3.7s-13 .28-13.22 1.07c-.14.52.64 2.2 1.17 3.25l2.79.3c13.71 1.55 22.08-.42 22.08-.42a26.5 26.5 0 0 0 1.07-4.7c.17-2.13-2.97-6.4-5.48-6.34",style:{fill:"#373174"}}),o||(o=ee.createElement("path",{d:"M306.82 534.79c.22-.79 10.09-1.07 13.22-1.07s8.54-3.7 8.54-3.7c-11.1 3.2-23.26-3.13-26.1-3.55s-3.7-8.48-3.7-8.48a4 4 0 0 0-.69.78c-7.84-2.24-7.2.69-7.2.69s-3.31 8.06-3.47 9.6 1.65 8 1.65 8A157 157 0 0 1 308 538c-.54-1-1.32-2.69-1.18-3.21",className:"cls-23"}))),ee.createElement("g",{id:"pants"},ee.createElement("path",{d:"M247.72 351c.93 11.52 10.74 46.93 6.9 63.57s0 96.4 0 96.42a26.2 26.2 0 0 0 7.26-1.63s3.62-29.08 4.05-33.35 7.25-57.81 5.12-63.14 8.32-45 8.32-45 3.84-16.71 5.26-20.69 10.52 14.22 10.52 25.32 10.53 42.09 3.42 53.47-.28 82.53-.28 82.53a45 45 0 0 0 8.53-2.88s6.82-87.61 8.58-112.08c1.4-19.34 2.51-61.45 2.91-78.22-7.84 4.16-26.64 13.38-40.37 14-17.77.82-31.16 10.2-30.22 21.68",style:{fill:"#383176"}}),h||(h=ee.createElement("path",{d:"M298.57 426c7.11-11.38-3.42-42.38-3.42-53.47s-9.1-29.3-10.52-25.32-5.26 20.69-5.26 20.69 7 23.68 8.1 30.24-3.62 25.23-3 37.54 5.76 72.17 5.76 72.17c1.81 1.45 5 1.33 8 .68s-6.77-71.16.34-82.53",className:"cls-23"})),p||(p=ee.createElement("path",{d:"M240.54 308.23c-5.76 15 1.5 66.28 2.51 71.82s-.59 39 0 45.44 3.25 82.77 3.25 82.77c2.06 2.44 5.32 2.95 8.32 2.77 0 0-3.84-79.78 0-96.42s-6-52.05-6.9-63.57 12.45-20.9 30.22-21.7c13.73-.62 32.53-9.84 40.37-14 .11-4.44.17-7.11.17-7.11-5.48-12.08-72.18-15-77.94 0",className:"cls-23"}))),ee.createElement("g",{id:"shirt"},ee.createElement("path",{d:"M321 239.54s2.06-11.8 2.27-17.13-14.93-22.4-24.1-25.18-15.59-15-15.59-15l3.55-10.39-11.64-2.09s-31.72 8.11-42.24 21 2 67 4.41 71.11 5.83 4 5.83 4-1.14 8.54-1.28 14.65-9.67 27-9.67 27l10.95 8.82 4.69-9 1.71 9.1s10.24 6.26 29 8.54a37.6 37.6 0 0 0 6.9.13c6.21-8.35 18.71-54.35 20-62.64S321 239.54 321 239.54",style:{fill:"#325aa8"}}),f||(f=ee.createElement("path",{d:"M378.07 183.94 343.37 227l-6.4-16.5-2.54-8c-2.53-8-13.25-22.51-15.49-23.9s-20.77-4.89-20.77-4.89l-11-2-3.55 10.39a44.6 44.6 0 0 0 5.13 7.41 15.2 15.2 0 0 1-5.44-2c-2.72-1.66-8.58-8.06-10.88-11.38 2 3.63 6.8 11.62 11.19 13.3a22.3 22.3 0 0 0 6.57 1.7 21.8 21.8 0 0 0 9 6c9.17 2.78 24.32 19.84 24.1 25.18S321 239.54 321 239.54s8 17.78 20.9 17.07 38.12-51.06 38.12-51.06ZM272.43 176.2c-.6-1.09-.95-1.79-.95-1.79a5 5 0 0 0 .95 1.79",className:"cls-26"})),E||(E=ee.createElement("path",{d:"M316.06 261.87c-.14-8 5-22.33 5-22.33s-13.94 14.65-15.22 23-13.77 54.29-20 62.64c17.71-1.21 38.18-12.93 38.18-12.93s-7.82-42.41-7.96-50.38M243.53 265.85s15.79-1 19.84-2.06 38.4-20.86 38.4-20.86S268.49 276 258.25 277h-15.84ZM259 236.56l-4.41-28.87s6 23.32 9.53 22.89 15.36-.71 15.36-.71Z",className:"cls-26"}))),ee.createElement("g",{id:"head"},g||(g=ee.createElement("path",{d:"M331.21 119.48s9.28.74 8.32 5.33-10.68 10.36-10.68 10.36Z",className:"cls-27"})),x||(x=ee.createElement("g",{id:"face"},ee.createElement("path",{d:"M295.15 133.77c-4.8-9.07-9.17-3-10.77 1.28s1.71 7.79 1.71 7.79c-3.84 8.32-10.56 26.87-10.56 26.87-.17 4.75 3.68 9.31 8.09 12.48 0 0 8.23-9.28 8.12-14.5s3.52-11.63 3.52-11.63c.75 3.95 5.55 7.89 5.55 7.89a22 22 0 0 0 4.9 4c2.46 1.28 6.4 3.41 13.87-4.27s11.63-44.15 11.63-44.15c-27.95-15.95-36.06 14.24-36.06 14.24",className:"cls-16"}),ee.createElement("path",{d:"M295.26 156.06s-3.63 6.4-3.52 11.63-8.1 14.49-8.12 14.5c3.93 2.82 8.31 4.54 10.72 4.31 5.12-.5 3.77-8.71 3.77-11.77s2.7-10.78 2.7-10.78-4.81-3.95-5.55-7.89",className:"cls-17"}))),y||(y=ee.createElement("path",{d:"M278.66 98.46c-1.14-5.26-15.87-3.92-15.88-3.92-2.94 2.34-5.07 4.47-5.7 5.74-2.24 4.48-3 11.84 0 15.89s14.08 2.83 14.08 2.83a123 123 0 0 1 8.73-8.81l-2.8 2.05s2.71-8.51 1.57-13.78",className:"cls-28"})),u||(u=ee.createElement("path",{d:"M289.59 83.21c-6.67-1.91-19.35 5.4-26.81 11.33 0 0 14.74-1.34 15.88 3.92s-1.57 13.8-1.57 13.8l2.8-2.05a66 66 0 0 1 8.52-6.71c8.29-5.31 10.48-17.62 1.18-20.29",className:"cls-27"})),ee.createElement("path",{d:"M289.59 105.26s-1.8-3.76-4.36-3.15-15.35 10-14.61 14.49a29.4 29.4 0 0 0 2.88 8.32Z",style:{fill:"#f6925b"}}),M||(M=ee.createElement("path",{d:"M304.42 116.8c3.44-9.39 20-.57 25.72-2.39a5.93 5.93 0 0 0 4.2-7 8.3 8.3 0 0 0-1.21-1c-8.32-5.87-34.88-4.59-40.91-2.46S276 118 273.5 124.92s.64 17.49 3 20 3.28 13.37 3.28 13.37c3.5-2.21 8.08-13.8 8.08-13.8a15.55 15.55 0 0 1-3.36-6.36c-.91-3.74 2.63-7.69 5.06-8.62 2.14-.82 4.85 3.06 5.47 4l.13-.23a64 64 0 0 0 9.26-16.48",className:"cls-28"})),_||(_=ee.createElement("path",{d:"M300.17 138c5 1.6 15.78-10.14 18.13-13.87s12.18.84 12.18.84 9.77-11.39 3.86-17.61a5.93 5.93 0 0 1-4.2 7c-5.69 1.82-22.28-7-25.72 2.39a64 64 0 0 1-9.27 16.53l-.13.23a2 2 0 0 1 .13.21s0 2.72 5.02 4.28",className:"cls-27"}))),ee.createElement("g",{id:"magnifying_glass","data-name":"magnifying glass"},ee.createElement("path",{d:"M321.77 184.51h4.38v76.97h-4.38z",style:{fill:"url(#linear-gradient-6)"},transform:"rotate(14.31 324.076 223.066)"}),ee.createElement("path",{d:"M371.73 118.48c-3-9.91-8.85-16.43-16.41-18.37s-15.81 1-23.21 8.26c-7.12 7-12.68 17.22-15.64 28.82s-3 23.26-.08 32.8c3 9.91 8.85 16.43 16.41 18.36a18.6 18.6 0 0 0 4.63.58c6.21 0 12.66-3 18.58-8.83 7.12-7 12.68-17.22 15.64-28.83s2.99-23.27.08-32.79m-4.17 31.75c-5.63 22.07-20.76 37.34-33.71 34-6.09-1.55-10.85-7-13.43-15.5-2.68-8.81-2.63-19.65.14-30.52 5.12-20.05 18.06-34.49 30.11-34.49a14.6 14.6 0 0 1 3.6.45c6.09 1.55 10.85 7.06 13.43 15.51 2.68 8.84 2.63 19.68-.14 30.55",style:{fill:"url(#linear-gradient-7)"}}),ee.createElement("path",{d:"M354.27 104.2a14.6 14.6 0 0 0-3.6-.45c-12.05 0-25 14.44-30.11 34.49-2.77 10.87-2.82 21.71-.14 30.52 2.58 8.45 7.34 14 13.43 15.5 12.95 3.31 28.08-12 33.71-34 2.77-10.87 2.82-21.71.14-30.52-2.58-8.48-7.34-13.99-13.43-15.54",style:{fill:"#26a9e0",opacity:.17}})),ee.createElement("path",{d:"M296.79 224.68s3.34 13.09 8.14 14.86l7.65-6.33s9.17 1.57 11.94-.14 6.05-7.68 6.26-9.46a17.5 17.5 0 0 1 .36-2.27 9.7 9.7 0 0 1 1-3.56c.78-1.28 3.13-5.76 2.77-7s-7.11.5-8.17.57-11.24.71-12.59 1.78-4.91 7.4-7.11 8-10.25 3.55-10.25 3.55",style:{fill:"#f59e81"}}),v||(v=ee.createElement("path",{d:"m541.98 71.02-54.07 15.73 12.61 3.95z",className:"cls-13"})),N||(N=ee.createElement("path",{d:"m500.52 90.7 3.56 9.66 37.9-29.34z",className:"cls-14"})),b||(b=ee.createElement("path",{d:"m501.49 91.22 40.49-20.2-19.57 23.43zM409.4 160a.37.37 0 0 1-.29-.14.4.4 0 0 1-.08-.24.35.35 0 0 1 .14-.28.37.37 0 0 1 .52.06.37.37 0 0 1-.06.52.33.33 0 0 1-.23.08m-1.49-2a.37.37 0 0 1-.31-.16c-.45-.69-.89-1.41-1.28-2.14a.36.36 0 0 1-.05-.19.39.39 0 0 1 .19-.32.36.36 0 0 1 .5.15c.39.69.8 1.39 1.24 2.07a.36.36 0 0 1 .06.2.35.35 0 0 1-.17.3.36.36 0 0 1-.18.09m-2.35-4.33a.38.38 0 0 1-.34-.22c-.33-.78-.63-1.55-.9-2.33a.4.4 0 0 1 0-.11.39.39 0 0 1 .25-.36.37.37 0 0 1 .47.24c.26.77.55 1.52.86 2.25a.3.3 0 0 1 0 .13.39.39 0 0 1-.22.35.4.4 0 0 1-.12.01ZM404 149a.37.37 0 0 1-.37-.28c-.2-.82-.38-1.64-.51-2.44a.2.2 0 0 1 0-.08.36.36 0 0 1 .3-.35.37.37 0 0 1 .43.3c.14.79.31 1.59.51 2.39a.3.3 0 0 1 0 .09.36.36 0 0 1-.28.36Zm-.86-4.86a.35.35 0 0 1-.36-.33c-.09-.81-.14-1.65-.17-2.49a.39.39 0 0 1 .36-.37.37.37 0 0 1 .36.37c0 .81.08 1.63.16 2.43a.37.37 0 0 1-.33.37Zm-.15-4.93a.37.37 0 0 1-.36-.37c0-.81.09-1.65.17-2.49a.37.37 0 0 1 .74 0c-.08.81-.14 1.63-.17 2.44a.37.37 0 0 1-.37.38Zm.5-4.91h-.06a.39.39 0 0 1-.31-.38c.13-.82.29-1.64.47-2.45a.37.37 0 0 1 .45-.27.39.39 0 0 1 .28.37.2.2 0 0 1 0 .07c-.19.79-.34 1.6-.48 2.4a.37.37 0 0 1-.37.22Zm1.11-4.81a.2.2 0 0 1-.11 0 .35.35 0 0 1-.26-.34.5.5 0 0 1 0-.12c.24-.8.51-1.59.79-2.36a.37.37 0 0 1 .47-.22.39.39 0 0 1 .25.35.4.4 0 0 1 0 .12c-.29.77-.54 1.55-.78 2.33a.35.35 0 0 1-.38.2Zm1.7-4.63a.4.4 0 0 1-.15 0 .39.39 0 0 1-.22-.35.4.4 0 0 1 0-.13c.33-.75.69-1.49 1.07-2.21a.36.36 0 0 1 .49-.17.37.37 0 0 1 .2.32.4.4 0 0 1 0 .19c-.38.73-.73 1.47-1.05 2.2a.39.39 0 0 1-.36.11Zm2.27-4.38a.33.33 0 0 1-.19-.06.34.34 0 0 1-.19-.31.3.3 0 0 1 .06-.19l.09-.15c.41-.68.84-1.33 1.26-2a.37.37 0 0 1 .51-.09.38.38 0 0 1 .17.31.37.37 0 0 1-.07.2c-.45.66-.86 1.29-1.23 1.91v.08l-.05.07a.33.33 0 0 1-.38.19Zm2.78-4.08a.34.34 0 0 1-.22-.07.36.36 0 0 1-.15-.3.37.37 0 0 1 .08-.22c.48-.63 1-1.28 1.56-1.93a.39.39 0 0 1 .52 0 .38.38 0 0 1 0 .53c-.52.61-1 1.25-1.52 1.88a.34.34 0 0 1-.29.07Zm3.2-3.75a.36.36 0 0 1-.25-.11.34.34 0 0 1-.12-.27.4.4 0 0 1 .1-.25c.56-.58 1.14-1.18 1.75-1.76a.37.37 0 0 1 .52 0 .38.38 0 0 1 .11.26.4.4 0 0 1-.11.26c-.58.55-1.15 1.14-1.73 1.74a.38.38 0 0 1-.29.09Zm58.9-1.77h-1.25a.37.37 0 0 1-.35-.36.38.38 0 0 1 .38-.36h2.45a.37.37 0 0 1 0 .74Zm3.69-.16a.37.37 0 0 1-.37-.34.36.36 0 0 1 .34-.36c.83-.07 1.65-.16 2.43-.27a.37.37 0 0 1 .42.32.4.4 0 0 1 0 .06.36.36 0 0 1-.32.35c-.83.12-1.67.21-2.47.27Zm-7.39 0c-.85-.07-1.68-.15-2.48-.27a.36.36 0 0 1-.31-.36.38.38 0 0 1 .41-.33c.81.12 1.63.21 2.43.27a.38.38 0 0 1 .34.37.35.35 0 0 1-.41.28ZM482 110a.36.36 0 0 1-.36-.29.3.3 0 0 1 0-.08.37.37 0 0 1 .31-.36c.79-.15 1.59-.33 2.38-.53a.37.37 0 0 1 .45.27s0 .06 0 .09a.36.36 0 0 1-.28.35c-.81.21-1.62.4-2.43.55Zm-17.17 0h-.08c-.8-.16-1.61-.34-2.43-.55a.39.39 0 0 1-.27-.37.3.3 0 0 1 0-.09.37.37 0 0 1 .45-.27c.81.21 1.62.4 2.39.55a.38.38 0 0 1 .3.36.2.2 0 0 1 0 .08.36.36 0 0 1-.35.29Zm-46.76-.81a.35.35 0 0 1-.27-.13.4.4 0 0 1-.1-.25.4.4 0 0 1 .13-.28c.61-.53 1.25-1.07 1.9-1.59a.37.37 0 0 1 .52 0 .43.43 0 0 1 .08.24.35.35 0 0 1-.14.28c-.65.53-1.29 1.07-1.87 1.58a.4.4 0 0 1-.24.15Zm68.72-.38a.37.37 0 0 1-.36-.26.4.4 0 0 1 0-.11.37.37 0 0 1 .26-.35c.8-.25 1.58-.52 2.31-.79a.39.39 0 0 1 .48.21.3.3 0 0 1 0 .14.37.37 0 0 1-.24.34c-.77.29-1.57.57-2.35.81Zm-26.74 0h-.11c-.79-.25-1.58-.54-2.35-.84a.37.37 0 0 1-.23-.34.6.6 0 0 1 0-.13.37.37 0 0 1 .48-.22c.78.3 1.55.58 2.3.82a.38.38 0 0 1 .26.36.4.4 0 0 1 0 .11.39.39 0 0 1-.34.2Zm31.36-1.7a.39.39 0 0 1-.35-.22.3.3 0 0 1 0-.14.36.36 0 0 1 .2-.34c.73-.34 1.47-.68 2.18-1a.37.37 0 0 1 .5.16.25.25 0 0 1 0 .17.36.36 0 0 1-.2.32c-.73.38-1.48.74-2.24 1.08Zm-36-.1a.3.3 0 0 1-.15 0c-.75-.35-1.5-.72-2.23-1.11a.39.39 0 0 1-.19-.34.34.34 0 0 1 .05-.17.38.38 0 0 1 .5-.15c.72.39 1.46.77 2.18 1.1a.37.37 0 0 1 .22.33.4.4 0 0 1 0 .17.37.37 0 0 1-.33.16Zm-33.53-.88a.38.38 0 0 1-.3-.15.4.4 0 0 1-.07-.22.36.36 0 0 1 .15-.3c.68-.5 1.36-1 2-1.43a.39.39 0 0 1 .51.09.4.4 0 0 1 .06.21.37.37 0 0 1-.16.31c-.67.46-1.35.94-2 1.42a.4.4 0 0 1-.14.03Zm73.87-1.28a.38.38 0 0 1-.32-.18.34.34 0 0 1-.05-.19.38.38 0 0 1 .18-.32c.69-.4 1.38-.85 2.06-1.31a.38.38 0 0 1 .52.1.36.36 0 0 1 .06.2.36.36 0 0 1-.15.3c-.67.45-1.35.9-2.05 1.3a.37.37 0 0 1-.2.06Zm-44.67-.21a.35.35 0 0 1-.2 0c-.71-.45-1.4-.91-2-1.38a.35.35 0 0 1-.16-.3.32.32 0 0 1 .08-.21.38.38 0 0 1 .52-.09c.63.46 1.31.91 2 1.35a.38.38 0 0 1 .17.33.4.4 0 0 1-.05.19.4.4 0 0 1-.31.07ZM426 103.32a.36.36 0 0 1-.31-.18.3.3 0 0 1-.06-.19.34.34 0 0 1 .18-.31c.7-.45 1.43-.88 2.12-1.28a.37.37 0 0 1 .51.14.4.4 0 0 1 .05.19.37.37 0 0 1-.18.31c-.75.43-1.44.85-2.11 1.26a.36.36 0 0 1-.2.06m73.88-1.32a.4.4 0 0 1-.3-.14.45.45 0 0 1-.08-.23.35.35 0 0 1 .15-.29c.64-.51 1.28-1 1.87-1.57a.37.37 0 0 1 .52 0 .38.38 0 0 1 0 .53c-.61.54-1.26 1.08-1.92 1.59a.4.4 0 0 1-.24.11m-52.75-.31a.32.32 0 0 1-.23-.08c-.65-.54-1.28-1.08-1.87-1.64a.4.4 0 0 1-.12-.29.33.33 0 0 1 .1-.24.38.38 0 0 1 .52 0c.6.57 1.21 1.11 1.83 1.61a.38.38 0 0 1 .13.29.35.35 0 0 1-.09.23.36.36 0 0 1-.27.15Zm-16.84-.87a.37.37 0 0 1-.33-.2.5.5 0 0 1 0-.17.38.38 0 0 1 .2-.33c.68-.36 1.4-.73 2.2-1.13a.38.38 0 0 1 .5.18.3.3 0 0 1 0 .15.37.37 0 0 1-.21.34c-.72.35-1.46.73-2.18 1.12a.6.6 0 0 1-.18.07Zm4.43-2.18a.36.36 0 0 1-.33-.21.34.34 0 0 1 0-.16.36.36 0 0 1 .22-.33c.74-.33 1.51-.67 2.27-1a.37.37 0 0 1 .47.21.2.2 0 0 1 0 .13.38.38 0 0 1-.22.34c-.72.3-1.47.62-2.23 1a.27.27 0 0 1-.18.05Zm8.82-.33a.36.36 0 0 1-.27-.12c-.58-.62-1.12-1.25-1.63-1.89a.4.4 0 0 1-.08-.23.3.3 0 0 1 0-.15c-.7.24-1.43.51-2.18.8a.38.38 0 0 1-.48-.21.6.6 0 0 1 0-.13.36.36 0 0 1 .23-.35l2.33-.86a.39.39 0 0 1 .48.23s0 .08 0 .13a.33.33 0 0 1 0 .17.31.31 0 0 1 .3.14c.49.62 1 1.25 1.59 1.85a.37.37 0 0 1 .1.25.36.36 0 0 1-.12.27.33.33 0 0 1-.27.13Zm.39-3.21a.37.37 0 0 1-.35-.25.5.5 0 0 1 0-.12.36.36 0 0 1 .26-.35l2.35-.77a.38.38 0 0 1 .46.24.4.4 0 0 1 0 .12.39.39 0 0 1-.25.35c-.79.25-1.58.5-2.35.76Zm-3.46-.64a.38.38 0 0 1-.31-.17c-.46-.67-.9-1.38-1.32-2.12a.3.3 0 0 1 0-.18.37.37 0 0 1 .69-.18c.4.69.83 1.39 1.29 2.07a.36.36 0 0 1 .06.2.38.38 0 0 1-.16.31.37.37 0 0 1-.25.1Zm8.16-.88a.37.37 0 0 1-.35-.25.5.5 0 0 1 0-.11.37.37 0 0 1 .26-.36l2.34-.76a.37.37 0 0 1 .47.23.4.4 0 0 1 0 .11.38.38 0 0 1-.25.36c-.7.24-1.45.48-2.35.77Zm4.68-1.56a.39.39 0 0 1-.35-.26.4.4 0 0 1 0-.12.38.38 0 0 1 .24-.35c.86-.31 1.62-.59 2.3-.86a.37.37 0 0 1 .48.2 1 1 0 0 1 0 .13.37.37 0 0 1-.23.36c-.73.29-1.52.58-2.32.87a.3.3 0 0 1-.12.06Zm4.59-1.83a.38.38 0 0 1-.34-.22.4.4 0 0 1 0-.14.37.37 0 0 1 .21-.35c.79-.35 1.51-.69 2.22-1.06a.36.36 0 0 1 .49.17.34.34 0 0 1 .05.17.37.37 0 0 1-.2.31c-.69.37-1.42.71-2.21 1.06a.28.28 0 0 1-.22.09Zm-19.86 0a.38.38 0 0 1-.34-.22c-.27-.58-.52-1.17-.74-1.77v-.12q-.07-.19-.15-.42a.25.25 0 0 1 0-.12.36.36 0 0 1 .24-.35.36.36 0 0 1 .47.22c.08.21.13.37.19.53.23.59.47 1.17.74 1.73a1 1 0 0 1 0 .16.38.38 0 0 1-.21.33.4.4 0 0 1-.24.03ZM462.27 88a.38.38 0 0 1-.31-.18.34.34 0 0 1 0-.19.38.38 0 0 1 .18-.32c.7-.43 1.39-.88 2-1.34a.38.38 0 0 1 .5.09.34.34 0 0 1 .07.22.37.37 0 0 1-.14.29c-.66.47-1.34.93-2.07 1.36a.3.3 0 0 1-.23.07m-25.87-2.46a.36.36 0 0 1-.36-.26c-.19-.78-.34-1.6-.47-2.42v-.06a.37.37 0 0 1 .31-.36.37.37 0 0 1 .42.3q.18 1.2.48 2.4v.09a.36.36 0 0 1-.27.35Zm29.86-.49a.4.4 0 0 1-.28-.13.36.36 0 0 1-.08-.25.37.37 0 0 1 .13-.27c.46-.41.92-.83 1.35-1.27l.39-.41a.37.37 0 0 1 .64.25.42.42 0 0 1-.09.24l-.38.4c-.45.46-.92.9-1.4 1.32a.37.37 0 0 1-.28.12m3.33-3.64a.3.3 0 0 1-.21-.06.35.35 0 0 1-.16-.31.3.3 0 0 1 .06-.19 20 20 0 0 0 1.23-2 .36.36 0 0 1 .48-.15.34.34 0 0 1 .2.34.24.24 0 0 1 0 .14 18 18 0 0 1-1.27 2.1.37.37 0 0 1-.33.13m-33.92-.75a.37.37 0 0 1-.38-.34v-2.5a.38.38 0 0 1 .37-.36.36.36 0 0 1 .34.37v2.4299999999999997a.34.34 0 0 1-.35.36ZM471.82 77h-.12a.4.4 0 0 1-.25-.36.4.4 0 0 1 0-.11 13.6 13.6 0 0 0 .54-2.34.37.37 0 0 1 .41-.32.38.38 0 0 1 .32.37 13.3 13.3 0 0 1-.57 2.47.37.37 0 0 1-.33.29m-35.93-1.29h-.05a.38.38 0 0 1-.32-.36s0 0 0-.06a25 25 0 0 1 .49-2.46.39.39 0 0 1 .46-.26.38.38 0 0 1 .28.36.3.3 0 0 1 0 .09 24 24 0 0 0-.49 2.38.37.37 0 0 1-.37.34Zm36.54-3.57a.36.36 0 0 1-.37-.34 10 10 0 0 0-.51-2.31.3.3 0 0 1 0-.12.37.37 0 0 1 .24-.35.37.37 0 0 1 .47.21 10 10 0 0 1 .54 2.46.37.37 0 0 1-.33.37ZM437.14 71a.3.3 0 0 1-.13 0 .38.38 0 0 1-.24-.34.25.25 0 0 1 0-.13 21 21 0 0 1 1-2.29.37.37 0 0 1 .5-.15.36.36 0 0 1 .19.32.25.25 0 0 1 0 .17 21 21 0 0 0-1 2.21.37.37 0 0 1-.32.21m33.64-3.41a.36.36 0 0 1-.31-.17 14.6 14.6 0 0 0-1.47-1.9.4.4 0 0 1-.1-.25.42.42 0 0 1 .1-.27.38.38 0 0 1 .52 0 14.6 14.6 0 0 1 1.57 2 .4.4 0 0 1 .06.21.34.34 0 0 1-.17.31.36.36 0 0 1-.2.05Zm-31.32-.93a.4.4 0 0 1-.21-.07.37.37 0 0 1-.16-.3.4.4 0 0 1 .06-.23 21 21 0 0 1 1.59-2 .37.37 0 0 1 .52 0 .32.32 0 0 1 .12.26.35.35 0 0 1-.1.26 18 18 0 0 0-1.52 1.87.38.38 0 0 1-.3.19Zm28-2.71a.37.37 0 0 1-.24-.1c-.62-.54-1.27-1-1.91-1.51a.36.36 0 0 1-.15-.3.34.34 0 0 1 .07-.22.39.39 0 0 1 .52-.09c.67.49 1.33 1 2 1.56a.4.4 0 0 1 .12.27.35.35 0 0 1-.09.26.4.4 0 0 1-.31.11ZM442.79 63a.4.4 0 0 1-.28-.13.34.34 0 0 1-.08-.23.35.35 0 0 1 .13-.29 18 18 0 0 1 2-1.5.39.39 0 0 1 .51.11.6.6 0 0 1 .06.21.37.37 0 0 1-.17.3 19 19 0 0 0-2 1.45.4.4 0 0 1-.17.08m20.68-2a.34.34 0 0 1-.18 0 21 21 0 0 0-2.15-1.07.35.35 0 0 1-.21-.34.4.4 0 0 1 0-.15.38.38 0 0 1 .49-.19 21 21 0 0 1 2.25 1.13.37.37 0 0 1 .18.33.4.4 0 0 1 0 .17.37.37 0 0 1-.38.12m-16.54-.71a.36.36 0 0 1-.33-.21.3.3 0 0 1-.05-.16.38.38 0 0 1 .22-.33 20 20 0 0 1 2.33-1 .38.38 0 0 1 .47.24.4.4 0 0 1 0 .11.38.38 0 0 1-.25.36 20 20 0 0 0-2.25.91.4.4 0 0 1-.14.12Zm12-1.21a.16.16 0 0 1-.1 0c-.56-.15-1.15-.28-1.74-.38l-.63-.09a.35.35 0 0 1-.32-.37.37.37 0 0 1 .42-.32l.65.09a16 16 0 0 1 1.79.4.35.35 0 0 1 .26.35s0 .07 0 .1a.36.36 0 0 1-.32.26Zm-7.34-.32a.37.37 0 0 1-.36-.31s0-.05 0-.08a.37.37 0 0 1 .3-.35 18 18 0 0 1 2.51-.27.37.37 0 0 1 .37.35.37.37 0 0 1-.36.37 15 15 0 0 0-2.4.26h-.07Z",className:"cls-13"})),ee.createElement("g",{id:"pie_1","data-name":"pie 1"},ee.createElement("path",{d:"M348.7 228.17 338.25 223s-8.54-32.94 18.34-63.3h13.09Z",style:{fill:"#211c50"}}),ee.createElement("path",{d:"m421.66 207.69-52-48c-11.89 12.57-17.13 29.84-19.39 43.9 26.05 7.02 71.39 4.1 71.39 4.1",style:{fill:"#f4825d"}}),ee.createElement("path",{d:"m348.7 228.17 73-20.48s-45.34 2.92-71.37-4.1a124 124 0 0 0-1.63 24.58",style:{fill:"#e56542"}})),k||(k=ee.createElement("path",{d:"M402.46 188.93c-.55-1.54-4.8-13.14-8.64-15.25s-9 0-9 0 6.85.19 6.64 2.11-7.46 12.21-4.58 13.66 9.45 6.86 9.45 6.86c3.26-1.23 6.61-6.04 6.13-7.38",className:"cls-16"})),j||(j=ee.createElement("path",{d:"M386.88 189.45c-2.88-1.5 4.38-11.74 4.59-13.66s-6.64-2.11-6.64-2.11l4.51 4.19s-3.63 4.11-6.08 6.8-1.07 5.63 0 7.12 8 4.8 11.62 4.8a4.2 4.2 0 0 0 1.45-.28s-6.57-5.37-9.45-6.86",className:"cls-17"})),ee.createElement("g",{id:"pie_3","data-name":"pie 3"},Z||(Z=ee.createElement("path",{d:"m360 245.37-11.4-5.83s-3.56 51.77 61.52 65.78Z",className:"cls-37"})),ee.createElement("path",{d:"m360 245.37 138.23-39.82s4.55 65.81-48.64 92.5S360 278.37 360 245.37",style:{fill:"url(#linear-gradient-8)"}}),w||(w=ee.createElement("path",{d:"m348.61 239.54 136.4-38.04 13.23 4.05-138.23 39.82z",className:"cls-37"}))),ee.createElement("g",{id:"pie_2","data-name":"pie 2"},z||(z=ee.createElement("path",{d:"m468.16 224.91-16.64-4.42-55.19-63.36 15.51 2.56z",className:"cls-39"})),D||(D=ee.createElement("path",{d:"M396.33 157.13s44.65-31.36 93.76 0l-78.25 2.56Z",className:"cls-39"})),G||(G=ee.createElement("path",{d:"M498.53 201.29c11.06-13.93-10.41-41.77-15.86-48.41-38.58-18.39-70.83 6.81-70.83 6.81l56.32 65.22s17.76-7.75 30.37-23.62",className:"cls-20"})),ee.createElement("path",{d:"m483.52 153.29-.85-.41c5.45 6.64 26.92 34.48 15.86 48.41-12.61 15.87-30.37 23.62-30.37 23.62l52.39-22.86s-9.3-35.11-37.03-48.76",style:{fill:"#1c4582"}})),ee.createElement("g",{id:"analysis"},C||(C=ee.createElement("path",{d:"m372.41 502.93 3.64-1.39.69 1.82-3.64 1.39zm58.32-211.57-.7-1.82-2.4.92.69 1.82zM426.5 293l-3.64 1.39-.69-1.82 3.64-1.39zm-5.5 2.05-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.45 2.09-3.64 1.38-.7-1.82 3.64-1.38zm-5.46 2.08-3.63 1.39-.7-1.82 3.64-1.39.7 1.82Zm-5.46 2.08-3.64 1.39-.7-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.09-3.6 1.37-.69-1.82 3.64-1.38.69 1.82Zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.63 1.39-.7-1.82 3.64-1.39zm-5.45 2.08-3.64 1.39-.7-1.82 3.64-1.39zM361 318l-3.64 1.39-.7-1.82 3.64-1.39zm-5.46 2-3.64 1.38-.69-1.82 3.63-1.38zm-5.35 2.08-.88-1.74A11.4 11.4 0 0 0 346 323l1.45 1.3a9.4 9.4 0 0 1 2.77-2.16Zm-3.87 3.59-1.62-1.07a14 14 0 0 0-1.76 3.79l1.88.53a12.2 12.2 0 0 1 1.5-3.25m-1.85 5-1.94-.2a36 36 0 0 0 0 4h1.94a37 37 0 0 1 .05-3.79Zm0 5.74v3.89h-1.95v-3.9Zm0 5.84v3.9h-1.97v-3.89Zm0 5.84V352h-1.94v-3.89Zm0 5.85v3.89h-2V354Zm0 5.84v3.89h-1.95v-3.9Zm0 5.84v3.9h-1.94v-3.89Zm0 5.84v3.9h-1.95v-3.86Zm0 5.85v3.89h-1.95v-3.9Zm0 5.84v3.89h-1.87v-3.9Zm0 5.84v3.9h-1.95V389Zm0 5.84v3.9h-1.95v-3.89Zm0 5.85v3.89h-1.94v-3.9Zm0 5.84v3.89h-2v-3.9Zm0 5.84v3.9h-1.95v-3.86Zm0 5.84v3.9h-1.94v-3.89Zm0 5.85V428h-1.95v-3.9Zm0 5.84v3.89h-1.77v-3.9Zm0 5.84v3.9h-1.94v-3.89Zm0 5.84v3.9h-1.95v-3.89Zm0 5.85v3.89h-1.95v-3.89Zm0 5.84v3.89h-1.95v-3.9Zm0 5.84v3.9h-2v-3.9Zm0 5.84v3.9h-1.94V465Zm0 5.84v3.9h-1.67v-3.89Zm0 5.85v3.89h-1.95v-3.89Zm0 5.84v3.89h-1.94v-3.9Zm0 5.84v3.89h-2v-3.9Zm0 5.84v3.9h-1.95v-3.89Zm0 5.84v3.9h-1.94V500Zm0 5.85v.9a6.3 6.3 0 0 0 .48 2.53l-1.79.78a8.3 8.3 0 0 1-.64-3.31v-.9Zm1.34 4.74L344.8 512a5.46 5.46 0 0 0 4.29 1.57l-.12-1.94a3.6 3.6 0 0 1-2.81-1Zm4.42.65 3.64-1.39.69 1.82-3.64 1.39zm5.45-2.08 3.64-1.39.7 1.82-3.29 1.42-.7-1.82Zm5.46-2.09 3.64-1.38.7 1.82-3.64 1.38zm9.1-3.46.7 1.81-3.64 1.39-.3-1.8Z",className:"cls-41"})),H||(H=ee.createElement("path",{d:"M454.69 270.31a11.1 11.1 0 0 0-4.45 3.15c.06-.28-.08.76.14-.84s1.52-4.06.45-5.53a13.4 13.4 0 0 0-3.26-2.11 5.23 5.23 0 0 0-3.88.11 14.56 14.56 0 0 0-6.25 5.29 25.8 25.8 0 0 0-3.5 8.47c-.23 1.61-.07.56-.1.83a4.66 4.66 0 0 0-4.11.07 16.1 16.1 0 0 0-6.37 5.4 20.5 20.5 0 0 0-3.59 8.6 9.53 9.53 0 0 0 .64 5.68 8.1 8.1 0 0 0 3.57 3c3.41 1.76 11.37-4.51 15.31-6.05l12.49-4.87a14.5 14.5 0 0 0 6.22-5.31 19.9 19.9 0 0 0 3.37-8.42c.23-1.7 1.85-4.08.41-5.53-2.27-2.25-4.92-2.76-7.09-1.94",className:"cls-42"})),S||(S=ee.createElement("path",{d:"M456.59 271.48a11.1 11.1 0 0 0-4.45 3.15c.06-.28-.08.76.14-.84s-.14-5.22-1.35-6.58-3.08-1.79-5.34-.94a14.46 14.46 0 0 0-6.25 5.28 25.8 25.8 0 0 0-3.5 8.47c-.23 1.62-.07.56-.1.83-1.11-.52-2.16-.66-4.11.07a16.1 16.1 0 0 0-6.37 5.4 20.5 20.5 0 0 0-3.59 8.61c-.44 3 .11 5.36 1.36 6.74s3.17 1.77 5.49.86l12.67-4.94 12.49-4.87a14.5 14.5 0 0 0 6.18-5.35 19.9 19.9 0 0 0 3.37-8.41c.4-2.92-.15-5.21-1.34-6.56a4.87 4.87 0 0 0-5.3-.92",className:"cls-43"})),T||(T=ee.createElement("path",{d:"m450.47 285.33 3.89-1.56-7.06 8.97-5.22-4.06 3.89-1.55 1.32-9.22 4.49-1.79z",className:"cls-44"})),U||(U=ee.createElement("path",{d:"m437.44 287.52-3.88 1.56 7.05-8.97 5.22 4.06-3.89 1.56-1.31 9.21-4.5 1.8z",className:"cls-44"})),O||(O=ee.createElement("path",{d:"m543.5 310.61-3.17 1.21-.6-1.59 3.17-1.23.6 1.59ZM519.36 447.5l.6 1.58 2.39-.91-.61-1.58zm4-1.52 3.17-1.21.61 1.59-3.18 1.21zm4.76-1.81 3.17-1.21.61 1.58-3.17 1.21zm4.76-1.82 3.17-1.21.61 1.59-3.17 1.21zm4.76-1.81 3.17-1.22.61 1.59-3.17 1.21zm4.76-1.82 3.17-1.21.61 1.59-3.18 1.21-.61-1.59Zm4.76-1.82 1.63-.62a5.2 5.2 0 0 0 1.24-.68l1 1.36a7.3 7.3 0 0 1-1.64.91l-1.63.62-.61-1.59Zm4-2.33 1.29 1.1a9.8 9.8 0 0 0 1.84-3.2l-1.61-.55a8.2 8.2 0 0 1-1.52 2.65m1.85-4.12 1.69.18a34 34 0 0 0 0-3.49H553c0 1 .08 2.22 0 3.3Zm0-5v-3.4h1.7v3.39Zm0-5.1V417h1.69v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7V400Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.69v3.4Zm0-5.09v-3.4h1.7v3.4Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.4Zm0-5.09V366h1.7v3.4Zm0-5.1v-3.4h1.7v3.4Zm0-5.09v-3.4h1.69v3.39Zm0-5.1v-3.4h1.7v3.4Zm0-5.09v-3.4h1.7V349Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.69v3.39Zm0-5.1v-3.39h1.69v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1a14 14 0 0 0-.15-3.17l1.65-.43a14.6 14.6 0 0 1 .2 3.6ZM552 309l1.3-1.09a4 4 0 0 0-3.88-1.3l.32 1.67a2.28 2.28 0 0 1 2.26.72m-6.9 1-.6-1.58 3.17-1.21.6 1.58Z",className:"cls-41"})),L||(L=ee.createElement("path",{d:"m378.82 458.09.55 59.81h-.83l-2.12-1.2-.31-.19c-2.32-1.33-3.24-4.07-3.24-6.62l.16-55.08a15.58 15.58 0 0 1 4.08-10.07 12.25 12.25 0 0 1 4.82-3.47l125.53-47.6a6.65 6.65 0 0 1 5.68.18l1.86 1.06.51.3c.81.47 1 .77 1 .83-2.19 8.51-137.71 52.96-137.69 62.05",className:"cls-45"})),ee.createElement("path",{d:"M384.37 442.63 509.9 395a6.62 6.62 0 0 1 5.68.18c2 1.12 3.24 3.47 3.25 6.62l-.17 55.09c0 5.62-4 11.69-8.88 13.56l-125.53 47.6c-4.93 1.87-8.93-1.18-8.94-6.79l.17-55.09c-.02-5.59 3.97-11.67 8.89-13.54",style:{fillRule:"evenodd",fill:"url(#linear-gradient-9)"}}),A||(A=ee.createElement("path",{d:"M514.65 437.32c-.21-7.81-2.8-10.82-6.75-10.3a8.6 8.6 0 0 0-1.91.5c-4 1.59-8.61 6.58-10.52 15.72-1.21 5.79-3.1 11-8.39 13.07-13.86 5-3.35-35.06-16.53-29.86-11.35 4.47-8.19 27-14.25 40.15-2.11 4.55-5 6.42-6.89 7.17-8 2.88-7-9.72-7.2-15.12-1-24.92-3.61-26.67-8.49-24.74-5.12 2.06-7.49 3.61-10.27 29.1-1.13 10.42-2.83 19.66-10.76 23-8.82 3.47-8.16-6.16-11.11-11.32-1.75-3.07-4.46-4-7.22-2.95-3 1.18-6 4.75-8 10.66-3.26 9.91-4.46 24.09-4.63 29.08l132.67-51.77c.02-7.59.43-15.64.25-22.39",className:"cls-45"})),q||(q=ee.createElement("path",{d:"m343.81 402.35.63 35.95h-.9l-2.29-1.3c-2.5-1.43-3.5-4.4-3.5-7.14l.14-30.85a16.85 16.85 0 0 1 4.41-10.88 13.2 13.2 0 0 1 5.19-3.74l40.14-15.06a7.15 7.15 0 0 1 6.13.2l2 1.14c1 .56 1.3.93 1.28 1-2.34 9.21-53.26 20.84-53.23 30.68",className:"cls-47"})),P||(P=ee.createElement("path",{d:"m349.8 385.66 40.13-15.05a7.09 7.09 0 0 1 6.13.19c2.14 1.21 3.5 3.74 3.51 7.15l-.15 30.85c0 6.06-4.27 12.62-9.58 14.64l-40.14 15.05c-5.31 2-9.63-1.27-9.65-7.33l.15-30.85c-.02-6.06 4.28-12.63 9.6-14.65",className:"cls-44"})),ee.createElement("path",{d:"M354.72 397.61a7.09 7.09 0 0 1 4.13-6.3c2.34-.88 4.19.52 4.19 3.13a7.18 7.18 0 0 1-4.17 6.38c-2.3.87-4.15-.58-4.15-3.21m8.39 24.56a7.19 7.19 0 0 1-4.17 6.37c-2.3.87-4.15-.58-4.16-3.21a7.1 7.1 0 0 1 4.13-6.31c2.34-.89 4.19.52 4.2 3.15m16.47-20.1a7.24 7.24 0 0 1 4.18-6.37c2.28-.87 4.14.58 4.15 3.21a7.11 7.11 0 0 1-4.13 6.29c-2.3.87-4.19-.52-4.2-3.13m-27.78-3.36c0 4.48 3.21 6.87 7.08 5.4a11.76 11.76 0 0 0 6.33-6.83l11.71 3.79a8.2 8.2 0 0 0-.22 2.09 6 6 0 0 0 .23 1.86l-11.67 12.67c-1.18-2.17-3.57-3.07-6.35-2-3.88 1.47-7.05 6.34-7 10.77s3.2 6.85 7.07 5.38 7.11-6.29 7.1-10.76l-.05-.25 12.31-13.22c1.26 1.38 3.23 1.81 5.49 1 3.91-1.48 7-6.32 7-10.74s-3.16-6.89-7.07-5.4a10.8 10.8 0 0 0-5.48 5.07l-12.34-3.81v-.33c0-4.47-3.22-6.85-7.13-5.36s-7.01 6.2-7.01 10.67",style:{fillRule:"evenodd",fill:"url(#linear-gradient-10)"}}),V||(V=ee.createElement("path",{d:"m357 305.12.37 55.08h-.71l-1.79-1c-2-1.12-2.74-3.44-2.74-5.59l.24-51.09a13.17 13.17 0 0 1 3.45-8.52 10.4 10.4 0 0 1 4.07-2.93l40-15a5.61 5.61 0 0 1 4.8.16l1.58.89c.79.44 1 .73 1 .78-1.87 7.24-50.27 19.52-50.27 27.22",className:"cls-43"})),F||(F=ee.createElement("path",{d:"m361.68 292.06 40-15a5.56 5.56 0 0 1 4.8.15c1.67.95 2.74 2.93 2.74 5.59l-.24 51.1c0 4.74-3.35 9.88-7.5 11.46l-40 15c-4.16 1.58-7.54-1-7.55-5.74l.25-51.1c-.03-4.74 3.34-9.88 7.5-11.46",className:"cls-44"})),ee.createElement("path",{d:"m361.68 292.06 40-15a5.56 5.56 0 0 1 4.8.15c1.67.95 2.74 2.93 2.74 5.59l-.22 40.73-55 20.59.2-40.6c-.05-4.74 3.32-9.88 7.48-11.46",style:{fillRule:"evenodd",fill:"url(#linear-gradient-11)"}}),R||(R=ee.createElement("path",{d:"M404 329.65c0-.95-.64-1.46-1.44-1.14l-18.08 6.68a2.66 2.66 0 0 0-1.47 2.3v1.87c0 .95.64 1.46 1.44 1.14l18.08-6.68a2.66 2.66 0 0 0 1.47-2.3ZM403.91 337.87c0-.83-.55-1.28-1.26-1-10.25 3.79-27.06 10-37.31 13.75a2.31 2.31 0 0 0-1.29 2v1.65c0 .84.56 1.29 1.26 1 10.26-3.79 27.06-10 37.31-13.75a2.34 2.34 0 0 0 1.3-2Z",className:"cls-50"})),ee.createElement("path",{d:"m365.9 303.54-9 3.48-.28 32.98 9-3.47.32-32.95Zm27-20.45-9 3.47-.42 44.11 9-3.48zm-13.51 12.76-.36 36.55-9 3.48.36-36.56zM406 322l-9 3.47.32-32.94 9-3.48Z",style:{fillRule:"evenodd",fill:"#5f97d0"}}),ee.createElement("path",{d:"M406.23 302a.57.57 0 0 0 0-.86.76.76 0 0 0-.95-.16l-8.53 6.39-4.1.93-8.73-3.74-5.25-7.19a.82.82 0 0 0-.95-.31.6.6 0 0 0-.15.11l-12.65 11.25-7.64.31c-.37-.09-.69.1-.7.42a.81.81 0 0 0 .64.76l8-.23a.64.64 0 0 0 .58-.11l12.36-11 4.86 6.66a.86.86 0 0 0 .38.29l9.2 3.94a.8.8 0 0 0 .46.05l4.39-1a.7.7 0 0 0 .25-.1Z",style:{fillRule:"evenodd",fill:"#4f66af",mixBlendMode:"multiply",opacity:.5}}),B||(B=ee.createElement("path",{d:"M406.22 302.13a.73.73 0 0 0 0-1 .67.67 0 0 0-.95-.16l-8.54 7.82-4.14 1.21-8.73-4-5.23-8.24a.75.75 0 0 0-.95-.33.5.5 0 0 0-.15.14l-12 13.33-8.36-2.13a.55.55 0 0 0-.7.53.88.88 0 0 0 .64.86l8.68 2.21a.56.56 0 0 0 .58-.15l11.73-13 4.85 7.63a.8.8 0 0 0 .37.33l9.2 4.28a.67.67 0 0 0 .46.05l4.4-1.34a.46.46 0 0 0 .24-.12Z",className:"cls-44"})),W||(W=ee.createElement("path",{d:"M508.74 286.69c0-.76-.51-1.16-1.16-.89l-19.74 7.72a2.18 2.18 0 0 0-1.2 1.87v1.52c0 .76.52 1.16 1.17.89l19.74-7.72a2.2 2.2 0 0 0 1.2-1.88Z",className:"cls-53"})),I||(I=ee.createElement("path",{d:"M531 253c0-1.7.62-2.63-.07-3.69a9.8 9.8 0 0 0-2.64-2 5.35 5.35 0 0 0-4.66-.06l-51.33 20.8c-4.13 1.66-7.53 6.94-7.59 11.8l-.21 24.37a7.42 7.42 0 0 0 1.36 4.76 8 8 0 0 0 3.21 2.21c1.06.29 1.49-.65 2.81-1.18l51.32-20.84c4.14-1.66 7.54-6.95 7.6-11.8Z",className:"cls-42"})),Y||(Y=ee.createElement("path",{d:"M532.17 253.94c.06-4.85-3.24-7.45-7.37-5.79L473.48 269c-4.13 1.66-7.54 6.95-7.6 11.8l-.2 24.38c-.06 4.85 3.24 7.44 7.37 5.79l51.32-20.85c4.14-1.66 7.54-6.94 7.6-11.79Z",className:"cls-44"})),ee.createElement("path",{d:"M532.17 253.94c.06-4.85-3.24-7.45-7.37-5.79L473.48 269c-4.13 1.66-7.54 6.95-7.6 11.8v2.29a12 12 0 0 1 1.4-.67l64.89-26.36Z",style:{fillRule:"evenodd",fill:"url(#linear-gradient-12)"}}),ee.createElement("path",{d:"M521.71 267.38c-5 .41-9.51 5.61-10.12 11.63s2.93 10.56 7.91 10.15 9.51-5.62 10.12-11.63-2.93-10.53-7.91-10.15",style:{fillRule:"evenodd",fill:"url(#linear-gradient-13)"}}),ee.createElement("path",{d:"M521.2 272.4c2.68-.22 4.59 2.23 4.27 5.47s-2.77 6.05-5.46 6.27-4.6-2.23-4.27-5.47 2.77-6.05 5.46-6.27m-3.2 6.08c-.17 1.72.84 3 2.27 2.91a3.63 3.63 0 0 0 2.9-3.33c.17-1.73-.84-3-2.27-2.91a3.62 3.62 0 0 0-2.9 3.33",style:{fillRule:"evenodd",fill:"url(#linear-gradient-14)"}}),X||(X=ee.createElement("path",{d:"M508.89 277.27c0-1.29-.87-2-2-1.51l-33.44 13.07a3.72 3.72 0 0 0-2 3.18v2.56c0 1.3.86 2 2 1.51L506.82 283a3.77 3.77 0 0 0 2-3.19Z",className:"cls-53"})),Q||(Q=ee.createElement("path",{d:"M527.31 251.1a2.75 2.75 0 0 0-2.21 2.53c-.13 1.31.64 2.3 1.73 2.22a2.77 2.77 0 0 0 2.21-2.54c.13-1.31-.64-2.31-1.73-2.21M522.13 253.16a2.75 2.75 0 0 0-2.21 2.53c-.13 1.31.64 2.3 1.73 2.21a2.74 2.74 0 0 0 2.2-2.53c.15-1.31-.64-2.3-1.72-2.21M516.52 255.43a2.74 2.74 0 0 0-2.21 2.53c-.13 1.31.64 2.31 1.73 2.22a2.76 2.76 0 0 0 2.2-2.54c.13-1.31-.64-2.3-1.72-2.21",className:"cls-44"})),ee.createElement("path",{d:"m420.66 348.77.15 51.32h-.9l-2.29-1.29c-2.5-1.43-3.5-4.39-3.5-7.14l.63-46.22a16.84 16.84 0 0 1 4.4-10.88 13.4 13.4 0 0 1 5.2-3.74L529.17 291a7.15 7.15 0 0 1 6.13.2l2 1.14c1 .56 1.3.93 1.29 1-2.35 9.2-117.95 45.59-117.93 55.43",style:{fillRule:"evenodd",fill:"url(#linear-gradient-15)"}}),ee.createElement("path",{d:"m426.65 332.09 104.82-39.82a7.09 7.09 0 0 1 6.13.2c2.14 1.2 3.5 3.74 3.51 7.14l-.63 46.23c0 6.06-4.27 12.62-9.58 14.64l-104.82 39.81c-5.32 2-9.64-1.27-9.65-7.33l.62-46.23c-.05-6.06 4.29-12.63 9.6-14.64",style:{fillRule:"evenodd",fill:"#ade1f7"}}),J||(J=ee.createElement("path",{d:"m422.12 350.74 59.67-22.44a1.73 1.73 0 0 1 1.47 0 1.9 1.9 0 0 1 .84 1.71v2.29a3.94 3.94 0 0 1-2.29 3.5l-59.67 22.45a1.65 1.65 0 0 1-2.31-1.75l-.05-2.3a4 4 0 0 1 2.34-3.46M422.15 364.72l59.67-22.45a1.73 1.73 0 0 1 1.47.05 1.9 1.9 0 0 1 .84 1.71v2.29a3.94 3.94 0 0 1-2.29 3.5l-59.67 22.45c-1.27.48-2.31-.31-2.31-1.76v-2.29a4 4 0 0 1 2.29-3.5M458.17 364.79l23.68-8.54a1.7 1.7 0 0 1 1.47.05 1.89 1.89 0 0 1 .84 1.71v2.29a4 4 0 0 1-2.29 3.5l-23.68 8.53c-1.27.48-2.3-.3-2.3-1.75l-.05-2.29a4 4 0 0 1 2.33-3.5",className:"cls-59"})),$||($=ee.createElement("path",{d:"M536.33 321.84c-.5 15.55-11.69 33-25 39s-23.58-5.67-23.2-17.38 3.23-16.19 7.81-23.29c2 1.48 3.91 3 5.87 4.41-3 4.56-4.82 7.48-5.06 15s6.36 15 14.91 11.17 15.74-15.07 16.06-25.06Z",className:"cls-41"})),ee.createElement("path",{d:"M529.89 305.07c4.21 3.13 6.69 9 6.44 16.77l-8.62 3.86c.16-5-1.42-8.76-4.13-10.77 2.11-3.28 4.22-6.55 6.31-9.86",style:{fill:"#413b89",fillRule:"evenodd"}}),K||(K=ee.createElement("path",{d:"M513.13 304.45c6.66-3 12.58-2.53 16.76.6q-3.14 4.95-6.31 9.88c-2.7-2-6.5-2.31-10.76-.4a27.27 27.27 0 0 0-11.13 10.22c-1.95-1.46-3.91-2.91-5.87-4.39 4.52-7.07 10.64-12.93 17.31-15.91",className:"cls-47"})))))))}},73712:(e,a,t)=>{"use strict";t.d(a,{A:()=>re});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee,ae,te=t(30758);function le(){return le=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...re}=e;return te.createElement("svg",le({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},re),a?te.createElement("title",{id:t},a):null,l||(l=te.createElement("defs",null,te.createElement("linearGradient",{id:"linear-gradient",x1:565.39,x2:495.35,y1:420.19,y2:282.33,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f79b5e"}),te.createElement("stop",{offset:.29,stopColor:"#faad60"}),te.createElement("stop",{offset:.71,stopColor:"#fec162"}),te.createElement("stop",{offset:1,stopColor:"#ffc863"})),te.createElement("linearGradient",{id:"linear-gradient-2",x1:285.83,x2:379.21,y1:329.1,y2:255.86,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.05,stopColor:"#fad05a"}),te.createElement("stop",{offset:.33,stopColor:"#fac85a"}),te.createElement("stop",{offset:.77,stopColor:"#f9b159"}),te.createElement("stop",{offset:1,stopColor:"#f8a359"})),te.createElement("linearGradient",{id:"Degradado_sin_nombre_8",x1:-238.49,x2:-177.57,y1:214.05,y2:214.05,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#2272b9"}),te.createElement("stop",{offset:.41,stopColor:"#2851a5"}),te.createElement("stop",{offset:.77,stopColor:"#2c3a97"}),te.createElement("stop",{offset:1,stopColor:"#2d3292"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-2",x1:-238.49,x2:-177.57,y1:201.84,y2:201.84}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-3",x1:401.41,x2:411.9,y1:296.15,y2:296.15}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-4",x1:268.16,x2:289.98,y1:319.83,y2:319.83}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-5",x1:385.35,x2:405.29,y1:280.92,y2:280.92}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-6",x1:265.75,x2:303.59,y1:348.64,y2:348.64}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-3",x1:359.98,x2:355.26,y1:435.36,y2:502.61}),te.createElement("linearGradient",{id:"Degradado_sin_nombre_20",x1:2247.71,x2:2248.15,y1:1747.66,y2:1768.82,gradientTransform:"matrix(1 0 0 -1 -1925.89 2236.11)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#4280c1"}),te.createElement("stop",{offset:1,stopColor:"#2c469c"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-7",x1:104.86,x2:132.76,y1:-1008.33,y2:-1008.33,gradientTransform:"matrix(1 0 0 -1 206.83 -529.81)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-8",x1:104.86,x2:132.76,y1:-1002.74,y2:-1002.74,gradientTransform:"matrix(1 0 0 -1 201.44 -522.76)"}),te.createElement("linearGradient",{id:"linear-gradient-4",x1:-170.29,x2:-162.71,y1:491.86,y2:464.9,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f8a034"}),te.createElement("stop",{offset:1,stopColor:"#ffc546"})),te.createElement("linearGradient",{id:"linear-gradient-5",x1:-171.61,x2:-180.96,y1:492.77,y2:473.38,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#fcb72c"}),te.createElement("stop",{offset:1,stopColor:"#ffcf44"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-6",x1:-159.94,x2:-156.6,y1:494.04,y2:481.56}),te.createElement("linearGradient",{id:"Degradado_sin_nombre_40",x1:2203.56,x2:2217.63,y1:375.96,y2:327.52,gradientTransform:"translate(-1999.3)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.32,stopColor:"#4b6ab1"}),te.createElement("stop",{offset:1,stopColor:"#5f83c2"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-7",x1:372.33,x2:390.94,y1:-430.67,y2:-430.67,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-2",x1:1985.87,x2:1986.03,y1:1164.62,y2:1172.42,gradientTransform:"matrix(1 0 0 -1 -1734.37 1560.92)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-9",x1:376.55,x2:386.93,y1:-417.87,y2:-417.87,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-10",x1:376.55,x2:386.93,y1:-415.79,y2:-415.79,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-8",x1:-136.52,x2:-117.91,y1:1145.89,y2:1145.89,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-3",x1:2495.13,x2:2495.29,y1:-412.16,y2:-404.35,gradientTransform:"matrix(1 0 0 -1 -2270.59 -94.67)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-11",x1:-132.3,x2:-121.92,y1:1158.69,y2:1158.69,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-12",x1:-132.3,x2:-121.92,y1:1160.77,y2:1160.77,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-9",x1:245.28,x2:263.55,y1:1537.31,y2:1537.31,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-4",x1:2112.62,x2:2112.78,y1:-802.23,y2:-794.56,gradientTransform:"matrix(1 0 0 -1 -1931.15 -445.99)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-13",x1:249.42,x2:259.61,y1:1549.87,y2:1549.87,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-14",x1:249.42,x2:259.61,y1:1551.92,y2:1551.92,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-2",x1:2213.93,x2:2231.66,y1:315.06,y2:315.06}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-3",x1:1103.42,x2:1121.15,y1:-756.73,y2:-756.73,gradientTransform:"rotate(97.83 181.079 -557.587)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-4",x1:2000.36,x2:2018.09,y1:997.1,y2:997.1,gradientTransform:"rotate(-31.9 -27.936 3872.469)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-5",x1:2195.3,x2:2207.35,y1:428.47,y2:386.97}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-6",x1:214.91,x2:214.92,y1:392.54,y2:392.52}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-7",x1:2197.89,x2:2217.64,y1:404.17,y2:336.15}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-8",x1:2227.24,x2:2248.16,y1:408.53,y2:336.45}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-9",x1:2237.02,x2:2246.13,y1:432.92,y2:401.53}),te.createElement("linearGradient",{id:"linear-gradient-10",x1:265.86,x2:189.33,y1:476.69,y2:461.55,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#242259"}),te.createElement("stop",{offset:1,stopColor:"#635b75"})),te.createElement("linearGradient",{id:"linear-gradient-11",x1:186.21,x2:258.64,y1:452.06,y2:452.06,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#3159a7"}),te.createElement("stop",{offset:1,stopColor:"#557ebe"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-10",id:"linear-gradient-12",x1:179.63,x2:263.01,y1:446.75,y2:446.75}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-13",x1:193.88,x2:258.04,y1:470.3,y2:470.3}),te.createElement("linearGradient",{id:"linear-gradient-14",x1:395.32,x2:454.96,y1:436.41,y2:436.41,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f2f2f2"}),te.createElement("stop",{offset:1,stopColor:"#e8e7f3"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-15",x1:464.99,x2:487.23,y1:375.07,y2:456.24}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-17",x1:476.82,x2:406.97,y1:468.87,y2:388.09}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-18",x1:437.15,x2:469.7,y1:439.7,y2:486.53}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-5",x1:1218.31,x2:1218.65,y1:-1516.5,y2:-1499.56,gradientTransform:"translate(-734.01 1982.54)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-16",x1:1136.58,x2:1158.94,y1:2257.54,y2:2257.54,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-17",x1:1136.58,x2:1158.94,y1:2262.02,y2:2262.02,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-19",x1:164.71,x2:164.71,y1:477.26,y2:421.44}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-20",x1:172.5,x2:172.5,y1:477.26,y2:421.44}),te.createElement("linearGradient",{id:"linear-gradient-21",x1:178.81,x2:171.39,y1:434.22,y2:460.11,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#fdf4b6"}),te.createElement("stop",{offset:1,stopColor:"#d07e2b"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-21",id:"linear-gradient-22",x1:186.44,x2:179.01,y1:436.41,y2:462.3}),te.createElement("radialGradient",{id:"Degradado_sin_nombre_5",cx:2729.02,cy:262.73,r:8.09,gradientTransform:"matrix(.91 -.1 -.1 -.99 -2089.49 867.93)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.29,stopColor:"#fff",stopOpacity:.6}),te.createElement("stop",{offset:.99,stopColor:"#fff",stopOpacity:0})),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-2",cx:2537.06,cy:418.26,r:52.01,gradientTransform:"matrix(1 0 0 -1 -2234.75 751.65)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-3",cx:2604.51,cy:410.71,r:71.34,gradientTransform:"matrix(1 0 0 -1 -2234.75 751.65)"}),te.createElement("radialGradient",{id:"radial-gradient",cx:-208.03,cy:147.25,r:28.01,gradientTransform:"matrix(-1 0 0 1.25 132 78.41)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.02,stopColor:"#fff"}),te.createElement("stop",{offset:.08,stopColor:"#dfcabe"}),te.createElement("stop",{offset:.13,stopColor:"#c59c88"}),te.createElement("stop",{offset:.17,stopColor:"#b48166"}),te.createElement("stop",{offset:.19,stopColor:"#ae7659"}),te.createElement("stop",{offset:.24,stopColor:"#9c6a50"}),te.createElement("stop",{offset:.37,stopColor:"#704e3a"}),te.createElement("stop",{offset:.49,stopColor:"#4b3629"}),te.createElement("stop",{offset:.62,stopColor:"#2f241b"}),te.createElement("stop",{offset:.75,stopColor:"#1b1711"}),te.createElement("stop",{offset:.87,stopColor:"#0f100b"}),te.createElement("stop",{offset:1,stopColor:"#0b0d09"})),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-4",cx:-125.99,cy:-945.34,r:3.71,gradientTransform:"matrix(-.33 -.85 -.93 .36 -542.77 685.14)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-5",cx:101.53,cy:-1063,r:23.83,gradientTransform:"scale(-1 1)rotate(-75 862.342 25.433)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-6",cx:132.43,cy:-1066.46,r:32.68,gradientTransform:"scale(-1 1)rotate(-75 862.342 25.433)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-2",cx:2247.96,cy:1368.03,r:13.11,gradientTransform:"matrix(.26 .97 1.2 -.32 -1882.6 -1254.88)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-7",cx:223.65,cy:-347.58,r:1.38,gradientTransform:"matrix(-.29 -.87 -.95 .32 9.23 688.27)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-8",cx:375.31,cy:-438.2,r:8.86,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-9",cx:386.8,cy:-439.49,r:12.16,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-3",cx:1985.45,cy:881.94,r:4.9,gradientTransform:"matrix(.22 .98 1.22 -.27 -1241.39 -1309.43)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-10",cx:-148.92,cy:1273.69,r:1.38,gradientTransform:"matrix(-.77 .49 .54 .84 -588.31 -706.92)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-11",cx:-133.54,cy:1138.35,r:8.86,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-12",cx:-122.04,cy:1137.07,r:12.16,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-4",cx:2494.32,cy:-384.38,r:4.9,gradientTransform:"matrix(.9 -.45 -.56 -1.12 -2226.03 987.75)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-13",cx:311.09,cy:1622.47,r:1.35,gradientTransform:"matrix(-.44 .8 .88 .48 -1130.94 -679.92)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-14",cx:248.2,cy:1529.9,r:8.7,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-15",cx:259.49,cy:1528.64,r:11.94,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-5",cx:2112.89,cy:-697.54,r:4.82,gradientTransform:"matrix(.57 -.82 -1.03 -.71 -1738.53 1597.66)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-16",cx:1367.61,cy:2206.83,r:2.97,gradientTransform:"matrix(.33 -.85 .93 .36 -2071.15 825.22)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-17",cx:1133.91,cy:2213.73,r:19.09,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-18",cx:1158.67,cy:2210.96,r:26.19,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-6",cx:1218.27,cy:-1258.3,r:10.59,gradientTransform:"matrix(-.26 .97 -1.2 -.32 -732.8 -1115.28)"}),te.createElement("style",null,".cls-3{fill:#cccbcb}.cls-6,.cls-79{fill:#231f20}.cls-8{fill:#213f98}.cls-29,.cls-30,.cls-35,.cls-74{fill:none;stroke-miterlimit:10}.cls-15{fill:#2a2e7e}.cls-20{fill:#cf7961}.cls-29,.cls-30{stroke:#2a2e7e}.cls-29{stroke-width:.81px}.cls-30,.cls-74{stroke-width:.41px}.cls-35{stroke:#231f20;stroke-width:.61px}.cls-72{fill:url(#linear-gradient-14)}.cls-74{stroke:#003953}.cls-79{fill-rule:evenodd}.cls-89{fill:#1f1a4e}.cls-90{fill:#f79f81}.cls-91{fill:#373175}.cls-92{fill:#242259}.cls-93{fill:#1e4380}"))),te.createElement("g",{style:{isolation:"isolate"}},te.createElement("g",{id:"Layer_2","data-name":"Layer 2"},te.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},te.createElement("path",{d:"M0 0h600v600H0z",style:{fill:"#fff"}}),r||(r=te.createElement("g",{id:"shadow"},te.createElement("path",{id:"shadow-2",d:"M48 491.94S4.84 495.29 21.74 498s472.56 1.18 371.36-11.46c-63.74-8-192.22-6.32-256.75-3.09S48 491.94 48 491.94",className:"cls-3","data-name":"shadow"}),te.createElement("path",{d:"M473 471.83s79.21 15.78 34.09 15.21-108.39 0-63.18-8.73 29.09-6.48 29.09-6.48",className:"cls-3"}))),te.createElement("g",{id:"tree"},te.createElement("path",{d:"M509.66 398.08c22.87-1.47 49.25-27.31 42.3-43.3s-8.55-26.58-1.51-37.38c6.38-9.81-17.46-51.33-8.41-67.24-3.38-3.2-8.06-5-12.38-3.52-5.47 1.87-8.2 7.91-9.92 13.43a128.6 128.6 0 0 0-4.32 18.67c-.92 6-1.57 12.5-5.46 17.18-4.28 5.14-11.5 6.91-16.25 11.61a17.74 17.74 0 0 0-4.94 15.29c.82 4.85 3.62 9.09 5.61 13.58s3.14 9.91.7 14.18c-2.16 3.75-6.51 5.6-9.53 8.71-3.85 4-5.29 9.88-4.6 15.37s3.31 10.58 6.6 15a52 52 0 0 0 5.72 6.48 46.6 46.6 0 0 0 16.39 1.94",style:{fill:"url(#linear-gradient)"}}),te.createElement("path",{d:"M532.22 421.28c4.87-10.54 22.45-17.86 29.25-23.67 7.17-6.14 13.74-14.37 15.11-24 1.53-10.76-4.35-16.51-9.3-25-8.19-14 8.38-27.72 2.77-41.78-2.9-7.24-11.41-10.48-16-16.79-3.67-5-4.48-11.56-5-17.78s-.89-12.69-3.91-18.15a16.9 16.9 0 0 0-3.12-4c-9 15.91 14.79 57.43 8.41 67.24-7 10.8-5.45 21.39 1.51 37.38s-19.43 41.83-42.3 43.3a46.6 46.6 0 0 1-16.39-1.92 52.3 52.3 0 0 0 11 8c9.75 5.37 21.75 8.03 27.97 17.17",style:{fill:"#f69159"}}),c||(c=te.createElement("path",{d:"m555.45 360.95-.46-.42L532.53 385v-59.39l14.65-18.56-.48-.39-14.17 17.95V264.8h-.62v31.37l-9.97-14.51-.52.35 10.49 15.25v47.98l-26.48-26.71-.44.43 26.92 27.16v57.33l-34.06-33.94-.44.44 34.5 34.38v62.69h.62v-81.1z",className:"cls-6"}))),te.createElement("g",{id:"bulb"},te.createElement("path",{d:"M340 355c-5.54.33-55.2-3.11-55.2-53.74 0-32.75 24-33.06 28.48-78h53.44c4.48 44.9 27.26 45.21 27.26 78C394 351.89 345.57 355.33 340 355",style:{fill:"url(#linear-gradient-2)"}}),s||(s=te.createElement("path",{d:"M366.5 223.3h-53.19v-30.55a4.18 4.18 0 0 1 4.18-4.18h44.83a4.18 4.18 0 0 1 4.18 4.18z",className:"cls-8"})),te.createElement("rect",{width:60.92,height:9.46,x:309.57,y:209.32,rx:1.94,style:{fill:"url(#Degradado_sin_nombre_8)"}}),te.createElement("rect",{width:60.92,height:9.46,x:309.57,y:197.11,rx:1.94,style:{fill:"url(#Degradado_sin_nombre_8-2)"}}),n||(n=te.createElement("path",{d:"M327.64 178.81h24.77a4 4 0 0 1 4 4v5.76h-32.77v-5.76a4 4 0 0 1 4-4",className:"cls-8"})),te.createElement("path",{d:"M367.27 340.71a3.9 3.9 0 1 0-3.42 4.64 4.09 4.09 0 0 0 3.42-4.64",style:{fill:"url(#Degradado_sin_nombre_5)"}}),te.createElement("path",{d:"M329.14 313.64c-1-9.19-8.56-15.91-16.95-15s-14.41 9.05-13.44 18.23 8.55 15.91 16.95 15 14.41-9.05 13.44-18.23",style:{fill:"url(#Degradado_sin_nombre_5-2)"}}),te.createElement("path",{d:"M368.66 331.81c14.34-11.54 12.7-30.79 11-47.24-.48-4.66 6.8-4.63 7.28 0 1.9 18.34 2.74 39.62-13.13 52.4-3.62 2.91-8.81-2.22-5.15-5.16",style:{fill:"url(#Degradado_sin_nombre_5-3)"}}),te.createElement("path",{d:"M347.94 223.3v57.36s-.84 17.45 11.28 18 1.15-20.4-15.81-20.4-29 3.28-27.58 15.61 14 4.2 14-17.84V223.3",style:{fill:"none",strokeMiterlimit:10,strokeWidth:".94px",stroke:"url(#radial-gradient)"}}),i||(i=te.createElement("path",{d:"M343.91 141.9h1.12v31.82h-1.12zM328.69 113.58h1.12v16.86h-1.12zM328.69 136.76h1.12v27.4h-1.12zM358.96 136.59h1.12v27.4h-1.12zM358.96 111.13h1.12v13.7h-1.12zM312.75 150.29h1.12v24.6h-1.12zM369.93 169.87h1.12v13.81h-1.12z",className:"cls-15"})),te.createElement("path",{d:"m405.93 328.41-1-.45a70.91 70.91 0 0 0-3.49-63.5l1-.56a72 72 0 0 1 3.55 64.51Z",style:{fill:"url(#Degradado_sin_nombre_8-3)"}}),te.createElement("path",{d:"M289.19 350.48a71.4 71.4 0 0 1-21-50.8 73.4 73.4 0 0 1 .76-10.49l1.11.16a71 71 0 0 0-.75 10.33 70.3 70.3 0 0 0 20.7 50Z",style:{fill:"url(#Degradado_sin_nombre_8-4)"}}),te.createElement("path",{d:"m404.72 307.92-1.11-.15a62.52 62.52 0 0 0-18.26-53l.78-.8a63.68 63.68 0 0 1 18.59 54Z",style:{fill:"url(#Degradado_sin_nombre_8-5)"}}),te.createElement("path",{d:"M303.16 370.33a63.14 63.14 0 0 1-34.45-34.28 65 65 0 0 1-3-8.82l1.09-.27a63 63 0 0 0 2.9 8.66 62 62 0 0 0 33.85 33.67Z",style:{fill:"url(#Degradado_sin_nombre_8-6)"}})),m||(m=te.createElement("path",{d:"M157.21 336.91s4.65.72 5.79.49 4.62-1.1 6.12-.68 2.73-.31 2.76.49-2.6 1.86-4.28 1.87c0 0 7.55 1.62 8.43 1.74s2.24 2.86 1.78 3.88-6.88 4-8.26 4.07-14.16-4.77-14.16-4.77Z",className:"cls-20"})),te.createElement("g",{id:"bulb-2","data-name":"bulb"},te.createElement("path",{d:"M388 461.73c.8 2.41 5.2 24.78-17.2 30.81-14.48 3.91-17.48-6.68-37.87-3.31l-3.12-11.58-.13-.47-3.12-11.59c19.33-7.33 16.75-17.44 31.24-21.34 22.37-6.03 29.66 14.99 30.2 17.48",style:{fill:"url(#linear-gradient-3)"}}),te.createElement("path",{d:"M309.88 471.58h24.37v11.73a4.18 4.18 0 0 1-4.18 4.18h-16a4.18 4.18 0 0 1-4.18-4.18v-11.73Z",style:{fill:"url(#Degradado_sin_nombre_20)"},transform:"rotate(74.93 322.058 479.529)"}),d||(d=te.createElement("path",{d:"m326.567 465.703 6.336 23.532-11.327 3.05a4.18 4.18 0 0 1-5.123-2.95l-4.16-15.45a4.18 4.18 0 0 1 2.95-5.122l11.326-3.05Z",className:"cls-8"})),te.createElement("rect",{width:27.9,height:4.33,x:311.68,y:476.35,rx:1.48,style:{fill:"url(#Degradado_sin_nombre_8-7)"},transform:"rotate(-105.07 325.641 478.514)"}),te.createElement("rect",{width:27.9,height:4.33,x:306.28,y:477.8,rx:1.48,style:{fill:"url(#Degradado_sin_nombre_8-8)"},transform:"rotate(-105.07 320.241 479.97)"}),o||(o=te.createElement("path",{d:"m311.199 487.013-2.312-8.584a3.06 3.06 0 0 1 2.16-3.75l1.361-.367 3.9 14.484-1.313.354a3.06 3.06 0 0 1-3.75-2.16Z",className:"cls-8"})),te.createElement("path",{d:"M378.42 451.38a1.79 1.79 0 1 0 2.45 1 1.87 1.87 0 0 0-2.45-1",style:{fill:"url(#Degradado_sin_nombre_5-4)"}}),te.createElement("path",{d:"M371 471.47c-4 1.52-6 5.68-4.63 9.29s5.72 5.29 9.67 3.77 6-5.68 4.62-9.29-5.73-5.24-9.66-3.77",style:{fill:"url(#Degradado_sin_nombre_5-5)"}}),te.createElement("path",{d:"M374.31 451.82c-6.81-5-15.13-1.94-22.2.77-2 .76-2.86-2.46-.87-3.23 7.89-3 17.2-5.93 24.74-.43 1.72 1.26.07 4.16-1.67 2.89",style:{fill:"url(#Degradado_sin_nombre_5-6)"}}),te.createElement("path",{d:"m331.11 482.55-.34-1.25 23.35-6.3c.23-.07.47-.13.71-.18a38 38 0 0 1-1.8-5.31 9 9 0 0 1-.27-1.41L329 474.53l-.34-1.24 24.08-6.48A11.46 11.46 0 0 1 356 459c1.27-1.23 2.62-1.75 3.7-1.43a2.72 2.72 0 0 1 1.77 2.29c1 4.79-4.21 7.26-7.13 7.9l-.28.07a9 9 0 0 0 .26 1.42 37 37 0 0 0 1.84 5.37c5.63-1 9.69.31 10.39 2.4.17.49.47 2.18-2.42 3.33a5.8 5.8 0 0 1-4.91 0 9.1 9.1 0 0 1-3.78-4.26l-.94.23Zm25.6-6.78a7.64 7.64 0 0 0 3 3.37 4.53 4.53 0 0 0 3.86 0c1.25-.5 1.88-1.15 1.68-1.73-.36-1.19-3.48-2.5-8.54-1.64m2.29-17.06a3.47 3.47 0 0 0-2.13 1.17 10.1 10.1 0 0 0-2.87 6.58c.32-.07 7.2-1.64 6.17-6.38-.11-.52-.35-1.17-.88-1.33a1.4 1.4 0 0 0-.29-.04",style:{fill:"url(#radial-gradient-2)"}})),h||(h=te.createElement("g",{id:"etc"},te.createElement("path",{d:"M365.64 362.67a4.85 4.85 0 1 0 4.85-4.85 4.85 4.85 0 0 0-4.85 4.85ZM281.45 261a3.39 3.39 0 1 0 3.39-3.39 3.38 3.38 0 0 0-3.39 3.39Z",className:"cls-29"}),te.createElement("path",{d:"M298.64 273.2v5.07M300.92 275.73h-4.56M407.75 253.01v5.07M410.03 255.55h-4.56M318.24 436.41v8.1M321.88 440.46h-7.29",className:"cls-30"}))),te.createElement("g",{id:"plant_3","data-name":"plant 3"},te.createElement("path",{d:"M306.27 485.79s-.77-27.15-10.13-29.16-10.69 16.94 0 35.65Z",style:{fill:"url(#linear-gradient-4)"}}),p||(p=te.createElement("path",{d:"M301.43 489.05a.17.17 0 0 1-.16-.12c-4.46-18.32-6.38-25.06-6.4-25.12a.17.17 0 0 1 .11-.2.16.16 0 0 1 .2.11c0 .06 1.94 6.81 6.4 25.14a.16.16 0 0 1-.11.19Z",className:"cls-6"})),te.createElement("path",{d:"M309.51 492.28s14.26-13.81 8.91-20.5-18.72 4.9-22.28 20.5Z",style:{fill:"url(#linear-gradient-5)"}}),f||(f=te.createElement("path",{d:"M303.94 490.43h-.06a.16.16 0 0 1-.09-.21c3.54-8.18 10.44-14.69 10.51-14.76a.17.17 0 0 1 .22 0 .17.17 0 0 1 0 .23c-.07.06-6.93 6.53-10.44 14.65a.14.14 0 0 1-.14.09",className:"cls-6"})),te.createElement("path",{d:"M297.44 492.28s-3.64-15.71-11-14.37 0 14.26 0 14.26Z",style:{fill:"url(#linear-gradient-6)"}}),E||(E=te.createElement("path",{d:"M290.24 490.32a.16.16 0 0 1-.16-.12l-2.45-9.13a.16.16 0 0 1 .11-.19.15.15 0 0 1 .2.11l2.45 9.13a.17.17 0 0 1-.11.2Z",className:"cls-6"}))),te.createElement("g",{id:"plant_1","data-name":"plant 1"},te.createElement("path",{d:"M227.81 372.46c-1-4.25-4.31-7.48-7.2-10.75-10.63-12-16.76-27.27-22.69-42.18a87.37 87.37 0 0 1 30.5 51.47Z",style:{fill:"url(#Degradado_sin_nombre_40)"}}),g||(g=te.createElement("path",{d:"M228.36 371.44c-.42-3.42-2.19-6.33-3.91-9.25-2.16-3.66-4.49-7.21-6.83-10.75-4.66-7.07-9.32-14.16-12.7-21.95-.11-.25-.47 0-.36.21 3.12 7.19 7.32 13.79 11.62 20.32 2.15 3.27 4.33 6.53 6.39 9.87 2.17 3.53 4.86 7.35 5.37 11.55 0 .26.46.27.42 0",className:"cls-6"})),x||(x=te.createElement("path",{d:"M185.28 356.76s36.39 15.33 36.13 96",className:"cls-35"})),y||(y=te.createElement("path",{d:"M222.7 467.66s-10-70.49 24.93-73.37",className:"cls-35"})),te.createElement("path",{d:"M276.37 387.55c.26.91 1.52 9.3-6.9 11.17-5.45 1.21-6.39-2.78-14-1.86l-1-4.36v-.18l-1-4.35c7.3-2.4 6.51-6.21 12-7.41 8.39-1.87 10.75 6.06 10.9 6.99",style:{fill:"url(#linear-gradient-7)"}}),te.createElement("path",{d:"M247 390.12h9.06V392a4 4 0 0 1-4 4h-1a4 4 0 0 1-4-4v-1.87z",style:{fill:"url(#Degradado_sin_nombre_20-2)"},transform:"rotate(77.49 251.579 393.068)"}),u||(u=te.createElement("path",{d:"m253.485 387.98 1.962 8.845-4.285.95a1.52 1.52 0 0 1-1.814-1.154l-1.3-5.858a1.52 1.52 0 0 1 1.155-1.813l4.296-.953Z",className:"cls-8"})),te.createElement("path",{d:"m251.19 388.65 1.9 8.56a.8.8 0 0 0 1 .61.82.82 0 0 0 .61-1l-1.9-8.56a.8.8 0 0 0-1-.61.79.79 0 0 0-.61 1",style:{fill:"url(#Degradado_sin_nombre_8-9)"}}),te.createElement("path",{d:"m249.16 389.1 1.9 8.56a.8.8 0 0 0 1 .61.82.82 0 0 0 .61-1l-1.9-8.56a.81.81 0 0 0-1-.61.79.79 0 0 0-.61 1",style:{fill:"url(#Degradado_sin_nombre_8-10)"}}),M||(M=te.createElement("path",{d:"m246.82 393 .49 2.21a1.66 1.66 0 0 0 2 1.26l-1.23-5.47a1.65 1.65 0 0 0-1.26 2",className:"cls-8"})),te.createElement("path",{d:"M273 383.55a.66.66 0 1 0 .42 1.25.66.66 0 1 0-.42-1.25",style:{fill:"url(#Degradado_sin_nombre_5-7)"}}),te.createElement("path",{d:"M269.89 390.89a2.62 2.62 0 1 0 3.53 1.56 2.73 2.73 0 0 0-3.53-1.56",style:{fill:"url(#Degradado_sin_nombre_5-8)"}}),te.createElement("path",{d:"M271.45 383.65c-2.44-2-5.59-1-8.26-.09-.76.25-1-1-.27-1.21 3-1 6.49-1.92 9.2.25.62.49 0 1.55-.67 1Z",style:{fill:"url(#Degradado_sin_nombre_5-9)"}}),te.createElement("path",{d:"m254.9 394.38-.12-.54 8.78-1.95.22-.05a14 14 0 0 1-.57-2 4 4 0 0 1-.07-.49l-8.91 2-.12-.55 9-2a4.3 4.3 0 0 1 1.36-2.86 1.52 1.52 0 0 1 1.44-.48 1 1 0 0 1 .64.91c.31 1.83-1.7 2.67-2.81 2.86h-.07a3 3 0 0 0 .07.49 14 14 0 0 0 .58 2c2.12-.28 3.6.3 3.83 1.1.06.19.15.85-1 1.25a2.18 2.18 0 0 1-1.86-.1 3.36 3.36 0 0 1-1.33-1.63l-.32.06Zm9.67-2.1a2.8 2.8 0 0 0 1 1.24 1.65 1.65 0 0 0 1.4.05c.34-.12.69-.34.63-.57-.09-.42-1.18-.93-3.03-.72m1.05-6.29a1.3 1.3 0 0 0-.76.39 3.7 3.7 0 0 0-1.16 2.32c.38-.08 2.6-.59 2.32-2.21 0-.19-.11-.42-.28-.48Z",style:{fill:"url(#radial-gradient-3)"}}),te.createElement("path",{d:"M213.28 291.25c.82-.47 8.65-3.71 12.5 4 2.48 5-1.16 6.87 1.57 14.06l-4 2-.16.08-4 2c-4.09-6.51-7.58-4.83-10.07-9.82-3.84-7.75 3.29-11.95 4.16-12.32",style:{fill:"url(#linear-gradient-8)"}}),te.createElement("path",{d:"M220.08 311h9.06v1.87a4 4 0 0 1-4 4h-1a4 4 0 0 1-4-4V311z",style:{fill:"url(#Degradado_sin_nombre_20-3)"},transform:"rotate(-26.44 224.66 314.039)"}),_||(_=te.createElement("path",{d:"m219.237 313.308 8.112-4.035 2.29 4.602a.78.78 0 0 1-.351 1.046l-6.724 3.345a.78.78 0 0 1-1.046-.351l-2.29-4.602z",className:"cls-8"})),te.createElement("path",{d:"m220.41 315.43 7.85-3.91a.81.81 0 0 0 .36-1.08.81.81 0 0 0-1.08-.36l-7.85 3.92a.8.8 0 0 0-.36 1.08.8.8 0 0 0 1.08.35",style:{fill:"url(#Degradado_sin_nombre_8-11)"}}),te.createElement("path",{d:"m221.33 317.29 7.85-3.9a.82.82 0 0 0 .37-1.08.83.83 0 0 0-1.09-.37l-7.84 3.91a.81.81 0 0 0-.37 1.08.8.8 0 0 0 1.08.36",style:{fill:"url(#Degradado_sin_nombre_8-12)"}}),v||(v=te.createElement("path",{d:"m225.64 318.63 2-1a1.67 1.67 0 0 0 .75-2.23l-5 2.49a1.66 1.66 0 0 0 2.25.74",className:"cls-8"})),te.createElement("path",{d:"M210.21 295.5a.66.66 0 1 0 .17-1 .69.69 0 0 0-.17 1",style:{fill:"url(#Degradado_sin_nombre_5-10)"}}),te.createElement("path",{d:"M218.08 296.74a2.61 2.61 0 1 0 .66-3.8 2.73 2.73 0 0 0-.66 3.8",style:{fill:"url(#Degradado_sin_nombre_5-11)"}}),te.createElement("path",{d:"M210.67 297c-1.31 2.85.4 5.66 1.91 8 .42.68-.69 1.23-1.11.56-1.69-2.66-3.43-5.84-2-9 .33-.72 1.51-.33 1.18.39Z",style:{fill:"url(#Degradado_sin_nombre_5-12)"}}),te.createElement("path",{d:"m221.81 312.07-4.11-8.27a4.36 4.36 0 0 1-3.11-.63 1.53 1.53 0 0 1-.81-1.28 1.07 1.07 0 0 1 .73-.85c1.7-.74 3 1 3.46 2v.07a5 5 0 0 0 .46-.19 14.5 14.5 0 0 0 1.79-1c-.79-2-.58-3.57.14-4 .18-.1.79-.35 1.45.65a2.22 2.22 0 0 1 .36 1.83 3.4 3.4 0 0 1-1.27 1.69c0 .1.09.2.14.29l4 8.06-.5.24-4-8.05-.1-.2a14 14 0 0 1-1.76 1 3 3 0 0 1-.46.19l4.06 8.17Zm-6.48-10.65a1.4 1.4 0 0 0-.59.13c-.18.08-.38.21-.4.39s.2.51.57.77a3.74 3.74 0 0 0 2.53.56c-.14-.27-.92-1.85-2.11-1.85m5.45-3a.2.2 0 0 0-.11 0c-.38.21-.61 1.41 0 3.14a2.75 2.75 0 0 0 .95-1.3 1.66 1.66 0 0 0-.29-1.37c-.13-.26-.33-.5-.55-.5Z",style:{fill:"url(#radial-gradient-4)"}}),te.createElement("path",{d:"M160.9 339c.48-.79 5.66-7.32 12.64-2.52 4.52 3.1 2.29 6.44 8.05 11.31l-2.48 3.62-.1.14-2.48 3.61c-6.61-3.63-8.82-.52-13.33-3.62-6.99-4.81-2.87-11.81-2.3-12.54",style:{fill:"url(#linear-gradient-9)"}}),te.createElement("path",{d:"M177 350.19h8.9V352a4 4 0 0 1-4 4h-.9a4 4 0 0 1-4-4v-1.83z",style:{fill:"url(#Degradado_sin_nombre_20-4)"},transform:"rotate(-55.52 181.487 353.106)"}),N||(N=te.createElement("path",{d:"m176.543 355.134 5.038-7.337 3.075 2.112a2.08 2.08 0 0 1 .537 2.892l-2.672 3.89a2.08 2.08 0 0 1-2.892.538l-3.075-2.112z",className:"cls-8"})),te.createElement("path",{d:"m178.55 356.34 4.88-7.1a.79.79 0 0 0-.21-1.1.8.8 0 0 0-1.1.21l-4.87 7.1a.79.79 0 0 0 .2 1.1.8.8 0 0 0 1.1-.21",style:{fill:"url(#Degradado_sin_nombre_8-13)"}}),te.createElement("path",{d:"m180.24 357.5 4.87-7.1a.79.79 0 0 0-.2-1.1.79.79 0 0 0-1.1.2l-4.88 7.1a.8.8 0 0 0 .21 1.1.79.79 0 0 0 1.1-.2",style:{fill:"url(#Degradado_sin_nombre_8-14)"}}),b||(b=te.createElement("path",{d:"m184.57 356.6 1.26-1.83a1.63 1.63 0 0 0-.43-2.27l-3.1 4.5a1.64 1.64 0 0 0 2.27-.4",className:"cls-8"})),te.createElement("path",{d:"M160.29 344.1a.67.67 0 0 0 .93-.23.71.71 0 0 0-1.25-.68.68.68 0 0 0 .32.91",style:{fill:"url(#Degradado_sin_nombre_5-13)"}}),te.createElement("path",{d:"M167.63 341.41a2.57 2.57 0 1 0-1.24-3.58 2.68 2.68 0 0 0 1.24 3.58",style:{fill:"url(#Degradado_sin_nombre_5-14)"}}),te.createElement("path",{d:"M161.38 345.14c.24 3.07 3.05 4.67 5.48 6 .69.38 0 1.38-.69 1-2.71-1.48-5.73-3.38-6-6.78-.06-.77 1.14-1 1.19-.22Z",style:{fill:"url(#Degradado_sin_nombre_5-15)"}}),te.createElement("path",{d:"m178.15 352.79-7.47-5.13a4.3 4.3 0 0 1-3 .94 1.49 1.49 0 0 1-1.31-.72 1 1 0 0 1 .22-1.08c1.11-1.45 3.07-.57 3.95.1h.05a4 4 0 0 0 .31-.37 13 13 0 0 0 1-1.75c-1.62-1.33-2.2-2.79-1.77-3.49.1-.17.51-.68 1.56-.13a2.17 2.17 0 0 1 1.18 1.39 3.37 3.37 0 0 1-.28 2.06l.26.18 7.28 5-.32.46-7.28-5-.17-.12a14 14 0 0 1-1 1.71 4 4 0 0 1-.3.38l7.38 5.07Zm-9.91-6.22a1.4 1.4 0 0 0-1.17.57c-.11.15-.23.35-.16.52a1.07 1.07 0 0 0 .86.38 3.63 3.63 0 0 0 2.43-.72 4 4 0 0 0-1.96-.75m2.66-5.06a.24.24 0 0 0-.23.11c-.22.35.16 1.5 1.52 2.66a2.64 2.64 0 0 0 .2-1.55 1.63 1.63 0 0 0-.9-1 1.5 1.5 0 0 0-.59-.22",style:{fill:"url(#radial-gradient-5)"}}),k||(k=te.createElement("path",{d:"M225.72 318.81c8.47 26.24-1.55 89-4.61 117.6",className:"cls-35"})),te.createElement("path",{d:"M226.43 321.94s-15.15-3.08-11.11-7.51 8 3.12 8 3.12-4.46-6.29-.74-7.24 4.73 6.5 4.73 6.5-.88-9.46 2.84-8.57 2.85 10.76-3.72 13.7",style:{fill:"url(#Degradado_sin_nombre_40-2)"}}),te.createElement("path",{d:"M244.35 394s5.11-14.59 8.94-10-4.18 7.54-4.18 7.54 6.83-3.56 7.27.25-7.09 3.8-7.09 3.8 9.5.42 8.12 4-11.04 1.31-13.06-5.59",style:{fill:"url(#Degradado_sin_nombre_40-3)"}}),te.createElement("path",{d:"M188.24 359.24s-14.49 5.39-13.4-.5 8.48-1.6 8.48-1.6-7.11-3-4.45-5.75 7.45 3 7.45 3-5.75-7.58-2.12-8.79 8.03 7.69 4.04 13.64",style:{fill:"url(#Degradado_sin_nombre_40-4)"}}),te.createElement("path",{d:"M220.14 426.62c-9.21-3.56-14.26-13.32-18-22.47s-7.34-19.15-15.52-24.66c6.61.16 12.41 4.79 16 10.35s5.33 12.05 7.43 18.31 10.09 18.47 10.09 18.47",style:{fill:"url(#Degradado_sin_nombre_40-5)"}}),te.createElement("path",{d:"M214.91 392.54",style:{fill:"url(#Degradado_sin_nombre_40-6)"}}),te.createElement("path",{d:"M213.28 393.93c-4.34-10-7.93-20.52-9.16-31.39s0-22.21 5-32a53.8 53.8 0 0 1 5.81 40c-1.76 7-4.94 14.38-2.33 21.12",style:{fill:"url(#Degradado_sin_nombre_40-7)"}}),te.createElement("path",{d:"M226.29 392.68c6.91-10.41 7.52-23.64 11.55-35.47a63.15 63.15 0 0 1 13.88-23c-1.71 10.9-2.26 22.06-5.43 32.63s-9.54 20.85-19.54 25.52",style:{fill:"url(#Degradado_sin_nombre_40-8)"}}),te.createElement("path",{d:"M223.75 422.18c.84-5 5.51-8.49 10.34-9.9s10-1.2 15-1.72 10.27-2 13.55-5.78c-.18 6.29-5 11.78-10.85 14.2s-12.39 2.26-18.61 1.25c-3.1-.51-6.67-1.09-9 1",style:{fill:"url(#Degradado_sin_nombre_40-9)"}}),j||(j=te.createElement("path",{d:"M223.94 422.28c6-11.16 22.37 2.47 29.49-7.61.16-.23-.2-.44-.36-.22-7 9.92-23.38-3.75-29.5 7.62-.12.24.24.45.37.21M225.35 393.25a20.64 20.64 0 0 0 7.66-6.69 71.4 71.4 0 0 0 7-11.39c3.78-7.89 4.47-16.76 5.1-25.36 0-.27-.4-.27-.42 0-.63 8.54-1.31 17.3-5.05 25.15a73.5 73.5 0 0 1-6 10c-2.27 3.28-4.84 6.22-8.52 7.94-.24.12 0 .48.22.37ZM211.7 389.75a118.9 118.9 0 0 1-2.6-39.62c0-.26-.4-.26-.42 0a119.6 119.6 0 0 0 2.61 39.73c.06.27.47.16.41-.11M220.25 426.44c-4.32-3.08-9.2-6.39-11.11-11.56-1.3-3.52-2.31-7.15-3.5-10.7-2.14-6.38-4.66-15.71-10.79-19.48a.21.21 0 0 0-.21.36c3.37 2.08 5.32 6.1 6.91 9.59a120 120 0 0 1 4.84 13.18 75 75 0 0 0 2.92 8.62c2.1 4.48 6.82 7.57 10.72 10.35.22.16.43-.2.22-.36",className:"cls-6"})),te.createElement("path",{d:"m258.64 449.98-1.46 7.12-6.21 30.63h-57.09l-6.21-30.63-1.46-7.12z",style:{fill:"url(#linear-gradient-10)"}}),te.createElement("path",{d:"M258.64 447.03v2.95l-1.46 7.12h-69.51l-1.46-7.12v-2.95z",style:{opacity:.54,fill:"url(#linear-gradient-11)"}}),te.createElement("path",{d:"M179.63 440.64h83.38v12.23h-83.38z",style:{fill:"url(#linear-gradient-12)"}}),te.createElement("path",{d:"M258.04 452.87h-25.83l-38.33 34.86h57.09z",style:{opacity:.54,fill:"url(#linear-gradient-13)"}})),te.createElement("g",{id:"gear"},Z||(Z=te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72"})),te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72",style:{mixBlendMode:"multiply"}}),w||(w=te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72"}))),te.createElement("g",{id:"plant_4","data-name":"plant 4"},z||(z=te.createElement("path",{d:"M465.23 448.93V454M467.51 451.47h-4.56",className:"cls-74"})),te.createElement("path",{d:"M473.27 468.5c1.11.49 41.23-50.82 27.81-54.18s-14.23-8.6-7.27-17.94-5.87-11.08-12.16-6.68 6.72-15.81.29-18.1-12.12 6-11 18.06-8.68-2.05-10.68 4.63 12.08 20.84 2.95 20.94-15.63 1.45-10.06 14.93 20.12 38.34 20.12 38.34",style:{fill:"url(#Degradado_sin_nombre_8-15)"}}),D||(D=te.createElement("path",{d:"M489.75 422.12a.23.23 0 0 0-.32-.07 53.7 53.7 0 0 0-16.1 17.82c.05-8.66.2-18.22.56-27.06A58.5 58.5 0 0 1 485 397.7a.24.24 0 1 0-.32-.35 58.8 58.8 0 0 0-10.77 14.34c.53-12.29 1.49-23 3.14-27.76a.24.24 0 0 0-.15-.3.23.23 0 0 0-.3.14c-1.28 3.67-2.15 10.92-2.72 19.7a26.9 26.9 0 0 0-8.88-6.1.23.23 0 0 0-.31.13.23.23 0 0 0 .12.31 26.1 26.1 0 0 1 9 6.32c-.17 2.73-.32 5.6-.44 8.55a.22.22 0 0 0 0 .16c-.24 5.92-.39 12.16-.48 18.24-1.41-2.09-6.3-8.65-13-10.41a.24.24 0 0 0-.12.46c7.56 2 12.77 10.2 13.15 10.81 0 3-.07 6-.08 8.82a.3.3 0 0 0 0 .13c-.07 15.16.17 27.32.18 27.61a.22.22 0 0 0 .14.21.17.17 0 0 0 .1 0 .24.24 0 0 0 .23-.25c0-.29-.25-12.47-.18-27.63a53.4 53.4 0 0 1 16.36-18.41.24.24 0 0 0 .08-.3",className:"cls-6"})),te.createElement("path",{d:"M415.3 362.18c7-2 4.06 10.29 9.51 19.07.94 1.12 1.85 2.28 2.72 3.46-.43-2.41-.34-5.9.73-6.67 2.8-2 2.33 2.91 2.11 4a16.7 16.7 0 0 1-1.56 4.41c1.19 1.69 2.32 3.42 3.39 5.16-.11-.58-.2-1.12-.28-1.49-.63-2.91-1.36-8.9 2.27-8.91 4.58 0 .34 9.89-.39 13 .11.18 1.62 2.85 2.24 4-.35-3.7.18-10 3.33-10.16 6.66-.32-1.65 7.84-2.43 11.67 1.06 2.14 2.5 5.5 3.39 7.72a14.1 14.1 0 0 1 .56-6.09c1-2.5 3.53-4.66 4.27-1.1.43 2.06-1.06 3.84-2 5.61a25.6 25.6 0 0 0-1.77 4.31c.73 2 1.4 4 2 6.09 0-3 .39-6.19 2-8.39 3.1-4.2 6.55-.48 6.05 3.32s-5.1 6-7.12 8.65q.68 2.81 1.15 5.65c.9-3.08 1.85-6.45 4.26-8.53s7.21-1.82 6.54 2c-.83 4.65-7.87 4.77-10.63 7.52q.6 3.81.94 7.7a23.2 23.2 0 0 1 3.21-6.24c2.26-2.92 5.71-1.07 5.64 2.19-.09 4.66-6 5.22-8.61 7.28.09 1.39.15 2.78.2 4.19.06 1.61.14 3.85.2 5.46 1.08-2.58 2.79-5.76 4.44-6.84 3.42-2.25 6.33.85 4.14 4.17-2.09 3.15-6.3 3-8.47 5.49.11 2.26.26 4.52.47 6.77 1.86-3.83 5.81-7.57 9.24-7.83 3.77-.29 5.09 2.77 2.49 5.41-1.87 1.9-8.63 2.66-11.48 4.8a75 75 0 0 0 1.3 7.7c.3 1.3-1.74 2-2.13.71a47 47 0 0 1-1.28-5.52c-.22-2.43-2.25-2.85-4.09-3.64-2.12-.91-12.58 2.26-9.47-5.75 2.63-6.77 9.93 1.05 13 5.2-.17-1.6-.29-3.2-.38-4.8a7.05 7.05 0 0 0-3.52-3.79c-3.23-1.85-16.65-1.83-14.5-8.27 3.35-10.06 16.14 6.23 17.95 10.83-.13-2.78-.31-9.37-.33-9.9a9.3 9.3 0 0 0-4.17-3.5c-2.07-.9-8.81-3.1-7.16-6.79s6.66.45 7.66 2a32.6 32.6 0 0 1 3.58 6.29c-.14-2.89-.35-5.77-.67-8.62-6-5.68-18.37-5.41-14.95-11 3.87-6.4 9.19 6.07 14.82 9.94a92 92 0 0 0-1.6-9.3c-.72-.35-1.78-1.26-3.17-1.9-3.12-1.43-9.59-1.38-10-5-.53-5 4-4.44 6.7-2.61 2.95 2 4.35 5 6 7.85v-.11a98 98 0 0 0-3-9.68c-4.17-2.2-15.66-1-12.44-7.15 2.5-4.76 9.6 2.73 12.13 6.32q-1.74-4.65-3.91-9.11c-.54.23-1.45-.56-3.47-.84-2.81-.38-8.43-.22-8.83-4.09-.28-2.71 4.13-2.32 6.08-1.46 2.2 1 3.77 3.42 5.5 5-.3-.6-3.49-6.4-4.88-8.63-4.34-1.66-16.57-3.37-14.59-7.65 2.22-4.82 9.95 2.61 13.8 6.39-.48-.74-4.23-6.38-5.19-7.63a33.2 33.2 0 0 1-10.31-6.9c-2.31-2.42-5.53-9.1 2.77-11.44",style:{fill:"url(#linear-gradient-17)"}}),te.createElement("path",{d:"M470.21 472.07q-.29-.27-.54-.54c-.09.41.1.58.54.54",style:{fill:"#c54f28"}}),te.createElement("path",{d:"M524.62 388.66c-4-14.33-17.29-6.28-22.88 6.09-1.69 3.72-4 10.71-6.74 19-6.33 19.17-14.84 45.29-22.67 54-1.69 1.9-2.52 3.12-2.66 3.75q.25.27.54.54a10.1 10.1 0 0 0 3.14-1.42c9.72-5.78 23.34-20.58 34.19-36.54 11.53-16.96 19.92-35.26 17.08-45.42",style:{fill:"#201b51"}}),G||(G=te.createElement("path",{d:"M469.66 471.55c-.13.65.48.68 1.62.19 30.3-26.21 45.9-84.21 46-84.4a.6.6 0 1 0-1.15-.31c-.13.19-15.92 58.97-46.47 84.52",className:"cls-79"})),te.createElement("path",{d:"M540.15 432.18c-7.31-2.2-20.23 3-32.79 10.71-13.74 8.44-27 19.89-32.07 28-1.93 3.09-1.65 4.16 2.22.84 10-8.54 47.77-17.59 57.51-21.75a25 25 0 0 0 3.29-1.71c7.75-4.81 11.69-13.13 1.84-16.09",style:{fill:"#598ac7"}}),C||(C=te.createElement("path",{d:"M474.52 473.72c-.51.1-.52-.38-.11-1.26 21-23.23 66.5-34.45 66.65-34.49a.46.46 0 0 1 .56.34.46.46 0 0 1-.34.57c-.14.04-46.28 11.41-66.76 34.84",className:"cls-79"}))),te.createElement("g",{id:"bulb-3","data-name":"bulb"},te.createElement("path",{d:"M431.69 458.93c-.65 1.93-4.16 19.87 13.79 24.69 11.61 3.12 14-5.36 30.35-2.68l2.5-9.28.1-.38 2.49-9.28c-15.49-5.87-13.43-14-25-17.09-17.99-4.82-23.82 12.02-24.23 14.02",style:{fill:"url(#linear-gradient-18)"}}),te.createElement("path",{d:"M478.94 466.79h11.16a4.18 4.18 0 0 1 4.18 4.18v8.57h-19.52V471a4.18 4.18 0 0 1 4.18-4.21",style:{fill:"url(#Degradado_sin_nombre_20-5)"},transform:"rotate(105.03 484.52 473.201)"}),H||(H=te.createElement("path",{d:"m492.158 469.475-2.894 10.779a4.18 4.18 0 0 1-5.121 2.953l-8.277-2.223 5.062-18.852 8.248 2.215a4.18 4.18 0 0 1 2.982 5.128",className:"cls-8"})),te.createElement("path",{d:"m485.79 463.68-4.9 18.24a1.74 1.74 0 0 1-2.13 1.23 1.74 1.74 0 0 1-1.23-2.13l4.9-18.24a1.74 1.74 0 0 1 2.13-1.23 1.74 1.74 0 0 1 1.23 2.13",style:{fill:"url(#Degradado_sin_nombre_8-16)"}}),te.createElement("path",{d:"m490.11 464.84-4.9 18.25a1.73 1.73 0 0 1-2.12 1.22 1.74 1.74 0 0 1-1.23-2.13l4.9-18.24a1.74 1.74 0 0 1 2.13-1.22 1.73 1.73 0 0 1 1.22 2.12",style:{fill:"url(#Degradado_sin_nombre_8-17)"}}),S||(S=te.createElement("path",{d:"m494.78 473.36-1.26 4.69a3.58 3.58 0 0 1-4.39 2.54l3.12-11.59a3.58 3.58 0 0 1 2.53 4.36",className:"cls-8"})),te.createElement("path",{d:"M439.35 450.63a1.43 1.43 0 1 1-1 2.66 1.43 1.43 0 1 1 1-2.66",style:{fill:"url(#Degradado_sin_nombre_5-16)"}}),te.createElement("path",{d:"M445.31 466.73a5.63 5.63 0 1 1-7.74 3 5.89 5.89 0 0 1 7.74-3",style:{fill:"url(#Degradado_sin_nombre_5-17)"}}),te.createElement("path",{d:"M442.63 451c5.46-4 12.13-1.57 17.8.6 1.61.61 2.29-2 .69-2.59-6.32-2.42-13.78-4.74-19.82-.33-1.38 1-.06 3.33 1.33 2.32",style:{fill:"url(#Degradado_sin_nombre_5-18)"}}),te.createElement("path",{d:"m477.24 475.71-18.71-5-.65-.16a7.3 7.3 0 0 1-3 3.38 4.74 4.74 0 0 1-4 0c-2.42-1-2.16-2.4-2-2.82.58-1.72 3.84-2.84 8.37-2a28 28 0 0 0 1.43-4.19 7 7 0 0 0 .19-1h-.14c-2.36-.51-6.64-2.53-5.79-6.47a2.31 2.31 0 0 1 1.51-1.93 3.32 3.32 0 0 1 3.09 1.18 9.36 9.36 0 0 1 2.66 6.29l19.1 5.01-.33 1.25-19-5.09a7 7 0 0 1-.2 1 32 32 0 0 1-1.38 4.13l.42.11 18.71 5Zm-22.95-5.63c-2.51 0-4.06.75-4.29 1.42-.15.47.56.94 1.28 1.23a3.51 3.51 0 0 0 3 0 5.8 5.8 0 0 0 2.29-2.49 16 16 0 0 0-2.28-.16m.63-13.45a.6.6 0 0 0-.2 0c-.36.1-.54.58-.62 1-.73 3.36 3.86 4.7 4.7 4.91a8 8 0 0 0-2.25-5 2.78 2.78 0 0 0-1.63-.91",style:{fill:"url(#radial-gradient-6)"}})),te.createElement("g",{id:"lady"},T||(T=te.createElement("path",{d:"M140.45 285.27s-2.5 6.16-1.58 9.51 2.65 8.07-.71 9.36-7.19 2.64-4.95 5.14 1.4 3.92-.47 5-2.58 5 2.26 5.74c0 0-2.46 3.59-8.83.26s-8.26-17.66-5.87-22.13 13.82-18.7 20.15-12.88",className:"cls-89"})),U||(U=te.createElement("path",{d:"m58.06 471.62-1.64 3.79s-9.11-1.47-8.82-4.43l1.46-3.93Z",className:"cls-90"})),O||(O=te.createElement("path",{d:"m54.28 469.67 3.78 1.95-1.64 3.79a28 28 0 0 1-4.6-1.13Z",className:"cls-20"})),L||(L=te.createElement("path",{d:"m99.85 476.62.52 3.14a7.3 7.3 0 0 0 3 .85l.5-4.67a36 36 0 0 0-4.02.68",className:"cls-90"})),A||(A=te.createElement("path",{d:"m109 479.76.43-3.14c-.94-.94-3.41-.93-5.6-.68l-.5 4.67a14.3 14.3 0 0 0 5.67-.85",className:"cls-20"})),q||(q=te.createElement("path",{d:"M101.54 491.22s1.85-6.53 1.53-7.82a10 10 0 0 1 .39-3.75 7 7 0 0 0-3.09.11c-1.43.64-3.09 11.59-2.62 12.73S109 493.8 113 494s15.28-.88 15.47-1.4a3.8 3.8 0 0 0 .07-1.17c-.21 0-9.22.26-12 .78s-15-.99-15-.99",className:"cls-91"})),P||(P=te.createElement("path",{d:"M115.84 484.85c-2.33-.09-6.81-5.09-6.81-5.09-1.12-.9-3.09.31-3.09.31s-1.17-.27-2.48-.42a10 10 0 0 0-.39 3.75c.32 1.29-1.53 7.82-1.53 7.82s12.28 1.57 15.06 1 11.76-.77 12-.78c0-.48-.07-.9-.07-.9-.84-5.16-10.36-5.54-12.69-5.69",className:"cls-92"})),V||(V=te.createElement("path",{d:"M58.06 483.83c-1.11-1.46-6.39-1.64-6.39-1.64l3-.57a10 10 0 0 1-3.07-3.82c-.78-2.14.72-4.52.72-4.52-1.83-1.12-4.12-2.51-4.43-2.64-.53-.23-5.44 3.71-6.06 6.54s11.15 13.33 13 14.13a7.8 7.8 0 0 0 2.05.36s2.29-6.38 1.18-7.84",className:"cls-91"})),F||(F=te.createElement("path",{d:"M65.58 491.55c.45-.14.21-1.87.21-1.87-.35-5.14-6.77-8-7.58-8s-1.75-6.35-1.75-6.35c-.34-1.82-1.74-.58-1.74-.58l-2.37-1.44s-1.5 2.38-.72 4.52a10 10 0 0 0 3.07 3.82l-3 .57s5.28.18 6.39 1.64-1.09 7.81-1.09 7.81a59 59 0 0 0 8.58-.12",className:"cls-92"})),R||(R=te.createElement("path",{d:"M106.18 447.63c-2.14-7-.43-20.13 3.28-31.17s-3.9-30.46-8.85-36.36-28.46-13.71-30.88-17.93c-1.47-2.56-5.33-4.67-8.13-5.93a35.1 35.1 0 0 0 0 17.09c3.14 11.34 3.85 40.47 2.28 44s-7 12.57-8.56 23-6.29 26.7-6.29 26.7a12.5 12.5 0 0 0 4.62 3.61c.06-.09 9.09-15.2 8.09-23.74s8.71-23.13 11.57-30.84-4.86-41.66-4.86-41.66l18 23.29s11.42 15.61 11.61 20.65-3.23 14.38-2.38 26.09 4.1 32.17 4.1 32.17a20.6 20.6 0 0 0 3.71.78c.42-1.65 4.74-23.02 2.69-29.75",className:"cls-91"})),B||(B=te.createElement("path",{d:"M73.34 416.08c-2.86 7.71-12.57 22.27-11.57 30.84s-8 23.65-8.09 23.74a10.5 10.5 0 0 0 4.38 1s18.26-49.12 21.7-56.54a182 182 0 0 0 6.76-17.37l-18-23.29s7.67 33.91 4.82 41.62",className:"cls-92"})),W||(W=te.createElement("path",{d:"M109.46 476.62s7.71-59.26 5.86-70-13.14-42.84-13.14-42.84l-39-12.73a33.5 33.5 0 0 0-1.6 5.15c2.8 1.26 6.66 3.37 8.13 5.93 2.42 4.22 25.93 12 30.88 17.93s12.56 25.32 8.85 36.36-5.42 24.18-3.28 31.17c2 6.73-2.27 28.1-2.62 29.77a10.2 10.2 0 0 0 5.92-.74",className:"cls-92"})),I||(I=te.createElement("path",{d:"M121 308.63s8.7 19.78 13.41 21.14 22.84 7.14 22.84 7.14l-1.28 6.49s-24.92-2.78-30.34-5.85S113.67 326 113.67 326Z",className:"cls-93"})),te.createElement("path",{d:"M119 330.05c-4.36-1.12-12.88-18.39-12.88-18.39 11.71 19 15.94 14.47 15.57 16.14a7.3 7.3 0 0 0 1-1.39c1.14-2.07-1.7-22.75-1.7-22.75-15.34-22-31.52-1.2-32.26-.19S81.76 317.2 79.76 321 63 347.26 61.56 348.33s-2.07 3.93.85 4.92c1.09.38 3.83 2.44 7.32 5 0 0 22.88 9.28 20.6-.71S78.05 345 83 336.79l5-8.19s3.52-10.47 5-4.38 6.66 13.52 7.9 14.57l1.24 1 5.73 3.57A120 120 0 0 0 124 347c7.85 1.07 30.53.24 30.53.24l.86-7.28c-7.23.09-36.39-9.91-36.39-9.91",style:{fill:"#3258a7"}}),Y||(Y=te.createElement("path",{d:"M93.11 322.62c-1.1-6.16 2.18-12.7 2.18-12.7L88 328.6l-5 8.19c-5 8.18 5 10.75 7.33 20.75s-20.59.72-20.6.71c5.91 4.33 14 10.05 20 11.35a22 22 0 0 0 16.06-2.35s-2.21-7.78-3.43-11.78 5.45-12.07 5.45-12.07-12.75-9.91-14.7-20.78M106.08 311.66s8.52 17.27 12.88 18.39a13.6 13.6 0 0 0 2.69-2.25c.35-1.67-3.86 2.89-15.57-16.14",className:"cls-93"})),X||(X=te.createElement("path",{d:"M132.74 275s-4.49 9.74-7.72 10.5-3.47 5-3.47 5l3.22 4.18a9.16 9.16 0 0 0 3.61 2.29c10.92-3.64 16.49-19.28 16.49-19.28-3.22-5.25-7.78-4.69-12.13-2.69",className:"cls-90"})),Q||(Q=te.createElement("path",{d:"M125 285.48c3.23-.76 7.7-10.45 7.72-10.5a73 73 0 0 0-7.81 4.69c-5.57 3.53-12.33 11.85-13.18 13.66s6.66 15 7.09 11.76 5.93-10.38 5.93-10.38l-3.22-4.18s.26-4.29 3.47-5.05",className:"cls-20"})),te.createElement("path",{d:"M151.39 273.55c-1.62-.75-2.14-5.73-3.33-9.39s-14.18-9.57-29-5.9-9.71 17.8-9 21.27-7.76 2.29-5.85 5.52-.38 4.62-6.71 6.62-8.81 11.8-8.81 11.8 3.57-3.14 7.57-2.81 9.28-1.19 9.28-1.19c.09 10.19 13.9 12.95 13.9 12.95s-11-6.5-10-11.21 6.93-8.78 5.57-12.56 5.35-6.43 5.93-9 11.58-4.23 11.58-4.23c5.42 3.83 12.33 2.3 12.33 2.3l-1.37 3.22c7.35-1.16 9.52-6.64 7.91-7.39",style:{fill:"#403982"}}),J||(J=te.createElement("path",{d:"M121 279.65c-.58 2.57-7.29 5.21-5.93 9s-4.57 7.85-5.57 12.56 10 11.21 10 11.21-2.29-1.62-.62-5.71-2-3.76-3.24-7.52 5.52-3.67 3.43-7.24-.91-4.85 5-7.23 8.51-9.3 8.51-9.3-11.05 1.66-11.58 4.23M144.87 277.72s4.52-.81 5.33-2.28c0 0-2.08 4.59-6.7 5.5Z",className:"cls-89"})),$||($=te.createElement("path",{d:"m164.49 346.09 12.25-2.09c-.38-1.17-1.53-2.63-2.2-2.63-.9 0-8.59-.59-8.59-.59 1.66-.24 4.14-1.64 4-2.43s-1.26.1-2.8-.12-4.88 1.12-6 1.5-5.79.29-5.79.29l-.57 4.82c1.66.36 4.68 1 6.5 1.17a12.4 12.4 0 0 0 3.2.08",className:"cls-90"})),K||(K=te.createElement("path",{d:"M169.18 350.08c1.36-.25 7.32-4.07 7.64-5.14a1.7 1.7 0 0 0-.08-1l-12.25 2.13a12.4 12.4 0 0 1-3.19-.12c-1.82-.18-4.84-.81-6.5-1.17l-.29 2.46s13.32 3.09 14.67 2.84",className:"cls-20"}))),te.createElement("g",{id:"plant_2","data-name":"plant 2"},te.createElement("path",{d:"M166.37 424.66c-.34 1.63.16 3.57-.12 5.24-.36 2.09-1.69 2.69-2.59 4a10.8 10.8 0 0 0-1.16 7 37 37 0 0 0 1.16 4.27 10.1 10.1 0 0 1 .32 4.63c-.51 2.23-3.21 4-3.21 13.39 0 8.61 6.14 11.95 7.89 14.06v-55.81l-.79.77a4.52 4.52 0 0 0-1.5 2.45",style:{fill:"url(#linear-gradient-19)"}}),te.createElement("path",{d:"M173.55 445.18a37 37 0 0 0 1.16-4.27 10.8 10.8 0 0 0-1.16-7c-.9-1.32-2.23-1.92-2.59-4-.28-1.67.22-3.61-.12-5.24a4.52 4.52 0 0 0-1.5-2.45l-.79-.77v55.82c1.75-2.11 7.89-5.45 7.89-14.06 0-9.43-2.7-11.16-3.21-13.39a10.1 10.1 0 0 1 .32-4.64",style:{fill:"url(#linear-gradient-20)"}}),te.createElement("path",{d:"M178.19 440.62c-.58.77-.33 1.92-.85 2.72-.66 1-2.11 1-3.22 1.42a3.56 3.56 0 0 0-2.16 3.36 12.7 12.7 0 0 0 .62 2.56 2.92 2.92 0 0 1-.31 2.52c-.83 1-3.85 1.22-5.15 6.17-1.17 4.53 4.71 7.94 6.22 9.52l7.66-29.34-.92.18a3.06 3.06 0 0 0-1.89.89",style:{fill:"url(#linear-gradient-21)"}}),te.createElement("path",{d:"M182.21 444.61c-.07-.95.72-1.84.59-2.78a3 3 0 0 0-1.21-1.7l-.71-.61-7.64 29.34c2.09-.64 8.89-.75 10.07-5.27 1.29-5-1.26-6.59-1.48-7.9a2.89 2.89 0 0 1 1-2.35 13 13 0 0 0 1.78-1.93 3.55 3.55 0 0 0-.24-4c-.79-.93-2.08-1.6-2.16-2.8",style:{fill:"url(#linear-gradient-22)"}}),ee||(ee=te.createElement("path",{d:"M170.64 471.79c-2.29-3.43-16.78-6.13-16.78-6.13s4.78 5.12 4.78 8.57a15 15 0 0 1-.82 3.9 7.77 7.77 0 0 0 7.39 10.11h.45a16.5 16.5 0 0 0 1.83-5.91c0-3.33 5.43-7.11 3.15-10.54",className:"cls-91"})),ae||(ae=te.createElement("path",{d:"M185.22 478.13a15 15 0 0 1-.82-3.9c0-3.45 4.78-8.57 4.78-8.57h-35.32s14.49 2.7 16.78 6.13-3.15 7.23-3.15 10.54a16.5 16.5 0 0 1-1.83 5.91h12.17a7.77 7.77 0 0 0 7.39-10.11",className:"cls-92"})))))))}},24546:(e,a,t)=>{"use strict";t.d(a,{A:()=>R});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V=t(30758);function F(){return F=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...R}=e;return V.createElement("svg",F({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 720 504","aria-labelledby":t},R),a?V.createElement("title",{id:t},a):null,l||(l=V.createElement("defs",null,V.createElement("linearGradient",{id:"linear-gradient",x1:207.67,x2:118.1,y1:267.21,y2:90.91,gradientTransform:"matrix(-1 0 0 1 347.92 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#f5995e"}),V.createElement("stop",{offset:.29,stopColor:"#f9ab60"}),V.createElement("stop",{offset:.71,stopColor:"#fdbf62"}),V.createElement("stop",{offset:1,stopColor:"#ffc663"})),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-2",x1:-156.84,x2:-246.41,y1:267.01,y2:90.71}),V.createElement("linearGradient",{id:"linear-gradient-3",x1:374.12,x2:407.66,y1:492.38,y2:337.42,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#1252c3"}),V.createElement("stop",{offset:1,stopColor:"#3f86fd"})),V.createElement("linearGradient",{id:"linear-gradient-4",x1:298.19,x2:435.3,y1:472.4,y2:472.4,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#ff9c5c"}),V.createElement("stop",{offset:1,stopColor:"#ffc861"})),V.createElement("linearGradient",{id:"linear-gradient-5",x1:80.91,x2:93.06,y1:484.01,y2:440.77,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#f8a034"}),V.createElement("stop",{offset:1,stopColor:"#ffc546"})),V.createElement("linearGradient",{id:"linear-gradient-6",x1:78.47,x2:63.37,y1:485.6,y2:454.33,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#fcb72c"}),V.createElement("stop",{offset:1,stopColor:"#ffcf44"})),V.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-7",x1:97.69,x2:103.07,y1:487.56,y2:467.49}),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-8",x1:239.16,x2:257.81,y1:191.33,y2:184.55}),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-9",x1:221.65,x2:236.53,y1:95.91,y2:90.5,gradientTransform:"rotate(-5.78 255.116 95.89)"}),V.createElement("style",null,".cls-2{fill:#fff}.cls-4{fill:#f48f59}.cls-17,.cls-5{fill:none;stroke-miterlimit:10}.cls-5{stroke:#231f20;stroke-linecap:round;stroke-width:1.17px}.cls-7{fill:#fd835a}.cls-8{fill:#201851}.cls-13{fill:#231f20}.cls-23{fill:#1150bf}.cls-17{stroke:#1150bf;stroke-width:5px}.cls-18{fill:#f45662}.cls-20{fill:#403881}.cls-21{fill:#fca080}.cls-22{fill:#e0e6ee}.cls-24{fill:#094081}.cls-25{fill:#232059}.cls-27{fill:#d07a62}"))),V.createElement("g",{style:{isolation:"isolate"}},V.createElement("g",{id:"Layer_2","data-name":"Layer 2"},V.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=V.createElement("path",{d:"M0 0h720v504H0z",className:"cls-2"})),V.createElement("g",{id:"TREE"},V.createElement("g",{id:"tree-2","data-name":"tree"},V.createElement("path",{d:"M211.53 238.93c-29.25-1.87-63-34.92-54.1-55.37s10.94-34 1.94-47.81c-8.17-12.53 22.32-65.64 10.75-86 4.33-4.09 10.3-6.38 15.83-4.5 7 2.39 10.49 10.12 12.69 17.18a164 164 0 0 1 5.52 23.87c1.18 7.7 2 16 7 22 5.47 6.58 14.7 8.83 20.78 14.84a22.7 22.7 0 0 1 6.31 19.56c-1 6.19-4.62 11.62-7.17 17.36s-4 12.68-.89 18.14c2.76 4.8 8.32 7.17 12.18 11.14 4.93 5.07 6.76 12.63 5.88 19.65s-4.22 13.54-8.44 19.21a65 65 0 0 1-7.32 8.29 59 59 0 0 1-20.96 2.44",style:{fill:"url(#linear-gradient)"}}),c||(c=V.createElement("path",{d:"M182.68 268.61c-6.23-13.48-28.71-22.84-37.41-30.28-9.17-7.84-17.57-18.33-19.27-30.66-2-13.76 5.56-21.12 11.89-31.93 10.48-17.9-10.72-35.46-3.54-53.43 3.7-9.27 14.59-13.41 20.45-21.48 4.69-6.45 5.73-14.79 6.38-22.74s1.14-16.22 5-23.2a21.7 21.7 0 0 1 4-5.13c11.57 20.35-18.92 73.46-10.75 86 9 13.82 7 27.36-1.94 47.81s24.85 53.5 54.1 55.37a59 59 0 0 0 20.95-2.45 66 66 0 0 1-14 10.26c-12.49 6.77-27.87 10.17-35.86 21.86",className:"cls-4"}))),s||(s=V.createElement("path",{d:"M182.63 97.31v386.73M182.63 148.5l20.76-25.86M182.63 201.7l20.76-25.86M182.63 178.43l-20.76-25.86M182.63 225.89l-20.76-25.86M182.63 256.87l20.76-25.86",className:"cls-5"}))),V.createElement("g",{id:"TREE-3","data-name":"TREE"},V.createElement("g",{id:"tree-4","data-name":"tree"},V.createElement("path",{d:"M576 238.73c-29.24-1.87-63-34.93-54.09-55.38s10.94-34 1.93-47.8c-8.16-12.54 22.33-65.64 10.76-86 4.32-4.1 10.3-6.38 15.82-4.5 7 2.39 10.49 10.11 12.7 17.18a162.6 162.6 0 0 1 5.51 23.87c1.18 7.7 2 16 7 22 5.46 6.57 14.69 8.82 20.78 14.83a22.71 22.71 0 0 1 6.31 19.56c-1 6.2-4.62 11.62-7.17 17.37s-4 12.68-.89 18.13c2.75 4.8 8.32 7.17 12.18 11.14 4.93 5.07 6.76 12.64 5.88 19.66s-4.23 13.53-8.44 19.21a66 66 0 0 1-7.32 8.28 59.1 59.1 0 0 1-20.96 2.45",style:{fill:"url(#linear-gradient-2)"}}),n||(n=V.createElement("path",{d:"M547.18 268.41c-6.22-13.48-28.71-22.84-37.4-30.28-9.18-7.84-17.57-18.37-19.32-30.66-2-13.77 5.55-21.13 11.88-31.93 10.48-17.9-10.72-35.46-3.53-53.44 3.7-9.26 14.58-13.4 20.45-21.47 4.68-6.46 5.73-14.79 6.38-22.74s1.14-16.23 5-23.21a21.4 21.4 0 0 1 4-5.12c11.57 20.35-18.92 73.45-10.76 86 9 13.82 7 27.35-1.93 47.8s24.85 53.51 54.09 55.38a59.1 59.1 0 0 0 21-2.46 65.8 65.8 0 0 1-14 10.26c-12.49 6.78-27.86 10.17-35.86 21.87",className:"cls-4"}))),i||(i=V.createElement("path",{d:"M547.14 97.11v386.73M547.14 148.3l20.76-25.86M547.14 201.49l20.76-25.86M547.14 178.23l-20.77-25.86M547.14 225.69l-20.77-25.86M547.14 256.66l20.76-25.86",className:"cls-5"}))),V.createElement("g",{id:"plant"},m||(m=V.createElement("path",{d:"M415.48 384c1.49 37.9 25.34 98.74 48.34 91.61 6.06-1.87-1.72-30.12-24-55-16.09-17.97-20.3-31.13-24.34-36.61",className:"cls-7"})),d||(d=V.createElement("path",{d:"M483.43 470.86c-.14 2.39 32.95 5.43 48.3-19.57 11.95-19.47 19.37-21.22 25.78-24.67-43.51-.79-73.71 37.99-74.08 44.24",className:"cls-8"})),V.createElement("path",{d:"M495.27 419.42c-.21-2 1.86-16.68-.36-28.17-4.53 4.44-21.34 61.69-20.81 71 .19 3.42-1.82 12.86 5.36 14.56C487 478.6 501 460.31 506 447.69c16.37-41.7 4.59-39.93 18.24-63.66-5.45 3.97-26.11 27.97-28.97 35.39",style:{fill:"#413b89"}}),o||(o=V.createElement("path",{d:"M504 403.28c-2.75 4-4 8.7-6.69 12.61-2.17 3.14-2 7.1-3.5 10.13-1.65 3.25-4.55 4.92-4.72 9.49-.08 2.13.46 3.9.26 5.83-.24 2.4-1.24 4.62-1.27 7.19 0 1.79.53 3.5.58 5.21.13 4.79-7.49 12.66-1.38 17-.33 4.05.4 5.49 2.49 5.55 4.46.13 4.3-4.42 5.17-6.92 1-2.89 4.28-4.78 4.6-8.74.16-2-1-4.46-.8-6.32.16-1.39 1.46-2.16 2.2-3.34 1.91-3 2-6.53 1.78-10-.12-2-1.71-5.27-1.46-7.09.47-3.51 4.05-4.41 3-9.46-.33-1.54-1.64-3.39-1.6-4.95s1.07-2.63 1.6-4.06c1.45-3.93-.19-8.07-.26-12.13",className:"cls-7"})),V.createElement("path",{d:"M487 461.32c-4.26-.17-9.66 3.86-12.5 8.31.06-2.8.21-5.6.4-8.4 3-2.78 8.19-2 11.21-5.55 3.17-3.77 0-8-4.5-5.73-2.19 1.1-4.74 4.77-6.44 7.8.16-2 .37-4.77.53-6.77.14-1.73.26-3.46.35-5.18 3.47-2.16 10.88-2 11.66-7.72.54-4-3.43-6.79-6.64-3.52a29 29 0 0 0-4.85 7.23c.09-3.22.08-6.43-.05-9.62 3.8-3 12.48-2.12 14.17-7.73 1.37-4.58-4.46-5.65-7.77-3.39s-4.92 6.23-6.46 9.9q-.19-3.57-.61-7.13c2.86-2.91 8.83-4.88 10-9.62s-2.55-9.69-7-5c-2.32 2.48-3.25 6.32-3.69 10-.44-2.61-1-5.21-1.58-7.79a31.7 31.7 0 0 1 2.81-5.05c1.42-2 3.51-4 3.27-6.62-.4-4.48-3.85-2.19-5.41.75a17.24 17.24 0 0 0-1.5 7.51c-.78-2.87-2.07-7.21-3.06-10 1.51-4.6 12.91-13.46 4.67-14-3.91-.27-5.47 7.42-5.57 12-.59-1.53-2.08-5-2.18-5.27 1.35-3.77 8-15.36 2.35-16-4.47-.5-4.43 7-4.07 10.65 0 .47.08 1.15.14 1.88-1.07-2.29-2.22-4.59-3.44-6.85a20.6 20.6 0 0 0 2.55-5.19c.43-1.37 1.72-7.36-2-5.28-1.42.79-2 5.07-1.85 8.1q-1.37-2.37-2.86-4.65c-5.45-11.59-.08-26.26-9-24.84-10.55 1.68-7.55 10.37-5 13.63a41.5 41.5 0 0 0 11.71 10c1 1.68 4.82 9.16 5.29 10.14-4.19-5.21-12.64-15.46-16.07-9.85-3.05 5 11.76 8.85 16.87 11.52 1.4 2.94 4.48 10.54 4.78 11.33-1.91-2.16-3.5-5.42-6.07-6.92-2.27-1.33-7.65-2.44-7.7.94-.06 4.81 6.88 5.43 10.29 6.3 2.45.63 3.46 1.74 4.15 1.53q2 5.79 3.52 11.77c-2.6-4.77-10.27-15-14-9.52-4.85 7.09 9.47 7.28 14.29 10.6a122 122 0 0 1 2.29 12.34v.15c-1.67-3.79-3-7.64-6.32-10.54-3-2.64-8.55-4-8.62 2.25 0 4.54 7.93 5.4 11.56 7.61 1.62 1 2.79 2.26 3.63 2.8a111 111 0 0 1 .64 11.69c-6.38-5.58-11.14-21.7-16.83-14.38-5 6.45 10.3 7.9 16.83 15.75 0 3.56-.17 7.13-.41 10.71a40.5 40.5 0 0 0-3.51-8.26c-1-2-6.54-7.89-9.15-3.52s5.42 8 7.84 9.39a11.7 11.7 0 0 1 4.64 4.91c-.05.66-.78 8.81-1 12.24-1.56-5.92-15-27.81-20.55-15.91-3.57 7.63 13 9.52 16.66 12.26 2.52 1.86 3.37 3.48 3.8 5.18-.12 2-.2 4-.22 6-3.15-5.54-11-16.22-15.23-8.26-5 9.41 8.36 7 10.83 8.44 2.16 1.24 4.6 2 4.52 5.07a58 58 0 0 0 .79 7c.29 1.65 2.9 1.09 2.73-.56a92 92 0 0 1-.5-9.67c3.82-2.23 12.24-2.19 14.82-4.26 3.54-2.99 2.35-6.94-2.38-7.13",style:{fill:"url(#linear-gradient-3)"}}),V.createElement("path",{d:"M421.58 485.91s4.78-14.14 15.85-9.59c0 0 5.54-17.9 19.12-3.9s9.41-16.06 22.95-13.36 9.51 13 9.51 13 12.88-6.64 10.09 4.85c0 0 30.41-15.16 30.91-2.33 0 0 20.38-3.78 16.86 6.79 0 0 11.82-3 11.82 4.53Z",style:{fill:"url(#linear-gradient-4)"}})),V.createElement("g",{id:"plant_3","data-name":"plant 3"},V.createElement("path",{d:"M177.78 474.29s-1.26-43.54-16.57-46.75-17.5 27.15 0 57.15Z",style:{fill:"url(#linear-gradient-5)"}}),h||(h=V.createElement("path",{d:"M169.86 479.51a.27.27 0 0 1-.25-.19c-7.3-29.38-10.44-40.18-10.47-40.28a.26.26 0 0 1 .18-.32.27.27 0 0 1 .32.18c0 .1 3.17 10.91 10.48 40.3a.26.26 0 0 1-.19.3Z",className:"cls-13"})),V.createElement("path",{d:"M183.08 484.69s23.34-22.15 14.59-32.86-30.63 7.86-36.46 32.86Z",style:{fill:"url(#linear-gradient-6)"}}),p||(p=V.createElement("path",{d:"M174 481.73h-.1a.27.27 0 0 1-.14-.34c5.79-13.11 17.08-23.55 17.2-23.66a.25.25 0 0 1 .36 0 .25.25 0 0 1 0 .36c-.11.1-11.33 10.47-17.07 23.48a.26.26 0 0 1-.25.16",className:"cls-13"})),V.createElement("path",{d:"M163.34 484.69s-6-25.18-18-23 0 22.86 0 22.86Z",style:{fill:"url(#linear-gradient-7)"}}),f||(f=V.createElement("path",{d:"M151.55 481.55a.26.26 0 0 1-.25-.19l-4-14.64a.24.24 0 0 1 .18-.31.26.26 0 0 1 .32.18l4 14.64a.26.26 0 0 1-.18.31Z",className:"cls-13"}))),V.createElement("g",{id:"shield"},V.createElement("path",{d:"m307.54 161.26 9.71 197.06h198.24l-9.71-197.06z",style:{fill:"#1150bf",opacity:.5}}),E||(E=V.createElement("path",{d:"m507.92 204.64-2.14-43.38h-36.47M478.97 358.32h36.52l-2.41-48.87M315.01 312.83l2.24 45.49h48.76M346.97 161.26h-39.43l2.46 49.87",className:"cls-17"})),g||(g=V.createElement("path",{d:"M379.91 203.47c19.75-6.65 29.83-18.94 29.83-18.94s11.74 12.29 32.39 18.94c18.48 6 37.82 5.24 37.82 5.24s4.12 65.21-16.63 91.48c-19.41 24.67-43.77 29-43.77 29s-24.94-4.35-47.7-29c-24.31-26.27-29.05-91.48-29.05-91.48s19.45.72 37.11-5.24",className:"cls-18"})),x||(x=V.createElement("path",{d:"M419.5 318.82c5.46-1.53 22.38-7.46 36.33-25.18 12.82-16.25 15.17-53.64 14.92-75.08a128.3 128.3 0 0 1-30.54-5.5 99.9 99.9 0 0 1-28.89-14.91 84.4 84.4 0 0 1-26.87 14.91 119.6 119.6 0 0 1-29.8 5.5c2.67 21.46 10.08 58.83 25.11 75.08 16.35 17.72 34.08 23.65 39.74 25.18",className:"cls-8"})),y||(y=V.createElement("path",{d:"M419.27 315.47c5.79-1.7 21-7.48 33.94-23.93 11.75-14.89 14.3-48.65 14.3-70a129 129 0 0 1-28.13-5.42 103.4 103.4 0 0 1-27.79-13.85 87.6 87.6 0 0 1-25.9 13.85 119.7 119.7 0 0 1-27.39 5.42c2.91 21.35 10.05 55.13 23.78 70 15.18 16.46 31.16 22.23 37.19 23.93",className:"cls-18"})),u||(u=V.createElement("path",{d:"M405.69 247.15a12.44 12.44 0 0 0 12.25 11.41 10.57 10.57 0 0 0 10.72-11.41 12.43 12.43 0 0 0-12.26-11.42 10.55 10.55 0 0 0-10.71 11.42",className:"cls-2"})),M||(M=V.createElement("path",{d:"M419.57 282.66a4.45 4.45 0 0 0 4.5-4.81l-1.77-26.33a5.24 5.24 0 0 0-5.16-4.81 4.45 4.45 0 0 0-4.51 4.81l1.79 26.33a5.24 5.24 0 0 0 5.15 4.81",className:"cls-2"})),V.createElement("path",{d:"M379.86 203.47c19.74-6.65 29.82-18.94 29.82-18.94s6.13 42.48 8 70.72 1.78 74 1.78 74-24.94-4.35-47.7-29c-24.32-26.27-29.05-91.48-29.05-91.48s19.48.66 37.15-5.3",style:{fill:"#5890f4",opacity:.25,mixBlendMode:"multiply"}})),V.createElement("g",{id:"man"},_||(_=V.createElement("g",{id:"shoes"},V.createElement("path",{d:"m220.32 455.82-.71 9.63s1.5 14.32 1.11 16.05c-.34 1.46-15.74 1.64-21.5.66a2.47 2.47 0 0 1-2.06-2.45v-2.88a3.7 3.7 0 0 1 .24-1.32l4.33-11.5v-8.19Z",className:"cls-20"}),V.createElement("path",{d:"M201.73 464s16.07-.71 16.62.75 1.26.69 1.26.69l.71-9.63h-18.59Z",className:"cls-21"}),V.createElement("path",{d:"M197.16 476.83v2.88a2.47 2.47 0 0 0 2.06 2.45c5.76 1 21.16.8 21.5-.66a15 15 0 0 0 0-2.67l-2 .39c0-5.36-2.84-7.33-9.38-8.67a13.65 13.65 0 0 0-11.14 2.75l-.83 2.21a3.7 3.7 0 0 0-.21 1.32",className:"cls-22"}),V.createElement("path",{d:"M314 479.67c-1-3.13-2.84-7.6-5.45-8.41-4.1-1.26-25.06-6.62-25.69-8.82 0 0-6.36 1.5-6.8 2.95s-9.44.12-9.44.12v.14l-1.25 15.16a1.8 1.8 0 0 0 1.8 2h44.56a2.37 2.37 0 0 0 2.27-3.14",className:"cls-20"}),V.createElement("path",{d:"M276.07 465.39c.44-1.45 6.8-2.95 6.8-2.95-.63-2.21-.76-10.28-.76-10.28l-16.88 2.68 1.4 10.67s9 1.33 9.44-.12",className:"cls-21"}),V.createElement("path",{d:"M267.19 482.77h44.56a2.37 2.37 0 0 0 2.26-3.1c-1-3.13-2.84-7.6-5.45-8.41l-2.93-.84c-.5 2.75-.82 9.51-.82 9.51l-39.31-.47-.11 1.35a1.8 1.8 0 0 0 1.8 1.96",className:"cls-22"}))),v||(v=V.createElement("g",{id:"pants"},V.createElement("path",{d:"M201.14 261.12S198 293 198 365.21c0 15.88 3.19 90.61 3.19 90.61h19.14s4.49-65.7 4.73-80.1-1.42-15.39 1.89-29.8 9.22-37.12 9.22-37.12 15.83 45.67 15.6 51.77-1.66 25.65 2.6 40.54 10.87 53.73 10.87 53.73 11.92 2 16.88-2.68c0 0-5.07-91.1-6-103.06s-14-91-14-91Z",className:"cls-23"}),V.createElement("path",{d:"m236.16 308.8 2.75-19.36s12.63 59.94 12.6 68.88Z",className:"cls-24"}))),V.createElement("g",{id:"body"},N||(N=V.createElement("path",{d:"M217.05 150.85a16.7 16.7 0 0 0-3.19 0c-.59.19-3.66 5.48-3.66 5.48s-16.23.78-21.19 6-24.52 45.13-24.13 53.21S183.79 259 183.79 259l11.11-6.31-9.9-36.62 9-13.57s8.47 24.13 8.34 30.65-1.17 28-1.17 28l61-3V209s13.08 19.83 16.08 21.91a8.13 8.13 0 0 0 7.69.92c1.44-.65 16.57-18.78 16.57-18.78l-8.74-10-8.61 4.18s-17.35-46-24.13-48.53-16.83-2.87-16.83-2.87-5-6.71-7.17-6.32-19.98 1.34-19.98 1.34",className:"cls-23"})),b||(b=V.createElement("path",{d:"M278.23 230.93a8.13 8.13 0 0 0 7.69.92c1.44-.65 16.57-18.78 16.57-18.78l-8.74-10-8.61 4.18s-6.26 4.82-9.46 4-13.53-26.87-13.53-26.87V209s13.08 19.85 16.08 21.93M193.97 202.5l5.1-7.23 1.26 27.48z",className:"cls-24"})),k||(k=V.createElement("path",{d:"M201.53 252.72s34.51 3.39 60.62-2.35v7.75s-15 7.74-61 3Z",className:"cls-25"})),j||(j=V.createElement("path",{d:"M245.24 264.28h-13.99v-13.91l13.99-.62z",className:"cls-20"})),Z||(Z=V.createElement("path",{d:"M242.31 261.12h-7.05v-7.01l7.05-.31z",className:"cls-25"})),w||(w=V.createElement("path",{d:"M227.68 161.41a3.68 3.68 0 0 0-3.65.92 50 50 0 0 0-4.69 6.39l1.69 1.69s2.74-8.93 6.65-9M244.18 155.8s-2 9.46-5.08 12.13c0 0-5.22-7.55-8.16-6.67 0 0 5.48 1.65 7.24 8.63 0 0 4.7-2.74 6-14.09",className:"cls-24"})),z||(z=V.createElement("ellipse",{cx:229.54,cy:169.11,className:"cls-24",rx:1.4,ry:1.96})),D||(D=V.createElement("path",{d:"m207.775 185.959 15.13-.454.088 2.93-15.13.454z",className:"cls-25"})),V.createElement("path",{d:"M252 178.39s1.62 3.08 6.56 3.86c0 0-.35 10.42-7.33 12.93 0 0-6.57-1.83-6.08-13.47.04 0 4.94-.14 6.85-3.32",style:{fill:"url(#linear-gradient-8)"}}),G||(G=V.createElement("path",{d:"M252 178.39c-1.95 3.18-6.85 3.32-6.85 3.32-.49 11.64 6.08 13.47 6.08 13.47a40 40 0 0 0 .77-16.79",className:"cls-4"})),C||(C=V.createElement("path",{d:"M178.42 284.31a4.5 4.5 0 0 1-2.51-8.24l145.59-97.65a4.5 4.5 0 1 1 5 7.47l-145.57 97.65a4.5 4.5 0 0 1-2.51.77",className:"cls-8"})),H||(H=V.createElement("path",{d:"m194.9 252.67.83 2.4a40 40 0 0 1 4.78 2.36 12 12 0 0 1 1.07 1.43l-2.5 1.67s3.77 6.64 5.57 7.1l1-.67s.56 1.45.27 2-1.32 2.16-2.69 2.2a3.84 3.84 0 0 1-3.43 2.57 3.64 3.64 0 0 1-3.84 2 4.47 4.47 0 0 1-3 1.73c-1.88.18-8.39-7.28-8.58-10s-.61-8.48-.61-8.48ZM302.49 213.07s10.89-14.09 11-15.59-1.79-10.83-3.89-11.09a2.51 2.51 0 0 0-2.76 1.24s-2.63.74-2.84 1.7c0 0-2 .58-2.38 1.76a4.94 4.94 0 0 0-2.19 1 2.43 2.43 0 0 0-.83 1.66l.83-.48s3.41 7.17 1.65 9.56l-4.69 3.24Z",className:"cls-21"})),S||(S=V.createElement("path",{d:"M301.1 202.84s-.34 1.35.39 1.89-2 4.91 1 8.34l-6.08-7Z",className:"cls-27"}))),V.createElement("g",{id:"head"},V.createElement("path",{d:"M211.9 121.63s-4.5.52-3.13 4.5 4.3 6.78 7.11 6.59l-.33 19.5s5.81 8.94 13.18 9 7.3-9.83 7.3-9.83v-7.17s5.15.78 6.59-10.63 1.95-28.63 0-29.15-27.85-4.2-30.72 17.19",style:{fill:"#f59d80"}}),T||(T=V.createElement("path",{d:"M211.9 121.63s2.58-.42 3.31.31c0 0 5.77 10.66 5.92 12.18s.54 10.91.54 10.91 8.75 5.67 15 4.11 9.3-6.56 9.25-7.29-2.88-12.13-2.88-12.13-3.29-1.71-4.46-1.47-15.36 3.38-15.36 3.38-4.45-10.28-4.79-11 3.08-1.42 1.56-5.48l2.48-8.53-15.39 3.79 3.48 11.6Z",className:"cls-20"})),U||(U=V.createElement("path",{d:"M215.88 132.72s2-.13 2.51-1.44c0 0-.26 3-2.54 3.33Z",className:"cls-27"})),O||(O=V.createElement("path",{d:"M218.81 107.51s9.79 3.1 14.48 3.1 15.26-1.1 15.91-3.1-5.93-4.08-5.93-4.08-14.56.57-24.46 4.08",className:"cls-8"})),L||(L=V.createElement("path",{d:"m243.27 95.09 6-3.79s-14.85-4.63-18.7-8.67c0 0-10.11 8.54-18.71 8.41 0 0-6.36 8.2-14 10.36l.72 2 6.45 1.83Z",className:"cls-23"})),A||(A=V.createElement("path",{d:"m207.09 110.4 36.18-7v-8.31a50 50 0 0 0-12.91 0c-7.24.91-25.31 10.17-25.31 10.17Z",className:"cls-8"})),V.createElement("path",{d:"M231 88s1.53 2.32 5.52 2.54c0 0 .56 8.3-4.78 10.85 0 0-5.36-.92-5.91-10.2.01-.02 3.88-.53 5.17-3.19",style:{fill:"url(#linear-gradient-9)"}}),q||(q=V.createElement("path",{d:"M231 88c-1.3 2.68-5.17 3.19-5.17 3.19.55 9.28 5.91 10.2 5.91 10.2A32 32 0 0 0 231 88",className:"cls-4"})),P||(P=V.createElement("path",{d:"M236.68 149.14a15 15 0 0 0 7.68-4.71 10.9 10.9 0 0 1-5 2.24s1.37-.91-.46-1.95-11.28 1.63-13.63.58-4.14-11.18-4.14-11.18c.15 1.52.54 10.91.54 10.91s8.75 5.67 15.01 4.11M215.21 121.94s-3.47-5.62-4-6-4.11-5.52-4.11-5.52l3.48 11.6 1.33-.37s2.65-.41 3.3.29",className:"cls-8"}))))))))}},43645:(e,a,t)=>{"use strict";t.d(a,{h:()=>r});t(30758);var l=t(86070);function r(){return(0,l.jsx)("div",{className:"flex justify-center mt-8 overflow-auto",children:(0,l.jsx)("table",{className:"table-fixed text-center",id:"landscape",children:(0,l.jsxs)("tbody",{children:[(0,l.jsxs)("tr",{className:"border-none",children:[(0,l.jsx)("td",{className:"border-none"}),(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"\u2190 individual entities"}),(0,l.jsx)("br",{}),"transactional"]}),(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"large data \u2192"}),(0,l.jsx)("br",{}),"analytical"]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"instantaneous \u2191"}),(0,l.jsx)("br",{}),"short-lived"]}),(0,l.jsxs)("td",{className:"bg-slate-100",children:[(0,l.jsx)("strong",{children:"Metatype"}),(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"composition engine for entities in evolving systems"})]}),(0,l.jsxs)("td",{children:["Trino",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"query engine for large data from multiples sources"})]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:["long-running",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"asynchronous \u2193"})]}),(0,l.jsxs)("td",{children:["Temporal",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"workflow orchestration for long-running operations"})]}),(0,l.jsxs)("td",{children:["Spark",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"batch/streaming engine for large data processing"})]})]})]})})})}},65671:(e,a,t)=>{"use strict";t.d(a,{A:()=>c});var l=t(98302),r=(t(30758),t(86070));function c(e){let{python:a,typescript:t,rust:c,...s}=e;const n=[a&&{content:a.content,codeLanguage:"python",codeFileUrl:a.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},c&&{content:c.content,codeLanguage:"rust",codeFileUrl:c.path}].filter((e=>!!e));return(0,r.jsx)(l.A,{code:0==n.length?void 0:n,...s})}},50287:(e,a,t)=>{"use strict";t.d(a,{fb:()=>N,sc:()=>k,M7:()=>j,kk:()=>b});var l=t(30758),r=t(41570),c=t(21545),s=t.n(c),n=t(86070);const i={blue:"rgb(160, 195, 242)",gray:"rgb(239, 239, 239)",orange:"rgb(252, 201, 159)",pink:"rgb(201, 158, 181)",red:"rgb(221, 147, 143)",green:"rgb(157, 187, 193)",yellow:"rgb(250, 226, 144)",turquoise:"rgb(156, 208, 228)",purple:"rgb(170, 158, 208)"};function m(e,a){return e*a*.6}function d(e){const a=l.useRef(null);return l.useEffect((()=>{a.current?.cache()})),(0,n.jsx)(r.rw,{ref:a,...e})}function o(e){let{p:[a,t],size:l,width:c,height:o,color:h,connectors:p=!0}=e;const f=a-c*l/2,E=t-m(l,o)/2,g=(0,n.jsx)(r.rw,{x:f,y:E,width:l*c,height:m(l,o),fill:i[h]??h,stroke:"black",strokeWidth:3,lineJoin:"round"});if(!p)return g;const x=Array.from({length:c},((e,a)=>a*l+.2*l));return(0,n.jsxs)(r.YJ,{children:[g,x.map((e=>(0,n.jsx)(d,{x:f+e,y:E-.25*l,width:.6*l,height:.25*l,fill:i[h]??h,filters:[s().Filters.Brighten],brightness:.075,stroke:"black",strokeWidth:3,lineJoin:"round"},e)))]})}var h=t(5136),p=t(66622);function f(e,a){let[t,r]=e;const[c,s]=(0,h.zh)((()=>({progress:0})),[]);return(0,l.useEffect)((()=>{if(t===r)return;let e=null;function l(e){return e{(0,p.__)(Object.values(c),(e=>e.stop())),window.removeEventListener("scroll",i),window.removeEventListener("keydown",d),window.removeEventListener("wheel",m)}}),[t,r]),c}function E(e,a,t){if(a.length!==t.length)throw new Error("xs and ys must have the same length");return e.to((e=>{let l=0;for(;a[l+1]{function e(){if(h.current){const{innerHeight:e}=window,{offsetTop:t,offsetWidth:l}=h.current,r=t-c,n=t+a+s,i=.5*e,m=Math.min(n/e,1),d=r-i*m,o=n-i*m;x({width:l,min:Math.max(d,0),max:Math.max(o,0)})}}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[h,x]),c{if(f.current){const{width:e,height:a}=f.current.measureSize(s);p([e,a])}}),[f,p,d]);const E=a-o/2,g=t-h/2,x=(0,n.jsx)(r.EY,{ref:f,x:E,y:g,text:s,fontFamily:m,fontSize:c});return 0===i.length?x:(0,n.jsxs)(r.YJ,{children:[x,i.map((e=>{let[l,c]=e;const s=l-a{const a=40,t=40,l=120,c=310,s=E(e,[0,.25],[1,0]),i=E(e,[.25,.5],[0,a]),d=E(e,[.25,.5],[0,-40]),h=E(e,[.5,.75],[0,-190]),p=E(e,[.5,.75],[0,1]),f=E(e,[.75,1],[0,1]),x=E(e,[.75,1],[0,a]),y=E(e,[.75,1],[0,-40]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)],text:"your database",size:20,arrows:[[260,135+2*m(t,2)]]})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,95+1*m(t,2)],text:"your backend",size:20,arrows:[[260,95+1*m(t,2)]]})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,55+0*m(t,2)],text:"your frontend",size:20,arrows:[[260,55+0*m(t,2)]]})}),(0,n.jsx)(g,{x:h,opacity:p,children:(0,n.jsx)(u,{p:[c,135+2*m(t,2)+20],text:"expectations",size:20})}),(0,n.jsx)(g,{x:h,y:d,children:(0,n.jsx)(o,{p:[c,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:h,children:(0,n.jsx)(o,{p:[c,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:h,y:i,children:(0,n.jsx)(o,{p:[c,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,y:y,children:(0,n.jsx)(o,{p:[300,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,children:(0,n.jsx)(o,{p:[320,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,y:x,children:(0,n.jsx)(o,{p:[c,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,children:(0,n.jsx)(u,{p:[c,135+2*m(t,2)+20],text:"reality",size:20})})]})}})}function b(){return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:e=>{const a=40,t=40,l=350,c=E(e,[0,.25],[0,1]),s=E(e,[0,.25],[1,0]),i=E(e,[0,.25,.5],[0,1,0]),d=E(e,[.5,.75],[0,a]),h=E(e,[.5,.75],[0,-40]),p=E(e,[.75,1],[0,-125]),f=E(e,[.75,1],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:p,y:h,opacity:c,children:(0,n.jsx)(o,{p:[l,135+2*m(t,2)],color:"orange",height:2,width:2,size:t})}),(0,n.jsx)(g,{x:p,opacity:c,children:(0,n.jsx)(o,{p:[l,95+1*m(t,2)],color:"gray",height:2,width:2,size:t})}),(0,n.jsx)(g,{x:p,y:d,opacity:c,children:(0,n.jsx)(o,{p:[l,55+0*m(t,2)],color:"blue",height:2,width:2,size:t})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[100,95+.5*m(t,2)-5],text:"typegraphs",size:20,arrows:[[300,55+-.5*m(t,2)],[300,95+.5*m(t,2)-5],[300,135+1.5*m(t,2)-10]]})}),(0,n.jsx)(g,{x:p,opacity:f,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)+20],text:"with Metatype",size:20})})]})}})}function k(){const[e]=_()("/images/logo.svg");return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:a=>{const t=40,l=120,c=380,s=E(a,[0,.25],[0,1]),i=E(a,[0,.25,.5],[0,1,0]),d=E(a,[.5,.75],[0,1]),h=E(a,[.5,.75],[1,0]),p=E(a,[.75,1],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[300,95+2*m(t,2)],color:"purple",height:2,width:2,size:t})}),(0,n.jsx)(o,{p:[c,95+2*m(t,2)],color:"orange",height:2,width:2,size:t}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[360,95+1*m(t,2)],color:"gray",height:2,width:3,size:t})}),(0,n.jsx)(g,{opacity:h,children:(0,n.jsx)(o,{p:[c,95+1*m(t,2)],color:"gray",height:2,width:2,size:t})}),(0,n.jsx)(o,{p:[c,95+0*m(t,2)],color:"blue",height:2,width:2,size:t}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(r._V,{x:70,y:90,width:100,height:120,image:e})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)],text:"typegate",size:20})}),(0,n.jsxs)(g,{opacity:s,children:[(0,n.jsx)(v,{points:[10,160,91,160]}),(0,n.jsx)(v,{points:[l,118,l,65,335,65]})]}),(0,n.jsxs)(g,{opacity:p,children:[(0,n.jsx)(v,{points:[144,160,255,160]}),(0,n.jsx)(v,{points:[l,118,l,65,320,65,320,100]})]})]})}})}function j(){return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:e=>{const a=40,t=150,l=E(e,[0,.2],[0,1]),c=E(e,[0,.2,.45],[0,1,0]),s=E(e,[.25,.45],[0,1]),i=E(e,[.25,.45,.7],[0,1,0]),d=E(e,[.5,.7],[0,1]),h=E(e,[.5,.7,1],[0,1,0]),p=E(e,[.75,.95],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:l,children:(0,n.jsx)(o,{p:[270,100+2*m(a,2)],color:"red",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:c,children:(0,n.jsx)(u,{p:[270,140+2*m(a,2)+10],text:"third parties",size:20})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[70,100+2*m(a,2)],color:"purple",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[70,140+2*m(a,2)+10],text:"internal analytics",size:20})}),(0,n.jsx)(o,{p:[t,100+2*m(a,2)],color:"orange",height:2,width:2,size:a}),(0,n.jsx)(g,{children:(0,n.jsx)(o,{p:[t,100+1*m(a,2)],color:"gray",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:l,children:(0,n.jsx)(o,{p:[210,100+1*m(a,2)],color:"gray",height:2,width:5,size:a})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[190,100+1*m(a,2)],color:"gray",height:2,width:6,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[230,100+2.5*m(a,1)],color:"pink",height:1,width:4,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[190,100+1.5*m(a,1)],color:"yellow",height:1,width:2,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[270,100+1.5*m(a,1)],color:"green",height:1,width:2,size:a})}),(0,n.jsx)(g,{opacity:h,children:(0,n.jsx)(u,{p:[390,140+0*m(a,2)+5],text:"split services",size:20})}),(0,n.jsx)(g,{opacity:p,children:(0,n.jsx)(o,{p:[250,100+0*m(a,1)],color:"turquoise",height:2,width:1,size:a})}),(0,n.jsx)(g,{opacity:p,children:(0,n.jsx)(u,{p:[355,140+-1*m(a,2)-5],text:"back for front",size:20})}),(0,n.jsx)(o,{p:[t,100+0*m(a,2)],color:"blue",height:2,width:2,size:a})]})}})}},26175:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>b});var l=t(30758),r=t(92076),c=t(30340),s=t(22653),n=t(65671),i=t(45656),m=(t(14127),t(56315)),d=t(43645),o=t(55230),h=t(86070);function p(){return(0,h.jsxs)("header",{className:"bg-gradient-to-b from-slate-200 from-0% to-white to-100%",children:[(0,h.jsx)("div",{className:"flex justify-end mt-5 mr-5 mb-0",children:(0,h.jsx)(r.A,{to:"https://devhunt.org/tool/metatype",children:(0,h.jsx)("img",{src:"images/homepage/devhunt_tab_solid.svg",alt:"Devhunt result"})})}),(0,h.jsxs)("div",{className:"container text-center py-12",children:[(0,h.jsx)("div",{className:"rounded-full bg-white w-40 h-40 flex px-6 m-auto mb-10",children:(0,h.jsx)("img",{src:"images/logo.svg",alt:"Metatype logo"})}),(0,h.jsxs)(o.A,{as:"h1",className:"text-5xl",children:["Declarative"," ",(0,h.jsx)("span",{className:"inline-block text-transparent bg-clip-text bg-gradient-to-r from-metared from-15% via-metablue via-50% to-metared to-85%",children:"API development"})," ","platform"]}),(0,h.jsxs)("p",{className:"hero__subtitle mx-auto text-3xl leading-10 max-w-[880px]",children:["Build ",(0,h.jsx)("strong",{children:"backend components"})," with ",(0,h.jsx)("strong",{children:"WASM"}),","," ",(0,h.jsx)("strong",{children:"Typescript"})," and"," ",(0,h.jsx)("strong",{children:"Python"}),", no matter where and how your (legacy) systems are."]}),(0,h.jsxs)("div",{className:"md:flex md:px-32 justify-center",children:[(0,h.jsx)(r.A,{className:"button button--primary button--lg m-2",to:"/docs/tutorials/quick-start",children:"Quick Start"}),(0,h.jsx)(r.A,{className:"button bg-slate-400 hover:bg-slate-300 button--lg m-2",to:"/docs/concepts/features-overview",children:"Learn more"})]})]})]})}function f(e){let{profile:a,setProfile:l}=e;return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"flex text-sm mb-8",children:(0,h.jsx)(m.mS,{choices:v,choice:a,onChange:l})}),(0,h.jsxs)(o.A,{as:"h2",children:[(0,h.jsx)("span",{className:"text-metared",children:"Programming"})," is like"," ",(0,h.jsx)("span",{className:"text-metared",children:"castle"})," building"]}),(0,h.jsxs)("p",{children:["And castle building is"," ",(0,h.jsx)("strong",{children:"hard"}),". Even the best teams can struggle to build according to the plans, especially with the ever evolving needs and the tech landscape complexities."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).fb;return(0,h.jsx)(e,{})}})]})}function E(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"reliable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"typegraphs"})]}),(0,h.jsxs)("p",{children:["Typegraphs are programmable ",(0,h.jsx)("strong",{children:"virtual graphs"})," ","describing all the components of your stack. They enable you to compose APIs, storage and business logic in a type safe manner."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).kk;return(0,h.jsx)(e,{})}})]})}function g(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"modulable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"typegate"})]}),(0,h.jsxs)("p",{children:["Typegate is a GraphQL/REST ",(0,h.jsx)("strong",{children:"composition engine"})," ","that compiles, optimizes, runs and caches queries over typegraphs. It enforces authentication, authorization and security for you."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).sc;return(0,h.jsx)(e,{})}})]})}function x(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"reusable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"Metatype"})]}),(0,h.jsxs)("p",{children:["Install third parties as ",(0,h.jsx)("strong",{children:"dependencies"})," ","and start reusing components. The Meta CLI offers you live reloading and one-command deployment to Metatype cloud or your self-hosted instance."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).M7;return(0,h.jsx)(e,{})}})]})}t(78245).A,h.Fragment,t(90803).A,h.Fragment,t(73712).A,h.Fragment,t(13201).A,h.Fragment,t(24546).A,h.Fragment,t(17603).A,h.Fragment;function y(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Try the ",(0,h.jsx)("span",{className:"text-metared",children:"playground"})," and"," ",(0,h.jsx)("span",{className:"text-metared",children:"deploy"})]}),(0,h.jsxs)("p",{children:["Metatype's unique approach combines the"," ",(0,h.jsx)("strong",{children:"best of the two worlds"}),". You are quickly productive thanks to the high-level abstractions, yet you can leverage all the low-level developer tooling you are familiar with."]})]}),(0,h.jsx)("div",{className:"w-full",children:(0,h.jsx)(n.A,{python:t(1673),typescript:t(48623),typegraph:"homepage",variables:{email:"fill-me",message:"Great tool!"},noTool:!0,defaultMode:"typegraph",query:t(95654)})})]})}const u=[{name:"GraphQL",logo:"/images/runtimes/graphql.svg"},{name:"HTTP",logo:"/images/runtimes/http.svg"},{name:"GRPC",logo:"/images/runtimes/grpc.svg"},{name:"Deno",logo:"/images/runtimes/deno.svg"},{name:"SQLite",logo:"/images/runtimes/sqlite.svg"},{name:"PostgreSQL",logo:"/images/runtimes/postgresql.svg"},{name:"Google APIs Explorer",logo:"/images/runtimes/google-apis-explorer.svg"},{name:"Python",logo:"/images/runtimes/python.svg"},{name:"WasmEdge",logo:"/images/runtimes/wasmedge.svg"},{name:"Temporal",logo:"/images/runtimes/temporal.svg"},{name:"S3",logo:"/images/runtimes/s3.svg"}];function M(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:[(0,h.jsx)("span",{className:"text-metared",children:"Easily"})," add your"," ",(0,h.jsx)("span",{className:"text-metared",children:"own"})," runtime"]}),(0,h.jsx)("p",{children:"More than 12 runtimes are natively supported. Usually it takes less than a day to integrate a new one and support the most frequent usages."})]}),(0,h.jsx)("div",{className:"flex flex-wrap gap-4 m-4",children:u.map(((e,a)=>(0,h.jsx)("img",{src:e.logo,alt:`${e.name} logo. All rights reserved to ${e.name}.`,style:{maxWidth:"150px",maxHeight:"80px"},className:"p-4 flex-1"},a)))})]})}function _(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Bringing ",(0,h.jsx)("span",{className:"text-metared",children:"speed"})," and"," ",(0,h.jsx)("span",{className:"text-metared",children:"novelty"})," to backend development"]}),(0,h.jsxs)("p",{className:"text-xl",children:["Metatype fills a gap in the tech landscape by introducing a new way to build fast and developer-friendly APIs that are"," ",(0,h.jsx)("strong",{children:"interoperable"})," with your existing (legacy) systems."]})]}),(0,h.jsx)(d.h,{})]})}const v={leader:"I'm an engineering leader",developer:"I'm a developer"},N={leader:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(E,{}),(0,h.jsx)(g,{}),(0,h.jsx)(x,{}),(0,h.jsx)(y,{}),(0,h.jsx)(_,{}),(0,h.jsx)(M,{})]}),developer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{}),(0,h.jsx)(y,{}),(0,h.jsx)(M,{})]})};function b(){const{siteConfig:e}=(0,c.A)(),[a,t]=(0,l.useState)(Object.keys(v)[0]);return(0,h.jsxs)(s.A,{title:e.title,description:e.tagline,children:[(0,h.jsx)(p,{}),(0,h.jsxs)("main",{id:"homepage",className:"container",children:[(0,h.jsx)(f,{profile:a,setProfile:t}),N[a]]})]})}},95654:e=>{var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stargazers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_feedback"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"message"},value:{kind:"StringValue",value:"I love X!",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_feedback"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:309}};a.loc.source={body:'query A {\n stargazers {\n login\n # composition\n user {\n name\n }\n }\n}\n\nmutation B {\n send_feedback(\n data: {\n email: "" # fill me\n message: "I love X!"\n }\n ) {\n id\n message\n }\n}\n\nquery C {\n list_feedback {\n email # cannot be accessed, delete me\n message\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,a){if("FragmentSpread"===e.kind)a.add(e.name.value);else if("VariableDefinition"===e.kind){var l=e.type;"NamedType"===l.kind&&a.add(l.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,a)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,a)})),e.definitions&&e.definitions.forEach((function(e){t(e,a)}))}var l={};function r(e,a){for(var t=0;t0;){var i=n;n=new Set,i.forEach((function(e){s.has(e)||(s.add(e),(l[e]||new Set).forEach((function(e){n.add(e)})))}))}return s.forEach((function(a){var l=r(e,a);l&&t.definitions.push(l)})),t}a.definitions.forEach((function(e){if(e.name){var a=new Set;t(e,a),l[e.name.value]=a}})),e.exports=a,e.exports.A=c(a,"A"),e.exports.B=c(a,"B"),e.exports.C=c(a,"C")},1673:e=>{e.exports={content:'@typegraph(\n)\ndef homepage(g: Graph):\n # every field may be controlled by a policy\n public = Policy.public()\n meta_only = Policy.context("email", re.compile(".+@metatype.dev"))\n public_write_only = Policy.on(create=public, read=meta_only)\n\n # define runtimes where your queries are executed\n github = HttpRuntime("https://api.github.com")\n db = PrismaRuntime("demo", "POSTGRES_CONN")\n\n # a feedback object stored in Postgres\n feedback = t.struct(\n {\n "id": t.uuid(as_id=True, config=["auto"]),\n "email": t.email().with_policy(public_write_only),\n "message": t.string(min=1, max=2000),\n },\n name="feedback",\n )\n\n # a stargazer object from Github\n stargazer = t.struct(\n {\n "login": t.string(),\n # link with the feedback across runtimes\n "user": github.get(\n "/users/{user}",\n t.struct({"user": t.string().from_parent("login")}),\n t.struct({"name": t.string().optional()}),\n ),\n }\n )\n\n # out of the box authenfication support\n g.auth(Auth.oauth2_github("openid email"))\n\n # expose part of the graph for queries\n g.expose(\n public,\n stargazers=github.get(\n "/repos/metatypedev/metatype/stargazers?per_page=2",\n t.struct({}),\n t.list(stargazer),\n ),\n # automatically generate crud operations\n send_feedback=db.create(feedback),\n list_feedback=db.find_many(feedback),\n )',path:"../examples/typegraphs/index.py"}},48623:e=>{e.exports={content:'typegraph(\n {\n name: "homepage",\n },\n (g) => {\n // every field may be controlled by a policy\n const pub = Policy.public();\n const metaOnly = Policy.context("email", /.+@metatype.dev/);\n const publicWriteOnly = Policy.on({ create: pub, read: metaOnly });\n\n // define runtimes where your queries are executed\n const github = new HttpRuntime("https://api.github.com");\n const db = new PrismaRuntime("demo", "POSTGRES_CONN");\n\n // a feedback object stored in Postgres\n const feedback = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email().withPolicy(publicWriteOnly),\n message: t.string({ min: 1, max: 2000 }, {}),\n },\n { name: "feedback" },\n );\n\n // a stargazer object from Github\n const stargazer = t.struct({\n login: t.string({}),\n // link with the feedback across runtimes\n user: github.get(\n t.struct({ user: t.string().fromParent("login") }),\n t.struct({ name: t.string().optional() }),\n { path: "/users/{user}" },\n ),\n });\n\n g.auth(Auth.oauth2Github("openid email"));\n\n // expose part of the graph for queries\n g.expose(\n {\n stargazers: github.get(t.struct({}), t.list(stargazer), {\n path: "/repos/metatypedev/metatype/stargazers?per_page=2",\n }),\n // automatically generate crud operations\n send_feedback: db.create(feedback),\n list_feedback: db.findMany(feedback),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/index.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4583],{13201:(e,a,t)=>{"use strict";t.d(a,{A:()=>I});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B=t(30758);function W(){return W=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...I}=e;return B.createElement("svg",W({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 720 504","aria-labelledby":t},I),a?B.createElement("title",{id:t},a):null,l||(l=B.createElement("defs",null,B.createElement("linearGradient",{id:"linear-gradient",x1:553.61,x2:614.75,y1:64.53,y2:214.07,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:.05,stopColor:"#fbd15b"}),B.createElement("stop",{offset:1,stopColor:"#f9a45a"})),B.createElement("linearGradient",{id:"linear-gradient-2",x1:602.04,x2:655.31,y1:218.4,y2:414.44,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#ff9d5d"}),B.createElement("stop",{offset:.08,stopColor:"#ff985d"}),B.createElement("stop",{offset:.18,stopColor:"#ff8a5c"}),B.createElement("stop",{offset:.28,stopColor:"#ff725b"}),B.createElement("stop",{offset:.28,stopColor:"#ff725b"}),B.createElement("stop",{offset:.37,stopColor:"#ff825b"}),B.createElement("stop",{offset:.49,stopColor:"#ff8f5c"}),B.createElement("stop",{offset:.64,stopColor:"#ff965c"}),B.createElement("stop",{offset:1,stopColor:"#ff985c"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:66.88,x2:128.02,y1:64.53,y2:214.07}),B.createElement("linearGradient",{id:"linear-gradient-4",x1:454.49,x2:368.74,y1:501.92,y2:385.42,gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#1252c4"}),B.createElement("stop",{offset:1,stopColor:"#3f87fe"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-5",x1:734.06,x2:767.6,y1:484.44,y2:329.47,gradientTransform:"matrix(-1 0 0 1 856.88 0)"}),B.createElement("linearGradient",{id:"linear-gradient-6",x1:658.13,x2:795.23,y1:464.45,y2:464.45,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#ff9d5c"}),B.createElement("stop",{offset:1,stopColor:"#ffc961"})),B.createElement("linearGradient",{id:"linear-gradient-7",x1:-205.8,x2:-198.21,y1:471.79,y2:444.79,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#f8a034"}),B.createElement("stop",{offset:1,stopColor:"#ffc546"})),B.createElement("linearGradient",{id:"linear-gradient-8",x1:-207.32,x2:-216.74,y1:472.78,y2:453.26,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},B.createElement("stop",{offset:0,stopColor:"#fcb72c"}),B.createElement("stop",{offset:1,stopColor:"#ffcf44"})),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-9",x1:-195.32,x2:-191.96,y1:474.01,y2:461.47}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-10",x1:-384.69,x2:-378.62,y1:467.88,y2:446.25,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-11",x1:-385.91,x2:-393.46,y1:468.67,y2:453.03,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-8",id:"linear-gradient-12",x1:-376.3,x2:-373.61,y1:469.66,y2:459.61,gradientTransform:"translate(1025.24)"}),B.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-13",x1:285.38,x2:205.29,y1:277.13,y2:163.87}),B.createElement("style",null,".cls-3{fill:#f55662}.cls-44{opacity:.3;mix-blend-mode:multiply}.cls-6{fill:#fe845a}.cls-27,.cls-7,.cls-9{fill:none;stroke:#231f20;stroke-linecap:round;stroke-miterlimit:10}.cls-7{stroke-width:1.23px}.cls-9{stroke-width:1.17px}.cls-12{fill:#403881}.cls-13{fill:#fca080}.cls-14{fill:#e0e6ee}.cls-15{fill:#232059}.cls-16{fill:#201851}.cls-19{fill:#094081}.cls-21{fill:#f59d80}.cls-22{fill:#d07a62}.cls-27{stroke-width:1.1px}.cls-32{fill:#231f20}.cls-38{fill:#fda181}.cls-39{fill:#e1e7ef}.cls-40{fill:#403882}.cls-41{fill:#1150be}.cls-42{fill:#094082}"))),B.createElement("g",{style:{isolation:"isolate"}},B.createElement("g",{id:"Layer_2","data-name":"Layer 2"},B.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},B.createElement("path",{d:"M0 0h720v504H0z",style:{fill:"#fff"}}),B.createElement("g",{id:"chair"},r||(r=B.createElement("path",{d:"m287.77 469.08-35.26-99.86h9.71c2.3 0 4.18-1.17 4.18-2.61v-3.37c0-1.44-1.88-2.61-4.18-2.61h-123.1c-2.3 0-4.18 1.17-4.18 2.61v3.37c0 1.44 1.88 2.61 4.18 2.61h12.5l-35.26 99.86c-.47 1.34.9 2.68 3 3s4.29-.56 4.76-1.9l35.68-100.96h84.53L280 470.16c.47 1.34 2.61 2.2 4.76 1.9 2.11-.3 3.48-1.64 3.01-2.98",className:"cls-3"})),B.createElement("g",{style:{opacity:.3,mixBlendMode:"multiply"}},c||(c=B.createElement("path",{d:"M252.51 369.22h-8.18l9.68 27.41 8.25.19zM151.62 369.22l-8.79 24.89 8.12.19 8.85-25.08z"})))),B.createElement("g",{id:"trees"},B.createElement("ellipse",{cx:592.6,cy:159.9,rx:42.48,ry:88.52,style:{fill:"url(#linear-gradient)"}}),s||(s=B.createElement("path",{d:"M615.52 85.35c6.66 15.64 10.71 36.22 10.71 58.77 0 48.89-19 88.52-42.48 88.52-8.44 0-16.3-5.12-22.91-14 7.78 18.25 19.12 29.75 31.76 29.75 23.46 0 42.48-39.63 42.48-88.52 0-31.27-7.8-58.78-19.56-74.52",className:"cls-6"})),n||(n=B.createElement("g",{id:"TREE"},B.createElement("path",{d:"M593.18 106.98v361.24M593.18 146.98l16.56-20.21M593.18 188.53l16.56-20.2M593.18 170.36l-16.55-20.2M593.18 207.44l-16.55-20.21M593.18 231.64l16.56-20.21",className:"cls-7"}))),B.createElement("path",{id:"tree-2",d:"M669.76 324.27c-8-13.73 8.22-27.21 2.71-41-2.84-7.11-11.19-10.29-15.68-16.48-3.6-4.95-4.4-11.34-4.9-17.44s-.87-12.45-3.84-17.8a16 16 0 0 0-3.06-3.93c-3.31-3.14-7.9-4.9-12.13-3.46-5.38 1.84-8.05 7.76-9.74 13.18a125 125 0 0 0-4.23 18.31c-.91 5.91-1.55 12.27-5.37 16.86-4.19 5.05-11.27 6.78-15.94 11.39a17.39 17.39 0 0 0-4.84 15c.8 4.75 3.54 8.92 5.5 13.32s3.08 9.73.68 13.91c-2.11 3.68-6.38 5.5-9.34 8.55-3.78 3.89-5.19 9.69-4.51 15.08s3.24 10.38 6.47 14.74a51.05 51.05 0 0 0 16.36 14.22c9.53 5.2 21.33 7.81 27.46 16.78 4.78-10.34 22-17.52 28.7-23.23 7-6 13.47-14.09 14.82-23.52 1.51-10.55-4.26-16.19-9.12-24.48","data-name":"tree",style:{fill:"url(#linear-gradient-2)"}}),i||(i=B.createElement("path",{d:"M636.11 309.59v157.59M636.11 360.87l22.7-22.7M636.11 332.38l-19.51-19.51",className:"cls-9"})),B.createElement("ellipse",{cx:105.87,cy:159.9,rx:42.48,ry:88.52,style:{fill:"url(#linear-gradient-3)"}}),m||(m=B.createElement("path",{d:"M128.78 85.35c6.67 15.64 10.72 36.22 10.72 58.77 0 48.89-19 88.52-42.48 88.52-8.44 0-16.3-5.12-22.91-14 7.78 18.25 19.12 29.75 31.76 29.75 23.46 0 42.48-39.63 42.48-88.52 0-31.27-7.8-58.78-19.57-74.52",className:"cls-6"})),d||(d=B.createElement("g",{id:"TREE-3","data-name":"TREE"},B.createElement("path",{d:"M106.45 106.98v361.24M106.45 146.98l16.56-20.21M106.45 188.53l16.56-20.2M106.45 170.36l-16.56-20.2M106.45 207.44l-16.56-20.21M106.45 231.64l16.56-20.21",className:"cls-7"})))),B.createElement("g",{id:"man"},B.createElement("ellipse",{cx:556.31,cy:471.57,rx:64.23,ry:3.35,style:{fill:"#c7ccd1"}}),o||(o=B.createElement("g",{id:"legs"},B.createElement("path",{d:"M525.91 455.54c0-.87-4.18-1.24-4.18-1.24S504.63 460 501 462c-2.41 1.32-3.2 5-3.46 7.28a1.74 1.74 0 0 0 1.7 1.92c7.93.12 39 .56 39.33 0s-.55-14.43-.55-14.43-12.11-.35-12.11-1.23",className:"cls-12"}),B.createElement("path",{d:"m522.06 446.81-.33 7.49s4.18.37 4.18 1.24 12.15 1.18 12.15 1.18l.55-8Z",className:"cls-13"}),B.createElement("path",{d:"M497.58 469.26a1.74 1.74 0 0 0 1.7 1.92c7.93.12 39 .56 39.33 0a14.6 14.6 0 0 0 0-2.69l-31.6.2-.38-9A58 58 0 0 0 501 462c-2.37 1.3-3.16 5-3.42 7.26",className:"cls-14"}),B.createElement("path",{d:"M612.13 444.69s-9 3.49-9.45 3.14-2.58.8-2.58.8-.31 4.56-1 5.67-5.87 6.67-10.62 8.57c-3.36 1.35-4.4 5.07-4.71 7.14a1.26 1.26 0 0 0 1.25 1.44h12.86c2.43 0 22.35-13.61 22.65-15.33s-8.4-11.43-8.4-11.43",className:"cls-12"}),B.createElement("path",{d:"M602.68 447.83c.45.35 9.45-3.14 9.45-3.14l-2.93-7.18-12.73 5.68 3.63 5.44s2.12-1.16 2.58-.8",className:"cls-13"}),B.createElement("path",{d:"M583.76 470a1.26 1.26 0 0 0 1.25 1.44h12.86c2.43 0 22.35-13.61 22.65-15.33a3 3 0 0 0-.59-1.58c-4.34 3.56-20.18 13.6-21 14s-4.52 0-4.52 0c.14-4.18-3.46-7-3.46-7a15.2 15.2 0 0 1-2.47 1.27c-3.37 1.42-4.41 5.14-4.72 7.2",className:"cls-14"}),B.createElement("path",{d:"M561.52 284.21s5.71 13.85 2.27 28.82c0 0 13.35 51.27 15.17 53.69s9.31 10.42 11.23 16.69 19 54.1 19 54.1l-13 6.78s-31.68-54.29-34.67-59.36-17.14-30.14-17.14-30.14-2.73 16.28-2.43 17.5-1.16 5 0 6.17 2 10 1.54 19-4.86 51.27-4.86 51.27-14.46 1.72-17.49-1c0 0-5.6-70.34-6-75.06s0-10.12-.14-12.14-5.59-69.64-5.59-69.64Z",className:"cls-12"}),B.createElement("path",{d:"M534 294c.08-2.21.12-4.3.12-6.29l-24.7 3.16s5.46 67.62 5.59 69.64-.26 7.42.14 12.14 6 75.06 6 75.06c-2.43-34.88 8.7-55.31 10.72-67.85s12.54-25.08 12.54-25.08-18.61-35.93-21.31-44.56S534 294 534 294",className:"cls-15"}))),B.createElement("g",{id:"body"},h||(h=B.createElement("path",{d:"m467.39 141-106.53-16.93a8.31 8.31 0 0 0-9.51 6.9l-4.71 29.69a35 35 0 0 0 .13 5.24l3.84.58c.21 0 .44.08.66.1a5.2 5.2 0 0 0 2.15-.3 22 22 0 1 1-7.86 36.4 3.45 3.45 0 0 0-2.08-1l-4-.61-5 36.22a8.2 8.2 0 0 0 6.81 9.38l30.43 4.83a3.83 3.83 0 0 1 2.52 6A22 22 0 0 0 394 292.2c7.43-.53 15.83-6.77 18.52-13.72a22.18 22.18 0 0 0 .5-15 3.71 3.71 0 0 1 4.12-4.8l30.62 4.86a8.18 8.18 0 0 0 9.37-6.8L474 150.15a8 8 0 0 0-6.61-9.15",className:"cls-16"})),p||(p=B.createElement("path",{d:"M408.54 277.89a22.18 22.18 0 0 0 .5-14.95 3.71 3.71 0 0 1 4.12-4.8l30.63 4.86a8.19 8.19 0 0 0 9.37-6.8l16.93-106.65a8 8 0 0 0-6.64-9.15l-106.53-16.92a8.31 8.31 0 0 0-9.51 6.9l-4.71 29.69a5.12 5.12 0 0 0 6.78 5.62 21.95 21.95 0 1 1-7.86 36.39 3.51 3.51 0 0 0-5.91 2l-5.19 32.68a8.19 8.19 0 0 0 6.81 9.37l30.43 4.83a3.84 3.84 0 0 1 2.52 6A22 22 0 0 0 390 291.61c7.45-.54 15.85-6.77 18.54-13.72",className:"cls-3"})),B.createElement("path",{d:"M439 236.83c3.8 2 14.91 4 20.48 4.86l1.36-8.54-30.54-7s3.55 7.95 8.7 10.68",style:{mixBlendMode:"multiply",opacity:.5}}),B.createElement("path",{d:"M560 258.12c.61-7.69 2.23-46.18 1.28-52.38s-12.3-13.4-12.3-13.4-18.44 4.45-25.48 8.2c0 0-23 6.68-27.61 6.41-3.42-.2-21.11-4.12-29.86-6.1l-2.46 15.49c9.45 3 28 8.58 34.61 8.68 1.63 0 3.93-.13 6.59-.38l-3.76 2a100.9 100.9 0 0 0-23.59 0 101.6 101.6 0 0 1-15.58.57 40 40 0 0 1-5.59-.57l-1.89 11.06 5.68.89c11.33 1.74 36.34 5.38 44.07 4.94a38.4 38.4 0 0 0 5.9-1c.11 7.48.65 14.19.44 16.78-.4 5-1 31.56-1 31.56s6.07 3.44 17.8 3.82 34.33-10.49 34.33-10.49-2.24-18.4-1.58-26.08",style:{fill:"#1150bf"}}),f||(f=B.createElement("path",{d:"m512 221 17.8-9.1s-5.8-3.78-4.66-6.81 6.78-5.51 6.78-5.51l2.95-3.41a73.3 73.3 0 0 0-11.44 4.33C521 202.7 514 214 512 221M527.93 280.37c2.56-1-4.59-2.23-9.55-3.24s-4.88-18.67-3.53-23.26 31-22.35 31-22.35c-2 .91-35.93 11-35.93 11 .11 7.48.65 14.19.44 16.78-.4 5-1 31.56-1 31.56s6.07 3.44 17.8 3.82A31.6 31.6 0 0 0 534 294c-7.08 0-8.63-12.62-6.07-13.63",className:"cls-19"})),B.createElement("path",{d:"M514.72 203c-7.86 3.62-18.59 8.38-24.34 7.73-7.33-.82-18.6-3.61-25.12-5.32l-1.74 11c9.45 3 28 8.58 34.61 8.68 1.63 0 3.93-.13 6.59-.38L512 221s5.26-14 11.43-20.5c.01.04-3.84 1.16-8.71 2.5",style:{fill:"#073868"}}),E||(E=B.createElement("path",{d:"M456.2 226.68a20 20 0 0 1-2.41-.32c-.72-.2-3.06-3.33-4.3-4s-5.21-2.09-6.06-2.61-.45 1.44 0 2.15a16.6 16.6 0 0 0 2 2.09l-5.93-1.24s-4.11-3.52-5.8-3.91-1.69.91-1.69.91-1.5-1-2.15-.45.91 1.89.91 1.89-1-.66-1.45 0 2.05 3.75 2.05 3.75-1.95-.12-.73 1.77a48 48 0 0 0 4.49 5.56 29.3 29.3 0 0 0 7.62 4c2.3.64 11.6 1.4 11.6 1.4Z",className:"cls-21"}))),B.createElement("g",{id:"head"},g||(g=B.createElement("path",{d:"M525.06 160.38s-3.64 27.1 0 28.37 8.09 0 8.09 0-1.26 10-1.21 10.87 16.13-3.9 17-7.28l-1.57-18.56s5.46-9 .71-12.08-16.9-8.04-23.02-1.32",className:"cls-21"})),x||(x=B.createElement("path",{d:"m533.15 188.75 5.57-2.33-5.94 5.35zM542.81 175.35a3.14 3.14 0 0 0 4.55-1.57s-.28 6.6-4.55 1.57M528.83 162.88c1.67-2.07 3-1.78 3.19-.76s.93 1.88 3.28 1.22a5.18 5.18 0 0 1 4.36 1.07 13.6 13.6 0 0 0 2.1-5.78c-5.53-2-12.52-2.84-16.7 1.75 0 0-.21 1.57-.47 4a4.76 4.76 0 0 0 4.24-1.5",className:"cls-22"})),y||(y=B.createElement("path",{d:"M556.55 163.57c-.34-2.56-2-2.53-2-2.53s2.39-6.27-.77-8a22.1 22.1 0 0 0-7.89-1.88s-9.51-4.92-11.6-3.78c0 0-4-4-8.36-2.56s-10.4 4.3-6.13 14.22 9.17-.13 11.66 1.76.61 2.76 3.78 2.22 4.38 1.35 4.38 1.35-1.59 8 .77 7.62 4.12-4.86 6.54-5.09.39 6.84.39 6.84-1.9 4.08-1.33 4.85a3.64 3.64 0 0 0 1.83 1.08l6.18-11.42s2.88-2.12 2.55-4.68",className:"cls-12"})),B.createElement("path",{d:"M540.43 172c2.36-.41 4.12-4.86 6.54-5.09s.39 6.84.39 6.84-1.9 4.08-1.33 4.85a3.64 3.64 0 0 0 1.83 1.08l6.14-11.43s2.93-2.12 2.6-4.68-2-2.53-2-2.53 2.5.54.68 3.37-6.07 0-6.07 0a1.46 1.46 0 0 1-2 0s-4.45 3-7.58 0c.03 0-1.56 8.02.8 7.59",style:{fill:"#1e194f"}}))),B.createElement("g",{id:"puzzle_3","data-name":"puzzle 3"},u||(u=B.createElement("path",{d:"M446.85 348h-30.07a5.12 5.12 0 0 0-4.48 7.58c1.82 3.29-4.58 31.78-18 32.52a22 22 0 0 1-19.14-34.57 3.5 3.5 0 0 0-2.85-5.53h-33.1a8.19 8.19 0 0 0-8.18 8.19s-3 35.52-5.55 34.25a21.8 21.8 0 0 0-8.66-2.28h-1.11l-5.83-.09L309 432h4.73c4.5-.13 8.4-.55 11.87-2.32A3.72 3.72 0 0 1 331 433v31a8.18 8.18 0 0 0 8.18 8.18h108a8 8 0 0 0 8-8V356.35a8.3 8.3 0 0 0-8.33-8.35",className:"cls-16"})),B.createElement("path",{d:"M304.93 431.46a22.14 22.14 0 0 0 14.84-1.85 3.71 3.71 0 0 1 5.39 3.32v31a8.19 8.19 0 0 0 8.19 8.19h108a8 8 0 0 0 8-8V356.25A8.31 8.31 0 0 0 441 348h-30a5.11 5.11 0 0 0-4.48 7.58 22 22 0 1 1-37.18-2 3.5 3.5 0 0 0-2.86-5.53h-33.13a8.19 8.19 0 0 0-8.19 8.19V387a3.83 3.83 0 0 1-5.55 3.43 22 22 0 0 0-31.13 24.94c1.69 7.21 9.16 14.52 16.45 16.09",style:{fill:"url(#linear-gradient-4)"}})),B.createElement("g",{id:"plants"},B.createElement("path",{d:"M246.45 440.58c1.4-1.61 7.86-4.08 10.58-8.06s12.14-17.86 19.33-15.15-6.22 12.43-10.2 17.29-4.31 18.94-14.83 18.94-7.99-9.42-4.88-13.02",style:{fill:"#3d86fa"}}),B.createElement("path",{d:"M245.83 404.36s5 .15 4.57 7.24-2.38 12.38-2 16.16 3.84 18.31-2.57 19.28-13.79-1.21-10.58-11.65.29-33.07 10.58-31.03",style:{fill:"#1351be"}}),M||(M=B.createElement("path",{d:"M244.28 412.81s-4.66 42.86-4.66 57.55M241 470.36s2.7-26.35 32-49.13",className:"cls-27"})),B.createElement("g",{id:"plant"},_||(_=B.createElement("path",{d:"M55.54 376c1.49 37.9 25.34 98.74 48.35 91.62 6.06-1.88-1.73-30.12-24-55C63.8 394.69 59.58 381.54 55.54 376",className:"cls-6"})),v||(v=B.createElement("path",{d:"M123.49 462.91c-.14 2.39 33 5.43 48.3-19.57 12-19.47 19.38-21.22 25.78-24.67-43.57-.79-73.71 37.99-74.08 44.24",className:"cls-16"})),B.createElement("path",{d:"M135.33 411.47c-.21-2 1.86-16.68-.35-28.17-4.53 4.44-21.35 61.7-20.82 71 .2 3.43-1.81 12.86 5.37 14.56 7.57 1.8 21.55-16.49 26.5-29.1 16.38-41.7 4.6-39.94 18.25-63.66-5.43 3.9-26.09 27.9-28.95 35.37",style:{fill:"#413b8a"}}),N||(N=B.createElement("path",{d:"M144.08 395.33c-2.75 4-4 8.71-6.7 12.61-2.17 3.15-1.95 7.1-3.49 10.13-1.66 3.25-4.56 4.92-4.73 9.49-.08 2.13.46 3.9.27 5.83-.24 2.4-1.25 4.62-1.28 7.19 0 1.79.53 3.5.58 5.21.13 4.8-7.48 12.66-1.38 17-.33 4.05.41 5.49 2.5 5.55 4.46.13 4.29-4.42 5.17-6.92 1-2.89 4.28-4.77 4.59-8.74.16-2-1-4.45-.8-6.31.17-1.4 1.46-2.17 2.2-3.35 1.91-3 2-6.53 1.79-10-.12-2-1.72-5.26-1.47-7.09.48-3.51 4-4.4 3-9.46-.33-1.53-1.64-3.38-1.6-4.95s1.07-2.63 1.6-4.06c1.44-3.93-.2-8.06-.25-12.13",className:"cls-6"})),B.createElement("path",{d:"M127.11 453.37c-4.27-.17-9.66 3.86-12.5 8.31.06-2.79.2-5.59.39-8.4 3-2.77 8.2-2 11.21-5.55 3.18-3.76 0-8-4.5-5.73-2.19 1.1-4.74 4.77-6.44 7.8.16-2 .37-4.77.54-6.76.14-1.74.25-3.47.35-5.19 3.46-2.16 10.87-2 11.65-7.72.55-4-3.43-6.79-6.64-3.52a29.3 29.3 0 0 0-4.85 7.23c.1-3.22.09-6.43 0-9.62 3.8-3 12.48-2.12 14.17-7.73 1.38-4.58-4.45-5.64-7.77-3.38s-4.92 6.22-6.46 9.89c-.13-2.38-.33-4.75-.61-7.13 2.86-2.91 8.83-4.88 10-9.62s-2.56-9.69-7-5c-2.32 2.48-3.25 6.33-3.69 10-.43-2.61-1-5.21-1.58-7.78a32.6 32.6 0 0 1 2.81-5.06c1.42-2 3.51-4 3.28-6.61-.41-4.49-3.86-2.2-5.42.74a17.3 17.3 0 0 0-1.56 7.42c-.78-2.87-2.07-7.21-3.07-10 1.51-4.6 12.91-13.46 4.67-14-3.9-.27-5.47 7.42-5.57 12-.59-1.52-2.07-5-2.18-5.27 1.36-3.77 8-15.36 2.36-16-4.48-.51-4.44 7-4.08 10.65.05.46.08 1.14.14 1.87-1.07-2.29-2.21-4.58-3.44-6.84a21.2 21.2 0 0 0 2.56-5.2c.43-1.37 1.71-7.36-2-5.28-1.43.79-2 5.07-1.86 8.1q-1.37-2.37-2.86-4.64c-5.44-11.6-.08-26.27-9-24.85-10.55 1.68-7.55 10.38-5 13.63a41.4 41.4 0 0 0 11.72 10c1 1.69 4.81 9.16 5.29 10.14-4.2-5.2-12.65-15.46-16.08-9.84-3 5 11.77 8.84 16.88 11.51 1.39 2.95 4.48 10.54 4.77 11.33-1.91-2.16-3.5-5.42-6.06-6.92-2.28-1.33-7.65-2.44-7.7.94-.07 4.81 6.87 5.43 10.28 6.3 2.46.63 3.46 1.74 4.15 1.53q2 5.81 3.52 11.78c-2.6-4.78-10.27-15-14-9.53-4.85 7.09 9.47 7.29 14.29 10.6a122 122 0 0 1 2.3 12.35v.14c-1.67-3.79-3-7.64-6.32-10.54-3.05-2.64-8.56-4-8.62 2.25 0 4.54 7.92 5.41 11.56 7.62 1.61 1 2.79 2.26 3.63 2.79a114 114 0 0 1 .63 11.69c-6.4-5.52-11.18-21.63-16.87-14.27-5 6.45 10.29 7.9 16.83 15.75 0 3.56-.17 7.13-.41 10.71a40.6 40.6 0 0 0-3.52-8.26c-1-2-6.54-7.89-9.15-3.52s5.43 8 7.84 9.39a11.7 11.7 0 0 1 4.64 4.91c-.05.66-.78 8.81-1 12.24-1.57-5.92-15-27.81-20.56-15.91-3.57 7.63 13 9.53 16.67 12.26 2.51 1.86 3.37 3.48 3.79 5.18q-.18 3-.21 6c-3.15-5.54-11-16.22-15.23-8.26-5 9.41 8.35 7 10.83 8.44 2.16 1.24 4.59 2 4.51 5.07a60 60 0 0 0 .79 7c.3 1.64 2.91 1.08 2.73-.57a95 95 0 0 1-.5-9.66c3.82-2.23 12.25-2.2 14.82-4.27 3.6-2.99 2.39-6.94-2.29-7.13",style:{fill:"url(#linear-gradient-5)"}}),B.createElement("path",{d:"M61.65 478s4.78-14.14 15.85-9.59c0 0 5.53-17.9 19.12-3.9s9.41-16.06 22.94-13.36 9.51 13 9.51 13 12.93-6.67 10.09 4.85c0 0 30.41-15.17 30.91-2.34 0 0 20.38-3.77 16.86 6.79 0 0 11.82-3 11.82 4.53Z",style:{fill:"url(#linear-gradient-6)"}})),B.createElement("g",{id:"plant_3","data-name":"plant 3"},B.createElement("path",{d:"M462 465.72s-.78-27.18-10.34-29.19-10.93 17 0 35.68Z",style:{fill:"url(#linear-gradient-7)"}}),b||(b=B.createElement("path",{d:"M457 469a.17.17 0 0 1-.16-.12c-4.56-18.34-6.52-25.08-6.54-25.15a.18.18 0 0 1 .11-.2.17.17 0 0 1 .2.11c0 .07 2 6.82 6.55 25.16a.18.18 0 0 1-.12.2Z",className:"cls-32"})),B.createElement("path",{d:"M465.28 472.21s14.57-13.82 9.11-20.52-19.12 4.91-22.76 20.52Z",style:{fill:"url(#linear-gradient-8)"}}),k||(k=B.createElement("path",{d:"M459.59 470.36h-.06a.17.17 0 0 1-.09-.21c3.62-8.19 10.67-14.7 10.74-14.77a.16.16 0 0 1 .23 0 .15.15 0 0 1 0 .22c-.07.07-7.07 6.54-10.66 14.67a.15.15 0 0 1-.16.09",className:"cls-32"})),B.createElement("path",{d:"M453 472.21s-3.71-15.72-11.22-14.38 0 14.27 0 14.27Z",style:{fill:"url(#linear-gradient-9)"}}),j||(j=B.createElement("path",{d:"M445.59 470.25a.16.16 0 0 1-.15-.12l-2.51-9.13a.16.16 0 0 1 .12-.19.15.15 0 0 1 .2.11l2.5 9.14a.17.17 0 0 1-.11.2Z",className:"cls-32"}))),B.createElement("g",{id:"plant_3-2","data-name":"plant 3"},B.createElement("path",{d:"M637.2 463s.63-21.78 8.29-23.39 8.75 13.58 0 28.59Z",style:{fill:"url(#linear-gradient-10)"}}),Z||(Z=B.createElement("path",{d:"M641.16 465.63a.12.12 0 0 0 .12-.1c3.65-14.69 5.23-20.09 5.24-20.14a.13.13 0 1 0-.25-.07c0 .05-1.59 5.46-5.24 20.15a.13.13 0 0 0 .1.16Z",className:"cls-32"})),B.createElement("path",{d:"M634.54 468.22s-11.67-11.08-7.29-16.44 15.32 3.93 18.24 16.44Z",style:{fill:"url(#linear-gradient-11)"}}),w||(w=B.createElement("path",{d:"M639.1 466.74a.13.13 0 0 0 .07-.17 40.9 40.9 0 0 0-8.6-11.83.13.13 0 1 0-.18.18 40.7 40.7 0 0 1 8.61 11.74.14.14 0 0 0 .1.08",className:"cls-32"})),B.createElement("path",{d:"M644.42 468.22s3-12.6 9-11.53 0 11.44 0 11.44Z",style:{fill:"url(#linear-gradient-12)"}}),z||(z=B.createElement("path",{d:"M650.32 466.65a.13.13 0 0 0 .12-.1l2-7.32a.13.13 0 0 0-.09-.16.14.14 0 0 0-.16.09l-2 7.33a.13.13 0 0 0 .09.15Z",className:"cls-32"})))),B.createElement("g",{id:"lady"},D||(D=B.createElement("g",{id:"SHOES"},B.createElement("path",{d:"M218.67 347.36s10.16 5.73 13.22 6.43 4.41 2.44 4.5 3.95-.22 2.19-.48 2.29-29.76 1.19-30.07-.26 1.62-12 1.62-12Z",className:"cls-15"}),B.createElement("path",{d:"M218.67 347.36s-4.87.81-4.86 1.67-6.35-1.25-6.35-1.25l-.72-9.72 12.49.4Z",className:"cls-38"}),B.createElement("path",{d:"M205.84 359.77c.31 1.45 29.81.37 30.07.26s.57-.79.48-2.29-1.44-3.24-4.5-3.95a8.6 8.6 0 0 1-1.27-.41c-.86.55-2.2 5.51-2.2 5.51-2.19.13-18.8-.2-22.59-.28a4.6 4.6 0 0 0 .01 1.16",className:"cls-39"}),B.createElement("path",{d:"m161.65 332.29-1.06 9.38-3.61 9.5a1.5 1.5 0 0 0 .81 1.92c4.12 1.77 16.62 7 20.35 7.54a44.4 44.4 0 0 0 8.53.14 1.76 1.76 0 0 0 1.63-1.85c-.13-2.18-.85-5.75-4.18-6.66-4.88-1.33-12-8.86-12-8.86l2.14-7.45Z",className:"cls-40"}),B.createElement("path",{d:"M172.15 343.4s-4.21-.09-5.06.7-6.5-2.43-6.5-2.43l1.06-9.38 12.64 3.71Z",className:"cls-38"}),B.createElement("path",{d:"M157.79 353.09c4.12 1.77 16.62 7 20.35 7.54a44.4 44.4 0 0 0 8.53.14 1.76 1.76 0 0 0 1.63-1.85c-.13-2.18-.85-5.75-4.18-6.66-.28-.08-.56-.18-.85-.29-5.16.83-5.48 6.43-5.48 6.43-4.46-.95-16.93-6.2-20.6-7.77l-.2.54a1.5 1.5 0 0 0 .8 1.92",className:"cls-39"}))),G||(G=B.createElement("g",{id:"PANTS"},B.createElement("path",{d:"M220.91 158.58s6.56 38.76 5.38 73.5-6.62 107.3-6.62 107.3-10.34.65-13.62-.95c0 0-6.2-49.45-4.78-64.61s1.73-16.66 1.73-18.34-2.66-26.86-2.66-26.86-5.76 28.1-8.33 40S174.29 336 174.29 336s-10-.47-12.64-3.66c0 0 3.43-51.64 7-64.29s5.2-19.38 5-25.05-3.67-41.71.82-60.74 8.6-26.09 8.6-26.09Z",className:"cls-40"}),B.createElement("path",{d:"m205.88 195.56-5.59 33.06s2.71 25.17 2.71 26.86-.26 3.19-1.68 18.34c-.14 1.48-.21 3.28-.21 5.32l.07 4.68s2.47-18.21 4.75-27.18-.05-61.08-.05-61.08",className:"cls-15"}))),B.createElement("g",{id:"body-2","data-name":"body"},C||(C=B.createElement("path",{d:"M212.58 44.38s5.29-1.4 5.79 2.65-1.37 12.31 3.14 13.88 10.41 3.55 7.93 9-10.08 8.51-6.2 13.72 7.19 5.2 1.49 11.48-47.48 5.8-47.48 5.8-7.88-3.32-9.86-9.68-6-10.82-.08-13 10.69-1.62 11.15-10.3.56-19.31 6.85-23.78 20.5-9.84 23.56-6.95a14 14 0 0 1 3.71 7.18",className:"cls-40"})),H||(H=B.createElement("path",{d:"M220.27 75c1.07-5.87-.5-7.93-2.89-14.05a42.8 42.8 0 0 1-2.62-12.53s-12.21 18.23-18.89 19.06-9.07-3.61-9.07-3.61-3.63 3.2-4.7 10.38-19.09.64-17.4 10c.67 2 1.86 4.29 2.69 7a22.1 22.1 0 0 0 7.08 10.15s44.56 0 50.26-6.27c5.54-6.1 2.58-6.27-1.16-11a9.29 9.29 0 0 1-3.3-9.13",className:"cls-15"})),S||(S=B.createElement("path",{d:"M326.36 181.65c-3.17-6.72-12-12.28-19.43-12.28a22.1 22.1 0 0 0-14.08 4.92 3.71 3.71 0 0 1-6-2.11L280.39 142a8.16 8.16 0 0 0-9.7-6.26L165.4 158.35a8 8 0 0 0-6.12 9.48L181.92 273a8.28 8.28 0 0 0 5.59 6.15l-1.39.39h4.12a8 8 0 0 0 1.52-.18l2.29-.49 27-5.82a5.1 5.1 0 0 0 2.78-8.33 21.89 21.89 0 1 1 36.68-5.8 3.49 3.49 0 0 0 1 4.1l-1.58.77h3.65a3.6 3.6 0 0 0 .85-.08l32.26-6.94a8.18 8.18 0 0 0 6.27-9.71l-6.47-30a3.82 3.82 0 0 1 4.69-4.51 21.92 21.92 0 0 0 25.13-30.85Z",className:"cls-16"})),T||(T=B.createElement("path",{d:"M255.08 136.83c-3.12-5.12-7.42-12.14-12.35-20.08-10.12-16.28-14.37-20.92-14.37-20.92-1.54-1.48-15-4-15-4L196 91.07s-5.2-.62-13-.86c-5.64-.17-8.9 2.11-13.17 6.1 4.78-3.83 7.9 24.07 7.9 24.07s1.94 12.78 3.46 23.07L183 145c5.46 4.75 12.34 11.16 12.34 11.16l-3.72 4.75 1 .31c3.64 1.06 27.74-2.13 28.33-2.6s3.84-23.05 4.43-24.94 4-6.91 4-6.91l15.69 22.78 15.27-4s-1.98-3.35-5.26-8.72",className:"cls-41"})),U||(U=B.createElement("path",{d:"M204.88 132.72c-1.14-.91-9.88-1.61-14.74-2.73s-7-16.38-7-16.38l-5.39 6.77s1.94 12.78 3.46 23.07L183 145c5.46 4.75 12.34 11.16 12.34 11.16l-3.72 4.75 1 .31a26 26 0 0 0 6.26.08c-.69-3.76-2.94-16.15-3.54-19.74-.75-4.28 10.66-7.93 9.54-8.84M229.36 126.73s2-4.25 1.87-7a64 64 0 0 0-1.55-8.43s6.74 16.18 8.36 19.35 22.28 14.77 22.28 14.77l-15.27 4Z",className:"cls-42"})),B.createElement("path",{d:"M303.21 169.37a22.1 22.1 0 0 0-14.08 4.92 3.7 3.7 0 0 1-5.95-2.11L276.67 142a8.16 8.16 0 0 0-9.7-6.26l-105.29 22.61a8 8 0 0 0-6.12 9.48L178.2 273a8.28 8.28 0 0 0 9.84 6.35l29.31-6.35a5.11 5.11 0 0 0 2.79-8.33 21.66 21.66 0 0 1-5-10.28 21.9 21.9 0 1 1 41.66 4.48 3.5 3.5 0 0 0 3.95 4.79l32.25-6.9a8.18 8.18 0 0 0 6.27-9.71l-6.47-30a3.83 3.83 0 0 1 4.7-4.51 21.92 21.92 0 0 0 25.12-30.85c-3.15-6.76-11.98-12.32-19.41-12.32",style:{fill:"url(#linear-gradient-13)"}}),O||(O=B.createElement("path",{d:"M192.14 98.87c6.11 3.9 13.91 3.45 13.91 3.45-.27-5.18-1.06-8.15-4.19-11l-5.86-.25s-5.2-.62-13-.86a16.3 16.3 0 0 0-3.59.28c5.46-1.08 6.71 4.51 12.73 8.38",className:"cls-42"})),L||(L=B.createElement("path",{d:"M203.59 174.79c4.11 1.08 5.82.52 6.17-.4 0 0 2.56.49 3.15.13s1.48-1.06 1.89-1 1.26-.75 1.5-1.13-17.94-11.29-30.9-19.17L167.82 157c4.8 2.77 14.66 8.32 18.72 9.67 5.46 1.85 12.93 7.04 17.05 8.12",className:"cls-44"})),A||(A=B.createElement("path",{d:"m183 145-1.73-1.51c-5.34-4.62-12.12-10.42-12.12-10.42l8.66-12.65s-3.12-27.9-7.9-24.07c-.27.24-.54.5-.81.75-5.3 5.52-17.21 27.33-18.46 30.31s-.92 7.55.64 12.58l.17.56c1.72 5.26 37 24.37 37 24.37l3.16-4 3.72-4.75S188.42 149.71 183 145",className:"cls-41"})),B.createElement("g",{id:"FACE"},q||(q=B.createElement("path",{d:"M214.76 48.46c-13.44-14.81-24.68 15.48-24.68 15.48-3.19-2.42-6.5 2.86-3.74 5.84s5.29 1.7 5.29 1.7a23.4 23.4 0 0 0 4.51 5.23v14.36s3.06 11.73 10.58 11.23 5.53-10.49 5.53-10.49c-1.08-.45-2.2-8.24-2.67-11.83a12.4 12.4 0 0 0 2.92-1.34c6.17-3.85 2.26-30.18 2.26-30.18",className:"cls-38"})),B.createElement("path",{d:"M209.58 80a14 14 0 0 1-9.79-.94s3.11 3.7 10.21 3.74Z",style:{fill:"#d17a62"}}),P||(P=B.createElement("path",{d:"M190.08 63.94s1.88 4.68 2.48 4.68.61-5.51.61-5.51 7.16-.22 8.65-7.32 4.75-8.82 8.15-7c0 0 2.48-2.48 4.79-.33a10.42 10.42 0 0 0-9.28-6.1c-7.02-.29-18.85 13.54-15.4 21.58",className:"cls-40"}))),V||(V=B.createElement("path",{d:"m195.3 156.12 2.68 1.94s4.47-.05 5.68.42 4.52 2.39 5.76 2.63 2.23.54 1.72 1.38-5 .17-5 .17 3.81 3.1 4.38 3.47 5.7 2.19 6 2.7 0 1.41 0 1.78c0 0 .27 1.82-.54 2.16a3.87 3.87 0 0 1-2.06 0s-.3 1-.91.94-3.23-.7-3.23-.7.23 1.38-.88 1.21-6.57-1.92-7.42-2.19-4.88-3.81-5.49-4.49-7.07-3.23-7.07-3.23Z",className:"cls-38"})),F||(F=B.createElement("path",{d:"M276.59 170.93a2.65 2.65 0 0 0 2.1 2c1.81.35 5.26 1.25 6.42.94l2.21-.6a3.8 3.8 0 0 1-.43-1.1l-1-4.66-12.33.88s.06 1.73 3.03 2.54",className:"cls-44"})),R||(R=B.createElement("path",{d:"M284.62 161.63s-2.49 1.2-3.77 1.06-5.36-.92-6-.52-1.28 1.23-.5 2c0 0-1.72 0-1.72.6a2.76 2.76 0 0 0 1.55 2.33 1.18 1.18 0 0 0-.64 1.38c.17 1.08 3.24 1.38 3.24 1.38a1 1 0 0 0-.65 1c.11.81 1.32 1 2.13 1.18a54 54 0 0 0 5.93.54 6.44 6.44 0 0 0 3.37-2.23c.1-.43-.45-1.07-.42-1.56s.22-2-.22-2.26.17-1.74-.17-2.09-.38-2.51-.72-2.72-1.58-.85-1.58-.85Z",className:"cls-38"}))))))))}},17603:(e,a,t)=>{"use strict";t.d(a,{A:()=>Q});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y=t(30758);function X(){return X=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...Q}=e;return Y.createElement("svg",X({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},Q),a?Y.createElement("title",{id:t},a):null,l||(l=Y.createElement("defs",null,Y.createElement("linearGradient",{id:"linear-gradient",x1:231.74,x2:230.72,y1:383.25,y2:506.44,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#242259"}),Y.createElement("stop",{offset:1,stopColor:"#986dae"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-2",x1:193.04,x2:192.02,y1:382.93,y2:506.12}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:154.35,x2:153.33,y1:382.61,y2:505.8}),Y.createElement("linearGradient",{id:"linear-gradient-4",x1:132.36,x2:211.61,y1:401.63,y2:314.82,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#f79b5e"}),Y.createElement("stop",{offset:.29,stopColor:"#faad60"}),Y.createElement("stop",{offset:.71,stopColor:"#fec162"}),Y.createElement("stop",{offset:1,stopColor:"#ffc863"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-5",x1:174.74,x2:254,y1:440.69,y2:353.85}),Y.createElement("linearGradient",{id:"linear-gradient-6",x1:515.28,x2:319.04,y1:126.84,y2:269.63,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#fff4fb"}),Y.createElement("stop",{offset:1,stopColor:"#c6d6ee"})),Y.createElement("linearGradient",{id:"linear-gradient-7",x1:347.91,x2:276.31,y1:221.85,y2:300.59,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:.05,stopColor:"#fad05a"}),Y.createElement("stop",{offset:.33,stopColor:"#fac85a"}),Y.createElement("stop",{offset:.77,stopColor:"#f9b159"}),Y.createElement("stop",{offset:1,stopColor:"#f8a359"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-8",x1:366.39,x2:294.78,y1:238.66,y2:317.39}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-9",x1:83.68,x2:83.68,y1:494.43,y2:404.68}),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-10",x1:96.2,x2:96.2,y1:494.43,y2:404.68}),Y.createElement("linearGradient",{id:"linear-gradient-11",x1:103.69,x2:94.11,y1:451.62,y2:485,gradientUnits:"userSpaceOnUse"},Y.createElement("stop",{offset:0,stopColor:"#fdf4b6"}),Y.createElement("stop",{offset:1,stopColor:"#d07e2b"})),Y.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-12",x1:113.52,x2:103.95,y1:454.44,y2:487.82}),Y.createElement("style",null,".cls-1{fill:#fff}.cls-8{fill:#f69159}.cls-27,.cls-9{fill:#1f1a4e}.cls-11{fill:#cf7961}.cls-12{fill:#ffb84f}.cls-13{fill:#f79f81}.cls-14{fill:#403982}.cls-15{fill:#3960ac;opacity:.57}.cls-16{fill:#ade1f7}.cls-17{fill:#d1dbef;opacity:.25}.cls-18{fill:#3258a7}.cls-19{fill:#1e4380}.cls-20{fill:#d37444}.cls-22{fill:#e3e3e3}.cls-24{fill:#ffd788}.cls-25{fill:#f4825d}.cls-26{fill:#104ab2}.cls-27{opacity:.46}.cls-28{fill:#709480}.cls-29{fill:#b4c6b6}.cls-30{fill:#f1eadf}.cls-38{fill:none;stroke:#221f1f;stroke-linecap:round;stroke-miterlimit:10;stroke-width:.44px}.cls-39{fill:#f9fcff}"))),Y.createElement("g",{id:"Layer_2","data-name":"Layer 2"},Y.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=Y.createElement("path",{d:"M0 0h600v600H0z",className:"cls-1"})),Y.createElement("g",{id:"chair"},Y.createElement("path",{d:"M153.75 449.63h75.4v11.07h-75.4z",style:{fill:"#1f1950"}}),Y.createElement("path",{d:"M257.97 515.03h-9.39l-44.23-123.21h9.39z",style:{fill:"url(#linear-gradient)"}}),Y.createElement("path",{d:"M182.24 515.03h9.39l11.05-123.21h-9.39z",style:{fill:"url(#linear-gradient-2)"}}),Y.createElement("path",{d:"M126.95 515.03h9.39l44.23-123.21h-9.39z",style:{fill:"url(#linear-gradient-3)"}}),Y.createElement("path",{d:"M138.07 304.67h80.61a5.42 5.42 0 0 1 5.42 5.42v82.84h-84.71a3.55 3.55 0 0 1-3.55-3.55V306.9a2.23 2.23 0 0 1 2.23-2.23",style:{fill:"url(#linear-gradient-4)"}}),Y.createElement("path",{d:"M174.25 392.93h75.51a4.36 4.36 0 0 1 4.36 4.36v3a4.36 4.36 0 0 1-4.36 4.36h-75.51z",style:{fill:"url(#linear-gradient-5)"}}),c||(c=Y.createElement("path",{d:"M142.18 380.3v-70.66a5 5 0 0 0-5-5 5 5 0 0 0-5 5v71.59a23.45 23.45 0 0 0 23.45 23.45h17.23a5.87 5.87 0 0 0 5.88-5.87 5.88 5.88 0 0 0-5.88-5.88H154.8a12.62 12.62 0 0 1-12.62-12.63",className:"cls-8"}))),Y.createElement("g",{id:"customer"},s||(s=Y.createElement("path",{d:"M419.93 104.3a94.81 94.81 0 0 0-39.65 180.92 93.7 93.7 0 0 0 14.62 5.32l.53.15a94 94 0 0 0 10.41 2.16 96 96 0 0 0 14.09 1 94.8 94.8 0 0 0 0-189.59Z",className:"cls-9"})),Y.createElement("path",{d:"M513.82 196.89A94.8 94.8 0 1 0 379.37 283l.43-11.82-5.84-.65a2.55 2.55 0 0 1-1.68-4.16 4.47 4.47 0 0 0-.29-6l-.2-.19a6 6 0 0 1-1.53-5.92l10.74-36.9a27.07 27.07 0 0 1 21-19.08l29.19-5.44 6.27.4a21.78 21.78 0 0 1 20.39 20.62l2.4 47.16a12.49 12.49 0 0 1-6.67 11.69l-9.94 5.21-1.74 11a94.81 94.81 0 0 0 71.92-92.03",style:{fill:"url(#linear-gradient-6)"}}),n||(n=Y.createElement("g",{id:"body"},Y.createElement("path",{d:"m392.48 272.61-12.68-1.42-.43 11.81a94 94 0 0 0 14.63 5.34Z",className:"cls-11"}),Y.createElement("path",{d:"m460.26 261-2.4-47.16a21.78 21.78 0 0 0-20.39-20.62l-6.27-.4-29.2 5.46a27.07 27.07 0 0 0-21 19.08l-10.7 36.89a6 6 0 0 0 1.53 5.92l.2.19a4.47 4.47 0 0 1 .29 6 2.55 2.55 0 0 0 1.68 4.16l5.84.65 12.68 1.42-10.58-1.18 1.73-11.84 5-33.91c-.49 4.55 1.14 21.66 2.44 33.91.78 7.4 1.45 13 1.45 13l1.44 15.77.54.14a95 95 0 0 0 10.4 2.16c5.64-8.31 16.77-25.78 16-33.4-1-10.18 13.57-46.49 13.57-46.49s3.73 21.72 2.57 32.61-4.94 16.76-2.74 24.91a13.29 13.29 0 0 0 9.31 9.65l9.94-5.21a12.49 12.49 0 0 0 6.67-11.71",className:"cls-12"}),Y.createElement("path",{d:"m388.59 225.68-5 33.91-1.73 11.84 10.58 1.18s-.67-5.62-1.45-13c-1.26-12.27-2.89-29.38-2.4-33.93M434.34 268.27c-2.2-8.15 1.57-14 2.74-24.91s-2.57-32.61-2.57-32.61-14.59 36.31-13.57 46.49c.76 7.62-10.37 25.09-16 33.4a96 96 0 0 0 14.09 1 95 95 0 0 0 22.89-2.79l1.74-11a13.29 13.29 0 0 1-9.32-9.58",className:"cls-8"}))),i||(i=Y.createElement("g",{id:"head"},Y.createElement("g",{id:"face"},Y.createElement("path",{d:"M409.91 202.94c9.32 3 20.2-10.86 20.2-10.86l-6.27-24.7-21.36 2.47s3.23 31.74 7.43 33.09",className:"cls-13"}),Y.createElement("path",{d:"m405.46 190.68 10.6-13.22-14.3-7.16z",className:"cls-11"}),Y.createElement("path",{d:"M388.7 157.11c.57 11.74 3.05 26.17 11.9 26.75 11.73.77 25.88-12.89 26.92-24.61s5.36-31.18-10.53-32.59c-23.08-2.04-29.31 9.68-28.29 30.45",className:"cls-13"})),Y.createElement("g",{id:"hair"},Y.createElement("path",{d:"M423.91 149.15c2.71-3.65 13.57-4.49 11.28-9.84s-4-10.38-4-10.38-2-13.24-19.24-9c-26.64 6.57-25.64 8.25-22.61 23.49 0 0 14.36 1.85 25.95-4.93 0 0 .41 8.16 5.18 12.32l-.83 8.73 1.48.57s.07-7.31 2.79-10.96",className:"cls-14"}),Y.createElement("path",{d:"M431.2 128.93s1.7 5 4 10.38-8.57 6.19-11.28 9.84-2.77 11-2.77 11L431.2 164c14.55-17.38 20.09-21.14 0-35.07",className:"cls-9"})),Y.createElement("ellipse",{cx:427.52,cy:162.53,className:"cls-13",rx:8.78,ry:6.82,transform:"rotate(-69.29 427.482 162.541)"}))),m||(m=Y.createElement("g",{id:"cp"},Y.createElement("rect",{width:11.7,height:24.46,x:421.23,y:157.11,className:"cls-9",rx:1.31,transform:"rotate(17.31 427.137 169.37)"}),Y.createElement("rect",{width:12.12,height:24.46,x:422.96,y:157.71,className:"cls-14",rx:1.31,transform:"rotate(17.31 429.078 169.982)"}),Y.createElement("circle",{cx:429,cy:160.36,r:1.24,className:"cls-9"}))),d||(d=Y.createElement("g",{id:"arm"},Y.createElement("path",{d:"m453.82 257.92-15.45-61s-3.22-12.23-2.67-14 5.09-14.54 5-15.86-6.66-6.8-7.25-7.18-4.5.85-4.75 2.34 1.31 7.39 1.23 8.12c0 0-.64 7.13 0 9.7s7.34 88.12 14.38 90.25a8 8 0 0 0 4.32-.78 10 10 0 0 0 5.19-11.59",className:"cls-13"}),Y.createElement("path",{d:"M429.89 180c-.64-2.57 0-9.7 0-9.7-.09.74-3.13 6.26-2 9.35s.95 22.87.94 24.56c0 1.24 1.2 16.58 2.31 27.64v.42l.06.56.15 1.48c.32 3 .62 5.55.88 7.12a118.8 118.8 0 0 0 5.5 23.79 7.74 7.74 0 0 0 6.5 5c-7-2.1-13.71-87.64-14.34-90.22",className:"cls-11"}))),o||(o=Y.createElement("path",{d:"m461.09 146.69.35-.07c5.62 3.36 9.27 3.2 11.11.34l.06-.09c1.56-2.43.78-5.32-2.34-7.32-2.73-1.76-5.77-2-9.27-1.12l-1-5.55a15.69 15.69 0 0 1 13.54 1.9c6.06 3.89 8 9.92 4.53 15.34l-.06.09c-3.5 5.46-9 5.4-14.38 3.13l-2.63 3.19-3.51-2.26Zm-7.24 10.42 5.8 3.73-3.84 6-5.81-3.75Z",className:"cls-9"}))),h||(h=Y.createElement("path",{d:"M305.51 315.49c-1.75-.7-18.79 1.8-18.79 1.8L243.85 309l-15.95 2.73c16.07 14.91 44.49 11.52 54.25 9.81h.28c3.14 0 10.48 2.91 12.33 2.76s9 1.36 11 1.36 6.3-4.2 6.27-4.71-4.77-4.76-6.52-5.46",className:"cls-13"})),p||(p=Y.createElement("g",{id:"bubble_text","data-name":"bubble text"},Y.createElement("path",{d:"M242.77 211.7 254 200.61h71.15c4.74 0 8.58-4.74 8.58-10.58v-14.5c0-5.84-3.84-10.57-8.58-10.57h-73.8c-4.74 0-8.58 4.73-8.58 10.57Z",className:"cls-15"}),Y.createElement("path",{d:"M261.45 173.05h61.4v1.44h-61.4zM261.45 181.21h61.4v1.44h-61.4zM261.45 189.37h61.4v1.44h-61.4z",className:"cls-16"}),Y.createElement("path",{d:"m383.12 138.74-11.24-11.09h-71.16c-4.74 0-8.58-4.74-8.58-10.58v-14.5c0-5.84 3.84-10.58 8.58-10.58h73.81c4.74 0 8.59 4.74 8.59 10.58Z",className:"cls-15"}),Y.createElement("path",{d:"M303.03 100.09h61.4v1.44h-61.4zM303.03 108.25h61.4v1.44h-61.4zM303.03 116.4h61.4v1.44h-61.4z",className:"cls-16"}),Y.createElement("rect",{width:94.98,height:32.6,x:47.33,y:207.77,className:"cls-17",rx:6.39}),Y.createElement("path",{d:"M125.52 217H64.11a1.09 1.09 0 0 1 0-2.17h61.41a1.09 1.09 0 0 1 0 2.17M125.52 225.15H64.11a1.08 1.08 0 1 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16M125.52 233.31H64.11a1.08 1.08 0 1 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16",className:"cls-16"}),Y.createElement("rect",{width:94.98,height:32.6,x:438.4,y:310.64,className:"cls-17",rx:6.39}),Y.createElement("path",{d:"M516.59 319.87h-61.41a1.08 1.08 0 0 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16M516.59 328h-61.41a1.09 1.09 0 0 1 0-2.17h61.41a1.09 1.09 0 0 1 0 2.17M516.59 336.18h-61.41a1.08 1.08 0 0 1 0-2.16h61.41a1.08 1.08 0 1 1 0 2.16",className:"cls-16"}))),f||(f=Y.createElement("g",{id:"pants"},Y.createElement("g",{id:"pants-2","data-name":"pants"},Y.createElement("path",{d:"M257.13 347.72h-26.51L214.09 489.1l10.37.26c30.77-82.3 36.77-119.33 39.31-133.75a6.73 6.73 0 0 0-6.64-7.89",className:"cls-18"}),Y.createElement("path",{d:"M214.09 489.1s33.32-80.83 25.75-132c-.48-3.25-9.22-9.39-9.22-9.39Z",className:"cls-19"}),Y.createElement("path",{d:"M231.46 347.72 217.3 347l-4-18.09-52.89 4.85-6.55 20.48c-5.65 17.67-.66 24 18.62 25.3l21.23 3.51-39.85 106.62h11.26c38.1-58.56 67.15-110.85 74.36-130.44a8.55 8.55 0 0 0-8.02-11.51",className:"cls-18"}),Y.createElement("path",{d:"M200.28 371.35c-12.87 3.16-26.42-1.32-29.07-9.38-3-9.15 4.65-14.25 4.65-14.25l-5.64-15.15-9.83 1.19-6.55 20.48c-5.65 17.67.77 24.7 18.94 27.21l20.91 1.6L156.08 484c54.71-87.09 44.2-112.65 44.2-112.65",className:"cls-19"})),Y.createElement("g",{id:"feet"},Y.createElement("path",{d:"m214.09 489.08 10.37.26-1.82 6.38h-9.67zM165.12 489.65l-2.92 5.64h-10.53l2.19-5.64z",className:"cls-13"})))),E||(E=Y.createElement("g",{id:"shoes"},Y.createElement("path",{d:"M217.83 511.41a11.5 11.5 0 0 0 6.33 5c1.4.2 6 .26 6 .26s-.56-6.94 3-8.29c-1.71-1-3.35-1.49-4.12-2-1.94-1.42-6-12-6-12l-10-.21-4.25 10.06s7.77 4.67 9.04 7.18",className:"cls-14"}),Y.createElement("path",{d:"M216.93 513.26c2.3 3.6 5.09 4.84 10.47 5.24a76.5 76.5 0 0 0 11.16-.15c0-5.83-2.77-8.5-5.38-10-3.57 1.35-3 8.29-3 8.29s-4.61-.06-6-.26a11.5 11.5 0 0 1-6.33-5c-1.27-2.51-9-7.28-9-7.28l-.57 1.33s6.34 4.23 8.65 7.83",className:"cls-1"}),Y.createElement("path",{d:"M153.35 507.09c1.65 1.45 5.34 7.13 6.83 8.57s7.21 1.32 7.21 1.32a9.33 9.33 0 0 1 5-8.46c-1.64-.88-3.18-1.33-3.92-1.87-1.94-1.42-5.83-12.07-5.83-12.07l-10.73-.16-3.81 9.71a25.4 25.4 0 0 1 5.25 2.96",className:"cls-14"}),Y.createElement("path",{d:"M156.34 513.62c2.3 3.6 5.09 4.85 10.47 5.25a63 63 0 0 0 11.16-.36c0-6-2.91-8.56-5.58-10a9.33 9.33 0 0 0-5 8.46s-5.73.13-7.21-1.32-5.18-7.12-6.83-8.57a25.4 25.4 0 0 0-5.25-3l-.63 1.6s6.53 4.32 8.87 7.94",className:"cls-1"}))),g||(g=Y.createElement("path",{d:"M243.73 303.63c-1.38-2.34-3.7-9-5.88-15.71-1.69-5.73-3.52-11.77-5.3-17.26-3.08-9.53-6-17.39-7.57-19-4.55-4.53-14.66 30.28-14.66 30.28l10.23 17.33c2.8 5.43 5.51 10.65 5.92 11.21.88 1.21 3 5.5 14.65 9.35s25.7 3.23 25.7 3.23l1.94-9.27s-21.3-3.79-25.03-10.16",className:"cls-9"})),x||(x=Y.createElement("path",{d:"m222.76 250.11-13.35-5.39h-21.84l-18.36 5.46a10.55 10.55 0 0 0-7.21 12.53l7.51 42.44-8.7 29.53h54.07l-4.15-29.95.13-.41a11.6 11.6 0 0 1 5.84-6.83c5-2.45 7.89-5.78 8.3-9.34a18.4 18.4 0 0 0-.32-5.23 51.36 51.36 0 0 1 1.55-25.46 5.94 5.94 0 0 0-3.47-7.35",className:"cls-14"})),y||(y=Y.createElement("path",{d:"M217.89 299a13 13 0 0 0 6.53-8.76s-6.63 6-29.62 3.81c-26.52-2.47-10 17.13-19.44 40.66h39.47s-3.79-27.8-3.24-29.43 3.46-4.88 6.3-6.28M173.61 284.96l-5.6 11.97-1.91-8.32z",className:"cls-9"})),u||(u=Y.createElement("path",{d:"M162.52 307.93c-.68-.25-1.2-4.13 1-7.62 2.31-3.69 10.1-15.35 10.1-15.35s-6-33.7-9.4-31.54-21.72 45.75-24.6 55.83c-.37 5.89 1.92 10.75 14.16 13a249 249 0 0 0 27 2.8c10.65.64 19.51.83 20.06.84l1.47-12.89s-38.39-4.56-39.79-5.07",className:"cls-14"})),M||(M=Y.createElement("g",{id:"mouse_x_keyboard","data-name":"mouse x keyboard"},Y.createElement("path",{d:"M218.38 320.96h77.88v5.53h-77.88z",className:"cls-12"}),Y.createElement("path",{d:"M264.59 326.5h-17.07a8.54 8.54 0 1 1 17.07 0",className:"cls-20"}))),_||(_=Y.createElement("path",{id:"hand",d:"M260.25 315.61c-1.95-.84-19.08 1.68-19.08 1.68L202.31 313l-1.45 12.86c23.64 0 43.34-3 44.27-2.86h.33a9.7 9.7 0 0 0 1.78.07 11.5 11.5 0 0 0 2.73-.42l.23-.07c.67-.18 1.18-.35 1.42-.41.69-.16 2.63 1.14 4 2.29s4.92.63 6.32.31 4-3.45 3.89-4.26-3.63-4.05-5.58-4.9",className:"cls-13"})),Y.createElement("g",{id:"pc"},v||(v=Y.createElement("path",{d:"M336.35 302.35h-75.88a8.28 8.28 0 0 1-8.26-8.74l3-49.28a8.28 8.28 0 0 1 8.26-7.81h75.88a8.27 8.27 0 0 1 8.26 8.74l-3 49.28a8.28 8.28 0 0 1-8.26 7.81",className:"cls-20"})),Y.createElement("path",{d:"M341.1 302.35h-75.88a8.28 8.28 0 0 1-8.26-8.74l3-49.28a8.28 8.28 0 0 1 8.26-7.81h75.88a8.27 8.27 0 0 1 8.26 8.74l-3 49.28a8.28 8.28 0 0 1-8.26 7.81",style:{fill:"url(#linear-gradient-7)"}}),N||(N=Y.createElement("path",{d:"m324.36 319-9.61-35.27h1.6v-8.4a5.86 5.86 0 0 0-5.86-5.86h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4l9.92 36.33a1.88 1.88 0 0 1-1.81 2.37H276.1v4.15h42.46a6 6 0 0 0 5.8-7.58m-11.42-5.46a5.36 5.36 0 1 1 5.35-5.36 5.36 5.36 0 0 1-5.35 5.35Z",className:"cls-20"})),b||(b=Y.createElement("path",{d:"M314.38 269.46h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4h25.27v-8.4a5.86 5.86 0 0 0-5.86-5.86M329.83 318.66l-9.51-34.94H295l1.42 5.23 8.94 32.82a3.82 3.82 0 0 1-3.42 4.81h21.88a6.27 6.27 0 0 0 6.01-7.92m-14.95-5.13a5.36 5.36 0 1 1 5.36-5.36 5.36 5.36 0 0 1-5.36 5.36",className:"cls-22"})),Y.createElement("path",{d:"m329.83 318.66-9.51-34.94h-.08v-8.4a5.86 5.86 0 0 0-5.86-5.86h-13.56a5.85 5.85 0 0 0-5.85 5.86v8.4l1.42 5.23 8.94 32.82a3.82 3.82 0 0 1-3.42 4.81h21.88a6.27 6.27 0 0 0 6.04-7.92m-14.95-5.13a5.36 5.36 0 1 1 5.36-5.36 5.36 5.36 0 0 1-5.36 5.36",style:{fill:"url(#linear-gradient-8)"}}),k||(k=Y.createElement("path",{d:"M329.83 319a.35.35 0 0 1-.34-.26L320 284a.36.36 0 0 1-.14-.29v-8.4a5.51 5.51 0 0 0-5.5-5.5h-13.54a.36.36 0 0 1 0-.72h13.56a6.23 6.23 0 0 1 6.22 6.22v8.18a.3.3 0 0 1 .06.12l9.52 34.95a.36.36 0 0 1-.25.44Z",className:"cls-24"})),j||(j=Y.createElement("path",{d:"M323.78 326.94a.36.36 0 1 1 0-.72 5.91 5.91 0 0 0 5.71-7.46L320 283.81a.36.36 0 0 1 .25-.44.35.35 0 0 1 .44.25l9.52 34.95a6.63 6.63 0 0 1-6.4 8.37Z",className:"cls-24"})),Z||(Z=Y.createElement("path",{d:"M327.63 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M331.52 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M335.4 280.47a.6.6 0 0 1-.56-.63l1.64-29.13a.57.57 0 0 1 .62-.56.6.6 0 0 1 .57.62L336 279.91a.59.59 0 0 1-.6.56M339.28 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.64 29.14a.59.59 0 0 1-.62.56M343.16 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.59.59 0 0 1 .63-.56.59.59 0 0 1 .56.62l-1.63 29.14a.6.6 0 0 1-.63.56M267.06 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M270.94 280.47a.6.6 0 0 1-.56-.63l1.62-29.13a.57.57 0 0 1 .62-.56.6.6 0 0 1 .57.62l-1.64 29.14a.6.6 0 0 1-.61.56M274.82 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.64 29.14a.59.59 0 0 1-.62.56M278.7 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56M282.59 280.47a.59.59 0 0 1-.56-.63l1.63-29.13a.6.6 0 0 1 1.19.06l-1.63 29.14a.6.6 0 0 1-.63.56",className:"cls-25"}))),w||(w=Y.createElement("g",{id:"table"},Y.createElement("path",{d:"M104.19 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.35h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-16"}),Y.createElement("path",{d:"M96.45 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-26"}),Y.createElement("path",{d:"M96.45 343.58h54.25v9.99H96.45z",className:"cls-27"}),Y.createElement("path",{d:"M314.32 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.57a7.34 7.34 0 0 1-7.34-7.34z",className:"cls-16"}),Y.createElement("path",{d:"M306.59 337.59h54.25v174.06a7.34 7.34 0 0 1-7.34 7.34h-39.58a7.34 7.34 0 0 1-7.34-7.34V337.59z",className:"cls-26"}),Y.createElement("path",{d:"M306.59 343.58h54.25v9.99h-54.25z",className:"cls-27"}),Y.createElement("rect",{width:287.71,height:17.08,x:74.03,y:326.5,className:"cls-26",rx:4.65}),Y.createElement("rect",{width:204.55,height:17.08,x:198.67,y:326.5,className:"cls-16",rx:4.65}))),z||(z=Y.createElement("path",{d:"M227.23 196.18c-4.79-10.78-16.43-15.52-21-15.52a17.2 17.2 0 0 0-9.76 3.57l12.93 40.68 20 6.22c4.11-11.77 3.06-20.83-.55-31 7.85 15.17 2.21 31.52 2.13 31.72l.68.25c.01-.19 6.7-19.57-4.43-35.92",className:"cls-9"})),D||(D=Y.createElement("path",{d:"M206.05 259.34c-12.27 0-18.48-14.62-18.48-14.62l9.79-19.81H214Z",className:"cls-13"})),G||(G=Y.createElement("path",{d:"m209.93 242.47-9.04-11.28 13.07-6.28z",className:"cls-11"})),C||(C=Y.createElement("path",{d:"M224.7 214.31c-.24 10.33-3.56 21.8-10.22 22.52-10.28 1.1-25.67-11.34-26.58-21.64s-1.8-27.41 12.16-28.65c20.3-1.79 24.94 13.87 24.64 27.77",className:"cls-13"})),H||(H=Y.createElement("path",{d:"M222.53 199.29s2.31-12.93-12.89-14.93c-6.8-6-20.63-2.63-27.18 1.83a27.2 27.2 0 0 0-5.7 3.83c-12.23 10.67-13.35 30.2-13.36 30.4h.72c0-.19 1.12-19.42 13.12-29.89a27 27 0 0 1 2.35-1.83c-7.92 8.46-14.12 20.84-13.81 33.6 13 14.54 32.67 12 32.67 12-4.3-8.58-3.47-17.48-2.66-21.83 8.77-2.14 14.85-5.83 18.09-11a15.83 15.83 0 0 0 2.49-9.29c.81.23 3.14 1.28 6.16 7.11m-9.27 1.82c-2.49 4-6.75 7-12.69 9.18 6-2.66 12.18-7.47 15-16.17a15.14 15.14 0 0 1-2.31 6.99",className:"cls-14"})),S||(S=Y.createElement("path",{d:"M187.35 196.89h2.92v15.64h-2.92z",className:"cls-28"})),T||(T=Y.createElement("path",{d:"M185.4 196.89h2.92v15.64h-2.92z",className:"cls-29"})),U||(U=Y.createElement("path",{d:"M191.93 200.41v-7.57a9.8 9.8 0 0 1 4.69-8.13c1.44-.87 5.55-3.43 5.55-3.43s-7.12 0-10.28 1.22l-.84.32a8.67 8.67 0 0 0-5.55 8.08v9.51Z",className:"cls-28"})),O||(O=Y.createElement("path",{d:"M190 200.41v-7.57a8.65 8.65 0 0 1 4.68-7.69l7.5-3.87-2.3-.19a22.6 22.6 0 0 0-9.93 1.41l-.83.32a8.65 8.65 0 0 0-5.55 8.08v9.51Z",className:"cls-29"})),L||(L=Y.createElement("circle",{cx:188.16,cy:216.13,r:8.27,className:"cls-29"})),A||(A=Y.createElement("circle",{cx:186.53,cy:216.13,r:8.27,className:"cls-30"})),q||(q=Y.createElement("circle",{cx:186.53,cy:216.13,r:5.19,className:"cls-29"})),P||(P=Y.createElement("circle",{cx:186.53,cy:216.13,r:2.36,className:"cls-30"})),V||(V=Y.createElement("path",{d:"m215.94 232.68-19.68-2.26-10.27-13.89 1.08-.8 9.93 13.42 19.1 2.2z",className:"cls-30"})),F||(F=Y.createElement("rect",{width:6.56,height:3.63,x:210.68,y:229.73,className:"cls-29",rx:.64})),Y.createElement("g",{id:"plant"},Y.createElement("path",{d:"M86.35 409.87c-.55 2.61.26 5.72-.2 8.41-.57 3.37-2.71 4.34-4.16 6.46-1.71 2.52-2.5 7.23-1.87 11.25a60 60 0 0 0 1.88 6.86 16.06 16.06 0 0 1 .51 7.45c-.81 3.58-5.16 6.35-5.16 21.52 0 13.84 9.88 19.22 12.68 22.61v-89.75l-1.26 1.23a7.33 7.33 0 0 0-2.42 3.96",style:{fill:"url(#linear-gradient-9)"}}),Y.createElement("path",{d:"M97.89 442.85a58 58 0 0 0 1.87-6.85c.63-4-.15-8.73-1.87-11.25-1.45-2.12-3.58-3.09-4.16-6.46-.46-2.69.36-5.8-.2-8.41a7.32 7.32 0 0 0-2.4-4l-1.27-1.23v89.75c2.8-3.39 12.68-8.77 12.68-22.61 0-15.17-4.35-17.94-5.16-21.52a16.06 16.06 0 0 1 .51-7.42",style:{fill:"url(#linear-gradient-10)"}}),Y.createElement("path",{d:"M102.88 459.88c-.75 1-.41 2.47-1.09 3.5-.84 1.3-2.72 1.25-4.15 1.83a4.59 4.59 0 0 0-2.79 4.34 16.6 16.6 0 0 0 .8 3.29 3.76 3.76 0 0 1-.4 3.25c-1.06 1.34-5 1.57-6.63 8-1.52 5.84 6.07 10.24 8 12.27l9.85-37.84-1.18.25a3.92 3.92 0 0 0-2.41 1.11",style:{fill:"url(#linear-gradient-11)"}}),Y.createElement("path",{d:"M108.07 465c-.09-1.23.93-2.37.76-3.59a3.9 3.9 0 0 0-1.56-2.19l-.92-.79-9.85 37.86c2.69-.83 11.47-1 13-6.8 1.66-6.39-1.63-8.5-1.91-10.19a3.78 3.78 0 0 1 1.24-3 16 16 0 0 0 2.3-2.49 4.6 4.6 0 0 0-.31-5.14c-.98-1.24-2.64-2.11-2.75-3.67",style:{fill:"url(#linear-gradient-12)"}}),Y.createElement("path",{d:"M95.31 500.07c-3-4.42-21.63-7.91-21.63-7.91s6.16 6.61 6.16 11a19.6 19.6 0 0 1-1.06 5 10 10 0 0 0 9.53 13h.58c1.2-2.55 2.37-5.56 2.37-7.62 0-4.15 6.99-9.06 4.05-13.47",style:{fill:"#373175"}}),Y.createElement("path",{d:"M114.12 508.24a19.6 19.6 0 0 1-1.06-5c0-4.44 6.16-11 6.16-11H73.68s18.68 3.49 21.63 7.91-4 9.32-4 13.59c0 2.06-1.17 5.07-2.37 7.62h15.7a10 10 0 0 0 9.48-13.12",style:{fill:"#242259"}})),Y.createElement("g",{id:"plant-2","data-name":"plant"},Y.createElement("path",{d:"M501.26 424.64c.73 4-2 15.13 0 18.64s5.77 11.18 2.49 18-7.34 25.64 15 26.2 18.53-24.28 16-29.14-5.87-9.49-7-19.54-2.15-13.56-14.46-22.82-14.12-11.07-16.94-7.57 3.45 8.09 4.91 16.23",style:{fill:"#413a82"}}),R||(R=Y.createElement("path",{d:"M509.74 428.25s18.14 38.41 6.47 82M517 451.26l-10.2-10.92M519.09 463.48l6.35-10.49M520.12 478.59l-12.87-11.41",className:"cls-38"})),B||(B=Y.createElement("path",{d:"M404.88 482.31s10-3.5 11.19-11.09 3-18.66-1.85-17.69-14.59 12.74-9.34 28.78M395.65 491.45s3.3-10.5-2.34-14.88-24.31-2.82 2.34 14.88M401.87 499.42s20-1.65 22.66-10.6-18.48-1.45-22.66 10.6",className:"cls-39"})),W||(W=Y.createElement("path",{d:"M412.37 461.89a154 154 0 0 1-7.49 20.42c-4.37 9.33-8.27 26.74-8.27 26.74s-1.45-10.41 22-19.35",className:"cls-38"})),I||(I=Y.createElement("path",{d:"M390.11 481.53a40.86 40.86 0 0 1 8 21.22",className:"cls-38"}))))))}},78245:(e,a,t)=>{"use strict";t.d(a,{A:()=>Je});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee,ae,te,le,re,ce,se,ne,ie,me,de,oe,he,pe,fe,Ee,ge,xe,ye,ue,Me,_e,ve,Ne,be,ke,je,Ze,we,ze,De,Ge,Ce,He,Se,Te,Ue,Oe,Le,Ae,qe,Pe,Ve,Fe,Re,Be,We,Ie,Ye,Xe=t(30758);function Qe(){return Qe=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...Je}=e;return Xe.createElement("svg",Qe({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},Je),a?Xe.createElement("title",{id:t},a):null,l||(l=Xe.createElement("defs",null,Xe.createElement("linearGradient",{id:"linear-gradient",x1:462.92,x2:488.57,y1:229.21,y2:135.56,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#2272b9"}),Xe.createElement("stop",{offset:.41,stopColor:"#2851a5"}),Xe.createElement("stop",{offset:.77,stopColor:"#2c3a97"}),Xe.createElement("stop",{offset:1,stopColor:"#2d3292"})),Xe.createElement("linearGradient",{id:"linear-gradient-2",x1:481.52,x2:525.09,y1:133.62,y2:187.49,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#f79b5e"}),Xe.createElement("stop",{offset:.29,stopColor:"#faad60"}),Xe.createElement("stop",{offset:.71,stopColor:"#fec162"}),Xe.createElement("stop",{offset:1,stopColor:"#ffc863"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-3",x1:473.21,x2:516.78,y1:140.34,y2:194.21}),Xe.createElement("linearGradient",{id:"linear-gradient-4",x1:127.14,x2:89.91,y1:154.71,y2:283.04,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#1252c4"}),Xe.createElement("stop",{offset:1,stopColor:"#3f87fe"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-5",x1:500.28,x2:427.3,y1:145.4,y2:111.83}),Xe.createElement("linearGradient",{id:"linear-gradient-6",x1:362.04,x2:449.04,y1:126.58,y2:126.58,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:1,stopColor:"#2272b9"}),Xe.createElement("stop",{offset:1,stopColor:"#2851a5"}),Xe.createElement("stop",{offset:1,stopColor:"#2c3a97"}),Xe.createElement("stop",{offset:1,stopColor:"#2d3292"})),Xe.createElement("linearGradient",{id:"linear-gradient-7",x1:101.11,x2:214.99,y1:124.89,y2:124.89,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#f67447"}),Xe.createElement("stop",{offset:1,stopColor:"#f69159"})),Xe.createElement("linearGradient",{id:"linear-gradient-8",x1:524.73,x2:403.32,y1:143.99,y2:164.49,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:.05,stopColor:"#fad05a"}),Xe.createElement("stop",{offset:.33,stopColor:"#fac85a"}),Xe.createElement("stop",{offset:.77,stopColor:"#f9b159"}),Xe.createElement("stop",{offset:1,stopColor:"#f8a359"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-9",x1:362.04,x2:473.5,y1:249.06,y2:249.06}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-10",x1:210.97,x2:372.06,y1:186.7,y2:186.7}),Xe.createElement("linearGradient",{id:"linear-gradient-11",x1:213.32,x2:365.43,y1:214.07,y2:214.07,gradientTransform:"matrix(1 0 0 -1 0 602)",gradientUnits:"userSpaceOnUse"},Xe.createElement("stop",{offset:0,stopColor:"#3159a7"}),Xe.createElement("stop",{offset:1,stopColor:"#557ebe"})),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-12",x1:213.15,x2:368.92,y1:371.84,y2:371.84}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-13",x1:182.86,x2:450.49,y1:376.4,y2:305.43}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-14",x1:210.49,x2:371.58,y1:97.29,y2:97.29}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-15",x1:327.03,x2:383.92,y1:387.06,y2:387.06}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-16",x1:231.54,x2:160.32,y1:212.58,y2:244.07}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-17",x1:288.92,x2:393.41,y1:165.36,y2:111.78}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-18",x1:315.24,x2:372.74,y1:228.98,y2:228.98}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-19",x1:306.93,x2:391.42,y1:317.46,y2:296.99}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-20",x1:217.15,x2:297.13,y1:333.24,y2:273.93}),Xe.createElement("linearGradient",{xlinkHref:"#linear-gradient-7",id:"linear-gradient-21",x1:297.44,x2:215.19,y1:477.89,y2:454.95}),Xe.createElement("style",null,".cls-1{fill:#fff}.cls-2{fill:#cccbcb}.cls-4,.cls-7{fill:#231f20}.cls-7{fill-rule:evenodd}.cls-10{fill:#1251c3}.cls-13{fill:#c6583e}.cls-18{fill:#413b8a}.cls-21{fill:#ddd}.cls-27{fill:#d17e2c}.cls-28{fill:#232059}.cls-29{fill:#373075}.cls-31{fill:#094082}.cls-33{fill:#1e4380}.cls-39{fill:#1e194f}.cls-41{fill:#cf7961}.cls-42{fill:#f79f81}.cls-45{fill:#373175}.cls-48{fill:#fda181}.cls-49{fill:#d17a62}.cls-50{fill:none;stroke:#e6e7e8;stroke-linecap:round;stroke-miterlimit:10;stroke-width:.48px}.cls-51{fill:#403882}"))),Xe.createElement("g",{id:"Layer_2","data-name":"Layer 2"},Xe.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=Xe.createElement("path",{d:"M0 0h600v600H0z",className:"cls-1"})),c||(c=Xe.createElement("g",{id:"shadow"},Xe.createElement("path",{d:"M322 516.69s75.69-1.49 75.93 8.06-78.27 10.5-95.3 11.15-84.32-2.08-95.52 4-112.56 5.89-103.52-4 64.41-1.42 79.87-5.83S278.79 516 322 516.69M469 482.36s43.83 3.3 34.83 9.9-52.58 7.72-71 9.41-114.53-.56-127.85 0-247.17 4.24-225.49-6 40.72-11.13 85.89-12.2S469 482.36 469 482.36",className:"cls-2"}))),Xe.createElement("g",{id:"plant"},Xe.createElement("path",{d:"M472.45 480.58c1.28.57 47.56-58.63 32.08-62.51s-16.41-9.92-8.38-20.69-6.77-12.78-14-7.71 7.75-18.23.33-20.88-14 7-12.65 20.84-10-2.37-12.31 5.33 13.93 24.05 3.4 24.17-18 1.67-11.61 17.23 23.14 44.22 23.14 44.22",style:{fill:"url(#linear-gradient)"}}),s||(s=Xe.createElement("path",{d:"M491.47 427.08a.28.28 0 0 0-.38-.09 62.2 62.2 0 0 0-18.57 20.57c.05-10 .23-21 .65-31.23A67 67 0 0 1 486 398.9a.27.27 0 0 0 0-.39.29.29 0 0 0-.33 0A68.2 68.2 0 0 0 473.22 415c.62-14.18 1.72-26.57 3.62-32a.27.27 0 0 0-.16-.35.26.26 0 0 0-.34.16c-1.47 4.23-2.47 12.59-3.13 22.72a31 31 0 0 0-10.25-7 .28.28 0 0 0-.36.15.28.28 0 0 0 .14.36 30.1 30.1 0 0 1 10.41 7.29c-.2 3.15-.37 6.46-.51 9.87a.5.5 0 0 0 0 .18c-.28 6.83-.45 14-.55 21.05-1.63-2.42-7.27-10-15-12a.28.28 0 0 0-.32.23.3.3 0 0 0 .18.31c8.72 2.27 14.73 11.76 15.17 12.46-.05 3.47-.08 6.89-.1 10.18a.3.3 0 0 0 0 .14c-.08 17.49.2 31.53.21 31.87a.29.29 0 0 0 .28.27.28.28 0 0 0 .27-.28c0-.34-.29-14.39-.21-31.88a61.64 61.64 0 0 1 18.87-21.25.26.26 0 0 0 .13-.34.24.24 0 0 0-.1-.06",className:"cls-4"})),Xe.createElement("path",{d:"m468.88 484.69-.62-.62c-.07.49.16.68.62.62",style:{fill:"url(#linear-gradient-2)"}}),Xe.createElement("path",{d:"M531.7 388.47c-4.61-16.53-20-7.24-26.41 7-1.94 4.3-4.62 12.36-7.77 21.91-7.3 22.11-17.12 52.25-26.15 62.36-2 2.19-2.91 3.59-3.07 4.32l.62.62a11.5 11.5 0 0 0 3.63-1.64c11.2-6.66 26.92-23.74 39.43-42.16 13.31-19.57 23.02-40.68 19.72-52.41",style:{fill:"url(#linear-gradient-3)"}}),n||(n=Xe.createElement("path",{d:"M468.29 484.11c-.15.74.55.77 1.87.21 35-30.23 53-97.15 53-97.36a.69.69 0 1 0-1.33-.37c-.05.22-18.3 68.1-53.54 97.52",className:"cls-7"})),Xe.createElement("path",{d:"M549.61 438.69c-8.43-2.54-23.34 3.46-37.83 12.36-15.85 9.74-31.19 22.95-37 32.26-2.23 3.58-1.9 4.8 2.56 1 11.52-9.86 55.11-20.3 66.35-25.1a26.3 26.3 0 0 0 3.79-2c8.94-5.52 13.45-15.12 2.13-18.52",style:{fill:"#598ac7"}}),i||(i=Xe.createElement("path",{d:"M473.88 486.61c-.58.11-.59-.44-.13-1.46 24.18-26.8 76.73-39.74 76.89-39.79a.54.54 0 0 1 .66.4.53.53 0 0 1-.39.65c-.16.04-53.42 13.17-77.03 40.2",className:"cls-7"}))),Xe.createElement("g",{id:"tree"},Xe.createElement("path",{d:"M89 407.43C112 406 138.37 380 131.39 364s-8.57-26.67-1.51-37.51c6.41-9.83-17.52-51.5-8.44-67.46-3.39-3.21-8.08-5-12.42-3.53-5.49 1.87-8.22 7.93-10 13.48a129 129 0 0 0-4.28 18.72c-.93 6.05-1.58 12.55-5.49 17.25C85 310.1 77.72 311.86 73 316.58a17.82 17.82 0 0 0-5 15.34c.82 4.87 3.62 9.12 5.62 13.63s3.16 9.95.7 14.22c-2.16 3.77-6.53 5.63-9.56 8.75-3.86 4-5.3 9.91-4.61 15.42s3.31 10.61 6.62 15.07a52 52 0 0 0 5.74 6.5A46.4 46.4 0 0 0 89 407.43",style:{fill:"url(#linear-gradient-4)"}}),m||(m=Xe.createElement("path",{d:"M111.59 430.69c4.89-10.57 22.52-17.92 29.35-23.75 7.19-6.16 13.78-14.42 15.16-24.06 1.54-10.8-4.36-16.57-9.33-25.05-8.22-14.05 8.41-27.83 2.77-41.93-2.9-7.26-11.44-10.51-16-16.84-3.68-5.07-4.5-11.61-5-17.85s-.89-12.73-3.92-18.2a16.8 16.8 0 0 0-3.13-4c-9.08 16 14.85 57.63 8.44 67.46-7.06 10.84-5.47 21.47 1.51 37.51S112 406 89 407.42a46.4 46.4 0 0 1-16.44-1.92 52 52 0 0 0 11 8.05c9.69 5.33 21.76 7.99 28.03 17.14",className:"cls-10"})),d||(d=Xe.createElement("path",{d:"m134.9 370.19-.46-.43-22.54 24.56v-59.6l14.7-18.62-.49-.39-14.21 18.01V273.7h-.62v31.48l-10.01-14.56-.51.35 10.52 15.31v48.14l-26.57-26.8-.44.44 27.01 27.25v57.52L77.1 378.78l-.44.44 34.62 34.49v62.9h.62v-81.37z",className:"cls-4"}))),Xe.createElement("g",{id:"back_boxes","data-name":"back boxes"},Xe.createElement("rect",{width:40.41,height:33.11,x:444.03,y:456.62,rx:4.15,style:{fill:"url(#linear-gradient-5)"}}),Xe.createElement("rect",{width:87,height:37.04,x:362.04,y:456.9,rx:4.59,style:{fill:"url(#linear-gradient-6)"}}),o||(o=Xe.createElement("path",{d:"M215 446.92h-84.3a4.2 4.2 0 0 0-1.8.42l-24.82 12.23 110.92-1Z",className:"cls-13"})),Xe.createElement("rect",{width:113.88,height:37.04,x:101.11,y:458.59,rx:6.75,style:{fill:"url(#linear-gradient-7)"}}),Xe.createElement("rect",{width:113.94,height:33.87,x:362.04,y:423.22,rx:5.82,style:{fill:"url(#linear-gradient-8)"}}),Xe.createElement("path",{d:"M447.35 348.19h-85.31v9.17l111.46.33z",style:{fill:"url(#linear-gradient-9)"}}),Xe.createElement("rect",{width:113.94,height:34.99,x:362.04,y:357.36,rx:3.36,style:{fill:"#2e89ff"}}),h||(h=Xe.createElement("rect",{width:101.59,height:30.95,x:362.04,y:392.27,className:"cls-18",rx:2.32}))),Xe.createElement("g",{id:"front_boxes","data-name":"front boxes"},Xe.createElement("path",{d:"M351.22 146.3H225.65l-14.19 9.53 155.88.08-12.75-8.58a6 6 0 0 0-3.37-1.03",style:{fill:"#cb8b3c"}}),Xe.createElement("rect",{width:161.09,height:41.5,x:208.81,y:154.69,rx:5.87,style:{fill:"#ffb953"}}),p||(p=Xe.createElement("ellipse",{cx:364.37,cy:189.93,className:"cls-21",rx:1.29,ry:1.23})),f||(f=Xe.createElement("ellipse",{cx:363.94,cy:160.7,className:"cls-21",rx:1.29,ry:1.23})),E||(E=Xe.createElement("ellipse",{cx:215.44,cy:190.19,className:"cls-21",rx:1.29,ry:1.23})),g||(g=Xe.createElement("ellipse",{cx:215.01,cy:160.96,className:"cls-21",rx:1.29,ry:1.23})),Xe.createElement("rect",{width:161.09,height:44.7,x:210.97,y:392.95,rx:8.59,style:{fill:"url(#linear-gradient-10)"}}),Xe.createElement("path",{d:"M355.22 380.71H227.81l-14.49 14.43 152.11-2.19z",style:{fill:"url(#linear-gradient-11)"}}),x||(x=Xe.createElement("circle",{cx:217.04,cy:399.35,r:1.29,className:"cls-21"})),y||(y=Xe.createElement("circle",{cx:217.04,cy:431.37,r:1.29,className:"cls-21"})),u||(u=Xe.createElement("circle",{cx:365.43,cy:399.29,r:1.29,className:"cls-21"})),M||(M=Xe.createElement("circle",{cx:365.43,cy:431.31,r:1.29,className:"cls-21"})),Xe.createElement("path",{d:"M354.74 225.44H227.33l-14.18 9.43h155.77z",style:{fill:"url(#linear-gradient-12)"}}),Xe.createElement("rect",{width:161.09,height:40.9,x:210.49,y:233.84,rx:5.53,style:{fill:"url(#linear-gradient-13)"}}),_||(_=Xe.createElement("ellipse",{cx:217.05,cy:238.81,className:"cls-21",rx:1.29,ry:1.25})),v||(v=Xe.createElement("ellipse",{cx:217.05,cy:269.81,className:"cls-21",rx:1.29,ry:1.25})),N||(N=Xe.createElement("ellipse",{cx:365.45,cy:238.76,className:"cls-21",rx:1.29,ry:1.25})),b||(b=Xe.createElement("ellipse",{cx:365.45,cy:269.76,className:"cls-21",rx:1.29,ry:1.25})),Xe.createElement("rect",{width:161.09,height:44.7,x:210.49,y:482.36,rx:8.59,style:{fill:"url(#linear-gradient-14)"}}),k||(k=Xe.createElement("path",{d:"M354.74 470.12H227.33l-9.93 12.24h147.55z",className:"cls-27"})),j||(j=Xe.createElement("circle",{cx:216.56,cy:488.76,r:1.29,className:"cls-21"})),Z||(Z=Xe.createElement("circle",{cx:216.56,cy:520.78,r:1.29,className:"cls-21"})),w||(w=Xe.createElement("circle",{cx:364.95,cy:488.7,r:1.29,className:"cls-21"})),z||(z=Xe.createElement("circle",{cx:364.95,cy:520.72,r:1.29,className:"cls-21"})),D||(D=Xe.createElement("path",{d:"M354.74 303.63H227.33l-14.88 10.25h157.18z",className:"cls-28"})),G||(G=Xe.createElement("rect",{width:161.09,height:41,x:210.49,y:312.02,className:"cls-29",rx:6.37})),C||(C=Xe.createElement("ellipse",{cx:217.32,cy:317.14,className:"cls-21",rx:1.29,ry:1.25})),H||(H=Xe.createElement("ellipse",{cx:217.32,cy:348.14,className:"cls-21",rx:1.29,ry:1.25})),S||(S=Xe.createElement("ellipse",{cx:365.71,cy:317.08,className:"cls-21",rx:1.29,ry:1.25})),T||(T=Xe.createElement("ellipse",{cx:365.71,cy:348.08,className:"cls-21",rx:1.29,ry:1.25})),U||(U=Xe.createElement("path",{d:"m330.24 232.63-9.87-6.13a6.17 6.17 0 0 1-2.93-5.42v-25h17.77Z",className:"cls-27"})),Xe.createElement("rect",{width:56.89,height:37.8,x:327.03,y:196.04,rx:6.39,style:{fill:"url(#linear-gradient-15)"}}),O||(O=Xe.createElement("ellipse",{cx:379.78,cy:230.23,className:"cls-21",rx:1.29,ry:1.23})),L||(L=Xe.createElement("ellipse",{cx:379.35,cy:201,className:"cls-21",rx:1.29,ry:1.23})),A||(A=Xe.createElement("ellipse",{cx:334.07,cy:230.49,className:"cls-21",rx:1.29,ry:1.23})),q||(q=Xe.createElement("ellipse",{cx:333.64,cy:201.26,className:"cls-21",rx:1.29,ry:1.23})),P||(P=Xe.createElement("path",{d:"m217.38 392.1 12.15-6.65a5.24 5.24 0 0 0 2.75-4.63v-27.9h-18.56Z",className:"cls-31"})),Xe.createElement("rect",{width:50.48,height:40.19,x:169.2,y:352.92,rx:4.52,style:{fill:"url(#linear-gradient-16)"}}),V||(V=Xe.createElement("circle",{cx:214.71,cy:388.77,r:1.29,className:"cls-21"})),F||(F=Xe.createElement("circle",{cx:214.28,cy:358.11,r:1.29,className:"cls-21"})),R||(R=Xe.createElement("circle",{cx:174.33,cy:388.48,r:1.29,className:"cls-21"})),B||(B=Xe.createElement("circle",{cx:173.9,cy:357.82,r:1.29,className:"cls-21"})),W||(W=Xe.createElement("path",{d:"m296.6 480.85-11.15-9.31a4.77 4.77 0 0 1-2-3.88v-30h21.09Z",className:"cls-33"})),Xe.createElement("rect",{width:80.96,height:44.7,x:293.99,y:437.65,rx:7.13,style:{fill:"url(#linear-gradient-17)"}}),I||(I=Xe.createElement("circle",{cx:368.54,cy:475.06,r:1.29,className:"cls-21"})),Y||(Y=Xe.createElement("circle",{cx:368.11,cy:444.4,r:1.29,className:"cls-21"})),X||(X=Xe.createElement("circle",{cx:301.92,cy:475.34,r:1.29,className:"cls-21"})),Q||(Q=Xe.createElement("circle",{cx:301.49,cy:444.68,r:1.29,className:"cls-21"})),Xe.createElement("path",{d:"m264.71 480.85 13.29-9.68a3.46 3.46 0 0 0 1.44-2.83v-30.65h-18.77Z",style:{fill:"#201851"}}),J||(J=Xe.createElement("rect",{width:59.71,height:44.7,x:207.12,y:437.66,className:"cls-18",rx:5.77})),$||($=Xe.createElement("circle",{cx:260.04,cy:475.2,r:1.29,className:"cls-21"})),K||(K=Xe.createElement("circle",{cx:259.61,cy:444.54,r:1.29,className:"cls-21"})),ee||(ee=Xe.createElement("circle",{cx:214.34,cy:475.47,r:1.29,className:"cls-21"})),ae||(ae=Xe.createElement("circle",{cx:213.91,cy:444.81,r:1.29,className:"cls-21"})),te||(te=Xe.createElement("path",{d:"m316.72 391.69-10.58-5.84a6.77 6.77 0 0 1-3.5-5.93v-27h18.1Z",className:"cls-27"})),Xe.createElement("rect",{width:57.5,height:40.19,x:315.24,y:352.92,rx:3.47,style:{fill:"url(#linear-gradient-18)"}}),le||(le=Xe.createElement("circle",{cx:366.99,cy:388.21,r:1.29,className:"cls-21"})),re||(re=Xe.createElement("circle",{cx:366.56,cy:357.55,r:1.29,className:"cls-21"})),ce||(ce=Xe.createElement("circle",{cx:321.29,cy:388.48,r:1.29,className:"cls-21"})),se||(se=Xe.createElement("circle",{cx:320.86,cy:357.82,r:1.29,className:"cls-21"})),ne||(ne=Xe.createElement("path",{d:"m317.17 311.41-8.75-6.28a6.63 6.63 0 0 1-2.82-5.57v-25.08h17.86Z",className:"cls-13"})),Xe.createElement("rect",{width:56.34,height:37.8,x:315.24,y:274.48,rx:3.02,style:{fill:"url(#linear-gradient-19)"}}),ie||(ie=Xe.createElement("ellipse",{cx:367.04,cy:308.03,className:"cls-21",rx:1.29,ry:1.23})),me||(me=Xe.createElement("ellipse",{cx:366.61,cy:278.8,className:"cls-21",rx:1.29,ry:1.23})),de||(de=Xe.createElement("ellipse",{cx:321.34,cy:308.29,className:"cls-21",rx:1.29,ry:1.23})),oe||(oe=Xe.createElement("ellipse",{cx:320.91,cy:279.06,className:"cls-21",rx:1.29,ry:1.23})),he||(he=Xe.createElement("path",{d:"M288.88 310.58s8.2-7.95 8.2-11.23v-24.87h-16.2Z",className:"cls-27"})),Xe.createElement("rect",{width:79.71,height:37.8,x:210.49,y:274.48,rx:3.87,style:{fill:"url(#linear-gradient-20)"}}),pe||(pe=Xe.createElement("ellipse",{cx:284.49,cy:307.3,className:"cls-21",rx:1.29,ry:1.2})),fe||(fe=Xe.createElement("ellipse",{cx:284.06,cy:278.69,className:"cls-21",rx:1.29,ry:1.2})),Ee||(Ee=Xe.createElement("ellipse",{cx:216.03,cy:307.55,className:"cls-21",rx:1.29,ry:1.2})),ge||(ge=Xe.createElement("ellipse",{cx:215.6,cy:278.95,className:"cls-21",rx:1.29,ry:1.2})),xe||(xe=Xe.createElement("path",{d:"m287.78 232.5 10.44-6.28a4.81 4.81 0 0 0 2.32-4.2V196H283.7Z",className:"cls-39"})),ye||(ye=Xe.createElement("rect",{width:82.23,height:37.8,x:207.12,y:196.04,className:"cls-29",rx:4.53})),ue||(ue=Xe.createElement("ellipse",{cx:283.92,cy:229.42,className:"cls-21",rx:1.29,ry:1.23})),Me||(Me=Xe.createElement("ellipse",{cx:283.49,cy:200.2,className:"cls-21",rx:1.29,ry:1.23})),_e||(_e=Xe.createElement("ellipse",{cx:212.86,cy:229.69,className:"cls-21",rx:1.29,ry:1.23})),ve||(ve=Xe.createElement("ellipse",{cx:212.43,cy:200.46,className:"cls-21",rx:1.29,ry:1.23}))),Xe.createElement("g",{id:"man_1","data-name":"man 1"},Xe.createElement("path",{d:"M153.8 356.29a27 27 0 0 0 1.83 17.71c4.35 9.12 13.61 12.49 13.61 12.49s.7 9-2 12.07a24.2 24.2 0 0 1-4.63-5c-2.73-3.84-12-10.16-12.73-18.3s3.92-18.97 3.92-18.97",style:{fill:"#303030",opacity:.17,isolation:"isolate"}}),Ne||(Ne=Xe.createElement("path",{d:"M169.32 333.45s1 5.31.37 6.81c-.44 1.14-2.67 2.78-3.72 3.51 2.66 2.62 6.8 6.5 6.76 5.18-.06-1.93 3.32-8.06 3.32-8.06s-4.32-2.38-5.26-4.38-1.47-3.06-1.47-3.06",className:"cls-41"})),be||(be=Xe.createElement("path",{d:"M186.36 318.37s-8.25.19-11.82.75-5.62 7.26-5.62 7.26-1.38-2.94-3.69-.19 2.44 5.08 2.44 5.08c.56 3-3.88 10.31-3.88 10.31s.92.95 2.18 2.19c1-.73 3.28-2.37 3.72-3.51.59-1.5-.37-6.81-.37-6.81s.53 1.06 1.47 3.06 5.35 4.61 5.35 4.61 3.34 1.71 6.1 1.36 3.36-1.78 3.36-1.78c3.68-5.51.76-22.33.76-22.33",className:"cls-42"})),ke||(ke=Xe.createElement("path",{d:"M174.54 319.12c3.57-.56 11.82-.75 11.82-.75-21.59-5.75-17.44 8-17.44 8s2.08-6.68 5.62-7.25",className:"cls-41"})),Xe.createElement("path",{d:"M164 319.45c1.6-1.17 1.92-1 4-.61s3.84-1.92 5.39-.47 5.4 3.19 8.4 2.68 4.22 1 6.3-1.87a5.5 5.5 0 0 0 0-.81s4.25-2.31 1.75-6.09a1.81 1.81 0 0 1-1.75 0c-1.12-.47-3.81-4.79-10.32-4.1s-9.94 3.57-9.94 3.57-3.19-1.13-4 1.56c-.52 1.72-2.8 2.77-4 4a4.2 4.2 0 0 0 .59 1.52c.99 1.47 1.98 1.8 3.58.62",style:{fill:"#403982"}}),Xe.createElement("path",{d:"M159.1 319.75c1.25 2.69.37 6.57 2.31 7.38s.67 7.31 5.56 8a9.15 9.15 0 0 0 .77-4.16s-3.54-1.36-3-3.61 3-3 4.2-1l.28 1.5s3-2.79 2.34-4.8a2.76 2.76 0 0 1 1.19-3.1s2.69 3.37 6 1.69c0 0 9 2.69 9.34-2.49-2.08 2.87-3.3 1.35-6.3 1.87s-6.85-1.22-8.4-2.68-3.33.9-5.39.47-2.39-.56-4 .61-2.58.85-3.66-.61a4.2 4.2 0 0 1-.59-1.52 2 2 0 0 0-.65 2.45",style:{fill:"#1f1a4e"}}),je||(je=Xe.createElement("path",{d:"M218.49 383.29c1.32-1.18 2.35-.66 3.14-3.15a22 22 0 0 1 1.17-2.92c-.53-.19-2.72 1.35-3.12 1.41a33 33 0 0 1-3.24-.41c1.07-.44 1.91-2.44 2.22-3s-.59-2.41-.87-2.2-2.38 2.61-3.19 3.33-6 .28-6 .28c-.8 0-1 1.85-1.09 3.51a31 31 0 0 0 4.74 1.74c2.35.56 4.93 2.58 6.24 1.41",className:"cls-42"})),Ze||(Ze=Xe.createElement("path",{d:"M207.56 382.82s3.26 1.22 4.82 1.75a50.5 50.5 0 0 0 7.3 1.38c.43-.07 3-3.19 3.58-4.29s-.06-3.91-.37-4.38a.15.15 0 0 0-.09-.06 22 22 0 0 0-1.17 2.92c-.79 2.49-1.82 2-3.14 3.15s-3.89-.85-6.24-1.41a31 31 0 0 1-4.74-1.74c-.04 1.4.05 2.68.05 2.68",className:"cls-41"})),we||(we=Xe.createElement("path",{d:"M132.66 514.05s-2.3 8.21-3.14 8.49 8.91 3.71 8.91 3.71 2.21-7.8 3-9.76-8.77-2.44-8.77-2.44M169.24 525.52l-.46-10.39-6.15 1.56c1.54.65 2.69 1.24 2.69 1.24l-1.14 8.67c1.82.14 3.95-.08 5.06-1.08",className:"cls-42"})),ze||(ze=Xe.createElement("path",{d:"m162.63 516.69-2.77.72s.82 7.57.61 8.21c-.11.33 1.66.85 3.71 1l1.14-8.67s-1.15-.59-2.69-1.26",className:"cls-41"})),De||(De=Xe.createElement("path",{d:"M160.4 531.77s-2.27 2.11-2.47 3.58-.83 3.37 1 4.42 6.81 1.9 8.87.85 1.86-3.37 3.1-2.11.41 2.74 2.48 2.74 14.65 1.47 17.33-.63 1.49-5.71.66-6.55-14.9-1.24-14.9-1.24l-8.25-2.74Z",className:"cls-1"})),Ge||(Ge=Xe.createElement("path",{d:"M190.08 532.89c-1.69 0-5.9.63-10.11-2.11s-7.48-7.23-10.85-7.87l-4.53.6s-.89.8 0 4-3.3 5.19 2.14 5.38 6 1.83 7.5 3c1 .73 5.82 2 9.24 2.83 2.13.08 4.13.1 5.55 0 4.42-.15 2.74-5.83 1.06-5.83",className:"cls-45"})),Ce||(Ce=Xe.createElement("path",{d:"M166.73 532.94c-5.44-.19-1.25-2.13-2.14-5.38s0-4 0-4l-4.12.54a27.1 27.1 0 0 0-1.76 7.15 52 52 0 0 0 0 6.11s6.74 1.68 8.84.63 1.69-2.32 2.74-2.32.21 1.9 2.32 2.32a104 104 0 0 0 10.86.81c-3.42-.83-8.28-2.1-9.24-2.83-1.5-1.2-2.06-2.85-7.5-3.03",className:"cls-39"})),He||(He=Xe.createElement("path",{d:"M125.6 524.77s-2.32 2.73-3.58 4.42 3.79 5 5.68 5.47a10.6 10.6 0 0 0 3.37.21 3.71 3.71 0 0 0 1.69 3c1.68 1 16.49 5.89 19.22 5.26s1.68-4.61 1.68-4.61l-9.78-5.33-7.16-5.69Z",className:"cls-1"})),Se||(Se=Xe.createElement("path",{d:"M143.88 533.19c-2.12-2.16-5-3.76-8.41-5.44-1.79-.89-1.46-3-.74-4.7a11.8 11.8 0 0 1-3.73-3.85s-4.77 1.41-5.61 3.93-2.53 4.21-1.41 5.9a6.62 6.62 0 0 0 5.06 3.08c2 0 2.8-3.36 4.2-.84s-.56 3.37 1.69 4.77 9 4.21 12.91 4.49 5.05.85 5.61 0a1.6 1.6 0 0 0 .23-.64c-.96-1.59-7.8-4.65-9.8-6.7",className:"cls-45"})),Te||(Te=Xe.createElement("path",{d:"M152.12 536.6c-1.69-.56-7.3-4.21-9-8.13a25.4 25.4 0 0 0-3.65-6.18 3.46 3.46 0 0 1-3.93 1.12 4.4 4.4 0 0 1-.8-.36c-.72 1.75-1 3.81.74 4.7 3.4 1.68 6.29 3.28 8.41 5.44s8.81 5.11 9.84 6.7c.15-1.09-.25-2.83-1.61-3.29",className:"cls-39"})),Xe.createElement("path",{d:"M172.88 451c0-7.86-7.86-43.5-9.83-48s-29.46-6.18-29.46-6.18a46.6 46.6 0 0 0-4.49 23.3c1.12 12.63 17.67 41.2 18.23 42.88s-3.19 8.82-3.75 11.07-12.24 40.34-11.4 41.75a13.85 13.85 0 0 0 8.42 3.36s14.33-26.17 15.74-31c0 0 9.88-20.23 9.1-26.6s-5.66-39.53-6.66-42.53a82 82 0 0 1-2-8.63s9.51 25 10.51 28.52 3.89 35.89 2 41.77-4 22-3.2 25.52c.64 3-.71 11.75-1.13 14.34a9.25 9.25 0 0 0 4.33-1.47s1.12-28.31 2.8-42.62.79-17.61.79-25.48",style:{fill:"#3258a7"}}),Ue||(Ue=Xe.createElement("path",{d:"M166 506.3c-.75-3.51 1.25-19.64 3.2-25.52s-1-38.27-2-41.77-10.46-28.52-10.46-28.52a82 82 0 0 0 2 8.63c1 3 5.87 36.15 6.66 42.53s-9.1 26.6-9.1 26.6l3.35 31.8a13.4 13.4 0 0 0 5.19.64c.49-2.64 1.84-11.42 1.16-14.39",className:"cls-33"})),Xe.createElement("path",{d:"M209.25 376.16s-16.32-3.6-21.57-5.76a91 91 0 0 0-12.89-3.71c-2.39-1.17 1.65-15.37 1.72-16.94s-5.06-4.79-5.06-4.79l-.44-.59c-4.85-4.08-8.25-3.16-12.11-3s-9.24 6.36-11.65 10.69-18.8 47-19.92 52.59c-.51 2.57.4 3.78 4.21 5.52 1.4-2.49 3.26-5.16 5.3-6.39 4.31-2.63 15.75-13.89 9.94-20.23s7.6-31.49 7.6-31.49.84 4.35.37 6.41 3.38 12.85 5.44 15.29 8.82 5.16 8.82 5.16l4.47 1.69c4.48 1.69 34.46 2.94 34.46 2.94 1.59-.75 1.31-7.39 1.31-7.39",style:{fill:"#ffc861"}}),Oe||(Oe=Xe.createElement("path",{d:"M160.19 373.69c-2.06-2.44-5.91-13.23-5.44-15.29s-.37-6.41-.37-6.41-13.42 25.15-7.6 31.49-5.63 17.6-9.94 20.23c-2 1.23-3.9 3.9-5.3 6.39a55 55 0 0 0 14.61 3.9c7.32.85 19.37-2.38 22-3.16s2.06-19.7.84-22.36 0-9.63 0-9.63-6.73-2.69-8.8-5.16",className:"cls-27"}))),Le||(Le=Xe.createElement("g",{id:"man_2","data-name":"man 2"},Xe.createElement("path",{d:"M398.88 334.92c1.14-1.37 3.06-1.27 4.66-.84l.63 7.83a47 47 0 0 1-5-.6ZM434.17 334.89l.57 8.5a17.7 17.7 0 0 1-3.14-.41l-.81-5.61c.09-1.92 1.66-2.46 3.38-2.48",className:"cls-48"}),Xe.createElement("path",{d:"m406.31 335.21-.5 6.46c-.17.21-.83.27-1.67.24l-.63-7.83a13 13 0 0 1 2.8 1.13M438.48 335.59v6.92a5.8 5.8 0 0 1-3.74.88l-.57-8.5a15.7 15.7 0 0 1 4.31.7",className:"cls-49"}),Xe.createElement("path",{d:"M431.52 342.41a10.3 10.3 0 0 0 3.17.28s.62 2.92 2.24 3.84 4.09 4 3.85 7.07a11 11 0 0 1-6 1.3c-4.73-.12-5-1.09-5-1.09-.42-3.12 1.74-11.4 1.74-11.4",className:"cls-29"}),Xe.createElement("path",{d:"M436.93 346.53c-1.62-.92-2.23-3.83-2.24-3.84 1.87 0 3.79-.18 3.79-.18a26.7 26.7 0 0 1 3.37 9.87c0 .29-.34.76-1.07 1.22.22-3.04-2.35-6.2-3.85-7.07",className:"cls-28"}),Xe.createElement("path",{d:"M438.27 347.69s-4.2-1.05-5.5.12M438.48 348.82s-3.92-.59-5.45.77M433 350.75s4.07-1.47 5.45-.38",className:"cls-50"}),Xe.createElement("path",{d:"M404.14 346.75c-1.24 1.52-2.86 3.81-5.29 5s-12.16 2.55-12.16 2.55c-.28-.15 0-1.74 0-1.74.19-2.91 7.86-5.15 9.34-6.1s3.13-5.11 3.13-5.11a24 24 0 0 0 5 .29s1.22 3.58-.02 5.11",className:"cls-29"}),Xe.createElement("path",{d:"M406.81 345c.81 1.81.52 5.72 0 7.44s-6.87 1.53-9.06 1.79a102 102 0 0 1-11.06 0s9.72-1.41 12.16-2.55 4-3.44 5.29-5 0-5.15 0-5.15a5.8 5.8 0 0 0 1.71-.29 13.6 13.6 0 0 0 .96 3.76",className:"cls-28"}),Xe.createElement("path",{d:"M399.51 347.78a4.62 4.62 0 0 0-3.14-1.63M397.94 348.82s-.67-1.31-3.55-1.63M395.63 349.59s-.1-1.14-3.17-1.58",className:"cls-50"}),Xe.createElement("path",{d:"M433.59 215.17c2.23 7 1.4 42.43.29 50.9s3.36 22.66 4.6 29.76 0 39.76 0 39.76c-.54 1.51-2.42 2-4.19 2s-1.4-29.35-.7-45.23-5.56-8.87-5.13-18.31-3.72-33.18-6.3-40.19-15.45-5.29-20.74-6.26-9.66-8.5-9.66-8.5 16.34-7.13 25.36-10.93 14.24.02 16.47 7",className:"cls-31"}),Xe.createElement("path",{d:"M401.42 227.63c5.29 1 18.17-.75 20.74 6.26s6.72 30.75 6.3 40.19 5.83 2.43 5.13 18.31.7 45.23.7 45.23a18 18 0 0 1-3.5-.25s-8.13-42.44-9.25-46.74-7.66-38.48-7.66-38.48.48-8.58-1.71-10.78-5-8.58-5-8.58-4.48 24.91-2 32.24-1.71 21.05-2.67 26.3c-.9 5 .87 41.07 1 44.62a23 23 0 0 1-4.75-1s-3.15-56.52-4.68-63-2.41-52.78-2.41-52.78 4.47 7.52 9.76 8.46",className:"cls-10"}),Xe.createElement("path",{d:"M402.56 291.33c1-5.25 5.15-19 2.67-26.3s2-32.24 2-32.24 2.76 6.39 5 8.58 1.65 10.78 1.65 10.78-2.85 21.06-3.87 27 .13 11 1.2 15.4-5 40.81-5 40.81a3.57 3.57 0 0 1-2.68.55c-.1-3.51-1.87-39.58-.97-44.58",className:"cls-31"}),Xe.createElement("path",{d:"m430.68 187.91-3.61-19.77s-3.14 20.5-4.1 24-6.1 10-7 11-31.24 18.47-31.24 18.47l5.94-3.38-.14 2.22s12.94 4.58 17.66 4.22S427.8 220 427.8 220s1-7.49 1-7.13 2.05 6.22 2.05 6.22 3-.65 3.89-1.64c-.06-.01-2.74-19.25-4.06-29.54",className:"cls-39"}),Xe.createElement("path",{d:"M411.88 190.9c.93-1.79 1.5-17 1.5-17s-7.86 6.08-8.86 12.37-12.74 21.53-12.74 21.53 19.15-15.11 20.1-16.9M385.52 165s-1.36 20.09-1.27 25c0 1.29-1.55 3.49-3.9 6l-.52.71a9.12 9.12 0 0 1 4 5.25l2.9-3.71a3.2 3.2 0 0 0 .43-.74l3-8.22s-4.65-21-4.64-24.29",className:"cls-39"}),Xe.createElement("path",{d:"M430.12 182.92c-.57-6.49-2.95-27.23-6.39-29.87s-16.84-5-16.84-5l-12.34 2.43s-9.78 3.73-10.22 6.1-5.16 33.67-5.87 35.1c-.19.38-1.51 2.08-3.34 4.35h.45a12.1 12.1 0 0 1 4.26.71l1-1.27c2.06-2.31 3.42-4.29 3.39-5.48-.09-4.94 1.27-25 1.27-25 0 3.32 4.6 24.36 4.6 24.36a97 97 0 0 1 2.36 12.74c.29 4.48-.72 5.71-.72 5.71s11.73-15.23 12.74-21.53 8.86-12.37 8.86-12.37-.57 15.23-1.5 17-20.1 16.88-20.1 16.88l-10.06 8.66s.91 5.39 3 5.16c0 0 30.28-17.51 31.24-18.47s6.1-7.44 7-11 4.1-24 4.1-24l3.61 19.77c-.2-2.12-.4-3.9-.5-4.98",className:"cls-51"}),Xe.createElement("path",{d:"M398.7 132.14s-.09-2.67 1.34-2.77c4.95-.33 1.71 5.67 1.71 5.67s2.31 11 5.14 13c0 0-1.46 4.83-5 6.88 0 0-4.57-2-4.57-4.27s2.07-7.58 2.07-7.58c-1.21 2.11-5.9 3.86-5.9 3.86a5.26 5.26 0 0 1-3.14.21c-3.72-1.21-8.39-18.41-8.39-18.41 14.04-8.73 16.74 3.41 16.74 3.41",className:"cls-48"}),Xe.createElement("path",{d:"M397.63 155.79c-3.43-.43-3.08-5.3-3.08-5.3l-1.07-3.49s4.69-1.75 5.9-3.86c0 0-2.07 5.29-2.07 7.58s4.56 4.27 4.57 4.27a6.7 6.7 0 0 1-4.25.8M393.48 147",className:"cls-49"}),Xe.createElement("path",{d:"M380.11 118.93c2.95-.62 12-5.93 14.67-6.14a12.5 12.5 0 0 1 2.21.07c2.48 1.3 5.21 3.36 4.22 5.88-1.72 4.36-3.73 6.36-3.76 7.86s1.59 6.68 1.59 6.68l-1.36-.59-.93-2.24-4.68-4.06s-5.07 3.61-10.15 2.34-6.48-6.48-6.48-6.48a8.15 8.15 0 0 1 4.67-3.32",className:"cls-51"}),Xe.createElement("path",{d:"M401.21 118.74c1-2.52-1.74-4.58-4.22-5.88 3.35.39 8.33 2.07 9 7 .86 6.2-1.77 18.31-1.86 19.36s-.42 3-.42 3-2.16-5.48-2-7.15c0 0 2.19-3.78-.57-5.1s-2.48 2.2-2.48 2.2l.34 1.14s-1.63-5.17-1.59-6.68 2.08-3.53 3.8-7.89",className:"cls-39"}),Xe.createElement("path",{d:"M382.29 222.27c-1.83 1.14-4.08 2.25-4.51 3.29s-6.66 3.82-11.41 3.36a8.2 8.2 0 0 1 .4-2.6c0-.44 2-.84 3.64-1.64a24 24 0 0 0 4.4-3.63c.22-.22-2.2-.07-2.92-.54s-1.9-1.43-1.33-2.11 4.08 0 7.15-.19 4-1.77 4-1.77c1.87-.14 2.69 2.83 3 4.29Z",className:"cls-48"}),Xe.createElement("path",{d:"M381.36 225.06c-.68 1.4-6 5-7.34 5.6s-6.29.15-7.25-.88a1.7 1.7 0 0 1-.4-.86c4.75.46 11-2.33 11.41-3.36s2.68-2.15 4.51-3.29 2.39-1.58 2.39-1.58c.1.48.14.79.14.79s-2.82 2.21-3.46 3.58",className:"cls-49"}))),Xe.createElement("g",{id:"lady"},Ae||(Ae=Xe.createElement("path",{d:"M235.57 89.22c2.58-1.36 5.48-6.58 6.08-8.56a47 47 0 0 1 2.28-5.37s11.12-4.6 12.57-6.25a53 53 0 0 0 4.16-6.66 8.35 8.35 0 0 1 4.22 4.71c1.48 3.67.23 10.73 2.54 11.13s8.19 3.86 8.19 3.86c1.58-3.76-4.06-5-6.54-5.84s1.68-8.22 3.66-12.38-4.55-6-4.55-6c1.88-3.47-4.06-4-10.6-6s-17.19 1.37-16.7 6.26-1.66 6.3-3.64 9 0 7.86 0 7.86c-1 3.27.45 6.14-4 8.42s-1.13 11.48-1.13 11.48.89-4.3 3.46-5.66",className:"cls-51"})),qe||(qe=Xe.createElement("path",{d:"M264.09 98c9.41-.39 12.28-3.07 15-8.06s-3.53-7.88-3.53-7.88-5.88-3.46-8.19-3.86-1-7.46-2.49-11.13a8.4 8.4 0 0 0-4.19-4.71 53 53 0 0 1-4.16 6.64c-1.45 1.69-12.53 6.29-12.53 6.29a48 48 0 0 0-2.31 5.4c-.6 2-3.5 7.2-6.08 8.56s-3.46 5.63-3.46 5.63 22.53 3.54 31.94 3.12",className:"cls-39"})),Xe.createElement("path",{d:"m283.5 153.69 10.95-6.85a3.81 3.81 0 0 0 1.79-3.24v-26.7h-16.86Z",style:{fill:"#bf4728"}}),Xe.createElement("rect",{width:59.71,height:37.8,x:225.65,y:116.9,rx:8.5,style:{fill:"url(#linear-gradient-21)"}}),Pe||(Pe=Xe.createElement("path",{d:"M299.24 112.38C297 104.06 275.58 89.51 274 89.22s-18-1.77-18-1.77c-10.11.91-16.75 2.11-22.66 6.12s-14.75 15.94-17.13 26.54a26.46 26.46 0 0 0 2.28 18.26c-.13-1.16 3.86-5.29 3.86-5.29-4.26-8 2-16 6.74-19.71s9.8-15.32 9.8-15.32c1.19 1.32-1.07 12.64-1.07 12.64l.2 6.21h12.26s2.73-9.24 11.07-9.24 12.3-12 12.3-12 .28 5.41 2.25 7 14.38 9.51 16.63 14l-19.43 21.73 5.22 5s23.2-22.7 20.92-31.01",className:"cls-10"})),Ve||(Ve=Xe.createElement("path",{d:"M275.88 102.69c-2-1.58-2.25-7-2.25-7s-4 12-12.3 12-11.07 9.24-11.07 9.24h24.29l.59-6.8 10.25 6.34c-2.5 1.88-12.31 21.93-12.31 21.93l19.4-21.71c-2.25-4.54-14.66-12.46-16.6-14M238.88 98.05s-5 11.66-9.8 15.32-11 11.69-6.74 19.71c-1.38-2.87 3.27-12 4.68-13.07s10.75-9.32 10.75-9.32 2.23-11.32 1.11-12.64",className:"cls-31"})),Fe||(Fe=Xe.createElement("g",{id:"head"},Xe.createElement("path",{d:"m248.39 85.17.11 4.65s4.11 5.61 13.14-.82l-.82-6.42Z",className:"cls-48"}),Xe.createElement("path",{d:"m248.39 84.8 12.43-2.22.48 3.73s-5.08 3.1-8.71 2.9-4.14-1.63-4.14-1.63Z",className:"cls-49"}),Xe.createElement("path",{d:"M244.62 66.47s-1.74 10.22.37 15.31 7.47 6.51 9.06 6.23 6.74-1.94 8.32-5.9 2.84-13 2.38-16.83-18.48-10.76-20.13 1.19",className:"cls-48"}),Xe.createElement("path",{d:"M260.62 62.38s-.6 4.62 1.23 5.8 2 8.22 2 8.22 4.51-7 2.54-12.11-5.72-8.71-5.77-1.91",className:"cls-51"}),Xe.createElement("path",{d:"M261.3 63.1a8.55 8.55 0 0 1-8.23 2.25c-5.29-1.19-6.87 11.47-10.7 10.19s.2-17 6.87-18.25 14.64-.6 12.06 5.81",className:"cls-51"}))),Re||(Re=Xe.createElement("path",{d:"M273.05 138.37a30 30 0 0 1-3.51 2.38c-.65.2-5.35 1.19-5.85 1.19s-.64 1.58.7 1.68a29 29 0 0 0 3.22 0s-4.16 3.91-5 4.11.1 2.46.6 2.76 4.41 2 7.62 0 5.08-3.21 7.45-7.17-5.23-4.95-5.23-4.95M222.3 133.08a10.9 10.9 0 0 0 3.77-.3c1.08-.49 2.12-.79 2.42-.45s-1.51 2-2.18 2.28a2.6 2.6 0 0 0-.9.6s.06 1.43 1.15 1.78a39 39 0 0 1 5.15 2.13c-.05.15-.25 3.17-1 3.66a16.6 16.6 0 0 1-7 .79 8.53 8.53 0 0 1-5.55-6.23c-.81-3.72 2.16-5.25 4.14-4.26",className:"cls-48"})),Be||(Be=Xe.createElement("ellipse",{cx:280.44,cy:149.78,className:"cls-21",rx:1.29,ry:1.23})),We||(We=Xe.createElement("ellipse",{cx:280.01,cy:120.55,className:"cls-21",rx:1.29,ry:1.23})),Ie||(Ie=Xe.createElement("ellipse",{cx:230.78,cy:150.04,className:"cls-21",rx:1.29,ry:1.23})),Ye||(Ye=Xe.createElement("ellipse",{cx:230.35,cy:120.81,className:"cls-21",rx:1.29,ry:1.23}))))))}},90803:(e,a,t)=>{"use strict";t.d(a,{A:()=>te});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee=t(30758);function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...te}=e;return ee.createElement("svg",ae({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},te),a?ee.createElement("title",{id:t},a):null,l||(l=ee.createElement("defs",null,ee.createElement("linearGradient",{id:"linear-gradient",x1:179.08,x2:252.06,y1:491.16,y2:408.29,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#f79b5e"}),ee.createElement("stop",{offset:1,stopColor:"#ffc863"})),ee.createElement("linearGradient",{id:"linear-gradient-2",x1:181.04,x2:78.66,y1:465.45,y2:402.61,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#3159a7"}),ee.createElement("stop",{offset:1,stopColor:"#557ebe"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-3",x1:144.05,x2:144.05,y1:497.56,y2:321.7}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-4",x1:171.48,x2:110.16,y1:484.38,y2:462.59}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-5",x1:96.22,x2:300.71,y1:477.21,y2:477.21}),ee.createElement("linearGradient",{id:"linear-gradient-6",x1:312.33,x2:335.6,y1:222.99,y2:222.99,gradientTransform:"rotate(-14.31 324.066 223.066)",gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:.05,stopColor:"#fad05a"}),ee.createElement("stop",{offset:.33,stopColor:"#fac85a"}),ee.createElement("stop",{offset:.77,stopColor:"#f9b159"}),ee.createElement("stop",{offset:1,stopColor:"#f8a359"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-7",x1:314.23,x2:365.43,y1:181.03,y2:117.88}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-8",x1:360.01,x2:498.34,y1:255.77,y2:255.77}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-9",x1:2019.17,x2:1994.62,y1:592.44,y2:505.25,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-10",x1:2092.42,x2:2098.89,y1:541.09,y2:518.99,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{id:"linear-gradient-11",x1:353.97,x2:409.21,y1:310.38,y2:310.38,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#3159a7"}),ee.createElement("stop",{offset:1,stopColor:"#4b8cca"})),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-12",x1:1987.72,x2:1989.82,y1:378.22,y2:361.34,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-13",x1:511.52,x2:529.69,y1:278.27,y2:278.27}),ee.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-14",x1:1964.24,x2:1966.6,y1:386.73,y2:376.51,gradientTransform:"scale(-1 1)rotate(-8 21.596 18003.734)"}),ee.createElement("linearGradient",{id:"linear-gradient-15",x1:414.12,x2:538.61,y1:345.23,y2:345.23,gradientUnits:"userSpaceOnUse"},ee.createElement("stop",{offset:0,stopColor:"#6569af"}),ee.createElement("stop",{offset:1,stopColor:"#54abdf"})),ee.createElement("style",null,".cls-44,.cls-59{fill:#fff}.cls-9{fill:#201b51}.cls-13{fill:#2874bb}.cls-14{fill:#0a4872}.cls-16{fill:#f79f82}.cls-17{fill:#d17a62}.cls-20{fill:#4d77ae}.cls-23,.cls-42{fill:#242359}.cls-43{fill:#383176}.cls-26{fill:#1d4482}.cls-27{fill:#1f1b4f}.cls-28{fill:#3f3b84}.cls-41{fill:#f4825d}.cls-37{fill:#201c50}.cls-39{fill:#211b4e}.cls-41,.cls-42,.cls-43,.cls-44,.cls-45,.cls-47,.cls-50,.cls-53,.cls-59{fill-rule:evenodd}.cls-45{fill:#d0e4f5}.cls-47{fill:#4584c5}.cls-50,.cls-53{fill:#6669af}.cls-50{opacity:.25}.cls-59{opacity:.5}.cls-53{opacity:.2}"))),ee.createElement("g",{style:{isolation:"isolate"}},ee.createElement("g",{id:"Layer_2","data-name":"Layer 2"},ee.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},ee.createElement("path",{d:"M0 0h600v600H0z",style:{fill:"#fff"}}),ee.createElement("g",{id:"plant"},ee.createElement("path",{d:"M56.57 434.43c8.29-2.76 20.59-.42 25.26 8.14a40.7 40.7 0 0 1 8.58 5.49c-1.87-2.17-3.74-4.65-3.53-7.69.24-3.59 3.11-3.13 4.86-1.19s1 3.3 1 5.92c-.08 2.21.32 4.07.26 5 .86.71 1.72 1.42 2.59 2.12q2 1.57 3.94 3.12c-.38-.66-.76-1.31-.91-1.62-1.38-2.91-3.4-6.42-3.15-10s3.48-5.48 5.89-3.08c2 2 .12 5.44-.48 8.11-.74 3.3-.29 5.13-.39 7.36q3.36 2.6 6.76 5.09a22.2 22.2 0 0 1-3.79-8.87c-.51-4.41 4-4.2 6.2-2.44 2.45 1.93 1.66 5.12 1.42 8.09a32.4 32.4 0 0 0 .18 6.08c1.19.84 2.39 1.68 3.61 2.49.94.64 1.88 1.27 2.83 1.89a15.9 15.9 0 0 1-2.1-7.7c0-1.45 0-4.19 1.31-5.06 1.72-1.1 3.45.81 4 2.31 1.47 3.72-.7 8.88-.09 12.48 2.43 1.53 4.88 3 7.37 4.44a21.9 21.9 0 0 1-3.78-7.57c-.43-1.82-.36-4.17 1-5.37s3.74-.32 4.64 1.45.88 4 1 6.12.87 5.12.6 7.29c1.18.64 2.37 1.27 3.57 1.88l.66.33c-.4-.76-.72-1.53-1-2.06a8.56 8.56 0 0 1-.82-5.57c.49-1.92 2.39-3.55 3.93-2.87 1.29.57 1.76 2.41 1.64 4.06s-.7 3.24-.85 4.88a14.5 14.5 0 0 0 .17 3 172 172 0 0 0 8.3 3.5 22.5 22.5 0 0 1-2.25-6.55 7.66 7.66 0 0 1 .75-4.6c.79-1.35 2.4-2.19 3.59-1.53s1.54 2.59 1.27 4.22c-.17 1-.88 7.58-1.43 9.22 2.72 1.05 5.45 2.1 8.17 3.2 1 .41.61 2.14-.49 1.94a59.6 59.6 0 0 1-11-3.25c-.78.74-2 1.25-2.76 2.13-1.26 1.54-2.18 3.43-3.53 4.86s-3.42 2.32-4.86 1.29a2.4 2.4 0 0 1-.89-1.23c-.51-1.64.74-3.44 2-4.56a15 15 0 0 1 7.42-3.56c-2.26-1-4.48-2-6.66-3.05l-.72.14a8 8 0 0 0-3.38 1.24 14.3 14.3 0 0 0-2.14 2.31 16.8 16.8 0 0 1-3.21 2.95 5.83 5.83 0 0 1-4.09 1.34 3 3 0 0 1-2.34-3.32 4.73 4.73 0 0 1 1.87-2.75 14.17 14.17 0 0 1 8.4-3 24 24 0 0 1 3.86.19q-4.16-2.06-8.21-4.39a10.5 10.5 0 0 0-3.32 1.8l-4.14 3.22a16.1 16.1 0 0 1-4.2 2.63 6.55 6.55 0 0 1-6.7-1.38 3.2 3.2 0 0 1-1.17-2.67 4 4 0 0 1 2.2-2.69 20.9 20.9 0 0 1 9.26-3 27.5 27.5 0 0 1 4.62 0c-2.41-1.47-4.79-3-7.14-4.57a21.2 21.2 0 0 0-9.25 2.33c-1.7.93-3.31 2.12-5 3a8.16 8.16 0 0 1-5.43 1.11 3.12 3.12 0 0 1-2.56-3.22 4 4 0 0 1 .52-1.49c1.76-3.15 5.34-4.13 8.48-4.24s7.74 0 11.23 1.21c-3-2.07-6-4.24-8.89-6.47a18.2 18.2 0 0 0-6 2.18c-3.18 1.63-6.24 3.67-9.58 4.74-2.11.67-4.45.9-6.29-.25a1.76 1.76 0 0 1-.73-.75 2.39 2.39 0 0 1 .36-2.06 9.55 9.55 0 0 1 3.8-3.4 20.7 20.7 0 0 1 11.71-2.24 33.3 33.3 0 0 1 5.76 1c-2.81-2.17-5.59-4.4-8.34-6.66l-.56-.48c-2 1.31-4.18 2.44-6.24 3.66s-4.35 2.47-6.49 1.86a2.74 2.74 0 0 1-1.68-1.23 3.89 3.89 0 0 1 .47-3.89 6.83 6.83 0 0 1 3.13-2.24 20.2 20.2 0 0 1 7.47-1c-1.55-1.34-3.12-2.69-4.73-4v.14c-3.21 1.4-6.1 3.92-9.34 5.18a9 9 0 0 1-7.6-.43 2.06 2.06 0 0 1-1.25-1.71 2.62 2.62 0 0 1 1-1.67 14.2 14.2 0 0 1 9.08-3.45 23 23 0 0 1 6 .49 28.8 28.8 0 0 0-9-4.59l-.1-.05a23.8 23.8 0 0 0-6-.17c-2.47.28-4.94.88-7.42 1a10.23 10.23 0 0 1-7-1.84c-1.4-1.11-2.43-3.48-1.28-5.12a4.12 4.12 0 0 1 2.29-1.38",style:{fill:"#493e6b"}}),ee.createElement("path",{d:"M189.66 355.66c22 45.12 17.54 89.76 6.18 90.23-43.11 1.79-45.44-97.06-24.4-153.57 3.38 9.68 2.3 30.68 18.22 63.34",style:{fill:"#413b89"}}),ee.createElement("path",{d:"M220.78 421.15c22.9-20.15 23.51-30.31 26.6-39.52 10.93 57.09-33.23 105.61-41.38 107.52-3.11.73-14.63-42.15 14.78-68",style:{fill:"url(#linear-gradient)"}}),ee.createElement("path",{d:"M163.49 440c7.66 10.12 19.77 24.38 18.28 37.52-.54 4.68-6.68 13.17-10.79 9.29-12.56-7.34-65.91-18.14-87.35-71.74-4.9-12.23-7.58-36.85-38.34-55.64 40.5 2.39 97.77 53.63 118.2 80.57",style:{fill:"url(#linear-gradient-2)"}}),ee.createElement("path",{d:"M107.9 384.54c1.86 2.23 2.32 5.89 4.71 7.24 1.79 1 4.15.52 6.19 2.28a21.4 21.4 0 0 1 4.52 6c2.35 4.41 2.55 8.74 3.87 13.39 1.22 4.29 5.69 5.94 9.09 8.9a42.8 42.8 0 0 1 11.1 16.18c1.45 3.49 1.76 9.19 4.08 11.68 1.64 1.74 4.51 2.54 6.2 4.54 2 2.29 3 5.53 3.66 8.44 1.37 5.95-2.27 8.92-7.76 9.79-6.49-2.88-17.67-9.3-20.8-16.27-1.36-3-.27-3.35-2.69-4.89-4.14-2.62-8.38-3.28-11.09-7.91a30.1 30.1 0 0 1-3.86-12.25c-.2-2.95.87-4.33-.87-6.67-2.75-3.69-6.54-5.52-8.62-9.95a35.5 35.5 0 0 1-2.58-9.93c-.34-2.26.47-3.79.47-5.78 0-3.57-3.59-5.66-5-9-1.59-3.67-1.9-8.12-2.22-12.1 4.18-.62 9.05 3.26 11.6 6.31",style:{fill:"#1f1952"}}),ee.createElement("path",{d:"M192.53 414c1.55-10.56 21.49-47.82 27.4-54.55-10.87 34.9 4 29.16-5.21 88.27-2.78 17.88-15.65 45.78-26.05 45.65-9.85-.12-10-13-11.24-17.41-3.4-12 1.82-91.46 6.43-98.56 6.24 14.3 7.81 33.99 8.67 36.6",style:{fill:"#4f7fc0"}}),r||(r=ee.createElement("path",{d:"M194.56 413.31c2.36-5.87 2.62-12.38 5-18.38 1.25 5.28 4.6 10.19 3.83 15.79-.28 2-1.28 3.85-.91 5.76s2.66 4.08 3.54 6c2.89 6.27-1.51 8.48-1.1 13.19.21 2.45 3.23 6.2 4 8.82 1.26 4.44 2.18 9 .59 13.53-.63 1.75-2.09 3.13-1.9 5 .25 2.49 2.5 5.28 2.88 8 .75 5.25-3 8.67-3.44 12.72-.41 3.51 1.13 9.39-4.72 10.52-2.74.53-4.11-1.13-4.86-6.5-9.23-3.92-1.6-16.38-3.17-22.59-.57-2.21-1.79-4.28-2.28-6.62-.71-3.35 0-6.54-.43-9.74-.31-2.57-1.53-4.72-2.05-7.52-1.1-6 2.18-9 3.39-13.75 1.15-4.41-.28-9.54 1.63-14.23",className:"cls-9"})),c||(c=ee.createElement("path",{d:"M166 441.84c1.13 1.26 1.89 2.93 3 4.06a65.5 65.5 0 0 1-3.8-17.77c-.34-5.28-1.93-11.91-.64-17.09a67 67 0 0 1 9 14.07c3.27 6.58 6.51 13.2 9.75 19.8 4.9 10 8.24 20.18 11.4 30.82 1.36 4.55 6.43 14.25 1.9 18.29a4.07 4.07 0 0 1-4.86.78c-2.3-1.46-4.17-4.11-6-6.09a73.4 73.4 0 0 1-13.09-18.58c-2.78-6-5.71-12-8.1-18.21-1.77-4.59-4.26-10.22-3.77-15.23 1.7 1.69 3.55 3.31 5.21 5.15",className:"cls-9"})),ee.createElement("path",{d:"M110.76 322.05c11.57-3.25 6.72 17 15.73 31.57 1.57 1.85 3.07 3.76 4.52 5.72-.71-4-.56-9.76 1.21-11 4.63-3.34 3.85 4.8 3.49 6.68a28 28 0 0 1-2.58 7.29c2 2.81 3.84 5.68 5.61 8.55-.19-1-.33-1.86-.47-2.47-1.05-4.82-2.25-14.73 3.76-14.75 7.57 0 .56 16.38-.66 21.59.19.31 2.7 4.72 3.72 6.65-.58-6.13.3-16.57 5.52-16.81 11-.53-2.73 13-4 19.31 1.75 3.55 4.13 9.1 5.6 12.78-.28-3.5-.23-7.08.93-10.07 1.62-4.14 5.84-7.72 7.07-1.83.71 3.42-1.75 6.36-3.32 9.28a42.4 42.4 0 0 0-2.94 7.14q1.81 5 3.29 10.08c0-5 .65-10.23 3.35-13.89 5.14-6.95 10.84-.79 10 5.5-.83 6.47-8.45 10-11.79 14.31.74 3.1 1.37 6.22 1.91 9.36 1.47-5.1 3-10.67 7-14.12s11.94-3 10.82 3.28c-1.36 7.7-13 7.9-17.59 12.45.67 4.21 1.18 8.46 1.56 12.75a38.7 38.7 0 0 1 5.35-10.4c3.75-4.83 9.45-1.76 9.35 3.64-.15 7.71-10 8.64-14.27 12q.23 3.45.34 6.93c.09 2.68.24 6.39.34 9.05 1.78-4.28 4.6-9.54 7.33-11.33 5.67-3.72 10.49 1.42 6.86 6.9-3.45 5.22-10.42 4.95-14 9.09.18 3.75.42 7.49.77 11.21 3.08-6.34 9.61-12.52 15.29-12.95 6.25-.48 8.43 4.57 4.12 8.95-3.1 3.14-14.28 4.4-19 7.95a123 123 0 0 0 2.15 12.74c.49 2.16-2.88 3.31-3.53 1.17a79 79 0 0 1-2.13-9.13c-.36-4-3.71-4.71-6.77-6-3.5-1.51-20.82 3.74-15.67-9.51 4.36-11.21 16.44 1.74 21.48 8.59-.28-2.63-.49-5.28-.64-7.93-.82-2.19-2.21-4.21-5.83-6.28-5.34-3.06-27.56-3-24-13.69 5.55-16.64 26.73 10.32 29.72 17.93-.22-4.59-.51-15.52-.54-16.4a15.65 15.65 0 0 0-6.92-5.79c-3.42-1.48-14.58-5.12-11.84-11.24s11 .75 12.67 3.25c2.2 3.33 4.53 6.66 5.94 10.42-.23-4.79-.58-9.55-1.11-14.27-9.88-9.4-30.41-9-24.76-18.29 6.42-10.58 15.21 10.06 24.55 16.47a155 155 0 0 0-2.65-15.4c-1.2-.58-3-2.1-5.25-3.15-5.17-2.37-15.88-2.28-16.51-8.31-.88-8.28 6.64-7.35 11.08-4.32 4.9 3.33 7.21 8.23 10 13v-.19a166 166 0 0 0-5-16c-6.9-3.64-25.92-1.69-20.59-11.84 4.14-7.88 15.89 4.53 20.08 10.46q-2.88-7.69-6.48-15.07c-.89.38-2.4-.94-5.74-1.39-4.66-.63-14-.37-14.62-6.77-.46-4.49 6.84-3.84 10.07-2.43 3.63 1.59 6.24 5.66 9.11 8.24-.51-1-5.78-10.6-8.08-14.28-7.19-2.76-27.43-5.59-24.16-12.67 3.68-8 16.47 4.31 22.84 10.57-.79-1.23-7-10.55-8.58-12.63a55.1 55.1 0 0 1-17.08-11.41c-3.84-3.89-9.19-14.98 4.57-18.84",style:{fill:"url(#linear-gradient-3)"}}),ee.createElement("path",{d:"M124.57 459.32c31-2.35 38.4 23 37.7 24.93-12.22 4.33-25.86 4-47.66-11.38-11.73-8.26-19.9-21.55-20.42-22.37 5.98 5.07 19.95 9.61 30.38 8.82",style:{fill:"url(#linear-gradient-4)"}}),ee.createElement("path",{d:"M96.22 505.64h204.49s.25-18.15-17.23-17.82-21 7.56-21 7.56 21.8-33.57 4.06-32.56-28.38 12.45-34.72 1.54-15.34-23.84-24.14-8.64-2 29.14-11.84 26.86-24.86-11.11-25.86 1.67c0 0-22.53-2.68-18.23 7.2s-40.58-.45-55.53 14.19",style:{fill:"url(#linear-gradient-5)"}})),s||(s=ee.createElement("path",{d:"m99.67 232.94 47.65-3.31-8.89 6.84z",className:"cls-13"})),n||(n=ee.createElement("path",{d:"M138.43 236.47v8.72l-38.76-12.25z",className:"cls-14"})),i||(i=ee.createElement("path",{d:"m137.82 237.16-38.15-4.22 22.44 12.92zM164.53 248.49h-1.52a.47.47 0 0 1 0-.93h3.07a.47.47 0 0 1 .47.46.46.46 0 0 1-.45.47Zm-4.63-.15h-.05c-1-.07-2-.15-3-.26a.46.46 0 0 1-.41-.45v-.06a.45.45 0 0 1 .5-.4h.06c1 .1 2 .19 3 .24a.46.46 0 0 1 .41.46.48.48 0 0 1-.47.43Zm9.29 0a.46.46 0 0 1-.46-.43.47.47 0 0 1 .43-.47c1.08-.08 2.08-.18 3-.29a.49.49 0 0 1 .53.41.48.48 0 0 1-.42.47c-1 .12-2 .22-3.08.3Zm-15.41-.6h-.11c-1-.14-2-.29-3-.46a.44.44 0 0 1-.38-.46v-.08a.45.45 0 0 1 .53-.37c1 .18 2.05.33 3 .46a.47.47 0 0 1 .4.46.13.13 0 0 1 0 .06.47.47 0 0 1-.44.38Zm21.54-.15a.46.46 0 0 1-.46-.38.2.2 0 0 1 0-.07.46.46 0 0 1 .38-.46c1-.19 2.05-.39 3-.62a.46.46 0 0 1 .55.35s0 .06 0 .09a.46.46 0 0 1-.36.46c-1 .23-2 .44-3.05.62Zm-27.63-.89h-.08c-1-.2-2-.41-3-.65a.47.47 0 0 1-.36-.45.4.4 0 0 1 0-.11.47.47 0 0 1 .56-.35c1 .23 2 .46 3 .66a.44.44 0 0 1 .37.44.3.3 0 0 1 0 .1.45.45 0 0 1-.49.35Zm33.63-.52a.47.47 0 0 1-.45-.33.7.7 0 0 1 0-.14.45.45 0 0 1 .33-.44c1-.29 2-.62 2.9-1a.49.49 0 0 1 .6.28.5.5 0 0 1 0 .16.49.49 0 0 1-.31.44c-1 .36-2 .68-3 1a.3.3 0 0 1-.07.02Zm5.78-2.18a.47.47 0 0 1-.42-.27.6.6 0 0 1 0-.2.46.46 0 0 1 .27-.41c.9-.41 1.82-.86 2.73-1.36a.46.46 0 0 1 .62.18.4.4 0 0 1 .07.22.46.46 0 0 1-.25.41c-.93.52-1.87 1-2.79 1.4a.6.6 0 0 1-.23.03m5.43-2.94a.47.47 0 0 1-.39-.22.45.45 0 0 1-.08-.26.52.52 0 0 1 .21-.37c.86-.56 1.7-1.13 2.48-1.73a.5.5 0 0 1 .66.1.5.5 0 0 1 .08.27.46.46 0 0 1-.18.38c-.83.62-1.69 1.22-2.56 1.77a.5.5 0 0 1-.22.08Zm4.93-3.7a.42.42 0 0 1-.34-.17.4.4 0 0 1-.11-.31.47.47 0 0 1 .14-.33c.79-.69 1.53-1.38 2.2-2.08a.48.48 0 0 1 .67 0 .5.5 0 0 1 .13.33.46.46 0 0 1-.13.32c-.75.75-1.51 1.47-2.28 2.14a.5.5 0 0 1-.28.12Zm4.34-4.4a.42.42 0 0 1-.29-.11.43.43 0 0 1-.06-.65c.68-.8 1.3-1.62 1.86-2.41a.5.5 0 0 1 .66-.11.47.47 0 0 1 .18.39.44.44 0 0 1-.07.26c-.6.84-1.25 1.67-1.93 2.46a.44.44 0 0 1-.35.21Zm3.57-5a.5.5 0 0 1-.23-.07.45.45 0 0 1-.23-.39.5.5 0 0 1 .07-.24c.29-.5.58-1 .85-1.54l-.5-.06a.48.48 0 0 1-.39-.46.3.3 0 0 1 0-.08.46.46 0 0 1 .52-.38l.81.11.12-.26a.48.48 0 0 1 .61-.21.46.46 0 0 1 .26.41.7.7 0 0 1 0 .2c.45.05.87.11 1.26.14a.47.47 0 0 1 .41.47.47.47 0 0 1-.51.42l-1.6-.19c-.33.62-.66 1.26-1 1.86a.46.46 0 0 1-.45.31Zm12.36-1.5a.47.47 0 0 1-.33-.79.42.42 0 0 1 .32-.13c1 0 2-.06 3-.12h.08a.47.47 0 0 1 .46.43h-.06.06a.49.49 0 0 1-.44.47c-1 .06-2.08.1-3.1.12Zm-3.11 0c-1 0-2-.06-3.1-.14a.46.46 0 0 1-.43-.47.47.47 0 0 1 .49-.43c1 .07 2 .11 3.06.14a.45.45 0 0 1 .33.14.42.42 0 0 1 .13.32.48.48 0 0 1-.48.43Zm9.29-.36a.47.47 0 0 1-.47-.41v-.06a.46.46 0 0 1 .42-.45c1-.1 2-.23 3-.37a.46.46 0 0 1 .52.39v.07a.45.45 0 0 1-.39.45c-1 .15-2.06.27-3.09.38Zm6.08-.87a.47.47 0 0 1-.46-.38.3.3 0 0 1 0-.1.45.45 0 0 1 .38-.43c1-.19 2-.41 3-.64a.5.5 0 0 1 .56.35s0 .07 0 .1a.47.47 0 0 1-.35.46v-.05.05c-1.07.25-2.06.45-3 .63Zm-27.64-.09h-.08l-1-.21c-.7-.15-1.38-.31-2-.47a.46.46 0 0 1-.33-.44.4.4 0 0 1 0-.12.46.46 0 0 1 .55-.33h.06c.63.17 1.28.32 1.91.45l1 .21a.46.46 0 0 1 .38.44.3.3 0 0 1 0 .1.45.45 0 0 1-.49.36Zm33.65-1.3a.46.46 0 0 1-.44-.34.5.5 0 0 1 0-.12.45.45 0 0 1 .33-.45c1-.27 2-.56 2.94-.87a.45.45 0 0 1 .58.3.3.3 0 0 1 0 .14.45.45 0 0 1-.31.44c-1.06.33-2 .62-3 .89Zm-39.58-.35a.5.5 0 0 1-.18 0 15.8 15.8 0 0 1-2.81-1.5.43.43 0 0 1-.2-.38.47.47 0 0 1 .08-.26.48.48 0 0 1 .65-.12 15 15 0 0 0 2.63 1.41.43.43 0 0 1 .29.41.6.6 0 0 1 0 .19.46.46 0 0 1-.46.25m11.6-1.1a.4.4 0 0 1-.15 0 .46.46 0 0 1-.31-.44.4.4 0 0 1 0-.15 30 30 0 0 0 .9-2.91.48.48 0 0 1 .56-.34.47.47 0 0 1 .35.45s0 .07 0 .12c-.25 1-.57 2-.92 3a.47.47 0 0 1-.45.27ZM191.45 220a.45.45 0 0 1-.37-.19 8 8 0 0 1-.63-.92 9.2 9.2 0 0 1-.85-1.94.6.6 0 0 1 0-.13.46.46 0 0 1 .32-.45.47.47 0 0 1 .58.31 9 9 0 0 0 .76 1.74c.18.29.37.58.57.85a.38.38 0 0 1 .1.27.5.5 0 0 1-.18.37.42.42 0 0 1-.3.09m18.08-3.54h-.06a.46.46 0 0 1-.4-.46v-.06c.09-.67.17-1.34.21-2 0-.35.05-.68.06-1a.46.46 0 0 1 .92 0v1c0 .68-.12 1.38-.23 2.1a.45.45 0 0 1-.5.37Zm-19.94-2.24a.46.46 0 0 1-.47-.43v-.28a16.3 16.3 0 0 1 .28-2.9.46.46 0 0 1 .55-.37.47.47 0 0 1 .37.44v.1a13.4 13.4 0 0 0-.27 2.73v.25a.45.45 0 0 1-.45.45Zm20-3.92a.45.45 0 0 1-.46-.39 16.6 16.6 0 0 0-.67-2.92v-.14a.47.47 0 0 1 .32-.45.48.48 0 0 1 .59.29 17.3 17.3 0 0 1 .71 3.06s0 0 0 .07a.47.47 0 0 1-.4.45Zm-18.86-2.09a.4.4 0 0 1-.18 0 .48.48 0 0 1-.27-.43.4.4 0 0 1 0-.18 15 15 0 0 1 1.57-2.76.47.47 0 0 1 .63-.1.46.46 0 0 1 .2.36.55.55 0 0 1-.09.29 13.6 13.6 0 0 0-1.48 2.6.47.47 0 0 1-.36.17Zm16.86-3.7a.48.48 0 0 1-.4-.21 9.1 9.1 0 0 0-1.92-2.19.47.47 0 0 1-.18-.36.4.4 0 0 1 .1-.29.47.47 0 0 1 .65-.08 9.8 9.8 0 0 1 2.13 2.41.5.5 0 0 1 .06.24.44.44 0 0 1-.2.4.5.5 0 0 1-.22.03Zm-13.27-1.29a.47.47 0 0 1-.32-.22.46.46 0 0 1-.12-.3.45.45 0 0 1 .15-.35 12.3 12.3 0 0 1 2.64-1.82.47.47 0 0 1 .62.21.4.4 0 0 1 0 .19.45.45 0 0 1-.25.43 11.4 11.4 0 0 0-2.43 1.68.4.4 0 0 1-.27.13Zm8.51-2.43h-.12a6.9 6.9 0 0 0-2.83-.21.45.45 0 0 1-.51-.4.2.2 0 0 1 0-.08.48.48 0 0 1 .41-.44 8.3 8.3 0 0 1 3.24.26.45.45 0 0 1 .31.43.7.7 0 0 1 0 .14.45.45 0 0 1-.48.25Z",className:"cls-13"})),ee.createElement("path",{id:"shadow",d:"M225.14 522.41s159.65-2.89 162.51 5.57-57.5 20.56-76.38 20.71-50.8 8.72-77 4.43-108.27-24.26-9.13-30.71",style:{fill:"#cccbcc"}}),m||(m=ee.createElement("g",{id:"feet"},ee.createElement("path",{d:"m306.82 505.64-.79 12.86-15.14.96-.64-11.62zM261.88 509.4l-1.5 13.01-14.29-.99.21-13.16z",className:"cls-16"}),ee.createElement("path",{d:"m298.78 518.96-.49-10.44-.16-1.77-7.88 1.09.64 11.62zM254.77 522.02l-.15-10.99.08-2.15-8.4-.62-.21 13.16z",className:"cls-17"}))),ee.createElement("g",{id:"shoes"},ee.createElement("path",{d:"M264.51 532.72c-.22-1.06-3.94-11.94-3.94-11.94l-.19 1.63a2.65 2.65 0 0 1-.53-1.67c0-.76-2.21-1.47-5.12-1.81 0 0-1.25 6.9-2.6 7.75s-9.81 5.83-9.67 8.11 14.08 2.56 14.08 2.56-14.08 2.49-14.08 5.61a6.9 6.9 0 0 1-.94 2.93 28.8 28.8 0 0 0 8.55 2.55c7.47 1.07 14.37-3.91 15.22-6.45s-.57-8.2-.78-9.27",style:{fill:"#373272"}}),ee.createElement("path",{d:"M256.54 537.35s-13.93-.29-14.08-2.56 8.32-7.26 9.67-8.11 2.59-7.71 2.6-7.75a30 30 0 0 0-3.63-.21 6.92 6.92 0 0 0-6.18 3.3s-3.95 6.58-4.87 8.29-2.28 11-2.28 11a6.7 6.7 0 0 1 0 1.49c0 .64 1.34 1.89 3.75 3.07a6.9 6.9 0 0 0 .94-2.93c0-3.1 14.08-5.59 14.08-5.59",style:{fill:"#242355"}}),d||(d=ee.createElement("path",{d:"M265.52 540.76a18.2 18.2 0 0 1-.16 4.55c-.41 1.28-7.36 3.92-14.83 3.28s-12.93-2.49-13.08-3.78c-.19-1.63 0-4.33.32-4.62.9-.81 10.17 3.49 15.22 3a106 106 0 0 0 12.53-2.43",className:"cls-20"}))),ee.createElement("g",{id:"shoes-2","data-name":"shoes"},ee.createElement("path",{d:"M332.86 537.92s1.63 2.39 0 3.41c-1 .6-13.88 1-16.73.28a71 71 0 0 0-11.45-1.7 22.6 22.6 0 0 0-5.9 1.28s-8.46.38-9.31-.88a4.77 4.77 0 0 1-.4-3.25s9.14-1.21 11.42-.5 11.73.22 13.72.5 18.65.86 18.65.86",style:{fill:"#5080c0"}}),ee.createElement("path",{d:"M328.49 526.88c-2.51 0-22.08-8.59-22.38-9.61s-1.73-.9-4.29-.63a5.26 5.26 0 0 0-3 1.35s.85 8 3.7 8.48 15 6.75 26.1 3.55c0 0-5.41 3.7-8.54 3.7s-13 .28-13.22 1.07c-.14.52.64 2.2 1.17 3.25l2.79.3c13.71 1.55 22.08-.42 22.08-.42a26.5 26.5 0 0 0 1.07-4.7c.17-2.13-2.97-6.4-5.48-6.34",style:{fill:"#373174"}}),o||(o=ee.createElement("path",{d:"M306.82 534.79c.22-.79 10.09-1.07 13.22-1.07s8.54-3.7 8.54-3.7c-11.1 3.2-23.26-3.13-26.1-3.55s-3.7-8.48-3.7-8.48a4 4 0 0 0-.69.78c-7.84-2.24-7.2.69-7.2.69s-3.31 8.06-3.47 9.6 1.65 8 1.65 8A157 157 0 0 1 308 538c-.54-1-1.32-2.69-1.18-3.21",className:"cls-23"}))),ee.createElement("g",{id:"pants"},ee.createElement("path",{d:"M247.72 351c.93 11.52 10.74 46.93 6.9 63.57s0 96.4 0 96.42a26.2 26.2 0 0 0 7.26-1.63s3.62-29.08 4.05-33.35 7.25-57.81 5.12-63.14 8.32-45 8.32-45 3.84-16.71 5.26-20.69 10.52 14.22 10.52 25.32 10.53 42.09 3.42 53.47-.28 82.53-.28 82.53a45 45 0 0 0 8.53-2.88s6.82-87.61 8.58-112.08c1.4-19.34 2.51-61.45 2.91-78.22-7.84 4.16-26.64 13.38-40.37 14-17.77.82-31.16 10.2-30.22 21.68",style:{fill:"#383176"}}),h||(h=ee.createElement("path",{d:"M298.57 426c7.11-11.38-3.42-42.38-3.42-53.47s-9.1-29.3-10.52-25.32-5.26 20.69-5.26 20.69 7 23.68 8.1 30.24-3.62 25.23-3 37.54 5.76 72.17 5.76 72.17c1.81 1.45 5 1.33 8 .68s-6.77-71.16.34-82.53",className:"cls-23"})),p||(p=ee.createElement("path",{d:"M240.54 308.23c-5.76 15 1.5 66.28 2.51 71.82s-.59 39 0 45.44 3.25 82.77 3.25 82.77c2.06 2.44 5.32 2.95 8.32 2.77 0 0-3.84-79.78 0-96.42s-6-52.05-6.9-63.57 12.45-20.9 30.22-21.7c13.73-.62 32.53-9.84 40.37-14 .11-4.44.17-7.11.17-7.11-5.48-12.08-72.18-15-77.94 0",className:"cls-23"}))),ee.createElement("g",{id:"shirt"},ee.createElement("path",{d:"M321 239.54s2.06-11.8 2.27-17.13-14.93-22.4-24.1-25.18-15.59-15-15.59-15l3.55-10.39-11.64-2.09s-31.72 8.11-42.24 21 2 67 4.41 71.11 5.83 4 5.83 4-1.14 8.54-1.28 14.65-9.67 27-9.67 27l10.95 8.82 4.69-9 1.71 9.1s10.24 6.26 29 8.54a37.6 37.6 0 0 0 6.9.13c6.21-8.35 18.71-54.35 20-62.64S321 239.54 321 239.54",style:{fill:"#325aa8"}}),f||(f=ee.createElement("path",{d:"M378.07 183.94 343.37 227l-6.4-16.5-2.54-8c-2.53-8-13.25-22.51-15.49-23.9s-20.77-4.89-20.77-4.89l-11-2-3.55 10.39a44.6 44.6 0 0 0 5.13 7.41 15.2 15.2 0 0 1-5.44-2c-2.72-1.66-8.58-8.06-10.88-11.38 2 3.63 6.8 11.62 11.19 13.3a22.3 22.3 0 0 0 6.57 1.7 21.8 21.8 0 0 0 9 6c9.17 2.78 24.32 19.84 24.1 25.18S321 239.54 321 239.54s8 17.78 20.9 17.07 38.12-51.06 38.12-51.06ZM272.43 176.2c-.6-1.09-.95-1.79-.95-1.79a5 5 0 0 0 .95 1.79",className:"cls-26"})),E||(E=ee.createElement("path",{d:"M316.06 261.87c-.14-8 5-22.33 5-22.33s-13.94 14.65-15.22 23-13.77 54.29-20 62.64c17.71-1.21 38.18-12.93 38.18-12.93s-7.82-42.41-7.96-50.38M243.53 265.85s15.79-1 19.84-2.06 38.4-20.86 38.4-20.86S268.49 276 258.25 277h-15.84ZM259 236.56l-4.41-28.87s6 23.32 9.53 22.89 15.36-.71 15.36-.71Z",className:"cls-26"}))),ee.createElement("g",{id:"head"},g||(g=ee.createElement("path",{d:"M331.21 119.48s9.28.74 8.32 5.33-10.68 10.36-10.68 10.36Z",className:"cls-27"})),x||(x=ee.createElement("g",{id:"face"},ee.createElement("path",{d:"M295.15 133.77c-4.8-9.07-9.17-3-10.77 1.28s1.71 7.79 1.71 7.79c-3.84 8.32-10.56 26.87-10.56 26.87-.17 4.75 3.68 9.31 8.09 12.48 0 0 8.23-9.28 8.12-14.5s3.52-11.63 3.52-11.63c.75 3.95 5.55 7.89 5.55 7.89a22 22 0 0 0 4.9 4c2.46 1.28 6.4 3.41 13.87-4.27s11.63-44.15 11.63-44.15c-27.95-15.95-36.06 14.24-36.06 14.24",className:"cls-16"}),ee.createElement("path",{d:"M295.26 156.06s-3.63 6.4-3.52 11.63-8.1 14.49-8.12 14.5c3.93 2.82 8.31 4.54 10.72 4.31 5.12-.5 3.77-8.71 3.77-11.77s2.7-10.78 2.7-10.78-4.81-3.95-5.55-7.89",className:"cls-17"}))),y||(y=ee.createElement("path",{d:"M278.66 98.46c-1.14-5.26-15.87-3.92-15.88-3.92-2.94 2.34-5.07 4.47-5.7 5.74-2.24 4.48-3 11.84 0 15.89s14.08 2.83 14.08 2.83a123 123 0 0 1 8.73-8.81l-2.8 2.05s2.71-8.51 1.57-13.78",className:"cls-28"})),u||(u=ee.createElement("path",{d:"M289.59 83.21c-6.67-1.91-19.35 5.4-26.81 11.33 0 0 14.74-1.34 15.88 3.92s-1.57 13.8-1.57 13.8l2.8-2.05a66 66 0 0 1 8.52-6.71c8.29-5.31 10.48-17.62 1.18-20.29",className:"cls-27"})),ee.createElement("path",{d:"M289.59 105.26s-1.8-3.76-4.36-3.15-15.35 10-14.61 14.49a29.4 29.4 0 0 0 2.88 8.32Z",style:{fill:"#f6925b"}}),M||(M=ee.createElement("path",{d:"M304.42 116.8c3.44-9.39 20-.57 25.72-2.39a5.93 5.93 0 0 0 4.2-7 8.3 8.3 0 0 0-1.21-1c-8.32-5.87-34.88-4.59-40.91-2.46S276 118 273.5 124.92s.64 17.49 3 20 3.28 13.37 3.28 13.37c3.5-2.21 8.08-13.8 8.08-13.8a15.55 15.55 0 0 1-3.36-6.36c-.91-3.74 2.63-7.69 5.06-8.62 2.14-.82 4.85 3.06 5.47 4l.13-.23a64 64 0 0 0 9.26-16.48",className:"cls-28"})),_||(_=ee.createElement("path",{d:"M300.17 138c5 1.6 15.78-10.14 18.13-13.87s12.18.84 12.18.84 9.77-11.39 3.86-17.61a5.93 5.93 0 0 1-4.2 7c-5.69 1.82-22.28-7-25.72 2.39a64 64 0 0 1-9.27 16.53l-.13.23a2 2 0 0 1 .13.21s0 2.72 5.02 4.28",className:"cls-27"}))),ee.createElement("g",{id:"magnifying_glass","data-name":"magnifying glass"},ee.createElement("path",{d:"M321.77 184.51h4.38v76.97h-4.38z",style:{fill:"url(#linear-gradient-6)"},transform:"rotate(14.31 324.076 223.066)"}),ee.createElement("path",{d:"M371.73 118.48c-3-9.91-8.85-16.43-16.41-18.37s-15.81 1-23.21 8.26c-7.12 7-12.68 17.22-15.64 28.82s-3 23.26-.08 32.8c3 9.91 8.85 16.43 16.41 18.36a18.6 18.6 0 0 0 4.63.58c6.21 0 12.66-3 18.58-8.83 7.12-7 12.68-17.22 15.64-28.83s2.99-23.27.08-32.79m-4.17 31.75c-5.63 22.07-20.76 37.34-33.71 34-6.09-1.55-10.85-7-13.43-15.5-2.68-8.81-2.63-19.65.14-30.52 5.12-20.05 18.06-34.49 30.11-34.49a14.6 14.6 0 0 1 3.6.45c6.09 1.55 10.85 7.06 13.43 15.51 2.68 8.84 2.63 19.68-.14 30.55",style:{fill:"url(#linear-gradient-7)"}}),ee.createElement("path",{d:"M354.27 104.2a14.6 14.6 0 0 0-3.6-.45c-12.05 0-25 14.44-30.11 34.49-2.77 10.87-2.82 21.71-.14 30.52 2.58 8.45 7.34 14 13.43 15.5 12.95 3.31 28.08-12 33.71-34 2.77-10.87 2.82-21.71.14-30.52-2.58-8.48-7.34-13.99-13.43-15.54",style:{fill:"#26a9e0",opacity:.17}})),ee.createElement("path",{d:"M296.79 224.68s3.34 13.09 8.14 14.86l7.65-6.33s9.17 1.57 11.94-.14 6.05-7.68 6.26-9.46a17.5 17.5 0 0 1 .36-2.27 9.7 9.7 0 0 1 1-3.56c.78-1.28 3.13-5.76 2.77-7s-7.11.5-8.17.57-11.24.71-12.59 1.78-4.91 7.4-7.11 8-10.25 3.55-10.25 3.55",style:{fill:"#f59e81"}}),v||(v=ee.createElement("path",{d:"m541.98 71.02-54.07 15.73 12.61 3.95z",className:"cls-13"})),N||(N=ee.createElement("path",{d:"m500.52 90.7 3.56 9.66 37.9-29.34z",className:"cls-14"})),b||(b=ee.createElement("path",{d:"m501.49 91.22 40.49-20.2-19.57 23.43zM409.4 160a.37.37 0 0 1-.29-.14.4.4 0 0 1-.08-.24.35.35 0 0 1 .14-.28.37.37 0 0 1 .52.06.37.37 0 0 1-.06.52.33.33 0 0 1-.23.08m-1.49-2a.37.37 0 0 1-.31-.16c-.45-.69-.89-1.41-1.28-2.14a.36.36 0 0 1-.05-.19.39.39 0 0 1 .19-.32.36.36 0 0 1 .5.15c.39.69.8 1.39 1.24 2.07a.36.36 0 0 1 .06.2.35.35 0 0 1-.17.3.36.36 0 0 1-.18.09m-2.35-4.33a.38.38 0 0 1-.34-.22c-.33-.78-.63-1.55-.9-2.33a.4.4 0 0 1 0-.11.39.39 0 0 1 .25-.36.37.37 0 0 1 .47.24c.26.77.55 1.52.86 2.25a.3.3 0 0 1 0 .13.39.39 0 0 1-.22.35.4.4 0 0 1-.12.01ZM404 149a.37.37 0 0 1-.37-.28c-.2-.82-.38-1.64-.51-2.44a.2.2 0 0 1 0-.08.36.36 0 0 1 .3-.35.37.37 0 0 1 .43.3c.14.79.31 1.59.51 2.39a.3.3 0 0 1 0 .09.36.36 0 0 1-.28.36Zm-.86-4.86a.35.35 0 0 1-.36-.33c-.09-.81-.14-1.65-.17-2.49a.39.39 0 0 1 .36-.37.37.37 0 0 1 .36.37c0 .81.08 1.63.16 2.43a.37.37 0 0 1-.33.37Zm-.15-4.93a.37.37 0 0 1-.36-.37c0-.81.09-1.65.17-2.49a.37.37 0 0 1 .74 0c-.08.81-.14 1.63-.17 2.44a.37.37 0 0 1-.37.38Zm.5-4.91h-.06a.39.39 0 0 1-.31-.38c.13-.82.29-1.64.47-2.45a.37.37 0 0 1 .45-.27.39.39 0 0 1 .28.37.2.2 0 0 1 0 .07c-.19.79-.34 1.6-.48 2.4a.37.37 0 0 1-.37.22Zm1.11-4.81a.2.2 0 0 1-.11 0 .35.35 0 0 1-.26-.34.5.5 0 0 1 0-.12c.24-.8.51-1.59.79-2.36a.37.37 0 0 1 .47-.22.39.39 0 0 1 .25.35.4.4 0 0 1 0 .12c-.29.77-.54 1.55-.78 2.33a.35.35 0 0 1-.38.2Zm1.7-4.63a.4.4 0 0 1-.15 0 .39.39 0 0 1-.22-.35.4.4 0 0 1 0-.13c.33-.75.69-1.49 1.07-2.21a.36.36 0 0 1 .49-.17.37.37 0 0 1 .2.32.4.4 0 0 1 0 .19c-.38.73-.73 1.47-1.05 2.2a.39.39 0 0 1-.36.11Zm2.27-4.38a.33.33 0 0 1-.19-.06.34.34 0 0 1-.19-.31.3.3 0 0 1 .06-.19l.09-.15c.41-.68.84-1.33 1.26-2a.37.37 0 0 1 .51-.09.38.38 0 0 1 .17.31.37.37 0 0 1-.07.2c-.45.66-.86 1.29-1.23 1.91v.08l-.05.07a.33.33 0 0 1-.38.19Zm2.78-4.08a.34.34 0 0 1-.22-.07.36.36 0 0 1-.15-.3.37.37 0 0 1 .08-.22c.48-.63 1-1.28 1.56-1.93a.39.39 0 0 1 .52 0 .38.38 0 0 1 0 .53c-.52.61-1 1.25-1.52 1.88a.34.34 0 0 1-.29.07Zm3.2-3.75a.36.36 0 0 1-.25-.11.34.34 0 0 1-.12-.27.4.4 0 0 1 .1-.25c.56-.58 1.14-1.18 1.75-1.76a.37.37 0 0 1 .52 0 .38.38 0 0 1 .11.26.4.4 0 0 1-.11.26c-.58.55-1.15 1.14-1.73 1.74a.38.38 0 0 1-.29.09Zm58.9-1.77h-1.25a.37.37 0 0 1-.35-.36.38.38 0 0 1 .38-.36h2.45a.37.37 0 0 1 0 .74Zm3.69-.16a.37.37 0 0 1-.37-.34.36.36 0 0 1 .34-.36c.83-.07 1.65-.16 2.43-.27a.37.37 0 0 1 .42.32.4.4 0 0 1 0 .06.36.36 0 0 1-.32.35c-.83.12-1.67.21-2.47.27Zm-7.39 0c-.85-.07-1.68-.15-2.48-.27a.36.36 0 0 1-.31-.36.38.38 0 0 1 .41-.33c.81.12 1.63.21 2.43.27a.38.38 0 0 1 .34.37.35.35 0 0 1-.41.28ZM482 110a.36.36 0 0 1-.36-.29.3.3 0 0 1 0-.08.37.37 0 0 1 .31-.36c.79-.15 1.59-.33 2.38-.53a.37.37 0 0 1 .45.27s0 .06 0 .09a.36.36 0 0 1-.28.35c-.81.21-1.62.4-2.43.55Zm-17.17 0h-.08c-.8-.16-1.61-.34-2.43-.55a.39.39 0 0 1-.27-.37.3.3 0 0 1 0-.09.37.37 0 0 1 .45-.27c.81.21 1.62.4 2.39.55a.38.38 0 0 1 .3.36.2.2 0 0 1 0 .08.36.36 0 0 1-.35.29Zm-46.76-.81a.35.35 0 0 1-.27-.13.4.4 0 0 1-.1-.25.4.4 0 0 1 .13-.28c.61-.53 1.25-1.07 1.9-1.59a.37.37 0 0 1 .52 0 .43.43 0 0 1 .08.24.35.35 0 0 1-.14.28c-.65.53-1.29 1.07-1.87 1.58a.4.4 0 0 1-.24.15Zm68.72-.38a.37.37 0 0 1-.36-.26.4.4 0 0 1 0-.11.37.37 0 0 1 .26-.35c.8-.25 1.58-.52 2.31-.79a.39.39 0 0 1 .48.21.3.3 0 0 1 0 .14.37.37 0 0 1-.24.34c-.77.29-1.57.57-2.35.81Zm-26.74 0h-.11c-.79-.25-1.58-.54-2.35-.84a.37.37 0 0 1-.23-.34.6.6 0 0 1 0-.13.37.37 0 0 1 .48-.22c.78.3 1.55.58 2.3.82a.38.38 0 0 1 .26.36.4.4 0 0 1 0 .11.39.39 0 0 1-.34.2Zm31.36-1.7a.39.39 0 0 1-.35-.22.3.3 0 0 1 0-.14.36.36 0 0 1 .2-.34c.73-.34 1.47-.68 2.18-1a.37.37 0 0 1 .5.16.25.25 0 0 1 0 .17.36.36 0 0 1-.2.32c-.73.38-1.48.74-2.24 1.08Zm-36-.1a.3.3 0 0 1-.15 0c-.75-.35-1.5-.72-2.23-1.11a.39.39 0 0 1-.19-.34.34.34 0 0 1 .05-.17.38.38 0 0 1 .5-.15c.72.39 1.46.77 2.18 1.1a.37.37 0 0 1 .22.33.4.4 0 0 1 0 .17.37.37 0 0 1-.33.16Zm-33.53-.88a.38.38 0 0 1-.3-.15.4.4 0 0 1-.07-.22.36.36 0 0 1 .15-.3c.68-.5 1.36-1 2-1.43a.39.39 0 0 1 .51.09.4.4 0 0 1 .06.21.37.37 0 0 1-.16.31c-.67.46-1.35.94-2 1.42a.4.4 0 0 1-.14.03Zm73.87-1.28a.38.38 0 0 1-.32-.18.34.34 0 0 1-.05-.19.38.38 0 0 1 .18-.32c.69-.4 1.38-.85 2.06-1.31a.38.38 0 0 1 .52.1.36.36 0 0 1 .06.2.36.36 0 0 1-.15.3c-.67.45-1.35.9-2.05 1.3a.37.37 0 0 1-.2.06Zm-44.67-.21a.35.35 0 0 1-.2 0c-.71-.45-1.4-.91-2-1.38a.35.35 0 0 1-.16-.3.32.32 0 0 1 .08-.21.38.38 0 0 1 .52-.09c.63.46 1.31.91 2 1.35a.38.38 0 0 1 .17.33.4.4 0 0 1-.05.19.4.4 0 0 1-.31.07ZM426 103.32a.36.36 0 0 1-.31-.18.3.3 0 0 1-.06-.19.34.34 0 0 1 .18-.31c.7-.45 1.43-.88 2.12-1.28a.37.37 0 0 1 .51.14.4.4 0 0 1 .05.19.37.37 0 0 1-.18.31c-.75.43-1.44.85-2.11 1.26a.36.36 0 0 1-.2.06m73.88-1.32a.4.4 0 0 1-.3-.14.45.45 0 0 1-.08-.23.35.35 0 0 1 .15-.29c.64-.51 1.28-1 1.87-1.57a.37.37 0 0 1 .52 0 .38.38 0 0 1 0 .53c-.61.54-1.26 1.08-1.92 1.59a.4.4 0 0 1-.24.11m-52.75-.31a.32.32 0 0 1-.23-.08c-.65-.54-1.28-1.08-1.87-1.64a.4.4 0 0 1-.12-.29.33.33 0 0 1 .1-.24.38.38 0 0 1 .52 0c.6.57 1.21 1.11 1.83 1.61a.38.38 0 0 1 .13.29.35.35 0 0 1-.09.23.36.36 0 0 1-.27.15Zm-16.84-.87a.37.37 0 0 1-.33-.2.5.5 0 0 1 0-.17.38.38 0 0 1 .2-.33c.68-.36 1.4-.73 2.2-1.13a.38.38 0 0 1 .5.18.3.3 0 0 1 0 .15.37.37 0 0 1-.21.34c-.72.35-1.46.73-2.18 1.12a.6.6 0 0 1-.18.07Zm4.43-2.18a.36.36 0 0 1-.33-.21.34.34 0 0 1 0-.16.36.36 0 0 1 .22-.33c.74-.33 1.51-.67 2.27-1a.37.37 0 0 1 .47.21.2.2 0 0 1 0 .13.38.38 0 0 1-.22.34c-.72.3-1.47.62-2.23 1a.27.27 0 0 1-.18.05Zm8.82-.33a.36.36 0 0 1-.27-.12c-.58-.62-1.12-1.25-1.63-1.89a.4.4 0 0 1-.08-.23.3.3 0 0 1 0-.15c-.7.24-1.43.51-2.18.8a.38.38 0 0 1-.48-.21.6.6 0 0 1 0-.13.36.36 0 0 1 .23-.35l2.33-.86a.39.39 0 0 1 .48.23s0 .08 0 .13a.33.33 0 0 1 0 .17.31.31 0 0 1 .3.14c.49.62 1 1.25 1.59 1.85a.37.37 0 0 1 .1.25.36.36 0 0 1-.12.27.33.33 0 0 1-.27.13Zm.39-3.21a.37.37 0 0 1-.35-.25.5.5 0 0 1 0-.12.36.36 0 0 1 .26-.35l2.35-.77a.38.38 0 0 1 .46.24.4.4 0 0 1 0 .12.39.39 0 0 1-.25.35c-.79.25-1.58.5-2.35.76Zm-3.46-.64a.38.38 0 0 1-.31-.17c-.46-.67-.9-1.38-1.32-2.12a.3.3 0 0 1 0-.18.37.37 0 0 1 .69-.18c.4.69.83 1.39 1.29 2.07a.36.36 0 0 1 .06.2.38.38 0 0 1-.16.31.37.37 0 0 1-.25.1Zm8.16-.88a.37.37 0 0 1-.35-.25.5.5 0 0 1 0-.11.37.37 0 0 1 .26-.36l2.34-.76a.37.37 0 0 1 .47.23.4.4 0 0 1 0 .11.38.38 0 0 1-.25.36c-.7.24-1.45.48-2.35.77Zm4.68-1.56a.39.39 0 0 1-.35-.26.4.4 0 0 1 0-.12.38.38 0 0 1 .24-.35c.86-.31 1.62-.59 2.3-.86a.37.37 0 0 1 .48.2 1 1 0 0 1 0 .13.37.37 0 0 1-.23.36c-.73.29-1.52.58-2.32.87a.3.3 0 0 1-.12.06Zm4.59-1.83a.38.38 0 0 1-.34-.22.4.4 0 0 1 0-.14.37.37 0 0 1 .21-.35c.79-.35 1.51-.69 2.22-1.06a.36.36 0 0 1 .49.17.34.34 0 0 1 .05.17.37.37 0 0 1-.2.31c-.69.37-1.42.71-2.21 1.06a.28.28 0 0 1-.22.09Zm-19.86 0a.38.38 0 0 1-.34-.22c-.27-.58-.52-1.17-.74-1.77v-.12q-.07-.19-.15-.42a.25.25 0 0 1 0-.12.36.36 0 0 1 .24-.35.36.36 0 0 1 .47.22c.08.21.13.37.19.53.23.59.47 1.17.74 1.73a1 1 0 0 1 0 .16.38.38 0 0 1-.21.33.4.4 0 0 1-.24.03ZM462.27 88a.38.38 0 0 1-.31-.18.34.34 0 0 1 0-.19.38.38 0 0 1 .18-.32c.7-.43 1.39-.88 2-1.34a.38.38 0 0 1 .5.09.34.34 0 0 1 .07.22.37.37 0 0 1-.14.29c-.66.47-1.34.93-2.07 1.36a.3.3 0 0 1-.23.07m-25.87-2.46a.36.36 0 0 1-.36-.26c-.19-.78-.34-1.6-.47-2.42v-.06a.37.37 0 0 1 .31-.36.37.37 0 0 1 .42.3q.18 1.2.48 2.4v.09a.36.36 0 0 1-.27.35Zm29.86-.49a.4.4 0 0 1-.28-.13.36.36 0 0 1-.08-.25.37.37 0 0 1 .13-.27c.46-.41.92-.83 1.35-1.27l.39-.41a.37.37 0 0 1 .64.25.42.42 0 0 1-.09.24l-.38.4c-.45.46-.92.9-1.4 1.32a.37.37 0 0 1-.28.12m3.33-3.64a.3.3 0 0 1-.21-.06.35.35 0 0 1-.16-.31.3.3 0 0 1 .06-.19 20 20 0 0 0 1.23-2 .36.36 0 0 1 .48-.15.34.34 0 0 1 .2.34.24.24 0 0 1 0 .14 18 18 0 0 1-1.27 2.1.37.37 0 0 1-.33.13m-33.92-.75a.37.37 0 0 1-.38-.34v-2.5a.38.38 0 0 1 .37-.36.36.36 0 0 1 .34.37v2.4299999999999997a.34.34 0 0 1-.35.36ZM471.82 77h-.12a.4.4 0 0 1-.25-.36.4.4 0 0 1 0-.11 13.6 13.6 0 0 0 .54-2.34.37.37 0 0 1 .41-.32.38.38 0 0 1 .32.37 13.3 13.3 0 0 1-.57 2.47.37.37 0 0 1-.33.29m-35.93-1.29h-.05a.38.38 0 0 1-.32-.36s0 0 0-.06a25 25 0 0 1 .49-2.46.39.39 0 0 1 .46-.26.38.38 0 0 1 .28.36.3.3 0 0 1 0 .09 24 24 0 0 0-.49 2.38.37.37 0 0 1-.37.34Zm36.54-3.57a.36.36 0 0 1-.37-.34 10 10 0 0 0-.51-2.31.3.3 0 0 1 0-.12.37.37 0 0 1 .24-.35.37.37 0 0 1 .47.21 10 10 0 0 1 .54 2.46.37.37 0 0 1-.33.37ZM437.14 71a.3.3 0 0 1-.13 0 .38.38 0 0 1-.24-.34.25.25 0 0 1 0-.13 21 21 0 0 1 1-2.29.37.37 0 0 1 .5-.15.36.36 0 0 1 .19.32.25.25 0 0 1 0 .17 21 21 0 0 0-1 2.21.37.37 0 0 1-.32.21m33.64-3.41a.36.36 0 0 1-.31-.17 14.6 14.6 0 0 0-1.47-1.9.4.4 0 0 1-.1-.25.42.42 0 0 1 .1-.27.38.38 0 0 1 .52 0 14.6 14.6 0 0 1 1.57 2 .4.4 0 0 1 .06.21.34.34 0 0 1-.17.31.36.36 0 0 1-.2.05Zm-31.32-.93a.4.4 0 0 1-.21-.07.37.37 0 0 1-.16-.3.4.4 0 0 1 .06-.23 21 21 0 0 1 1.59-2 .37.37 0 0 1 .52 0 .32.32 0 0 1 .12.26.35.35 0 0 1-.1.26 18 18 0 0 0-1.52 1.87.38.38 0 0 1-.3.19Zm28-2.71a.37.37 0 0 1-.24-.1c-.62-.54-1.27-1-1.91-1.51a.36.36 0 0 1-.15-.3.34.34 0 0 1 .07-.22.39.39 0 0 1 .52-.09c.67.49 1.33 1 2 1.56a.4.4 0 0 1 .12.27.35.35 0 0 1-.09.26.4.4 0 0 1-.31.11ZM442.79 63a.4.4 0 0 1-.28-.13.34.34 0 0 1-.08-.23.35.35 0 0 1 .13-.29 18 18 0 0 1 2-1.5.39.39 0 0 1 .51.11.6.6 0 0 1 .06.21.37.37 0 0 1-.17.3 19 19 0 0 0-2 1.45.4.4 0 0 1-.17.08m20.68-2a.34.34 0 0 1-.18 0 21 21 0 0 0-2.15-1.07.35.35 0 0 1-.21-.34.4.4 0 0 1 0-.15.38.38 0 0 1 .49-.19 21 21 0 0 1 2.25 1.13.37.37 0 0 1 .18.33.4.4 0 0 1 0 .17.37.37 0 0 1-.38.12m-16.54-.71a.36.36 0 0 1-.33-.21.3.3 0 0 1-.05-.16.38.38 0 0 1 .22-.33 20 20 0 0 1 2.33-1 .38.38 0 0 1 .47.24.4.4 0 0 1 0 .11.38.38 0 0 1-.25.36 20 20 0 0 0-2.25.91.4.4 0 0 1-.14.12Zm12-1.21a.16.16 0 0 1-.1 0c-.56-.15-1.15-.28-1.74-.38l-.63-.09a.35.35 0 0 1-.32-.37.37.37 0 0 1 .42-.32l.65.09a16 16 0 0 1 1.79.4.35.35 0 0 1 .26.35s0 .07 0 .1a.36.36 0 0 1-.32.26Zm-7.34-.32a.37.37 0 0 1-.36-.31s0-.05 0-.08a.37.37 0 0 1 .3-.35 18 18 0 0 1 2.51-.27.37.37 0 0 1 .37.35.37.37 0 0 1-.36.37 15 15 0 0 0-2.4.26h-.07Z",className:"cls-13"})),ee.createElement("g",{id:"pie_1","data-name":"pie 1"},ee.createElement("path",{d:"M348.7 228.17 338.25 223s-8.54-32.94 18.34-63.3h13.09Z",style:{fill:"#211c50"}}),ee.createElement("path",{d:"m421.66 207.69-52-48c-11.89 12.57-17.13 29.84-19.39 43.9 26.05 7.02 71.39 4.1 71.39 4.1",style:{fill:"#f4825d"}}),ee.createElement("path",{d:"m348.7 228.17 73-20.48s-45.34 2.92-71.37-4.1a124 124 0 0 0-1.63 24.58",style:{fill:"#e56542"}})),k||(k=ee.createElement("path",{d:"M402.46 188.93c-.55-1.54-4.8-13.14-8.64-15.25s-9 0-9 0 6.85.19 6.64 2.11-7.46 12.21-4.58 13.66 9.45 6.86 9.45 6.86c3.26-1.23 6.61-6.04 6.13-7.38",className:"cls-16"})),j||(j=ee.createElement("path",{d:"M386.88 189.45c-2.88-1.5 4.38-11.74 4.59-13.66s-6.64-2.11-6.64-2.11l4.51 4.19s-3.63 4.11-6.08 6.8-1.07 5.63 0 7.12 8 4.8 11.62 4.8a4.2 4.2 0 0 0 1.45-.28s-6.57-5.37-9.45-6.86",className:"cls-17"})),ee.createElement("g",{id:"pie_3","data-name":"pie 3"},Z||(Z=ee.createElement("path",{d:"m360 245.37-11.4-5.83s-3.56 51.77 61.52 65.78Z",className:"cls-37"})),ee.createElement("path",{d:"m360 245.37 138.23-39.82s4.55 65.81-48.64 92.5S360 278.37 360 245.37",style:{fill:"url(#linear-gradient-8)"}}),w||(w=ee.createElement("path",{d:"m348.61 239.54 136.4-38.04 13.23 4.05-138.23 39.82z",className:"cls-37"}))),ee.createElement("g",{id:"pie_2","data-name":"pie 2"},z||(z=ee.createElement("path",{d:"m468.16 224.91-16.64-4.42-55.19-63.36 15.51 2.56z",className:"cls-39"})),D||(D=ee.createElement("path",{d:"M396.33 157.13s44.65-31.36 93.76 0l-78.25 2.56Z",className:"cls-39"})),G||(G=ee.createElement("path",{d:"M498.53 201.29c11.06-13.93-10.41-41.77-15.86-48.41-38.58-18.39-70.83 6.81-70.83 6.81l56.32 65.22s17.76-7.75 30.37-23.62",className:"cls-20"})),ee.createElement("path",{d:"m483.52 153.29-.85-.41c5.45 6.64 26.92 34.48 15.86 48.41-12.61 15.87-30.37 23.62-30.37 23.62l52.39-22.86s-9.3-35.11-37.03-48.76",style:{fill:"#1c4582"}})),ee.createElement("g",{id:"analysis"},C||(C=ee.createElement("path",{d:"m372.41 502.93 3.64-1.39.69 1.82-3.64 1.39zm58.32-211.57-.7-1.82-2.4.92.69 1.82zM426.5 293l-3.64 1.39-.69-1.82 3.64-1.39zm-5.5 2.05-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.45 2.09-3.64 1.38-.7-1.82 3.64-1.38zm-5.46 2.08-3.63 1.39-.7-1.82 3.64-1.39.7 1.82Zm-5.46 2.08-3.64 1.39-.7-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.09-3.6 1.37-.69-1.82 3.64-1.38.69 1.82Zm-5.46 2.08-3.64 1.39-.69-1.82 3.64-1.39zm-5.46 2.08-3.63 1.39-.7-1.82 3.64-1.39zm-5.45 2.08-3.64 1.39-.7-1.82 3.64-1.39zM361 318l-3.64 1.39-.7-1.82 3.64-1.39zm-5.46 2-3.64 1.38-.69-1.82 3.63-1.38zm-5.35 2.08-.88-1.74A11.4 11.4 0 0 0 346 323l1.45 1.3a9.4 9.4 0 0 1 2.77-2.16Zm-3.87 3.59-1.62-1.07a14 14 0 0 0-1.76 3.79l1.88.53a12.2 12.2 0 0 1 1.5-3.25m-1.85 5-1.94-.2a36 36 0 0 0 0 4h1.94a37 37 0 0 1 .05-3.79Zm0 5.74v3.89h-1.95v-3.9Zm0 5.84v3.9h-1.97v-3.89Zm0 5.84V352h-1.94v-3.89Zm0 5.85v3.89h-2V354Zm0 5.84v3.89h-1.95v-3.9Zm0 5.84v3.9h-1.94v-3.89Zm0 5.84v3.9h-1.95v-3.86Zm0 5.85v3.89h-1.95v-3.9Zm0 5.84v3.89h-1.87v-3.9Zm0 5.84v3.9h-1.95V389Zm0 5.84v3.9h-1.95v-3.89Zm0 5.85v3.89h-1.94v-3.9Zm0 5.84v3.89h-2v-3.9Zm0 5.84v3.9h-1.95v-3.86Zm0 5.84v3.9h-1.94v-3.89Zm0 5.85V428h-1.95v-3.9Zm0 5.84v3.89h-1.77v-3.9Zm0 5.84v3.9h-1.94v-3.89Zm0 5.84v3.9h-1.95v-3.89Zm0 5.85v3.89h-1.95v-3.89Zm0 5.84v3.89h-1.95v-3.9Zm0 5.84v3.9h-2v-3.9Zm0 5.84v3.9h-1.94V465Zm0 5.84v3.9h-1.67v-3.89Zm0 5.85v3.89h-1.95v-3.89Zm0 5.84v3.89h-1.94v-3.9Zm0 5.84v3.89h-2v-3.9Zm0 5.84v3.9h-1.95v-3.89Zm0 5.84v3.9h-1.94V500Zm0 5.85v.9a6.3 6.3 0 0 0 .48 2.53l-1.79.78a8.3 8.3 0 0 1-.64-3.31v-.9Zm1.34 4.74L344.8 512a5.46 5.46 0 0 0 4.29 1.57l-.12-1.94a3.6 3.6 0 0 1-2.81-1Zm4.42.65 3.64-1.39.69 1.82-3.64 1.39zm5.45-2.08 3.64-1.39.7 1.82-3.29 1.42-.7-1.82Zm5.46-2.09 3.64-1.38.7 1.82-3.64 1.38zm9.1-3.46.7 1.81-3.64 1.39-.3-1.8Z",className:"cls-41"})),H||(H=ee.createElement("path",{d:"M454.69 270.31a11.1 11.1 0 0 0-4.45 3.15c.06-.28-.08.76.14-.84s1.52-4.06.45-5.53a13.4 13.4 0 0 0-3.26-2.11 5.23 5.23 0 0 0-3.88.11 14.56 14.56 0 0 0-6.25 5.29 25.8 25.8 0 0 0-3.5 8.47c-.23 1.61-.07.56-.1.83a4.66 4.66 0 0 0-4.11.07 16.1 16.1 0 0 0-6.37 5.4 20.5 20.5 0 0 0-3.59 8.6 9.53 9.53 0 0 0 .64 5.68 8.1 8.1 0 0 0 3.57 3c3.41 1.76 11.37-4.51 15.31-6.05l12.49-4.87a14.5 14.5 0 0 0 6.22-5.31 19.9 19.9 0 0 0 3.37-8.42c.23-1.7 1.85-4.08.41-5.53-2.27-2.25-4.92-2.76-7.09-1.94",className:"cls-42"})),S||(S=ee.createElement("path",{d:"M456.59 271.48a11.1 11.1 0 0 0-4.45 3.15c.06-.28-.08.76.14-.84s-.14-5.22-1.35-6.58-3.08-1.79-5.34-.94a14.46 14.46 0 0 0-6.25 5.28 25.8 25.8 0 0 0-3.5 8.47c-.23 1.62-.07.56-.1.83-1.11-.52-2.16-.66-4.11.07a16.1 16.1 0 0 0-6.37 5.4 20.5 20.5 0 0 0-3.59 8.61c-.44 3 .11 5.36 1.36 6.74s3.17 1.77 5.49.86l12.67-4.94 12.49-4.87a14.5 14.5 0 0 0 6.18-5.35 19.9 19.9 0 0 0 3.37-8.41c.4-2.92-.15-5.21-1.34-6.56a4.87 4.87 0 0 0-5.3-.92",className:"cls-43"})),T||(T=ee.createElement("path",{d:"m450.47 285.33 3.89-1.56-7.06 8.97-5.22-4.06 3.89-1.55 1.32-9.22 4.49-1.79z",className:"cls-44"})),U||(U=ee.createElement("path",{d:"m437.44 287.52-3.88 1.56 7.05-8.97 5.22 4.06-3.89 1.56-1.31 9.21-4.5 1.8z",className:"cls-44"})),O||(O=ee.createElement("path",{d:"m543.5 310.61-3.17 1.21-.6-1.59 3.17-1.23.6 1.59ZM519.36 447.5l.6 1.58 2.39-.91-.61-1.58zm4-1.52 3.17-1.21.61 1.59-3.18 1.21zm4.76-1.81 3.17-1.21.61 1.58-3.17 1.21zm4.76-1.82 3.17-1.21.61 1.59-3.17 1.21zm4.76-1.81 3.17-1.22.61 1.59-3.17 1.21zm4.76-1.82 3.17-1.21.61 1.59-3.18 1.21-.61-1.59Zm4.76-1.82 1.63-.62a5.2 5.2 0 0 0 1.24-.68l1 1.36a7.3 7.3 0 0 1-1.64.91l-1.63.62-.61-1.59Zm4-2.33 1.29 1.1a9.8 9.8 0 0 0 1.84-3.2l-1.61-.55a8.2 8.2 0 0 1-1.52 2.65m1.85-4.12 1.69.18a34 34 0 0 0 0-3.49H553c0 1 .08 2.22 0 3.3Zm0-5v-3.4h1.7v3.39Zm0-5.1V417h1.69v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7V400Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.69v3.4Zm0-5.09v-3.4h1.7v3.4Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.4Zm0-5.09V366h1.7v3.4Zm0-5.1v-3.4h1.7v3.4Zm0-5.09v-3.4h1.69v3.39Zm0-5.1v-3.4h1.7v3.4Zm0-5.09v-3.4h1.7V349Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1v-3.39h1.7v3.4Zm0-5.09v-3.4h1.69v3.39Zm0-5.1v-3.39h1.69v3.4Zm0-5.09v-3.4h1.7v3.39Zm0-5.1a14 14 0 0 0-.15-3.17l1.65-.43a14.6 14.6 0 0 1 .2 3.6ZM552 309l1.3-1.09a4 4 0 0 0-3.88-1.3l.32 1.67a2.28 2.28 0 0 1 2.26.72m-6.9 1-.6-1.58 3.17-1.21.6 1.58Z",className:"cls-41"})),L||(L=ee.createElement("path",{d:"m378.82 458.09.55 59.81h-.83l-2.12-1.2-.31-.19c-2.32-1.33-3.24-4.07-3.24-6.62l.16-55.08a15.58 15.58 0 0 1 4.08-10.07 12.25 12.25 0 0 1 4.82-3.47l125.53-47.6a6.65 6.65 0 0 1 5.68.18l1.86 1.06.51.3c.81.47 1 .77 1 .83-2.19 8.51-137.71 52.96-137.69 62.05",className:"cls-45"})),ee.createElement("path",{d:"M384.37 442.63 509.9 395a6.62 6.62 0 0 1 5.68.18c2 1.12 3.24 3.47 3.25 6.62l-.17 55.09c0 5.62-4 11.69-8.88 13.56l-125.53 47.6c-4.93 1.87-8.93-1.18-8.94-6.79l.17-55.09c-.02-5.59 3.97-11.67 8.89-13.54",style:{fillRule:"evenodd",fill:"url(#linear-gradient-9)"}}),A||(A=ee.createElement("path",{d:"M514.65 437.32c-.21-7.81-2.8-10.82-6.75-10.3a8.6 8.6 0 0 0-1.91.5c-4 1.59-8.61 6.58-10.52 15.72-1.21 5.79-3.1 11-8.39 13.07-13.86 5-3.35-35.06-16.53-29.86-11.35 4.47-8.19 27-14.25 40.15-2.11 4.55-5 6.42-6.89 7.17-8 2.88-7-9.72-7.2-15.12-1-24.92-3.61-26.67-8.49-24.74-5.12 2.06-7.49 3.61-10.27 29.1-1.13 10.42-2.83 19.66-10.76 23-8.82 3.47-8.16-6.16-11.11-11.32-1.75-3.07-4.46-4-7.22-2.95-3 1.18-6 4.75-8 10.66-3.26 9.91-4.46 24.09-4.63 29.08l132.67-51.77c.02-7.59.43-15.64.25-22.39",className:"cls-45"})),q||(q=ee.createElement("path",{d:"m343.81 402.35.63 35.95h-.9l-2.29-1.3c-2.5-1.43-3.5-4.4-3.5-7.14l.14-30.85a16.85 16.85 0 0 1 4.41-10.88 13.2 13.2 0 0 1 5.19-3.74l40.14-15.06a7.15 7.15 0 0 1 6.13.2l2 1.14c1 .56 1.3.93 1.28 1-2.34 9.21-53.26 20.84-53.23 30.68",className:"cls-47"})),P||(P=ee.createElement("path",{d:"m349.8 385.66 40.13-15.05a7.09 7.09 0 0 1 6.13.19c2.14 1.21 3.5 3.74 3.51 7.15l-.15 30.85c0 6.06-4.27 12.62-9.58 14.64l-40.14 15.05c-5.31 2-9.63-1.27-9.65-7.33l.15-30.85c-.02-6.06 4.28-12.63 9.6-14.65",className:"cls-44"})),ee.createElement("path",{d:"M354.72 397.61a7.09 7.09 0 0 1 4.13-6.3c2.34-.88 4.19.52 4.19 3.13a7.18 7.18 0 0 1-4.17 6.38c-2.3.87-4.15-.58-4.15-3.21m8.39 24.56a7.19 7.19 0 0 1-4.17 6.37c-2.3.87-4.15-.58-4.16-3.21a7.1 7.1 0 0 1 4.13-6.31c2.34-.89 4.19.52 4.2 3.15m16.47-20.1a7.24 7.24 0 0 1 4.18-6.37c2.28-.87 4.14.58 4.15 3.21a7.11 7.11 0 0 1-4.13 6.29c-2.3.87-4.19-.52-4.2-3.13m-27.78-3.36c0 4.48 3.21 6.87 7.08 5.4a11.76 11.76 0 0 0 6.33-6.83l11.71 3.79a8.2 8.2 0 0 0-.22 2.09 6 6 0 0 0 .23 1.86l-11.67 12.67c-1.18-2.17-3.57-3.07-6.35-2-3.88 1.47-7.05 6.34-7 10.77s3.2 6.85 7.07 5.38 7.11-6.29 7.1-10.76l-.05-.25 12.31-13.22c1.26 1.38 3.23 1.81 5.49 1 3.91-1.48 7-6.32 7-10.74s-3.16-6.89-7.07-5.4a10.8 10.8 0 0 0-5.48 5.07l-12.34-3.81v-.33c0-4.47-3.22-6.85-7.13-5.36s-7.01 6.2-7.01 10.67",style:{fillRule:"evenodd",fill:"url(#linear-gradient-10)"}}),V||(V=ee.createElement("path",{d:"m357 305.12.37 55.08h-.71l-1.79-1c-2-1.12-2.74-3.44-2.74-5.59l.24-51.09a13.17 13.17 0 0 1 3.45-8.52 10.4 10.4 0 0 1 4.07-2.93l40-15a5.61 5.61 0 0 1 4.8.16l1.58.89c.79.44 1 .73 1 .78-1.87 7.24-50.27 19.52-50.27 27.22",className:"cls-43"})),F||(F=ee.createElement("path",{d:"m361.68 292.06 40-15a5.56 5.56 0 0 1 4.8.15c1.67.95 2.74 2.93 2.74 5.59l-.24 51.1c0 4.74-3.35 9.88-7.5 11.46l-40 15c-4.16 1.58-7.54-1-7.55-5.74l.25-51.1c-.03-4.74 3.34-9.88 7.5-11.46",className:"cls-44"})),ee.createElement("path",{d:"m361.68 292.06 40-15a5.56 5.56 0 0 1 4.8.15c1.67.95 2.74 2.93 2.74 5.59l-.22 40.73-55 20.59.2-40.6c-.05-4.74 3.32-9.88 7.48-11.46",style:{fillRule:"evenodd",fill:"url(#linear-gradient-11)"}}),R||(R=ee.createElement("path",{d:"M404 329.65c0-.95-.64-1.46-1.44-1.14l-18.08 6.68a2.66 2.66 0 0 0-1.47 2.3v1.87c0 .95.64 1.46 1.44 1.14l18.08-6.68a2.66 2.66 0 0 0 1.47-2.3ZM403.91 337.87c0-.83-.55-1.28-1.26-1-10.25 3.79-27.06 10-37.31 13.75a2.31 2.31 0 0 0-1.29 2v1.65c0 .84.56 1.29 1.26 1 10.26-3.79 27.06-10 37.31-13.75a2.34 2.34 0 0 0 1.3-2Z",className:"cls-50"})),ee.createElement("path",{d:"m365.9 303.54-9 3.48-.28 32.98 9-3.47.32-32.95Zm27-20.45-9 3.47-.42 44.11 9-3.48zm-13.51 12.76-.36 36.55-9 3.48.36-36.56zM406 322l-9 3.47.32-32.94 9-3.48Z",style:{fillRule:"evenodd",fill:"#5f97d0"}}),ee.createElement("path",{d:"M406.23 302a.57.57 0 0 0 0-.86.76.76 0 0 0-.95-.16l-8.53 6.39-4.1.93-8.73-3.74-5.25-7.19a.82.82 0 0 0-.95-.31.6.6 0 0 0-.15.11l-12.65 11.25-7.64.31c-.37-.09-.69.1-.7.42a.81.81 0 0 0 .64.76l8-.23a.64.64 0 0 0 .58-.11l12.36-11 4.86 6.66a.86.86 0 0 0 .38.29l9.2 3.94a.8.8 0 0 0 .46.05l4.39-1a.7.7 0 0 0 .25-.1Z",style:{fillRule:"evenodd",fill:"#4f66af",mixBlendMode:"multiply",opacity:.5}}),B||(B=ee.createElement("path",{d:"M406.22 302.13a.73.73 0 0 0 0-1 .67.67 0 0 0-.95-.16l-8.54 7.82-4.14 1.21-8.73-4-5.23-8.24a.75.75 0 0 0-.95-.33.5.5 0 0 0-.15.14l-12 13.33-8.36-2.13a.55.55 0 0 0-.7.53.88.88 0 0 0 .64.86l8.68 2.21a.56.56 0 0 0 .58-.15l11.73-13 4.85 7.63a.8.8 0 0 0 .37.33l9.2 4.28a.67.67 0 0 0 .46.05l4.4-1.34a.46.46 0 0 0 .24-.12Z",className:"cls-44"})),W||(W=ee.createElement("path",{d:"M508.74 286.69c0-.76-.51-1.16-1.16-.89l-19.74 7.72a2.18 2.18 0 0 0-1.2 1.87v1.52c0 .76.52 1.16 1.17.89l19.74-7.72a2.2 2.2 0 0 0 1.2-1.88Z",className:"cls-53"})),I||(I=ee.createElement("path",{d:"M531 253c0-1.7.62-2.63-.07-3.69a9.8 9.8 0 0 0-2.64-2 5.35 5.35 0 0 0-4.66-.06l-51.33 20.8c-4.13 1.66-7.53 6.94-7.59 11.8l-.21 24.37a7.42 7.42 0 0 0 1.36 4.76 8 8 0 0 0 3.21 2.21c1.06.29 1.49-.65 2.81-1.18l51.32-20.84c4.14-1.66 7.54-6.95 7.6-11.8Z",className:"cls-42"})),Y||(Y=ee.createElement("path",{d:"M532.17 253.94c.06-4.85-3.24-7.45-7.37-5.79L473.48 269c-4.13 1.66-7.54 6.95-7.6 11.8l-.2 24.38c-.06 4.85 3.24 7.44 7.37 5.79l51.32-20.85c4.14-1.66 7.54-6.94 7.6-11.79Z",className:"cls-44"})),ee.createElement("path",{d:"M532.17 253.94c.06-4.85-3.24-7.45-7.37-5.79L473.48 269c-4.13 1.66-7.54 6.95-7.6 11.8v2.29a12 12 0 0 1 1.4-.67l64.89-26.36Z",style:{fillRule:"evenodd",fill:"url(#linear-gradient-12)"}}),ee.createElement("path",{d:"M521.71 267.38c-5 .41-9.51 5.61-10.12 11.63s2.93 10.56 7.91 10.15 9.51-5.62 10.12-11.63-2.93-10.53-7.91-10.15",style:{fillRule:"evenodd",fill:"url(#linear-gradient-13)"}}),ee.createElement("path",{d:"M521.2 272.4c2.68-.22 4.59 2.23 4.27 5.47s-2.77 6.05-5.46 6.27-4.6-2.23-4.27-5.47 2.77-6.05 5.46-6.27m-3.2 6.08c-.17 1.72.84 3 2.27 2.91a3.63 3.63 0 0 0 2.9-3.33c.17-1.73-.84-3-2.27-2.91a3.62 3.62 0 0 0-2.9 3.33",style:{fillRule:"evenodd",fill:"url(#linear-gradient-14)"}}),X||(X=ee.createElement("path",{d:"M508.89 277.27c0-1.29-.87-2-2-1.51l-33.44 13.07a3.72 3.72 0 0 0-2 3.18v2.56c0 1.3.86 2 2 1.51L506.82 283a3.77 3.77 0 0 0 2-3.19Z",className:"cls-53"})),Q||(Q=ee.createElement("path",{d:"M527.31 251.1a2.75 2.75 0 0 0-2.21 2.53c-.13 1.31.64 2.3 1.73 2.22a2.77 2.77 0 0 0 2.21-2.54c.13-1.31-.64-2.31-1.73-2.21M522.13 253.16a2.75 2.75 0 0 0-2.21 2.53c-.13 1.31.64 2.3 1.73 2.21a2.74 2.74 0 0 0 2.2-2.53c.15-1.31-.64-2.3-1.72-2.21M516.52 255.43a2.74 2.74 0 0 0-2.21 2.53c-.13 1.31.64 2.31 1.73 2.22a2.76 2.76 0 0 0 2.2-2.54c.13-1.31-.64-2.3-1.72-2.21",className:"cls-44"})),ee.createElement("path",{d:"m420.66 348.77.15 51.32h-.9l-2.29-1.29c-2.5-1.43-3.5-4.39-3.5-7.14l.63-46.22a16.84 16.84 0 0 1 4.4-10.88 13.4 13.4 0 0 1 5.2-3.74L529.17 291a7.15 7.15 0 0 1 6.13.2l2 1.14c1 .56 1.3.93 1.29 1-2.35 9.2-117.95 45.59-117.93 55.43",style:{fillRule:"evenodd",fill:"url(#linear-gradient-15)"}}),ee.createElement("path",{d:"m426.65 332.09 104.82-39.82a7.09 7.09 0 0 1 6.13.2c2.14 1.2 3.5 3.74 3.51 7.14l-.63 46.23c0 6.06-4.27 12.62-9.58 14.64l-104.82 39.81c-5.32 2-9.64-1.27-9.65-7.33l.62-46.23c-.05-6.06 4.29-12.63 9.6-14.64",style:{fillRule:"evenodd",fill:"#ade1f7"}}),J||(J=ee.createElement("path",{d:"m422.12 350.74 59.67-22.44a1.73 1.73 0 0 1 1.47 0 1.9 1.9 0 0 1 .84 1.71v2.29a3.94 3.94 0 0 1-2.29 3.5l-59.67 22.45a1.65 1.65 0 0 1-2.31-1.75l-.05-2.3a4 4 0 0 1 2.34-3.46M422.15 364.72l59.67-22.45a1.73 1.73 0 0 1 1.47.05 1.9 1.9 0 0 1 .84 1.71v2.29a3.94 3.94 0 0 1-2.29 3.5l-59.67 22.45c-1.27.48-2.31-.31-2.31-1.76v-2.29a4 4 0 0 1 2.29-3.5M458.17 364.79l23.68-8.54a1.7 1.7 0 0 1 1.47.05 1.89 1.89 0 0 1 .84 1.71v2.29a4 4 0 0 1-2.29 3.5l-23.68 8.53c-1.27.48-2.3-.3-2.3-1.75l-.05-2.29a4 4 0 0 1 2.33-3.5",className:"cls-59"})),$||($=ee.createElement("path",{d:"M536.33 321.84c-.5 15.55-11.69 33-25 39s-23.58-5.67-23.2-17.38 3.23-16.19 7.81-23.29c2 1.48 3.91 3 5.87 4.41-3 4.56-4.82 7.48-5.06 15s6.36 15 14.91 11.17 15.74-15.07 16.06-25.06Z",className:"cls-41"})),ee.createElement("path",{d:"M529.89 305.07c4.21 3.13 6.69 9 6.44 16.77l-8.62 3.86c.16-5-1.42-8.76-4.13-10.77 2.11-3.28 4.22-6.55 6.31-9.86",style:{fill:"#413b89",fillRule:"evenodd"}}),K||(K=ee.createElement("path",{d:"M513.13 304.45c6.66-3 12.58-2.53 16.76.6q-3.14 4.95-6.31 9.88c-2.7-2-6.5-2.31-10.76-.4a27.27 27.27 0 0 0-11.13 10.22c-1.95-1.46-3.91-2.91-5.87-4.39 4.52-7.07 10.64-12.93 17.31-15.91",className:"cls-47"})))))))}},73712:(e,a,t)=>{"use strict";t.d(a,{A:()=>re});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V,F,R,B,W,I,Y,X,Q,J,$,K,ee,ae,te=t(30758);function le(){return le=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...re}=e;return te.createElement("svg",le({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 600 600","aria-labelledby":t},re),a?te.createElement("title",{id:t},a):null,l||(l=te.createElement("defs",null,te.createElement("linearGradient",{id:"linear-gradient",x1:565.39,x2:495.35,y1:420.19,y2:282.33,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f79b5e"}),te.createElement("stop",{offset:.29,stopColor:"#faad60"}),te.createElement("stop",{offset:.71,stopColor:"#fec162"}),te.createElement("stop",{offset:1,stopColor:"#ffc863"})),te.createElement("linearGradient",{id:"linear-gradient-2",x1:285.83,x2:379.21,y1:329.1,y2:255.86,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.05,stopColor:"#fad05a"}),te.createElement("stop",{offset:.33,stopColor:"#fac85a"}),te.createElement("stop",{offset:.77,stopColor:"#f9b159"}),te.createElement("stop",{offset:1,stopColor:"#f8a359"})),te.createElement("linearGradient",{id:"Degradado_sin_nombre_8",x1:-238.49,x2:-177.57,y1:214.05,y2:214.05,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#2272b9"}),te.createElement("stop",{offset:.41,stopColor:"#2851a5"}),te.createElement("stop",{offset:.77,stopColor:"#2c3a97"}),te.createElement("stop",{offset:1,stopColor:"#2d3292"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-2",x1:-238.49,x2:-177.57,y1:201.84,y2:201.84}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-3",x1:401.41,x2:411.9,y1:296.15,y2:296.15}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-4",x1:268.16,x2:289.98,y1:319.83,y2:319.83}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-5",x1:385.35,x2:405.29,y1:280.92,y2:280.92}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-6",x1:265.75,x2:303.59,y1:348.64,y2:348.64}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-3",x1:359.98,x2:355.26,y1:435.36,y2:502.61}),te.createElement("linearGradient",{id:"Degradado_sin_nombre_20",x1:2247.71,x2:2248.15,y1:1747.66,y2:1768.82,gradientTransform:"matrix(1 0 0 -1 -1925.89 2236.11)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#4280c1"}),te.createElement("stop",{offset:1,stopColor:"#2c469c"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-7",x1:104.86,x2:132.76,y1:-1008.33,y2:-1008.33,gradientTransform:"matrix(1 0 0 -1 206.83 -529.81)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-8",x1:104.86,x2:132.76,y1:-1002.74,y2:-1002.74,gradientTransform:"matrix(1 0 0 -1 201.44 -522.76)"}),te.createElement("linearGradient",{id:"linear-gradient-4",x1:-170.29,x2:-162.71,y1:491.86,y2:464.9,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f8a034"}),te.createElement("stop",{offset:1,stopColor:"#ffc546"})),te.createElement("linearGradient",{id:"linear-gradient-5",x1:-171.61,x2:-180.96,y1:492.77,y2:473.38,gradientTransform:"matrix(-1 0 0 1 132 0)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#fcb72c"}),te.createElement("stop",{offset:1,stopColor:"#ffcf44"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-6",x1:-159.94,x2:-156.6,y1:494.04,y2:481.56}),te.createElement("linearGradient",{id:"Degradado_sin_nombre_40",x1:2203.56,x2:2217.63,y1:375.96,y2:327.52,gradientTransform:"translate(-1999.3)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.32,stopColor:"#4b6ab1"}),te.createElement("stop",{offset:1,stopColor:"#5f83c2"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-7",x1:372.33,x2:390.94,y1:-430.67,y2:-430.67,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-2",x1:1985.87,x2:1986.03,y1:1164.62,y2:1172.42,gradientTransform:"matrix(1 0 0 -1 -1734.37 1560.92)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-9",x1:376.55,x2:386.93,y1:-417.87,y2:-417.87,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-10",x1:376.55,x2:386.93,y1:-415.79,y2:-415.79,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-8",x1:-136.52,x2:-117.91,y1:1145.89,y2:1145.89,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-3",x1:2495.13,x2:2495.29,y1:-412.16,y2:-404.35,gradientTransform:"matrix(1 0 0 -1 -2270.59 -94.67)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-11",x1:-132.3,x2:-121.92,y1:1158.69,y2:1158.69,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-12",x1:-132.3,x2:-121.92,y1:1160.77,y2:1160.77,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-5",id:"linear-gradient-9",x1:245.28,x2:263.55,y1:1537.31,y2:1537.31,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-4",x1:2112.62,x2:2112.78,y1:-802.23,y2:-794.56,gradientTransform:"matrix(1 0 0 -1 -1931.15 -445.99)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-13",x1:249.42,x2:259.61,y1:1549.87,y2:1549.87,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-14",x1:249.42,x2:259.61,y1:1551.92,y2:1551.92,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-2",x1:2213.93,x2:2231.66,y1:315.06,y2:315.06}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-3",x1:1103.42,x2:1121.15,y1:-756.73,y2:-756.73,gradientTransform:"rotate(97.83 181.079 -557.587)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-4",x1:2000.36,x2:2018.09,y1:997.1,y2:997.1,gradientTransform:"rotate(-31.9 -27.936 3872.469)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-5",x1:2195.3,x2:2207.35,y1:428.47,y2:386.97}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-6",x1:214.91,x2:214.92,y1:392.54,y2:392.52}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-7",x1:2197.89,x2:2217.64,y1:404.17,y2:336.15}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-8",x1:2227.24,x2:2248.16,y1:408.53,y2:336.45}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_40",id:"Degradado_sin_nombre_40-9",x1:2237.02,x2:2246.13,y1:432.92,y2:401.53}),te.createElement("linearGradient",{id:"linear-gradient-10",x1:265.86,x2:189.33,y1:476.69,y2:461.55,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#242259"}),te.createElement("stop",{offset:1,stopColor:"#635b75"})),te.createElement("linearGradient",{id:"linear-gradient-11",x1:186.21,x2:258.64,y1:452.06,y2:452.06,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#3159a7"}),te.createElement("stop",{offset:1,stopColor:"#557ebe"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-10",id:"linear-gradient-12",x1:179.63,x2:263.01,y1:446.75,y2:446.75}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-13",x1:193.88,x2:258.04,y1:470.3,y2:470.3}),te.createElement("linearGradient",{id:"linear-gradient-14",x1:395.32,x2:454.96,y1:436.41,y2:436.41,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#f2f2f2"}),te.createElement("stop",{offset:1,stopColor:"#e8e7f3"})),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-15",x1:464.99,x2:487.23,y1:375.07,y2:456.24}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-11",id:"linear-gradient-17",x1:476.82,x2:406.97,y1:468.87,y2:388.09}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-2",id:"linear-gradient-18",x1:437.15,x2:469.7,y1:439.7,y2:486.53}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_20",id:"Degradado_sin_nombre_20-5",x1:1218.31,x2:1218.65,y1:-1516.5,y2:-1499.56,gradientTransform:"translate(-734.01 1982.54)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-16",x1:1136.58,x2:1158.94,y1:2257.54,y2:2257.54,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("linearGradient",{xlinkHref:"#Degradado_sin_nombre_8",id:"Degradado_sin_nombre_8-17",x1:1136.58,x2:1158.94,y1:2262.02,y2:2262.02,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-19",x1:164.71,x2:164.71,y1:477.26,y2:421.44}),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-4",id:"linear-gradient-20",x1:172.5,x2:172.5,y1:477.26,y2:421.44}),te.createElement("linearGradient",{id:"linear-gradient-21",x1:178.81,x2:171.39,y1:434.22,y2:460.11,gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:0,stopColor:"#fdf4b6"}),te.createElement("stop",{offset:1,stopColor:"#d07e2b"})),te.createElement("linearGradient",{xlinkHref:"#linear-gradient-21",id:"linear-gradient-22",x1:186.44,x2:179.01,y1:436.41,y2:462.3}),te.createElement("radialGradient",{id:"Degradado_sin_nombre_5",cx:2729.02,cy:262.73,r:8.09,gradientTransform:"matrix(.91 -.1 -.1 -.99 -2089.49 867.93)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.29,stopColor:"#fff",stopOpacity:.6}),te.createElement("stop",{offset:.99,stopColor:"#fff",stopOpacity:0})),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-2",cx:2537.06,cy:418.26,r:52.01,gradientTransform:"matrix(1 0 0 -1 -2234.75 751.65)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-3",cx:2604.51,cy:410.71,r:71.34,gradientTransform:"matrix(1 0 0 -1 -2234.75 751.65)"}),te.createElement("radialGradient",{id:"radial-gradient",cx:-208.03,cy:147.25,r:28.01,gradientTransform:"matrix(-1 0 0 1.25 132 78.41)",gradientUnits:"userSpaceOnUse"},te.createElement("stop",{offset:.02,stopColor:"#fff"}),te.createElement("stop",{offset:.08,stopColor:"#dfcabe"}),te.createElement("stop",{offset:.13,stopColor:"#c59c88"}),te.createElement("stop",{offset:.17,stopColor:"#b48166"}),te.createElement("stop",{offset:.19,stopColor:"#ae7659"}),te.createElement("stop",{offset:.24,stopColor:"#9c6a50"}),te.createElement("stop",{offset:.37,stopColor:"#704e3a"}),te.createElement("stop",{offset:.49,stopColor:"#4b3629"}),te.createElement("stop",{offset:.62,stopColor:"#2f241b"}),te.createElement("stop",{offset:.75,stopColor:"#1b1711"}),te.createElement("stop",{offset:.87,stopColor:"#0f100b"}),te.createElement("stop",{offset:1,stopColor:"#0b0d09"})),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-4",cx:-125.99,cy:-945.34,r:3.71,gradientTransform:"matrix(-.33 -.85 -.93 .36 -542.77 685.14)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-5",cx:101.53,cy:-1063,r:23.83,gradientTransform:"scale(-1 1)rotate(-75 862.342 25.433)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-6",cx:132.43,cy:-1066.46,r:32.68,gradientTransform:"scale(-1 1)rotate(-75 862.342 25.433)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-2",cx:2247.96,cy:1368.03,r:13.11,gradientTransform:"matrix(.26 .97 1.2 -.32 -1882.6 -1254.88)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-7",cx:223.65,cy:-347.58,r:1.38,gradientTransform:"matrix(-.29 -.87 -.95 .32 9.23 688.27)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-8",cx:375.31,cy:-438.2,r:8.86,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-9",cx:386.8,cy:-439.49,r:12.16,gradientTransform:"scale(-1 1)rotate(-77.3 568.366 381.113)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-3",cx:1985.45,cy:881.94,r:4.9,gradientTransform:"matrix(.22 .98 1.22 -.27 -1241.39 -1309.43)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-10",cx:-148.92,cy:1273.69,r:1.38,gradientTransform:"matrix(-.77 .49 .54 .84 -588.31 -706.92)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-11",cx:-133.54,cy:1138.35,r:8.86,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-12",cx:-122.04,cy:1137.07,r:12.16,gradientTransform:"matrix(-.9 .45 .45 .9 -405.91 -668)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-4",cx:2494.32,cy:-384.38,r:4.9,gradientTransform:"matrix(.9 -.45 -.56 -1.12 -2226.03 987.75)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-13",cx:311.09,cy:1622.47,r:1.35,gradientTransform:"matrix(-.44 .8 .88 .48 -1130.94 -679.92)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-14",cx:248.2,cy:1529.9,r:8.7,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-15",cx:259.49,cy:1528.64,r:11.94,gradientTransform:"scale(-1 1)rotate(55.2 1181.035 544.988)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-5",cx:2112.89,cy:-697.54,r:4.82,gradientTransform:"matrix(.57 -.82 -1.03 -.71 -1738.53 1597.66)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-16",cx:1367.61,cy:2206.83,r:2.97,gradientTransform:"matrix(.33 -.85 .93 .36 -2071.15 825.22)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-17",cx:1133.91,cy:2213.73,r:19.09,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("radialGradient",{xlinkHref:"#Degradado_sin_nombre_5",id:"Degradado_sin_nombre_5-18",cx:1158.67,cy:2210.96,r:26.19,gradientTransform:"rotate(-74.97 -349.33 1799.21)"}),te.createElement("radialGradient",{xlinkHref:"#radial-gradient",id:"radial-gradient-6",cx:1218.27,cy:-1258.3,r:10.59,gradientTransform:"matrix(-.26 .97 -1.2 -.32 -732.8 -1115.28)"}),te.createElement("style",null,".cls-3{fill:#cccbcb}.cls-6,.cls-79{fill:#231f20}.cls-8{fill:#213f98}.cls-29,.cls-30,.cls-35,.cls-74{fill:none;stroke-miterlimit:10}.cls-15{fill:#2a2e7e}.cls-20{fill:#cf7961}.cls-29,.cls-30{stroke:#2a2e7e}.cls-29{stroke-width:.81px}.cls-30,.cls-74{stroke-width:.41px}.cls-35{stroke:#231f20;stroke-width:.61px}.cls-72{fill:url(#linear-gradient-14)}.cls-74{stroke:#003953}.cls-79{fill-rule:evenodd}.cls-89{fill:#1f1a4e}.cls-90{fill:#f79f81}.cls-91{fill:#373175}.cls-92{fill:#242259}.cls-93{fill:#1e4380}"))),te.createElement("g",{style:{isolation:"isolate"}},te.createElement("g",{id:"Layer_2","data-name":"Layer 2"},te.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},te.createElement("path",{d:"M0 0h600v600H0z",style:{fill:"#fff"}}),r||(r=te.createElement("g",{id:"shadow"},te.createElement("path",{id:"shadow-2",d:"M48 491.94S4.84 495.29 21.74 498s472.56 1.18 371.36-11.46c-63.74-8-192.22-6.32-256.75-3.09S48 491.94 48 491.94",className:"cls-3","data-name":"shadow"}),te.createElement("path",{d:"M473 471.83s79.21 15.78 34.09 15.21-108.39 0-63.18-8.73 29.09-6.48 29.09-6.48",className:"cls-3"}))),te.createElement("g",{id:"tree"},te.createElement("path",{d:"M509.66 398.08c22.87-1.47 49.25-27.31 42.3-43.3s-8.55-26.58-1.51-37.38c6.38-9.81-17.46-51.33-8.41-67.24-3.38-3.2-8.06-5-12.38-3.52-5.47 1.87-8.2 7.91-9.92 13.43a128.6 128.6 0 0 0-4.32 18.67c-.92 6-1.57 12.5-5.46 17.18-4.28 5.14-11.5 6.91-16.25 11.61a17.74 17.74 0 0 0-4.94 15.29c.82 4.85 3.62 9.09 5.61 13.58s3.14 9.91.7 14.18c-2.16 3.75-6.51 5.6-9.53 8.71-3.85 4-5.29 9.88-4.6 15.37s3.31 10.58 6.6 15a52 52 0 0 0 5.72 6.48 46.6 46.6 0 0 0 16.39 1.94",style:{fill:"url(#linear-gradient)"}}),te.createElement("path",{d:"M532.22 421.28c4.87-10.54 22.45-17.86 29.25-23.67 7.17-6.14 13.74-14.37 15.11-24 1.53-10.76-4.35-16.51-9.3-25-8.19-14 8.38-27.72 2.77-41.78-2.9-7.24-11.41-10.48-16-16.79-3.67-5-4.48-11.56-5-17.78s-.89-12.69-3.91-18.15a16.9 16.9 0 0 0-3.12-4c-9 15.91 14.79 57.43 8.41 67.24-7 10.8-5.45 21.39 1.51 37.38s-19.43 41.83-42.3 43.3a46.6 46.6 0 0 1-16.39-1.92 52.3 52.3 0 0 0 11 8c9.75 5.37 21.75 8.03 27.97 17.17",style:{fill:"#f69159"}}),c||(c=te.createElement("path",{d:"m555.45 360.95-.46-.42L532.53 385v-59.39l14.65-18.56-.48-.39-14.17 17.95V264.8h-.62v31.37l-9.97-14.51-.52.35 10.49 15.25v47.98l-26.48-26.71-.44.43 26.92 27.16v57.33l-34.06-33.94-.44.44 34.5 34.38v62.69h.62v-81.1z",className:"cls-6"}))),te.createElement("g",{id:"bulb"},te.createElement("path",{d:"M340 355c-5.54.33-55.2-3.11-55.2-53.74 0-32.75 24-33.06 28.48-78h53.44c4.48 44.9 27.26 45.21 27.26 78C394 351.89 345.57 355.33 340 355",style:{fill:"url(#linear-gradient-2)"}}),s||(s=te.createElement("path",{d:"M366.5 223.3h-53.19v-30.55a4.18 4.18 0 0 1 4.18-4.18h44.83a4.18 4.18 0 0 1 4.18 4.18z",className:"cls-8"})),te.createElement("rect",{width:60.92,height:9.46,x:309.57,y:209.32,rx:1.94,style:{fill:"url(#Degradado_sin_nombre_8)"}}),te.createElement("rect",{width:60.92,height:9.46,x:309.57,y:197.11,rx:1.94,style:{fill:"url(#Degradado_sin_nombre_8-2)"}}),n||(n=te.createElement("path",{d:"M327.64 178.81h24.77a4 4 0 0 1 4 4v5.76h-32.77v-5.76a4 4 0 0 1 4-4",className:"cls-8"})),te.createElement("path",{d:"M367.27 340.71a3.9 3.9 0 1 0-3.42 4.64 4.09 4.09 0 0 0 3.42-4.64",style:{fill:"url(#Degradado_sin_nombre_5)"}}),te.createElement("path",{d:"M329.14 313.64c-1-9.19-8.56-15.91-16.95-15s-14.41 9.05-13.44 18.23 8.55 15.91 16.95 15 14.41-9.05 13.44-18.23",style:{fill:"url(#Degradado_sin_nombre_5-2)"}}),te.createElement("path",{d:"M368.66 331.81c14.34-11.54 12.7-30.79 11-47.24-.48-4.66 6.8-4.63 7.28 0 1.9 18.34 2.74 39.62-13.13 52.4-3.62 2.91-8.81-2.22-5.15-5.16",style:{fill:"url(#Degradado_sin_nombre_5-3)"}}),te.createElement("path",{d:"M347.94 223.3v57.36s-.84 17.45 11.28 18 1.15-20.4-15.81-20.4-29 3.28-27.58 15.61 14 4.2 14-17.84V223.3",style:{fill:"none",strokeMiterlimit:10,strokeWidth:".94px",stroke:"url(#radial-gradient)"}}),i||(i=te.createElement("path",{d:"M343.91 141.9h1.12v31.82h-1.12zM328.69 113.58h1.12v16.86h-1.12zM328.69 136.76h1.12v27.4h-1.12zM358.96 136.59h1.12v27.4h-1.12zM358.96 111.13h1.12v13.7h-1.12zM312.75 150.29h1.12v24.6h-1.12zM369.93 169.87h1.12v13.81h-1.12z",className:"cls-15"})),te.createElement("path",{d:"m405.93 328.41-1-.45a70.91 70.91 0 0 0-3.49-63.5l1-.56a72 72 0 0 1 3.55 64.51Z",style:{fill:"url(#Degradado_sin_nombre_8-3)"}}),te.createElement("path",{d:"M289.19 350.48a71.4 71.4 0 0 1-21-50.8 73.4 73.4 0 0 1 .76-10.49l1.11.16a71 71 0 0 0-.75 10.33 70.3 70.3 0 0 0 20.7 50Z",style:{fill:"url(#Degradado_sin_nombre_8-4)"}}),te.createElement("path",{d:"m404.72 307.92-1.11-.15a62.52 62.52 0 0 0-18.26-53l.78-.8a63.68 63.68 0 0 1 18.59 54Z",style:{fill:"url(#Degradado_sin_nombre_8-5)"}}),te.createElement("path",{d:"M303.16 370.33a63.14 63.14 0 0 1-34.45-34.28 65 65 0 0 1-3-8.82l1.09-.27a63 63 0 0 0 2.9 8.66 62 62 0 0 0 33.85 33.67Z",style:{fill:"url(#Degradado_sin_nombre_8-6)"}})),m||(m=te.createElement("path",{d:"M157.21 336.91s4.65.72 5.79.49 4.62-1.1 6.12-.68 2.73-.31 2.76.49-2.6 1.86-4.28 1.87c0 0 7.55 1.62 8.43 1.74s2.24 2.86 1.78 3.88-6.88 4-8.26 4.07-14.16-4.77-14.16-4.77Z",className:"cls-20"})),te.createElement("g",{id:"bulb-2","data-name":"bulb"},te.createElement("path",{d:"M388 461.73c.8 2.41 5.2 24.78-17.2 30.81-14.48 3.91-17.48-6.68-37.87-3.31l-3.12-11.58-.13-.47-3.12-11.59c19.33-7.33 16.75-17.44 31.24-21.34 22.37-6.03 29.66 14.99 30.2 17.48",style:{fill:"url(#linear-gradient-3)"}}),te.createElement("path",{d:"M309.88 471.58h24.37v11.73a4.18 4.18 0 0 1-4.18 4.18h-16a4.18 4.18 0 0 1-4.18-4.18v-11.73Z",style:{fill:"url(#Degradado_sin_nombre_20)"},transform:"rotate(74.93 322.058 479.529)"}),d||(d=te.createElement("path",{d:"m326.567 465.703 6.336 23.532-11.327 3.05a4.18 4.18 0 0 1-5.123-2.95l-4.16-15.45a4.18 4.18 0 0 1 2.95-5.122l11.326-3.05Z",className:"cls-8"})),te.createElement("rect",{width:27.9,height:4.33,x:311.68,y:476.35,rx:1.48,style:{fill:"url(#Degradado_sin_nombre_8-7)"},transform:"rotate(-105.07 325.641 478.514)"}),te.createElement("rect",{width:27.9,height:4.33,x:306.28,y:477.8,rx:1.48,style:{fill:"url(#Degradado_sin_nombre_8-8)"},transform:"rotate(-105.07 320.241 479.97)"}),o||(o=te.createElement("path",{d:"m311.199 487.013-2.312-8.584a3.06 3.06 0 0 1 2.16-3.75l1.361-.367 3.9 14.484-1.313.354a3.06 3.06 0 0 1-3.75-2.16Z",className:"cls-8"})),te.createElement("path",{d:"M378.42 451.38a1.79 1.79 0 1 0 2.45 1 1.87 1.87 0 0 0-2.45-1",style:{fill:"url(#Degradado_sin_nombre_5-4)"}}),te.createElement("path",{d:"M371 471.47c-4 1.52-6 5.68-4.63 9.29s5.72 5.29 9.67 3.77 6-5.68 4.62-9.29-5.73-5.24-9.66-3.77",style:{fill:"url(#Degradado_sin_nombre_5-5)"}}),te.createElement("path",{d:"M374.31 451.82c-6.81-5-15.13-1.94-22.2.77-2 .76-2.86-2.46-.87-3.23 7.89-3 17.2-5.93 24.74-.43 1.72 1.26.07 4.16-1.67 2.89",style:{fill:"url(#Degradado_sin_nombre_5-6)"}}),te.createElement("path",{d:"m331.11 482.55-.34-1.25 23.35-6.3c.23-.07.47-.13.71-.18a38 38 0 0 1-1.8-5.31 9 9 0 0 1-.27-1.41L329 474.53l-.34-1.24 24.08-6.48A11.46 11.46 0 0 1 356 459c1.27-1.23 2.62-1.75 3.7-1.43a2.72 2.72 0 0 1 1.77 2.29c1 4.79-4.21 7.26-7.13 7.9l-.28.07a9 9 0 0 0 .26 1.42 37 37 0 0 0 1.84 5.37c5.63-1 9.69.31 10.39 2.4.17.49.47 2.18-2.42 3.33a5.8 5.8 0 0 1-4.91 0 9.1 9.1 0 0 1-3.78-4.26l-.94.23Zm25.6-6.78a7.64 7.64 0 0 0 3 3.37 4.53 4.53 0 0 0 3.86 0c1.25-.5 1.88-1.15 1.68-1.73-.36-1.19-3.48-2.5-8.54-1.64m2.29-17.06a3.47 3.47 0 0 0-2.13 1.17 10.1 10.1 0 0 0-2.87 6.58c.32-.07 7.2-1.64 6.17-6.38-.11-.52-.35-1.17-.88-1.33a1.4 1.4 0 0 0-.29-.04",style:{fill:"url(#radial-gradient-2)"}})),h||(h=te.createElement("g",{id:"etc"},te.createElement("path",{d:"M365.64 362.67a4.85 4.85 0 1 0 4.85-4.85 4.85 4.85 0 0 0-4.85 4.85ZM281.45 261a3.39 3.39 0 1 0 3.39-3.39 3.38 3.38 0 0 0-3.39 3.39Z",className:"cls-29"}),te.createElement("path",{d:"M298.64 273.2v5.07M300.92 275.73h-4.56M407.75 253.01v5.07M410.03 255.55h-4.56M318.24 436.41v8.1M321.88 440.46h-7.29",className:"cls-30"}))),te.createElement("g",{id:"plant_3","data-name":"plant 3"},te.createElement("path",{d:"M306.27 485.79s-.77-27.15-10.13-29.16-10.69 16.94 0 35.65Z",style:{fill:"url(#linear-gradient-4)"}}),p||(p=te.createElement("path",{d:"M301.43 489.05a.17.17 0 0 1-.16-.12c-4.46-18.32-6.38-25.06-6.4-25.12a.17.17 0 0 1 .11-.2.16.16 0 0 1 .2.11c0 .06 1.94 6.81 6.4 25.14a.16.16 0 0 1-.11.19Z",className:"cls-6"})),te.createElement("path",{d:"M309.51 492.28s14.26-13.81 8.91-20.5-18.72 4.9-22.28 20.5Z",style:{fill:"url(#linear-gradient-5)"}}),f||(f=te.createElement("path",{d:"M303.94 490.43h-.06a.16.16 0 0 1-.09-.21c3.54-8.18 10.44-14.69 10.51-14.76a.17.17 0 0 1 .22 0 .17.17 0 0 1 0 .23c-.07.06-6.93 6.53-10.44 14.65a.14.14 0 0 1-.14.09",className:"cls-6"})),te.createElement("path",{d:"M297.44 492.28s-3.64-15.71-11-14.37 0 14.26 0 14.26Z",style:{fill:"url(#linear-gradient-6)"}}),E||(E=te.createElement("path",{d:"M290.24 490.32a.16.16 0 0 1-.16-.12l-2.45-9.13a.16.16 0 0 1 .11-.19.15.15 0 0 1 .2.11l2.45 9.13a.17.17 0 0 1-.11.2Z",className:"cls-6"}))),te.createElement("g",{id:"plant_1","data-name":"plant 1"},te.createElement("path",{d:"M227.81 372.46c-1-4.25-4.31-7.48-7.2-10.75-10.63-12-16.76-27.27-22.69-42.18a87.37 87.37 0 0 1 30.5 51.47Z",style:{fill:"url(#Degradado_sin_nombre_40)"}}),g||(g=te.createElement("path",{d:"M228.36 371.44c-.42-3.42-2.19-6.33-3.91-9.25-2.16-3.66-4.49-7.21-6.83-10.75-4.66-7.07-9.32-14.16-12.7-21.95-.11-.25-.47 0-.36.21 3.12 7.19 7.32 13.79 11.62 20.32 2.15 3.27 4.33 6.53 6.39 9.87 2.17 3.53 4.86 7.35 5.37 11.55 0 .26.46.27.42 0",className:"cls-6"})),x||(x=te.createElement("path",{d:"M185.28 356.76s36.39 15.33 36.13 96",className:"cls-35"})),y||(y=te.createElement("path",{d:"M222.7 467.66s-10-70.49 24.93-73.37",className:"cls-35"})),te.createElement("path",{d:"M276.37 387.55c.26.91 1.52 9.3-6.9 11.17-5.45 1.21-6.39-2.78-14-1.86l-1-4.36v-.18l-1-4.35c7.3-2.4 6.51-6.21 12-7.41 8.39-1.87 10.75 6.06 10.9 6.99",style:{fill:"url(#linear-gradient-7)"}}),te.createElement("path",{d:"M247 390.12h9.06V392a4 4 0 0 1-4 4h-1a4 4 0 0 1-4-4v-1.87z",style:{fill:"url(#Degradado_sin_nombre_20-2)"},transform:"rotate(77.49 251.579 393.068)"}),u||(u=te.createElement("path",{d:"m253.485 387.98 1.962 8.845-4.285.95a1.52 1.52 0 0 1-1.814-1.154l-1.3-5.858a1.52 1.52 0 0 1 1.155-1.813l4.296-.953Z",className:"cls-8"})),te.createElement("path",{d:"m251.19 388.65 1.9 8.56a.8.8 0 0 0 1 .61.82.82 0 0 0 .61-1l-1.9-8.56a.8.8 0 0 0-1-.61.79.79 0 0 0-.61 1",style:{fill:"url(#Degradado_sin_nombre_8-9)"}}),te.createElement("path",{d:"m249.16 389.1 1.9 8.56a.8.8 0 0 0 1 .61.82.82 0 0 0 .61-1l-1.9-8.56a.81.81 0 0 0-1-.61.79.79 0 0 0-.61 1",style:{fill:"url(#Degradado_sin_nombre_8-10)"}}),M||(M=te.createElement("path",{d:"m246.82 393 .49 2.21a1.66 1.66 0 0 0 2 1.26l-1.23-5.47a1.65 1.65 0 0 0-1.26 2",className:"cls-8"})),te.createElement("path",{d:"M273 383.55a.66.66 0 1 0 .42 1.25.66.66 0 1 0-.42-1.25",style:{fill:"url(#Degradado_sin_nombre_5-7)"}}),te.createElement("path",{d:"M269.89 390.89a2.62 2.62 0 1 0 3.53 1.56 2.73 2.73 0 0 0-3.53-1.56",style:{fill:"url(#Degradado_sin_nombre_5-8)"}}),te.createElement("path",{d:"M271.45 383.65c-2.44-2-5.59-1-8.26-.09-.76.25-1-1-.27-1.21 3-1 6.49-1.92 9.2.25.62.49 0 1.55-.67 1Z",style:{fill:"url(#Degradado_sin_nombre_5-9)"}}),te.createElement("path",{d:"m254.9 394.38-.12-.54 8.78-1.95.22-.05a14 14 0 0 1-.57-2 4 4 0 0 1-.07-.49l-8.91 2-.12-.55 9-2a4.3 4.3 0 0 1 1.36-2.86 1.52 1.52 0 0 1 1.44-.48 1 1 0 0 1 .64.91c.31 1.83-1.7 2.67-2.81 2.86h-.07a3 3 0 0 0 .07.49 14 14 0 0 0 .58 2c2.12-.28 3.6.3 3.83 1.1.06.19.15.85-1 1.25a2.18 2.18 0 0 1-1.86-.1 3.36 3.36 0 0 1-1.33-1.63l-.32.06Zm9.67-2.1a2.8 2.8 0 0 0 1 1.24 1.65 1.65 0 0 0 1.4.05c.34-.12.69-.34.63-.57-.09-.42-1.18-.93-3.03-.72m1.05-6.29a1.3 1.3 0 0 0-.76.39 3.7 3.7 0 0 0-1.16 2.32c.38-.08 2.6-.59 2.32-2.21 0-.19-.11-.42-.28-.48Z",style:{fill:"url(#radial-gradient-3)"}}),te.createElement("path",{d:"M213.28 291.25c.82-.47 8.65-3.71 12.5 4 2.48 5-1.16 6.87 1.57 14.06l-4 2-.16.08-4 2c-4.09-6.51-7.58-4.83-10.07-9.82-3.84-7.75 3.29-11.95 4.16-12.32",style:{fill:"url(#linear-gradient-8)"}}),te.createElement("path",{d:"M220.08 311h9.06v1.87a4 4 0 0 1-4 4h-1a4 4 0 0 1-4-4V311z",style:{fill:"url(#Degradado_sin_nombre_20-3)"},transform:"rotate(-26.44 224.66 314.039)"}),_||(_=te.createElement("path",{d:"m219.237 313.308 8.112-4.035 2.29 4.602a.78.78 0 0 1-.351 1.046l-6.724 3.345a.78.78 0 0 1-1.046-.351l-2.29-4.602z",className:"cls-8"})),te.createElement("path",{d:"m220.41 315.43 7.85-3.91a.81.81 0 0 0 .36-1.08.81.81 0 0 0-1.08-.36l-7.85 3.92a.8.8 0 0 0-.36 1.08.8.8 0 0 0 1.08.35",style:{fill:"url(#Degradado_sin_nombre_8-11)"}}),te.createElement("path",{d:"m221.33 317.29 7.85-3.9a.82.82 0 0 0 .37-1.08.83.83 0 0 0-1.09-.37l-7.84 3.91a.81.81 0 0 0-.37 1.08.8.8 0 0 0 1.08.36",style:{fill:"url(#Degradado_sin_nombre_8-12)"}}),v||(v=te.createElement("path",{d:"m225.64 318.63 2-1a1.67 1.67 0 0 0 .75-2.23l-5 2.49a1.66 1.66 0 0 0 2.25.74",className:"cls-8"})),te.createElement("path",{d:"M210.21 295.5a.66.66 0 1 0 .17-1 .69.69 0 0 0-.17 1",style:{fill:"url(#Degradado_sin_nombre_5-10)"}}),te.createElement("path",{d:"M218.08 296.74a2.61 2.61 0 1 0 .66-3.8 2.73 2.73 0 0 0-.66 3.8",style:{fill:"url(#Degradado_sin_nombre_5-11)"}}),te.createElement("path",{d:"M210.67 297c-1.31 2.85.4 5.66 1.91 8 .42.68-.69 1.23-1.11.56-1.69-2.66-3.43-5.84-2-9 .33-.72 1.51-.33 1.18.39Z",style:{fill:"url(#Degradado_sin_nombre_5-12)"}}),te.createElement("path",{d:"m221.81 312.07-4.11-8.27a4.36 4.36 0 0 1-3.11-.63 1.53 1.53 0 0 1-.81-1.28 1.07 1.07 0 0 1 .73-.85c1.7-.74 3 1 3.46 2v.07a5 5 0 0 0 .46-.19 14.5 14.5 0 0 0 1.79-1c-.79-2-.58-3.57.14-4 .18-.1.79-.35 1.45.65a2.22 2.22 0 0 1 .36 1.83 3.4 3.4 0 0 1-1.27 1.69c0 .1.09.2.14.29l4 8.06-.5.24-4-8.05-.1-.2a14 14 0 0 1-1.76 1 3 3 0 0 1-.46.19l4.06 8.17Zm-6.48-10.65a1.4 1.4 0 0 0-.59.13c-.18.08-.38.21-.4.39s.2.51.57.77a3.74 3.74 0 0 0 2.53.56c-.14-.27-.92-1.85-2.11-1.85m5.45-3a.2.2 0 0 0-.11 0c-.38.21-.61 1.41 0 3.14a2.75 2.75 0 0 0 .95-1.3 1.66 1.66 0 0 0-.29-1.37c-.13-.26-.33-.5-.55-.5Z",style:{fill:"url(#radial-gradient-4)"}}),te.createElement("path",{d:"M160.9 339c.48-.79 5.66-7.32 12.64-2.52 4.52 3.1 2.29 6.44 8.05 11.31l-2.48 3.62-.1.14-2.48 3.61c-6.61-3.63-8.82-.52-13.33-3.62-6.99-4.81-2.87-11.81-2.3-12.54",style:{fill:"url(#linear-gradient-9)"}}),te.createElement("path",{d:"M177 350.19h8.9V352a4 4 0 0 1-4 4h-.9a4 4 0 0 1-4-4v-1.83z",style:{fill:"url(#Degradado_sin_nombre_20-4)"},transform:"rotate(-55.52 181.487 353.106)"}),N||(N=te.createElement("path",{d:"m176.543 355.134 5.038-7.337 3.075 2.112a2.08 2.08 0 0 1 .537 2.892l-2.672 3.89a2.08 2.08 0 0 1-2.892.538l-3.075-2.112z",className:"cls-8"})),te.createElement("path",{d:"m178.55 356.34 4.88-7.1a.79.79 0 0 0-.21-1.1.8.8 0 0 0-1.1.21l-4.87 7.1a.79.79 0 0 0 .2 1.1.8.8 0 0 0 1.1-.21",style:{fill:"url(#Degradado_sin_nombre_8-13)"}}),te.createElement("path",{d:"m180.24 357.5 4.87-7.1a.79.79 0 0 0-.2-1.1.79.79 0 0 0-1.1.2l-4.88 7.1a.8.8 0 0 0 .21 1.1.79.79 0 0 0 1.1-.2",style:{fill:"url(#Degradado_sin_nombre_8-14)"}}),b||(b=te.createElement("path",{d:"m184.57 356.6 1.26-1.83a1.63 1.63 0 0 0-.43-2.27l-3.1 4.5a1.64 1.64 0 0 0 2.27-.4",className:"cls-8"})),te.createElement("path",{d:"M160.29 344.1a.67.67 0 0 0 .93-.23.71.71 0 0 0-1.25-.68.68.68 0 0 0 .32.91",style:{fill:"url(#Degradado_sin_nombre_5-13)"}}),te.createElement("path",{d:"M167.63 341.41a2.57 2.57 0 1 0-1.24-3.58 2.68 2.68 0 0 0 1.24 3.58",style:{fill:"url(#Degradado_sin_nombre_5-14)"}}),te.createElement("path",{d:"M161.38 345.14c.24 3.07 3.05 4.67 5.48 6 .69.38 0 1.38-.69 1-2.71-1.48-5.73-3.38-6-6.78-.06-.77 1.14-1 1.19-.22Z",style:{fill:"url(#Degradado_sin_nombre_5-15)"}}),te.createElement("path",{d:"m178.15 352.79-7.47-5.13a4.3 4.3 0 0 1-3 .94 1.49 1.49 0 0 1-1.31-.72 1 1 0 0 1 .22-1.08c1.11-1.45 3.07-.57 3.95.1h.05a4 4 0 0 0 .31-.37 13 13 0 0 0 1-1.75c-1.62-1.33-2.2-2.79-1.77-3.49.1-.17.51-.68 1.56-.13a2.17 2.17 0 0 1 1.18 1.39 3.37 3.37 0 0 1-.28 2.06l.26.18 7.28 5-.32.46-7.28-5-.17-.12a14 14 0 0 1-1 1.71 4 4 0 0 1-.3.38l7.38 5.07Zm-9.91-6.22a1.4 1.4 0 0 0-1.17.57c-.11.15-.23.35-.16.52a1.07 1.07 0 0 0 .86.38 3.63 3.63 0 0 0 2.43-.72 4 4 0 0 0-1.96-.75m2.66-5.06a.24.24 0 0 0-.23.11c-.22.35.16 1.5 1.52 2.66a2.64 2.64 0 0 0 .2-1.55 1.63 1.63 0 0 0-.9-1 1.5 1.5 0 0 0-.59-.22",style:{fill:"url(#radial-gradient-5)"}}),k||(k=te.createElement("path",{d:"M225.72 318.81c8.47 26.24-1.55 89-4.61 117.6",className:"cls-35"})),te.createElement("path",{d:"M226.43 321.94s-15.15-3.08-11.11-7.51 8 3.12 8 3.12-4.46-6.29-.74-7.24 4.73 6.5 4.73 6.5-.88-9.46 2.84-8.57 2.85 10.76-3.72 13.7",style:{fill:"url(#Degradado_sin_nombre_40-2)"}}),te.createElement("path",{d:"M244.35 394s5.11-14.59 8.94-10-4.18 7.54-4.18 7.54 6.83-3.56 7.27.25-7.09 3.8-7.09 3.8 9.5.42 8.12 4-11.04 1.31-13.06-5.59",style:{fill:"url(#Degradado_sin_nombre_40-3)"}}),te.createElement("path",{d:"M188.24 359.24s-14.49 5.39-13.4-.5 8.48-1.6 8.48-1.6-7.11-3-4.45-5.75 7.45 3 7.45 3-5.75-7.58-2.12-8.79 8.03 7.69 4.04 13.64",style:{fill:"url(#Degradado_sin_nombre_40-4)"}}),te.createElement("path",{d:"M220.14 426.62c-9.21-3.56-14.26-13.32-18-22.47s-7.34-19.15-15.52-24.66c6.61.16 12.41 4.79 16 10.35s5.33 12.05 7.43 18.31 10.09 18.47 10.09 18.47",style:{fill:"url(#Degradado_sin_nombre_40-5)"}}),te.createElement("path",{d:"M214.91 392.54",style:{fill:"url(#Degradado_sin_nombre_40-6)"}}),te.createElement("path",{d:"M213.28 393.93c-4.34-10-7.93-20.52-9.16-31.39s0-22.21 5-32a53.8 53.8 0 0 1 5.81 40c-1.76 7-4.94 14.38-2.33 21.12",style:{fill:"url(#Degradado_sin_nombre_40-7)"}}),te.createElement("path",{d:"M226.29 392.68c6.91-10.41 7.52-23.64 11.55-35.47a63.15 63.15 0 0 1 13.88-23c-1.71 10.9-2.26 22.06-5.43 32.63s-9.54 20.85-19.54 25.52",style:{fill:"url(#Degradado_sin_nombre_40-8)"}}),te.createElement("path",{d:"M223.75 422.18c.84-5 5.51-8.49 10.34-9.9s10-1.2 15-1.72 10.27-2 13.55-5.78c-.18 6.29-5 11.78-10.85 14.2s-12.39 2.26-18.61 1.25c-3.1-.51-6.67-1.09-9 1",style:{fill:"url(#Degradado_sin_nombre_40-9)"}}),j||(j=te.createElement("path",{d:"M223.94 422.28c6-11.16 22.37 2.47 29.49-7.61.16-.23-.2-.44-.36-.22-7 9.92-23.38-3.75-29.5 7.62-.12.24.24.45.37.21M225.35 393.25a20.64 20.64 0 0 0 7.66-6.69 71.4 71.4 0 0 0 7-11.39c3.78-7.89 4.47-16.76 5.1-25.36 0-.27-.4-.27-.42 0-.63 8.54-1.31 17.3-5.05 25.15a73.5 73.5 0 0 1-6 10c-2.27 3.28-4.84 6.22-8.52 7.94-.24.12 0 .48.22.37ZM211.7 389.75a118.9 118.9 0 0 1-2.6-39.62c0-.26-.4-.26-.42 0a119.6 119.6 0 0 0 2.61 39.73c.06.27.47.16.41-.11M220.25 426.44c-4.32-3.08-9.2-6.39-11.11-11.56-1.3-3.52-2.31-7.15-3.5-10.7-2.14-6.38-4.66-15.71-10.79-19.48a.21.21 0 0 0-.21.36c3.37 2.08 5.32 6.1 6.91 9.59a120 120 0 0 1 4.84 13.18 75 75 0 0 0 2.92 8.62c2.1 4.48 6.82 7.57 10.72 10.35.22.16.43-.2.22-.36",className:"cls-6"})),te.createElement("path",{d:"m258.64 449.98-1.46 7.12-6.21 30.63h-57.09l-6.21-30.63-1.46-7.12z",style:{fill:"url(#linear-gradient-10)"}}),te.createElement("path",{d:"M258.64 447.03v2.95l-1.46 7.12h-69.51l-1.46-7.12v-2.95z",style:{opacity:.54,fill:"url(#linear-gradient-11)"}}),te.createElement("path",{d:"M179.63 440.64h83.38v12.23h-83.38z",style:{fill:"url(#linear-gradient-12)"}}),te.createElement("path",{d:"M258.04 452.87h-25.83l-38.33 34.86h57.09z",style:{opacity:.54,fill:"url(#linear-gradient-13)"}})),te.createElement("g",{id:"gear"},Z||(Z=te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72"})),te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72",style:{mixBlendMode:"multiply"}}),w||(w=te.createElement("path",{d:"M395.32 443.07h6.9a24 24 0 0 0 2 4.84l-4.87 4.88 9.41 9.42 4.88-4.88a23.4 23.4 0 0 0 4.84 2v6.9h13.32v-6.9a23.4 23.4 0 0 0 4.84-2l4.88 4.88 9.42-9.42-4.88-4.88a23.4 23.4 0 0 0 2-4.84H455v-13.32h-6.9a23.4 23.4 0 0 0-2-4.84l4.88-4.88-9.42-9.41-4.88 4.87a24 24 0 0 0-4.84-2v-6.9h-13.36v6.9a24 24 0 0 0-4.84 2l-4.88-4.87-9.41 9.38 4.87 4.88a24 24 0 0 0-2 4.84h-6.9Zm20.13-.22c-6.22-11.06 5.07-22.35 16.13-16.13a8.46 8.46 0 0 1 3.25 3.25c6.22 11.06-5.07 22.35-16.13 16.13a8.6 8.6 0 0 1-3.25-3.25",className:"cls-72"}))),te.createElement("g",{id:"plant_4","data-name":"plant 4"},z||(z=te.createElement("path",{d:"M465.23 448.93V454M467.51 451.47h-4.56",className:"cls-74"})),te.createElement("path",{d:"M473.27 468.5c1.11.49 41.23-50.82 27.81-54.18s-14.23-8.6-7.27-17.94-5.87-11.08-12.16-6.68 6.72-15.81.29-18.1-12.12 6-11 18.06-8.68-2.05-10.68 4.63 12.08 20.84 2.95 20.94-15.63 1.45-10.06 14.93 20.12 38.34 20.12 38.34",style:{fill:"url(#Degradado_sin_nombre_8-15)"}}),D||(D=te.createElement("path",{d:"M489.75 422.12a.23.23 0 0 0-.32-.07 53.7 53.7 0 0 0-16.1 17.82c.05-8.66.2-18.22.56-27.06A58.5 58.5 0 0 1 485 397.7a.24.24 0 1 0-.32-.35 58.8 58.8 0 0 0-10.77 14.34c.53-12.29 1.49-23 3.14-27.76a.24.24 0 0 0-.15-.3.23.23 0 0 0-.3.14c-1.28 3.67-2.15 10.92-2.72 19.7a26.9 26.9 0 0 0-8.88-6.1.23.23 0 0 0-.31.13.23.23 0 0 0 .12.31 26.1 26.1 0 0 1 9 6.32c-.17 2.73-.32 5.6-.44 8.55a.22.22 0 0 0 0 .16c-.24 5.92-.39 12.16-.48 18.24-1.41-2.09-6.3-8.65-13-10.41a.24.24 0 0 0-.12.46c7.56 2 12.77 10.2 13.15 10.81 0 3-.07 6-.08 8.82a.3.3 0 0 0 0 .13c-.07 15.16.17 27.32.18 27.61a.22.22 0 0 0 .14.21.17.17 0 0 0 .1 0 .24.24 0 0 0 .23-.25c0-.29-.25-12.47-.18-27.63a53.4 53.4 0 0 1 16.36-18.41.24.24 0 0 0 .08-.3",className:"cls-6"})),te.createElement("path",{d:"M415.3 362.18c7-2 4.06 10.29 9.51 19.07.94 1.12 1.85 2.28 2.72 3.46-.43-2.41-.34-5.9.73-6.67 2.8-2 2.33 2.91 2.11 4a16.7 16.7 0 0 1-1.56 4.41c1.19 1.69 2.32 3.42 3.39 5.16-.11-.58-.2-1.12-.28-1.49-.63-2.91-1.36-8.9 2.27-8.91 4.58 0 .34 9.89-.39 13 .11.18 1.62 2.85 2.24 4-.35-3.7.18-10 3.33-10.16 6.66-.32-1.65 7.84-2.43 11.67 1.06 2.14 2.5 5.5 3.39 7.72a14.1 14.1 0 0 1 .56-6.09c1-2.5 3.53-4.66 4.27-1.1.43 2.06-1.06 3.84-2 5.61a25.6 25.6 0 0 0-1.77 4.31c.73 2 1.4 4 2 6.09 0-3 .39-6.19 2-8.39 3.1-4.2 6.55-.48 6.05 3.32s-5.1 6-7.12 8.65q.68 2.81 1.15 5.65c.9-3.08 1.85-6.45 4.26-8.53s7.21-1.82 6.54 2c-.83 4.65-7.87 4.77-10.63 7.52q.6 3.81.94 7.7a23.2 23.2 0 0 1 3.21-6.24c2.26-2.92 5.71-1.07 5.64 2.19-.09 4.66-6 5.22-8.61 7.28.09 1.39.15 2.78.2 4.19.06 1.61.14 3.85.2 5.46 1.08-2.58 2.79-5.76 4.44-6.84 3.42-2.25 6.33.85 4.14 4.17-2.09 3.15-6.3 3-8.47 5.49.11 2.26.26 4.52.47 6.77 1.86-3.83 5.81-7.57 9.24-7.83 3.77-.29 5.09 2.77 2.49 5.41-1.87 1.9-8.63 2.66-11.48 4.8a75 75 0 0 0 1.3 7.7c.3 1.3-1.74 2-2.13.71a47 47 0 0 1-1.28-5.52c-.22-2.43-2.25-2.85-4.09-3.64-2.12-.91-12.58 2.26-9.47-5.75 2.63-6.77 9.93 1.05 13 5.2-.17-1.6-.29-3.2-.38-4.8a7.05 7.05 0 0 0-3.52-3.79c-3.23-1.85-16.65-1.83-14.5-8.27 3.35-10.06 16.14 6.23 17.95 10.83-.13-2.78-.31-9.37-.33-9.9a9.3 9.3 0 0 0-4.17-3.5c-2.07-.9-8.81-3.1-7.16-6.79s6.66.45 7.66 2a32.6 32.6 0 0 1 3.58 6.29c-.14-2.89-.35-5.77-.67-8.62-6-5.68-18.37-5.41-14.95-11 3.87-6.4 9.19 6.07 14.82 9.94a92 92 0 0 0-1.6-9.3c-.72-.35-1.78-1.26-3.17-1.9-3.12-1.43-9.59-1.38-10-5-.53-5 4-4.44 6.7-2.61 2.95 2 4.35 5 6 7.85v-.11a98 98 0 0 0-3-9.68c-4.17-2.2-15.66-1-12.44-7.15 2.5-4.76 9.6 2.73 12.13 6.32q-1.74-4.65-3.91-9.11c-.54.23-1.45-.56-3.47-.84-2.81-.38-8.43-.22-8.83-4.09-.28-2.71 4.13-2.32 6.08-1.46 2.2 1 3.77 3.42 5.5 5-.3-.6-3.49-6.4-4.88-8.63-4.34-1.66-16.57-3.37-14.59-7.65 2.22-4.82 9.95 2.61 13.8 6.39-.48-.74-4.23-6.38-5.19-7.63a33.2 33.2 0 0 1-10.31-6.9c-2.31-2.42-5.53-9.1 2.77-11.44",style:{fill:"url(#linear-gradient-17)"}}),te.createElement("path",{d:"M470.21 472.07q-.29-.27-.54-.54c-.09.41.1.58.54.54",style:{fill:"#c54f28"}}),te.createElement("path",{d:"M524.62 388.66c-4-14.33-17.29-6.28-22.88 6.09-1.69 3.72-4 10.71-6.74 19-6.33 19.17-14.84 45.29-22.67 54-1.69 1.9-2.52 3.12-2.66 3.75q.25.27.54.54a10.1 10.1 0 0 0 3.14-1.42c9.72-5.78 23.34-20.58 34.19-36.54 11.53-16.96 19.92-35.26 17.08-45.42",style:{fill:"#201b51"}}),G||(G=te.createElement("path",{d:"M469.66 471.55c-.13.65.48.68 1.62.19 30.3-26.21 45.9-84.21 46-84.4a.6.6 0 1 0-1.15-.31c-.13.19-15.92 58.97-46.47 84.52",className:"cls-79"})),te.createElement("path",{d:"M540.15 432.18c-7.31-2.2-20.23 3-32.79 10.71-13.74 8.44-27 19.89-32.07 28-1.93 3.09-1.65 4.16 2.22.84 10-8.54 47.77-17.59 57.51-21.75a25 25 0 0 0 3.29-1.71c7.75-4.81 11.69-13.13 1.84-16.09",style:{fill:"#598ac7"}}),C||(C=te.createElement("path",{d:"M474.52 473.72c-.51.1-.52-.38-.11-1.26 21-23.23 66.5-34.45 66.65-34.49a.46.46 0 0 1 .56.34.46.46 0 0 1-.34.57c-.14.04-46.28 11.41-66.76 34.84",className:"cls-79"}))),te.createElement("g",{id:"bulb-3","data-name":"bulb"},te.createElement("path",{d:"M431.69 458.93c-.65 1.93-4.16 19.87 13.79 24.69 11.61 3.12 14-5.36 30.35-2.68l2.5-9.28.1-.38 2.49-9.28c-15.49-5.87-13.43-14-25-17.09-17.99-4.82-23.82 12.02-24.23 14.02",style:{fill:"url(#linear-gradient-18)"}}),te.createElement("path",{d:"M478.94 466.79h11.16a4.18 4.18 0 0 1 4.18 4.18v8.57h-19.52V471a4.18 4.18 0 0 1 4.18-4.21",style:{fill:"url(#Degradado_sin_nombre_20-5)"},transform:"rotate(105.03 484.52 473.201)"}),H||(H=te.createElement("path",{d:"m492.158 469.475-2.894 10.779a4.18 4.18 0 0 1-5.121 2.953l-8.277-2.223 5.062-18.852 8.248 2.215a4.18 4.18 0 0 1 2.982 5.128",className:"cls-8"})),te.createElement("path",{d:"m485.79 463.68-4.9 18.24a1.74 1.74 0 0 1-2.13 1.23 1.74 1.74 0 0 1-1.23-2.13l4.9-18.24a1.74 1.74 0 0 1 2.13-1.23 1.74 1.74 0 0 1 1.23 2.13",style:{fill:"url(#Degradado_sin_nombre_8-16)"}}),te.createElement("path",{d:"m490.11 464.84-4.9 18.25a1.73 1.73 0 0 1-2.12 1.22 1.74 1.74 0 0 1-1.23-2.13l4.9-18.24a1.74 1.74 0 0 1 2.13-1.22 1.73 1.73 0 0 1 1.22 2.12",style:{fill:"url(#Degradado_sin_nombre_8-17)"}}),S||(S=te.createElement("path",{d:"m494.78 473.36-1.26 4.69a3.58 3.58 0 0 1-4.39 2.54l3.12-11.59a3.58 3.58 0 0 1 2.53 4.36",className:"cls-8"})),te.createElement("path",{d:"M439.35 450.63a1.43 1.43 0 1 1-1 2.66 1.43 1.43 0 1 1 1-2.66",style:{fill:"url(#Degradado_sin_nombre_5-16)"}}),te.createElement("path",{d:"M445.31 466.73a5.63 5.63 0 1 1-7.74 3 5.89 5.89 0 0 1 7.74-3",style:{fill:"url(#Degradado_sin_nombre_5-17)"}}),te.createElement("path",{d:"M442.63 451c5.46-4 12.13-1.57 17.8.6 1.61.61 2.29-2 .69-2.59-6.32-2.42-13.78-4.74-19.82-.33-1.38 1-.06 3.33 1.33 2.32",style:{fill:"url(#Degradado_sin_nombre_5-18)"}}),te.createElement("path",{d:"m477.24 475.71-18.71-5-.65-.16a7.3 7.3 0 0 1-3 3.38 4.74 4.74 0 0 1-4 0c-2.42-1-2.16-2.4-2-2.82.58-1.72 3.84-2.84 8.37-2a28 28 0 0 0 1.43-4.19 7 7 0 0 0 .19-1h-.14c-2.36-.51-6.64-2.53-5.79-6.47a2.31 2.31 0 0 1 1.51-1.93 3.32 3.32 0 0 1 3.09 1.18 9.36 9.36 0 0 1 2.66 6.29l19.1 5.01-.33 1.25-19-5.09a7 7 0 0 1-.2 1 32 32 0 0 1-1.38 4.13l.42.11 18.71 5Zm-22.95-5.63c-2.51 0-4.06.75-4.29 1.42-.15.47.56.94 1.28 1.23a3.51 3.51 0 0 0 3 0 5.8 5.8 0 0 0 2.29-2.49 16 16 0 0 0-2.28-.16m.63-13.45a.6.6 0 0 0-.2 0c-.36.1-.54.58-.62 1-.73 3.36 3.86 4.7 4.7 4.91a8 8 0 0 0-2.25-5 2.78 2.78 0 0 0-1.63-.91",style:{fill:"url(#radial-gradient-6)"}})),te.createElement("g",{id:"lady"},T||(T=te.createElement("path",{d:"M140.45 285.27s-2.5 6.16-1.58 9.51 2.65 8.07-.71 9.36-7.19 2.64-4.95 5.14 1.4 3.92-.47 5-2.58 5 2.26 5.74c0 0-2.46 3.59-8.83.26s-8.26-17.66-5.87-22.13 13.82-18.7 20.15-12.88",className:"cls-89"})),U||(U=te.createElement("path",{d:"m58.06 471.62-1.64 3.79s-9.11-1.47-8.82-4.43l1.46-3.93Z",className:"cls-90"})),O||(O=te.createElement("path",{d:"m54.28 469.67 3.78 1.95-1.64 3.79a28 28 0 0 1-4.6-1.13Z",className:"cls-20"})),L||(L=te.createElement("path",{d:"m99.85 476.62.52 3.14a7.3 7.3 0 0 0 3 .85l.5-4.67a36 36 0 0 0-4.02.68",className:"cls-90"})),A||(A=te.createElement("path",{d:"m109 479.76.43-3.14c-.94-.94-3.41-.93-5.6-.68l-.5 4.67a14.3 14.3 0 0 0 5.67-.85",className:"cls-20"})),q||(q=te.createElement("path",{d:"M101.54 491.22s1.85-6.53 1.53-7.82a10 10 0 0 1 .39-3.75 7 7 0 0 0-3.09.11c-1.43.64-3.09 11.59-2.62 12.73S109 493.8 113 494s15.28-.88 15.47-1.4a3.8 3.8 0 0 0 .07-1.17c-.21 0-9.22.26-12 .78s-15-.99-15-.99",className:"cls-91"})),P||(P=te.createElement("path",{d:"M115.84 484.85c-2.33-.09-6.81-5.09-6.81-5.09-1.12-.9-3.09.31-3.09.31s-1.17-.27-2.48-.42a10 10 0 0 0-.39 3.75c.32 1.29-1.53 7.82-1.53 7.82s12.28 1.57 15.06 1 11.76-.77 12-.78c0-.48-.07-.9-.07-.9-.84-5.16-10.36-5.54-12.69-5.69",className:"cls-92"})),V||(V=te.createElement("path",{d:"M58.06 483.83c-1.11-1.46-6.39-1.64-6.39-1.64l3-.57a10 10 0 0 1-3.07-3.82c-.78-2.14.72-4.52.72-4.52-1.83-1.12-4.12-2.51-4.43-2.64-.53-.23-5.44 3.71-6.06 6.54s11.15 13.33 13 14.13a7.8 7.8 0 0 0 2.05.36s2.29-6.38 1.18-7.84",className:"cls-91"})),F||(F=te.createElement("path",{d:"M65.58 491.55c.45-.14.21-1.87.21-1.87-.35-5.14-6.77-8-7.58-8s-1.75-6.35-1.75-6.35c-.34-1.82-1.74-.58-1.74-.58l-2.37-1.44s-1.5 2.38-.72 4.52a10 10 0 0 0 3.07 3.82l-3 .57s5.28.18 6.39 1.64-1.09 7.81-1.09 7.81a59 59 0 0 0 8.58-.12",className:"cls-92"})),R||(R=te.createElement("path",{d:"M106.18 447.63c-2.14-7-.43-20.13 3.28-31.17s-3.9-30.46-8.85-36.36-28.46-13.71-30.88-17.93c-1.47-2.56-5.33-4.67-8.13-5.93a35.1 35.1 0 0 0 0 17.09c3.14 11.34 3.85 40.47 2.28 44s-7 12.57-8.56 23-6.29 26.7-6.29 26.7a12.5 12.5 0 0 0 4.62 3.61c.06-.09 9.09-15.2 8.09-23.74s8.71-23.13 11.57-30.84-4.86-41.66-4.86-41.66l18 23.29s11.42 15.61 11.61 20.65-3.23 14.38-2.38 26.09 4.1 32.17 4.1 32.17a20.6 20.6 0 0 0 3.71.78c.42-1.65 4.74-23.02 2.69-29.75",className:"cls-91"})),B||(B=te.createElement("path",{d:"M73.34 416.08c-2.86 7.71-12.57 22.27-11.57 30.84s-8 23.65-8.09 23.74a10.5 10.5 0 0 0 4.38 1s18.26-49.12 21.7-56.54a182 182 0 0 0 6.76-17.37l-18-23.29s7.67 33.91 4.82 41.62",className:"cls-92"})),W||(W=te.createElement("path",{d:"M109.46 476.62s7.71-59.26 5.86-70-13.14-42.84-13.14-42.84l-39-12.73a33.5 33.5 0 0 0-1.6 5.15c2.8 1.26 6.66 3.37 8.13 5.93 2.42 4.22 25.93 12 30.88 17.93s12.56 25.32 8.85 36.36-5.42 24.18-3.28 31.17c2 6.73-2.27 28.1-2.62 29.77a10.2 10.2 0 0 0 5.92-.74",className:"cls-92"})),I||(I=te.createElement("path",{d:"M121 308.63s8.7 19.78 13.41 21.14 22.84 7.14 22.84 7.14l-1.28 6.49s-24.92-2.78-30.34-5.85S113.67 326 113.67 326Z",className:"cls-93"})),te.createElement("path",{d:"M119 330.05c-4.36-1.12-12.88-18.39-12.88-18.39 11.71 19 15.94 14.47 15.57 16.14a7.3 7.3 0 0 0 1-1.39c1.14-2.07-1.7-22.75-1.7-22.75-15.34-22-31.52-1.2-32.26-.19S81.76 317.2 79.76 321 63 347.26 61.56 348.33s-2.07 3.93.85 4.92c1.09.38 3.83 2.44 7.32 5 0 0 22.88 9.28 20.6-.71S78.05 345 83 336.79l5-8.19s3.52-10.47 5-4.38 6.66 13.52 7.9 14.57l1.24 1 5.73 3.57A120 120 0 0 0 124 347c7.85 1.07 30.53.24 30.53.24l.86-7.28c-7.23.09-36.39-9.91-36.39-9.91",style:{fill:"#3258a7"}}),Y||(Y=te.createElement("path",{d:"M93.11 322.62c-1.1-6.16 2.18-12.7 2.18-12.7L88 328.6l-5 8.19c-5 8.18 5 10.75 7.33 20.75s-20.59.72-20.6.71c5.91 4.33 14 10.05 20 11.35a22 22 0 0 0 16.06-2.35s-2.21-7.78-3.43-11.78 5.45-12.07 5.45-12.07-12.75-9.91-14.7-20.78M106.08 311.66s8.52 17.27 12.88 18.39a13.6 13.6 0 0 0 2.69-2.25c.35-1.67-3.86 2.89-15.57-16.14",className:"cls-93"})),X||(X=te.createElement("path",{d:"M132.74 275s-4.49 9.74-7.72 10.5-3.47 5-3.47 5l3.22 4.18a9.16 9.16 0 0 0 3.61 2.29c10.92-3.64 16.49-19.28 16.49-19.28-3.22-5.25-7.78-4.69-12.13-2.69",className:"cls-90"})),Q||(Q=te.createElement("path",{d:"M125 285.48c3.23-.76 7.7-10.45 7.72-10.5a73 73 0 0 0-7.81 4.69c-5.57 3.53-12.33 11.85-13.18 13.66s6.66 15 7.09 11.76 5.93-10.38 5.93-10.38l-3.22-4.18s.26-4.29 3.47-5.05",className:"cls-20"})),te.createElement("path",{d:"M151.39 273.55c-1.62-.75-2.14-5.73-3.33-9.39s-14.18-9.57-29-5.9-9.71 17.8-9 21.27-7.76 2.29-5.85 5.52-.38 4.62-6.71 6.62-8.81 11.8-8.81 11.8 3.57-3.14 7.57-2.81 9.28-1.19 9.28-1.19c.09 10.19 13.9 12.95 13.9 12.95s-11-6.5-10-11.21 6.93-8.78 5.57-12.56 5.35-6.43 5.93-9 11.58-4.23 11.58-4.23c5.42 3.83 12.33 2.3 12.33 2.3l-1.37 3.22c7.35-1.16 9.52-6.64 7.91-7.39",style:{fill:"#403982"}}),J||(J=te.createElement("path",{d:"M121 279.65c-.58 2.57-7.29 5.21-5.93 9s-4.57 7.85-5.57 12.56 10 11.21 10 11.21-2.29-1.62-.62-5.71-2-3.76-3.24-7.52 5.52-3.67 3.43-7.24-.91-4.85 5-7.23 8.51-9.3 8.51-9.3-11.05 1.66-11.58 4.23M144.87 277.72s4.52-.81 5.33-2.28c0 0-2.08 4.59-6.7 5.5Z",className:"cls-89"})),$||($=te.createElement("path",{d:"m164.49 346.09 12.25-2.09c-.38-1.17-1.53-2.63-2.2-2.63-.9 0-8.59-.59-8.59-.59 1.66-.24 4.14-1.64 4-2.43s-1.26.1-2.8-.12-4.88 1.12-6 1.5-5.79.29-5.79.29l-.57 4.82c1.66.36 4.68 1 6.5 1.17a12.4 12.4 0 0 0 3.2.08",className:"cls-90"})),K||(K=te.createElement("path",{d:"M169.18 350.08c1.36-.25 7.32-4.07 7.64-5.14a1.7 1.7 0 0 0-.08-1l-12.25 2.13a12.4 12.4 0 0 1-3.19-.12c-1.82-.18-4.84-.81-6.5-1.17l-.29 2.46s13.32 3.09 14.67 2.84",className:"cls-20"}))),te.createElement("g",{id:"plant_2","data-name":"plant 2"},te.createElement("path",{d:"M166.37 424.66c-.34 1.63.16 3.57-.12 5.24-.36 2.09-1.69 2.69-2.59 4a10.8 10.8 0 0 0-1.16 7 37 37 0 0 0 1.16 4.27 10.1 10.1 0 0 1 .32 4.63c-.51 2.23-3.21 4-3.21 13.39 0 8.61 6.14 11.95 7.89 14.06v-55.81l-.79.77a4.52 4.52 0 0 0-1.5 2.45",style:{fill:"url(#linear-gradient-19)"}}),te.createElement("path",{d:"M173.55 445.18a37 37 0 0 0 1.16-4.27 10.8 10.8 0 0 0-1.16-7c-.9-1.32-2.23-1.92-2.59-4-.28-1.67.22-3.61-.12-5.24a4.52 4.52 0 0 0-1.5-2.45l-.79-.77v55.82c1.75-2.11 7.89-5.45 7.89-14.06 0-9.43-2.7-11.16-3.21-13.39a10.1 10.1 0 0 1 .32-4.64",style:{fill:"url(#linear-gradient-20)"}}),te.createElement("path",{d:"M178.19 440.62c-.58.77-.33 1.92-.85 2.72-.66 1-2.11 1-3.22 1.42a3.56 3.56 0 0 0-2.16 3.36 12.7 12.7 0 0 0 .62 2.56 2.92 2.92 0 0 1-.31 2.52c-.83 1-3.85 1.22-5.15 6.17-1.17 4.53 4.71 7.94 6.22 9.52l7.66-29.34-.92.18a3.06 3.06 0 0 0-1.89.89",style:{fill:"url(#linear-gradient-21)"}}),te.createElement("path",{d:"M182.21 444.61c-.07-.95.72-1.84.59-2.78a3 3 0 0 0-1.21-1.7l-.71-.61-7.64 29.34c2.09-.64 8.89-.75 10.07-5.27 1.29-5-1.26-6.59-1.48-7.9a2.89 2.89 0 0 1 1-2.35 13 13 0 0 0 1.78-1.93 3.55 3.55 0 0 0-.24-4c-.79-.93-2.08-1.6-2.16-2.8",style:{fill:"url(#linear-gradient-22)"}}),ee||(ee=te.createElement("path",{d:"M170.64 471.79c-2.29-3.43-16.78-6.13-16.78-6.13s4.78 5.12 4.78 8.57a15 15 0 0 1-.82 3.9 7.77 7.77 0 0 0 7.39 10.11h.45a16.5 16.5 0 0 0 1.83-5.91c0-3.33 5.43-7.11 3.15-10.54",className:"cls-91"})),ae||(ae=te.createElement("path",{d:"M185.22 478.13a15 15 0 0 1-.82-3.9c0-3.45 4.78-8.57 4.78-8.57h-35.32s14.49 2.7 16.78 6.13-3.15 7.23-3.15 10.54a16.5 16.5 0 0 1-1.83 5.91h12.17a7.77 7.77 0 0 0 7.39-10.11",className:"cls-92"})))))))}},24546:(e,a,t)=>{"use strict";t.d(a,{A:()=>R});var l,r,c,s,n,i,m,d,o,h,p,f,E,g,x,y,u,M,_,v,N,b,k,j,Z,w,z,D,G,C,H,S,T,U,O,L,A,q,P,V=t(30758);function F(){return F=Object.assign?Object.assign.bind():function(e){for(var a=1;a{let{title:a,titleId:t,...R}=e;return V.createElement("svg",F({xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 720 504","aria-labelledby":t},R),a?V.createElement("title",{id:t},a):null,l||(l=V.createElement("defs",null,V.createElement("linearGradient",{id:"linear-gradient",x1:207.67,x2:118.1,y1:267.21,y2:90.91,gradientTransform:"matrix(-1 0 0 1 347.92 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#f5995e"}),V.createElement("stop",{offset:.29,stopColor:"#f9ab60"}),V.createElement("stop",{offset:.71,stopColor:"#fdbf62"}),V.createElement("stop",{offset:1,stopColor:"#ffc663"})),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-2",x1:-156.84,x2:-246.41,y1:267.01,y2:90.71}),V.createElement("linearGradient",{id:"linear-gradient-3",x1:374.12,x2:407.66,y1:492.38,y2:337.42,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#1252c3"}),V.createElement("stop",{offset:1,stopColor:"#3f86fd"})),V.createElement("linearGradient",{id:"linear-gradient-4",x1:298.19,x2:435.3,y1:472.4,y2:472.4,gradientTransform:"matrix(-1 0 0 1 856.88 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#ff9c5c"}),V.createElement("stop",{offset:1,stopColor:"#ffc861"})),V.createElement("linearGradient",{id:"linear-gradient-5",x1:80.91,x2:93.06,y1:484.01,y2:440.77,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#f8a034"}),V.createElement("stop",{offset:1,stopColor:"#ffc546"})),V.createElement("linearGradient",{id:"linear-gradient-6",x1:78.47,x2:63.37,y1:485.6,y2:454.33,gradientTransform:"matrix(-1 0 0 1 252 0)",gradientUnits:"userSpaceOnUse"},V.createElement("stop",{offset:0,stopColor:"#fcb72c"}),V.createElement("stop",{offset:1,stopColor:"#ffcf44"})),V.createElement("linearGradient",{xlinkHref:"#linear-gradient-6",id:"linear-gradient-7",x1:97.69,x2:103.07,y1:487.56,y2:467.49}),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-8",x1:239.16,x2:257.81,y1:191.33,y2:184.55}),V.createElement("linearGradient",{xlinkHref:"#linear-gradient",id:"linear-gradient-9",x1:221.65,x2:236.53,y1:95.91,y2:90.5,gradientTransform:"rotate(-5.78 255.116 95.89)"}),V.createElement("style",null,".cls-2{fill:#fff}.cls-4{fill:#f48f59}.cls-17,.cls-5{fill:none;stroke-miterlimit:10}.cls-5{stroke:#231f20;stroke-linecap:round;stroke-width:1.17px}.cls-7{fill:#fd835a}.cls-8{fill:#201851}.cls-13{fill:#231f20}.cls-23{fill:#1150bf}.cls-17{stroke:#1150bf;stroke-width:5px}.cls-18{fill:#f45662}.cls-20{fill:#403881}.cls-21{fill:#fca080}.cls-22{fill:#e0e6ee}.cls-24{fill:#094081}.cls-25{fill:#232059}.cls-27{fill:#d07a62}"))),V.createElement("g",{style:{isolation:"isolate"}},V.createElement("g",{id:"Layer_2","data-name":"Layer 2"},V.createElement("g",{id:"Layer_1-2","data-name":"Layer 1"},r||(r=V.createElement("path",{d:"M0 0h720v504H0z",className:"cls-2"})),V.createElement("g",{id:"TREE"},V.createElement("g",{id:"tree-2","data-name":"tree"},V.createElement("path",{d:"M211.53 238.93c-29.25-1.87-63-34.92-54.1-55.37s10.94-34 1.94-47.81c-8.17-12.53 22.32-65.64 10.75-86 4.33-4.09 10.3-6.38 15.83-4.5 7 2.39 10.49 10.12 12.69 17.18a164 164 0 0 1 5.52 23.87c1.18 7.7 2 16 7 22 5.47 6.58 14.7 8.83 20.78 14.84a22.7 22.7 0 0 1 6.31 19.56c-1 6.19-4.62 11.62-7.17 17.36s-4 12.68-.89 18.14c2.76 4.8 8.32 7.17 12.18 11.14 4.93 5.07 6.76 12.63 5.88 19.65s-4.22 13.54-8.44 19.21a65 65 0 0 1-7.32 8.29 59 59 0 0 1-20.96 2.44",style:{fill:"url(#linear-gradient)"}}),c||(c=V.createElement("path",{d:"M182.68 268.61c-6.23-13.48-28.71-22.84-37.41-30.28-9.17-7.84-17.57-18.33-19.27-30.66-2-13.76 5.56-21.12 11.89-31.93 10.48-17.9-10.72-35.46-3.54-53.43 3.7-9.27 14.59-13.41 20.45-21.48 4.69-6.45 5.73-14.79 6.38-22.74s1.14-16.22 5-23.2a21.7 21.7 0 0 1 4-5.13c11.57 20.35-18.92 73.46-10.75 86 9 13.82 7 27.36-1.94 47.81s24.85 53.5 54.1 55.37a59 59 0 0 0 20.95-2.45 66 66 0 0 1-14 10.26c-12.49 6.77-27.87 10.17-35.86 21.86",className:"cls-4"}))),s||(s=V.createElement("path",{d:"M182.63 97.31v386.73M182.63 148.5l20.76-25.86M182.63 201.7l20.76-25.86M182.63 178.43l-20.76-25.86M182.63 225.89l-20.76-25.86M182.63 256.87l20.76-25.86",className:"cls-5"}))),V.createElement("g",{id:"TREE-3","data-name":"TREE"},V.createElement("g",{id:"tree-4","data-name":"tree"},V.createElement("path",{d:"M576 238.73c-29.24-1.87-63-34.93-54.09-55.38s10.94-34 1.93-47.8c-8.16-12.54 22.33-65.64 10.76-86 4.32-4.1 10.3-6.38 15.82-4.5 7 2.39 10.49 10.11 12.7 17.18a162.6 162.6 0 0 1 5.51 23.87c1.18 7.7 2 16 7 22 5.46 6.57 14.69 8.82 20.78 14.83a22.71 22.71 0 0 1 6.31 19.56c-1 6.2-4.62 11.62-7.17 17.37s-4 12.68-.89 18.13c2.75 4.8 8.32 7.17 12.18 11.14 4.93 5.07 6.76 12.64 5.88 19.66s-4.23 13.53-8.44 19.21a66 66 0 0 1-7.32 8.28 59.1 59.1 0 0 1-20.96 2.45",style:{fill:"url(#linear-gradient-2)"}}),n||(n=V.createElement("path",{d:"M547.18 268.41c-6.22-13.48-28.71-22.84-37.4-30.28-9.18-7.84-17.57-18.37-19.32-30.66-2-13.77 5.55-21.13 11.88-31.93 10.48-17.9-10.72-35.46-3.53-53.44 3.7-9.26 14.58-13.4 20.45-21.47 4.68-6.46 5.73-14.79 6.38-22.74s1.14-16.23 5-23.21a21.4 21.4 0 0 1 4-5.12c11.57 20.35-18.92 73.45-10.76 86 9 13.82 7 27.35-1.93 47.8s24.85 53.51 54.09 55.38a59.1 59.1 0 0 0 21-2.46 65.8 65.8 0 0 1-14 10.26c-12.49 6.78-27.86 10.17-35.86 21.87",className:"cls-4"}))),i||(i=V.createElement("path",{d:"M547.14 97.11v386.73M547.14 148.3l20.76-25.86M547.14 201.49l20.76-25.86M547.14 178.23l-20.77-25.86M547.14 225.69l-20.77-25.86M547.14 256.66l20.76-25.86",className:"cls-5"}))),V.createElement("g",{id:"plant"},m||(m=V.createElement("path",{d:"M415.48 384c1.49 37.9 25.34 98.74 48.34 91.61 6.06-1.87-1.72-30.12-24-55-16.09-17.97-20.3-31.13-24.34-36.61",className:"cls-7"})),d||(d=V.createElement("path",{d:"M483.43 470.86c-.14 2.39 32.95 5.43 48.3-19.57 11.95-19.47 19.37-21.22 25.78-24.67-43.51-.79-73.71 37.99-74.08 44.24",className:"cls-8"})),V.createElement("path",{d:"M495.27 419.42c-.21-2 1.86-16.68-.36-28.17-4.53 4.44-21.34 61.69-20.81 71 .19 3.42-1.82 12.86 5.36 14.56C487 478.6 501 460.31 506 447.69c16.37-41.7 4.59-39.93 18.24-63.66-5.45 3.97-26.11 27.97-28.97 35.39",style:{fill:"#413b89"}}),o||(o=V.createElement("path",{d:"M504 403.28c-2.75 4-4 8.7-6.69 12.61-2.17 3.14-2 7.1-3.5 10.13-1.65 3.25-4.55 4.92-4.72 9.49-.08 2.13.46 3.9.26 5.83-.24 2.4-1.24 4.62-1.27 7.19 0 1.79.53 3.5.58 5.21.13 4.79-7.49 12.66-1.38 17-.33 4.05.4 5.49 2.49 5.55 4.46.13 4.3-4.42 5.17-6.92 1-2.89 4.28-4.78 4.6-8.74.16-2-1-4.46-.8-6.32.16-1.39 1.46-2.16 2.2-3.34 1.91-3 2-6.53 1.78-10-.12-2-1.71-5.27-1.46-7.09.47-3.51 4.05-4.41 3-9.46-.33-1.54-1.64-3.39-1.6-4.95s1.07-2.63 1.6-4.06c1.45-3.93-.19-8.07-.26-12.13",className:"cls-7"})),V.createElement("path",{d:"M487 461.32c-4.26-.17-9.66 3.86-12.5 8.31.06-2.8.21-5.6.4-8.4 3-2.78 8.19-2 11.21-5.55 3.17-3.77 0-8-4.5-5.73-2.19 1.1-4.74 4.77-6.44 7.8.16-2 .37-4.77.53-6.77.14-1.73.26-3.46.35-5.18 3.47-2.16 10.88-2 11.66-7.72.54-4-3.43-6.79-6.64-3.52a29 29 0 0 0-4.85 7.23c.09-3.22.08-6.43-.05-9.62 3.8-3 12.48-2.12 14.17-7.73 1.37-4.58-4.46-5.65-7.77-3.39s-4.92 6.23-6.46 9.9q-.19-3.57-.61-7.13c2.86-2.91 8.83-4.88 10-9.62s-2.55-9.69-7-5c-2.32 2.48-3.25 6.32-3.69 10-.44-2.61-1-5.21-1.58-7.79a31.7 31.7 0 0 1 2.81-5.05c1.42-2 3.51-4 3.27-6.62-.4-4.48-3.85-2.19-5.41.75a17.24 17.24 0 0 0-1.5 7.51c-.78-2.87-2.07-7.21-3.06-10 1.51-4.6 12.91-13.46 4.67-14-3.91-.27-5.47 7.42-5.57 12-.59-1.53-2.08-5-2.18-5.27 1.35-3.77 8-15.36 2.35-16-4.47-.5-4.43 7-4.07 10.65 0 .47.08 1.15.14 1.88-1.07-2.29-2.22-4.59-3.44-6.85a20.6 20.6 0 0 0 2.55-5.19c.43-1.37 1.72-7.36-2-5.28-1.42.79-2 5.07-1.85 8.1q-1.37-2.37-2.86-4.65c-5.45-11.59-.08-26.26-9-24.84-10.55 1.68-7.55 10.37-5 13.63a41.5 41.5 0 0 0 11.71 10c1 1.68 4.82 9.16 5.29 10.14-4.19-5.21-12.64-15.46-16.07-9.85-3.05 5 11.76 8.85 16.87 11.52 1.4 2.94 4.48 10.54 4.78 11.33-1.91-2.16-3.5-5.42-6.07-6.92-2.27-1.33-7.65-2.44-7.7.94-.06 4.81 6.88 5.43 10.29 6.3 2.45.63 3.46 1.74 4.15 1.53q2 5.79 3.52 11.77c-2.6-4.77-10.27-15-14-9.52-4.85 7.09 9.47 7.28 14.29 10.6a122 122 0 0 1 2.29 12.34v.15c-1.67-3.79-3-7.64-6.32-10.54-3-2.64-8.55-4-8.62 2.25 0 4.54 7.93 5.4 11.56 7.61 1.62 1 2.79 2.26 3.63 2.8a111 111 0 0 1 .64 11.69c-6.38-5.58-11.14-21.7-16.83-14.38-5 6.45 10.3 7.9 16.83 15.75 0 3.56-.17 7.13-.41 10.71a40.5 40.5 0 0 0-3.51-8.26c-1-2-6.54-7.89-9.15-3.52s5.42 8 7.84 9.39a11.7 11.7 0 0 1 4.64 4.91c-.05.66-.78 8.81-1 12.24-1.56-5.92-15-27.81-20.55-15.91-3.57 7.63 13 9.52 16.66 12.26 2.52 1.86 3.37 3.48 3.8 5.18-.12 2-.2 4-.22 6-3.15-5.54-11-16.22-15.23-8.26-5 9.41 8.36 7 10.83 8.44 2.16 1.24 4.6 2 4.52 5.07a58 58 0 0 0 .79 7c.29 1.65 2.9 1.09 2.73-.56a92 92 0 0 1-.5-9.67c3.82-2.23 12.24-2.19 14.82-4.26 3.54-2.99 2.35-6.94-2.38-7.13",style:{fill:"url(#linear-gradient-3)"}}),V.createElement("path",{d:"M421.58 485.91s4.78-14.14 15.85-9.59c0 0 5.54-17.9 19.12-3.9s9.41-16.06 22.95-13.36 9.51 13 9.51 13 12.88-6.64 10.09 4.85c0 0 30.41-15.16 30.91-2.33 0 0 20.38-3.78 16.86 6.79 0 0 11.82-3 11.82 4.53Z",style:{fill:"url(#linear-gradient-4)"}})),V.createElement("g",{id:"plant_3","data-name":"plant 3"},V.createElement("path",{d:"M177.78 474.29s-1.26-43.54-16.57-46.75-17.5 27.15 0 57.15Z",style:{fill:"url(#linear-gradient-5)"}}),h||(h=V.createElement("path",{d:"M169.86 479.51a.27.27 0 0 1-.25-.19c-7.3-29.38-10.44-40.18-10.47-40.28a.26.26 0 0 1 .18-.32.27.27 0 0 1 .32.18c0 .1 3.17 10.91 10.48 40.3a.26.26 0 0 1-.19.3Z",className:"cls-13"})),V.createElement("path",{d:"M183.08 484.69s23.34-22.15 14.59-32.86-30.63 7.86-36.46 32.86Z",style:{fill:"url(#linear-gradient-6)"}}),p||(p=V.createElement("path",{d:"M174 481.73h-.1a.27.27 0 0 1-.14-.34c5.79-13.11 17.08-23.55 17.2-23.66a.25.25 0 0 1 .36 0 .25.25 0 0 1 0 .36c-.11.1-11.33 10.47-17.07 23.48a.26.26 0 0 1-.25.16",className:"cls-13"})),V.createElement("path",{d:"M163.34 484.69s-6-25.18-18-23 0 22.86 0 22.86Z",style:{fill:"url(#linear-gradient-7)"}}),f||(f=V.createElement("path",{d:"M151.55 481.55a.26.26 0 0 1-.25-.19l-4-14.64a.24.24 0 0 1 .18-.31.26.26 0 0 1 .32.18l4 14.64a.26.26 0 0 1-.18.31Z",className:"cls-13"}))),V.createElement("g",{id:"shield"},V.createElement("path",{d:"m307.54 161.26 9.71 197.06h198.24l-9.71-197.06z",style:{fill:"#1150bf",opacity:.5}}),E||(E=V.createElement("path",{d:"m507.92 204.64-2.14-43.38h-36.47M478.97 358.32h36.52l-2.41-48.87M315.01 312.83l2.24 45.49h48.76M346.97 161.26h-39.43l2.46 49.87",className:"cls-17"})),g||(g=V.createElement("path",{d:"M379.91 203.47c19.75-6.65 29.83-18.94 29.83-18.94s11.74 12.29 32.39 18.94c18.48 6 37.82 5.24 37.82 5.24s4.12 65.21-16.63 91.48c-19.41 24.67-43.77 29-43.77 29s-24.94-4.35-47.7-29c-24.31-26.27-29.05-91.48-29.05-91.48s19.45.72 37.11-5.24",className:"cls-18"})),x||(x=V.createElement("path",{d:"M419.5 318.82c5.46-1.53 22.38-7.46 36.33-25.18 12.82-16.25 15.17-53.64 14.92-75.08a128.3 128.3 0 0 1-30.54-5.5 99.9 99.9 0 0 1-28.89-14.91 84.4 84.4 0 0 1-26.87 14.91 119.6 119.6 0 0 1-29.8 5.5c2.67 21.46 10.08 58.83 25.11 75.08 16.35 17.72 34.08 23.65 39.74 25.18",className:"cls-8"})),y||(y=V.createElement("path",{d:"M419.27 315.47c5.79-1.7 21-7.48 33.94-23.93 11.75-14.89 14.3-48.65 14.3-70a129 129 0 0 1-28.13-5.42 103.4 103.4 0 0 1-27.79-13.85 87.6 87.6 0 0 1-25.9 13.85 119.7 119.7 0 0 1-27.39 5.42c2.91 21.35 10.05 55.13 23.78 70 15.18 16.46 31.16 22.23 37.19 23.93",className:"cls-18"})),u||(u=V.createElement("path",{d:"M405.69 247.15a12.44 12.44 0 0 0 12.25 11.41 10.57 10.57 0 0 0 10.72-11.41 12.43 12.43 0 0 0-12.26-11.42 10.55 10.55 0 0 0-10.71 11.42",className:"cls-2"})),M||(M=V.createElement("path",{d:"M419.57 282.66a4.45 4.45 0 0 0 4.5-4.81l-1.77-26.33a5.24 5.24 0 0 0-5.16-4.81 4.45 4.45 0 0 0-4.51 4.81l1.79 26.33a5.24 5.24 0 0 0 5.15 4.81",className:"cls-2"})),V.createElement("path",{d:"M379.86 203.47c19.74-6.65 29.82-18.94 29.82-18.94s6.13 42.48 8 70.72 1.78 74 1.78 74-24.94-4.35-47.7-29c-24.32-26.27-29.05-91.48-29.05-91.48s19.48.66 37.15-5.3",style:{fill:"#5890f4",opacity:.25,mixBlendMode:"multiply"}})),V.createElement("g",{id:"man"},_||(_=V.createElement("g",{id:"shoes"},V.createElement("path",{d:"m220.32 455.82-.71 9.63s1.5 14.32 1.11 16.05c-.34 1.46-15.74 1.64-21.5.66a2.47 2.47 0 0 1-2.06-2.45v-2.88a3.7 3.7 0 0 1 .24-1.32l4.33-11.5v-8.19Z",className:"cls-20"}),V.createElement("path",{d:"M201.73 464s16.07-.71 16.62.75 1.26.69 1.26.69l.71-9.63h-18.59Z",className:"cls-21"}),V.createElement("path",{d:"M197.16 476.83v2.88a2.47 2.47 0 0 0 2.06 2.45c5.76 1 21.16.8 21.5-.66a15 15 0 0 0 0-2.67l-2 .39c0-5.36-2.84-7.33-9.38-8.67a13.65 13.65 0 0 0-11.14 2.75l-.83 2.21a3.7 3.7 0 0 0-.21 1.32",className:"cls-22"}),V.createElement("path",{d:"M314 479.67c-1-3.13-2.84-7.6-5.45-8.41-4.1-1.26-25.06-6.62-25.69-8.82 0 0-6.36 1.5-6.8 2.95s-9.44.12-9.44.12v.14l-1.25 15.16a1.8 1.8 0 0 0 1.8 2h44.56a2.37 2.37 0 0 0 2.27-3.14",className:"cls-20"}),V.createElement("path",{d:"M276.07 465.39c.44-1.45 6.8-2.95 6.8-2.95-.63-2.21-.76-10.28-.76-10.28l-16.88 2.68 1.4 10.67s9 1.33 9.44-.12",className:"cls-21"}),V.createElement("path",{d:"M267.19 482.77h44.56a2.37 2.37 0 0 0 2.26-3.1c-1-3.13-2.84-7.6-5.45-8.41l-2.93-.84c-.5 2.75-.82 9.51-.82 9.51l-39.31-.47-.11 1.35a1.8 1.8 0 0 0 1.8 1.96",className:"cls-22"}))),v||(v=V.createElement("g",{id:"pants"},V.createElement("path",{d:"M201.14 261.12S198 293 198 365.21c0 15.88 3.19 90.61 3.19 90.61h19.14s4.49-65.7 4.73-80.1-1.42-15.39 1.89-29.8 9.22-37.12 9.22-37.12 15.83 45.67 15.6 51.77-1.66 25.65 2.6 40.54 10.87 53.73 10.87 53.73 11.92 2 16.88-2.68c0 0-5.07-91.1-6-103.06s-14-91-14-91Z",className:"cls-23"}),V.createElement("path",{d:"m236.16 308.8 2.75-19.36s12.63 59.94 12.6 68.88Z",className:"cls-24"}))),V.createElement("g",{id:"body"},N||(N=V.createElement("path",{d:"M217.05 150.85a16.7 16.7 0 0 0-3.19 0c-.59.19-3.66 5.48-3.66 5.48s-16.23.78-21.19 6-24.52 45.13-24.13 53.21S183.79 259 183.79 259l11.11-6.31-9.9-36.62 9-13.57s8.47 24.13 8.34 30.65-1.17 28-1.17 28l61-3V209s13.08 19.83 16.08 21.91a8.13 8.13 0 0 0 7.69.92c1.44-.65 16.57-18.78 16.57-18.78l-8.74-10-8.61 4.18s-17.35-46-24.13-48.53-16.83-2.87-16.83-2.87-5-6.71-7.17-6.32-19.98 1.34-19.98 1.34",className:"cls-23"})),b||(b=V.createElement("path",{d:"M278.23 230.93a8.13 8.13 0 0 0 7.69.92c1.44-.65 16.57-18.78 16.57-18.78l-8.74-10-8.61 4.18s-6.26 4.82-9.46 4-13.53-26.87-13.53-26.87V209s13.08 19.85 16.08 21.93M193.97 202.5l5.1-7.23 1.26 27.48z",className:"cls-24"})),k||(k=V.createElement("path",{d:"M201.53 252.72s34.51 3.39 60.62-2.35v7.75s-15 7.74-61 3Z",className:"cls-25"})),j||(j=V.createElement("path",{d:"M245.24 264.28h-13.99v-13.91l13.99-.62z",className:"cls-20"})),Z||(Z=V.createElement("path",{d:"M242.31 261.12h-7.05v-7.01l7.05-.31z",className:"cls-25"})),w||(w=V.createElement("path",{d:"M227.68 161.41a3.68 3.68 0 0 0-3.65.92 50 50 0 0 0-4.69 6.39l1.69 1.69s2.74-8.93 6.65-9M244.18 155.8s-2 9.46-5.08 12.13c0 0-5.22-7.55-8.16-6.67 0 0 5.48 1.65 7.24 8.63 0 0 4.7-2.74 6-14.09",className:"cls-24"})),z||(z=V.createElement("ellipse",{cx:229.54,cy:169.11,className:"cls-24",rx:1.4,ry:1.96})),D||(D=V.createElement("path",{d:"m207.775 185.959 15.13-.454.088 2.93-15.13.454z",className:"cls-25"})),V.createElement("path",{d:"M252 178.39s1.62 3.08 6.56 3.86c0 0-.35 10.42-7.33 12.93 0 0-6.57-1.83-6.08-13.47.04 0 4.94-.14 6.85-3.32",style:{fill:"url(#linear-gradient-8)"}}),G||(G=V.createElement("path",{d:"M252 178.39c-1.95 3.18-6.85 3.32-6.85 3.32-.49 11.64 6.08 13.47 6.08 13.47a40 40 0 0 0 .77-16.79",className:"cls-4"})),C||(C=V.createElement("path",{d:"M178.42 284.31a4.5 4.5 0 0 1-2.51-8.24l145.59-97.65a4.5 4.5 0 1 1 5 7.47l-145.57 97.65a4.5 4.5 0 0 1-2.51.77",className:"cls-8"})),H||(H=V.createElement("path",{d:"m194.9 252.67.83 2.4a40 40 0 0 1 4.78 2.36 12 12 0 0 1 1.07 1.43l-2.5 1.67s3.77 6.64 5.57 7.1l1-.67s.56 1.45.27 2-1.32 2.16-2.69 2.2a3.84 3.84 0 0 1-3.43 2.57 3.64 3.64 0 0 1-3.84 2 4.47 4.47 0 0 1-3 1.73c-1.88.18-8.39-7.28-8.58-10s-.61-8.48-.61-8.48ZM302.49 213.07s10.89-14.09 11-15.59-1.79-10.83-3.89-11.09a2.51 2.51 0 0 0-2.76 1.24s-2.63.74-2.84 1.7c0 0-2 .58-2.38 1.76a4.94 4.94 0 0 0-2.19 1 2.43 2.43 0 0 0-.83 1.66l.83-.48s3.41 7.17 1.65 9.56l-4.69 3.24Z",className:"cls-21"})),S||(S=V.createElement("path",{d:"M301.1 202.84s-.34 1.35.39 1.89-2 4.91 1 8.34l-6.08-7Z",className:"cls-27"}))),V.createElement("g",{id:"head"},V.createElement("path",{d:"M211.9 121.63s-4.5.52-3.13 4.5 4.3 6.78 7.11 6.59l-.33 19.5s5.81 8.94 13.18 9 7.3-9.83 7.3-9.83v-7.17s5.15.78 6.59-10.63 1.95-28.63 0-29.15-27.85-4.2-30.72 17.19",style:{fill:"#f59d80"}}),T||(T=V.createElement("path",{d:"M211.9 121.63s2.58-.42 3.31.31c0 0 5.77 10.66 5.92 12.18s.54 10.91.54 10.91 8.75 5.67 15 4.11 9.3-6.56 9.25-7.29-2.88-12.13-2.88-12.13-3.29-1.71-4.46-1.47-15.36 3.38-15.36 3.38-4.45-10.28-4.79-11 3.08-1.42 1.56-5.48l2.48-8.53-15.39 3.79 3.48 11.6Z",className:"cls-20"})),U||(U=V.createElement("path",{d:"M215.88 132.72s2-.13 2.51-1.44c0 0-.26 3-2.54 3.33Z",className:"cls-27"})),O||(O=V.createElement("path",{d:"M218.81 107.51s9.79 3.1 14.48 3.1 15.26-1.1 15.91-3.1-5.93-4.08-5.93-4.08-14.56.57-24.46 4.08",className:"cls-8"})),L||(L=V.createElement("path",{d:"m243.27 95.09 6-3.79s-14.85-4.63-18.7-8.67c0 0-10.11 8.54-18.71 8.41 0 0-6.36 8.2-14 10.36l.72 2 6.45 1.83Z",className:"cls-23"})),A||(A=V.createElement("path",{d:"m207.09 110.4 36.18-7v-8.31a50 50 0 0 0-12.91 0c-7.24.91-25.31 10.17-25.31 10.17Z",className:"cls-8"})),V.createElement("path",{d:"M231 88s1.53 2.32 5.52 2.54c0 0 .56 8.3-4.78 10.85 0 0-5.36-.92-5.91-10.2.01-.02 3.88-.53 5.17-3.19",style:{fill:"url(#linear-gradient-9)"}}),q||(q=V.createElement("path",{d:"M231 88c-1.3 2.68-5.17 3.19-5.17 3.19.55 9.28 5.91 10.2 5.91 10.2A32 32 0 0 0 231 88",className:"cls-4"})),P||(P=V.createElement("path",{d:"M236.68 149.14a15 15 0 0 0 7.68-4.71 10.9 10.9 0 0 1-5 2.24s1.37-.91-.46-1.95-11.28 1.63-13.63.58-4.14-11.18-4.14-11.18c.15 1.52.54 10.91.54 10.91s8.75 5.67 15.01 4.11M215.21 121.94s-3.47-5.62-4-6-4.11-5.52-4.11-5.52l3.48 11.6 1.33-.37s2.65-.41 3.3.29",className:"cls-8"}))))))))}},43645:(e,a,t)=>{"use strict";t.d(a,{h:()=>r});t(30758);var l=t(86070);function r(){return(0,l.jsx)("div",{className:"flex justify-center mt-8 overflow-auto",children:(0,l.jsx)("table",{className:"table-fixed text-center",id:"landscape",children:(0,l.jsxs)("tbody",{children:[(0,l.jsxs)("tr",{className:"border-none",children:[(0,l.jsx)("td",{className:"border-none"}),(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"\u2190 individual entities"}),(0,l.jsx)("br",{}),"transactional"]}),(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"large data \u2192"}),(0,l.jsx)("br",{}),"analytical"]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:[(0,l.jsx)("small",{children:"instantaneous \u2191"}),(0,l.jsx)("br",{}),"short-lived"]}),(0,l.jsxs)("td",{className:"bg-slate-100",children:[(0,l.jsx)("strong",{children:"Metatype"}),(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"composition engine for entities in evolving systems"})]}),(0,l.jsxs)("td",{children:["Trino",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"query engine for large data from multiples sources"})]})]}),(0,l.jsxs)("tr",{children:[(0,l.jsxs)("td",{children:["long-running",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"asynchronous \u2193"})]}),(0,l.jsxs)("td",{children:["Temporal",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"workflow orchestration for long-running operations"})]}),(0,l.jsxs)("td",{children:["Spark",(0,l.jsx)("br",{}),(0,l.jsx)("small",{children:"batch/streaming engine for large data processing"})]})]})]})})})}},65671:(e,a,t)=>{"use strict";t.d(a,{A:()=>c});var l=t(98302),r=(t(30758),t(86070));function c(e){let{python:a,typescript:t,rust:c,...s}=e;const n=[a&&{content:a.content,codeLanguage:"python",codeFileUrl:a.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},c&&{content:c.content,codeLanguage:"rust",codeFileUrl:c.path}].filter((e=>!!e));return(0,r.jsx)(l.A,{code:0==n.length?void 0:n,...s})}},50287:(e,a,t)=>{"use strict";t.d(a,{fb:()=>N,sc:()=>k,M7:()=>j,kk:()=>b});var l=t(30758),r=t(41570),c=t(21545),s=t.n(c),n=t(86070);const i={blue:"rgb(160, 195, 242)",gray:"rgb(239, 239, 239)",orange:"rgb(252, 201, 159)",pink:"rgb(201, 158, 181)",red:"rgb(221, 147, 143)",green:"rgb(157, 187, 193)",yellow:"rgb(250, 226, 144)",turquoise:"rgb(156, 208, 228)",purple:"rgb(170, 158, 208)"};function m(e,a){return e*a*.6}function d(e){const a=l.useRef(null);return l.useEffect((()=>{a.current?.cache()})),(0,n.jsx)(r.rw,{ref:a,...e})}function o(e){let{p:[a,t],size:l,width:c,height:o,color:h,connectors:p=!0}=e;const f=a-c*l/2,E=t-m(l,o)/2,g=(0,n.jsx)(r.rw,{x:f,y:E,width:l*c,height:m(l,o),fill:i[h]??h,stroke:"black",strokeWidth:3,lineJoin:"round"});if(!p)return g;const x=Array.from({length:c},((e,a)=>a*l+.2*l));return(0,n.jsxs)(r.YJ,{children:[g,x.map((e=>(0,n.jsx)(d,{x:f+e,y:E-.25*l,width:.6*l,height:.25*l,fill:i[h]??h,filters:[s().Filters.Brighten],brightness:.075,stroke:"black",strokeWidth:3,lineJoin:"round"},e)))]})}var h=t(5136),p=t(66622);function f(e,a){let[t,r]=e;const[c,s]=(0,h.zh)((()=>({progress:0})),[]);return(0,l.useEffect)((()=>{if(t===r)return;let e=null;function l(e){return e{(0,p.__)(Object.values(c),(e=>e.stop())),window.removeEventListener("scroll",i),window.removeEventListener("keydown",d),window.removeEventListener("wheel",m)}}),[t,r]),c}function E(e,a,t){if(a.length!==t.length)throw new Error("xs and ys must have the same length");return e.to((e=>{let l=0;for(;a[l+1]{function e(){if(h.current){const{innerHeight:e}=window,{offsetTop:t,offsetWidth:l}=h.current,r=t-c,n=t+a+s,i=.5*e,m=Math.min(n/e,1),d=r-i*m,o=n-i*m;x({width:l,min:Math.max(d,0),max:Math.max(o,0)})}}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[h,x]),c{if(f.current){const{width:e,height:a}=f.current.measureSize(s);p([e,a])}}),[f,p,d]);const E=a-o/2,g=t-h/2,x=(0,n.jsx)(r.EY,{ref:f,x:E,y:g,text:s,fontFamily:m,fontSize:c});return 0===i.length?x:(0,n.jsxs)(r.YJ,{children:[x,i.map((e=>{let[l,c]=e;const s=l-a{const a=40,t=40,l=120,c=310,s=E(e,[0,.25],[1,0]),i=E(e,[.25,.5],[0,a]),d=E(e,[.25,.5],[0,-40]),h=E(e,[.5,.75],[0,-190]),p=E(e,[.5,.75],[0,1]),f=E(e,[.75,1],[0,1]),x=E(e,[.75,1],[0,a]),y=E(e,[.75,1],[0,-40]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)],text:"your database",size:20,arrows:[[260,135+2*m(t,2)]]})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,95+1*m(t,2)],text:"your backend",size:20,arrows:[[260,95+1*m(t,2)]]})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(u,{p:[l,55+0*m(t,2)],text:"your frontend",size:20,arrows:[[260,55+0*m(t,2)]]})}),(0,n.jsx)(g,{x:h,opacity:p,children:(0,n.jsx)(u,{p:[c,135+2*m(t,2)+20],text:"expectations",size:20})}),(0,n.jsx)(g,{x:h,y:d,children:(0,n.jsx)(o,{p:[c,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:h,children:(0,n.jsx)(o,{p:[c,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:h,y:i,children:(0,n.jsx)(o,{p:[c,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,y:y,children:(0,n.jsx)(o,{p:[300,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,children:(0,n.jsx)(o,{p:[320,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,y:x,children:(0,n.jsx)(o,{p:[c,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:f,children:(0,n.jsx)(u,{p:[c,135+2*m(t,2)+20],text:"reality",size:20})})]})}})}function b(){return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:e=>{const a=40,t=40,l=350,c=E(e,[0,.25],[0,1]),s=E(e,[0,.25],[1,0]),i=E(e,[0,.25,.5],[0,1,0]),d=E(e,[.5,.75],[0,a]),h=E(e,[.5,.75],[0,-40]),p=E(e,[.75,1],[0,-125]),f=E(e,[.75,1],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,135+2*m(t,2)],color:"orange",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,95+1*m(t,2)],color:"gray",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[l,55+0*m(t,2)],color:"blue",height:2,width:2,size:t,connectors:!1})}),(0,n.jsx)(g,{x:p,y:h,opacity:c,children:(0,n.jsx)(o,{p:[l,135+2*m(t,2)],color:"orange",height:2,width:2,size:t})}),(0,n.jsx)(g,{x:p,opacity:c,children:(0,n.jsx)(o,{p:[l,95+1*m(t,2)],color:"gray",height:2,width:2,size:t})}),(0,n.jsx)(g,{x:p,y:d,opacity:c,children:(0,n.jsx)(o,{p:[l,55+0*m(t,2)],color:"blue",height:2,width:2,size:t})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[100,95+.5*m(t,2)-5],text:"typegraphs",size:20,arrows:[[300,55+-.5*m(t,2)],[300,95+.5*m(t,2)-5],[300,135+1.5*m(t,2)-10]]})}),(0,n.jsx)(g,{x:p,opacity:f,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)+20],text:"with Metatype",size:20})})]})}})}function k(){const[e]=_()("/images/logo.svg");return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:a=>{const t=40,l=120,c=380,s=E(a,[0,.25],[0,1]),i=E(a,[0,.25,.5],[0,1,0]),d=E(a,[.5,.75],[0,1]),h=E(a,[.5,.75],[1,0]),p=E(a,[.75,1],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[300,95+2*m(t,2)],color:"purple",height:2,width:2,size:t})}),(0,n.jsx)(o,{p:[c,95+2*m(t,2)],color:"orange",height:2,width:2,size:t}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[360,95+1*m(t,2)],color:"gray",height:2,width:3,size:t})}),(0,n.jsx)(g,{opacity:h,children:(0,n.jsx)(o,{p:[c,95+1*m(t,2)],color:"gray",height:2,width:2,size:t})}),(0,n.jsx)(o,{p:[c,95+0*m(t,2)],color:"blue",height:2,width:2,size:t}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(r._V,{x:70,y:90,width:100,height:120,image:e})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[l,135+2*m(t,2)],text:"typegate",size:20})}),(0,n.jsxs)(g,{opacity:s,children:[(0,n.jsx)(v,{points:[10,160,91,160]}),(0,n.jsx)(v,{points:[l,118,l,65,335,65]})]}),(0,n.jsxs)(g,{opacity:p,children:[(0,n.jsx)(v,{points:[144,160,255,160]}),(0,n.jsx)(v,{points:[l,118,l,65,320,65,320,100]})]})]})}})}function j(){return(0,n.jsx)(x,{canvasHeight:300,canvasWidth:500,height:300,before:20,after:20,slowMotion:1,scene:e=>{const a=40,t=150,l=E(e,[0,.2],[0,1]),c=E(e,[0,.2,.45],[0,1,0]),s=E(e,[.25,.45],[0,1]),i=E(e,[.25,.45,.7],[0,1,0]),d=E(e,[.5,.7],[0,1]),h=E(e,[.5,.7,1],[0,1,0]),p=E(e,[.75,.95],[0,1]);return(0,n.jsxs)(r.Wd,{children:[(0,n.jsx)(g,{opacity:l,children:(0,n.jsx)(o,{p:[270,100+2*m(a,2)],color:"red",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:c,children:(0,n.jsx)(u,{p:[270,140+2*m(a,2)+10],text:"third parties",size:20})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[70,100+2*m(a,2)],color:"purple",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:i,children:(0,n.jsx)(u,{p:[70,140+2*m(a,2)+10],text:"internal analytics",size:20})}),(0,n.jsx)(o,{p:[t,100+2*m(a,2)],color:"orange",height:2,width:2,size:a}),(0,n.jsx)(g,{children:(0,n.jsx)(o,{p:[t,100+1*m(a,2)],color:"gray",height:2,width:2,size:a})}),(0,n.jsx)(g,{opacity:l,children:(0,n.jsx)(o,{p:[210,100+1*m(a,2)],color:"gray",height:2,width:5,size:a})}),(0,n.jsx)(g,{opacity:s,children:(0,n.jsx)(o,{p:[190,100+1*m(a,2)],color:"gray",height:2,width:6,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[230,100+2.5*m(a,1)],color:"pink",height:1,width:4,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[190,100+1.5*m(a,1)],color:"yellow",height:1,width:2,size:a})}),(0,n.jsx)(g,{opacity:d,children:(0,n.jsx)(o,{p:[270,100+1.5*m(a,1)],color:"green",height:1,width:2,size:a})}),(0,n.jsx)(g,{opacity:h,children:(0,n.jsx)(u,{p:[390,140+0*m(a,2)+5],text:"split services",size:20})}),(0,n.jsx)(g,{opacity:p,children:(0,n.jsx)(o,{p:[250,100+0*m(a,1)],color:"turquoise",height:2,width:1,size:a})}),(0,n.jsx)(g,{opacity:p,children:(0,n.jsx)(u,{p:[355,140+-1*m(a,2)-5],text:"back for front",size:20})}),(0,n.jsx)(o,{p:[t,100+0*m(a,2)],color:"blue",height:2,width:2,size:a})]})}})}},26175:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>b});var l=t(30758),r=t(92076),c=t(30340),s=t(22653),n=t(65671),i=t(45656),m=(t(14127),t(56315)),d=t(43645),o=t(55230),h=t(86070);function p(){return(0,h.jsxs)("header",{className:"bg-gradient-to-b from-slate-200 from-0% to-white to-100%",children:[(0,h.jsx)("div",{className:"flex justify-end mt-5 mr-5 mb-0",children:(0,h.jsx)(r.A,{to:"https://devhunt.org/tool/metatype",children:(0,h.jsx)("img",{src:"images/homepage/devhunt_tab_solid.svg",alt:"Devhunt result"})})}),(0,h.jsxs)("div",{className:"container text-center py-12",children:[(0,h.jsx)("div",{className:"rounded-full bg-white w-40 h-40 flex px-6 m-auto mb-10",children:(0,h.jsx)("img",{src:"images/logo.svg",alt:"Metatype logo"})}),(0,h.jsxs)(o.A,{as:"h1",className:"text-5xl",children:["Declarative"," ",(0,h.jsx)("span",{className:"inline-block text-transparent bg-clip-text bg-gradient-to-r from-metared from-15% via-metablue via-50% to-metared to-85%",children:"API development"})," ","platform"]}),(0,h.jsxs)("p",{className:"hero__subtitle mx-auto text-3xl leading-10 max-w-[880px]",children:["Build ",(0,h.jsx)("strong",{children:"backend components"})," with ",(0,h.jsx)("strong",{children:"WASM"}),","," ",(0,h.jsx)("strong",{children:"Typescript"})," and ",(0,h.jsx)("strong",{children:"Python"}),", no matter where and how your (legacy) systems are."]}),(0,h.jsxs)("div",{className:"md:flex md:px-32 justify-center",children:[(0,h.jsx)(r.A,{className:"button button--primary button--lg m-2",to:"/docs/tutorials/quick-start",children:"Quick Start"}),(0,h.jsx)(r.A,{className:"button bg-slate-400 hover:bg-slate-300 button--lg m-2",to:"/docs/concepts/features-overview",children:"Learn more"})]})]})]})}function f(e){let{profile:a,setProfile:l}=e;return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("div",{className:"flex text-sm mb-8",children:(0,h.jsx)(m.mS,{choices:v,choice:a,onChange:l})}),(0,h.jsxs)(o.A,{as:"h2",children:[(0,h.jsx)("span",{className:"text-metared",children:"Programming"})," is like"," ",(0,h.jsx)("span",{className:"text-metared",children:"castle"})," building"]}),(0,h.jsxs)("p",{children:["And castle building is ",(0,h.jsx)("strong",{children:"hard"}),". Even the best teams can struggle to build according to the plans, especially with the ever evolving needs and the tech landscape complexities."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).fb;return(0,h.jsx)(e,{})}})]})}function E(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"reliable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"typegraphs"})]}),(0,h.jsxs)("p",{children:["Typegraphs are programmable ",(0,h.jsx)("strong",{children:"virtual graphs"})," describing all the components of your stack. They enable you to compose APIs, storage and business logic in a type safe manner."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).kk;return(0,h.jsx)(e,{})}})]})}function g(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"modulable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"typegate"})]}),(0,h.jsxs)("p",{children:["Typegate is a GraphQL/REST ",(0,h.jsx)("strong",{children:"composition engine"})," that compiles, optimizes, runs and caches queries over typegraphs. It enforces authentication, authorization and security for you."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).sc;return(0,h.jsx)(e,{})}})]})}function x(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Build ",(0,h.jsx)("span",{className:"text-metared",children:"reusable"})," castle with"," ",(0,h.jsx)("span",{className:"text-metared",children:"Metatype"})]}),(0,h.jsxs)("p",{children:["Install third parties as ",(0,h.jsx)("strong",{children:"dependencies"})," and start reusing components. The Meta CLI offers you live reloading and one-command deployment to Metatype cloud or your self-hosted instance."]})]}),(0,h.jsx)(i.A,{fallback:(0,h.jsx)("div",{className:"h-[300px]"}),children:()=>{const e=t(50287).M7;return(0,h.jsx)(e,{})}})]})}t(78245).A,h.Fragment,t(90803).A,h.Fragment,t(73712).A,h.Fragment,t(13201).A,h.Fragment,t(24546).A,h.Fragment,t(17603).A,h.Fragment;function y(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Try the ",(0,h.jsx)("span",{className:"text-metared",children:"playground"})," and"," ",(0,h.jsx)("span",{className:"text-metared",children:"deploy"})]}),(0,h.jsxs)("p",{children:["Metatype's unique approach combines the"," ",(0,h.jsx)("strong",{children:"best of the two worlds"}),". You are quickly productive thanks to the high-level abstractions, yet you can leverage all the low-level developer tooling you are familiar with."]})]}),(0,h.jsx)("div",{className:"w-full",children:(0,h.jsx)(n.A,{python:t(1673),typescript:t(48623),typegraph:"homepage",variables:{email:"fill-me",message:"Great tool!"},noTool:!0,defaultMode:"typegraph",query:t(95654)})})]})}const u=[{name:"GraphQL",logo:"/images/runtimes/graphql.svg"},{name:"HTTP",logo:"/images/runtimes/http.svg"},{name:"GRPC",logo:"/images/runtimes/grpc.svg"},{name:"Deno",logo:"/images/runtimes/deno.svg"},{name:"SQLite",logo:"/images/runtimes/sqlite.svg"},{name:"PostgreSQL",logo:"/images/runtimes/postgresql.svg"},{name:"Google APIs Explorer",logo:"/images/runtimes/google-apis-explorer.svg"},{name:"Python",logo:"/images/runtimes/python.svg"},{name:"WasmEdge",logo:"/images/runtimes/wasmedge.svg"},{name:"Temporal",logo:"/images/runtimes/temporal.svg"},{name:"S3",logo:"/images/runtimes/s3.svg"}];function M(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:[(0,h.jsx)("span",{className:"text-metared",children:"Easily"})," add your"," ",(0,h.jsx)("span",{className:"text-metared",children:"own"})," runtime"]}),(0,h.jsx)("p",{children:"More than 12 runtimes are natively supported. Usually it takes less than a day to integrate a new one and support the most frequent usages."})]}),(0,h.jsx)("div",{className:"flex flex-wrap gap-4 m-4",children:u.map(((e,a)=>(0,h.jsx)("img",{src:e.logo,alt:`${e.name} logo. All rights reserved to ${e.name}.`,style:{maxWidth:"150px",maxHeight:"80px"},className:"p-4 flex-1"},a)))})]})}function _(){return(0,h.jsxs)("section",{children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)(o.A,{as:"h2",children:["Bringing ",(0,h.jsx)("span",{className:"text-metared",children:"speed"})," and"," ",(0,h.jsx)("span",{className:"text-metared",children:"novelty"})," to backend development"]}),(0,h.jsxs)("p",{className:"text-xl",children:["Metatype fills a gap in the tech landscape by introducing a new way to build fast and developer-friendly APIs that are"," ",(0,h.jsx)("strong",{children:"interoperable"})," with your existing (legacy) systems."]})]}),(0,h.jsx)(d.h,{})]})}const v={leader:"I'm an engineering leader",developer:"I'm a developer"},N={leader:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(E,{}),(0,h.jsx)(g,{}),(0,h.jsx)(x,{}),(0,h.jsx)(y,{}),(0,h.jsx)(_,{}),(0,h.jsx)(M,{})]}),developer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(_,{}),(0,h.jsx)(y,{}),(0,h.jsx)(M,{})]})};function b(){const{siteConfig:e}=(0,c.A)(),[a,t]=(0,l.useState)(Object.keys(v)[0]);return(0,h.jsxs)(s.A,{title:e.title,description:e.tagline,children:[(0,h.jsx)(p,{}),(0,h.jsxs)("main",{id:"homepage",className:"container",children:[(0,h.jsx)(f,{profile:a,setProfile:t}),N[a]]})]})}},95654:e=>{var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"stargazers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"login"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_feedback"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"message"},value:{kind:"StringValue",value:"I love X!",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_feedback"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:309}};a.loc.source={body:'query A {\n stargazers {\n login\n # composition\n user {\n name\n }\n }\n}\n\nmutation B {\n send_feedback(\n data: {\n email: "" # fill me\n message: "I love X!"\n }\n ) {\n id\n message\n }\n}\n\nquery C {\n list_feedback {\n email # cannot be accessed, delete me\n message\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,a){if("FragmentSpread"===e.kind)a.add(e.name.value);else if("VariableDefinition"===e.kind){var l=e.type;"NamedType"===l.kind&&a.add(l.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,a)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,a)})),e.definitions&&e.definitions.forEach((function(e){t(e,a)}))}var l={};function r(e,a){for(var t=0;t0;){var i=n;n=new Set,i.forEach((function(e){s.has(e)||(s.add(e),(l[e]||new Set).forEach((function(e){n.add(e)})))}))}return s.forEach((function(a){var l=r(e,a);l&&t.definitions.push(l)})),t}a.definitions.forEach((function(e){if(e.name){var a=new Set;t(e,a),l[e.name.value]=a}})),e.exports=a,e.exports.A=c(a,"A"),e.exports.B=c(a,"B"),e.exports.C=c(a,"C")},1673:e=>{e.exports={content:'@typegraph(\n)\ndef homepage(g: Graph):\n # every field may be controlled by a policy\n public = Policy.public()\n meta_only = Policy.context("email", re.compile(".+@metatype.dev"))\n public_write_only = Policy.on(create=public, read=meta_only)\n\n # define runtimes where your queries are executed\n github = HttpRuntime("https://api.github.com")\n db = PrismaRuntime("demo", "POSTGRES_CONN")\n\n # a feedback object stored in Postgres\n feedback = t.struct(\n {\n "id": t.uuid(as_id=True, config=["auto"]),\n "email": t.email().with_policy(public_write_only),\n "message": t.string(min=1, max=2000),\n },\n name="feedback",\n )\n\n # a stargazer object from Github\n stargazer = t.struct(\n {\n "login": t.string(),\n # link with the feedback across runtimes\n "user": github.get(\n "/users/{user}",\n t.struct({"user": t.string().from_parent("login")}),\n t.struct({"name": t.string().optional()}),\n ),\n }\n )\n\n # out of the box authenfication support\n g.auth(Auth.oauth2_github("openid email"))\n\n # expose part of the graph for queries\n g.expose(\n public,\n stargazers=github.get(\n "/repos/metatypedev/metatype/stargazers?per_page=2",\n t.struct({}),\n t.list(stargazer),\n ),\n # automatically generate crud operations\n send_feedback=db.create(feedback),\n list_feedback=db.find_many(feedback),\n )',path:"../examples/typegraphs/index.py"}},48623:e=>{e.exports={content:'typegraph(\n {\n name: "homepage",\n },\n (g) => {\n // every field may be controlled by a policy\n const pub = Policy.public();\n const metaOnly = Policy.context("email", /.+@metatype.dev/);\n const publicWriteOnly = Policy.on({ create: pub, read: metaOnly });\n\n // define runtimes where your queries are executed\n const github = new HttpRuntime("https://api.github.com");\n const db = new PrismaRuntime("demo", "POSTGRES_CONN");\n\n // a feedback object stored in Postgres\n const feedback = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email().withPolicy(publicWriteOnly),\n message: t.string({ min: 1, max: 2000 }, {}),\n },\n { name: "feedback" },\n );\n\n // a stargazer object from Github\n const stargazer = t.struct({\n login: t.string({}),\n // link with the feedback across runtimes\n user: github.get(\n t.struct({ user: t.string().fromParent("login") }),\n t.struct({ name: t.string().optional() }),\n { path: "/users/{user}" },\n ),\n });\n\n g.auth(Auth.oauth2Github("openid email"));\n\n // expose part of the graph for queries\n g.expose(\n {\n stargazers: github.get(t.struct({}), t.list(stargazer), {\n path: "/repos/metatypedev/metatype/stargazers?per_page=2",\n }),\n // automatically generate crud operations\n send_feedback: db.create(feedback),\n list_feedback: db.findMany(feedback),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/index.ts"}}}]); \ No newline at end of file diff --git a/assets/js/1f54f6f7.b8c61c8e.js b/assets/js/1f54f6f7.1ab94f0b.js similarity index 67% rename from assets/js/1f54f6f7.b8c61c8e.js rename to assets/js/1f54f6f7.1ab94f0b.js index 4001d9dc0c..c7eee7005e 100644 --- a/assets/js/1f54f6f7.b8c61c8e.js +++ b/assets/js/1f54f6f7.1ab94f0b.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4404],{43053:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var i=t(86070),a=t(25710),o=t(65671);const r={sidebar_position:50},s="Custom functions",c={id:"guides/external-functions/index",title:"Custom functions",description:"Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under functions which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function generators to minimize boilerplate. For cases not expressible by generators, runtimes like the DenoRuntime allow us to write more powerful custom functions.",source:"@site/docs/guides/external-functions/index.mdx",sourceDirName:"guides/external-functions",slug:"/guides/external-functions/",permalink:"/docs/guides/external-functions/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/external-functions/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Metatype Basics",permalink:"/docs/tutorials/metatype-basics/"},next:{title:"Upload files to cloud storage",permalink:"/docs/guides/files-upload/"}},d={},l=[{value:"Accessing function context",id:"accessing-function-context",level:2},{value:"Accessing the typegraph",id:"accessing-the-typegraph",level:2},{value:"Generating types",id:"generating-types",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"custom-functions",children:"Custom functions"}),"\n",(0,i.jsxs)(n.p,{children:["Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under ",(0,i.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"functions"})," which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/prisma#generators",children:"generators"})," to minimize boilerplate. For cases not expressible by generators, runtimes like the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," allow us to write more powerful custom functions."]}),"\n",(0,i.jsx)(n.p,{children:"Custom functions are commonly used for:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Specialized business logic to respond directly to incoming requests"}),"\n",(0,i.jsx)(n.li,{children:"Authentication policy logic"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["The following example uses the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," to respond to requests and define a policy."]}),"\n",(0,i.jsx)(o.A,{typegraph:"math",typescript:t(41929),python:t(32535),query:t(34348)}),"\n",(0,i.jsxs)(n.p,{children:["Note that for the ",(0,i.jsx)(n.code,{children:"fib"})," root function, we're using a typescript module in an external file. Here's what ",(0,i.jsx)(n.code,{children:"scripts/fib.ts"})," looks like:"]}),"\n",(0,i.jsx)(o.A,{typescript:t(39409),disablePlayground:!0}),"\n",(0,i.jsx)(n.p,{children:"The following runtimes can be used to run custom functions:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/deno/",children:(0,i.jsx)(n.code,{children:"DenoRuntime"})})," through typescript code."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/python/",children:(0,i.jsx)(n.code,{children:"PythonRuntime"})})," through python code."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/wasm/",children:(0,i.jsx)(n.code,{children:"WasmRuntime"})})," through wasm modules."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/prisma/",children:(0,i.jsx)(n.code,{children:"PrismaRuntime"})})," throw raw SQL queries."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"accessing-function-context",children:"Accessing function context"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsxs)(n.p,{children:["The following feature is currently only implemented for the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"On some runtimes, custom functions are passed to the context object along with the function inputs. This object provides access to all kinds of information about the context in which the function is running. The following example illustrates availaible fields:"}),"\n",(0,i.jsx)(o.A,{typegraph:"func-ctx",typescript:t(46165),python:t(58379),query:t(90939)}),"\n",(0,i.jsxs)(n.p,{children:["Note, the typescript version of the sample uses a closure instead of a string snippet to define the function. This is a simple syntax sugar availaible when using ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," through the typescript sdk or the ",(0,i.jsx)(n.code,{children:"PythonRuntime"})," the python one. Consult the reference for each runtime to look at what's availaible."]}),"\n",(0,i.jsx)(n.h2,{id:"accessing-the-typegraph",children:"Accessing the typegraph"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsxs)(n.p,{children:["The following feature is currently only implemented for the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["To do anything meaningful with custom functions, you'll want to access the rest of functionality implemented on your typegraph. The primary way of doing this is by sending GraphqQl queries from within your function. On the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),", to make this easier, there's a ",(0,i.jsx)(n.code,{children:"gql"})," object passed to all functions. The following exapmle illustrates how it functions:"]}),"\n",(0,i.jsx)(o.A,{typegraph:"func-gql",typescript:t(95856),python:t(63014),query:t(30360)}),"\n",(0,i.jsxs)(n.p,{children:["And ",(0,i.jsx)(n.code,{children:"scripts/createVote.ts"})," looks like:"]}),"\n",(0,i.jsx)(o.A,{typescript:t(97778),disablePlayground:!0}),"\n",(0,i.jsx)(n.h2,{id:"generating-types",children:"Generating types"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,i.jsxs)(n.p,{children:["Custom functions can be made smoother to develop or more robust to changes by using the ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," to generate code for them. By using the generated types along with static analysis tools in your workflow, this allows you to avoid many cases of drift between your custom functions and your typegraph. Not to mention improving the development experience of writing custom functions. The code generated for Python and Rust targets also includes the serialization boilerplate and utilities that you'd need for those to even get started in those languages."]}),"\n",(0,i.jsxs)(n.p,{children:["The metagen library is availaible within the ",(0,i.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," or the ",(0,i.jsx)(n.a,{href:"/docs/reference/typegraph#sdks",children:"typegraph SDK"}),". In the following example we'll use the CLI to generate typescript code for a simple typegraph."]}),"\n",(0,i.jsx)(o.A,{typegraph:"metagen-deno",typescript:t(86099),python:t(14037),query:t(29711)}),"\n",(0,i.jsxs)(n.p,{children:["We'll need to configure metagen through the ",(0,i.jsx)(n.code,{children:"metatype.yaml"})," file. We add a new target to the metagen section that does what we need."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"metagen:\n targets:\n # named targets to configure a bunch of generators together\n metagen_deno:\n - generator: fdk_typescript # generator to use\n # path to generate to\n path: ./metagen/ts/\n # point to the typegraph location\n # or name of typegraph on a typegate somehwere\n typegraph_path: ./metagen-deno.ts\n"})}),"\n",(0,i.jsxs)(n.p,{children:["We can configure multiple target in our config file. Each target can have mutiple generator configurations. Metagen currently ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen",children:"implements"})," for the Typescript, Python and Rust targets."]}),"\n",(0,i.jsx)(n.p,{children:"We can then invoke the target using the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"meta gen metagen_deno\n"})}),"\n",(0,i.jsx)(n.p,{children:"This results in the following files."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"\u276f lsd --tree metagen\n\uf115 metagen\n\u2514\u2500\u2500 \ue628 ts\n \u2514\u2500\u2500 \ue628 fdk.ts\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Within ",(0,i.jsx)(n.code,{children:"fdk.ts"})," and the types and helpers, all the types from your typegraph should be there. Something like:"]}),"\n",(0,i.jsxs)(r,{children:[(0,i.jsx)("summary",{children:"Code generation sample. Collapsed for aesthetic reasons."}),(0,i.jsx)(o.A,{typescript:t(96280),disablePlayground:!0})]}),"\n",(0,i.jsxs)(n.p,{children:["Note, this also include typescript function types for specific typegraph functions. By default, the ",(0,i.jsx)(n.code,{children:"fdk_typescript"})," generator will only include stub function types for those defined on the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," but this is ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen#fdk_typescript",children:"configurable"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["We can then use these types in the following manner. Add the following snippet into ",(0,i.jsx)(n.code,{children:"metagen/ts/remix.ts"}),"."]}),"\n",(0,i.jsx)(o.A,{typescript:t(13246),disablePlayground:!0}),"\n",(0,i.jsx)(n.p,{children:"Ofcourse, we'll need to include both our implementation and the generated code when defining our typegraph functions."})]})}function m(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var i=t(98302),a=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...r}=e;const s=[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)(i.A,{code:0==s.length?void 0:s,...r})}},90939:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ctx"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"effect"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"meta"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"secrets"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headers"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:119}};n.loc.source={body:"query {\n ctx {\n parent\n context\n effect\n meta {\n url\n token\n }\n secrets\n headers\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},30360:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createIdea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"PATENT #12343",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"corp@abc.xyz",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"desc"},value:{kind:"StringValue",value:"Well, you can't use it so why do you care?",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createVote"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createVote"},arguments:[{kind:"Argument",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"corp@abc.xyz",block:!1}},{kind:"Argument",name:{kind:"Name",value:"ideaId"},value:{kind:"StringValue",value:"c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"vote"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:488}};n.loc.source={body:'# create idea first\nmutation createIdea {\n createIdea(\n data: {\n id: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5"\n name: "PATENT #12343"\n authorEmail: "corp@abc.xyz"\n desc: "Well, you can\'t use it so why do you care?"\n }\n ) {\n id\n authorEmail\n }\n}\n\n# now try to vote using same email\nmutation createVote {\n createVote(\n authorEmail: "corp@abc.xyz"\n ideaId: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5"\n ) {\n vote {\n id\n authorEmail\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};function a(e,n){for(var t=0;t0;){var c=s;s=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach((function(e){s.add(e)})))}))}return r.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.createIdea=o(n,"createIdea"),e.exports.createVote=o(n,"createVote")},34348:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fib"},arguments:[{kind:"Argument",name:{kind:"Name",value:"size"},value:{kind:"IntValue",value:"50"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"random"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"randomItem"},arguments:[{kind:"Argument",name:{kind:"Name",value:"items"},value:{kind:"ListValue",values:[{kind:"StringValue",value:"ice",block:!1},{kind:"StringValue",value:"advice",block:!1},{kind:"StringValue",value:"gold",block:!1},{kind:"StringValue",value:"flowers",block:!1},{kind:"StringValue",value:"dirt",block:!1}]}}],directives:[]}]}}],loc:{start:0,end:95}};n.loc.source={body:'{\n fib(size: 50)\n random\n randomItem(items: ["ice", "advice", "gold", "flowers", "dirt"])\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},29711:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"remix"},arguments:[{kind:"Argument",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"Lovefool",block:!1}},{kind:"Argument",name:{kind:"Name",value:"artist"},value:{kind:"StringValue",value:"The Cardigans",block:!1}},{kind:"Argument",name:{kind:"Name",value:"releaseTime"},value:{kind:"StringValue",value:"1996-06-29T10:30:40.340Z",block:!1}},{kind:"Argument",name:{kind:"Name",value:"mp3Url"},value:{kind:"StringValue",value:"https://mus.ic/lovefool.mp3",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"artist"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"releaseTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mp3Url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:213}};n.loc.source={body:'query {\n remix(\n title: "Lovefool"\n artist: "The Cardigans"\n releaseTime: "1996-06-29T10:30:40.340Z"\n mp3Url: "https://mus.ic/lovefool.mp3"\n ) {\n title\n artist\n releaseTime\n mp3Url\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},58379:e=>{e.exports={content:'g.expose(\n Policy.public(),\n ctx=deno.func(\n t.struct({}),\n t.struct(\n {\n # the effect under which the function was run\n "effect": t.enum(["create", "read", "update", "delete"]),\n "meta": t.struct(\n {\n # url to host typegraph\n # can be used to talk to host typegraph from within\n # function\n "url": t.string(),\n # token for accessing host typegraph\n "token": t.string(),\n }\n ),\n # http headers\n "headers": t.list(t.list(t.string())),\n # typegraph secrets\n "secrets": t.list(t.list(t.string())),\n # FIXME: explanation\n "parent": t.string(),\n "context": t.string(),\n }\n ),\n # modeling arbitrary associative arrays in\n # graphql is difficult so we return a listified format.\n # Follow the link for alternative solutions\n # https://github.com/graphql/graphql-spec/issues/101#issuecomment-170170967\n code="""(_, ctx) => ({\n ...ctx,\n parent: JSON.stringify(ctx.parent),\n context: JSON.stringify(ctx.context),\n headers: Object.entries(ctx.headers),\n secrets: Object.entries(ctx.secrets),\n })""",\n ),\n)',path:"../examples/typegraphs/func-ctx.py"}},46165:e=>{e.exports={content:'g.expose(\n {\n ctx: deno.func(\n t.struct({}),\n t.struct({\n // the effect under which the function was run\n effect: t.enum_(["create", "read", "update", "delete"]),\n meta: t.struct({\n // url to host typegraph\n // can be used to talk to host typegraph from within\n // function\n url: t.string(), // token for accessing host typegraph\n token: t.string(),\n }),\n\n // http headers\n headers: t.list(t.list(t.string())),\n // typegraph secrets\n secrets: t.list(t.list(t.string())),\n\n // FIXME: explanation\n parent: t.string(),\n context: t.string(),\n }),\n {\n // modeling arbitrary associative arrays in\n // graphql is difficult so we return a listified format.\n // Follow the link for alternative solutions\n // https://github.com/graphql/graphql-spec/issues/101#issuecomment-170170967\n code: (_: any, ctx: any) => ({\n ...ctx,\n parent: JSON.stringify(ctx.parent),\n context: JSON.stringify(ctx.context),\n headers: Object.entries(ctx.headers),\n secrets: Object.entries(ctx.secrets),\n }),\n }\n ),\n },\n Policy.public()\n);',path:"../examples/typegraphs/func-ctx.ts"}},63014:e=>{e.exports={content:'deno = DenoRuntime()\ndb = PrismaRuntime("db", "POSTGRES")\nidea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "desc": t.string().optional(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n },\n name="idea",\n)\nvote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "idea": g.ref("idea"),\n },\n name="vote",\n)\n# Policy.internal means only custom functions\n# can access these root functions\ng.expose(\n Policy.internal(),\n i_get_idea=db.find_unique(idea),\n i_create_vote=db.create(vote),\n)\ng.expose(\n Policy.public(),\n createIdea=db.create(idea),\n createVote=deno.import_(\n t.struct({"ideaId": t.uuid(), "authorEmail": t.email()}).rename(\n "CreateVoteInput"\n ),\n t.struct(\n {\n "voteId": t.uuid(),\n # using `reduce` we improve the API allowing\n # create calls to get the newly created object\n # without having to send this data from the\n # custom funciton\n "vote": db.find_unique(vote).reduce(\n {\n "where": {\n "id": g.inherit().from_parent("voteId"),\n },\n }\n ),\n }\n ).rename("CreateVoteOutput"),\n module="scripts/createVote.ts",\n name="handle", # name the exported function to run\n effect=fx.create(),\n ),\n)',path:"../examples/typegraphs/func-gql.py"}},95856:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst db = new PrismaRuntime("db", "POSTGRES");\n\nconst idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n desc: t.string().optional(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n },\n { name: "idea" },\n);\nconst vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n);\n\n// Policy.internal means only custom functions\n// can access these root functions\ng.expose(\n {\n i_get_idea: db.findUnique(idea),\n i_create_vote: db.create(vote),\n },\n Policy.internal(),\n);\n\ng.expose(\n {\n createIdea: db.create(idea),\n createVote: deno.import(\n t\n .struct({ ideaId: t.uuid(), authorEmail: t.email() })\n .rename("CreateVoteInput"),\n t\n .struct({\n voteId: t.uuid(),\n // using `reduce` we improve the API allowing\n // create calls to get the newly created object\n // without having to send this data from the\n // custom funciton\n vote: db.findUnique(vote).reduce({\n where: {\n id: g.inherit().fromParent("voteId"),\n },\n }),\n })\n .rename("CreateVoteOutput"),\n {\n module: "scripts/createVote.ts",\n name: "handle", // name the exported function to run\n effect: fx.create(),\n },\n ),\n },\n Policy.public(),\n);',path:"../examples/typegraphs/func-gql.ts"}},32535:e=>{e.exports={content:'from typegraph.runtimes.deno import DenoRuntime\n\n\n@typegraph(\n)\ndef math(g: Graph):\n public = Policy.public()\n\n # we need a runtime to run the functions on\n deno = DenoRuntime()\n\n # we can provide the function code inline\n random_item_fn = "({ items }) => items[Math.floor(Math.random() * items.length)]"\n\n # or we can point to a local file that\'s accessible to the meta-cli\n fib_module = "scripts/fib.ts"\n\n # the policy implementation is based on functions as well\n restrict_referer = deno.policy(\n "restrict_referer_policy",\n \'(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)\',\n )\n\n g.expose(\n public,\n # all functions have inputs and outputs\n fib=deno.import_(\n t.struct({"size": t.integer()}),\n t.list(t.float()),\n module=fib_module,\n name="default", # name the exported function to run\n ).with_policy(restrict_referer),\n randomItem=deno.func(\n t.struct({"items": t.list(t.string())}),\n t.string(),\n code=random_item_fn,\n ),\n random=deno.func(\n t.struct(),\n t.float(),\n code="() => Math.random()", # more inline code\n ),\n )',path:"../examples/typegraphs/math.py"}},41929:e=>{e.exports={content:'import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\nawait typegraph(\n {\n name: "math",\n },\n (g) => {\n const pub = Policy.public();\n\n // we need a runtime to run the functions on\n const deno = new DenoRuntime();\n\n // we can provide the function code inline\n const random_item_fn =\n "({ items }) => items[Math.floor(Math.random() * items.length)]";\n\n // the policy implementation is based on functions itself\n const restrict_referer = deno.policy(\n "restrict_referer_policy",\n \'(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)\'\n );\n\n // or we can point to a local file that\'s accessible to the meta-cli\n const fib_module = "scripts/fib.ts";\n\n g.expose(\n {\n // all functions have inputs and outputs\n fib: deno\n .import(t.struct({ size: t.integer() }), t.list(t.float()), {\n module: fib_module,\n name: "default", // name the exported function to run\n })\n .withPolicy(restrict_referer),\n randomItem: deno.func(\n t.struct({ items: t.list(t.string()) }),\n t.string(),\n { code: random_item_fn }\n ),\n random: deno.func(\n t.struct({}),\n t.float(),\n { code: "() => Math.random()" } // more inline code\n ),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/math.ts"}},14037:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_deno(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-deno.py"}},86099:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-deno",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n const deno = new DenoRuntime();\n\n g.expose(\n {\n remix: deno\n .import(idv3, idv3, {\n module: "./metagen/ts/remix.ts",\n deps: ["./metagen/ts/fdk.ts"],\n name: "remix_track",\n })\n .rename("remix_track"), // explicit names help\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/metagen-deno.ts"}},96280:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n\nexport type Ctx = {\n parent?: Record;\n /**\n * Request context extracted by auth extractors.\n */\n context?: Record;\n secrets: Record;\n effect: "create" | "update" | "delete" | "read" | undefined | null;\n meta: {\n url: string;\n token: string;\n };\n headers: Record;\n};\n\n/**\n * Access features on your typegraph deployment.\n */\nexport type Deployment = {\n gql: (query: readonly string[], ...args: unknown[]) => {\n run: (\n variables: Record,\n ) => Promise>;\n };\n};\n\nexport type Handler = (\n input: In,\n ctx: Ctx,\n tg: Deployment,\n) => Out | Promise;\n\nexport type StringDateTime = string;\nexport type StringUri = string;\nexport type Idv3 = {\n title: string;\n artist: string;\n releaseTime: StringDateTime;\n mp3Url: StringUri;\n};\n\n\nexport type RemixTrackHandler = Handler;',path:"../examples/typegraphs/metagen/ts/fdk.ts"}},13246:e=>{e.exports={content:'import type { RemixTrackHandler, Ctx, Idv3 } from "./fdk.ts";\n\n// the name of the export must match the one referred int he typegraph\nexport const remix_track: RemixTrackHandler = (inp, cx: Ctx) => {\n const out: Idv3 = {\n title: `${inp.title} (Remix)`,\n artist: `${inp.artist} + DJ Cloud`,\n releaseTime: new Date().toISOString(),\n // S3Runtime could be used to really provide this service\n mp3Url: `${cx.meta.url}/get_mp3`,\n };\n return out;\n};',path:"../examples/typegraphs/metagen/ts/remix.ts"}},97778:e=>{e.exports={content:"export async function handle(\n inp: { ideaId: string; authorEmail: string },\n _ctx: any,\n // the third paramter contains the gql client object\n { gql }: any,\n) {\n // find the referenced idea from the typegraph\n const { data: { idea } } = await gql`\n query getIdeaAuthorEmail($ideaId: String!) {\n idea: i_get_idea(where: { id: $ideaId }) {\n authorEmail\n }\n }\n `.run({ ideaId: inp.ideaId });\n\n // we check if the idea exists\n if (!idea) {\n throw new Error(`no idea found under id ${inp.ideaId}`);\n }\n\n // and that the author and voter aren't the same\n if (inp.authorEmail == idea.authorEmail) {\n throw new Error(`author of idea can't vote for idea`);\n }\n\n // we persist the vote with another gql call\n const { data: { vote } } = await gql`\n mutation insertVote($ideaId: String!, $authorEmail: String!) {\n vote: i_create_vote(data: { \n authorEmail: $authorEmail, \n idea: { connect: { id: $ideaId } } \n }) {\n id\n }\n }\n `.run(inp);\n return { voteId: vote.id };\n}",path:"../examples/typegraphs/scripts/createVote.ts"}},39409:e=>{e.exports={content:"const CACHE = [1, 1];\nconst MAX_CACHE_SIZE = 1000;\n\nexport default function fib({ size }: { size: number }) {\n if (size > MAX_CACHE_SIZE) {\n throw new Error(`unsupported size ${size} > ${MAX_CACHE_SIZE}`);\n }\n let i = CACHE.length;\n while (i++ < size) {\n CACHE.push(CACHE[i - 2] + CACHE[i - 3]);\n }\n return CACHE.slice(0, size);\n}",path:"../examples/typegraphs/scripts/fib.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4404],{43053:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>s,default:()=>m,frontMatter:()=>r,metadata:()=>c,toc:()=>l});var i=t(86070),a=t(25710),o=t(65671);const r={sidebar_position:50},s="Custom functions",c={id:"guides/external-functions/index",title:"Custom functions",description:"Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under functions which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function generators to minimize boilerplate. For cases not expressible by generators, runtimes like the DenoRuntime allow us to write more powerful custom functions.",source:"@site/docs/guides/external-functions/index.mdx",sourceDirName:"guides/external-functions",slug:"/guides/external-functions/",permalink:"/docs/guides/external-functions/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/external-functions/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Metatype Basics",permalink:"/docs/tutorials/metatype-basics/"},next:{title:"Upload files to cloud storage",permalink:"/docs/guides/files-upload/"}},d={},l=[{value:"Accessing function context",id:"accessing-function-context",level:2},{value:"Accessing the typegraph",id:"accessing-the-typegraph",level:2},{value:"Generating types",id:"generating-types",level:2}];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components},{Details:r}=n;return r||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"custom-functions",children:"Custom functions"}),"\n",(0,i.jsxs)(n.p,{children:["Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under ",(0,i.jsx)(n.a,{href:"/docs/concepts/mental-model#functions",children:"functions"})," which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/prisma#generators",children:"generators"})," to minimize boilerplate. For cases not expressible by generators, runtimes like the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," allow us to write more powerful custom functions."]}),"\n",(0,i.jsx)(n.p,{children:"Custom functions are commonly used for:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Specialized business logic to respond directly to incoming requests"}),"\n",(0,i.jsx)(n.li,{children:"Authentication policy logic"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["The following example uses the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," to respond to requests and define a policy."]}),"\n",(0,i.jsx)(o.A,{typegraph:"math",typescript:t(41929),python:t(32535),query:t(34348)}),"\n",(0,i.jsxs)(n.p,{children:["Note that for the ",(0,i.jsx)(n.code,{children:"fib"})," root function, we're using a typescript module in an external file. Here's what ",(0,i.jsx)(n.code,{children:"scripts/fib.ts"})," looks like:"]}),"\n",(0,i.jsx)(o.A,{typescript:t(39409),disablePlayground:!0}),"\n",(0,i.jsx)(n.p,{children:"The following runtimes can be used to run custom functions:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/deno/",children:(0,i.jsx)(n.code,{children:"DenoRuntime"})})," through typescript code."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/python/",children:(0,i.jsx)(n.code,{children:"PythonRuntime"})})," through python code."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/wasm/",children:(0,i.jsx)(n.code,{children:"WasmRuntime"})})," through wasm modules."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/prisma/",children:(0,i.jsx)(n.code,{children:"PrismaRuntime"})})," throw raw SQL queries."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"accessing-function-context",children:"Accessing function context"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsxs)(n.p,{children:["The following feature is currently only implemented for the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),"."]})}),"\n",(0,i.jsx)(n.p,{children:"On some runtimes, custom functions are passed to the context object along with the function inputs. This object provides access to all kinds of information about the context in which the function is running. The following example illustrates availaible fields:"}),"\n",(0,i.jsx)(o.A,{typegraph:"func-ctx",typescript:t(46165),python:t(58379),query:t(90939)}),"\n",(0,i.jsxs)(n.p,{children:["Note, the typescript version of the sample uses a closure instead of a string snippet to define the function. This is a simple syntax sugar availaible when using ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," through the typescript sdk or the ",(0,i.jsx)(n.code,{children:"PythonRuntime"})," the python one. Consult the reference for each runtime to look at what's availaible."]}),"\n",(0,i.jsx)(n.h2,{id:"accessing-the-typegraph",children:"Accessing the typegraph"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsxs)(n.p,{children:["The following feature is currently only implemented for the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),"."]})}),"\n",(0,i.jsxs)(n.p,{children:["To do anything meaningful with custom functions, you'll want to access the rest of functionality implemented on your typegraph. The primary way of doing this is by sending GraphqQl queries from within your function. On the ",(0,i.jsx)(n.code,{children:"DenoRuntime"}),", to make this easier, there's a ",(0,i.jsx)(n.code,{children:"gql"})," object passed to all functions. The following exapmle illustrates how it functions:"]}),"\n",(0,i.jsx)(o.A,{typegraph:"func-gql",typescript:t(95856),python:t(63014),query:t(30360)}),"\n",(0,i.jsxs)(n.p,{children:["And ",(0,i.jsx)(n.code,{children:"scripts/createVote.ts"})," looks like:"]}),"\n",(0,i.jsx)(o.A,{typescript:t(97778),disablePlayground:!0}),"\n",(0,i.jsx)(n.h2,{id:"generating-types",children:"Generating types"}),"\n",(0,i.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,i.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,i.jsxs)(n.p,{children:["Custom functions can be made smoother to develop or more robust to changes by using the ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," to generate code for them. By using the generated types along with static analysis tools in your workflow, this allows you to avoid many cases of drift between your custom functions and your typegraph. Not to mention improving the development experience of writing custom functions. The code generated for Python and Rust targets also includes the serialization boilerplate and utilities that you'd need for those to even get started in those languages."]}),"\n",(0,i.jsxs)(n.p,{children:["The metagen library is availaible within the ",(0,i.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," or the ",(0,i.jsx)(n.a,{href:"/docs/reference/typegraph#sdks",children:"typegraph SDK"}),". In the following example we'll use the CLI to generate typescript code for a simple typegraph."]}),"\n",(0,i.jsx)(o.A,{typegraph:"metagen-deno",typescript:t(86099),python:t(14037),query:t(29711)}),"\n",(0,i.jsxs)(n.p,{children:["We'll need to configure metagen through the ",(0,i.jsx)(n.code,{children:"metatype.yaml"})," file. We add a new target to the metagen section that does what we need."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"metagen:\n targets:\n # named targets to configure a bunch of generators together\n metagen_deno:\n - generator: fdk_typescript # generator to use\n # path to generate to\n path: ./metagen/ts/\n # point to the typegraph location\n # or name of typegraph on a typegate somehwere\n typegraph_path: ./metagen-deno.ts\n"})}),"\n",(0,i.jsxs)(n.p,{children:["We can configure multiple target in our config file. Each target can have mutiple generator configurations. Metagen currently ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen",children:"implements"})," for the Typescript, Python and Rust targets."]}),"\n",(0,i.jsx)(n.p,{children:"We can then invoke the target using the following command:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"meta gen metagen_deno\n"})}),"\n",(0,i.jsx)(n.p,{children:"This results in the following files."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"\u276f lsd --tree metagen\n\uf115 metagen\n\u2514\u2500\u2500 \ue628 ts\n \u2514\u2500\u2500 \ue628 fdk.ts\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Within ",(0,i.jsx)(n.code,{children:"fdk.ts"})," and the types and helpers, all the types from your typegraph should be there. Something like:"]}),"\n",(0,i.jsxs)(r,{children:[(0,i.jsx)("summary",{children:"Code generation sample. Collapsed for aesthetic reasons."}),(0,i.jsx)(o.A,{typescript:t(96280),disablePlayground:!0})]}),"\n",(0,i.jsxs)(n.p,{children:["Note, this also include typescript function types for specific typegraph functions. By default, the ",(0,i.jsx)(n.code,{children:"fdk_typescript"})," generator will only include stub function types for those defined on the ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," but this is ",(0,i.jsx)(n.a,{href:"/docs/reference/metagen#fdk_typescript",children:"configurable"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["We can then use these types in the following manner. Add the following snippet into ",(0,i.jsx)(n.code,{children:"metagen/ts/remix.ts"}),"."]}),"\n",(0,i.jsx)(o.A,{typescript:t(13246),disablePlayground:!0}),"\n",(0,i.jsx)(n.p,{children:"Ofcourse, we'll need to include both our implementation and the generated code when defining our typegraph functions."})]})}function m(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var i=t(98302),a=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...r}=e;const s=[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)(i.A,{code:0==s.length?void 0:s,...r})}},90939:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"ctx"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parent"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"effect"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"meta"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"token"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"secrets"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"headers"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:119}};n.loc.source={body:"query {\n ctx {\n parent\n context\n effect\n meta {\n url\n token\n }\n secrets\n headers\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},30360:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createIdea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"PATENT #12343",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"corp@abc.xyz",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"desc"},value:{kind:"StringValue",value:"Well, you can't use it so why do you care?",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createVote"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createVote"},arguments:[{kind:"Argument",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"corp@abc.xyz",block:!1}},{kind:"Argument",name:{kind:"Name",value:"ideaId"},value:{kind:"StringValue",value:"c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"vote"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:488}};n.loc.source={body:'# create idea first\nmutation createIdea {\n createIdea(\n data: {\n id: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5"\n name: "PATENT #12343"\n authorEmail: "corp@abc.xyz"\n desc: "Well, you can\'t use it so why do you care?"\n }\n ) {\n id\n authorEmail\n }\n}\n\n# now try to vote using same email\nmutation createVote {\n createVote(\n authorEmail: "corp@abc.xyz"\n ideaId: "c0ebb212-c94e-4fa5-a6ed-ae910d6cd9f5"\n ) {\n vote {\n id\n authorEmail\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};function a(e,n){for(var t=0;t0;){var c=s;s=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach((function(e){s.add(e)})))}))}return r.forEach((function(n){var i=a(e,n);i&&t.definitions.push(i)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.createIdea=o(n,"createIdea"),e.exports.createVote=o(n,"createVote")},34348:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"fib"},arguments:[{kind:"Argument",name:{kind:"Name",value:"size"},value:{kind:"IntValue",value:"50"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"random"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"randomItem"},arguments:[{kind:"Argument",name:{kind:"Name",value:"items"},value:{kind:"ListValue",values:[{kind:"StringValue",value:"ice",block:!1},{kind:"StringValue",value:"advice",block:!1},{kind:"StringValue",value:"gold",block:!1},{kind:"StringValue",value:"flowers",block:!1},{kind:"StringValue",value:"dirt",block:!1}]}}],directives:[]}]}}],loc:{start:0,end:95}};n.loc.source={body:'{\n fib(size: 50)\n random\n randomItem(items: ["ice", "advice", "gold", "flowers", "dirt"])\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},29711:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"remix"},arguments:[{kind:"Argument",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"Lovefool",block:!1}},{kind:"Argument",name:{kind:"Name",value:"artist"},value:{kind:"StringValue",value:"The Cardigans",block:!1}},{kind:"Argument",name:{kind:"Name",value:"releaseTime"},value:{kind:"StringValue",value:"1996-06-29T10:30:40.340Z",block:!1}},{kind:"Argument",name:{kind:"Name",value:"mp3Url"},value:{kind:"StringValue",value:"https://mus.ic/lovefool.mp3",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"artist"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"releaseTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mp3Url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:213}};n.loc.source={body:'query {\n remix(\n title: "Lovefool"\n artist: "The Cardigans"\n releaseTime: "1996-06-29T10:30:40.340Z"\n mp3Url: "https://mus.ic/lovefool.mp3"\n ) {\n title\n artist\n releaseTime\n mp3Url\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},58379:e=>{e.exports={content:'g.expose(\n Policy.public(),\n ctx=deno.func(\n t.struct({}),\n t.struct(\n {\n # the effect under which the function was run\n "effect": t.enum(["create", "read", "update", "delete"]),\n "meta": t.struct(\n {\n # url to host typegraph\n # can be used to talk to host typegraph from within\n # function\n "url": t.string(),\n # token for accessing host typegraph\n "token": t.string(),\n }\n ),\n # http headers\n "headers": t.list(t.list(t.string())),\n # typegraph secrets\n "secrets": t.list(t.list(t.string())),\n # FIXME: explanation\n "parent": t.string(),\n "context": t.string(),\n }\n ),\n # modeling arbitrary associative arrays in\n # graphql is difficult so we return a listified format.\n # Follow the link for alternative solutions\n # https://github.com/graphql/graphql-spec/issues/101#issuecomment-170170967\n code="""(_, ctx) => ({\n ...ctx,\n parent: JSON.stringify(ctx.parent),\n context: JSON.stringify(ctx.context),\n headers: Object.entries(ctx.headers),\n secrets: Object.entries(ctx.secrets),\n })""",\n ),\n)',path:"../examples/typegraphs/func-ctx.py"}},46165:e=>{e.exports={content:'g.expose(\n {\n ctx: deno.func(\n t.struct({}),\n t.struct({\n // the effect under which the function was run\n effect: t.enum_(["create", "read", "update", "delete"]),\n meta: t.struct({\n // url to host typegraph\n // can be used to talk to host typegraph from within\n // function\n url: t.string(), // token for accessing host typegraph\n token: t.string(),\n }),\n\n // http headers\n headers: t.list(t.list(t.string())),\n // typegraph secrets\n secrets: t.list(t.list(t.string())),\n\n // FIXME: explanation\n parent: t.string(),\n context: t.string(),\n }),\n {\n // modeling arbitrary associative arrays in\n // graphql is difficult so we return a listified format.\n // Follow the link for alternative solutions\n // https://github.com/graphql/graphql-spec/issues/101#issuecomment-170170967\n code: (_: any, ctx: any) => ({\n ...ctx,\n parent: JSON.stringify(ctx.parent),\n context: JSON.stringify(ctx.context),\n headers: Object.entries(ctx.headers),\n secrets: Object.entries(ctx.secrets),\n }),\n },\n ),\n },\n Policy.public(),\n);',path:"../examples/typegraphs/func-ctx.ts"}},63014:e=>{e.exports={content:'deno = DenoRuntime()\ndb = PrismaRuntime("db", "POSTGRES")\nidea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "desc": t.string().optional(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n },\n name="idea",\n)\nvote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "idea": g.ref("idea"),\n },\n name="vote",\n)\n# Policy.internal means only custom functions\n# can access these root functions\ng.expose(\n Policy.internal(),\n i_get_idea=db.find_unique(idea),\n i_create_vote=db.create(vote),\n)\ng.expose(\n Policy.public(),\n createIdea=db.create(idea),\n createVote=deno.import_(\n t.struct({"ideaId": t.uuid(), "authorEmail": t.email()}).rename(\n "CreateVoteInput"\n ),\n t.struct(\n {\n "voteId": t.uuid(),\n # using `reduce` we improve the API allowing\n # create calls to get the newly created object\n # without having to send this data from the\n # custom funciton\n "vote": db.find_unique(vote).reduce(\n {\n "where": {\n "id": g.inherit().from_parent("voteId"),\n },\n }\n ),\n }\n ).rename("CreateVoteOutput"),\n module="scripts/createVote.ts",\n name="handle", # name the exported function to run\n effect=fx.create(),\n ),\n)',path:"../examples/typegraphs/func-gql.py"}},95856:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst db = new PrismaRuntime("db", "POSTGRES");\n\nconst idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n desc: t.string().optional(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n },\n { name: "idea" },\n);\nconst vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n);\n\n// Policy.internal means only custom functions\n// can access these root functions\ng.expose(\n {\n i_get_idea: db.findUnique(idea),\n i_create_vote: db.create(vote),\n },\n Policy.internal(),\n);\n\ng.expose(\n {\n createIdea: db.create(idea),\n createVote: deno.import(\n t\n .struct({ ideaId: t.uuid(), authorEmail: t.email() })\n .rename("CreateVoteInput"),\n t\n .struct({\n voteId: t.uuid(),\n // using `reduce` we improve the API allowing\n // create calls to get the newly created object\n // without having to send this data from the\n // custom funciton\n vote: db.findUnique(vote).reduce({\n where: {\n id: g.inherit().fromParent("voteId"),\n },\n }),\n })\n .rename("CreateVoteOutput"),\n {\n module: "scripts/createVote.ts",\n name: "handle", // name the exported function to run\n effect: fx.create(),\n },\n ),\n },\n Policy.public(),\n);',path:"../examples/typegraphs/func-gql.ts"}},32535:e=>{e.exports={content:'from typegraph.runtimes.deno import DenoRuntime\n\n\n@typegraph(\n)\ndef math(g: Graph):\n public = Policy.public()\n\n # we need a runtime to run the functions on\n deno = DenoRuntime()\n\n # we can provide the function code inline\n random_item_fn = "({ items }) => items[Math.floor(Math.random() * items.length)]"\n\n # or we can point to a local file that\'s accessible to the meta-cli\n fib_module = "scripts/fib.ts"\n\n # the policy implementation is based on functions as well\n restrict_referer = deno.policy(\n "restrict_referer_policy",\n \'(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)\',\n )\n\n g.expose(\n public,\n # all functions have inputs and outputs\n fib=deno.import_(\n t.struct({"size": t.integer()}),\n t.list(t.float()),\n module=fib_module,\n name="default", # name the exported function to run\n ).with_policy(restrict_referer),\n randomItem=deno.func(\n t.struct({"items": t.list(t.string())}),\n t.string(),\n code=random_item_fn,\n ),\n random=deno.func(\n t.struct(),\n t.float(),\n code="() => Math.random()", # more inline code\n ),\n )',path:"../examples/typegraphs/math.py"}},41929:e=>{e.exports={content:'import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\nawait typegraph(\n {\n name: "math",\n },\n (g) => {\n const pub = Policy.public();\n\n // we need a runtime to run the functions on\n const deno = new DenoRuntime();\n\n // we can provide the function code inline\n const random_item_fn =\n "({ items }) => items[Math.floor(Math.random() * items.length)]";\n\n // the policy implementation is based on functions itself\n const restrict_referer = deno.policy(\n "restrict_referer_policy",\n \'(_, context) => context.headers.referer && ["localhost", "metatype.dev"].includes(new URL(context.headers.referer).hostname)\',\n );\n\n // or we can point to a local file that\'s accessible to the meta-cli\n const fib_module = "scripts/fib.ts";\n\n g.expose(\n {\n // all functions have inputs and outputs\n fib: deno\n .import(t.struct({ size: t.integer() }), t.list(t.float()), {\n module: fib_module,\n name: "default", // name the exported function to run\n })\n .withPolicy(restrict_referer),\n randomItem: deno.func(\n t.struct({ items: t.list(t.string()) }),\n t.string(),\n { code: random_item_fn },\n ),\n random: deno.func(\n t.struct({}),\n t.float(),\n { code: "() => Math.random()" }, // more inline code\n ),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/math.ts"}},14037:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_deno(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-deno.py"}},86099:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-deno",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n const deno = new DenoRuntime();\n\n g.expose(\n {\n remix: deno\n .import(idv3, idv3, {\n module: "./metagen/ts/remix.ts",\n deps: ["./metagen/ts/fdk.ts"],\n name: "remix_track",\n })\n .rename("remix_track"), // explicit names help\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/metagen-deno.ts"}},96280:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n\nexport type Ctx = {\n parent?: Record;\n /**\n * Request context extracted by auth extractors.\n */\n context?: Record;\n secrets: Record;\n effect: "create" | "update" | "delete" | "read" | undefined | null;\n meta: {\n url: string;\n token: string;\n };\n headers: Record;\n};\n\n/**\n * Access features on your typegraph deployment.\n */\nexport type Deployment = {\n gql: (query: readonly string[], ...args: unknown[]) => {\n run: (\n variables: Record,\n ) => Promise>;\n };\n};\n\nexport type Handler = (\n input: In,\n ctx: Ctx,\n tg: Deployment,\n) => Out | Promise;\n\nexport type StringDateTime = string;\nexport type StringUri = string;\nexport type Idv3 = {\n title: string;\n artist: string;\n releaseTime: StringDateTime;\n mp3Url: StringUri;\n};\n\nexport type RemixTrackHandler = Handler;',path:"../examples/typegraphs/metagen/ts/fdk.ts"}},13246:e=>{e.exports={content:'import type { Ctx, Idv3, RemixTrackHandler } from "./fdk.ts";\n\n// the name of the export must match the one referred int he typegraph\nexport const remix_track: RemixTrackHandler = (inp, cx: Ctx) => {\n const out: Idv3 = {\n title: `${inp.title} (Remix)`,\n artist: `${inp.artist} + DJ Cloud`,\n releaseTime: new Date().toISOString(),\n // S3Runtime could be used to really provide this service\n mp3Url: `${cx.meta.url}/get_mp3`,\n };\n return out;\n};',path:"../examples/typegraphs/metagen/ts/remix.ts"}},97778:e=>{e.exports={content:"export async function handle(\n inp: { ideaId: string; authorEmail: string },\n _ctx: any,\n // the third paramter contains the gql client object\n { gql }: any,\n) {\n // find the referenced idea from the typegraph\n const { data: { idea } } = await gql`\n query getIdeaAuthorEmail($ideaId: String!) {\n idea: i_get_idea(where: { id: $ideaId }) {\n authorEmail\n }\n }\n `.run({ ideaId: inp.ideaId });\n\n // we check if the idea exists\n if (!idea) {\n throw new Error(`no idea found under id ${inp.ideaId}`);\n }\n\n // and that the author and voter aren't the same\n if (inp.authorEmail == idea.authorEmail) {\n throw new Error(`author of idea can't vote for idea`);\n }\n\n // we persist the vote with another gql call\n const { data: { vote } } = await gql`\n mutation insertVote($ideaId: String!, $authorEmail: String!) {\n vote: i_create_vote(data: { \n authorEmail: $authorEmail, \n idea: { connect: { id: $ideaId } } \n }) {\n id\n }\n }\n `.run(inp);\n return { voteId: vote.id };\n}",path:"../examples/typegraphs/scripts/createVote.ts"}},39409:e=>{e.exports={content:"const CACHE = [1, 1];\nconst MAX_CACHE_SIZE = 1000;\n\nexport default function fib({ size }: { size: number }) {\n if (size > MAX_CACHE_SIZE) {\n throw new Error(`unsupported size ${size} > ${MAX_CACHE_SIZE}`);\n }\n let i = CACHE.length;\n while (i++ < size) {\n CACHE.push(CACHE[i - 2] + CACHE[i - 3]);\n }\n return CACHE.slice(0, size);\n}",path:"../examples/typegraphs/scripts/fib.ts"}}}]); \ No newline at end of file diff --git a/assets/js/26137cf5.e3abf870.js b/assets/js/26137cf5.382dc0cf.js similarity index 97% rename from assets/js/26137cf5.e3abf870.js rename to assets/js/26137cf5.382dc0cf.js index b6fa331e65..b9f240021e 100644 --- a/assets/js/26137cf5.e3abf870.js +++ b/assets/js/26137cf5.382dc0cf.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7050],{9677:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,RM:()=>o});var i=t(86070),s=t(25710),a=t(65671);t(7871);const o=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"S3Runtime"})," can be used to interact with object storage APIs that are S3 compatible. Object storages like S3 are commonly used to cover app needs around large blob data like uploading and serving images. Most object storage services provide S3 compatible APIs including the open-source ",(0,i.jsx)(n.a,{href:"https://min.io/",children:"MinIO"})," engine which you can run locally for development."]}),"\n",(0,i.jsx)(n.p,{children:"For the following example, you'll need to setup your S3 compatible store first. The following snippet can get you started using minio on docker compose:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'services:\n minio:\n image: bitnami/minio:2022\n platform: linux/amd64\n restart: always\n ports:\n - "9000:9000"\n - "9001:9001"\n environment:\n MINIO_REGION_NAME: local\n MINIO_ROOT_USER: minio\n MINIO_ROOT_PASSWORD: password\n MINIO_DEFAULT_BUCKETS: "bucket:none"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We then provide the following secrets to our typegraph through ",(0,i.jsx)(n.code,{children:"metatype.yml"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yml",children:'typegates:\n dev:\n secrets:\n # ..\n # replace "files-upload" by the name of your typegraph\n files-upload:\n S3_HOST: http://localhost:9000\n S3_REGION: local\n S3_ACCESS_KEY: minio\n S3_SECRET_KEY: password\n S3_PATH_STYLE: true\n'})}),"\n",(0,i.jsx)(n.p,{children:"Our typegraph will then look something like:"}),"\n",(0,i.jsx)(a.A,{typegraph:"files-upload",typescript:t(96144),python:t(2950),query:t(52852)}),"\n",(0,i.jsxs)(n.p,{children:["Peruse the ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"reference"})," on the ",(0,i.jsx)(n.code,{children:"S3Runtime"})," for more information."]})]})}function r(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},52897:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});var i=t(86070),s=t(25710),a=t(9677);const o={sidebar_position:50},l="Upload files to cloud storage",r={id:"guides/files-upload/index",title:"Upload files to cloud storage",description:"We can then use this typegraph from our client code like so:",source:"@site/docs/guides/files-upload/index.mdx",sourceDirName:"guides/files-upload",slug:"/guides/files-upload/",permalink:"/docs/guides/files-upload/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/files-upload/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Custom functions",permalink:"/docs/guides/external-functions/"},next:{title:"Write REST endpoints",permalink:"/docs/guides/rest/"}},p={},d=[...a.RM,{value:"Uploading file using GraphQL multipart request",id:"uploading-file-using-graphql-multipart-request",level:3}];function c(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"upload-files-to-cloud-storage",children:"Upload files to cloud storage"}),"\n",(0,i.jsx)(a.Ay,{}),"\n",(0,i.jsx)(n.p,{children:"We can then use this typegraph from our client code like so:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:'const image = await Deno.readFile("website/static/images/logo.png");\n\n// Get a presigned url\nconst {\n data: { signUploadUrl: presigned },\n} = await fetch("http://localhost:7891/files-upload", {\n method: "POST",\n body: JSON.stringify({\n query: `\n query SignUploadUrl($length: Int) {\n signUploadUrl(length: $length, path: "my-super-image.png")\n }\n `,\n variables: {\n length: image.length,\n },\n }),\n}).then((r) => r.json());\n\n// Upload the file\nconst upload = await fetch(presigned, {\n method: "PUT",\n body: image,\n headers: {\n "content-type": "image/png",\n "content-length": image.length,\n },\n});\n\nconsole.log(upload.status);\n'})}),"\n",(0,i.jsx)(n.h3,{id:"uploading-file-using-graphql-multipart-request",children:"Uploading file using GraphQL multipart request"}),"\n",(0,i.jsxs)(n.p,{children:["Metatype supports\n",(0,i.jsx)(n.a,{href:"https://github.com/jaydenseric/graphql-multipart-request-spec",children:"GraphQL multipart request"}),"\nfor uploading files.\nYou may use one of the clients in this\n",(0,i.jsx)(n.a,{href:"https://github.com/jaydenseric/graphql-multipart-request-spec#client",children:"list"}),"\nthat support GraphQL multipart request."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:'const image = await Deno.readFile("website/static/images/logo.png");\n\nconst formData = new FormData();\nformData.append(\n "operations",\n JSON.stringify({\n query: `\n mutation UploadImage($file: Upload!) {\n upload(file: $file) {\n id\n path\n size\n contentType\n }\n }\n `,\n variables: {\n file: null,\n },\n }),\n);\nformData.append("map", JSON.stringify({ 0: ["variables.file"] }));\nformData.append("0", image, "logo.png");\n\nconst upload = await fetch("http://localhost:7891/files-upload", {\n method: "POST",\n body: formData,\n});\nconsole.log(await upload.json());\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});var i=t(98302),s=(t(30758),t(86070));function a(e){let{python:n,typescript:t,rust:a,...o}=e;const l=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==l.length?void 0:l,...o})}},52852:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listObjects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"keys"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"size"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"{\n listObjects {\n keys {\n key\n size\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},2950:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.aws import S3Runtime\n\n# skip-next-line\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n name="files-upload",\n # skip-next-line\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef files_upload(g: Graph):\n s3 = S3Runtime(\n # we provide the name of the env vars\n # the typegate will read from\n "S3_HOST",\n "S3_REGION",\n "S3_ACCESS_KEY",\n "S3_SECRET_KEY",\n path_style_secret="S3_PATH_STYLE",\n )\n\n g.expose(\n Policy.public(),\n # we can then generate helpers for interacting with our runtime\n listObjects=s3.list("examples"),\n getDownloadUrl=s3.presign_get("examples"),\n signUploadUrl=s3.presign_put("examples"),\n upload=s3.upload("examples", t.file(allow=["image/png", "image/jpeg"])),\n uploadMany=s3.upload_all("examples"),\n )',path:"../examples/typegraphs/files-upload.py"}},96144:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { S3Runtime } from "@typegraph/sdk/providers/aws.ts";\n\nawait typegraph(\n {\n name: "files-upload",\n },\n (g) => {\n const s3 = new S3Runtime({\n hostSecret: "S3_HOST",\n regionSecret: "S3_REGION",\n accessKeySecret: "S3_ACCESS_KEY",\n secretKeySecret: "S3_SECRET_KEY",\n pathStyleSecret: "S3_PATH_STYLE",\n });\n\n g.expose(\n {\n listObjects: s3.list("examples"),\n getDownloadUrl: s3.presignGet({ bucket: "examples" }),\n signUploadUrl: s3.presignPut({ bucket: "examples" }),\n upload: s3.upload(\n "examples",\n t.file({ allow: ["image/png", "image/jpeg"] })\n ),\n uploadMany: s3.uploadAll("examples"),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/files-upload.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7050],{9677:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,RM:()=>o});var i=t(86070),s=t(25710),a=t(65671);t(7871);const o=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"S3Runtime"})," can be used to interact with object storage APIs that are S3 compatible. Object storages like S3 are commonly used to cover app needs around large blob data like uploading and serving images. Most object storage services provide S3 compatible APIs including the open-source ",(0,i.jsx)(n.a,{href:"https://min.io/",children:"MinIO"})," engine which you can run locally for development."]}),"\n",(0,i.jsx)(n.p,{children:"For the following example, you'll need to setup your S3 compatible store first. The following snippet can get you started using minio on docker compose:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'services:\n minio:\n image: bitnami/minio:2022\n platform: linux/amd64\n restart: always\n ports:\n - "9000:9000"\n - "9001:9001"\n environment:\n MINIO_REGION_NAME: local\n MINIO_ROOT_USER: minio\n MINIO_ROOT_PASSWORD: password\n MINIO_DEFAULT_BUCKETS: "bucket:none"\n'})}),"\n",(0,i.jsxs)(n.p,{children:["We then provide the following secrets to our typegraph through ",(0,i.jsx)(n.code,{children:"metatype.yml"}),"."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yml",children:'typegates:\n dev:\n secrets:\n # ..\n # replace "files-upload" by the name of your typegraph\n files-upload:\n S3_HOST: http://localhost:9000\n S3_REGION: local\n S3_ACCESS_KEY: minio\n S3_SECRET_KEY: password\n S3_PATH_STYLE: true\n'})}),"\n",(0,i.jsx)(n.p,{children:"Our typegraph will then look something like:"}),"\n",(0,i.jsx)(a.A,{typegraph:"files-upload",typescript:t(96144),python:t(2950),query:t(52852)}),"\n",(0,i.jsxs)(n.p,{children:["Peruse the ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:"reference"})," on the ",(0,i.jsx)(n.code,{children:"S3Runtime"})," for more information."]})]})}function r(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},52897:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>r,toc:()=>d});var i=t(86070),s=t(25710),a=t(9677);const o={sidebar_position:50},l="Upload files to cloud storage",r={id:"guides/files-upload/index",title:"Upload files to cloud storage",description:"We can then use this typegraph from our client code like so:",source:"@site/docs/guides/files-upload/index.mdx",sourceDirName:"guides/files-upload",slug:"/guides/files-upload/",permalink:"/docs/guides/files-upload/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/files-upload/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Custom functions",permalink:"/docs/guides/external-functions/"},next:{title:"Write REST endpoints",permalink:"/docs/guides/rest/"}},p={},d=[...a.RM,{value:"Uploading file using GraphQL multipart request",id:"uploading-file-using-graphql-multipart-request",level:3}];function c(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"upload-files-to-cloud-storage",children:"Upload files to cloud storage"}),"\n",(0,i.jsx)(a.Ay,{}),"\n",(0,i.jsx)(n.p,{children:"We can then use this typegraph from our client code like so:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:'const image = await Deno.readFile("website/static/images/logo.png");\n\n// Get a presigned url\nconst {\n data: { signUploadUrl: presigned },\n} = await fetch("http://localhost:7891/files-upload", {\n method: "POST",\n body: JSON.stringify({\n query: `\n query SignUploadUrl($length: Int) {\n signUploadUrl(length: $length, path: "my-super-image.png")\n }\n `,\n variables: {\n length: image.length,\n },\n }),\n}).then((r) => r.json());\n\n// Upload the file\nconst upload = await fetch(presigned, {\n method: "PUT",\n body: image,\n headers: {\n "content-type": "image/png",\n "content-length": image.length,\n },\n});\n\nconsole.log(upload.status);\n'})}),"\n",(0,i.jsx)(n.h3,{id:"uploading-file-using-graphql-multipart-request",children:"Uploading file using GraphQL multipart request"}),"\n",(0,i.jsxs)(n.p,{children:["Metatype supports\n",(0,i.jsx)(n.a,{href:"https://github.com/jaydenseric/graphql-multipart-request-spec",children:"GraphQL multipart request"}),"\nfor uploading files.\nYou may use one of the clients in this\n",(0,i.jsx)(n.a,{href:"https://github.com/jaydenseric/graphql-multipart-request-spec#client",children:"list"}),"\nthat support GraphQL multipart request."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:'const image = await Deno.readFile("website/static/images/logo.png");\n\nconst formData = new FormData();\nformData.append(\n "operations",\n JSON.stringify({\n query: `\n mutation UploadImage($file: Upload!) {\n upload(file: $file) {\n id\n path\n size\n contentType\n }\n }\n `,\n variables: {\n file: null,\n },\n }),\n);\nformData.append("map", JSON.stringify({ 0: ["variables.file"] }));\nformData.append("0", image, "logo.png");\n\nconst upload = await fetch("http://localhost:7891/files-upload", {\n method: "POST",\n body: formData,\n});\nconsole.log(await upload.json());\n'})})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});var i=t(98302),s=(t(30758),t(86070));function a(e){let{python:n,typescript:t,rust:a,...o}=e;const l=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==l.length?void 0:l,...o})}},52852:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"listObjects"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"keys"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"size"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"{\n listObjects {\n keys {\n key\n size\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},2950:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.aws import S3Runtime\n\n# skip-next-line\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n name="files-upload",\n # skip-next-line\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef files_upload(g: Graph):\n s3 = S3Runtime(\n # we provide the name of the env vars\n # the typegate will read from\n "S3_HOST",\n "S3_REGION",\n "S3_ACCESS_KEY",\n "S3_SECRET_KEY",\n path_style_secret="S3_PATH_STYLE",\n )\n\n g.expose(\n Policy.public(),\n # we can then generate helpers for interacting with our runtime\n listObjects=s3.list("examples"),\n getDownloadUrl=s3.presign_get("examples"),\n signUploadUrl=s3.presign_put("examples"),\n upload=s3.upload("examples", t.file(allow=["image/png", "image/jpeg"])),\n uploadMany=s3.upload_all("examples"),\n )',path:"../examples/typegraphs/files-upload.py"}},96144:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { S3Runtime } from "@typegraph/sdk/providers/aws.ts";\n\nawait typegraph(\n {\n name: "files-upload",\n },\n (g) => {\n const s3 = new S3Runtime({\n hostSecret: "S3_HOST",\n regionSecret: "S3_REGION",\n accessKeySecret: "S3_ACCESS_KEY",\n secretKeySecret: "S3_SECRET_KEY",\n pathStyleSecret: "S3_PATH_STYLE",\n });\n\n g.expose(\n {\n listObjects: s3.list("examples"),\n getDownloadUrl: s3.presignGet({ bucket: "examples" }),\n signUploadUrl: s3.presignPut({ bucket: "examples" }),\n upload: s3.upload(\n "examples",\n t.file({ allow: ["image/png", "image/jpeg"] }),\n ),\n uploadMany: s3.uploadAll("examples"),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/files-upload.ts"}}}]); \ No newline at end of file diff --git a/assets/js/289ade6e.6f6236ce.js b/assets/js/289ade6e.bf467dbf.js similarity index 92% rename from assets/js/289ade6e.6f6236ce.js rename to assets/js/289ade6e.bf467dbf.js index cd4bed314e..306752a200 100644 --- a/assets/js/289ade6e.6f6236ce.js +++ b/assets/js/289ade6e.bf467dbf.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7525],{92809:(e,a,t)=>{"use strict";t.r(a),t.d(a,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var n=t(86070),i=t(25710),o=t(65671);const s={},r="Programmable API gateway",c={id:"programmable-api-gateway/index",title:"Programmable API gateway",description:"A programmable API gateway is an API gateway that provides a customizable framework for developers to create and deploy custom logic and policies for incoming requests and outgoing responses. Unlike traditional API gateways that provide a fixed set of features and policies, programmable API gateways offer a more flexible and extensible approach to managing APIs.",source:"@site/use-cases/programmable-api-gateway/index.mdx",sourceDirName:"programmable-api-gateway",slug:"/programmable-api-gateway/",permalink:"/use-cases/programmable-api-gateway/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/programmable-api-gateway/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"ORM for the edge",permalink:"/use-cases/orm-for-the-edge/"}},l={},d=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function p(e){const a={h1:"h1",h2:"h2",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.h1,{id:"programmable-api-gateway",children:"Programmable API gateway"}),"\n",(0,n.jsx)(a.p,{children:"A programmable API gateway is an API gateway that provides a customizable framework for developers to create and deploy custom logic and policies for incoming requests and outgoing responses. Unlike traditional API gateways that provide a fixed set of features and policies, programmable API gateways offer a more flexible and extensible approach to managing APIs."}),"\n",(0,n.jsx)(a.h2,{id:"case-study",children:"Case study"}),"\n",(0,n.jsx)("div",{className:"text-center md:float-right p-8",children:(0,n.jsx)(a.p,{children:(0,n.jsx)(a.img,{src:t(81421).A+""})})}),"\n",(0,n.jsx)(a.p,{children:"Suppose that your company needs to implement various policies and logic to manage and secure its APIs, such as rate limiting, caching, and request/response transformations."}),"\n",(0,n.jsx)(a.p,{children:"To achieve this, the company can adopt a programmable API gateway that allows developers to create and deploy custom function to implement additional logic and policies for incoming requests and outgoing responses."}),"\n",(0,n.jsx)(a.p,{children:"It also provides a platform for the company to manage its API infrastructure more efficiently and flexibly. Developers can leverage existing libraries and frameworks to quickly build and deploy custom logic, reducing the time and effort required to develop and maintain the API gateway."}),"\n",(0,n.jsx)(a.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,n.jsx)(a.p,{children:"Metatype provide a Python SDK for developers to create and deploy custom logic and policies, which can later be deployed to the gateway in a single command line. Importers can also be used to import existing API or logic definitions from other sources, such as OpenAPI, GraphQL, and gRPC."}),"\n",(0,n.jsx)(a.p,{children:"This enables developer to quickly build and deploy any update the API or the business logic without having to worry about the underlying infrastructure."}),"\n",(0,n.jsx)(o.A,{typegraph:"programmable-api-gateway",python:t(44592),typescript:t(68246),query:t(74839)})]})}function m(e={}){const{wrapper:a}={...(0,i.R)(),...e.components};return a?(0,n.jsx)(a,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},65671:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var n=t(98302),i=(t(30758),t(86070));function o(e){let{python:a,typescript:t,rust:o,...s}=e;const r=[a&&{content:a.content,codeLanguage:"python",codeFileUrl:a.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,i.jsx)(n.A,{code:0==r.length?void 0:r,...s})}},74839:e=>{var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"static_a"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"foo"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"static_b"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"foo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:75}};a.loc.source={body:"query A {\n static_a {\n foo\n }\n}\n\nquery B {\n static_b {\n foo\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,a){if("FragmentSpread"===e.kind)a.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&a.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,a)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,a)})),e.definitions&&e.definitions.forEach((function(e){t(e,a)}))}var n={};function i(e,a){for(var t=0;t0;){var c=r;r=new Set,c.forEach((function(e){s.has(e)||(s.add(e),(n[e]||new Set).forEach((function(e){r.add(e)})))}))}return s.forEach((function(a){var n=i(e,a);n&&t.definitions.push(n)})),t}a.definitions.forEach((function(e){if(e.name){var a=new Set;t(e,a),n[e.name.value]=a}})),e.exports=a,e.exports.A=o(a,"A"),e.exports.B=o(a,"B")},81421:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});const n=t.p+"assets/images/image.drawio-c3feec9409b941440f13260d6a23c2d4.svg"},44592:e=>{e.exports={content:'@typegraph(\n)\ndef programmable_api_gateway(g: Graph):\n deno = DenoRuntime()\n\n public = Policy.public()\n roulette_access = deno.policy("roulette", "() => Math.random() < 0.5")\n\n my_api_format = """\n static_a:\n access: roulette_access\n foo: rab\n static_b:\n access: public\n foo: bar\n """\n\n for field, static_vals in yaml.safe_load(my_api_format).items():\n g.expose(\n public if static_vals.pop("access") == "public" else roulette_access,\n **{field: deno.static(t.struct({"foo": t.string()}), static_vals)},\n )',path:"../examples/typegraphs/programmable-api-gateway.py"}},68246:e=>{e.exports={content:'typegraph(\n {\n name: "programmable-api-gateway",\n },\n (g) => {\n const deno = new DenoRuntime();\n\n const pub = Policy.public();\n const roulette_access = deno.policy(\n "roulette",\n "() => Math.random() < 0.5"\n );\n\n static_a: { foo: "rab", access: "roulette_access" },\n static_b: { foo: "bar", access: "public" },\n };\n\n for (const [k, static_vals] of Object.entries(myApiFormat)) {\n const policy = static_vals["access"] == "public" ? pub : roulette_access;\n g.expose(\n {\n [k]: deno.static(t.struct({ foo: t.string() }), {\n foo: static_vals["foo"],\n }),\n },\n policy\n );\n }\n }\n);',path:"../examples/typegraphs/programmable-api-gateway.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7525],{92809:(e,a,t)=>{"use strict";t.r(a),t.d(a,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var n=t(86070),i=t(25710),o=t(65671);const s={},r="Programmable API gateway",c={id:"programmable-api-gateway/index",title:"Programmable API gateway",description:"A programmable API gateway is an API gateway that provides a customizable framework for developers to create and deploy custom logic and policies for incoming requests and outgoing responses. Unlike traditional API gateways that provide a fixed set of features and policies, programmable API gateways offer a more flexible and extensible approach to managing APIs.",source:"@site/use-cases/programmable-api-gateway/index.mdx",sourceDirName:"programmable-api-gateway",slug:"/programmable-api-gateway/",permalink:"/use-cases/programmable-api-gateway/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/programmable-api-gateway/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"ORM for the edge",permalink:"/use-cases/orm-for-the-edge/"}},l={},d=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function p(e){const a={h1:"h1",h2:"h2",img:"img",p:"p",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.h1,{id:"programmable-api-gateway",children:"Programmable API gateway"}),"\n",(0,n.jsx)(a.p,{children:"A programmable API gateway is an API gateway that provides a customizable framework for developers to create and deploy custom logic and policies for incoming requests and outgoing responses. Unlike traditional API gateways that provide a fixed set of features and policies, programmable API gateways offer a more flexible and extensible approach to managing APIs."}),"\n",(0,n.jsx)(a.h2,{id:"case-study",children:"Case study"}),"\n",(0,n.jsx)("div",{className:"text-center md:float-right p-8",children:(0,n.jsx)(a.p,{children:(0,n.jsx)(a.img,{src:t(81421).A+""})})}),"\n",(0,n.jsx)(a.p,{children:"Suppose that your company needs to implement various policies and logic to manage and secure its APIs, such as rate limiting, caching, and request/response transformations."}),"\n",(0,n.jsx)(a.p,{children:"To achieve this, the company can adopt a programmable API gateway that allows developers to create and deploy custom function to implement additional logic and policies for incoming requests and outgoing responses."}),"\n",(0,n.jsx)(a.p,{children:"It also provides a platform for the company to manage its API infrastructure more efficiently and flexibly. Developers can leverage existing libraries and frameworks to quickly build and deploy custom logic, reducing the time and effort required to develop and maintain the API gateway."}),"\n",(0,n.jsx)(a.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,n.jsx)(a.p,{children:"Metatype provide a Python SDK for developers to create and deploy custom logic and policies, which can later be deployed to the gateway in a single command line. Importers can also be used to import existing API or logic definitions from other sources, such as OpenAPI, GraphQL, and gRPC."}),"\n",(0,n.jsx)(a.p,{children:"This enables developer to quickly build and deploy any update the API or the business logic without having to worry about the underlying infrastructure."}),"\n",(0,n.jsx)(o.A,{typegraph:"programmable-api-gateway",python:t(44592),typescript:t(68246),query:t(74839)})]})}function m(e={}){const{wrapper:a}={...(0,i.R)(),...e.components};return a?(0,n.jsx)(a,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},65671:(e,a,t)=>{"use strict";t.d(a,{A:()=>o});var n=t(98302),i=(t(30758),t(86070));function o(e){let{python:a,typescript:t,rust:o,...s}=e;const r=[a&&{content:a.content,codeLanguage:"python",codeFileUrl:a.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,i.jsx)(n.A,{code:0==r.length?void 0:r,...s})}},74839:e=>{var a={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"static_a"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"foo"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"static_b"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"foo"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:75}};a.loc.source={body:"query A {\n static_a {\n foo\n }\n}\n\nquery B {\n static_b {\n foo\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,a){if("FragmentSpread"===e.kind)a.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&a.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,a)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,a)})),e.definitions&&e.definitions.forEach((function(e){t(e,a)}))}var n={};function i(e,a){for(var t=0;t0;){var c=r;r=new Set,c.forEach((function(e){s.has(e)||(s.add(e),(n[e]||new Set).forEach((function(e){r.add(e)})))}))}return s.forEach((function(a){var n=i(e,a);n&&t.definitions.push(n)})),t}a.definitions.forEach((function(e){if(e.name){var a=new Set;t(e,a),n[e.name.value]=a}})),e.exports=a,e.exports.A=o(a,"A"),e.exports.B=o(a,"B")},81421:(e,a,t)=>{"use strict";t.d(a,{A:()=>n});const n=t.p+"assets/images/image.drawio-c3feec9409b941440f13260d6a23c2d4.svg"},44592:e=>{e.exports={content:'@typegraph(\n)\ndef programmable_api_gateway(g: Graph):\n deno = DenoRuntime()\n\n public = Policy.public()\n roulette_access = deno.policy("roulette", "() => Math.random() < 0.5")\n\n my_api_format = """\n static_a:\n access: roulette_access\n foo: rab\n static_b:\n access: public\n foo: bar\n """\n\n for field, static_vals in yaml.safe_load(my_api_format).items():\n g.expose(\n public if static_vals.pop("access") == "public" else roulette_access,\n **{field: deno.static(t.struct({"foo": t.string()}), static_vals)},\n )',path:"../examples/typegraphs/programmable-api-gateway.py"}},68246:e=>{e.exports={content:'typegraph(\n {\n name: "programmable-api-gateway",\n },\n (g) => {\n const deno = new DenoRuntime();\n\n const pub = Policy.public();\n const roulette_access = deno.policy(\n "roulette",\n "() => Math.random() < 0.5",\n );\n\n static_a: { foo: "rab", access: "roulette_access" },\n static_b: { foo: "bar", access: "public" },\n };\n\n for (const [k, static_vals] of Object.entries(myApiFormat)) {\n const policy = static_vals["access"] == "public" ? pub : roulette_access;\n g.expose(\n {\n [k]: deno.static(t.struct({ foo: t.string() }), {\n foo: static_vals["foo"],\n }),\n },\n policy,\n );\n }\n },\n);',path:"../examples/typegraphs/programmable-api-gateway.ts"}}}]); \ No newline at end of file diff --git a/assets/js/2df24393.03f52b71.js b/assets/js/2df24393.f0dc955c.js similarity index 91% rename from assets/js/2df24393.03f52b71.js rename to assets/js/2df24393.f0dc955c.js index a5fc98f1d7..4c22c230fe 100644 --- a/assets/js/2df24393.03f52b71.js +++ b/assets/js/2df24393.f0dc955c.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8598],{77162:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var t=i(86070),o=i(25710),s=(i(7871),i(65671));const r={sidebar_position:3},a="Policies",c={id:"reference/policies/index",title:"Policies",description:"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity.",source:"@site/docs/reference/policies/index.mdx",sourceDirName:"reference/policies",slug:"/reference/policies/",permalink:"/docs/reference/policies/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/policies/index.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"docs",previous:{title:"Wasm",permalink:"/docs/reference/runtimes/wasm/"},next:{title:"Ecosystem",permalink:"/docs/reference/ecosystem/"}},l={},d=[{value:"Policy based access control (PBAC)",id:"policy-based-access-control-pbac",level:2}];function u(e){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"policies",children:"Policies"}),"\n","\n",(0,t.jsx)(n.h1,{id:"policies-and-functions",children:"Policies and functions"}),"\n",(0,t.jsx)(n.p,{children:"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity."}),"\n",(0,t.jsx)(n.h2,{id:"policy-based-access-control-pbac",children:"Policy based access control (PBAC)"}),"\n",(0,t.jsx)(n.p,{children:"The Deno runtime enable to understand the last abstraction. Policies are a way to verify for each type whether the user is authorized or not to access it. It's a very powerful concept that can be for instance used to guarantee a given type is never accidentally exposed to the outside world."}),"\n",(0,t.jsx)(n.p,{children:"Metatype comes with some built-in policies, but you can use the Deno runtime to define your own:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"policies.public()"})," is an alias for ",(0,t.jsx)(n.code,{children:'Policy(PureFunMat("() => true"))'})," providing everyone open access."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:'policies.ctx("role_value", "role_field")'})," is a companion policy for the authentication strategy you learned in the previous section. It will verify the context and give adequate access to the user."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Policies are hierarchical in the sense that the request starts with a denial, and the root functions must explicitly provide an access or not. Once access granted, any further types can either inherit or override the access. Policies evaluate in order in case multiple ones are defined."}),"\n",(0,t.jsx)(s.A,{typegraph:"policies",python:i(85775),typescript:i(22481),query:i(6931)})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>s});var t=i(98302),o=(i(30758),i(86070));function s(e){let{python:n,typescript:i,rust:s,...r}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(t.A,{code:0==a.length?void 0:a,...r})}},6931:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"public"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"both"},arguments:[],directives:[]}]}}],loc:{start:0,end:92}};n.loc.source={body:"query A {\n public\n}\n\nquery B {\n admin_only\n}\n\nquery C {\n user_only\n}\n\nquery D {\n both\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function o(e,n){for(var i=0;i0;){var c=a;a=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(t[e]||new Set).forEach((function(e){a.add(e)})))}))}return r.forEach((function(n){var t=o(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=s(n,"A"),e.exports.B=s(n,"B"),e.exports.C=s(n,"C"),e.exports.D=s(n,"D")},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null"\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null"\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8598],{77162:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>p,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var t=i(86070),o=i(25710),s=(i(7871),i(65671));const r={sidebar_position:3},a="Policies",c={id:"reference/policies/index",title:"Policies",description:"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity.",source:"@site/docs/reference/policies/index.mdx",sourceDirName:"reference/policies",slug:"/reference/policies/",permalink:"/docs/reference/policies/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/policies/index.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"docs",previous:{title:"Wasm",permalink:"/docs/reference/runtimes/wasm/"},next:{title:"Ecosystem",permalink:"/docs/reference/ecosystem/"}},l={},d=[{value:"Policy based access control (PBAC)",id:"policy-based-access-control-pbac",level:2}];function u(e){const n={code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"policies",children:"Policies"}),"\n","\n",(0,t.jsx)(n.h1,{id:"policies-and-functions",children:"Policies and functions"}),"\n",(0,t.jsx)(n.p,{children:"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity."}),"\n",(0,t.jsx)(n.h2,{id:"policy-based-access-control-pbac",children:"Policy based access control (PBAC)"}),"\n",(0,t.jsx)(n.p,{children:"The Deno runtime enable to understand the last abstraction. Policies are a way to verify for each type whether the user is authorized or not to access it. It's a very powerful concept that can be for instance used to guarantee a given type is never accidentally exposed to the outside world."}),"\n",(0,t.jsx)(n.p,{children:"Metatype comes with some built-in policies, but you can use the Deno runtime to define your own:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"policies.public()"})," is an alias for ",(0,t.jsx)(n.code,{children:'Policy(PureFunMat("() => true"))'})," providing everyone open access."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:'policies.ctx("role_value", "role_field")'})," is a companion policy for the authentication strategy you learned in the previous section. It will verify the context and give adequate access to the user."]}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Policies are hierarchical in the sense that the request starts with a denial, and the root functions must explicitly provide an access or not. Once access granted, any further types can either inherit or override the access. Policies evaluate in order in case multiple ones are defined."}),"\n",(0,t.jsx)(s.A,{typegraph:"policies",python:i(85775),typescript:i(22481),query:i(6931)})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(u,{...e})}):u(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>s});var t=i(98302),o=(i(30758),i(86070));function s(e){let{python:n,typescript:i,rust:s,...r}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(t.A,{code:0==a.length?void 0:a,...r})}},6931:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"public"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"both"},arguments:[],directives:[]}]}}],loc:{start:0,end:92}};n.loc.source={body:"query A {\n public\n}\n\nquery B {\n admin_only\n}\n\nquery C {\n user_only\n}\n\nquery D {\n both\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function o(e,n){for(var i=0;i0;){var c=a;a=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(t[e]||new Set).forEach((function(e){a.add(e)})))}))}return r.forEach((function(n){var t=o(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=s(n,"A"),e.exports.B=s(n,"B"),e.exports.C=s(n,"C"),e.exports.D=s(n,"D")},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub,\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file diff --git a/assets/js/3169f45d.1a107590.js b/assets/js/3169f45d.29f830ab.js similarity index 95% rename from assets/js/3169f45d.1a107590.js rename to assets/js/3169f45d.29f830ab.js index d396eecad1..a766a01c1f 100644 --- a/assets/js/3169f45d.1a107590.js +++ b/assets/js/3169f45d.29f830ab.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3597],{16678:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>u,default:()=>m,frontMatter:()=>o,metadata:()=>d,toc:()=>p});var i=t(86070),s=t(25710),r=t(65671),a=t(65480),c=t(27676);const o={},u="HTTP/REST",d={id:"reference/runtimes/http/index",title:"HTTP/REST",description:"HTTP Runtime",source:"@site/docs/reference/runtimes/http/index.mdx",sourceDirName:"reference/runtimes/http",slug:"/reference/runtimes/http/",permalink:"/docs/reference/runtimes/http/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/http/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"gRPC Runtime",permalink:"/docs/reference/runtimes/grpc/"},next:{title:"Kv",permalink:"/docs/reference/runtimes/kv/"}},l={},p=[{value:"HTTP Runtime",id:"http-runtime",level:2},{value:"Verbs",id:"verbs",level:2}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"httprest",children:"HTTP/REST"}),"\n",(0,i.jsx)(n.h2,{id:"http-runtime",children:"HTTP Runtime"}),"\n",(0,i.jsx)(n.p,{children:"The HTTPRuntime allows your typegraphs to access external REST APIs."}),"\n",(0,i.jsx)(n.p,{children:"Common use cases (but not limited to):"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Enable consuming one or more REST APIs through the same interface"}),"\n",(0,i.jsxs)(n.li,{children:["Programmatically generate typegraphs from an existing ",(0,i.jsx)(n.a,{href:"https://swagger.io/specification/",children:"openapi specs"})," or similar"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Example:"}),"\n",(0,i.jsx)(r.A,{typegraph:"http-runtime",typescript:t(65794),python:t(88820),query:t(60431)}),"\n",(0,i.jsx)(n.h2,{id:"verbs",children:"Verbs"}),"\n",(0,i.jsxs)(n.p,{children:["This runtime supports ",(0,i.jsx)(n.code,{children:"GET"}),", ",(0,i.jsx)(n.code,{children:"POST"}),", ",(0,i.jsx)(n.code,{children:"PUT"}),", ",(0,i.jsx)(n.code,{children:"DELETE"})," http verbs."]}),"\n",(0,i.jsxs)(n.p,{children:["In most cases, queries are not limited to a simple query parameter or use the default ",(0,i.jsx)(n.code,{children:"application/json"})," content type. You can assign what parts of your request description each field in the input struct belongs to."]}),"\n",(0,i.jsxs)(n.p,{children:["In the example bellow, this endpoint corresponds to ",(0,i.jsx)(n.code,{children:"POST /submit_user?form_type=.."})," with a body requiring the fields: ",(0,i.jsx)(n.code,{children:"pseudo"}),", ",(0,i.jsx)(n.code,{children:"age"})," and with header ",(0,i.jsx)(n.code,{children:"accept"})," set as ",(0,i.jsx)(n.code,{children:"application/json"}),"."]}),"\n",(0,i.jsxs)(a.Ay,{children:[(0,i.jsx)(c.A,{value:"python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'# ..\n remote = HTTPRuntime("")\n g.expose(\n pub,\n add_user=remote.post(\n "/submit_user",\n # define your input/output\n t.struct(\n {\n "id": t.uuid(),\n "username": t.float(),\n "years_lived": t.integer(),\n "form_type": t.integer(),\n "config_accept": t.string().set("application/json")\n },\n ),\n t.struct({ "message": t.string() }),\n # specify where each field in your input should be associated with\n body_fields=("username", "years_lived"),\n query_fields=("form_type"),\n # you may want to rename a few fields\n # if you are using your own naming conventions or reusing types\n rename_fields={\n "username": "pseudo",\n "years_lived": "age",\n },\n content_type="multipart/form-data",\n # set a custom header prefix\n header_prefix="config_"\n )\n )\n# ..\n'})})}),(0,i.jsx)(c.A,{value:"typescript",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:'// ..\n const remote = new HttpRuntime("");\n g.expose({\n add_user: remote.post(\n // define your input/output\n t.struct(\n {\n id: t.uuid(),\n username: t.float(),\n years_lived: t.integer(),\n form_type: t.integer()\n },\n ),\n t.struct({ message: t.string() }),\n {\n path: "/submit_user",\n // specify where each field in your input should be associated with\n bodyFields: ["username", "years_lived"],\n queryFields: ["form_type"],\n // you may want to rename a few fields\n // if you are using your own naming conventions or reusing types\n renameFields: [\n ["username", "pseudo"],\n ["years_lived", "age"],\n ],\n contentType: "multipart/form-data",\n }\n )}, pub);\n// ..\n'})})})]})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>a,gc:()=>c});t(30758);var i=t(3733),s=t(56315),r=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,i.e)();return(0,r.jsx)(s.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function c(e){let{children:n}=e;const[t]=(0,i.e)();return(0,r.jsx)(s.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(98302),s=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...a}=e;const c=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==c.length?void 0:c,...a})}},60431:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"facts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"StringValue",value:"en",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"facts_as_text"},arguments:[{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"StringValue",value:"en",block:!1}}],directives:[]}]}}],loc:{start:0,end:121}};n.loc.source={body:'query {\n facts(language: "en") {\n id\n text\n # source_url\n # permalink\n }\n facts_as_text(language: "en")\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},88820:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.runtimes import HttpRuntime\n\n\n@typegraph(\n)\ndef http_runtime(g: Graph):\n pub = Policy.public()\n\n # highlight-next-line\n facts = HttpRuntime("https://uselessfacts.jsph.pl/api/v2/facts")\n\n g.expose(\n pub,\n facts=facts.get(\n "/random",\n t.struct({"language": t.enum(["en", "de"])}),\n t.struct(\n {\n "id": t.string(),\n "text": t.string(),\n "source": t.string(),\n "source_url": t.string(),\n "language": t.string(),\n "permalink": t.string(),\n }\n ),\n ),\n facts_as_text=facts.get(\n "/random",\n t.struct(\n {\n "header_accept": t.string().set("text/plain"),\n "language": t.enum(["en", "de"]),\n }\n ),\n t.string(),\n header_prefix="header_",\n ),\n )',path:"../examples/typegraphs/http-runtime.py"}},65794:e=>{e.exports={content:'// highlight-next-line\nimport { HttpRuntime } from "@typegraph/sdk/runtimes/http.ts";\n\nawait typegraph(\n {\n name: "http-runtime",\n },\n (g) => {\n // highlight-next-line\n const facts = new HttpRuntime("https://uselessfacts.jsph.pl/api/v2/facts");\n const pub = Policy.public();\n\n g.expose(\n {\n facts: facts.get(\n t.struct({\n language: t.enum_(["en", "de"]),\n }),\n t.struct({\n id: t.string(),\n text: t.string(),\n source: t.string(),\n source_url: t.string(),\n language: t.string(),\n permalink: t.string(),\n }),\n {\n path: "/random",\n }\n ),\n facts_as_text: facts.get(\n t.struct({\n header_accept: t.string().set("text/plain"),\n language: t.enum_(["en", "de"]),\n }),\n t.string(),\n { path: "/random", headerPrefix: "header_" }\n ),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/http-runtime.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3597],{16678:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>u,default:()=>m,frontMatter:()=>o,metadata:()=>d,toc:()=>p});var i=t(86070),s=t(25710),r=t(65671),a=t(65480),c=t(27676);const o={},u="HTTP/REST",d={id:"reference/runtimes/http/index",title:"HTTP/REST",description:"HTTP Runtime",source:"@site/docs/reference/runtimes/http/index.mdx",sourceDirName:"reference/runtimes/http",slug:"/reference/runtimes/http/",permalink:"/docs/reference/runtimes/http/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/http/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"gRPC Runtime",permalink:"/docs/reference/runtimes/grpc/"},next:{title:"Kv",permalink:"/docs/reference/runtimes/kv/"}},l={},p=[{value:"HTTP Runtime",id:"http-runtime",level:2},{value:"Verbs",id:"verbs",level:2}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"httprest",children:"HTTP/REST"}),"\n",(0,i.jsx)(n.h2,{id:"http-runtime",children:"HTTP Runtime"}),"\n",(0,i.jsx)(n.p,{children:"The HTTPRuntime allows your typegraphs to access external REST APIs."}),"\n",(0,i.jsx)(n.p,{children:"Common use cases (but not limited to):"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Enable consuming one or more REST APIs through the same interface"}),"\n",(0,i.jsxs)(n.li,{children:["Programmatically generate typegraphs from an existing ",(0,i.jsx)(n.a,{href:"https://swagger.io/specification/",children:"openapi specs"})," or similar"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Example:"}),"\n",(0,i.jsx)(r.A,{typegraph:"http-runtime",typescript:t(65794),python:t(88820),query:t(60431)}),"\n",(0,i.jsx)(n.h2,{id:"verbs",children:"Verbs"}),"\n",(0,i.jsxs)(n.p,{children:["This runtime supports ",(0,i.jsx)(n.code,{children:"GET"}),", ",(0,i.jsx)(n.code,{children:"POST"}),", ",(0,i.jsx)(n.code,{children:"PUT"}),", ",(0,i.jsx)(n.code,{children:"DELETE"})," http verbs."]}),"\n",(0,i.jsxs)(n.p,{children:["In most cases, queries are not limited to a simple query parameter or use the default ",(0,i.jsx)(n.code,{children:"application/json"})," content type. You can assign what parts of your request description each field in the input struct belongs to."]}),"\n",(0,i.jsxs)(n.p,{children:["In the example bellow, this endpoint corresponds to ",(0,i.jsx)(n.code,{children:"POST /submit_user?form_type=.."})," with a body requiring the fields: ",(0,i.jsx)(n.code,{children:"pseudo"}),", ",(0,i.jsx)(n.code,{children:"age"})," and with header ",(0,i.jsx)(n.code,{children:"accept"})," set as ",(0,i.jsx)(n.code,{children:"application/json"}),"."]}),"\n",(0,i.jsxs)(a.Ay,{children:[(0,i.jsx)(c.A,{value:"python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'# ..\n remote = HTTPRuntime("")\n g.expose(\n pub,\n add_user=remote.post(\n "/submit_user",\n # define your input/output\n t.struct(\n {\n "id": t.uuid(),\n "username": t.float(),\n "years_lived": t.integer(),\n "form_type": t.integer(),\n "config_accept": t.string().set("application/json")\n },\n ),\n t.struct({ "message": t.string() }),\n # specify where each field in your input should be associated with\n body_fields=("username", "years_lived"),\n query_fields=("form_type"),\n # you may want to rename a few fields\n # if you are using your own naming conventions or reusing types\n rename_fields={\n "username": "pseudo",\n "years_lived": "age",\n },\n content_type="multipart/form-data",\n # set a custom header prefix\n header_prefix="config_"\n )\n )\n# ..\n'})})}),(0,i.jsx)(c.A,{value:"typescript",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:'// ..\n const remote = new HttpRuntime("");\n g.expose({\n add_user: remote.post(\n // define your input/output\n t.struct(\n {\n id: t.uuid(),\n username: t.float(),\n years_lived: t.integer(),\n form_type: t.integer()\n },\n ),\n t.struct({ message: t.string() }),\n {\n path: "/submit_user",\n // specify where each field in your input should be associated with\n bodyFields: ["username", "years_lived"],\n queryFields: ["form_type"],\n // you may want to rename a few fields\n // if you are using your own naming conventions or reusing types\n renameFields: [\n ["username", "pseudo"],\n ["years_lived", "age"],\n ],\n contentType: "multipart/form-data",\n }\n )}, pub);\n// ..\n'})})})]})]})}function m(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>a,gc:()=>c});t(30758);var i=t(3733),s=t(56315),r=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,i.e)();return(0,r.jsx)(s.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function c(e){let{children:n}=e;const[t]=(0,i.e)();return(0,r.jsx)(s.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(98302),s=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...a}=e;const c=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==c.length?void 0:c,...a})}},60431:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"facts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"StringValue",value:"en",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"text"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"facts_as_text"},arguments:[{kind:"Argument",name:{kind:"Name",value:"language"},value:{kind:"StringValue",value:"en",block:!1}}],directives:[]}]}}],loc:{start:0,end:121}};n.loc.source={body:'query {\n facts(language: "en") {\n id\n text\n # source_url\n # permalink\n }\n facts_as_text(language: "en")\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},88820:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.runtimes import HttpRuntime\n\n\n@typegraph(\n)\ndef http_runtime(g: Graph):\n pub = Policy.public()\n\n # highlight-next-line\n facts = HttpRuntime("https://uselessfacts.jsph.pl/api/v2/facts")\n\n g.expose(\n pub,\n facts=facts.get(\n "/random",\n t.struct({"language": t.enum(["en", "de"])}),\n t.struct(\n {\n "id": t.string(),\n "text": t.string(),\n "source": t.string(),\n "source_url": t.string(),\n "language": t.string(),\n "permalink": t.string(),\n }\n ),\n ),\n facts_as_text=facts.get(\n "/random",\n t.struct(\n {\n "header_accept": t.string().set("text/plain"),\n "language": t.enum(["en", "de"]),\n }\n ),\n t.string(),\n header_prefix="header_",\n ),\n )',path:"../examples/typegraphs/http-runtime.py"}},65794:e=>{e.exports={content:'// highlight-next-line\nimport { HttpRuntime } from "@typegraph/sdk/runtimes/http.ts";\n\nawait typegraph(\n {\n name: "http-runtime",\n },\n (g) => {\n // highlight-next-line\n const facts = new HttpRuntime("https://uselessfacts.jsph.pl/api/v2/facts");\n const pub = Policy.public();\n\n g.expose(\n {\n facts: facts.get(\n t.struct({\n language: t.enum_(["en", "de"]),\n }),\n t.struct({\n id: t.string(),\n text: t.string(),\n source: t.string(),\n source_url: t.string(),\n language: t.string(),\n permalink: t.string(),\n }),\n {\n path: "/random",\n },\n ),\n facts_as_text: facts.get(\n t.struct({\n header_accept: t.string().set("text/plain"),\n language: t.enum_(["en", "de"]),\n }),\n t.string(),\n { path: "/random", headerPrefix: "header_" },\n ),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/http-runtime.ts"}}}]); \ No newline at end of file diff --git a/assets/js/42ecd3be.225949bf.js b/assets/js/42ecd3be.159be4ce.js similarity index 83% rename from assets/js/42ecd3be.225949bf.js rename to assets/js/42ecd3be.159be4ce.js index e620ca165b..4e13988f31 100644 --- a/assets/js/42ecd3be.225949bf.js +++ b/assets/js/42ecd3be.159be4ce.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2829],{88572:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>d,RM:()=>c});var i=t(86070),o=t(25710),s=t(65671),r=t(65480),a=t(27676);const c=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) is a mechanism that allows or denies cross-origin requests in the browser. It prevents websites that you've not explicitly allowed from using your API. Note that it doesn't protect non-browser clients like server side code or a mobile app from using your typegraphs, only browsers implements the CORS mechanism. More details can be found ",(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/HTTP/CORS",children:"here"}),"."]}),"\n",(0,i.jsxs)(r.Ay,{children:[(0,i.jsx)(a.A,{value:"typescript",children:(0,i.jsx)(s.A,{typegraph:"cors",typescript:t(66906),query:t(4489)})}),(0,i.jsx)(a.A,{value:"python",children:(0,i.jsx)(s.A,{typegraph:"cors",python:t(71388),query:t(4489)})})]}),"\n",(0,i.jsx)(n.p,{children:"If your browser support well CORS, you should the following error if you try to run the interactive demo."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "NetworkError when attempting to fetch resource.",\n "stack": ""\n }\n ]\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"Look in the network tab of your browser inspect tools to see the error proper."}),"\n",(0,i.jsx)(n.p,{children:"By the way, there is a hidden cors header in all interactive demos you have met so far:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'# ..\nCors(allow_origin=["https://metatype.dev", "http://localhost:3000"])\n# ..\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},23233:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var i=t(86070),o=t(25710),s=(t(88572),t(27676),t(65671));const r={sidebar_position:50},a="Secure your requests",c={id:"guides/securing-requests/index",title:"Secure your requests",description:"Authentication",source:"@site/docs/guides/securing-requests/index.mdx",sourceDirName:"guides/securing-requests",slug:"/guides/securing-requests/",permalink:"/docs/guides/securing-requests/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/securing-requests/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Write REST endpoints",permalink:"/docs/guides/rest/"},next:{title:"Wasm functions",permalink:"/docs/guides/wasm-functions/"}},l={},d=[{value:"Authentication",id:"authentication",level:2},{value:"Policies",id:"policies",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"secure-your-requests",children:"Secure your requests"}),"\n",(0,i.jsx)(n.h2,{id:"authentication",children:"Authentication"}),"\n",(0,i.jsx)(n.p,{children:"Typegraphs supports multiple auth schemes for incoming requests including:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#basic-authentication",children:"Basic access"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#jwt-authentication",children:"JSON Web Tokens (JWT)"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#oauth2-authorization",children:"OAuth2"})}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each scheme relies on tokens that will be expected on the ",(0,i.jsx)(n.code,{children:"Authorization"})," header of any incoming request. Information extracted from any found tokens will then be added to the context of every request. Each scheme allows for different secrets to be encoded in the tokens, secrets like user identification and access tokens. You can then use ",(0,i.jsx)(n.a,{href:"/docs/reference/policies",children:"policies"})," to examine the context and determine if a request is allowed access to parts of your typegraph. You can also ",(0,i.jsx)(n.a,{href:"/docs/reference/types/injections",children:"inject"})," data from the context, to set materalizer inputs for example, using ",(0,i.jsx)(n.code,{children:"from_context"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The following example uses basic authentication in order to only allow access for admin users. Basic authentication relies on a username and password pair. We specify the password through typegraph secrets with the format ",(0,i.jsx)(n.code,{children:"BASIC_{username}"}),". In this case, the secret ",(0,i.jsx)(n.code,{children:"BASIC_andim=password"})," is set."]}),"\n",(0,i.jsx)(s.A,{typegraph:"authentication",python:t(36310),typescript:t(37583),query:t(89280),headers:{Authorization:"Basic YW5kaW06cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,i.jsxs)(n.p,{children:["Note, the token is encoded in base64. Decoded, it'd read ",(0,i.jsx)(n.code,{children:"andim:password"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["If you were to try to send a request without the header, you'd notice that ",(0,i.jsx)(n.code,{children:"get_full_context"})," still returns a result. An empty object. Authentication is only responsible for populating the context object and without a policy to shoot down the request, it'll access the materalizers."]}),"\n",(0,i.jsxs)(n.p,{children:["On the other hand, ",(0,i.jsx)(n.code,{children:"get_context"})," returns an empty object when no header is found. ",(0,i.jsx)(n.code,{children:"from_context"})," acts as guard preventing the materalizer from being accessed unless the named data is found in the context."]}),"\n",(0,i.jsxs)(n.p,{children:["More details about authentication can be found ",(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"policies",children:"Policies"}),"\n",(0,i.jsxs)(n.p,{children:["The primary authorization paradigm used in typegraphs is ",(0,i.jsx)(n.a,{href:"/docs/reference/policies#policy-based-access-control-pbac",children:"policy based access control"}),". Policies are small pieces of logic that evaluate a request and determine whether access is allowed or not. They're attached to materalizers and are evaluated whenever a request tries to access the materalizer."]}),"\n",(0,i.jsxs)(n.p,{children:["Concretely, policies are implemented using ",(0,i.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom function"}),". These functions take the request's context object as input and return an optional bool. Typescript functions running on ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," is the recommended way for writing policies today and the following example demonstrates how."]}),"\n",(0,i.jsx)(n.p,{children:"Before anything, the following secrets are required to enable the basic authentication scheme."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'typegates:\n dev:\n # ..\n secrets:\n policies:\n BASIC_admin: "admin_pass"\n BASIC_user: "user_pass"\n'})}),"\n",(0,i.jsx)(s.A,{typegraph:"policies",typescript:t(22481),python:t(85775),query:t(64722),headers:{Authorization:"Basic YWRtaW46YWRtaW5fcGFzcw=="},tab:"headers"}),"\n",(0,i.jsx)(n.p,{children:"More than one policy can be attached to a single materalizer and combining policies allows for compositionaly defining our access control rules. If a materalizer has more than one policy, they are evaluated in turn and:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["If any one of attached policy returns ",(0,i.jsx)(n.code,{children:"true"}),", the request immediately gains access."]}),"\n",(0,i.jsxs)(n.li,{children:["If a policy returns ",(0,i.jsx)(n.code,{children:"false"}),", the request is immediately denied access."]}),"\n",(0,i.jsx)(n.li,{children:"If the policy means to defer decision to other attached policies, it can return null instead."}),"\n",(0,i.jsxs)(n.li,{children:["If all attached policies return ",(0,i.jsx)(n.code,{children:"null"}),", the request is denied access."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["There are helper functions on the ",(0,i.jsx)(n.code,{children:"Policy"})," object that allow easy construction of common policy patterns."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.public"}),": allow any request."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.internal"}),": allow requests originating from within typegraph like custom functions."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.on"}),": use different policies depending on request effect. Useful for policy shared across many materalizers."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.context"}),": generate a policy using a simple pattern matching on context object fields."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,gc:()=>a});t(30758);var i=t(3733),o=t(56315),s=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,i.e)();return(0,s.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:r,children:n})}function a(e){let{children:n}=e;const[t]=(0,i.e)();return(0,s.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var i=t(98302),o=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...r}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(i.A,{code:0==a.length?void 0:a,...r})}},89280:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_full_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"query {\n get_full_context\n get_context {\n username\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},64722:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"public"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"both"},arguments:[],directives:[]}]}}],loc:{start:0,end:92}};n.loc.source={body:"query A {\n public\n}\n\nquery B {\n admin_only\n}\n\nquery C {\n user_only\n}\n\nquery D {\n both\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};function o(e,n){for(var t=0;t0;){var c=a;a=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach((function(e){a.add(e)})))}))}return r.forEach((function(n){var i=o(e,n);i&&t.definitions.push(i)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.A=s(n,"A"),e.exports.B=s(n,"B"),e.exports.C=s(n,"C"),e.exports.D=s(n,"D")},4489:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"catch_me_if_you_can"},arguments:[],directives:[]}]}}],loc:{start:0,end:75}};n.loc.source={body:"query {\n catch_me_if_you_can\n # the results panel should show an error\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},36310:e=>{e.exports={content:'deno = DenoRuntime()\nctx = t.struct({"username": t.string().optional()})\n\n# highlight-start\n# expects a secret in metatype.yml\n# `BASIC_[username]`\n# highlight-next-line\ng.auth(Auth.basic(["andim"]))\n# highlight-end\n\ng.expose(\n Policy.public(),\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n get_full_context=deno.func(\n t.struct({}),\n t.string(),\n code="(_: any, ctx: any) => Deno.inspect(ctx.context)",\n ),\n)',path:"../examples/typegraphs/authentication.py"}},37583:e=>{e.exports={content:'const deno = new DenoRuntime();\n\nconst ctx = t.struct({\n username: t.string().optional(),\n});\n\n// highlight-start\n// expects a secret in metatype.yml\n// `BASIC_[username]`\n// highlight-next-line\ng.auth(Auth.basic(["andim"]));\n// highlight-end\n\ng.expose(\n {\n get_context: deno.identity(ctx).apply({\n username: g.fromContext("username"),\n }),\n get_full_context: deno.func(t.struct({}), t.string(), {\n code: "(_: any, ctx: any) => Deno.inspect(ctx.context)",\n }),\n },\n Policy.public()\n);',path:"../examples/typegraphs/authentication.ts"}},71388:e=>{e.exports={content:'@typegraph(\n # highlight-start\n cors=Cors(\n allow_origin=["https://not-this.domain"],\n allow_headers=["x-custom-header"],\n expose_headers=["header-1"],\n allow_credentials=True,\n max_age_sec=60,\n ),\n # highlight-end\n)\ndef cors(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n\n g.expose(\n Policy.public(),\n catch_me_if_you_can=random.gen(t.string()),\n )',path:"../examples/typegraphs/cors.py"}},66906:e=>{e.exports={content:'await typegraph(\n {\n name: "cors",\n // highlight-start\n cors: {\n allowOrigin: ["https://not-this.domain"],\n allowHeaders: ["x-custom-header"],\n exposeHeaders: ["header-1"],\n allowCredentials: true,\n maxAgeSec: 60,\n },\n // highlight-end\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n\n g.expose(\n {\n catch_me_if_you_can: random.gen(t.string()),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/cors.ts"}},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null"\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null"\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2829],{88572:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>d,RM:()=>c});var i=t(86070),o=t(25710),s=t(65671),r=t(65480),a=t(27676);const c=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) is a mechanism that allows or denies cross-origin requests in the browser. It prevents websites that you've not explicitly allowed from using your API. Note that it doesn't protect non-browser clients like server side code or a mobile app from using your typegraphs, only browsers implements the CORS mechanism. More details can be found ",(0,i.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/HTTP/CORS",children:"here"}),"."]}),"\n",(0,i.jsxs)(r.Ay,{children:[(0,i.jsx)(a.A,{value:"typescript",children:(0,i.jsx)(s.A,{typegraph:"cors",typescript:t(66906),query:t(4489)})}),(0,i.jsx)(a.A,{value:"python",children:(0,i.jsx)(s.A,{typegraph:"cors",python:t(71388),query:t(4489)})})]}),"\n",(0,i.jsx)(n.p,{children:"If your browser support well CORS, you should the following error if you try to run the interactive demo."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "NetworkError when attempting to fetch resource.",\n "stack": ""\n }\n ]\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"Look in the network tab of your browser inspect tools to see the error proper."}),"\n",(0,i.jsx)(n.p,{children:"By the way, there is a hidden cors header in all interactive demos you have met so far:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'# ..\nCors(allow_origin=["https://metatype.dev", "http://localhost:3000"])\n# ..\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},23233:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>h,frontMatter:()=>r,metadata:()=>c,toc:()=>d});var i=t(86070),o=t(25710),s=(t(88572),t(27676),t(65671));const r={sidebar_position:50},a="Secure your requests",c={id:"guides/securing-requests/index",title:"Secure your requests",description:"Authentication",source:"@site/docs/guides/securing-requests/index.mdx",sourceDirName:"guides/securing-requests",slug:"/guides/securing-requests/",permalink:"/docs/guides/securing-requests/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/securing-requests/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Write REST endpoints",permalink:"/docs/guides/rest/"},next:{title:"Wasm functions",permalink:"/docs/guides/wasm-functions/"}},l={},d=[{value:"Authentication",id:"authentication",level:2},{value:"Policies",id:"policies",level:2}];function u(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"secure-your-requests",children:"Secure your requests"}),"\n",(0,i.jsx)(n.h2,{id:"authentication",children:"Authentication"}),"\n",(0,i.jsx)(n.p,{children:"Typegraphs supports multiple auth schemes for incoming requests including:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#basic-authentication",children:"Basic access"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#jwt-authentication",children:"JSON Web Tokens (JWT)"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication#oauth2-authorization",children:"OAuth2"})}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["Each scheme relies on tokens that will be expected on the ",(0,i.jsx)(n.code,{children:"Authorization"})," header of any incoming request. Information extracted from any found tokens will then be added to the context of every request. Each scheme allows for different secrets to be encoded in the tokens, secrets like user identification and access tokens. You can then use ",(0,i.jsx)(n.a,{href:"/docs/reference/policies",children:"policies"})," to examine the context and determine if a request is allowed access to parts of your typegraph. You can also ",(0,i.jsx)(n.a,{href:"/docs/reference/types/injections",children:"inject"})," data from the context, to set materalizer inputs for example, using ",(0,i.jsx)(n.code,{children:"from_context"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["The following example uses basic authentication in order to only allow access for admin users. Basic authentication relies on a username and password pair. We specify the password through typegraph secrets with the format ",(0,i.jsx)(n.code,{children:"BASIC_{username}"}),". In this case, the secret ",(0,i.jsx)(n.code,{children:"BASIC_andim=password"})," is set."]}),"\n",(0,i.jsx)(s.A,{typegraph:"authentication",python:t(36310),typescript:t(37583),query:t(89280),headers:{Authorization:"Basic YW5kaW06cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,i.jsxs)(n.p,{children:["Note, the token is encoded in base64. Decoded, it'd read ",(0,i.jsx)(n.code,{children:"andim:password"}),"."]}),"\n",(0,i.jsxs)(n.p,{children:["If you were to try to send a request without the header, you'd notice that ",(0,i.jsx)(n.code,{children:"get_full_context"})," still returns a result. An empty object. Authentication is only responsible for populating the context object and without a policy to shoot down the request, it'll access the materalizers."]}),"\n",(0,i.jsxs)(n.p,{children:["On the other hand, ",(0,i.jsx)(n.code,{children:"get_context"})," returns an empty object when no header is found. ",(0,i.jsx)(n.code,{children:"from_context"})," acts as guard preventing the materalizer from being accessed unless the named data is found in the context."]}),"\n",(0,i.jsxs)(n.p,{children:["More details about authentication can be found ",(0,i.jsx)(n.a,{href:"/docs/reference/typegate/authentication",children:"here"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"policies",children:"Policies"}),"\n",(0,i.jsxs)(n.p,{children:["The primary authorization paradigm used in typegraphs is ",(0,i.jsx)(n.a,{href:"/docs/reference/policies#policy-based-access-control-pbac",children:"policy based access control"}),". Policies are small pieces of logic that evaluate a request and determine whether access is allowed or not. They're attached to materalizers and are evaluated whenever a request tries to access the materalizer."]}),"\n",(0,i.jsxs)(n.p,{children:["Concretely, policies are implemented using ",(0,i.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom function"}),". These functions take the request's context object as input and return an optional bool. Typescript functions running on ",(0,i.jsx)(n.code,{children:"DenoRuntime"})," is the recommended way for writing policies today and the following example demonstrates how."]}),"\n",(0,i.jsx)(n.p,{children:"Before anything, the following secrets are required to enable the basic authentication scheme."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:'typegates:\n dev:\n # ..\n secrets:\n policies:\n BASIC_admin: "admin_pass"\n BASIC_user: "user_pass"\n'})}),"\n",(0,i.jsx)(s.A,{typegraph:"policies",typescript:t(22481),python:t(85775),query:t(64722),headers:{Authorization:"Basic YWRtaW46YWRtaW5fcGFzcw=="},tab:"headers"}),"\n",(0,i.jsx)(n.p,{children:"More than one policy can be attached to a single materalizer and combining policies allows for compositionaly defining our access control rules. If a materalizer has more than one policy, they are evaluated in turn and:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["If any one of attached policy returns ",(0,i.jsx)(n.code,{children:"true"}),", the request immediately gains access."]}),"\n",(0,i.jsxs)(n.li,{children:["If a policy returns ",(0,i.jsx)(n.code,{children:"false"}),", the request is immediately denied access."]}),"\n",(0,i.jsx)(n.li,{children:"If the policy means to defer decision to other attached policies, it can return null instead."}),"\n",(0,i.jsxs)(n.li,{children:["If all attached policies return ",(0,i.jsx)(n.code,{children:"null"}),", the request is denied access."]}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["There are helper functions on the ",(0,i.jsx)(n.code,{children:"Policy"})," object that allow easy construction of common policy patterns."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.public"}),": allow any request."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.internal"}),": allow requests originating from within typegraph like custom functions."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.on"}),": use different policies depending on request effect. Useful for policy shared across many materalizers."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"Policy.context"}),": generate a policy using a simple pattern matching on context object fields."]}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>r,gc:()=>a});t(30758);var i=t(3733),o=t(56315),s=t(86070);function r(e){let{children:n}=e;const[t,r]=(0,i.e)();return(0,s.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:r,children:n})}function a(e){let{children:n}=e;const[t]=(0,i.e)();return(0,s.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var i=t(98302),o=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...r}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(i.A,{code:0==a.length?void 0:a,...r})}},89280:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_full_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"get_context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:62}};n.loc.source={body:"query {\n get_full_context\n get_context {\n username\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},64722:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"public"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_only"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"both"},arguments:[],directives:[]}]}}],loc:{start:0,end:92}};n.loc.source={body:"query A {\n public\n}\n\nquery B {\n admin_only\n}\n\nquery C {\n user_only\n}\n\nquery D {\n both\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};function o(e,n){for(var t=0;t0;){var c=a;a=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(i[e]||new Set).forEach((function(e){a.add(e)})))}))}return r.forEach((function(n){var i=o(e,n);i&&t.definitions.push(i)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n,e.exports.A=s(n,"A"),e.exports.B=s(n,"B"),e.exports.C=s(n,"C"),e.exports.D=s(n,"D")},4489:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"catch_me_if_you_can"},arguments:[],directives:[]}]}}],loc:{start:0,end:75}};n.loc.source={body:"query {\n catch_me_if_you_can\n # the results panel should show an error\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},36310:e=>{e.exports={content:'deno = DenoRuntime()\nctx = t.struct({"username": t.string().optional()})\n\n# highlight-start\n# expects a secret in metatype.yml\n# `BASIC_[username]`\n# highlight-next-line\ng.auth(Auth.basic(["andim"]))\n# highlight-end\n\ng.expose(\n Policy.public(),\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n get_full_context=deno.func(\n t.struct({}),\n t.string(),\n code="(_: any, ctx: any) => Deno.inspect(ctx.context)",\n ),\n)',path:"../examples/typegraphs/authentication.py"}},37583:e=>{e.exports={content:'const deno = new DenoRuntime();\n\nconst ctx = t.struct({\n username: t.string().optional(),\n});\n\n// highlight-start\n// expects a secret in metatype.yml\n// `BASIC_[username]`\n// highlight-next-line\ng.auth(Auth.basic(["andim"]));\n// highlight-end\n\ng.expose(\n {\n get_context: deno.identity(ctx).apply({\n username: g.fromContext("username"),\n }),\n get_full_context: deno.func(t.struct({}), t.string(), {\n code: "(_: any, ctx: any) => Deno.inspect(ctx.context)",\n }),\n },\n Policy.public(),\n);',path:"../examples/typegraphs/authentication.ts"}},71388:e=>{e.exports={content:'@typegraph(\n # highlight-start\n cors=Cors(\n allow_origin=["https://not-this.domain"],\n allow_headers=["x-custom-header"],\n expose_headers=["header-1"],\n allow_credentials=True,\n max_age_sec=60,\n ),\n # highlight-end\n)\ndef cors(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n\n g.expose(\n Policy.public(),\n catch_me_if_you_can=random.gen(t.string()),\n )',path:"../examples/typegraphs/cors.py"}},66906:e=>{e.exports={content:'await typegraph(\n {\n name: "cors",\n // highlight-start\n cors: {\n allowOrigin: ["https://not-this.domain"],\n allowHeaders: ["x-custom-header"],\n exposeHeaders: ["header-1"],\n allowCredentials: true,\n maxAgeSec: 60,\n },\n // highlight-end\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n\n g.expose(\n {\n catch_me_if_you_can: random.gen(t.string()),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/cors.ts"}},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub,\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file diff --git a/assets/js/474845f3.3eb6516d.js b/assets/js/474845f3.fa1a64ff.js similarity index 96% rename from assets/js/474845f3.3eb6516d.js rename to assets/js/474845f3.fa1a64ff.js index fe6518fa0c..0b11dd0226 100644 --- a/assets/js/474845f3.3eb6516d.js +++ b/assets/js/474845f3.fa1a64ff.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5364],{16086:(n,e,t)=>{"use strict";t.r(e),t.d(e,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>p});var i=t(86070),o=t(25710),r=(t(7871),t(65671));const a={},s="Deno/typescript",c={id:"reference/runtimes/deno/index",title:"Deno/typescript",description:"Deno runtime",source:"@site/docs/reference/runtimes/deno/index.mdx",sourceDirName:"reference/runtimes/deno",slug:"/reference/runtimes/deno/",permalink:"/docs/reference/runtimes/deno/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/deno/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Runtimes",permalink:"/docs/reference/runtimes/"},next:{title:"GraphQL",permalink:"/docs/reference/runtimes/graphql/"}},d={},p=[{value:"Deno runtime",id:"deno-runtime",level:2}];function l(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"denotypescript",children:"Deno/typescript"}),"\n","\n",(0,i.jsx)(e.h2,{id:"deno-runtime",children:"Deno runtime"}),"\n",(0,i.jsx)(e.p,{children:"The DenoRuntime allows you to run lightweight and short-lived typescript function in a sandboxed environment. Permissions can be customized per typegraph and by default only include some HTTPs domains. It's a great way to implement custom logic and functions. All typegraphs can lazily spawn a web worker and get an incredible cold-start and continuous performance thanks to the V8 engine powering Deno."}),"\n",(0,i.jsx)(r.A,{typegraph:"deno",typescript:t(27395),python:t(38981),query:t(27659)}),"\n",(0,i.jsx)(e.p,{children:"Instead of providing the typescript code inline, we can also point to a file on disk:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-python",children:'# my_typegraph.py\n\nfrom typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n@typegraph()\ndef deno(g: Graph):\n public = Policy.public()\n deno = DenoRuntime()\n\n g.expose(\n public,\n add=deno.import_(\n t.struct({"a": t.number(), "b": t.number()}),\n t.number(),\n module="main.ts", # path to ts file\n name="doAddition", # function export from ts file to use\n ),\n )\n'})}),"\n",(0,i.jsx)(e.p,{children:"Where main.ts looks like:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typescript",children:"// main.ts\n\ninterface AddInput {\n a: number;\n b: number;\n}\nexport function doAddition({ a, b }: AddInput) {\n return a + b;\n}\n"})})]})}function u(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(l,{...n})}):l(n)}},65671:(n,e,t)=>{"use strict";t.d(e,{A:()=>r});var i=t(98302),o=(t(30758),t(86070));function r(n){let{python:e,typescript:t,rust:r,...a}=n;const s=[e&&{content:e.content,codeLanguage:"python",codeFileUrl:e.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((n=>!!n));return(0,o.jsx)(i.A,{code:0==s.length?void 0:s,...a})}},27659:n=>{var e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"compute_fib"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"3"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"res"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ms"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:51}};e.loc.source={body:"query {\n compute_fib(n: 3) {\n res\n ms\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(n,e){if("FragmentSpread"===n.kind)e.add(n.name.value);else if("VariableDefinition"===n.kind){var i=n.type;"NamedType"===i.kind&&e.add(i.name.value)}n.selectionSet&&n.selectionSet.selections.forEach((function(n){t(n,e)})),n.variableDefinitions&&n.variableDefinitions.forEach((function(n){t(n,e)})),n.definitions&&n.definitions.forEach((function(n){t(n,e)}))}var i={};e.definitions.forEach((function(n){if(n.name){var e=new Set;t(n,e),i[n.name.value]=e}})),n.exports=e},38981:n=>{n.exports={content:'@typegraph(\n)\ndef deno(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n fib = deno.func(\n t.struct({"n": t.float()}),\n t.struct({"res": t.integer(), "ms": t.float()}),\n code="""\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n """,\n )\n\n g.expose(\n public,\n compute_fib=fib,\n )',path:"../examples/typegraphs/deno.py"}},27395:n=>{n.exports={content:'await typegraph(\n {\n name: "deno",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const fib = deno.func(\n t.struct({ n: t.float() }),\n t.struct({ res: t.integer(), ms: t.float() }),\n {\n code: `\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n `,\n }\n );\n\n g.expose(\n {\n compute_fib: fib,\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/deno.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5364],{16086:(n,e,t)=>{"use strict";t.r(e),t.d(e,{assets:()=>d,contentTitle:()=>s,default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>p});var i=t(86070),o=t(25710),r=(t(7871),t(65671));const a={},s="Deno/typescript",c={id:"reference/runtimes/deno/index",title:"Deno/typescript",description:"Deno runtime",source:"@site/docs/reference/runtimes/deno/index.mdx",sourceDirName:"reference/runtimes/deno",slug:"/reference/runtimes/deno/",permalink:"/docs/reference/runtimes/deno/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/deno/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Runtimes",permalink:"/docs/reference/runtimes/"},next:{title:"GraphQL",permalink:"/docs/reference/runtimes/graphql/"}},d={},p=[{value:"Deno runtime",id:"deno-runtime",level:2}];function l(n){const e={code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...(0,o.R)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"denotypescript",children:"Deno/typescript"}),"\n","\n",(0,i.jsx)(e.h2,{id:"deno-runtime",children:"Deno runtime"}),"\n",(0,i.jsx)(e.p,{children:"The DenoRuntime allows you to run lightweight and short-lived typescript function in a sandboxed environment. Permissions can be customized per typegraph and by default only include some HTTPs domains. It's a great way to implement custom logic and functions. All typegraphs can lazily spawn a web worker and get an incredible cold-start and continuous performance thanks to the V8 engine powering Deno."}),"\n",(0,i.jsx)(r.A,{typegraph:"deno",typescript:t(27395),python:t(38981),query:t(27659)}),"\n",(0,i.jsx)(e.p,{children:"Instead of providing the typescript code inline, we can also point to a file on disk:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-python",children:'# my_typegraph.py\n\nfrom typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n@typegraph()\ndef deno(g: Graph):\n public = Policy.public()\n deno = DenoRuntime()\n\n g.expose(\n public,\n add=deno.import_(\n t.struct({"a": t.number(), "b": t.number()}),\n t.number(),\n module="main.ts", # path to ts file\n name="doAddition", # function export from ts file to use\n ),\n )\n'})}),"\n",(0,i.jsx)(e.p,{children:"Where main.ts looks like:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typescript",children:"// main.ts\n\ninterface AddInput {\n a: number;\n b: number;\n}\nexport function doAddition({ a, b }: AddInput) {\n return a + b;\n}\n"})})]})}function u(n={}){const{wrapper:e}={...(0,o.R)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(l,{...n})}):l(n)}},65671:(n,e,t)=>{"use strict";t.d(e,{A:()=>r});var i=t(98302),o=(t(30758),t(86070));function r(n){let{python:e,typescript:t,rust:r,...a}=n;const s=[e&&{content:e.content,codeLanguage:"python",codeFileUrl:e.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((n=>!!n));return(0,o.jsx)(i.A,{code:0==s.length?void 0:s,...a})}},27659:n=>{var e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"compute_fib"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"3"}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"res"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ms"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:51}};e.loc.source={body:"query {\n compute_fib(n: 3) {\n res\n ms\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(n,e){if("FragmentSpread"===n.kind)e.add(n.name.value);else if("VariableDefinition"===n.kind){var i=n.type;"NamedType"===i.kind&&e.add(i.name.value)}n.selectionSet&&n.selectionSet.selections.forEach((function(n){t(n,e)})),n.variableDefinitions&&n.variableDefinitions.forEach((function(n){t(n,e)})),n.definitions&&n.definitions.forEach((function(n){t(n,e)}))}var i={};e.definitions.forEach((function(n){if(n.name){var e=new Set;t(n,e),i[n.name.value]=e}})),n.exports=e},38981:n=>{n.exports={content:'@typegraph(\n)\ndef deno(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n fib = deno.func(\n t.struct({"n": t.float()}),\n t.struct({"res": t.integer(), "ms": t.float()}),\n code="""\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n """,\n )\n\n g.expose(\n public,\n compute_fib=fib,\n )',path:"../examples/typegraphs/deno.py"}},27395:n=>{n.exports={content:'await typegraph(\n {\n name: "deno",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const fib = deno.func(\n t.struct({ n: t.float() }),\n t.struct({ res: t.integer(), ms: t.float() }),\n {\n code: `\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n `,\n },\n );\n\n g.expose(\n {\n compute_fib: fib,\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/deno.ts"}}}]); \ No newline at end of file diff --git a/assets/js/56e37303.1f25d9b1.js b/assets/js/56e37303.1f25d9b1.js new file mode 100644 index 0000000000..8363164c28 --- /dev/null +++ b/assets/js/56e37303.1f25d9b1.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2903],{68962:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>l,metadata:()=>a,toc:()=>u});var s=t(86070),r=t(25710),i=t(65671);const l={sidebar_position:50},o="Client",a={id:"reference/typegraph/client/index",title:"Client",description:"The following feature isn't yet stable.",source:"@site/docs/reference/typegraph/client/index.mdx",sourceDirName:"reference/typegraph/client",slug:"/reference/typegraph/client/",permalink:"/docs/reference/typegraph/client/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegraph/client/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Typegraph",permalink:"/docs/reference/typegraph/"},next:{title:"Typegate",permalink:"/docs/reference/typegate/"}},c={},u=[{value:"Guide",id:"guide",level:2},{value:"QueryGraph",id:"querygraph",level:3},{value:"Transports",id:"transports",level:3},{value:"GraphQLTransport",id:"graphqltransport",level:4},{value:"HostcallTransport",id:"hostcalltransport",level:4},{value:"Requests",id:"requests",level:3},{value:"Nested arguments",id:"nested-arguments",level:3},{value:"Selecting fields",id:"selecting-fields",level:3},{value:"Preparing requests",id:"preparing-requests",level:3},{value:"Aliases",id:"aliases",level:3},{value:"Unions",id:"unions",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"client",children:"Client"}),"\n",(0,s.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,s.jsx)(n.p,{children:"The following feature isn't yet stable."})}),"\n",(0,s.jsxs)(n.p,{children:["The typegraph client provides a code-first alternative for querying typegraphs.\nIt contains types generated from typegraph definitions to ensure type safety.\nThe ",(0,s.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," suite provides the client code-generators under the following names:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_ts"}),": client code-generator for Typescript for use in browsers and other Javascript runtimes"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_py"}),": client code-generator for Python"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_rs"}),": client code-generator for Rust."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Refer to the metagen documentation on how to access the generators."}),"\n",(0,s.jsx)(n.h2,{id:"guide",children:"Guide"}),"\n",(0,s.jsx)(n.p,{children:"Even though there are minor differences across language implementations, the generated clients adhere to a common design that contains the following elements."}),"\n",(0,s.jsx)(n.h3,{id:"querygraph",children:(0,s.jsx)(n.code,{children:"QueryGraph"})}),"\n",(0,s.jsx)(n.p,{children:"The root type generated for the client, it includes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Query builders for all the root functions"}),"\n",(0,s.jsx)(n.li,{children:"Transport constructors for all the transports exposed by the typegraph"}),"\n"]}),"\n",(0,s.jsx)(i.A,{python:{content:"\nfrom client import QueryGraph\n\nqg = new QueryGraph();"},typescript:{content:'import { QueryGraph } from "./client.ts" ;\n\nconst qg = new QueryGraph();'},rust:{content:'use client::*;\n\nlet api1 = QueryGraph::new(format!("http://localhost:7890/sample").parse()?);'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"transports",children:"Transports"}),"\n",(0,s.jsxs)(n.p,{children:["Different transport implementations are used to send the requests to the typegate for different use cases.\nThe ",(0,s.jsx)(n.code,{children:"QueryGraph"})," will sport methods to construct transports supported by the typegraph (see examples below).\nNot all transports have the same feature sets."]}),"\n",(0,s.jsx)(n.h4,{id:"graphqltransport",children:(0,s.jsx)(n.code,{children:"GraphQLTransport"})}),"\n",(0,s.jsx)(n.p,{children:"This transport converts to equivalent GraphQL query strings that get sent over http.\nIt includes the following features for all implementations:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Sync or async queries and mutations"}),"\n",(0,s.jsx)(n.li,{children:"Multiple queries or mutations in one request"}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"hostcalltransport",children:(0,s.jsx)(n.code,{children:"HostcallTransport"})}),"\n",(0,s.jsx)(n.p,{children:"This transport uses host functions exposed by the typegate for use with custom functions."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Sync queries and mutations"}),"\n",(0,s.jsx)(n.li,{children:"Multiple queries or mutations in one request"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"requests",children:"Requests"}),"\n",(0,s.jsx)(n.p,{children:"Requests consist of two parts:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Describe the operations using methods on ",(0,s.jsx)(n.code,{children:"QueryGraph"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Methods are typesafe according to each typegraph root functions."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Transport methods that take the query description and perform request to the typegate.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Mutations and queries use separate methods and types."}),"\n",(0,s.jsxs)(n.li,{children:["Some transports like the ",(0,s.jsx)(n.code,{children:"GraphQLTransport"})," support multiple operations in one request"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.A,{python:{content:'qg = QueryGraph()\ngql_client = qg.graphql_sync("http://localhost:7890/sample")\n\n# describe the query\n\n# there\'s a different method available for mutations\n\nout = gql_client.query(\n{\n"user": qg.get_user( # the function takes arguments\nUserArgs(id="1234"),\nUserSelections( # choose which fields get included\nid=True,\nemail=True,\n),\n), # add a second query in the request # this one doesn\'t take arguments so only # selections are provided\n"posts": qg.get_posts({ # both arguments and selections are TypedDicts # allowing use of dicts instead of the classes\n"slug": True,\n"title": True,\n}),\n}\n)\n\nuser = out["user"];\nposts = out["posts"]'},typescript:{content:'const api1 = new QueryGraph();\nconst gqlClient = api1.graphql("http://localhost:7890/sample");\n\n// describe the query\n// there\'s a different method available for mutations\nconst out = await gqlClient.query({\nuser: api1.getUser(\n// the function takes arguments\n{ id: "1234" },\n{\n// choose which fields get included\nid: true,\nemail: true,\n}),\n// add a second query in the request\n// this one doesn\'t take arguments so only\n// selections are provided\nposts: api1.getPosts(\n{ title: true, slug: true }\n),\n});\nconst user = out.user;\nconst posts = out.posts;'},rust:{content:'let api1 = QueryGraph::new("http://localhost:7890/sample".parse()?);\nlet gql_sync = api1.graphql_sync();\n\n// describe the query\n// there\'s a different method available for mutations\nlet out = gql_sync.query((\n// the function takes arguments\napi1.get_user(UserArgs { id: "1234".into() })\n.select(UserSelections {\n// choose which fields get included\n// in rust, selection functions are\n// used instead of booleans.\nid: get(),\nslug: get(),\n}),\n// add a second query in the request\n// note: rust uses tuples for multi-requests\n// this one doesn\'t take arguments\napi1.get_posts()\n.select(PostSelections {\nid: get(),\nslug: get(),\ntitle: get(),\n}),\n)).unwrap();\n\nlet (user, posts) = out;'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"nested-arguments",children:"Nested arguments"}),"\n",(0,s.jsx)(n.p,{children:"Some fields are themselves composite types that have fields that also require selection.\nAnd functions are used to resolve certain fields which require arguments."}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserArgs(id="1234"),\n UserSelections(\n id=True,\n email=True,\n # the posts field takes an argument\n # and is also a composite\n # selection and arguments are combined\n # with tuples in such cases\n posts=(\n PostArgs(filter="top"), \n PostSelections(\n slug=True, \n title=True\n )\n ),\n # this nested composite doesn\'t\n # take arguments so no tuple\n comments=CommentSelections(\n body=True\n )\n ),\n ),\n }\n)\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // posts field takes an argument\n // and is also a composite\n // selection and arguments are combined\n // with array tuples in such cases\n posts: [\n { filter: "top" }, \n { title: true, slug: true }\n ],\n // this nested composite doesn\'t\n // take arguments so no tuple\n // required\n comments: { body: true }\n }\n ),\n});\n '},rust:{content:'let user = gql_sync.query(\n api1.get_user(UserArgs { id: "1234".into() })\n .select(UserSelections {\n id: get(),\n slug: get(),\n // posts nested field takes an argument\n // and is also a composite type\n // requiring the arg_select select function\n posts: arg_select(\n PostArgs { filter: "top".into() },\n PostSelections {\n id: get(),\n slug: get(),\n title: get(),\n }\n ),\n // this nested composite doesn\'t\n // take arguments so the select function\n // is used instead\n comments: select(CommentSelections {\n body: get()\n }),\n }),\n).unwrap();\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"selecting-fields",children:"Selecting fields"}),"\n",(0,s.jsx)(n.p,{children:"Booleans indicate interest when selecting fields on an object.\nBy default a field isn't included if it's null, or unspecified.\nSelections can include selection flags to flip the default so that all unspecified fields get included.\nThis won't apply if the field requires an argument explicitly requiring them for inclusion."}),"\n",(0,s.jsxs)(n.p,{children:["Note that these patterns are different in the ",(0,s.jsx)(n.code,{children:"client_rs"})," implementations as demonstrated below:"]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserArgs(id="1234"),\n UserSelections(\n # seletion flags are set on the underscore\n # field. The select_all flg flips the\n # semantics for unspecified fields\n _=SelectionFlags(select_all=True),\n # False excludes fields explicitly\n id=False,\n # the posts field takes an argument\n # so the select_all flag doesn\'t apply\n # it still must be provided\n # if intending to include it\n posts=(\n PostArgs(filter="top"), \n # TypedDict form\n {"_": SelectionFlags(select_all=True)},\n ),\n # comments is a nested composite but\n # doesn\'t take args so select_all flag applies\n # comments=CommentSelections(\n # body=True\n # )\n ),\n ),\n }\n)\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // posts field takes an argument\n // and is also a composite\n // selection and arguments are combined\n // with array tuples in such cases\n posts: [\n { filter: "top" }, \n { title: true, slug: true }\n ],\n // this nested composite doesn\'t\n // take arguments so no tuple\n // required\n }\n ),\n});\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // seletion flags are set on the underscore\n // field. The selectAll flg flips the\n // semantics for unspecified fields\n _: "selectAll",\n // false excludes fields explicitly \n id: false,\n // post field takes an argument\n // so the selectAll flag doesn\'t apply\n // it still must be provided\n // if intending to include it\n posts: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n // comments is a nested composite but\n // doesnt\'t take args so selectAll flag applies\n // comments: { body: true }\n }\n ),\n});\n '},rust:{content:'let user = gql_sync.query(\n api1.get_user(UserArgs { id: "1234".into() })\n .select(UserSelections {\n // skip excludes fields explicitly \n id: skip(),\n\n // post field takes an argument\n // so the all() down below still\n // won\'t include it\n // it must be provided explicitly\n // if intending to include it\n posts: arg_select(\n PostArgs { filter: "top".into() },\n // we use all top\n all()\n ),\n\n // comments is a nested composite but\n // doesnt\'t take args so the all() down\n // below includes it\n // comments: select(CommentSelections::all())\n\n // filling the missing fields with the results\n // of all() using the struct update syntax\n // ensures they\'re all get()\n // use default() to get a selection that is full\n // of skip()\n ..all()\n }),\n\n).unwrap();\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.p,{children:"Note that this only applies to scalar fields and those that require arguments or are structs must still be explicitly included."}),"\n",(0,s.jsx)(n.h3,{id:"preparing-requests",children:"Preparing requests"}),"\n",(0,s.jsxs)(n.p,{children:["Some transports like the ",(0,s.jsx)(n.code,{children:"GraphQLTransport"})," allows one to prepare requests before hand and reuse them.\nThis isn't immediately useful but will be critical when persisted queries are available in Metatype."]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nprepared = gql_client.prepare_query(\n # the args object will contain placholder value of the arguments\n # the lambda will then return a request description as\n # usual\n lambda args: {\n "user": qg.get_user(\n # use only values from args for arguments\n # no branching should be done\n { "id": args.get("userId") },\n {\n "id": True,\n "email": True,\n "posts": (\n { "filter": args.get("postFilter") }, \n { "_": SelectionFlags(select_all=True) },\n ),\n },\n ),\n },\n)\n\n# execute the actual query\n\n# the input here must contain every key\n\n# used from the lambda arg above\n\nout = prepared.perform({\n"userId": "1234",\n"postFilter": "top",\n})\nout2 = prepared.perform({\n"userId": "5678",\n"postFilter": "hot",\n})\n'},typescript:{content:'\nconst prepared = gqlClient.prepareQuery(\n// the args object will contain placholder value of the arguments\n// the closure will then return a request description as\n// usual\n(\n// types can be provided as hints\nargs: PreparedArgs<{\nuserId: string;\npostFilter: string;\n}>,\n) => ({\n\n user: api1.getUser(\n // use only values from args for arguments\n // no branching should be done\n { id: args.userId },\n {\n id: true,\n email: true,\n posts: [\n { filter: args.postFilter },\n { title: true, slug: true }\n ],\n }),\n\n})\n);\n\n// execute the actual query\n// the input here must contain every key\n// used from the closure arg above\nconst { posts } = await prepared.perform({\nuserId: "1234"\npostFilter: "top"\n});\nconst { posts: posts2 } = await prepared.perform({\nuserId: "5678"\npostFilter: "hot"\n});\n'},rust:{content:'\nlet prepared_m = gql_sync.prepare_mutation(\n// the args object will contain placholder value of the arguments\n// the closure will then return a request description as\n// usual\n|args| {\n(\n// for each placholder value, we provide a closure that returns\n// argument structs according to the value\n// this closure will be used for each use of the prepared\n// request\napi1.scalar_args(args.get("userId", |id: String| UserArgs { id })),\n.select(UserSelections {\nid: get(),\nslug: get(),\nposts: arg_select(\n// the placholder closures can take any parameter\n// that implements serde::DeserializeOwned\n// the closure here does no transformation\nargs.get("postFilter", |val: PostArgs| val)\nPostSelections {\nid: get(),\nslug: get(),\ntitle: get(),\n}\n),\n}),\n)\n}\n);\n\n// execute the actual query\n// the input here must contain every key\n// used from the closure arg above\nlet user1 = prepared_clone.perform([\n(\n"userId",\n// perform takes an Into parameter,\n// requiring use of json values to\n// allow heterogeneous values in a single map\nserde_json::json!("1234"),\n),\n(\n"postFilter",\nserde_json::json!(PostArgs{\nfilter: "hot".into(),\n}),\n),\n])?;\nlet user1 = prepared_clone.perform([\n(\n"userId",\nserde_json::json!("1234"),\n),\n(\n"postFilter",\n// we can provide PostArgs in json form alternatively\n// but this is less typesafe\nserde_json::json!({\n"filter": "top"\n}),\n),\n])?;\n\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.admonition,{title:"Caution",type:"warning",children:(0,s.jsx)(n.p,{children:"Note that in all three implementations, the closures are only invoked once and it's critical that there are no branching logic present in them."})}),"\n",(0,s.jsx)(n.h3,{id:"aliases",children:"Aliases"}),"\n",(0,s.jsxs)(n.p,{children:["Aliasing allows the querying of a node multiple times under different names.\nThis is very similar to the ",(0,s.jsx)(n.a,{href:"https://graphql.org/learn/queries/#aliases",children:"GraphQL aliases"})," and uses them under the hood when using the GraphQLTransport.\nNote that not all ",(0,s.jsx)(n.code,{children:"Runtimes"})," support aliasing so make sure your target does before using this feature."]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserSelections(\n _=SelectionFlags(select_all=True),\n # all selections accept Aliases in their stead\n # including scalars\n posts=Alias(\n # posts is a composie with arguments so the \n # tuple form is expected\n post1=(\n PostArgs(filter="top"), \n PostSelections(\n id=True,\n slug=True,\n title=True,\n ),\n )\n # a second aliasing\n post2=(\n PostArgs(filter="hot"), \n PostSelections(\n _=SelectionFlags(select_all=True),\n id=False,\n ),\n )\n ),\n ),\n ),\n }\n)\n# note that when using aliases, the TypedDict are no longer\n# valid\nposts1 = out["user"]["post1"];\nposts2 = out["user"].["post2"];\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser({\n _: "selectAll",\n // all selections accept alias() in their stead\n // including scalars\n posts: alias({\n // posts is a composie with arguments so the \n // tuple form is expected\n post1: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n // a second aliasing\n post2: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n }),\n }),\n});\n\n// when using aliases, the original types\n// provided are no longer accurate\nconst posts1 = user.post1\nconst posts2 = user.post1\n'},rust:{content:'\n// user here is a serde_json::Value type\n// since we opted into aliases by using\n// select_aliased\nlet (user,) = gql_sync.query((\napi1.get_user()\n// alias() selections are only available under root select_aliased\n// selections. Even if the alias() is nested deep, the root\n// must be select_aliased\n.select_aliased(UserSelections {\n// all selections accept alias() in their stead\n// including scalars\nposts: alias([\n(\n"post1",\n// posts is a composie with arguments so the\n// arg_select form is expected\nposts: arg_select(\nPostArgs { filter: "top".into() },\nPostSelections {\n..all()\n}\n),\n),\n// a second aliasing\n("post2", arg_select(PostArgs { filter: "hot".into() }, all())),\n]),\n..all()\n}),\n))?;\n// aliases force use of json to bypass the generated types\nlet posts1 = user["post1"];\nlet posts2 = user["post2"];\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"unions",children:"Unions"}),"\n",(0,s.jsx)(n.p,{children:"Union and either types that have composite variants require special forms when querying them.\nThe generated selection types will have fields for selecting composite variants.\nIf the value from the API wasn't of a selected variant, an empty object will be returned.\nScalar variants are always selected."}),"\n",(0,s.jsx)(i.A,{python:{content:'\nres5 = gql_client.query(\n {\n # this case is only interested in post values\n "postOnly": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n "post": {"_": SelectionFlags(select_all=True)}\n },\n ),\n "userOnly": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n "user": { "_": SelectionFlags(select_all=True) }\n },\n ),\n "both": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n # add selections for both variants to ensure\n # that a value is present no matter the type\n "post": {"_": SelectionFlags(select_all=True)},\n "user": {"_": SelectionFlags(select_all=True)},\n },\n ),\n }\n)\n'},typescript:{content:'\nconst out = await gqlClient.query({\n // this case is only interested in post values\n postOnly: api1.compositeUnion(\n { id: "1234" }, \n {\n post: { "_": "selectAll" },\n }\n ),\n userOnly: api1.compositeUnion(\n { id: "1234" }, \n {\n user: { "_": "selectAll" },\n }\n ),\n both: api1.compositeUnion(\n { id: "1234" }, \n {\n // add selections for both variants to ensure\n // that a value is present no matter the type\n user: { "_": "selectAll" },\n post: { "_": "selectAll" },\n }\n ),\n});\n '},rust:{content:'\nlet out = gql\n .query((\n // this case is only interested in post values\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n post: select(all()),\n ..default()\n }),\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n user: select(all()),\n ..default()\n }),\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n // add selections for both variants to ensure\n // that a value is present no matter the type\n post: select(all()),\n user: select(all()),\n }),\n ))\n .await?;\n'},disablePlayground:!0})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{t.d(n,{A:()=>i});var s=t(98302),r=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...l}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,r.jsx)(s.A,{code:0==o.length?void 0:o,...l})}}}]); \ No newline at end of file diff --git a/assets/js/56e37303.46032205.js b/assets/js/56e37303.46032205.js deleted file mode 100644 index 256d4f8221..0000000000 --- a/assets/js/56e37303.46032205.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2903],{68962:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>p,frontMatter:()=>l,metadata:()=>a,toc:()=>u});var s=t(86070),r=t(25710),i=t(65671);const l={sidebar_position:50},o="Client",a={id:"reference/typegraph/client/index",title:"Client",description:"The following feature isn't yet stable.",source:"@site/docs/reference/typegraph/client/index.mdx",sourceDirName:"reference/typegraph/client",slug:"/reference/typegraph/client/",permalink:"/docs/reference/typegraph/client/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegraph/client/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Typegraph",permalink:"/docs/reference/typegraph/"},next:{title:"Typegate",permalink:"/docs/reference/typegate/"}},c={},u=[{value:"Guide",id:"guide",level:2},{value:"QueryGraph",id:"querygraph",level:3},{value:"Transports",id:"transports",level:3},{value:"GraphQLTransport",id:"graphqltransport",level:4},{value:"HostcallTransport",id:"hostcalltransport",level:4},{value:"Requests",id:"requests",level:3},{value:"Nested arguments",id:"nested-arguments",level:3},{value:"Selecting fields",id:"selecting-fields",level:3},{value:"Preparing requests",id:"preparing-requests",level:3},{value:"Aliases",id:"aliases",level:3},{value:"Unions",id:"unions",level:3}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"client",children:"Client"}),"\n",(0,s.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,s.jsx)(n.p,{children:"The following feature isn't yet stable."})}),"\n",(0,s.jsxs)(n.p,{children:["The typegraph client provides a code-first alternative for querying typegraphs.\nIt contains types generated from typegraph definitions to ensure type safety.\nThe ",(0,s.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," suite provides the client code-generators under the following names:"]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_ts"}),": client code-generator for Typescript for use in browsers and other Javascript runtimes"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_py"}),": client code-generator for Python"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"client_rs"}),": client code-generator for Rust."]}),"\n"]}),"\n",(0,s.jsx)(n.p,{children:"Refer to the metagen documentation on how to access the generators."}),"\n",(0,s.jsx)(n.h2,{id:"guide",children:"Guide"}),"\n",(0,s.jsx)(n.p,{children:"Even though there are minor differences across language implementations, the generated clients adhere to a common design that contains the following elements."}),"\n",(0,s.jsx)(n.h3,{id:"querygraph",children:(0,s.jsx)(n.code,{children:"QueryGraph"})}),"\n",(0,s.jsx)(n.p,{children:"The root type generated for the client, it includes:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Query builders for all the root functions"}),"\n",(0,s.jsx)(n.li,{children:"Transport constructors for all the transports exposed by the typegraph"}),"\n"]}),"\n",(0,s.jsx)(i.A,{python:{content:"\nfrom client import QueryGraph\n\nqg = new QueryGraph();"},typescript:{content:'import { QueryGraph } from "./client.ts" ;\n\nconst qg = new QueryGraph();'},rust:{content:'use client::*;\n\nlet api1 = QueryGraph::new(format!("http://localhost:7890/sample").parse()?);'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"transports",children:"Transports"}),"\n",(0,s.jsxs)(n.p,{children:["Different transport implementations are used to send the requests to the typegate for different use cases.\nThe ",(0,s.jsx)(n.code,{children:"QueryGraph"})," will sport methods to construct transports supported by the typegraph (see examples below).\nNot all transports have the same feature sets."]}),"\n",(0,s.jsx)(n.h4,{id:"graphqltransport",children:(0,s.jsx)(n.code,{children:"GraphQLTransport"})}),"\n",(0,s.jsx)(n.p,{children:"This transport converts to equivalent GraphQL query strings that get sent over http.\nIt includes the following features for all implementations:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Sync or async queries and mutations"}),"\n",(0,s.jsx)(n.li,{children:"Multiple queries or mutations in one request"}),"\n"]}),"\n",(0,s.jsx)(n.h4,{id:"hostcalltransport",children:(0,s.jsx)(n.code,{children:"HostcallTransport"})}),"\n",(0,s.jsx)(n.p,{children:"This transport uses host functions exposed by the typegate for use with custom functions."}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Sync queries and mutations"}),"\n",(0,s.jsx)(n.li,{children:"Multiple queries or mutations in one request"}),"\n"]}),"\n",(0,s.jsx)(n.h3,{id:"requests",children:"Requests"}),"\n",(0,s.jsx)(n.p,{children:"Requests consist of two parts:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["Describe the operations using methods on ",(0,s.jsx)(n.code,{children:"QueryGraph"}),".","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Methods are typesafe according to each typegraph root functions."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["Transport methods that take the query description and perform request to the typegate.","\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"Mutations and queries use separate methods and types."}),"\n",(0,s.jsxs)(n.li,{children:["Some transports like the ",(0,s.jsx)(n.code,{children:"GraphQLTransport"})," support multiple operations in one request"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(i.A,{python:{content:'qg = QueryGraph()\ngql_client = qg.graphql_sync("http://localhost:7890/sample")\n\n# describe the query\n# there\'s a different method available for mutations\nout = gql_client.query(\n {\n "user": qg.get_user(\n # the function takes arguments\n UserArgs(id="1234"),\n UserSelections(\n # choose which fields get included\n id=True,\n email=True,\n ),\n ),\n # add a second query in the request\n # this one doesn\'t take arguments so only\n # selections are provided\n "posts": qg.get_posts({\n # both arguments and selections are TypedDicts\n # allowing use of dicts instead of the classes\n "slug": True,\n "title": True,\n }),\n }\n)\n\nuser = out["user"];\nposts = out["posts"]'},typescript:{content:'const api1 = new QueryGraph();\nconst gqlClient = api1.graphql("http://localhost:7890/sample");\n\n// describe the query\n// there\'s a different method available for mutations\nconst out = await gqlClient.query({\n user: api1.getUser(\n // the function takes arguments\n { id: "1234" }, \n {\n // choose which fields get included\n id: true,\n email: true,\n }),\n // add a second query in the request\n // this one doesn\'t take arguments so only\n // selections are provided\n posts: api1.getPosts(\n { title: true, slug: true }\n ),\n});\nconst user = out.user;\nconst posts = out.posts;'},rust:{content:'let api1 = QueryGraph::new("http://localhost:7890/sample".parse()?);\nlet gql_sync = api1.graphql_sync();\n\n// describe the query\n// there\'s a different method available for mutations\nlet out = gql_sync.query((\n // the function takes arguments\n api1.get_user(UserArgs { id: "1234".into() })\n .select(UserSelections {\n // choose which fields get included\n // in rust, selection functions are \n // used instead of booleans. \n id: get(),\n slug: get(),\n }),\n // add a second query in the request\n // note: rust uses tuples for multi-requests\n // this one doesn\'t take arguments\n api1.get_posts()\n .select(PostSelections {\n id: get(),\n slug: get(),\n title: get(),\n }),\n)).unwrap();\n\nlet (user, posts) = out;'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"nested-arguments",children:"Nested arguments"}),"\n",(0,s.jsx)(n.p,{children:"Some fields are themselves composite types that have fields that also require selection.\nAnd functions are used to resolve certain fields which require arguments."}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserArgs(id="1234"),\n UserSelections(\n id=True,\n email=True,\n # the posts field takes an argument\n # and is also a composite\n # selection and arguments are combined\n # with tuples in such cases\n posts=(\n PostArgs(filter="top"), \n PostSelections(\n slug=True, \n title=True\n )\n ),\n # this nested composite doesn\'t\n # take arguments so no tuple\n comments=CommentSelections(\n body=True\n )\n ),\n ),\n }\n)\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // posts field takes an argument\n // and is also a composite\n // selection and arguments are combined\n // with array tuples in such cases\n posts: [\n { filter: "top" }, \n { title: true, slug: true }\n ],\n // this nested composite doesn\'t\n // take arguments so no tuple\n // required\n comments: { body: true }\n }\n ),\n});\n '},rust:{content:'let user = gql_sync.query(\n api1.get_user(UserArgs { id: "1234".into() })\n .select(UserSelections {\n id: get(),\n slug: get(),\n // posts nested field takes an argument\n // and is also a composite type\n // requiring the arg_select select function\n posts: arg_select(\n PostArgs { filter: "top".into() },\n PostSelections {\n id: get(),\n slug: get(),\n title: get(),\n }\n ),\n // this nested composite doesn\'t\n // take arguments so the select function\n // is used instead\n comments: select(CommentSelections {\n body: get()\n }),\n }),\n).unwrap();\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"selecting-fields",children:"Selecting fields"}),"\n",(0,s.jsx)(n.p,{children:"Booleans indicate interest when selecting fields on an object.\nBy default a field isn't included if it's null, or unspecified.\nSelections can include selection flags to flip the default so that all unspecified fields get included.\nThis won't apply if the field requires an argument explicitly requiring them for inclusion."}),"\n",(0,s.jsxs)(n.p,{children:["Note that these patterns are different in the ",(0,s.jsx)(n.code,{children:"client_rs"})," implementations as demonstrated below:"]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserArgs(id="1234"),\n UserSelections(\n # seletion flags are set on the underscore\n # field. The select_all flg flips the\n # semantics for unspecified fields\n _=SelectionFlags(select_all=True),\n # False excludes fields explicitly\n id=False,\n # the posts field takes an argument\n # so the select_all flag doesn\'t apply\n # it still must be provided\n # if intending to include it\n posts=(\n PostArgs(filter="top"), \n # TypedDict form\n {"_": SelectionFlags(select_all=True)},\n ),\n # comments is a nested composite but\n # doesn\'t take args so select_all flag applies\n # comments=CommentSelections(\n # body=True\n # )\n ),\n ),\n }\n)\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // posts field takes an argument\n // and is also a composite\n // selection and arguments are combined\n // with array tuples in such cases\n posts: [\n { filter: "top" }, \n { title: true, slug: true }\n ],\n // this nested composite doesn\'t\n // take arguments so no tuple\n // required\n }\n ),\n});\nconst { user } = await gqlClient.query({\n user: api1.getUser(\n { id: "1234" }, \n {\n // seletion flags are set on the underscore\n // field. The selectAll flg flips the\n // semantics for unspecified fields\n _: "selectAll",\n // false excludes fields explicitly \n id: false,\n // post field takes an argument\n // so the selectAll flag doesn\'t apply\n // it still must be provided\n // if intending to include it\n posts: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n // comments is a nested composite but\n // doesnt\'t take args so selectAll flag applies\n // comments: { body: true }\n }\n ),\n});\n '},rust:{content:'let user = gql_sync.query(\n api1.get_user(UserArgs { id: "1234".into() })\n .select(UserSelections {\n // skip excludes fields explicitly \n id: skip(),\n\n // post field takes an argument\n // so the all() down below still\n // won\'t include it\n // it must be provided explicitly\n // if intending to include it\n posts: arg_select(\n PostArgs { filter: "top".into() },\n // we use all top \n all()\n ),\n\n // comments is a nested composite but\n // doesnt\'t take args so the all() down\n // below includes it\n // comments: select(CommentSelections::all())\n\n // filling the missing fields with the results\n // of all() using the struct update syntax\n // ensures they\'re all get()\n // use default() to get a selection that is full\n // of skip()\n ..all()\n }),\n).unwrap();\n'},disablePlayground:!0}),"\n",(0,s.jsx)(n.p,{children:"Note that this only applies to scalar fields and those that require arguments or are structs must still be explicitly included."}),"\n",(0,s.jsx)(n.h3,{id:"preparing-requests",children:"Preparing requests"}),"\n",(0,s.jsxs)(n.p,{children:["Some transports like the ",(0,s.jsx)(n.code,{children:"GraphQLTransport"})," allows one to prepare requests before hand and reuse them.\nThis isn't immediately useful but will be critical when persisted queries are available in Metatype."]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nprepared = gql_client.prepare_query(\n # the args object will contain placholder value of the arguments\n # the lambda will then return a request description as\n # usual\n lambda args: {\n "user": qg.get_user(\n # use only values from args for arguments\n # no branching should be done\n { "id": args.get("userId") },\n {\n "id": True,\n "email": True,\n "posts": (\n { "filter": args.get("postFilter") }, \n { "_": SelectionFlags(select_all=True) },\n ),\n },\n ),\n },\n)\n\n# execute the actual query\n# the input here must contain every key\n# used from the lambda arg above\nout = prepared.perform({\n "userId": "1234",\n "postFilter": "top",\n})\nout2 = prepared.perform({\n "userId": "5678",\n "postFilter": "hot",\n})\n'},typescript:{content:'\nconst prepared = gqlClient.prepareQuery(\n // the args object will contain placholder value of the arguments\n // the closure will then return a request description as\n // usual\n (\n // types can be provided as hints\n args: PreparedArgs<{\n userId: string;\n postFilter: string;\n }>,\n ) => ({\n\n user: api1.getUser(\n // use only values from args for arguments\n // no branching should be done\n { id: args.userId }, \n {\n id: true,\n email: true,\n posts: [\n { filter: args.postFilter }, \n { title: true, slug: true }\n ],\n }),\n\n })\n);\n\n// execute the actual query\n// the input here must contain every key\n// used from the closure arg above\nconst { posts } = await prepared.perform({ \n userId: "1234" \n postFilter: "top" \n});\nconst { posts: posts2 } = await prepared.perform({ \n userId: "5678" \n postFilter: "hot" \n});\n '},rust:{content:'\nlet prepared_m = gql_sync.prepare_mutation(\n // the args object will contain placholder value of the arguments\n // the closure will then return a request description as\n // usual\n |args| {\n (\n // for each placholder value, we provide a closure that returns\n // argument structs according to the value\n // this closure will be used for each use of the prepared\n // request\n api1.scalar_args(args.get("userId", |id: String| UserArgs { id })),\n .select(UserSelections {\n id: get(),\n slug: get(),\n posts: arg_select(\n // the placholder closures can take any parameter\n // that implements serde::DeserializeOwned\n // the closure here does no transformation\n args.get("postFilter", |val: PostArgs| val)\n PostSelections {\n id: get(),\n slug: get(),\n title: get(),\n }\n ),\n }),\n )\n }\n);\n\n// execute the actual query\n// the input here must contain every key\n// used from the closure arg above\nlet user1 = prepared_clone.perform([\n (\n "userId",\n // perform takes an Into parameter, \n // requiring use of json values to \n // allow heterogeneous values in a single map\n serde_json::json!("1234"),\n ),\n (\n "postFilter",\n serde_json::json!(PostArgs{\n filter: "hot".into(),\n }),\n ),\n])?;\nlet user1 = prepared_clone.perform([\n (\n "userId",\n serde_json::json!("1234"),\n ),\n (\n "postFilter",\n // we can provide PostArgs in json form alternatively\n // but this is less typesafe\n serde_json::json!({\n "filter": "top"\n }),\n ),\n])?;\n\n '},disablePlayground:!0}),"\n",(0,s.jsx)(n.admonition,{title:"Caution",type:"warning",children:(0,s.jsx)(n.p,{children:"Note that in all three implementations, the closures are only invoked once and it's critical that there are no branching logic present in them."})}),"\n",(0,s.jsx)(n.h3,{id:"aliases",children:"Aliases"}),"\n",(0,s.jsxs)(n.p,{children:["Aliasing allows the querying of a node multiple times under different names.\nThis is very similar to the ",(0,s.jsx)(n.a,{href:"https://graphql.org/learn/queries/#aliases",children:"GraphQL aliases"})," and uses them under the hood when using the GraphQLTransport.\nNote that not all ",(0,s.jsx)(n.code,{children:"Runtimes"})," support aliasing so make sure your target does before using this feature."]}),"\n",(0,s.jsx)(i.A,{python:{content:'\nout = gql_client.query(\n {\n "user": qg.get_user(\n UserSelections(\n _=SelectionFlags(select_all=True),\n # all selections accept Aliases in their stead\n # including scalars\n posts=Alias(\n # posts is a composie with arguments so the \n # tuple form is expected\n post1=(\n PostArgs(filter="top"), \n PostSelections(\n id=True,\n slug=True,\n title=True,\n ),\n )\n # a second aliasing\n post2=(\n PostArgs(filter="hot"), \n PostSelections(\n _=SelectionFlags(select_all=True),\n id=False,\n ),\n )\n ),\n ),\n ),\n }\n)\n# note that when using aliases, the TypedDict are no longer\n# valid\nposts1 = out["user"]["post1"];\nposts2 = out["user"].["post2"];\n'},typescript:{content:'\nconst { user } = await gqlClient.query({\n user: api1.getUser({\n _: "selectAll",\n // all selections accept alias() in their stead\n // including scalars\n posts: alias({\n // posts is a composie with arguments so the \n // tuple form is expected\n post1: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n // a second aliasing\n post2: [\n { filter: "top" }, \n { _: "selectAll" }\n ],\n }),\n }),\n});\n\n// when using aliases, the original types\n// provided are no longer accurate\nconst posts1 = user.post1\nconst posts2 = user.post1\n '},rust:{content:'\n// user here is a serde_json::Value type\n// since we opted into aliases by using\n// select_aliased\nlet (user,) = gql_sync.query((\n api1.get_user()\n // alias() selections are only available under root select_aliased\n // selections. Even if the alias() is nested deep, the root\n // must be select_aliased\n .select_aliased(UserSelections {\n // all selections accept alias() in their stead\n // including scalars\n posts: alias([\n (\n "post1",\n // posts is a composie with arguments so the \n // arg_select form is expected\n posts: arg_select(\n PostArgs { filter: "top".into() },\n PostSelections {\n ..all()\n }\n ),\n ),\n // a second aliasing\n ("post2", arg_select(PostArgs { filter: "hot".into() }, all())),\n ]),\n ..all()\n }),\n))?;\n// aliases force use of json to bypass the generated types\nlet posts1 = user["post1"];\nlet posts2 = user["post2"];\n '},disablePlayground:!0}),"\n",(0,s.jsx)(n.h3,{id:"unions",children:"Unions"}),"\n",(0,s.jsx)(n.p,{children:"Union and either types that have composite variants require special forms when querying them.\nThe generated selection types will have fields for selecting composite variants.\nIf the value from the API wasn't of a selected variant, an empty object will be returned.\nScalar variants are always selected."}),"\n",(0,s.jsx)(i.A,{python:{content:'\nres5 = gql_client.query(\n {\n # this case is only interested in post values\n "postOnly": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n "post": {"_": SelectionFlags(select_all=True)}\n },\n ),\n "userOnly": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n "user": { "_": SelectionFlags(select_all=True) }\n },\n ),\n "both": qg.composite_union(\n {\n "userId": "1234"\n },\n {\n # add selections for both variants to ensure\n # that a value is present no matter the type\n "post": {"_": SelectionFlags(select_all=True)},\n "user": {"_": SelectionFlags(select_all=True)},\n },\n ),\n }\n)\n'},typescript:{content:'\nconst out = await gqlClient.query({\n // this case is only interested in post values\n postOnly: api1.compositeUnion(\n { id: "1234" }, \n {\n post: { "_": "selectAll" },\n }\n ),\n userOnly: api1.compositeUnion(\n { id: "1234" }, \n {\n user: { "_": "selectAll" },\n }\n ),\n both: api1.compositeUnion(\n { id: "1234" }, \n {\n // add selections for both variants to ensure\n // that a value is present no matter the type\n user: { "_": "selectAll" },\n post: { "_": "selectAll" },\n }\n ),\n});\n '},rust:{content:'\nlet out = gql\n .query((\n // this case is only interested in post values\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n post: select(all()),\n ..default()\n }),\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n user: select(all()),\n ..default()\n }),\n api1\n .composite_union(MyArgs { id: "1234".into(), })\n .select(UnionSelections {\n // add selections for both variants to ensure\n // that a value is present no matter the type\n post: select(all()),\n user: select(all()),\n }),\n ))\n .await?;\n'},disablePlayground:!0})]})}function p(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{t.d(n,{A:()=>i});var s=t(98302),r=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...l}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,r.jsx)(s.A,{code:0==o.length?void 0:o,...l})}}}]); \ No newline at end of file diff --git a/assets/js/5e3d8afa.672c1ae7.js b/assets/js/5e3d8afa.672c1ae7.js new file mode 100644 index 0000000000..9e0981ec41 --- /dev/null +++ b/assets/js/5e3d8afa.672c1ae7.js @@ -0,0 +1 @@ +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3862],{75627:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>o,toc:()=>c});var i=t(86070),s=t(25710),r=t(65671);const a={sidebar_position:50},l="GraphQL",o={id:"reference/graphql/index",title:"GraphQL",description:"GraphQL is the primary means of querying your typegraph.",source:"@site/docs/reference/graphql/index.mdx",sourceDirName:"reference/graphql",slug:"/reference/graphql/",permalink:"/docs/reference/graphql/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/graphql/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Embedded Typegate",permalink:"/docs/reference/meta-cli/embedded-typegate/"},next:{title:"Changelog",permalink:"/docs/reference/changelog"}},d={},c=[{value:"Query and Mutation",id:"query-and-mutation",level:2},{value:"Variables",id:"variables",level:2},{value:"Types",id:"types",level:2},{value:"Scalars",id:"scalars",level:3},{value:"Files",id:"files",level:3},{value:"Structs",id:"structs",level:3},{value:"Lists",id:"lists",level:3},{value:"Functions",id:"functions",level:3},{value:"Unions and Eithers",id:"unions-and-eithers",level:3}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"graphql",children:"GraphQL"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://graphql.org/",children:"GraphQL"})," is the primary means of querying your typegraph.\nThis page documents all the semantics of how your typegraph translates into a GraphQL schema."]}),"\n",(0,i.jsxs)(n.h2,{id:"query-and-mutation",children:[(0,i.jsx)(n.code,{children:"Query"})," and ",(0,i.jsx)(n.code,{children:"Mutation"})]}),"\n",(0,i.jsxs)(n.p,{children:["The root functions passed to the ",(0,i.jsx)(n.code,{children:"expose"})," function will be added as fields to the ",(0,i.jsxs)(n.a,{href:"https://graphql.org/learn/schema/#the-query-and-mutation-types",children:["special ",(0,i.jsx)(n.code,{children:"query"})," and ",(0,i.jsx)(n.code,{children:"mutation"})]})," GraphQL objects.\nUnder which object a function is assigned depends on it's ",(0,i.jsx)(n.a,{href:"/docs/reference/types/functions",children:"effect"}),".\nNote that this assignment still holds for deeply nested functions so be sure to avoid including functions that have mutating effects under query responses or vice versa."]}),"\n",(0,i.jsx)(n.h2,{id:"variables",children:"Variables"}),"\n",(0,i.jsxs)(n.p,{children:["While ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/queries/#variables",children:"GraphQL Variables"})," work as expected for the most part, the typegate currently does not do type validation of variables for the provided query documents."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-graphql",children:'query ($varRight: String!, $varWrong: Int!) {\n foo1: foo(in: $varRight)\n foo2: foo(in: $varWrong)\n}\n{\n "varRight": "string",\n # request will work as long as varWrong is string\n # even if variable above was annotated as Int\n "varWrong": "AlsoString",\n}\n'})}),"\n",(0,i.jsx)(n.h2,{id:"types",children:"Types"}),"\n",(0,i.jsx)(n.h3,{id:"scalars",children:"Scalars"}),"\n",(0,i.jsxs)(n.p,{children:["The simple primitive typegraph types translate directly to their ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/schema/#scalar-types",children:"GraphQL equivalent"}),".\nThis includes standard scalar variants like ",(0,i.jsx)(n.code,{children:"t.uuid"})," or any user declared aliases with custom configurations.\nNo custom GraphQL scalars are generated for such types."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"GraphQL type"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.integer()"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"Int"})}),(0,i.jsx)(n.td,{children:"Represents signed 32-bit integers."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.float()"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"Float"})}),(0,i.jsxs)(n.td,{children:["Represents signed double-precision values as specified by ",(0,i.jsx)(n.a,{href:"https://en.wikipedia.org/wiki/IEEE_754",children:"IEEE 754"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.boolean()"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"Boolean"})}),(0,i.jsxs)(n.td,{children:["Represents ",(0,i.jsx)(n.code,{children:"true"})," or ",(0,i.jsx)(n.code,{children:"false"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.string()"})}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"String"})}),(0,i.jsx)(n.td,{children:"Represents textual data as UTF-8 character sequences."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"files",children:"Files"}),"\n",(0,i.jsxs)(n.p,{children:["File types, primarily used through the ",(0,i.jsx)(n.a,{href:"/docs/reference/runtimes/s3",children:(0,i.jsx)(n.code,{children:"S3Runtime"})}),", translate to a custom scalar called ",(0,i.jsx)(n.code,{children:"File"})," in the GraphQL schema.\nThe ",(0,i.jsx)(n.code,{children:"S3Runtime"})," provides a set of helpers for all your file needs including support for ",(0,i.jsx)(n.a,{href:"/docs/guides/files-upload",children:"multipart HTTP requests"})," for file upload."]}),"\n",(0,i.jsx)(n.h3,{id:"structs",children:"Structs"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"t.structs"})," types translate to:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://graphql.org/learn/schema/#input-types",children:"GraphQL input types"})," when used as inputs to functions"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.a,{href:"https://graphql.org/learn/schema/#object-types-and-fields",children:"GraphQL object types"})," in any other place."]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"lists",children:"Lists"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"t.list"})," types simply convert to ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/schema/#lists-and-non-null",children:"GraphQL list types"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"functions",children:"Functions"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"t.func"})," types are represented by their output type in the GraphQL schema.\nIf their input struct has fields present, these are converted to ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/schema/#arguments",children:"arguments"})," for the field."]}),"\n",(0,i.jsx)(n.h3,{id:"unions-and-eithers",children:"Unions and Eithers"}),"\n",(0,i.jsx)(n.p,{children:"Unions and either translate to a number of different forms depending on their usage in the graph and their composition."}),"\n",(0,i.jsx)(n.p,{children:"When used as a field in an input struct, unions/eithers are converted to custom scalars since the GraphQL spec doesn't allow GraphQL unions on input types.\nThese scalars expect the standard JSON representation of your value and that is all."}),"\n",(0,i.jsxs)(n.p,{children:["When querying union/either values, there are a few more details.\nFor struct variants, the standard GraphQL rules apply and ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/queries/#inline-fragments",children:"inline fragments"})," must be used.\nCurrently, all struct variants must have inline fragments present even if the user is not interested in them.\nAnd as per GraphQL spec, common field querying is not supported and any fields must be part of the inline fragment.\nUnlike the GraphQL spec, this includes the ",(0,i.jsx)(n.code,{children:"__typename"})," field which must be included in the fragments instead."]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-graphql",children:"# introspection schema\nunion MyUnion = Struct1 | Struct2\n\ntype Struct1 {\n foo: String!\n bar: String!\n}\n\ntype Struct2 {\n foo: String!\n baz: String!\n}\n\n# introspection expected query (THIS IS WRONG)\nquery {\n myUnion {\n # common fields are not supported\n __typename\n foo\n ... on Struct1 {\n bar\n }\n ... on Struct2 {\n baz\n }\n }\n}\n\n# actual expected query (THIS IS RIGHT)\nquery {\n myUnion {\n ... on Struct1 {\n # common fields must be included each time\n __typename\n foo\n bar\n }\n ... on Struct2 {\n __typename\n foo\n baz\n }\n }\n}\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For scalar variant, the introspected GraphQL schema will include a ",(0,i.jsx)(n.code,{children:"_NameOfScalar"})," variant in the introspection schema ",(0,i.jsx)(n.strong,{children:"but"})," the value is returned at the field level as a simple scalar.\nThat is, GraphQL API explorers will show union ",(0,i.jsx)(n.strong,{children:"object"})," members that include the scalar values and they'll prompt you to use ",(0,i.jsx)(n.a,{href:"https://graphql.org/learn/queries/#inline-fragments",children:"inline fragments"})," for querying the scalar members.\nBut the typegate will reject these kind of queries in preference to simple fields.\nLook at the following example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-graphql",children:'# introspection schema\nunion MyUnion = _String | _Integer\n\ntype _String {\n string: String!\n}\n\ntype _Integer {\n integer: Int!\n}\n\n# introspection expected query (THIS IS WRONG)\nquery {\n myUnion {\n ... on _String {\n string\n }\n ... on _Integer {\n integer\n }\n }\n}\n\n# actual expected query (THIS IS RIGHT)\nquery {\n # no subfield selection at all required\n # since all members are scalars\n myUnion\n}\n\n# received json\n{\n "myUnion": "string"\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"List members act accordingly to their wrapped times.\nLists of scalars are treated as scalars and lists of composites as a standard GraphQL composites list."}),"\n",(0,i.jsx)(n.p,{children:"The following playground shows all the different types of unions/eithers:"}),"\n",(0,i.jsx)(r.A,{typegraph:"union-either",typescript:t(67548),python:t(51626),query:t(82481)})]})}function p(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var i=t(98302),s=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...a}=e;const l=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==l.length?void 0:l,...a})}},82481:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"outer"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"unionList"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_1"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field1"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_2"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field2"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"union"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_1"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field1"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_2"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field2"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"either"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_1"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field1"},arguments:[],directives:[]}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"comp_2"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field2"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:532}};n.loc.source={body:"{\n outer {\n # scalar 1 and 2 don't need\n # type inline fragments\n unionList {\n ... on comp_1 {\n field1\n }\n ... on comp_2 {\n field2\n }\n }\n # we must include fragments\n # for all composites or it will fail\n union {\n ... on comp_1 {\n field1\n }\n ... on comp_2 {\n field2\n }\n }\n # rules are the same between unions and eithers\n either {\n ... on comp_1 {\n field1\n }\n ... on comp_2 {\n field2\n }\n }\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},51626:e=>{e.exports={content:'@typegraph(\n)\ndef union_either(g: Graph):\n deno = DenoRuntime()\n members = [\n t.string().rename("scalar_1"),\n t.integer().rename("scalar_2"),\n t.struct(\n {\n "field1": t.string(),\n }\n ).rename("comp_1"),\n t.struct(\n {\n "field2": t.string(),\n }\n ).rename("comp_2"),\n t.list(t.string()).rename("scalar_list"),\n # # FIXME: list of composites is broken\n # t.list(\n # t.struct(\n # {\n # "listField": t.string(),\n # }\n # ),\n # ),\n ]\n g.expose(\n Policy.public(),\n outer=deno.func(\n t.struct(),\n t.struct(\n {\n "union": t.union(members),\n "either": t.either(members),\n "unionList": t.list(t.union(members)),\n }\n ),\n code="""() => ({\n either: {\n field1: "1",\n },\n union: {\n field2: "2",\n },\n unionList: [\n "scalar",\n 2,\n {\n field1: "1",\n },\n {\n field2: "2",\n },\n ["scalar_1", "scalar_2"],\n ],\n })""",\n ),\n )',path:"../examples/typegraphs/union-either.py"}},67548:e=>{e.exports={content:'typegraph(\n {\n name: "union-either",\n },\n (g) => {\n const deno = new DenoRuntime();\n const members = [\n t.string().rename("scalar_1"),\n t.integer().rename("scalar_2"),\n t.struct({\n field1: t.string(),\n }).rename("comp_1"),\n t.struct({\n field2: t.string(),\n }).rename("comp_2"),\n t.list(t.string()).rename("scalar_list"),\n /* FIXME: list of composites is broken\n t.list(\n t.struct({\n listField: t.string(),\n }),\n ), */\n ];\n g.expose({\n outer: deno.func(\n // input\n t.struct({}),\n // output\n t.struct({\n union: t.union(members),\n either: t.either(members),\n unionList: t.list(t.union(members)),\n }),\n {\n code: () => ({\n either: {\n field1: "1",\n },\n union: {\n field2: "2",\n },\n unionList: [\n "scalar",\n 2,\n {\n field1: "1",\n },\n {\n field2: "2",\n },\n ["scalar_1", "scalar_2"],\n ],\n }),\n },\n ),\n }, Policy.public());\n },\n);',path:"../examples/typegraphs/union-either.ts"}}}]); \ No newline at end of file diff --git a/assets/js/6b5a7be1.510e9cd3.js b/assets/js/6b5a7be1.7d9dbc23.js similarity index 68% rename from assets/js/6b5a7be1.510e9cd3.js rename to assets/js/6b5a7be1.7d9dbc23.js index 9530f8ccde..35e7f1cdd5 100644 --- a/assets/js/6b5a7be1.510e9cd3.js +++ b/assets/js/6b5a7be1.7d9dbc23.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2920],{65977:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=n(86070),r=n(25710);const s={},o="Introducing gRPC Runtime",a={permalink:"/blog/2024/09/26/introducing-grpc-runtime",editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx",source:"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx",title:"Introducing gRPC Runtime",description:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs.",date:"2024-09-26T00:00:00.000Z",tags:[],readingTime:4.4,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,nextItem:{title:"Distributed execution flow paradigms",permalink:"/blog/2024/08/27/distributed-execution-flow-paradigms"}},l={authorsImageUrls:[]},c=[{value:"What is gRPC?",id:"what-is-grpc",level:2},{value:"Why gRPC Matters for Metatype",id:"why-grpc-matters-for-metatype",level:2},{value:"Diagram: gRPC and Metatype Integration",id:"diagram-grpc-and-metatype-integration",level:2},{value:"Introducing gRPC Runtime in Metatype",id:"introducing-grpc-runtime-in-metatype",level:2},{value:"Key Technical Details",id:"key-technical-details",level:2},{value:"Architecture",id:"architecture",level:3},{value:"Implementation",id:"implementation",level:3},{value:"Benefits for Developers",id:"benefits-for-developers",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs."}),"\n",(0,i.jsx)(t.h2,{id:"what-is-grpc",children:"What is gRPC?"}),"\n",(0,i.jsxs)(t.p,{children:["gRPC, or ",(0,i.jsx)(t.strong,{children:"g"}),"oogle ",(0,i.jsx)(t.strong,{children:"R"}),"emote ",(0,i.jsx)(t.strong,{children:"P"}),"rocedure ",(0,i.jsx)(t.strong,{children:"C"}),"all, is a high-performance, open-source communication framework initially developed by Google. It enables ",(0,i.jsx)(t.strong,{children:"efficient and fast communication between microservices"})," in a distributed system, making it ideal for modern backend architectures."]}),"\n",(0,i.jsxs)(t.p,{children:["Unlike traditional HTTP APIs that use JSON, gRPC relies on ",(0,i.jsx)(t.strong,{children:"Protocol Buffers"})," (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems."]}),"\n",(0,i.jsx)(t.p,{children:"Key benefits of gRPC include:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Cross-language support"}),": gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Strong type safety"}),": Protocol Buffers ensure type-safe communication, catching errors early and improving reliability."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Bidirectional streaming"}),": gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"In short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential."}),"\n",(0,i.jsx)(t.h2,{id:"why-grpc-matters-for-metatype",children:"Why gRPC Matters for Metatype"}),"\n",(0,i.jsxs)(t.p,{children:["Metatype is a platform that enables developers to create ",(0,i.jsx)(t.strong,{children:"typegraphs"}),"\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility."]}),"\n",(0,i.jsx)(t.p,{children:"By integrating gRPC, Metatype empowers developers to:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Expose gRPC services via GraphQL or HTTP endpoints"}),", making them accessible to clients in a way that best suits their needs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Compose gRPC services with other backend components"}),", such as databases or other APIs, to create powerful and cohesive backend systems."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"diagram-grpc-and-metatype-integration",children:"Diagram: gRPC and Metatype Integration"}),"\n",(0,i.jsx)("center",{children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"gRPC and Metatype Integration Diagram",src:n(15602).A+"",width:"161",height:"681"})})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.em,{children:"Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend."})}),"\n",(0,i.jsx)(t.h2,{id:"introducing-grpc-runtime-in-metatype",children:"Introducing gRPC Runtime in Metatype"}),"\n",(0,i.jsx)(t.p,{children:"The new gRPC Runtime is the latest addition to Metatype's suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends."}),"\n",(0,i.jsx)(t.h2,{id:"key-technical-details",children:"Key Technical Details"}),"\n",(0,i.jsx)(t.h3,{id:"architecture",children:"Architecture"}),"\n",(0,i.jsx)(t.p,{children:"The gRPC Runtime integrates seamlessly with Metatype's existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"GrpcRuntime Class"}),": The main interface for defining gRPC interactions within your typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"proto_file"}),": Path to the .proto file that defines the gRPC service."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"endpoint"}),": The gRPC server address in the format ",(0,i.jsx)(t.code,{children:"tcp://:"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"call method"}),": Creates a typegraph function for gRPC method calls."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"implementation",children:"Implementation"}),"\n",(0,i.jsx)(t.p,{children:"Here's how the gRPC Runtime fits into a Metatype typegraph:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:'from typegraph import Graph, Policy, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes.grpc import GrpcRuntime\n\n@typegraph(\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef create_grpc_typegraph(g: Graph):\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\n grpc_runtime = GrpcRuntime(\n # proto_file: Path to the .proto file that defines the gRPC service\n proto_file="proto/helloworld.proto",\n # endpoint: The gRPC server address in the format tcp://:\n endpoint="tcp://localhost:4770"\n )\n \n # Expose the gRPC service within your typegraph\n # This allows you to incorporate gRPC calls alongside other runtime operations\n g.expose(\n Policy.public(),\n # call method: Creates a typegraph function for gRPC method calls\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\n greet=grpc_runtime.call("/helloworld.Greeter/SayHello"),\n )\n\n# The typegraph can now be exposed via GraphQL or HTTP, \n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\n'})}),"\n",(0,i.jsx)(t.p,{children:"This implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Define gRPC service connections using the GrpcRuntime class"}),"\n",(0,i.jsx)(t.li,{children:"Expose gRPC methods as part of your typegraph"}),"\n",(0,i.jsx)(t.li,{children:"Combine gRPC functionality with other Metatype features and runtimes"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"By structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic."}),"\n",(0,i.jsx)(t.h2,{id:"benefits-for-developers",children:"Benefits for Developers"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Unified Backend Structure"}),": Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Type Safety"}),": Leverage Metatype's strong typing system in conjunction with gRPC's protocol buffers for end-to-end type safety."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Flexible Exposure"}),": Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Composability"}),": Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsx)(t.p,{children:"To start using the gRPC Runtime in your Metatype project:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Ensure you have the latest version of Metatype installed."}),"\n",(0,i.jsx)(t.li,{children:"Prepare your .proto files for the gRPC services you want to integrate."}),"\n",(0,i.jsx)(t.li,{children:"Set up your typegraph as shown in the example above, incorporating the GrpcRuntime."}),"\n",(0,i.jsx)(t.li,{children:"Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed."}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(t.p,{children:"The addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease."}),"\n",(0,i.jsxs)(t.p,{children:["For more detailed documentation, code examples, and best practices, check out our ",(0,i.jsx)(t.a,{href:"https://metatype.dev/docs",children:"official Metatype docs"}),"#."]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},15602:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/GrpcMetatype.drawio-e6e626affae448f5b44a48ab82805ee9.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2920],{65977:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=n(86070),r=n(25710);const s={},o="Introducing gRPC Runtime",a={permalink:"/blog/2024/09/26/introducing-grpc-runtime",editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx",source:"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx",title:"Introducing gRPC Runtime",description:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs.",date:"2024-09-26T00:00:00.000Z",tags:[],readingTime:4.4,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,nextItem:{title:"Distributed execution flow paradigms",permalink:"/blog/2024/08/27/distributed-execution-flow-paradigms"}},l={authorsImageUrls:[]},c=[{value:"What is gRPC?",id:"what-is-grpc",level:2},{value:"Why gRPC Matters for Metatype",id:"why-grpc-matters-for-metatype",level:2},{value:"Diagram: gRPC and Metatype Integration",id:"diagram-grpc-and-metatype-integration",level:2},{value:"Introducing gRPC Runtime in Metatype",id:"introducing-grpc-runtime-in-metatype",level:2},{value:"Key Technical Details",id:"key-technical-details",level:2},{value:"Architecture",id:"architecture",level:3},{value:"Implementation",id:"implementation",level:3},{value:"Benefits for Developers",id:"benefits-for-developers",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs."}),"\n",(0,i.jsx)(t.h2,{id:"what-is-grpc",children:"What is gRPC?"}),"\n",(0,i.jsxs)(t.p,{children:["gRPC, or ",(0,i.jsx)(t.strong,{children:"g"}),"oogle ",(0,i.jsx)(t.strong,{children:"R"}),"emote ",(0,i.jsx)(t.strong,{children:"P"}),"rocedure ",(0,i.jsx)(t.strong,{children:"C"}),"all, is a high-performance, open-source communication framework initially developed by Google. It enables ",(0,i.jsx)(t.strong,{children:"efficient and fast communication between microservices"})," in a distributed system, making it ideal for modern backend architectures."]}),"\n",(0,i.jsxs)(t.p,{children:["Unlike traditional HTTP APIs that use JSON, gRPC relies on ",(0,i.jsx)(t.strong,{children:"Protocol Buffers"})," (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems."]}),"\n",(0,i.jsx)(t.p,{children:"Key benefits of gRPC include:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Cross-language support"}),": gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Strong type safety"}),": Protocol Buffers ensure type-safe communication, catching errors early and improving reliability."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Bidirectional streaming"}),": gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"In short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential."}),"\n",(0,i.jsx)(t.h2,{id:"why-grpc-matters-for-metatype",children:"Why gRPC Matters for Metatype"}),"\n",(0,i.jsxs)(t.p,{children:["Metatype is a platform that enables developers to create ",(0,i.jsx)(t.strong,{children:"typegraphs"}),"\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility."]}),"\n",(0,i.jsx)(t.p,{children:"By integrating gRPC, Metatype empowers developers to:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Expose gRPC services via GraphQL or HTTP endpoints"}),", making them accessible to clients in a way that best suits their needs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Compose gRPC services with other backend components"}),", such as databases or other APIs, to create powerful and cohesive backend systems."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"diagram-grpc-and-metatype-integration",children:"Diagram: gRPC and Metatype Integration"}),"\n",(0,i.jsx)("center",{children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"gRPC and Metatype Integration Diagram",src:n(15602).A+"",width:"161",height:"681"})})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.em,{children:"Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend."})}),"\n",(0,i.jsx)(t.h2,{id:"introducing-grpc-runtime-in-metatype",children:"Introducing gRPC Runtime in Metatype"}),"\n",(0,i.jsx)(t.p,{children:"The new gRPC Runtime is the latest addition to Metatype's suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends."}),"\n",(0,i.jsx)(t.h2,{id:"key-technical-details",children:"Key Technical Details"}),"\n",(0,i.jsx)(t.h3,{id:"architecture",children:"Architecture"}),"\n",(0,i.jsx)(t.p,{children:"The gRPC Runtime integrates seamlessly with Metatype's existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"GrpcRuntime Class"}),": The main interface for defining gRPC interactions within your typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"proto_file"}),": Path to the .proto file that defines the gRPC service."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"endpoint"}),": The gRPC server address in the format ",(0,i.jsx)(t.code,{children:"tcp://:"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"call method"}),": Creates a typegraph function for gRPC method calls."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"implementation",children:"Implementation"}),"\n",(0,i.jsx)(t.p,{children:"Here's how the gRPC Runtime fits into a Metatype typegraph:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:'from typegraph import Graph, Policy, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes.grpc import GrpcRuntime\n\n@typegraph(\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef create_grpc_typegraph(g: Graph):\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\n grpc_runtime = GrpcRuntime(\n # proto_file: Path to the .proto file that defines the gRPC service\n proto_file="proto/helloworld.proto",\n # endpoint: The gRPC server address in the format tcp://:\n endpoint="tcp://localhost:4770"\n )\n\n # Expose the gRPC service within your typegraph\n # This allows you to incorporate gRPC calls alongside other runtime operations\n g.expose(\n Policy.public(),\n # call method: Creates a typegraph function for gRPC method calls\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\n greet=grpc_runtime.call("/helloworld.Greeter/SayHello"),\n )\n\n# The typegraph can now be exposed via GraphQL or HTTP,\n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\n'})}),"\n",(0,i.jsx)(t.p,{children:"This implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Define gRPC service connections using the GrpcRuntime class"}),"\n",(0,i.jsx)(t.li,{children:"Expose gRPC methods as part of your typegraph"}),"\n",(0,i.jsx)(t.li,{children:"Combine gRPC functionality with other Metatype features and runtimes"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"By structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic."}),"\n",(0,i.jsx)(t.h2,{id:"benefits-for-developers",children:"Benefits for Developers"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Unified Backend Structure"}),": Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Type Safety"}),": Leverage Metatype's strong typing system in conjunction with gRPC's protocol buffers for end-to-end type safety."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Flexible Exposure"}),": Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Composability"}),": Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsx)(t.p,{children:"To start using the gRPC Runtime in your Metatype project:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Ensure you have the latest version of Metatype installed."}),"\n",(0,i.jsx)(t.li,{children:"Prepare your .proto files for the gRPC services you want to integrate."}),"\n",(0,i.jsx)(t.li,{children:"Set up your typegraph as shown in the example above, incorporating the GrpcRuntime."}),"\n",(0,i.jsx)(t.li,{children:"Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed."}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(t.p,{children:"The addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease."}),"\n",(0,i.jsxs)(t.p,{children:["For more detailed documentation, code examples, and best practices, check out our ",(0,i.jsx)(t.a,{href:"https://metatype.dev/docs",children:"official Metatype docs"}),"#."]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},15602:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/GrpcMetatype.drawio-e6e626affae448f5b44a48ab82805ee9.png"}}]); \ No newline at end of file diff --git a/assets/js/6baad3d0.619f56be.js b/assets/js/6baad3d0.2b7fdc50.js similarity index 97% rename from assets/js/6baad3d0.619f56be.js rename to assets/js/6baad3d0.2b7fdc50.js index e5af6e6544..0af3d017b2 100644 --- a/assets/js/6baad3d0.619f56be.js +++ b/assets/js/6baad3d0.2b7fdc50.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7010],{51092:(e,I,g)=>{"use strict";g.r(I),g.d(I,{assets:()=>d,contentTitle:()=>t,default:()=>c,frontMatter:()=>a,metadata:()=>A,toc:()=>s});var i=g(86070),n=g(25710),C=g(65671);const a={},t="Instant APIs on your database",A={id:"automatic-crud-validation/index",title:"Instant APIs on your database",description:"CRUD stands for Create, Read, Update, and Delete, which are the four basic functions of persistent storage in a software application. Those operations are commonly used in combination with data validation to ensure that the stored data is correct and consistent.",source:"@site/use-cases/automatic-crud-validation/index.mdx",sourceDirName:"automatic-crud-validation",slug:"/automatic-crud-validation/",permalink:"/use-cases/automatic-crud-validation/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/automatic-crud-validation/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",next:{title:"Backend for frontend",permalink:"/use-cases/backend-for-frontend/"}},d={},s=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function o(e){const I={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",...(0,n.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(I.h1,{id:"instant-apis-on-your-database",children:"Instant APIs on your database"}),"\n",(0,i.jsx)(I.p,{children:"CRUD stands for Create, Read, Update, and Delete, which are the four basic functions of persistent storage in a software application. Those operations are commonly used in combination with data validation to ensure that the stored data is correct and consistent."}),"\n",(0,i.jsx)(I.h2,{id:"case-study",children:"Case study"}),"\n",(0,i.jsx)("div",{className:"text-center md:float-right p-8",children:(0,i.jsx)(I.p,{children:(0,i.jsx)(I.img,{src:g(37834).A+""})})}),"\n",(0,i.jsx)(I.p,{children:"Let's say you are developing a web application for a retail store that allows customers to place orders online. In this scenario, you would need to use CRUD operations to create, read, update, and delete data related to orders, customers, products, and inventory."}),"\n",(0,i.jsx)(I.p,{children:"You would have to model each of these entities as a data type, define the operations that can be performed on them and write the code to ensure the correctness of the data processed in the operations."}),"\n",(0,i.jsxs)(I.p,{children:["For example, you would need to define a ",(0,i.jsx)(I.code,{children:"Customer"})," type with the following fields: ",(0,i.jsx)(I.code,{children:"id"}),", ",(0,i.jsx)(I.code,{children:"name"}),", ",(0,i.jsx)(I.code,{children:"email"}),", and ",(0,i.jsx)(I.code,{children:"address"}),". You would also need to define the operations that can be performed on the ",(0,i.jsx)(I.code,{children:"Customer"})," type, such as ",(0,i.jsx)(I.code,{children:"createCustomer"}),", ",(0,i.jsx)(I.code,{children:"updateCustomer"}),", and ",(0,i.jsx)(I.code,{children:"deleteCustomer"}),". You would also need to write the code to validate the data in the ",(0,i.jsx)(I.code,{children:"createCustomer"})," operation to ensure that the customer's email address is valid and that the customer's address is not empty. Same for the other fields."]}),"\n",(0,i.jsx)(I.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,i.jsxs)(I.p,{children:["Metatype simplifies the development of CRUD APIs by providing the ",(0,i.jsx)(I.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma runtime"})," that automates the creation of the API for CRUD operations and corresponding data validation in PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. It can even validate some advanced types like email which may not be supported by downstream system (databases often store email address into plain string instead of a specialized field). This makes it faster for developers to create scalable CRUD APIs and enable them to focus their expertise where it matters most like checkout or the search capabilities."]}),"\n",(0,i.jsx)(C.A,{typegraph:"prisma-runtime",python:g(70160),typescript:g(93814),query:g(29922)})]})}function c(e={}){const{wrapper:I}={...(0,n.R)(),...e.components};return I?(0,i.jsx)(I,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},65671:(e,I,g)=>{"use strict";g.d(I,{A:()=>C});var i=g(98302),n=(g(30758),g(86070));function C(e){let{python:I,typescript:g,rust:C,...a}=e;const t=[I&&{content:I.content,codeLanguage:"python",codeFileUrl:I.path},g&&{content:g.content,codeLanguage:"typescript",codeFileUrl:g.path},C&&{content:C.content,codeLanguage:"rust",codeFileUrl:C.path}].filter((e=>!!e));return(0,n.jsx)(i.A,{code:0==t.length?void 0:t,...a})}},29922:e=>{var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"create"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"john@doe.com",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"read"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"read_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"find_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"StringValue",value:"%doe%",block:!1}},{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstname"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:288}};I.loc.source={body:'mutation create {\n create_user(\n data: {\n firstname: "" # fill me\n email: "john@doe.com"\n }\n ) {\n id\n }\n}\n\nquery read {\n read_user(\n where: {\n firstname: "" # fill me\n }\n ) {\n id\n }\n find_user(term: "%doe%", id: "") {\n email\n firstname\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function g(e,I){if("FragmentSpread"===e.kind)I.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&I.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){g(e,I)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){g(e,I)})),e.definitions&&e.definitions.forEach((function(e){g(e,I)}))}var i={};function n(e,I){for(var g=0;g0;){var A=t;t=new Set,A.forEach((function(e){a.has(e)||(a.add(e),(i[e]||new Set).forEach((function(e){t.add(e)})))}))}return a.forEach((function(I){var i=n(e,I);i&&g.definitions.push(i)})),g}I.definitions.forEach((function(e){if(e.name){var I=new Set;g(e,I),i[e.name.value]=I}})),e.exports=I,e.exports.create=C(I,"create"),e.exports.read=C(I,"read")},37834:(e,I,g)=>{"use strict";g.d(I,{A:()=>i});const i="data:image/svg+xml;base64,PHN2ZyBob3N0PSI2NWJkNzExNDRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMjFweCIgaGVpZ2h0PSIzMjFweCIgdmlld0JveD0iLTAuNSAtMC41IDEyMSAzMjEiIGNvbnRlbnQ9IiZsdDtteGZpbGUmZ3Q7Jmx0O2RpYWdyYW0gaWQ9JnF1b3Q7dEF4eUpDZUVWUjVvV2UyWDZEYmsmcXVvdDsgbmFtZT0mcXVvdDtQYWdlLTEmcXVvdDsmZ3Q7elZiZmI5b3dFUDVyZUJ6S0R3anRZNEYybTFRME5qUzFmVFRKa1ZnemNlUTRrT3l2M3lXMms1aEF5N1NwNmd2Y2ZiN3puYis3Y3p6eUYvdnlzeUJac3VJUnNKSG5ST1hJWDQ0OEw1aTQrRnNEbFFMOFcwY0JzYUNSZ3R3TzJORGZvRUZqVnRBSWNzdFFjczRreld3dzVHa0tvYlF3SWdRLzJtWTd6dXlvR1lsaEFHeEN3b2JvRTQxa290QWJiOWJoWDRER2lZbnNCcmRxWlUrTXNUNUpucENJSDN1UWZ6L3lGNEp6cWFSOXVRQldjMmQ0VVg0UEYxYmJ4QVNrOGhvSHoxY2VCOElLZlRpZG1Lek1hU0hDdzJzMTVTbit6Uk81WjZpNUtFSko1VFBLem5pcXRaZmV5ckl1dVdPVXlpaXBGRlhQcVZaZittdWRXNk1aUDVWYW5jL0Y0Mm9vNTRVSXRaVTMwUzFDUkF6YXpBdGFzckZKZ2U4QjQ2Q043dEJQenRqMXBzcE5BQ09TSHV5UVJIZFEzTHEydTYwNXhXUTZFNzdiNVJqV3FvS3hLVTAydWgzMFBFd21qaDFHcGE2OXVvMVE2R1hmUVUyUkx4UjhjcWJnQVVOYTVsc1U0bHE0VzMrdGg0ZFJaRFZ2VjRWWk5naUdhbDJlQUVVTTd0eGxtUkkySUE0VVMzRGFUWUlYYVFTUnJ1Z3hvUkkyR1dscWRjVEx3bTR1blNzSUNlWHJKYjlZU3MrM3VmWE42QjI3eVhVTmx2U21ObkF1bDlvcXdHdHNUei93TkRYYUdnVEZZNEg0dHhFTHpvelk3SHhkcnA2bnEwa08zbTdweFkrZnl6cE1HdFdmSFNLSnNxY29VcDVlMStNcmtFUlcyY2RyNmZhNmVKZVduZzNZM254L2JHYitsTVFWVDJPK25LdjdBR1E0SGpDSG43K3NGc09LVWFSUStHL3p0MVZrUDI1YmdJUy80cVlFM3dxSjI0REdjL1ZzY0tmL2lmU1RPM29hREVrUHpuQis4L2VjbzlxOUFOUWQzejJqL1BzLyZsdDsvZGlhZ3JhbSZndDsmbHQ7L214ZmlsZSZndDsiPgogICAgPGRlZnMvPgogICAgPGc+CiAgICAgICAgPHBhdGggZD0iTSA2MCA2MCBMIDYwIDExMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gNjAgMTE4Ljg4IEwgNTYuNSAxMTEuODggTCA2MCAxMTMuNjMgTCA2My41IDExMS44OCBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTIwIiBoZWlnaHQ9IjYwIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTAuNSAtMC41KSI+CiAgICAgICAgICAgIDxzd2l0Y2g+CiAgICAgICAgICAgICAgICA8Zm9yZWlnbk9iamVjdCBwb2ludGVyLWV2ZW50cz0ibm9uZSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5IiBzdHlsZT0ib3ZlcmZsb3c6IHZpc2libGU7IHRleHQtYWxpZ246IGxlZnQ7Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iZGlzcGxheTogZmxleDsgYWxpZ24taXRlbXM6IHVuc2FmZSBjZW50ZXI7IGp1c3RpZnktY29udGVudDogdW5zYWZlIGNlbnRlcjsgd2lkdGg6IDExOHB4OyBoZWlnaHQ6IDFweDsgcGFkZGluZy10b3A6IDMwcHg7IG1hcmdpbi1sZWZ0OiAxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBJIGNsaWVudHMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2I+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2ViLCBBcHAsIFNlcnZpY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjYwIiB5PSIzNCIgZmlsbD0icmdiKDAsIDAsIDApIiBmb250LWZhbWlseT0iSGVsdmV0aWNhIiBmb250LXNpemU9IjEycHgiIHRleHQtYW5jaG9yPSJtaWRkbGUiPgogICAgICAgICAgICAgICAgICAgIEFQSSBjbGllbnRzLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgICAgICA8cGF0aCBkPSJNIDYwIDE4MCBMIDYwIDIzMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gNjAgMjM4Ljg4IEwgNTYuNSAyMzEuODggTCA2MCAyMzMuNjMgTCA2My41IDIzMS44OCBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIwIiB5PSIxMjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMTUwcHg7IG1hcmdpbi1sZWZ0OiAxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JVRCBhbmQgZGF0YSB2YWxpZGF0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxici8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ldGF0eXBlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMTU0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgQ1JVRCBhbmQgZGF0YSB2YWxpZGEuLi4KICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgPC9zd2l0Y2g+CiAgICAgICAgPC9nPgogICAgICAgIDxwYXRoIGQ9Ik0gMzAgMjU1IEMgMzAgMjQ2LjcyIDQzLjQzIDI0MCA2MCAyNDAgQyA2Ny45NiAyNDAgNzUuNTkgMjQxLjU4IDgxLjIxIDI0NC4zOSBDIDg2Ljg0IDI0Ny4yMSA5MCAyNTEuMDIgOTAgMjU1IEwgOTAgMzA1IEMgOTAgMzEzLjI4IDc2LjU3IDMyMCA2MCAzMjAgQyA0My40MyAzMjAgMzAgMzEzLjI4IDMwIDMwNSBaIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cGF0aCBkPSJNIDkwIDI1NSBDIDkwIDI2My4yOCA3Ni41NyAyNzAgNjAgMjcwIEMgNDMuNDMgMjcwIDMwIDI2My4yOCAzMCAyNTUiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogNThweDsgaGVpZ2h0OiAxcHg7IHBhZGRpbmctdG9wOiAyOTNweDsgbWFyZ2luLWxlZnQ6IDMxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTUUwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb25nb0RCLCBldGMuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMjk2IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgU1FMLC4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICA8L2c+CiAgICA8c3dpdGNoPgogICAgICAgIDxnIHJlcXVpcmVkRmVhdHVyZXM9Imh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL2ZlYXR1cmUjRXh0ZW5zaWJpbGl0eSIvPgogICAgICAgIDxhIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAsLTUpIiB4bGluazpocmVmPSJodHRwczovL3d3dy5kaWFncmFtcy5uZXQvZG9jL2ZhcS9zdmctZXhwb3J0LXRleHQtcHJvYmxlbXMiIHRhcmdldD0iX2JsYW5rIj4KICAgICAgICAgICAgPHRleHQgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1zaXplPSIxMHB4IiB4PSI1MCUiIHk9IjEwMCUiPgogICAgICAgICAgICAgICAgVGV4dCBpcyBub3QgU1ZHIC0gY2Fubm90IGRpc3BsYXkKICAgICAgICAgICAgPC90ZXh0PgogICAgICAgIDwvYT4KICAgIDwvc3dpdGNoPgo8L3N2Zz4K"},70160:e=>{e.exports={content:'@typegraph(\n cors=Cors(\n # ..\n ),\n)\ndef prisma_runtime(g: Graph):\n public = Policy.public()\n db = PrismaRuntime("legacy", "POSTGRES_CONN")\n user = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "email": t.email(),\n "firstname": t.string(min=2, max=2000),\n },\n name="user",\n )\n\n g.expose(\n create_user=db.create(user),\n read_user=db.find_many(user),\n find_user=db.query_raw(\n \'SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = ${id} OR email LIKE ${term} OR firstname LIKE ${term}\',\n t.struct(\n {\n "id": t.string(),\n "term": t.string(),\n }\n ),\n t.list(user),\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/prisma-runtime.py"}},93814:e=>{e.exports={content:'typegraph(\n {\n name: "prisma-runtime",\n cors: {\n // ..\n allowOrigin: ["https://metatype.dev", "http://localhost:3000"],\n },\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("legacy", "POSTGRES_CONN");\n const user = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email(),\n firstname: t.string({ min: 2, max: 2000 }, {}),\n },\n { name: "user" }\n );\n\n g.expose(\n {\n create_user: db.create(user),\n read_user: db.findMany(user),\n find_user: db.queryRaw(\n `SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = $\\{id} OR email LIKE $\\{term} OR firstname LIKE $\\{term}`,\n t.struct({\n id: t.string(),\n term: t.string(),\n }),\n t.list(user)\n ),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/prisma-runtime.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[7010],{51092:(e,I,g)=>{"use strict";g.r(I),g.d(I,{assets:()=>d,contentTitle:()=>t,default:()=>c,frontMatter:()=>a,metadata:()=>A,toc:()=>s});var i=g(86070),n=g(25710),C=g(65671);const a={},t="Instant APIs on your database",A={id:"automatic-crud-validation/index",title:"Instant APIs on your database",description:"CRUD stands for Create, Read, Update, and Delete, which are the four basic functions of persistent storage in a software application. Those operations are commonly used in combination with data validation to ensure that the stored data is correct and consistent.",source:"@site/use-cases/automatic-crud-validation/index.mdx",sourceDirName:"automatic-crud-validation",slug:"/automatic-crud-validation/",permalink:"/use-cases/automatic-crud-validation/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/automatic-crud-validation/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",next:{title:"Backend for frontend",permalink:"/use-cases/backend-for-frontend/"}},d={},s=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function o(e){const I={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",...(0,n.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(I.h1,{id:"instant-apis-on-your-database",children:"Instant APIs on your database"}),"\n",(0,i.jsx)(I.p,{children:"CRUD stands for Create, Read, Update, and Delete, which are the four basic functions of persistent storage in a software application. Those operations are commonly used in combination with data validation to ensure that the stored data is correct and consistent."}),"\n",(0,i.jsx)(I.h2,{id:"case-study",children:"Case study"}),"\n",(0,i.jsx)("div",{className:"text-center md:float-right p-8",children:(0,i.jsx)(I.p,{children:(0,i.jsx)(I.img,{src:g(37834).A+""})})}),"\n",(0,i.jsx)(I.p,{children:"Let's say you are developing a web application for a retail store that allows customers to place orders online. In this scenario, you would need to use CRUD operations to create, read, update, and delete data related to orders, customers, products, and inventory."}),"\n",(0,i.jsx)(I.p,{children:"You would have to model each of these entities as a data type, define the operations that can be performed on them and write the code to ensure the correctness of the data processed in the operations."}),"\n",(0,i.jsxs)(I.p,{children:["For example, you would need to define a ",(0,i.jsx)(I.code,{children:"Customer"})," type with the following fields: ",(0,i.jsx)(I.code,{children:"id"}),", ",(0,i.jsx)(I.code,{children:"name"}),", ",(0,i.jsx)(I.code,{children:"email"}),", and ",(0,i.jsx)(I.code,{children:"address"}),". You would also need to define the operations that can be performed on the ",(0,i.jsx)(I.code,{children:"Customer"})," type, such as ",(0,i.jsx)(I.code,{children:"createCustomer"}),", ",(0,i.jsx)(I.code,{children:"updateCustomer"}),", and ",(0,i.jsx)(I.code,{children:"deleteCustomer"}),". You would also need to write the code to validate the data in the ",(0,i.jsx)(I.code,{children:"createCustomer"})," operation to ensure that the customer's email address is valid and that the customer's address is not empty. Same for the other fields."]}),"\n",(0,i.jsx)(I.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,i.jsxs)(I.p,{children:["Metatype simplifies the development of CRUD APIs by providing the ",(0,i.jsx)(I.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma runtime"})," that automates the creation of the API for CRUD operations and corresponding data validation in PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. It can even validate some advanced types like email which may not be supported by downstream system (databases often store email address into plain string instead of a specialized field). This makes it faster for developers to create scalable CRUD APIs and enable them to focus their expertise where it matters most like checkout or the search capabilities."]}),"\n",(0,i.jsx)(C.A,{typegraph:"prisma-runtime",python:g(70160),typescript:g(93814),query:g(29922)})]})}function c(e={}){const{wrapper:I}={...(0,n.R)(),...e.components};return I?(0,i.jsx)(I,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},65671:(e,I,g)=>{"use strict";g.d(I,{A:()=>C});var i=g(98302),n=(g(30758),g(86070));function C(e){let{python:I,typescript:g,rust:C,...a}=e;const t=[I&&{content:I.content,codeLanguage:"python",codeFileUrl:I.path},g&&{content:g.content,codeLanguage:"typescript",codeFileUrl:g.path},C&&{content:C.content,codeLanguage:"rust",codeFileUrl:C.path}].filter((e=>!!e));return(0,n.jsx)(i.A,{code:0==t.length?void 0:t,...a})}},29922:e=>{var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"create"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"john@doe.com",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"read"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"read_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"find_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"StringValue",value:"%doe%",block:!1}},{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstname"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:288}};I.loc.source={body:'mutation create {\n create_user(\n data: {\n firstname: "" # fill me\n email: "john@doe.com"\n }\n ) {\n id\n }\n}\n\nquery read {\n read_user(\n where: {\n firstname: "" # fill me\n }\n ) {\n id\n }\n find_user(term: "%doe%", id: "") {\n email\n firstname\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function g(e,I){if("FragmentSpread"===e.kind)I.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&I.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){g(e,I)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){g(e,I)})),e.definitions&&e.definitions.forEach((function(e){g(e,I)}))}var i={};function n(e,I){for(var g=0;g0;){var A=t;t=new Set,A.forEach((function(e){a.has(e)||(a.add(e),(i[e]||new Set).forEach((function(e){t.add(e)})))}))}return a.forEach((function(I){var i=n(e,I);i&&g.definitions.push(i)})),g}I.definitions.forEach((function(e){if(e.name){var I=new Set;g(e,I),i[e.name.value]=I}})),e.exports=I,e.exports.create=C(I,"create"),e.exports.read=C(I,"read")},37834:(e,I,g)=>{"use strict";g.d(I,{A:()=>i});const i="data:image/svg+xml;base64,PHN2ZyBob3N0PSI2NWJkNzExNDRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMjFweCIgaGVpZ2h0PSIzMjFweCIgdmlld0JveD0iLTAuNSAtMC41IDEyMSAzMjEiIGNvbnRlbnQ9IiZsdDtteGZpbGUmZ3Q7Jmx0O2RpYWdyYW0gaWQ9JnF1b3Q7dEF4eUpDZUVWUjVvV2UyWDZEYmsmcXVvdDsgbmFtZT0mcXVvdDtQYWdlLTEmcXVvdDsmZ3Q7elZiZmI5b3dFUDVyZUJ6S0R3anRZNEYybTFRME5qUzFmVFRKa1ZnemNlUTRrT3l2M3lXMms1aEF5N1NwNmd2Y2ZiN3puYis3Y3p6eUYvdnlzeUJac3VJUnNKSG5ST1hJWDQ0OEw1aTQrRnNEbFFMOFcwY0JzYUNSZ3R3TzJORGZvRUZqVnRBSWNzdFFjczRreld3dzVHa0tvYlF3SWdRLzJtWTd6dXlvR1lsaEFHeEN3b2JvRTQxa290QWJiOWJoWDRER2lZbnNCcmRxWlUrTXNUNUpucENJSDN1UWZ6L3lGNEp6cWFSOXVRQldjMmQ0VVg0UEYxYmJ4QVNrOGhvSHoxY2VCOElLZlRpZG1Lek1hU0hDdzJzMTVTbit6Uk81WjZpNUtFSko1VFBLem5pcXRaZmV5ckl1dVdPVXlpaXBGRlhQcVZaZittdWRXNk1aUDVWYW5jL0Y0Mm9vNTRVSXRaVTMwUzFDUkF6YXpBdGFzckZKZ2U4QjQ2Q043dEJQenRqMXBzcE5BQ09TSHV5UVJIZFEzTHEydTYwNXhXUTZFNzdiNVJqV3FvS3hLVTAydWgzMFBFd21qaDFHcGE2OXVvMVE2R1hmUVUyUkx4UjhjcWJnQVVOYTVsc1U0bHE0VzMrdGg0ZFJaRFZ2VjRWWk5naUdhbDJlQUVVTTd0eGxtUkkySUE0VVMzRGFUWUlYYVFTUnJ1Z3hvUkkyR1dscWRjVEx3bTR1blNzSUNlWHJKYjlZU3MrM3VmWE42QjI3eVhVTmx2U21ObkF1bDlvcXdHdHNUei93TkRYYUdnVEZZNEg0dHhFTHpvelk3SHhkcnA2bnEwa08zbTdweFkrZnl6cE1HdFdmSFNLSnNxY29VcDVlMStNcmtFUlcyY2RyNmZhNmVKZVduZzNZM254L2JHYitsTVFWVDJPK25LdjdBR1E0SGpDSG43K3NGc09LVWFSUStHL3p0MVZrUDI1YmdJUy80cVlFM3dxSjI0REdjL1ZzY0tmL2lmU1RPM29hREVrUHpuQis4L2VjbzlxOUFOUWQzejJqL1BzLyZsdDsvZGlhZ3JhbSZndDsmbHQ7L214ZmlsZSZndDsiPgogICAgPGRlZnMvPgogICAgPGc+CiAgICAgICAgPHBhdGggZD0iTSA2MCA2MCBMIDYwIDExMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gNjAgMTE4Ljg4IEwgNTYuNSAxMTEuODggTCA2MCAxMTMuNjMgTCA2My41IDExMS44OCBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTIwIiBoZWlnaHQ9IjYwIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTAuNSAtMC41KSI+CiAgICAgICAgICAgIDxzd2l0Y2g+CiAgICAgICAgICAgICAgICA8Zm9yZWlnbk9iamVjdCBwb2ludGVyLWV2ZW50cz0ibm9uZSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5IiBzdHlsZT0ib3ZlcmZsb3c6IHZpc2libGU7IHRleHQtYWxpZ246IGxlZnQ7Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iZGlzcGxheTogZmxleDsgYWxpZ24taXRlbXM6IHVuc2FmZSBjZW50ZXI7IGp1c3RpZnktY29udGVudDogdW5zYWZlIGNlbnRlcjsgd2lkdGg6IDExOHB4OyBoZWlnaHQ6IDFweDsgcGFkZGluZy10b3A6IDMwcHg7IG1hcmdpbi1sZWZ0OiAxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVBJIGNsaWVudHMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2I+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2ViLCBBcHAsIFNlcnZpY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjYwIiB5PSIzNCIgZmlsbD0icmdiKDAsIDAsIDApIiBmb250LWZhbWlseT0iSGVsdmV0aWNhIiBmb250LXNpemU9IjEycHgiIHRleHQtYW5jaG9yPSJtaWRkbGUiPgogICAgICAgICAgICAgICAgICAgIEFQSSBjbGllbnRzLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgICAgICA8cGF0aCBkPSJNIDYwIDE4MCBMIDYwIDIzMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gNjAgMjM4Ljg4IEwgNTYuNSAyMzEuODggTCA2MCAyMzMuNjMgTCA2My41IDIzMS44OCBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIwIiB5PSIxMjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMTUwcHg7IG1hcmdpbi1sZWZ0OiAxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1JVRCBhbmQgZGF0YSB2YWxpZGF0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxici8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ldGF0eXBlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMTU0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgQ1JVRCBhbmQgZGF0YSB2YWxpZGEuLi4KICAgICAgICAgICAgICAgIDwvdGV4dD4KICAgICAgICAgICAgPC9zd2l0Y2g+CiAgICAgICAgPC9nPgogICAgICAgIDxwYXRoIGQ9Ik0gMzAgMjU1IEMgMzAgMjQ2LjcyIDQzLjQzIDI0MCA2MCAyNDAgQyA2Ny45NiAyNDAgNzUuNTkgMjQxLjU4IDgxLjIxIDI0NC4zOSBDIDg2Ljg0IDI0Ny4yMSA5MCAyNTEuMDIgOTAgMjU1IEwgOTAgMzA1IEMgOTAgMzEzLjI4IDc2LjU3IDMyMCA2MCAzMjAgQyA0My40MyAzMjAgMzAgMzEzLjI4IDMwIDMwNSBaIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cGF0aCBkPSJNIDkwIDI1NSBDIDkwIDI2My4yOCA3Ni41NyAyNzAgNjAgMjcwIEMgNDMuNDMgMjcwIDMwIDI2My4yOCAzMCAyNTUiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogNThweDsgaGVpZ2h0OiAxcHg7IHBhZGRpbmctdG9wOiAyOTNweDsgbWFyZ2luLWxlZnQ6IDMxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTUUwsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyLz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb25nb0RCLCBldGMuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMjk2IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgU1FMLC4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICA8L2c+CiAgICA8c3dpdGNoPgogICAgICAgIDxnIHJlcXVpcmVkRmVhdHVyZXM9Imh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL2ZlYXR1cmUjRXh0ZW5zaWJpbGl0eSIvPgogICAgICAgIDxhIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAsLTUpIiB4bGluazpocmVmPSJodHRwczovL3d3dy5kaWFncmFtcy5uZXQvZG9jL2ZhcS9zdmctZXhwb3J0LXRleHQtcHJvYmxlbXMiIHRhcmdldD0iX2JsYW5rIj4KICAgICAgICAgICAgPHRleHQgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1zaXplPSIxMHB4IiB4PSI1MCUiIHk9IjEwMCUiPgogICAgICAgICAgICAgICAgVGV4dCBpcyBub3QgU1ZHIC0gY2Fubm90IGRpc3BsYXkKICAgICAgICAgICAgPC90ZXh0PgogICAgICAgIDwvYT4KICAgIDwvc3dpdGNoPgo8L3N2Zz4K"},70160:e=>{e.exports={content:'@typegraph(\n cors=Cors(\n # ..\n ),\n)\ndef prisma_runtime(g: Graph):\n public = Policy.public()\n db = PrismaRuntime("legacy", "POSTGRES_CONN")\n user = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "email": t.email(),\n "firstname": t.string(min=2, max=2000),\n },\n name="user",\n )\n\n g.expose(\n create_user=db.create(user),\n read_user=db.find_many(user),\n find_user=db.query_raw(\n \'SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = ${id} OR email LIKE ${term} OR firstname LIKE ${term}\',\n t.struct(\n {\n "id": t.string(),\n "term": t.string(),\n }\n ),\n t.list(user),\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/prisma-runtime.py"}},93814:e=>{e.exports={content:'typegraph(\n {\n name: "prisma-runtime",\n cors: {\n // ..\n allowOrigin: ["https://metatype.dev", "http://localhost:3000"],\n },\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("legacy", "POSTGRES_CONN");\n const user = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email(),\n firstname: t.string({ min: 2, max: 2000 }, {}),\n },\n { name: "user" },\n );\n\n g.expose(\n {\n create_user: db.create(user),\n read_user: db.findMany(user),\n find_user: db.queryRaw(\n `SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = $\\{id} OR email LIKE $\\{term} OR firstname LIKE $\\{term}`,\n t.struct({\n id: t.string(),\n term: t.string(),\n }),\n t.list(user),\n ),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/prisma-runtime.ts"}}}]); \ No newline at end of file diff --git a/assets/js/6c4588a6.56af1959.js b/assets/js/6c4588a6.cec7ca06.js similarity index 93% rename from assets/js/6c4588a6.56af1959.js rename to assets/js/6c4588a6.cec7ca06.js index d048298273..3ed73c9acd 100644 --- a/assets/js/6c4588a6.56af1959.js +++ b/assets/js/6c4588a6.cec7ca06.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6686],{14344:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);const o=[];function r(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["Metatype is only supported on macOS and Linux. Windows users should use ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/windows/wsl/install",children:"Linux on Windows with WSL"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["You can download the binary from the\n",(0,s.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/releases/",children:"releases page"}),", make it\nexecutable and add it to your ",(0,s.jsx)(n.code,{children:"PATH"})," or use the automated method below."]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"An installer script is also provided for the CLI in our repository. Curl and install in it with the following one-liner. The installer may ask for your password."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\n"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["For later use, you can run the following command to upgrade ",(0,s.jsx)(n.code,{children:"Meta CLI"})," to a newer version. If your Meta CLI is up to date, you will get an ",(0,s.jsx)(n.code,{children:"Already up to date!"})," response."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta upgrade\n"})}),"\n"]}),"\n"]})}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You are done installing ",(0,s.jsx)(n.code,{children:"Meta CLI"}),"."]})]})}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)}},96503:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);t(75707);const o=[{value:"Using Embedded Typegate (Recommended)",id:"using-embedded-typegate-recommended",level:3}];function r(e){const n={a:"a",admonition:"admonition",code:"code",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h3,{id:"using-embedded-typegate-recommended",children:"Using Embedded Typegate (Recommended)"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["You can launch the embedded typegate via two subcommands, ",(0,s.jsx)(n.code,{children:"meta dev"})," and ",(0,s.jsx)(n.code,{children:"meta typegate"}),". Check the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"Embedded Typegate"})," for more info."]})}),"\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."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:" Using docker (Not Recommended) "}),(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"Docker"})," and use the following ",(0,s.jsx)(n.code,{children:"compose.yml"})," to launch a typegate node. For multi-instance production workloads, Redis and an S3 object store provider are required but the typegate will run using in-memory stores if no ",(0,s.jsx)(n.code,{children:"SYNC_*"})," environment variable is detected. More details can be found ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate/synchronization",children:"here"}),". In practice you might also want to add a database or other systems that the typegate can connect to."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",children:'services:\n typegate:\n image: ghcr.io/metatypedev/typegate:latest\n ports:\n - "7890:7890"\n extra_hosts:\n - "host.docker.internal:host-gateway"\n environment:\n # only for dev, generate secure values for production\n TG_SECRET: "a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw=="\n TG_ADMIN_PASSWORD: password\n DEBUG: "true"\n'})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# launch the containers\ndocker compose up --detach\n\n# watch the typegate logs\ndocker compose logs typegate --follow\n"})})]})]})}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)}},22356:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>p,RM:()=>d});var s=t(86070),a=t(25710),o=t(65480),r=t(25459),i=t(9234),c=t(27676);const d=[];function l(e){const n={a:"a",code:"code",img:"img",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(o.Ay,{children:[(0,s.jsxs)(c.A,{value:"typescript",children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://www.npmjs.com/package/@typegraph/sdk",children:(0,s.jsx)(n.img,{src:"https://img.shields.io/npm/v/@typegraph/sdk?label=typegraph",alt:"Typegraph version"})})}),(0,s.jsxs)(n.p,{children:["Install the ",(0,s.jsx)(n.code,{children:"@typegraph/sdk"})," package from npm using your preferred package manager and runtime. The SDK requires Node 16+ with Typescript 4.7+, Deno 1.28+ or Bun 1+."]}),(0,s.jsxs)(i.A,{children:[(0,s.jsx)(c.A,{value:"pnpm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"pnpm add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"npm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm install @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"yarn",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"yarn add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"deno",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'import { ... } from "npm:@typegraph/sdk/mod.ts";\n'})})}),(0,s.jsx)(c.A,{value:"bun",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"bun add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"jsr",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# deno\ndeno add @typegraph/sdk\n\n# npm (one of the below, depending on your package manager)\nnpx jsr add @typegraph/sdk\nyarn dlx jsr add @typegraph/sdk\npnpm dlx jsr add @typegraph/sdk\nbunx jsr add @typegraph/sdk\n"})})})]}),(0,s.jsx)("br",{}),(0,s.jsx)(n.p,{children:"When using Node, make sure to add this to your Typescript configuration:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:' "moduleResolution": "node16", // Or "nodenext"\n'})})]}),(0,s.jsxs)(c.A,{value:"python",children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://pypi.org/project/typegraph/",children:(0,s.jsx)(n.img,{src:"https://img.shields.io/pypi/v/typegraph?label=typegraph",alt:"Typegraph version"})})}),(0,s.jsxs)(n.p,{children:["Create (and activate) your virtual environment with Python 3.8+ for your project. Then install the ",(0,s.jsx)(n.code,{children:"typegraph"})," package from Python Package Index (PyPI) using your preferred method."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# virtual env\npython3 -m venv .venv\nsource .venv/bin/activate\n"})}),(0,s.jsxs)(r.A,{children:[(0,s.jsx)(c.A,{value:"pip",children:(0,s.jsx)(n.code,{children:"bash pip3 install typegraph "})}),(0,s.jsx)(c.A,{value:"poetry",children:(0,s.jsx)(n.code,{children:"bash poetry add typegraph "})})]})]})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},75707:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);const o=[{value:"1. 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;t0;){var c=i;i=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(s[e]||new Set).forEach((function(e){i.add(e)})))}))}return r.forEach((function(n){var s=a(e,n);s&&t.definitions.push(s)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),s[e.name.value]=n}})),e.exports=n,e.exports.CreateMessage=o(n,"CreateMessage"),e.exports.ListMessages=o(n,"ListMessages")},1755:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno";\nimport { PythonRuntime } from "@typegraph/sdk/runtimes/python";\n\ntypegraph("example", (g) => {\n const pub = Policy.public();\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n\n g.expose({\n add: python\n .fromLambda(\n t.struct({ first: t.float(), second: t.float() }),\n 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});',path:"../examples/templates/node/api/example.ts"}},25063:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes import PythonRuntime\n\n\n@typegraph()\ndef example(g: Graph):\n public = Policy.public()\n python = PythonRuntime()\n\n hello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n )\n\n g.expose(public, hello=hello)',path:"../examples/templates/python/api/example.py"}},12599:e=>{e.exports={content:'from typegraph import Graph, Policy, t, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.runtimes import PythonRuntime, DenoRuntime\n\n\n@typegraph(\n)\ndef quick_start_project(g: Graph):\n # access control\n public = Policy.public()\n\n # runtimes\n deno = DenoRuntime()\n python = PythonRuntime()\n db = PrismaRuntime("database", "POSTGRES")\n\n # types, database tables\n 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 # custom functions\n add = deno.func(\n t.struct({"first": t.float(), "second": t.float()}),\n t.float(),\n code="({first, second}) => first + second",\n )\n hello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n )\n\n # expose endpoints\n g.expose(\n public,\n add=add,\n hello=hello,\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/quick-start-project.py"}},5641:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "quick-start-project",\n cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },\n },\n (g) => {\n // access control\n const pub = Policy.public();\n\n // runtimes\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n const db = new PrismaRuntime("database", "POSTGRES");\n\n // types, database tables\n const message = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }), // configuring our primary key\n title: t.string(),\n body: t.string(),\n },\n { name: "message" } // the name of our type\n );\n\n // custom functions\n const add = deno.func(\n t.struct({ first: t.float(), second: t.float() }),\n t.float(),\n { code: "({first, second}) => first + second" }\n );\n const hello = python.fromLambda(\n t.struct({ world: t.string() }),\n t.string(),\n { code: `lambda x: f"Hello {x[\'world\']}!"` }\n );\n\n g.expose(\n {\n add,\n hello,\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/quick-start-project.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6686],{14344:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);const o=[];function r(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.p,{children:["Metatype is only supported on macOS and Linux. Windows users should use ",(0,s.jsx)(n.a,{href:"https://learn.microsoft.com/windows/wsl/install",children:"Linux on Windows with WSL"}),"."]})}),"\n",(0,s.jsxs)(n.p,{children:["You can download the binary from the\n",(0,s.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/releases/",children:"releases page"}),", make it\nexecutable and add it to your ",(0,s.jsx)(n.code,{children:"PATH"})," or use the automated method below."]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsx)(n.p,{children:"An installer script is also provided for the CLI in our repository. Curl and install in it with the following one-liner. The installer may ask for your password."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"curl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\n"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"info",children:(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["For later use, you can run the following command to upgrade ",(0,s.jsx)(n.code,{children:"Meta CLI"})," to a newer version. If your Meta CLI is up to date, you will get an ",(0,s.jsx)(n.code,{children:"Already up to date!"})," response."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"meta upgrade\n"})}),"\n"]}),"\n"]})}),"\n",(0,s.jsxs)(n.p,{children:["That's it! You are done installing ",(0,s.jsx)(n.code,{children:"Meta CLI"}),"."]})]})}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)}},96503:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);t(75707);const o=[{value:"Using Embedded Typegate (Recommended)",id:"using-embedded-typegate-recommended",level:3}];function r(e){const n={a:"a",admonition:"admonition",code:"code",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components},{Details:t}=n;return t||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h3,{id:"using-embedded-typegate-recommended",children:"Using Embedded Typegate (Recommended)"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsxs)(n.p,{children:["You can launch the embedded typegate via two subcommands, ",(0,s.jsx)(n.code,{children:"meta dev"})," and ",(0,s.jsx)(n.code,{children:"meta typegate"}),". Check the ",(0,s.jsx)(n.a,{href:"/docs/reference/meta-cli/embedded-typegate",children:"Embedded Typegate"})," for more info."]})}),"\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."]}),"\n",(0,s.jsxs)(t,{children:[(0,s.jsx)("summary",{children:" Using docker (Not Recommended) "}),(0,s.jsxs)(n.p,{children:["Install ",(0,s.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"Docker"})," and use the following ",(0,s.jsx)(n.code,{children:"compose.yml"})," to launch a typegate node. For multi-instance production workloads, Redis and an S3 object store provider are required but the typegate will run using in-memory stores if no ",(0,s.jsx)(n.code,{children:"SYNC_*"})," environment variable is detected. More details can be found ",(0,s.jsx)(n.a,{href:"/docs/reference/typegate/synchronization",children:"here"}),". In practice you might also want to add a database or other systems that the typegate can connect to."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yml",children:'services:\n typegate:\n image: ghcr.io/metatypedev/typegate:latest\n ports:\n - "7890:7890"\n extra_hosts:\n - "host.docker.internal:host-gateway"\n environment:\n # only for dev, generate secure values for production\n TG_SECRET: "a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw=="\n TG_ADMIN_PASSWORD: password\n DEBUG: "true"\n'})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# launch the containers\ndocker compose up --detach\n\n# watch the typegate logs\ndocker compose logs typegate --follow\n"})})]})]})}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)}},22356:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>p,RM:()=>d});var s=t(86070),a=t(25710),o=t(65480),r=t(25459),i=t(9234),c=t(27676);const d=[];function l(e){const n={a:"a",code:"code",img:"img",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,s.jsxs)(o.Ay,{children:[(0,s.jsxs)(c.A,{value:"typescript",children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://www.npmjs.com/package/@typegraph/sdk",children:(0,s.jsx)(n.img,{src:"https://img.shields.io/npm/v/@typegraph/sdk?label=typegraph",alt:"Typegraph version"})})}),(0,s.jsxs)(n.p,{children:["Install the ",(0,s.jsx)(n.code,{children:"@typegraph/sdk"})," package from npm using your preferred package manager and runtime. The SDK requires Node 16+ with Typescript 4.7+, Deno 1.28+ or Bun 1+."]}),(0,s.jsxs)(i.A,{children:[(0,s.jsx)(c.A,{value:"pnpm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"pnpm add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"npm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm install @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"yarn",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"yarn add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"deno",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:'import { ... } from "npm:@typegraph/sdk/mod.ts";\n'})})}),(0,s.jsx)(c.A,{value:"bun",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"bun add @typegraph/sdk\n"})})}),(0,s.jsx)(c.A,{value:"jsr",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# deno\ndeno add @typegraph/sdk\n\n# npm (one of the below, depending on your package manager)\nnpx jsr add @typegraph/sdk\nyarn dlx jsr add @typegraph/sdk\npnpm dlx jsr add @typegraph/sdk\nbunx jsr add @typegraph/sdk\n"})})})]}),(0,s.jsx)("br",{}),(0,s.jsx)(n.p,{children:"When using Node, make sure to add this to your Typescript configuration:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:' "moduleResolution": "node16", // Or "nodenext"\n'})})]}),(0,s.jsxs)(c.A,{value:"python",children:[(0,s.jsx)(n.p,{children:(0,s.jsx)(n.a,{href:"https://pypi.org/project/typegraph/",children:(0,s.jsx)(n.img,{src:"https://img.shields.io/pypi/v/typegraph?label=typegraph",alt:"Typegraph version"})})}),(0,s.jsxs)(n.p,{children:["Create (and activate) your virtual environment with Python 3.8+ for your project. Then install the ",(0,s.jsx)(n.code,{children:"typegraph"})," package from Python Package Index (PyPI) using your preferred method."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"# virtual env\npython3 -m venv .venv\nsource .venv/bin/activate\n"})}),(0,s.jsxs)(r.A,{children:[(0,s.jsx)(c.A,{value:"pip",children:(0,s.jsx)(n.code,{children:"bash pip3 install typegraph "})}),(0,s.jsx)(c.A,{value:"poetry",children:(0,s.jsx)(n.code,{children:"bash poetry add typegraph "})})]})]})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},75707:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,RM:()=>o});var s=t(86070),a=t(25710);const o=[{value:"1. 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;t0;){var c=i;i=new Set,c.forEach((function(e){r.has(e)||(r.add(e),(s[e]||new Set).forEach((function(e){i.add(e)})))}))}return r.forEach((function(n){var s=a(e,n);s&&t.definitions.push(s)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),s[e.name.value]=n}})),e.exports=n,e.exports.CreateMessage=o(n,"CreateMessage"),e.exports.ListMessages=o(n,"ListMessages")},1755:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno";\nimport { PythonRuntime } from "@typegraph/sdk/runtimes/python";\n\ntypegraph("example", (g) => {\n const pub = Policy.public();\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n\n g.expose({\n add: python\n .fromLambda(\n t.struct({ first: t.float(), second: t.float() }),\n 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});',path:"../examples/templates/node/api/example.ts"}},25063:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes import PythonRuntime\n\n\n@typegraph()\ndef example(g: Graph):\n public = Policy.public()\n python = PythonRuntime()\n\n hello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n )\n\n g.expose(public, hello=hello)',path:"../examples/templates/python/api/example.py"}},12599:e=>{e.exports={content:'from typegraph import Graph, Policy, t, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.runtimes import PythonRuntime, DenoRuntime\n\n\n@typegraph(\n)\ndef quick_start_project(g: Graph):\n # access control\n public = Policy.public()\n\n # runtimes\n deno = DenoRuntime()\n python = PythonRuntime()\n db = PrismaRuntime("database", "POSTGRES")\n\n # types, database tables\n 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 # custom functions\n add = deno.func(\n t.struct({"first": t.float(), "second": t.float()}),\n t.float(),\n code="({first, second}) => first + second",\n )\n hello = python.from_lambda(\n t.struct({"world": t.string()}),\n t.string(),\n lambda x: f"Hello {x[\'world\']}!",\n )\n\n # expose endpoints\n g.expose(\n public,\n add=add,\n hello=hello,\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/quick-start-project.py"}},5641:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PythonRuntime } from "@typegraph/sdk/runtimes/python.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "quick-start-project",\n cors: { allowOrigin: ["https://metatype.dev", "http://localhost:3000"] },\n },\n (g) => {\n // access control\n const pub = Policy.public();\n\n // runtimes\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n const db = new PrismaRuntime("database", "POSTGRES");\n\n // types, database tables\n const message = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }), // configuring our primary key\n title: t.string(),\n body: t.string(),\n },\n { name: "message" }, // the name of our type\n );\n\n // custom functions\n const add = deno.func(\n t.struct({ first: t.float(), second: t.float() }),\n t.float(),\n { code: "({first, second}) => first + second" },\n );\n const hello = python.fromLambda(\n t.struct({ world: t.string() }),\n t.string(),\n { code: `lambda x: f"Hello {x[\'world\']}!"` },\n );\n\n g.expose(\n {\n add,\n hello,\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/quick-start-project.ts"}}}]); \ No newline at end of file diff --git a/assets/js/6dc80b66.dd15ca59.js b/assets/js/6dc80b66.7a658e61.js similarity index 98% rename from assets/js/6dc80b66.dd15ca59.js rename to assets/js/6dc80b66.7a658e61.js index 43cd9640a0..7bac5c256a 100644 --- a/assets/js/6dc80b66.dd15ca59.js +++ b/assets/js/6dc80b66.7a658e61.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6650],{87409:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>h,frontMatter:()=>d,metadata:()=>c,toc:()=>u});var r=t(86070),o=t(25710),i=t(65480),s=t(27676),a=t(65671);t(7871);const d={},l="Importing External Modules",c={id:"guides/import-external-modules/index",title:"Importing External Modules",description:"So far, the functinos we've looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime's generate helper. The deno.policy function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we'll look at how to roll a custom function ourselves. We'll be using the Deno runtime to run our code.",source:"@site/docs/guides/import-external-modules/index.mdx",sourceDirName:"guides/import-external-modules",slug:"/guides/import-external-modules/",permalink:"/docs/guides/import-external-modules/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/import-external-modules/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Contribute to Metatype",permalink:"/docs/guides/contributing"},next:{title:"Programmatic deployment",permalink:"/docs/guides/programmatic-deployment/"}},p={},u=[];function m(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"importing-external-modules",children:"Importing External Modules"}),"\n",(0,r.jsxs)(n.p,{children:["So far, the functinos we've looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime's ",(0,r.jsx)(n.code,{children:"generate"})," helper. The ",(0,r.jsx)(n.code,{children:"deno.policy"})," function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we'll look at how to roll a custom function ourselves. We'll be using the Deno runtime to run our code."]}),"\n",(0,r.jsxs)(n.p,{children:["Instead of including the code inline through a string, the Deno runtime allows us to import modules from disk. Our modules are allowed to use ESM imports to access libraries on different registries like ",(0,r.jsx)(n.code,{children:"npm"})," and ",(0,r.jsx)(n.code,{children:"deno.land"}),". We'll use these features to write a simple function that converts markdown to html."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typescript",children:'import * as marked from "https://deno.land/x/marked/mod.ts";\n\nexport function parse({ raw }: { raw: string }): string {\n return marked.parse(raw);\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"We'll expose our module using the deno runtime."}),"\n",(0,r.jsxs)(i.Ay,{children:[(0,r.jsx)(s.A,{value:"typescript",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n parse_markdown: deno.import(t.struct({ raw: t.string() }), t.string(), {\n name: "parse",\n // the path is parsed relative to the typegraph file\n module: "md2html.ts",\n }),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,r.jsx)(s.A,{value:"python",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n g.expose(\n pub,\n # ..\n parse_markdown=deno.import_(\n t.struct({"raw": t.string()}),\n t.string(),\n # the path is parsed relative to the typegraph file\n module="md2html.ts",\n name="parse",\n ),\n )\n\n'})})})]}),"\n",(0,r.jsx)(n.p,{children:"We can now access our func through the GraphQl api."}),"\n",(0,r.jsx)(a.A,{typegraph:"roadmap-func",python:t(97435),typescript:t(49989),query:t(68814)})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>s,gc:()=>a});t(30758);var r=t(3733),o=t(56315),i=t(86070);function s(e){let{children:n}=e;const[t,s]=(0,r.e)();return(0,i.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:s,children:n})}function a(e){let{children:n}=e;const[t]=(0,r.e)();return(0,i.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var r=t(98302),o=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...s}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,o.jsx)(r.A,{code:0==a.length?void 0:a,...s})}},68814:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parse_markdown"},arguments:[{kind:"Argument",name:{kind:"Name",value:"raw"},value:{kind:"StringValue",value:"hello",block:!1}}],directives:[]}]}}],loc:{start:0,end:41}};n.loc.source={body:'query {\n parse_markdown(raw: "hello")\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},97435:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n deno = DenoRuntime()\n\n\n g.expose(\n pub,\n parse_markdown=deno.import_(\n t.struct({"raw": t.string()}),\n t.string(),\n module="scripts/md2html.ts.src",\n name="parse",\n ),\n )',path:"../examples/typegraphs/func.py"}},49989:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\n\nawait typegraph(\n {\n },\n (g) => {\n const deno = new DenoRuntime();\n\n\n g.expose(\n {\n parse_markdown: deno.import(t.struct({ raw: t.string() }), t.string(), {\n module: "scripts/md2html.ts.src",\n name: "parse",\n }),\n },\n pub\n );\n\n }\n);',path:"../examples/typegraphs/func.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6650],{87409:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>p,contentTitle:()=>l,default:()=>h,frontMatter:()=>d,metadata:()=>c,toc:()=>u});var r=t(86070),o=t(25710),i=t(65480),s=t(27676),a=t(65671);t(7871);const d={},l="Importing External Modules",c={id:"guides/import-external-modules/index",title:"Importing External Modules",description:"So far, the functinos we've looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime's generate helper. The deno.policy function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we'll look at how to roll a custom function ourselves. We'll be using the Deno runtime to run our code.",source:"@site/docs/guides/import-external-modules/index.mdx",sourceDirName:"guides/import-external-modules",slug:"/guides/import-external-modules/",permalink:"/docs/guides/import-external-modules/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/import-external-modules/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Contribute to Metatype",permalink:"/docs/guides/contributing"},next:{title:"Programmatic deployment",permalink:"/docs/guides/programmatic-deployment/"}},p={},u=[];function m(e){const n={code:"code",h1:"h1",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"importing-external-modules",children:"Importing External Modules"}),"\n",(0,r.jsxs)(n.p,{children:["So far, the functinos we've looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime's ",(0,r.jsx)(n.code,{children:"generate"})," helper. The ",(0,r.jsx)(n.code,{children:"deno.policy"})," function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we'll look at how to roll a custom function ourselves. We'll be using the Deno runtime to run our code."]}),"\n",(0,r.jsxs)(n.p,{children:["Instead of including the code inline through a string, the Deno runtime allows us to import modules from disk. Our modules are allowed to use ESM imports to access libraries on different registries like ",(0,r.jsx)(n.code,{children:"npm"})," and ",(0,r.jsx)(n.code,{children:"deno.land"}),". We'll use these features to write a simple function that converts markdown to html."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typescript",children:'import * as marked from "https://deno.land/x/marked/mod.ts";\n\nexport function parse({ raw }: { raw: string }): string {\n return marked.parse(raw);\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"We'll expose our module using the deno runtime."}),"\n",(0,r.jsxs)(i.Ay,{children:[(0,r.jsx)(s.A,{value:"typescript",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n parse_markdown: deno.import(t.struct({ raw: t.string() }), t.string(), {\n name: "parse",\n // the path is parsed relative to the typegraph file\n module: "md2html.ts",\n }),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,r.jsx)(s.A,{value:"python",children:(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n g.expose(\n pub,\n # ..\n parse_markdown=deno.import_(\n t.struct({"raw": t.string()}),\n t.string(),\n # the path is parsed relative to the typegraph file\n module="md2html.ts",\n name="parse",\n ),\n )\n\n'})})})]}),"\n",(0,r.jsx)(n.p,{children:"We can now access our func through the GraphQl api."}),"\n",(0,r.jsx)(a.A,{typegraph:"roadmap-func",python:t(97435),typescript:t(49989),query:t(68814)})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>s,gc:()=>a});t(30758);var r=t(3733),o=t(56315),i=t(86070);function s(e){let{children:n}=e;const[t,s]=(0,r.e)();return(0,i.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:s,children:n})}function a(e){let{children:n}=e;const[t]=(0,r.e)();return(0,i.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var r=t(98302),o=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...s}=e;const a=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,o.jsx)(r.A,{code:0==a.length?void 0:a,...s})}},68814:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"parse_markdown"},arguments:[{kind:"Argument",name:{kind:"Name",value:"raw"},value:{kind:"StringValue",value:"hello",block:!1}}],directives:[]}]}}],loc:{start:0,end:41}};n.loc.source={body:'query {\n parse_markdown(raw: "hello")\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},97435:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n deno = DenoRuntime()\n\n\n g.expose(\n pub,\n parse_markdown=deno.import_(\n t.struct({"raw": t.string()}),\n t.string(),\n module="scripts/md2html.ts.src",\n name="parse",\n ),\n )',path:"../examples/typegraphs/func.py"}},49989:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\n\nawait typegraph(\n {\n },\n (g) => {\n const deno = new DenoRuntime();\n\n\n g.expose(\n {\n parse_markdown: deno.import(t.struct({ raw: t.string() }), t.string(), {\n module: "scripts/md2html.ts.src",\n name: "parse",\n }),\n },\n pub,\n );\n\n },\n);',path:"../examples/typegraphs/func.ts"}}}]); \ No newline at end of file diff --git a/assets/js/878e8ee7.3242329c.js b/assets/js/878e8ee7.3242329c.js deleted file mode 100644 index 158a6ba89a..0000000000 --- a/assets/js/878e8ee7.3242329c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6800],{49362:e=>{e.exports=JSON.parse('{"version":{"pluginId":"docs","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"link","label":"Getting started","href":"/docs/","docId":"index","unlisted":false},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Quick-start","href":"/docs/tutorials/quick-start/","docId":"tutorials/quick-start/index","unlisted":false},{"type":"link","label":"Metatype Basics","href":"/docs/tutorials/metatype-basics/","docId":"tutorials/metatype-basics/index","unlisted":false}]},{"type":"category","label":"How-to guides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Custom functions","href":"/docs/guides/external-functions/","docId":"guides/external-functions/index","unlisted":false},{"type":"link","label":"Upload files to cloud storage","href":"/docs/guides/files-upload/","docId":"guides/files-upload/index","unlisted":false},{"type":"link","label":"Write REST endpoints","href":"/docs/guides/rest/","docId":"guides/rest/index","unlisted":false},{"type":"link","label":"Secure your requests","href":"/docs/guides/securing-requests/","docId":"guides/securing-requests/index","unlisted":false},{"type":"link","label":"Wasm functions","href":"/docs/guides/wasm-functions/","docId":"guides/wasm-functions/index","unlisted":false},{"type":"link","label":"Self-host the Typegate","href":"/docs/guides/self-hosting","docId":"guides/self-hosting","unlisted":false},{"type":"link","label":"Contribute to Metatype","href":"/docs/guides/contributing","docId":"guides/contributing","unlisted":false},{"type":"link","label":"Importing External Modules","href":"/docs/guides/import-external-modules/","docId":"guides/import-external-modules/index","unlisted":false},{"type":"link","label":"Programmatic deployment","href":"/docs/guides/programmatic-deployment/","docId":"guides/programmatic-deployment/index","unlisted":false},{"type":"link","label":"Test typegraphs","href":"/docs/guides/test-your-typegraph/","docId":"guides/test-your-typegraph/index","unlisted":false}]},{"type":"category","label":"Reference","collapsible":true,"collapsed":false,"items":[{"type":"category","label":"Types","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Type comparison","href":"/docs/reference/types/comparison","docId":"reference/types/comparison","unlisted":false},{"type":"link","label":"Functions","href":"/docs/reference/types/functions","docId":"reference/types/functions","unlisted":false},{"type":"link","label":"Injections","href":"/docs/reference/types/injections","docId":"reference/types/injections","unlisted":false},{"type":"link","label":"Parameter Transformations","href":"/docs/reference/types/parameter-transformations","docId":"reference/types/parameter-transformations","unlisted":false}],"href":"/docs/reference/types/"},{"type":"category","label":"Runtimes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Deno/typescript","href":"/docs/reference/runtimes/deno/","docId":"reference/runtimes/deno/index","unlisted":false},{"type":"link","label":"GraphQL","href":"/docs/reference/runtimes/graphql/","docId":"reference/runtimes/graphql/index","unlisted":false},{"type":"link","label":"gRPC Runtime","href":"/docs/reference/runtimes/grpc/","docId":"reference/runtimes/grpc/index","unlisted":false},{"type":"link","label":"HTTP/REST","href":"/docs/reference/runtimes/http/","docId":"reference/runtimes/http/index","unlisted":false},{"type":"link","label":"Kv","href":"/docs/reference/runtimes/kv/","docId":"reference/runtimes/kv/index","unlisted":false},{"type":"link","label":"Prisma","href":"/docs/reference/runtimes/prisma/","docId":"reference/runtimes/prisma/index","unlisted":false},{"type":"link","label":"Python","href":"/docs/reference/runtimes/python/","docId":"reference/runtimes/python/index","unlisted":false},{"type":"link","label":"Random","href":"/docs/reference/runtimes/random/","docId":"reference/runtimes/random/index","unlisted":false},{"type":"link","label":"S3","href":"/docs/reference/runtimes/s3/","docId":"reference/runtimes/s3/index","unlisted":false},{"type":"link","label":"Substantial","href":"/docs/reference/runtimes/substantial/","docId":"reference/runtimes/substantial/index","unlisted":false},{"type":"link","label":"Temporal","href":"/docs/reference/runtimes/temporal/","docId":"reference/runtimes/temporal/index","unlisted":false},{"type":"link","label":"Wasm","href":"/docs/reference/runtimes/wasm/","docId":"reference/runtimes/wasm/index","unlisted":false}],"href":"/docs/reference/runtimes/"},{"type":"link","label":"Policies","href":"/docs/reference/policies/","docId":"reference/policies/index","unlisted":false},{"type":"link","label":"Ecosystem","href":"/docs/reference/ecosystem/","docId":"reference/ecosystem/index","unlisted":false},{"type":"link","label":"REST","href":"/docs/reference/rest/","docId":"reference/rest/index","unlisted":false},{"type":"category","label":"Typegraph","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Client","href":"/docs/reference/typegraph/client/","docId":"reference/typegraph/client/index","unlisted":false}],"href":"/docs/reference/typegraph/"},{"type":"category","label":"Typegate","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Authentication","href":"/docs/reference/typegate/authentication/","docId":"reference/typegate/authentication/index","unlisted":false},{"type":"link","label":"CORS","href":"/docs/reference/typegate/cors/","docId":"reference/typegate/cors/index","unlisted":false},{"type":"link","label":"Rate limiting","href":"/docs/reference/typegate/rate-limiting/","docId":"reference/typegate/rate-limiting/index","unlisted":false},{"type":"link","label":"Synchronization","href":"/docs/reference/typegate/synchronization/","docId":"reference/typegate/synchronization/index","unlisted":false}],"href":"/docs/reference/typegate/"},{"type":"category","label":"Meta CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Available commands","href":"/docs/reference/meta-cli/available-commands","docId":"reference/meta-cli/available-commands","unlisted":false},{"type":"link","label":"Configuration file","href":"/docs/reference/meta-cli/configuration-file","docId":"reference/meta-cli/configuration-file","unlisted":false},{"type":"link","label":"Embedded Typegate","href":"/docs/reference/meta-cli/embedded-typegate/","docId":"reference/meta-cli/embedded-typegate/index","unlisted":false}],"href":"/docs/reference/meta-cli/"},{"type":"link","label":"Changelog","href":"/docs/reference/changelog","docId":"reference/changelog","unlisted":false},{"type":"link","label":"index","href":"/docs/reference/metagen/","docId":"reference/metagen/index","unlisted":false}]},{"type":"category","label":"Concepts","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Features overview","href":"/docs/concepts/features-overview/","docId":"concepts/features-overview/index","unlisted":false},{"type":"link","label":"Mental model","href":"/docs/concepts/mental-model/","docId":"concepts/mental-model/index","unlisted":false},{"type":"link","label":"Architecture","href":"/docs/concepts/architecture/","docId":"concepts/architecture/index","unlisted":false},{"type":"link","label":"Comparing Metatype","href":"/docs/concepts/comparisons/","docId":"concepts/comparisons/index","unlisted":false},{"type":"category","label":"RFCs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"M0 - Template","href":"/docs/concepts/RFCs/M0-template","docId":"concepts/RFCs/M0-template","unlisted":false}],"href":"/docs/concepts/RFCs/"}]}]},"docs":{"concepts/architecture/index":{"id":"concepts/architecture/index","title":"Architecture","description":"Artifacts","sidebar":"docs"},"concepts/comparisons/index":{"id":"concepts/comparisons/index","title":"Comparing Metatype","description":"Metatype foundations takes inspiration from many innovative tools that arose in the last years. We took the best of each of them and combined them into a single engine backed by a convenient computing model.","sidebar":"docs"},"concepts/features-overview/index":{"id":"concepts/features-overview/index","title":"Features overview","description":"We\'re taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ticket or better yet discussion boards. Thank you!","sidebar":"docs"},"concepts/mental-model/index":{"id":"concepts/mental-model/index","title":"Mental model","description":"This page gives a high-level view of Metatype\'s foundations.","sidebar":"docs"},"concepts/RFCs/index":{"id":"concepts/RFCs/index","title":"RFCs","description":"| N\xb0 | Name | Date |","sidebar":"docs"},"concepts/RFCs/M0-template":{"id":"concepts/RFCs/M0-template","title":"M0 - Template","description":"This template is derived from the Rust RFC template and thus is under the same license. Please adapt the following template to your needs and ensure that the RFC is complete before submitting it.","sidebar":"docs"},"guides/contributing":{"id":"guides/contributing","title":"Contribute to Metatype","description":"","sidebar":"docs"},"guides/external-functions/index":{"id":"guides/external-functions/index","title":"Custom functions","description":"Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under functions which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function generators to minimize boilerplate. For cases not expressible by generators, runtimes like the DenoRuntime allow us to write more powerful custom functions.","sidebar":"docs"},"guides/files-upload/index":{"id":"guides/files-upload/index","title":"Upload files to cloud storage","description":"We can then use this typegraph from our client code like so:","sidebar":"docs"},"guides/import-external-modules/index":{"id":"guides/import-external-modules/index","title":"Importing External Modules","description":"So far, the functinos we\'ve looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime\'s generate helper. The deno.policy function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we\'ll look at how to roll a custom function ourselves. We\'ll be using the Deno runtime to run our code.","sidebar":"docs"},"guides/programmatic-deployment/index":{"id":"guides/programmatic-deployment/index","title":"Programmatic deployment","description":"The SDKs are complete enough to enable deploying typegraphs without using meta cli, the later being built as a convenience tool for everyday use.","sidebar":"docs"},"guides/rest/index":{"id":"guides/rest/index","title":"Write REST endpoints","description":"The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.","sidebar":"docs"},"guides/securing-requests/index":{"id":"guides/securing-requests/index","title":"Secure your requests","description":"Authentication","sidebar":"docs"},"guides/self-hosting":{"id":"guides/self-hosting","title":"Self-host the Typegate","description":"Helm","sidebar":"docs"},"guides/test-your-typegraph/index":{"id":"guides/test-your-typegraph/index","title":"Test typegraphs","description":"Typegraph is the SDK for Metatype, used to author and define applications..","sidebar":"docs"},"guides/wasm-functions/index":{"id":"guides/wasm-functions/index","title":"Wasm functions","description":"The following feature is not yet stable.","sidebar":"docs"},"index":{"id":"index","title":"Getting started","description":"Start building with the tutorials","sidebar":"docs"},"reference/changelog":{"id":"reference/changelog","title":"Changelog","description":"","sidebar":"docs"},"reference/ecosystem/index":{"id":"reference/ecosystem/index","title":"Ecosystem","description":"ghjk","sidebar":"docs"},"reference/meta-cli/available-commands":{"id":"reference/meta-cli/available-commands","title":"Available commands","description":"Managing typegraphs","sidebar":"docs"},"reference/meta-cli/configuration-file":{"id":"reference/meta-cli/configuration-file","title":"Configuration file","description":"metatype.yml Example file","sidebar":"docs"},"reference/meta-cli/embedded-typegate/index":{"id":"reference/meta-cli/embedded-typegate/index","title":"Embedded Typegate","description":"","sidebar":"docs"},"reference/meta-cli/index":{"id":"reference/meta-cli/index","title":"Meta CLI","description":"Meta-cli version","sidebar":"docs"},"reference/metagen/index":{"id":"reference/metagen/index","title":"index","description":"/typegrap/typegraphh---","sidebar":"docs"},"reference/policies/index":{"id":"reference/policies/index","title":"Policies","description":"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity.","sidebar":"docs"},"reference/rest/index":{"id":"reference/rest/index","title":"REST","description":"Metatype also allows you to consume your API in the same way you would consume regular REST APIs. It is as easy as calling a function: g.rest(..).","sidebar":"docs"},"reference/runtimes/deno/index":{"id":"reference/runtimes/deno/index","title":"Deno/typescript","description":"Deno runtime","sidebar":"docs"},"reference/runtimes/graphql/index":{"id":"reference/runtimes/graphql/index","title":"GraphQL","description":"GraphQL runtime","sidebar":"docs"},"reference/runtimes/grpc/index":{"id":"reference/runtimes/grpc/index","title":"gRPC Runtime","description":"Overview","sidebar":"docs"},"reference/runtimes/http/index":{"id":"reference/runtimes/http/index","title":"HTTP/REST","description":"HTTP Runtime","sidebar":"docs"},"reference/runtimes/index":{"id":"reference/runtimes/index","title":"Runtimes","description":"Specialized runtimes","sidebar":"docs"},"reference/runtimes/kv/index":{"id":"reference/runtimes/kv/index","title":"Kv","description":"Kv Runtime","sidebar":"docs"},"reference/runtimes/prisma/index":{"id":"reference/runtimes/prisma/index","title":"Prisma","description":"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:","sidebar":"docs"},"reference/runtimes/python/index":{"id":"reference/runtimes/python/index","title":"Python","description":"Python Runtime","sidebar":"docs"},"reference/runtimes/random/index":{"id":"reference/runtimes/random/index","title":"Random","description":"Random runtime","sidebar":"docs"},"reference/runtimes/s3/index":{"id":"reference/runtimes/s3/index","title":"S3","description":"S3 runtime","sidebar":"docs"},"reference/runtimes/substantial/index":{"id":"reference/runtimes/substantial/index","title":"Substantial","description":"Substantial runtime","sidebar":"docs"},"reference/runtimes/temporal/index":{"id":"reference/runtimes/temporal/index","title":"Temporal","description":"Temporal runtime","sidebar":"docs"},"reference/runtimes/wasm/index":{"id":"reference/runtimes/wasm/index","title":"Wasm","description":"Wasm runtime","sidebar":"docs"},"reference/typegate/authentication/index":{"id":"reference/typegate/authentication/index","title":"Authentication","description":"Authentication enable the typegate to identify the user making the request and share some contextual data (called later \\"context\\" or \\"claims\\"). This data can then be used by policies or injected into various fields. Authenticated requests must use the Authorization header to provide a token in one of the following format.","sidebar":"docs"},"reference/typegate/cors/index":{"id":"reference/typegate/cors/index","title":"CORS","description":"","sidebar":"docs"},"reference/typegate/index":{"id":"reference/typegate/index","title":"Typegate","description":"Typegate version","sidebar":"docs"},"reference/typegate/rate-limiting/index":{"id":"reference/typegate/rate-limiting/index","title":"Rate limiting","description":"The rate limiting algorithm works as follows:","sidebar":"docs"},"reference/typegate/synchronization/index":{"id":"reference/typegate/synchronization/index","title":"Synchronization","description":"The typegate run in either on of the following modes:","sidebar":"docs"},"reference/typegraph/client/index":{"id":"reference/typegraph/client/index","title":"Client","description":"The following feature isn\'t yet stable.","sidebar":"docs"},"reference/typegraph/index":{"id":"reference/typegraph/index","title":"Typegraph","description":"Typegraphs are the main building blocks when writing some code using Metatype. They define the unit of development/deployment and expose under a define name a set of types and their relationships.","sidebar":"docs"},"reference/types/comparison":{"id":"reference/types/comparison","title":"Type comparison","description":"A type A is called a subtype of a type B if any valid value for A is a valid value for B.","sidebar":"docs"},"reference/types/functions":{"id":"reference/types/functions","title":"Functions","description":"Function objects describe a piece of logic that is to be run on a certain runtime.","sidebar":"docs"},"reference/types/index":{"id":"reference/types/index","title":"Types","description":"Overview","sidebar":"docs"},"reference/types/injections":{"id":"reference/types/injections","title":"Injections","description":"Injection is a mechanism to get the value of a parameter from other sources than the graphql query. When a parameter is injected, no value is expected in the query, otherwise, the query will fail. They are specified at the type level for input types that are direct children of a t.struct.","sidebar":"docs"},"reference/types/parameter-transformations":{"id":"reference/types/parameter-transformations","title":"Parameter Transformations","description":"might consider using parameter transformations if:","sidebar":"docs"},"tutorials/metatype-basics/index":{"id":"tutorials/metatype-basics/index","title":"Metatype Basics","description":"This page will walk you through a real world API with data storage and authorization.","sidebar":"docs"},"tutorials/quick-start/index":{"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.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/878e8ee7.faabbe3b.js b/assets/js/878e8ee7.faabbe3b.js new file mode 100644 index 0000000000..8808e5a98e --- /dev/null +++ b/assets/js/878e8ee7.faabbe3b.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6800],{49362:e=>{e.exports=JSON.parse('{"version":{"pluginId":"docs","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"docs":[{"type":"link","label":"Getting started","href":"/docs/","docId":"index","unlisted":false},{"type":"category","label":"Tutorials","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Quick-start","href":"/docs/tutorials/quick-start/","docId":"tutorials/quick-start/index","unlisted":false},{"type":"link","label":"Metatype Basics","href":"/docs/tutorials/metatype-basics/","docId":"tutorials/metatype-basics/index","unlisted":false}]},{"type":"category","label":"How-to guides","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Custom functions","href":"/docs/guides/external-functions/","docId":"guides/external-functions/index","unlisted":false},{"type":"link","label":"Upload files to cloud storage","href":"/docs/guides/files-upload/","docId":"guides/files-upload/index","unlisted":false},{"type":"link","label":"Write REST endpoints","href":"/docs/guides/rest/","docId":"guides/rest/index","unlisted":false},{"type":"link","label":"Secure your requests","href":"/docs/guides/securing-requests/","docId":"guides/securing-requests/index","unlisted":false},{"type":"link","label":"Wasm functions","href":"/docs/guides/wasm-functions/","docId":"guides/wasm-functions/index","unlisted":false},{"type":"link","label":"Self-host the Typegate","href":"/docs/guides/self-hosting","docId":"guides/self-hosting","unlisted":false},{"type":"link","label":"Contribute to Metatype","href":"/docs/guides/contributing","docId":"guides/contributing","unlisted":false},{"type":"link","label":"Importing External Modules","href":"/docs/guides/import-external-modules/","docId":"guides/import-external-modules/index","unlisted":false},{"type":"link","label":"Programmatic deployment","href":"/docs/guides/programmatic-deployment/","docId":"guides/programmatic-deployment/index","unlisted":false},{"type":"link","label":"Test typegraphs","href":"/docs/guides/test-your-typegraph/","docId":"guides/test-your-typegraph/index","unlisted":false}]},{"type":"category","label":"Reference","collapsible":true,"collapsed":false,"items":[{"type":"category","label":"Types","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Type comparison","href":"/docs/reference/types/comparison","docId":"reference/types/comparison","unlisted":false},{"type":"link","label":"Functions","href":"/docs/reference/types/functions","docId":"reference/types/functions","unlisted":false},{"type":"link","label":"Injections","href":"/docs/reference/types/injections","docId":"reference/types/injections","unlisted":false},{"type":"link","label":"Parameter Transformations","href":"/docs/reference/types/parameter-transformations","docId":"reference/types/parameter-transformations","unlisted":false}],"href":"/docs/reference/types/"},{"type":"category","label":"Runtimes","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Deno/typescript","href":"/docs/reference/runtimes/deno/","docId":"reference/runtimes/deno/index","unlisted":false},{"type":"link","label":"GraphQL","href":"/docs/reference/runtimes/graphql/","docId":"reference/runtimes/graphql/index","unlisted":false},{"type":"link","label":"gRPC Runtime","href":"/docs/reference/runtimes/grpc/","docId":"reference/runtimes/grpc/index","unlisted":false},{"type":"link","label":"HTTP/REST","href":"/docs/reference/runtimes/http/","docId":"reference/runtimes/http/index","unlisted":false},{"type":"link","label":"Kv","href":"/docs/reference/runtimes/kv/","docId":"reference/runtimes/kv/index","unlisted":false},{"type":"link","label":"Prisma","href":"/docs/reference/runtimes/prisma/","docId":"reference/runtimes/prisma/index","unlisted":false},{"type":"link","label":"Python","href":"/docs/reference/runtimes/python/","docId":"reference/runtimes/python/index","unlisted":false},{"type":"link","label":"Random","href":"/docs/reference/runtimes/random/","docId":"reference/runtimes/random/index","unlisted":false},{"type":"link","label":"S3","href":"/docs/reference/runtimes/s3/","docId":"reference/runtimes/s3/index","unlisted":false},{"type":"link","label":"Substantial","href":"/docs/reference/runtimes/substantial/","docId":"reference/runtimes/substantial/index","unlisted":false},{"type":"link","label":"Temporal","href":"/docs/reference/runtimes/temporal/","docId":"reference/runtimes/temporal/index","unlisted":false},{"type":"link","label":"Wasm","href":"/docs/reference/runtimes/wasm/","docId":"reference/runtimes/wasm/index","unlisted":false}],"href":"/docs/reference/runtimes/"},{"type":"link","label":"Policies","href":"/docs/reference/policies/","docId":"reference/policies/index","unlisted":false},{"type":"link","label":"Ecosystem","href":"/docs/reference/ecosystem/","docId":"reference/ecosystem/index","unlisted":false},{"type":"link","label":"REST","href":"/docs/reference/rest/","docId":"reference/rest/index","unlisted":false},{"type":"category","label":"Typegraph","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Client","href":"/docs/reference/typegraph/client/","docId":"reference/typegraph/client/index","unlisted":false}],"href":"/docs/reference/typegraph/"},{"type":"category","label":"Typegate","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Authentication","href":"/docs/reference/typegate/authentication/","docId":"reference/typegate/authentication/index","unlisted":false},{"type":"link","label":"CORS","href":"/docs/reference/typegate/cors/","docId":"reference/typegate/cors/index","unlisted":false},{"type":"link","label":"Rate limiting","href":"/docs/reference/typegate/rate-limiting/","docId":"reference/typegate/rate-limiting/index","unlisted":false},{"type":"link","label":"Synchronization","href":"/docs/reference/typegate/synchronization/","docId":"reference/typegate/synchronization/index","unlisted":false}],"href":"/docs/reference/typegate/"},{"type":"category","label":"Meta CLI","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"Available commands","href":"/docs/reference/meta-cli/available-commands","docId":"reference/meta-cli/available-commands","unlisted":false},{"type":"link","label":"Configuration file","href":"/docs/reference/meta-cli/configuration-file","docId":"reference/meta-cli/configuration-file","unlisted":false},{"type":"link","label":"Embedded Typegate","href":"/docs/reference/meta-cli/embedded-typegate/","docId":"reference/meta-cli/embedded-typegate/index","unlisted":false}],"href":"/docs/reference/meta-cli/"},{"type":"link","label":"GraphQL","href":"/docs/reference/graphql/","docId":"reference/graphql/index","unlisted":false},{"type":"link","label":"Changelog","href":"/docs/reference/changelog","docId":"reference/changelog","unlisted":false},{"type":"link","label":"index","href":"/docs/reference/metagen/","docId":"reference/metagen/index","unlisted":false}]},{"type":"category","label":"Concepts","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Features overview","href":"/docs/concepts/features-overview/","docId":"concepts/features-overview/index","unlisted":false},{"type":"link","label":"Mental model","href":"/docs/concepts/mental-model/","docId":"concepts/mental-model/index","unlisted":false},{"type":"link","label":"Architecture","href":"/docs/concepts/architecture/","docId":"concepts/architecture/index","unlisted":false},{"type":"link","label":"Comparing Metatype","href":"/docs/concepts/comparisons/","docId":"concepts/comparisons/index","unlisted":false},{"type":"category","label":"RFCs","collapsible":true,"collapsed":true,"items":[{"type":"link","label":"M0 - Template","href":"/docs/concepts/RFCs/M0-template","docId":"concepts/RFCs/M0-template","unlisted":false}],"href":"/docs/concepts/RFCs/"}]}]},"docs":{"concepts/architecture/index":{"id":"concepts/architecture/index","title":"Architecture","description":"Artifacts","sidebar":"docs"},"concepts/comparisons/index":{"id":"concepts/comparisons/index","title":"Comparing Metatype","description":"Metatype foundations takes inspiration from many innovative tools that arose in the last years. We took the best of each of them and combined them into a single engine backed by a convenient computing model.","sidebar":"docs"},"concepts/features-overview/index":{"id":"concepts/features-overview/index","title":"Features overview","description":"We\'re taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ticket or better yet discussion boards. Thank you!","sidebar":"docs"},"concepts/mental-model/index":{"id":"concepts/mental-model/index","title":"Mental model","description":"This page gives a high-level view of Metatype\'s foundations.","sidebar":"docs"},"concepts/RFCs/index":{"id":"concepts/RFCs/index","title":"RFCs","description":"| N\xb0 | Name | Date |","sidebar":"docs"},"concepts/RFCs/M0-template":{"id":"concepts/RFCs/M0-template","title":"M0 - Template","description":"This template is derived from the Rust RFC template and thus is under the same license. Please adapt the following template to your needs and ensure that the RFC is complete before submitting it.","sidebar":"docs"},"guides/contributing":{"id":"guides/contributing","title":"Contribute to Metatype","description":"","sidebar":"docs"},"guides/external-functions/index":{"id":"guides/external-functions/index","title":"Custom functions","description":"Custom functions can be used to run custom code at different points of a typegraph. These constructs fall under functions which are, concretly, operations associated to a specific runtime. For some common tasks, like simple operations on database tables for example, runtime implementations provide function generators to minimize boilerplate. For cases not expressible by generators, runtimes like the DenoRuntime allow us to write more powerful custom functions.","sidebar":"docs"},"guides/files-upload/index":{"id":"guides/files-upload/index","title":"Upload files to cloud storage","description":"We can then use this typegraph from our client code like so:","sidebar":"docs"},"guides/import-external-modules/index":{"id":"guides/import-external-modules/index","title":"Importing External Modules","description":"So far, the functinos we\'ve looked at have been generated by helpers like the CRUD helpers from the Prisma runtime or the the Random runtime\'s generate helper. The deno.policy function we used for authoring policies was also based on function objects. All these helpers are shorthands for creating function objects and now we\'ll look at how to roll a custom function ourselves. We\'ll be using the Deno runtime to run our code.","sidebar":"docs"},"guides/programmatic-deployment/index":{"id":"guides/programmatic-deployment/index","title":"Programmatic deployment","description":"The SDKs are complete enough to enable deploying typegraphs without using meta cli, the later being built as a convenience tool for everyday use.","sidebar":"docs"},"guides/rest/index":{"id":"guides/rest/index","title":"Write REST endpoints","description":"The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.","sidebar":"docs"},"guides/securing-requests/index":{"id":"guides/securing-requests/index","title":"Secure your requests","description":"Authentication","sidebar":"docs"},"guides/self-hosting":{"id":"guides/self-hosting","title":"Self-host the Typegate","description":"Helm","sidebar":"docs"},"guides/test-your-typegraph/index":{"id":"guides/test-your-typegraph/index","title":"Test typegraphs","description":"Typegraph is the SDK for Metatype, used to author and define applications..","sidebar":"docs"},"guides/wasm-functions/index":{"id":"guides/wasm-functions/index","title":"Wasm functions","description":"The following feature is not yet stable.","sidebar":"docs"},"index":{"id":"index","title":"Getting started","description":"Start building with the tutorials","sidebar":"docs"},"reference/changelog":{"id":"reference/changelog","title":"Changelog","description":"","sidebar":"docs"},"reference/ecosystem/index":{"id":"reference/ecosystem/index","title":"Ecosystem","description":"ghjk","sidebar":"docs"},"reference/graphql/index":{"id":"reference/graphql/index","title":"GraphQL","description":"GraphQL is the primary means of querying your typegraph.","sidebar":"docs"},"reference/meta-cli/available-commands":{"id":"reference/meta-cli/available-commands","title":"Available commands","description":"Managing typegraphs","sidebar":"docs"},"reference/meta-cli/configuration-file":{"id":"reference/meta-cli/configuration-file","title":"Configuration file","description":"metatype.yml Example file","sidebar":"docs"},"reference/meta-cli/embedded-typegate/index":{"id":"reference/meta-cli/embedded-typegate/index","title":"Embedded Typegate","description":"","sidebar":"docs"},"reference/meta-cli/index":{"id":"reference/meta-cli/index","title":"Meta CLI","description":"Meta-cli version","sidebar":"docs"},"reference/metagen/index":{"id":"reference/metagen/index","title":"index","description":"/typegrap/typegraphh---","sidebar":"docs"},"reference/policies/index":{"id":"reference/policies/index","title":"Policies","description":"Typegraphs allow you to specify granular access control when exposing your functions. This can be done at the function or the type field level. This section also makes use of toy typegraph for the sake of clarity.","sidebar":"docs"},"reference/rest/index":{"id":"reference/rest/index","title":"REST","description":"Metatype also allows you to consume your API in the same way you would consume regular REST APIs. It is as easy as calling a function: g.rest(..).","sidebar":"docs"},"reference/runtimes/deno/index":{"id":"reference/runtimes/deno/index","title":"Deno/typescript","description":"Deno runtime","sidebar":"docs"},"reference/runtimes/graphql/index":{"id":"reference/runtimes/graphql/index","title":"GraphQL","description":"GraphQL runtime","sidebar":"docs"},"reference/runtimes/grpc/index":{"id":"reference/runtimes/grpc/index","title":"gRPC Runtime","description":"Overview","sidebar":"docs"},"reference/runtimes/http/index":{"id":"reference/runtimes/http/index","title":"HTTP/REST","description":"HTTP Runtime","sidebar":"docs"},"reference/runtimes/index":{"id":"reference/runtimes/index","title":"Runtimes","description":"Specialized runtimes","sidebar":"docs"},"reference/runtimes/kv/index":{"id":"reference/runtimes/kv/index","title":"Kv","description":"Kv Runtime","sidebar":"docs"},"reference/runtimes/prisma/index":{"id":"reference/runtimes/prisma/index","title":"Prisma","description":"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:","sidebar":"docs"},"reference/runtimes/python/index":{"id":"reference/runtimes/python/index","title":"Python","description":"Python Runtime","sidebar":"docs"},"reference/runtimes/random/index":{"id":"reference/runtimes/random/index","title":"Random","description":"Random runtime","sidebar":"docs"},"reference/runtimes/s3/index":{"id":"reference/runtimes/s3/index","title":"S3","description":"S3 runtime","sidebar":"docs"},"reference/runtimes/substantial/index":{"id":"reference/runtimes/substantial/index","title":"Substantial","description":"Substantial runtime","sidebar":"docs"},"reference/runtimes/temporal/index":{"id":"reference/runtimes/temporal/index","title":"Temporal","description":"Temporal runtime","sidebar":"docs"},"reference/runtimes/wasm/index":{"id":"reference/runtimes/wasm/index","title":"Wasm","description":"Wasm runtime","sidebar":"docs"},"reference/typegate/authentication/index":{"id":"reference/typegate/authentication/index","title":"Authentication","description":"Authentication enable the typegate to identify the user making the request and share some contextual data (called later \\"context\\" or \\"claims\\"). This data can then be used by policies or injected into various fields. Authenticated requests must use the Authorization header to provide a token in one of the following format.","sidebar":"docs"},"reference/typegate/cors/index":{"id":"reference/typegate/cors/index","title":"CORS","description":"","sidebar":"docs"},"reference/typegate/index":{"id":"reference/typegate/index","title":"Typegate","description":"Typegate version","sidebar":"docs"},"reference/typegate/rate-limiting/index":{"id":"reference/typegate/rate-limiting/index","title":"Rate limiting","description":"The rate limiting algorithm works as follows:","sidebar":"docs"},"reference/typegate/synchronization/index":{"id":"reference/typegate/synchronization/index","title":"Synchronization","description":"The typegate run in either on of the following modes:","sidebar":"docs"},"reference/typegraph/client/index":{"id":"reference/typegraph/client/index","title":"Client","description":"The following feature isn\'t yet stable.","sidebar":"docs"},"reference/typegraph/index":{"id":"reference/typegraph/index","title":"Typegraph","description":"Typegraphs are the main building blocks when writing some code using Metatype. They define the unit of development/deployment and expose under a define name a set of types and their relationships.","sidebar":"docs"},"reference/types/comparison":{"id":"reference/types/comparison","title":"Type comparison","description":"A type A is called a subtype of a type B if any valid value for A is a valid value for B.","sidebar":"docs"},"reference/types/functions":{"id":"reference/types/functions","title":"Functions","description":"Function objects describe a piece of logic that is to be run on a certain runtime.","sidebar":"docs"},"reference/types/index":{"id":"reference/types/index","title":"Types","description":"Overview","sidebar":"docs"},"reference/types/injections":{"id":"reference/types/injections","title":"Injections","description":"Injection is a mechanism to get the value of a parameter from other sources than the graphql query. When a parameter is injected, no value is expected in the query, otherwise, the query will fail. They are specified at the type level for input types that are direct children of a t.struct.","sidebar":"docs"},"reference/types/parameter-transformations":{"id":"reference/types/parameter-transformations","title":"Parameter Transformations","description":"might consider using parameter transformations if:","sidebar":"docs"},"tutorials/metatype-basics/index":{"id":"tutorials/metatype-basics/index","title":"Metatype Basics","description":"This page will walk you through a real world API with data storage and authorization.","sidebar":"docs"},"tutorials/quick-start/index":{"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.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/8cfb3d68.bb7917b9.js b/assets/js/8cfb3d68.affae4c6.js similarity index 73% rename from assets/js/8cfb3d68.bb7917b9.js rename to assets/js/8cfb3d68.affae4c6.js index 788cbf1985..20757efe71 100644 --- a/assets/js/8cfb3d68.bb7917b9.js +++ b/assets/js/8cfb3d68.affae4c6.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3599],{37214:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>u,default:()=>f,frontMatter:()=>d,metadata:()=>h,toc:()=>g});var s=n(86070),o=n(25710),i=(n(30758),n(55230)),a=n(7871),r=n(92076);function c(e){return(0,s.jsx)("div",{children:e?.rows?.map((e=>(0,s.jsx)("div",{className:"gap-4 flex max-w-full my-10",children:e.map((e=>{if("title"in e)return(0,s.jsx)("div",{className:"flex-1 w-full",children:(0,s.jsx)(l,{...e})});if("content"in e){const t=e.path.split("."),n=t[t.length-1];return(0,s.jsxs)("div",{className:"flex-1 w-full",children:[(0,s.jsxs)(r.A,{to:`https://github.com/metatypedev/metatype/blob/main/${e.path}`,className:"absolute top-0 right-0 m-2 p-1",children:[e.path.split("/").pop()," \u2197"]}),(0,s.jsx)(a.A,{language:n,wrap:!0,children:e.content})]})}return(0,s.jsx)("div",{className:"flex-1 w-full",children:e})}))})))})}function l(e){return(0,s.jsx)(r.A,{to:e.link,style:{textDecoration:"none",color:"inherit"},children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,s.jsx)(i.A,{as:"h3",className:"inline-block",children:e.title}),(0,s.jsx)("span",{className:`text-right ${{complete:"text-green-500",beta:"text-yellow-500",future:"text-pink-500"}[e.status]}`,children:e.status.toUpperCase()})]}),(0,s.jsx)("div",{children:e.body})]})})}var p=n(65671);const d={sidebar_position:1},u="Features overview",h={id:"concepts/features-overview/index",title:"Features overview",description:"We're taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ticket or better yet discussion boards. Thank you!",source:"@site/docs/concepts/features-overview/index.mdx",sourceDirName:"concepts/features-overview",slug:"/concepts/features-overview/",permalink:"/docs/concepts/features-overview/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/concepts/features-overview/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",previous:{title:"index",permalink:"/docs/reference/metagen/"},next:{title:"Mental model",permalink:"/docs/concepts/mental-model/"}},m={},g=[{value:"Typegate",id:"typegate",level:2},{value:"Typegraph",id:"typegraph",level:2},{value:"Runtimes",id:"runtimes",level:2},{value:"Prisma",id:"prisma",level:3},{value:"Authentication",id:"authentication",level:2},{value:"Tooling",id:"tooling",level:2},{value:"SDKs",id:"sdks",level:2}];function y(e){const t={a:"a",admonition:"admonition",code:"code",div:"div",h1:"h1",h2:"h2",h3:"h3",p:"p",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"features-overview",children:"Features overview"}),"\n",(0,s.jsx)(t.admonition,{title:"Suggestions",type:"info",children:(0,s.jsxs)(t.p,{children:["We're taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ",(0,s.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/issues",children:"ticket"})," or better yet ",(0,s.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/discussions/",children:"discussion"})," boards. Thank you!"]})}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"typegate",children:"Typegate"}),"\n",(0,s.jsx)(c,{rows:[[{title:"GraphQL API",status:"complete",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Expose select functions in your graph through a GraphQL API. These root-functions will serve as the entry point to your graph for any incoming request. The typegraph model is a great fit for GraphQL semantics and this is the best supported way to consume typegraphs."})},{title:"GraphQL Subscriptions",status:"future",link:"https://github.com/metatypedev/metatype/issues/726",body:(0,s.jsx)(s.Fragment,{children:"Get real-time data to clients."})}],[{title:"REST API",status:"complete",link:"/docs/guides/rest",body:(0,s.jsx)(s.Fragment,{children:"You can expose select root functions through a simple REST API. This is handy to serve endpoints for clients that are not GraphQl capable, even though it hampers access to some typegraph features. Inputs will be sourced from either HTTP bodies or search parameters according to HTTP verb."})},{title:"gRPC API",status:"complete",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Expose your gRPC API, enabling high-performance, bi-directional communication between services. This allows you to call gRPC methods directly from the typegraph, providing more flexibility and better integration with existing gRPC-based microservices. This approach supports a broader range of real-time use cases ."})}],[{title:"Cron triggers",status:"future",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Execute functions at certain time intervals. Useful for cleanup jobs."})},(0,s.jsx)(t.div,{})],[{title:"Rate-limiting",status:"complete",link:"/docs/reference/typegate/cors",body:(0,s.jsx)(s.Fragment,{children:"Rate-limit parts of your graph to minimize abuse. The limits can be configured granularly for each function and for custom time windows. Use custom request identifiers, in addition to ip addresses, to track limits counters."})},{title:"CORS",status:"complete",link:"/docs/reference/typegate/cors",body:(0,s.jsx)(s.Fragment,{children:"Specify cross-origin request rules to control which domains can access your API from within a browser. Prevents abuse from websites trying to use your API without permission."})}],[{title:"Single-node",status:"complete",link:"/docs/reference/typegate/synchronization",body:(0,s.jsx)(s.Fragment,{children:"The typegate can be run as a single node mode for simple deployments and using the filesystem as its artifact store. Useful for local development and testing."})},{title:"Multi-node",status:"complete",link:"/docs/reference/typegate/synchronization",body:(0,s.jsx)(s.Fragment,{children:"Deploy multiple instances of the typegate to distribute loads across machines and scale horizontally. You'll only need a Redis compatible key-value cache, an S3 compatible object store, and your favorite load-balancer in front of the instances to get it going. This mode is recommended for production deployments even if only a single node is used."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"typegraph",children:"Typegraph"}),"\n",(0,s.jsx)(c,{rows:[[(0,s.jsx)(p.A,{python:n(84986),typescript:n(24204),disablePlayground:!0})],[{title:"Scalar types",status:"complete",link:"/docs/reference/types#scalar-types",body:(0,s.jsxs)(s.Fragment,{children:["The primitive types ",(0,s.jsx)(t.code,{children:"integer"}),", ",(0,s.jsx)(t.code,{children:"float"}),","," ",(0,s.jsx)(t.code,{children:"boolean"}),", ",(0,s.jsx)(t.code,{children:"string"})," and ",(0,s.jsx)(t.code,{children:"file"}),". All data that flows through a typegraph reduces down to these types."]})},{title:"Type constraints",status:"complete",link:"/docs/reference/types/injections",body:(0,s.jsx)(s.Fragment,{children:"Declare types in your graph that are subset of primitives like string and integers by using regular expressions or min/max limits. Useful to validate incoming data even more and distribute invariants through your app."})}],[{title:"Composite types",status:"complete",link:"/docs/reference/types#scalar-types",body:(0,s.jsxs)(s.Fragment,{children:["Support for ",(0,s.jsx)(t.code,{children:"struct"}),", ",(0,s.jsx)(t.code,{children:"list"}),","," ",(0,s.jsx)(t.code,{children:"union"}),", ",(0,s.jsx)(t.code,{children:"either"})," and ",(0,s.jsx)(t.code,{children:"optional"})," ","types. These allow you to represent types equivalent to most modern type systems."]})},{title:"Injections",status:"complete",link:"/docs/reference/types/injections",body:(0,s.jsx)(s.Fragment,{children:"Injections resolve part of your graph inline instead of from functions or provide defaults for incoming request data. This can be used to set static values or source them from the context, other parts of the graph...etc."})}],[{title:"Functions",status:"complete",link:"/docs/reference/types/functions",body:(0,s.jsxs)(s.Fragment,{children:["Nodes in your typegraph that represent data to be resolved after running some logic on a ",(0,s.jsx)(t.code,{children:"Runtime"}),"."]})},{title:"Function chaining",status:"future",link:"https://github.com/metatypedev/metatype/issues/721",body:(0,s.jsx)(s.Fragment,{children:"Compose functions together by feeding the output of one as the input of another. Encourages code reuse by allowing one to extract common middleware logic from each function, all within the typegraph layer."})}],[{title:(0,s.jsx)(t.code,{children:"reduce"}),status:"complete",link:"/docs/reference/types/parameter-transformations#funcreducetree",body:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.code,{children:"reduce"})," is useful to transform function input types so that only certain struct fields are used, discarding the others. Required fields can be hidden from the user and can instead be injected from the request's context or a static default. This is useful for remixing generated or core domain types to more targeted forms appropriate for a function."]})},{title:(0,s.jsx)(t.code,{children:"apply"}),status:"complete",link:"/docs/reference/types/parameter-transformations#funcapplytree",body:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.code,{children:"apply"})," allows the flattening of deeply nested function input types to something friendlier. Injection can also be used to substitute required fields in the original type from another source."]})}],[{title:"Imports",status:"future",link:"https://github.com/metatypedev/metatype/issues/722",body:(0,s.jsxs)(s.Fragment,{children:["Imports will allow graphs to include nodes from other API descriptions like GraphQL, OpenAPI, gRPC and database schemas. These APIs can then be consumed in a typesafe manner through the"," ",(0,s.jsx)(t.code,{children:"GraphQL"})," and ",(0,s.jsx)(t.code,{children:"Http"})," runtimes."]})},{title:"Secrets",status:"complete",link:"#",body:(0,s.jsx)(s.Fragment,{children:"First-class support for secrets to ease runtime substitution of sensetive values. API keys or dynamic values only discovrable after deployment, this is how you get them into your app."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"runtimes",children:"Runtimes"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Deno runtime",status:"complete",link:"/docs/reference/runtimes/deno",body:(0,s.jsx)(s.Fragment,{children:"Write functions that execute pieces of TypeScript code on a Deno worker. Includes easy access to ESM and libraries through standard Deno features."})}],[(0,s.jsx)(p.A,{python:n(38981),typescript:n(27395),disablePlayground:!0})],[{title:"Python runtime",status:"beta",link:"/docs/reference/runtimes/python",body:(0,s.jsx)(s.Fragment,{children:"Implement functions that execute python functions in code snippets or on disk modules."})}],[(0,s.jsxs)(a.A,{language:"py",children:['from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import PythonRuntime\n\n@typegraph() def example_python(g: Graph): public = Policy.public() python = PythonRuntime()\n\n g.expose(\n public,\n add=t.func(\n t.struct({"a": t.integer(), "b": t.integer()}),\n t.integer(),\n # we can provide the code inline using lambdas\n python.from_lambda(lambda x: x["a"] + x["b"]),\n ),\n sayHello=python.import_(\n t.struct({"name": t.string()}),\n t.string(),\n # point to pythoin a file on disc\n module="hello.py",\n name="say_hello"\n ),\n )\n\n}'," "]})],[{title:"S3 runtime",status:"complete",link:"/docs/reference/runtimes/s3",body:(0,s.jsxs)(s.Fragment,{children:[" Store large blobs in S3 compatible object stores. This includes support for ",(0,s.jsx)(r.A,{to:"/docs/guides/files-upload",children:"GraphQL file uploads"})," and presigned URLs making working with images and large uploads a breeze. "]})},{title:"Temporal runtime",status:"complete",link:"/docs/reference/runtimes/temporal",body:(0,s.jsx)(s.Fragment,{children:" Kick off and query Temporal workflows from a typegraph. Temporal is a durable execution engine that can be used to implement long-running, failure-resistant business processes. "})},{title:"Wasm runtime",status:"beta",link:"/docs/reference/runtimes/wasm",body:(0,s.jsx)(s.Fragment,{children:" Make functions that use WASM components to implement their logic. Write core-wasm or wasi 0.2 based wasm components in languages like Rust, Python and Javascript to power all your custom functions. "})}],[{title:"GraphQL runtime",status:"complete",link:"/docs/reference/runtimes/graphql",body:(0,s.jsx)(s.Fragment,{children:" Include external GraphQL APIs as part of your typegraph. This runtime provides functions that resolve the data by querying an external GraphQL API. "})},{title:"Http runtime",status:"complete",link:"/docs/reference/runtimes/http",body:(0,s.jsx)(s.Fragment,{children:" Include external Http APIs as part of your typegraph. Source the data for your graph using external HTTP requests. "})}],[{title:"Random runtime",status:"complete",link:"/docs/reference/runtimes/random",body:(0,s.jsx)(s.Fragment,{children:" Functions to generate random data based on your types. Useful for quickly throwing together an API and testing. "})},{title:"gRPC runtime",status:"complete",link:"/docs/reference/runtimes/grpc",body:(0,s.jsx)(s.Fragment,{children:" Include external gRPC APIs as part of your typegraph. "})}]]}),"\n",(0,s.jsx)(t.h3,{id:"prisma",children:"Prisma"}),"\n",(0,s.jsx)(t.p,{children:"Access a myriad of databases directly from your typegraph. Run queries, mange it's schema, the full orm featureset."}),"\n",(0,s.jsx)(c,{rows:[[(0,s.jsx)(p.A,{python:n(50864),typescript:n(74518),disablePlayground:!0})],[{title:"Relational schemas",status:"complete",link:"/docs/reference/runtimes/prisma#relationships",body:(0,s.jsx)(s.Fragment,{children:"Use the types in your graph to declare and manage relational schemas to be used on your databse. This means support for primary keys, unique constraints, one-to-one, one-to-many, many-to-many relationships...etc."})},{title:"CRUD queries",status:"complete",link:"/docs/reference/runtimes/prisma#generators",body:(0,s.jsx)(s.Fragment,{children:"Easily generate functions for common create, update, read and delete queries. Includes nested filtering and aggregration paramters for efficent and targeted requests."})},{title:"Raw queries",status:"complete",link:"/docs/reference/runtimes/prisma#raw-query",body:(0,s.jsx)(s.Fragment,{children:"Drop down to raw SQL queries for cases not covered by the CRUD generators. Useful to access unique features native to your database or craft extra efficient queries."})}],[{title:"PostgreSQL support",status:"complete",link:"/docs/reference/runtimes/prisma",body:(0,s.jsx)(s.Fragment,{children:"Support for PostgreSQL, a modern and established DBMS."})},{title:"Beta databases",status:"beta",link:"https://github.com/metatypedev/metatype/issues/724",body:(0,s.jsx)(s.Fragment,{children:"MySQL, MariaDB, AWS Aurora, AWS Aurora Serverless, Microsoft SQL Server, Azure SQL, MongoDB, CockroachDB."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"authentication",children:"Authentication"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Policy-based access control",status:"complete",link:"/docs/reference/policies",body:(0,s.jsx)(s.Fragment,{children:"Policies are simple functions that take the request as input and return values to signal whether it's allowed/denied access. They can be attached to any function in the graph and are evaluated right before the request triggers one. They compose well and are the primary authorization primitive available to typegraphs."})}],[(0,s.jsx)(p.A,{python:n(85775),typescript:n(22481),disablePlayground:!0})],[{title:"Basic authentication",status:"complete",link:"/docs/reference/typegate/authentication#basic-authentication",body:(0,s.jsx)(s.Fragment,{children:"Requests can authenticate themselves using Basic HTTP headers. Simple but useful for getting started or protecting admin only requests."})},(0,s.jsx)(p.A,{python:n(33175),typescript:n(26217),disablePlayground:!0})],[{title:"JWT authentication",status:"complete",link:"/docs/reference/typegate/authentication#jwt-authentication",body:(0,s.jsx)(s.Fragment,{children:"Json Web Tokens can be used to attach more authentication and context information to requests. The data in the tokens can then be used by policies to make authorization decisions."})},(0,s.jsx)(p.A,{python:n(8980),typescript:n(37538),disablePlayground:!0})],[{title:"OAuth2 authorization",status:"complete",link:"/docs/reference/typegate/authentication#oauth2-authorization",body:(0,s.jsx)(s.Fragment,{children:"Use the Oauth2 scheme to implement social-sign in from common identity providers like Github, Meta and Google."})},(0,s.jsx)(p.A,{python:n(42422),typescript:n(23680),disablePlayground:!0})]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"tooling",children:"Tooling"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Meta CLI",status:"complete",link:"/docs/reference/meta-cli",body:(0,s.jsx)(s.Fragment,{children:"Full-featured CLI to aid development and manage typegraph deployments on the typegate. Supports watch mode to aid rapid-iteration, including support for interactive database migration management. Bundles the typegate within it making the CLI all one needs to get started. (And a text editor, of course.)"})}],[(0,s.jsxs)(a.A,{language:"shell",children:["\u276f meta --help at 02:03:36\nDeclarative API development platform. Build backend components with WASM/Typescript/Python, no matter where and how your (legacy) systems are.\n\nUsage: meta [OPTIONS] [COMMAND]\n\nCommands: serialize Serialize the typegraphs defined in the specified python file(s) into JSON dev Push typegraph(s) with development mode features enabled deploy Push typegraph(s) to typegate undeploy Undeploy typegraph(s) from typegate gen Access metagen generators upgrade Upgrade completion Generate shell completion doctor Troubleshoot the installation new Create a new Metatype project typegate Access a minimal deno CLI help Print this message or the help of the given subcommand(s)\n\nOptions: --version -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -C, --dir [default: .] --config path to the config file -h, --help Print help "," "]})],[{title:"Metagen",status:"beta",link:"#",body:(0,s.jsxs)(s.Fragment,{children:[" Code generation suite that supports Rust, Python and Typescript. Generate types from your graph and other helper functions for authoring custom functions for the Wasm, Python and Deno runtimes respectively. Can be accessed through the CLI under the ",(0,s.jsx)(t.code,{children:"gen"})," subcommand or through the different SDKs. "]})},{title:"Meta LSP",status:"beta",body:(0,s.jsx)(s.Fragment,{children:" Extension for your IDE to help authoring of typegraphs. Supports VSCode as of now. "})},(0,s.jsx)(t.div,{})],[{title:"Docker images",status:"complete",link:"https://github.com/orgs/metatypedev/packages/container/package/typegate",body:(0,s.jsxs)(s.Fragment,{children:[" The typegate is primarily distributed as a docker image for deployment as a container. All the available configuration environment variables can be found ",(0,s.jsx)(r.A,{to:"http://localhost:3000/docs/reference/typegate#environment-variables",children:"here"}),". "]})},{title:"Helm charts",status:"complete",link:"/docs/guides/self-hosting",body:(0,s.jsx)(s.Fragment,{children:" Helm charts are published to ease installation of a typegate deployment in your Kubernetes cluster. "})}],[(0,s.jsxs)(a.A,{language:"shell",children:[" ","docker run --rm --pull always \\ -p 7890:7890 \\ -e TG_SECRET=$(openssl rand -base64 64 | tr -d '\\n') \\ -e TG_ADMIN_PASSWORD=\"password\" \\ ghcr.io/metatypedev/typegate:latest"," "]})]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"sdks",children:"SDKs"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Typescript SDK",status:"complete",link:"https://www.npmjs.com/package/@typegraph/sdk",body:(0,s.jsx)(s.Fragment,{children:"Use typescript to author typegraphs and access other SDK tooling. Supports Node and compatible runtimes like Deno and Bun."})},{title:"Python SDK",status:"complete",link:"http://localhost:3000/docs/reference/typegate#environment-variables",body:(0,s.jsx)(s.Fragment,{children:"Use Python to author typegraphs and access other SDK tooling."})},{title:"Dart SDK",status:"future",link:"https://www.npmjs.com/package/@typegraph/sdk",body:(0,s.jsx)(s.Fragment,{children:"Use Dart to author typegraphs and access other SDK tooling."})}],[{title:"Deployments",status:"complete",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Programmatically upload your typegraphs to the typegate from within the SDK. Useful for writing tests or building on top of the Metatype platform."})},{title:"Migrations",status:"beta",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Programmaticaly manage necessary migrations returned by the Prisma runtime. Useful for writing tests or building on top of the Metatype platform."})}],[{title:"Codegen",status:"beta",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Access metagen through the SDK directly to generate type declarations and other helpful code. Useful for testing and to build custom workflows/tooling."})},(0,s.jsx)(t.div,{})]]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(y,{...e})}):y(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(98302),o=(n(30758),n(86070));function i(e){let{python:t,typescript:n,rust:i,...a}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,o.jsx)(s.A,{code:0==r.length?void 0:r,...a})}},33175:e=>{e.exports={content:'@typegraph(\n)\ndef basic_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"username": t.string().optional()})\n\n # highlight-next-line\n g.auth(Auth.basic(["admin"]))\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/basic.py"}},26217:e=>{e.exports={content:'await typegraph(\n {\n name: "basic-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n username: t.string().optional(),\n });\n\n // highlight-next-line\n g.auth(Auth.basic(["admin"]));\n\n g.expose({\n get_context: deno\n .identity(ctx)\n .apply({\n username: g.fromContext("username"),\n })\n .withPolicy(pub),\n });\n }\n);',path:"../examples/typegraphs/basic.ts"}},50864:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.providers.prisma import PrismaRuntime\n\n\n@typegraph(\n)\ndef database(g: Graph):\n db = PrismaRuntime("database", "POSTGRES_CONN")\n public = Policy.public()\n\n message = t.struct(\n {\n # highlight-next-line\n "id": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n # highlight-next-line\n name="message",\n )\n\n g.expose(\n public,\n # highlight-next-line\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/database.py"}},74518:e=>{e.exports={content:'// highlight-next-line\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\nawait typegraph(\n {\n name: "database",\n },\n (g) => {\n const db = new PrismaRuntime("database", "POSTGRES_CONN");\n const pub = Policy.public();\n\n const message = t.struct(\n {\n // highlight-next-line\n id: t.integer({}, { asId: true, config: { auto: true } }),\n title: t.string(),\n body: t.string(),\n },\n // highlight-next-line\n { name: "message" }\n );\n\n g.expose(\n {\n // highlight-next-line\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/database.ts"}},38981:e=>{e.exports={content:'@typegraph(\n)\ndef deno(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n fib = deno.func(\n t.struct({"n": t.float()}),\n t.struct({"res": t.integer(), "ms": t.float()}),\n code="""\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n """,\n )\n\n g.expose(\n public,\n compute_fib=fib,\n )',path:"../examples/typegraphs/deno.py"}},27395:e=>{e.exports={content:'await typegraph(\n {\n name: "deno",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const fib = deno.func(\n t.struct({ n: t.float() }),\n t.struct({ res: t.integer(), ms: t.float() }),\n {\n code: `\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n `,\n }\n );\n\n g.expose(\n {\n compute_fib: fib,\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/deno.ts"}},84986:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes import RandomRuntime\n\n\n@typegraph(\n)\ndef first_typegraph(g: Graph):\n # declare runtimes and policies\n random = RandomRuntime(reset=None)\n public = Policy.public()\n\n # declare types\n message = t.struct(\n {\n "id": t.integer(),\n "title": t.string(),\n "user_id": t.integer(),\n }\n )\n\n # expose them with policies\n g.expose(\n public,\n # input \u2192 output via runtime function\n get_message=random.gen(message),\n )',path:"../examples/typegraphs/first-typegraph.py"}},24204:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\nawait typegraph(\n {\n name: "first-typegraph",\n },\n (g) => {\n // declare runtimes and policies\n const random = new RandomRuntime({});\n const pub = Policy.public();\n\n // declare types\n const message = t.struct({\n id: t.integer(),\n title: t.string(),\n user_id: t.integer(),\n });\n\n // expose them with policies\n g.expose(\n {\n // input \u2192 output via runtime function\n get_message: random.gen(message),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/first-typegraph.ts"}},8980:e=>{e.exports={content:'@typegraph(\n)\ndef jwt_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"your_own_content": t.string().optional()})\n # highlight-next-line\n g.auth(Auth.hmac256("custom"))\n\n g.expose(\n get_context=deno.identity(ctx).apply(\n {\n "your_own_content": g.from_context("your_own_content"),\n }\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/jwt.py"}},37538:e=>{e.exports={content:'typegraph(\n {\n name: "jwt-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n your_own_content: t.string().optional(),\n });\n // highlight-next-line\n g.auth(Auth.hmac256("custom"));\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n your_own_content: g.fromContext("your_own_content"),\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/jwt.ts"}},42422:e=>{e.exports={content:'@typegraph(\n)\ndef oauth2_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"exp": t.integer().optional()})\n\n # highlight-start\n g.auth(Auth.oauth2_github("openid profile email"))\n # highlight-end\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "exp": g.from_context("exp"),\n }\n ),\n )',path:"../examples/typegraphs/oauth2.py"}},23680:e=>{e.exports={content:'typegraph(\n {\n name: "oauth2-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({ exp: t.integer().optional() });\n\n // highlight-start\n g.auth(Auth.oauth2Github("openid profile email"));\n // highlight-end\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n exp: g.fromContext("exp"),\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/oauth2.ts"}},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null"\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null"\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3599],{37214:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>m,contentTitle:()=>u,default:()=>f,frontMatter:()=>d,metadata:()=>h,toc:()=>g});var s=n(86070),o=n(25710),i=(n(30758),n(55230)),a=n(7871),r=n(92076);function c(e){return(0,s.jsx)("div",{children:e?.rows?.map((e=>(0,s.jsx)("div",{className:"gap-4 flex max-w-full my-10",children:e.map((e=>{if("title"in e)return(0,s.jsx)("div",{className:"flex-1 w-full",children:(0,s.jsx)(l,{...e})});if("content"in e){const t=e.path.split("."),n=t[t.length-1];return(0,s.jsxs)("div",{className:"flex-1 w-full",children:[(0,s.jsxs)(r.A,{to:`https://github.com/metatypedev/metatype/blob/main/${e.path}`,className:"absolute top-0 right-0 m-2 p-1",children:[e.path.split("/").pop()," \u2197"]}),(0,s.jsx)(a.A,{language:n,wrap:!0,children:e.content})]})}return(0,s.jsx)("div",{className:"flex-1 w-full",children:e})}))})))})}function l(e){return(0,s.jsx)(r.A,{to:e.link,style:{textDecoration:"none",color:"inherit"},children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex gap-2 justify-between",children:[(0,s.jsx)(i.A,{as:"h3",className:"inline-block",children:e.title}),(0,s.jsx)("span",{className:`text-right ${{complete:"text-green-500",beta:"text-yellow-500",future:"text-pink-500"}[e.status]}`,children:e.status.toUpperCase()})]}),(0,s.jsx)("div",{children:e.body})]})})}var p=n(65671);const d={sidebar_position:1},u="Features overview",h={id:"concepts/features-overview/index",title:"Features overview",description:"We're taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ticket or better yet discussion boards. Thank you!",source:"@site/docs/concepts/features-overview/index.mdx",sourceDirName:"concepts/features-overview",slug:"/concepts/features-overview/",permalink:"/docs/concepts/features-overview/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/concepts/features-overview/index.mdx",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"docs",previous:{title:"index",permalink:"/docs/reference/metagen/"},next:{title:"Mental model",permalink:"/docs/concepts/mental-model/"}},m={},g=[{value:"Typegate",id:"typegate",level:2},{value:"Typegraph",id:"typegraph",level:2},{value:"Runtimes",id:"runtimes",level:2},{value:"Prisma",id:"prisma",level:3},{value:"Authentication",id:"authentication",level:2},{value:"Tooling",id:"tooling",level:2},{value:"SDKs",id:"sdks",level:2}];function y(e){const t={a:"a",admonition:"admonition",code:"code",div:"div",h1:"h1",h2:"h2",h3:"h3",p:"p",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"features-overview",children:"Features overview"}),"\n",(0,s.jsx)(t.admonition,{title:"Suggestions",type:"info",children:(0,s.jsxs)(t.p,{children:["We're taking any and all kinds of feature requests, suggestions and recommendations. Please direct them kindly to the github ",(0,s.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/issues",children:"ticket"})," or better yet ",(0,s.jsx)(t.a,{href:"https://github.com/metatypedev/metatype/discussions/",children:"discussion"})," boards. Thank you!"]})}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"typegate",children:"Typegate"}),"\n",(0,s.jsx)(c,{rows:[[{title:"GraphQL API",status:"complete",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Expose select functions in your graph through a GraphQL API. These root-functions will serve as the entry point to your graph for any incoming request. The typegraph model is a great fit for GraphQL semantics and this is the best supported way to consume typegraphs."})},{title:"GraphQL Subscriptions",status:"future",link:"https://github.com/metatypedev/metatype/issues/726",body:(0,s.jsx)(s.Fragment,{children:"Get real-time data to clients."})}],[{title:"REST API",status:"complete",link:"/docs/guides/rest",body:(0,s.jsx)(s.Fragment,{children:"You can expose select root functions through a simple REST API. This is handy to serve endpoints for clients that are not GraphQl capable, even though it hampers access to some typegraph features. Inputs will be sourced from either HTTP bodies or search parameters according to HTTP verb."})},{title:"gRPC API",status:"complete",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Expose your gRPC API, enabling high-performance, bi-directional communication between services. This allows you to call gRPC methods directly from the typegraph, providing more flexibility and better integration with existing gRPC-based microservices. This approach supports a broader range of real-time use cases ."})}],[{title:"Cron triggers",status:"future",link:"/docs/reference/typegate",body:(0,s.jsx)(s.Fragment,{children:"Execute functions at certain time intervals. Useful for cleanup jobs."})},(0,s.jsx)(t.div,{})],[{title:"Rate-limiting",status:"complete",link:"/docs/reference/typegate/cors",body:(0,s.jsx)(s.Fragment,{children:"Rate-limit parts of your graph to minimize abuse. The limits can be configured granularly for each function and for custom time windows. Use custom request identifiers, in addition to ip addresses, to track limits counters."})},{title:"CORS",status:"complete",link:"/docs/reference/typegate/cors",body:(0,s.jsx)(s.Fragment,{children:"Specify cross-origin request rules to control which domains can access your API from within a browser. Prevents abuse from websites trying to use your API without permission."})}],[{title:"Single-node",status:"complete",link:"/docs/reference/typegate/synchronization",body:(0,s.jsx)(s.Fragment,{children:"The typegate can be run as a single node mode for simple deployments and using the filesystem as its artifact store. Useful for local development and testing."})},{title:"Multi-node",status:"complete",link:"/docs/reference/typegate/synchronization",body:(0,s.jsx)(s.Fragment,{children:"Deploy multiple instances of the typegate to distribute loads across machines and scale horizontally. You'll only need a Redis compatible key-value cache, an S3 compatible object store, and your favorite load-balancer in front of the instances to get it going. This mode is recommended for production deployments even if only a single node is used."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"typegraph",children:"Typegraph"}),"\n",(0,s.jsx)(c,{rows:[[(0,s.jsx)(p.A,{python:n(84986),typescript:n(24204),disablePlayground:!0})],[{title:"Scalar types",status:"complete",link:"/docs/reference/types#scalar-types",body:(0,s.jsxs)(s.Fragment,{children:["The primitive types ",(0,s.jsx)(t.code,{children:"integer"}),", ",(0,s.jsx)(t.code,{children:"float"}),","," ",(0,s.jsx)(t.code,{children:"boolean"}),", ",(0,s.jsx)(t.code,{children:"string"})," and ",(0,s.jsx)(t.code,{children:"file"}),". All data that flows through a typegraph reduces down to these types."]})},{title:"Type constraints",status:"complete",link:"/docs/reference/types/injections",body:(0,s.jsx)(s.Fragment,{children:"Declare types in your graph that are subset of primitives like string and integers by using regular expressions or min/max limits. Useful to validate incoming data even more and distribute invariants through your app."})}],[{title:"Composite types",status:"complete",link:"/docs/reference/types#scalar-types",body:(0,s.jsxs)(s.Fragment,{children:["Support for ",(0,s.jsx)(t.code,{children:"struct"}),", ",(0,s.jsx)(t.code,{children:"list"}),","," ",(0,s.jsx)(t.code,{children:"union"}),", ",(0,s.jsx)(t.code,{children:"either"})," and ",(0,s.jsx)(t.code,{children:"optional"})," ","types. These allow you to represent types equivalent to most modern type systems."]})},{title:"Injections",status:"complete",link:"/docs/reference/types/injections",body:(0,s.jsx)(s.Fragment,{children:"Injections resolve part of your graph inline instead of from functions or provide defaults for incoming request data. This can be used to set static values or source them from the context, other parts of the graph...etc."})}],[{title:"Functions",status:"complete",link:"/docs/reference/types/functions",body:(0,s.jsxs)(s.Fragment,{children:["Nodes in your typegraph that represent data to be resolved after running some logic on a ",(0,s.jsx)(t.code,{children:"Runtime"}),"."]})},{title:"Function chaining",status:"future",link:"https://github.com/metatypedev/metatype/issues/721",body:(0,s.jsx)(s.Fragment,{children:"Compose functions together by feeding the output of one as the input of another. Encourages code reuse by allowing one to extract common middleware logic from each function, all within the typegraph layer."})}],[{title:(0,s.jsx)(t.code,{children:"reduce"}),status:"complete",link:"/docs/reference/types/parameter-transformations#funcreducetree",body:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.code,{children:"reduce"})," is useful to transform function input types so that only certain struct fields are used, discarding the others. Required fields can be hidden from the user and can instead be injected from the request's context or a static default. This is useful for remixing generated or core domain types to more targeted forms appropriate for a function."]})},{title:(0,s.jsx)(t.code,{children:"apply"}),status:"complete",link:"/docs/reference/types/parameter-transformations#funcapplytree",body:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.code,{children:"apply"})," allows the flattening of deeply nested function input types to something friendlier. Injection can also be used to substitute required fields in the original type from another source."]})}],[{title:"Imports",status:"future",link:"https://github.com/metatypedev/metatype/issues/722",body:(0,s.jsxs)(s.Fragment,{children:["Imports will allow graphs to include nodes from other API descriptions like GraphQL, OpenAPI, gRPC and database schemas. These APIs can then be consumed in a typesafe manner through the"," ",(0,s.jsx)(t.code,{children:"GraphQL"})," and ",(0,s.jsx)(t.code,{children:"Http"})," runtimes."]})},{title:"Secrets",status:"complete",link:"#",body:(0,s.jsx)(s.Fragment,{children:"First-class support for secrets to ease runtime substitution of sensetive values. API keys or dynamic values only discovrable after deployment, this is how you get them into your app."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"runtimes",children:"Runtimes"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Deno runtime",status:"complete",link:"/docs/reference/runtimes/deno",body:(0,s.jsx)(s.Fragment,{children:"Write functions that execute pieces of TypeScript code on a Deno worker. Includes easy access to ESM and libraries through standard Deno features."})}],[(0,s.jsx)(p.A,{python:n(38981),typescript:n(27395),disablePlayground:!0})],[{title:"Python runtime",status:"beta",link:"/docs/reference/runtimes/python",body:(0,s.jsx)(s.Fragment,{children:"Implement functions that execute python functions in code snippets or on disk modules."})}],[(0,s.jsxs)(a.A,{language:"py",children:['from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import PythonRuntime\n\n@typegraph() def example_python(g: Graph): public = Policy.public() python = PythonRuntime()\n\n g.expose(\n public,\n add=t.func(\n t.struct({"a": t.integer(), "b": t.integer()}),\n t.integer(),\n # we can provide the code inline using lambdas\n python.from_lambda(lambda x: x["a"] + x["b"]),\n ),\n sayHello=python.import_(\n t.struct({"name": t.string()}),\n t.string(),\n # point to pythoin a file on disc\n module="hello.py",\n name="say_hello"\n ),\n )\n\n}'," "]})],[{title:"S3 runtime",status:"complete",link:"/docs/reference/runtimes/s3",body:(0,s.jsxs)(s.Fragment,{children:[" Store large blobs in S3 compatible object stores. This includes support for ",(0,s.jsx)(r.A,{to:"/docs/guides/files-upload",children:"GraphQL file uploads"})," and presigned URLs making working with images and large uploads a breeze. "]})},{title:"Temporal runtime",status:"complete",link:"/docs/reference/runtimes/temporal",body:(0,s.jsx)(s.Fragment,{children:" Kick off and query Temporal workflows from a typegraph. Temporal is a durable execution engine that can be used to implement long-running, failure-resistant business processes. "})},{title:"Wasm runtime",status:"beta",link:"/docs/reference/runtimes/wasm",body:(0,s.jsx)(s.Fragment,{children:" Make functions that use WASM components to implement their logic. Write core-wasm or wasi 0.2 based wasm components in languages like Rust, Python and Javascript to power all your custom functions. "})}],[{title:"GraphQL runtime",status:"complete",link:"/docs/reference/runtimes/graphql",body:(0,s.jsx)(s.Fragment,{children:" Include external GraphQL APIs as part of your typegraph. This runtime provides functions that resolve the data by querying an external GraphQL API. "})},{title:"Http runtime",status:"complete",link:"/docs/reference/runtimes/http",body:(0,s.jsx)(s.Fragment,{children:" Include external Http APIs as part of your typegraph. Source the data for your graph using external HTTP requests. "})}],[{title:"Random runtime",status:"complete",link:"/docs/reference/runtimes/random",body:(0,s.jsx)(s.Fragment,{children:" Functions to generate random data based on your types. Useful for quickly throwing together an API and testing. "})},{title:"gRPC runtime",status:"complete",link:"/docs/reference/runtimes/grpc",body:(0,s.jsx)(s.Fragment,{children:" Include external gRPC APIs as part of your typegraph. "})}]]}),"\n",(0,s.jsx)(t.h3,{id:"prisma",children:"Prisma"}),"\n",(0,s.jsx)(t.p,{children:"Access a myriad of databases directly from your typegraph. Run queries, mange it's schema, the full orm featureset."}),"\n",(0,s.jsx)(c,{rows:[[(0,s.jsx)(p.A,{python:n(50864),typescript:n(74518),disablePlayground:!0})],[{title:"Relational schemas",status:"complete",link:"/docs/reference/runtimes/prisma#relationships",body:(0,s.jsx)(s.Fragment,{children:"Use the types in your graph to declare and manage relational schemas to be used on your databse. This means support for primary keys, unique constraints, one-to-one, one-to-many, many-to-many relationships...etc."})},{title:"CRUD queries",status:"complete",link:"/docs/reference/runtimes/prisma#generators",body:(0,s.jsx)(s.Fragment,{children:"Easily generate functions for common create, update, read and delete queries. Includes nested filtering and aggregration paramters for efficent and targeted requests."})},{title:"Raw queries",status:"complete",link:"/docs/reference/runtimes/prisma#raw-query",body:(0,s.jsx)(s.Fragment,{children:"Drop down to raw SQL queries for cases not covered by the CRUD generators. Useful to access unique features native to your database or craft extra efficient queries."})}],[{title:"PostgreSQL support",status:"complete",link:"/docs/reference/runtimes/prisma",body:(0,s.jsx)(s.Fragment,{children:"Support for PostgreSQL, a modern and established DBMS."})},{title:"Beta databases",status:"beta",link:"https://github.com/metatypedev/metatype/issues/724",body:(0,s.jsx)(s.Fragment,{children:"MySQL, MariaDB, AWS Aurora, AWS Aurora Serverless, Microsoft SQL Server, Azure SQL, MongoDB, CockroachDB."})}]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"authentication",children:"Authentication"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Policy-based access control",status:"complete",link:"/docs/reference/policies",body:(0,s.jsx)(s.Fragment,{children:"Policies are simple functions that take the request as input and return values to signal whether it's allowed/denied access. They can be attached to any function in the graph and are evaluated right before the request triggers one. They compose well and are the primary authorization primitive available to typegraphs."})}],[(0,s.jsx)(p.A,{python:n(85775),typescript:n(22481),disablePlayground:!0})],[{title:"Basic authentication",status:"complete",link:"/docs/reference/typegate/authentication#basic-authentication",body:(0,s.jsx)(s.Fragment,{children:"Requests can authenticate themselves using Basic HTTP headers. Simple but useful for getting started or protecting admin only requests."})},(0,s.jsx)(p.A,{python:n(33175),typescript:n(26217),disablePlayground:!0})],[{title:"JWT authentication",status:"complete",link:"/docs/reference/typegate/authentication#jwt-authentication",body:(0,s.jsx)(s.Fragment,{children:"Json Web Tokens can be used to attach more authentication and context information to requests. The data in the tokens can then be used by policies to make authorization decisions."})},(0,s.jsx)(p.A,{python:n(8980),typescript:n(37538),disablePlayground:!0})],[{title:"OAuth2 authorization",status:"complete",link:"/docs/reference/typegate/authentication#oauth2-authorization",body:(0,s.jsx)(s.Fragment,{children:"Use the Oauth2 scheme to implement social-sign in from common identity providers like Github, Meta and Google."})},(0,s.jsx)(p.A,{python:n(42422),typescript:n(23680),disablePlayground:!0})]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"tooling",children:"Tooling"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Meta CLI",status:"complete",link:"/docs/reference/meta-cli",body:(0,s.jsx)(s.Fragment,{children:"Full-featured CLI to aid development and manage typegraph deployments on the typegate. Supports watch mode to aid rapid-iteration, including support for interactive database migration management. Bundles the typegate within it making the CLI all one needs to get started. (And a text editor, of course.)"})}],[(0,s.jsxs)(a.A,{language:"shell",children:["\u276f meta --help at 02:03:36\nDeclarative API development platform. Build backend components with WASM/Typescript/Python, no matter where and how your (legacy) systems are.\n\nUsage: meta [OPTIONS] [COMMAND]\n\nCommands: serialize Serialize the typegraphs defined in the specified python file(s) into JSON dev Push typegraph(s) with development mode features enabled deploy Push typegraph(s) to typegate undeploy Undeploy typegraph(s) from typegate gen Access metagen generators upgrade Upgrade completion Generate shell completion doctor Troubleshoot the installation new Create a new Metatype project typegate Access a minimal deno CLI help Print this message or the help of the given subcommand(s)\n\nOptions: --version -v, --verbose... Increase logging verbosity -q, --quiet... Decrease logging verbosity -C, --dir [default: .] --config path to the config file -h, --help Print help "," "]})],[{title:"Metagen",status:"beta",link:"#",body:(0,s.jsxs)(s.Fragment,{children:[" Code generation suite that supports Rust, Python and Typescript. Generate types from your graph and other helper functions for authoring custom functions for the Wasm, Python and Deno runtimes respectively. Can be accessed through the CLI under the ",(0,s.jsx)(t.code,{children:"gen"})," subcommand or through the different SDKs. "]})},{title:"Meta LSP",status:"beta",body:(0,s.jsx)(s.Fragment,{children:" Extension for your IDE to help authoring of typegraphs. Supports VSCode as of now. "})},(0,s.jsx)(t.div,{})],[{title:"Docker images",status:"complete",link:"https://github.com/orgs/metatypedev/packages/container/package/typegate",body:(0,s.jsxs)(s.Fragment,{children:[" The typegate is primarily distributed as a docker image for deployment as a container. All the available configuration environment variables can be found ",(0,s.jsx)(r.A,{to:"http://localhost:3000/docs/reference/typegate#environment-variables",children:"here"}),". "]})},{title:"Helm charts",status:"complete",link:"/docs/guides/self-hosting",body:(0,s.jsx)(s.Fragment,{children:" Helm charts are published to ease installation of a typegate deployment in your Kubernetes cluster. "})}],[(0,s.jsxs)(a.A,{language:"shell",children:[" ","docker run --rm --pull always \\ -p 7890:7890 \\ -e TG_SECRET=$(openssl rand -base64 64 | tr -d '\\n') \\ -e TG_ADMIN_PASSWORD=\"password\" \\ ghcr.io/metatypedev/typegate:latest"," "]})]]}),"\n",(0,s.jsx)("br",{}),"\n",(0,s.jsx)(t.h2,{id:"sdks",children:"SDKs"}),"\n",(0,s.jsx)(c,{rows:[[{title:"Typescript SDK",status:"complete",link:"https://www.npmjs.com/package/@typegraph/sdk",body:(0,s.jsx)(s.Fragment,{children:"Use typescript to author typegraphs and access other SDK tooling. Supports Node and compatible runtimes like Deno and Bun."})},{title:"Python SDK",status:"complete",link:"http://localhost:3000/docs/reference/typegate#environment-variables",body:(0,s.jsx)(s.Fragment,{children:"Use Python to author typegraphs and access other SDK tooling."})},{title:"Dart SDK",status:"future",link:"https://www.npmjs.com/package/@typegraph/sdk",body:(0,s.jsx)(s.Fragment,{children:"Use Dart to author typegraphs and access other SDK tooling."})}],[{title:"Deployments",status:"complete",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Programmatically upload your typegraphs to the typegate from within the SDK. Useful for writing tests or building on top of the Metatype platform."})},{title:"Migrations",status:"beta",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Programmaticaly manage necessary migrations returned by the Prisma runtime. Useful for writing tests or building on top of the Metatype platform."})}],[{title:"Codegen",status:"beta",link:"/docs/guides/programmatic-deployment",body:(0,s.jsx)(s.Fragment,{children:"Access metagen through the SDK directly to generate type declarations and other helpful code. Useful for testing and to build custom workflows/tooling."})},(0,s.jsx)(t.div,{})]]})]})}function f(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(y,{...e})}):y(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var s=n(98302),o=(n(30758),n(86070));function i(e){let{python:t,typescript:n,rust:i,...a}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,o.jsx)(s.A,{code:0==r.length?void 0:r,...a})}},33175:e=>{e.exports={content:'@typegraph(\n)\ndef basic_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"username": t.string().optional()})\n\n # highlight-next-line\n g.auth(Auth.basic(["admin"]))\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/basic.py"}},26217:e=>{e.exports={content:'await typegraph(\n {\n name: "basic-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n username: t.string().optional(),\n });\n\n // highlight-next-line\n g.auth(Auth.basic(["admin"]));\n\n g.expose({\n get_context: deno\n .identity(ctx)\n .apply({\n username: g.fromContext("username"),\n })\n .withPolicy(pub),\n });\n },\n);',path:"../examples/typegraphs/basic.ts"}},50864:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.providers.prisma import PrismaRuntime\n\n\n@typegraph(\n)\ndef database(g: Graph):\n db = PrismaRuntime("database", "POSTGRES_CONN")\n public = Policy.public()\n\n message = t.struct(\n {\n # highlight-next-line\n "id": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n # highlight-next-line\n name="message",\n )\n\n g.expose(\n public,\n # highlight-next-line\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/database.py"}},74518:e=>{e.exports={content:'// highlight-next-line\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\nawait typegraph(\n {\n name: "database",\n },\n (g) => {\n const db = new PrismaRuntime("database", "POSTGRES_CONN");\n const pub = Policy.public();\n\n const message = t.struct(\n {\n // highlight-next-line\n id: t.integer({}, { asId: true, config: { auto: true } }),\n title: t.string(),\n body: t.string(),\n },\n // highlight-next-line\n { name: "message" },\n );\n\n g.expose(\n {\n // highlight-next-line\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/database.ts"}},38981:e=>{e.exports={content:'@typegraph(\n)\ndef deno(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n fib = deno.func(\n t.struct({"n": t.float()}),\n t.struct({"res": t.integer(), "ms": t.float()}),\n code="""\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n """,\n )\n\n g.expose(\n public,\n compute_fib=fib,\n )',path:"../examples/typegraphs/deno.py"}},27395:e=>{e.exports={content:'await typegraph(\n {\n name: "deno",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const fib = deno.func(\n t.struct({ n: t.float() }),\n t.struct({ res: t.integer(), ms: t.float() }),\n {\n code: `\n ({ n }) => {\n let a = 0, b = 1, c;\n const start = performance.now();\n for (\n let i = 0;\n i < Math.min(n, 10);\n c = a + b, a = b, b = c, i += 1\n );\n return {\n res: b,\n ms: performance.now() - start,\n };\n }\n `,\n },\n );\n\n g.expose(\n {\n compute_fib: fib,\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/deno.ts"}},84986:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes import RandomRuntime\n\n\n@typegraph(\n)\ndef first_typegraph(g: Graph):\n # declare runtimes and policies\n random = RandomRuntime(reset=None)\n public = Policy.public()\n\n # declare types\n message = t.struct(\n {\n "id": t.integer(),\n "title": t.string(),\n "user_id": t.integer(),\n }\n )\n\n # expose them with policies\n g.expose(\n public,\n # input \u2192 output via runtime function\n get_message=random.gen(message),\n )',path:"../examples/typegraphs/first-typegraph.py"}},24204:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\nawait typegraph(\n {\n name: "first-typegraph",\n },\n (g) => {\n // declare runtimes and policies\n const random = new RandomRuntime({});\n const pub = Policy.public();\n\n // declare types\n const message = t.struct({\n id: t.integer(),\n title: t.string(),\n user_id: t.integer(),\n });\n\n // expose them with policies\n g.expose(\n {\n // input \u2192 output via runtime function\n get_message: random.gen(message),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/first-typegraph.ts"}},8980:e=>{e.exports={content:'@typegraph(\n)\ndef jwt_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"your_own_content": t.string().optional()})\n # highlight-next-line\n g.auth(Auth.hmac256("custom"))\n\n g.expose(\n get_context=deno.identity(ctx).apply(\n {\n "your_own_content": g.from_context("your_own_content"),\n }\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/jwt.py"}},37538:e=>{e.exports={content:'typegraph(\n {\n name: "jwt-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({\n your_own_content: t.string().optional(),\n });\n // highlight-next-line\n g.auth(Auth.hmac256("custom"));\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n your_own_content: g.fromContext("your_own_content"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/jwt.ts"}},42422:e=>{e.exports={content:'@typegraph(\n)\ndef oauth2_authentication(g: Graph):\n deno = DenoRuntime()\n public = Policy.public()\n\n ctx = t.struct({"exp": t.integer().optional()})\n\n # highlight-start\n g.auth(Auth.oauth2_github("openid profile email"))\n # highlight-end\n\n g.expose(\n public,\n get_context=deno.identity(ctx).apply(\n {\n "exp": g.from_context("exp"),\n }\n ),\n )',path:"../examples/typegraphs/oauth2.py"}},23680:e=>{e.exports={content:'typegraph(\n {\n name: "oauth2-authentication",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const ctx = t.struct({ exp: t.integer().optional() });\n\n // highlight-start\n g.auth(Auth.oauth2Github("openid profile email"));\n // highlight-end\n\n g.expose(\n {\n get_context: deno.identity(ctx).apply({\n exp: g.fromContext("exp"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/oauth2.ts"}},85775:e=>{e.exports={content:'deno = DenoRuntime()\nrandom = RandomRuntime(seed=0, reset=None)\n\n# `public` is sugar for to `() => true`\npublic = Policy.public()\n\nadmin_only = deno.policy(\n "admin_only",\n # note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n)\nuser_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n)\n\ng.auth(Auth.basic(["admin", "user"]))\n\ng.expose(\n # set default policy for the exposed functions\n Policy.public(),\n public=random.gen(t.string()).with_policy(public),\n admin_only=random.gen(t.string()).with_policy(admin_only),\n user_only=random.gen(t.string()).with_policy(user_only),\n # if both policies return null, access is denied\n both=random.gen(t.string()).with_policy(user_only, admin_only),\n)',path:"../examples/typegraphs/policies.py"}},22481:e=>{e.exports={content:'const deno = new DenoRuntime();\nconst random = new RandomRuntime({ seed: 0 });\n// `public` is sugar for `(_args, _ctx) => true`\nconst pub = Policy.public();\n\nconst admin_only = deno.policy(\n "admin_only",\n // note: policies either return true | false | null\n "(args, { context }) => context.username ? context.username === \'admin\' : null",\n);\nconst user_only = deno.policy(\n "user_only",\n "(args, { context }) => context.username ? context.username === \'user\' : null",\n);\n\ng.auth(Auth.basic(["admin", "user"]));\n\ng.expose(\n {\n public: random.gen(t.string()).withPolicy(pub),\n admin_only: random.gen(t.string()).withPolicy(admin_only),\n user_only: random.gen(t.string()).withPolicy(user_only),\n // if both attached policies return null, access is denied\n both: random.gen(t.string()).withPolicy([user_only, admin_only]),\n // set default policy for the exposed functions\n },\n pub,\n);',path:"../examples/typegraphs/policies.ts"}}}]); \ No newline at end of file diff --git a/assets/js/929c1f2b.12bc4f51.js b/assets/js/929c1f2b.bcd46599.js similarity index 98% rename from assets/js/929c1f2b.12bc4f51.js rename to assets/js/929c1f2b.bcd46599.js index 99612b55f7..ea09a44b9e 100644 --- a/assets/js/929c1f2b.12bc4f51.js +++ b/assets/js/929c1f2b.bcd46599.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[619],{68642:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var t=i(86070),s=i(25710),a=i(65671);i(7871);const r={},d="Prisma",l={id:"reference/runtimes/prisma/index",title:"Prisma",description:"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:",source:"@site/docs/reference/runtimes/prisma/index.mdx",sourceDirName:"reference/runtimes/prisma",slug:"/reference/runtimes/prisma/",permalink:"/docs/reference/runtimes/prisma/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/prisma/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Kv",permalink:"/docs/reference/runtimes/kv/"},next:{title:"Python",permalink:"/docs/reference/runtimes/python/"}},o={},c=[{value:"Prisma runtime",id:"prisma-runtime",level:2},{value:"Usage",id:"usage",level:2},{value:"Raw query",id:"raw-query",level:3},{value:"Models",id:"models",level:2},{value:"Relationships",id:"relationships",level:2},{value:"One-to-one relationships",id:"one-to-one-relationships",level:3},{value:"One-to-many relationships",id:"one-to-many-relationships",level:3},{value:"Many-to-many relationships",id:"many-to-many-relationships",level:3},{value:"Link",id:"link",level:3},{value:"Generators",id:"generators",level:2},{value:"Dealing with migrations",id:"dealing-with-migrations",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"prisma",children:"Prisma"}),"\n",(0,t.jsx)(n.p,{children:"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"PostgreSQL"}),"\n",(0,t.jsx)(n.li,{children:"MySQL"}),"\n",(0,t.jsx)(n.li,{children:"MariaDB"}),"\n",(0,t.jsx)(n.li,{children:"SQLite (however, SQLite is unlikely to be used with Metatype as it cannot be distributed easily)"}),"\n",(0,t.jsx)(n.li,{children:"AWS Aurora"}),"\n",(0,t.jsx)(n.li,{children:"AWS Aurora Serverless"}),"\n",(0,t.jsx)(n.li,{children:"Microsoft SQL Server"}),"\n",(0,t.jsx)(n.li,{children:"Azure SQL"}),"\n",(0,t.jsx)(n.li,{children:"MongoDB"}),"\n",(0,t.jsx)(n.li,{children:"CockroachDB"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The exact supported version can be found on their ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/database-reference/supported-databases",children:"documentation"}),". Some databases may not have some specific behaviors and features support. The precise details are also available in ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/database-reference/database-features",children:"this page"}),"."]}),"\n",(0,t.jsx)(n.h1,{id:"your-first-api",children:"Your first API"}),"\n",(0,t.jsx)(n.p,{children:"Getting random data is great, but having some input variables and meaningful output is even better. The random runtime is usually used to quickly draft and iterate on an API prototype. Once the interface feels efficient and well-designed, it's time to move another runtime backed by some storage."}),"\n",(0,t.jsx)(n.admonition,{title:"Please share your feedback",type:"tip",children:(0,t.jsxs)(n.p,{children:['You can raise issues, suggest improvements, ask questions and share your feedback using comments below \u2193, using private messages with the "Help, Feedback & Roadmap" button on the right \u2192 or directly using the ',(0,t.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/discussions",children:"GitHub discussions"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"prisma-runtime",children:"Prisma runtime"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.prisma.io/",children:"Prisma"}),' is a "Next-generation Node.js and Typescript ORM" supporting PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, CockroachDB and Microsoft SQL Server. It is one of the main runtimes provided by Metatype and doesn\'t require any additional installation.']}),"\n",(0,t.jsxs)(n.p,{children:["Go ahead and update ",(0,t.jsx)(n.code,{children:"typegraph.py"})," with the highlighted lines below:"]}),"\n",(0,t.jsx)(a.A,{typegraph:"database",python:i(50864),typescript:i(74518),query:i(75528)}),"\n",(0,t.jsx)(n.p,{children:"A few things to note on the changes:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["You can import runtimes from ",(0,t.jsx)(n.code,{children:"typegraph.runtime.Y"})," or ",(0,t.jsx)(n.code,{children:"typegraph.providers.X.runtimes.Y"})," for non-core providers."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"config"})," method allows specifying runtime specific attributes. In this case, ",(0,t.jsx)(n.code,{children:"id"})," shall be automatically set and incremented by the database."]}),"\n",(0,t.jsx)(n.li,{children:"Types get generated names unless you manually specify them. You can find the exact names in the playground documentation. Here you want to have a human friendly name as it will also be the name of the table in your database."}),"\n",(0,t.jsx)(n.li,{children:"Runtimes often come with some sugar syntax to generate types and avoid manipulating functions directly. A corresponding declaration would have looked like this:"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["In order to use the Prisma runtime, you need to add a new environment variable. Runtimes don't take raw secrets, but instead a secret key used to look up environment variables named under the format ",(0,t.jsx)(n.code,{children:"TG_[typegraph name]_[key]"}),". You can either add it in your ",(0,t.jsx)(n.code,{children:"metatype.yml"})," (recommended) or in your ",(0,t.jsx)(n.code,{children:"compose.yml"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"$ cat metatype.yml\ntypegates:\n dev:\n # ..\n secrets:\n database\n# highlight-next-line\n POSTGRES_CONN: postgresql://postgres:password@postgres:5432/db\n\n$ meta dev\n"})}),"\n",(0,t.jsx)(n.p,{children:"And now, you can iteratively continue to improve your interface, running migrations and having data stored inside your database."}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'with TypeGraph("prisma-runtime-example") as g:\n db = PrismaRuntime("main_db", "DB_CONNECTION")\n\n user = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email(),\n }\n )\n\n g.expose(\n createUser=db.create(user).add_policy(public)\n )\n'})}),"\n",(0,t.jsx)(n.h3,{id:"raw-query",children:"Raw query"}),"\n",(0,t.jsx)(n.p,{children:"Generate a raw SQL query operation on the runtime"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'db = PrismaRuntime("my-app", "POSTGRES")\ng.expose(\n countUsers=db.raw_query(\n "SELECT COUNT(*) as total FROM User",\n t.struct({}),\n t.list(t.struct({"total": t.integer()}))\n )\n)\n'})}),"\n",(0,t.jsx)(n.p,{children:"Generate a raw SQL query operation without return"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'db = PrismaRuntime("my-app", "POSTGRES")\ng.expose(\n setActive=db.raw_execute(\n "UPDATE User SET active = TRUE WHERE id=${id}",\n t.struct({"id": t.uuid()}),\n effect=effects.update()\n ),\n)\n'})}),"\n",(0,t.jsx)(n.h2,{id:"models",children:"Models"}),"\n",(0,t.jsxs)(n.p,{children:["Any ",(0,t.jsx)(n.code,{children:"t.struct"})," that is passed to a generator of a ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," defines a model. Models must have an ID field specified by the ",(0,t.jsx)(n.code,{children:'"id"'})," config."]}),"\n",(0,t.jsx)(n.p,{children:"Here is the list of all the available configs for model fields:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Config"}),(0,t.jsx)(n.th,{children:"Effect"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"id"})}),(0,t.jsx)(n.td,{children:"defines the field ID for the model (a.k.a. primary key)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"auto"})}),(0,t.jsxs)(n.td,{children:["the value of this field can be auto generated; supported for ",(0,t.jsx)(n.code,{children:"t.integer()"})," (auto-increment) and ",(0,t.jsx)(n.code,{children:"t.uuid()"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"unique"})}),(0,t.jsx)(n.td,{children:"make this field unique among all instances of the model"})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"relationships",children:"Relationships"}),"\n",(0,t.jsxs)(n.p,{children:["Relationship fields must be defined on both sides of the relationship. A relationship is always defined for ",(0,t.jsx)(n.code,{children:"t.struct"})," types and ",(0,t.jsx)(n.code,{children:"t.optional"})," or ",(0,t.jsx)(n.code,{children:"t.list"})," of ",(0,t.jsx)(n.code,{children:"t.struct"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Relationships can also be defined implicitly using the ",(0,t.jsx)(n.a,{href:"#link",children:(0,t.jsx)(n.code,{children:"link"})})," instance method of ",(0,t.jsx)(n.code,{children:"PrismaRuntime"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'runtime = PrismaRuntime("example", "POSTGRES")\n\nuser = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email().config("unique"),\n "posts": t.list(g("Post")),\n }\n).named("User")\n\npost = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "title": t.string(),\n "author": g("User"),\n }\n).named("Post")\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," supports two kinds of relationship between models."]}),"\n",(0,t.jsx)(n.h3,{id:"one-to-one-relationships",children:"One-to-one relationships"}),"\n",(0,t.jsx)(n.p,{children:"A one-to-one relationship must be in one of these two variants."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Cardinality"}),(0,t.jsx)(n.th,{children:"Field type in Model1"}),(0,t.jsx)(n.th,{children:"Field type in Model2"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"1..1 \u2194 0..1"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2")'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model1").optional()'})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"0..1 \u2194 0..1"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2").optional()'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model1").optional()'})})]})]})]}),"\n",(0,t.jsx)(n.p,{children:"For the optional (0..1 \u2194 0..1) one-to-one relationship, you need to indicate on which field/model the foreign key will be by:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["wrapping the type in a ",(0,t.jsx)(n.a,{href:"#link",children:(0,t.jsx)(n.code,{children:"runtime.link(.)"})})," with ",(0,t.jsx)(n.code,{children:"fkey=True"}),": ",(0,t.jsx)(n.code,{children:'runtime.link(g("Model2").optional(), fkey=True)'}),";",(0,t.jsx)("br",{})]}),"\n",(0,t.jsxs)(n.li,{children:["or adding ",(0,t.jsx)(n.code,{children:'.config("unique")'}),": ",(0,t.jsx)(n.code,{children:'g("Model2").optional().config("unique")'}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"one-to-many-relationships",children:"One-to-many relationships"}),"\n",(0,t.jsx)(n.p,{children:"A one-to-many relationship must be in one of these two variants."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Cardinality"}),(0,t.jsx)(n.th,{children:"Field type in Model1"}),(0,t.jsx)(n.th,{children:"Field type in Model2"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"1..1 \u2194 0..n"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2")'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'t.list(g("Model1"))'})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"0..1 \u2194 0..n"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2").optional()'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'t.list(g("Model1"))'})})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"many-to-many-relationships",children:"Many-to-many relationships"}),"\n",(0,t.jsx)(n.p,{children:"Many-to-many relationships must be modelled explicitly using a join model."}),"\n",(0,t.jsx)(n.h3,{id:"link",children:"Link"}),"\n",(0,t.jsxs)(n.p,{children:["Explicitly declare a relationship between models. The return value of this function shall be the type of a property of a ",(0,t.jsx)(n.code,{children:"t.struct"})," that defines a model. If the other end of the relationship is also defined using ",(0,t.jsx)(n.code,{children:"link"}),", both links must have the same name."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'runtime = PrismaRuntime("example", "POSTGRES")\n\nuser = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email().config("unique"),\n "posts": runtime.link(t.list(g("Post")), "postAuthor"),\n }\n).named("User")\n\npost = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "title": t.string(),\n "author": runtime.link(g("User"), "postAuthor"),\n }\n).named("Post")\n'})}),"\n",(0,t.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,t.jsxs)(n.p,{children:["Generators are instance methods of ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," that can be used to generate a ",(0,t.jsx)(n.code,{children:"t.func"})," that represents a specific operation on a specific model of the runtime. They match to the model queries defined for the ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/api-reference/prisma-client-reference",children:"prisma client API"}),". for the type of the input ",(0,t.jsx)(n.code,{children:"t.struct"})," and the return type."]}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'with TypeGraph("prisma-runtime-example") as g:\n db = PrismaRuntime("main_db", "DB_CONNECTION")\n\n user = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email(),\n }\n )\n\n g.expose(\n createUser=db.create(user).add_policy(public),\n findUser=db.find(user).add_policy(public),\n findManyUsers=db.find_many(user).add_policy(public),\n )\n'})}),"\n",(0,t.jsx)(n.p,{children:"Here is a list of all available generators:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_unique"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_first"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_many"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"create"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"update"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"upsert"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"delete"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"delete_many"})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"dealing-with-migrations",children:"Dealing with migrations"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.prisma.io/dataguide/types/relational/what-are-database-migrations",children:"Migrations"})," are basically blueprints that ensure that your local database and remote database both have the same schema. Migration files are generated as modifications are made in your typegraph as you deploy."]}),"\n",(0,t.jsx)(n.p,{children:"meta cli offers various ways to deal with failing migrations. In general, you will be required manually edit the SQL changes that made your migration fails, most of the time failing migrations are related to columns/tables that were removed, renamed or added."}),"\n",(0,t.jsxs)(n.p,{children:["However, if you wish to ignore failing migrations (eg. in a testing environment), you can use the ",(0,t.jsx)(n.code,{children:"--run-destructive-migrations"})," flag, it will reset your database schema."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>a});var t=i(98302),s=(i(30758),i(86070));function a(e){let{python:n,typescript:i,rust:a,...r}=e;const d=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(t.A,{code:0==d.length?void 0:d,...r})}},75528:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"A"},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:"Hello World",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"body"},value:{kind:"StringValue",value:"This is a message",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_messages"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"equals"},value:{kind:"StringValue",value:"Hello World",block:!1}}]}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:251}};n.loc.source={body:'mutation A {\n create_message(\n data: {\n # id is autogenerated\n title: "Hello World"\n body: "This is a message"\n }\n ) {\n id\n }\n}\n\nquery B {\n list_messages(where: { title: { equals: "Hello World" } }) {\n id\n body\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function s(e,n){for(var i=0;i0;){var l=d;d=new Set,l.forEach((function(e){r.has(e)||(r.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return r.forEach((function(n){var t=s(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=a(n,"A"),e.exports.B=a(n,"B")},50864:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.providers.prisma import PrismaRuntime\n\n\n@typegraph(\n)\ndef database(g: Graph):\n db = PrismaRuntime("database", "POSTGRES_CONN")\n public = Policy.public()\n\n message = t.struct(\n {\n # highlight-next-line\n "id": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n # highlight-next-line\n name="message",\n )\n\n g.expose(\n public,\n # highlight-next-line\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/database.py"}},74518:e=>{e.exports={content:'// highlight-next-line\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\nawait typegraph(\n {\n name: "database",\n },\n (g) => {\n const db = new PrismaRuntime("database", "POSTGRES_CONN");\n const pub = Policy.public();\n\n const message = t.struct(\n {\n // highlight-next-line\n id: t.integer({}, { asId: true, config: { auto: true } }),\n title: t.string(),\n body: t.string(),\n },\n // highlight-next-line\n { name: "message" }\n );\n\n g.expose(\n {\n // highlight-next-line\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/database.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[619],{68642:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>u,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var t=i(86070),s=i(25710),a=i(65671);i(7871);const r={},d="Prisma",l={id:"reference/runtimes/prisma/index",title:"Prisma",description:"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:",source:"@site/docs/reference/runtimes/prisma/index.mdx",sourceDirName:"reference/runtimes/prisma",slug:"/reference/runtimes/prisma/",permalink:"/docs/reference/runtimes/prisma/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/prisma/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Kv",permalink:"/docs/reference/runtimes/kv/"},next:{title:"Python",permalink:"/docs/reference/runtimes/python/"}},o={},c=[{value:"Prisma runtime",id:"prisma-runtime",level:2},{value:"Usage",id:"usage",level:2},{value:"Raw query",id:"raw-query",level:3},{value:"Models",id:"models",level:2},{value:"Relationships",id:"relationships",level:2},{value:"One-to-one relationships",id:"one-to-one-relationships",level:3},{value:"One-to-many relationships",id:"one-to-many-relationships",level:3},{value:"Many-to-many relationships",id:"many-to-many-relationships",level:3},{value:"Link",id:"link",level:3},{value:"Generators",id:"generators",level:2},{value:"Dealing with migrations",id:"dealing-with-migrations",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"prisma",children:"Prisma"}),"\n",(0,t.jsx)(n.p,{children:"Prisma is a database ORM runtime that enables to query many different databases. It enables to create, read, update and delete data with a developer-friendly API. This runtime is included within the typegate and is compatible with the following databases:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"PostgreSQL"}),"\n",(0,t.jsx)(n.li,{children:"MySQL"}),"\n",(0,t.jsx)(n.li,{children:"MariaDB"}),"\n",(0,t.jsx)(n.li,{children:"SQLite (however, SQLite is unlikely to be used with Metatype as it cannot be distributed easily)"}),"\n",(0,t.jsx)(n.li,{children:"AWS Aurora"}),"\n",(0,t.jsx)(n.li,{children:"AWS Aurora Serverless"}),"\n",(0,t.jsx)(n.li,{children:"Microsoft SQL Server"}),"\n",(0,t.jsx)(n.li,{children:"Azure SQL"}),"\n",(0,t.jsx)(n.li,{children:"MongoDB"}),"\n",(0,t.jsx)(n.li,{children:"CockroachDB"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["The exact supported version can be found on their ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/database-reference/supported-databases",children:"documentation"}),". Some databases may not have some specific behaviors and features support. The precise details are also available in ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/database-reference/database-features",children:"this page"}),"."]}),"\n",(0,t.jsx)(n.h1,{id:"your-first-api",children:"Your first API"}),"\n",(0,t.jsx)(n.p,{children:"Getting random data is great, but having some input variables and meaningful output is even better. The random runtime is usually used to quickly draft and iterate on an API prototype. Once the interface feels efficient and well-designed, it's time to move another runtime backed by some storage."}),"\n",(0,t.jsx)(n.admonition,{title:"Please share your feedback",type:"tip",children:(0,t.jsxs)(n.p,{children:['You can raise issues, suggest improvements, ask questions and share your feedback using comments below \u2193, using private messages with the "Help, Feedback & Roadmap" button on the right \u2192 or directly using the ',(0,t.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/discussions",children:"GitHub discussions"}),"."]})}),"\n",(0,t.jsx)(n.h2,{id:"prisma-runtime",children:"Prisma runtime"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.prisma.io/",children:"Prisma"}),' is a "Next-generation Node.js and Typescript ORM" supporting PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, CockroachDB and Microsoft SQL Server. It is one of the main runtimes provided by Metatype and doesn\'t require any additional installation.']}),"\n",(0,t.jsxs)(n.p,{children:["Go ahead and update ",(0,t.jsx)(n.code,{children:"typegraph.py"})," with the highlighted lines below:"]}),"\n",(0,t.jsx)(a.A,{typegraph:"database",python:i(50864),typescript:i(74518),query:i(75528)}),"\n",(0,t.jsx)(n.p,{children:"A few things to note on the changes:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["You can import runtimes from ",(0,t.jsx)(n.code,{children:"typegraph.runtime.Y"})," or ",(0,t.jsx)(n.code,{children:"typegraph.providers.X.runtimes.Y"})," for non-core providers."]}),"\n",(0,t.jsxs)(n.li,{children:["The ",(0,t.jsx)(n.code,{children:"config"})," method allows specifying runtime specific attributes. In this case, ",(0,t.jsx)(n.code,{children:"id"})," shall be automatically set and incremented by the database."]}),"\n",(0,t.jsx)(n.li,{children:"Types get generated names unless you manually specify them. You can find the exact names in the playground documentation. Here you want to have a human friendly name as it will also be the name of the table in your database."}),"\n",(0,t.jsx)(n.li,{children:"Runtimes often come with some sugar syntax to generate types and avoid manipulating functions directly. A corresponding declaration would have looked like this:"}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:["In order to use the Prisma runtime, you need to add a new environment variable. Runtimes don't take raw secrets, but instead a secret key used to look up environment variables named under the format ",(0,t.jsx)(n.code,{children:"TG_[typegraph name]_[key]"}),". You can either add it in your ",(0,t.jsx)(n.code,{children:"metatype.yml"})," (recommended) or in your ",(0,t.jsx)(n.code,{children:"compose.yml"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"$ cat metatype.yml\ntypegates:\n dev:\n # ..\n secrets:\n database\n# highlight-next-line\n POSTGRES_CONN: postgresql://postgres:password@postgres:5432/db\n\n$ meta dev\n"})}),"\n",(0,t.jsx)(n.p,{children:"And now, you can iteratively continue to improve your interface, running migrations and having data stored inside your database."}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'with TypeGraph("prisma-runtime-example") as g:\n db = PrismaRuntime("main_db", "DB_CONNECTION")\n\n user = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email(),\n }\n )\n\n g.expose(\n createUser=db.create(user).add_policy(public)\n )\n'})}),"\n",(0,t.jsx)(n.h3,{id:"raw-query",children:"Raw query"}),"\n",(0,t.jsx)(n.p,{children:"Generate a raw SQL query operation on the runtime"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'db = PrismaRuntime("my-app", "POSTGRES")\ng.expose(\n countUsers=db.raw_query(\n "SELECT COUNT(*) as total FROM User",\n t.struct({}),\n t.list(t.struct({"total": t.integer()}))\n )\n)\n'})}),"\n",(0,t.jsx)(n.p,{children:"Generate a raw SQL query operation without return"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'db = PrismaRuntime("my-app", "POSTGRES")\ng.expose(\n setActive=db.raw_execute(\n "UPDATE User SET active = TRUE WHERE id=${id}",\n t.struct({"id": t.uuid()}),\n effect=effects.update()\n ),\n)\n'})}),"\n",(0,t.jsx)(n.h2,{id:"models",children:"Models"}),"\n",(0,t.jsxs)(n.p,{children:["Any ",(0,t.jsx)(n.code,{children:"t.struct"})," that is passed to a generator of a ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," defines a model. Models must have an ID field specified by the ",(0,t.jsx)(n.code,{children:'"id"'})," config."]}),"\n",(0,t.jsx)(n.p,{children:"Here is the list of all the available configs for model fields:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Config"}),(0,t.jsx)(n.th,{children:"Effect"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"id"})}),(0,t.jsx)(n.td,{children:"defines the field ID for the model (a.k.a. primary key)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"auto"})}),(0,t.jsxs)(n.td,{children:["the value of this field can be auto generated; supported for ",(0,t.jsx)(n.code,{children:"t.integer()"})," (auto-increment) and ",(0,t.jsx)(n.code,{children:"t.uuid()"})]})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"unique"})}),(0,t.jsx)(n.td,{children:"make this field unique among all instances of the model"})]})]})]}),"\n",(0,t.jsx)(n.h2,{id:"relationships",children:"Relationships"}),"\n",(0,t.jsxs)(n.p,{children:["Relationship fields must be defined on both sides of the relationship. A relationship is always defined for ",(0,t.jsx)(n.code,{children:"t.struct"})," types and ",(0,t.jsx)(n.code,{children:"t.optional"})," or ",(0,t.jsx)(n.code,{children:"t.list"})," of ",(0,t.jsx)(n.code,{children:"t.struct"}),"."]}),"\n",(0,t.jsxs)(n.p,{children:["Relationships can also be defined implicitly using the ",(0,t.jsx)(n.a,{href:"#link",children:(0,t.jsx)(n.code,{children:"link"})})," instance method of ",(0,t.jsx)(n.code,{children:"PrismaRuntime"}),"."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'runtime = PrismaRuntime("example", "POSTGRES")\n\nuser = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email().config("unique"),\n "posts": t.list(g("Post")),\n }\n).named("User")\n\npost = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "title": t.string(),\n "author": g("User"),\n }\n).named("Post")\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," supports two kinds of relationship between models."]}),"\n",(0,t.jsx)(n.h3,{id:"one-to-one-relationships",children:"One-to-one relationships"}),"\n",(0,t.jsx)(n.p,{children:"A one-to-one relationship must be in one of these two variants."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Cardinality"}),(0,t.jsx)(n.th,{children:"Field type in Model1"}),(0,t.jsx)(n.th,{children:"Field type in Model2"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"1..1 \u2194 0..1"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2")'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model1").optional()'})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"0..1 \u2194 0..1"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2").optional()'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model1").optional()'})})]})]})]}),"\n",(0,t.jsx)(n.p,{children:"For the optional (0..1 \u2194 0..1) one-to-one relationship, you need to indicate on which field/model the foreign key will be by:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["wrapping the type in a ",(0,t.jsx)(n.a,{href:"#link",children:(0,t.jsx)(n.code,{children:"runtime.link(.)"})})," with ",(0,t.jsx)(n.code,{children:"fkey=True"}),": ",(0,t.jsx)(n.code,{children:'runtime.link(g("Model2").optional(), fkey=True)'}),";",(0,t.jsx)("br",{})]}),"\n",(0,t.jsxs)(n.li,{children:["or adding ",(0,t.jsx)(n.code,{children:'.config("unique")'}),": ",(0,t.jsx)(n.code,{children:'g("Model2").optional().config("unique")'}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"one-to-many-relationships",children:"One-to-many relationships"}),"\n",(0,t.jsx)(n.p,{children:"A one-to-many relationship must be in one of these two variants."}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Cardinality"}),(0,t.jsx)(n.th,{children:"Field type in Model1"}),(0,t.jsx)(n.th,{children:"Field type in Model2"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"1..1 \u2194 0..n"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2")'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'t.list(g("Model1"))'})})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:"0..1 \u2194 0..n"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'g("Model2").optional()'})}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:'t.list(g("Model1"))'})})]})]})]}),"\n",(0,t.jsx)(n.h3,{id:"many-to-many-relationships",children:"Many-to-many relationships"}),"\n",(0,t.jsx)(n.p,{children:"Many-to-many relationships must be modelled explicitly using a join model."}),"\n",(0,t.jsx)(n.h3,{id:"link",children:"Link"}),"\n",(0,t.jsxs)(n.p,{children:["Explicitly declare a relationship between models. The return value of this function shall be the type of a property of a ",(0,t.jsx)(n.code,{children:"t.struct"})," that defines a model. If the other end of the relationship is also defined using ",(0,t.jsx)(n.code,{children:"link"}),", both links must have the same name."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'runtime = PrismaRuntime("example", "POSTGRES")\n\nuser = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email().config("unique"),\n "posts": runtime.link(t.list(g("Post")), "postAuthor"),\n }\n).named("User")\n\npost = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "title": t.string(),\n "author": runtime.link(g("User"), "postAuthor"),\n }\n).named("Post")\n'})}),"\n",(0,t.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,t.jsxs)(n.p,{children:["Generators are instance methods of ",(0,t.jsx)(n.code,{children:"PrismaRuntime"})," that can be used to generate a ",(0,t.jsx)(n.code,{children:"t.func"})," that represents a specific operation on a specific model of the runtime. They match to the model queries defined for the ",(0,t.jsx)(n.a,{href:"https://www.prisma.io/docs/reference/api-reference/prisma-client-reference",children:"prisma client API"}),". for the type of the input ",(0,t.jsx)(n.code,{children:"t.struct"})," and the return type."]}),"\n",(0,t.jsx)(n.p,{children:"Example:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-python",children:'with TypeGraph("prisma-runtime-example") as g:\n db = PrismaRuntime("main_db", "DB_CONNECTION")\n\n user = t.struct(\n {\n "id": t.uuid().config("id", "auto"),\n "email": t.email(),\n }\n )\n\n g.expose(\n createUser=db.create(user).add_policy(public),\n findUser=db.find(user).add_policy(public),\n findManyUsers=db.find_many(user).add_policy(public),\n )\n'})}),"\n",(0,t.jsx)(n.p,{children:"Here is a list of all available generators:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_unique"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_first"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"find_many"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"create"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"update"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"upsert"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"delete"})}),"\n",(0,t.jsx)(n.li,{children:(0,t.jsx)(n.code,{children:"delete_many"})}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"dealing-with-migrations",children:"Dealing with migrations"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://www.prisma.io/dataguide/types/relational/what-are-database-migrations",children:"Migrations"})," are basically blueprints that ensure that your local database and remote database both have the same schema. Migration files are generated as modifications are made in your typegraph as you deploy."]}),"\n",(0,t.jsx)(n.p,{children:"meta cli offers various ways to deal with failing migrations. In general, you will be required manually edit the SQL changes that made your migration fails, most of the time failing migrations are related to columns/tables that were removed, renamed or added."}),"\n",(0,t.jsxs)(n.p,{children:["However, if you wish to ignore failing migrations (eg. in a testing environment), you can use the ",(0,t.jsx)(n.code,{children:"--run-destructive-migrations"})," flag, it will reset your database schema."]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>a});var t=i(98302),s=(i(30758),i(86070));function a(e){let{python:n,typescript:i,rust:a,...r}=e;const d=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(t.A,{code:0==d.length?void 0:d,...r})}},75528:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"A"},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:"Hello World",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"body"},value:{kind:"StringValue",value:"This is a message",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"list_messages"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"title"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"equals"},value:{kind:"StringValue",value:"Hello World",block:!1}}]}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"body"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:251}};n.loc.source={body:'mutation A {\n create_message(\n data: {\n # id is autogenerated\n title: "Hello World"\n body: "This is a message"\n }\n ) {\n id\n }\n}\n\nquery B {\n list_messages(where: { title: { equals: "Hello World" } }) {\n id\n body\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function s(e,n){for(var i=0;i0;){var l=d;d=new Set,l.forEach((function(e){r.has(e)||(r.add(e),(t[e]||new Set).forEach((function(e){d.add(e)})))}))}return r.forEach((function(n){var t=s(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=a(n,"A"),e.exports.B=a(n,"B")},50864:e=>{e.exports={content:'# highlight-next-line\nfrom typegraph.providers.prisma import PrismaRuntime\n\n\n@typegraph(\n)\ndef database(g: Graph):\n db = PrismaRuntime("database", "POSTGRES_CONN")\n public = Policy.public()\n\n message = t.struct(\n {\n # highlight-next-line\n "id": t.integer(as_id=True, config=["auto"]),\n "title": t.string(),\n "body": t.string(),\n },\n # highlight-next-line\n name="message",\n )\n\n g.expose(\n public,\n # highlight-next-line\n create_message=db.create(message),\n list_messages=db.find_many(message),\n )',path:"../examples/typegraphs/database.py"}},74518:e=>{e.exports={content:'// highlight-next-line\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\nawait typegraph(\n {\n name: "database",\n },\n (g) => {\n const db = new PrismaRuntime("database", "POSTGRES_CONN");\n const pub = Policy.public();\n\n const message = t.struct(\n {\n // highlight-next-line\n id: t.integer({}, { asId: true, config: { auto: true } }),\n title: t.string(),\n body: t.string(),\n },\n // highlight-next-line\n { name: "message" },\n );\n\n g.expose(\n {\n // highlight-next-line\n create_message: db.create(message),\n list_messages: db.findMany(message),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/database.ts"}}}]); \ No newline at end of file diff --git a/assets/js/95183ce9.74397535.js b/assets/js/95183ce9.74397535.js deleted file mode 100644 index d07c790282..0000000000 --- a/assets/js/95183ce9.74397535.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6574],{28350:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>h,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>g,toc:()=>c});var r=n(86070),o=n(25710),p=n(65480),a=n(27676),s=n(7871);const i={},l="Programmatic deployment",g={id:"guides/programmatic-deployment/index",title:"Programmatic deployment",description:"The SDKs are complete enough to enable deploying typegraphs without using meta cli, the later being built as a convenience tool for everyday use.",source:"@site/docs/guides/programmatic-deployment/index.mdx",sourceDirName:"guides/programmatic-deployment",slug:"/guides/programmatic-deployment/",permalink:"/docs/guides/programmatic-deployment/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/programmatic-deployment/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Importing External Modules",permalink:"/docs/guides/import-external-modules/"},next:{title:"Test typegraphs",permalink:"/docs/guides/test-your-typegraph/"}},h={},c=[{value:"Deploy typegraphs",id:"deploy-typegraphs",level:2},{value:"Undeploy typegraphs",id:"undeploy-typegraphs",level:2}];function y(e){const t={a:"a",br:"br",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.h1,{id:"programmatic-deployment",children:"Programmatic deployment"}),"\n",(0,r.jsxs)(t.p,{children:["The SDKs are complete enough to enable deploying typegraphs without using ",(0,r.jsx)(t.a,{href:"/docs/reference/meta-cli",children:"meta cli"}),", the later being built as a convenience tool for everyday use."]}),"\n",(0,r.jsx)(t.p,{children:"Common use cases:"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:"Testing"}),"\n",(0,r.jsx)(t.li,{children:"Manage everything programmatically"}),"\n"]}),"\n",(0,r.jsx)(t.h2,{id:"deploy-typegraphs",children:"Deploy typegraphs"}),"\n",(0,r.jsxs)(t.p,{children:["This can be done using the ",(0,r.jsx)(t.code,{children:"tgDeploy"}),"/",(0,r.jsx)(t.code,{children:"tg_deploy"})," function.",(0,r.jsx)(t.br,{}),"\n","You are required to provide the configurations and also handle migrations by yourself (if any)."]}),"\n",(0,r.jsxs)(p.Ay,{children:[(0,r.jsx)(a.A,{value:"python",children:(0,r.jsx)(s.A,{language:"python",children:n(79796).content})}),(0,r.jsx)(a.A,{value:"typescript",children:(0,r.jsx)(s.A,{language:"typescript",children:n(80066).content})})]}),"\n",(0,r.jsx)(t.h2,{id:"undeploy-typegraphs",children:"Undeploy typegraphs"}),"\n",(0,r.jsxs)(t.p,{children:["Similarly to the above, you can undeploy typegraphs using the ",(0,r.jsx)(t.code,{children:"tgRemove"}),"/",(0,r.jsx)(t.code,{children:"tg_remove"})," function."]}),"\n",(0,r.jsxs)(p.Ay,{children:[(0,r.jsx)(a.A,{value:"python",children:(0,r.jsx)(s.A,{language:"python",children:n(25343).content})}),(0,r.jsx)(a.A,{value:"typescript",children:(0,r.jsx)(s.A,{language:"typescript",children:n(29985).content})})]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(y,{...e})}):y(e)}},65480:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>a,gc:()=>s});n(30758);var r=n(3733),o=n(56315),p=n(86070);function a(e){let{children:t}=e;const[n,a]=(0,r.e)();return(0,p.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:n,onChange:a,children:t})}function s(e){let{children:t}=e;const[n]=(0,r.e)();return(0,p.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:n,children:t})}},79796:e=>{e.exports={content:'import os\nfrom os import path\n\nfrom typegraph.gen.exports.core import MigrationAction\nfrom typegraph.graph.shared_types import BasicAuth\nfrom typegraph.graph.tg_deploy import (\n TypegraphDeployParams,\n tg_deploy,\n TypegateConnectionOptions,\n)\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph import Graph, Policy, t, typegraph\n\n\n# Your typegraph\n@typegraph()\ndef example(g: Graph):\n deno = DenoRuntime()\n pub = Policy.public()\n\n g.expose(\n pub,\n sayHello=deno.import_(\n t.struct({"name": t.string()}),\n t.string(),\n module="scripts/say_hello.ts",\n name="sayHello",\n ),\n )\n\n\n# Configure your deployment\ndef deploy():\n base_url = ""\n auth = BasicAuth("", "")\n\n config: TypegraphDeployParams = TypegraphDeployParams(\n typegate=TypegateConnectionOptions(url=base_url, auth=auth),\n typegraph_path=os.path.join(cwd, "path-to-typegraph"),\n prefix="",\n secrets={},\n migrations_dir=path.join("prisma-migrations", example.name),\n migration_actions=None,\n default_migration_action=MigrationAction(\n apply=True,\n reset=True, # allow destructive migrations\n create=True,\n ),\n )\n\n # Deploy to typegate\n result = tg_deploy(example, config) # pass your typegraph function name\n return result\n\n\n# typegate response\nres = deploy()',path:"../tests/docs/how-tos/prog_deploy/prog_deploy.py"}},80066:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n// deno-lint-ignore no-external-import\nimport * as path from "node:path";\nimport { BasicAuth, tgDeploy } from "@typegraph/sdk/tg_deploy.ts";\n\n// Your typegraph\nexport const tg = await typegraph("example", (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n g.expose(\n {\n sayHello: deno.import(t.struct({ name: t.string() }), t.string(), {\n module: "scripts/say_hello.ts",\n name: "sayHello",\n }),\n },\n pub,\n );\n});\n\n// Configure your deployment\nlet baseUrl = "";\nlet auth = new BasicAuth("", "");\n\nconst config = {\n typegate: {\n url: baseUrl,\n auth: auth,\n },\n typegraphPath: path.join(cwd, "path-to-typegraph.ts"),\n prefix: "",\n secrets: {},\n migrationsDir: path.join("prisma-migrations", tg.name),\n defaultMigrationAction: {\n apply: true,\n create: true,\n reset: true, // allow destructive migrations\n },\n};\n\n// Deploy to typegate\nconst deployResult = await tgDeploy(tg, config);',path:"../tests/docs/how-tos/prog_deploy/prog_deploy.ts"}},25343:e=>{e.exports={content:'# ..\nfrom typegraph.graph.tg_deploy import (\n TypegateConnectionOptions,\n TypegraphRemoveParams,\n tg_remove,\n)\n\nfrom typegraph import Graph, typegraph\nfrom typegraph.graph.shared_types import BasicAuth\n\n\n\n# Your typegraph\n@typegraph()\ndef example(g: Graph):\n # ..\n\n\ndef remove():\n base_url = ""\n auth = BasicAuth("", "")\n\n result = tg_remove(\n example.name, # pass the typegraph name\n params=TypegraphRemoveParams(\n typegate=TypegateConnectionOptions(url=base_url, auth=auth),\n ),\n )\n\n return result\n\n\n# Response from typegate\nres = remove()',path:"../tests/docs/how-tos/prog_deploy/prog_remove.py"}},29985:e=>{e.exports={content:'import { typegraph } from "@typegraph/sdk/index.ts";\nimport { BasicAuth, tgRemove } from "@typegraph/sdk/tg_deploy.ts";\n\n// Your typegraph\nconst tg = await typegraph("example", (_g) => {\n // ...\n});\n\n\n// Response from typegate,\nconst result = await tgRemove(tg.name, {\n // pass the typegraph name\n typegate: {\n url: baseUrl,\n auth: auth,\n },\n});',path:"../tests/docs/how-tos/prog_deploy/prog_remove.ts"}}}]); \ No newline at end of file diff --git a/assets/js/95183ce9.a30576ab.js b/assets/js/95183ce9.a30576ab.js new file mode 100644 index 0000000000..0a4e01b432 --- /dev/null +++ b/assets/js/95183ce9.a30576ab.js @@ -0,0 +1 @@ +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6574],{28350:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>g});var r=t(86070),o=t(25710),p=t(65480),a=t(27676),s=t(7871);const i={},l="Programmatic deployment",c={id:"guides/programmatic-deployment/index",title:"Programmatic deployment",description:"The SDKs are complete enough to enable deploying typegraphs without using meta cli, the later being built as a convenience tool for everyday use.",source:"@site/docs/guides/programmatic-deployment/index.mdx",sourceDirName:"guides/programmatic-deployment",slug:"/guides/programmatic-deployment/",permalink:"/docs/guides/programmatic-deployment/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/programmatic-deployment/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Importing External Modules",permalink:"/docs/guides/import-external-modules/"},next:{title:"Test typegraphs",permalink:"/docs/guides/test-your-typegraph/"}},h={},g=[{value:"Deploy typegraphs",id:"deploy-typegraphs",level:2},{value:"Undeploy typegraphs",id:"undeploy-typegraphs",level:2}];function y(e){const n={a:"a",br:"br",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"programmatic-deployment",children:"Programmatic deployment"}),"\n",(0,r.jsxs)(n.p,{children:["The SDKs are complete enough to enable deploying typegraphs without using ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta cli"}),", the later being built as a convenience tool for everyday use."]}),"\n",(0,r.jsx)(n.p,{children:"Common use cases:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Testing"}),"\n",(0,r.jsx)(n.li,{children:"Manage everything programmatically"}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"deploy-typegraphs",children:"Deploy typegraphs"}),"\n",(0,r.jsxs)(n.p,{children:["This can be done using the ",(0,r.jsx)(n.code,{children:"tgDeploy"}),"/",(0,r.jsx)(n.code,{children:"tg_deploy"})," function.",(0,r.jsx)(n.br,{}),"\n","You are required to provide the configurations and also handle migrations by yourself (if any)."]}),"\n",(0,r.jsxs)(p.Ay,{children:[(0,r.jsx)(a.A,{value:"python",children:(0,r.jsx)(s.A,{language:"python",children:t(79796).content})}),(0,r.jsx)(a.A,{value:"typescript",children:(0,r.jsx)(s.A,{language:"typescript",children:t(80066).content})})]}),"\n",(0,r.jsx)(n.h2,{id:"undeploy-typegraphs",children:"Undeploy typegraphs"}),"\n",(0,r.jsxs)(n.p,{children:["Similarly to the above, you can undeploy typegraphs using the ",(0,r.jsx)(n.code,{children:"tgRemove"}),"/",(0,r.jsx)(n.code,{children:"tg_remove"})," function."]}),"\n",(0,r.jsxs)(p.Ay,{children:[(0,r.jsx)(a.A,{value:"python",children:(0,r.jsx)(s.A,{language:"python",children:t(25343).content})}),(0,r.jsx)(a.A,{value:"typescript",children:(0,r.jsx)(s.A,{language:"typescript",children:t(29985).content})})]})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(y,{...e})}):y(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>a,gc:()=>s});t(30758);var r=t(3733),o=t(56315),p=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,r.e)();return(0,p.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function s(e){let{children:n}=e;const[t]=(0,r.e)();return(0,p.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},79796:e=>{e.exports={content:'# Copyright Metatype O\xdc, licensed under the Mozilla Public License Version 2.0.\n# SPDX-License-Identifier: MPL-2.0\n\nimport os\nfrom os import path\n\nfrom typegraph.gen.exports.core import MigrationAction\nfrom typegraph.graph.shared_types import BasicAuth\nfrom typegraph.graph.tg_deploy import (\n TypegraphDeployParams,\n tg_deploy,\n TypegateConnectionOptions,\n)\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph import Graph, Policy, t, typegraph\n\n\n# Your typegraph\n@typegraph()\ndef example(g: Graph):\n deno = DenoRuntime()\n pub = Policy.public()\n\n g.expose(\n pub,\n sayHello=deno.import_(\n t.struct({"name": t.string()}),\n t.string(),\n module="scripts/say_hello.ts",\n name="sayHello",\n ),\n )\n\n\n# Configure your deployment\ndef deploy():\n base_url = ""\n auth = BasicAuth("", "")\n\n config: TypegraphDeployParams = TypegraphDeployParams(\n typegate=TypegateConnectionOptions(url=base_url, auth=auth),\n typegraph_path=os.path.join(cwd, "path-to-typegraph"),\n prefix="",\n secrets={},\n migrations_dir=path.join("prisma-migrations", example.name),\n migration_actions=None,\n default_migration_action=MigrationAction(\n apply=True,\n reset=True, # allow destructive migrations\n create=True,\n ),\n )\n\n # Deploy to typegate\n result = tg_deploy(example, config) # pass your typegraph function name\n return result\n\n\n# typegate response\nres = deploy()',path:"../tests/docs/how-tos/prog_deploy/prog_deploy.py"}},80066:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n// deno-lint-ignore no-external-import\nimport * as path from "node:path";\nimport { BasicAuth, tgDeploy } from "@typegraph/sdk/tg_deploy.ts";\n\n// Your typegraph\nexport const tg = await typegraph("example", (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n g.expose(\n {\n sayHello: deno.import(t.struct({ name: t.string() }), t.string(), {\n module: "scripts/say_hello.ts",\n name: "sayHello",\n }),\n },\n pub,\n );\n});\n\n// Configure your deployment\nlet baseUrl = "";\nlet auth = new BasicAuth("", "");\n\nconst config = {\n typegate: {\n url: baseUrl,\n auth: auth,\n },\n typegraphPath: path.join(cwd, "path-to-typegraph.ts"),\n prefix: "",\n secrets: {},\n migrationsDir: path.join("prisma-migrations", tg.name),\n defaultMigrationAction: {\n apply: true,\n create: true,\n reset: true, // allow destructive migrations\n },\n};\n\n// Deploy to typegate\nconst deployResult = await tgDeploy(tg, config);',path:"../tests/docs/how-tos/prog_deploy/prog_deploy.ts"}},25343:e=>{e.exports={content:'# Copyright Metatype O\xdc, licensed under the Mozilla Public License Version 2.0.\n# SPDX-License-Identifier: MPL-2.0\n\n# ..\nfrom typegraph.graph.tg_deploy import (\n TypegateConnectionOptions,\n TypegraphRemoveParams,\n tg_remove,\n)\n\nfrom typegraph import Graph, typegraph\nfrom typegraph.graph.shared_types import BasicAuth\n\n\n\n# Your typegraph\n@typegraph()\ndef example(g: Graph):\n # ..\n\n\ndef remove():\n base_url = ""\n auth = BasicAuth("", "")\n\n result = tg_remove(\n example.name, # pass the typegraph name\n params=TypegraphRemoveParams(\n typegate=TypegateConnectionOptions(url=base_url, auth=auth),\n ),\n )\n\n return result\n\n\n# Response from typegate\nres = remove()',path:"../tests/docs/how-tos/prog_deploy/prog_remove.py"}},29985:e=>{e.exports={content:'import { typegraph } from "@typegraph/sdk/index.ts";\nimport { BasicAuth, tgRemove } from "@typegraph/sdk/tg_deploy.ts";\n\n// Your typegraph\nconst tg = await typegraph("example", (_g) => {\n // ...\n});\n\n\n// Response from typegate,\nconst result = await tgRemove(tg.name, {\n // pass the typegraph name\n typegate: {\n url: baseUrl,\n auth: auth,\n },\n});',path:"../tests/docs/how-tos/prog_deploy/prog_remove.ts"}}}]); \ No newline at end of file diff --git a/assets/js/99c4cb86.04f82d74.js b/assets/js/99c4cb86.18f9d535.js similarity index 91% rename from assets/js/99c4cb86.04f82d74.js rename to assets/js/99c4cb86.18f9d535.js index a93c95e6ff..5b11924e4c 100644 --- a/assets/js/99c4cb86.04f82d74.js +++ b/assets/js/99c4cb86.18f9d535.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8237],{68305:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var i=n(86070),s=n(25710),a=n(65671);const o={},r="IAM gateway",c={id:"iam-provider/index",title:"IAM gateway",description:"An Identity and Access Management (IAM) gateway is a core component of the cloud computing ecosystems. It provide an efficient and secure way to manage authentification for user identities and their authorized privileges within a system.",source:"@site/use-cases/iam-provider/index.mdx",sourceDirName:"iam-provider",slug:"/iam-provider/",permalink:"/use-cases/iam-provider/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/iam-provider/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Composable GraphQL server",permalink:"/use-cases/graphql-server/"},next:{title:"Microservices orchestration",permalink:"/use-cases/microservice-orchestration/"}},u={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function d(e){const t={h1:"h1",h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"iam-gateway",children:"IAM gateway"}),"\n",(0,i.jsx)(t.p,{children:"An Identity and Access Management (IAM) gateway is a core component of the cloud computing ecosystems. It provide an efficient and secure way to manage authentification for user identities and their authorized privileges within a system."}),"\n",(0,i.jsx)(t.h2,{id:"case-study",children:"Case study"}),"\n",(0,i.jsx)("div",{className:"text-center md:float-right p-8",children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:n(46321).A+""})})}),"\n",(0,i.jsx)(t.p,{children:"Suppose a developer is building a social media platform that allows users to post updates and view other users' profiles. The developer wants to ensure that only authenticated users can access the platform's resources, and that each user can only access their own data."}),"\n",(0,i.jsx)(t.p,{children:"To achieve this, the developer can use OAuth2 for user authentication and access control. OAuth2 allows users to log in using their Google or GitHub credentials, which are verified by Google or GitHub's IAM system. Once the user is authenticated, the social media platform can use OAuth2 to obtain an access token, which is used to authorize the user's access to the platform's resources."}),"\n",(0,i.jsx)(t.p,{children:"The social media platform can also use IAM to control access to resources based on user roles and permissions. For example, only authenticated users can access the platform's resources, and each user can only access their own data."}),"\n",(0,i.jsx)(t.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,i.jsx)(t.p,{children:"Metatype comes with a built-in IAM gateway that can be used to manage user identities and their authorized privileges within a system. It supports any OpenID/OAuth2 providers and includes a list of pre-configured ones like Google, GitHub, Facebook, Twitter or LinkedIn. You can also use your own identity provider and rely on JSON Web Tokens (JWT) for authentication."}),"\n",(0,i.jsx)(t.p,{children:"Once the user is authenticated, you can use policy access based control (PBAC) to control access to resources based on user identifies and permissions. For example, only authenticated users can access the platform's resources, and each user can only access their own data. Policies can be defined by any function, and run on or off Metatype."}),"\n",(0,i.jsx)(a.A,{typegraph:"iam-provider",python:n(73412),typescript:n(1970),query:n(40603)})]})}function p(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(98302),s=(n(30758),n(86070));function a(e){let{python:t,typescript:n,rust:a,...o}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==r.length?void 0:r,...o})}},40603:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"loginUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"logoutUrl"},arguments:[],directives:[]}]}}],loc:{start:0,end:64}};t.loc.source={body:"query {\n loginUrl\n\n context {\n username\n }\n\n logoutUrl\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},46321:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const i=n.p+"assets/images/image.drawio-b3345f8611397f333ceac94ea774b2d3.svg"},73412:e=>{e.exports={content:'@typegraph(\n)\ndef iam_provider(g: Graph):\n g.auth(Auth.oauth2_github("openid profile email"))\n\n public = Policy.public()\n\n deno = DenoRuntime()\n host = environ.get("TG_URL", "http://localhost:7890")\n url = f"{host}/iam-provider/auth/github?redirect_uri={quote_plus(host)}"\n\n g.expose(\n public,\n loginUrl=deno.static(t.string(), url),\n logoutUrl=deno.static(t.string(), f"{url}&clear"),\n context=deno.func(\n t.struct({}),\n t.struct({"username": t.string()}).optional(),\n code="(_, { context }) => Object.keys(context).length === 0 ? null : context",\n ),\n )',path:"../examples/typegraphs/iam-provider.py"}},1970:e=>{e.exports={content:'typegraph(\n {\n name: "iam-provider",\n },\n (g) => {\n g.auth(Auth.oauth2Github("openid profile email"));\n\n const pub = Policy.public();\n\n const deno = new DenoRuntime();\n const host = getEnvOrDefault("TG_URL", "http://localhost:7890");\n const url = `${host}/iam-provider/auth/github?redirect_uri=${encodeURIComponent(\n host\n )}`;\n\n g.expose(\n {\n loginUrl: deno.static(t.string(), url),\n logoutUrl: deno.static(t.string(), `${url}&clear`),\n context: deno.func(\n t.struct({}),\n t.struct({ username: t.string() }).optional(),\n {\n code: "(_, { context }) => Object.keys(context).length === 0 ? null : context",\n }\n ),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/iam-provider.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8237],{68305:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>c,toc:()=>l});var i=n(86070),s=n(25710),a=n(65671);const o={},r="IAM gateway",c={id:"iam-provider/index",title:"IAM gateway",description:"An Identity and Access Management (IAM) gateway is a core component of the cloud computing ecosystems. It provide an efficient and secure way to manage authentification for user identities and their authorized privileges within a system.",source:"@site/use-cases/iam-provider/index.mdx",sourceDirName:"iam-provider",slug:"/iam-provider/",permalink:"/use-cases/iam-provider/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/iam-provider/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Composable GraphQL server",permalink:"/use-cases/graphql-server/"},next:{title:"Microservices orchestration",permalink:"/use-cases/microservice-orchestration/"}},u={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function d(e){const t={h1:"h1",h2:"h2",img:"img",p:"p",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"iam-gateway",children:"IAM gateway"}),"\n",(0,i.jsx)(t.p,{children:"An Identity and Access Management (IAM) gateway is a core component of the cloud computing ecosystems. It provide an efficient and secure way to manage authentification for user identities and their authorized privileges within a system."}),"\n",(0,i.jsx)(t.h2,{id:"case-study",children:"Case study"}),"\n",(0,i.jsx)("div",{className:"text-center md:float-right p-8",children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{src:n(46321).A+""})})}),"\n",(0,i.jsx)(t.p,{children:"Suppose a developer is building a social media platform that allows users to post updates and view other users' profiles. The developer wants to ensure that only authenticated users can access the platform's resources, and that each user can only access their own data."}),"\n",(0,i.jsx)(t.p,{children:"To achieve this, the developer can use OAuth2 for user authentication and access control. OAuth2 allows users to log in using their Google or GitHub credentials, which are verified by Google or GitHub's IAM system. Once the user is authenticated, the social media platform can use OAuth2 to obtain an access token, which is used to authorize the user's access to the platform's resources."}),"\n",(0,i.jsx)(t.p,{children:"The social media platform can also use IAM to control access to resources based on user roles and permissions. For example, only authenticated users can access the platform's resources, and each user can only access their own data."}),"\n",(0,i.jsx)(t.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,i.jsx)(t.p,{children:"Metatype comes with a built-in IAM gateway that can be used to manage user identities and their authorized privileges within a system. It supports any OpenID/OAuth2 providers and includes a list of pre-configured ones like Google, GitHub, Facebook, Twitter or LinkedIn. You can also use your own identity provider and rely on JSON Web Tokens (JWT) for authentication."}),"\n",(0,i.jsx)(t.p,{children:"Once the user is authenticated, you can use policy access based control (PBAC) to control access to resources based on user identifies and permissions. For example, only authenticated users can access the platform's resources, and each user can only access their own data. Policies can be defined by any function, and run on or off Metatype."}),"\n",(0,i.jsx)(a.A,{typegraph:"iam-provider",python:n(73412),typescript:n(1970),query:n(40603)})]})}function p(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(98302),s=(n(30758),n(86070));function a(e){let{python:t,typescript:n,rust:a,...o}=e;const r=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,s.jsx)(i.A,{code:0==r.length?void 0:r,...o})}},40603:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"loginUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"context"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"username"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"logoutUrl"},arguments:[],directives:[]}]}}],loc:{start:0,end:64}};t.loc.source={body:"query {\n loginUrl\n\n context {\n username\n }\n\n logoutUrl\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function n(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&t.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){n(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){n(e,t)})),e.definitions&&e.definitions.forEach((function(e){n(e,t)}))}var i={};t.definitions.forEach((function(e){if(e.name){var t=new Set;n(e,t),i[e.name.value]=t}})),e.exports=t},46321:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});const i=n.p+"assets/images/image.drawio-b3345f8611397f333ceac94ea774b2d3.svg"},73412:e=>{e.exports={content:'@typegraph(\n)\ndef iam_provider(g: Graph):\n g.auth(Auth.oauth2_github("openid profile email"))\n\n public = Policy.public()\n\n deno = DenoRuntime()\n host = environ.get("TG_URL", "http://localhost:7890")\n url = f"{host}/iam-provider/auth/github?redirect_uri={quote_plus(host)}"\n\n g.expose(\n public,\n loginUrl=deno.static(t.string(), url),\n logoutUrl=deno.static(t.string(), f"{url}&clear"),\n context=deno.func(\n t.struct({}),\n t.struct({"username": t.string()}).optional(),\n code="(_, { context }) => Object.keys(context).length === 0 ? null : context",\n ),\n )',path:"../examples/typegraphs/iam-provider.py"}},1970:e=>{e.exports={content:'typegraph(\n {\n name: "iam-provider",\n },\n (g) => {\n g.auth(Auth.oauth2Github("openid profile email"));\n\n const pub = Policy.public();\n\n const deno = new DenoRuntime();\n const host = getEnvOrDefault("TG_URL", "http://localhost:7890");\n const url = `${host}/iam-provider/auth/github?redirect_uri=${\n encodeURIComponent(\n host,\n )\n }`;\n\n g.expose(\n {\n loginUrl: deno.static(t.string(), url),\n logoutUrl: deno.static(t.string(), `${url}&clear`),\n context: deno.func(\n t.struct({}),\n t.struct({ username: t.string() }).optional(),\n {\n code:\n "(_, { context }) => Object.keys(context).length === 0 ? null : context",\n },\n ),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/iam-provider.ts"}}}]); \ No newline at end of file diff --git a/assets/js/a0248338.cc681205.js b/assets/js/a0248338.73e1d60a.js similarity index 96% rename from assets/js/a0248338.cc681205.js rename to assets/js/a0248338.73e1d60a.js index d4f7eb109a..21b79d7074 100644 --- a/assets/js/a0248338.cc681205.js +++ b/assets/js/a0248338.73e1d60a.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5028],{3894:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>p,toc:()=>c});var s=n(86070),r=n(25710),o=(n(7871),n(65671));const i={sidebar_position:50},d="Write REST endpoints",p={id:"guides/rest/index",title:"Write REST endpoints",description:"The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.",source:"@site/docs/guides/rest/index.mdx",sourceDirName:"guides/rest",slug:"/guides/rest/",permalink:"/docs/guides/rest/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/rest/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Upload files to cloud storage",permalink:"/docs/guides/files-upload/"},next:{title:"Secure your requests",permalink:"/docs/guides/securing-requests/"}},a={},c=[];function h(e){const t={a:"a",code:"code",h1:"h1",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"write-rest-endpoints",children:"Write REST endpoints"}),"\n",(0,s.jsxs)(t.p,{children:["The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.\nIn addition, we can also expose ",(0,s.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/REST",children:"REST"})," APIs using the ",(0,s.jsx)(t.code,{children:"rest"})," method.\nThe method takes GraphQl queries and provides RESTly endpoints for them."]}),"\n",(0,s.jsx)(o.A,{python:n(34868),typescript:n(70370),disablePlayground:!0}),"\n",(0,s.jsxs)(t.p,{children:["The effect of the root function accessed in the query determines the HTTP verb used, and the mapping can be found ",(0,s.jsx)(t.a,{href:"/docs/reference/types/functions#effects",children:"here"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["There's also an OpenAPI schema generated from the rest endpoints served under ",(0,s.jsx)(t.code,{children:"{typegate_url}/{typegraph}/rest/_schema"}),".\nA browser-based explorer for the OpenAPI schema is served under ",(0,s.jsx)(t.code,{children:"{typegate_url}/{typegraph}/rest"})," as well."]}),"\n",(0,s.jsxs)(t.p,{children:["You can refer to the ",(0,s.jsx)(t.a,{href:"/docs/reference/rest",children:"REST reference"})," section for more information."]}),"\n"]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(98302),r=(n(30758),n(86070));function o(e){let{python:t,typescript:n,rust:o,...i}=e;const d=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,r.jsx)(s.A,{code:0==d.length?void 0:d,...i})}},34868:e=>{e.exports={content:'g.expose(\n postFromUser=deno.func(\n user,\n post,\n code="(_) => ({ id: 12, author: {id: 1} })",\n ).with_policy(pub),\n)\n\n# In this example, the query below maps to {typegate_url}/example-rest/rest/get_post?id=..\n# highlight-start\ng.rest(\n """\n query get_post($id: Integer) {\n postFromUser(id: $id) {\n id\n author {\n id\n }\n }\n }\n """\n)\n# highlight-end',path:"../examples/typegraphs/example_rest.py"}},70370:e=>{e.exports={content:'g.expose({\n postFromUser: deno\n .func(user, post, { code: "(_) => ({ id: 12, author: {id: 1} })" })\n .withPolicy(pub),\n});\n\n// In this example, the query below maps to {typegate_url}/example-rest/rest/get_post?id=..\n// highlight-start\ng.rest(\n `\n query get_post($id: Integer) {\n postFromUser(id: $id) {\n id\n author {\n id\n }\n }\n }\n`\n);\n// highlight-end',path:"../examples/typegraphs/example_rest.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5028],{3894:(e,t,n)=>{"use strict";n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>p,toc:()=>c});var s=n(86070),r=n(25710),o=(n(7871),n(65671));const i={sidebar_position:50},d="Write REST endpoints",p={id:"guides/rest/index",title:"Write REST endpoints",description:"The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.",source:"@site/docs/guides/rest/index.mdx",sourceDirName:"guides/rest",slug:"/guides/rest/",permalink:"/docs/guides/rest/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/rest/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Upload files to cloud storage",permalink:"/docs/guides/files-upload/"},next:{title:"Secure your requests",permalink:"/docs/guides/securing-requests/"}},a={},c=[];function h(e){const t={a:"a",code:"code",h1:"h1",p:"p",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h1,{id:"write-rest-endpoints",children:"Write REST endpoints"}),"\n",(0,s.jsxs)(t.p,{children:["The root functions, the ones we expose from our typegraphs, are served through a GraphQl API over HTTP.\nIn addition, we can also expose ",(0,s.jsx)(t.a,{href:"https://en.wikipedia.org/wiki/REST",children:"REST"})," APIs using the ",(0,s.jsx)(t.code,{children:"rest"})," method.\nThe method takes GraphQl queries and provides RESTly endpoints for them."]}),"\n",(0,s.jsx)(o.A,{python:n(34868),typescript:n(70370),disablePlayground:!0}),"\n",(0,s.jsxs)(t.p,{children:["The effect of the root function accessed in the query determines the HTTP verb used, and the mapping can be found ",(0,s.jsx)(t.a,{href:"/docs/reference/types/functions#effects",children:"here"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["There's also an OpenAPI schema generated from the rest endpoints served under ",(0,s.jsx)(t.code,{children:"{typegate_url}/{typegraph}/rest/_schema"}),".\nA browser-based explorer for the OpenAPI schema is served under ",(0,s.jsx)(t.code,{children:"{typegate_url}/{typegraph}/rest"})," as well."]}),"\n",(0,s.jsxs)(t.p,{children:["You can refer to the ",(0,s.jsx)(t.a,{href:"/docs/reference/rest",children:"REST reference"})," section for more information."]}),"\n"]})}function u(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},65671:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var s=n(98302),r=(n(30758),n(86070));function o(e){let{python:t,typescript:n,rust:o,...i}=e;const d=[t&&{content:t.content,codeLanguage:"python",codeFileUrl:t.path},n&&{content:n.content,codeLanguage:"typescript",codeFileUrl:n.path},o&&{content:o.content,codeLanguage:"rust",codeFileUrl:o.path}].filter((e=>!!e));return(0,r.jsx)(s.A,{code:0==d.length?void 0:d,...i})}},34868:e=>{e.exports={content:'g.expose(\n postFromUser=deno.func(\n user,\n post,\n code="(_) => ({ id: 12, author: {id: 1} })",\n ).with_policy(pub),\n)\n\n# In this example, the query below maps to {typegate_url}/example-rest/rest/get_post?id=..\n# highlight-start\ng.rest(\n """\n query get_post($id: Integer) {\n postFromUser(id: $id) {\n id\n author {\n id\n }\n }\n }\n """\n)\n# highlight-end',path:"../examples/typegraphs/example_rest.py"}},70370:e=>{e.exports={content:'g.expose({\n postFromUser: deno\n .func(user, post, { code: "(_) => ({ id: 12, author: {id: 1} })" })\n .withPolicy(pub),\n});\n\n// In this example, the query below maps to {typegate_url}/example-rest/rest/get_post?id=..\n// highlight-start\ng.rest(\n `\n query get_post($id: Integer) {\n postFromUser(id: $id) {\n id\n author {\n id\n }\n }\n }\n`,\n);\n// highlight-end',path:"../examples/typegraphs/example_rest.ts"}}}]); \ No newline at end of file diff --git a/assets/js/a4f64869.3a2272ee.js b/assets/js/a4f64869.3a2272ee.js new file mode 100644 index 0000000000..b32347c370 --- /dev/null +++ b/assets/js/a4f64869.3a2272ee.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1723],{33454:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>p,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var s=t(86070),i=t(25710),r=t(65480),a=t(27676);const o={},l="Substantial",c={id:"reference/runtimes/substantial/index",title:"Substantial",description:"Substantial runtime",source:"@site/docs/reference/runtimes/substantial/index.mdx",sourceDirName:"reference/runtimes/substantial",slug:"/reference/runtimes/substantial/",permalink:"/docs/reference/runtimes/substantial/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/substantial/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"S3",permalink:"/docs/reference/runtimes/s3/"},next:{title:"Temporal",permalink:"/docs/reference/runtimes/temporal/"}},d={},u=[{value:"Substantial runtime",id:"substantial-runtime",level:2},{value:"Key Concepts",id:"key-concepts",level:2},{value:"Workflows",id:"workflows",level:3},{value:"Backend",id:"backend",level:3},{value:"Run",id:"run",level:3},{value:"Child workflows",id:"child-workflows",level:2}];function h(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"substantial",children:"Substantial"}),"\n",(0,s.jsx)(n.h2,{id:"substantial-runtime",children:"Substantial runtime"}),"\n",(0,s.jsx)(n.p,{children:"The Substantial runtime enables the execution of durable workflows in one or accross multiple typegates."}),"\n",(0,s.jsx)(n.p,{children:"Why use it?"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:'Long-running "processes"'}),": Durable tasks that need to run over extended periods (days, weeks or months), handling ",(0,s.jsx)(n.strong,{children:"retries"})," and ",(0,s.jsx)(n.strong,{children:"restarts"})," seamlessly."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fault-tolerant execution"}),": Ensure reliable execution of tasks, even upon failures, by maintaining a durable state of the latest run."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Task orchestration"}),": Coordinate complex sequences of workflows (analogous to microservices interactions)."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For example, the workflow bellow will continue running until a ",(0,s.jsx)(n.code,{children:"confirmation"})," event is sent to the ",(0,s.jsx)(n.strong,{children:"associated run"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'export async function sendEmail(ctx: Context) {\n // 1. A workflow can receive parameters whose type is defined on the typegraph\n const { to } = ctx.kwargs;\n\n // 2. When a function call produces effects, we can make it durable\n const info = await ctx.save(() => sendSubscriptionEmail(to));\n const timeSent = await ctx.save(() => new Date().toJSON());\n\n const confirmation = ctx.receive("confirmation");\n if (!confirmation) {\n throw new Error(`${to} has denied the subscription sent at ${timeSent}`);\n }\n\n return `${to} confirmed (${info})`;\n}\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, if we were to shut down the Typegate node executing it and then restart it, the state ",(0,s.jsx)(n.strong,{children:"will be preserved"}),". This means that if the subscription email was already sent, upon relaunch, it will not be sent again, same thing for the value of ",(0,s.jsx)(n.code,{children:"timeSent"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"key-concepts",children:"Key Concepts"}),"\n",(0,s.jsx)(n.h3,{id:"workflows",children:"Workflows"}),"\n",(0,s.jsxs)(n.p,{children:["A special type of function with ",(0,s.jsx)(n.strong,{children:"durable state"})," and an execution mechanism directly tied to time. A workflow can also trigger other workflows (child workflows)."]}),"\n",(0,s.jsx)(n.h3,{id:"backend",children:"Backend"}),"\n",(0,s.jsxs)(n.p,{children:["This abstraction implements a set of atomic operations that allows Typegate to persist and recover the workflow state. Currently, we have the ",(0,s.jsx)(n.strong,{children:"Redis"})," backend available, along with others like ",(0,s.jsx)(n.strong,{children:"fs"})," and ",(0,s.jsx)(n.strong,{children:"memory"}),", which are primarily intended for development or testing purposes."]}),"\n",(0,s.jsx)(n.h3,{id:"run",children:"Run"}),"\n",(0,s.jsxs)(n.p,{children:["When a workflow is started, a run is created and Substantial will provide you a ",(0,s.jsx)(n.code,{children:"run_id"})," to uniquely identify it."]}),"\n",(0,s.jsxs)(n.p,{children:["You can send an event or abort an ongoing run from its ",(0,s.jsx)(n.code,{children:"run_id"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"child-workflows",children:"Child workflows"}),"\n",(0,s.jsx)(n.p,{children:"Child workflows are like any other workflows, they are just run by another workflow (parent)."}),"\n",(0,s.jsx)(n.p,{children:"If a workflow parent is explicitly stopped or aborted, all of its descendants will also be aborted."}),"\n",(0,s.jsx)(n.p,{children:"For example, suppose you want to write a workflow that sends a subscription request to a list of emails and then receive a notification for each confirmation or denial, but only during your work hours."}),"\n",(0,s.jsx)(n.p,{children:"You can easily translate that logic as if you were writing generic sequential code using Substantial workflows."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'import {\n nextTimeWhenAdminIsAvailable,\n sendSubscriptionEmail,\n notifyAdmin,\n} from "./utils.ts";\n\nexport async function sendEmail(ctx: Context) {\n // 1. A workflow can receive parameters whose type is defined on the typegraph\n const { to } = ctx.kwargs;\n\n // 2. When a function call produces effects, we can make it durable\n const info = await ctx.save(() => sendSubscriptionEmail(to));\n const timeSent = await ctx.save(() => new Date());\n\n const confirmation = ctx.receive("confirmation");\n if (!confirmation) {\n throw new Error(`${to} has denied the subscription sent at ${timeSent}`);\n }\n\n // 3. In this scenario, we use a durable sleep to wait until the admin\n // is available\n const duration = await ctx.save(() =>\n nextTimeWhenAdminIsAvailable(new Date()),\n );\n ctx.sleep(duration);\n\n const _ = await ctx.save(() => notifyAdmin(info), {\n retry: {\n minBackoffMs: 1000,\n maxBackoffMs: 5000,\n maxRetries: 4,\n },\n });\n\n return `${to} confirmed`;\n}\n\nexport async function sendMultipleEmails(ctx: Context) {\n const { emails } = ctx.kwargs;\n\n // 1. Persist the state of the child workflows\n const handlersDef = await ctx.save(async () => {\n const handlersDef = [];\n for (const email of emails) {\n const handleDef = await ctx.startChildWorkflow(sendEmail, {\n to: email,\n });\n handlersDef.push(handleDef);\n }\n\n return handlersDef;\n });\n\n // 2. Create handles for your child workflows\n const handles = handlersDef.map((def) => ctx.createWorkflowHandle(def));\n\n // 3. In this example, we wait on all child workflows to complete\n await ctx.ensure(async () => {\n for (const handle of handles) {\n if (!(await handle.hasStopped())) {\n return false;\n }\n }\n return true;\n });\n\n const ret = await ctx.save(async () => {\n const ret = [];\n for (const handle of handles) {\n const childResult = await handle.result();\n ret.push(childResult);\n }\n\n return ret;\n });\n\n return ret;\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"In your typegraph, you will have:"}),"\n",(0,s.jsxs)(r.Ay,{children:[(0,s.jsx)(a.A,{value:"python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'from typegraph import typegraph, t, Graph\nfrom typegraph.policy import Policy\nfrom typegraph.runtimes.substantial import SubstantialRuntime, WorkflowFile\nfrom typegraph.runtimes.substantial import Backend\n\n\n@typegraph()\ndef substantial_example(g: Graph):\n pub = Policy.public()\n\n backend = Backend.redis("REDIS_SECRET")\n file = (\n WorkflowFile.deno(file="my_workflow.ts", deps=["shared/types.ts"])\n .import_(["sendEmail", "sendMultipleEmails"])\n .build()\n )\n\n sub = SubstantialRuntime(backend, [file])\n\n g.expose(\n pub,\n stop=sub.stop(),\n send_multiple_emails=sub.start(t.struct({ "emails": t.list(t.email()) })).reduce(\n { "name": "sendMultipleEmails"}\n ),\n send_single_email=sub.start(t.struct({"to": t.email()})).reduce(\n {"name": "sendEmail"}\n ),\n results_raw=sub.query_results_raw(),\n workers=sub.query_resources(),\n **sub.internals(), # Required for child workflows\n )\n\n'})})}),(0,s.jsx)(a.A,{value:"typescript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport {\n SubstantialRuntime,\n Backend,\n WorkflowFile,\n} from "@typegraph/sdk/runtimes/substantial.ts";\n\ntypegraph(\n {\n name: "substantial-example",\n },\n (g) => {\n const pub = Policy.public();\n const backend = Backend.redis("REDIS_SECRET");\n const file = WorkflowFile.deno("my_workflow.ts", [])\n .import(["sendEmail", "sendMultipleEmails"])\n .build();\n\n const sub = new SubstantialRuntime(backend, [file]);\n\n g.expose(\n {\n stop: sub.stop(),\n send_multiple_emails: sub\n .start(t.struct({ emails: t.list(t.email()) }))\n .reduce({ name: "sendMultipleEmails" }),\n send_single_email: sub\n .start(t.struct({ to: t.email() }))\n .reduce({ name: "sendEmail" }),\n results_raw: sub.queryResultsRaw(),\n workers: sub.queryResources(),\n ...sub.internals(), // Required for child workflows\n },\n pub,\n );\n },\n);\n'})})})]})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{t.d(n,{Ay:()=>a,gc:()=>o});t(30758);var s=t(3733),i=t(56315),r=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,s.e)();return(0,r.jsx)(i.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function o(e){let{children:n}=e;const[t]=(0,s.e)();return(0,r.jsx)(i.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}}}]); \ No newline at end of file diff --git a/assets/js/a4f64869.3c3a0bcf.js b/assets/js/a4f64869.3c3a0bcf.js deleted file mode 100644 index fdeea513b9..0000000000 --- a/assets/js/a4f64869.3c3a0bcf.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[1723],{33454:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>p,frontMatter:()=>o,metadata:()=>c,toc:()=>u});var s=t(86070),i=t(25710),r=t(65480),a=t(27676);const o={},l="Substantial",c={id:"reference/runtimes/substantial/index",title:"Substantial",description:"Substantial runtime",source:"@site/docs/reference/runtimes/substantial/index.mdx",sourceDirName:"reference/runtimes/substantial",slug:"/reference/runtimes/substantial/",permalink:"/docs/reference/runtimes/substantial/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/substantial/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"S3",permalink:"/docs/reference/runtimes/s3/"},next:{title:"Temporal",permalink:"/docs/reference/runtimes/temporal/"}},d={},u=[{value:"Substantial runtime",id:"substantial-runtime",level:2},{value:"Key Concepts",id:"key-concepts",level:2},{value:"Workflows",id:"workflows",level:3},{value:"Backend",id:"backend",level:3},{value:"Run",id:"run",level:3},{value:"Child workflows",id:"child-workflows",level:2}];function h(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"substantial",children:"Substantial"}),"\n",(0,s.jsx)(n.h2,{id:"substantial-runtime",children:"Substantial runtime"}),"\n",(0,s.jsx)(n.p,{children:"The Substantial runtime enables the execution of durable workflows in one or accross multiple typegates."}),"\n",(0,s.jsx)(n.p,{children:"Why use it?"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:'Long-running "processes"'}),": Durable tasks that need to run over extended periods (days, weeks or months), handling ",(0,s.jsx)(n.strong,{children:"retries"})," and ",(0,s.jsx)(n.strong,{children:"restarts"})," seamlessly."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Fault-tolerant execution"}),": Ensure reliable execution of tasks, even upon failures, by maintaining a durable state of the latest run."]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.strong,{children:"Task orchestration"}),": Coordinate complex sequences of workflows (analogous to microservices interactions)."]}),"\n"]}),"\n",(0,s.jsxs)(n.p,{children:["For example, the workflow bellow will continue running until a ",(0,s.jsx)(n.code,{children:"confirmation"})," event is sent to the ",(0,s.jsx)(n.strong,{children:"associated run"}),"."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'export async function sendEmail(ctx: Context) {\n // 1. A workflow can receive parameters whose type is defined on the typegraph\n const { to } = ctx.kwargs;\n\n // 2. When a function call produces effects, we can make it durable\n const info = await ctx.save(() => sendSubscriptionEmail(to));\n const timeSent = await ctx.save(() => new Date().toJSON());\n\n const confirmation = ctx.receive("confirmation");\n if (!confirmation) {\n throw new Error(`${to} has denied the subscription sent at ${timeSent}`);\n }\n\n return `${to} confirmed (${info})`;\n}\n\n'})}),"\n",(0,s.jsxs)(n.p,{children:["Additionally, if we were to shut down the Typegate node executing it and then restart it, the state ",(0,s.jsx)(n.strong,{children:"will be preserved"}),". This means that if the subscription email was already sent, upon relaunch, it will not be sent again, same thing for the value of ",(0,s.jsx)(n.code,{children:"timeSent"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"key-concepts",children:"Key Concepts"}),"\n",(0,s.jsx)(n.h3,{id:"workflows",children:"Workflows"}),"\n",(0,s.jsxs)(n.p,{children:["A special type of function with ",(0,s.jsx)(n.strong,{children:"durable state"})," and an execution mechanism directly tied to time. A workflow can also trigger other workflows (child workflows)."]}),"\n",(0,s.jsx)(n.h3,{id:"backend",children:"Backend"}),"\n",(0,s.jsxs)(n.p,{children:["This abstraction implements a set of atomic operations that allows Typegate to persist and recover the workflow state. Currently, we have the ",(0,s.jsx)(n.strong,{children:"Redis"})," backend available, along with others like ",(0,s.jsx)(n.strong,{children:"fs"})," and ",(0,s.jsx)(n.strong,{children:"memory"}),", which are primarily intended for development or testing purposes."]}),"\n",(0,s.jsx)(n.h3,{id:"run",children:"Run"}),"\n",(0,s.jsxs)(n.p,{children:["When a workflow is started, a run is created and Substantial will provide you a ",(0,s.jsx)(n.code,{children:"run_id"})," to uniquely identify it."]}),"\n",(0,s.jsxs)(n.p,{children:["You can send an event or abort an ongoing run from its ",(0,s.jsx)(n.code,{children:"run_id"}),"."]}),"\n",(0,s.jsx)(n.h2,{id:"child-workflows",children:"Child workflows"}),"\n",(0,s.jsx)(n.p,{children:"Child workflows are like any other workflows, they are just run by another workflow (parent)."}),"\n",(0,s.jsx)(n.p,{children:"If a workflow parent is explicitly stopped or aborted, all of its descendants will also be aborted."}),"\n",(0,s.jsx)(n.p,{children:"For example, suppose you want to write a workflow that sends a subscription request to a list of emails and then receive a notification for each confirmation or denial, but only during your work hours."}),"\n",(0,s.jsx)(n.p,{children:"You can easily translate that logic as if you were writing generic sequential code using Substantial workflows."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'import { nextTimeWhenAdminIsAvailable, sendSubscriptionEmail, notifyAdmin } from "./utils.ts";\n\nexport async function sendEmail(ctx: Context) {\n // 1. A workflow can receive parameters whose type is defined on the typegraph\n const { to } = ctx.kwargs;\n\n // 2. When a function call produces effects, we can make it durable\n const info = await ctx.save(() => sendSubscriptionEmail(to));\n const timeSent = await ctx.save(() => new Date());\n\n const confirmation = ctx.receive("confirmation");\n if (!confirmation) {\n throw new Error(`${to} has denied the subscription sent at ${timeSent}`);\n }\n\n // 3. In this scenario, we use a durable sleep to wait until the admin\n // is available\n const duration = await ctx.save(() => nextTimeWhenAdminIsAvailable(new Date()));\n ctx.sleep(duration);\n\n const _ = await ctx.save(() => notifyAdmin(info), {\n retry: {\n minBackoffMs: 1000,\n maxBackoffMs: 5000,\n maxRetries: 4,\n }\n });\n\n return `${to} confirmed`;\n}\n\nexport async function sendMultipleEmails(ctx: Context) {\n const { emails } = ctx.kwargs;\n\n // 1. Persist the state of the child workflows\n const handlersDef = await ctx.save(async () => {\n const handlersDef = [];\n for (const email of emails) {\n const handleDef = await ctx.startChildWorkflow(sendEmail, {\n to: email,\n });\n handlersDef.push(handleDef);\n }\n\n return handlersDef;\n });\n\n // 2. Create handles for your child workflows\n const handles = handlersDef.map((def) => ctx.createWorkflowHandle(def));\n\n // 3. In this example, we wait on all child workflows to complete\n await ctx.ensure(async () => {\n for (const handle of handles) {\n if (!(await handle.hasStopped())) {\n return false;\n }\n }\n return true;\n });\n\n const ret = await ctx.save(async () => {\n const ret = [];\n for (const handle of handles) {\n const childResult = await handle.result();\n ret.push(childResult);\n }\n\n return ret;\n });\n\n return ret;\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"In your typegraph, you will have:"}),"\n",(0,s.jsxs)(r.Ay,{children:[(0,s.jsx)(a.A,{value:"python",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-python",children:'from typegraph import typegraph, t, Graph\nfrom typegraph.policy import Policy\nfrom typegraph.runtimes.substantial import SubstantialRuntime, WorkflowFile\nfrom typegraph.runtimes.substantial import Backend\n\n\n@typegraph()\ndef substantial_example(g: Graph):\n pub = Policy.public()\n\n backend = Backend.redis("REDIS_SECRET")\n file = (\n WorkflowFile.deno(file="my_workflow.ts", deps=["shared/types.ts"])\n .import_(["sendEmail", "sendMultipleEmails"])\n .build()\n )\n\n sub = SubstantialRuntime(backend, [file])\n\n g.expose(\n pub,\n stop=sub.stop(),\n send_multiple_emails=sub.start(t.struct({ "emails": t.list(t.email()) })).reduce(\n { "name": "sendMultipleEmails"}\n ),\n send_single_email=sub.start(t.struct({"to": t.email()})).reduce(\n {"name": "sendEmail"}\n ),\n results_raw=sub.query_results_raw(),\n workers=sub.query_resources(),\n **sub.internals(), # Required for child workflows\n )\n\n'})})}),(0,s.jsx)(a.A,{value:"typescript",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-typescript",children:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport {\n SubstantialRuntime,\n Backend,\n WorkflowFile,\n} from "@typegraph/sdk/runtimes/substantial.ts";\n\ntypegraph(\n {\n name: "substantial-example",\n },\n (g) => {\n const pub = Policy.public();\n const backend = Backend.redis("REDIS_SECRET");\n const file = WorkflowFile.deno("my_workflow.ts", [])\n .import(["sendEmail", "sendMultipleEmails"])\n .build();\n\n const sub = new SubstantialRuntime(backend, [file]);\n\n g.expose(\n {\n stop: sub.stop(),\n send_multiple_emails: sub\n .start(t.struct({ emails: t.list(t.email()) }))\n .reduce({ name: "sendMultipleEmails" }),\n send_single_email: sub\n .start(t.struct({ to: t.email() }))\n .reduce({ name: "sendEmail" }),\n results_raw: sub.queryResultsRaw(),\n workers: sub.queryResources(),\n ...sub.internals(), // Required for child workflows\n },\n pub\n );\n }\n);\n'})})})]})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{t.d(n,{Ay:()=>a,gc:()=>o});t(30758);var s=t(3733),i=t(56315),r=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,s.e)();return(0,r.jsx)(i.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function o(e){let{children:n}=e;const[t]=(0,s.e)();return(0,r.jsx)(i.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}}}]); \ No newline at end of file diff --git a/assets/js/a70287ac.33b6f861.js b/assets/js/a70287ac.33b6f861.js new file mode 100644 index 0000000000..2907d5fa15 --- /dev/null +++ b/assets/js/a70287ac.33b6f861.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2058],{77487:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>r,default:()=>m,frontMatter:()=>a,metadata:()=>c,toc:()=>h});var i=n(86070),t=n(25710);function l(e){const s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",input:"input",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components},{Details:n}=s;return n||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"changelog",children:"Changelog"}),"\n",(0,i.jsx)(s.p,{children:"All notable changes to this project will be documented in this file."}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc5---2024-11-10",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.5",children:"v0.5.0-rc.5"})," - 2024-11-10"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Meta dev does not exit properly upon ",(0,i.jsx)(s.code,{children:"SIGTERM"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/895",children:"#895"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Fix optional field filter in apply (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/909",children:"#909"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix the optional field filter on apply: resolve types before matching."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-1",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No migrations needed."})}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Grpc annoucement blog (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/872",children:"#872"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-2",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Watch artifacts (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/897",children:"#897"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Solve ",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-710/watch-artifacts",children:"MET\n710"}),"."]}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"..."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-3",children:"Migration notes"}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Substantial function secrets support (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/908",children:"#908"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add support for passing secrets to substantial workflows"}),"\n",(0,i.jsx)(s.li,{children:"Bump version to 0.5.0-rc5"}),"\n"]}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["License change to MPL Version 2.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/899",children:"#899"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: license change to MPL Version 2.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/899",children:"#899"}),")"]}),"\n"]})]}),(0,i.jsx)(s.h4,{id:"migration-notes-4",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"All license headers has changed to MPL 2.0."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc4---2024-11-05",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.4",children:"v0.5.0-rc.4"})," - 2024-11-05"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-1",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(typegraph) Send rpc message in chunks in the TS typegraph client (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/904",children:"#904"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Send the JSON-RPC message is chunks in the TypeScript typegraph client\r\nto prevent reaching the line size limit for stdout. Note: we could not\r\nreproduce the issue locally as it only occurs when using the published\r\npackage for Node.js."}),"\n",(0,i.jsx)(s.li,{children:"Use JSON-RPC notification for logging and report from the typegraph\r\nclients."}),"\n",(0,i.jsxs)(s.li,{children:["Other changes:","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Use relative paths for static task sources in the CLI;"}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["Fix TODO in ",(0,i.jsx)(s.code,{children:"meta gen"}),": pass the working directory on the\r\n",(0,i.jsx)(s.code,{children:"working_dir"})," param of ",(0,i.jsx)(s.code,{children:"SerializeActionGenerator::new"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-5",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Speculative fix for ",(0,i.jsx)(s.code,{children:"typegate_prisma_test.ts"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/898",children:"#898"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Assigns special schemas for each test that relies on the\r\n",(0,i.jsx)(s.code,{children:"runtimes/prisma/prisma.py"})," typegraph."]}),"\n",(0,i.jsx)(s.li,{children:"Bumps version tag to 0.5.0-rc4"}),"\n",(0,i.jsx)(s.li,{children:"Fixes issues in release pipeline"}),"\n",(0,i.jsxs)(s.li,{children:["Disables all but the ",(0,i.jsx)(s.code,{children:"test-full"})," job when the test pipeline is run\r\nwith tmate enabled."]}),"\n"]}),(0,i.jsxs)(s.p,{children:["The flakeout of ",(0,i.jsx)(s.code,{children:"typegate_prisma_test.ts"})," has proved difficult to\r\nrecreate. Looking at the code and going from recent similar cases, I\r\nsuspect it happens due to the old code reusing the same pg schema for\r\nmultiple tests. Assigning special schemas for each tests should\r\nhopefully help."]}),(0,i.jsx)(s.h4,{id:"migration-notes-6",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc3---2024-10-30",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.3",children:"v0.5.0-rc.3"})," - 2024-10-30"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-2",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Update license file (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/890",children:"#890"}),")"]})}),(0,i.jsx)(s.h1,{id:"pr-summary",children:"PR Summary"}),(0,i.jsxs)(s.p,{children:["Commit d84e4ed6c3f88d52c95f1491a050daa924e14b87 moved the\n",(0,i.jsx)(s.code,{children:"LICENSE-MPL-2.0.md"})," file. This PR adjusts sources to changes."]}),(0,i.jsx)(s.h4,{id:"migration-notes-7",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Minor bug fixes (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/894",children:"#894"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bug with typegraph context reset around deno_modules"}),"\n",(0,i.jsx)(s.li,{children:"Bug with typegate onPush hook error detection and typegraph parsing of\r\nsuch errors"}),"\n",(0,i.jsx)(s.li,{children:"Bug with artifact resolution when they're reused."}),"\n",(0,i.jsx)(s.li,{children:"Bug with return type of the KvRuntime get functions"}),"\n",(0,i.jsx)(s.li,{children:"Bumps metatype to 0.5.0-rc.3"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-8",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-1",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add substantial (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/891",children:"#891"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"docs"}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"N/A"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration",children:"Migration"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc2---2024-10-24",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.2",children:"v0.5.0-rc.2"})," - 2024-10-24"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-3",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Fix ",(0,i.jsx)(s.code,{children:".apply"})," serialization error with optional structs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/886",children:"#886"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Fix the error on ",(0,i.jsx)(s.code,{children:".apply"})," when the apply tree goes beyond an optional\r\nstruct, mostly changing the implementation of ",(0,i.jsx)(s.code,{children:"resolve_optional"})," method."]}),"\n",(0,i.jsxs)(s.li,{children:["Improve the errors when we encounter an exception raise by\r\n",(0,i.jsx)(s.code,{children:"Result::Err"})," from typegraph_core."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-9",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-1",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add GraphQL alias support for prisma runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/887",children:"#887"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add GraphQL alias support for prisma runtime"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-10",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc1---2024-10-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.1",children:"v0.5.0-rc.1"})," - 2024-10-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-4",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(ci) Disable sccache when secrets not avail (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/874",children:"#874"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Makes sccache optional so PRs from dependabot and forks can still run\r\nthe test suite."}),"\n",(0,i.jsx)(s.li,{children:"Increases sccache allotment to 50g."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Change default installation directory (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/873",children:"#873"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Remplacement PR for #843."}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"..."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-11",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Grpc docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/852",children:"#852"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-12",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Make __typename returns the variant name on unions (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/838",children:"#838"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add missing implementation for static injection for parameter\r\ntransformations on the typegate"}),"\n",(0,i.jsxs)(s.li,{children:["Solves\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-642/gate-typename-on-union-selections-should-hold-member-title",children:"MET-642"}),":\r\nFix the ",(0,i.jsx)(s.code,{children:"__typename"})," result on union variants: return the variant name\r\ninstead of the parent type name"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-13",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsx)(s.h4,{id:"checklist",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Key collision on redis (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/865",children:"#865"}),")"]})}),(0,i.jsxs)(s.p,{children:["Follow up of #863\r\nWhen multiple start occurs for redis, some schedules can happen\r\n",(0,i.jsx)(s.strong,{children:"exactly"})," at the same time resulting into the same identifier (and\r\nleading to an inconsistent state)."]}),(0,i.jsxs)(s.p,{children:["This solution simply combines the ",(0,i.jsx)(s.code,{children:"schedule"})," with the run_id making it\r\nunique instead of using it as is."]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-gql",children:"mutation AllAtOnce {\r\n a: start_retry(kwargs: { .. }) # => calls add_schedule( ... date ...)\r\n b: start_retry(kwargs: { .. })\r\n c: start_retry(kwargs: { .. })\r\n d: start_retry(kwargs: { .. }) \r\n e: start_retry(kwargs: { .. })\r\n f: start_retry(kwargs: { .. })\r\n # ..\r\n}\n"})}),(0,i.jsx)(s.h4,{id:"migration-notes-14",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Fix missing images (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/847",children:"#847"}),")"]})}),(0,i.jsxs)(s.h2,{id:"fix-missing-images-for-durable-execution-blog",children:["Fix missing images for ",(0,i.jsx)(s.code,{children:"durable execution"})," blog"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-15",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve name generation for prisma types (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/849",children:"#849"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-657/sdk-improve-generated-titles-for-prisma-types",children:"MET-657"})]}),(0,i.jsx)(s.h4,{id:"migration-notes-16",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-2",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(blog) Running python with WebAssembly part 1 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/823",children:"#823"}),")"]})}),(0,i.jsx)(s.p,{children:"Running python with webassembly (part 1)"}),(0,i.jsx)(s.h4,{id:"migration-notes-17",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-1",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced a comprehensive guide for integrating Python runtime with\r\nWebAssembly (WASI) in the Metatype ecosystem."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Detailed the advantages of using WebAssembly over Docker for platform\r\nindependence and resource management."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Provided technical requirements and a refined solution for executing\r\nPython scripts in a sandboxed environment."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Expanded vocabulary with new relevant terms for enhanced text\r\nprocessing and validation."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated YAML configuration structure in documentation for clarity on\r\ntype gate usage."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/reference/typegraph/client"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/777",children:"#777"}),")"]})}),(0,i.jsx)(s.p,{children:"Pre-documentation for the code-first queries feature."}),(0,i.jsx)(s.h4,{id:"migration-notes-18",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-2",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(dev) Typegraph explorer (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/859",children:"#859"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add a web version of tree-view which is more interactive"}),"\n",(0,i.jsxs)(s.li,{children:["Enable typegraph serialization without ",(0,i.jsx)(s.code,{children:"metatype.yml"})," config file"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/user-attachments/assets/81771c07-1f2a-493a-81df-969c8182f9bf",alt:"image"})})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Empty object as custom scalar (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/876",children:"#876"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Allow empty object on the output without any change"}),"\n",(0,i.jsxs)(s.li,{children:["Just like ",(0,i.jsx)(s.code,{children:"Int"}),", ",(0,i.jsx)(s.code,{children:"String"}),", and such, rightfully refer the constant\r\n",(0,i.jsx)(s.code,{children:"{}"})," as a scalar"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Any"})," empty object will now be refered as ",(0,i.jsx)(s.code,{children:"EmptyObject"})," scalar"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-19",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk) Overridable templates (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/842",children:"#842"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-630/gen-add-parameter-to-replace-static-sections",children:"MET-630"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Make templates in the ",(0,i.jsx)(s.em,{children:"static"})," sections overridable","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_rust"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_python"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_typescript"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add a CLI tool to generate extract the default template"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-20",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"No changes needed."}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(metagen) Union/either for clients (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/857",children:"#857"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Add union support for the ",(0,i.jsx)(s.code,{children:"client_xx"})," metagen implementations."]}),"\n"]}),(0,i.jsxs)(s.p,{children:["There are still some edge cases especially around variant identification\r\nin the client languages. I tried many things but our hands are tied by\r\nserde. Basically, users will have to be careful when designing their\r\nunion types to avoid ambiguity cases. Hopefully,\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-674/graph-checksvalidation-on-teither",children:"674"}),"\r\nwill help there."]}),(0,i.jsx)(s.h4,{id:"migration-notes-21",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-2",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new methods for rendering union types in both TypeScript\r\nand Python."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced GraphQL query generation with support for multiple union\r\ntypes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added a new ",(0,i.jsx)(s.code,{children:"variants"})," property to the ",(0,i.jsx)(s.code,{children:"NodeMeta"})," type for improved\r\nselection handling."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Improved error handling for node selections and argument processing."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test cases to reflect schema changes and added new tests for\r\nclient functionality."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Redis backend (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/855",children:"#855"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Redis Backend base logic port + some improvements"}),"\n",(0,i.jsxs)(s.li,{children:["Moved ",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_POLL_INTERVAL_SEC"})," and\r\n",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_LEASE_LIFESPAN_SEC"})," to config"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-22",children:"Migration notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Renamed ",(0,i.jsx)(s.code,{children:"Backend.fs()"})," and ",(0,i.jsx)(s.code,{children:"Backend.memory()"})," to ",(0,i.jsx)(s.code,{children:"Backend.dev_fs()"}),"\r\nand ",(0,i.jsx)(s.code,{children:"Backend.dev_memory()"})]}),"\n",(0,i.jsxs)(s.li,{children:["Removed ",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_RELAUNCH_MS"})," as it was relevant only for purely\r\nworker-based runs, which rendered the new\r\n",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_POLL_INTERVAL_SEC"})," redundant when an interrupt hits."]}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-3",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"release-notes",children:"Release Notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced Redis as a new backend option for enhanced data management."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added Docker Compose configuration for a Redis service."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented comprehensive testing for Redis functionality and backend\r\nintegration."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Improved error handling during backend initialization."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated type definitions for backend configurations to streamline\r\nRedis integration."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Refactored test cases for clarity and consistency across different\r\nbackend types."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Retry + timeout on save (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/863",children:"#863"}),")"]})}),(0,i.jsx)(s.p,{children:"Port and improve retry/timeout."}),(0,i.jsx)(s.h4,{id:"migration-notes-23",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Child workflows + docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/867",children:"#867"}),")"]})}),(0,i.jsx)(s.p,{children:"Support for child workflows."}),(0,i.jsx)(s.p,{children:"Solves MET-689 and MET-668."}),(0,i.jsx)(s.h4,{id:"migration-notes-24",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"Previously"}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-python",children:' sub = SubstantialRuntime(backend)\r\n hello = sub.deno(file="workflow.ts", name="sayHello", deps=[])\r\n\r\n g.expose(\r\n # each function start, stop, result, ... holds a copy of the workflow data\r\n start_hello = hello.start(...),\r\n stop_hello = hello.stop()\r\n )\n'})}),(0,i.jsxs)(s.p,{children:["This approach relied on workflow files being referenced in each\r\nmaterializer, but the constructs were too restrictive to support\r\nsomething like ",(0,i.jsx)(s.code,{children:'mutation { results(name: "nameManuallyGiven") }'}),"."]}),(0,i.jsx)(s.p,{children:"We now have instead"}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-python",children:' file = (\r\n WorkflowFile\r\n .deno(file="workflow.ts", deps=[])\r\n .import_(["sayHello"])\r\n .build()\r\n )\r\n\r\n # workflow data are refered only once\r\n sub = SubstantialRuntime(backend, [file])\r\n g.expose(\r\n start_hello = sub.start(...).reduce({ "name": "sayHello" }),\r\n stop = sub.stop()\r\n )\n'})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs,gate) Substantial integration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/844",children:"#844"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs,gate) Port agent concept (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/845",children:"#845"}),")"]})}),(0,i.jsx)(s.p,{children:"Continuation of #844"})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Well-defined type comparison semantics (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/846",children:"#846"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-655/sdk-improve-the-ensuresubtypeof-implementation",children:"MET-655"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Document the type comparison semantics"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Improve the implementation (",(0,i.jsx)(s.code,{children:"EnsureSubtypeOf"})," trait)"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add more test cases for type comparisons"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-25",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No change is needed."})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-4",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"release-notes-1",children:"Release Notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced comprehensive type comparison rules and semantics for\r\nscalar types, optionals, lists, objects, and unions."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added support for enumerated types in the type system, allowing for\r\nmore precise type definitions."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced parent injection mechanism documentation to clarify type\r\ncompatibility requirements."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented a new suite of type comparison tests and validation\r\nmechanisms."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved error reporting and handling in the type validation process."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated and expanded documentation for type comparisons, enumerations,\r\nand parent injections."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added new tests for type comparison and validation scenarios."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Grpc runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/819",children:"#819"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-26",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Python hostcall (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/860",children:"#860"}),")"]})}),(0,i.jsx)(s.p,{children:"Dead lock on python worker"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-27",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-1",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["Checks/validation on t.either (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/868",children:"#868"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: Checks/validation on t.either (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/868",children:"#868"}),")"]}),"\n"]})]}),(0,i.jsx)(s.p,{children:"Emit a warning or an error when a variant is a subtype of another one."}),(0,i.jsx)(s.h4,{id:"migration-notes-28",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"BREAKING CHANGE"}),": Previously valid typegraph might fail validation.\r\nYou will need to fix your types to add some consistency in\r\n",(0,i.jsx)(s.code,{children:"t.either"}),"/",(0,i.jsx)(s.code,{children:"t.union"})," types."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Update prisma + deno + rust deps (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/869",children:"#869"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump deno to 1.46.3"}),"\n",(0,i.jsx)(s.li,{children:"Update prisma-engines to 5.20"}),"\n",(0,i.jsx)(s.li,{children:"Update other rust deps."}),"\n"]}),(0,i.jsx)(s.p,{children:"Closes MET-669 and MET-622 and MET-680."}),(0,i.jsx)(s.h4,{id:"migration-notes-29",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Add err msg for missing env vars (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/827",children:"#827"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-30",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Use stream during artifact upload to s3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/841",children:"#841"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-31",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gen, doc) Rename mdk to fdk (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/851",children:"#851"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-32",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(sdk) Remove index based names (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/848",children:"#848"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: remove index based names (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/848",children:"#848"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Replace index based names for types by one that relies on type context\r\nin graph"}),"\n",(0,i.jsx)(s.li,{children:"Tests for type deduplication"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-33",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"TODO"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["Move as_id out of ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/866",children:"#866"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: Move as_id out of ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/866",children:"#866"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-684/store-the-id-field-in-tstruct-instead-of-in-the-target-type-as-id",children:"MET-684"}),"\r\nand\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-471/parent-injection-use-property-name-instead-of-function-name",children:"MET-471"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"common/typegraph"})}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Store the id field in ",(0,i.jsx)(s.code,{children:"ObjectTypeData"})," instead of in the target\r\ntype (",(0,i.jsx)(s.code,{children:"as_id"}),")","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add ",(0,i.jsx)(s.code,{children:"id()"})," method on ",(0,i.jsx)(s.code,{children:"t.integer"})," and ",(0,i.jsx)(s.code,{children:"t.string"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"typegraph/core"}),"\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Store ",(0,i.jsx)(s.code,{children:"as_id"}),", ",(0,i.jsx)(s.code,{children:"injection"})," and ",(0,i.jsx)(s.code,{children:"policy"})," in ",(0,i.jsx)(s.code,{children:"TypeRef::attribute"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add support for direct and link target in ",(0,i.jsx)(s.code,{children:"TypeRef"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Only allow name registration for ",(0,i.jsx)(s.code,{children:"TypeDef"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Semantics"}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Use property name instead of type name in from_parent injection\r\nsource"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-34",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"BREAKING CHANGE"}),"\r\n",(0,i.jsx)(s.code,{children:"from_parent"})," injections source shall be changed to the key in the\r\nparent ",(0,i.jsx)(s.code,{children:"t.struct"})," instead of the type name."]}),(0,i.jsx)(s.h4,{id:"checklist-1",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move injection data to ",(0,i.jsx)(s.code,{children:"t.func"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/871",children:"#871"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-682/move-all-injection-data-to-tfunc",children:"MET-682"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Move all injection data in ",(0,i.jsx)(s.code,{children:"ObjectTypeData"})," (i.e. ",(0,i.jsx)(s.code,{children:"t.func"}),")"]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-656/sdk-improve-generated-titles-from-applyreduce",children:"MET-656"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Translate reduce to injection specification on ",(0,i.jsx)(s.code,{children:"t.func"})]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-94/remove-runtime-field-from-typenode",children:"MET-94"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Remove runtime field from ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/858",children:"#858"}),")"]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-683/move-runtime-related-type-configs-out-of-typenode",children:"MET-683"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Move runtime-related configs to ",(0,i.jsx)(s.code,{children:"MaterializerData"})," or\r\n",(0,i.jsx)(s.code,{children:"RuntimeData"})]}),"\n",(0,i.jsx)(s.li,{children:"Misc."}),"\n",(0,i.jsxs)(s.li,{children:["Enable random ports for the typegate (when ",(0,i.jsx)(s.code,{children:"TG_PORT=0"}),"); this will\r\nwork with ",(0,i.jsx)(s.code,{children:"meta dev"})," with embedded typegate if you set the ",(0,i.jsx)(s.code,{children:"--gate"}),"\r\noption with port ",(0,i.jsx)(s.code,{children:"0"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-35",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v0410---2024-09-04",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.10",children:"v0.4.10"})," - 2024-09-04"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-2",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to v0.4.10 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/835",children:"#835"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump v0.4.10"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v0410-rc1---2024-09-03",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.10-rc1",children:"v0.4.10-rc1"})," - 2024-09-03"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-5",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Use import_map at runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/833",children:"#833"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump to release v0.4.10-rc1"}),"\n",(0,i.jsx)(s.li,{children:"Use import_map.json at runtime since remote configs aren't supported"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9",children:"v0.4.9"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-3",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to v0.4.9 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/831",children:"#831"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to v0.4.9"}),"\n",(0,i.jsx)(s.li,{children:"Fix issue with cross config context"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049-rc2---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9-rc2",children:"v0.4.9-rc2"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-4",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Prepare 0.4.9-rc2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/829",children:"#829"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix the minor issues with rc1"}),"\n",(0,i.jsx)(s.li,{children:"Bump to rc2"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049-rc1---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9-rc1",children:"v0.4.9-rc1"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"features-3",children:"Features"}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Post on ",(0,i.jsx)(s.code,{children:"Durable Execution"}),". (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/816",children:"#816"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(metagen) Client_ts (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/790",children:"#790"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Implements ",(0,i.jsx)(s.code,{children:"client_ts"})," as described in #777 ."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-36",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-5",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Improved error handling in the ",(0,i.jsx)(s.code,{children:"typegraph"})," function to provide better\r\nerror messages."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated Docker image references to use ",(0,i.jsx)(s.code,{children:"docker.io"})," prefix for\r\nconsistency."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Excluded unnecessary files from the VSCode settings."}),"\n",(0,i.jsx)(s.li,{children:"Enhanced configurability of Docker commands in development tasks."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated environment variable ",(0,i.jsx)(s.code,{children:"GHJK_VERSION"})," to reflect a semantic\r\nversioning format."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced modules and methods for TypeScript and Python code\r\ngeneration in the ",(0,i.jsx)(s.code,{children:"metagen"})," library, enhancing client generation\r\ncapabilities."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added ",(0,i.jsx)(s.code,{children:"test_typegraph_3"})," function for improved testing capabilities."]}),"\n",(0,i.jsx)(s.li,{children:"Included metadata for the package manager in the project settings."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(sub) Sdk and typing (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/811",children:"#811"}),")"]})}),(0,i.jsx)(s.p,{children:"User side of substantial"}),(0,i.jsx)(s.h4,{id:"migration-notes-37",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add caching to Secrets struct to improve performance (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/813",children:"#813"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-38",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-1",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs, gate) Push for ",(0,i.jsx)(s.code,{children:"meta dev"})," instead of ",(0,i.jsx)(s.code,{children:"meta typegate"})," on docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/822",children:"#822"}),")"]})}),(0,i.jsx)(s.h2,{id:"ensure-documentation-is-pushing-for-meta-dev-instead-of-meta-typegate",children:"Ensure documentation is pushing for meta dev instead of meta typegate"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add a warning that envs are not set."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-635/cli-ensure-documentation-is-pushing-for-meta-dev-instead-of-meta",children:"MET-635"})}),(0,i.jsx)(s.h4,{id:"migration-notes-39",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Flatten deps and improve repo folder (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/821",children:"#821"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"libs/"})," to ",(0,i.jsx)(s.code,{children:"src/"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"typegate/"}),", ",(0,i.jsx)(s.code,{children:"meta-cli"}),", ",(0,i.jsx)(s.code,{children:"typegraph/"}),", ",(0,i.jsx)(s.code,{children:"meta-lsp/"})," to ",(0,i.jsx)(s.code,{children:"src/"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"dev/"})," to ",(0,i.jsx)(s.code,{children:"tools/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"website/"})," to ",(0,i.jsx)(s.code,{children:"docs/metatype.dev"}),"/"]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegate/tests"})," to ",(0,i.jsx)(s.code,{children:"tests/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/dev"})," to ",(0,i.jsx)(s.code,{children:"tools/jsr/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/sdk"})," to ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"src/deno"})," to ",(0,i.jsx)(s.code,{children:"src/mt_deno"})]}),"\n",(0,i.jsxs)(s.li,{children:["Bumps deno to ",(0,i.jsx)(s.code,{children:"1.46.1"})]}),"\n",(0,i.jsxs)(s.li,{children:["Bumps rust toolchain to ",(0,i.jsx)(s.code,{children:"1.80.1"})]}),"\n",(0,i.jsx)(s.li,{children:"Moves all rust dependencies to workspace section"}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"tools/task-*.ts"})," to ",(0,i.jsx)(s.code,{children:"tools/task/*.ts"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"cliff.toml"}),", ",(0,i.jsx)(s.code,{children:"Cross.toml"}),", ",(0,i.jsx)(s.code,{children:"ruff.toml"})," to ",(0,i.jsx)(s.code,{children:"tools/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Uses deno\r\n",(0,i.jsx)(s.a,{href:"https://docs.deno.com/runtime/manual/basics/workspaces/",children:"workspaces"})," to\r\norganize ",(0,i.jsx)(s.code,{children:"src/typegraph/deno"}),", ",(0,i.jsx)(s.code,{children:"src/typegate"}),", ",(0,i.jsx)(s.code,{children:"tools/"}),", ",(0,i.jsx)(s.code,{children:"tests/"})," and\r\nmore."]}),"\n",(0,i.jsx)(s.li,{children:"Closes MET-607"}),"\n",(0,i.jsx)(s.li,{children:"Updates poetry to 1.8.3"}),"\n",(0,i.jsx)(s.li,{children:"Bumps metatype to version 0.4.9-rc1"}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Update CONTRIBUTING.md"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix CI workflows"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix Dockerfile"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix all tests"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-40",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"No end user changes required"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v048---2024-08-16",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.8",children:"v0.4.8"})," - 2024-08-16"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-6",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Table method for kv runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/815",children:"#815"}),")"]})}),(0,i.jsxs)(s.p,{children:["I discover an issue in the KV runtime documentation\r\n",(0,i.jsx)(s.a,{href:"https://metatype.dev/docs/reference/runtimes/kv",children:"kvruntime docs"})]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"wasm_backtrace"})," config bug (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/814",children:"#814"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"$WASM_BACKTRACE_DETAILS"})," was enabled in ",(0,i.jsx)(s.code,{children:"main"})," ghjk env which\r\naffected embedded wasm module compilation to have backtrace enabled.\r\nThis broke typegate runs without the flag enabled due to mismatch."]}),"\n",(0,i.jsx)(s.li,{children:"Fixes Cargo.lock not being used in Dockerfile."}),"\n",(0,i.jsx)(s.li,{children:"Prepare 0.4.8 release"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-4",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Kv runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/797",children:"#797"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-41",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-5",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to 0.4.8-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/810",children:"#810"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump prerelease"}),"\n",(0,i.jsx)(s.li,{children:"Fix minor issue with release pipeline"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v047---2024-08-08",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.7",children:"v0.4.7"})," - 2024-08-08"]}),"\n",(0,i.jsx)(s.h3,{id:"features-5",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Fix auto deployment (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/806",children:"#806"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Upgrade lade-sdk"}),"\n",(0,i.jsx)(s.li,{children:"Fix discovery"}),"\n",(0,i.jsx)(s.li,{children:"Remove obsolete dep: actix-web"}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"lade-sdk"})," uses the main branch, which now has the fix for the\r\nfollowing issues:"]}),"\n",(0,i.jsxs)(s.li,{children:["dependency version conflict with\r\n",(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/deno/blob/691f297537c4a3d9a12ce005c0478b4aee86287c/Cargo.toml#L179",children:"deno"}),":\r\n",(0,i.jsx)(s.code,{children:"url"})," is set at ",(0,i.jsx)(s.code,{children:"<2.5.0"}),";"]}),"\n",(0,i.jsx)(s.li,{children:"required ProjectID error for infisical: the project id is added\r\nexplicitly on the command."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-42",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Cors headers on error (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/803",children:"#803"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-43",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-6",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to 0.4.7-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/805",children:"#805"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to 0.4.7-0"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-2",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Add how to test typegraphs doc (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/798",children:"#798"}),")"]})}),(0,i.jsxs)(s.h1,{id:"how-to-test-your-typegraphs-documentation",children:[(0,i.jsx)(s.code,{children:"How to test your typegraphs"})," documentation"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add python doc"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add ts doc"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","upgrade bitnami/minIo image to 2024?"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-44",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-6",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated the Minio service to the latest version for improved\r\nperformance and potential new features."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced comprehensive documentation for testing typegraphs in both\r\nTypeScript and Python, enhancing developer experience."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Enhanced readability of the ",(0,i.jsx)(s.code,{children:"Meta CLI"})," upgrade instructions."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Reformatted installation instructions for the ",(0,i.jsx)(s.code,{children:"typegraph"})," package for\r\nbetter clarity."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated dependency management configuration for improved compatibility\r\nand performance across different platforms."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve JSR score (part 1) (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/807",children:"#807"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add symbol documentations"}),"\n",(0,i.jsx)(s.li,{children:"Fix slow types"}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-45",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v046---2024-08-01",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.6",children:"v0.4.6"})," - 2024-08-01"]}),"\n",(0,i.jsx)(s.h3,{id:"features-6",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Better arg split logic for MCLI_LOADER (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/799",children:"#799"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-46",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-7",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Prepare 0.4.6 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/795",children:"#795"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to 0.4.6-0"}),"\n",(0,i.jsx)(s.li,{children:"Add sanity tests for published SDKs"}),"\n",(0,i.jsx)(s.li,{children:"Bump deno to 1.45.2"}),"\n",(0,i.jsx)(s.li,{children:"Bump rust to 1.79.0"}),"\n",(0,i.jsx)(s.li,{children:"Fix myriad of bugs"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-47",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-7",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced new logging capabilities in the ",(0,i.jsx)(s.code,{children:"ConnectedEngine"})," with\r\nadjustable logging levels."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented cleanup procedures in tests to enhance resource\r\nmanagement."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fixed import paths for permissions to ensure correct functionality in\r\ntests and applications."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Version Updates"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Incremented version numbers across multiple projects and packages to\r\nreflect ongoing development and improvements."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added comments to clarify code behavior and potential future\r\nconsiderations in various modules."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Optimized string handling in several functions and adjusted method\r\nsignatures for improved clarity and efficiency."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-3",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Better documentation on ",(0,i.jsx)(s.code,{children:"quick-start"})," page (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/793",children:"#793"}),")"]})}),(0,i.jsxs)(s.h2,{id:"improve-the-documentation-on-quick-start-page",children:["Improve the documentation on ",(0,i.jsx)(s.code,{children:"quick-start"})," page"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add dev hunt result to homepage."]}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-48",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v045---2024-07-18",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.5",children:"v0.4.5"})," - 2024-07-18"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-7",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Broken pipeline for 0.4.4 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/782",children:"#782"}),")"]})}),(0,i.jsxs)(s.p,{children:["Fixes erroneous usage of ",(0,i.jsx)(s.code,{children:"setup-deno"})," which has been replaced by ",(0,i.jsx)(s.code,{children:"ghjk"}),"\r\nitself."]}),(0,i.jsx)(s.h4,{id:"migration-notes-49",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Broken release pipeline 2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/783",children:"#783"}),")"]})}),(0,i.jsx)(s.p,{children:"Fix issue with the three remaining failing jobs."}),(0,i.jsx)(s.h4,{id:"migration-notes-50",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Release pipeline 3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/784",children:"#784"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Remove accidental dry-run from jsr publish"}),"\n",(0,i.jsx)(s.li,{children:"Fix cross dockerfile"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-51",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Skip deno stack trace from error message (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/787",children:"#787"}),")"]})}),(0,i.jsx)(s.p,{children:"Skip the deno stack trace from the error message when tg_manage fails."}),(0,i.jsx)(s.h4,{id:"migration-notes-52",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-7",children:"Features"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(cli) Configurable backoff (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/789",children:"#789"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: configurable backoff (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/789",children:"#789"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Make the backoff configurable through the ",(0,i.jsx)(s.code,{children:"--retry"})," and\r\n",(0,i.jsx)(s.code,{children:"--retry-interval-ms"})," options."]}),"\n",(0,i.jsx)(s.li,{children:"The default max retry count is changed to 0 on the default mode, and\r\nremains 3 on the watch mode."}),"\n",(0,i.jsxs)(s.li,{children:["The ",(0,i.jsx)(s.code,{children:"--max-parallel-loads"})," option has been renamed to ",(0,i.jsx)(s.code,{children:"--threads"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-53",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"--max-parallel-loads"})," option has been renamed to ",(0,i.jsx)(s.code,{children:"--threads"}),"."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add list subcommand features to meta_cli (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/775",children:"#775"}),")"]})}),(0,i.jsx)(s.p,{children:"new branch after conflict with main branch"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-54",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upgrade www and gha (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/786",children:"#786"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add back gleap (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/791",children:"#791"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Gleap.io was removed a while back"}),"\n",(0,i.jsx)(s.li,{children:"this adds it back so visitors can open ticket and suggest feedback"}),"\n",(0,i.jsx)(s.li,{children:"internally, we will use this to fine tune the documentation"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-8",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump v0.4.5 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/792",children:"#792"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bumps metatype version to 0.4.5"}),"\n",(0,i.jsx)(s.li,{children:"Bumps ghjk to latest commit"}),"\n",(0,i.jsxs)(s.li,{children:["Fixes ",(0,i.jsx)(s.code,{children:"setup"})," whiz task to avoid issues on macos"]}),"\n",(0,i.jsx)(s.li,{children:"Fixes release pipeline to publish JSR"}),"\n"]}),(0,i.jsx)(s.p,{children:"MET-614 MET-606 MET-605 MET-613"}),(0,i.jsx)(s.h4,{id:"migration-notes-55",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No changes required."})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v044---2024-07-05",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.4",children:"v0.4.4"})," - 2024-07-05"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-8",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Ensure all deps are defined in import_map.json (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/768",children:"#768"}),")"]})}),(0,i.jsxs)(s.p,{children:["Ensure that all deps are defined in ",(0,i.jsx)(s.code,{children:"import_map.json"})," with a specific\r\nversion."]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Missing typegraphs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/755",children:"#755"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"fix the typegraphs that were incorrectly formatted"}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Stable formatting and uniformize the code-loader (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/766",children:"#766"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"add prettier to avoid doc formatting issue"}),"\n",(0,i.jsxs)(s.li,{children:["now explicitly require ",(0,i.jsx)(s.code,{children:"!!code-loader!"})," to load code inside the\r\ndocumentation (will hopefully help also with the missing typegraphs\r\nissues, still under investigation)"]}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-3",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Generate clients from openapi (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/778",children:"#778"}),")"]})}),(0,i.jsx)(s.p,{children:"Demonstrate how to use the openapi spec to generate clients in most\r\nlanguages/frameworks."}),(0,i.jsx)(s.h4,{id:"migration-notes-56",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-8",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Updated REST API documentation URLs with placeholders for easier\r\nconfiguration."}),"\n",(0,i.jsx)(s.li,{children:"Added information on generating and using OpenAPI clients, including\r\nTypeScript fetch client generation."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsx)(s.li,{children:"Corrected a regular expression in import handling to ensure accurate\r\nreplacements."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsx)(s.li,{children:"Improved file writing by appending a newline character to JSON\r\nstrings."}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-8",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move all the configs to one single file (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/733",children:"#733"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Move all the configs to one single file"}),"\n",(0,i.jsxs)(s.li,{children:["Remove some specific configs from the global config variable and make\r\nthem accessible on the ",(0,i.jsx)(s.code,{children:"Typegate"})," instance, to improve test\r\nconfigurability."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-57",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"SYNC_REDIS_PASSWORD"})," has been removed, can only be set on the\r\n",(0,i.jsx)(s.code,{children:"SYNC_REDIS_URL"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Remove restrictions for union/either types (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/761",children:"#761"}),")"]})}),(0,i.jsx)(s.p,{children:"In the previous versions, we restricted the variant types allowed in\r\nunion/either to be all in the same category (after flattening\r\nmulti-level unions):"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.em,{children:"Category 1"})," - ",(0,i.jsx)(s.strong,{children:"GraphQL leaf types"}),": scalar type, or array of scalar\r\ntype, which require no selection set on GraphQL."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.em,{children:"Category 2"})," - ",(0,i.jsx)(s.strong,{children:"GraphQL non-leaf types"}),": object type or array of\r\nobject type, which require a selection set on GraphQL (aka selectable\r\ntypes in the codebase)."]}),"\n"]}),(0,i.jsxs)(s.p,{children:["Those restrictions can be lifted, and the selection field of an\r\nunion-type field will have inline fragments with type conditions for\r\neach ",(0,i.jsx)(s.em,{children:"Category 2"})," variant. No type condition is required for ",(0,i.jsx)(s.em,{children:"Category\r\n1"})," types, the selection sets are not relevant."]}),(0,i.jsx)(s.p,{children:"The case that is not handled by this PR is when one of the variants is\r\nan array of union type."}),(0,i.jsx)(s.h4,{id:"migration-notes-58",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Typegate in meta dev, upgrade test (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/776",children:"#776"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Test the typegate upgrade from the latest published version to the\r\ncurrent version."}),"\n",(0,i.jsxs)(s.li,{children:["Add a flag to run an instance of the typegate with the target\r\nconfiguration (port, admin passsword) to ",(0,i.jsx)(s.code,{children:"meta deploy"}),", enabled by\r\ndefault for ",(0,i.jsx)(s.code,{children:"meta dev"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-59",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["If you have a script that runs ",(0,i.jsx)(s.code,{children:"meta dev"}),", add the flag ",(0,i.jsx)(s.code,{children:"--no-typegate"}),"\r\nif you already have a typegate."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-9",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add programmatic deploy tests (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/769",children:"#769"}),")"]})}),(0,i.jsx)(s.h2,{id:"add-programmatic-deploy-tests-for-the-docs",children:"Add Programmatic deploy tests for the docs"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add programmatic typegraph deploy/remove tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","refactor tg_remove to accept ",(0,i.jsx)(s.code,{children:"typegraph_name"})," instead of\r\n",(0,i.jsx)(s.code,{children:"TypegraphOutput"})," obj."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-591/docstest-test-example-script-for-tg-deploy",children:"MET-591"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-60",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to version 0.4.4 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/779",children:"#779"}),")"]})}),(0,i.jsx)(s.p,{children:"Prepare release of the 0.4.4 version."}),(0,i.jsx)(s.h4,{id:"migration-notes-61",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-4",children:"Refactor"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(sdk) Back to deno + jsr exploration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/760",children:"#760"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: back to deno + jsr exploration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/760",children:"#760"}),")"]}),"\n"]})]}),(0,i.jsx)(s.p,{children:"Try reverting back to deno runtime for the typescript sdk in hope of\r\nmaking the dx easier.\r\nHosting a custom node/npm project adds more layer of indirection which\r\nmay result in cryptic issues sometimes."}),(0,i.jsxs)(s.p,{children:["This should also facilitate publishing on jsr although additional work\r\nare still required on the ",(0,i.jsx)(s.code,{children:"jco"})," codegen side."]}),(0,i.jsx)(s.h4,{id:"migration-notes-62",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move to ghjk 0.2.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/754",children:"#754"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Refactors the ghjk.ts, CI to the latest version of ghjk"}),"\n",(0,i.jsx)(s.li,{children:"Bumps version to 0.4.4-0"}),"\n",(0,i.jsx)(s.li,{children:"Fixes race bug in python_sync tests"}),"\n",(0,i.jsxs)(s.li,{children:["Fixes flakeout of wasm ",(0,i.jsx)(s.code,{children:"build.sh"})," scripts due to wasm-tools EOF issue"]}),"\n",(0,i.jsx)(s.li,{children:"#763"}),"\n",(0,i.jsx)(s.li,{children:"#746"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-63",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-9",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.li,{children:["Updated GitHub Actions workflows to use the latest version of\r\n",(0,i.jsx)(s.code,{children:"metatypedev/setup-ghjk"})," for improved stability and performance."]}),"\n",(0,i.jsxs)(s.li,{children:["Modified ",(0,i.jsx)(s.code,{children:"GHJK_VERSION"})," and various environment variables across\r\nmultiple configuration files to ensure compatibility with updated\r\ndependencies."]}),"\n",(0,i.jsx)(s.li,{children:"Revised Dockerfiles to streamline environment setup and improve build\r\nefficiency."}),"\n",(0,i.jsxs)(s.li,{children:["Updated dependency management in ",(0,i.jsx)(s.code,{children:"pyproject.toml"})," for better security\r\nand performance.","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced logging and error handling in test scripts."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.p,{children:"These updates collectively optimize the development environment,\r\nensuring smoother builds and more reliable workflows."}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"testing",children:"Testing"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(full) Update test runner (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/705",children:"#705"}),")"]})}),(0,i.jsx)(s.p,{children:"New test runner, by default:"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Less verbose"}),"\n",(0,i.jsx)(s.li,{children:"No output for successful tests"}),"\n"]}),(0,i.jsx)(s.p,{children:"Parallel tests re-enabled."}),(0,i.jsx)(s.h4,{id:"migration-notes-64",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})})]}),"\n",(0,i.jsxs)(s.h2,{id:"v043---2024-06-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.3",children:"v0.4.3"})," - 2024-06-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-9",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(ci) Poetry lockfile (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/732",children:"#732"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fixes poetry lockfile and adds pre-commit hook to prevent issue from\nhappening"}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Fix demo typegraphs 2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/756",children:"#756"}),")"]})}),(0,i.jsx)(s.p,{children:"Fix example typegraphs on metatype.dev."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","reduce.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","policies.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","graphql.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","authentication.ts"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-574/docs-fix-demo-typegraphs-2",children:"MET_574"})}),(0,i.jsx)(s.h4,{id:"migration-notes-65",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Fix programmatic deployment guides (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/762",children:"#762"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix typo"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix/test tg deploy"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix/test tg remove"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-587/docs-fix-programmatic-deployment-guides",children:"MET-587"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-66",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Only build xtask once for the tests (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/720",children:"#720"}),")"]})}),(0,i.jsx)(s.p,{children:"Use the xtask binary to run the tests."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-10",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Updated platform compatibility to ",(0,i.jsx)(s.code,{children:"x86_64-linux"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new configuration entry for enhanced versioning and platform\r\nsupport."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Improvements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Modified test script to use a custom build script for better test\r\nmanagement."}),"\n"]}),"\n"]}),(0,i.jsx)(s.p,{children:"These changes improve platform compatibility and streamline the testing\r\nprocess."}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Missing typegraphs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/741",children:"#741"}),")"]})}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Fix Missing Typegraphs"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"attempt to fix the missing typegraphs on metatype.dev."}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-563/docs-complete-missing-typegraphs",children:"MET-563"})}),(0,i.jsx)(s.h4,{id:"migration-notes-67",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.em,{children:"No Migrations Needed"}),"\r\n..."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upload url path and add logging in the SDK (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/740",children:"#740"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix upload url: prepare-upload returns upload tokens instead of upload\r\nurls"}),"\n",(0,i.jsx)(s.li,{children:"Add logging in the typegraph SDK"}),"\n",(0,i.jsx)(s.li,{children:"Refactor the actor system in the CLI"}),"\n",(0,i.jsx)(s.li,{children:"Use jsonrpc for communication between the CLI and typegraph processes\r\n(over stdin/stdout)"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-68",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"typegraphs.deno"})," section of the ",(0,i.jsx)(s.code,{children:"metatype.yaml"})," config file has\r\nbeen replaced by ",(0,i.jsx)(s.code,{children:"typegraphs.typescript"})," and ",(0,i.jsx)(s.code,{children:"typegraphs.javascript"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"tg_deploy"})," params has changed."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Failed typegraph deployment (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/758",children:"#758"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix casing typo in the typescript sdk"}),"\n",(0,i.jsx)(s.li,{children:"Fix error reporting in the typescript sdk"}),"\n",(0,i.jsx)(s.li,{children:"Display the retry number"}),"\n",(0,i.jsx)(s.li,{children:"Warning on cancelled retry"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-69",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-4",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/concepts/features-overview/"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/725",children:"#725"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Re-does the feature overview page of the documentation."}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-11",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Added a "Features Roadmap" component to the website, displaying a list\r\nof features with details and links.'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated various guides and reference documents to improve clarity and\r\npresentation of code examples."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new sections for various features such as Typegate, Typegraph,\r\nRuntimes, Prisma, Auth, Tooling, and SDK."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Corrected a typo in the GraphQL runtimes reference documentation."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Replaced ",(0,i.jsx)(s.code,{children:"SDKTabs"})," and ",(0,i.jsx)(s.code,{children:"TabItem"})," components with ",(0,i.jsx)(s.code,{children:"TGExample"})," for\r\nbetter code example presentation."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Adjusted the ",(0,i.jsx)(s.code,{children:"MiniQL"})," component to handle optional properties and\r\ndefault settings."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/reference/metagen"})," + ",(0,i.jsx)(s.code,{children:"/docs/guides/wasm-functions"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/751",children:"#751"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Adds ",(0,i.jsx)(s.code,{children:"/docs/reference/metagen"})]}),"\n",(0,i.jsxs)(s.li,{children:["Adds ",(0,i.jsx)(s.code,{children:"/docs/guides/wasm-functions"})]}),"\n",(0,i.jsxs)(s.li,{children:["Adds a codegen section to ",(0,i.jsx)(s.code,{children:"/docs/guides/external-functions"})]}),"\n"]}),(0,i.jsx)(s.p,{children:"MDK-492."}),(0,i.jsx)(s.h4,{id:"migration-notes-70",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-12",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added new targets for ",(0,i.jsx)(s.code,{children:"metagen"})," with different generators and paths\r\nfor TypeScript, Python, and Rust."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionality for defining and exposing typegraphs with\r\npolicies in various environments (Deno, Python, Rust)."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added automated Rust WebAssembly project generation and compilation\r\nscript."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Enhanced documentation with new sections and updated code examples\r\nusing ",(0,i.jsx)(s.code,{children:"TGExample"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Updated ",(0,i.jsx)(s.code,{children:".gitignore"})," to exclude ",(0,i.jsx)(s.code,{children:"*.wasm"})," files."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated links and added detailed instructions for generating types\r\nusing ",(0,i.jsx)(s.code,{children:"metagen"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Switched from ",(0,i.jsx)(s.code,{children:"HashMap"})," to ",(0,i.jsx)(s.code,{children:"BTreeMap"})," and ",(0,i.jsx)(s.code,{children:"HashSet"})," to ",(0,i.jsx)(s.code,{children:"BTreeSet"})," in\r\nvarious modules for better data structure handling."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added logging enhancements in the ",(0,i.jsx)(s.code,{children:"Typegate"})," class."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Updated build script for Rust WebAssembly target."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Programmatic deployment blogpost (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/752",children:"#752"}),")"]})}),(0,i.jsx)(s.p,{children:"Blogpost to help discover programmatic deployment additions."}),(0,i.jsx)(s.h4,{id:"migration-notes-71",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-13",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced programmatic deployment feature for deploying typegraphs\nwithin the Metatype ecosystem using TypeScript/Python SDKs."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new configuration options and deployment functions to enhance\nautomation and flexibility in deployment processes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added a new blog post detailing the programmatic deployment feature\nand its usage."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-9",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(SDK) Add ",(0,i.jsx)(s.code,{children:"globs"})," and ",(0,i.jsx)(s.code,{children:"dir"})," support for artifact deps. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/698",children:"#698"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Include glob and dir support for ",(0,i.jsx)(s.code,{children:"PythonRuntime"})," deps."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Include glob and dir support for ",(0,i.jsx)(s.code,{children:"DenoRuntime"})," deps."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add tests"]}),"\n"]}),(0,i.jsxs)(s.p,{children:["The change includes support for declaring artifact dependencies through\r\n",(0,i.jsx)(s.code,{children:"globs"})," and ",(0,i.jsx)(s.code,{children:"dirs"})]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-441/sdk-support-globs-and-directories-in-artifact-dependencies",children:"MET-441"})}),(0,i.jsx)(s.h4,{id:"migration-notes-72",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["In the ",(0,i.jsx)(s.code,{children:"deps"})," parameter for ",(0,i.jsx)(s.code,{children:"python.import(...)"})," and ",(0,i.jsx)(s.code,{children:"deno.import(...)"}),",\r\nglobs and dirs can be passed in addition to files."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-14",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced functionality for defining and deploying Typegraphs for\r\nDeno and Python runtimes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added support for defining a Deno runtime dependency graph with\r\npolicies for test scenarios."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Corrected the structure of the ",(0,i.jsx)(s.code,{children:"Deno.serve"})," call in the ",(0,i.jsx)(s.code,{children:"serve"}),"\r\nfunction."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Enhanced method chaining for better readability in the ",(0,i.jsx)(s.code,{children:"MetaTest"}),"\r\nclass."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test coverage reporting to include new Deno runtime test\r\nfiles."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Commented out and removed outdated test cases in Deno runtime tests."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Updated platform specification in configuration files."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Add ",(0,i.jsx)(s.code,{children:"embedded typegate"})," page (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/747",children:"#747"}),")"]})}),(0,i.jsx)(s.h1,{id:"embedded-typegate-docs-page",children:"Embedded typegate docs page"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","need a page under meta-cli/embedded typegate to explain how that\r\nworks"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","tutorials should take advantage of the embedded one"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","the embedded one should be the default everything"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","explain that there is 2 flavors in reference/meta-cli"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-562/docs-use-embedded-whenever-possible-in-the-docs-and-examples",children:"MET-562"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-73",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.em,{children:"No Migrations Needed"}),"\r\n..."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk) Mdk python (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/707",children:"#707"}),")"]})}),(0,i.jsx)(s.p,{children:"Mdk for python runtime"}),(0,i.jsx)(s.h4,{id:"migration-notes-74",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-15",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities for generating Python code based on\r\nconfigurations, including handling of templates and required objects."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added Python script templates for defining typed functions and\r\nstructured objects with comprehensive data type handling."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced type management and priority handling in utility functions."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Provided detailed summaries and documentation for new functionalities\r\nand templates."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented new structures and methods for efficient code generation\r\nand type handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added tests for defining typegraph structures and policies in Python."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated URLs in the ",(0,i.jsx)(s.code,{children:".ghjk/deno.lock"})," file to reflect new changes in\r\nthe codebase."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(mdk) ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/739",children:"#739"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/739",children:"#739"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Implements the ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," code generator for typescript type\ninference on Deno runtime external modules."]}),"\n",(0,i.jsx)(s.li,{children:"Ports the very simple generator already present in meta-cli."}),"\n",(0,i.jsx)(s.li,{children:"Removes old codegen from cli and sdk."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-75",children:"Migration notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Metagen section of ",(0,i.jsx)(s.code,{children:"metatype.yaml"})," has changed. Targets are now lists\ninstead of maps, items no sporting ",(0,i.jsx)(s.code,{children:"generator"})," field instead of key\nacting as ref to generator."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) WasmRuntime's ",(0,i.jsx)(s.code,{children:"fromExport"})," method has been renamed to ",(0,i.jsx)(s.code,{children:"export"}),"\nto make it more uniform to handler."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) WasmRuntime ",(0,i.jsx)(s.code,{children:"export"})," and ",(0,i.jsx)(s.code,{children:"handler"})," method's now expect\nhandler/func name under ",(0,i.jsx)(s.code,{children:"name"})," instead of ",(0,i.jsx)(s.code,{children:"func"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) ",(0,i.jsx)(s.code,{children:"codegen"})," flag has been removed from ",(0,i.jsx)(s.code,{children:"ArtifactsConfig"})," object."]}),"\n",(0,i.jsxs)(s.li,{children:["(cli) ",(0,i.jsx)(s.code,{children:"gen mod/mdk"})," has been simplified to just ",(0,i.jsx)(s.code,{children:"gen"})," as the previous\nmod option is no longer avail."]}),"\n"]}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk,gate) Hostcall (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/706",children:"#706"}),")"]})}),(0,i.jsx)(s.p,{children:"Introduces a mechanism for wasm materializers to access hostgate\r\nfunctions."}),(0,i.jsxs)(s.p,{children:["This implements a pretty basic JSON wire interface, a singular\r\n",(0,i.jsx)(s.code,{children:"hostcall"})," function that's exposed to materializers. The only\r\nimplemented function on this interface are ",(0,i.jsx)(s.code,{children:"gql"})," queries."]}),(0,i.jsx)(s.p,{children:"This is a stacked PR on top of #687."}),(0,i.jsx)(s.p,{children:"MET-473."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-16",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added an import statement for ",(0,i.jsx)(s.code,{children:"std_url"})," and a new task for installing\r\nWASI adapter related files."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities in the application's runtime to support\r\nadditional parameters and error handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Enhancements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved the application's handling of GraphQL queries with new error\r\ntypes and display methods."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced the WASM runtime build process to target a more appropriate\r\narchitecture."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fixed issues in Python and WASM runtime tests to ensure reliability\r\nand performance."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated internal documentation to reflect new command interfaces and\r\nenvironmental interactions in the application's CLI tools."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Refactored various internal APIs to improve code maintainability and\r\nefficiency."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(meta-test) Update ",(0,i.jsx)(s.code,{children:"t.engine()"})," impl (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/716",children:"#716"}),")"]})}),(0,i.jsxs)(s.p,{children:["Update the implementation of ",(0,i.jsx)(s.code,{children:"t.engine()"})]}),(0,i.jsxs)(s.p,{children:["The change comes with removing the different spin-offs of ",(0,i.jsx)(s.code,{children:"t.engine"}),"\r\nwhich arose from the previous impl of t.engine incompatibility with\r\nartifact upload protocol. The change will make ",(0,i.jsx)(s.code,{children:"t.engine"})," deploy the\r\nartifacts in Artifact Resolution mode by running a shell command to\r\ndeploy the typegraph."]}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-500/test-update-the-implementation-of-tengine",children:"MET-500"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","remove different versions of ",(0,i.jsx)(s.code,{children:"t.engine"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add tg_deploy caller script which imports typegraphs dynamically\r\nand deploys them."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","make changes to make ",(0,i.jsx)(s.code,{children:"t.engine"})," run in artifact resolution mode"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","update existing tests to adhere to the current change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","pass unique different ",(0,i.jsx)(s.code,{children:"tempDir"}),"s to all the typegate instances\r\ncreated during test."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add support for authoring multiple typegraphs in a single file in\r\n",(0,i.jsx)(s.code,{children:"meta-test"})," and add multi typegraph tests."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-76",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"python SDK test typegraphs' function names should be the same with the\r\nfilename of the typegraph file, for dynamic import compatibility\r\nreasons."}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-17",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced a new function ",(0,i.jsx)(s.code,{children:"wasm_duplicate"})," to handle WebAssembly\r\nruntimes with specific policies."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Renamed and refactored functions and test setups to align with updated\r\ntest frameworks and improve code clarity."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added error handling in the ",(0,i.jsx)(s.code,{children:"getLocalPath"})," function to log warnings if\r\nlinking errors occur."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test scripts to reflect changes in function calls, imports,\r\nand engine instantiation for better test accuracy and reliability."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Doc polish (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/735",children:"#735"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"doc polish and cleanup"}),"\n",(0,i.jsx)(s.li,{children:"upgrade website except Docusaurus as the css issue is stil present"}),"\n",(0,i.jsx)(s.li,{children:"bump to next pre-release"}),"\n",(0,i.jsx)(s.li,{children:"not everything is done, but let's iterate!"}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-18",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added platform compatibility for ",(0,i.jsx)(s.code,{children:"x86_64-linux"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities for generating Python code and enhanced\r\ntype management."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added import statement for ",(0,i.jsx)(s.code,{children:"std_url"})," and new task for installing WASI\r\nadapter files."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced runtime support for additional parameters and error handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Improvements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced GraphQL query handling with new error types and display\r\nmethods."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved WASM runtime build process for better architecture targeting."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:'Updated feature overview and added a "Features Roadmap" component.'}),"\n",(0,i.jsx)(s.li,{children:"Enhanced various guides and references for better clarity."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new sections for Typegate, Typegraph, Runtimes, Prisma, Auth,\r\nTooling, and SDK."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Corrected typos and improved code example presentation."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fixed issues in Python and WASM runtime tests to ensure reliability."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-10",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Replace term materializer with function for user facing concepts (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/736",children:"#736"}),")"]})}),(0,i.jsx)(s.p,{children:"Materializer and function might introduce confusion as they are pretty\r\nmuch the same thing from the user point of view, one can be defined in\r\nterms of the other."}),(0,i.jsx)(s.h4,{id:"migration-notes-77",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-19",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:'Updated terminology from "materializers" to "functions" across various\r\ndocumentation files to reflect a semantic shift and provide clearer\r\ndescriptions.'}),"\n",(0,i.jsx)(s.li,{children:"Improved clarity in descriptions of custom functions, runtimes, and\r\ntheir roles in the Metatype computing model."}),"\n",(0,i.jsx)(s.li,{children:"Corrected typos and refined explanations in multiple guides and\r\nreference documents."}),"\n"]}),(0,i.jsx)(s.p,{children:"These changes enhance the readability and consistency of our\r\ndocumentation, making it easier for users to understand and implement\r\nthe features and concepts within the system."})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Embedded typegate (v0.3.x) blog (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/750",children:"#750"}),")"]})}),(0,i.jsx)(s.h1,{id:"add-a-blog-about-embedded-typegate",children:"Add a blog about Embedded Typegate."}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-564/docs-embedded-typegate-v03x",children:"MET-564"})}),(0,i.jsx)(s.h4,{id:"migration-notes-78",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-20",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced a new blog post on emulating server nodes locally using the\r\nEmbedded Typegate feature in Meta CLI."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added a new ",(0,i.jsx)(s.code,{children:"BlogIntro"})," component to the website for displaying styled\r\nblog introductions."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated documentation to explain how to spin up a local instance of\r\nTypegate for testing and development."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated platform compatibility from "x86_64-linux" to\r\n"aarch64-darwin".'}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(website) ",(0,i.jsx)(s.code,{children:"g.rest"})," reference at ",(0,i.jsx)(s.code,{children:"/docs/reference/rest"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/734",children:"#734"}),")"]})}),(0,i.jsxs)(s.p,{children:["Add reference page for ",(0,i.jsx)(s.code,{children:"g.rest(..)"})]}),(0,i.jsx)(s.h4,{id:"migration-notes-79",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-21",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Documentation"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added a reference to the REST reference section in the REST guide."}),"\n",(0,i.jsx)(s.li,{children:"Introduced new documentation for consuming APIs using Metatype."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["Included examples in Python and TypeScript for interacting with REST\r\nAPIs.","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Explained query types, dynamic queries, and endpoint access."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Provided guidance on accessing auto-generated documentation and\r\ndownloading the OpenAPI spec."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump deno to 1.43.6 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/737",children:"#737"}),")"]})}),(0,i.jsx)(s.p,{children:"Update deno to 1.43.6 and make requisite changes."}),(0,i.jsx)(s.p,{children:"Required because of dep conflicts with latest lade-sdk."}),(0,i.jsx)(s.h4,{id:"migration-notes-80",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Update ",(0,i.jsx)(s.code,{children:"rust"})," dependencies (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/748",children:"#748"}),")"]})}),(0,i.jsx)(s.p,{children:"update Rust dependencies"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-479/sdkgate-update-rust-dependencies",children:"MET-479"})}),(0,i.jsx)(s.h4,{id:"migration-notes-81",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump ",(0,i.jsx)(s.code,{children:"METATYPE_VERSION"})," to 0.4.3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/764",children:"#764"}),")"]})})}),"\n",(0,i.jsxs)(s.h2,{id:"v042---2024-05-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.2",children:"v0.4.2"})," - 2024-05-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-10",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Fix fat CLI compilation (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/730",children:"#730"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fix fat CLI compilation"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump to 0.4.2"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump wasmtime to 21"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump rust to 1.78.0"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v041---2024-05-20",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.1",children:"v0.4.1"})," - 2024-05-20"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-11",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(SDK) Artifact upload fails when same file referred multiple times (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/715",children:"#715"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix the bug where duplicate artifact references causing failure\r\nduring artifact resolution(typegate) during runtime."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add sync mode tests for Python and Deno runtime."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add other edge test cases to artifact upload.","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","test for no artifact in typegraph"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","test for duplicate artifact reference in the same typegraph"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Improve logging and responses, prepare 0.4.1 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/714",children:"#714"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Logging before and after each faillible operation","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Runtimes: foreign resolvers"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Always log before reporting error: HTTP response"}),"\n",(0,i.jsx)(s.li,{children:"Fix error code in artifact_service"}),"\n",(0,i.jsxs)(s.li,{children:["Add ",(0,i.jsx)(s.code,{children:"BaseError"})," class for structured messages in responses"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-22",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated Docker image versions and dependency versions to ensure\r\ncompatibility and stability."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added a search functionality to the app."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced error handling with specific error classes for more detailed\r\nerror messages."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Replaced generic ",(0,i.jsx)(s.code,{children:"Error"})," instances with specific error classes for\r\nbetter error categorization."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Refactored error handling in HTTP response functions to use a\r\n",(0,i.jsx)(s.code,{children:"BaseError"})," class."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated version numbers across multiple configuration files to\r\n",(0,i.jsx)(s.code,{children:"0.4.1-0"}),"."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"features-10",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Polish documentation and project (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/696",children:"#696"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"update the headline, the overviews and many other documentation areas"}),"\n",(0,i.jsx)(s.li,{children:"upgrades the dependencies."}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-23",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated Docker image version for the ",(0,i.jsx)(s.code,{children:"typegate"})," service to ensure\r\nstability and compatibility."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Revised ",(0,i.jsx)(s.code,{children:"TAGLINE"})," for better clarity on supported languages: WASM,\r\nTypescript, and Python."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated version declarations for improved consistency and\r\nfunctionality across multiple files."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-11",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Final polish to comparison table. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/709",children:"#709"}),")"]})}),(0,i.jsx)(s.p,{children:"some changes to comparison table(docs)"}),(0,i.jsx)(s.h4,{id:"migration-notes-82",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-24",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Introduced a new section on Artifact Tracking Protocol in the\r\narchitecture documentation, explaining artifact classification and\r\ntracking modes in Metatype."}),"\n",(0,i.jsx)(s.li,{children:"Updated comparisons documentation with additional platforms, criteria\r\nfor choosing Metatype, and detailed feature comparison tables."}),"\n",(0,i.jsx)(s.li,{children:"Renamed project directory for clarity and consistency in project setup\r\ndocumentation."}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Bug Fixes"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Removed outdated ",(0,i.jsx)(s.code,{children:"TODO"})," comment in installation documentation."]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to version 0.4.1-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/713",children:"#713"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bumps version to 0.4.1-0."}),"\n",(0,i.jsx)(s.li,{children:"Fixes broken release CI."}),"\n",(0,i.jsx)(s.li,{children:"#719"}),"\n",(0,i.jsx)(s.li,{children:"Adds 20 minutes to test-full timeout."}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-25",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-26",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated platform support for better compatibility with "x86_64-linux".'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Minor version updates across multiple configurations to enhance\r\nstability."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated version numbers from "0.4.0" to "0.4.1-0" across various files\r\nand configurations.'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Adjusted build and test scripts for improved efficiency and\r\ncompatibility."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced internal documentation to reflect version and platform\r\nchanges."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v040---2024-05-09",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.0",children:"v0.4.0"})," - 2024-05-09"]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-5",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add a comparison b/n metatype and other similar solutions/products. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/697",children:"#697"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Adds a comparison table between metatype and other similar services."}),"\n",(0,i.jsxs)(s.li,{children:["Add artifact upload protocol to ",(0,i.jsx)(s.code,{children:"Architecture"})," section in docs."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-443/include-comparisons-with-other-products-similar-to-metatype",children:"MET-443"})}),(0,i.jsx)(s.h4,{id:"migration-notes-83",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})})]}),"\n",(0,i.jsx)(s.h3,{id:"features-11",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Artifact removal (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/668",children:"#668"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add GC: remove artifacts when unreferenced by any deployed typegraph"}),"\n",(0,i.jsxs)(s.li,{children:["Improve resource management: use ",(0,i.jsx)(s.code,{children:"AsyncDisposable"})," and\r\n",(0,i.jsx)(s.code,{children:"AsyncDisposableStack"})]}),"\n",(0,i.jsxs)(s.li,{children:["Improve testability (for parallel testing): always read the tmpDir\r\nconfig from the ",(0,i.jsx)(s.code,{children:"Typegate"})," object"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"motivation-and-context",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-433/file-removal",children:"MET-433"})}),(0,i.jsx)(s.h4,{id:"migration-notes-84",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h3,{id:"checklist-2",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-27",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced search functionality with the addition of a new search bar."}),"\n",(0,i.jsx)(s.li,{children:"Introduced new test configurations to improve script execution."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated artifact storage documentation to clarify management\r\nprocesses."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added new extensions to support improved code commenting."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Removed outdated Deno import mapping settings to streamline\r\ndevelopment environment setup."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Expanded documentation on artifact tracking and management, including\r\nreference counting and garbage collection mechanisms."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Implemented interface changes in ",(0,i.jsx)(s.code,{children:"QueryEngine"})," for better async\r\ndisposal management."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Code restructuring in artifact management for enhanced performance and\r\nmaintainability."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Adjusted settings and configurations in the development environment to\r\nalign with current best practices."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new test cases for artifact upload and management\r\nfunctionalities."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-12",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Prepare 0.4.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/710",children:"#710"}),")"]})}),(0,i.jsx)(s.p,{children:"Bumps version to release 0.4.0."}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-28",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsx)(s.li,{children:"Updated the software across various components to version 0.4.0,\r\nenhancing functionality and potentially introducing new features or\r\nfixes."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Updated version documentation in multiple configuration files to\r\nreflect new version 0.4.0."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsx)(s.li,{children:"Adjusted version constants and dependencies to ensure compatibility\r\nand stability with the new software version 0.4.0."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-5",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Wasi 0.2 pyrt (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/687",children:"#687"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Rewrites the PythonRuntime host using a ",(0,i.jsx)(s.code,{children:"componentize-py"})," based\r\ncomponent."]}),"\n",(0,i.jsxs)(s.li,{children:["Leaf through this\r\n",(0,i.jsx)(s.a,{href:"https://hackmd.io/@SC-qT-WXTROceKYdNA-Lpg/ryyAXiQlC/edit",children:"memo"})," for a\r\nmental model."]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(libs/xtask,gate) Remove xtask/codegen (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/700",children:"#700"}),")"]})}),(0,i.jsx)(s.p,{children:"Faster build time"}),(0,i.jsx)(s.h4,{id:"migration-notes-85",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["Make sure to sync ",(0,i.jsx)(s.code,{children:"typegate/src/types.ts"})," when an update is made on the\r\ntypegraph schema."]})]})]})}function d(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}const a={title:"Changelog",comments:!1,sidebar_position:1e3},r="",c={id:"reference/changelog",title:"Changelog",description:"",source:"@site/docs/reference/changelog.mdx",sourceDirName:"reference",slug:"/reference/changelog",permalink:"/docs/reference/changelog",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/changelog.mdx",tags:[],version:"current",sidebarPosition:1e3,frontMatter:{title:"Changelog",comments:!1,sidebar_position:1e3},sidebar:"docs",previous:{title:"GraphQL",permalink:"/docs/reference/graphql/"},next:{title:"index",permalink:"/docs/reference/metagen/"}},o={},h=[{value:"v0.5.0-rc.5 - 2024-11-10",id:"v050-rc5---2024-11-10",level:2},{value:"Bug Fixes",id:"bug-fixes",level:3},{value:"Migration notes",id:"migration-notes",level:4},{value:"Migration notes",id:"migration-notes-1",level:4},{value:"Documentation",id:"documentation",level:3},{value:"Migration notes",id:"migration-notes-2",level:4},{value:"Features",id:"features",level:3},{value:"Migration notes",id:"migration-notes-3",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks",level:3},{value:"Migration notes",id:"migration-notes-4",level:4},{value:"v0.5.0-rc.4 - 2024-11-05",id:"v050-rc4---2024-11-05",level:2},{value:"Bug Fixes",id:"bug-fixes-1",level:3},{value:"Migration notes",id:"migration-notes-5",level:4},{value:"Migration notes",id:"migration-notes-6",level:4},{value:"v0.5.0-rc.3 - 2024-10-30",id:"v050-rc3---2024-10-30",level:2},{value:"Bug Fixes",id:"bug-fixes-2",level:3},{value:"Migration notes",id:"migration-notes-7",level:4},{value:"Migration notes",id:"migration-notes-8",level:4},{value:"Documentation",id:"documentation-1",level:3},{value:"Migration",id:"migration",level:4},{value:"v0.5.0-rc.2 - 2024-10-24",id:"v050-rc2---2024-10-24",level:2},{value:"Bug Fixes",id:"bug-fixes-3",level:3},{value:"Migration notes",id:"migration-notes-9",level:4},{value:"Features",id:"features-1",level:3},{value:"Migration notes",id:"migration-notes-10",level:4},{value:"v0.5.0-rc.1 - 2024-10-22",id:"v050-rc1---2024-10-22",level:2},{value:"Bug Fixes",id:"bug-fixes-4",level:3},{value:"Migration notes",id:"migration-notes-11",level:4},{value:"Migration notes",id:"migration-notes-12",level:4},{value:"Migration notes",id:"migration-notes-13",level:4},{value:"Checklist",id:"checklist",level:4},{value:"Migration notes",id:"migration-notes-14",level:4},{value:"Fix missing images for durable execution blog",id:"fix-missing-images-for-durable-execution-blog",level:2},{value:"Migration notes",id:"migration-notes-15",level:4},{value:"Migration notes",id:"migration-notes-16",level:4},{value:"Documentation",id:"documentation-2",level:3},{value:"Migration notes",id:"migration-notes-17",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-1",level:2},{value:"Migration notes",id:"migration-notes-18",level:4},{value:"Features",id:"features-2",level:3},{value:"Migration notes",id:"migration-notes-19",level:4},{value:"Migration notes",id:"migration-notes-20",level:4},{value:"Migration notes",id:"migration-notes-21",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-2",level:2},{value:"Migration notes",id:"migration-notes-22",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-3",level:2},{value:"Release Notes",id:"release-notes",level:2},{value:"Migration notes",id:"migration-notes-23",level:4},{value:"Migration notes",id:"migration-notes-24",level:4},{value:"Migration notes",id:"migration-notes-25",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-4",level:2},{value:"Release Notes",id:"release-notes-1",level:2},{value:"Migration notes",id:"migration-notes-26",level:4},{value:"Migration notes",id:"migration-notes-27",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-1",level:3},{value:"Migration notes",id:"migration-notes-28",level:4},{value:"Migration notes",id:"migration-notes-29",level:4},{value:"Refactor",id:"refactor",level:3},{value:"Migration notes",id:"migration-notes-30",level:4},{value:"Migration notes",id:"migration-notes-31",level:4},{value:"Migration notes",id:"migration-notes-32",level:4},{value:"Migration notes",id:"migration-notes-33",level:4},{value:"Migration notes",id:"migration-notes-34",level:4},{value:"Checklist",id:"checklist-1",level:4},{value:"Migration notes",id:"migration-notes-35",level:4},{value:"v0.4.10 - 2024-09-04",id:"v0410---2024-09-04",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-2",level:3},{value:"v0.4.10-rc1 - 2024-09-03",id:"v0410-rc1---2024-09-03",level:2},{value:"Bug Fixes",id:"bug-fixes-5",level:3},{value:"v0.4.9 - 2024-09-02",id:"v049---2024-09-02",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-3",level:3},{value:"v0.4.9-rc2 - 2024-09-02",id:"v049-rc2---2024-09-02",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-4",level:3},{value:"v0.4.9-rc1 - 2024-09-02",id:"v049-rc1---2024-09-02",level:2},{value:"Features",id:"features-3",level:3},{value:"Migration notes",id:"migration-notes-36",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-5",level:2},{value:"Migration notes",id:"migration-notes-37",level:4},{value:"Migration notes",id:"migration-notes-38",level:4},{value:"Refactor",id:"refactor-1",level:3},{value:"Ensure documentation is pushing for meta dev instead of meta typegate",id:"ensure-documentation-is-pushing-for-meta-dev-instead-of-meta-typegate",level:2},{value:"Migration notes",id:"migration-notes-39",level:4},{value:"Migration notes",id:"migration-notes-40",level:4},{value:"v0.4.8 - 2024-08-16",id:"v048---2024-08-16",level:2},{value:"Bug Fixes",id:"bug-fixes-6",level:3},{value:"Features",id:"features-4",level:3},{value:"Migration notes",id:"migration-notes-41",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-5",level:3},{value:"v0.4.7 - 2024-08-08",id:"v047---2024-08-08",level:2},{value:"Features",id:"features-5",level:3},{value:"Migration notes",id:"migration-notes-42",level:4},{value:"Migration notes",id:"migration-notes-43",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-6",level:3},{value:"Refactor",id:"refactor-2",level:3},{value:"Migration notes",id:"migration-notes-44",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-6",level:2},{value:"Migration notes",id:"migration-notes-45",level:4},{value:"v0.4.6 - 2024-08-01",id:"v046---2024-08-01",level:2},{value:"Features",id:"features-6",level:3},{value:"Migration notes",id:"migration-notes-46",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-7",level:3},{value:"Migration notes",id:"migration-notes-47",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-7",level:2},{value:"Refactor",id:"refactor-3",level:3},{value:"Improve the documentation on quick-start page",id:"improve-the-documentation-on-quick-start-page",level:2},{value:"Migration notes",id:"migration-notes-48",level:4},{value:"v0.4.5 - 2024-07-18",id:"v045---2024-07-18",level:2},{value:"Bug Fixes",id:"bug-fixes-7",level:3},{value:"Migration notes",id:"migration-notes-49",level:4},{value:"Migration notes",id:"migration-notes-50",level:4},{value:"Migration notes",id:"migration-notes-51",level:4},{value:"Migration notes",id:"migration-notes-52",level:4},{value:"Features",id:"features-7",level:3},{value:"Migration notes",id:"migration-notes-53",level:4},{value:"Migration notes",id:"migration-notes-54",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-8",level:3},{value:"Migration notes",id:"migration-notes-55",level:4},{value:"v0.4.4 - 2024-07-05",id:"v044---2024-07-05",level:2},{value:"Bug Fixes",id:"bug-fixes-8",level:3},{value:"Documentation",id:"documentation-3",level:3},{value:"Migration notes",id:"migration-notes-56",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-8",level:2},{value:"Features",id:"features-8",level:3},{value:"Migration notes",id:"migration-notes-57",level:4},{value:"Migration notes",id:"migration-notes-58",level:4},{value:"Migration notes",id:"migration-notes-59",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-9",level:3},{value:"Add Programmatic deploy tests for the docs",id:"add-programmatic-deploy-tests-for-the-docs",level:2},{value:"Migration notes",id:"migration-notes-60",level:4},{value:"Migration notes",id:"migration-notes-61",level:4},{value:"Refactor",id:"refactor-4",level:3},{value:"Migration notes",id:"migration-notes-62",level:4},{value:"Migration notes",id:"migration-notes-63",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-9",level:2},{value:"Testing",id:"testing",level:3},{value:"Migration notes",id:"migration-notes-64",level:4},{value:"v0.4.3 - 2024-06-22",id:"v043---2024-06-22",level:2},{value:"Bug Fixes",id:"bug-fixes-9",level:3},{value:"Migration notes",id:"migration-notes-65",level:4},{value:"Migration notes",id:"migration-notes-66",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-10",level:2},{value:"Migration notes",id:"migration-notes-67",level:4},{value:"Migration notes",id:"migration-notes-68",level:4},{value:"Migration notes",id:"migration-notes-69",level:4},{value:"Documentation",id:"documentation-4",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-11",level:2},{value:"Migration notes",id:"migration-notes-70",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-12",level:2},{value:"Migration notes",id:"migration-notes-71",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-13",level:2},{value:"Features",id:"features-9",level:3},{value:"Migration notes",id:"migration-notes-72",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-14",level:2},{value:"Migration notes",id:"migration-notes-73",level:4},{value:"Migration notes",id:"migration-notes-74",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-15",level:2},{value:"Migration notes",id:"migration-notes-75",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-16",level:2},{value:"Migration notes",id:"migration-notes-76",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-17",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-18",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-10",level:3},{value:"Migration notes",id:"migration-notes-77",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-19",level:2},{value:"Migration notes",id:"migration-notes-78",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-20",level:2},{value:"Migration notes",id:"migration-notes-79",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-21",level:2},{value:"Migration notes",id:"migration-notes-80",level:4},{value:"Migration notes",id:"migration-notes-81",level:4},{value:"v0.4.2 - 2024-05-22",id:"v042---2024-05-22",level:2},{value:"Bug Fixes",id:"bug-fixes-10",level:3},{value:"v0.4.1 - 2024-05-20",id:"v041---2024-05-20",level:2},{value:"Bug Fixes",id:"bug-fixes-11",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-22",level:2},{value:"Features",id:"features-10",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-23",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-11",level:3},{value:"Migration notes",id:"migration-notes-82",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-24",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-25",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-26",level:2},{value:"v0.4.0 - 2024-05-09",id:"v040---2024-05-09",level:2},{value:"Documentation",id:"documentation-5",level:3},{value:"Migration notes",id:"migration-notes-83",level:4},{value:"Features",id:"features-11",level:3},{value:"Motivation and context",id:"motivation-and-context",level:4},{value:"Migration notes",id:"migration-notes-84",level:4},{value:"Checklist",id:"checklist-2",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-27",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-12",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-28",level:2},{value:"Refactor",id:"refactor-5",level:3},{value:"Migration notes",id:"migration-notes-85",level:4}];function x(e){const s={h1:"h1",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:""}),"\n",(0,i.jsx)(d,{})]})}function m(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file diff --git a/assets/js/a70287ac.e105dad1.js b/assets/js/a70287ac.e105dad1.js deleted file mode 100644 index 84fb9c6d87..0000000000 --- a/assets/js/a70287ac.e105dad1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2058],{77487:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>m,frontMatter:()=>a,metadata:()=>r,toc:()=>h});var i=n(86070),t=n(25710);function l(e){const s={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h4:"h4",hr:"hr",img:"img",input:"input",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components},{Details:n}=s;return n||function(e,s){throw new Error("Expected "+(s?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:"changelog",children:"Changelog"}),"\n",(0,i.jsx)(s.p,{children:"All notable changes to this project will be documented in this file."}),"\n",(0,i.jsxs)(s.h2,{id:"v050-rc1---2024-10-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.5.0-rc.1",children:"v0.5.0-rc.1"})," - 2024-10-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(ci) Disable sccache when secrets not avail (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/874",children:"#874"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Makes sccache optional so PRs from dependabot and forks can still run\r\nthe test suite."}),"\n",(0,i.jsx)(s.li,{children:"Increases sccache allotment to 50g."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Change default installation directory (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/873",children:"#873"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Remplacement PR for #843."}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"..."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Grpc docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/852",children:"#852"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-1",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Make __typename returns the variant name on unions (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/838",children:"#838"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add missing implementation for static injection for parameter\r\ntransformations on the typegate"}),"\n",(0,i.jsxs)(s.li,{children:["Solves\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-642/gate-typename-on-union-selections-should-hold-member-title",children:"MET-642"}),":\r\nFix the ",(0,i.jsx)(s.code,{children:"__typename"})," result on union variants: return the variant name\r\ninstead of the parent type name"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-2",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsx)(s.h4,{id:"checklist",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Key collision on redis (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/865",children:"#865"}),")"]})}),(0,i.jsxs)(s.p,{children:["Follow up of #863\r\nWhen multiple start occurs for redis, some schedules can happen\r\n",(0,i.jsx)(s.strong,{children:"exactly"})," at the same time resulting into the same identifier (and\r\nleading to an inconsistent state)."]}),(0,i.jsxs)(s.p,{children:["This solution simply combines the ",(0,i.jsx)(s.code,{children:"schedule"})," with the run_id making it\r\nunique instead of using it as is."]}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-gql",children:"mutation AllAtOnce {\r\n a: start_retry(kwargs: { .. }) # => calls add_schedule( ... date ...)\r\n b: start_retry(kwargs: { .. })\r\n c: start_retry(kwargs: { .. })\r\n d: start_retry(kwargs: { .. }) \r\n e: start_retry(kwargs: { .. })\r\n f: start_retry(kwargs: { .. })\r\n # ..\r\n}\n"})}),(0,i.jsx)(s.h4,{id:"migration-notes-3",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Fix missing images (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/847",children:"#847"}),")"]})}),(0,i.jsxs)(s.h2,{id:"fix-missing-images-for-durable-execution-blog",children:["Fix missing images for ",(0,i.jsx)(s.code,{children:"durable execution"})," blog"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-4",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve name generation for prisma types (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/849",children:"#849"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-657/sdk-improve-generated-titles-for-prisma-types",children:"MET-657"})]}),(0,i.jsx)(s.h4,{id:"migration-notes-5",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(blog) Running python with WebAssembly part 1 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/823",children:"#823"}),")"]})}),(0,i.jsx)(s.p,{children:"Running python with webassembly (part 1)"}),(0,i.jsx)(s.h4,{id:"migration-notes-6",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-1",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced a comprehensive guide for integrating Python runtime with\r\nWebAssembly (WASI) in the Metatype ecosystem."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Detailed the advantages of using WebAssembly over Docker for platform\r\nindependence and resource management."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Provided technical requirements and a refined solution for executing\r\nPython scripts in a sandboxed environment."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Expanded vocabulary with new relevant terms for enhanced text\r\nprocessing and validation."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated YAML configuration structure in documentation for clarity on\r\ntype gate usage."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/reference/typegraph/client"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/777",children:"#777"}),")"]})}),(0,i.jsx)(s.p,{children:"Pre-documentation for the code-first queries feature."}),(0,i.jsx)(s.h4,{id:"migration-notes-7",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(dev) Typegraph explorer (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/859",children:"#859"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add a web version of tree-view which is more interactive"}),"\n",(0,i.jsxs)(s.li,{children:["Enable typegraph serialization without ",(0,i.jsx)(s.code,{children:"metatype.yml"})," config file"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.img,{src:"https://github.com/user-attachments/assets/81771c07-1f2a-493a-81df-969c8182f9bf",alt:"image"})})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Empty object as custom scalar (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/876",children:"#876"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Allow empty object on the output without any change"}),"\n",(0,i.jsxs)(s.li,{children:["Just like ",(0,i.jsx)(s.code,{children:"Int"}),", ",(0,i.jsx)(s.code,{children:"String"}),", and such, rightfully refer the constant\r\n",(0,i.jsx)(s.code,{children:"{}"})," as a scalar"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Any"})," empty object will now be refered as ",(0,i.jsx)(s.code,{children:"EmptyObject"})," scalar"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-8",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk) Overridable templates (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/842",children:"#842"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-630/gen-add-parameter-to-replace-static-sections",children:"MET-630"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Make templates in the ",(0,i.jsx)(s.em,{children:"static"})," sections overridable","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_rust"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_python"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ",(0,i.jsx)(s.code,{children:"mdk_typescript"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add a CLI tool to generate extract the default template"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-9",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"No changes needed."}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(metagen) Union/either for clients (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/857",children:"#857"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Add union support for the ",(0,i.jsx)(s.code,{children:"client_xx"})," metagen implementations."]}),"\n"]}),(0,i.jsxs)(s.p,{children:["There are still some edge cases especially around variant identification\r\nin the client languages. I tried many things but our hands are tied by\r\nserde. Basically, users will have to be careful when designing their\r\nunion types to avoid ambiguity cases. Hopefully,\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-674/graph-checksvalidation-on-teither",children:"674"}),"\r\nwill help there."]}),(0,i.jsx)(s.h4,{id:"migration-notes-10",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-2",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new methods for rendering union types in both TypeScript\r\nand Python."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced GraphQL query generation with support for multiple union\r\ntypes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added a new ",(0,i.jsx)(s.code,{children:"variants"})," property to the ",(0,i.jsx)(s.code,{children:"NodeMeta"})," type for improved\r\nselection handling."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Improved error handling for node selections and argument processing."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test cases to reflect schema changes and added new tests for\r\nclient functionality."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Redis backend (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/855",children:"#855"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Redis Backend base logic port + some improvements"}),"\n",(0,i.jsxs)(s.li,{children:["Moved ",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_POLL_INTERVAL_SEC"})," and\r\n",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_LEASE_LIFESPAN_SEC"})," to config"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-11",children:"Migration notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Renamed ",(0,i.jsx)(s.code,{children:"Backend.fs()"})," and ",(0,i.jsx)(s.code,{children:"Backend.memory()"})," to ",(0,i.jsx)(s.code,{children:"Backend.dev_fs()"}),"\r\nand ",(0,i.jsx)(s.code,{children:"Backend.dev_memory()"})]}),"\n",(0,i.jsxs)(s.li,{children:["Removed ",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_RELAUNCH_MS"})," as it was relevant only for purely\r\nworker-based runs, which rendered the new\r\n",(0,i.jsx)(s.code,{children:"SUBSTANTIAL_POLL_INTERVAL_SEC"})," redundant when an interrupt hits."]}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-3",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"release-notes",children:"Release Notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced Redis as a new backend option for enhanced data management."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added Docker Compose configuration for a Redis service."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented comprehensive testing for Redis functionality and backend\r\nintegration."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Improved error handling during backend initialization."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated type definitions for backend configurations to streamline\r\nRedis integration."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Refactored test cases for clarity and consistency across different\r\nbackend types."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Retry + timeout on save (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/863",children:"#863"}),")"]})}),(0,i.jsx)(s.p,{children:"Port and improve retry/timeout."}),(0,i.jsx)(s.h4,{id:"migration-notes-12",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs) Child workflows + docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/867",children:"#867"}),")"]})}),(0,i.jsx)(s.p,{children:"Support for child workflows."}),(0,i.jsx)(s.p,{children:"Solves MET-689 and MET-668."}),(0,i.jsx)(s.h4,{id:"migration-notes-13",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"Previously"}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-python",children:' sub = SubstantialRuntime(backend)\r\n hello = sub.deno(file="workflow.ts", name="sayHello", deps=[])\r\n\r\n g.expose(\r\n # each function start, stop, result, ... holds a copy of the workflow data\r\n start_hello = hello.start(...),\r\n stop_hello = hello.stop()\r\n )\n'})}),(0,i.jsxs)(s.p,{children:["This approach relied on workflow files being referenced in each\r\nmaterializer, but the constructs were too restrictive to support\r\nsomething like ",(0,i.jsx)(s.code,{children:'mutation { results(name: "nameManuallyGiven") }'}),"."]}),(0,i.jsx)(s.p,{children:"We now have instead"}),(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-python",children:' file = (\r\n WorkflowFile\r\n .deno(file="workflow.ts", deps=[])\r\n .import_(["sayHello"])\r\n .build()\r\n )\r\n\r\n # workflow data are refered only once\r\n sub = SubstantialRuntime(backend, [file])\r\n g.expose(\r\n start_hello = sub.start(...).reduce({ "name": "sayHello" }),\r\n stop = sub.stop()\r\n )\n'})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs,gate) Substantial integration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/844",children:"#844"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(subs,gate) Port agent concept (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/845",children:"#845"}),")"]})}),(0,i.jsx)(s.p,{children:"Continuation of #844"})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Well-defined type comparison semantics (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/846",children:"#846"}),")"]})}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-655/sdk-improve-the-ensuresubtypeof-implementation",children:"MET-655"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Document the type comparison semantics"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Improve the implementation (",(0,i.jsx)(s.code,{children:"EnsureSubtypeOf"})," trait)"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add more test cases for type comparisons"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-14",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No change is needed."})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-4",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"release-notes-1",children:"Release Notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced comprehensive type comparison rules and semantics for\r\nscalar types, optionals, lists, objects, and unions."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added support for enumerated types in the type system, allowing for\r\nmore precise type definitions."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced parent injection mechanism documentation to clarify type\r\ncompatibility requirements."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented a new suite of type comparison tests and validation\r\nmechanisms."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved error reporting and handling in the type validation process."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated and expanded documentation for type comparisons, enumerations,\r\nand parent injections."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added new tests for type comparison and validation scenarios."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Grpc runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/819",children:"#819"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-15",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Python hostcall (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/860",children:"#860"}),")"]})}),(0,i.jsx)(s.p,{children:"Dead lock on python worker"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-16",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["Checks/validation on t.either (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/868",children:"#868"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: Checks/validation on t.either (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/868",children:"#868"}),")"]}),"\n"]})]}),(0,i.jsx)(s.p,{children:"Emit a warning or an error when a variant is a subtype of another one."}),(0,i.jsx)(s.h4,{id:"migration-notes-17",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"BREAKING CHANGE"}),": Previously valid typegraph might fail validation.\r\nYou will need to fix your types to add some consistency in\r\n",(0,i.jsx)(s.code,{children:"t.either"}),"/",(0,i.jsx)(s.code,{children:"t.union"})," types."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Update prisma + deno + rust deps (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/869",children:"#869"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump deno to 1.46.3"}),"\n",(0,i.jsx)(s.li,{children:"Update prisma-engines to 5.20"}),"\n",(0,i.jsx)(s.li,{children:"Update other rust deps."}),"\n"]}),(0,i.jsx)(s.p,{children:"Closes MET-669 and MET-622 and MET-680."}),(0,i.jsx)(s.h4,{id:"migration-notes-18",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Add err msg for missing env vars (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/827",children:"#827"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-19",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Use stream during artifact upload to s3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/841",children:"#841"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-20",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gen, doc) Rename mdk to fdk (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/851",children:"#851"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-21",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(sdk) Remove index based names (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/848",children:"#848"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: remove index based names (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/848",children:"#848"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Replace index based names for types by one that relies on type context\r\nin graph"}),"\n",(0,i.jsx)(s.li,{children:"Tests for type deduplication"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-22",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"TODO"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["Move as_id out of ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/866",children:"#866"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: Move as_id out of ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/866",children:"#866"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.p,{children:["Solve\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-684/store-the-id-field-in-tstruct-instead-of-in-the-target-type-as-id",children:"MET-684"}),"\r\nand\r\n",(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-471/parent-injection-use-property-name-instead-of-function-name",children:"MET-471"})]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"common/typegraph"})}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Store the id field in ",(0,i.jsx)(s.code,{children:"ObjectTypeData"})," instead of in the target\r\ntype (",(0,i.jsx)(s.code,{children:"as_id"}),")","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add ",(0,i.jsx)(s.code,{children:"id()"})," method on ",(0,i.jsx)(s.code,{children:"t.integer"})," and ",(0,i.jsx)(s.code,{children:"t.string"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"typegraph/core"}),"\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Store ",(0,i.jsx)(s.code,{children:"as_id"}),", ",(0,i.jsx)(s.code,{children:"injection"})," and ",(0,i.jsx)(s.code,{children:"policy"})," in ",(0,i.jsx)(s.code,{children:"TypeRef::attribute"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add support for direct and link target in ",(0,i.jsx)(s.code,{children:"TypeRef"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Only allow name registration for ",(0,i.jsx)(s.code,{children:"TypeDef"})]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Semantics"}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Use property name instead of type name in from_parent injection\r\nsource"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-23",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.strong,{children:"BREAKING CHANGE"}),"\r\n",(0,i.jsx)(s.code,{children:"from_parent"})," injections source shall be changed to the key in the\r\nparent ",(0,i.jsx)(s.code,{children:"t.struct"})," instead of the type name."]}),(0,i.jsx)(s.h4,{id:"checklist-1",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move injection data to ",(0,i.jsx)(s.code,{children:"t.func"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/871",children:"#871"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-682/move-all-injection-data-to-tfunc",children:"MET-682"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Move all injection data in ",(0,i.jsx)(s.code,{children:"ObjectTypeData"})," (i.e. ",(0,i.jsx)(s.code,{children:"t.func"}),")"]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-656/sdk-improve-generated-titles-from-applyreduce",children:"MET-656"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Translate reduce to injection specification on ",(0,i.jsx)(s.code,{children:"t.func"})]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-94/remove-runtime-field-from-typenode",children:"MET-94"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Remove runtime field from ",(0,i.jsx)(s.code,{children:"TypeNode"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/858",children:"#858"}),")"]}),"\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-683/move-runtime-related-type-configs-out-of-typenode",children:"MET-683"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Move runtime-related configs to ",(0,i.jsx)(s.code,{children:"MaterializerData"})," or\r\n",(0,i.jsx)(s.code,{children:"RuntimeData"})]}),"\n",(0,i.jsx)(s.li,{children:"Misc."}),"\n",(0,i.jsxs)(s.li,{children:["Enable random ports for the typegate (when ",(0,i.jsx)(s.code,{children:"TG_PORT=0"}),"); this will\r\nwork with ",(0,i.jsx)(s.code,{children:"meta dev"})," with embedded typegate if you set the ",(0,i.jsx)(s.code,{children:"--gate"}),"\r\noption with port ",(0,i.jsx)(s.code,{children:"0"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-24",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v0410---2024-09-04",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.10",children:"v0.4.10"})," - 2024-09-04"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-1",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to v0.4.10 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/835",children:"#835"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump v0.4.10"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v0410-rc1---2024-09-03",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.10-rc1",children:"v0.4.10-rc1"})," - 2024-09-03"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-1",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Use import_map at runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/833",children:"#833"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump to release v0.4.10-rc1"}),"\n",(0,i.jsx)(s.li,{children:"Use import_map.json at runtime since remote configs aren't supported"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9",children:"v0.4.9"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-2",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to v0.4.9 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/831",children:"#831"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to v0.4.9"}),"\n",(0,i.jsx)(s.li,{children:"Fix issue with cross config context"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049-rc2---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9-rc2",children:"v0.4.9-rc2"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-3",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Prepare 0.4.9-rc2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/829",children:"#829"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix the minor issues with rc1"}),"\n",(0,i.jsx)(s.li,{children:"Bump to rc2"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v049-rc1---2024-09-02",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.9-rc1",children:"v0.4.9-rc1"})," - 2024-09-02"]}),"\n",(0,i.jsx)(s.h3,{id:"features-1",children:"Features"}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Post on ",(0,i.jsx)(s.code,{children:"Durable Execution"}),". (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/816",children:"#816"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(metagen) Client_ts (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/790",children:"#790"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Implements ",(0,i.jsx)(s.code,{children:"client_ts"})," as described in #777 ."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-25",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-5",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Improved error handling in the ",(0,i.jsx)(s.code,{children:"typegraph"})," function to provide better\r\nerror messages."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated Docker image references to use ",(0,i.jsx)(s.code,{children:"docker.io"})," prefix for\r\nconsistency."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Excluded unnecessary files from the VSCode settings."}),"\n",(0,i.jsx)(s.li,{children:"Enhanced configurability of Docker commands in development tasks."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated environment variable ",(0,i.jsx)(s.code,{children:"GHJK_VERSION"})," to reflect a semantic\r\nversioning format."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced modules and methods for TypeScript and Python code\r\ngeneration in the ",(0,i.jsx)(s.code,{children:"metagen"})," library, enhancing client generation\r\ncapabilities."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added ",(0,i.jsx)(s.code,{children:"test_typegraph_3"})," function for improved testing capabilities."]}),"\n",(0,i.jsx)(s.li,{children:"Included metadata for the package manager in the project settings."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(sub) Sdk and typing (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/811",children:"#811"}),")"]})}),(0,i.jsx)(s.p,{children:"User side of substantial"}),(0,i.jsx)(s.h4,{id:"migration-notes-26",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add caching to Secrets struct to improve performance (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/813",children:"#813"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-27",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-1",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs, gate) Push for ",(0,i.jsx)(s.code,{children:"meta dev"})," instead of ",(0,i.jsx)(s.code,{children:"meta typegate"})," on docs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/822",children:"#822"}),")"]})}),(0,i.jsx)(s.h2,{id:"ensure-documentation-is-pushing-for-meta-dev-instead-of-meta-typegate",children:"Ensure documentation is pushing for meta dev instead of meta typegate"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add a warning that envs are not set."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-635/cli-ensure-documentation-is-pushing-for-meta-dev-instead-of-meta",children:"MET-635"})}),(0,i.jsx)(s.h4,{id:"migration-notes-28",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Flatten deps and improve repo folder (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/821",children:"#821"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"libs/"})," to ",(0,i.jsx)(s.code,{children:"src/"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"typegate/"}),", ",(0,i.jsx)(s.code,{children:"meta-cli"}),", ",(0,i.jsx)(s.code,{children:"typegraph/"}),", ",(0,i.jsx)(s.code,{children:"meta-lsp/"})," to ",(0,i.jsx)(s.code,{children:"src/"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"dev/"})," to ",(0,i.jsx)(s.code,{children:"tools/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"website/"})," to ",(0,i.jsx)(s.code,{children:"docs/metatype.dev"}),"/"]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegate/tests"})," to ",(0,i.jsx)(s.code,{children:"tests/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/dev"})," to ",(0,i.jsx)(s.code,{children:"tools/jsr/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/sdk"})," to ",(0,i.jsx)(s.code,{children:"src/typegraph/deno/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Renames ",(0,i.jsx)(s.code,{children:"src/deno"})," to ",(0,i.jsx)(s.code,{children:"src/mt_deno"})]}),"\n",(0,i.jsxs)(s.li,{children:["Bumps deno to ",(0,i.jsx)(s.code,{children:"1.46.1"})]}),"\n",(0,i.jsxs)(s.li,{children:["Bumps rust toolchain to ",(0,i.jsx)(s.code,{children:"1.80.1"})]}),"\n",(0,i.jsx)(s.li,{children:"Moves all rust dependencies to workspace section"}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"tools/task-*.ts"})," to ",(0,i.jsx)(s.code,{children:"tools/task/*.ts"})]}),"\n",(0,i.jsxs)(s.li,{children:["Moves ",(0,i.jsx)(s.code,{children:"cliff.toml"}),", ",(0,i.jsx)(s.code,{children:"Cross.toml"}),", ",(0,i.jsx)(s.code,{children:"ruff.toml"})," to ",(0,i.jsx)(s.code,{children:"tools/"})]}),"\n",(0,i.jsxs)(s.li,{children:["Uses deno\r\n",(0,i.jsx)(s.a,{href:"https://docs.deno.com/runtime/manual/basics/workspaces/",children:"workspaces"})," to\r\norganize ",(0,i.jsx)(s.code,{children:"src/typegraph/deno"}),", ",(0,i.jsx)(s.code,{children:"src/typegate"}),", ",(0,i.jsx)(s.code,{children:"tools/"}),", ",(0,i.jsx)(s.code,{children:"tests/"})," and\r\nmore."]}),"\n",(0,i.jsx)(s.li,{children:"Closes MET-607"}),"\n",(0,i.jsx)(s.li,{children:"Updates poetry to 1.8.3"}),"\n",(0,i.jsx)(s.li,{children:"Bumps metatype to version 0.4.9-rc1"}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Update CONTRIBUTING.md"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix CI workflows"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix Dockerfile"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix all tests"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-29",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"No end user changes required"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v048---2024-08-16",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.8",children:"v0.4.8"})," - 2024-08-16"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-2",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Table method for kv runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/815",children:"#815"}),")"]})}),(0,i.jsxs)(s.p,{children:["I discover an issue in the KV runtime documentation\r\n",(0,i.jsx)(s.a,{href:"https://metatype.dev/docs/reference/runtimes/kv",children:"kvruntime docs"})]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"wasm_backtrace"})," config bug (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/814",children:"#814"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"$WASM_BACKTRACE_DETAILS"})," was enabled in ",(0,i.jsx)(s.code,{children:"main"})," ghjk env which\r\naffected embedded wasm module compilation to have backtrace enabled.\r\nThis broke typegate runs without the flag enabled due to mismatch."]}),"\n",(0,i.jsx)(s.li,{children:"Fixes Cargo.lock not being used in Dockerfile."}),"\n",(0,i.jsx)(s.li,{children:"Prepare 0.4.8 release"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-2",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Kv runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/797",children:"#797"}),")"]})}),(0,i.jsx)(s.h4,{id:"migration-notes-30",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-4",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to 0.4.8-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/810",children:"#810"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump prerelease"}),"\n",(0,i.jsx)(s.li,{children:"Fix minor issue with release pipeline"}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v047---2024-08-08",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.7",children:"v0.4.7"})," - 2024-08-08"]}),"\n",(0,i.jsx)(s.h3,{id:"features-3",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Fix auto deployment (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/806",children:"#806"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Upgrade lade-sdk"}),"\n",(0,i.jsx)(s.li,{children:"Fix discovery"}),"\n",(0,i.jsx)(s.li,{children:"Remove obsolete dep: actix-web"}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"lade-sdk"})," uses the main branch, which now has the fix for the\r\nfollowing issues:"]}),"\n",(0,i.jsxs)(s.li,{children:["dependency version conflict with\r\n",(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/deno/blob/691f297537c4a3d9a12ce005c0478b4aee86287c/Cargo.toml#L179",children:"deno"}),":\r\n",(0,i.jsx)(s.code,{children:"url"})," is set at ",(0,i.jsx)(s.code,{children:"<2.5.0"}),";"]}),"\n",(0,i.jsx)(s.li,{children:"required ProjectID error for infisical: the project id is added\r\nexplicitly on the command."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-31",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Cors headers on error (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/803",children:"#803"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-32",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-5",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to 0.4.7-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/805",children:"#805"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to 0.4.7-0"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-2",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Add how to test typegraphs doc (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/798",children:"#798"}),")"]})}),(0,i.jsxs)(s.h1,{id:"how-to-test-your-typegraphs-documentation",children:[(0,i.jsx)(s.code,{children:"How to test your typegraphs"})," documentation"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add python doc"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add ts doc"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","upgrade bitnami/minIo image to 2024?"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-33",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-6",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated the Minio service to the latest version for improved\r\nperformance and potential new features."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced comprehensive documentation for testing typegraphs in both\r\nTypeScript and Python, enhancing developer experience."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Enhanced readability of the ",(0,i.jsx)(s.code,{children:"Meta CLI"})," upgrade instructions."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Reformatted installation instructions for the ",(0,i.jsx)(s.code,{children:"typegraph"})," package for\r\nbetter clarity."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated dependency management configuration for improved compatibility\r\nand performance across different platforms."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve JSR score (part 1) (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/807",children:"#807"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add symbol documentations"}),"\n",(0,i.jsx)(s.li,{children:"Fix slow types"}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-34",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v046---2024-08-01",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.6",children:"v0.4.6"})," - 2024-08-01"]}),"\n",(0,i.jsx)(s.h3,{id:"features-4",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Better arg split logic for MCLI_LOADER (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/799",children:"#799"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-35",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-6",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Prepare 0.4.6 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/795",children:"#795"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bump version to 0.4.6-0"}),"\n",(0,i.jsx)(s.li,{children:"Add sanity tests for published SDKs"}),"\n",(0,i.jsx)(s.li,{children:"Bump deno to 1.45.2"}),"\n",(0,i.jsx)(s.li,{children:"Bump rust to 1.79.0"}),"\n",(0,i.jsx)(s.li,{children:"Fix myriad of bugs"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-36",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-7",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced new logging capabilities in the ",(0,i.jsx)(s.code,{children:"ConnectedEngine"})," with\r\nadjustable logging levels."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented cleanup procedures in tests to enhance resource\r\nmanagement."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fixed import paths for permissions to ensure correct functionality in\r\ntests and applications."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Version Updates"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Incremented version numbers across multiple projects and packages to\r\nreflect ongoing development and improvements."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added comments to clarify code behavior and potential future\r\nconsiderations in various modules."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Optimized string handling in several functions and adjusted method\r\nsignatures for improved clarity and efficiency."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-3",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Better documentation on ",(0,i.jsx)(s.code,{children:"quick-start"})," page (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/793",children:"#793"}),")"]})}),(0,i.jsxs)(s.h2,{id:"improve-the-documentation-on-quick-start-page",children:["Improve the documentation on ",(0,i.jsx)(s.code,{children:"quick-start"})," page"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add dev hunt result to homepage."]}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-37",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v045---2024-07-18",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.5",children:"v0.4.5"})," - 2024-07-18"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-3",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Broken pipeline for 0.4.4 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/782",children:"#782"}),")"]})}),(0,i.jsxs)(s.p,{children:["Fixes erroneous usage of ",(0,i.jsx)(s.code,{children:"setup-deno"})," which has been replaced by ",(0,i.jsx)(s.code,{children:"ghjk"}),"\r\nitself."]}),(0,i.jsx)(s.h4,{id:"migration-notes-38",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Broken release pipeline 2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/783",children:"#783"}),")"]})}),(0,i.jsx)(s.p,{children:"Fix issue with the three remaining failing jobs."}),(0,i.jsx)(s.h4,{id:"migration-notes-39",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Release pipeline 3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/784",children:"#784"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Remove accidental dry-run from jsr publish"}),"\n",(0,i.jsx)(s.li,{children:"Fix cross dockerfile"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-40",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Skip deno stack trace from error message (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/787",children:"#787"}),")"]})}),(0,i.jsx)(s.p,{children:"Skip the deno stack trace from the error message when tg_manage fails."}),(0,i.jsx)(s.h4,{id:"migration-notes-41",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-5",children:"Features"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(cli) Configurable backoff (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/789",children:"#789"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: configurable backoff (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/789",children:"#789"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Make the backoff configurable through the ",(0,i.jsx)(s.code,{children:"--retry"})," and\r\n",(0,i.jsx)(s.code,{children:"--retry-interval-ms"})," options."]}),"\n",(0,i.jsx)(s.li,{children:"The default max retry count is changed to 0 on the default mode, and\r\nremains 3 on the watch mode."}),"\n",(0,i.jsxs)(s.li,{children:["The ",(0,i.jsx)(s.code,{children:"--max-parallel-loads"})," option has been renamed to ",(0,i.jsx)(s.code,{children:"--threads"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-42",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"--max-parallel-loads"})," option has been renamed to ",(0,i.jsx)(s.code,{children:"--threads"}),"."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add list subcommand features to meta_cli (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/775",children:"#775"}),")"]})}),(0,i.jsx)(s.p,{children:"new branch after conflict with main branch"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-43",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upgrade www and gha (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/786",children:"#786"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add back gleap (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/791",children:"#791"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Gleap.io was removed a while back"}),"\n",(0,i.jsx)(s.li,{children:"this adds it back so visitors can open ticket and suggest feedback"}),"\n",(0,i.jsx)(s.li,{children:"internally, we will use this to fine tune the documentation"}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-7",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump v0.4.5 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/792",children:"#792"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bumps metatype version to 0.4.5"}),"\n",(0,i.jsx)(s.li,{children:"Bumps ghjk to latest commit"}),"\n",(0,i.jsxs)(s.li,{children:["Fixes ",(0,i.jsx)(s.code,{children:"setup"})," whiz task to avoid issues on macos"]}),"\n",(0,i.jsx)(s.li,{children:"Fixes release pipeline to publish JSR"}),"\n"]}),(0,i.jsx)(s.p,{children:"MET-614 MET-606 MET-605 MET-613"}),(0,i.jsx)(s.h4,{id:"migration-notes-44",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No changes required."})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(s.h2,{id:"v044---2024-07-05",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.4",children:"v0.4.4"})," - 2024-07-05"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-4",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Ensure all deps are defined in import_map.json (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/768",children:"#768"}),")"]})}),(0,i.jsxs)(s.p,{children:["Ensure that all deps are defined in ",(0,i.jsx)(s.code,{children:"import_map.json"})," with a specific\r\nversion."]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Missing typegraphs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/755",children:"#755"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"fix the typegraphs that were incorrectly formatted"}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Stable formatting and uniformize the code-loader (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/766",children:"#766"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"add prettier to avoid doc formatting issue"}),"\n",(0,i.jsxs)(s.li,{children:["now explicitly require ",(0,i.jsx)(s.code,{children:"!!code-loader!"})," to load code inside the\r\ndocumentation (will hopefully help also with the missing typegraphs\r\nissues, still under investigation)"]}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-1",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Generate clients from openapi (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/778",children:"#778"}),")"]})}),(0,i.jsx)(s.p,{children:"Demonstrate how to use the openapi spec to generate clients in most\r\nlanguages/frameworks."}),(0,i.jsx)(s.h4,{id:"migration-notes-45",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-8",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Updated REST API documentation URLs with placeholders for easier\r\nconfiguration."}),"\n",(0,i.jsx)(s.li,{children:"Added information on generating and using OpenAPI clients, including\r\nTypeScript fetch client generation."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsx)(s.li,{children:"Corrected a regular expression in import handling to ensure accurate\r\nreplacements."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsx)(s.li,{children:"Improved file writing by appending a newline character to JSON\r\nstrings."}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-6",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move all the configs to one single file (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/733",children:"#733"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Move all the configs to one single file"}),"\n",(0,i.jsxs)(s.li,{children:["Remove some specific configs from the global config variable and make\r\nthem accessible on the ",(0,i.jsx)(s.code,{children:"Typegate"})," instance, to improve test\r\nconfigurability."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-46",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"SYNC_REDIS_PASSWORD"})," has been removed, can only be set on the\r\n",(0,i.jsx)(s.code,{children:"SYNC_REDIS_URL"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Remove restrictions for union/either types (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/761",children:"#761"}),")"]})}),(0,i.jsx)(s.p,{children:"In the previous versions, we restricted the variant types allowed in\r\nunion/either to be all in the same category (after flattening\r\nmulti-level unions):"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.em,{children:"Category 1"})," - ",(0,i.jsx)(s.strong,{children:"GraphQL leaf types"}),": scalar type, or array of scalar\r\ntype, which require no selection set on GraphQL."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.em,{children:"Category 2"})," - ",(0,i.jsx)(s.strong,{children:"GraphQL non-leaf types"}),": object type or array of\r\nobject type, which require a selection set on GraphQL (aka selectable\r\ntypes in the codebase)."]}),"\n"]}),(0,i.jsxs)(s.p,{children:["Those restrictions can be lifted, and the selection field of an\r\nunion-type field will have inline fragments with type conditions for\r\neach ",(0,i.jsx)(s.em,{children:"Category 2"})," variant. No type condition is required for ",(0,i.jsx)(s.em,{children:"Category\r\n1"})," types, the selection sets are not relevant."]}),(0,i.jsx)(s.p,{children:"The case that is not handled by this PR is when one of the variants is\r\nan array of union type."}),(0,i.jsx)(s.h4,{id:"migration-notes-47",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Typegate in meta dev, upgrade test (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/776",children:"#776"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Test the typegate upgrade from the latest published version to the\r\ncurrent version."}),"\n",(0,i.jsxs)(s.li,{children:["Add a flag to run an instance of the typegate with the target\r\nconfiguration (port, admin passsword) to ",(0,i.jsx)(s.code,{children:"meta deploy"}),", enabled by\r\ndefault for ",(0,i.jsx)(s.code,{children:"meta dev"}),"."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-48",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["If you have a script that runs ",(0,i.jsx)(s.code,{children:"meta dev"}),", add the flag ",(0,i.jsx)(s.code,{children:"--no-typegate"}),"\r\nif you already have a typegate."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-8",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add programmatic deploy tests (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/769",children:"#769"}),")"]})}),(0,i.jsx)(s.h2,{id:"add-programmatic-deploy-tests-for-the-docs",children:"Add Programmatic deploy tests for the docs"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add programmatic typegraph deploy/remove tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","refactor tg_remove to accept ",(0,i.jsx)(s.code,{children:"typegraph_name"})," instead of\r\n",(0,i.jsx)(s.code,{children:"TypegraphOutput"})," obj."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-591/docstest-test-example-script-for-tg-deploy",children:"MET-591"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-49",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to version 0.4.4 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/779",children:"#779"}),")"]})}),(0,i.jsx)(s.p,{children:"Prepare release of the 0.4.4 version."}),(0,i.jsx)(s.h4,{id:"migration-notes-50",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"refactor-4",children:"Refactor"}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(sdk) Back to deno + jsr exploration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/760",children:"#760"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: back to deno + jsr exploration (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/760",children:"#760"}),")"]}),"\n"]})]}),(0,i.jsx)(s.p,{children:"Try reverting back to deno runtime for the typescript sdk in hope of\r\nmaking the dx easier.\r\nHosting a custom node/npm project adds more layer of indirection which\r\nmay result in cryptic issues sometimes."}),(0,i.jsxs)(s.p,{children:["This should also facilitate publishing on jsr although additional work\r\nare still required on the ",(0,i.jsx)(s.code,{children:"jco"})," codegen side."]}),(0,i.jsx)(s.h4,{id:"migration-notes-51",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Move to ghjk 0.2.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/754",children:"#754"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Refactors the ghjk.ts, CI to the latest version of ghjk"}),"\n",(0,i.jsx)(s.li,{children:"Bumps version to 0.4.4-0"}),"\n",(0,i.jsx)(s.li,{children:"Fixes race bug in python_sync tests"}),"\n",(0,i.jsxs)(s.li,{children:["Fixes flakeout of wasm ",(0,i.jsx)(s.code,{children:"build.sh"})," scripts due to wasm-tools EOF issue"]}),"\n",(0,i.jsx)(s.li,{children:"#763"}),"\n",(0,i.jsx)(s.li,{children:"#746"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-52",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-9",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.li,{children:["Updated GitHub Actions workflows to use the latest version of\r\n",(0,i.jsx)(s.code,{children:"metatypedev/setup-ghjk"})," for improved stability and performance."]}),"\n",(0,i.jsxs)(s.li,{children:["Modified ",(0,i.jsx)(s.code,{children:"GHJK_VERSION"})," and various environment variables across\r\nmultiple configuration files to ensure compatibility with updated\r\ndependencies."]}),"\n",(0,i.jsx)(s.li,{children:"Revised Dockerfiles to streamline environment setup and improve build\r\nefficiency."}),"\n",(0,i.jsxs)(s.li,{children:["Updated dependency management in ",(0,i.jsx)(s.code,{children:"pyproject.toml"})," for better security\r\nand performance.","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced logging and error handling in test scripts."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.p,{children:"These updates collectively optimize the development environment,\r\nensuring smoother builds and more reliable workflows."}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"testing",children:"Testing"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(full) Update test runner (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/705",children:"#705"}),")"]})}),(0,i.jsx)(s.p,{children:"New test runner, by default:"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Less verbose"}),"\n",(0,i.jsx)(s.li,{children:"No output for successful tests"}),"\n"]}),(0,i.jsx)(s.p,{children:"Parallel tests re-enabled."}),(0,i.jsx)(s.h4,{id:"migration-notes-53",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})})]}),"\n",(0,i.jsxs)(s.h2,{id:"v043---2024-06-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.3",children:"v0.4.3"})," - 2024-06-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-5",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(ci) Poetry lockfile (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/732",children:"#732"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fixes poetry lockfile and adds pre-commit hook to prevent issue from\nhappening"}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Fix demo typegraphs 2 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/756",children:"#756"}),")"]})}),(0,i.jsx)(s.p,{children:"Fix example typegraphs on metatype.dev."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","reduce.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","policies.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","graphql.ts"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","authentication.ts"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-574/docs-fix-demo-typegraphs-2",children:"MET_574"})}),(0,i.jsx)(s.h4,{id:"migration-notes-54",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Fix programmatic deployment guides (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/762",children:"#762"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Fix typo"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix/test tg deploy"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix/test tg remove"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-587/docs-fix-programmatic-deployment-guides",children:"MET-587"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-55",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Only build xtask once for the tests (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/720",children:"#720"}),")"]})}),(0,i.jsx)(s.p,{children:"Use the xtask binary to run the tests."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-10",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Updated platform compatibility to ",(0,i.jsx)(s.code,{children:"x86_64-linux"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new configuration entry for enhanced versioning and platform\r\nsupport."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Improvements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Modified test script to use a custom build script for better test\r\nmanagement."}),"\n"]}),"\n"]}),(0,i.jsx)(s.p,{children:"These changes improve platform compatibility and streamline the testing\r\nprocess."}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Missing typegraphs (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/741",children:"#741"}),")"]})}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Fix Missing Typegraphs"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"attempt to fix the missing typegraphs on metatype.dev."}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-563/docs-complete-missing-typegraphs",children:"MET-563"})}),(0,i.jsx)(s.h4,{id:"migration-notes-56",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.em,{children:"No Migrations Needed"}),"\r\n..."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upload url path and add logging in the SDK (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/740",children:"#740"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix upload url: prepare-upload returns upload tokens instead of upload\r\nurls"}),"\n",(0,i.jsx)(s.li,{children:"Add logging in the typegraph SDK"}),"\n",(0,i.jsx)(s.li,{children:"Refactor the actor system in the CLI"}),"\n",(0,i.jsx)(s.li,{children:"Use jsonrpc for communication between the CLI and typegraph processes\r\n(over stdin/stdout)"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-57",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"typegraphs.deno"})," section of the ",(0,i.jsx)(s.code,{children:"metatype.yaml"})," config file has\r\nbeen replaced by ",(0,i.jsx)(s.code,{children:"typegraphs.typescript"})," and ",(0,i.jsx)(s.code,{children:"typegraphs.javascript"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"tg_deploy"})," params has changed."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Failed typegraph deployment (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/758",children:"#758"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fix casing typo in the typescript sdk"}),"\n",(0,i.jsx)(s.li,{children:"Fix error reporting in the typescript sdk"}),"\n",(0,i.jsx)(s.li,{children:"Display the retry number"}),"\n",(0,i.jsx)(s.li,{children:"Warning on cancelled retry"}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-58",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-2",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/concepts/features-overview/"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/725",children:"#725"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Re-does the feature overview page of the documentation."}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-11",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Added a "Features Roadmap" component to the website, displaying a list\r\nof features with details and links.'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated various guides and reference documents to improve clarity and\r\npresentation of code examples."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new sections for various features such as Typegate, Typegraph,\r\nRuntimes, Prisma, Auth, Tooling, and SDK."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Corrected a typo in the GraphQL runtimes reference documentation."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Replaced ",(0,i.jsx)(s.code,{children:"SDKTabs"})," and ",(0,i.jsx)(s.code,{children:"TabItem"})," components with ",(0,i.jsx)(s.code,{children:"TGExample"})," for\r\nbetter code example presentation."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Adjusted the ",(0,i.jsx)(s.code,{children:"MiniQL"})," component to handle optional properties and\r\ndefault settings."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"/docs/reference/metagen"})," + ",(0,i.jsx)(s.code,{children:"/docs/guides/wasm-functions"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/751",children:"#751"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Adds ",(0,i.jsx)(s.code,{children:"/docs/reference/metagen"})]}),"\n",(0,i.jsxs)(s.li,{children:["Adds ",(0,i.jsx)(s.code,{children:"/docs/guides/wasm-functions"})]}),"\n",(0,i.jsxs)(s.li,{children:["Adds a codegen section to ",(0,i.jsx)(s.code,{children:"/docs/guides/external-functions"})]}),"\n"]}),(0,i.jsx)(s.p,{children:"MDK-492."}),(0,i.jsx)(s.h4,{id:"migration-notes-59",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-12",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added new targets for ",(0,i.jsx)(s.code,{children:"metagen"})," with different generators and paths\r\nfor TypeScript, Python, and Rust."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionality for defining and exposing typegraphs with\r\npolicies in various environments (Deno, Python, Rust)."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added automated Rust WebAssembly project generation and compilation\r\nscript."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Enhanced documentation with new sections and updated code examples\r\nusing ",(0,i.jsx)(s.code,{children:"TGExample"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Updated ",(0,i.jsx)(s.code,{children:".gitignore"})," to exclude ",(0,i.jsx)(s.code,{children:"*.wasm"})," files."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated links and added detailed instructions for generating types\r\nusing ",(0,i.jsx)(s.code,{children:"metagen"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Switched from ",(0,i.jsx)(s.code,{children:"HashMap"})," to ",(0,i.jsx)(s.code,{children:"BTreeMap"})," and ",(0,i.jsx)(s.code,{children:"HashSet"})," to ",(0,i.jsx)(s.code,{children:"BTreeSet"})," in\r\nvarious modules for better data structure handling."]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added logging enhancements in the ",(0,i.jsx)(s.code,{children:"Typegate"})," class."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Updated build script for Rust WebAssembly target."}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Programmatic deployment blogpost (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/752",children:"#752"}),")"]})}),(0,i.jsx)(s.p,{children:"Blogpost to help discover programmatic deployment additions."}),(0,i.jsx)(s.h4,{id:"migration-notes-60",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-13",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced programmatic deployment feature for deploying typegraphs\nwithin the Metatype ecosystem using TypeScript/Python SDKs."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new configuration options and deployment functions to enhance\nautomation and flexibility in deployment processes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added a new blog post detailing the programmatic deployment feature\nand its usage."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsx)(s.h3,{id:"features-7",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(SDK) Add ",(0,i.jsx)(s.code,{children:"globs"})," and ",(0,i.jsx)(s.code,{children:"dir"})," support for artifact deps. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/698",children:"#698"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Include glob and dir support for ",(0,i.jsx)(s.code,{children:"PythonRuntime"})," deps."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Include glob and dir support for ",(0,i.jsx)(s.code,{children:"DenoRuntime"})," deps."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add tests"]}),"\n"]}),(0,i.jsxs)(s.p,{children:["The change includes support for declaring artifact dependencies through\r\n",(0,i.jsx)(s.code,{children:"globs"})," and ",(0,i.jsx)(s.code,{children:"dirs"})]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-441/sdk-support-globs-and-directories-in-artifact-dependencies",children:"MET-441"})}),(0,i.jsx)(s.h4,{id:"migration-notes-61",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["In the ",(0,i.jsx)(s.code,{children:"deps"})," parameter for ",(0,i.jsx)(s.code,{children:"python.import(...)"})," and ",(0,i.jsx)(s.code,{children:"deno.import(...)"}),",\r\nglobs and dirs can be passed in addition to files."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-14",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced functionality for defining and deploying Typegraphs for\r\nDeno and Python runtimes."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added support for defining a Deno runtime dependency graph with\r\npolicies for test scenarios."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Corrected the structure of the ",(0,i.jsx)(s.code,{children:"Deno.serve"})," call in the ",(0,i.jsx)(s.code,{children:"serve"}),"\r\nfunction."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Enhanced method chaining for better readability in the ",(0,i.jsx)(s.code,{children:"MetaTest"}),"\r\nclass."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test coverage reporting to include new Deno runtime test\r\nfiles."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Commented out and removed outdated test cases in Deno runtime tests."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Updated platform specification in configuration files."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Add ",(0,i.jsx)(s.code,{children:"embedded typegate"})," page (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/747",children:"#747"}),")"]})}),(0,i.jsx)(s.h1,{id:"embedded-typegate-docs-page",children:"Embedded typegate docs page"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","need a page under meta-cli/embedded typegate to explain how that\r\nworks"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","tutorials should take advantage of the embedded one"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","the embedded one should be the default everything"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","explain that there is 2 flavors in reference/meta-cli"]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-562/docs-use-embedded-whenever-possible-in-the-docs-and-examples",children:"MET-562"})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-62",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.em,{children:"No Migrations Needed"}),"\r\n..."]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk) Mdk python (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/707",children:"#707"}),")"]})}),(0,i.jsx)(s.p,{children:"Mdk for python runtime"}),(0,i.jsx)(s.h4,{id:"migration-notes-63",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-15",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities for generating Python code based on\r\nconfigurations, including handling of templates and required objects."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added Python script templates for defining typed functions and\r\nstructured objects with comprehensive data type handling."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced type management and priority handling in utility functions."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Provided detailed summaries and documentation for new functionalities\r\nand templates."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Implemented new structures and methods for efficient code generation\r\nand type handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added tests for defining typegraph structures and policies in Python."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated URLs in the ",(0,i.jsx)(s.code,{children:".ghjk/deno.lock"})," file to reflect new changes in\r\nthe codebase."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{open:!0,children:[(0,i.jsxs)("summary",{children:[(0,i.jsxs)(s.p,{children:["(mdk) ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/739",children:"#739"}),")"]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["BREAKING: ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/739",children:"#739"}),")"]}),"\n"]})]}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Implements the ",(0,i.jsx)(s.code,{children:"mdk_typescript"})," code generator for typescript type\ninference on Deno runtime external modules."]}),"\n",(0,i.jsx)(s.li,{children:"Ports the very simple generator already present in meta-cli."}),"\n",(0,i.jsx)(s.li,{children:"Removes old codegen from cli and sdk."}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-64",children:"Migration notes"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Metagen section of ",(0,i.jsx)(s.code,{children:"metatype.yaml"})," has changed. Targets are now lists\ninstead of maps, items no sporting ",(0,i.jsx)(s.code,{children:"generator"})," field instead of key\nacting as ref to generator."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) WasmRuntime's ",(0,i.jsx)(s.code,{children:"fromExport"})," method has been renamed to ",(0,i.jsx)(s.code,{children:"export"}),"\nto make it more uniform to handler."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) WasmRuntime ",(0,i.jsx)(s.code,{children:"export"})," and ",(0,i.jsx)(s.code,{children:"handler"})," method's now expect\nhandler/func name under ",(0,i.jsx)(s.code,{children:"name"})," instead of ",(0,i.jsx)(s.code,{children:"func"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:["(sdk) ",(0,i.jsx)(s.code,{children:"codegen"})," flag has been removed from ",(0,i.jsx)(s.code,{children:"ArtifactsConfig"})," object."]}),"\n",(0,i.jsxs)(s.li,{children:["(cli) ",(0,i.jsx)(s.code,{children:"gen mod/mdk"})," has been simplified to just ",(0,i.jsx)(s.code,{children:"gen"})," as the previous\nmod option is no longer avail."]}),"\n"]}),(0,i.jsx)(s.hr,{}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(mdk,gate) Hostcall (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/706",children:"#706"}),")"]})}),(0,i.jsx)(s.p,{children:"Introduces a mechanism for wasm materializers to access hostgate\r\nfunctions."}),(0,i.jsxs)(s.p,{children:["This implements a pretty basic JSON wire interface, a singular\r\n",(0,i.jsx)(s.code,{children:"hostcall"})," function that's exposed to materializers. The only\r\nimplemented function on this interface are ",(0,i.jsx)(s.code,{children:"gql"})," queries."]}),(0,i.jsx)(s.p,{children:"This is a stacked PR on top of #687."}),(0,i.jsx)(s.p,{children:"MET-473."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-16",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added an import statement for ",(0,i.jsx)(s.code,{children:"std_url"})," and a new task for installing\r\nWASI adapter related files."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities in the application's runtime to support\r\nadditional parameters and error handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Enhancements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved the application's handling of GraphQL queries with new error\r\ntypes and display methods."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced the WASM runtime build process to target a more appropriate\r\narchitecture."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fixed issues in Python and WASM runtime tests to ensure reliability\r\nand performance."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated internal documentation to reflect new command interfaces and\r\nenvironmental interactions in the application's CLI tools."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Refactored various internal APIs to improve code maintainability and\r\nefficiency."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(meta-test) Update ",(0,i.jsx)(s.code,{children:"t.engine()"})," impl (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/716",children:"#716"}),")"]})}),(0,i.jsxs)(s.p,{children:["Update the implementation of ",(0,i.jsx)(s.code,{children:"t.engine()"})]}),(0,i.jsxs)(s.p,{children:["The change comes with removing the different spin-offs of ",(0,i.jsx)(s.code,{children:"t.engine"}),"\r\nwhich arose from the previous impl of t.engine incompatibility with\r\nartifact upload protocol. The change will make ",(0,i.jsx)(s.code,{children:"t.engine"})," deploy the\r\nartifacts in Artifact Resolution mode by running a shell command to\r\ndeploy the typegraph."]}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-500/test-update-the-implementation-of-tengine",children:"MET-500"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","remove different versions of ",(0,i.jsx)(s.code,{children:"t.engine"})]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add tg_deploy caller script which imports typegraphs dynamically\r\nand deploys them."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","make changes to make ",(0,i.jsx)(s.code,{children:"t.engine"})," run in artifact resolution mode"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","update existing tests to adhere to the current change"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","pass unique different ",(0,i.jsx)(s.code,{children:"tempDir"}),"s to all the typegate instances\r\ncreated during test."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add support for authoring multiple typegraphs in a single file in\r\n",(0,i.jsx)(s.code,{children:"meta-test"})," and add multi typegraph tests."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"migration-notes-65",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"python SDK test typegraphs' function names should be the same with the\r\nfilename of the typegraph file, for dynamic import compatibility\r\nreasons."}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-17",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Introduced a new function ",(0,i.jsx)(s.code,{children:"wasm_duplicate"})," to handle WebAssembly\r\nruntimes with specific policies."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Renamed and refactored functions and test setups to align with updated\r\ntest frameworks and improve code clarity."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added error handling in the ",(0,i.jsx)(s.code,{children:"getLocalPath"})," function to log warnings if\r\nlinking errors occur."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated test scripts to reflect changes in function calls, imports,\r\nand engine instantiation for better test accuracy and reliability."}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Doc polish (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/735",children:"#735"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"doc polish and cleanup"}),"\n",(0,i.jsx)(s.li,{children:"upgrade website except Docusaurus as the css issue is stil present"}),"\n",(0,i.jsx)(s.li,{children:"bump to next pre-release"}),"\n",(0,i.jsx)(s.li,{children:"not everything is done, but let's iterate!"}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-18",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Added platform compatibility for ",(0,i.jsx)(s.code,{children:"x86_64-linux"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new functionalities for generating Python code and enhanced\r\ntype management."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added import statement for ",(0,i.jsx)(s.code,{children:"std_url"})," and new task for installing WASI\r\nadapter files."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced runtime support for additional parameters and error handling."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Improvements"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced GraphQL query handling with new error types and display\r\nmethods."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Improved WASM runtime build process for better architecture targeting."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:'Updated feature overview and added a "Features Roadmap" component.'}),"\n",(0,i.jsx)(s.li,{children:"Enhanced various guides and references for better clarity."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Added new sections for Typegate, Typegraph, Runtimes, Prisma, Auth,\r\nTooling, and SDK."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Corrected typos and improved code example presentation."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Fixed issues in Python and WASM runtime tests to ensure reliability."}),"\n"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-9",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Replace term materializer with function for user facing concepts (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/736",children:"#736"}),")"]})}),(0,i.jsx)(s.p,{children:"Materializer and function might introduce confusion as they are pretty\r\nmuch the same thing from the user point of view, one can be defined in\r\nterms of the other."}),(0,i.jsx)(s.h4,{id:"migration-notes-66",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-19",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:'Updated terminology from "materializers" to "functions" across various\r\ndocumentation files to reflect a semantic shift and provide clearer\r\ndescriptions.'}),"\n",(0,i.jsx)(s.li,{children:"Improved clarity in descriptions of custom functions, runtimes, and\r\ntheir roles in the Metatype computing model."}),"\n",(0,i.jsx)(s.li,{children:"Corrected typos and refined explanations in multiple guides and\r\nreference documents."}),"\n"]}),(0,i.jsx)(s.p,{children:"These changes enhance the readability and consistency of our\r\ndocumentation, making it easier for users to understand and implement\r\nthe features and concepts within the system."})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Embedded typegate (v0.3.x) blog (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/750",children:"#750"}),")"]})}),(0,i.jsx)(s.h1,{id:"add-a-blog-about-embedded-typegate",children:"Add a blog about Embedded Typegate."}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-564/docs-embedded-typegate-v03x",children:"MET-564"})}),(0,i.jsx)(s.h4,{id:"migration-notes-67",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-20",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced a new blog post on emulating server nodes locally using the\r\nEmbedded Typegate feature in Meta CLI."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Added a new ",(0,i.jsx)(s.code,{children:"BlogIntro"})," component to the website for displaying styled\r\nblog introductions."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated documentation to explain how to spin up a local instance of\r\nTypegate for testing and development."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated platform compatibility from "x86_64-linux" to\r\n"aarch64-darwin".'}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(website) ",(0,i.jsx)(s.code,{children:"g.rest"})," reference at ",(0,i.jsx)(s.code,{children:"/docs/reference/rest"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/734",children:"#734"}),")"]})}),(0,i.jsxs)(s.p,{children:["Add reference page for ",(0,i.jsx)(s.code,{children:"g.rest(..)"})]}),(0,i.jsx)(s.h4,{id:"migration-notes-68",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-21",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Documentation"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added a reference to the REST reference section in the REST guide."}),"\n",(0,i.jsx)(s.li,{children:"Introduced new documentation for consuming APIs using Metatype."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["Included examples in Python and TypeScript for interacting with REST\r\nAPIs.","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Explained query types, dynamic queries, and endpoint access."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Provided guidance on accessing auto-generated documentation and\r\ndownloading the OpenAPI spec."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump deno to 1.43.6 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/737",children:"#737"}),")"]})}),(0,i.jsx)(s.p,{children:"Update deno to 1.43.6 and make requisite changes."}),(0,i.jsx)(s.p,{children:"Required because of dep conflicts with latest lade-sdk."}),(0,i.jsx)(s.h4,{id:"migration-notes-69",children:"Migration notes"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Update ",(0,i.jsx)(s.code,{children:"rust"})," dependencies (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/748",children:"#748"}),")"]})}),(0,i.jsx)(s.p,{children:"update Rust dependencies"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-479/sdkgate-update-rust-dependencies",children:"MET-479"})}),(0,i.jsx)(s.h4,{id:"migration-notes-70",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change comes with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump ",(0,i.jsx)(s.code,{children:"METATYPE_VERSION"})," to 0.4.3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/764",children:"#764"}),")"]})})}),"\n",(0,i.jsxs)(s.h2,{id:"v042---2024-05-22",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.2",children:"v0.4.2"})," - 2024-05-22"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-6",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Fix fat CLI compilation (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/730",children:"#730"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Fix fat CLI compilation"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump to 0.4.2"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump wasmtime to 21"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Bump rust to 1.78.0"}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change comes with new or modified tests"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:["\n",(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v041---2024-05-20",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.1",children:"v0.4.1"})," - 2024-05-20"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-7",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(SDK) Artifact upload fails when same file referred multiple times (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/715",children:"#715"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","fix the bug where duplicate artifact references causing failure\r\nduring artifact resolution(typegate) during runtime."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add sync mode tests for Python and Deno runtime."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","add other edge test cases to artifact upload.","\n",(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","test for no artifact in typegraph"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","test for duplicate artifact reference in the same typegraph"]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Improve logging and responses, prepare 0.4.1 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/714",children:"#714"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Logging before and after each faillible operation","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Runtimes: foreign resolvers"}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(s.li,{children:"Always log before reporting error: HTTP response"}),"\n",(0,i.jsx)(s.li,{children:"Fix error code in artifact_service"}),"\n",(0,i.jsxs)(s.li,{children:["Add ",(0,i.jsx)(s.code,{children:"BaseError"})," class for structured messages in responses"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-22",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated Docker image versions and dependency versions to ensure\r\ncompatibility and stability."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added a search functionality to the app."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced error handling with specific error classes for more detailed\r\nerror messages."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Replaced generic ",(0,i.jsx)(s.code,{children:"Error"})," instances with specific error classes for\r\nbetter error categorization."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Refactored error handling in HTTP response functions to use a\r\n",(0,i.jsx)(s.code,{children:"BaseError"})," class."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated version numbers across multiple configuration files to\r\n",(0,i.jsx)(s.code,{children:"0.4.1-0"}),"."]}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"features-8",children:"Features"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Polish documentation and project (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/696",children:"#696"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"update the headline, the overviews and many other documentation areas"}),"\n",(0,i.jsx)(s.li,{children:"upgrades the dependencies."}),"\n"]}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-23",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Updated Docker image version for the ",(0,i.jsx)(s.code,{children:"typegate"})," service to ensure\r\nstability and compatibility."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Revised ",(0,i.jsx)(s.code,{children:"TAGLINE"})," for better clarity on supported languages: WASM,\r\nTypescript, and Python."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated version declarations for improved consistency and\r\nfunctionality across multiple files."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-10",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(docs) Final polish to comparison table. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/709",children:"#709"}),")"]})}),(0,i.jsx)(s.p,{children:"some changes to comparison table(docs)"}),(0,i.jsx)(s.h4,{id:"migration-notes-71",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-24",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Introduced a new section on Artifact Tracking Protocol in the\r\narchitecture documentation, explaining artifact classification and\r\ntracking modes in Metatype."}),"\n",(0,i.jsx)(s.li,{children:"Updated comparisons documentation with additional platforms, criteria\r\nfor choosing Metatype, and detailed feature comparison tables."}),"\n",(0,i.jsx)(s.li,{children:"Renamed project directory for clarity and consistency in project setup\r\ndocumentation."}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Bug Fixes"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Removed outdated ",(0,i.jsx)(s.code,{children:"TODO"})," comment in installation documentation."]}),"\n"]}),"\n"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Bump to version 0.4.1-0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/713",children:"#713"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Bumps version to 0.4.1-0."}),"\n",(0,i.jsx)(s.li,{children:"Fixes broken release CI."}),"\n",(0,i.jsx)(s.li,{children:"#719"}),"\n",(0,i.jsx)(s.li,{children:"Adds 20 minutes to test-full timeout."}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-25",children:"Summary by CodeRabbit"}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-26",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated platform support for better compatibility with "x86_64-linux".'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Minor version updates across multiple configurations to enhance\r\nstability."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:'Updated version numbers from "0.4.0" to "0.4.1-0" across various files\r\nand configurations.'}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Adjusted build and test scripts for improved efficiency and\r\ncompatibility."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Enhanced internal documentation to reflect version and platform\r\nchanges."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(s.h2,{id:"v040---2024-05-09",children:[(0,i.jsx)(s.a,{href:"https://github.com/metatypedev/metatype/releases/tag/v0.4.0",children:"v0.4.0"})," - 2024-05-09"]}),"\n",(0,i.jsx)(s.h3,{id:"bug-fixes-8",children:"Bug Fixes"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gh-tests) Fix local npm registry config (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/692",children:"#692"}),")"]})}),(0,i.jsx)(s.p,{children:"Fix the NPM registry config in the Github tests."}),(0,i.jsx)(s.h4,{id:"migration-notes-72",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Website and headline (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/691",children:"#691"}),")"]})}),(0,i.jsx)(s.h4,{id:"motivation-and-context",children:"Motivation and context"}),(0,i.jsxs)(s.p,{children:["Fix the CSS issue introduced by docusaurus 3.2.0\r\n(",(0,i.jsx)(s.a,{href:"https://github.com/facebook/docusaurus/issues/10005",children:"https://github.com/facebook/docusaurus/issues/10005"}),"). 3.2.1 should fix\r\nit but the affected version maybe loaded by dependencies, so we will\r\nhave to wait a bit more."]}),(0,i.jsx)(s.h3,{id:"checklist-2",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Do not override log level when no verbosity flag is present (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/694",children:"#694"}),")"]})}),(0,i.jsx)(s.p,{children:"Remove log level override by the verbosity flag when no flag is present.\r\nIt will default to the configured env_logger default level (or env\r\nvariable)."}),(0,i.jsx)(s.p,{children:"..."}),(0,i.jsxs)(s.p,{children:['The default log level became "error" after #664, and ',(0,i.jsx)(s.code,{children:"RUST_LOG"}),"\r\nenvironment variable where ignored."]}),(0,i.jsx)(s.h4,{id:"migration-notes-73",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})})]}),"\n",(0,i.jsx)(s.h3,{id:"documentation-3",children:"Documentation"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add examples for each command (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/684",children:"#684"}),")"]})}),(0,i.jsx)(s.h4,{id:"motivation-and-context-1",children:"Motivation and context"}),(0,i.jsxs)(s.p,{children:["Getting started with ",(0,i.jsx)(s.code,{children:"meta"})," cli should be easy"]}),(0,i.jsx)(s.h4,{id:"migration-notes-74",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsx)(s.h3,{id:"checklist-3",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"/tutorials/quick-start"})," section. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/681",children:"#681"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Improve Layout"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Include a simple project."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add the result/outputs to running CLI commands."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Remove Metatype cloud registration form."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Separate the CLI commands to separate code blocks"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add links to references and concepts."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Add playground."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-2",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-440/docs-meta-task",children:"Docs\r\nMeta-task"})}),(0,i.jsx)(s.h4,{id:"migration-notes-75",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})}),(0,i.jsx)(s.h3,{id:"checklist-4",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Test the commands and the examples."]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"/docs/tutorials/metatype-basics"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/688",children:"#688"}),")"]})}),(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"/docs/tutorials/metatype-basics"})]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-3",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-440/docs-meta-task",children:"Docs\r\nMeta-task"})}),(0,i.jsx)(s.h4,{id:"migration-notes-76",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migrations Needed"})}),(0,i.jsx)(s.h3,{id:"checklist-5",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"/reference/runtimes/"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/676",children:"#676"}),")"]})}),(0,i.jsx)(s.h4,{id:"motivation-and-context-4",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:"Better documentation"}),(0,i.jsx)(s.h4,{id:"migration-notes-77",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"N/A"}),(0,i.jsx)(s.h3,{id:"checklist-6",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"/guides/external-functions"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/677",children:"#677"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Improvements to the ",(0,i.jsx)(s.code,{children:"/guides/external-functions"})," page."]}),"\n",(0,i.jsx)(s.li,{children:"Adds a configuration file for git-town"}),"\n"]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-5",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h4,{id:"migration-notes-78",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h3,{id:"checklist-7",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Improve ",(0,i.jsx)(s.code,{children:"docs/reference/types"})," (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/685",children:"#685"}),")"]})}),(0,i.jsxs)(s.p,{children:["Improves ",(0,i.jsx)(s.code,{children:"docs/reference/types"})]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-6",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h4,{id:"migration-notes-79",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h3,{id:"checklist-8",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Add a comparison b/n metatype and other similar solutions/products. (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/697",children:"#697"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Adds a comparison table between metatype and other similar services."}),"\n",(0,i.jsxs)(s.li,{children:["Add artifact upload protocol to ",(0,i.jsx)(s.code,{children:"Architecture"})," section in docs."]}),"\n"]}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-443/include-comparisons-with-other-products-similar-to-metatype",children:"MET-443"})}),(0,i.jsx)(s.h4,{id:"migration-notes-80",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"No Migration Needed"})})]}),"\n",(0,i.jsx)(s.h3,{id:"features-9",children:"Features"}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli) Timeout loader process (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/693",children:"#693"}),")"]})})}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(cli,sdk) Better error messages (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/689",children:"#689"}),")"]})}),(0,i.jsx)(s.h4,{id:"motivation-and-context-7",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:"Make it more clear where failures happen"}),(0,i.jsx)(s.h4,{id:"migration-notes-81",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"None"}),(0,i.jsx)(s.h3,{id:"checklist-9",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upload artifacts to s3 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/638",children:"#638"}),")"]})}),(0,i.jsx)(s.p,{children:"Upload artifacts to S3 when sync-mode is enabled"}),(0,i.jsx)(s.h4,{id:"motivation-and-context-8",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:"Sharing artifacts between replicas without including it in the typegraph\r\n(and sync through redis)"}),(0,i.jsx)(s.h4,{id:"migration-notes-82",children:"Migration notes"}),(0,i.jsx)(s.p,{children:"No changes needed."}),(0,i.jsx)(s.h3,{id:"checklist-10",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upload ",(0,i.jsx)(s.code,{children:"PythonRuntime"})," artifacts and deps (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/672",children:"#672"}),")"]})}),(0,i.jsx)(s.h4,{id:"motivation-and-context-9",children:"Motivation and context"}),(0,i.jsxs)(s.p,{children:["Track artifact/module dependencis for ",(0,i.jsx)(s.code,{children:"PythonRuntime"})]}),(0,i.jsx)(s.h4,{id:"migration-notes-83",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"python.import(...)"})," and ",(0,i.jsx)(s.code,{children:"python.import_(...)"})," accept an optional parameter ",(0,i.jsx)(s.code,{children:"deps"})," that accepts list of dependencies for the python module."]}),(0,i.jsx)(s.h3,{id:"checklist-11",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Upload ",(0,i.jsx)(s.code,{children:"DenoRuntime"})," artifacts and deps (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/674",children:"#674"}),")"]})}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Track deno runtime artifacts(also dependencies)"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Upload artifacts during deploy to either local(single replica) or\r\nshared(s3)"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","resolve artifacts(module and deps) upon typegate runtime."]}),"\n"]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-10",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:"Persisting deno runtime artifacts to a local/shared storage."}),(0,i.jsx)(s.h4,{id:"migration-notes-84",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:[(0,i.jsx)(s.code,{children:"deno.import(...)"})," and ",(0,i.jsx)(s.code,{children:"deno.import_(...)"})," accept an optional parameter\r\nthat accepts list of dependencies for the deno/ts module."]}),(0,i.jsx)(s.h3,{id:"checklist-12",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Enable batch prisma queries in the typegate runtime (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/682",children:"#682"}),")"]})}),(0,i.jsx)(s.p,{children:"Enable batch prisma queries (and transaction) in the typegate runtime"}),(0,i.jsx)(s.h4,{id:"motivation-and-context-11",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:"Console"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-381/console-collections",children:"MET-381"})}),(0,i.jsx)(s.h4,{id:"migration-notes-85",children:"Migration notes"}),(0,i.jsx)(s.h3,{id:"checklist-13",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["Artifact removal (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/668",children:"#668"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Add GC: remove artifacts when unreferenced by any deployed typegraph"}),"\n",(0,i.jsxs)(s.li,{children:["Improve resource management: use ",(0,i.jsx)(s.code,{children:"AsyncDisposable"})," and\r\n",(0,i.jsx)(s.code,{children:"AsyncDisposableStack"})]}),"\n",(0,i.jsxs)(s.li,{children:["Improve testability (for parallel testing): always read the tmpDir\r\nconfig from the ",(0,i.jsx)(s.code,{children:"Typegate"})," object"]}),"\n"]}),(0,i.jsx)(s.h4,{id:"motivation-and-context-12",children:"Motivation and context"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.a,{href:"https://linear.app/metatypedev/issue/MET-433/file-removal",children:"MET-433"})}),(0,i.jsx)(s.h4,{id:"migration-notes-86",children:"Migration notes"}),(0,i.jsx)(s.p,{children:(0,i.jsx)(s.em,{children:"N/A"})}),(0,i.jsx)(s.h3,{id:"checklist-14",children:"Checklist"}),(0,i.jsxs)(s.ul,{className:"contains-task-list",children:["\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","The change come with new or modified tests"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","Hard-to-understand functions have explanatory comments"]}),"\n",(0,i.jsxs)(s.li,{className:"task-list-item",children:[(0,i.jsx)(s.input,{type:"checkbox",checked:!0,disabled:!0})," ","End-user documentation is updated to reflect the change"]}),"\n"]}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-27",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Enhanced search functionality with the addition of a new search bar."}),"\n",(0,i.jsx)(s.li,{children:"Introduced new test configurations to improve script execution."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Updated artifact storage documentation to clarify management\r\nprocesses."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Added new extensions to support improved code commenting."}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Removed outdated Deno import mapping settings to streamline\r\ndevelopment environment setup."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Expanded documentation on artifact tracking and management, including\r\nreference counting and garbage collection mechanisms."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Refactor"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsxs)(s.p,{children:["Implemented interface changes in ",(0,i.jsx)(s.code,{children:"QueryEngine"})," for better async\r\ndisposal management."]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Code restructuring in artifact management for enhanced performance and\r\nmaintainability."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Chores"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Adjusted settings and configurations in the development environment to\r\nalign with current best practices."}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:(0,i.jsx)(s.strong,{children:"Tests"})}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["\n",(0,i.jsx)(s.p,{children:"Introduced new test cases for artifact upload and management\r\nfunctionalities."}),"\n"]}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(s.h3,{id:"miscellaneous-tasks-11",children:"Miscellaneous Tasks"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(release) Prepare 0.4.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/710",children:"#710"}),")"]})}),(0,i.jsx)(s.p,{children:"Bumps version to release 0.4.0."}),(0,i.jsx)(s.h2,{id:"summary-by-coderabbit-28",children:"Summary by CodeRabbit"}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"New Features"})}),"\n",(0,i.jsx)(s.li,{children:"Updated the software across various components to version 0.4.0,\r\nenhancing functionality and potentially introducing new features or\r\nfixes."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Documentation"})}),"\n",(0,i.jsx)(s.li,{children:"Updated version documentation in multiple configuration files to\r\nreflect new version 0.4.0."}),"\n",(0,i.jsx)(s.li,{children:(0,i.jsx)(s.strong,{children:"Bug Fixes"})}),"\n",(0,i.jsx)(s.li,{children:"Adjusted version constants and dependencies to ensure compatibility\r\nand stability with the new software version 0.4.0."}),"\n"]}),(0,i.jsx)(s.hr,{})]}),"\n",(0,i.jsx)(n,{children:(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(sdk,gate) Bump wasmtime to 20.0.0 and wit-bindgen to 0.24.0 (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/695",children:"#695"}),")"]})})}),"\n",(0,i.jsx)(s.h3,{id:"refactor-5",children:"Refactor"}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(gate) Wasi 0.2 pyrt (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/687",children:"#687"}),")"]})}),(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Rewrites the PythonRuntime host using a ",(0,i.jsx)(s.code,{children:"componentize-py"})," based\r\ncomponent."]}),"\n",(0,i.jsxs)(s.li,{children:["Leaf through this\r\n",(0,i.jsx)(s.a,{href:"https://hackmd.io/@SC-qT-WXTROceKYdNA-Lpg/ryyAXiQlC/edit",children:"memo"})," for a\r\nmental model."]}),"\n"]})]}),"\n",(0,i.jsxs)(n,{children:[(0,i.jsx)("summary",{children:(0,i.jsxs)(s.p,{children:["(libs/xtask,gate) Remove xtask/codegen (",(0,i.jsx)("a",{href:"https://github.com/metatypedev/metatype/pull/700",children:"#700"}),")"]})}),(0,i.jsx)(s.p,{children:"Faster build time"}),(0,i.jsx)(s.h4,{id:"migration-notes-87",children:"Migration notes"}),(0,i.jsxs)(s.p,{children:["Make sure to sync ",(0,i.jsx)(s.code,{children:"typegate/src/types.ts"})," when an update is made on the\r\ntypegraph schema."]})]})]})}function d(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}const a={title:"Changelog",comments:!1,sidebar_position:1e3},c="",r={id:"reference/changelog",title:"Changelog",description:"",source:"@site/docs/reference/changelog.mdx",sourceDirName:"reference",slug:"/reference/changelog",permalink:"/docs/reference/changelog",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/changelog.mdx",tags:[],version:"current",sidebarPosition:1e3,frontMatter:{title:"Changelog",comments:!1,sidebar_position:1e3},sidebar:"docs",previous:{title:"Embedded Typegate",permalink:"/docs/reference/meta-cli/embedded-typegate/"},next:{title:"index",permalink:"/docs/reference/metagen/"}},o={},h=[{value:"v0.5.0-rc.1 - 2024-10-22",id:"v050-rc1---2024-10-22",level:2},{value:"Bug Fixes",id:"bug-fixes",level:3},{value:"Migration notes",id:"migration-notes",level:4},{value:"Migration notes",id:"migration-notes-1",level:4},{value:"Migration notes",id:"migration-notes-2",level:4},{value:"Checklist",id:"checklist",level:4},{value:"Migration notes",id:"migration-notes-3",level:4},{value:"Fix missing images for durable execution blog",id:"fix-missing-images-for-durable-execution-blog",level:2},{value:"Migration notes",id:"migration-notes-4",level:4},{value:"Migration notes",id:"migration-notes-5",level:4},{value:"Documentation",id:"documentation",level:3},{value:"Migration notes",id:"migration-notes-6",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-1",level:2},{value:"Migration notes",id:"migration-notes-7",level:4},{value:"Features",id:"features",level:3},{value:"Migration notes",id:"migration-notes-8",level:4},{value:"Migration notes",id:"migration-notes-9",level:4},{value:"Migration notes",id:"migration-notes-10",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-2",level:2},{value:"Migration notes",id:"migration-notes-11",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-3",level:2},{value:"Release Notes",id:"release-notes",level:2},{value:"Migration notes",id:"migration-notes-12",level:4},{value:"Migration notes",id:"migration-notes-13",level:4},{value:"Migration notes",id:"migration-notes-14",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-4",level:2},{value:"Release Notes",id:"release-notes-1",level:2},{value:"Migration notes",id:"migration-notes-15",level:4},{value:"Migration notes",id:"migration-notes-16",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks",level:3},{value:"Migration notes",id:"migration-notes-17",level:4},{value:"Migration notes",id:"migration-notes-18",level:4},{value:"Refactor",id:"refactor",level:3},{value:"Migration notes",id:"migration-notes-19",level:4},{value:"Migration notes",id:"migration-notes-20",level:4},{value:"Migration notes",id:"migration-notes-21",level:4},{value:"Migration notes",id:"migration-notes-22",level:4},{value:"Migration notes",id:"migration-notes-23",level:4},{value:"Checklist",id:"checklist-1",level:4},{value:"Migration notes",id:"migration-notes-24",level:4},{value:"v0.4.10 - 2024-09-04",id:"v0410---2024-09-04",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-1",level:3},{value:"v0.4.10-rc1 - 2024-09-03",id:"v0410-rc1---2024-09-03",level:2},{value:"Bug Fixes",id:"bug-fixes-1",level:3},{value:"v0.4.9 - 2024-09-02",id:"v049---2024-09-02",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-2",level:3},{value:"v0.4.9-rc2 - 2024-09-02",id:"v049-rc2---2024-09-02",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-3",level:3},{value:"v0.4.9-rc1 - 2024-09-02",id:"v049-rc1---2024-09-02",level:2},{value:"Features",id:"features-1",level:3},{value:"Migration notes",id:"migration-notes-25",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-5",level:2},{value:"Migration notes",id:"migration-notes-26",level:4},{value:"Migration notes",id:"migration-notes-27",level:4},{value:"Refactor",id:"refactor-1",level:3},{value:"Ensure documentation is pushing for meta dev instead of meta typegate",id:"ensure-documentation-is-pushing-for-meta-dev-instead-of-meta-typegate",level:2},{value:"Migration notes",id:"migration-notes-28",level:4},{value:"Migration notes",id:"migration-notes-29",level:4},{value:"v0.4.8 - 2024-08-16",id:"v048---2024-08-16",level:2},{value:"Bug Fixes",id:"bug-fixes-2",level:3},{value:"Features",id:"features-2",level:3},{value:"Migration notes",id:"migration-notes-30",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-4",level:3},{value:"v0.4.7 - 2024-08-08",id:"v047---2024-08-08",level:2},{value:"Features",id:"features-3",level:3},{value:"Migration notes",id:"migration-notes-31",level:4},{value:"Migration notes",id:"migration-notes-32",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-5",level:3},{value:"Refactor",id:"refactor-2",level:3},{value:"Migration notes",id:"migration-notes-33",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-6",level:2},{value:"Migration notes",id:"migration-notes-34",level:4},{value:"v0.4.6 - 2024-08-01",id:"v046---2024-08-01",level:2},{value:"Features",id:"features-4",level:3},{value:"Migration notes",id:"migration-notes-35",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-6",level:3},{value:"Migration notes",id:"migration-notes-36",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-7",level:2},{value:"Refactor",id:"refactor-3",level:3},{value:"Improve the documentation on quick-start page",id:"improve-the-documentation-on-quick-start-page",level:2},{value:"Migration notes",id:"migration-notes-37",level:4},{value:"v0.4.5 - 2024-07-18",id:"v045---2024-07-18",level:2},{value:"Bug Fixes",id:"bug-fixes-3",level:3},{value:"Migration notes",id:"migration-notes-38",level:4},{value:"Migration notes",id:"migration-notes-39",level:4},{value:"Migration notes",id:"migration-notes-40",level:4},{value:"Migration notes",id:"migration-notes-41",level:4},{value:"Features",id:"features-5",level:3},{value:"Migration notes",id:"migration-notes-42",level:4},{value:"Migration notes",id:"migration-notes-43",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-7",level:3},{value:"Migration notes",id:"migration-notes-44",level:4},{value:"v0.4.4 - 2024-07-05",id:"v044---2024-07-05",level:2},{value:"Bug Fixes",id:"bug-fixes-4",level:3},{value:"Documentation",id:"documentation-1",level:3},{value:"Migration notes",id:"migration-notes-45",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-8",level:2},{value:"Features",id:"features-6",level:3},{value:"Migration notes",id:"migration-notes-46",level:4},{value:"Migration notes",id:"migration-notes-47",level:4},{value:"Migration notes",id:"migration-notes-48",level:4},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-8",level:3},{value:"Add Programmatic deploy tests for the docs",id:"add-programmatic-deploy-tests-for-the-docs",level:2},{value:"Migration notes",id:"migration-notes-49",level:4},{value:"Migration notes",id:"migration-notes-50",level:4},{value:"Refactor",id:"refactor-4",level:3},{value:"Migration notes",id:"migration-notes-51",level:4},{value:"Migration notes",id:"migration-notes-52",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-9",level:2},{value:"Testing",id:"testing",level:3},{value:"Migration notes",id:"migration-notes-53",level:4},{value:"v0.4.3 - 2024-06-22",id:"v043---2024-06-22",level:2},{value:"Bug Fixes",id:"bug-fixes-5",level:3},{value:"Migration notes",id:"migration-notes-54",level:4},{value:"Migration notes",id:"migration-notes-55",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-10",level:2},{value:"Migration notes",id:"migration-notes-56",level:4},{value:"Migration notes",id:"migration-notes-57",level:4},{value:"Migration notes",id:"migration-notes-58",level:4},{value:"Documentation",id:"documentation-2",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-11",level:2},{value:"Migration notes",id:"migration-notes-59",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-12",level:2},{value:"Migration notes",id:"migration-notes-60",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-13",level:2},{value:"Features",id:"features-7",level:3},{value:"Migration notes",id:"migration-notes-61",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-14",level:2},{value:"Migration notes",id:"migration-notes-62",level:4},{value:"Migration notes",id:"migration-notes-63",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-15",level:2},{value:"Migration notes",id:"migration-notes-64",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-16",level:2},{value:"Migration notes",id:"migration-notes-65",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-17",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-18",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-9",level:3},{value:"Migration notes",id:"migration-notes-66",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-19",level:2},{value:"Migration notes",id:"migration-notes-67",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-20",level:2},{value:"Migration notes",id:"migration-notes-68",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-21",level:2},{value:"Migration notes",id:"migration-notes-69",level:4},{value:"Migration notes",id:"migration-notes-70",level:4},{value:"v0.4.2 - 2024-05-22",id:"v042---2024-05-22",level:2},{value:"Bug Fixes",id:"bug-fixes-6",level:3},{value:"v0.4.1 - 2024-05-20",id:"v041---2024-05-20",level:2},{value:"Bug Fixes",id:"bug-fixes-7",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-22",level:2},{value:"Features",id:"features-8",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-23",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-10",level:3},{value:"Migration notes",id:"migration-notes-71",level:4},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-24",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-25",level:2},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-26",level:2},{value:"v0.4.0 - 2024-05-09",id:"v040---2024-05-09",level:2},{value:"Bug Fixes",id:"bug-fixes-8",level:3},{value:"Migration notes",id:"migration-notes-72",level:4},{value:"Motivation and context",id:"motivation-and-context",level:4},{value:"Checklist",id:"checklist-2",level:3},{value:"Migration notes",id:"migration-notes-73",level:4},{value:"Documentation",id:"documentation-3",level:3},{value:"Motivation and context",id:"motivation-and-context-1",level:4},{value:"Migration notes",id:"migration-notes-74",level:4},{value:"Checklist",id:"checklist-3",level:3},{value:"Motivation and context",id:"motivation-and-context-2",level:4},{value:"Migration notes",id:"migration-notes-75",level:4},{value:"Checklist",id:"checklist-4",level:3},{value:"Motivation and context",id:"motivation-and-context-3",level:4},{value:"Migration notes",id:"migration-notes-76",level:4},{value:"Checklist",id:"checklist-5",level:3},{value:"Motivation and context",id:"motivation-and-context-4",level:4},{value:"Migration notes",id:"migration-notes-77",level:4},{value:"Checklist",id:"checklist-6",level:3},{value:"Motivation and context",id:"motivation-and-context-5",level:4},{value:"Migration notes",id:"migration-notes-78",level:4},{value:"Checklist",id:"checklist-7",level:3},{value:"Motivation and context",id:"motivation-and-context-6",level:4},{value:"Migration notes",id:"migration-notes-79",level:4},{value:"Checklist",id:"checklist-8",level:3},{value:"Migration notes",id:"migration-notes-80",level:4},{value:"Features",id:"features-9",level:3},{value:"Motivation and context",id:"motivation-and-context-7",level:4},{value:"Migration notes",id:"migration-notes-81",level:4},{value:"Checklist",id:"checklist-9",level:3},{value:"Motivation and context",id:"motivation-and-context-8",level:4},{value:"Migration notes",id:"migration-notes-82",level:4},{value:"Checklist",id:"checklist-10",level:3},{value:"Motivation and context",id:"motivation-and-context-9",level:4},{value:"Migration notes",id:"migration-notes-83",level:4},{value:"Checklist",id:"checklist-11",level:3},{value:"Motivation and context",id:"motivation-and-context-10",level:4},{value:"Migration notes",id:"migration-notes-84",level:4},{value:"Checklist",id:"checklist-12",level:3},{value:"Motivation and context",id:"motivation-and-context-11",level:4},{value:"Migration notes",id:"migration-notes-85",level:4},{value:"Checklist",id:"checklist-13",level:3},{value:"Motivation and context",id:"motivation-and-context-12",level:4},{value:"Migration notes",id:"migration-notes-86",level:4},{value:"Checklist",id:"checklist-14",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-27",level:2},{value:"Miscellaneous Tasks",id:"miscellaneous-tasks-11",level:3},{value:"Summary by CodeRabbit",id:"summary-by-coderabbit-28",level:2},{value:"Refactor",id:"refactor-5",level:3},{value:"Migration notes",id:"migration-notes-87",level:4}];function x(e){const s={h1:"h1",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.h1,{id:""}),"\n",(0,i.jsx)(d,{})]})}function m(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(x,{...e})}):x(e)}}}]); \ No newline at end of file diff --git a/assets/js/ad5e0346.8ab824fd.js b/assets/js/ad5e0346.5ca5f6ad.js similarity index 86% rename from assets/js/ad5e0346.8ab824fd.js rename to assets/js/ad5e0346.5ca5f6ad.js index c1f8ccdb35..6fc65b4c5a 100644 --- a/assets/js/ad5e0346.8ab824fd.js +++ b/assets/js/ad5e0346.5ca5f6ad.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[11],{14344:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>s,RM:()=>r});var a=t(86070),i=t(25710);const r=[];function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.admonition,{type:"info",children:(0,a.jsxs)(n.p,{children:["Metatype is only supported on macOS and Linux. Windows users should use ",(0,a.jsx)(n.a,{href:"https://learn.microsoft.com/windows/wsl/install",children:"Linux on Windows with WSL"}),"."]})}),"\n",(0,a.jsxs)(n.p,{children:["You can download the binary from the\n",(0,a.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/releases/",children:"releases page"}),", make it\nexecutable and add it to your ",(0,a.jsx)(n.code,{children:"PATH"})," or use the automated method below."]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"An installer script is also provided for the CLI in our repository. Curl and install in it with the following one-liner. The installer may ask for your password."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"curl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\n"})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.admonition,{type:"info",children:(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["For later use, you can run the following command to upgrade ",(0,a.jsx)(n.code,{children:"Meta CLI"})," to a newer version. If your Meta CLI is up to date, you will get an ",(0,a.jsx)(n.code,{children:"Already up to date!"})," response."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta upgrade\n"})}),"\n"]}),"\n"]})}),"\n",(0,a.jsxs)(n.p,{children:["That's it! You are done installing ",(0,a.jsx)(n.code,{children:"Meta CLI"}),"."]})]})}function s(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(o,{...e})}):o(e)}},95459:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>m,frontMatter:()=>d,metadata:()=>l,toc:()=>p});var a=t(86070),i=t(25710),r=t(65480),o=t(27676),s=t(65671);t(14344),t(7871);const d={sidebar_position:3},c="Metatype Basics",l={id:"tutorials/metatype-basics/index",title:"Metatype Basics",description:"This page will walk you through a real world API with data storage and authorization.",source:"@site/docs/tutorials/metatype-basics/index.mdx",sourceDirName:"tutorials/metatype-basics",slug:"/tutorials/metatype-basics/",permalink:"/docs/tutorials/metatype-basics/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"docs",previous:{title:"Quick-start",permalink:"/docs/tutorials/quick-start/"},next:{title:"Custom functions",permalink:"/docs/guides/external-functions/"}},u={},p=[{value:"What are you building?",id:"what-are-you-building",level:2},{value:"Setup",id:"setup",level:2},{value:"Create a new project",id:"create-a-new-project",level:3},{value:"Launch typegate",id:"launch-typegate",level:3},{value:"Make sure it's all working",id:"make-sure-its-all-working",level:3},{value:"Building our Models",id:"building-our-models",level:2},{value:"Exposing our application",id:"exposing-our-application",level:2},{value:"The Prisma Runtime",id:"the-prisma-runtime",level:3},{value:"Policies",id:"policies",level:2},{value:"More Customization for our app",id:"more-customization-for-our-app",level:2},{value:"Preventing Unauthorized Creation of Related Objects",id:"preventing-unauthorized-creation-of-related-objects",level:3},{value:"Restrict Update Operation on Selected Fields",id:"restrict-update-operation-on-selected-fields",level:3},{value:"Creating REST endpoints",id:"creating-rest-endpoints",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"metatype-basics",children:"Metatype Basics"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"This page will walk you through a real world API with data storage and authorization."})}),"\n",(0,a.jsx)(n.admonition,{title:"You will learn",type:"note",children:(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"How to setup your development for metatype projects."}),"\n",(0,a.jsx)(n.li,{children:"How to run the typegate on the docker runtime."}),"\n",(0,a.jsx)(n.li,{children:"How to create/read/update/delete data."}),"\n",(0,a.jsx)(n.li,{children:"How to write custom business logic."}),"\n",(0,a.jsx)(n.li,{children:"How to authenticate requests."}),"\n",(0,a.jsx)(n.li,{children:"How to protect data with policies."}),"\n"]})}),"\n",(0,a.jsx)(n.h2,{id:"what-are-you-building",children:"What are you building?"}),"\n",(0,a.jsxs)(n.p,{children:["For this tutorial, we'll be implementing an API to power a simple feature roadmap/request hybrid as can be seen on ",(0,a.jsx)(n.a,{href:"https://productlane.com/roadmap",children:"Productlane"}),"."]}),"\n",(0,a.jsx)(n.p,{children:"Looking through the app we can see that the api should allow:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:'Unauthenticated users to submit new "ideas" or vote on any of those already listed.'}),"\n",(0,a.jsx)(n.li,{children:'Specify or vote on the importance of an "idea" from "medium" to "critical" or even submit text with more description.'}),"\n",(0,a.jsx)(n.li,{children:'Admins will be able to move ideas across buckets like "Backlog", "Planned", "In Progress".'}),"\n"]}),"\n","\n",(0,a.jsx)(n.h2,{id:"setup",children:"Setup"}),"\n",(0,a.jsxs)(n.p,{children:["To setup your Metatype development environment, please follow the installation guide ",(0,a.jsx)(n.a,{href:"/docs/tutorials/quick-start#1-meta-cli",children:"here"})]}),"\n",(0,a.jsx)(n.h3,{id:"create-a-new-project",children:"Create a new project"}),"\n",(0,a.jsx)(n.p,{children:"Metatype projects are composed of modular bundles of types, logic and policies called typegraphs. We author typegraphs using modern programming languages & environments. Python and Typescript are currently available for use. The meta-cli allows us to create a new project based on pre-existing templates."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsxs)(o.A,{value:"typescript",children:[(0,a.jsxs)(n.p,{children:["Run one the following commands to create a new project under a new directory titled ",(0,a.jsx)(n.code,{children:"tg_roadmap"}),"."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Node/Bun runtimes\nmeta new --template node tg_roadmap\n# ^ project name\n# ^ Use `meta new --help` find out more available templates.\n"})}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Deno\nmeta new --template deno tg_roadmap\n"})}),(0,a.jsxs)(n.p,{children:["When using Typescript, the ",(0,a.jsx)(n.code,{children:"@typegraph/sdk"})," package exposes all the necessary functions and types we'll need to describe our typegraph. The templates already specify it as as a dependency so all we need to do now is run the following command to download it:"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Deno\ndeno cache api/example.ts # cache dependencies\n\n# using Bun\nbun install\n\n# using pnpm\npnpm install\n\n# using npm\nnpm install\n\n# using yarn\nyarn install\n"})})]}),(0,a.jsxs)(o.A,{value:"python",children:[(0,a.jsxs)(n.p,{children:["Run the following command to create a new project under a new directory titled ",(0,a.jsx)(n.code,{children:"tg_roadmap"}),"."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta new --template python tg_roadmap\n# ^ project name\n# ^ Use `meta new --help` find out more available templates.\n"})}),(0,a.jsxs)(n.p,{children:["When using python, the ",(0,a.jsx)(n.code,{children:"typegraph"})," package exposes all the necessary functions and types we'll need to describe our typegraph. We'll need to run the following command to install it:"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# virtual env\npython3 -m venv .venv\n# other activate scripts should be available for non bash shells\nsource .venv/bin/activate\n\n# using pip\npip3 install typegraph\n\n# using poetry\n# the template has included `typegraph` in the poetry manifest\npoetry install\n"})})]})]}),"\n",(0,a.jsx)(n.h3,{id:"launch-typegate",children:"Launch typegate"}),"\n",(0,a.jsxs)(n.p,{children:["The typegate is a program that runs and orchestrates our typegraphs. We can run it locally for development purposes. Typegate currently requires the Redis database to function and to make it easy to run both, we'll make use of a linux container runtime for this. The Docker runtime to be specific which has installation guides located ",(0,a.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"here"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["We'll also need the Docker Compose orchestrator which usually comes by default with the ",(0,a.jsx)(n.code,{children:"docker"})," command. Use the following command to check if it is available:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose version\n# Docker Compose version 2.23.0\n"})}),"\n",(0,a.jsxs)(n.p,{children:["...and if not, the official installation guide can be found ",(0,a.jsx)(n.a,{href:"https://docs.docker.com/compose/install/",children:"here"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["If you have your docker runtime installed and running correctly, you will be able to launch the ",(0,a.jsx)(n.code,{children:"compose.yml"})," file that's bundled in every template.\nThe compose file also includes the ",(0,a.jsx)(n.code,{children:"postgres"})," databases that we'll be using."]}),"\n",(0,a.jsx)(n.p,{children:"To launch the services, navigate your shell to the project directory and run the following command:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose up --detach\n# ^ detach means it'll run in the background.\n# Omit to get the all logs in the current terminal\n"})}),"\n",(0,a.jsx)(n.p,{children:"This should download and start typegate and its dependent services."}),"\n",(0,a.jsx)(n.p,{children:"We can observe their log of typegate or any of the other services with the following command. It has to be run from the same project directory."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose logs typegate --follow\n# ^ Omit service name to look at the combined logs of all services\n"})}),"\n",(0,a.jsx)(n.h3,{id:"make-sure-its-all-working",children:"Make sure it's all working"}),"\n",(0,a.jsx)(n.p,{children:"Run the following to make sure everything's up and running."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta doctor\n"})}),"\n",(0,a.jsxs)(n.p,{children:["After running the command, you should get a result similar to then one ",(0,a.jsx)(n.a,{href:"/docs/tutorials/quick-start#4-verify-your-installation",children:"here"}),"."]}),"\n",(0,a.jsx)(n.h2,{id:"building-our-models",children:"Building our Models"}),"\n",(0,a.jsxs)(n.p,{children:["We will be using the ",(0,a.jsx)(n.a,{href:"/docs/reference/types",children:"type system"}),' from the typegraph SDK to describe the shape of the data that flows through our application. In this case, we\'ll build our typegraph around types that represent "ideas", "votes" and "buckets".']}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsxs)(o.A,{value:"typescript",children:[(0,a.jsxs)(n.p,{children:["Modify the file at ",(0,a.jsx)(n.code,{children:"api/example.ts"})," to look something like the following."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// we\'ll need the following imports\nimport { t, typegraph } from "@typegraph/sdk.js";\n\ntypegraph("roadmap", (g) => {\n // ^ each typegraph has a name\n\n const bucket = t.struct({\n // asId and other config items describe the logical properties\n // of our types beyond just the shape\n id: t.integer({}, { asId: true }),\n name: t.string(),\n });\n const idea = t.struct({\n // uuid is just a shorthand alias for `t.string({format: "uuid"})`\n id: t.uuid({ asId: true }),\n name: t.string(),\n // another string shorthand\n authorEmail: t.email(),\n });\n const vote = t.struct({\n id: t.uuid(),\n authorEmail: t.email(),\n // `enum_` is also a shorthand over `t.string`\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n // makes it optional\n desc: t.string().optional(),\n });\n});\n'})})]}),(0,a.jsxs)(o.A,{value:"python",children:[(0,a.jsxs)(n.p,{children:["Modify the file at ",(0,a.jsx)(n.code,{children:"api/example.py"})," to look something like the following."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'# we\'ll need the following imports\nfrom typegraph import typegraph, t, Graph\n\n# the typegraph will carry the name of the defining function by default\n@typegraph()\ndef roadmap(g: Graph):\n bucket = t.struct({\n # asId and other config items describe the logical properties\n # of our types beyond just the shape\n "id": t.integer(as_id=True),\n "name": t.string(),\n });\n idea = t.struct({\n # email is just a shorthand alias for `t.string({format: "uuid"})`\n "id": t.uuid(as_id=True),\n "name": t.string(),\n # another string shorthand\n "authorEmail": t.email(),\n });\n vote = t.struct({\n "id": t.uuid(),\n "authorEmail": t.email(),\n # `enum` is also a shorthand over `t.string`\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n # makes it optional\n "desc": t.string().optional(),\n });\n\n'})})]})]}),"\n",(0,a.jsx)(n.p,{children:"The types here are very simple and we haven't yet added any thing that models their relationships but they should do for our purposes."}),"\n",(0,a.jsx)(n.h2,{id:"exposing-our-application",children:"Exposing our application"}),"\n",(0,a.jsx)(n.p,{children:"Typegraphs expose an API to the external world using Function objects. Functions describe the operation that transform some input type into an output type and we define them in scope of different Runtimes, where the actual logic runs. At this early stage, we can make use of the Random runtime which allows us to generate random test data for our types to get a feel of our API."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// add need the following imports\nimport { Policy } from "@typegraph/sdk/index.js";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n // every exposed function requires access control policies\n // for now, just use the public policy, anyone can access it\n const pub = Policy.public();\n const random = new RandomRuntime({});\n g.expose({\n // generates a random object in the shape of idea\n get_idea: random.gen(idea).withPolicy(pub),\n });\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"# add need the following imports\nfrom typegraph.runtimes.random import RandomRuntime\nfrom typegraph import Policy\n\n@typegraph() def roadmap(g: Graph): # every exposed function requires access control policies # for now, just use the public policy, anyone can access it pub = Policy.public() random = RandomRuntime() g.expose( # generates a random object in the shape of idea get_idea=random.gen(idea).with_policy(pub) )\n\n"})})})]}),"\n",(0,a.jsx)(n.p,{children:"At this point, we can push our typegraph to the locally running typegate node and access it. Run the following command in your project root:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# features auto-reload on any changes to your source files\nmeta dev\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Typegate has first-class support for consuming the API through a GraphQl interface and it is enabled by default. It also bundles the GrahpiQl API explorer and you should be able to access it at ",(0,a.jsx)(n.a,{href:"http://localhost:7890/roadmap",children:"http://localhost:7890/roadmap"})," once meta-cli has successfully pushed your typegraph."]}),"\n",(0,a.jsxs)(n.p,{children:["You can go ahead and try out the following ",(0,a.jsx)(n.code,{children:"graphql"})," on the interface and get a feel for it."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:"query {\n get_idea {\n id\n name\n authorEmail\n }\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:"Or, you can mess around on the playground below."}),"\n",(0,a.jsx)(s.A,{typegraph:"first-typegraph",python:t(84986),typescript:t(24204),query:t(10374)}),"\n",(0,a.jsx)(n.h3,{id:"the-prisma-runtime",children:"The Prisma Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["Now that we have created a simple endpoint that generates random values for our ",(0,a.jsx)(n.code,{children:"idea"})," model/type, let's add a CRUD support to our app. A runtime most apps will be depend on is the ",(0,a.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma Runtime"})," which allows us to connect to different databases and peform database operations."]}),"\n",(0,a.jsxs)(n.p,{children:["For this tutorial, we'll be making use of the ",(0,a.jsx)(n.code,{children:"PostgreSQL"})," database. If you made use of the ",(0,a.jsx)(n.code,{children:"compose.yml"})," to run typegate as outlined in this tutorial, there should be an instance of Postgres already up. You can check if postgres container is currently running by using the ",(0,a.jsx)(n.code,{children:"meta doctor"})," command."]}),"\n",(0,a.jsxs)(n.p,{children:["If a typegraph needs to access a database, it first needs to be made aware of its address. This is done through secrets. In the root of your project directory, you'll find a file titled ",(0,a.jsx)(n.code,{children:"metatype.yaml"}),". It contains metatype specific configuration for our project such as the top level ",(0,a.jsx)(n.code,{children:"typegates"})," object which we use to specify the location and credentials of the different typegate nodes we'll be using. Each typegate entry also takes an ",(0,a.jsx)(n.a,{href:"/docs/reference/meta-cli/configuration-file#named-secrets",children:(0,a.jsx)(n.code,{children:"secrets"})})," object where we can specify secret to be passed to our typegraphs."]}),"\n",(0,a.jsxs)(n.p,{children:["The keys in the ",(0,a.jsx)(n.code,{children:"secrets"})," object are the names of the typegraphs and the values are objects mapping secret names to their values/sources."]}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"metatype.yaml"})," should already have a few sample environment variables. Add an entry like the following to give our typegraph access to the database's address:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:'typegates:\n dev:\n # ..\n secrets:\n TG_ROADMAP_POSTGRES: "postgresql://postgres:password@postgres:5432/db"\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Meta-cli will auto-reload when it detects changes to ",(0,a.jsx)(n.code,{children:"metatype.yaml"}),". This is because Meta-cli was run in ",(0,a.jsx)(n.code,{children:"dev"})," mode(through the ",(0,a.jsx)(n.code,{children:"meta dev"})," command)."]}),"\n",(0,a.jsx)(n.p,{children:"We can add the Prisma runtime to our typegraph now."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// new imports\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n // the constructor takes the name of the env var directly\n const db = new PrismaRuntime("db", "POSTGRES");\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'# new imports\nfrom typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n\n # the constructor takes the name of the env var directly\n db = PrismaRuntime("db", "POSTGRES")\n # ..\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["One of the features that the Prisma runtime allows us to implement is relationships. Here, we are creating a one to many relationship between bucket and ideas, also another one to many between ideas and vote. We will be specifiying relationships by using the ",(0,a.jsx)(n.code,{children:"t.list"})," List type and ",(0,a.jsx)(n.code,{children:"g.ref"}),"(method which accepts the name of the model/entity as a parameter) for creating the link. Check the example below for better understanding."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n const db = new PrismaRuntime("db", "POSTGRES");\n\n const bucket = t\n .struct({\n id: t.integer(\n {},\n {\n asId: true,\n // auto generate ids during creation\n config: { auto: true },\n },\n ),\n name: t.string(),\n // one-to many relationship\n ideas: t.list(g.ref("idea")),\n })\n // explicitly naming our types makes reference later easier\n .rename("bucket");\n\n const idea = t\n .struct({\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n // we need to specify the relationships on both types\n bucket: g.ref("bucket"),\n votes: t.list(g.ref("vote")),\n })\n .rename("idea");\n\n const vote = t\n .struct({\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n })\n .rename("vote");\n\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n db = PrismaRuntime("db", "POSTGRES")\n\n bucket = t.struct(\n {\n "id": t.integer(\n as_id=True,\n # auto generate ids during creation\n config={"auto": True}\n ),\n "name": t.string(),\n # one-to many relationship\n "ideas": t.list(g.ref("idea")),\n },\n # explicitly naming our types makes reference later easier\n name="bucket"\n )\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea"\n )\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote"\n )\n # ..\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.code,{children:"g.ref"})," declares logical relationships between our types which the Prisma runtime will be able to pick up. If you need more control on what the relationships will look like on the database, you can use the ",(0,a.jsx)(n.code,{children:"db.link"})," function. More information can be found on the Prisma runtime ",(0,a.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"reference"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["When we save our file at this point, the ",(0,a.jsx)(n.code,{children:"meta dev"})," watcher should automatically create and push the necessary migrations to our database to get it in its intended shape. You should see a new subdirectory in your project called ",(0,a.jsx)(n.code,{children:"prisma"}),". It's where the generated migrations are contained."]}),"\n",(0,a.jsx)(n.p,{children:"If you mess something up in the migrations and want a clean slate, you can reset everything by recreating the containers like so:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# remove all containers and their volumes\ndocker compose down -v\n# launch\ndocker compose up --detach\n# meta dev will auto apply any pending changes to databases\nmeta dev\n"})}),"\n",(0,a.jsx)(n.p,{children:"At this point, we're ready to add functions to expose database queries to create or read data. The Prisma runtime allows us to run raw queries directly on the database but it also provides handy functions we can use for basic CRUD operations. We'll make use of those."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n // ...\n g.expose(\n {\n get_buckets: db.findMany(bucket),\n create_bucket: db.create(bucket),\n get_idea: db.findFirst(idea),\n create_ideas: db.create(idea),\n },\n pub, // make all functions public by default\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n # ..\n g.expose(\n pub, # make all functions public by default\n get_buckets=db.find_many(bucket),\n create_bucket=db.create(bucket),\n get_idea=db.find_many(bucket),\n create_idea=db.create(bucket),\n get_vote=db.create(vote),\n )\n\n'})})})]}),"\n",(0,a.jsx)(n.p,{children:"We should be able to add a few buckets and ideas now."}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-prisma",python:t(37745),typescript:t(72839),query:t(1532)}),"\n",(0,a.jsx)(n.h2,{id:"policies",children:"Policies"}),"\n",(0,a.jsx)(n.p,{children:"We now have the tools enough to allow coarse CRUD of our data. The next thing we usually add at this point is authorization. A way to control who can read or write what. The primary mechanism typegraphs use for this purpose are policies."}),"\n",(0,a.jsx)(n.p,{children:"Policies are small functions that get the context of a request as input and return a boolean signaling weather access should be granted."}),"\n",(0,a.jsx)(n.p,{children:"Metatype currently supports policies based on javascript functions that are run on the Deno runtime."}),"\n",(0,a.jsxs)(n.p,{children:['For this tutorial, we\'ll be making use of the basic auth extractor. It expects a string in the format "Basic token" to be set in the ',(0,a.jsx)(n.code,{children:"Authorization"})," http header. The token is expected to be a base64 encoded string in the format ",(0,a.jsx)(n.code,{children:"username:secret"}),"."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";\nimport { Auth } from "@typegraph/sdk/params.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n const deno = new DenoRuntime();\n\n // The basic extractor only populates the context when\n // it recognizes the username and the secret matches\n g.auth(Auth.basic(["andim" /*more users*/]));\n\n // the `username` value is only availaible if the basic\n // extractor was successful\n const admins = deno.policy(\n "admins",\n `\n (_args, { context }) => !!context.username\n`,\n );\n\n g.expose(\n {\n // ..\n // only admins are allowed to create new buckets\n create_bucket: db.create(bucket).withPolicy(admins),\n // ..\n },\n pub,\n );\n\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Auth\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n # The basic extractor only populates the context when\n # it recognizes the username and the secret matches\n g.auth(Auth.basic(["andim"]))\n\n deno = DenoRuntime()\n\n # the username value is only available if the basic\n # extractor was successful\n admins = deno.policy("admins", """\n (_args, { context }) => !!context.username\n""")\n\n g.expose(\n pub,\n # ..\n # only admins are allowed to create new buckets\n create_bucket=db.create(bucket).with_policy(admins),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["The basic extractors expects the secrets in environment variables named in a specific format. Add the following entries to the ",(0,a.jsx)(n.code,{children:"metatype.yaml"})," file:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:"typegates:\n dev:\n # ..\n secrets:\n roadmap: # your typegraph name\n # ..\n # the basic extractor secret format\n # BASIC_[username]\n BASIC_ADMIN: hunter2\n"})}),"\n",(0,a.jsxs)(n.p,{children:["When you save the files, meta-cli will reload the new additions to your typegraph. ",(0,a.jsx)(n.code,{children:"create_bucket"})," is now only accessible to requests bearing the right tokens (For the provided example, ",(0,a.jsx)(n.code,{children:"Basic YW5kaW06aHVudGVyMg=="}),' should work). If you are using the GraphiQl interface from earlier, there should be a panel in the bottom left called "Headers" for setting http headers']}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-policies",python:t(41764),typescript:t(2386),query:t(38798)}),"\n",(0,a.jsx)(n.h2,{id:"more-customization-for-our-app",children:"More Customization for our app"}),"\n",(0,a.jsx)(n.h3,{id:"preventing-unauthorized-creation-of-related-objects",children:"Preventing Unauthorized Creation of Related Objects"}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Reference"}),": ",(0,a.jsx)(n.a,{href:"/docs/reference/types/parameter-transformations",children:"Parameter transformations"})]}),"\n",(0,a.jsxs)(n.p,{children:["By default, Prisma generates types that supports the whole suite of usecases one might have on a CRUD operation such as allowing creation of objects of related types in a single operation. We don't always want this and in our case, we want to prevent users from being able to create buckets, which are protected, through the ",(0,a.jsx)(n.code,{children:"create_idea"})," function which's public. We can use the ",(0,a.jsx)(n.code,{children:"reduce"})," method to modify the input types of functions."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation CIdea {\n create_idea(\n data: {\n # we want to prevent bucket creation through `create_idea`\n bucket: { create: { name: "Backlog" } }\n authorEmail: "asdf@as.df"\n name: "Add support for WASM GC"\n }\n ) {\n id\n name\n }\n}\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Even though the ",(0,a.jsx)(n.code,{children:"reduce"})," method doesn't allow us to change the shape of the type, we can change the types of members and importantly here, hide the ones we don't need."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n create_idea: db.create(idea).reduce({\n data: {\n // `g.inherit` specifies that we keep the member\n // type of the original\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: {\n connect: g.inherit(),\n // by omitting the `create` member, we hide it\n },\n },\n }),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.expose(\n pub,\n # ..\n create_idea=db.create(idea).reduce({\n "data": {\n # `g.inherit` specifies that we keep the member\n # type of the original\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {\n "connect": g.inherit(),\n # by omitting the `create` member, we hide it\n }\n }\n }),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["Requests are now only able to ",(0,a.jsx)(n.code,{children:"connect"})," new ideas with pre-existing buckets and won't be able to create them. If you try to ",(0,a.jsx)(n.code,{children:"create"})," new bucket through ",(0,a.jsx)(n.code,{children:"create_idea"}),", the typgate will return this response."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "Unexpected property \'create\' for argument \'data.bucket\' of type \'object\' (\'object_288\') at create_idea; valid properties are: connect",\n "locations": [],\n "path": [],\n "extensions": {\n "timestamp": "2024-04-21T09:46:33.177Z"\n }\n }\n ]\n}\n'})}),"\n",(0,a.jsxs)(n.p,{children:["As you will be linking existing buckets when creating ideas, you need to create at least one bucket in your database. To do that you need to execute the following graphql query with admin privileges. You should add ",(0,a.jsx)(n.code,{children:'Authorization: "Basic YW5kaW06cGFzc3dvcmQ="'})," in your headers when sending the request."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n'})}),"\n",(0,a.jsx)(n.p,{children:"Now, If you try using this mutation, it will work as expected. You can only specify buckets that are already created."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_idea(\n data: {\n # we want to prevent bucket creation through `create_idea`\n bucket: { connect: { id: 1 } }\n authorEmail: "asdf@as.df"\n name: "Add support for WASM GC"\n }\n ) {\n id\n name\n bucket {\n id\n name\n }\n }\n}\n'})}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-reduce",python:t(39047),typescript:t(55385),query:t(11642),headers:{Authorization:"Basic YW5kaW06cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,a.jsx)(n.h3,{id:"restrict-update-operation-on-selected-fields",children:"Restrict Update Operation on Selected Fields"}),"\n",(0,a.jsxs)(n.p,{children:["You'll notice that we had set the ",(0,a.jsx)(n.code,{children:"importance"})," field on votes as optional. This is to allow users to just up-vote an idea from the main list without opening a form. If they want to add importance or a description to their vote at a later point, we want to update their already existing vote. It should be easy to expose a function for this using Prisma's ",(0,a.jsx)(n.code,{children:"db.update"})," helper and ",(0,a.jsx)(n.code,{children:"reduce"})," to restrict changes to only those field. But we'll take this opportunity to explore the feature of the Prisma runtime to execute raw queries."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import * as effects from "@typegraph/sdk/effects.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n set_vote_importance: db.execute(\n // query parameters are matched by name from the input type\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n // our input type\n t.struct({\n vote_id: t.uuid(),\n importance: t.enum_(["medium", "important", "critical"]),\n }),\n // we use effects to signal what kind of operation we\'re doing\n // updates and creates will be exposed as mutations in GraphQl\n // the boolean signals that the query is idempotent\n effects.update(true),\n ),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.gen.exports.runtimes import EffectUpdate\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.expose(\n pub,\n # ..\n set_vote_importance=db.execute(\n # query parameters are matched by name from the input typ\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n # our input type\n t.struct({\n "vote_id": t.uuid(),\n "importance": t.enum(["medium", "important", "critical"]),\n }),\n # we use effects to signal what kind of operation we\'re doing\n # updates and creates will be exposed as mutations in GraphQl\n # the boolean signals that the query is idempotent\n EffectUpdate(True),\n ),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsx)(n.p,{children:"Our query is exposed like any other function in the GraphQl api."}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-execute",python:t(49198),typescript:t(25544),query:t(85779)}),"\n",(0,a.jsx)(n.h3,{id:"creating-rest-endpoints",children:"Creating REST endpoints"}),"\n",(0,a.jsxs)(n.p,{children:["We can easily expose an HTTP API for our typegraph using the ",(0,a.jsx)(n.code,{children:"g.rest"})," method. It takes a string describe a graphql query to be executed when the http path is requested."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n\n g.rest(\n `\n query get_buckets {\n get_buckets {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n `,\n );\n g.rest(\n // query parameters present\n // expects a request of the type `roadmap/rest/get_bucket?id=uuidstr`\n `\n query get_bucket($id: Integer) {\n get_bucket(where:{\n id: $id\n }) {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n `,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.rest(\n """\n query get_buckets {\n get_buckets {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n """\n )\n g.rest(\n # query parameters present\n # expects a request of the type `roadmap/rest/get_bucket?id=uuidstr`\n """\n query get_bucket($id: Integer) {\n get_bucket(where:{\n id: $id\n }) {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n """\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["The exposed query is served at the path ",(0,a.jsx)(n.code,{children:"{typegate_url}/{typegraph_name}/rest/{query_name}"}),". Any parameters that the query takes are processed from the search params of the request. You can check this ",(0,a.jsx)(n.a,{href:"http://localhost:7890/roadmap/rest/get_buckets",children:"link"})," on your local machine and check the results. "]}),"\n",(0,a.jsx)(n.p,{children:"This is it for this tutorial and thanks for following till the end! This was a long one but we hope it gave you an overview to the vast capabilties of Metatype. We ecourage you to keep exploring!"})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>o,gc:()=>s});t(30758);var a=t(3733),i=t(56315),r=t(86070);function o(e){let{children:n}=e;const[t,o]=(0,a.e)();return(0,r.jsx)(i.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:o,children:n})}function s(e){let{children:n}=e;const[t]=(0,a.e)();return(0,r.jsx)(i.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var a=t(98302),i=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...o}=e;const s=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,i.jsx)(a.A,{code:0==s.length?void 0:s,...o})}},85779:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UVote"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"set_vote_importance"},arguments:[{kind:"Argument",name:{kind:"Name",value:"vote_id"},value:{kind:"StringValue",value:"2f3207e0-6cb6-4aaf-a759-037cdfe48f0c",block:!1}},{kind:"Argument",name:{kind:"Name",value:"importance"},value:{kind:"StringValue",value:"medium",block:!1}}],directives:[]}]}}],loc:{start:0,end:123}};n.loc.source={body:'mutation UVote {\n set_vote_importance(\n vote_id: "2f3207e0-6cb6-4aaf-a759-037cdfe48f0c"\n importance: "medium"\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(n,"UVote")},38798:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:86}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(n,"CBucket")},1532:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_idea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"bucket"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"connect"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"IntValue",value:"1"}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"deng@xi.ng",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Add support for WASM Gc",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:272}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n\nmutation CIdea {\n create_idea(\n data: {\n bucket: { connect: { id: 1 } }\n authorEmail: "deng@xi.ng"\n name: "Add support for WASM Gc"\n }\n ) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.CBucket=r(n,"CBucket"),e.exports.CIdea=r(n,"CIdea")},10374:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_message"},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",alias:{kind:"Name",value:"second_one"},name:{kind:"Name",value:"get_message"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:106}};n.loc.source={body:"query {\n get_message {\n id\n title\n # user_id\n }\n\n second_one: get_message {\n user_id\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n},11642:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_idea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"bucket"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"connect"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"IntValue",value:"1"}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"deng@xi.ng",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Add support for WASM Gc",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:272}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n\nmutation CIdea {\n create_idea(\n data: {\n bucket: { connect: { id: 1 } }\n authorEmail: "deng@xi.ng"\n name: "Add support for WASM Gc"\n }\n ) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.CBucket=r(n,"CBucket"),e.exports.CIdea=r(n,"CIdea")},49198:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.gen.exports.runtimes import EffectUpdate\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n bucket = t.struct(\n {\n "id": t.integer(as_id=True, config={"auto": True}),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.auth(Auth.basic(["andim"]))\n\n admins = deno.policy(\n "admins",\n """\n (_args, { context }) => !!context.username\n""",\n )\n\n g.expose(\n pub,\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_bucket=db.find_first(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea).reduce(\n {\n "data": {\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {"connect": g.inherit()},\n }\n }\n ),\n create_vote=db.create(vote),\n set_vote_importance=db.execute(\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n t.struct(\n {\n "vote_id": t.uuid(),\n "importance": t.enum(["medium", "important", "critical"]),\n }\n ),\n EffectUpdate(True),\n ),\n get_context=deno.identity(t.struct({"username": t.string().optional()})).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/execute.py"}},25544:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport * as effects from "@typegraph/sdk/effects.ts";\n\nawait typegraph(\n {\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n `\n (_args, { context }) => !!context.username\n `,\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_bucket: db.findFirst(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea).reduce({\n data: {\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: { connect: g.inherit() },\n },\n }),\n create_vote: db.create(vote),\n set_vote_importance: db.execute(\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n t.struct({\n vote_id: t.uuid(),\n importance: t.enum_(["medium", "important", "critical"]),\n }),\n effects.update(true),\n ),\n get_context: deno\n .identity(t.struct({ username: t.string().optional() }))\n .apply({\n username: g.fromContext("username"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/execute.ts"}},84986:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes import RandomRuntime\n\n\n@typegraph(\n)\ndef first_typegraph(g: Graph):\n # declare runtimes and policies\n random = RandomRuntime(reset=None)\n public = Policy.public()\n\n # declare types\n message = t.struct(\n {\n "id": t.integer(),\n "title": t.string(),\n "user_id": t.integer(),\n }\n )\n\n # expose them with policies\n g.expose(\n public,\n # input \u2192 output via runtime function\n get_message=random.gen(message),\n )',path:"../examples/typegraphs/first-typegraph.py"}},24204:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\nawait typegraph(\n {\n name: "first-typegraph",\n },\n (g) => {\n // declare runtimes and policies\n const random = new RandomRuntime({});\n const pub = Policy.public();\n\n // declare types\n const message = t.struct({\n id: t.integer(),\n title: t.string(),\n user_id: t.integer(),\n });\n\n // expose them with policies\n g.expose(\n {\n // input \u2192 output via runtime function\n get_message: random.gen(message),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/first-typegraph.ts"}},37745:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap_py(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n\n bucket = t.struct(\n {\n "id": t.integer(config={"auto": True}).id(),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n idea = t.struct(\n {\n "id": t.uuid(config={"auto": True}).id(),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n vote = t.struct(\n {\n "id": t.uuid(config={"auto": True}).id(),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.expose(\n pub,\n get_buckets=db.find_many(bucket),\n create_bucket=db.create(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea),\n get_vote=db.create(vote),\n )',path:"../examples/typegraphs/prisma.py"}},72839:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "roadmap-prisma",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n\n const bucket = t.struct(\n {\n id: t.integer({}, { config: { auto: true } }).id(),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n const idea = t.struct(\n {\n id: t.uuid({ config: { auto: true } }).id(),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n const vote = t.struct(\n {\n id: t.uuid({ config: { auto: true } }).id(),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.expose(\n {\n get_buckets: db.findMany(bucket),\n create_bucket: db.create(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea),\n get_vote: db.create(vote),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/prisma.ts"}},39047:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n bucket = t.struct(\n {\n "id": t.integer(as_id=True, config={"auto": True}),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.auth(Auth.basic(["andim"]))\n\n admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n )\n\n g.expose(\n pub,\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_bucket=db.find_first(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea).reduce(\n {\n "data": {\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {"connect": g.inherit()},\n }\n }\n ),\n create_vote=db.create(vote),\n )',path:"../examples/typegraphs/reduce.py"}},55385:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\ntypegraph(\n {\n name: "roadmap-reduce",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" }\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" }\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" }\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username"\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_bucket: db.findFirst(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea).reduce({\n data: {\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: { connect: g.inherit() },\n },\n }),\n create_vote: db.create(vote),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/reduce.ts"}},41764:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n\n # highlight-next-line\n g.auth(Auth.basic(["andim"]))\n\n # highlight-start\n admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n )\n # highlight-end\n\n g.expose(\n pub,\n # highlight-next-line\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea),\n create_vote=db.create(vote),\n )',path:"../examples/typegraphs/roadmap-policies.py"}},2386:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "roadmap-policies",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n // auto generate ids during creation\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" }\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" }\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" }\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username"\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea),\n create_vote: db.create(vote),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/roadmap-policies.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[11],{14344:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>s,RM:()=>r});var a=t(86070),i=t(25710);const r=[];function o(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.admonition,{type:"info",children:(0,a.jsxs)(n.p,{children:["Metatype is only supported on macOS and Linux. Windows users should use ",(0,a.jsx)(n.a,{href:"https://learn.microsoft.com/windows/wsl/install",children:"Linux on Windows with WSL"}),"."]})}),"\n",(0,a.jsxs)(n.p,{children:["You can download the binary from the\n",(0,a.jsx)(n.a,{href:"https://github.com/metatypedev/metatype/releases/",children:"releases page"}),", make it\nexecutable and add it to your ",(0,a.jsx)(n.code,{children:"PATH"})," or use the automated method below."]}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"An installer script is also provided for the CLI in our repository. Curl and install in it with the following one-liner. The installer may ask for your password."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"curl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\n"})}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(n.admonition,{type:"info",children:(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsxs)(n.p,{children:["For later use, you can run the following command to upgrade ",(0,a.jsx)(n.code,{children:"Meta CLI"})," to a newer version. If your Meta CLI is up to date, you will get an ",(0,a.jsx)(n.code,{children:"Already up to date!"})," response."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta upgrade\n"})}),"\n"]}),"\n"]})}),"\n",(0,a.jsxs)(n.p,{children:["That's it! You are done installing ",(0,a.jsx)(n.code,{children:"Meta CLI"}),"."]})]})}function s(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(o,{...e})}):o(e)}},95459:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>m,frontMatter:()=>d,metadata:()=>l,toc:()=>p});var a=t(86070),i=t(25710),r=t(65480),o=t(27676),s=t(65671);t(14344),t(7871);const d={sidebar_position:3},c="Metatype Basics",l={id:"tutorials/metatype-basics/index",title:"Metatype Basics",description:"This page will walk you through a real world API with data storage and authorization.",source:"@site/docs/tutorials/metatype-basics/index.mdx",sourceDirName:"tutorials/metatype-basics",slug:"/tutorials/metatype-basics/",permalink:"/docs/tutorials/metatype-basics/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/tutorials/metatype-basics/index.mdx",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"docs",previous:{title:"Quick-start",permalink:"/docs/tutorials/quick-start/"},next:{title:"Custom functions",permalink:"/docs/guides/external-functions/"}},u={},p=[{value:"What are you building?",id:"what-are-you-building",level:2},{value:"Setup",id:"setup",level:2},{value:"Create a new project",id:"create-a-new-project",level:3},{value:"Launch typegate",id:"launch-typegate",level:3},{value:"Make sure it's all working",id:"make-sure-its-all-working",level:3},{value:"Building our Models",id:"building-our-models",level:2},{value:"Exposing our application",id:"exposing-our-application",level:2},{value:"The Prisma Runtime",id:"the-prisma-runtime",level:3},{value:"Policies",id:"policies",level:2},{value:"More Customization for our app",id:"more-customization-for-our-app",level:2},{value:"Preventing Unauthorized Creation of Related Objects",id:"preventing-unauthorized-creation-of-related-objects",level:3},{value:"Restrict Update Operation on Selected Fields",id:"restrict-update-operation-on-selected-fields",level:3},{value:"Creating REST endpoints",id:"creating-rest-endpoints",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"metatype-basics",children:"Metatype Basics"}),"\n",(0,a.jsx)(n.p,{children:(0,a.jsx)(n.strong,{children:"This page will walk you through a real world API with data storage and authorization."})}),"\n",(0,a.jsx)(n.admonition,{title:"You will learn",type:"note",children:(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:"How to setup your development for metatype projects."}),"\n",(0,a.jsx)(n.li,{children:"How to run the typegate on the docker runtime."}),"\n",(0,a.jsx)(n.li,{children:"How to create/read/update/delete data."}),"\n",(0,a.jsx)(n.li,{children:"How to write custom business logic."}),"\n",(0,a.jsx)(n.li,{children:"How to authenticate requests."}),"\n",(0,a.jsx)(n.li,{children:"How to protect data with policies."}),"\n"]})}),"\n",(0,a.jsx)(n.h2,{id:"what-are-you-building",children:"What are you building?"}),"\n",(0,a.jsxs)(n.p,{children:["For this tutorial, we'll be implementing an API to power a simple feature roadmap/request hybrid as can be seen on ",(0,a.jsx)(n.a,{href:"https://productlane.com/roadmap",children:"Productlane"}),"."]}),"\n",(0,a.jsx)(n.p,{children:"Looking through the app we can see that the api should allow:"}),"\n",(0,a.jsxs)(n.ul,{children:["\n",(0,a.jsx)(n.li,{children:'Unauthenticated users to submit new "ideas" or vote on any of those already listed.'}),"\n",(0,a.jsx)(n.li,{children:'Specify or vote on the importance of an "idea" from "medium" to "critical" or even submit text with more description.'}),"\n",(0,a.jsx)(n.li,{children:'Admins will be able to move ideas across buckets like "Backlog", "Planned", "In Progress".'}),"\n"]}),"\n","\n",(0,a.jsx)(n.h2,{id:"setup",children:"Setup"}),"\n",(0,a.jsxs)(n.p,{children:["To setup your Metatype development environment, please follow the installation guide ",(0,a.jsx)(n.a,{href:"/docs/tutorials/quick-start#1-meta-cli",children:"here"})]}),"\n",(0,a.jsx)(n.h3,{id:"create-a-new-project",children:"Create a new project"}),"\n",(0,a.jsx)(n.p,{children:"Metatype projects are composed of modular bundles of types, logic and policies called typegraphs. We author typegraphs using modern programming languages & environments. Python and Typescript are currently available for use. The meta-cli allows us to create a new project based on pre-existing templates."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsxs)(o.A,{value:"typescript",children:[(0,a.jsxs)(n.p,{children:["Run one the following commands to create a new project under a new directory titled ",(0,a.jsx)(n.code,{children:"tg_roadmap"}),"."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Node/Bun runtimes\nmeta new --template node tg_roadmap\n# ^ project name\n# ^ Use `meta new --help` find out more available templates.\n"})}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Deno\nmeta new --template deno tg_roadmap\n"})}),(0,a.jsxs)(n.p,{children:["When using Typescript, the ",(0,a.jsx)(n.code,{children:"@typegraph/sdk"})," package exposes all the necessary functions and types we'll need to describe our typegraph. The templates already specify it as as a dependency so all we need to do now is run the following command to download it:"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# using Deno\ndeno cache api/example.ts # cache dependencies\n\n# using Bun\nbun install\n\n# using pnpm\npnpm install\n\n# using npm\nnpm install\n\n# using yarn\nyarn install\n"})})]}),(0,a.jsxs)(o.A,{value:"python",children:[(0,a.jsxs)(n.p,{children:["Run the following command to create a new project under a new directory titled ",(0,a.jsx)(n.code,{children:"tg_roadmap"}),"."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta new --template python tg_roadmap\n# ^ project name\n# ^ Use `meta new --help` find out more available templates.\n"})}),(0,a.jsxs)(n.p,{children:["When using python, the ",(0,a.jsx)(n.code,{children:"typegraph"})," package exposes all the necessary functions and types we'll need to describe our typegraph. We'll need to run the following command to install it:"]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# virtual env\npython3 -m venv .venv\n# other activate scripts should be available for non bash shells\nsource .venv/bin/activate\n\n# using pip\npip3 install typegraph\n\n# using poetry\n# the template has included `typegraph` in the poetry manifest\npoetry install\n"})})]})]}),"\n",(0,a.jsx)(n.h3,{id:"launch-typegate",children:"Launch typegate"}),"\n",(0,a.jsxs)(n.p,{children:["The typegate is a program that runs and orchestrates our typegraphs. We can run it locally for development purposes. Typegate currently requires the Redis database to function and to make it easy to run both, we'll make use of a linux container runtime for this. The Docker runtime to be specific which has installation guides located ",(0,a.jsx)(n.a,{href:"https://docs.docker.com/get-docker/",children:"here"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["We'll also need the Docker Compose orchestrator which usually comes by default with the ",(0,a.jsx)(n.code,{children:"docker"})," command. Use the following command to check if it is available:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose version\n# Docker Compose version 2.23.0\n"})}),"\n",(0,a.jsxs)(n.p,{children:["...and if not, the official installation guide can be found ",(0,a.jsx)(n.a,{href:"https://docs.docker.com/compose/install/",children:"here"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["If you have your docker runtime installed and running correctly, you will be able to launch the ",(0,a.jsx)(n.code,{children:"compose.yml"})," file that's bundled in every template.\nThe compose file also includes the ",(0,a.jsx)(n.code,{children:"postgres"})," databases that we'll be using."]}),"\n",(0,a.jsx)(n.p,{children:"To launch the services, navigate your shell to the project directory and run the following command:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose up --detach\n# ^ detach means it'll run in the background.\n# Omit to get the all logs in the current terminal\n"})}),"\n",(0,a.jsx)(n.p,{children:"This should download and start typegate and its dependent services."}),"\n",(0,a.jsx)(n.p,{children:"We can observe their log of typegate or any of the other services with the following command. It has to be run from the same project directory."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"docker compose logs typegate --follow\n# ^ Omit service name to look at the combined logs of all services\n"})}),"\n",(0,a.jsx)(n.h3,{id:"make-sure-its-all-working",children:"Make sure it's all working"}),"\n",(0,a.jsx)(n.p,{children:"Run the following to make sure everything's up and running."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"meta doctor\n"})}),"\n",(0,a.jsxs)(n.p,{children:["After running the command, you should get a result similar to then one ",(0,a.jsx)(n.a,{href:"/docs/tutorials/quick-start#4-verify-your-installation",children:"here"}),"."]}),"\n",(0,a.jsx)(n.h2,{id:"building-our-models",children:"Building our Models"}),"\n",(0,a.jsxs)(n.p,{children:["We will be using the ",(0,a.jsx)(n.a,{href:"/docs/reference/types",children:"type system"}),' from the typegraph SDK to describe the shape of the data that flows through our application. In this case, we\'ll build our typegraph around types that represent "ideas", "votes" and "buckets".']}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsxs)(o.A,{value:"typescript",children:[(0,a.jsxs)(n.p,{children:["Modify the file at ",(0,a.jsx)(n.code,{children:"api/example.ts"})," to look something like the following."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// we\'ll need the following imports\nimport { t, typegraph } from "@typegraph/sdk.js";\n\ntypegraph("roadmap", (g) => {\n // ^ each typegraph has a name\n\n const bucket = t.struct({\n // asId and other config items describe the logical properties\n // of our types beyond just the shape\n id: t.integer({}, { asId: true }),\n name: t.string(),\n });\n const idea = t.struct({\n // uuid is just a shorthand alias for `t.string({format: "uuid"})`\n id: t.uuid({ asId: true }),\n name: t.string(),\n // another string shorthand\n authorEmail: t.email(),\n });\n const vote = t.struct({\n id: t.uuid(),\n authorEmail: t.email(),\n // `enum_` is also a shorthand over `t.string`\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n // makes it optional\n desc: t.string().optional(),\n });\n});\n'})})]}),(0,a.jsxs)(o.A,{value:"python",children:[(0,a.jsxs)(n.p,{children:["Modify the file at ",(0,a.jsx)(n.code,{children:"api/example.py"})," to look something like the following."]}),(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'# we\'ll need the following imports\nfrom typegraph import typegraph, t, Graph\n\n# the typegraph will carry the name of the defining function by default\n@typegraph()\ndef roadmap(g: Graph):\n bucket = t.struct({\n # asId and other config items describe the logical properties\n # of our types beyond just the shape\n "id": t.integer(as_id=True),\n "name": t.string(),\n });\n idea = t.struct({\n # email is just a shorthand alias for `t.string({format: "uuid"})`\n "id": t.uuid(as_id=True),\n "name": t.string(),\n # another string shorthand\n "authorEmail": t.email(),\n });\n vote = t.struct({\n "id": t.uuid(),\n "authorEmail": t.email(),\n # `enum` is also a shorthand over `t.string`\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n # makes it optional\n "desc": t.string().optional(),\n });\n\n'})})]})]}),"\n",(0,a.jsx)(n.p,{children:"The types here are very simple and we haven't yet added any thing that models their relationships but they should do for our purposes."}),"\n",(0,a.jsx)(n.h2,{id:"exposing-our-application",children:"Exposing our application"}),"\n",(0,a.jsx)(n.p,{children:"Typegraphs expose an API to the external world using Function objects. Functions describe the operation that transform some input type into an output type and we define them in scope of different Runtimes, where the actual logic runs. At this early stage, we can make use of the Random runtime which allows us to generate random test data for our types to get a feel of our API."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// add need the following imports\nimport { Policy } from "@typegraph/sdk/index.js";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n // every exposed function requires access control policies\n // for now, just use the public policy, anyone can access it\n const pub = Policy.public();\n const random = new RandomRuntime({});\n g.expose({\n // generates a random object in the shape of idea\n get_idea: random.gen(idea).withPolicy(pub),\n });\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:"# add need the following imports\nfrom typegraph.runtimes.random import RandomRuntime\nfrom typegraph import Policy\n\n@typegraph() def roadmap(g: Graph): # every exposed function requires access control policies # for now, just use the public policy, anyone can access it pub = Policy.public() random = RandomRuntime() g.expose( # generates a random object in the shape of idea get_idea=random.gen(idea).with_policy(pub) )\n\n"})})})]}),"\n",(0,a.jsx)(n.p,{children:"At this point, we can push our typegraph to the locally running typegate node and access it. Run the following command in your project root:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# features auto-reload on any changes to your source files\nmeta dev\n"})}),"\n",(0,a.jsxs)(n.p,{children:["Typegate has first-class support for consuming the API through a GraphQl interface and it is enabled by default. It also bundles the GrahpiQl API explorer and you should be able to access it at ",(0,a.jsx)(n.a,{href:"http://localhost:7890/roadmap",children:"http://localhost:7890/roadmap"})," once meta-cli has successfully pushed your typegraph."]}),"\n",(0,a.jsxs)(n.p,{children:["You can go ahead and try out the following ",(0,a.jsx)(n.code,{children:"graphql"})," on the interface and get a feel for it."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:"query {\n get_idea {\n id\n name\n authorEmail\n }\n}\n"})}),"\n",(0,a.jsx)(n.p,{children:"Or, you can mess around on the playground below."}),"\n",(0,a.jsx)(s.A,{typegraph:"first-typegraph",python:t(84986),typescript:t(24204),query:t(10374)}),"\n",(0,a.jsx)(n.h3,{id:"the-prisma-runtime",children:"The Prisma Runtime"}),"\n",(0,a.jsxs)(n.p,{children:["Now that we have created a simple endpoint that generates random values for our ",(0,a.jsx)(n.code,{children:"idea"})," model/type, let's add a CRUD support to our app. A runtime most apps will be depend on is the ",(0,a.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma Runtime"})," which allows us to connect to different databases and peform database operations."]}),"\n",(0,a.jsxs)(n.p,{children:["For this tutorial, we'll be making use of the ",(0,a.jsx)(n.code,{children:"PostgreSQL"})," database. If you made use of the ",(0,a.jsx)(n.code,{children:"compose.yml"})," to run typegate as outlined in this tutorial, there should be an instance of Postgres already up. You can check if postgres container is currently running by using the ",(0,a.jsx)(n.code,{children:"meta doctor"})," command."]}),"\n",(0,a.jsxs)(n.p,{children:["If a typegraph needs to access a database, it first needs to be made aware of its address. This is done through secrets. In the root of your project directory, you'll find a file titled ",(0,a.jsx)(n.code,{children:"metatype.yaml"}),". It contains metatype specific configuration for our project such as the top level ",(0,a.jsx)(n.code,{children:"typegates"})," object which we use to specify the location and credentials of the different typegate nodes we'll be using. Each typegate entry also takes an ",(0,a.jsx)(n.a,{href:"/docs/reference/meta-cli/configuration-file#named-secrets",children:(0,a.jsx)(n.code,{children:"secrets"})})," object where we can specify secret to be passed to our typegraphs."]}),"\n",(0,a.jsxs)(n.p,{children:["The keys in the ",(0,a.jsx)(n.code,{children:"secrets"})," object are the names of the typegraphs and the values are objects mapping secret names to their values/sources."]}),"\n",(0,a.jsxs)(n.p,{children:["The ",(0,a.jsx)(n.code,{children:"metatype.yaml"})," should already have a few sample environment variables. Add an entry like the following to give our typegraph access to the database's address:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:'typegates:\n dev:\n # ..\n secrets:\n TG_ROADMAP_POSTGRES: "postgresql://postgres:password@postgres:5432/db"\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Meta-cli will auto-reload when it detects changes to ",(0,a.jsx)(n.code,{children:"metatype.yaml"}),". This is because Meta-cli was run in ",(0,a.jsx)(n.code,{children:"dev"})," mode(through the ",(0,a.jsx)(n.code,{children:"meta dev"})," command)."]}),"\n",(0,a.jsx)(n.p,{children:"We can add the Prisma runtime to our typegraph now."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'// new imports\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n // the constructor takes the name of the env var directly\n const db = new PrismaRuntime("db", "POSTGRES");\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'# new imports\nfrom typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n\n # the constructor takes the name of the env var directly\n db = PrismaRuntime("db", "POSTGRES")\n # ..\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["One of the features that the Prisma runtime allows us to implement is relationships. Here, we are creating a one to many relationship between bucket and ideas, also another one to many between ideas and vote. We will be specifiying relationships by using the ",(0,a.jsx)(n.code,{children:"t.list"})," List type and ",(0,a.jsx)(n.code,{children:"g.ref"}),"(method which accepts the name of the model/entity as a parameter) for creating the link. Check the example below for better understanding."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n const db = new PrismaRuntime("db", "POSTGRES");\n\n const bucket = t\n .struct({\n id: t.integer(\n {},\n {\n asId: true,\n // auto generate ids during creation\n config: { auto: true },\n },\n ),\n name: t.string(),\n // one-to many relationship\n ideas: t.list(g.ref("idea")),\n })\n // explicitly naming our types makes reference later easier\n .rename("bucket");\n\n const idea = t\n .struct({\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n // we need to specify the relationships on both types\n bucket: g.ref("bucket"),\n votes: t.list(g.ref("vote")),\n })\n .rename("idea");\n\n const vote = t\n .struct({\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n })\n .rename("vote");\n\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n db = PrismaRuntime("db", "POSTGRES")\n\n bucket = t.struct(\n {\n "id": t.integer(\n as_id=True,\n # auto generate ids during creation\n config={"auto": True}\n ),\n "name": t.string(),\n # one-to many relationship\n "ideas": t.list(g.ref("idea")),\n },\n # explicitly naming our types makes reference later easier\n name="bucket"\n )\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea"\n )\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote"\n )\n # ..\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.code,{children:"g.ref"})," declares logical relationships between our types which the Prisma runtime will be able to pick up. If you need more control on what the relationships will look like on the database, you can use the ",(0,a.jsx)(n.code,{children:"db.link"})," function. More information can be found on the Prisma runtime ",(0,a.jsx)(n.a,{href:"/docs/reference/runtimes/prisma",children:"reference"}),"."]}),"\n",(0,a.jsxs)(n.p,{children:["When we save our file at this point, the ",(0,a.jsx)(n.code,{children:"meta dev"})," watcher should automatically create and push the necessary migrations to our database to get it in its intended shape. You should see a new subdirectory in your project called ",(0,a.jsx)(n.code,{children:"prisma"}),". It's where the generated migrations are contained."]}),"\n",(0,a.jsx)(n.p,{children:"If you mess something up in the migrations and want a clean slate, you can reset everything by recreating the containers like so:"}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-bash",children:"# remove all containers and their volumes\ndocker compose down -v\n# launch\ndocker compose up --detach\n# meta dev will auto apply any pending changes to databases\nmeta dev\n"})}),"\n",(0,a.jsx)(n.p,{children:"At this point, we're ready to add functions to expose database queries to create or read data. The Prisma runtime allows us to run raw queries directly on the database but it also provides handy functions we can use for basic CRUD operations. We'll make use of those."}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { PrismaRuntime } from "@typegraph/sdk/providers/prisma.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n // ...\n g.expose(\n {\n get_buckets: db.findMany(bucket),\n create_bucket: db.create(bucket),\n get_idea: db.findFirst(idea),\n create_ideas: db.create(idea),\n },\n pub, // make all functions public by default\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n # ..\n g.expose(\n pub, # make all functions public by default\n get_buckets=db.find_many(bucket),\n create_bucket=db.create(bucket),\n get_idea=db.find_many(bucket),\n create_idea=db.create(bucket),\n get_vote=db.create(vote),\n )\n\n'})})})]}),"\n",(0,a.jsx)(n.p,{children:"We should be able to add a few buckets and ideas now."}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-prisma",python:t(37745),typescript:t(72839),query:t(1532)}),"\n",(0,a.jsx)(n.h2,{id:"policies",children:"Policies"}),"\n",(0,a.jsx)(n.p,{children:"We now have the tools enough to allow coarse CRUD of our data. The next thing we usually add at this point is authorization. A way to control who can read or write what. The primary mechanism typegraphs use for this purpose are policies."}),"\n",(0,a.jsx)(n.p,{children:"Policies are small functions that get the context of a request as input and return a boolean signaling weather access should be granted."}),"\n",(0,a.jsx)(n.p,{children:"Metatype currently supports policies based on javascript functions that are run on the Deno runtime."}),"\n",(0,a.jsxs)(n.p,{children:['For this tutorial, we\'ll be making use of the basic auth extractor. It expects a string in the format "Basic token" to be set in the ',(0,a.jsx)(n.code,{children:"Authorization"})," http header. The token is expected to be a base64 encoded string in the format ",(0,a.jsx)(n.code,{children:"username:secret"}),"."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import { DenoRuntime } from "@typegraph/sdk/runtimes/deno.js";\nimport { Auth } from "@typegraph/sdk/params.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n\n const deno = new DenoRuntime();\n\n // The basic extractor only populates the context when\n // it recognizes the username and the secret matches\n g.auth(Auth.basic(["andim" /*more users*/]));\n\n // the `username` value is only availaible if the basic\n // extractor was successful\n const admins = deno.policy(\n "admins",\n `\n (_args, { context }) => !!context.username\n`,\n );\n\n g.expose(\n {\n // ..\n // only admins are allowed to create new buckets\n create_bucket: db.create(bucket).withPolicy(admins),\n // ..\n },\n pub,\n );\n\n // ...\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Auth\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n # The basic extractor only populates the context when\n # it recognizes the username and the secret matches\n g.auth(Auth.basic(["andim"]))\n\n deno = DenoRuntime()\n\n # the username value is only available if the basic\n # extractor was successful\n admins = deno.policy("admins", """\n (_args, { context }) => !!context.username\n""")\n\n g.expose(\n pub,\n # ..\n # only admins are allowed to create new buckets\n create_bucket=db.create(bucket).with_policy(admins),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["The basic extractors expects the secrets in environment variables named in a specific format. Add the following entries to the ",(0,a.jsx)(n.code,{children:"metatype.yaml"})," file:"]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-yaml",children:"typegates:\n dev:\n # ..\n secrets:\n roadmap: # your typegraph name\n # ..\n # the basic extractor secret format\n # BASIC_[username]\n BASIC_ADMIN: hunter2\n"})}),"\n",(0,a.jsxs)(n.p,{children:["When you save the files, meta-cli will reload the new additions to your typegraph. ",(0,a.jsx)(n.code,{children:"create_bucket"})," is now only accessible to requests bearing the right tokens (For the provided example, ",(0,a.jsx)(n.code,{children:"Basic YW5kaW06aHVudGVyMg=="}),' should work). If you are using the GraphiQl interface from earlier, there should be a panel in the bottom left called "Headers" for setting http headers']}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-policies",python:t(41764),typescript:t(2386),query:t(38798)}),"\n",(0,a.jsx)(n.h2,{id:"more-customization-for-our-app",children:"More Customization for our app"}),"\n",(0,a.jsx)(n.h3,{id:"preventing-unauthorized-creation-of-related-objects",children:"Preventing Unauthorized Creation of Related Objects"}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Reference"}),": ",(0,a.jsx)(n.a,{href:"/docs/reference/types/parameter-transformations",children:"Parameter transformations"})]}),"\n",(0,a.jsxs)(n.p,{children:["By default, Prisma generates types that supports the whole suite of usecases one might have on a CRUD operation such as allowing creation of objects of related types in a single operation. We don't always want this and in our case, we want to prevent users from being able to create buckets, which are protected, through the ",(0,a.jsx)(n.code,{children:"create_idea"})," function which's public. We can use the ",(0,a.jsx)(n.code,{children:"reduce"})," method to modify the input types of functions."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation CIdea {\n create_idea(\n data: {\n # we want to prevent bucket creation through `create_idea`\n bucket: { create: { name: "Backlog" } }\n authorEmail: "asdf@as.df"\n name: "Add support for WASM GC"\n }\n ) {\n id\n name\n }\n}\n'})}),"\n",(0,a.jsxs)(n.p,{children:["Even though the ",(0,a.jsx)(n.code,{children:"reduce"})," method doesn't allow us to change the shape of the type, we can change the types of members and importantly here, hide the ones we don't need."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n create_idea: db.create(idea).reduce({\n data: {\n // `g.inherit` specifies that we keep the member\n // type of the original\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: {\n connect: g.inherit(),\n // by omitting the `create` member, we hide it\n },\n },\n }),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.expose(\n pub,\n # ..\n create_idea=db.create(idea).reduce({\n "data": {\n # `g.inherit` specifies that we keep the member\n # type of the original\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {\n "connect": g.inherit(),\n # by omitting the `create` member, we hide it\n }\n }\n }),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["Requests are now only able to ",(0,a.jsx)(n.code,{children:"connect"})," new ideas with pre-existing buckets and won't be able to create them. If you try to ",(0,a.jsx)(n.code,{children:"create"})," new bucket through ",(0,a.jsx)(n.code,{children:"create_idea"}),", the typgate will return this response."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "Unexpected property \'create\' for argument \'data.bucket\' of type \'object\' (\'object_288\') at create_idea; valid properties are: connect",\n "locations": [],\n "path": [],\n "extensions": {\n "timestamp": "2024-04-21T09:46:33.177Z"\n }\n }\n ]\n}\n'})}),"\n",(0,a.jsxs)(n.p,{children:["As you will be linking existing buckets when creating ideas, you need to create at least one bucket in your database. To do that you need to execute the following graphql query with admin privileges. You should add ",(0,a.jsx)(n.code,{children:'Authorization: "Basic YW5kaW06cGFzc3dvcmQ="'})," in your headers when sending the request."]}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n'})}),"\n",(0,a.jsx)(n.p,{children:"Now, If you try using this mutation, it will work as expected. You can only specify buckets that are already created."}),"\n",(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-graphql",children:'mutation {\n create_idea(\n data: {\n # we want to prevent bucket creation through `create_idea`\n bucket: { connect: { id: 1 } }\n authorEmail: "asdf@as.df"\n name: "Add support for WASM GC"\n }\n ) {\n id\n name\n bucket {\n id\n name\n }\n }\n}\n'})}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-reduce",python:t(39047),typescript:t(55385),query:t(11642),headers:{Authorization:"Basic YW5kaW06cGFzc3dvcmQ="},tab:"headers"}),"\n",(0,a.jsx)(n.h3,{id:"restrict-update-operation-on-selected-fields",children:"Restrict Update Operation on Selected Fields"}),"\n",(0,a.jsxs)(n.p,{children:["You'll notice that we had set the ",(0,a.jsx)(n.code,{children:"importance"})," field on votes as optional. This is to allow users to just up-vote an idea from the main list without opening a form. If they want to add importance or a description to their vote at a later point, we want to update their already existing vote. It should be easy to expose a function for this using Prisma's ",(0,a.jsx)(n.code,{children:"db.update"})," helper and ",(0,a.jsx)(n.code,{children:"reduce"})," to restrict changes to only those field. But we'll take this opportunity to explore the feature of the Prisma runtime to execute raw queries."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'import * as effects from "@typegraph/sdk/effects.js";\n\ntypegraph("roadmap", (g) => {\n // ...\n g.expose(\n {\n // ..\n set_vote_importance: db.execute(\n // query parameters are matched by name from the input type\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n // our input type\n t.struct({\n vote_id: t.uuid(),\n importance: t.enum_(["medium", "important", "critical"]),\n }),\n // we use effects to signal what kind of operation we\'re doing\n // updates and creates will be exposed as mutations in GraphQl\n // the boolean signals that the query is idempotent\n effects.update(true),\n ),\n // ..\n },\n pub,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'from typegraph.gen.exports.runtimes import EffectUpdate\n\n@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.expose(\n pub,\n # ..\n set_vote_importance=db.execute(\n # query parameters are matched by name from the input typ\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n # our input type\n t.struct({\n "vote_id": t.uuid(),\n "importance": t.enum(["medium", "important", "critical"]),\n }),\n # we use effects to signal what kind of operation we\'re doing\n # updates and creates will be exposed as mutations in GraphQl\n # the boolean signals that the query is idempotent\n EffectUpdate(True),\n ),\n # ..\n )\n\n'})})})]}),"\n",(0,a.jsx)(n.p,{children:"Our query is exposed like any other function in the GraphQl api."}),"\n",(0,a.jsx)(s.A,{typegraph:"roadmap-execute",python:t(49198),typescript:t(25544),query:t(85779)}),"\n",(0,a.jsx)(n.h3,{id:"creating-rest-endpoints",children:"Creating REST endpoints"}),"\n",(0,a.jsxs)(n.p,{children:["We can easily expose an HTTP API for our typegraph using the ",(0,a.jsx)(n.code,{children:"g.rest"})," method. It takes a string describe a graphql query to be executed when the http path is requested."]}),"\n",(0,a.jsxs)(r.Ay,{children:[(0,a.jsx)(o.A,{value:"typescript",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-typescript",children:'typegraph("roadmap", (g) => {\n // ...\n\n g.rest(\n `\n query get_buckets {\n get_buckets {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n `,\n );\n g.rest(\n // query parameters present\n // expects a request of the type `roadmap/rest/get_bucket?id=uuidstr`\n `\n query get_bucket($id: Integer) {\n get_bucket(where:{\n id: $id\n }) {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n `,\n );\n});\n'})})}),(0,a.jsx)(o.A,{value:"python",children:(0,a.jsx)(n.pre,{children:(0,a.jsx)(n.code,{className:"language-python",children:'@typegraph()\ndef roadmap(g: Graph):\n # ..\n g.rest(\n """\n query get_buckets {\n get_buckets {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n """\n )\n g.rest(\n # query parameters present\n # expects a request of the type `roadmap/rest/get_bucket?id=uuidstr`\n """\n query get_bucket($id: Integer) {\n get_bucket(where:{\n id: $id\n }) {\n id\n name\n ideas {\n id\n name\n authorEmail\n }\n }\n }\n """\n )\n\n'})})})]}),"\n",(0,a.jsxs)(n.p,{children:["The exposed query is served at the path ",(0,a.jsx)(n.code,{children:"{typegate_url}/{typegraph_name}/rest/{query_name}"}),". Any parameters that the query takes are processed from the search params of the request. You can check this ",(0,a.jsx)(n.a,{href:"http://localhost:7890/roadmap/rest/get_buckets",children:"link"})," on your local machine and check the results. "]}),"\n",(0,a.jsx)(n.p,{children:"This is it for this tutorial and thanks for following till the end! This was a long one but we hope it gave you an overview to the vast capabilties of Metatype. We ecourage you to keep exploring!"})]})}function m(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>o,gc:()=>s});t(30758);var a=t(3733),i=t(56315),r=t(86070);function o(e){let{children:n}=e;const[t,o]=(0,a.e)();return(0,r.jsx)(i.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:o,children:n})}function s(e){let{children:n}=e;const[t]=(0,a.e)();return(0,r.jsx)(i.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>r});var a=t(98302),i=(t(30758),t(86070));function r(e){let{python:n,typescript:t,rust:r,...o}=e;const s=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},r&&{content:r.content,codeLanguage:"rust",codeFileUrl:r.path}].filter((e=>!!e));return(0,i.jsx)(a.A,{code:0==s.length?void 0:s,...o})}},85779:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UVote"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"set_vote_importance"},arguments:[{kind:"Argument",name:{kind:"Name",value:"vote_id"},value:{kind:"StringValue",value:"2f3207e0-6cb6-4aaf-a759-037cdfe48f0c",block:!1}},{kind:"Argument",name:{kind:"Name",value:"importance"},value:{kind:"StringValue",value:"medium",block:!1}}],directives:[]}]}}],loc:{start:0,end:123}};n.loc.source={body:'mutation UVote {\n set_vote_importance(\n vote_id: "2f3207e0-6cb6-4aaf-a759-037cdfe48f0c"\n importance: "medium"\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(n,"UVote")},38798:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:86}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(n,"CBucket")},1532:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_idea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"bucket"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"connect"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"IntValue",value:"1"}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"deng@xi.ng",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Add support for WASM Gc",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:272}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n\nmutation CIdea {\n create_idea(\n data: {\n bucket: { connect: { id: 1 } }\n authorEmail: "deng@xi.ng"\n name: "Add support for WASM Gc"\n }\n ) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.CBucket=r(n,"CBucket"),e.exports.CIdea=r(n,"CIdea")},10374:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_message"},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",alias:{kind:"Name",value:"second_one"},name:{kind:"Name",value:"get_message"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user_id"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:106}};n.loc.source={body:"query {\n get_message {\n id\n title\n # user_id\n }\n\n second_one: get_message {\n user_id\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n},11642:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CBucket"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_bucket"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Backlog",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CIdea"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_idea"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"bucket"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"connect"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"IntValue",value:"1"}}]}}]}},{kind:"ObjectField",name:{kind:"Name",value:"authorEmail"},value:{kind:"StringValue",value:"deng@xi.ng",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"name"},value:{kind:"StringValue",value:"Add support for WASM Gc",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:272}};n.loc.source={body:'mutation CBucket {\n create_bucket(data: { name: "Backlog" }) {\n id\n name\n }\n}\n\nmutation CIdea {\n create_idea(\n data: {\n bucket: { connect: { id: 1 } }\n authorEmail: "deng@xi.ng"\n name: "Add support for WASM Gc"\n }\n ) {\n id\n name\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};function i(e,n){for(var t=0;t0;){var d=s;s=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.CBucket=r(n,"CBucket"),e.exports.CIdea=r(n,"CIdea")},49198:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.gen.exports.runtimes import EffectUpdate\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n bucket = t.struct(\n {\n "id": t.integer(as_id=True, config={"auto": True}),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.auth(Auth.basic(["andim"]))\n\n admins = deno.policy(\n "admins",\n """\n (_args, { context }) => !!context.username\n""",\n )\n\n g.expose(\n pub,\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_bucket=db.find_first(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea).reduce(\n {\n "data": {\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {"connect": g.inherit()},\n }\n }\n ),\n create_vote=db.create(vote),\n set_vote_importance=db.execute(\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n t.struct(\n {\n "vote_id": t.uuid(),\n "importance": t.enum(["medium", "important", "critical"]),\n }\n ),\n EffectUpdate(True),\n ),\n get_context=deno.identity(t.struct({"username": t.string().optional()})).apply(\n {\n "username": g.from_context("username"),\n }\n ),\n )',path:"../examples/typegraphs/execute.py"}},25544:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport * as effects from "@typegraph/sdk/effects.ts";\n\nawait typegraph(\n {\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n `\n (_args, { context }) => !!context.username\n `,\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_bucket: db.findFirst(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea).reduce({\n data: {\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: { connect: g.inherit() },\n },\n }),\n create_vote: db.create(vote),\n set_vote_importance: db.execute(\n \'UPDATE "vote" SET importance = ${importance} WHERE id = ${vote_id}::uuid\',\n t.struct({\n vote_id: t.uuid(),\n importance: t.enum_(["medium", "important", "critical"]),\n }),\n effects.update(true),\n ),\n get_context: deno\n .identity(t.struct({ username: t.string().optional() }))\n .apply({\n username: g.fromContext("username"),\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/execute.ts"}},84986:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes import RandomRuntime\n\n\n@typegraph(\n)\ndef first_typegraph(g: Graph):\n # declare runtimes and policies\n random = RandomRuntime(reset=None)\n public = Policy.public()\n\n # declare types\n message = t.struct(\n {\n "id": t.integer(),\n "title": t.string(),\n "user_id": t.integer(),\n }\n )\n\n # expose them with policies\n g.expose(\n public,\n # input \u2192 output via runtime function\n get_message=random.gen(message),\n )',path:"../examples/typegraphs/first-typegraph.py"}},24204:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\nawait typegraph(\n {\n name: "first-typegraph",\n },\n (g) => {\n // declare runtimes and policies\n const random = new RandomRuntime({});\n const pub = Policy.public();\n\n // declare types\n const message = t.struct({\n id: t.integer(),\n title: t.string(),\n user_id: t.integer(),\n });\n\n // expose them with policies\n g.expose(\n {\n // input \u2192 output via runtime function\n get_message: random.gen(message),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/first-typegraph.ts"}},37745:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap_py(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n\n bucket = t.struct(\n {\n "id": t.integer(config={"auto": True}).id(),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n idea = t.struct(\n {\n "id": t.uuid(config={"auto": True}).id(),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n vote = t.struct(\n {\n "id": t.uuid(config={"auto": True}).id(),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.expose(\n pub,\n get_buckets=db.find_many(bucket),\n create_bucket=db.create(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea),\n get_vote=db.create(vote),\n )',path:"../examples/typegraphs/prisma.py"}},72839:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "roadmap-prisma",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n\n const bucket = t.struct(\n {\n id: t.integer({}, { config: { auto: true } }).id(),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n const idea = t.struct(\n {\n id: t.uuid({ config: { auto: true } }).id(),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n const vote = t.struct(\n {\n id: t.uuid({ config: { auto: true } }).id(),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.expose(\n {\n get_buckets: db.findMany(bucket),\n create_bucket: db.create(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea),\n get_vote: db.create(vote),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/prisma.ts"}},39047:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n bucket = t.struct(\n {\n "id": t.integer(as_id=True, config={"auto": True}),\n "name": t.string(),\n "ideas": t.list(g.ref("idea")),\n },\n name="bucket",\n )\n\n idea = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "name": t.string(),\n "authorEmail": t.email(),\n "votes": t.list(g.ref("vote")),\n "bucket": g.ref("bucket"),\n },\n name="idea",\n )\n\n vote = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "authorEmail": t.email(),\n "importance": t.enum(["medium", "important", "critical"]).optional(),\n "desc": t.string().optional(),\n "idea": g.ref("idea"),\n },\n name="vote",\n )\n\n g.auth(Auth.basic(["andim"]))\n\n admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n )\n\n g.expose(\n pub,\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_bucket=db.find_first(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea).reduce(\n {\n "data": {\n "name": g.inherit(),\n "authorEmail": g.inherit(),\n "votes": g.inherit(),\n "bucket": {"connect": g.inherit()},\n }\n }\n ),\n create_vote=db.create(vote),\n )',path:"../examples/typegraphs/reduce.py"}},55385:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\ntypegraph(\n {\n name: "roadmap-reduce",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_bucket: db.findFirst(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea).reduce({\n data: {\n name: g.inherit(),\n authorEmail: g.inherit(),\n votes: g.inherit(),\n bucket: { connect: g.inherit() },\n },\n }),\n create_vote: db.create(vote),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/reduce.ts"}},41764:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\nfrom typegraph.graph.params import Auth\nfrom typegraph.providers.prisma import PrismaRuntime\nfrom typegraph.graph.params import Cors\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n pub = Policy.public()\n db = PrismaRuntime("db", "POSTGRES")\n deno = DenoRuntime()\n\n\n # highlight-next-line\n g.auth(Auth.basic(["andim"]))\n\n # highlight-start\n admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n )\n # highlight-end\n\n g.expose(\n pub,\n # highlight-next-line\n create_bucket=db.create(bucket).with_policy(admins),\n get_buckets=db.find_many(bucket),\n get_idea=db.find_many(idea),\n create_idea=db.create(idea),\n create_vote=db.create(vote),\n )',path:"../examples/typegraphs/roadmap-policies.py"}},2386:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { Auth } from "@typegraph/sdk/params.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\nimport { PrismaRuntime } from "@typegraph/sdk/providers/prisma.ts";\n\ntypegraph(\n {\n name: "roadmap-policies",\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("db", "POSTGRES");\n const deno = new DenoRuntime();\n\n const bucket = t.struct(\n {\n // auto generate ids during creation\n id: t.integer({}, { asId: true, config: { auto: true } }),\n name: t.string(),\n ideas: t.list(g.ref("idea")),\n },\n { name: "bucket" },\n );\n\n const idea = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n name: t.string(),\n authorEmail: t.email(),\n votes: t.list(g.ref("vote")),\n bucket: g.ref("bucket"),\n },\n { name: "idea" },\n );\n\n const vote = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n authorEmail: t.email(),\n importance: t.enum_(["medium", "important", "critical"]).optional(),\n desc: t.string().optional(),\n idea: g.ref("idea"),\n },\n { name: "vote" },\n );\n\n g.auth(Auth.basic(["andim"]));\n\n const admins = deno.policy(\n "admins",\n "(_args, { context }) => !!context.username",\n );\n\n g.expose(\n {\n create_bucket: db.create(bucket).withPolicy(admins),\n get_buckets: db.findMany(bucket),\n get_idea: db.findMany(idea),\n create_idea: db.create(idea),\n create_vote: db.create(vote),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/roadmap-policies.ts"}}}]); \ No newline at end of file diff --git a/assets/js/b3219b4c.7c571c01.js b/assets/js/b3219b4c.7c571c01.js deleted file mode 100644 index fd604fb826..0000000000 --- a/assets/js/b3219b4c.7c571c01.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3099],{83890:e=>{e.exports=JSON.parse('{"archive":{"blogPosts":[{"id":"/2024/09/26/introducing-grpc-runtime","metadata":{"permalink":"/blog/2024/09/26/introducing-grpc-runtime","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx","source":"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx","title":"Introducing gRPC Runtime","description":"We\'re excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform\'s ability to create versatile and powerful backends through typegraphs.","date":"2024-09-26T00:00:00.000Z","tags":[],"readingTime":4.4,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"nextItem":{"title":"Distributed execution flow paradigms","permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms"}},"content":"We\'re excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform\'s ability to create versatile and powerful backends through typegraphs.\\n\\n## What is gRPC?\\n\\ngRPC, or **g**oogle **R**emote **P**rocedure **C**all, is a high-performance, open-source communication framework initially developed by Google. It enables **efficient and fast communication between microservices** in a distributed system, making it ideal for modern backend architectures.\\n\\nUnlike traditional HTTP APIs that use JSON, gRPC relies on **Protocol Buffers** (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems.\\n\\nKey benefits of gRPC include:\\n- **Cross-language support**: gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly.\\n- **Strong type safety**: Protocol Buffers ensure type-safe communication, catching errors early and improving reliability.\\n- **Bidirectional streaming**: gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics.\\n\\nIn short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential.\\n\\n## Why gRPC Matters for Metatype\\n\\nMetatype is a platform that enables developers to create **typegraphs**\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility.\\n\\nBy integrating gRPC, Metatype empowers developers to:\\n- **Expose gRPC services via GraphQL or HTTP endpoints**, making them accessible to clients in a way that best suits their needs.\\n- **Compose gRPC services with other backend components**, such as databases or other APIs, to create powerful and cohesive backend systems.\\n\\n## Diagram: gRPC and Metatype Integration\\n\\n
\\n ![gRPC and Metatype Integration Diagram](./GrpcMetatype.drawio.png)\\n
\\n\\n\\n*Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend.*\\n\\n## Introducing gRPC Runtime in Metatype\\n\\nThe new gRPC Runtime is the latest addition to Metatype\'s suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends.\\n\\n## Key Technical Details\\n\\n### Architecture\\nThe gRPC Runtime integrates seamlessly with Metatype\'s existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic.\\n\\n1. **GrpcRuntime Class**: The main interface for defining gRPC interactions within your typegraph.\\n2. **proto_file**: Path to the .proto file that defines the gRPC service.\\n3. **endpoint**: The gRPC server address in the format `tcp://:`.\\n4. **call method**: Creates a typegraph function for gRPC method calls.\\n\\n### Implementation\\n\\nHere\'s how the gRPC Runtime fits into a Metatype typegraph:\\n\\n```python\\nfrom typegraph import Graph, Policy, typegraph\\nfrom typegraph.graph.params import Cors\\nfrom typegraph.runtimes.grpc import GrpcRuntime\\n\\n@typegraph(\\n cors=Cors(allow_origin=[\\"https://metatype.dev\\", \\"http://localhost:3000\\"]),\\n)\\ndef create_grpc_typegraph(g: Graph):\\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\\n grpc_runtime = GrpcRuntime(\\n # proto_file: Path to the .proto file that defines the gRPC service\\n proto_file=\\"proto/helloworld.proto\\",\\n # endpoint: The gRPC server address in the format tcp://:\\n endpoint=\\"tcp://localhost:4770\\"\\n )\\n \\n # Expose the gRPC service within your typegraph\\n # This allows you to incorporate gRPC calls alongside other runtime operations\\n g.expose(\\n Policy.public(),\\n # call method: Creates a typegraph function for gRPC method calls\\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\\n greet=grpc_runtime.call(\\"/helloworld.Greeter/SayHello\\"),\\n )\\n\\n# The typegraph can now be exposed via GraphQL or HTTP, \\n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\\n```\\nThis implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:\\n\\n1. Define gRPC service connections using the GrpcRuntime class\\n2. Expose gRPC methods as part of your typegraph\\n3. Combine gRPC functionality with other Metatype features and runtimes\\n\\nBy structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic.\\n\\n## Benefits for Developers\\n\\n1. **Unified Backend Structure**: Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph.\\n2. **Type Safety**: Leverage Metatype\'s strong typing system in conjunction with gRPC\'s protocol buffers for end-to-end type safety.\\n3. **Flexible Exposure**: Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol.\\n4. **Composability**: Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph.\\n\\n## Getting Started\\n\\nTo start using the gRPC Runtime in your Metatype project:\\n\\n1. Ensure you have the latest version of Metatype installed.\\n2. Prepare your .proto files for the gRPC services you want to integrate.\\n3. Set up your typegraph as shown in the example above, incorporating the GrpcRuntime.\\n4. Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed.\\n\\n## Conclusion\\n\\nThe addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease.\\n\\nFor more detailed documentation, code examples, and best practices, check out our [official Metatype docs](https://metatype.dev/docs)#."},{"id":"/2024/08/27/distributed-execution-flow-paradigms","metadata":{"permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx","source":"@site/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx","title":"Distributed execution flow paradigms","description":"In this age of cloud development and microservices architecture, problems start to arise with the increased workloads that run in the system. Imagine an e-commerce platform where a customer places an order for a product during a high-demand sale event. The order triggers a series of interconnected processes: payment processing, inventory checks, packaging, shipping, and final delivery. Each of these processes might be handled by different microservices, potentially running on different servers or even in different data centers. What happens if the payment service goes down right after the payment is authorized but before the inventory is updated? Or if the packaging service fails just after the inventory is deducted but before the item is packed? Without a robust mechanism to ensure that each step in the workflow completes successfully and that failures are properly handled, you could end up with unhappy customers, lost orders, and inventory discrepancies.","date":"2024-08-27T00:00:00.000Z","tags":[],"readingTime":10.92,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Introducing gRPC Runtime","permalink":"/blog/2024/09/26/introducing-grpc-runtime"},"nextItem":{"title":"Python on WebAssembly: How?","permalink":"/blog/2024/08/26/python-on-webassembly"}},"content":"import TabItem from \\"@theme/TabItem\\";\\nimport SDKTabs from \\"@site/src/components/SDKTabs\\";\\n\\n\\nIn this age of cloud development and microservices architecture, problems start to arise with the increased workloads that run in the system. Imagine an e-commerce platform where a customer places an order for a product during a high-demand sale event. The order triggers a series of interconnected processes: payment processing, inventory checks, packaging, shipping, and final delivery. Each of these processes might be handled by different microservices, potentially running on different servers or even in different data centers. What happens if the payment service goes down right after the payment is authorized but before the inventory is updated? Or if the packaging service fails just after the inventory is deducted but before the item is packed? Without a robust mechanism to ensure that each step in the workflow completes successfully and that failures are properly handled, you could end up with unhappy customers, lost orders, and inventory discrepancies.\\n\\nHaving multiple components in your system introduces more failure points, which is a common phenomenon in complex systems. But one important behavior any application must ensure is that the execution flow reaches its completion. As systems grow in features and complexity, the likelihood of long-running processes increases. To ensure these processes complete as intended, several solutions have been introduced over the last few decades.\\nLet\'s explore some of the solutions that have been proposed to achieve workflow completeness.\\n\\n### 1. Event-Driven Architecture with Message Queues\\n\\nThis architecture relies heavily on services communicating by publishing and subscribing to events using message queues. Message queues are persistent storages that ensure data is not lost during failures or service unavailability. Components in a distributed system synchronize by using events/messages through these independent services. While this approach offers service decomposability and fault tolerance, it has some shortcomings. For example, using message queues comes with the overhead of managing messages (e.g., deduplication and message ordering). It also isn\u2019t ideal for systems requiring immediate consistency across components. Some technologies and patterns that utilize this architecture include:\\n\\n- [RabbitMQ](https://www.rabbitmq.com/)\\n- [Amazon SQS](https://aws.amazon.com/sqs/)\\n\\n![](eda.drawio.svg)\\n\\n
\\n Fig. Event Driven Architecture with Message Queues - RabbitMQ\\n
\\n\\n#### Advantages\\n\\n- Improved Scalability\\n- Enhanced Responsiveness\\n- Enhanced Fault Tolerance\\n- Simplified Complex Workflows\\n- Real-Time Data Processing\\n\\n#### Challenges\\n\\n- Event Ordering\\n- Data Consistency\\n- Monitoring and Debugging\\n- Event Deduplication\\n\\nYou can mitigate or reduce these challenges by following best practices like Event Sourcing, Idempotent Processing, CQRS (Command Query Responsibility Segregation), and Event Versioning.\\n\\n### 2. The [Saga Pattern](https://microservices.io/patterns/data/saga.html)\\n\\nThis design pattern aims to achieve consistency across different services in a distributed system by breaking complex transactions spanning multiple components into a series of local transactions. Each of these transactions triggers an event or message that starts the next transaction in the sequence. If any local transaction fails to complete, a series of compensating actions roll back the effects of preceding transactions. While the orchestration of local transactions can vary, the pattern aims to achieve consistency in a microservices-based system. Events are designed to be stored in durable storage systems or logs, providing a trail to reconstruct the system to a state after a failure. While the saga pattern is an effective way to ensure consistency, it can be challenging to implement timer/timeout-based workflows and to design and implement the compensating actions for local transactions.\\n\\n**Note**: In the Saga pattern, a compensating transaction must be idempotent and retryable. These principles ensure that transactions can be managed without manual intervention.\\n\\n![](saga.drawio.svg)\\n\\n
\\n Fig. The Saga Pattern for Order delivery system\\n
\\n\\n#### Advantages\\n\\n- Ensures data consistency in a distributed system without tight coupling.\\n- Provides Roll back if one of the operations in the sequence fails.\\n\\n#### Drawbacks\\n\\n- Might be challenging to implement initially.\\n- Hard to debug.\\n- Compensating transactions don\u2019t always work.\\n\\n### 3. [Stateful Orchestrators](https://docs.oracle.com/en/applications/jd-edwards/cross-product/9.2/eotos/creating-a-stateful-orchestration-release-9-2-8-3.html#u30249073)\\n\\nStateful orchestrators provide a solution for long-running workflows by maintaining the state of each step in a workflow. Each step in a workflow represents a task, and these tasks are represented as states inside workflows. Workflows are defined as state machines or directed acyclic graphs (DAGs). In this approach, an orchestrator handles task execution order, transitioning, handling retries, and maintaining state. In the event of a failure, the system can recover from the persisted state. Stateful orchestrators offer significant value in fault tolerance, consistency, and observability. It\u2019s one of the solutions proven effective in modern distributed computing. Some well-known services that provide this solution include:\\n\\n- [Apache Airflow](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/overview.html)\\n- [Azure Logic Apps](https://azure.microsoft.com/en-us/products/logic-apps)\\n\\n#### Advantages\\n\\n- **High Resiliency**: Stateful orchestrators provide high resiliency in case of outages, ensuring that workflows can continue from where they left off.\\n- **Data Persistence**: They allow you to keep, review, or reference data from previous events, which is useful for long-running processes.\\n- **Extended Runtime**: Stateful workflows can continue running for much longer than stateless workflows, making them suitable for complex and long-running tasks.\\n\\n#### Challenges\\n\\n- **Additional Complexity**: They introduce additional complexity, requiring you to manage issues such as load balancing, CPU and memory usage, and networking.\\n- **Cost**: With stateful workflows, you pay for the VMs that are running in the cluster, whereas with stateless workflows, you pay only for the actual compute resources consumed.\\n\\n### 4. Durable Execution\\n\\nDurable execution refers to the ability of a system to preserve the state of an application and persist execution despite failures or interruptions. Durable execution ensures that for every task, its inputs, outputs, call stack, and local variables are persisted. These constraints, or rather features, allow a system to automatically retry or continue running in the face of infrastructure or system failures, ultimately ensuring completion.\\n\\nDurable execution isn\u2019t a completely distinct solution from the ones listed above but rather incorporates some of their strengths while presenting a more comprehensive approach to achieving consistency, fault tolerance, data integrity, resilience for long-running processes, and observability.\\n\\n\\n
Fig. Durable workflow engine
\\n\\n#### Advantages\\n\\n- **Reduced Manual Intervention**: Minimizes the need for human intervention by handling retries and failures programmatically.\\n- **Improved Observability**: Provides a clear audit trail and visibility into the state of workflows, which aids in debugging and monitoring.\\n- **Scalability**: Scales efficiently across distributed systems while maintaining workflow integrity.\\n\\n#### Challenges\\n\\n- **Resource Intensive**: Persistent state storage and management can consume significant resources, especially in large-scale systems.\\n- **Latency**: The need to persist state and handle retries can introduce latency in the execution flow.\\n\\nAs durable execution grows to be a fundamental driver of distributed computing, some of the solutions which use this architecture are\\n\\n- [Temporal](https://temporal.io/)\\n- [Uber Cadence](https://cadenceworkflow.io/)\\n\\nAmong these, [Temporal](https://temporal.io/) has grown in influence, used by companies like SnapChat, HashiCorp, Stripe, DoorDash, and DataDog. Its success is driven by its practical application in real-world scenarios and the expertise of its founders.\\n\\nAt Metatype, we recognize the value of durable execution and are committed to making it accessible. Our [Temporal Runtime](/docs/reference/runtimes/temporal) integrates seamlessly into our declarative API development platform, enabling users to harness the power of Temporal directly within Metatype. For those interested in exploring further, our documentation provides a detailed guide on getting started with [Temporal Runtime](/docs/reference/runtimes/temporal).\\n\\nBelow is an example of how you can build a simple API to interact with an order delivery temporal workflow within Metatype.\\n\\n:::note\\nIf you are new to Metatype or haven\u2019t set it up yet in your development environment. You can follow this [guideline](/docs/tutorials/quick-start).\\n:::\\n\\nFor this example, the order delivery system will have few components/services such as Payment, Inventory and Delivery.\\n\\nYour temporal workflow definition should look similar to the one below.\\n\\n\\n\\n \\n\\n
\\n\\nActivities definition inside `src/activities.ts`:`\\n\\n```typescript\\nasync function sleep(time: number) {\\n return new Promise((resolve) => {\\n setTimeout(resolve, time);\\n });\\n}\\n\\nexport async function processPayment(orderId: string): Promise {\\n console.log(`Processing payment for order ${orderId}`);\\n // Simulate payment processing logic\\n await sleep(2);\\n return \\"Payment processed\\";\\n}\\n\\nexport async function checkInventory(orderId: string): Promise {\\n console.log(`Checking inventory for order ${orderId}`);\\n // Simulate inventory check logic\\n await sleep(2);\\n return \\"Inventory available\\";\\n}\\n\\nexport async function deliverOrder(orderId: string): Promise {\\n console.log(`Delivering order ${orderId}`);\\n // Simulate delivery logic\\n await sleep(5);\\n return \\"Order delivered\\";\\n}\\n```\\n\\n
\\n\\n
\\n\\nWorkflow definition inside `src/workflows.ts`:\\n```typescript import {proxyActivities} from \\"@temporalio/workflow\\";\\n\\nexport const { processPayment, checkInventory, deliverOrder } =\\n proxyActivities<{\\n processPayment(orderId: string): Promise;\\n checkInventory(orderId: string): Promise;\\n deliverOrder(orderId: string): Promise;\\n }>({\\n startToCloseTimeout: \\"10 seconds\\",\\n });\\n\\nexport async function OrderWorkflow(orderId: string): Promise {\\n const paymentResult = await processPayment(orderId);\\n const inventoryResult = await checkInventory(orderId);\\n const deliveryResult = await deliverOrder(orderId);\\n return `Order ${orderId} completed with results: ${paymentResult}, ${inventoryResult}, ${deliveryResult}`;\\n}\\n```\\n
\\n\\n
\\nWorker definintion inside `src/worker.ts`:\\n\\n```typescript\\nimport { NativeConnection, Worker } from \\"@temporalio/worker\\";\\nimport * as activities from \\"./activities\\";\\nimport { TASK_QUEUE_NAME } from \\"./shared\\";\\n\\nasync function run() {\\n const connection = await NativeConnection.connect({\\n address: \\"localhost:7233\\",\\n });\\n\\n const worker = await Worker.create({\\n connection,\\n namespace: \\"default\\",\\n taskQueue: TASK_QUEUE_NAME,\\n workflowsPath: require.resolve(\\"./workflows\\"),\\n activities,\\n });\\n\\n await worker.run();\\n}\\n\\nrun().catch((err) => {\\n console.error(err);\\n process.exit(1);\\n});\\n```\\n\\n
\\n\\nAfter you have setup the above components, now you need a client to start of any `OrderWorkflow`. Here is where metatype comes in, through the simple APIs [Temporal Runtime](/docs/reference/runtimes/temporal) exposes, you can communicate with your temporal cluster.\\nDown below is the workflow communication bridge for this system expressed within a [typegraph](/docs/reference/typegraph) which includes endpoints to start a new workflow and describe an existing one.\\n\\n```typescript\\nimport { Policy, t, typegraph } from \\"@typegraph/sdk/index.ts\\";\\nimport { TemporalRuntime } from \\"@typegraph/sdk/providers/temporal.ts\\";\\n\\ntypegraph(\\n {\\n name: \\"order_delivery\\",\\n },\\n (g: any) => {\\n const pub = Policy.public();\\n\\n const temporal = new TemporalRuntime({\\n name: \\"order_delivery\\",\\n hostSecret: \\"HOST\\",\\n namespaceSecret: \\"NAMESPACE\\",\\n });\\n\\n const workflow_id = \\"order-delivery-1\\";\\n\\n const order_id = t.string();\\n\\n g.expose(\\n {\\n start: temporal.startWorkflow(\\"OrderWorkflow\\", order_id),\\n describe: workflow_id\\n ? temporal.describeWorkflow().reduce({ workflow_id })\\n : temporal.describeWorkflow(),\\n },\\n pub,\\n );\\n },\\n);\\n```\\n\\n
\\n\\n {/* break */}\\n \\n\\n
\\nActivities definition inside `activities.py`.\\n\\n```python\\nfrom temporalio import activity\\nimport time\\n\\n@activity.defn\\nasync def process_payment(order_id: str) -> str:\\n print(f\\"Processing payment for order {order_id}\\")\\n # Simulate payment processing logic\\n time.sleep(5)\\n return \\"Payment processed\\"\\n\\n@activity.defn\\nasync def check_inventory(order_id: str) -> str:\\n print(f\\"Checking inventory for order {order_id}\\")\\n # Simulate inventory check logic\\n time.sleep(4)\\n return \\"Inventory available\\"\\n\\n@activity.defn\\nasync def deliver_order(order_id: str) -> str:\\n print(f\\"Delivering order {order_id}\\")\\n time.sleep(8)\\n # Simulate delivery logic\\n return \\"Order delivered\\"\\n```\\n\\n
\\n\\n
\\nWorker defintion inside `run_worker.py`.\\n\\n```python\\nimport asyncio\\n\\nfrom temporalio.client import Client\\nfrom temporalio.worker import Worker\\n\\nfrom activities import process_payment, deliver_order, check_inventory\\nfrom shared import ORDER_DELIVERY_QUEUE\\nfrom workflows import OrderWorkflow\\n\\n\\nasync def main() -> None:\\n client: Client = await Client.connect(\\"localhost:7233\\", namespace=\\"default\\")\\n worker: Worker = Worker(\\n client,\\n task_queue=ORDER_DELIVERY_QUEUE,\\n workflows=[OrderWorkflow],\\n activities=[process_payment, check_inventory, deliver_order],\\n )\\n await worker.run()\\n\\n\\nif __name__ == \\"__main__\\":\\n asyncio.run(main())\\n```\\n\\n
\\n\\nAfter you have setup the above components, now you need a client to start of any `OrderWorkflow`. Here is where metatype comes in, through the simple APIs [Temporal Runtime](/docs/reference/runtimes/temporal) exposes, you can communicate with your temporal cluster.\\nDown below is the workflow communication bridge for this system expressed within a [typegraph](/docs/reference/typegraph) which includes endpoints to start a new workflow and describe an existing one.\\n\\n```python\\nfrom typegraph import t, typegraph, Policy, Graph\\nfrom typegraph.providers.temporal import TemporalRuntime\\n\\n\\n@typegraph()\\ndef example(g: Graph):\\n public = Policy.public()\\n\\n temporal = TemporalRuntime(\\n \\"example\\", \\"HOST\\", namespace_secret=\\"NAMESPACE\\"\\n )\\n\\n workflow_id = \\"order-delivery-1\\"\\n\\n order_id = t.string()\\n\\n g.expose(\\n public,\\n start=temporal.start_workflow(\\"OrderWorkflow\\", order_id),\\n describe=temporal.describe_workflow().reduce({\\"workflow_id\\": workflow_id})\\n if workflow_id\\n else temporal.describe_workflow(),\\n )\\n```\\n\\n
\\n\\n
\\n\\nYou need to add the secrets `HOST` and `NAMESPACE` under your typegraph name inside the `metatype.yaml` file. These secrets are important to connect with your temporal cluster and can be safely stored in the config file as shown below.\\n\\n
\\nmetatype.yaml\\n\\n```yaml\\ntypegate:\\n dev:\\n url: \\"http://localhost:7890\\"\\n username: admin\\n password: password\\n secrets:\\n example:\\n POSTGRES: \\"postgresql://postgres:password@postgres:5432/db\\"\\n HOST: \\"http://localhost:7233\\"\\n NAMESPACE: \\"default\\"\\n```\\n\\n
\\n\\nYou need to add only the last two lines as the others are auto-generated. Note that secrets are defined under the `example` parent, which is the name of your typegraph. If the name doesn\'t match, you will face secret not found issues when deploying your typegraph.\\n\\nBefore deploying the above typegraph, you need to start the temporal server and the worker. You need to have [temporal](https://learn.temporal.io/getting_started/typescript/dev_environment/#set-up-a-local-temporal-service-for-development-with-temporal-cli) installed on your machine.\\n\\n
\\nBoot up temporal\\n\\nStart the temporal server.\\n\\n```bash\\ntemporal server start-dev\\n```\\n\\nStart the worker.\\n\\n\\n\\n\\n ```typescript npx ts-node src/worker.ts ```\\n\\n\\n```python python run_worker.py ```\\n\\n\\n
\\n\\nAfter booting the temporal server, run the command down below to get a locally spinning [typegate](/docs/reference/typegate) instance with your typegraph deployed.\\n\\n```bash\\nmeta dev\\n```\\n\\nAfter completing the above steps, you can access the web GraphQL client of the typegate at [`http://localhost:7890/example`](http://localhost:7890/example). Run this query inside the client to start your workflow.\\n\\n```graphql\\nmutation {\\n start(\\n workflow_id: \\"order-delivery-3\\"\\n task_queue: \\"order-delivery-queue\\"\\n args: [\\"order12\\"]\\n )\\n}\\n```\\n\\nAfter a successful run, you will get the following result which includes the `run_id` of the workflow which has just been started.\\n\\n\\n\\nYou can also check the temporal web UI to monitor your workflows and you should see a result similar to this one.\\n\\n\\n\\nYou can explore the [Temporal Runtime](/docs/reference/runtimes/temporal) for more info.\\n\\nThis wraps up the blog, thanks for reading until the end :)"},{"id":"/2024/08/26/python-on-webassembly","metadata":{"permalink":"/blog/2024/08/26/python-on-webassembly","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx","source":"@site/blog/2024-08-26-python-on-webassembly/index.mdx","title":"Python on WebAssembly: How?","description":"Metatype\'s different language runtimes are nice, but integrating one is an entire story. Let\'s discover how we managed to implement one for Python.","date":"2024-08-26T00:00:00.000Z","tags":[],"readingTime":11.125,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Distributed execution flow paradigms","permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms"},"nextItem":{"title":"Programmatic deployment (v0.4.x)","permalink":"/blog/2024/05/09/programmatic-deployment"}},"content":"Metatype\'s different language runtimes are nice, but integrating one is an entire story. Let\'s discover how we managed to implement one for Python.\\n\\n## Why?\\n\\nYou have probably heard of \\"Function as a Service\\" or FaaS. \\nIn simple terms, FaaS are platforms that allow users to run code in response to events without the hassle of managing the underlying infrastructure. \\nUsers submit their programs and the platform takes care of the rest including, usually, scaling, availability, and configuration.\\nAWS Lambda is one such example and FaaS as a whole are a popular implementation of the serverless model.\\n\\nMetatype has this model at heart with applications composed of small functions that respond to events like http requests and authorization checks. \\nThis is achieved through runtimes like the [`DenoRuntime`](/docs/reference/runtimes/deno) which implements a way to execute functions authored in Typescript using Web Workers as implemented by [Deno](https://docs.deno.com/runtime/manual/runtime/workers/) (not based on Deno Deploy). \\n\\n:::note\\nMetatype supports running multiple apps or typegraphs on a single deployed cluster but we\'re still in the kitchen on a hosted cloud solution. \\nSubscribe to the [blog](https://metatype.dev/blog/rss.xml) or the [Github](https://github.com/metatypedev/metatype) repository for updates.\\n:::\\n\\nImplementing the `DenoRuntime` was a very straightforward affair as the Typegate (the engine at the heart of Metatype) is primarily written in Typescript and runs on a slightly modified version of the Deno runtime.\\nWhat\'s more, JavaScript has single threaded and asynchronous semantics and the v8 engine that it commonly runs on is of very high-quality by all regards. \\nThese qualities lend themselves very well to the requirements of running a serverless platform like security (good sandboxing) and performance (low start-up latencies).\\nThis fact is reflected in the dominance of JavaScript in the serverless market though it doesn\'t hurt that it\'s also the most popular language in use today.\\n\\nAnother very popular language is Python; and its standard library can be quite resourceful for this type of use case.\\nHowever, as we shall see, integrating the Python runtime isn\'t as simple as integrating Deno.\\n\\n## What are the requirements?\\n\\nThere are a number of Python runtimes available but a set of extra factors limit what we can achieve.\\n\\n1. **Security**: functions should have limited access to the execution environment. Python doesn\'t have built-in features for sandboxing out of the box unlike Deno.\\n2. **Speed**: functions should run fast and with low latency. We\'re interested in metrics like cold-start latency and overhead of any cross process/system communication.\\n3. **User-friendliness**: functionalities provided in any of the languages supported by Metatype should, within reason, mirror each other and maintain a degree of uniformity. We support inline code snippets and external file references for `DenoRuntime` and this should be the case for Python as well.\\n4. **Interoperability**: functions running in Python will need to have access to other parts of the app running on the Typegate like being able to invoke other functions.\\n\\nThe Typegate is a TypeScript program with a bit of Rust sprinkled in. \\nIt runs as a traditional POSIX process. \\nThink Linux containers. \\nThis fact renders multi-processing, one of the readily apparent approaches, undesirable as it would require investing is robust worker process management and distribution schemes.\\nIt\'d be great if we could keep everything inside the Typegate process.\\n\\nOne solution that presents itself here is the [PyO3](https://pyo3.rs/) project which provide Rust bindings to different Python runtimes like CPython and PyPy.\\nIt\'d not only allow us to run Python code in-process but it also provide an easy way to expose the functions written in Rust to Python and vice-versa. \\nA good solution for the bidirectional communication needed for our interoperability requirements.\\n\\nUnfortunately, PyO3 doesn\'t have any provisions for sandboxing which is critical for our use case.\\nThis is where WebAssembly enters into the picture. \\nWebAssembly or Wasm for short is a executable bytecode format that originates from the web world and is designed for applications that run inside web-browsers. \\nThis use case shares most of our requirements and the Wasm world promises excellent sandboxing properties that should be perfect for our use case.\\nWe just have to find a way to run Python inside of it.\\n\\n## An aside on WASI \\n\\nWebAssembly System Interface (WASI) is an additional spec for the bytecode format that formalizes how Wasm programs access their host environment.\\nA lot like POSIX, this generally means OS capabilities such as file system access and networking but also, in it\'s latest iteration extends to any custom host defined functionality.\\n\\nWasm + WASI fits very well to our use case. As opposed to mutli-processing, we can instantiate, manage, and expose resources programmatically with ease.\\nAnd as luck would have it, some [community work](https://github.com/vmware-labs/webassembly-language-runtimes) has already been done at the time that led to wasm builds of CPython being available.\\n\\nUnfortunately, the WASI spec itself is a work in progress.\\nWhen we started out, only the limited \\"[preview1](https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md)\\" implementation was supported by most runtimes.\\n`preview1` only focused on a standard set of host functionalities much like a `libc` implementation.\\nWell enough but any custom functionality meant having to rely on simple C ABI alike functions for _intra_-process communication.\\nIn order to make this work easier, we elected to bring PyO3 back into the picture so that all the IPC stuff is written in Rust, the language with the most support in the Wasm ecosystem today.\\n\\nAll in all, this would mean the python interpreter wrapped in a PyO3 based native API.\\nAn assembly that accepts user code as strings and then invokes them in response to events.\\nAll of this would be running inside a Wasm runtime, [WasmEdge](https://wasmedge.org/) in this case, which ticks of all of the sandboxing and security requirements.\\nThis approach is well described as the [Reactor pattern](https://wasmcloud.com/blog/webassembly-patterns-command-reactor-library#the-reactor-pattern), a common pattern used in Wasm land.\\n\\n\\"FIRST\\n\\n### File system access\\n\\nSince the PyO3 project doesn\'t support [statically linking](https://github.com/PyO3/pyo3/issues/416) the Python runtime, we\'ll need to find a way dynamically link `libpython`.\\nThankfully, Wasm does support [dynamic linking](https://github.com/WebAssembly/design/blob/main/DynamicLinking.md) and wasm builds of [`libpython`](https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/python) are available curtsy of the WebAssembly Language Runtimes project. \\nBringing all of this together isn\'t as simple though as PyO3\'s tries to load `libpython` from certain _paths_, a concept that isn\'t exactly clearly defined in Wasm\'s post POSIX webtopia.\\n\\nOur first solution was to use [wasi-vfs](https://github.com/kateinoigakukun/wasi-vfs), a tool which allows you to embed a virtual file system, accessible through preview1 APIs, directly into your wasm binaries.\\nThis way, we could prepare a single wasm artifact that contains both the `libpython` build and the custom glue code.\\n\\nThis approach turned out to be quite hacky though and after encountering several issues, we ultimately decided to go with **preopens**.\\nPreopens are another virtual file-system solution where you map an actual file-system directory to a virtual directory visible to a running Wasm instance.\\nThis means we\'ll need to prepare the `libpython` Wasm file on disk before running the instance but it was an acceptable solution.\\nWe also use preopens to provide some of the user submitted code to our custom python runtime.\\n\\nThe following rust snippet demonstrates the preopens looked like in use:\\n\\n```rust\\nfn init_Python_vm() -> Result {\\n let preopens = vec![\\n // User script will be uploaded at ./src/Python which is virtually seen as /app\\n // Each script has access only to /app\\n \\"/app:./src/Python:readonly\\".to_owned()\\n ];\\n\\n // This follow the same idea as above, but for clarity\'s sake we decided to separate it\\n let pylib = PathBuf::from(\\"./vendor/libpython/usr/local/lib\\");\\n\\n // This is our wasm module reponsible for running Python scripts at runtime\\n // It assumes /app and libpython to be available in its world\\n let wasi_mod = PathBuf::from(\\"./build/Python-wasi-reactor.wasm\\");\\n\\n // Now we can instantiate the WASI module with all the configurations above\\n let rt = instantiate_custom_python_runtime(preopens, pylib, wasi_mod)?;\\n rt.run_func(None, \\"init_Python\\", params!())?;\\n\\n // ..\\n\\n Ok(rt)\\n}\\n```\\n\\n### WASI 0.2\\n\\nThe solution described above worked well to an extent but the limitations of preview1 and all the wrangling with PyO3 resulted in complexity that we were always ready to get rid of.\\nThis was exactly what we did after the Bytecode Alliance finalized [WASI 0.2](https://bytecodealliance.org/articles/WASI-0.2) back in January 2024 and with it, a slew of new opportunuties.\\n\\nWASI 0.2 introduces a whole new concept of components, wasm modules that come with pre-specifed interfaces using the [Wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) format and based on a whole new [ABI](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md) to boot.\\nThese new capabilities suggest that it should possible to replace our PyO3 based glue code with the WASI based layer. \\nLet\'s see how.\\n\\nWe first used the new found WASI powers to implement support for Wasm based functions through the [`WasmRuntime`](/docs/reference/runtimes/wasm).\\nThis lead us to implement the [`wit_wire`](https://github.com/metatypedev/metatype/blob/2e692b9ae9e48b6e1a863130fc1bfbdd004cb631/src/wit/wit-wire.wit) protocol, a simple JSON based WIT interface that\'d be used by any wasm component that intenteds to run on the `WasmRuntime`.\\nSimple enough that it\'s reproduced down below in it\'s entirety.\\n\\n```wit\\npackage metatype:wit-wire;\\n\\n// what the host provides\\ninterface typegate-wire {\\n hostcall: func(op-name: string, json: string) -> result;\\n}\\n\\n// what\'s expected from the guest\\ninterface mat-wire {\\n\\n // init function called when we first make the component\\n init: func(args: init-args) -> result;\\n // general purpose event handler\\n handle: func(req: handle-req) -> result;\\n\\n type json-str = string;\\n\\n record init-args {\\n // the list of operations the application is expecting\\n // from this component\\n expected-ops: list\\n metatype-version: string,\\n }\\n\\n record mat-info {\\n op-name: string,\\n mat-title: string,\\n mat-data-json: string,\\n }\\n\\n record init-response {\\n ok: bool\\n }\\n\\n variant init-error {\\n version-mismatch(string),\\n unexpected-mat(mat-info),\\n other(string)\\n }\\n\\n record handle-req {\\n op-name: string,\\n in-json: json-str,\\n }\\n\\n variant handle-err {\\n no-handler,\\n in-json-err(string),\\n handler-err(string),\\n }\\n}\\n\\n// a world defines what interfaces get imported\\n// and exported\\nworld wit-wire {\\n import typegate-wire;\\n\\n export mat-wire;\\n}\\n\\n```\\n\\nSquint your eyes tight enough and the `wit_wire` protocol as implemented wasn\'t far off from what the PyO3 based glue code was doing in the previous implementation.\\nSpecifically, register a list of operations that the Typegate is expecting from the module and execute them for incoming event.\\nWe just need to add support for the operation metadata to contain extra items.\\nIn the case of the [`PythonRuntime`](/docs/reference/runtimes/python), this would be the Python code itself.\\n\\nNow that we have the `wit_wire` implementation taking care of bidirectional communication, we have little reason to keep the PyO3 based glue code around.\\nThis glue was doing a bit more than acting as a boundary though.\\nIt was also responsible for setting up the operating environment for the Python code.\\nFor example, we\'d need some kind of initialization to execute the user\'s Python snippets which are in free standing `lambda` form. \\nHow does one create components out of Python anyways?\\n\\n[componentize-py](https://github.com/bytecodealliance/componentize-py) is a tool authored by the Bytecode Alliance that allows you to produce WASI components that are authored in Python.\\nIt has code generation suite that emits guest bindings in Python for any WIT specification you feed it.\\nIt then takes your Python code written against these bindings and embeds them in a Wasm build of the Python interpreter to produce a component that supports the specified Wit.\\n\\nUnsurprisingly, componentize-py relies on PyO3 and preopens itself in addition to [component-init](https://github.com/dicej/component-init), a solution to pre-intialize components up to a certain point for improved startup latencies.\\nThis pre-intialization means we won\'t need to provide the actual preopens for the resulting component, baking the `libpython` object code directly into it as PyO3 will have dynamically loaded the object code by that point.\\nUltimately, this allows us to write all of our glue code in Python itself.\\n\\nWe still need a bit of Rust to support the `wit_wire` interface on the Typegate but this implementation is general across both the `PythonRuntime` and `WasmRuntime`.\\nWe\'d also moved to the [Wasmtime](https://wasmtime.dev/), also by Bytecode Alliance, for our wasm workloads at this point and their Rust bindings are a pleasure to use.\\nIt\'s all smooth sailing from here.\\n\\n## Cloudy skies?\\n\\nA final stumbling block for this approach was the many seconds Wasmtime spends cooking all your CPU cores when it compiles the fat wasm module that contains the Python interpreter, Pyo3 bindings and more.\\nThis happens because Wasmtime does\'t ([yet](https://github.com/bytecodealliance/rfcs/blob/main/accepted/wasmtime-baseline-compilation.md)) implement any schemes for tiered compilation, all code being greeted by their optimizing compiler, Cranelift.\\nAnd optimizations take time.\\nSure, you only pay this cost the first time you load the Python runtime module as Wasmtime has great support for caching including on-disk caching.\\nBut, 10+ second cold-starts, as measured on one developer\'s machine, are unacceptable in a system that primarily serves HTTP requests.\\nWhat to do?\\n\\nWasmtime has just the feature for this problem, [pre-compilation](https://docs.wasmtime.dev/cli-options.html#compile).\\nAhead-of-time compilation of wasm bytecode into a native instruction set.\\nSuch files are commonly given the `.cwasm` extesion, _c_ for compiled, and they are not a standalone executable but inteded to be run within Wasmtime\'s sandbox.\\nThis eliminates the compliation cost but the semantics of the source wasm bytecode and the runtime safe-guards means that this should be just as safe as JITting it (just-in-time compilation).\\nWe then statically embed this pre-compiled wasm artifact, after compressing it, in the Typegate binary removing the need for sidecar files while ensuring minimal cold-starts for our python workloads.\\nTo be concrete, this means _roughly_ around 200 ms of overhead for a cold function and 5 ms for a warm one.\\nGood enough.\\n\\nThis post describes the technical journey we took to arrive to the current implementation of the `PythonRuntime`. Hopefully, all details were clear enough and please direct any feedback, questions, and thoughts to the comments down below and our Github issues/discussion board."},{"id":"/2024/05/09/programmatic-deployment","metadata":{"permalink":"/blog/2024/05/09/programmatic-deployment","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-05-09-programmatic-deployment/index.mdx","source":"@site/blog/2024-05-09-programmatic-deployment/index.mdx","title":"Programmatic deployment (v0.4.x)","description":"A new approach to deploying typegraphs has been introduced starting with version 0.4.0. This aims to facilitate the development of automation tools around the APIs you build within the Metatype ecosystem.","date":"2024-05-09T00:00:00.000Z","tags":[],"readingTime":3.405,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Python on WebAssembly: How?","permalink":"/blog/2024/08/26/python-on-webassembly"},"nextItem":{"title":"The Node/Deno SDK is now available","permalink":"/blog/2023/11/27/node-compatibility"}},"content":"import SDKTabs from \\"@site/src/components/SDKTabs\\";\\nimport TabItem from \\"@theme/TabItem\\";\\nimport UpgradePythonSDK from \\"../../shared/upgrade/python-sdk.mdx\\";\\nimport UpgradeTsSDK from \\"../../shared/upgrade/typescript-sdk.mdx\\";\\n\\n\\nA new approach to deploying typegraphs has been introduced starting with version 0.4.0. This aims to facilitate the development of automation tools around the APIs you build within the Metatype ecosystem.\\n\\n## What has changed?\\n\\nBefore v0.4.x, we had to entirely rely on the [meta cli](/docs/reference/meta-cli) to deploy typegraphs to a typegate instance.\\n\\nThis is no longer the case, as all core logic has been moved to the TypeScript/Python typegraph SDKs, both of which share the same WebAssembly-based **typegraph-core** behind the scenes. This provides some degree of assurance that you will have nearly identical experiences with each SDK.\\n\\n## What are the use-cases?\\n\\nSince typegraphs can be written using the programming language your preferred SDK is based on, you can dynamically create typegraphs with ease.\\n\\nThe missing piece was having an interface natively backed inside the SDK for doing deployment programmatically.\\n\\n### Programmatic deployment\\n\\n### Initial setup\\n\\nJust like any other dependency in your favorite programming language, each SDKs can be installed with your favorite package manager.\\n\\nYou can use one of the commands below to get started with the latest available version.\\n\\n\\n \\n \\n \\n \\n \\n \\n\\n\\n#### Configuration\\n\\nThis is analoguous to the yaml configuration file when you are using [meta cli](/docs/reference/meta-cli).\\n\\nIt\'s the place where you tell which typegate you want to deploy to, how you want the artifacts to be resolved, among other settings.\\n\\n\\n \\n\\n```python\\nconfig: TypegraphDeployParams = TypegraphDeployParams(\\n typegate=TypegateConnectionOptions(url=\\"\\", auth=BasicAuth(\\"\\", \\"\\")),\\n typegraph_path=os.path.join(cwd, \\"path-to-typegraph\\"),\\n prefix=\\"\\",\\n secrets={},\\n migrations_dir=path.join(\\"prisma-migrations\\", example.name),\\n migration_actions=None,\\n default_migration_action=MigrationAction(\\n apply=True,\\n reset=True, # allow destructive migrations\\n create=True,\\n ),\\n )\\n```\\n\\n \\n \\n\\n```typescript\\nconst config = {\\n typegate: {\\n url: \\"\\",\\n auth: new BasicAuth(\\"\\", \\"\\"),\\n },\\n typegraphPath: path.join(cwd, \\"path-to-typegraph.ts\\"),\\n prefix: \\"\\",\\n secrets: { POSTGRES: \\"\\" },\\n migrationsDir: path.join(\\"prisma-migrations\\", tg.name),\\n defaultMigrationAction: {\\n create: true,\\n reset: true, // allow destructive migrations\\n },\\n};\\n```\\n\\n \\n\\n\\n\\n### Deploy/remove\\n\\nNow, picture this, you have a lot of typegraphs and one or more typegate instance(s) running, you can easily make small scripts that does any specific job you want.\\n\\n```typescript\\n// ..\\nimport { tgDeploy, tgRemove } from \\"@typegraph/sdk/tg_deploy.js\\";\\n// ..\\n\\nconst BASIC_AUTH = loadMyAuthsFromSomeSource();\\nconst TYPEGATE_URL = \\"...\\";\\n\\nexport async function getTypegraphs() {\\n // Suppose we have these typegraphs..\\n // Let\'s enumerate them like this to simplify\\n return [\\n {\\n tg: await import(\\"path/to/shop-finances\\"),\\n location: \\"path/to/shop-finances.ts\\",\\n },\\n {\\n tg: await import(\\"path/to/shop-stats\\"),\\n location: \\"path/to/shop-stats.ts\\",\\n },\\n ];\\n}\\n\\nexport function getConfig(tgName: string, tgLocation: string) {\\n // Note: You can always develop various ways of constructing the configuration,\\n // like loading it from a file.\\n return {\\n typegate: {\\n url: \\"\\",\\n auth: new BasicAuth(\\"\\", \\"\\"),\\n },\\n typegraphPath: path.join(cwd, \\"path-to-typegraph.ts\\"),\\n prefix: \\"\\",\\n secrets: { POSTGRES: \\"\\" },\\n migrationsDir: path.join(\\"prisma-migrations\\", tg.name),\\n defaultMigrationAction: {\\n create: true,\\n reset: true, // allow destructive migrations\\n },\\n };\\n}\\n\\nexport async function deployAll() {\\n const typegraphs = await getTypegraphs();\\n for (const { tg, location } of typegraphs) {\\n try {\\n const config = getConfig(tg.name, location);\\n // use tgDeploy to deploy typegraphs, it will contain the response from typegate\\n const { typegate } = await tgDeploy(tg, config);\\n const selection = typegate?.data?.addTypegraph;\\n if (selection) {\\n const { messages } = selection;\\n console.log(messages.map(({ text }) => text).join(\\"\\\\n\\"));\\n } else {\\n throw new Error(JSON.stringify(typegate));\\n }\\n } catch (e) {\\n console.error(\\"[!] Failed deploying\\", tg.name);\\n console.error(e);\\n }\\n }\\n}\\n\\nexport async function undeployAll() {\\n const typegraphs = await getTypegraphs();\\n for (const { tg } of typegraphs) {\\n try {\\n // use tgRemove to remove typegraphs\\n const { typegate } = await tgRemove(\\"\\", {\\n baseUrl: TYPEGATE_URL,\\n auth: BASIC_AUTH,\\n });\\n console.log(typegate);\\n } catch (e) {\\n console.error(\\"Failed removing\\", tg.name);\\n console.error(e);\\n }\\n }\\n}\\n```\\n\\n### Going beyond\\n\\nWith these new additions, you can automate virtually anything programmatically on the typegraph side. Starting from having highly dynamic APIs to providing ways to deploy and configure them, you can even build a custom framework around the ecosystem!\\n\\nPlease tell us what you think and report any issues you found on [Github](https://github.com/metatypedev/metatype/issues).\\n\\n:::info Notes\\n\\nYou can check the [Programmatic deployment](/docs/guides/programmatic-deployment) reference page for more information.\\n\\n:::"},{"id":"/2023/11/27/node-compatibility","metadata":{"permalink":"/blog/2023/11/27/node-compatibility","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-11-27-node-compatibility/index.mdx","source":"@site/blog/2023-11-27-node-compatibility/index.mdx","title":"The Node/Deno SDK is now available","description":"We are happy to announce that we have redesigned our SDKs to support Node/Deno and facilitate the integration of future languages. Most of the typegraph SDK is now written in Rust and shaped around a core interface running in WebAssembly.","date":"2023-11-27T00:00:00.000Z","tags":[],"readingTime":1.7,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Programmatic deployment (v0.4.x)","permalink":"/blog/2024/05/09/programmatic-deployment"},"nextItem":{"title":"Programmable glue for developers","permalink":"/blog/2023/06/18/programmable-glue"}},"content":"We are happy to announce that we have redesigned our SDKs to support Node/Deno and facilitate the integration of future languages. Most of the [typegraph SDK](/docs/reference/typegraph) is now written in Rust and shaped around a core interface running in WebAssembly.\\n\\n## Meet `wit`\\n\\nIn the realm of WebAssembly, the [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen) project emerges as the most mature tool to create and maintain the language bindings for WebAssembly modules. This tool introduces WIT (WebAssembly Interface Types) as an Interface Definition Language (IDL) to describe the imports, exports, and capabilities of WebAssembly components seamlessly.\\n\\nFor example, Metatype implements the reactor pattern to handle requests as they come and delegate part of their execution in correct WASM runtime. The wit-bindgen helps there to define the interfaces between the guest (the Metatype runtime) and the host (the typegate) to ensure the correct serialization of the payloads. The `wit` definition could look like this:\\n\\n```\\npackage metatype:wit-wire;\\n\\ninterface typegate-wire {\\n hostcall: func(op-name: string, json: string) -> result;\\n}\\n\\ninterface mat-wire {\\n record handle-req {\\n op-name: string,\\n in-json: string,\\n }\\n\\n handle: func(req: handle-req) -> result;\\n}\\n\\nworld wit-wire {\\n import typegate-wire;\\n\\n export mat-wire;\\n}\\n```\\n\\nThe `wit` file is then used to generate the bindings for the host and the guest in Rust, TypeScript, Python, and other languages. The host bindings are used in the typegate to call the WASM runtime, and the guest bindings are used in the WASM runtime to call the typegate.\\n\\n## Install the v0.2.x series\\n\\nThe documentation contains now examples for Node and Deno.\\n\\n### Upgrade with Node\\n\\n```bash\\nnpm install @typegraph/sdk\\nmeta new --template node .\\n```\\n\\n### Upgrade with Deno\\n\\n```bash\\nmeta new --template deno .\\n```\\n\\n```typescript\\nimport { typegraph } from \\"npm:@typegraph/sdk/index.js\\";\\n```\\n\\n### Upgrade with Python\\n\\n```python\\npip3 install --upgrade typegraph\\npoetry add typegraph@latest\\n```\\n\\n## Give us feedback!\\n\\nThis new release enables us to provide a consistent experience across all languages and reduce the work to maintain the existing Python SDK.\\n\\nAs always, report issues and let us know what you think on [GitHub](https://github.com/metatypedev/metatype/discussions)."},{"id":"/2023/06/18/programmable-glue","metadata":{"permalink":"/blog/2023/06/18/programmable-glue","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-06-18-programmable-glue/index.mdx","source":"@site/blog/2023-06-18-programmable-glue/index.mdx","title":"Programmable glue for developers","description":"We are introducing Metatype, a new project that allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.","date":"2023-06-18T00:00:00.000Z","tags":[],"readingTime":1.295,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"The Node/Deno SDK is now available","permalink":"/blog/2023/11/27/node-compatibility"},"nextItem":{"title":"Emulating your server nodes locally","permalink":"/blog/2023/03/15/emulating-servers"}},"content":"import { CompareLandscape } from \\"@site/src/components/CompareLandscape\\";\\nimport Metatype from \\"@site/shared/metatype-intro.mdx\\";\\nimport TGExample from \\"@site/src/components/TGExample\\";\\n\\n\\nWe are introducing Metatype, a new project that allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.\\n\\n## What is Metatype?\\n\\n\\n\\n## What are virtual graphs?\\n\\nTypegraphs are a declarative way to expose all APIs, storage and business logic of your stack as a single graph. They take inspiration from domain-driven design principles and in the idea that the relation between of the data is as important as data itself, even though they might be in different locations or shapes.\\n\\n\\n\\nThese elements can then be combined and composed together similarly on how you would compose web components to create an interface in modern frontend practices. This allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.\\n\\n## Where does this belong in the tech landscape?\\n\\nBefore Metatype, there was a gap in the technological landscape for a solution that specifically addressed the transactional, short-lived use cases. While there were existing tools for analytical or long-running use cases, such as Trino and Temporal, there was no generic engine for handling transactional, short-lived tasks.\\n\\n \\n\\n## Give it a try!\\n\\nLet us know what you think! Metatype is open source and we welcome any feedback or contributions. The community primarily lives on [GitHub](https://github.com/metatypedev/metatype).\\n\\n:::info Next steps\\n\\n[Build your first typegraph](/docs/tutorials/metatype-basics) or read more about the [concepts behind Metatype](/docs/concepts/mental-model).\\n\\n:::"},{"id":"/2023/03/15/emulating-servers","metadata":{"permalink":"/blog/2023/03/15/emulating-servers","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-03-15-emulating-servers/index.mdx","source":"@site/blog/2023-03-15-emulating-servers/index.mdx","title":"Emulating your server nodes locally","description":"Introducing the Embedded Typegate","date":"2023-03-15T00:00:00.000Z","tags":[],"readingTime":3.07,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Programmable glue for developers","permalink":"/blog/2023/06/18/programmable-glue"}},"content":"import BlogIntro from \\"@site/src/components/BlogIntro\\";\\nimport UpgradeMetatype from \\"../../shared/upgrade/index.mdx\\";\\n\\n\\n\\n\\n## Introducing the Embedded Typegate\\n\\nThe embedded typegate is a feature that comes with the [Meta CLI](/docs/reference/meta-cli) which provides the option of spinning a typegate instance from the CLI with minimum configurations and installations needed from the developer. All that is required to access the _Embedded Typegate_ is to install _Meta CLI_. The spawned typegate instance behaves similarly to cloud-deployed typegates.\\n\\n## The motive\\n\\nThere are more than a couple of reasons why a developer would be tempted to use an emedded typegate. While developers can start a typegate instance using docker compose, the developer needs to install docker as a dependency to run the typegate container. Even though docker is familiar among many developers, it can sometimes be tricky and unbeknownst to some developers. We at metatype highly value the developer experience and one reason for adding the _embedded typegate_ feature to the _Meta CLI_ is for users to have a smooth experience with our system by providing a docker compose free experience.\\nThis feature provides a great utility for developers to author and test typegraphs in their local machine before deploying them to production level typegate instances on the cloud.\\nAdditionally, developers need not concern themselves with deployment configurations which are needed only during deployment. The only need to focus their energy and time in developing the right application and easily test them on _embedded typegate_ running from the terminal. To add more to what is said, as the typegate engine keeps evolving, users will be abstracted away from the different configurations which might be added on the future. The _Meta CLI_ will abstract much of what\'s not needed in a dev environment. Thus, leaving less headaches to developers on new changes.\\nUltimately, The _embedded typegate_ is designed to be a good dev environment friendly tool which faciliates development time.\\n\\n## Quick First hand example\\n\\n### Install the v0.3.x series\\n\\nEither of the two [Typegraph](/docs/reference/typegraph) SDKs are needed to author typegraphs. For this example, the node SDK will be used.\\n\\nFirst, make sure the _Meta CLI_ is installed.\\n\\n```shell\\ncurl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\\n```\\n\\nNext, create a new node project using this command.\\n\\n```shell\\nmeta new --template node\\n```\\n\\nThe above command will create a sample typegraph which you can use to test the embedded typegate.\\n\\nNow, you need to install the typegraph SDK by running the command down below. The previous command generates a `package.json` with the SDK specified as a dependency.\\n\\n```shell\\nnpm install\\n```\\n\\nBefore deploying the typegraph to the embedded typegate, Run the following commands below.\\n\\n```shell\\nmeta dev\\n```\\n\\nNow that there is running instance of a typegate, you can deploy the example typegraph. From another terminal, run the command below.\\n\\n```shell\\nmeta deploy -f api/example.ts --allow-dirty --create-migration --target dev --gate http://localhost:7890\\n```\\n\\nThe typegate runs on port 7890 by default. If you access [http://localhost:7890/example](http://localhost:7890/example) on your browser, you can see an GraphQL interface to interact with the deployed typegraph. You can test the example typegraph using the following graphql query below.\\n\\n```graphql\\nquery {\\n multilpy(first: 3, second: 5)\\n}\\n```\\n\\n\\n\\n## Learn more about Metatype\\n\\nWanna dive deep into the basics of _Metaype_? check our interactive [tutorial](/docs/tutorials/metatype-basics) revolving around the core features of the system."}]}}')}}]); \ No newline at end of file diff --git a/assets/js/b3219b4c.f8778267.js b/assets/js/b3219b4c.f8778267.js new file mode 100644 index 0000000000..2687be15c0 --- /dev/null +++ b/assets/js/b3219b4c.f8778267.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[3099],{83890:e=>{e.exports=JSON.parse('{"archive":{"blogPosts":[{"id":"/2024/09/26/introducing-grpc-runtime","metadata":{"permalink":"/blog/2024/09/26/introducing-grpc-runtime","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx","source":"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx","title":"Introducing gRPC Runtime","description":"We\'re excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform\'s ability to create versatile and powerful backends through typegraphs.","date":"2024-09-26T00:00:00.000Z","tags":[],"readingTime":4.4,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"nextItem":{"title":"Distributed execution flow paradigms","permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms"}},"content":"We\'re excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform\'s ability to create versatile and powerful backends through typegraphs.\\n\\n## What is gRPC?\\n\\ngRPC, or **g**oogle **R**emote **P**rocedure **C**all, is a high-performance, open-source communication framework initially developed by Google. It enables **efficient and fast communication between microservices** in a distributed system, making it ideal for modern backend architectures.\\n\\nUnlike traditional HTTP APIs that use JSON, gRPC relies on **Protocol Buffers** (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems.\\n\\nKey benefits of gRPC include:\\n\\n- **Cross-language support**: gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly.\\n- **Strong type safety**: Protocol Buffers ensure type-safe communication, catching errors early and improving reliability.\\n- **Bidirectional streaming**: gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics.\\n\\nIn short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential.\\n\\n## Why gRPC Matters for Metatype\\n\\nMetatype is a platform that enables developers to create **typegraphs**\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility.\\n\\nBy integrating gRPC, Metatype empowers developers to:\\n\\n- **Expose gRPC services via GraphQL or HTTP endpoints**, making them accessible to clients in a way that best suits their needs.\\n- **Compose gRPC services with other backend components**, such as databases or other APIs, to create powerful and cohesive backend systems.\\n\\n## Diagram: gRPC and Metatype Integration\\n\\n
\\n ![gRPC and Metatype Integration Diagram](./GrpcMetatype.drawio.png)\\n
\\n\\n_Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend._\\n\\n## Introducing gRPC Runtime in Metatype\\n\\nThe new gRPC Runtime is the latest addition to Metatype\'s suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends.\\n\\n## Key Technical Details\\n\\n### Architecture\\n\\nThe gRPC Runtime integrates seamlessly with Metatype\'s existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic.\\n\\n1. **GrpcRuntime Class**: The main interface for defining gRPC interactions within your typegraph.\\n2. **proto_file**: Path to the .proto file that defines the gRPC service.\\n3. **endpoint**: The gRPC server address in the format `tcp://:`.\\n4. **call method**: Creates a typegraph function for gRPC method calls.\\n\\n### Implementation\\n\\nHere\'s how the gRPC Runtime fits into a Metatype typegraph:\\n\\n```python\\nfrom typegraph import Graph, Policy, typegraph\\nfrom typegraph.graph.params import Cors\\nfrom typegraph.runtimes.grpc import GrpcRuntime\\n\\n@typegraph(\\n cors=Cors(allow_origin=[\\"https://metatype.dev\\", \\"http://localhost:3000\\"]),\\n)\\ndef create_grpc_typegraph(g: Graph):\\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\\n grpc_runtime = GrpcRuntime(\\n # proto_file: Path to the .proto file that defines the gRPC service\\n proto_file=\\"proto/helloworld.proto\\",\\n # endpoint: The gRPC server address in the format tcp://:\\n endpoint=\\"tcp://localhost:4770\\"\\n )\\n\\n # Expose the gRPC service within your typegraph\\n # This allows you to incorporate gRPC calls alongside other runtime operations\\n g.expose(\\n Policy.public(),\\n # call method: Creates a typegraph function for gRPC method calls\\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\\n greet=grpc_runtime.call(\\"/helloworld.Greeter/SayHello\\"),\\n )\\n\\n# The typegraph can now be exposed via GraphQL or HTTP,\\n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\\n```\\n\\nThis implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:\\n\\n1. Define gRPC service connections using the GrpcRuntime class\\n2. Expose gRPC methods as part of your typegraph\\n3. Combine gRPC functionality with other Metatype features and runtimes\\n\\nBy structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic.\\n\\n## Benefits for Developers\\n\\n1. **Unified Backend Structure**: Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph.\\n2. **Type Safety**: Leverage Metatype\'s strong typing system in conjunction with gRPC\'s protocol buffers for end-to-end type safety.\\n3. **Flexible Exposure**: Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol.\\n4. **Composability**: Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph.\\n\\n## Getting Started\\n\\nTo start using the gRPC Runtime in your Metatype project:\\n\\n1. Ensure you have the latest version of Metatype installed.\\n2. Prepare your .proto files for the gRPC services you want to integrate.\\n3. Set up your typegraph as shown in the example above, incorporating the GrpcRuntime.\\n4. Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed.\\n\\n## Conclusion\\n\\nThe addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease.\\n\\nFor more detailed documentation, code examples, and best practices, check out our [official Metatype docs](https://metatype.dev/docs)#."},{"id":"/2024/08/27/distributed-execution-flow-paradigms","metadata":{"permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx","source":"@site/blog/2024-08-27-distributed-execution-flow-paradigms/index.mdx","title":"Distributed execution flow paradigms","description":"In this age of cloud development and microservices architecture, problems start to arise with the increased workloads that run in the system. Imagine an e-commerce platform where a customer places an order for a product during a high-demand sale event. The order triggers a series of interconnected processes: payment processing, inventory checks, packaging, shipping, and final delivery. Each of these processes might be handled by different microservices, potentially running on different servers or even in different data centers. What happens if the payment service goes down right after the payment is authorized but before the inventory is updated? Or if the packaging service fails just after the inventory is deducted but before the item is packed? Without a robust mechanism to ensure that each step in the workflow completes successfully and that failures are properly handled, you could end up with unhappy customers, lost orders, and inventory discrepancies.","date":"2024-08-27T00:00:00.000Z","tags":[],"readingTime":10.92,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Introducing gRPC Runtime","permalink":"/blog/2024/09/26/introducing-grpc-runtime"},"nextItem":{"title":"Python on WebAssembly: How?","permalink":"/blog/2024/08/26/python-on-webassembly"}},"content":"import TabItem from \\"@theme/TabItem\\";\\nimport SDKTabs from \\"@site/src/components/SDKTabs\\";\\n\\n\\nIn this age of cloud development and microservices architecture, problems start to arise with the increased workloads that run in the system. Imagine an e-commerce platform where a customer places an order for a product during a high-demand sale event. The order triggers a series of interconnected processes: payment processing, inventory checks, packaging, shipping, and final delivery. Each of these processes might be handled by different microservices, potentially running on different servers or even in different data centers. What happens if the payment service goes down right after the payment is authorized but before the inventory is updated? Or if the packaging service fails just after the inventory is deducted but before the item is packed? Without a robust mechanism to ensure that each step in the workflow completes successfully and that failures are properly handled, you could end up with unhappy customers, lost orders, and inventory discrepancies.\\n\\nHaving multiple components in your system introduces more failure points, which is a common phenomenon in complex systems. But one important behavior any application must ensure is that the execution flow reaches its completion. As systems grow in features and complexity, the likelihood of long-running processes increases. To ensure these processes complete as intended, several solutions have been introduced over the last few decades.\\nLet\'s explore some of the solutions that have been proposed to achieve workflow completeness.\\n\\n### 1. Event-Driven Architecture with Message Queues\\n\\nThis architecture relies heavily on services communicating by publishing and subscribing to events using message queues. Message queues are persistent storages that ensure data is not lost during failures or service unavailability. Components in a distributed system synchronize by using events/messages through these independent services. While this approach offers service decomposability and fault tolerance, it has some shortcomings. For example, using message queues comes with the overhead of managing messages (e.g., deduplication and message ordering). It also isn\u2019t ideal for systems requiring immediate consistency across components. Some technologies and patterns that utilize this architecture include:\\n\\n- [RabbitMQ](https://www.rabbitmq.com/)\\n- [Amazon SQS](https://aws.amazon.com/sqs/)\\n\\n![](eda.drawio.svg)\\n\\n
\\n Fig. Event Driven Architecture with Message Queues - RabbitMQ\\n
\\n\\n#### Advantages\\n\\n- Improved Scalability\\n- Enhanced Responsiveness\\n- Enhanced Fault Tolerance\\n- Simplified Complex Workflows\\n- Real-Time Data Processing\\n\\n#### Challenges\\n\\n- Event Ordering\\n- Data Consistency\\n- Monitoring and Debugging\\n- Event Deduplication\\n\\nYou can mitigate or reduce these challenges by following best practices like Event Sourcing, Idempotent Processing, CQRS (Command Query Responsibility Segregation), and Event Versioning.\\n\\n### 2. The [Saga Pattern](https://microservices.io/patterns/data/saga.html)\\n\\nThis design pattern aims to achieve consistency across different services in a distributed system by breaking complex transactions spanning multiple components into a series of local transactions. Each of these transactions triggers an event or message that starts the next transaction in the sequence. If any local transaction fails to complete, a series of compensating actions roll back the effects of preceding transactions. While the orchestration of local transactions can vary, the pattern aims to achieve consistency in a microservices-based system. Events are designed to be stored in durable storage systems or logs, providing a trail to reconstruct the system to a state after a failure. While the saga pattern is an effective way to ensure consistency, it can be challenging to implement timer/timeout-based workflows and to design and implement the compensating actions for local transactions.\\n\\n**Note**: In the Saga pattern, a compensating transaction must be idempotent and retryable. These principles ensure that transactions can be managed without manual intervention.\\n\\n![](saga.drawio.svg)\\n\\n
\\n Fig. The Saga Pattern for Order delivery system\\n
\\n\\n#### Advantages\\n\\n- Ensures data consistency in a distributed system without tight coupling.\\n- Provides Roll back if one of the operations in the sequence fails.\\n\\n#### Drawbacks\\n\\n- Might be challenging to implement initially.\\n- Hard to debug.\\n- Compensating transactions don\u2019t always work.\\n\\n### 3. [Stateful Orchestrators](https://docs.oracle.com/en/applications/jd-edwards/cross-product/9.2/eotos/creating-a-stateful-orchestration-release-9-2-8-3.html#u30249073)\\n\\nStateful orchestrators provide a solution for long-running workflows by maintaining the state of each step in a workflow. Each step in a workflow represents a task, and these tasks are represented as states inside workflows. Workflows are defined as state machines or directed acyclic graphs (DAGs). In this approach, an orchestrator handles task execution order, transitioning, handling retries, and maintaining state. In the event of a failure, the system can recover from the persisted state. Stateful orchestrators offer significant value in fault tolerance, consistency, and observability. It\u2019s one of the solutions proven effective in modern distributed computing. Some well-known services that provide this solution include:\\n\\n- [Apache Airflow](https://airflow.apache.org/docs/apache-airflow/stable/core-concepts/overview.html)\\n- [Azure Logic Apps](https://azure.microsoft.com/en-us/products/logic-apps)\\n\\n#### Advantages\\n\\n- **High Resiliency**: Stateful orchestrators provide high resiliency in case of outages, ensuring that workflows can continue from where they left off.\\n- **Data Persistence**: They allow you to keep, review, or reference data from previous events, which is useful for long-running processes.\\n- **Extended Runtime**: Stateful workflows can continue running for much longer than stateless workflows, making them suitable for complex and long-running tasks.\\n\\n#### Challenges\\n\\n- **Additional Complexity**: They introduce additional complexity, requiring you to manage issues such as load balancing, CPU and memory usage, and networking.\\n- **Cost**: With stateful workflows, you pay for the VMs that are running in the cluster, whereas with stateless workflows, you pay only for the actual compute resources consumed.\\n\\n### 4. Durable Execution\\n\\nDurable execution refers to the ability of a system to preserve the state of an application and persist execution despite failures or interruptions. Durable execution ensures that for every task, its inputs, outputs, call stack, and local variables are persisted. These constraints, or rather features, allow a system to automatically retry or continue running in the face of infrastructure or system failures, ultimately ensuring completion.\\n\\nDurable execution isn\u2019t a completely distinct solution from the ones listed above but rather incorporates some of their strengths while presenting a more comprehensive approach to achieving consistency, fault tolerance, data integrity, resilience for long-running processes, and observability.\\n\\n\\n
Fig. Durable workflow engine
\\n\\n#### Advantages\\n\\n- **Reduced Manual Intervention**: Minimizes the need for human intervention by handling retries and failures programmatically.\\n- **Improved Observability**: Provides a clear audit trail and visibility into the state of workflows, which aids in debugging and monitoring.\\n- **Scalability**: Scales efficiently across distributed systems while maintaining workflow integrity.\\n\\n#### Challenges\\n\\n- **Resource Intensive**: Persistent state storage and management can consume significant resources, especially in large-scale systems.\\n- **Latency**: The need to persist state and handle retries can introduce latency in the execution flow.\\n\\nAs durable execution grows to be a fundamental driver of distributed computing, some of the solutions which use this architecture are\\n\\n- [Temporal](https://temporal.io/)\\n- [Uber Cadence](https://cadenceworkflow.io/)\\n\\nAmong these, [Temporal](https://temporal.io/) has grown in influence, used by companies like SnapChat, HashiCorp, Stripe, DoorDash, and DataDog. Its success is driven by its practical application in real-world scenarios and the expertise of its founders.\\n\\nAt Metatype, we recognize the value of durable execution and are committed to making it accessible. Our [Temporal Runtime](/docs/reference/runtimes/temporal) integrates seamlessly into our declarative API development platform, enabling users to harness the power of Temporal directly within Metatype. For those interested in exploring further, our documentation provides a detailed guide on getting started with [Temporal Runtime](/docs/reference/runtimes/temporal).\\n\\nBelow is an example of how you can build a simple API to interact with an order delivery temporal workflow within Metatype.\\n\\n:::note\\nIf you are new to Metatype or haven\u2019t set it up yet in your development environment. You can follow this [guideline](/docs/tutorials/quick-start).\\n:::\\n\\nFor this example, the order delivery system will have few components/services such as Payment, Inventory and Delivery.\\n\\nYour temporal workflow definition should look similar to the one below.\\n\\n\\n\\n \\n\\n
\\n\\nActivities definition inside `src/activities.ts`:`\\n\\n```typescript\\nasync function sleep(time: number) {\\n return new Promise((resolve) => {\\n setTimeout(resolve, time);\\n });\\n}\\n\\nexport async function processPayment(orderId: string): Promise {\\n console.log(`Processing payment for order ${orderId}`);\\n // Simulate payment processing logic\\n await sleep(2);\\n return \\"Payment processed\\";\\n}\\n\\nexport async function checkInventory(orderId: string): Promise {\\n console.log(`Checking inventory for order ${orderId}`);\\n // Simulate inventory check logic\\n await sleep(2);\\n return \\"Inventory available\\";\\n}\\n\\nexport async function deliverOrder(orderId: string): Promise {\\n console.log(`Delivering order ${orderId}`);\\n // Simulate delivery logic\\n await sleep(5);\\n return \\"Order delivered\\";\\n}\\n```\\n\\n
\\n\\n
\\n\\nWorkflow definition inside `src/workflows.ts`:\\n```typescript import {proxyActivities} from \\"@temporalio/workflow\\";\\n\\nexport const { processPayment, checkInventory, deliverOrder } =\\n proxyActivities<{\\n processPayment(orderId: string): Promise;\\n checkInventory(orderId: string): Promise;\\n deliverOrder(orderId: string): Promise;\\n }>({\\n startToCloseTimeout: \\"10 seconds\\",\\n });\\n\\nexport async function OrderWorkflow(orderId: string): Promise {\\n const paymentResult = await processPayment(orderId);\\n const inventoryResult = await checkInventory(orderId);\\n const deliveryResult = await deliverOrder(orderId);\\n return `Order ${orderId} completed with results: ${paymentResult}, ${inventoryResult}, ${deliveryResult}`;\\n}\\n```\\n
\\n\\n
\\nWorker definintion inside `src/worker.ts`:\\n\\n```typescript\\nimport { NativeConnection, Worker } from \\"@temporalio/worker\\";\\nimport * as activities from \\"./activities\\";\\nimport { TASK_QUEUE_NAME } from \\"./shared\\";\\n\\nasync function run() {\\n const connection = await NativeConnection.connect({\\n address: \\"localhost:7233\\",\\n });\\n\\n const worker = await Worker.create({\\n connection,\\n namespace: \\"default\\",\\n taskQueue: TASK_QUEUE_NAME,\\n workflowsPath: require.resolve(\\"./workflows\\"),\\n activities,\\n });\\n\\n await worker.run();\\n}\\n\\nrun().catch((err) => {\\n console.error(err);\\n process.exit(1);\\n});\\n```\\n\\n
\\n\\nAfter you have setup the above components, now you need a client to start of any `OrderWorkflow`. Here is where metatype comes in, through the simple APIs [Temporal Runtime](/docs/reference/runtimes/temporal) exposes, you can communicate with your temporal cluster.\\nDown below is the workflow communication bridge for this system expressed within a [typegraph](/docs/reference/typegraph) which includes endpoints to start a new workflow and describe an existing one.\\n\\n```typescript\\nimport { Policy, t, typegraph } from \\"@typegraph/sdk/index.ts\\";\\nimport { TemporalRuntime } from \\"@typegraph/sdk/providers/temporal.ts\\";\\n\\ntypegraph(\\n {\\n name: \\"order_delivery\\",\\n },\\n (g: any) => {\\n const pub = Policy.public();\\n\\n const temporal = new TemporalRuntime({\\n name: \\"order_delivery\\",\\n hostSecret: \\"HOST\\",\\n namespaceSecret: \\"NAMESPACE\\",\\n });\\n\\n const workflow_id = \\"order-delivery-1\\";\\n\\n const order_id = t.string();\\n\\n g.expose(\\n {\\n start: temporal.startWorkflow(\\"OrderWorkflow\\", order_id),\\n describe: workflow_id\\n ? temporal.describeWorkflow().reduce({ workflow_id })\\n : temporal.describeWorkflow(),\\n },\\n pub,\\n );\\n },\\n);\\n```\\n\\n
\\n\\n {/* break */}\\n \\n\\n
\\nActivities definition inside `activities.py`.\\n\\n```python\\nfrom temporalio import activity\\nimport time\\n\\n@activity.defn\\nasync def process_payment(order_id: str) -> str:\\n print(f\\"Processing payment for order {order_id}\\")\\n # Simulate payment processing logic\\n time.sleep(5)\\n return \\"Payment processed\\"\\n\\n@activity.defn\\nasync def check_inventory(order_id: str) -> str:\\n print(f\\"Checking inventory for order {order_id}\\")\\n # Simulate inventory check logic\\n time.sleep(4)\\n return \\"Inventory available\\"\\n\\n@activity.defn\\nasync def deliver_order(order_id: str) -> str:\\n print(f\\"Delivering order {order_id}\\")\\n time.sleep(8)\\n # Simulate delivery logic\\n return \\"Order delivered\\"\\n```\\n\\n
\\n\\n
\\nWorker defintion inside `run_worker.py`.\\n\\n```python\\nimport asyncio\\n\\nfrom temporalio.client import Client\\nfrom temporalio.worker import Worker\\n\\nfrom activities import process_payment, deliver_order, check_inventory\\nfrom shared import ORDER_DELIVERY_QUEUE\\nfrom workflows import OrderWorkflow\\n\\n\\nasync def main() -> None:\\n client: Client = await Client.connect(\\"localhost:7233\\", namespace=\\"default\\")\\n worker: Worker = Worker(\\n client,\\n task_queue=ORDER_DELIVERY_QUEUE,\\n workflows=[OrderWorkflow],\\n activities=[process_payment, check_inventory, deliver_order],\\n )\\n await worker.run()\\n\\n\\nif __name__ == \\"__main__\\":\\n asyncio.run(main())\\n```\\n\\n
\\n\\nAfter you have setup the above components, now you need a client to start of any `OrderWorkflow`. Here is where metatype comes in, through the simple APIs [Temporal Runtime](/docs/reference/runtimes/temporal) exposes, you can communicate with your temporal cluster.\\nDown below is the workflow communication bridge for this system expressed within a [typegraph](/docs/reference/typegraph) which includes endpoints to start a new workflow and describe an existing one.\\n\\n```python\\nfrom typegraph import t, typegraph, Policy, Graph\\nfrom typegraph.providers.temporal import TemporalRuntime\\n\\n\\n@typegraph()\\ndef example(g: Graph):\\n public = Policy.public()\\n\\n temporal = TemporalRuntime(\\n \\"example\\", \\"HOST\\", namespace_secret=\\"NAMESPACE\\"\\n )\\n\\n workflow_id = \\"order-delivery-1\\"\\n\\n order_id = t.string()\\n\\n g.expose(\\n public,\\n start=temporal.start_workflow(\\"OrderWorkflow\\", order_id),\\n describe=temporal.describe_workflow().reduce({\\"workflow_id\\": workflow_id})\\n if workflow_id\\n else temporal.describe_workflow(),\\n )\\n```\\n\\n
\\n\\n
\\n\\nYou need to add the secrets `HOST` and `NAMESPACE` under your typegraph name inside the `metatype.yaml` file. These secrets are important to connect with your temporal cluster and can be safely stored in the config file as shown below.\\n\\n
\\nmetatype.yaml\\n\\n```yaml\\ntypegate:\\n dev:\\n url: \\"http://localhost:7890\\"\\n username: admin\\n password: password\\n secrets:\\n example:\\n POSTGRES: \\"postgresql://postgres:password@postgres:5432/db\\"\\n HOST: \\"http://localhost:7233\\"\\n NAMESPACE: \\"default\\"\\n```\\n\\n
\\n\\nYou need to add only the last two lines as the others are auto-generated. Note that secrets are defined under the `example` parent, which is the name of your typegraph. If the name doesn\'t match, you will face secret not found issues when deploying your typegraph.\\n\\nBefore deploying the above typegraph, you need to start the temporal server and the worker. You need to have [temporal](https://learn.temporal.io/getting_started/typescript/dev_environment/#set-up-a-local-temporal-service-for-development-with-temporal-cli) installed on your machine.\\n\\n
\\nBoot up temporal\\n\\nStart the temporal server.\\n\\n```bash\\ntemporal server start-dev\\n```\\n\\nStart the worker.\\n\\n\\n\\n\\n ```typescript npx ts-node src/worker.ts ```\\n\\n\\n```python python run_worker.py ```\\n\\n\\n
\\n\\nAfter booting the temporal server, run the command down below to get a locally spinning [typegate](/docs/reference/typegate) instance with your typegraph deployed.\\n\\n```bash\\nmeta dev\\n```\\n\\nAfter completing the above steps, you can access the web GraphQL client of the typegate at [`http://localhost:7890/example`](http://localhost:7890/example). Run this query inside the client to start your workflow.\\n\\n```graphql\\nmutation {\\n start(\\n workflow_id: \\"order-delivery-3\\"\\n task_queue: \\"order-delivery-queue\\"\\n args: [\\"order12\\"]\\n )\\n}\\n```\\n\\nAfter a successful run, you will get the following result which includes the `run_id` of the workflow which has just been started.\\n\\n\\n\\nYou can also check the temporal web UI to monitor your workflows and you should see a result similar to this one.\\n\\n\\n\\nYou can explore the [Temporal Runtime](/docs/reference/runtimes/temporal) for more info.\\n\\nThis wraps up the blog, thanks for reading until the end :)"},{"id":"/2024/08/26/python-on-webassembly","metadata":{"permalink":"/blog/2024/08/26/python-on-webassembly","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-08-26-python-on-webassembly/index.mdx","source":"@site/blog/2024-08-26-python-on-webassembly/index.mdx","title":"Python on WebAssembly: How?","description":"Metatype\'s different language runtimes are nice, but integrating one is an entire story. Let\'s discover how we managed to implement one for Python.","date":"2024-08-26T00:00:00.000Z","tags":[],"readingTime":11.125,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Distributed execution flow paradigms","permalink":"/blog/2024/08/27/distributed-execution-flow-paradigms"},"nextItem":{"title":"Programmatic deployment (v0.4.x)","permalink":"/blog/2024/05/09/programmatic-deployment"}},"content":"Metatype\'s different language runtimes are nice, but integrating one is an entire story. Let\'s discover how we managed to implement one for Python.\\n\\n## Why?\\n\\nYou have probably heard of \\"Function as a Service\\" or FaaS.\\nIn simple terms, FaaS are platforms that allow users to run code in response to events without the hassle of managing the underlying infrastructure.\\nUsers submit their programs and the platform takes care of the rest including, usually, scaling, availability, and configuration.\\nAWS Lambda is one such example and FaaS as a whole are a popular implementation of the serverless model.\\n\\nMetatype has this model at heart with applications composed of small functions that respond to events like http requests and authorization checks.\\nThis is achieved through runtimes like the [`DenoRuntime`](/docs/reference/runtimes/deno) which implements a way to execute functions authored in Typescript using Web Workers as implemented by [Deno](https://docs.deno.com/runtime/manual/runtime/workers/) (not based on Deno Deploy).\\n\\n:::note\\nMetatype supports running multiple apps or typegraphs on a single deployed cluster but we\'re still in the kitchen on a hosted cloud solution.\\nSubscribe to the [blog](https://metatype.dev/blog/rss.xml) or the [Github](https://github.com/metatypedev/metatype) repository for updates.\\n:::\\n\\nImplementing the `DenoRuntime` was a very straightforward affair as the Typegate (the engine at the heart of Metatype) is primarily written in Typescript and runs on a slightly modified version of the Deno runtime.\\nWhat\'s more, JavaScript has single threaded and asynchronous semantics and the v8 engine that it commonly runs on is of very high-quality by all regards.\\nThese qualities lend themselves very well to the requirements of running a serverless platform like security (good sandboxing) and performance (low start-up latencies).\\nThis fact is reflected in the dominance of JavaScript in the serverless market though it doesn\'t hurt that it\'s also the most popular language in use today.\\n\\nAnother very popular language is Python; and its standard library can be quite resourceful for this type of use case.\\nHowever, as we shall see, integrating the Python runtime isn\'t as simple as integrating Deno.\\n\\n## What are the requirements?\\n\\nThere are a number of Python runtimes available but a set of extra factors limit what we can achieve.\\n\\n1. **Security**: functions should have limited access to the execution environment. Python doesn\'t have built-in features for sandboxing out of the box unlike Deno.\\n2. **Speed**: functions should run fast and with low latency. We\'re interested in metrics like cold-start latency and overhead of any cross process/system communication.\\n3. **User-friendliness**: functionalities provided in any of the languages supported by Metatype should, within reason, mirror each other and maintain a degree of uniformity. We support inline code snippets and external file references for `DenoRuntime` and this should be the case for Python as well.\\n4. **Interoperability**: functions running in Python will need to have access to other parts of the app running on the Typegate like being able to invoke other functions.\\n\\nThe Typegate is a TypeScript program with a bit of Rust sprinkled in.\\nIt runs as a traditional POSIX process.\\nThink Linux containers.\\nThis fact renders multi-processing, one of the readily apparent approaches, undesirable as it would require investing is robust worker process management and distribution schemes.\\nIt\'d be great if we could keep everything inside the Typegate process.\\n\\nOne solution that presents itself here is the [PyO3](https://pyo3.rs/) project which provide Rust bindings to different Python runtimes like CPython and PyPy.\\nIt\'d not only allow us to run Python code in-process but it also provide an easy way to expose the functions written in Rust to Python and vice-versa.\\nA good solution for the bidirectional communication needed for our interoperability requirements.\\n\\nUnfortunately, PyO3 doesn\'t have any provisions for sandboxing which is critical for our use case.\\nThis is where WebAssembly enters into the picture.\\nWebAssembly or Wasm for short is a executable bytecode format that originates from the web world and is designed for applications that run inside web-browsers.\\nThis use case shares most of our requirements and the Wasm world promises excellent sandboxing properties that should be perfect for our use case.\\nWe just have to find a way to run Python inside of it.\\n\\n## An aside on WASI\\n\\nWebAssembly System Interface (WASI) is an additional spec for the bytecode format that formalizes how Wasm programs access their host environment.\\nA lot like POSIX, this generally means OS capabilities such as file system access and networking but also, in it\'s latest iteration extends to any custom host defined functionality.\\n\\nWasm + WASI fits very well to our use case. As opposed to mutli-processing, we can instantiate, manage, and expose resources programmatically with ease.\\nAnd as luck would have it, some [community work](https://github.com/vmware-labs/webassembly-language-runtimes) has already been done at the time that led to wasm builds of CPython being available.\\n\\nUnfortunately, the WASI spec itself is a work in progress.\\nWhen we started out, only the limited \\"[preview1](https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md)\\" implementation was supported by most runtimes.\\n`preview1` only focused on a standard set of host functionalities much like a `libc` implementation.\\nWell enough but any custom functionality meant having to rely on simple C ABI alike functions for _intra_-process communication.\\nIn order to make this work easier, we elected to bring PyO3 back into the picture so that all the IPC stuff is written in Rust, the language with the most support in the Wasm ecosystem today.\\n\\nAll in all, this would mean the python interpreter wrapped in a PyO3 based native API.\\nAn assembly that accepts user code as strings and then invokes them in response to events.\\nAll of this would be running inside a Wasm runtime, [WasmEdge](https://wasmedge.org/) in this case, which ticks of all of the sandboxing and security requirements.\\nThis approach is well described as the [Reactor pattern](https://wasmcloud.com/blog/webassembly-patterns-command-reactor-library#the-reactor-pattern), a common pattern used in Wasm land.\\n\\n\\"FIRST\\n\\n### File system access\\n\\nSince the PyO3 project doesn\'t support [statically linking](https://github.com/PyO3/pyo3/issues/416) the Python runtime, we\'ll need to find a way dynamically link `libpython`.\\nThankfully, Wasm does support [dynamic linking](https://github.com/WebAssembly/design/blob/main/DynamicLinking.md) and wasm builds of [`libpython`](https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/python) are available curtsy of the WebAssembly Language Runtimes project.\\nBringing all of this together isn\'t as simple though as PyO3\'s tries to load `libpython` from certain _paths_, a concept that isn\'t exactly clearly defined in Wasm\'s post POSIX webtopia.\\n\\nOur first solution was to use [wasi-vfs](https://github.com/kateinoigakukun/wasi-vfs), a tool which allows you to embed a virtual file system, accessible through preview1 APIs, directly into your wasm binaries.\\nThis way, we could prepare a single wasm artifact that contains both the `libpython` build and the custom glue code.\\n\\nThis approach turned out to be quite hacky though and after encountering several issues, we ultimately decided to go with **preopens**.\\nPreopens are another virtual file-system solution where you map an actual file-system directory to a virtual directory visible to a running Wasm instance.\\nThis means we\'ll need to prepare the `libpython` Wasm file on disk before running the instance but it was an acceptable solution.\\nWe also use preopens to provide some of the user submitted code to our custom python runtime.\\n\\nThe following rust snippet demonstrates the preopens looked like in use:\\n\\n```rust\\nfn init_Python_vm() -> Result {\\n let preopens = vec![\\n // User script will be uploaded at ./src/Python which is virtually seen as /app\\n // Each script has access only to /app\\n \\"/app:./src/Python:readonly\\".to_owned()\\n ];\\n\\n // This follow the same idea as above, but for clarity\'s sake we decided to separate it\\n let pylib = PathBuf::from(\\"./vendor/libpython/usr/local/lib\\");\\n\\n // This is our wasm module reponsible for running Python scripts at runtime\\n // It assumes /app and libpython to be available in its world\\n let wasi_mod = PathBuf::from(\\"./build/Python-wasi-reactor.wasm\\");\\n\\n // Now we can instantiate the WASI module with all the configurations above\\n let rt = instantiate_custom_python_runtime(preopens, pylib, wasi_mod)?;\\n rt.run_func(None, \\"init_Python\\", params!())?;\\n\\n // ..\\n\\n Ok(rt)\\n}\\n```\\n\\n### WASI 0.2\\n\\nThe solution described above worked well to an extent but the limitations of preview1 and all the wrangling with PyO3 resulted in complexity that we were always ready to get rid of.\\nThis was exactly what we did after the Bytecode Alliance finalized [WASI 0.2](https://bytecodealliance.org/articles/WASI-0.2) back in January 2024 and with it, a slew of new opportunuties.\\n\\nWASI 0.2 introduces a whole new concept of components, wasm modules that come with pre-specifed interfaces using the [Wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) format and based on a whole new [ABI](https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md) to boot.\\nThese new capabilities suggest that it should possible to replace our PyO3 based glue code with the WASI based layer.\\nLet\'s see how.\\n\\nWe first used the new found WASI powers to implement support for Wasm based functions through the [`WasmRuntime`](/docs/reference/runtimes/wasm).\\nThis lead us to implement the [`wit_wire`](https://github.com/metatypedev/metatype/blob/2e692b9ae9e48b6e1a863130fc1bfbdd004cb631/src/wit/wit-wire.wit) protocol, a simple JSON based WIT interface that\'d be used by any wasm component that intenteds to run on the `WasmRuntime`.\\nSimple enough that it\'s reproduced down below in it\'s entirety.\\n\\n```wit\\npackage metatype:wit-wire;\\n\\n// what the host provides\\ninterface typegate-wire {\\n hostcall: func(op-name: string, json: string) -> result;\\n}\\n\\n// what\'s expected from the guest\\ninterface mat-wire {\\n\\n // init function called when we first make the component\\n init: func(args: init-args) -> result;\\n // general purpose event handler\\n handle: func(req: handle-req) -> result;\\n\\n type json-str = string;\\n\\n record init-args {\\n // the list of operations the application is expecting\\n // from this component\\n expected-ops: list\\n metatype-version: string,\\n }\\n\\n record mat-info {\\n op-name: string,\\n mat-title: string,\\n mat-data-json: string,\\n }\\n\\n record init-response {\\n ok: bool\\n }\\n\\n variant init-error {\\n version-mismatch(string),\\n unexpected-mat(mat-info),\\n other(string)\\n }\\n\\n record handle-req {\\n op-name: string,\\n in-json: json-str,\\n }\\n\\n variant handle-err {\\n no-handler,\\n in-json-err(string),\\n handler-err(string),\\n }\\n}\\n\\n// a world defines what interfaces get imported\\n// and exported\\nworld wit-wire {\\n import typegate-wire;\\n\\n export mat-wire;\\n}\\n\\n```\\n\\nSquint your eyes tight enough and the `wit_wire` protocol as implemented wasn\'t far off from what the PyO3 based glue code was doing in the previous implementation.\\nSpecifically, register a list of operations that the Typegate is expecting from the module and execute them for incoming event.\\nWe just need to add support for the operation metadata to contain extra items.\\nIn the case of the [`PythonRuntime`](/docs/reference/runtimes/python), this would be the Python code itself.\\n\\nNow that we have the `wit_wire` implementation taking care of bidirectional communication, we have little reason to keep the PyO3 based glue code around.\\nThis glue was doing a bit more than acting as a boundary though.\\nIt was also responsible for setting up the operating environment for the Python code.\\nFor example, we\'d need some kind of initialization to execute the user\'s Python snippets which are in free standing `lambda` form.\\nHow does one create components out of Python anyways?\\n\\n[componentize-py](https://github.com/bytecodealliance/componentize-py) is a tool authored by the Bytecode Alliance that allows you to produce WASI components that are authored in Python.\\nIt has code generation suite that emits guest bindings in Python for any WIT specification you feed it.\\nIt then takes your Python code written against these bindings and embeds them in a Wasm build of the Python interpreter to produce a component that supports the specified Wit.\\n\\nUnsurprisingly, componentize-py relies on PyO3 and preopens itself in addition to [component-init](https://github.com/dicej/component-init), a solution to pre-intialize components up to a certain point for improved startup latencies.\\nThis pre-intialization means we won\'t need to provide the actual preopens for the resulting component, baking the `libpython` object code directly into it as PyO3 will have dynamically loaded the object code by that point.\\nUltimately, this allows us to write all of our glue code in Python itself.\\n\\nWe still need a bit of Rust to support the `wit_wire` interface on the Typegate but this implementation is general across both the `PythonRuntime` and `WasmRuntime`.\\nWe\'d also moved to the [Wasmtime](https://wasmtime.dev/), also by Bytecode Alliance, for our wasm workloads at this point and their Rust bindings are a pleasure to use.\\nIt\'s all smooth sailing from here.\\n\\n## Cloudy skies?\\n\\nA final stumbling block for this approach was the many seconds Wasmtime spends cooking all your CPU cores when it compiles the fat wasm module that contains the Python interpreter, Pyo3 bindings and more.\\nThis happens because Wasmtime does\'t ([yet](https://github.com/bytecodealliance/rfcs/blob/main/accepted/wasmtime-baseline-compilation.md)) implement any schemes for tiered compilation, all code being greeted by their optimizing compiler, Cranelift.\\nAnd optimizations take time.\\nSure, you only pay this cost the first time you load the Python runtime module as Wasmtime has great support for caching including on-disk caching.\\nBut, 10+ second cold-starts, as measured on one developer\'s machine, are unacceptable in a system that primarily serves HTTP requests.\\nWhat to do?\\n\\nWasmtime has just the feature for this problem, [pre-compilation](https://docs.wasmtime.dev/cli-options.html#compile).\\nAhead-of-time compilation of wasm bytecode into a native instruction set.\\nSuch files are commonly given the `.cwasm` extesion, _c_ for compiled, and they are not a standalone executable but inteded to be run within Wasmtime\'s sandbox.\\nThis eliminates the compliation cost but the semantics of the source wasm bytecode and the runtime safe-guards means that this should be just as safe as JITting it (just-in-time compilation).\\nWe then statically embed this pre-compiled wasm artifact, after compressing it, in the Typegate binary removing the need for sidecar files while ensuring minimal cold-starts for our python workloads.\\nTo be concrete, this means _roughly_ around 200 ms of overhead for a cold function and 5 ms for a warm one.\\nGood enough.\\n\\nThis post describes the technical journey we took to arrive to the current implementation of the `PythonRuntime`. Hopefully, all details were clear enough and please direct any feedback, questions, and thoughts to the comments down below and our Github issues/discussion board."},{"id":"/2024/05/09/programmatic-deployment","metadata":{"permalink":"/blog/2024/05/09/programmatic-deployment","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-05-09-programmatic-deployment/index.mdx","source":"@site/blog/2024-05-09-programmatic-deployment/index.mdx","title":"Programmatic deployment (v0.4.x)","description":"A new approach to deploying typegraphs has been introduced starting with version 0.4.0. This aims to facilitate the development of automation tools around the APIs you build within the Metatype ecosystem.","date":"2024-05-09T00:00:00.000Z","tags":[],"readingTime":3.405,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Python on WebAssembly: How?","permalink":"/blog/2024/08/26/python-on-webassembly"},"nextItem":{"title":"The Node/Deno SDK is now available","permalink":"/blog/2023/11/27/node-compatibility"}},"content":"import SDKTabs from \\"@site/src/components/SDKTabs\\";\\nimport TabItem from \\"@theme/TabItem\\";\\nimport UpgradePythonSDK from \\"../../shared/upgrade/python-sdk.mdx\\";\\nimport UpgradeTsSDK from \\"../../shared/upgrade/typescript-sdk.mdx\\";\\n\\n\\nA new approach to deploying typegraphs has been introduced starting with version 0.4.0. This aims to facilitate the development of automation tools around the APIs you build within the Metatype ecosystem.\\n\\n## What has changed?\\n\\nBefore v0.4.x, we had to entirely rely on the [meta cli](/docs/reference/meta-cli) to deploy typegraphs to a typegate instance.\\n\\nThis is no longer the case, as all core logic has been moved to the TypeScript/Python typegraph SDKs, both of which share the same WebAssembly-based **typegraph-core** behind the scenes. This provides some degree of assurance that you will have nearly identical experiences with each SDK.\\n\\n## What are the use-cases?\\n\\nSince typegraphs can be written using the programming language your preferred SDK is based on, you can dynamically create typegraphs with ease.\\n\\nThe missing piece was having an interface natively backed inside the SDK for doing deployment programmatically.\\n\\n### Programmatic deployment\\n\\n### Initial setup\\n\\nJust like any other dependency in your favorite programming language, each SDKs can be installed with your favorite package manager.\\n\\nYou can use one of the commands below to get started with the latest available version.\\n\\n\\n \\n \\n \\n \\n \\n \\n\\n\\n#### Configuration\\n\\nThis is analoguous to the yaml configuration file when you are using [meta cli](/docs/reference/meta-cli).\\n\\nIt\'s the place where you tell which typegate you want to deploy to, how you want the artifacts to be resolved, among other settings.\\n\\n\\n \\n\\n```python\\nconfig: TypegraphDeployParams = TypegraphDeployParams(\\n typegate=TypegateConnectionOptions(url=\\"\\", auth=BasicAuth(\\"\\", \\"\\")),\\n typegraph_path=os.path.join(cwd, \\"path-to-typegraph\\"),\\n prefix=\\"\\",\\n secrets={},\\n migrations_dir=path.join(\\"prisma-migrations\\", example.name),\\n migration_actions=None,\\n default_migration_action=MigrationAction(\\n apply=True,\\n reset=True, # allow destructive migrations\\n create=True,\\n ),\\n )\\n```\\n\\n \\n \\n\\n```typescript\\nconst config = {\\n typegate: {\\n url: \\"\\",\\n auth: new BasicAuth(\\"\\", \\"\\"),\\n },\\n typegraphPath: path.join(cwd, \\"path-to-typegraph.ts\\"),\\n prefix: \\"\\",\\n secrets: { POSTGRES: \\"\\" },\\n migrationsDir: path.join(\\"prisma-migrations\\", tg.name),\\n defaultMigrationAction: {\\n create: true,\\n reset: true, // allow destructive migrations\\n },\\n};\\n```\\n\\n \\n\\n\\n\\n### Deploy/remove\\n\\nNow, picture this, you have a lot of typegraphs and one or more typegate instance(s) running, you can easily make small scripts that does any specific job you want.\\n\\n```typescript\\n// ..\\nimport { tgDeploy, tgRemove } from \\"@typegraph/sdk/tg_deploy.js\\";\\n// ..\\n\\nconst BASIC_AUTH = loadMyAuthsFromSomeSource();\\nconst TYPEGATE_URL = \\"...\\";\\n\\nexport async function getTypegraphs() {\\n // Suppose we have these typegraphs..\\n // Let\'s enumerate them like this to simplify\\n return [\\n {\\n tg: await import(\\"path/to/shop-finances\\"),\\n location: \\"path/to/shop-finances.ts\\",\\n },\\n {\\n tg: await import(\\"path/to/shop-stats\\"),\\n location: \\"path/to/shop-stats.ts\\",\\n },\\n ];\\n}\\n\\nexport function getConfig(tgName: string, tgLocation: string) {\\n // Note: You can always develop various ways of constructing the configuration,\\n // like loading it from a file.\\n return {\\n typegate: {\\n url: \\"\\",\\n auth: new BasicAuth(\\"\\", \\"\\"),\\n },\\n typegraphPath: path.join(cwd, \\"path-to-typegraph.ts\\"),\\n prefix: \\"\\",\\n secrets: { POSTGRES: \\"\\" },\\n migrationsDir: path.join(\\"prisma-migrations\\", tg.name),\\n defaultMigrationAction: {\\n create: true,\\n reset: true, // allow destructive migrations\\n },\\n };\\n}\\n\\nexport async function deployAll() {\\n const typegraphs = await getTypegraphs();\\n for (const { tg, location } of typegraphs) {\\n try {\\n const config = getConfig(tg.name, location);\\n // use tgDeploy to deploy typegraphs, it will contain the response from typegate\\n const { typegate } = await tgDeploy(tg, config);\\n const selection = typegate?.data?.addTypegraph;\\n if (selection) {\\n const { messages } = selection;\\n console.log(messages.map(({ text }) => text).join(\\"\\\\n\\"));\\n } else {\\n throw new Error(JSON.stringify(typegate));\\n }\\n } catch (e) {\\n console.error(\\"[!] Failed deploying\\", tg.name);\\n console.error(e);\\n }\\n }\\n}\\n\\nexport async function undeployAll() {\\n const typegraphs = await getTypegraphs();\\n for (const { tg } of typegraphs) {\\n try {\\n // use tgRemove to remove typegraphs\\n const { typegate } = await tgRemove(\\"\\", {\\n baseUrl: TYPEGATE_URL,\\n auth: BASIC_AUTH,\\n });\\n console.log(typegate);\\n } catch (e) {\\n console.error(\\"Failed removing\\", tg.name);\\n console.error(e);\\n }\\n }\\n}\\n```\\n\\n### Going beyond\\n\\nWith these new additions, you can automate virtually anything programmatically on the typegraph side. Starting from having highly dynamic APIs to providing ways to deploy and configure them, you can even build a custom framework around the ecosystem!\\n\\nPlease tell us what you think and report any issues you found on [Github](https://github.com/metatypedev/metatype/issues).\\n\\n:::info Notes\\n\\nYou can check the [Programmatic deployment](/docs/guides/programmatic-deployment) reference page for more information.\\n\\n:::"},{"id":"/2023/11/27/node-compatibility","metadata":{"permalink":"/blog/2023/11/27/node-compatibility","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-11-27-node-compatibility/index.mdx","source":"@site/blog/2023-11-27-node-compatibility/index.mdx","title":"The Node/Deno SDK is now available","description":"We are happy to announce that we have redesigned our SDKs to support Node/Deno and facilitate the integration of future languages. Most of the typegraph SDK is now written in Rust and shaped around a core interface running in WebAssembly.","date":"2023-11-27T00:00:00.000Z","tags":[],"readingTime":1.7,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Programmatic deployment (v0.4.x)","permalink":"/blog/2024/05/09/programmatic-deployment"},"nextItem":{"title":"Programmable glue for developers","permalink":"/blog/2023/06/18/programmable-glue"}},"content":"We are happy to announce that we have redesigned our SDKs to support Node/Deno and facilitate the integration of future languages. Most of the [typegraph SDK](/docs/reference/typegraph) is now written in Rust and shaped around a core interface running in WebAssembly.\\n\\n## Meet `wit`\\n\\nIn the realm of WebAssembly, the [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen) project emerges as the most mature tool to create and maintain the language bindings for WebAssembly modules. This tool introduces WIT (WebAssembly Interface Types) as an Interface Definition Language (IDL) to describe the imports, exports, and capabilities of WebAssembly components seamlessly.\\n\\nFor example, Metatype implements the reactor pattern to handle requests as they come and delegate part of their execution in correct WASM runtime. The wit-bindgen helps there to define the interfaces between the guest (the Metatype runtime) and the host (the typegate) to ensure the correct serialization of the payloads. The `wit` definition could look like this:\\n\\n```\\npackage metatype:wit-wire;\\n\\ninterface typegate-wire {\\n hostcall: func(op-name: string, json: string) -> result;\\n}\\n\\ninterface mat-wire {\\n record handle-req {\\n op-name: string,\\n in-json: string,\\n }\\n\\n handle: func(req: handle-req) -> result;\\n}\\n\\nworld wit-wire {\\n import typegate-wire;\\n\\n export mat-wire;\\n}\\n```\\n\\nThe `wit` file is then used to generate the bindings for the host and the guest in Rust, TypeScript, Python, and other languages. The host bindings are used in the typegate to call the WASM runtime, and the guest bindings are used in the WASM runtime to call the typegate.\\n\\n## Install the v0.2.x series\\n\\nThe documentation contains now examples for Node and Deno.\\n\\n### Upgrade with Node\\n\\n```bash\\nnpm install @typegraph/sdk\\nmeta new --template node .\\n```\\n\\n### Upgrade with Deno\\n\\n```bash\\nmeta new --template deno .\\n```\\n\\n```typescript\\nimport { typegraph } from \\"npm:@typegraph/sdk/index.js\\";\\n```\\n\\n### Upgrade with Python\\n\\n```python\\npip3 install --upgrade typegraph\\npoetry add typegraph@latest\\n```\\n\\n## Give us feedback!\\n\\nThis new release enables us to provide a consistent experience across all languages and reduce the work to maintain the existing Python SDK.\\n\\nAs always, report issues and let us know what you think on [GitHub](https://github.com/metatypedev/metatype/discussions)."},{"id":"/2023/06/18/programmable-glue","metadata":{"permalink":"/blog/2023/06/18/programmable-glue","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-06-18-programmable-glue/index.mdx","source":"@site/blog/2023-06-18-programmable-glue/index.mdx","title":"Programmable glue for developers","description":"We are introducing Metatype, a new project that allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.","date":"2023-06-18T00:00:00.000Z","tags":[],"readingTime":1.295,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"The Node/Deno SDK is now available","permalink":"/blog/2023/11/27/node-compatibility"},"nextItem":{"title":"Emulating your server nodes locally","permalink":"/blog/2023/03/15/emulating-servers"}},"content":"import { CompareLandscape } from \\"@site/src/components/CompareLandscape\\";\\nimport Metatype from \\"@site/shared/metatype-intro.mdx\\";\\nimport TGExample from \\"@site/src/components/TGExample\\";\\n\\n\\nWe are introducing Metatype, a new project that allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.\\n\\n## What is Metatype?\\n\\n\\n\\n## What are virtual graphs?\\n\\nTypegraphs are a declarative way to expose all APIs, storage and business logic of your stack as a single graph. They take inspiration from domain-driven design principles and in the idea that the relation between of the data is as important as data itself, even though they might be in different locations or shapes.\\n\\n\\n\\nThese elements can then be combined and composed together similarly on how you would compose web components to create an interface in modern frontend practices. This allows developers to build modular and strongly typed APIs using typegraph as a programmable glue.\\n\\n## Where does this belong in the tech landscape?\\n\\nBefore Metatype, there was a gap in the technological landscape for a solution that specifically addressed the transactional, short-lived use cases. While there were existing tools for analytical or long-running use cases, such as Trino and Temporal, there was no generic engine for handling transactional, short-lived tasks.\\n\\n \\n\\n## Give it a try!\\n\\nLet us know what you think! Metatype is open source and we welcome any feedback or contributions. The community primarily lives on [GitHub](https://github.com/metatypedev/metatype).\\n\\n:::info Next steps\\n\\n[Build your first typegraph](/docs/tutorials/metatype-basics) or read more about the [concepts behind Metatype](/docs/concepts/mental-model).\\n\\n:::"},{"id":"/2023/03/15/emulating-servers","metadata":{"permalink":"/blog/2023/03/15/emulating-servers","editUrl":"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2023-03-15-emulating-servers/index.mdx","source":"@site/blog/2023-03-15-emulating-servers/index.mdx","title":"Emulating your server nodes locally","description":"Introducing the Embedded Typegate","date":"2023-03-15T00:00:00.000Z","tags":[],"readingTime":3.07,"hasTruncateMarker":false,"authors":[],"frontMatter":{},"unlisted":false,"prevItem":{"title":"Programmable glue for developers","permalink":"/blog/2023/06/18/programmable-glue"}},"content":"import BlogIntro from \\"@site/src/components/BlogIntro\\";\\nimport UpgradeMetatype from \\"../../shared/upgrade/index.mdx\\";\\n\\n\\n\\n\\n## Introducing the Embedded Typegate\\n\\nThe embedded typegate is a feature that comes with the [Meta CLI](/docs/reference/meta-cli) which provides the option of spinning a typegate instance from the CLI with minimum configurations and installations needed from the developer. All that is required to access the _Embedded Typegate_ is to install _Meta CLI_. The spawned typegate instance behaves similarly to cloud-deployed typegates.\\n\\n## The motive\\n\\nThere are more than a couple of reasons why a developer would be tempted to use an emedded typegate. While developers can start a typegate instance using docker compose, the developer needs to install docker as a dependency to run the typegate container. Even though docker is familiar among many developers, it can sometimes be tricky and unbeknownst to some developers. We at metatype highly value the developer experience and one reason for adding the _embedded typegate_ feature to the _Meta CLI_ is for users to have a smooth experience with our system by providing a docker compose free experience.\\nThis feature provides a great utility for developers to author and test typegraphs in their local machine before deploying them to production level typegate instances on the cloud.\\nAdditionally, developers need not concern themselves with deployment configurations which are needed only during deployment. The only need to focus their energy and time in developing the right application and easily test them on _embedded typegate_ running from the terminal. To add more to what is said, as the typegate engine keeps evolving, users will be abstracted away from the different configurations which might be added on the future. The _Meta CLI_ will abstract much of what\'s not needed in a dev environment. Thus, leaving less headaches to developers on new changes.\\nUltimately, The _embedded typegate_ is designed to be a good dev environment friendly tool which faciliates development time.\\n\\n## Quick First hand example\\n\\n### Install the v0.3.x series\\n\\nEither of the two [Typegraph](/docs/reference/typegraph) SDKs are needed to author typegraphs. For this example, the node SDK will be used.\\n\\nFirst, make sure the _Meta CLI_ is installed.\\n\\n```shell\\ncurl -fsSL https://raw.githubusercontent.com/metatypedev/metatype/main/installer.sh | bash\\n```\\n\\nNext, create a new node project using this command.\\n\\n```shell\\nmeta new --template node\\n```\\n\\nThe above command will create a sample typegraph which you can use to test the embedded typegate.\\n\\nNow, you need to install the typegraph SDK by running the command down below. The previous command generates a `package.json` with the SDK specified as a dependency.\\n\\n```shell\\nnpm install\\n```\\n\\nBefore deploying the typegraph to the embedded typegate, Run the following commands below.\\n\\n```shell\\nmeta dev\\n```\\n\\nNow that there is running instance of a typegate, you can deploy the example typegraph. From another terminal, run the command below.\\n\\n```shell\\nmeta deploy -f api/example.ts --allow-dirty --create-migration --target dev --gate http://localhost:7890\\n```\\n\\nThe typegate runs on port 7890 by default. If you access [http://localhost:7890/example](http://localhost:7890/example) on your browser, you can see an GraphQL interface to interact with the deployed typegraph. You can test the example typegraph using the following graphql query below.\\n\\n```graphql\\nquery {\\n multilpy(first: 3, second: 5)\\n}\\n```\\n\\n\\n\\n## Learn more about Metatype\\n\\nWanna dive deep into the basics of _Metaype_? check our interactive [tutorial](/docs/tutorials/metatype-basics) revolving around the core features of the system."}]}}')}}]); \ No newline at end of file diff --git a/assets/js/b8f4db82.ff7ace8c.js b/assets/js/b8f4db82.793214bb.js similarity index 66% rename from assets/js/b8f4db82.ff7ace8c.js rename to assets/js/b8f4db82.793214bb.js index 79d22a3334..666f9e66a9 100644 --- a/assets/js/b8f4db82.ff7ace8c.js +++ b/assets/js/b8f4db82.793214bb.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4619],{96996:(e,r,t)=>{"use strict";t.r(r),t.d(r,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>s,metadata:()=>l,toc:()=>c});var n=t(86070),o=t(25710),a=t(65671);const s={},i="Temporal",l={id:"reference/runtimes/temporal/index",title:"Temporal",description:"Temporal runtime",source:"@site/docs/reference/runtimes/temporal/index.mdx",sourceDirName:"reference/runtimes/temporal",slug:"/reference/runtimes/temporal/",permalink:"/docs/reference/runtimes/temporal/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/temporal/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Substantial",permalink:"/docs/reference/runtimes/substantial/"},next:{title:"Wasm",permalink:"/docs/reference/runtimes/wasm/"}},p={},c=[{value:"Temporal runtime",id:"temporal-runtime",level:2}];function m(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"temporal",children:"Temporal"}),"\n",(0,n.jsx)(r.h2,{id:"temporal-runtime",children:"Temporal runtime"}),"\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.a,{href:"https://temporal.io/",children:"Temporal"})," is an open-source durable execution engine that can be used to develop workflows that are long lived and failure resistant. Common use cases include:"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Implementing multi-step, complicated transactionaly business logic."}),"\n",(0,n.jsx)(r.li,{children:"Guaranteed event processing."}),"\n",(0,n.jsx)(r.li,{children:"Control planes for driving processes."}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:["The ",(0,n.jsx)(r.code,{children:"TemporalRuntime"})," in Metatype can be used to directly ",(0,n.jsx)(r.code,{children:"start"}),", ",(0,n.jsx)(r.code,{children:"query"}),", ",(0,n.jsx)(r.code,{children:"signal"})," and ",(0,n.jsx)(r.code,{children:"describe"})," workflows on your temporal cluster. Refer to the ",(0,n.jsx)(r.a,{href:"https://docs.temporal.io",children:"temporal docs"})," for more on what you can accomplish with this tech."]}),"\n",(0,n.jsx)(r.p,{children:"An interesting use case is to dynamically describe the operations you want to expose, this enables reusing typegraphs accross different projects or even building a small framework around it."}),"\n",(0,n.jsx)(r.p,{children:"Here is a simple example of a typegraph that takes some value from an environment variable."}),"\n",(0,n.jsx)(a.A,{typegraph:"temporal",python:t(46335),typescript:t(50977),disablePlayground:!0,query:{content:""}})]})}function d(e={}){const{wrapper:r}={...(0,o.R)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}},65671:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});var n=t(98302),o=(t(30758),t(86070));function a(e){let{python:r,typescript:t,rust:a,...s}=e;const i=[r&&{content:r.content,codeLanguage:"python",codeFileUrl:r.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,o.jsx)(n.A,{code:0==i.length?void 0:i,...s})}},46335:e=>{e.exports={content:'from typegraph import t, typegraph, Policy, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.providers.temporal import TemporalRuntime\nimport os\n\n\n@typegraph(\n)\ndef temporal(g: Graph):\n public = Policy.public()\n # set `HOST` and `NAMESPACE` under secrets inside metatype.yaml\n temporal = TemporalRuntime("", "HOST", namespace_secret="NAMESPACE")\n\n workflow_id = os.getenv("ID_FROM_ENV")\n arg = t.struct({"some_field": t.string()})\n\n g.expose(\n public,\n start=temporal.start_workflow("", arg),\n query=temporal.query_workflow("", arg, t.string()),\n signal=temporal.signal_workflow("", arg),\n describe=temporal.describe_workflow().reduce({"workflow_id": workflow_id})\n if workflow_id\n else temporal.describe_workflow(),\n )',path:"../examples/typegraphs/temporal.py"}},50977:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { TemporalRuntime } from "@typegraph/sdk/providers/temporal.ts";\n\n\ntypegraph(\n {\n name: "temporal",\n },\n (g: any) => {\n const pub = Policy.public();\n // set `HOST` and `NAMESPACE` under secrets inside metatype.yaml\n const temporal = new TemporalRuntime({\n name: "",\n hostSecret: "HOST",\n namespaceSecret: "NAMESPACE",\n });\n\n const workflow_id = getEnvVariable("ID_FROM_ENV");\n const arg = t.struct({ some_field: t.string() });\n\n g.expose(\n {\n start: temporal.startWorkflow("", arg),\n query: temporal.queryWorkflow("", arg, t.string()),\n signal: temporal.signalWorkflow("", arg),\n describe: workflow_id\n ? temporal.describeWorkflow().reduce({ workflow_id })\n : temporal.describeWorkflow(),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/temporal.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4619],{96996:(e,r,t)=>{"use strict";t.r(r),t.d(r,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var n=t(86070),o=t(25710),s=t(65671);const a={},i="Temporal",l={id:"reference/runtimes/temporal/index",title:"Temporal",description:"Temporal runtime",source:"@site/docs/reference/runtimes/temporal/index.mdx",sourceDirName:"reference/runtimes/temporal",slug:"/reference/runtimes/temporal/",permalink:"/docs/reference/runtimes/temporal/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/temporal/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Substantial",permalink:"/docs/reference/runtimes/substantial/"},next:{title:"Wasm",permalink:"/docs/reference/runtimes/wasm/"}},p={},c=[{value:"Temporal runtime",id:"temporal-runtime",level:2}];function m(e){const r={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.h1,{id:"temporal",children:"Temporal"}),"\n",(0,n.jsx)(r.h2,{id:"temporal-runtime",children:"Temporal runtime"}),"\n",(0,n.jsxs)(r.p,{children:[(0,n.jsx)(r.a,{href:"https://temporal.io/",children:"Temporal"})," is an open-source durable execution engine that can be used to develop workflows that are long lived and failure resistant. Common use cases include:"]}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:"Implementing multi-step, complicated transactionaly business logic."}),"\n",(0,n.jsx)(r.li,{children:"Guaranteed event processing."}),"\n",(0,n.jsx)(r.li,{children:"Control planes for driving processes."}),"\n"]}),"\n",(0,n.jsxs)(r.p,{children:["The ",(0,n.jsx)(r.code,{children:"TemporalRuntime"})," in Metatype can be used to directly ",(0,n.jsx)(r.code,{children:"start"}),", ",(0,n.jsx)(r.code,{children:"query"}),", ",(0,n.jsx)(r.code,{children:"signal"})," and ",(0,n.jsx)(r.code,{children:"describe"})," workflows on your temporal cluster. Refer to the ",(0,n.jsx)(r.a,{href:"https://docs.temporal.io",children:"temporal docs"})," for more on what you can accomplish with this tech."]}),"\n",(0,n.jsx)(r.p,{children:"An interesting use case is to dynamically describe the operations you want to expose, this enables reusing typegraphs accross different projects or even building a small framework around it."}),"\n",(0,n.jsx)(r.p,{children:"Here is a simple example of a typegraph that takes some value from an environment variable."}),"\n",(0,n.jsx)(s.A,{typegraph:"temporal",python:t(46335),typescript:t(50977),disablePlayground:!0,query:{content:""}})]})}function d(e={}){const{wrapper:r}={...(0,o.R)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(m,{...e})}):m(e)}},65671:(e,r,t)=>{"use strict";t.d(r,{A:()=>s});var n=t(98302),o=(t(30758),t(86070));function s(e){let{python:r,typescript:t,rust:s,...a}=e;const i=[r&&{content:r.content,codeLanguage:"python",codeFileUrl:r.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(n.A,{code:0==i.length?void 0:i,...a})}},46335:e=>{e.exports={content:'from typegraph import t, typegraph, Policy, Graph\nfrom typegraph.graph.params import Cors\nfrom typegraph.providers.temporal import TemporalRuntime\nimport os\n\n\n@typegraph(\n)\ndef temporal(g: Graph):\n public = Policy.public()\n # set `HOST` and `NAMESPACE` under secrets inside metatype.yaml\n temporal = TemporalRuntime("", "HOST", namespace_secret="NAMESPACE")\n\n workflow_id = os.getenv("ID_FROM_ENV")\n arg = t.struct({"some_field": t.string()})\n\n g.expose(\n public,\n start=temporal.start_workflow("", arg),\n query=temporal.query_workflow("", arg, t.string()),\n signal=temporal.signal_workflow("", arg),\n describe=temporal.describe_workflow().reduce({"workflow_id": workflow_id})\n if workflow_id\n else temporal.describe_workflow(),\n )',path:"../examples/typegraphs/temporal.py"}},50977:e=>{e.exports={content:'// Copyright Metatype O\xdc, licensed under the Mozilla Public License Version 2.0.\n// SPDX-License-Identifier: MPL-2.0\n\nimport { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { TemporalRuntime } from "@typegraph/sdk/providers/temporal.ts";\nimport process from "node:process";\n\ntypegraph(\n {\n name: "temporal",\n },\n (g: any) => {\n const pub = Policy.public();\n // set `HOST` and `NAMESPACE` under secrets inside metatype.yaml\n const temporal = new TemporalRuntime({\n name: "",\n hostSecret: "HOST",\n namespaceSecret: "NAMESPACE",\n });\n\n const workflow_id = process.env["ID_FROM_ENV"];\n const arg = t.struct({ some_field: t.string() });\n\n g.expose(\n {\n start: temporal.startWorkflow("", arg),\n query: temporal.queryWorkflow("", arg, t.string()),\n signal: temporal.signalWorkflow("", arg),\n describe: workflow_id\n ? temporal.describeWorkflow().reduce({ workflow_id })\n : temporal.describeWorkflow(),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/temporal.ts"}}}]); \ No newline at end of file diff --git a/assets/js/bbc54dbf.64f82f9b.js b/assets/js/bbc54dbf.accd566f.js similarity index 97% rename from assets/js/bbc54dbf.64f82f9b.js rename to assets/js/bbc54dbf.accd566f.js index 096f692c56..960daf33b8 100644 --- a/assets/js/bbc54dbf.64f82f9b.js +++ b/assets/js/bbc54dbf.accd566f.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2427],{10148:(I,g,e)=>{"use strict";e.r(g),e.d(g,{assets:()=>d,contentTitle:()=>a,default:()=>c,frontMatter:()=>n,metadata:()=>t,toc:()=>l});var C=e(86070),A=e(25710),i=e(65671);const n={},a="ORM for the edge",t={id:"orm-for-the-edge/index",title:"ORM for the edge",description:"Edge computing platforms like Deno Deploy and Cloudflare Workers can provide a convenient and scalable way for developers to deploy their applications and APIs near the end-users, improving performance, reducing latency, and enhancing the user experience. Due to the resource constraints and compatibility issues (legacy libraries or specific drivers) of those environments, running a traditional Object-Relational Mapping (ORM) library might not be as easy as in normal deployments.",source:"@site/use-cases/orm-for-the-edge/index.mdx",sourceDirName:"orm-for-the-edge",slug:"/orm-for-the-edge/",permalink:"/use-cases/orm-for-the-edge/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/orm-for-the-edge/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Microservices orchestration",permalink:"/use-cases/microservice-orchestration/"},next:{title:"Programmable API gateway",permalink:"/use-cases/programmable-api-gateway/"}},d={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function s(I){const g={a:"a",h1:"h1",h2:"h2",img:"img",p:"p",...(0,A.R)(),...I.components};return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(g.h1,{id:"orm-for-the-edge",children:"ORM for the edge"}),"\n",(0,C.jsx)(g.p,{children:"Edge computing platforms like Deno Deploy and Cloudflare Workers can provide a convenient and scalable way for developers to deploy their applications and APIs near the end-users, improving performance, reducing latency, and enhancing the user experience. Due to the resource constraints and compatibility issues (legacy libraries or specific drivers) of those environments, running a traditional Object-Relational Mapping (ORM) library might not be as easy as in normal deployments."}),"\n",(0,C.jsx)(g.h2,{id:"case-study",children:"Case study"}),"\n",(0,C.jsx)("div",{className:"text-center md:float-right p-8",children:(0,C.jsx)(g.p,{children:(0,C.jsx)(g.img,{src:e(74226).A+""})})}),"\n",(0,C.jsx)(g.p,{children:"Suppose you are building a mobile app that allows users to order food from local restaurants. To provide a low-latency user experience, you want to run your server-side logic as close as possible to your users."}),"\n",(0,C.jsx)(g.p,{children:"You can deploy your functions across multiple locations on distributed edge servers. For database interactions, you may need a lightweight relay API to remains compatible with the platform and offer an efficient interface like an ORM provide."}),"\n",(0,C.jsx)(g.p,{children:"When a user makes a request to view the menu or place an order, the corresponding function running on the edge will make a request to the lightweight relay API to retrieve or modify the relevant data in the database."}),"\n",(0,C.jsx)(g.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,C.jsxs)(g.p,{children:["Metatype can act out of the box as a lightweight relay API, simplifying database interactions via HTTP/GraphQL requests, and allowing you to query your database through the ",(0,C.jsx)(g.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma runtime"}),". Prisma is a well-known ORM library that provides a convenient interface to interact with PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, CockroachDB databases."]}),"\n",(0,C.jsx)(i.A,{typegraph:"prisma-runtime",python:e(70160),typescript:e(93814),query:e(29922)})]})}function c(I={}){const{wrapper:g}={...(0,A.R)(),...I.components};return g?(0,C.jsx)(g,{...I,children:(0,C.jsx)(s,{...I})}):s(I)}},65671:(I,g,e)=>{"use strict";e.d(g,{A:()=>i});var C=e(98302),A=(e(30758),e(86070));function i(I){let{python:g,typescript:e,rust:i,...n}=I;const a=[g&&{content:g.content,codeLanguage:"python",codeFileUrl:g.path},e&&{content:e.content,codeLanguage:"typescript",codeFileUrl:e.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((I=>!!I));return(0,A.jsx)(C.A,{code:0==a.length?void 0:a,...n})}},29922:I=>{var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"create"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"john@doe.com",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"read"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"read_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"find_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"StringValue",value:"%doe%",block:!1}},{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstname"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:288}};g.loc.source={body:'mutation create {\n create_user(\n data: {\n firstname: "" # fill me\n email: "john@doe.com"\n }\n ) {\n id\n }\n}\n\nquery read {\n read_user(\n where: {\n firstname: "" # fill me\n }\n ) {\n id\n }\n find_user(term: "%doe%", id: "") {\n email\n firstname\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function e(I,g){if("FragmentSpread"===I.kind)g.add(I.name.value);else if("VariableDefinition"===I.kind){var C=I.type;"NamedType"===C.kind&&g.add(C.name.value)}I.selectionSet&&I.selectionSet.selections.forEach((function(I){e(I,g)})),I.variableDefinitions&&I.variableDefinitions.forEach((function(I){e(I,g)})),I.definitions&&I.definitions.forEach((function(I){e(I,g)}))}var C={};function A(I,g){for(var e=0;e0;){var t=a;a=new Set,t.forEach((function(I){n.has(I)||(n.add(I),(C[I]||new Set).forEach((function(I){a.add(I)})))}))}return n.forEach((function(g){var C=A(I,g);C&&e.definitions.push(C)})),e}g.definitions.forEach((function(I){if(I.name){var g=new Set;e(I,g),C[I.name.value]=g}})),I.exports=g,I.exports.create=i(g,"create"),I.exports.read=i(g,"read")},74226:(I,g,e)=>{"use strict";e.d(g,{A:()=>C});const C="data:image/svg+xml;base64,PHN2ZyBob3N0PSI2NWJkNzExNDRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTFweCIgaGVpZ2h0PSIzMjFweCIgdmlld0JveD0iLTAuNSAtMC41IDI1MSAzMjEiIGNvbnRlbnQ9IiZsdDtteGZpbGUmZ3Q7Jmx0O2RpYWdyYW0gaWQ9JnF1b3Q7dEF4eUpDZUVWUjVvV2UyWDZEYmsmcXVvdDsgbmFtZT0mcXVvdDtQYWdlLTEmcXVvdDsmZ3Q7eFZaTmM1c3dFUDAxUHRiRGgwM2NxKzAwUGRpVHRENmtPY3F3QmsyRXhBaGhUSDk5RjVENEtIWkNPcTV6UXZ1MGk3VHY3VXFhdUt2NDlDQkpFbTFGQUd6aVdNRnA0cTRuam1OYkN3OC9KVklZeExWckpKUTAwRmdMN09odk1JNGF6V2dBYWM5UkNjRVVUZnFnTHpnSFgvVXdJcVhJKzI0SHdmcXJKaVNFQWJEekNSdWl6elJRVVkwdW5Mc1cvdzQwak16S3R2ZTFub21KY2RhWnBCRUpSTjZCM1B1SnU1SkNxSG9VbjFiQVN2WU1MM1hjdHd1enpjWWtjRFVtUU8vNFNGaW1jOVA3VW9WSkZnTE1YWnRjY1B3c0l4VXp0R3djd29tcVh6aTJwbk50dlhSbTFxWG1sakVLWTNBbGl6ckltUnY3cFR2WnhsV1dDUnhtcHhOT1JTWjl2VitkZ1NJeUJPMmw2NjNNcEJPbUdYa0FFUU91Z2c2NlFyOVlVeHMzVnNWSVlFVFJZMTk0b3VzbmJFS2J2ejBKaW50clhjVGhrT0kyT2hyZ29MTm9DMVhLbkZmSk9hT1N4ekM1NVI0SFlUbFlBeGZvc29hRWljTE00bjhiaHlaQ0d1UlpTQmJrMkVsbG1obFhOSWFCK0ZKa1BJQkE4NTlIVk1FdUlSWFZPVFozdnhZdXluTUVxZUEwaG5yWDFZMmhqd2JYTkVyZTlwbHRzS2pUWTU1MVdab2U4Mi9SN04yMitEOVUrNVgxQkJKVlVpQS8waERlc0NGc2QyUkhqQzcvc1J4Nzc1ZnlwbFExcjdWMXJNZWYyM0hsdkFWRlZKRjhmZzNQckg0TnoyWTNyR0dqYklmZzNZL054Rm1kSVV6d1VLeVgxWndGeXA4T21NUGJLU21IZnNFb1VpamQ5L25iMTJSdjlnMUEvTmV3a3VBeFUvZ2IwSGhhMytyMi9FcWsvM1Z3ekwwaDZkNFp6aGZYT0RkdWZHbmUvWWRMMHp5ai91SFd2UG9aMGFqL3hpR3hZaUlMRGd5elFrZTh5VjVCcHVQT2lSMUlMQ3NHYVZvKy9UTHVLeXA0K3ZtbmhuZTdtdy9OOW9sWnYwZmFsN3A3L3djPSZsdDsvZGlhZ3JhbSZndDsmbHQ7L214ZmlsZSZndDsiPgogICAgPGRlZnMvPgogICAgPGc+CiAgICAgICAgPHBhdGggZD0iTSA2MCA2MCBMIDk2LjQ3IDExNC43IiBmaWxsPSJub25lIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0ic3Ryb2tlIi8+CiAgICAgICAgPHBhdGggZD0iTSA5OS4zOCAxMTkuMDcgTCA5Mi41OCAxMTUuMTkgTCA5Ni40NyAxMTQuNyBMIDk4LjQxIDExMS4zIFoiIGZpbGw9InJnYigwLCAwLCAwKSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9ImFsbCIvPgogICAgICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMzBweDsgbWFyZ2luLWxlZnQ6IDFweDsiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGRhdGEtZHJhd2lvLWNvbG9ycz0iY29sb3I6IHJnYigwLCAwLCAwKTsgIiBzdHlsZT0iYm94LXNpemluZzogYm9yZGVyLWJveDsgZm9udC1zaXplOiAwcHg7IHRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iZGlzcGxheTogaW5saW5lLWJsb2NrOyBmb250LXNpemU6IDEycHg7IGZvbnQtZmFtaWx5OiBIZWx2ZXRpY2E7IGNvbG9yOiByZ2IoMCwgMCwgMCk7IGxpbmUtaGVpZ2h0OiAxLjI7IHBvaW50ZXItZXZlbnRzOiBhbGw7IHdoaXRlLXNwYWNlOiBub3JtYWw7IG92ZXJmbG93LXdyYXA6IG5vcm1hbDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZW5vIERlcGxveQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmxkd2lkZSBydW50aW1lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMzQiIGZpbGw9InJnYigwLCAwLCAwKSIgZm9udC1mYW1pbHk9IkhlbHZldGljYSIgZm9udC1zaXplPSIxMnB4IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj4KICAgICAgICAgICAgICAgICAgICBEZW5vIERlcGxveS4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICAgICAgPHBhdGggZD0iTSAxMzAgMTgwIEwgMTMwIDIzMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gMTMwIDIzOC44OCBMIDEyNi41IDIzMS44OCBMIDEzMCAyMzMuNjMgTCAxMzMuNSAyMzEuODggWiIgZmlsbD0icmdiKDAsIDAsIDApIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPHJlY3QgeD0iNzAiIHk9IjEyMCIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI2MCIgZmlsbD0icmdiKDI1NSwgMjU1LCAyNTUpIiBzdHJva2U9InJnYigwLCAwLCAwKSIgcG9pbnRlci1ldmVudHM9ImFsbCIvPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0wLjUgLTAuNSkiPgogICAgICAgICAgICA8c3dpdGNoPgogICAgICAgICAgICAgICAgPGZvcmVpZ25PYmplY3QgcG9pbnRlci1ldmVudHM9Im5vbmUiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHJlcXVpcmVkRmVhdHVyZXM9Imh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL2ZlYXR1cmUjRXh0ZW5zaWJpbGl0eSIgc3R5bGU9Im92ZXJmbG93OiB2aXNpYmxlOyB0ZXh0LWFsaWduOiBsZWZ0OyI+CiAgICAgICAgICAgICAgICAgICAgPGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImRpc3BsYXk6IGZsZXg7IGFsaWduLWl0ZW1zOiB1bnNhZmUgY2VudGVyOyBqdXN0aWZ5LWNvbnRlbnQ6IHVuc2FmZSBjZW50ZXI7IHdpZHRoOiAxMThweDsgaGVpZ2h0OiAxcHg7IHBhZGRpbmctdG9wOiAxNTBweDsgbWFyZ2luLWxlZnQ6IDcxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlnaHR3ZWlnaHQgT1JNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxici8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWV0YXR5cGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjEzMCIgeT0iMTU0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgTGlnaHR3ZWlnaHQgT1JNLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgICAgICA8cGF0aCBkPSJNIDEwMCAyNTUgQyAxMDAgMjQ2LjcyIDExMy40MyAyNDAgMTMwIDI0MCBDIDEzNy45NiAyNDAgMTQ1LjU5IDI0MS41OCAxNTEuMjEgMjQ0LjM5IEMgMTU2Ljg0IDI0Ny4yMSAxNjAgMjUxLjAyIDE2MCAyNTUgTCAxNjAgMzA1IEMgMTYwIDMxMy4yOCAxNDYuNTcgMzIwIDEzMCAzMjAgQyAxMTMuNDMgMzIwIDEwMCAzMTMuMjggMTAwIDMwNSBaIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cGF0aCBkPSJNIDE2MCAyNTUgQyAxNjAgMjYzLjI4IDE0Ni41NyAyNzAgMTMwIDI3MCBDIDExMy40MyAyNzAgMTAwIDI2My4yOCAxMDAgMjU1IiBmaWxsPSJub25lIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTAuNSAtMC41KSI+CiAgICAgICAgICAgIDxzd2l0Y2g+CiAgICAgICAgICAgICAgICA8Zm9yZWlnbk9iamVjdCBwb2ludGVyLWV2ZW50cz0ibm9uZSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5IiBzdHlsZT0ib3ZlcmZsb3c6IHZpc2libGU7IHRleHQtYWxpZ246IGxlZnQ7Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iZGlzcGxheTogZmxleDsgYWxpZ24taXRlbXM6IHVuc2FmZSBjZW50ZXI7IGp1c3RpZnktY29udGVudDogdW5zYWZlIGNlbnRlcjsgd2lkdGg6IDU4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMjkzcHg7IG1hcmdpbi1sZWZ0OiAxMDFweDsiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGRhdGEtZHJhd2lvLWNvbG9ycz0iY29sb3I6IHJnYigwLCAwLCAwKTsgIiBzdHlsZT0iYm94LXNpemluZzogYm9yZGVyLWJveDsgZm9udC1zaXplOiAwcHg7IHRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iZGlzcGxheTogaW5saW5lLWJsb2NrOyBmb250LXNpemU6IDEycHg7IGZvbnQtZmFtaWx5OiBIZWx2ZXRpY2E7IGNvbG9yOiByZ2IoMCwgMCwgMCk7IGxpbmUtaGVpZ2h0OiAxLjI7IHBvaW50ZXItZXZlbnRzOiBhbGw7IHdoaXRlLXNwYWNlOiBub3JtYWw7IG92ZXJmbG93LXdyYXA6IG5vcm1hbDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNRTCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vbmdvREIsIGV0Yy4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjEzMCIgeT0iMjk2IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgU1FMLC4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICAgICAgPHBhdGggZD0iTSAxOTAgNjAgTCAxNjIuODUgMTE0LjMiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJzdHJva2UiLz4KICAgICAgICA8cGF0aCBkPSJNIDE2MC41IDExOSBMIDE2MC41IDExMS4xNyBMIDE2Mi44NSAxMTQuMyBMIDE2Ni43NiAxMTQuMyBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIxMzAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMzBweDsgbWFyZ2luLWxlZnQ6IDEzMXB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgZGF0YS1kcmF3aW8tY29sb3JzPSJjb2xvcjogcmdiKDAsIDAsIDApOyAiIHN0eWxlPSJib3gtc2l6aW5nOiBib3JkZXItYm94OyBmb250LXNpemU6IDBweDsgdGV4dC1hbGlnbjogY2VudGVyOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IGZvbnQtc2l6ZTogMTJweDsgZm9udC1mYW1pbHk6IEhlbHZldGljYTsgY29sb3I6IHJnYigwLCAwLCAwKTsgbGluZS1oZWlnaHQ6IDEuMjsgcG9pbnRlci1ldmVudHM6IGFsbDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgb3ZlcmZsb3ctd3JhcDogbm9ybWFsOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsb3VkZmxhcmUgV29ya2VycwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZlcmxlc3MgZnVuY3Rpb25zCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSIxOTAiIHk9IjM0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgQ2xvdWRmbGFyZSBXb3JrZXJzLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgIDwvZz4KICAgIDxzd2l0Y2g+CiAgICAgICAgPGcgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5Ii8+CiAgICAgICAgPGEgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCwtNSkiIHhsaW5rOmhyZWY9Imh0dHBzOi8vd3d3LmRpYWdyYW1zLm5ldC9kb2MvZmFxL3N2Zy1leHBvcnQtdGV4dC1wcm9ibGVtcyIgdGFyZ2V0PSJfYmxhbmsiPgogICAgICAgICAgICA8dGV4dCB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LXNpemU9IjEwcHgiIHg9IjUwJSIgeT0iMTAwJSI+CiAgICAgICAgICAgICAgICBUZXh0IGlzIG5vdCBTVkcgLSBjYW5ub3QgZGlzcGxheQogICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgPC9hPgogICAgPC9zd2l0Y2g+Cjwvc3ZnPgo="},70160:I=>{I.exports={content:'@typegraph(\n cors=Cors(\n # ..\n ),\n)\ndef prisma_runtime(g: Graph):\n public = Policy.public()\n db = PrismaRuntime("legacy", "POSTGRES_CONN")\n user = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "email": t.email(),\n "firstname": t.string(min=2, max=2000),\n },\n name="user",\n )\n\n g.expose(\n create_user=db.create(user),\n read_user=db.find_many(user),\n find_user=db.query_raw(\n \'SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = ${id} OR email LIKE ${term} OR firstname LIKE ${term}\',\n t.struct(\n {\n "id": t.string(),\n "term": t.string(),\n }\n ),\n t.list(user),\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/prisma-runtime.py"}},93814:I=>{I.exports={content:'typegraph(\n {\n name: "prisma-runtime",\n cors: {\n // ..\n allowOrigin: ["https://metatype.dev", "http://localhost:3000"],\n },\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("legacy", "POSTGRES_CONN");\n const user = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email(),\n firstname: t.string({ min: 2, max: 2000 }, {}),\n },\n { name: "user" }\n );\n\n g.expose(\n {\n create_user: db.create(user),\n read_user: db.findMany(user),\n find_user: db.queryRaw(\n `SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = $\\{id} OR email LIKE $\\{term} OR firstname LIKE $\\{term}`,\n t.struct({\n id: t.string(),\n term: t.string(),\n }),\n t.list(user)\n ),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/prisma-runtime.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2427],{10148:(I,g,e)=>{"use strict";e.r(g),e.d(g,{assets:()=>d,contentTitle:()=>a,default:()=>c,frontMatter:()=>n,metadata:()=>t,toc:()=>l});var C=e(86070),A=e(25710),i=e(65671);const n={},a="ORM for the edge",t={id:"orm-for-the-edge/index",title:"ORM for the edge",description:"Edge computing platforms like Deno Deploy and Cloudflare Workers can provide a convenient and scalable way for developers to deploy their applications and APIs near the end-users, improving performance, reducing latency, and enhancing the user experience. Due to the resource constraints and compatibility issues (legacy libraries or specific drivers) of those environments, running a traditional Object-Relational Mapping (ORM) library might not be as easy as in normal deployments.",source:"@site/use-cases/orm-for-the-edge/index.mdx",sourceDirName:"orm-for-the-edge",slug:"/orm-for-the-edge/",permalink:"/use-cases/orm-for-the-edge/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/orm-for-the-edge/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Microservices orchestration",permalink:"/use-cases/microservice-orchestration/"},next:{title:"Programmable API gateway",permalink:"/use-cases/programmable-api-gateway/"}},d={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function s(I){const g={a:"a",h1:"h1",h2:"h2",img:"img",p:"p",...(0,A.R)(),...I.components};return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(g.h1,{id:"orm-for-the-edge",children:"ORM for the edge"}),"\n",(0,C.jsx)(g.p,{children:"Edge computing platforms like Deno Deploy and Cloudflare Workers can provide a convenient and scalable way for developers to deploy their applications and APIs near the end-users, improving performance, reducing latency, and enhancing the user experience. Due to the resource constraints and compatibility issues (legacy libraries or specific drivers) of those environments, running a traditional Object-Relational Mapping (ORM) library might not be as easy as in normal deployments."}),"\n",(0,C.jsx)(g.h2,{id:"case-study",children:"Case study"}),"\n",(0,C.jsx)("div",{className:"text-center md:float-right p-8",children:(0,C.jsx)(g.p,{children:(0,C.jsx)(g.img,{src:e(74226).A+""})})}),"\n",(0,C.jsx)(g.p,{children:"Suppose you are building a mobile app that allows users to order food from local restaurants. To provide a low-latency user experience, you want to run your server-side logic as close as possible to your users."}),"\n",(0,C.jsx)(g.p,{children:"You can deploy your functions across multiple locations on distributed edge servers. For database interactions, you may need a lightweight relay API to remains compatible with the platform and offer an efficient interface like an ORM provide."}),"\n",(0,C.jsx)(g.p,{children:"When a user makes a request to view the menu or place an order, the corresponding function running on the edge will make a request to the lightweight relay API to retrieve or modify the relevant data in the database."}),"\n",(0,C.jsx)(g.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,C.jsxs)(g.p,{children:["Metatype can act out of the box as a lightweight relay API, simplifying database interactions via HTTP/GraphQL requests, and allowing you to query your database through the ",(0,C.jsx)(g.a,{href:"/docs/reference/runtimes/prisma",children:"Prisma runtime"}),". Prisma is a well-known ORM library that provides a convenient interface to interact with PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, CockroachDB databases."]}),"\n",(0,C.jsx)(i.A,{typegraph:"prisma-runtime",python:e(70160),typescript:e(93814),query:e(29922)})]})}function c(I={}){const{wrapper:g}={...(0,A.R)(),...I.components};return g?(0,C.jsx)(g,{...I,children:(0,C.jsx)(s,{...I})}):s(I)}},65671:(I,g,e)=>{"use strict";e.d(g,{A:()=>i});var C=e(98302),A=(e(30758),e(86070));function i(I){let{python:g,typescript:e,rust:i,...n}=I;const a=[g&&{content:g.content,codeLanguage:"python",codeFileUrl:g.path},e&&{content:e.content,codeLanguage:"typescript",codeFileUrl:e.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((I=>!!I));return(0,A.jsx)(C.A,{code:0==a.length?void 0:a,...n})}},29922:I=>{var g={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"create"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"data"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}},{kind:"ObjectField",name:{kind:"Name",value:"email"},value:{kind:"StringValue",value:"john@doe.com",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"read"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"read_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"firstname"},value:{kind:"StringValue",value:"",block:!1}}]}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"find_user"},arguments:[{kind:"Argument",name:{kind:"Name",value:"term"},value:{kind:"StringValue",value:"%doe%",block:!1}},{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"StringValue",value:"",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstname"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:288}};g.loc.source={body:'mutation create {\n create_user(\n data: {\n firstname: "" # fill me\n email: "john@doe.com"\n }\n ) {\n id\n }\n}\n\nquery read {\n read_user(\n where: {\n firstname: "" # fill me\n }\n ) {\n id\n }\n find_user(term: "%doe%", id: "") {\n email\n firstname\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};function e(I,g){if("FragmentSpread"===I.kind)g.add(I.name.value);else if("VariableDefinition"===I.kind){var C=I.type;"NamedType"===C.kind&&g.add(C.name.value)}I.selectionSet&&I.selectionSet.selections.forEach((function(I){e(I,g)})),I.variableDefinitions&&I.variableDefinitions.forEach((function(I){e(I,g)})),I.definitions&&I.definitions.forEach((function(I){e(I,g)}))}var C={};function A(I,g){for(var e=0;e0;){var t=a;a=new Set,t.forEach((function(I){n.has(I)||(n.add(I),(C[I]||new Set).forEach((function(I){a.add(I)})))}))}return n.forEach((function(g){var C=A(I,g);C&&e.definitions.push(C)})),e}g.definitions.forEach((function(I){if(I.name){var g=new Set;e(I,g),C[I.name.value]=g}})),I.exports=g,I.exports.create=i(g,"create"),I.exports.read=i(g,"read")},74226:(I,g,e)=>{"use strict";e.d(g,{A:()=>C});const C="data:image/svg+xml;base64,PHN2ZyBob3N0PSI2NWJkNzExNDRlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIyNTFweCIgaGVpZ2h0PSIzMjFweCIgdmlld0JveD0iLTAuNSAtMC41IDI1MSAzMjEiIGNvbnRlbnQ9IiZsdDtteGZpbGUmZ3Q7Jmx0O2RpYWdyYW0gaWQ9JnF1b3Q7dEF4eUpDZUVWUjVvV2UyWDZEYmsmcXVvdDsgbmFtZT0mcXVvdDtQYWdlLTEmcXVvdDsmZ3Q7eFZaTmM1c3dFUDAxUHRiRGgwM2NxKzAwUGRpVHRENmtPY3F3QmsyRXhBaGhUSDk5RjVENEtIWkNPcTV6UXZ1MGk3VHY3VXFhdUt2NDlDQkpFbTFGQUd6aVdNRnA0cTRuam1OYkN3OC9KVklZeExWckpKUTAwRmdMN09odk1JNGF6V2dBYWM5UkNjRVVUZnFnTHpnSFgvVXdJcVhJKzI0SHdmcXJKaVNFQWJEekNSdWl6elJRVVkwdW5Mc1cvdzQwak16S3R2ZTFub21KY2RhWnBCRUpSTjZCM1B1SnU1SkNxSG9VbjFiQVN2WU1MM1hjdHd1enpjWWtjRFVtUU8vNFNGaW1jOVA3VW9WSkZnTE1YWnRjY1B3c0l4VXp0R3djd29tcVh6aTJwbk50dlhSbTFxWG1sakVLWTNBbGl6ckltUnY3cFR2WnhsV1dDUnhtcHhOT1JTWjl2VitkZ1NJeUJPMmw2NjNNcEJPbUdYa0FFUU91Z2c2NlFyOVlVeHMzVnNWSVlFVFJZMTk0b3VzbmJFS2J2ejBKaW50clhjVGhrT0kyT2hyZ29MTm9DMVhLbkZmSk9hT1N4ekM1NVI0SFlUbFlBeGZvc29hRWljTE00bjhiaHlaQ0d1UlpTQmJrMkVsbG1obFhOSWFCK0ZKa1BJQkE4NTlIVk1FdUlSWFZPVFozdnhZdXluTUVxZUEwaG5yWDFZMmhqd2JYTkVyZTlwbHRzS2pUWTU1MVdab2U4Mi9SN04yMitEOVUrNVgxQkJKVlVpQS8waERlc0NGc2QyUkhqQzcvc1J4Nzc1ZnlwbFExcjdWMXJNZWYyM0hsdkFWRlZKRjhmZzNQckg0TnoyWTNyR0dqYklmZzNZL054Rm1kSVV6d1VLeVgxWndGeXA4T21NUGJLU21IZnNFb1VpamQ5L25iMTJSdjlnMUEvTmV3a3VBeFUvZ2IwSGhhMytyMi9FcWsvM1Z3ekwwaDZkNFp6aGZYT0RkdWZHbmUvWWRMMHp5ai91SFd2UG9aMGFqL3hpR3hZaUlMRGd5elFrZTh5VjVCcHVQT2lSMUlMQ3NHYVZvKy9UTHVLeXA0K3ZtbmhuZTdtdy9OOW9sWnYwZmFsN3A3L3djPSZsdDsvZGlhZ3JhbSZndDsmbHQ7L214ZmlsZSZndDsiPgogICAgPGRlZnMvPgogICAgPGc+CiAgICAgICAgPHBhdGggZD0iTSA2MCA2MCBMIDk2LjQ3IDExNC43IiBmaWxsPSJub25lIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0ic3Ryb2tlIi8+CiAgICAgICAgPHBhdGggZD0iTSA5OS4zOCAxMTkuMDcgTCA5Mi41OCAxMTUuMTkgTCA5Ni40NyAxMTQuNyBMIDk4LjQxIDExMS4zIFoiIGZpbGw9InJnYigwLCAwLCAwKSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9ImFsbCIvPgogICAgICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMzBweDsgbWFyZ2luLWxlZnQ6IDFweDsiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGRhdGEtZHJhd2lvLWNvbG9ycz0iY29sb3I6IHJnYigwLCAwLCAwKTsgIiBzdHlsZT0iYm94LXNpemluZzogYm9yZGVyLWJveDsgZm9udC1zaXplOiAwcHg7IHRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iZGlzcGxheTogaW5saW5lLWJsb2NrOyBmb250LXNpemU6IDEycHg7IGZvbnQtZmFtaWx5OiBIZWx2ZXRpY2E7IGNvbG9yOiByZ2IoMCwgMCwgMCk7IGxpbmUtaGVpZ2h0OiAxLjI7IHBvaW50ZXItZXZlbnRzOiBhbGw7IHdoaXRlLXNwYWNlOiBub3JtYWw7IG92ZXJmbG93LXdyYXA6IG5vcm1hbDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZW5vIERlcGxveQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmxkd2lkZSBydW50aW1lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSI2MCIgeT0iMzQiIGZpbGw9InJnYigwLCAwLCAwKSIgZm9udC1mYW1pbHk9IkhlbHZldGljYSIgZm9udC1zaXplPSIxMnB4IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIj4KICAgICAgICAgICAgICAgICAgICBEZW5vIERlcGxveS4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICAgICAgPHBhdGggZD0iTSAxMzAgMTgwIEwgMTMwIDIzMy42MyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZS1taXRlcmxpbWl0PSIxMCIgcG9pbnRlci1ldmVudHM9InN0cm9rZSIvPgogICAgICAgIDxwYXRoIGQ9Ik0gMTMwIDIzOC44OCBMIDEyNi41IDIzMS44OCBMIDEzMCAyMzMuNjMgTCAxMzMuNSAyMzEuODggWiIgZmlsbD0icmdiKDAsIDAsIDApIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPHJlY3QgeD0iNzAiIHk9IjEyMCIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI2MCIgZmlsbD0icmdiKDI1NSwgMjU1LCAyNTUpIiBzdHJva2U9InJnYigwLCAwLCAwKSIgcG9pbnRlci1ldmVudHM9ImFsbCIvPgogICAgICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0wLjUgLTAuNSkiPgogICAgICAgICAgICA8c3dpdGNoPgogICAgICAgICAgICAgICAgPGZvcmVpZ25PYmplY3QgcG9pbnRlci1ldmVudHM9Im5vbmUiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHJlcXVpcmVkRmVhdHVyZXM9Imh0dHA6Ly93d3cudzMub3JnL1RSL1NWRzExL2ZlYXR1cmUjRXh0ZW5zaWJpbGl0eSIgc3R5bGU9Im92ZXJmbG93OiB2aXNpYmxlOyB0ZXh0LWFsaWduOiBsZWZ0OyI+CiAgICAgICAgICAgICAgICAgICAgPGRpdiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgc3R5bGU9ImRpc3BsYXk6IGZsZXg7IGFsaWduLWl0ZW1zOiB1bnNhZmUgY2VudGVyOyBqdXN0aWZ5LWNvbnRlbnQ6IHVuc2FmZSBjZW50ZXI7IHdpZHRoOiAxMThweDsgaGVpZ2h0OiAxcHg7IHBhZGRpbmctdG9wOiAxNTBweDsgbWFyZ2luLWxlZnQ6IDcxcHg7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBkYXRhLWRyYXdpby1jb2xvcnM9ImNvbG9yOiByZ2IoMCwgMCwgMCk7ICIgc3R5bGU9ImJveC1zaXppbmc6IGJvcmRlci1ib3g7IGZvbnQtc2l6ZTogMHB4OyB0ZXh0LWFsaWduOiBjZW50ZXI7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImRpc3BsYXk6IGlubGluZS1ibG9jazsgZm9udC1zaXplOiAxMnB4OyBmb250LWZhbWlseTogSGVsdmV0aWNhOyBjb2xvcjogcmdiKDAsIDAsIDApOyBsaW5lLWhlaWdodDogMS4yOyBwb2ludGVyLWV2ZW50czogYWxsOyB3aGl0ZS1zcGFjZTogbm9ybWFsOyBvdmVyZmxvdy13cmFwOiBub3JtYWw7Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Yj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlnaHR3ZWlnaHQgT1JNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxici8+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWV0YXR5cGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjEzMCIgeT0iMTU0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgTGlnaHR3ZWlnaHQgT1JNLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgICAgICA8cGF0aCBkPSJNIDEwMCAyNTUgQyAxMDAgMjQ2LjcyIDExMy40MyAyNDAgMTMwIDI0MCBDIDEzNy45NiAyNDAgMTQ1LjU5IDI0MS41OCAxNTEuMjEgMjQ0LjM5IEMgMTU2Ljg0IDI0Ny4yMSAxNjAgMjUxLjAyIDE2MCAyNTUgTCAxNjAgMzA1IEMgMTYwIDMxMy4yOCAxNDYuNTcgMzIwIDEzMCAzMjAgQyAxMTMuNDMgMzIwIDEwMCAzMTMuMjggMTAwIDMwNSBaIiBmaWxsPSJyZ2IoMjU1LCAyNTUsIDI1NSkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cGF0aCBkPSJNIDE2MCAyNTUgQyAxNjAgMjYzLjI4IDE0Ni41NyAyNzAgMTMwIDI3MCBDIDExMy40MyAyNzAgMTAwIDI2My4yOCAxMDAgMjU1IiBmaWxsPSJub25lIiBzdHJva2U9InJnYigwLCAwLCAwKSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEwIiBwb2ludGVyLWV2ZW50cz0iYWxsIi8+CiAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTAuNSAtMC41KSI+CiAgICAgICAgICAgIDxzd2l0Y2g+CiAgICAgICAgICAgICAgICA8Zm9yZWlnbk9iamVjdCBwb2ludGVyLWV2ZW50cz0ibm9uZSIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5IiBzdHlsZT0ib3ZlcmZsb3c6IHZpc2libGU7IHRleHQtYWxpZ246IGxlZnQ7Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iZGlzcGxheTogZmxleDsgYWxpZ24taXRlbXM6IHVuc2FmZSBjZW50ZXI7IGp1c3RpZnktY29udGVudDogdW5zYWZlIGNlbnRlcjsgd2lkdGg6IDU4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMjkzcHg7IG1hcmdpbi1sZWZ0OiAxMDFweDsiPgogICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGRhdGEtZHJhd2lvLWNvbG9ycz0iY29sb3I6IHJnYigwLCAwLCAwKTsgIiBzdHlsZT0iYm94LXNpemluZzogYm9yZGVyLWJveDsgZm9udC1zaXplOiAwcHg7IHRleHQtYWxpZ246IGNlbnRlcjsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iZGlzcGxheTogaW5saW5lLWJsb2NrOyBmb250LXNpemU6IDEycHg7IGZvbnQtZmFtaWx5OiBIZWx2ZXRpY2E7IGNvbG9yOiByZ2IoMCwgMCwgMCk7IGxpbmUtaGVpZ2h0OiAxLjI7IHBvaW50ZXItZXZlbnRzOiBhbGw7IHdoaXRlLXNwYWNlOiBub3JtYWw7IG92ZXJmbG93LXdyYXA6IG5vcm1hbDsiPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNRTCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1vbmdvREIsIGV0Yy4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIDwvZm9yZWlnbk9iamVjdD4KICAgICAgICAgICAgICAgIDx0ZXh0IHg9IjEzMCIgeT0iMjk2IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgU1FMLC4uLgogICAgICAgICAgICAgICAgPC90ZXh0PgogICAgICAgICAgICA8L3N3aXRjaD4KICAgICAgICA8L2c+CiAgICAgICAgPHBhdGggZD0iTSAxOTAgNjAgTCAxNjIuODUgMTE0LjMiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJzdHJva2UiLz4KICAgICAgICA8cGF0aCBkPSJNIDE2MC41IDExOSBMIDE2MC41IDExMS4xNyBMIDE2Mi44NSAxMTQuMyBMIDE2Ni43NiAxMTQuMyBaIiBmaWxsPSJyZ2IoMCwgMCwgMCkiIHN0cm9rZT0icmdiKDAsIDAsIDApIiBzdHJva2UtbWl0ZXJsaW1pdD0iMTAiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8cmVjdCB4PSIxMzAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iNjAiIGZpbGw9InJnYigyNTUsIDI1NSwgMjU1KSIgc3Ryb2tlPSJyZ2IoMCwgMCwgMCkiIHBvaW50ZXItZXZlbnRzPSJhbGwiLz4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMC41IC0wLjUpIj4KICAgICAgICAgICAgPHN3aXRjaD4KICAgICAgICAgICAgICAgIDxmb3JlaWduT2JqZWN0IHBvaW50ZXItZXZlbnRzPSJub25lIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiByZXF1aXJlZEZlYXR1cmVzPSJodHRwOi8vd3d3LnczLm9yZy9UUi9TVkcxMS9mZWF0dXJlI0V4dGVuc2liaWxpdHkiIHN0eWxlPSJvdmVyZmxvdzogdmlzaWJsZTsgdGV4dC1hbGlnbjogbGVmdDsiPgogICAgICAgICAgICAgICAgICAgIDxkaXYgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGh0bWwiIHN0eWxlPSJkaXNwbGF5OiBmbGV4OyBhbGlnbi1pdGVtczogdW5zYWZlIGNlbnRlcjsganVzdGlmeS1jb250ZW50OiB1bnNhZmUgY2VudGVyOyB3aWR0aDogMTE4cHg7IGhlaWdodDogMXB4OyBwYWRkaW5nLXRvcDogMzBweDsgbWFyZ2luLWxlZnQ6IDEzMXB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgZGF0YS1kcmF3aW8tY29sb3JzPSJjb2xvcjogcmdiKDAsIDAsIDApOyAiIHN0eWxlPSJib3gtc2l6aW5nOiBib3JkZXItYm94OyBmb250LXNpemU6IDBweDsgdGV4dC1hbGlnbjogY2VudGVyOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJkaXNwbGF5OiBpbmxpbmUtYmxvY2s7IGZvbnQtc2l6ZTogMTJweDsgZm9udC1mYW1pbHk6IEhlbHZldGljYTsgY29sb3I6IHJnYigwLCAwLCAwKTsgbGluZS1oZWlnaHQ6IDEuMjsgcG9pbnRlci1ldmVudHM6IGFsbDsgd2hpdGUtc3BhY2U6IG5vcm1hbDsgb3ZlcmZsb3ctd3JhcDogbm9ybWFsOyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsb3VkZmxhcmUgV29ya2VycwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnIvPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlcnZlcmxlc3MgZnVuY3Rpb25zCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICA8L2ZvcmVpZ25PYmplY3Q+CiAgICAgICAgICAgICAgICA8dGV4dCB4PSIxOTAiIHk9IjM0IiBmaWxsPSJyZ2IoMCwgMCwgMCkiIGZvbnQtZmFtaWx5PSJIZWx2ZXRpY2EiIGZvbnQtc2l6ZT0iMTJweCIgdGV4dC1hbmNob3I9Im1pZGRsZSI+CiAgICAgICAgICAgICAgICAgICAgQ2xvdWRmbGFyZSBXb3JrZXJzLi4uCiAgICAgICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgICAgIDwvc3dpdGNoPgogICAgICAgIDwvZz4KICAgIDwvZz4KICAgIDxzd2l0Y2g+CiAgICAgICAgPGcgcmVxdWlyZWRGZWF0dXJlcz0iaHR0cDovL3d3dy53My5vcmcvVFIvU1ZHMTEvZmVhdHVyZSNFeHRlbnNpYmlsaXR5Ii8+CiAgICAgICAgPGEgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCwtNSkiIHhsaW5rOmhyZWY9Imh0dHBzOi8vd3d3LmRpYWdyYW1zLm5ldC9kb2MvZmFxL3N2Zy1leHBvcnQtdGV4dC1wcm9ibGVtcyIgdGFyZ2V0PSJfYmxhbmsiPgogICAgICAgICAgICA8dGV4dCB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBmb250LXNpemU9IjEwcHgiIHg9IjUwJSIgeT0iMTAwJSI+CiAgICAgICAgICAgICAgICBUZXh0IGlzIG5vdCBTVkcgLSBjYW5ub3QgZGlzcGxheQogICAgICAgICAgICA8L3RleHQ+CiAgICAgICAgPC9hPgogICAgPC9zd2l0Y2g+Cjwvc3ZnPgo="},70160:I=>{I.exports={content:'@typegraph(\n cors=Cors(\n # ..\n ),\n)\ndef prisma_runtime(g: Graph):\n public = Policy.public()\n db = PrismaRuntime("legacy", "POSTGRES_CONN")\n user = t.struct(\n {\n "id": t.uuid(as_id=True, config={"auto": True}),\n "email": t.email(),\n "firstname": t.string(min=2, max=2000),\n },\n name="user",\n )\n\n g.expose(\n create_user=db.create(user),\n read_user=db.find_many(user),\n find_user=db.query_raw(\n \'SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = ${id} OR email LIKE ${term} OR firstname LIKE ${term}\',\n t.struct(\n {\n "id": t.string(),\n "term": t.string(),\n }\n ),\n t.list(user),\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/prisma-runtime.py"}},93814:I=>{I.exports={content:'typegraph(\n {\n name: "prisma-runtime",\n cors: {\n // ..\n allowOrigin: ["https://metatype.dev", "http://localhost:3000"],\n },\n },\n (g) => {\n const pub = Policy.public();\n const db = new PrismaRuntime("legacy", "POSTGRES_CONN");\n const user = t.struct(\n {\n id: t.uuid({ asId: true, config: { auto: true } }),\n email: t.email(),\n firstname: t.string({ min: 2, max: 2000 }, {}),\n },\n { name: "user" },\n );\n\n g.expose(\n {\n create_user: db.create(user),\n read_user: db.findMany(user),\n find_user: db.queryRaw(\n `SELECT id, firstname, email FROM "user" WHERE CAST(id as VARCHAR) = $\\{id} OR email LIKE $\\{term} OR firstname LIKE $\\{term}`,\n t.struct({\n id: t.string(),\n term: t.string(),\n }),\n t.list(user),\n ),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/prisma-runtime.ts"}}}]); \ No newline at end of file diff --git a/assets/js/c843538e.c8c7375e.js b/assets/js/c843538e.66f0ff3a.js similarity index 97% rename from assets/js/c843538e.c8c7375e.js rename to assets/js/c843538e.66f0ff3a.js index 589115017b..7a0058425e 100644 --- a/assets/js/c843538e.c8c7375e.js +++ b/assets/js/c843538e.66f0ff3a.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2384],{15404:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>u,toc:()=>l});var a=t(86070),i=t(25710),s=t(65671);const o={},r="Cloud function runner",u={id:"faas-runner/index",title:"Cloud function runner",description:"A Function-as-a-Service (FaaS) runner is a platform that allows developers to deploy and run small, single-purpose functions in the cloud. FaaS runners typically provide a serverless architecture, which means that developers do not have to worry about infrastructure management or the scaling, as the platform automatically handles these tasks.",source:"@site/use-cases/faas-runner/index.mdx",sourceDirName:"faas-runner",slug:"/faas-runner/",permalink:"/use-cases/faas-runner/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/faas-runner/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Backend for frontend",permalink:"/use-cases/backend-for-frontend/"},next:{title:"Composable GraphQL server",permalink:"/use-cases/graphql-server/"}},c={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function d(e){const n={h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"cloud-function-runner",children:"Cloud function runner"}),"\n",(0,a.jsx)(n.p,{children:"A Function-as-a-Service (FaaS) runner is a platform that allows developers to deploy and run small, single-purpose functions in the cloud. FaaS runners typically provide a serverless architecture, which means that developers do not have to worry about infrastructure management or the scaling, as the platform automatically handles these tasks."}),"\n",(0,a.jsx)(n.h2,{id:"case-study",children:"Case study"}),"\n",(0,a.jsx)("div",{className:"text-center md:float-right p-8",children:(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{src:t(83758).A+""})})}),"\n",(0,a.jsx)(n.p,{children:"For example, imagine you have an e-commerce application that uses FaaS to process orders. When a customer places an order, multiple functions may need to be executed, such as validating the order, processing the payment, and updating the inventory."}),"\n",(0,a.jsx)(n.p,{children:"Each function may be executed independently by the FaaS platform and may take varying amounts of time to complete. Those functions may also be executed for historical reason on different platforms like AWS Lambda, Google Cloud Functions, or Azure Functions."}),"\n",(0,a.jsx)(n.p,{children:"To collect the results of all the functions in a timely manner, you need to ensure that each function is executed in the correct order and that you are not waiting for a slow function to complete before moving on to the next function."}),"\n",(0,a.jsx)(n.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,a.jsx)(n.p,{children:"To solve the use case of executing multiple functions and collecting their results, Metatype provides two key features."}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Function composition/chaining: functions can be chained together to form a pipeline. The output of one function can be used as the input of the next function in the pipeline. This allows us to execute multiple functions in a specific order."}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Embedded runner: you can easily write a function that glues together multiple functions and executes them in a specific order. This allows you to execute multiple functions in a specific order. Currently, both Python and Typescript are supported."}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.A,{typegraph:"faas-runner",python:t(49099),typescript:t(13589),query:t(20256)})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var a=t(98302),i=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...o}=e;const r=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,i.jsx)(a.A,{code:0==r.length?void 0:r,...o})}},20256:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pycumsum"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"5"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"tscumsum"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"5"}}],directives:[]}]}}],loc:{start:0,end:45}};n.loc.source={body:"query {\n pycumsum(n: 5)\n\n tscumsum(n: 5)\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n},83758:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});const a=t.p+"assets/images/image.drawio-1eac40d204b6d3f2e3f634e3bd1b86b1.svg"},49099:e=>{e.exports={content:'@typegraph(\n)\ndef faas_runner(g: Graph):\n public = Policy.public()\n\n deno = DenoRuntime()\n python = PythonRuntime()\n\n inp = t.struct({"n": t.integer(min=0, max=100)})\n out = t.integer()\n\n g.expose(\n pycumsum=python.from_lambda(inp, out, lambda inp: sum(range(inp["n"]))),\n tscumsum=deno.func(\n inp,\n out,\n code="({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/faas-runner.py"}},13589:e=>{e.exports={content:'typegraph(\n {\n name: "faas-runner",\n },\n (g) => {\n const pub = Policy.public();\n\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n\n const inp = t.struct({ n: t.integer({ min: 0, max: 100 }) });\n const out = t.integer();\n\n g.expose(\n {\n pycumsum: python.fromLambda(inp, out, {\n code: `lambda inp: sum(range(inp[\'n\']))`,\n }),\n tscumsum: deno.func(inp, out, {\n code: "({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/faas-runner.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2384],{15404:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>u,toc:()=>l});var a=t(86070),i=t(25710),s=t(65671);const o={},r="Cloud function runner",u={id:"faas-runner/index",title:"Cloud function runner",description:"A Function-as-a-Service (FaaS) runner is a platform that allows developers to deploy and run small, single-purpose functions in the cloud. FaaS runners typically provide a serverless architecture, which means that developers do not have to worry about infrastructure management or the scaling, as the platform automatically handles these tasks.",source:"@site/use-cases/faas-runner/index.mdx",sourceDirName:"faas-runner",slug:"/faas-runner/",permalink:"/use-cases/faas-runner/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/use-cases/faas-runner/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"useCases",previous:{title:"Backend for frontend",permalink:"/use-cases/backend-for-frontend/"},next:{title:"Composable GraphQL server",permalink:"/use-cases/graphql-server/"}},c={},l=[{value:"Case study",id:"case-study",level:2},{value:"Metatype's solution",id:"metatypes-solution",level:2}];function d(e){const n={h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"cloud-function-runner",children:"Cloud function runner"}),"\n",(0,a.jsx)(n.p,{children:"A Function-as-a-Service (FaaS) runner is a platform that allows developers to deploy and run small, single-purpose functions in the cloud. FaaS runners typically provide a serverless architecture, which means that developers do not have to worry about infrastructure management or the scaling, as the platform automatically handles these tasks."}),"\n",(0,a.jsx)(n.h2,{id:"case-study",children:"Case study"}),"\n",(0,a.jsx)("div",{className:"text-center md:float-right p-8",children:(0,a.jsx)(n.p,{children:(0,a.jsx)(n.img,{src:t(83758).A+""})})}),"\n",(0,a.jsx)(n.p,{children:"For example, imagine you have an e-commerce application that uses FaaS to process orders. When a customer places an order, multiple functions may need to be executed, such as validating the order, processing the payment, and updating the inventory."}),"\n",(0,a.jsx)(n.p,{children:"Each function may be executed independently by the FaaS platform and may take varying amounts of time to complete. Those functions may also be executed for historical reason on different platforms like AWS Lambda, Google Cloud Functions, or Azure Functions."}),"\n",(0,a.jsx)(n.p,{children:"To collect the results of all the functions in a timely manner, you need to ensure that each function is executed in the correct order and that you are not waiting for a slow function to complete before moving on to the next function."}),"\n",(0,a.jsx)(n.h2,{id:"metatypes-solution",children:"Metatype's solution"}),"\n",(0,a.jsx)(n.p,{children:"To solve the use case of executing multiple functions and collecting their results, Metatype provides two key features."}),"\n",(0,a.jsxs)(n.ol,{children:["\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Function composition/chaining: functions can be chained together to form a pipeline. The output of one function can be used as the input of the next function in the pipeline. This allows us to execute multiple functions in a specific order."}),"\n"]}),"\n",(0,a.jsxs)(n.li,{children:["\n",(0,a.jsx)(n.p,{children:"Embedded runner: you can easily write a function that glues together multiple functions and executes them in a specific order. This allows you to execute multiple functions in a specific order. Currently, both Python and Typescript are supported."}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.A,{typegraph:"faas-runner",python:t(49099),typescript:t(13589),query:t(20256)})]})}function p(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(d,{...e})}):d(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var a=t(98302),i=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...o}=e;const r=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,i.jsx)(a.A,{code:0==r.length?void 0:r,...o})}},20256:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pycumsum"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"5"}}],directives:[]},{kind:"Field",name:{kind:"Name",value:"tscumsum"},arguments:[{kind:"Argument",name:{kind:"Name",value:"n"},value:{kind:"IntValue",value:"5"}}],directives:[]}]}}],loc:{start:0,end:45}};n.loc.source={body:"query {\n pycumsum(n: 5)\n\n tscumsum(n: 5)\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 a=e.type;"NamedType"===a.kind&&n.add(a.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 a={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n},83758:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});const a=t.p+"assets/images/image.drawio-1eac40d204b6d3f2e3f634e3bd1b86b1.svg"},49099:e=>{e.exports={content:'@typegraph(\n)\ndef faas_runner(g: Graph):\n public = Policy.public()\n\n deno = DenoRuntime()\n python = PythonRuntime()\n\n inp = t.struct({"n": t.integer(min=0, max=100)})\n out = t.integer()\n\n g.expose(\n pycumsum=python.from_lambda(inp, out, lambda inp: sum(range(inp["n"]))),\n tscumsum=deno.func(\n inp,\n out,\n code="({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",\n ),\n default_policy=[public],\n )',path:"../examples/typegraphs/faas-runner.py"}},13589:e=>{e.exports={content:'typegraph(\n {\n name: "faas-runner",\n },\n (g) => {\n const pub = Policy.public();\n\n const deno = new DenoRuntime();\n const python = new PythonRuntime();\n\n const inp = t.struct({ n: t.integer({ min: 0, max: 100 }) });\n const out = t.integer();\n\n g.expose(\n {\n pycumsum: python.fromLambda(inp, out, {\n code: `lambda inp: sum(range(inp[\'n\']))`,\n }),\n tscumsum: deno.func(inp, out, {\n code:\n "({n}) => Array.from(Array(5).keys()).reduce((sum, e) => sum + e, 0)",\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/faas-runner.ts"}}}]); \ No newline at end of file diff --git a/assets/js/cd86e9b3.81e49972.js b/assets/js/cd86e9b3.81e49972.js new file mode 100644 index 0000000000..a41a646611 --- /dev/null +++ b/assets/js/cd86e9b3.81e49972.js @@ -0,0 +1 @@ +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4947],{98143:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>p});var r=t(86070),s=t(25710),i=t(65671),a=t(7871);const o={},l=void 0,d={id:"reference/metagen/index",title:"index",description:"/typegrap/typegraphh---",source:"@site/docs/reference/metagen/index.mdx",sourceDirName:"reference/metagen",slug:"/reference/metagen/",permalink:"/docs/reference/metagen/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/metagen/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Changelog",permalink:"/docs/reference/changelog"},next:{title:"Features overview",permalink:"/docs/concepts/features-overview/"}},c={},p=[{value:"Access through CLI",id:"access-through-cli",level:2},{value:"Access through SDK",id:"access-through-sdk",level:2},{value:"Generators",id:"generators",level:2},{value:"client_ts",id:"client_ts",level:3},{value:"client_py",id:"client_py",level:3},{value:"client_rs",id:"client_rs",level:3},{value:"fdk_typescript",id:"fdk_typescript",level:3},{value:"fdk_python",id:"fdk_python",level:3},{value:"fdk_rust",id:"fdk_rust",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components},{Details:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"/typegrap/typegraphh---\nsidebar_position: 50"}),"\n",(0,r.jsx)(n.hr,{}),"\n","\n",(0,r.jsx)(n.h1,{id:"metagen",children:"Metagen"}),"\n",(0,r.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,r.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,r.jsx)(n.p,{children:"Metagen is a code-generator suite that contains implementations that help with development on the Metatype platform. Today, this means a set of generators to:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Generate code-first, typesafe clients for your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:["Help with ",(0,r.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom functions"})," by generating types, serializers and bindings."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["It's availaible bundled within the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," and the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph#sdks",children:"typegraph SDKs"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"access-through-cli",children:"Access through CLI"}),"\n",(0,r.jsxs)(n.p,{children:["The meta-cli has a dedicated ",(0,r.jsx)(n.code,{children:"gen"})," command for interacting with metagen. We configure the generators through the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli/configuration-file",children:"standard configuration file"})," under the metagen key."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'typegates:\n # bla bla\n\ntypegraphs:\n # bla bla\n\nmetagen:\n targets:\n main:\n # generator to use\n - generator: fdk_rust\n # path to generate to\n path: ./bff/\n # typegraph path to use\n typegraph_path: ./typegraphs/svc-bff.ts\n # we can have multiple generators per target\n - generator: fdk_rust\n path: ./telemetry/\n typegraph_path: ./typegraphs/svc-telemetry.ts\n # generators might have custom keys\n stubbed_runtimes: ["wasm_wire", "deno"]\n # more than one targets avail if you need them\n iter:\n - generator: client_ts\n path: ./next_app/\n # name of typegraph to read from typegate\n typegraph: svc_bff\n'})}),"\n",(0,r.jsx)(n.p,{children:"This allows us to invoke the targets from the CLI."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"meta cli gen main\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This will resolve the requisite typegraphs, serialize as needed and put the resulting files at the appropriate locations. If no target name is provied, the CLI will look for a target under the key ",(0,r.jsx)(n.code,{children:"main"})," and invoke it instead."]}),"\n",(0,r.jsx)(n.h2,{id:"access-through-sdk",children:"Access through SDK"}),"\n",(0,r.jsx)(n.p,{children:"Metagen is availaible through the SDK for programmatic access needs and can be helpful when writing tests or when relying on the CLI is not an option."}),"\n",(0,r.jsx)(i.A,{python:t(7797),typescript:t(19507),disablePlayground:!0}),"\n",(0,r.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,r.jsxs)(n.admonition,{title:"Chicken or the egg?",type:"info",children:[(0,r.jsx)(n.p,{children:"As most of the generators are intended for types to be used by custom functions, they'll require that you declare the custom functions in your typegraph first. This begs the question, how does one declare custom functions that depend on artifacts that are yet to be generated? Typegraphs error out when referenced artifacts aren't found, how does it work in this scenario?"}),(0,r.jsxs)(n.p,{children:["To resolve this concern, the SDKs support a serialization mode that skips resolution of artifacts. This mode is activated when serialization is done for codegen purposes. What this means is that, ",(0,r.jsx)(n.strong,{children:"you can declare non-existent files in your typegraph and codegen should work"}),". Some generators are even smart enough to work around your expected files. Of course, if the files aren't present when you're trying to deply to the typegate, it'll raise an error."]})]}),"\n",(0,r.jsx)(n.h3,{id:"client_ts",children:(0,r.jsx)(n.code,{children:"client_ts"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API",children:(0,r.jsx)(n.code,{children:"fetch"})})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Requires Node.js version ",(0,r.jsx)(n.code,{children:"v17.5.0"})," and ",(0,r.jsx)(n.a,{href:"https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch",children:"up"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Requires using ",(0,r.jsx)(n.code,{children:"--experimental-fetch"})," flag if on Node.js version below v18.0.0"]}),"\n",(0,r.jsx)(n.li,{children:"Provides async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"client_py",children:(0,r.jsx)(n.code,{children:"client_py"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"urlib"})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Provides sync and async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"client_rs",children:(0,r.jsx)(n.code,{children:"client_rs"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://lib.rs/crates/reqwest",children:(0,r.jsx)(n.code,{children:"reqwest"})})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Provides sync and async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_typescript",children:(0,r.jsx)(n.code,{children:"fdk_typescript"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Typescript types that map to typegraph types"}),"\n",(0,r.jsxs)(n.li,{children:["Stub function types for custom functions implementors that adhere to typegraph functions.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all function types from the ",(0,r.jsx)(n.code,{children:"DenoRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["Use ",(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," to select which runtimes get stubs."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"#client_ts",children:(0,r.jsx)(n.code,{children:"client_ts"})})," based typegraph client","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Special ",(0,r.jsx)(n.code,{children:"HostcallTransport"})," implementation"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{python:t(14037),typescript:t(14037),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(i.A,{typescript:t(13246),disablePlayground:!0}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample."})}),(0,r.jsx)(i.A,{typescript:t(96280),disablePlayground:!0})]}),"\n",(0,r.jsx)(n.p,{children:"It supports the following extra configuration keys."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Key"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"stubbed_runtimes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:'["deno"]'})}),(0,r.jsx)(n.td,{children:"Runtimes for which to generate stub types."})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_python",children:(0,r.jsx)(n.code,{children:"fdk_python"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Python classes that map to typegraph types"}),"\n",(0,r.jsxs)(n.li,{children:["Decorators for custom functions implementors that require adherance to typegraph function types.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all functions from the ",(0,r.jsx)(n.code,{children:"PythonRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["TODO: ",(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," for ",(0,r.jsx)(n.code,{children:"fdk_python"})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"TODO: types for interacting with the typegate from within custom functions."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"If the referenced module for the custom function is not found, the generator will also output stub implementation (in addition to the types) at the given type. It will not replace our code on a second run."}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{typescript:t(62292),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(i.A,{python:t(28434),disablePlayground:!0}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample."})}),(0,r.jsx)(i.A,{python:t(95696),disablePlayground:!0})]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_rust",children:(0,r.jsx)(n.code,{children:"fdk_rust"})}),"\n",(0,r.jsx)(n.p,{children:"This generator generates types, serializers and bindings needed to implement custom functions in Rust. Rust implementations will need to be compiled to wasm components to be executed on the metatype platform and the generator assumes such usage."}),"\n",(0,r.jsx)(n.p,{children:"To be more specific, it supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Rust types that map to typegraph defined types","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Serialization is handled out of sight through ",(0,r.jsx)(n.a,{href:"https://lib.rs/serde_json",children:(0,r.jsx)(n.code,{children:"serde_json"})})]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["Stub traits for custom functions implementors that adhere to typegraph functions.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all functions from the ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["The generator assumes the ",(0,r.jsx)(n.code,{children:"wire"})," based wasm interface is being targetted."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," key can be used to configure stub generation from additional runtimes."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Types for interacting with the typegate from within custom functions."}),"\n",(0,r.jsxs)(n.li,{children:["Glue code for setting up the wasm component to be run within the ",(0,r.jsx)(n.code,{children:"WasmRuntime"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"By default the generator will also output a library crate entrypoint and a functional Cargo.toml with all the required dependencies. These additional files wlil not be overwritten on a second run. The generator can also be configured to avoid generating them even if not present."}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{python:t(28054),typescript:t(86016),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(a.A,{language:"rust",children:t(39028).content}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:"Code generation sample."}),(0,r.jsx)(a.A,{language:"rust",children:t(86496).content})]}),"\n",(0,r.jsx)(n.p,{children:"It supports the following extra configuration keys."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Key"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"stubbed_runtimes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:'["wasm_wire"]'})}),(0,r.jsx)(n.td,{children:"Runtimes for which to generate stub types."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"crate_name"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"${typegraphName}_fdk"})}),(0,r.jsxs)(n.td,{children:["Name to assign to crate when generating ",(0,r.jsx)(n.code,{children:"Cargo.toml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"skip_cargo_toml"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Do not generate ",(0,r.jsx)(n.code,{children:"Cargo.toml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"skip_lib_rs"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Do not generate ",(0,r.jsx)(n.code,{children:"lib.rs"}),", the sample entrypoint."]})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var r=t(98302),s=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...a}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,s.jsx)(r.A,{code:0==o.length?void 0:o,...a})}},14037:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_deno(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-deno.py"}},62292:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-py",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n const python = new PythonRuntime();\n\n g.expose(\n {\n remix: python\n .import(idv3, idv3, {\n module: "./metagen/py/remix.py",\n deps: ["./metagen/py/remix_types.py"],\n name: "remix_track",\n })\n .rename("remix_track"), // explicit names help\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/metagen-py.ts"}},28054:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_rs(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n\n # the wire flavour is availible through a static\n # constructor\n wasm = WasmRuntime.wire("metagen/rust.wasm")\n\n g.expose(\n Policy.public(),\n remix=wasm.handler(\n idv3,\n idv3,\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-rs.py"}},86016:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-rs",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n // the wire flavour is availible through a static\n // constructor\n const wasm = WasmRuntime.wire("metagen/rust.wasm");\n\n g.expose(\n {\n remix: wasm\n .handler(\n idv3,\n idv3,\n {\n name: "remix_track",\n },\n // the traits will map to the name of the materializer\n // and also the the name of the handler mentioned above\n )\n .rename("remix_track"),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/metagen-rs.ts"}},7797:e=>{e.exports={content:'import os\nfrom typegraph.graph.metagen import Metagen\n\n\n@typegraph(\n)\ndef metagen_sdk(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"),\n )\n\n\nif __name__ == "__main__" and False:\n metagen = Metagen(\n # the workspace root that our config is relative to\n os.path.dirname(os.path.abspath(__file__)),\n # the rest is pretty similar to the CLI config\n {\n "targets": {\n "main": [\n {\n "generator": "fdk_typescript",\n "typegraph_path": __file__,\n "path": "funcs/",\n },\n ],\n },\n },\n )\n tg = metagen_sdk()\n # dry_run doesn\'t write to disk\n items = metagen.dry_run(tg, "main", None)',path:"../examples/typegraphs/metagen-sdk.py"}},19507:e=>{e.exports={content:'// Copyright Metatype O\xdc, licensed under the Mozilla Public License Version 2.0.\n// SPDX-License-Identifier: MPL-2.0\n\nimport { Metagen } from "@typegraph/sdk/metagen.ts";\n\n// get typegraph desc here\nconst tg = await typegraph(\n {\n name: "metagen-sdk",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n })\n .rename("idv3");\n\n const deno = new DenoRuntime();\n\n g.expose(\n {\n remix: deno\n .import(idv3, idv3, {\n module: "./metagen/ts/remix.ts",\n deps: ["./metagen/ts/fdk.ts"],\n name: "remix_track",\n })\n .rename("remix_track"),\n },\n Policy.public(),\n );\n },\n);\n\n// deno-lint-ignore no-constant-condition\nif (false) {\n const myPath = import.meta.url.replace("file://", "");\n const metagen = new Metagen(\n // the workspace root that our config is relative to\n myPath + "/..",\n // this rest of the config is similmilar to the CLI config\n {\n targets: {\n main: [\n {\n generator: "fdk_typescript",\n typegraph_path: myPath,\n path: "funcs/",\n },\n ],\n },\n },\n );\n // dry_run doesn\'t write to disk\n metagen.dryRun(tg, "main");\n}',path:"../examples/typegraphs/metagen-sdk.ts"}},28434:e=>{e.exports={content:'from .remix_types import typed_remix_track, Idv3\n\n\n# the following decorator makes sure your function\n# adheres to the function types from the typegraph\n@typed_remix_track\ndef remix_track(inp: Idv3) -> Idv3:\n return Idv3(\n title=f"{inp.title} (Remix)",\n artist=f"{inp.artist} + DJ Cloud",\n releaseTime=inp.releaseTime,\n mp3Url="https://mp3.url/remix1",\n )',path:"../examples/typegraphs/metagen/py/remix.py"}},95696:e=>{e.exports={content:'from types import NoneType\nfrom typing import Callable, List, Union, get_origin, ForwardRef, Any\nfrom dataclasses import dataclass, asdict, fields\n\nFORWARD_REFS = {}\n\n\nclass Struct:\n def repr(self):\n return asdict(self)\n\n @staticmethod\n def try_new(dt_class, val: Any):\n # Object\n ftypes = {f.name: f.type for f in fields(dt_class)}\n attrs = {}\n for f in val:\n fval = val[f]\n ftype = ftypes[f]\n serialized = False\n # Union\n if get_origin(ftype) is Union:\n try:\n attrs[f] = Struct.try_union(ftype.__args__, fval)\n serialized = True\n except Exception:\n pass\n # List\n elif get_origin(ftype) is list:\n try:\n attrs[f] = Struct.try_typed_list(ftype.__args__, fval)\n serialized = True\n except Exception:\n pass\n # Any\n if not serialized:\n if isinstance(ftype, str) and ftype in FORWARD_REFS:\n klass = FORWARD_REFS[ftype]\n attrs[f] = Struct.new(klass, fval)\n else:\n attrs[f] = Struct.new(ftype, fval)\n return dt_class(**attrs)\n\n @staticmethod\n def try_typed_list(tpe: Any, items: Any):\n hint = tpe.__args__[0]\n klass = (\n FORWARD_REFS[hint.__forward_arg__] if isinstance(hint, ForwardRef) else hint\n )\n return [Struct.new(klass, v) for v in items]\n\n @staticmethod\n def try_union(variants: List[Any], val: Any):\n errors = []\n for variant in variants:\n try:\n if variant is NoneType:\n if val is None:\n return None\n else:\n continue\n if get_origin(variant) is list:\n if isinstance(val, list):\n return Struct.try_typed_list(variant, val)\n else:\n continue\n klass = FORWARD_REFS[variant.__forward_arg__]\n return Struct.try_new(klass, val)\n except Exception as e:\n errors.append(str(e))\n raise Exception("\\n".join(errors))\n\n @staticmethod\n def new(dt_class: Any, val: Any):\n try:\n return Struct.try_new(dt_class, val)\n except Exception:\n return val\n\n\n@dataclass\nclass Idv3(Struct):\n title: str\n artist: str\n releaseTime: str\n mp3Url: str\n\n\nFORWARD_REFS["Idv3"] = Idv3\n\n\ndef __repr(value: Any):\n if isinstance(value, Struct):\n return value.repr()\n return value\n\n\ndef typed_remix_track(user_fn: Callable[[Idv3], Idv3]):\n def exported_wrapper(raw_inp):\n inp: Idv3 = Struct.new(Idv3, raw_inp)\n out: Idv3 = user_fn(inp)\n if isinstance(out, list):\n return [__repr(v) for v in out]\n return __repr(out)\n\n return exported_wrapper',path:"../examples/typegraphs/metagen/py/remix_types.py"}},86496:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n#![cfg_attr(rustfmt, rustfmt_skip)]\n\n// gen-static-start\n#![allow(dead_code)]\n\npub mod wit {\n wit_bindgen::generate!({\n pub_export_macro: true,\n \n inline: "package metatype:wit-wire;\n\ninterface typegate-wire {\n hostcall: func(op-name: string, json: string) -> result;\n}\n\ninterface mat-wire {\n type json-str = string;\n\n record mat-info {\n op-name: string,\n mat-title: string,\n mat-hash: string,\n mat-data-json: string,\n }\n\n record init-args {\n metatype-version: string,\n expected-ops: list\n }\n\n record init-response {\n ok: bool\n }\n\n variant init-error {\n version-mismatch(string),\n unexpected-mat(mat-info),\n other(string)\n }\n\n init: func(args: init-args) -> result;\n\n record handle-req {\n op-name: string,\n in-json: json-str,\n }\n\n variant handle-err {\n no-handler,\n in-json-err(string),\n handler-err(string),\n }\n\n handle: func(req: handle-req) -> result;\n}\n\nworld wit-wire {\n import typegate-wire;\n\n export mat-wire;\n}\n"\n });\n}\n\nuse std::cell::RefCell;\nuse std::collections::HashMap;\n\nuse wit::exports::metatype::wit_wire::mat_wire::*;\nuse wit::metatype::wit_wire::typegate_wire::hostcall;\n\npub type HandlerFn = Box Result>;\n\npub struct ErasedHandler {\n mat_id: String,\n mat_trait: String,\n mat_title: String,\n handler_fn: HandlerFn,\n}\n\npub struct MatBuilder {\n handlers: HashMap,\n}\n\nimpl MatBuilder {\n pub fn new() -> Self {\n Self {\n handlers: Default::default(),\n }\n }\n\n pub fn register_handler(mut self, handler: ErasedHandler) -> Self {\n self.handlers.insert(handler.mat_trait.clone(), handler);\n self\n }\n}\n\npub struct Router {\n handlers: HashMap,\n}\n\nimpl Router {\n pub fn from_builder(builder: MatBuilder) -> Self {\n Self {\n handlers: builder.handlers,\n }\n }\n\n pub fn init(&self, args: InitArgs) -> Result {\n static MT_VERSION: &str = "0.5.0-rc.6";\n if args.metatype_version != MT_VERSION {\n return Err(InitError::VersionMismatch(MT_VERSION.into()));\n }\n for info in args.expected_ops {\n let mat_trait = stubs::op_to_trait_name(&info.op_name);\n if !self.handlers.contains_key(mat_trait) {\n return Err(InitError::UnexpectedMat(info));\n }\n }\n Ok(InitResponse { ok: true })\n }\n\n pub fn handle(&self, req: HandleReq) -> Result {\n let mat_trait = stubs::op_to_trait_name(&req.op_name);\n let Some(handler) = self.handlers.get(mat_trait) else {\n return Err(HandleErr::NoHandler);\n };\n let cx = Ctx {};\n (handler.handler_fn)(&req.in_json, cx)\n }\n}\n\npub type InitCallback = fn() -> anyhow::Result;\n\nthread_local! {\n pub static MAT_STATE: RefCell = panic!("MAT_STATE has not been initialized");\n}\n\npub struct Ctx {}\n\nimpl Ctx {\n pub fn gql(\n &self,\n query: &str,\n variables: impl Into,\n ) -> Result\n where\n O: serde::de::DeserializeOwned,\n {\n match hostcall(\n "gql",\n &serde_json::to_string(&serde_json::json!({\n "query": query,\n "variables": variables.into(),\n }))?,\n ) {\n Ok(json) => Ok(serde_json::from_str(&json[..])?),\n Err(json) => Err(GraphqlRunError::HostError(serde_json::from_str(&json)?)),\n }\n }\n}\n\n#[derive(Debug)]\npub enum GraphqlRunError {\n JsonError(serde_json::Error),\n HostError(serde_json::Value),\n}\n\nimpl std::error::Error for GraphqlRunError {}\n\nimpl From for GraphqlRunError {\n fn from(value: serde_json::Error) -> Self {\n Self::JsonError(value)\n }\n}\n\nimpl std::fmt::Display for GraphqlRunError {\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n match self {\n GraphqlRunError::JsonError(msg) => write!(f, "json error: {msg}"),\n GraphqlRunError::HostError(serde_json::Value::Object(map))\n if map.contains_key("message") =>\n {\n write!(f, "host error: {}", map["message"])\n }\n GraphqlRunError::HostError(val) => write!(f, "host error: {val:?}"),\n }\n }\n}\n\n#[macro_export]\nmacro_rules! init_mat {\n (hook: $init_hook:expr) => {\n struct MatWireGuest;\n use wit::exports::metatype::wit_wire::mat_wire::*;\n wit::export!(MatWireGuest with_types_in wit);\n\n #[allow(unused)]\n impl Guest for MatWireGuest {\n fn handle(req: HandleReq) -> Result {\n MAT_STATE.with(|router| {\n let router = router.borrow();\n router.handle(req)\n })\n }\n\n fn init(args: InitArgs) -> Result {\n let hook = $init_hook;\n let router = Router::from_builder(hook());\n let resp = router.init(args)?;\n MAT_STATE.set(router);\n Ok(resp)\n }\n }\n };\n}\n// gen-static-end\nuse types::*;\npub mod types {\n pub type Idv3TitleString = String;\n pub type Idv3ReleaseTimeStringDatetime = String;\n pub type Idv3Mp3UrlStringUri = String;\n #[derive(Debug, serde::Serialize, serde::Deserialize)]\n pub struct Idv3 {\n pub title: Idv3TitleString,\n pub artist: Idv3TitleString,\n #[serde(rename = "releaseTime")]\n pub release_time: Idv3ReleaseTimeStringDatetime,\n #[serde(rename = "mp3Url")]\n pub mp3_url: Idv3Mp3UrlStringUri,\n }\n}\npub mod stubs {\n use super::*;\n pub trait RemixTrack: Sized + \'static {\n fn erased(self) -> ErasedHandler {\n ErasedHandler {\n mat_id: "remix_track".into(),\n mat_title: "remix_track".into(),\n mat_trait: "RemixTrack".into(),\n handler_fn: Box::new(move |req, cx| {\n let req = serde_json::from_str(req)\n .map_err(|err| HandleErr::InJsonErr(format!("{err}")))?;\n let res = self\n .handle(req, cx)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))?;\n serde_json::to_string(&res)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))\n }),\n }\n }\n\n fn handle(&self, input: Idv3, cx: Ctx) -> anyhow::Result;\n }\n pub fn op_to_trait_name(op_name: &str) -> &\'static str {\n match op_name {\n "remix_track" => "RemixTrack",\n _ => panic!("unrecognized op_name: {op_name}"),\n }\n }\n}',path:"../examples/typegraphs/metagen/rs/fdk.rs"}},39028:e=>{e.exports={content:'mod fdk;\npub use fdk::*;\n\n// the macro sets up all the glue\ninit_mat! {\n // the hook is expected to return a MatBuilder instance\n hook: || {\n // initialize global stuff here if you need it\n MatBuilder::new()\n // register function handlers here\n // each trait will map to the name of the\n // handler found in the typegraph\n .register_handler(stubs::RemixTrack::erased(MyMat))\n }\n}\n\nstruct MyMat;\n\nimpl stubs::RemixTrack for MyMat {\n fn handle(&self, input: types::Idv3, _cx: Ctx) -> anyhow::Result {\n Ok(types::Idv3 {\n title: format!("{} (Remix)", input.title),\n artist: format!("{} + DJ Cloud", input.artist),\n release_time: input.release_time,\n mp3_url: "https://mp3.url/shumba2".to_string(),\n })\n }\n}',path:"../examples/typegraphs/metagen/rs/lib.rs"}},96280:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n\nexport type Ctx = {\n parent?: Record;\n /**\n * Request context extracted by auth extractors.\n */\n context?: Record;\n secrets: Record;\n effect: "create" | "update" | "delete" | "read" | undefined | null;\n meta: {\n url: string;\n token: string;\n };\n headers: Record;\n};\n\n/**\n * Access features on your typegraph deployment.\n */\nexport type Deployment = {\n gql: (query: readonly string[], ...args: unknown[]) => {\n run: (\n variables: Record,\n ) => Promise>;\n };\n};\n\nexport type Handler = (\n input: In,\n ctx: Ctx,\n tg: Deployment,\n) => Out | Promise;\n\nexport type StringDateTime = string;\nexport type StringUri = string;\nexport type Idv3 = {\n title: string;\n artist: string;\n releaseTime: StringDateTime;\n mp3Url: StringUri;\n};\n\nexport type RemixTrackHandler = Handler;',path:"../examples/typegraphs/metagen/ts/fdk.ts"}},13246:e=>{e.exports={content:'import type { Ctx, Idv3, RemixTrackHandler } from "./fdk.ts";\n\n// the name of the export must match the one referred int he typegraph\nexport const remix_track: RemixTrackHandler = (inp, cx: Ctx) => {\n const out: Idv3 = {\n title: `${inp.title} (Remix)`,\n artist: `${inp.artist} + DJ Cloud`,\n releaseTime: new Date().toISOString(),\n // S3Runtime could be used to really provide this service\n mp3Url: `${cx.meta.url}/get_mp3`,\n };\n return out;\n};',path:"../examples/typegraphs/metagen/ts/remix.ts"}}}]); \ No newline at end of file diff --git a/assets/js/cd86e9b3.d39e3910.js b/assets/js/cd86e9b3.d39e3910.js deleted file mode 100644 index 8218f51489..0000000000 --- a/assets/js/cd86e9b3.d39e3910.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4947],{98143:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>d,toc:()=>p});var r=t(86070),s=t(25710),i=t(65671),a=t(7871);const o={},l=void 0,d={id:"reference/metagen/index",title:"index",description:"/typegrap/typegraphh---",source:"@site/docs/reference/metagen/index.mdx",sourceDirName:"reference/metagen",slug:"/reference/metagen/",permalink:"/docs/reference/metagen/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/metagen/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Changelog",permalink:"/docs/reference/changelog"},next:{title:"Features overview",permalink:"/docs/concepts/features-overview/"}},c={},p=[{value:"/typegrap/typegraphh---\nsidebar_position: 50",id:"typegraptypegraphh---sidebar_position-50",level:2},{value:"Access through CLI",id:"access-through-cli",level:2},{value:"Access through SDK",id:"access-through-sdk",level:2},{value:"Generators",id:"generators",level:2},{value:"client_ts",id:"client_ts",level:3},{value:"client_py",id:"client_py",level:3},{value:"client_rs",id:"client_rs",level:3},{value:"fdk_typescript",id:"fdk_typescript",level:3},{value:"fdk_python",id:"fdk_python",level:3},{value:"fdk_rust",id:"fdk_rust",level:3}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components},{Details:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h2,{id:"typegraptypegraphh---sidebar_position-50",children:"/typegrap/typegraphh---\nsidebar_position: 50"}),"\n","\n",(0,r.jsx)(n.h1,{id:"metagen",children:"Metagen"}),"\n",(0,r.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,r.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,r.jsx)(n.p,{children:"Metagen is a code-generator suite that contains implementations that help with development on the Metatype platform. Today, this means a set of generators to:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Generate code-first, typesafe clients for your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:["Help with ",(0,r.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom functions"})," by generating types, serializers and bindings."]}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["It's availaible bundled within the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," and the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph#sdks",children:"typegraph SDKs"}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"access-through-cli",children:"Access through CLI"}),"\n",(0,r.jsxs)(n.p,{children:["The meta-cli has a dedicated ",(0,r.jsx)(n.code,{children:"gen"})," command for interacting with metagen. We configure the generators through the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli/configuration-file",children:"standard configuration file"})," under the metagen key."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'typegates:\n # bla bla\n\ntypegraphs:\n # bla bla\n\nmetagen:\n targets:\n main:\n # generator to use\n - generator: fdk_rust\n # path to generate to\n path: ./bff/\n # typegraph path to use\n typegraph_path: ./typegraphs/svc-bff.ts\n # we can have multiple generators per target\n - generator: fdk_rust\n path: ./telemetry/\n typegraph_path: ./typegraphs/svc-telemetry.ts\n # generators might have custom keys\n stubbed_runtimes: ["wasm_wire", "deno"]\n # more than one targets avail if you need them\n iter:\n - generator: client_ts\n path: ./next_app/\n # name of typegraph to read from typegate\n typegraph: svc_bff\n'})}),"\n",(0,r.jsx)(n.p,{children:"This allows us to invoke the targets from the CLI."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"meta cli gen main\n"})}),"\n",(0,r.jsxs)(n.p,{children:["This will resolve the requisite typegraphs, serialize as needed and put the resulting files at the appropriate locations. If no target name is provied, the CLI will look for a target under the key ",(0,r.jsx)(n.code,{children:"main"})," and invoke it instead."]}),"\n",(0,r.jsx)(n.h2,{id:"access-through-sdk",children:"Access through SDK"}),"\n",(0,r.jsx)(n.p,{children:"Metagen is availaible through the SDK for programmatic access needs and can be helpful when writing tests or when relying on the CLI is not an option."}),"\n",(0,r.jsx)(i.A,{python:t(7797),typescript:t(19507),disablePlayground:!0}),"\n",(0,r.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,r.jsxs)(n.admonition,{title:"Chicken or the egg?",type:"info",children:[(0,r.jsx)(n.p,{children:"As most of the generators are intended for types to be used by custom functions, they'll require that you declare the custom functions in your typegraph first. This begs the question, how does one declare custom functions that depend on artifacts that are yet to be generated? Typegraphs error out when referenced artifacts aren't found, how does it work in this scenario?"}),(0,r.jsxs)(n.p,{children:["To resolve this concern, the SDKs support a serialization mode that skips resolution of artifacts. This mode is activated when serialization is done for codegen purposes. What this means is that, ",(0,r.jsx)(n.strong,{children:"you can declare non-existent files in your typegraph and codegen should work"}),". Some generators are even smart enough to work around your expected files. Of course, if the files aren't present when you're trying to deply to the typegate, it'll raise an error."]})]}),"\n",(0,r.jsx)(n.h3,{id:"client_ts",children:(0,r.jsx)(n.code,{children:"client_ts"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API",children:(0,r.jsx)(n.code,{children:"fetch"})})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Requires Node.js version ",(0,r.jsx)(n.code,{children:"v17.5.0"})," and ",(0,r.jsx)(n.a,{href:"https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#fetch",children:"up"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:["Requires using ",(0,r.jsx)(n.code,{children:"--experimental-fetch"})," flag if on Node.js version below v18.0.0"]}),"\n",(0,r.jsx)(n.li,{children:"Provides async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"client_py",children:(0,r.jsx)(n.code,{children:"client_py"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"urlib"})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Provides sync and async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"client_rs",children:(0,r.jsx)(n.code,{children:"client_rs"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Types and query builders based on your typegraph"}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"https://lib.rs/crates/reqwest",children:(0,r.jsx)(n.code,{children:"reqwest"})})," based ",(0,r.jsx)(n.code,{children:"GraphQlTransport"})," implementation","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Provides sync and async queries"}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Prepared requests and aliases"}),"\n"]}),"\n",(0,r.jsxs)(n.p,{children:["Refer to the ",(0,r.jsx)(n.a,{href:"/docs/reference/typegraph/client/",children:"client reference"})," for usage guidelines and examples."]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_typescript",children:(0,r.jsx)(n.code,{children:"fdk_typescript"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Typescript types that map to typegraph types"}),"\n",(0,r.jsxs)(n.li,{children:["Stub function types for custom functions implementors that adhere to typegraph functions.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all function types from the ",(0,r.jsx)(n.code,{children:"DenoRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["Use ",(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," to select which runtimes get stubs."]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.a,{href:"#client_ts",children:(0,r.jsx)(n.code,{children:"client_ts"})})," based typegraph client","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Special ",(0,r.jsx)(n.code,{children:"HostcallTransport"})," implementation"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{python:t(14037),typescript:t(14037),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(i.A,{typescript:t(13246),disablePlayground:!0}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample."})}),(0,r.jsx)(i.A,{typescript:t(96280),disablePlayground:!0})]}),"\n",(0,r.jsx)(n.p,{children:"It supports the following extra configuration keys."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Key"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsx)(n.tbody,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"stubbed_runtimes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:'["deno"]'})}),(0,r.jsx)(n.td,{children:"Runtimes for which to generate stub types."})]})})]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_python",children:(0,r.jsx)(n.code,{children:"fdk_python"})}),"\n",(0,r.jsx)(n.p,{children:"This generator supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Python classes that map to typegraph types"}),"\n",(0,r.jsxs)(n.li,{children:["Decorators for custom functions implementors that require adherance to typegraph function types.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all functions from the ",(0,r.jsx)(n.code,{children:"PythonRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["TODO: ",(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," for ",(0,r.jsx)(n.code,{children:"fdk_python"})]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"TODO: types for interacting with the typegate from within custom functions."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"If the referenced module for the custom function is not found, the generator will also output stub implementation (in addition to the types) at the given type. It will not replace our code on a second run."}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{typescript:t(62292),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(i.A,{python:t(28434),disablePlayground:!0}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample."})}),(0,r.jsx)(i.A,{python:t(95696),disablePlayground:!0})]}),"\n",(0,r.jsx)(n.h3,{id:"fdk_rust",children:(0,r.jsx)(n.code,{children:"fdk_rust"})}),"\n",(0,r.jsx)(n.p,{children:"This generator generates types, serializers and bindings needed to implement custom functions in Rust. Rust implementations will need to be compiled to wasm components to be executed on the metatype platform and the generator assumes such usage."}),"\n",(0,r.jsx)(n.p,{children:"To be more specific, it supports:"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Rust types that map to typegraph defined types","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Serialization is handled out of sight through ",(0,r.jsx)(n.a,{href:"https://lib.rs/serde_json",children:(0,r.jsx)(n.code,{children:"serde_json"})})]}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:["Stub traits for custom functions implementors that adhere to typegraph functions.","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["By default, all functions from the ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," get stub types."]}),"\n",(0,r.jsxs)(n.li,{children:["The generator assumes the ",(0,r.jsx)(n.code,{children:"wire"})," based wasm interface is being targetted."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"stubbed_runtimes"})," key can be used to configure stub generation from additional runtimes."]}),"\n"]}),"\n"]}),"\n",(0,r.jsx)(n.li,{children:"Types for interacting with the typegate from within custom functions."}),"\n",(0,r.jsxs)(n.li,{children:["Glue code for setting up the wasm component to be run within the ",(0,r.jsx)(n.code,{children:"WasmRuntime"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"By default the generator will also output a library crate entrypoint and a functional Cargo.toml with all the required dependencies. These additional files wlil not be overwritten on a second run. The generator can also be configured to avoid generating them even if not present."}),"\n",(0,r.jsx)(n.p,{children:"The following example showcases the generator."}),"\n",(0,r.jsx)(n.p,{children:"Typegraph:"}),"\n",(0,r.jsx)(i.A,{python:t(28054),typescript:t(86016),disablePlayground:!0}),"\n",(0,r.jsx)(n.p,{children:"Custom function:"}),"\n",(0,r.jsx)(a.A,{language:"rust",children:t(39028).content}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:"Code generation sample."}),(0,r.jsx)(a.A,{language:"rust",children:t(86496).content})]}),"\n",(0,r.jsx)(n.p,{children:"It supports the following extra configuration keys."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Key"}),(0,r.jsx)(n.th,{children:"Type"}),(0,r.jsx)(n.th,{children:"Default"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"stubbed_runtimes"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string[]"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:'["wasm_wire"]'})}),(0,r.jsx)(n.td,{children:"Runtimes for which to generate stub types."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"crate_name"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"${typegraphName}_fdk"})}),(0,r.jsxs)(n.td,{children:["Name to assign to crate when generating ",(0,r.jsx)(n.code,{children:"Cargo.toml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"skip_cargo_toml"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Do not generate ",(0,r.jsx)(n.code,{children:"Cargo.toml"}),"."]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"skip_lib_rs"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"false"})}),(0,r.jsxs)(n.td,{children:["Do not generate ",(0,r.jsx)(n.code,{children:"lib.rs"}),", the sample entrypoint."]})]})]})]})]})}function u(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>i});var r=t(98302),s=(t(30758),t(86070));function i(e){let{python:n,typescript:t,rust:i,...a}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},i&&{content:i.content,codeLanguage:"rust",codeFileUrl:i.path}].filter((e=>!!e));return(0,s.jsx)(r.A,{code:0==o.length?void 0:o,...a})}},14037:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_deno(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-deno.py"}},62292:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-py",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n const python = new PythonRuntime();\n\n g.expose(\n {\n remix: python\n .import(idv3, idv3, {\n module: "./metagen/py/remix.py",\n deps: ["./metagen/py/remix_types.py"],\n name: "remix_track",\n })\n .rename("remix_track"), // explicit names help\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/metagen-py.ts"}},28054:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_rs(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n\n # the wire flavour is availible through a static\n # constructor\n wasm = WasmRuntime.wire("metagen/rust.wasm")\n\n g.expose(\n Policy.public(),\n remix=wasm.handler(\n idv3,\n idv3,\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-rs.py"}},86016:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-rs",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n // the wire flavour is availible through a static\n // constructor\n const wasm = WasmRuntime.wire("metagen/rust.wasm");\n\n g.expose(\n {\n remix: wasm\n .handler(\n idv3,\n idv3,\n {\n name: "remix_track",\n }\n // the traits will map to the name of the materializer\n // and also the the name of the handler mentioned above\n )\n .rename("remix_track"),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/metagen-rs.ts"}},7797:e=>{e.exports={content:'import os\nfrom typegraph.graph.metagen import Metagen\n\n\n@typegraph(\n)\ndef metagen_sdk(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n }\n ).rename("idv3")\n deno = DenoRuntime()\n\n g.expose(\n Policy.public(),\n remix=deno.import_(\n idv3,\n idv3,\n module="./metagen/ts/remix.ts",\n deps=["./metagen/ts/fdk.ts"],\n name="remix_track",\n ).rename("remix_track"),\n )\n\n\nif __name__ == "__main__" and False:\n metagen = Metagen(\n # the workspace root that our config is relative to\n os.path.dirname(os.path.abspath(__file__)),\n # the rest is pretty similar to the CLI config\n {\n "targets": {\n "main": [\n {\n "generator": "fdk_typescript",\n "typegraph_path": __file__,\n "path": "funcs/",\n },\n ],\n },\n },\n )\n tg = metagen_sdk()\n # dry_run doesn\'t write to disk\n items = metagen.dry_run(tg, "main", None)',path:"../examples/typegraphs/metagen-sdk.py"}},19507:e=>{e.exports={content:'import { Metagen } from "@typegraph/sdk/metagen.ts";\n\n// get typegraph desc here\nconst tg = await typegraph(\n {\n name: "metagen-sdk",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n })\n .rename("idv3");\n\n const deno = new DenoRuntime();\n\n g.expose(\n {\n remix: deno\n .import(idv3, idv3, {\n module: "./metagen/ts/remix.ts",\n deps: ["./metagen/ts/fdk.ts"],\n name: "remix_track",\n })\n .rename("remix_track"),\n },\n Policy.public(),\n );\n },\n);\n\nif (false) {\n const myPath = import.meta.url.replace("file://", "");\n const metagen = new Metagen(\n // the workspace root that our config is relative to\n myPath + "/..",\n // this rest of the config is similmilar to the CLI config\n {\n targets: {\n main: [\n {\n generator: "fdk_typescript",\n typegraph_path: myPath,\n path: "funcs/",\n },\n ],\n },\n },\n );\n // dry_run doesn\'t write to disk\n metagen.dryRun(tg, "main");\n}',path:"../examples/typegraphs/metagen-sdk.ts"}},28434:e=>{e.exports={content:'from .remix_types import typed_remix_track, Idv3\n\n\n# the following decorator makes sure your function\n# adheres to the function types from the typegraph\n@typed_remix_track\ndef remix_track(inp: Idv3) -> Idv3:\n return Idv3(\n title=f"{inp.title} (Remix)",\n artist=f"{inp.artist} + DJ Cloud",\n releaseTime=inp.releaseTime,\n mp3Url="https://mp3.url/remix1",\n )',path:"../examples/typegraphs/metagen/py/remix.py"}},95696:e=>{e.exports={content:'from types import NoneType\nfrom typing import Callable, List, Union, get_origin, ForwardRef, Any\nfrom dataclasses import dataclass, asdict, fields\n\nFORWARD_REFS = {}\n\n\nclass Struct:\n def repr(self):\n return asdict(self)\n\n @staticmethod\n def try_new(dt_class, val: Any):\n # Object\n ftypes = {f.name: f.type for f in fields(dt_class)}\n attrs = {}\n for f in val:\n fval = val[f]\n ftype = ftypes[f]\n serialized = False\n # Union\n if get_origin(ftype) is Union:\n try:\n attrs[f] = Struct.try_union(ftype.__args__, fval)\n serialized = True\n except Exception:\n pass\n # List\n elif get_origin(ftype) is list:\n try:\n attrs[f] = Struct.try_typed_list(ftype.__args__, fval)\n serialized = True\n except Exception:\n pass\n # Any\n if not serialized:\n if isinstance(ftype, str) and ftype in FORWARD_REFS:\n klass = FORWARD_REFS[ftype]\n attrs[f] = Struct.new(klass, fval)\n else:\n attrs[f] = Struct.new(ftype, fval)\n return dt_class(**attrs)\n\n @staticmethod\n def try_typed_list(tpe: Any, items: Any):\n hint = tpe.__args__[0]\n klass = (\n FORWARD_REFS[hint.__forward_arg__] if isinstance(hint, ForwardRef) else hint\n )\n return [Struct.new(klass, v) for v in items]\n\n @staticmethod\n def try_union(variants: List[Any], val: Any):\n errors = []\n for variant in variants:\n try:\n if variant is NoneType:\n if val is None:\n return None\n else:\n continue\n if get_origin(variant) is list:\n if isinstance(val, list):\n return Struct.try_typed_list(variant, val)\n else:\n continue\n klass = FORWARD_REFS[variant.__forward_arg__]\n return Struct.try_new(klass, val)\n except Exception as e:\n errors.append(str(e))\n raise Exception("\\n".join(errors))\n\n @staticmethod\n def new(dt_class: Any, val: Any):\n try:\n return Struct.try_new(dt_class, val)\n except Exception:\n return val\n\n\n@dataclass\nclass Idv3(Struct):\n title: str\n artist: str\n releaseTime: str\n mp3Url: str\n\n\nFORWARD_REFS["Idv3"] = Idv3\n\n\ndef __repr(value: Any):\n if isinstance(value, Struct):\n return value.repr()\n return value\n\n\ndef typed_remix_track(user_fn: Callable[[Idv3], Idv3]):\n def exported_wrapper(raw_inp):\n inp: Idv3 = Struct.new(Idv3, raw_inp)\n out: Idv3 = user_fn(inp)\n if isinstance(out, list):\n return [__repr(v) for v in out]\n return __repr(out)\n\n return exported_wrapper',path:"../examples/typegraphs/metagen/py/remix_types.py"}},86496:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n#![cfg_attr(rustfmt, rustfmt_skip)]\n\n// gen-static-start\n#![allow(dead_code)]\n\npub mod wit {\n wit_bindgen::generate!({\n pub_export_macro: true,\n \n inline: "package metatype:wit-wire;\n\ninterface typegate-wire {\n hostcall: func(op-name: string, json: string) -> result;\n}\n\ninterface mat-wire {\n type json-str = string;\n\n record mat-info {\n op-name: string,\n mat-title: string,\n mat-hash: string,\n mat-data-json: string,\n }\n\n record init-args {\n metatype-version: string,\n expected-ops: list\n }\n\n record init-response {\n ok: bool\n }\n\n variant init-error {\n version-mismatch(string),\n unexpected-mat(mat-info),\n other(string)\n }\n\n init: func(args: init-args) -> result;\n\n record handle-req {\n op-name: string,\n in-json: json-str,\n }\n\n variant handle-err {\n no-handler,\n in-json-err(string),\n handler-err(string),\n }\n\n handle: func(req: handle-req) -> result;\n}\n\nworld wit-wire {\n import typegate-wire;\n\n export mat-wire;\n}\n"\n });\n}\n\nuse std::cell::RefCell;\nuse std::collections::HashMap;\n\nuse wit::exports::metatype::wit_wire::mat_wire::*;\nuse wit::metatype::wit_wire::typegate_wire::hostcall;\n\npub type HandlerFn = Box Result>;\n\npub struct ErasedHandler {\n mat_id: String,\n mat_trait: String,\n mat_title: String,\n handler_fn: HandlerFn,\n}\n\npub struct MatBuilder {\n handlers: HashMap,\n}\n\nimpl MatBuilder {\n pub fn new() -> Self {\n Self {\n handlers: Default::default(),\n }\n }\n\n pub fn register_handler(mut self, handler: ErasedHandler) -> Self {\n self.handlers.insert(handler.mat_trait.clone(), handler);\n self\n }\n}\n\npub struct Router {\n handlers: HashMap,\n}\n\nimpl Router {\n pub fn from_builder(builder: MatBuilder) -> Self {\n Self {\n handlers: builder.handlers,\n }\n }\n\n pub fn init(&self, args: InitArgs) -> Result {\n static MT_VERSION: &str = "0.5.0-rc.4";\n if args.metatype_version != MT_VERSION {\n return Err(InitError::VersionMismatch(MT_VERSION.into()));\n }\n for info in args.expected_ops {\n let mat_trait = stubs::op_to_trait_name(&info.op_name);\n if !self.handlers.contains_key(mat_trait) {\n return Err(InitError::UnexpectedMat(info));\n }\n }\n Ok(InitResponse { ok: true })\n }\n\n pub fn handle(&self, req: HandleReq) -> Result {\n let mat_trait = stubs::op_to_trait_name(&req.op_name);\n let Some(handler) = self.handlers.get(mat_trait) else {\n return Err(HandleErr::NoHandler);\n };\n let cx = Ctx {};\n (handler.handler_fn)(&req.in_json, cx)\n }\n}\n\npub type InitCallback = fn() -> anyhow::Result;\n\nthread_local! {\n pub static MAT_STATE: RefCell = panic!("MAT_STATE has not been initialized");\n}\n\npub struct Ctx {}\n\nimpl Ctx {\n pub fn gql(\n &self,\n query: &str,\n variables: impl Into,\n ) -> Result\n where\n O: serde::de::DeserializeOwned,\n {\n match hostcall(\n "gql",\n &serde_json::to_string(&serde_json::json!({\n "query": query,\n "variables": variables.into(),\n }))?,\n ) {\n Ok(json) => Ok(serde_json::from_str(&json[..])?),\n Err(json) => Err(GraphqlRunError::HostError(serde_json::from_str(&json)?)),\n }\n }\n}\n\n#[derive(Debug)]\npub enum GraphqlRunError {\n JsonError(serde_json::Error),\n HostError(serde_json::Value),\n}\n\nimpl std::error::Error for GraphqlRunError {}\n\nimpl From for GraphqlRunError {\n fn from(value: serde_json::Error) -> Self {\n Self::JsonError(value)\n }\n}\n\nimpl std::fmt::Display for GraphqlRunError {\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n match self {\n GraphqlRunError::JsonError(msg) => write!(f, "json error: {msg}"),\n GraphqlRunError::HostError(serde_json::Value::Object(map))\n if map.contains_key("message") =>\n {\n write!(f, "host error: {}", map["message"])\n }\n GraphqlRunError::HostError(val) => write!(f, "host error: {val:?}"),\n }\n }\n}\n\n#[macro_export]\nmacro_rules! init_mat {\n (hook: $init_hook:expr) => {\n struct MatWireGuest;\n use wit::exports::metatype::wit_wire::mat_wire::*;\n wit::export!(MatWireGuest with_types_in wit);\n\n #[allow(unused)]\n impl Guest for MatWireGuest {\n fn handle(req: HandleReq) -> Result {\n MAT_STATE.with(|router| {\n let router = router.borrow();\n router.handle(req)\n })\n }\n\n fn init(args: InitArgs) -> Result {\n let hook = $init_hook;\n let router = Router::from_builder(hook());\n let resp = router.init(args)?;\n MAT_STATE.set(router);\n Ok(resp)\n }\n }\n };\n}\n// gen-static-end\nuse types::*;\npub mod types {\n pub type Idv3TitleString = String;\n pub type Idv3ReleaseTimeStringDatetime = String;\n pub type Idv3Mp3UrlStringUri = String;\n #[derive(Debug, serde::Serialize, serde::Deserialize)]\n pub struct Idv3 {\n pub title: Idv3TitleString,\n pub artist: Idv3TitleString,\n #[serde(rename = "releaseTime")]\n pub release_time: Idv3ReleaseTimeStringDatetime,\n #[serde(rename = "mp3Url")]\n pub mp3_url: Idv3Mp3UrlStringUri,\n }\n}\npub mod stubs {\n use super::*;\n pub trait RemixTrack: Sized + \'static {\n fn erased(self) -> ErasedHandler {\n ErasedHandler {\n mat_id: "remix_track".into(),\n mat_title: "remix_track".into(),\n mat_trait: "RemixTrack".into(),\n handler_fn: Box::new(move |req, cx| {\n let req = serde_json::from_str(req)\n .map_err(|err| HandleErr::InJsonErr(format!("{err}")))?;\n let res = self\n .handle(req, cx)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))?;\n serde_json::to_string(&res)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))\n }),\n }\n }\n\n fn handle(&self, input: Idv3, cx: Ctx) -> anyhow::Result;\n }\n pub fn op_to_trait_name(op_name: &str) -> &\'static str {\n match op_name {\n "remix_track" => "RemixTrack",\n _ => panic!("unrecognized op_name: {op_name}"),\n }\n }\n}',path:"../examples/typegraphs/metagen/rs/fdk.rs"}},39028:e=>{e.exports={content:'mod fdk;\npub use fdk::*;\n\n// the macro sets up all the glue\ninit_mat! {\n // the hook is expected to return a MatBuilder instance\n hook: || {\n // initialize global stuff here if you need it\n MatBuilder::new()\n // register function handlers here\n // each trait will map to the name of the\n // handler found in the typegraph\n .register_handler(stubs::RemixTrack::erased(MyMat))\n }\n}\n\nstruct MyMat;\n\nimpl stubs::RemixTrack for MyMat {\n fn handle(&self, input: types::Idv3, _cx: Ctx) -> anyhow::Result {\n Ok(types::Idv3 {\n title: format!("{} (Remix)", input.title),\n artist: format!("{} + DJ Cloud", input.artist),\n release_time: input.release_time,\n mp3_url: "https://mp3.url/shumba2".to_string(),\n })\n }\n}',path:"../examples/typegraphs/metagen/rs/lib.rs"}},96280:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n\nexport type Ctx = {\n parent?: Record;\n /**\n * Request context extracted by auth extractors.\n */\n context?: Record;\n secrets: Record;\n effect: "create" | "update" | "delete" | "read" | undefined | null;\n meta: {\n url: string;\n token: string;\n };\n headers: Record;\n};\n\n/**\n * Access features on your typegraph deployment.\n */\nexport type Deployment = {\n gql: (query: readonly string[], ...args: unknown[]) => {\n run: (\n variables: Record,\n ) => Promise>;\n };\n};\n\nexport type Handler = (\n input: In,\n ctx: Ctx,\n tg: Deployment,\n) => Out | Promise;\n\nexport type StringDateTime = string;\nexport type StringUri = string;\nexport type Idv3 = {\n title: string;\n artist: string;\n releaseTime: StringDateTime;\n mp3Url: StringUri;\n};\n\n\nexport type RemixTrackHandler = Handler;',path:"../examples/typegraphs/metagen/ts/fdk.ts"}},13246:e=>{e.exports={content:'import type { RemixTrackHandler, Ctx, Idv3 } from "./fdk.ts";\n\n// the name of the export must match the one referred int he typegraph\nexport const remix_track: RemixTrackHandler = (inp, cx: Ctx) => {\n const out: Idv3 = {\n title: `${inp.title} (Remix)`,\n artist: `${inp.artist} + DJ Cloud`,\n releaseTime: new Date().toISOString(),\n // S3Runtime could be used to really provide this service\n mp3Url: `${cx.meta.url}/get_mp3`,\n };\n return out;\n};',path:"../examples/typegraphs/metagen/ts/remix.ts"}}}]); \ No newline at end of file diff --git a/assets/js/d89a9c00.b0dd8f49.js b/assets/js/d89a9c00.f9cb86c9.js similarity index 97% rename from assets/js/d89a9c00.b0dd8f49.js rename to assets/js/d89a9c00.f9cb86c9.js index 06a95bb17e..fc8345502d 100644 --- a/assets/js/d89a9c00.b0dd8f49.js +++ b/assets/js/d89a9c00.f9cb86c9.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5253],{88572:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>d,RM:()=>a});var r=t(86070),o=t(25710),s=t(65671),i=t(65480),c=t(27676);const a=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) is a mechanism that allows or denies cross-origin requests in the browser. It prevents websites that you've not explicitly allowed from using your API. Note that it doesn't protect non-browser clients like server side code or a mobile app from using your typegraphs, only browsers implements the CORS mechanism. More details can be found ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/HTTP/CORS",children:"here"}),"."]}),"\n",(0,r.jsxs)(i.Ay,{children:[(0,r.jsx)(c.A,{value:"typescript",children:(0,r.jsx)(s.A,{typegraph:"cors",typescript:t(66906),query:t(4489)})}),(0,r.jsx)(c.A,{value:"python",children:(0,r.jsx)(s.A,{typegraph:"cors",python:t(71388),query:t(4489)})})]}),"\n",(0,r.jsx)(n.p,{children:"If your browser support well CORS, you should the following error if you try to run the interactive demo."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "NetworkError when attempting to fetch resource.",\n "stack": ""\n }\n ]\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"Look in the network tab of your browser inspect tools to see the error proper."}),"\n",(0,r.jsx)(n.p,{children:"By the way, there is a hidden cors header in all interactive demos you have met so far:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'# ..\nCors(allow_origin=["https://metatype.dev", "http://localhost:3000"])\n# ..\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},24331:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var r=t(86070),o=t(25710),s=t(88572);const i={},c="CORS",a={id:"reference/typegate/cors/index",title:"CORS",description:"",source:"@site/docs/reference/typegate/cors/index.mdx",sourceDirName:"reference/typegate/cors",slug:"/reference/typegate/cors/",permalink:"/docs/reference/typegate/cors/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/cors/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Authentication",permalink:"/docs/reference/typegate/authentication/"},next:{title:"Rate limiting",permalink:"/docs/reference/typegate/rate-limiting/"}},l={},d=[...s.RM];function h(e){const n={h1:"h1",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"cors",children:"CORS"}),"\n",(0,r.jsx)(s.Ay,{})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,gc:()=>c});t(30758);var r=t(3733),o=t(56315),s=t(86070);function i(e){let{children:n}=e;const[t,i]=(0,r.e)();return(0,s.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:i,children:n})}function c(e){let{children:n}=e;const[t]=(0,r.e)();return(0,s.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var r=t(98302),o=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...i}=e;const c=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(r.A,{code:0==c.length?void 0:c,...i})}},4489:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"catch_me_if_you_can"},arguments:[],directives:[]}]}}],loc:{start:0,end:75}};n.loc.source={body:"query {\n catch_me_if_you_can\n # the results panel should show an error\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},71388:e=>{e.exports={content:'@typegraph(\n # highlight-start\n cors=Cors(\n allow_origin=["https://not-this.domain"],\n allow_headers=["x-custom-header"],\n expose_headers=["header-1"],\n allow_credentials=True,\n max_age_sec=60,\n ),\n # highlight-end\n)\ndef cors(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n\n g.expose(\n Policy.public(),\n catch_me_if_you_can=random.gen(t.string()),\n )',path:"../examples/typegraphs/cors.py"}},66906:e=>{e.exports={content:'await typegraph(\n {\n name: "cors",\n // highlight-start\n cors: {\n allowOrigin: ["https://not-this.domain"],\n allowHeaders: ["x-custom-header"],\n exposeHeaders: ["header-1"],\n allowCredentials: true,\n maxAgeSec: 60,\n },\n // highlight-end\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n\n g.expose(\n {\n catch_me_if_you_can: random.gen(t.string()),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/cors.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[5253],{88572:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>d,RM:()=>a});var r=t(86070),o=t(25710),s=t(65671),i=t(65480),c=t(27676);const a=[];function l(e){const n={a:"a",code:"code",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.p,{children:["Cross-Origin Resource Sharing (CORS) is a mechanism that allows or denies cross-origin requests in the browser. It prevents websites that you've not explicitly allowed from using your API. Note that it doesn't protect non-browser clients like server side code or a mobile app from using your typegraphs, only browsers implements the CORS mechanism. More details can be found ",(0,r.jsx)(n.a,{href:"https://developer.mozilla.org/en/docs/Web/HTTP/CORS",children:"here"}),"."]}),"\n",(0,r.jsxs)(i.Ay,{children:[(0,r.jsx)(c.A,{value:"typescript",children:(0,r.jsx)(s.A,{typegraph:"cors",typescript:t(66906),query:t(4489)})}),(0,r.jsx)(c.A,{value:"python",children:(0,r.jsx)(s.A,{typegraph:"cors",python:t(71388),query:t(4489)})})]}),"\n",(0,r.jsx)(n.p,{children:"If your browser support well CORS, you should the following error if you try to run the interactive demo."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-json",children:'{\n "errors": [\n {\n "message": "NetworkError when attempting to fetch resource.",\n "stack": ""\n }\n ]\n}\n'})}),"\n",(0,r.jsx)(n.p,{children:"Look in the network tab of your browser inspect tools to see the error proper."}),"\n",(0,r.jsx)(n.p,{children:"By the way, there is a hidden cors header in all interactive demos you have met so far:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-python",children:'# ..\nCors(allow_origin=["https://metatype.dev", "http://localhost:3000"])\n# ..\n'})})]})}function d(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},24331:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>i,metadata:()=>a,toc:()=>d});var r=t(86070),o=t(25710),s=t(88572);const i={},c="CORS",a={id:"reference/typegate/cors/index",title:"CORS",description:"",source:"@site/docs/reference/typegate/cors/index.mdx",sourceDirName:"reference/typegate/cors",slug:"/reference/typegate/cors/",permalink:"/docs/reference/typegate/cors/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/cors/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Authentication",permalink:"/docs/reference/typegate/authentication/"},next:{title:"Rate limiting",permalink:"/docs/reference/typegate/rate-limiting/"}},l={},d=[...s.RM];function h(e){const n={h1:"h1",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"cors",children:"CORS"}),"\n",(0,r.jsx)(s.Ay,{})]})}function p(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>i,gc:()=>c});t(30758);var r=t(3733),o=t(56315),s=t(86070);function i(e){let{children:n}=e;const[t,i]=(0,r.e)();return(0,s.jsx)(o.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:i,children:n})}function c(e){let{children:n}=e;const[t]=(0,r.e)();return(0,s.jsx)(o.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>s});var r=t(98302),o=(t(30758),t(86070));function s(e){let{python:n,typescript:t,rust:s,...i}=e;const c=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},s&&{content:s.content,codeLanguage:"rust",codeFileUrl:s.path}].filter((e=>!!e));return(0,o.jsx)(r.A,{code:0==c.length?void 0:c,...i})}},4489:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"catch_me_if_you_can"},arguments:[],directives:[]}]}}],loc:{start:0,end:75}};n.loc.source={body:"query {\n catch_me_if_you_can\n # the results panel should show an error\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},71388:e=>{e.exports={content:'@typegraph(\n # highlight-start\n cors=Cors(\n allow_origin=["https://not-this.domain"],\n allow_headers=["x-custom-header"],\n expose_headers=["header-1"],\n allow_credentials=True,\n max_age_sec=60,\n ),\n # highlight-end\n)\ndef cors(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n\n g.expose(\n Policy.public(),\n catch_me_if_you_can=random.gen(t.string()),\n )',path:"../examples/typegraphs/cors.py"}},66906:e=>{e.exports={content:'await typegraph(\n {\n name: "cors",\n // highlight-start\n cors: {\n allowOrigin: ["https://not-this.domain"],\n allowHeaders: ["x-custom-header"],\n exposeHeaders: ["header-1"],\n allowCredentials: true,\n maxAgeSec: 60,\n },\n // highlight-end\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n\n g.expose(\n {\n catch_me_if_you_can: random.gen(t.string()),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/cors.ts"}}}]); \ No newline at end of file diff --git a/assets/js/d8f8b671.dbf6ab11.js b/assets/js/d8f8b671.b4c37a46.js similarity index 98% rename from assets/js/d8f8b671.dbf6ab11.js rename to assets/js/d8f8b671.b4c37a46.js index 11834a5e6b..a706e95d7e 100644 --- a/assets/js/d8f8b671.dbf6ab11.js +++ b/assets/js/d8f8b671.b4c37a46.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8349],{37860:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>d});var t=i(86070),r=i(25710),a=i(65671);const l={},o="Rate limiting",s={id:"reference/typegate/rate-limiting/index",title:"Rate limiting",description:"The rate limiting algorithm works as follows:",source:"@site/docs/reference/typegate/rate-limiting/index.mdx",sourceDirName:"reference/typegate/rate-limiting",slug:"/reference/typegate/rate-limiting/",permalink:"/docs/reference/typegate/rate-limiting/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/rate-limiting/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"CORS",permalink:"/docs/reference/typegate/cors/"},next:{title:"Synchronization",permalink:"/docs/reference/typegate/synchronization/"}},c={},d=[];function h(e){const n={code:"code",h1:"h1",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"rate-limiting",children:"Rate limiting"}),"\n",(0,t.jsx)(n.p,{children:"The rate limiting algorithm works as follows:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["each function type can either count the # of calls it gets or the # of results returned ",(0,t.jsx)(n.code,{children:"rate_calls=False"})]}),"\n",(0,t.jsxs)(n.li,{children:["each function type can have a weight ",(0,t.jsx)(n.code,{children:"rate_weight=1"})]}),"\n",(0,t.jsxs)(n.li,{children:["each request is identified by its IP or by one value of its context if set ",(0,t.jsx)(n.code,{children:"context_identifier"})]}),"\n",(0,t.jsxs)(n.li,{children:["a single query can score a maximum of ",(0,t.jsx)(n.code,{children:"query_limit"})]}),"\n",(0,t.jsxs)(n.li,{children:["multiple queries can sum up to ",(0,t.jsx)(n.code,{children:"window_limit"})," in a ",(0,t.jsx)(n.code,{children:"window_sec"})," window"]}),"\n",(0,t.jsxs)(n.li,{children:["when there is multiple typegates (",(0,t.jsx)(n.code,{children:"N"}),"), you can improve performance by avoiding score synchronizing while the typegate has not reached ",(0,t.jsx)(n.code,{children:"local_excess"}),": the real maximum score is thus ",(0,t.jsx)(n.code,{children:"window_limit + min(local_excess, query_limit) * N"})]}),"\n"]}),"\n",(0,t.jsx)(a.A,{typegraph:"rate",python:i(48303),typescript:i(85009),query:i(17781)}),"\n",(0,t.jsx)(n.p,{children:"Playing with the above should allow you to quickly hit the limits."})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>a});var t=i(98302),r=(i(30758),i(86070));function a(e){let{python:n,typescript:i,rust:a,...l}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,r.jsx)(t.A,{code:0==o.length?void 0:o,...l})}},17781:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lightweight_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"medium_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"heavy_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"by_result_count"},arguments:[],directives:[]}]}}],loc:{start:0,end:115}};n.loc.source={body:"query A {\n lightweight_call\n}\n\nquery B {\n medium_call\n}\n\nquery C {\n heavy_call\n}\n\nquery D {\n by_result_count\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function r(e,n){for(var i=0;i0;){var s=o;o=new Set,s.forEach((function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach((function(e){o.add(e)})))}))}return l.forEach((function(n){var t=r(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=a(n,"A"),e.exports.B=a(n,"B"),e.exports.C=a(n,"C"),e.exports.D=a(n,"D")},48303:e=>{e.exports={content:"@typegraph(\n # highlight-next-line\n rate=Rate(\n # highlight-next-line\n window_limit=35,\n # highlight-next-line\n window_sec=15,\n # highlight-next-line\n query_limit=25,\n # highlight-next-line\n context_identifier=None,\n # highlight-next-line\n local_excess=0,\n # highlight-next-line\n ),\n)\ndef rate(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n public = Policy.public()\n\n g.expose(\n public,\n lightweight_call=random.gen(t.string()).rate(calls=True, weight=1),\n medium_call=random.gen(t.string()).rate(calls=True, weight=5),\n heavy_call=random.gen(t.string()).rate(calls=True, weight=15),\n by_result_count=random.gen(\n t.list(t.string()),\n ).rate(calls=False, weight=2), # increment by # of results returned\n )",path:"../examples/typegraphs/rate.py"}},85009:e=>{e.exports={content:'typegraph(\n {\n name: "rate",\n // highlight-next-line\n rate: {\n // highlight-next-line\n windowLimit: 35,\n // highlight-next-line\n windowSec: 15,\n // highlight-next-line\n queryLimit: 25,\n // highlight-next-line\n contextIdentifier: undefined,\n // highlight-next-line\n localExcess: 0,\n // highlight-next-line\n },\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n const pub = Policy.public();\n\n g.expose(\n {\n lightweight_call: random\n .gen(t.string())\n .rate({ calls: true, weight: 1 }),\n medium_call: random.gen(t.string()).rate({ calls: true, weight: 5 }),\n heavy_call: random.gen(t.string()).rate({ calls: true, weight: 15 }),\n by_result_count: random\n .gen(t.list(t.string()))\n .rate({ calls: false, weight: 2 }), // increment by # of results returned\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/rate.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8349],{37860:(e,n,i)=>{"use strict";i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>u,frontMatter:()=>l,metadata:()=>s,toc:()=>d});var t=i(86070),r=i(25710),a=i(65671);const l={},o="Rate limiting",s={id:"reference/typegate/rate-limiting/index",title:"Rate limiting",description:"The rate limiting algorithm works as follows:",source:"@site/docs/reference/typegate/rate-limiting/index.mdx",sourceDirName:"reference/typegate/rate-limiting",slug:"/reference/typegate/rate-limiting/",permalink:"/docs/reference/typegate/rate-limiting/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/typegate/rate-limiting/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"CORS",permalink:"/docs/reference/typegate/cors/"},next:{title:"Synchronization",permalink:"/docs/reference/typegate/synchronization/"}},c={},d=[];function h(e){const n={code:"code",h1:"h1",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"rate-limiting",children:"Rate limiting"}),"\n",(0,t.jsx)(n.p,{children:"The rate limiting algorithm works as follows:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["each function type can either count the # of calls it gets or the # of results returned ",(0,t.jsx)(n.code,{children:"rate_calls=False"})]}),"\n",(0,t.jsxs)(n.li,{children:["each function type can have a weight ",(0,t.jsx)(n.code,{children:"rate_weight=1"})]}),"\n",(0,t.jsxs)(n.li,{children:["each request is identified by its IP or by one value of its context if set ",(0,t.jsx)(n.code,{children:"context_identifier"})]}),"\n",(0,t.jsxs)(n.li,{children:["a single query can score a maximum of ",(0,t.jsx)(n.code,{children:"query_limit"})]}),"\n",(0,t.jsxs)(n.li,{children:["multiple queries can sum up to ",(0,t.jsx)(n.code,{children:"window_limit"})," in a ",(0,t.jsx)(n.code,{children:"window_sec"})," window"]}),"\n",(0,t.jsxs)(n.li,{children:["when there is multiple typegates (",(0,t.jsx)(n.code,{children:"N"}),"), you can improve performance by avoiding score synchronizing while the typegate has not reached ",(0,t.jsx)(n.code,{children:"local_excess"}),": the real maximum score is thus ",(0,t.jsx)(n.code,{children:"window_limit + min(local_excess, query_limit) * N"})]}),"\n"]}),"\n",(0,t.jsx)(a.A,{typegraph:"rate",python:i(48303),typescript:i(85009),query:i(17781)}),"\n",(0,t.jsx)(n.p,{children:"Playing with the above should allow you to quickly hit the limits."})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},65671:(e,n,i)=>{"use strict";i.d(n,{A:()=>a});var t=i(98302),r=(i(30758),i(86070));function a(e){let{python:n,typescript:i,rust:a,...l}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},i&&{content:i.content,codeLanguage:"typescript",codeFileUrl:i.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,r.jsx)(t.A,{code:0==o.length?void 0:o,...l})}},17781:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"A"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"lightweight_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"B"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"medium_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"C"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"heavy_call"},arguments:[],directives:[]}]}},{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"D"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"by_result_count"},arguments:[],directives:[]}]}}],loc:{start:0,end:115}};n.loc.source={body:"query A {\n lightweight_call\n}\n\nquery B {\n medium_call\n}\n\nquery C {\n heavy_call\n}\n\nquery D {\n by_result_count\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function i(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){i(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){i(e,n)})),e.definitions&&e.definitions.forEach((function(e){i(e,n)}))}var t={};function r(e,n){for(var i=0;i0;){var s=o;o=new Set,s.forEach((function(e){l.has(e)||(l.add(e),(t[e]||new Set).forEach((function(e){o.add(e)})))}))}return l.forEach((function(n){var t=r(e,n);t&&i.definitions.push(t)})),i}n.definitions.forEach((function(e){if(e.name){var n=new Set;i(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.A=a(n,"A"),e.exports.B=a(n,"B"),e.exports.C=a(n,"C"),e.exports.D=a(n,"D")},48303:e=>{e.exports={content:"@typegraph(\n # highlight-next-line\n rate=Rate(\n # highlight-next-line\n window_limit=35,\n # highlight-next-line\n window_sec=15,\n # highlight-next-line\n query_limit=25,\n # highlight-next-line\n context_identifier=None,\n # highlight-next-line\n local_excess=0,\n # highlight-next-line\n ),\n)\ndef rate(g: Graph):\n random = RandomRuntime(seed=0, reset=None)\n public = Policy.public()\n\n g.expose(\n public,\n lightweight_call=random.gen(t.string()).rate(calls=True, weight=1),\n medium_call=random.gen(t.string()).rate(calls=True, weight=5),\n heavy_call=random.gen(t.string()).rate(calls=True, weight=15),\n by_result_count=random.gen(\n t.list(t.string()),\n ).rate(calls=False, weight=2), # increment by # of results returned\n )",path:"../examples/typegraphs/rate.py"}},85009:e=>{e.exports={content:'typegraph(\n {\n name: "rate",\n // highlight-next-line\n rate: {\n // highlight-next-line\n windowLimit: 35,\n // highlight-next-line\n windowSec: 15,\n // highlight-next-line\n queryLimit: 25,\n // highlight-next-line\n contextIdentifier: undefined,\n // highlight-next-line\n localExcess: 0,\n // highlight-next-line\n },\n },\n (g) => {\n const random = new RandomRuntime({ seed: 0 });\n const pub = Policy.public();\n\n g.expose(\n {\n lightweight_call: random\n .gen(t.string())\n .rate({ calls: true, weight: 1 }),\n medium_call: random.gen(t.string()).rate({ calls: true, weight: 5 }),\n heavy_call: random.gen(t.string()).rate({ calls: true, weight: 15 }),\n by_result_count: random\n .gen(t.list(t.string()))\n .rate({ calls: false, weight: 2 }), // increment by # of results returned\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/rate.ts"}}}]); \ No newline at end of file diff --git a/assets/js/e1da19f3.f16f35a7.js b/assets/js/e1da19f3.2b3c8976.js similarity index 57% rename from assets/js/e1da19f3.f16f35a7.js rename to assets/js/e1da19f3.2b3c8976.js index a4f216f70f..54f9043d5b 100644 --- a/assets/js/e1da19f3.f16f35a7.js +++ b/assets/js/e1da19f3.2b3c8976.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4191],{48372:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>u});var r=t(86070),i=t(25710),a=t(65671),s=t(7871);const o={sidebar_position:50},l="Wasm functions",d={id:"guides/wasm-functions/index",title:"Wasm functions",description:"The following feature is not yet stable.",source:"@site/docs/guides/wasm-functions/index.mdx",sourceDirName:"guides/wasm-functions",slug:"/guides/wasm-functions/",permalink:"/docs/guides/wasm-functions/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/wasm-functions/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Secure your requests",permalink:"/docs/guides/securing-requests/"},next:{title:"Self-host the Typegate",permalink:"/docs/guides/self-hosting"}},c={},u=[{value:"Tooling",id:"tooling",level:2},{value:"Typegraph",id:"typegraph",level:2},{value:"Metagen",id:"metagen",level:2},{value:"Building",id:"building",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components},{Details:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"wasm-functions",children:"Wasm functions"}),"\n",(0,r.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,r.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"/docs/reference/runtimes/wasm",children:(0,r.jsx)(n.code,{children:"WasmRuntime"})})," enables one to use any langauge/ecosystem with a toolchain capable of producing wasm artifacts to author ",(0,r.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom functions"}),". ",(0,r.jsx)(n.a,{href:"https://rust-lang.org",children:"Rust"})," is one such a language and has shaped up to be the hotspot of development in the wasm ecosystem (The Metatype itself platform has many rusty parts). In this guide, we'll see how to set up a workflow for using Rust for our custom functions."]}),"\n",(0,r.jsx)(n.h2,{id:"tooling",children:"Tooling"}),"\n",(0,r.jsx)(n.p,{children:"We need to install several programs to be able to produce the components. The following checklist contains links to get you started:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Rust compiler toolchain: this guide assumes moderate familiartiy of development with rust and won't spend many words on how to get it functional. In any case, you can get started with rust ",(0,r.jsx)(n.a,{href:"https://www.rust-lang.org/learn/get-started",children:"here"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"wasm32-unknown-unknown"})," target for rustc: This is the backend that rustc uses to produce wasi compatible wasm components. If you're using ",(0,r.jsx)(n.code,{children:"rustup"})," to manage your toolchain, Cargo will automatically install the target when you're building."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"wasm-tools"}),": this is the swiss army knife for working with wasm artifacts, courtesy of the ",(0,r.jsx)(n.a,{href:"https://bytecodealliance.org/",children:"Bytecode Alliance"}),". Installation instructions can be found ",(0,r.jsx)(n.a,{href:"https://github.com/bytecodealliance/wasm-tools/",children:"here"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"typegraph",children:"Typegraph"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," currently comes in two flavours that are both based on the wasm component spec. This guide focues on the ",(0,r.jsx)(n.code,{children:"wire"})," flavour, where your component is expected to implement a standard WIT interface that's designed around a simple Json based RPC wire format. Thankfully, all of that boilerplate is easy to automate away and that's exactly what we'll do using ",(0,r.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," to generate the binding code."]}),"\n",(0,r.jsx)(n.p,{children:"Before anything though, we need to author the typegraph:"}),"\n",(0,r.jsx)(a.A,{python:t(28054),typescript:t(86016),disablePlayground:!0}),"\n",(0,r.jsxs)(n.p,{children:["Note that the ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," constructor mentions a non-existent wasm file on disk. This won't be a problem for the metagen generators but we'll need to produce the artifact before we deploy the typegraph. We'll see what buliding the artifact entails in just a minute."]}),"\n",(0,r.jsx)(n.h2,{id:"metagen",children:"Metagen"}),"\n",(0,r.jsxs)(n.p,{children:["We can now tackle the boilerplate. Metagen bundles the ",(0,r.jsx)(n.a,{href:"/docs/reference/metagen#fdk_rust",children:(0,r.jsx)(n.code,{children:"fdk_rust"})})," generator which can generate all the glue code along with Rust types that correspond to our typegraph types. Let's configure a metagen target in our configuration file to get just that done."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"metagen:\n targets:\n metagen_rs:\n # this is the generator we're interested in\n - generator: fdk_rust\n # the location where to put the generated files\n path: ./metagen/rs/\n # the path to our typegraph\n typegraph_path: ./metagen-rs.ts\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The configuration file is read by the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," which also bundles the metagen suite. This means we can invoke the target from the command line like so:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meta gen metagen_rs\n"})}),"\n",(0,r.jsx)(n.p,{children:"This should give us the following files:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"\u276f lsd --tree metagen/rs/\n\uf115 rs\n\u251c\u2500\u2500 \ue7a8 Cargo.toml\n\u251c\u2500\u2500 \ue7a8 lib.rs\n\u2514\u2500\u2500 \ue7a8 fdk.rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By default, the ",(0,r.jsx)(n.code,{children:"fdk_rust"})," generator outputs all the necessary files required to build our wasm file. This includes the ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," manifest for our Rust crate."]}),"\n",(0,r.jsx)(s.A,{language:"toml",children:t(86858).content}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"fdk_rust"})," will not overwrite a ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file discovered at generation path so you can add other dependencies if need be."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"fdk.rs"})," file contains all the glue code including the typegraph types."]}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample. It's collapsed here as it's for the most part an\nuninteresting implementation detail."})}),(0,r.jsx)(s.A,{language:"rust",children:t(86496).content})]}),"\n",(0,r.jsx)(n.p,{children:"When working on the typegraph, we can run metagen again to regenerate this file and get the latest types."}),"\n",(0,r.jsxs)(n.p,{children:["The generator also includes a sample ",(0,r.jsx)(n.code,{children:"lib.rs"})," entrypoint file for our crate. We'll modify it now to implement our custom function."]}),"\n",(0,r.jsx)(s.A,{language:"rust",children:t(39028).content}),"\n",(0,r.jsx)(n.h2,{id:"building",children:"Building"}),"\n",(0,r.jsx)(n.p,{children:"We'll now use the rust toolchain and wasm-tools to build the wasm component. This requires multiple commands. It's presented below as a shell script that you can modify from."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"# flags to make script execution visible\nset -eux\n\n# regenerate code before building\nmeta gen metagen_rs\n\n# variablize common names\nTARGET=wasm32-wasi\nCRATE_NAME=metagen_rs_fdk\n\n# build in release mode for smallest sizes\ncargo build -p $CRATE_NAME --target $TARGET --release\n# use wasm-tools to change wasm file into wasm component\nwasm-tools component new \\\n # rust builds the wasm file under the name of the crate\n ./target/$TARGET/debug/$CRATE_NAME.wasm \\\n -o ./target/rust-component.wasm \\\n\n# copy the component to a location that we specified\n# in our typegraph\ncp ./target/rust-component.wasm ./rust.wasm\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Put the shell script into a file like ",(0,r.jsx)(n.code,{children:"build.sh"})," and execute it with a posix compatible shell like ",(0,r.jsx)(n.code,{children:"bash"}),". You should now have all the files to deploy your typegraph."]}),"\n",(0,r.jsx)(a.A,{typegraph:"metagen-rs",typescript:t(86016),python:t(28054),query:t(48734)})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});var r=t(98302),i=(t(30758),t(86070));function a(e){let{python:n,typescript:t,rust:a,...s}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,i.jsx)(r.A,{code:0==o.length?void 0:o,...s})}},48734:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"remix"},arguments:[{kind:"Argument",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"Lovefool",block:!1}},{kind:"Argument",name:{kind:"Name",value:"artist"},value:{kind:"StringValue",value:"The Cardigans",block:!1}},{kind:"Argument",name:{kind:"Name",value:"releaseTime"},value:{kind:"StringValue",value:"1996-06-29T10:30:40.340Z",block:!1}},{kind:"Argument",name:{kind:"Name",value:"mp3Url"},value:{kind:"StringValue",value:"https://mus.ic/lovefool.mp3",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"artist"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"releaseTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mp3Url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:213}};n.loc.source={body:'query {\n remix(\n title: "Lovefool"\n artist: "The Cardigans"\n releaseTime: "1996-06-29T10:30:40.340Z"\n mp3Url: "https://mus.ic/lovefool.mp3"\n ) {\n title\n artist\n releaseTime\n mp3Url\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},28054:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_rs(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n\n # the wire flavour is availible through a static\n # constructor\n wasm = WasmRuntime.wire("metagen/rust.wasm")\n\n g.expose(\n Policy.public(),\n remix=wasm.handler(\n idv3,\n idv3,\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-rs.py"}},86016:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-rs",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n // the wire flavour is availible through a static\n // constructor\n const wasm = WasmRuntime.wire("metagen/rust.wasm");\n\n g.expose(\n {\n remix: wasm\n .handler(\n idv3,\n idv3,\n {\n name: "remix_track",\n }\n // the traits will map to the name of the materializer\n // and also the the name of the handler mentioned above\n )\n .rename("remix_track"),\n },\n Policy.public()\n );\n }\n);',path:"../examples/typegraphs/metagen-rs.ts"}},86858:e=>{e.exports={content:'package.name = "metagen_rs_fdk"\npackage.edition = "2021"\npackage.version = "0.0.1"\n\n# we need to use a specific library crate type to build\n# wasm components in rust\n[lib]\npath = "lib.rs"\ncrate-type = ["cdylib", "rlib"]\n\n# the following dependencies are used by the generated code\n[dependencies]\nanyhow = "1" # error handling\nserde = { version = "1", features = ["derive"] } # serialization\nserde_json = "1" #json serialization\nwit-bindgen = "0.22.0" # wasm component biding\n\n# we set the following flags to minimize code size\n# when buliding in the release mode\n# this keeps our wasm files small\n[profile.release]\nstrip = "symbols"\nopt-level = "z"',path:"../examples/typegraphs/metagen/rs/Cargo.toml"}},86496:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n#![cfg_attr(rustfmt, rustfmt_skip)]\n\n// gen-static-start\n#![allow(dead_code)]\n\npub mod wit {\n wit_bindgen::generate!({\n pub_export_macro: true,\n \n inline: "package metatype:wit-wire;\n\ninterface typegate-wire {\n hostcall: func(op-name: string, json: string) -> result;\n}\n\ninterface mat-wire {\n type json-str = string;\n\n record mat-info {\n op-name: string,\n mat-title: string,\n mat-hash: string,\n mat-data-json: string,\n }\n\n record init-args {\n metatype-version: string,\n expected-ops: list\n }\n\n record init-response {\n ok: bool\n }\n\n variant init-error {\n version-mismatch(string),\n unexpected-mat(mat-info),\n other(string)\n }\n\n init: func(args: init-args) -> result;\n\n record handle-req {\n op-name: string,\n in-json: json-str,\n }\n\n variant handle-err {\n no-handler,\n in-json-err(string),\n handler-err(string),\n }\n\n handle: func(req: handle-req) -> result;\n}\n\nworld wit-wire {\n import typegate-wire;\n\n export mat-wire;\n}\n"\n });\n}\n\nuse std::cell::RefCell;\nuse std::collections::HashMap;\n\nuse wit::exports::metatype::wit_wire::mat_wire::*;\nuse wit::metatype::wit_wire::typegate_wire::hostcall;\n\npub type HandlerFn = Box Result>;\n\npub struct ErasedHandler {\n mat_id: String,\n mat_trait: String,\n mat_title: String,\n handler_fn: HandlerFn,\n}\n\npub struct MatBuilder {\n handlers: HashMap,\n}\n\nimpl MatBuilder {\n pub fn new() -> Self {\n Self {\n handlers: Default::default(),\n }\n }\n\n pub fn register_handler(mut self, handler: ErasedHandler) -> Self {\n self.handlers.insert(handler.mat_trait.clone(), handler);\n self\n }\n}\n\npub struct Router {\n handlers: HashMap,\n}\n\nimpl Router {\n pub fn from_builder(builder: MatBuilder) -> Self {\n Self {\n handlers: builder.handlers,\n }\n }\n\n pub fn init(&self, args: InitArgs) -> Result {\n static MT_VERSION: &str = "0.5.0-rc.4";\n if args.metatype_version != MT_VERSION {\n return Err(InitError::VersionMismatch(MT_VERSION.into()));\n }\n for info in args.expected_ops {\n let mat_trait = stubs::op_to_trait_name(&info.op_name);\n if !self.handlers.contains_key(mat_trait) {\n return Err(InitError::UnexpectedMat(info));\n }\n }\n Ok(InitResponse { ok: true })\n }\n\n pub fn handle(&self, req: HandleReq) -> Result {\n let mat_trait = stubs::op_to_trait_name(&req.op_name);\n let Some(handler) = self.handlers.get(mat_trait) else {\n return Err(HandleErr::NoHandler);\n };\n let cx = Ctx {};\n (handler.handler_fn)(&req.in_json, cx)\n }\n}\n\npub type InitCallback = fn() -> anyhow::Result;\n\nthread_local! {\n pub static MAT_STATE: RefCell = panic!("MAT_STATE has not been initialized");\n}\n\npub struct Ctx {}\n\nimpl Ctx {\n pub fn gql(\n &self,\n query: &str,\n variables: impl Into,\n ) -> Result\n where\n O: serde::de::DeserializeOwned,\n {\n match hostcall(\n "gql",\n &serde_json::to_string(&serde_json::json!({\n "query": query,\n "variables": variables.into(),\n }))?,\n ) {\n Ok(json) => Ok(serde_json::from_str(&json[..])?),\n Err(json) => Err(GraphqlRunError::HostError(serde_json::from_str(&json)?)),\n }\n }\n}\n\n#[derive(Debug)]\npub enum GraphqlRunError {\n JsonError(serde_json::Error),\n HostError(serde_json::Value),\n}\n\nimpl std::error::Error for GraphqlRunError {}\n\nimpl From for GraphqlRunError {\n fn from(value: serde_json::Error) -> Self {\n Self::JsonError(value)\n }\n}\n\nimpl std::fmt::Display for GraphqlRunError {\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n match self {\n GraphqlRunError::JsonError(msg) => write!(f, "json error: {msg}"),\n GraphqlRunError::HostError(serde_json::Value::Object(map))\n if map.contains_key("message") =>\n {\n write!(f, "host error: {}", map["message"])\n }\n GraphqlRunError::HostError(val) => write!(f, "host error: {val:?}"),\n }\n }\n}\n\n#[macro_export]\nmacro_rules! init_mat {\n (hook: $init_hook:expr) => {\n struct MatWireGuest;\n use wit::exports::metatype::wit_wire::mat_wire::*;\n wit::export!(MatWireGuest with_types_in wit);\n\n #[allow(unused)]\n impl Guest for MatWireGuest {\n fn handle(req: HandleReq) -> Result {\n MAT_STATE.with(|router| {\n let router = router.borrow();\n router.handle(req)\n })\n }\n\n fn init(args: InitArgs) -> Result {\n let hook = $init_hook;\n let router = Router::from_builder(hook());\n let resp = router.init(args)?;\n MAT_STATE.set(router);\n Ok(resp)\n }\n }\n };\n}\n// gen-static-end\nuse types::*;\npub mod types {\n pub type Idv3TitleString = String;\n pub type Idv3ReleaseTimeStringDatetime = String;\n pub type Idv3Mp3UrlStringUri = String;\n #[derive(Debug, serde::Serialize, serde::Deserialize)]\n pub struct Idv3 {\n pub title: Idv3TitleString,\n pub artist: Idv3TitleString,\n #[serde(rename = "releaseTime")]\n pub release_time: Idv3ReleaseTimeStringDatetime,\n #[serde(rename = "mp3Url")]\n pub mp3_url: Idv3Mp3UrlStringUri,\n }\n}\npub mod stubs {\n use super::*;\n pub trait RemixTrack: Sized + \'static {\n fn erased(self) -> ErasedHandler {\n ErasedHandler {\n mat_id: "remix_track".into(),\n mat_title: "remix_track".into(),\n mat_trait: "RemixTrack".into(),\n handler_fn: Box::new(move |req, cx| {\n let req = serde_json::from_str(req)\n .map_err(|err| HandleErr::InJsonErr(format!("{err}")))?;\n let res = self\n .handle(req, cx)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))?;\n serde_json::to_string(&res)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))\n }),\n }\n }\n\n fn handle(&self, input: Idv3, cx: Ctx) -> anyhow::Result;\n }\n pub fn op_to_trait_name(op_name: &str) -> &\'static str {\n match op_name {\n "remix_track" => "RemixTrack",\n _ => panic!("unrecognized op_name: {op_name}"),\n }\n }\n}',path:"../examples/typegraphs/metagen/rs/fdk.rs"}},39028:e=>{e.exports={content:'mod fdk;\npub use fdk::*;\n\n// the macro sets up all the glue\ninit_mat! {\n // the hook is expected to return a MatBuilder instance\n hook: || {\n // initialize global stuff here if you need it\n MatBuilder::new()\n // register function handlers here\n // each trait will map to the name of the\n // handler found in the typegraph\n .register_handler(stubs::RemixTrack::erased(MyMat))\n }\n}\n\nstruct MyMat;\n\nimpl stubs::RemixTrack for MyMat {\n fn handle(&self, input: types::Idv3, _cx: Ctx) -> anyhow::Result {\n Ok(types::Idv3 {\n title: format!("{} (Remix)", input.title),\n artist: format!("{} + DJ Cloud", input.artist),\n release_time: input.release_time,\n mp3_url: "https://mp3.url/shumba2".to_string(),\n })\n }\n}',path:"../examples/typegraphs/metagen/rs/lib.rs"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4191],{48372:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>d,toc:()=>u});var r=t(86070),i=t(25710),a=t(65671),s=t(7871);const o={sidebar_position:50},l="Wasm functions",d={id:"guides/wasm-functions/index",title:"Wasm functions",description:"The following feature is not yet stable.",source:"@site/docs/guides/wasm-functions/index.mdx",sourceDirName:"guides/wasm-functions",slug:"/guides/wasm-functions/",permalink:"/docs/guides/wasm-functions/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/guides/wasm-functions/index.mdx",tags:[],version:"current",sidebarPosition:50,frontMatter:{sidebar_position:50},sidebar:"docs",previous:{title:"Secure your requests",permalink:"/docs/guides/securing-requests/"},next:{title:"Self-host the Typegate",permalink:"/docs/guides/self-hosting"}},c={},u=[{value:"Tooling",id:"tooling",level:2},{value:"Typegraph",id:"typegraph",level:2},{value:"Metagen",id:"metagen",level:2},{value:"Building",id:"building",level:2}];function m(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,i.R)(),...e.components},{Details:o}=n;return o||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"wasm-functions",children:"Wasm functions"}),"\n",(0,r.jsx)(n.admonition,{title:"Beta",type:"warning",children:(0,r.jsx)(n.p,{children:"The following feature is not yet stable."})}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.a,{href:"/docs/reference/runtimes/wasm",children:(0,r.jsx)(n.code,{children:"WasmRuntime"})})," enables one to use any langauge/ecosystem with a toolchain capable of producing wasm artifacts to author ",(0,r.jsx)(n.a,{href:"/docs/guides/external-functions",children:"custom functions"}),". ",(0,r.jsx)(n.a,{href:"https://rust-lang.org",children:"Rust"})," is one such a language and has shaped up to be the hotspot of development in the wasm ecosystem (The Metatype itself platform has many rusty parts). In this guide, we'll see how to set up a workflow for using Rust for our custom functions."]}),"\n",(0,r.jsx)(n.h2,{id:"tooling",children:"Tooling"}),"\n",(0,r.jsx)(n.p,{children:"We need to install several programs to be able to produce the components. The following checklist contains links to get you started:"}),"\n",(0,r.jsxs)(n.ol,{children:["\n",(0,r.jsxs)(n.li,{children:["Rust compiler toolchain: this guide assumes moderate familiartiy of development with rust and won't spend many words on how to get it functional. In any case, you can get started with rust ",(0,r.jsx)(n.a,{href:"https://www.rust-lang.org/learn/get-started",children:"here"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"wasm32-unknown-unknown"})," target for rustc: This is the backend that rustc uses to produce wasi compatible wasm components. If you're using ",(0,r.jsx)(n.code,{children:"rustup"})," to manage your toolchain, Cargo will automatically install the target when you're building."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"wasm-tools"}),": this is the swiss army knife for working with wasm artifacts, courtesy of the ",(0,r.jsx)(n.a,{href:"https://bytecodealliance.org/",children:"Bytecode Alliance"}),". Installation instructions can be found ",(0,r.jsx)(n.a,{href:"https://github.com/bytecodealliance/wasm-tools/",children:"here"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"typegraph",children:"Typegraph"}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," currently comes in two flavours that are both based on the wasm component spec. This guide focues on the ",(0,r.jsx)(n.code,{children:"wire"})," flavour, where your component is expected to implement a standard WIT interface that's designed around a simple Json based RPC wire format. Thankfully, all of that boilerplate is easy to automate away and that's exactly what we'll do using ",(0,r.jsx)(n.a,{href:"/docs/reference/metagen",children:"metagen"})," to generate the binding code."]}),"\n",(0,r.jsx)(n.p,{children:"Before anything though, we need to author the typegraph:"}),"\n",(0,r.jsx)(a.A,{python:t(28054),typescript:t(86016),disablePlayground:!0}),"\n",(0,r.jsxs)(n.p,{children:["Note that the ",(0,r.jsx)(n.code,{children:"WasmRuntime"})," constructor mentions a non-existent wasm file on disk. This won't be a problem for the metagen generators but we'll need to produce the artifact before we deploy the typegraph. We'll see what buliding the artifact entails in just a minute."]}),"\n",(0,r.jsx)(n.h2,{id:"metagen",children:"Metagen"}),"\n",(0,r.jsxs)(n.p,{children:["We can now tackle the boilerplate. Metagen bundles the ",(0,r.jsx)(n.a,{href:"/docs/reference/metagen#fdk_rust",children:(0,r.jsx)(n.code,{children:"fdk_rust"})})," generator which can generate all the glue code along with Rust types that correspond to our typegraph types. Let's configure a metagen target in our configuration file to get just that done."]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"metagen:\n targets:\n metagen_rs:\n # this is the generator we're interested in\n - generator: fdk_rust\n # the location where to put the generated files\n path: ./metagen/rs/\n # the path to our typegraph\n typegraph_path: ./metagen-rs.ts\n"})}),"\n",(0,r.jsxs)(n.p,{children:["The configuration file is read by the ",(0,r.jsx)(n.a,{href:"/docs/reference/meta-cli",children:"meta CLI"})," which also bundles the metagen suite. This means we can invoke the target from the command line like so:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"meta gen metagen_rs\n"})}),"\n",(0,r.jsx)(n.p,{children:"This should give us the following files:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-shell",children:"\u276f lsd --tree metagen/rs/\n\uf115 rs\n\u251c\u2500\u2500 \ue7a8 Cargo.toml\n\u251c\u2500\u2500 \ue7a8 lib.rs\n\u2514\u2500\u2500 \ue7a8 fdk.rs\n"})}),"\n",(0,r.jsxs)(n.p,{children:["By default, the ",(0,r.jsx)(n.code,{children:"fdk_rust"})," generator outputs all the necessary files required to build our wasm file. This includes the ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," manifest for our Rust crate."]}),"\n",(0,r.jsx)(s.A,{language:"toml",children:t(86858).content}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"fdk_rust"})," will not overwrite a ",(0,r.jsx)(n.code,{children:"Cargo.toml"})," file discovered at generation path so you can add other dependencies if need be."]}),"\n",(0,r.jsxs)(n.p,{children:["The ",(0,r.jsx)(n.code,{children:"fdk.rs"})," file contains all the glue code including the typegraph types."]}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsx)("summary",{children:(0,r.jsx)(n.p,{children:"Code generation sample. It's collapsed here as it's for the most part an\nuninteresting implementation detail."})}),(0,r.jsx)(s.A,{language:"rust",children:t(86496).content})]}),"\n",(0,r.jsx)(n.p,{children:"When working on the typegraph, we can run metagen again to regenerate this file and get the latest types."}),"\n",(0,r.jsxs)(n.p,{children:["The generator also includes a sample ",(0,r.jsx)(n.code,{children:"lib.rs"})," entrypoint file for our crate. We'll modify it now to implement our custom function."]}),"\n",(0,r.jsx)(s.A,{language:"rust",children:t(39028).content}),"\n",(0,r.jsx)(n.h2,{id:"building",children:"Building"}),"\n",(0,r.jsx)(n.p,{children:"We'll now use the rust toolchain and wasm-tools to build the wasm component. This requires multiple commands. It's presented below as a shell script that you can modify from."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"# flags to make script execution visible\nset -eux\n\n# regenerate code before building\nmeta gen metagen_rs\n\n# variablize common names\nTARGET=wasm32-wasi\nCRATE_NAME=metagen_rs_fdk\n\n# build in release mode for smallest sizes\ncargo build -p $CRATE_NAME --target $TARGET --release\n# use wasm-tools to change wasm file into wasm component\nwasm-tools component new \\\n # rust builds the wasm file under the name of the crate\n ./target/$TARGET/debug/$CRATE_NAME.wasm \\\n -o ./target/rust-component.wasm \\\n\n# copy the component to a location that we specified\n# in our typegraph\ncp ./target/rust-component.wasm ./rust.wasm\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Put the shell script into a file like ",(0,r.jsx)(n.code,{children:"build.sh"})," and execute it with a posix compatible shell like ",(0,r.jsx)(n.code,{children:"bash"}),". You should now have all the files to deploy your typegraph."]}),"\n",(0,r.jsx)(a.A,{typegraph:"metagen-rs",typescript:t(86016),python:t(28054),query:t(48734)})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(m,{...e})}):m(e)}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});var r=t(98302),i=(t(30758),t(86070));function a(e){let{python:n,typescript:t,rust:a,...s}=e;const o=[n&&{content:n.content,codeLanguage:"python",codeFileUrl:n.path},t&&{content:t.content,codeLanguage:"typescript",codeFileUrl:t.path},a&&{content:a.content,codeLanguage:"rust",codeFileUrl:a.path}].filter((e=>!!e));return(0,i.jsx)(r.A,{code:0==o.length?void 0:o,...s})}},48734:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"remix"},arguments:[{kind:"Argument",name:{kind:"Name",value:"title"},value:{kind:"StringValue",value:"Lovefool",block:!1}},{kind:"Argument",name:{kind:"Name",value:"artist"},value:{kind:"StringValue",value:"The Cardigans",block:!1}},{kind:"Argument",name:{kind:"Name",value:"releaseTime"},value:{kind:"StringValue",value:"1996-06-29T10:30:40.340Z",block:!1}},{kind:"Argument",name:{kind:"Name",value:"mp3Url"},value:{kind:"StringValue",value:"https://mus.ic/lovefool.mp3",block:!1}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"artist"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"releaseTime"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"mp3Url"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:213}};n.loc.source={body:'query {\n remix(\n title: "Lovefool"\n artist: "The Cardigans"\n releaseTime: "1996-06-29T10:30:40.340Z"\n mp3Url: "https://mus.ic/lovefool.mp3"\n ) {\n title\n artist\n releaseTime\n mp3Url\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 r=e.type;"NamedType"===r.kind&&n.add(r.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 r={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),r[e.name.value]=n}})),e.exports=n},28054:e=>{e.exports={content:'@typegraph(\n)\ndef metagen_rs(g: Graph):\n idv3 = t.struct(\n {\n "title": t.string(),\n "artist": t.string(),\n "releaseTime": t.datetime(),\n "mp3Url": t.uri(),\n # explicit type names help when generating code\n }\n ).rename("idv3")\n\n # the wire flavour is availible through a static\n # constructor\n wasm = WasmRuntime.wire("metagen/rust.wasm")\n\n g.expose(\n Policy.public(),\n remix=wasm.handler(\n idv3,\n idv3,\n name="remix_track",\n ).rename("remix_track"), # explicit names help\n )',path:"../examples/typegraphs/metagen-rs.py"}},86016:e=>{e.exports={content:'await typegraph(\n {\n name: "metagen-rs",\n },\n (g) => {\n const idv3 = t\n .struct({\n title: t.string(),\n artist: t.string(),\n releaseTime: t.datetime(),\n mp3Url: t.uri(),\n // explicit type names help when generating code\n })\n .rename("idv3");\n\n // the wire flavour is availible through a static\n // constructor\n const wasm = WasmRuntime.wire("metagen/rust.wasm");\n\n g.expose(\n {\n remix: wasm\n .handler(\n idv3,\n idv3,\n {\n name: "remix_track",\n },\n // the traits will map to the name of the materializer\n // and also the the name of the handler mentioned above\n )\n .rename("remix_track"),\n },\n Policy.public(),\n );\n },\n);',path:"../examples/typegraphs/metagen-rs.ts"}},86858:e=>{e.exports={content:'package.name = "metagen_rs_fdk"\npackage.edition = "2021"\npackage.version = "0.0.1"\n\n# we need to use a specific library crate type to build\n# wasm components in rust\n[lib]\npath = "lib.rs"\ncrate-type = ["cdylib", "rlib"]\n\n# the following dependencies are used by the generated code\n[dependencies]\nanyhow = "1" # error handling\nserde = { version = "1", features = ["derive"] } # serialization\nserde_json = "1" #json serialization\nwit-bindgen = "0.22.0" # wasm component biding\n\n# we set the following flags to minimize code size\n# when buliding in the release mode\n# this keeps our wasm files small\n[profile.release]\nstrip = "symbols"\nopt-level = "z"',path:"../examples/typegraphs/metagen/rs/Cargo.toml"}},86496:e=>{e.exports={content:'// This file was @generated by metagen and is intended\n// to be generated again on subsequent metagen runs.\n#![cfg_attr(rustfmt, rustfmt_skip)]\n\n// gen-static-start\n#![allow(dead_code)]\n\npub mod wit {\n wit_bindgen::generate!({\n pub_export_macro: true,\n \n inline: "package metatype:wit-wire;\n\ninterface typegate-wire {\n hostcall: func(op-name: string, json: string) -> result;\n}\n\ninterface mat-wire {\n type json-str = string;\n\n record mat-info {\n op-name: string,\n mat-title: string,\n mat-hash: string,\n mat-data-json: string,\n }\n\n record init-args {\n metatype-version: string,\n expected-ops: list\n }\n\n record init-response {\n ok: bool\n }\n\n variant init-error {\n version-mismatch(string),\n unexpected-mat(mat-info),\n other(string)\n }\n\n init: func(args: init-args) -> result;\n\n record handle-req {\n op-name: string,\n in-json: json-str,\n }\n\n variant handle-err {\n no-handler,\n in-json-err(string),\n handler-err(string),\n }\n\n handle: func(req: handle-req) -> result;\n}\n\nworld wit-wire {\n import typegate-wire;\n\n export mat-wire;\n}\n"\n });\n}\n\nuse std::cell::RefCell;\nuse std::collections::HashMap;\n\nuse wit::exports::metatype::wit_wire::mat_wire::*;\nuse wit::metatype::wit_wire::typegate_wire::hostcall;\n\npub type HandlerFn = Box Result>;\n\npub struct ErasedHandler {\n mat_id: String,\n mat_trait: String,\n mat_title: String,\n handler_fn: HandlerFn,\n}\n\npub struct MatBuilder {\n handlers: HashMap,\n}\n\nimpl MatBuilder {\n pub fn new() -> Self {\n Self {\n handlers: Default::default(),\n }\n }\n\n pub fn register_handler(mut self, handler: ErasedHandler) -> Self {\n self.handlers.insert(handler.mat_trait.clone(), handler);\n self\n }\n}\n\npub struct Router {\n handlers: HashMap,\n}\n\nimpl Router {\n pub fn from_builder(builder: MatBuilder) -> Self {\n Self {\n handlers: builder.handlers,\n }\n }\n\n pub fn init(&self, args: InitArgs) -> Result {\n static MT_VERSION: &str = "0.5.0-rc.6";\n if args.metatype_version != MT_VERSION {\n return Err(InitError::VersionMismatch(MT_VERSION.into()));\n }\n for info in args.expected_ops {\n let mat_trait = stubs::op_to_trait_name(&info.op_name);\n if !self.handlers.contains_key(mat_trait) {\n return Err(InitError::UnexpectedMat(info));\n }\n }\n Ok(InitResponse { ok: true })\n }\n\n pub fn handle(&self, req: HandleReq) -> Result {\n let mat_trait = stubs::op_to_trait_name(&req.op_name);\n let Some(handler) = self.handlers.get(mat_trait) else {\n return Err(HandleErr::NoHandler);\n };\n let cx = Ctx {};\n (handler.handler_fn)(&req.in_json, cx)\n }\n}\n\npub type InitCallback = fn() -> anyhow::Result;\n\nthread_local! {\n pub static MAT_STATE: RefCell = panic!("MAT_STATE has not been initialized");\n}\n\npub struct Ctx {}\n\nimpl Ctx {\n pub fn gql(\n &self,\n query: &str,\n variables: impl Into,\n ) -> Result\n where\n O: serde::de::DeserializeOwned,\n {\n match hostcall(\n "gql",\n &serde_json::to_string(&serde_json::json!({\n "query": query,\n "variables": variables.into(),\n }))?,\n ) {\n Ok(json) => Ok(serde_json::from_str(&json[..])?),\n Err(json) => Err(GraphqlRunError::HostError(serde_json::from_str(&json)?)),\n }\n }\n}\n\n#[derive(Debug)]\npub enum GraphqlRunError {\n JsonError(serde_json::Error),\n HostError(serde_json::Value),\n}\n\nimpl std::error::Error for GraphqlRunError {}\n\nimpl From for GraphqlRunError {\n fn from(value: serde_json::Error) -> Self {\n Self::JsonError(value)\n }\n}\n\nimpl std::fmt::Display for GraphqlRunError {\n fn fmt(&self, f: &mut std::fmt::Formatter<\'_>) -> std::fmt::Result {\n match self {\n GraphqlRunError::JsonError(msg) => write!(f, "json error: {msg}"),\n GraphqlRunError::HostError(serde_json::Value::Object(map))\n if map.contains_key("message") =>\n {\n write!(f, "host error: {}", map["message"])\n }\n GraphqlRunError::HostError(val) => write!(f, "host error: {val:?}"),\n }\n }\n}\n\n#[macro_export]\nmacro_rules! init_mat {\n (hook: $init_hook:expr) => {\n struct MatWireGuest;\n use wit::exports::metatype::wit_wire::mat_wire::*;\n wit::export!(MatWireGuest with_types_in wit);\n\n #[allow(unused)]\n impl Guest for MatWireGuest {\n fn handle(req: HandleReq) -> Result {\n MAT_STATE.with(|router| {\n let router = router.borrow();\n router.handle(req)\n })\n }\n\n fn init(args: InitArgs) -> Result {\n let hook = $init_hook;\n let router = Router::from_builder(hook());\n let resp = router.init(args)?;\n MAT_STATE.set(router);\n Ok(resp)\n }\n }\n };\n}\n// gen-static-end\nuse types::*;\npub mod types {\n pub type Idv3TitleString = String;\n pub type Idv3ReleaseTimeStringDatetime = String;\n pub type Idv3Mp3UrlStringUri = String;\n #[derive(Debug, serde::Serialize, serde::Deserialize)]\n pub struct Idv3 {\n pub title: Idv3TitleString,\n pub artist: Idv3TitleString,\n #[serde(rename = "releaseTime")]\n pub release_time: Idv3ReleaseTimeStringDatetime,\n #[serde(rename = "mp3Url")]\n pub mp3_url: Idv3Mp3UrlStringUri,\n }\n}\npub mod stubs {\n use super::*;\n pub trait RemixTrack: Sized + \'static {\n fn erased(self) -> ErasedHandler {\n ErasedHandler {\n mat_id: "remix_track".into(),\n mat_title: "remix_track".into(),\n mat_trait: "RemixTrack".into(),\n handler_fn: Box::new(move |req, cx| {\n let req = serde_json::from_str(req)\n .map_err(|err| HandleErr::InJsonErr(format!("{err}")))?;\n let res = self\n .handle(req, cx)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))?;\n serde_json::to_string(&res)\n .map_err(|err| HandleErr::HandlerErr(format!("{err}")))\n }),\n }\n }\n\n fn handle(&self, input: Idv3, cx: Ctx) -> anyhow::Result;\n }\n pub fn op_to_trait_name(op_name: &str) -> &\'static str {\n match op_name {\n "remix_track" => "RemixTrack",\n _ => panic!("unrecognized op_name: {op_name}"),\n }\n }\n}',path:"../examples/typegraphs/metagen/rs/fdk.rs"}},39028:e=>{e.exports={content:'mod fdk;\npub use fdk::*;\n\n// the macro sets up all the glue\ninit_mat! {\n // the hook is expected to return a MatBuilder instance\n hook: || {\n // initialize global stuff here if you need it\n MatBuilder::new()\n // register function handlers here\n // each trait will map to the name of the\n // handler found in the typegraph\n .register_handler(stubs::RemixTrack::erased(MyMat))\n }\n}\n\nstruct MyMat;\n\nimpl stubs::RemixTrack for MyMat {\n fn handle(&self, input: types::Idv3, _cx: Ctx) -> anyhow::Result {\n Ok(types::Idv3 {\n title: format!("{} (Remix)", input.title),\n artist: format!("{} + DJ Cloud", input.artist),\n release_time: input.release_time,\n mp3_url: "https://mp3.url/shumba2".to_string(),\n })\n }\n}',path:"../examples/typegraphs/metagen/rs/lib.rs"}}}]); \ No newline at end of file diff --git a/assets/js/e66bdb87.2ae9a129.js b/assets/js/e66bdb87.c22dbf33.js similarity index 87% rename from assets/js/e66bdb87.2ae9a129.js rename to assets/js/e66bdb87.c22dbf33.js index 86ff4784bb..a6faa4152d 100644 --- a/assets/js/e66bdb87.2ae9a129.js +++ b/assets/js/e66bdb87.c22dbf33.js @@ -1 +1 @@ -(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4591],{4391:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>d,metadata:()=>l,toc:()=>m});var i=t(86070),r=t(25710),o=t(65671),a=t(65480),s=t(27676);const d={},c="Random",l={id:"reference/runtimes/random/index",title:"Random",description:"Random runtime",source:"@site/docs/reference/runtimes/random/index.mdx",sourceDirName:"reference/runtimes/random",slug:"/reference/runtimes/random/",permalink:"/docs/reference/runtimes/random/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/random/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Python",permalink:"/docs/reference/runtimes/python/"},next:{title:"S3",permalink:"/docs/reference/runtimes/s3/"}},u={},m=[{value:"Random runtime",id:"random-runtime",level:2},{value:"Generators",id:"generators",level:2}];function p(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"random",children:"Random"}),"\n",(0,i.jsx)(n.h2,{id:"random-runtime",children:"Random runtime"}),"\n",(0,i.jsxs)(n.p,{children:["The Random runtime allows you to produce ",(0,i.jsx)(n.em,{children:"structured"})," datas randomly."]}),"\n",(0,i.jsx)(n.p,{children:"One use case is to use this runtime as way of testing, for example you can rapidly draft a small backend that produces structured data for your frontend application."}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"seed"})," parameter ensures repeatability if set."]}),"\n",(0,i.jsx)(o.A,{python:t(40433),typescript:t(59175),typegraph:"roadmap-random",query:t(4193)}),"\n",(0,i.jsx)(n.p,{children:"Another use case is to inject random values to a function input"}),"\n",(0,i.jsx)(o.A,{typegraph:"random-field",python:t(5539),typescript:t(30461),query:t(75562)}),"\n",(0,i.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,i.jsxs)(n.p,{children:["Here is a list of some standard generators that you can attach to your type, if ",(0,i.jsx)(n.em,{children:"unspecifed"}),", it will default on generating any values that the associated type can hold."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{style:{textAlign:"center"},children:"Generator config"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.string()"})}),(0,i.jsxs)(n.td,{style:{textAlign:"center"},children:[(0,i.jsx)(n.code,{children:"name"}),", ",(0,i.jsx)(n.code,{children:"address"}),", ",(0,i.jsx)(n.code,{children:"postcode"}),", ",(0,i.jsx)(n.code,{children:"country"}),", ",(0,i.jsx)(n.code,{children:"email"}),", ",(0,i.jsx)(n.code,{children:"uuid"}),", ",(0,i.jsx)(n.code,{children:"uri"}),", ",(0,i.jsx)(n.code,{children:"hostname"}),", ",(0,i.jsx)(n.code,{children:"date"}),", ",(0,i.jsx)(n.code,{children:"time"}),", ",(0,i.jsx)(n.code,{children:"phone"}),", ",(0,i.jsx)(n.code,{children:"ean"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"t.integer()"}),", ",(0,i.jsx)(n.code,{children:"t.float()"})]}),(0,i.jsx)(n.td,{style:{textAlign:"center"},children:(0,i.jsx)(n.code,{children:"age"})})]})]})]}),"\n",(0,i.jsxs)(a.Ay,{children:[(0,i.jsx)(s.A,{value:"python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'user = t.struct(\n {\n "id": t.uuid(), # random uuid\n "name": t.string(config={"gen": "name"}), # random name\n "age": t.integer(config={"gen": "age", "type": "adult"}), # type: "child", "adult"\n "email": t.email(),\n "address": t.struct(\n {\n "street": t.string(config={"gen": "address"}),\n "city": t.string(config={"gen": "city"}),\n "postcode": t.string(config={"gen": "postcode"}),\n "country": t.string(config={"gen": "country", "full": True}),\n }\n ),\n }\n)\n'})})}),(0,i.jsx)(s.A,{value:"typescript",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:'const user = t.struct(\n {\n id: t.uuid(), // random uuid\n name: t.string({}, { config: { gen: "name" } }), // random name\n age: t.integer({}, { config: { gen: "age", type: "adult" } }), // type: "child", "adult"\n email: t.email(),\n address: t.struct(\n {\n street: t.string({}, { config: { gen: "address" } }),\n city: t.string({}, { config: { gen: "city" } }),\n postcode: t.string({}, { config: { gen: "postcode"} }),\n country: t.string({}, { config: { gen: "country", full: true } }),\n }\n ),\n }\n)\n'})})})]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>a,gc:()=>s});t(30758);var i=t(3733),r=t(56315),o=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,i.e)();return(0,o.jsx)(r.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function s(e){let{children:n}=e;const[t]=(0,i.e)();return(0,o.jsx)(r.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var i=t(98302),r=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...a}=e;const s=[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,r.jsx)(i.A,{code:0==s.length?void 0:s,...a})}},75562:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"bonus1"},name:{kind:"Name",value:"get_bonus"},arguments:[{kind:"Argument",name:{kind:"Name",value:"performance"},value:{kind:"IntValue",value:"200"}}],directives:[]},{kind:"Field",alias:{kind:"Name",value:"bonus2"},name:{kind:"Name",value:"get_bonus"},arguments:[{kind:"Argument",name:{kind:"Name",value:"performance"},value:{kind:"IntValue",value:"27"}}],directives:[]}]}}],loc:{start:0,end:85}};n.loc.source={body:"query {\n bonus1: get_bonus(performance: 200)\n bonus2: get_bonus(performance: 27)\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},4193:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_idea"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:61}};n.loc.source={body:"query {\n get_idea {\n id\n # name\n authorEmail\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},5539:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n\n\n@typegraph(\n)\ndef random_field(g: Graph):\n deno = DenoRuntime()\n pub = Policy.public()\n\n bonus_items = t.list(t.enum(["+1 gold", "+1 metal"]))\n daily_bonus = t.struct(\n {\n "performance": t.integer(),\n "bonus": bonus_items.from_random(), # this field is now generated randomly\n }\n )\n\n # set a custom seed\n g.configure_random_injection(seed=1234)\n\n g.expose(\n pub,\n get_bonus=deno.func(\n daily_bonus,\n t.string(),\n code="""({ performance, bonus }) => `Daily bonus: ${\n (performance > 100 ? bonus : [\'none\']).join(\', \')\n }`;\n """,\n ),\n )',path:"../examples/typegraphs/random-field.py"}},30461:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\ntypegraph(\n {\n name: "random-field",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const bonusItems = t.list(t.enum_(["+1 gold", "+1 metal"]));\n const dailyBonus = t.struct({\n performance: t.integer(),\n bonus: bonusItems.fromRandom(), // this field is now generated randomly\n });\n\n // set a custom seed\n g.configureRandomInjection({ seed: 1234 });\n\n g.expose(\n {\n get_bonus: deno.func(dailyBonus, t.string(), {\n code: ({ performance, bonus }) =>\n `Daily bonus: ${(performance > 100 ? bonus : ["none"]).join(", ")}`,\n }),\n },\n pub\n );\n }\n);',path:"../examples/typegraphs/random-field.ts"}},40433:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.random import RandomRuntime\n\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n idea = t.struct(\n {\n "id": t.uuid(\n as_id=True\n ), # uuid is just a shorthand alias for `t.string({format: "uuid"})`\n "name": t.string(),\n "authorEmail": t.email(), # another string shorthand\n }\n )\n random = RandomRuntime(reset=None, seed=1)\n pub = Policy.public()\n g.expose(pub, get_idea=random.gen(idea))',path:"../examples/typegraphs/roadmap-random.py"}},59175:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\n\ntypegraph(\n {\n name: "roadmap-random",\n },\n (g) => {\n\n const idea = t.struct({\n id: t.uuid({ asId: true }), // uuid is just a shorthand alias for `t.string({}, {{format: "uuid"}: undefined})`\n name: t.string(),\n authorEmail: t.email(), // another string shorthand\n });\n\n const random = new RandomRuntime({ seed: 1 });\n const pub = Policy.public();\n g.expose({ get_idea: random.gen(idea) }, pub);\n }\n);',path:"../examples/typegraphs/roadmap-random.ts"}}}]); \ No newline at end of file +(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4591],{4391:(e,n,t)=>{"use strict";t.r(n),t.d(n,{assets:()=>u,contentTitle:()=>c,default:()=>h,frontMatter:()=>d,metadata:()=>l,toc:()=>m});var i=t(86070),r=t(25710),o=t(65671),a=t(65480),s=t(27676);const d={},c="Random",l={id:"reference/runtimes/random/index",title:"Random",description:"Random runtime",source:"@site/docs/reference/runtimes/random/index.mdx",sourceDirName:"reference/runtimes/random",slug:"/reference/runtimes/random/",permalink:"/docs/reference/runtimes/random/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/runtimes/random/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Python",permalink:"/docs/reference/runtimes/python/"},next:{title:"S3",permalink:"/docs/reference/runtimes/s3/"}},u={},m=[{value:"Random runtime",id:"random-runtime",level:2},{value:"Generators",id:"generators",level:2}];function p(e){const n={code:"code",em:"em",h1:"h1",h2:"h2",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"random",children:"Random"}),"\n",(0,i.jsx)(n.h2,{id:"random-runtime",children:"Random runtime"}),"\n",(0,i.jsxs)(n.p,{children:["The Random runtime allows you to produce ",(0,i.jsx)(n.em,{children:"structured"})," datas randomly."]}),"\n",(0,i.jsx)(n.p,{children:"One use case is to use this runtime as way of testing, for example you can rapidly draft a small backend that produces structured data for your frontend application."}),"\n",(0,i.jsxs)(n.p,{children:["The ",(0,i.jsx)(n.code,{children:"seed"})," parameter ensures repeatability if set."]}),"\n",(0,i.jsx)(o.A,{python:t(40433),typescript:t(59175),typegraph:"roadmap-random",query:t(4193)}),"\n",(0,i.jsx)(n.p,{children:"Another use case is to inject random values to a function input"}),"\n",(0,i.jsx)(o.A,{typegraph:"random-field",python:t(5539),typescript:t(30461),query:t(75562)}),"\n",(0,i.jsx)(n.h2,{id:"generators",children:"Generators"}),"\n",(0,i.jsxs)(n.p,{children:["Here is a list of some standard generators that you can attach to your type, if ",(0,i.jsx)(n.em,{children:"unspecifed"}),", it will default on generating any values that the associated type can hold."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{style:{textAlign:"center"},children:"Generator config"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"t.string()"})}),(0,i.jsxs)(n.td,{style:{textAlign:"center"},children:[(0,i.jsx)(n.code,{children:"name"}),", ",(0,i.jsx)(n.code,{children:"address"}),", ",(0,i.jsx)(n.code,{children:"postcode"}),", ",(0,i.jsx)(n.code,{children:"country"}),", ",(0,i.jsx)(n.code,{children:"email"}),", ",(0,i.jsx)(n.code,{children:"uuid"}),", ",(0,i.jsx)(n.code,{children:"uri"}),", ",(0,i.jsx)(n.code,{children:"hostname"}),", ",(0,i.jsx)(n.code,{children:"date"}),", ",(0,i.jsx)(n.code,{children:"time"}),", ",(0,i.jsx)(n.code,{children:"phone"}),", ",(0,i.jsx)(n.code,{children:"ean"})]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"t.integer()"}),", ",(0,i.jsx)(n.code,{children:"t.float()"})]}),(0,i.jsx)(n.td,{style:{textAlign:"center"},children:(0,i.jsx)(n.code,{children:"age"})})]})]})]}),"\n",(0,i.jsxs)(a.Ay,{children:[(0,i.jsx)(s.A,{value:"python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'user = t.struct(\n {\n "id": t.uuid(), # random uuid\n "name": t.string(config={"gen": "name"}), # random name\n "age": t.integer(config={"gen": "age", "type": "adult"}), # type: "child", "adult"\n "email": t.email(),\n "address": t.struct(\n {\n "street": t.string(config={"gen": "address"}),\n "city": t.string(config={"gen": "city"}),\n "postcode": t.string(config={"gen": "postcode"}),\n "country": t.string(config={"gen": "country", "full": True}),\n }\n ),\n }\n)\n'})})}),(0,i.jsx)(s.A,{value:"typescript",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-typescript",children:'const user = t.struct(\n {\n id: t.uuid(), // random uuid\n name: t.string({}, { config: { gen: "name" } }), // random name\n age: t.integer({}, { config: { gen: "age", type: "adult" } }), // type: "child", "adult"\n email: t.email(),\n address: t.struct(\n {\n street: t.string({}, { config: { gen: "address" } }),\n city: t.string({}, { config: { gen: "city" } }),\n postcode: t.string({}, { config: { gen: "postcode"} }),\n country: t.string({}, { config: { gen: "country", full: true } }),\n }\n ),\n }\n)\n'})})})]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},65480:(e,n,t)=>{"use strict";t.d(n,{Ay:()=>a,gc:()=>s});t(30758);var i=t(3733),r=t(56315),o=t(86070);function a(e){let{children:n}=e;const[t,a]=(0,i.e)();return(0,o.jsx)(r.mS,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,onChange:a,children:n})}function s(e){let{children:n}=e;const[t]=(0,i.e)();return(0,o.jsx)(r.q9,{choices:{typescript:"Typescript SDK",python:"Python SDK"},choice:t,children:n})}},65671:(e,n,t)=>{"use strict";t.d(n,{A:()=>o});var i=t(98302),r=(t(30758),t(86070));function o(e){let{python:n,typescript:t,rust:o,...a}=e;const s=[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,r.jsx)(i.A,{code:0==s.length?void 0:s,...a})}},75562:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:{kind:"Name",value:"bonus1"},name:{kind:"Name",value:"get_bonus"},arguments:[{kind:"Argument",name:{kind:"Name",value:"performance"},value:{kind:"IntValue",value:"200"}}],directives:[]},{kind:"Field",alias:{kind:"Name",value:"bonus2"},name:{kind:"Name",value:"get_bonus"},arguments:[{kind:"Argument",name:{kind:"Name",value:"performance"},value:{kind:"IntValue",value:"27"}}],directives:[]}]}}],loc:{start:0,end:85}};n.loc.source={body:"query {\n bonus1: get_bonus(performance: 200)\n bonus2: get_bonus(performance: 27)\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},4193:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_idea"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"authorEmail"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:61}};n.loc.source={body:"query {\n get_idea {\n id\n # name\n authorEmail\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 i=e.type;"NamedType"===i.kind&&n.add(i.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 i={};n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),i[e.name.value]=n}})),e.exports=n},5539:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.deno import DenoRuntime\n\n\n\n@typegraph(\n)\ndef random_field(g: Graph):\n deno = DenoRuntime()\n pub = Policy.public()\n\n bonus_items = t.list(t.enum(["+1 gold", "+1 metal"]))\n daily_bonus = t.struct(\n {\n "performance": t.integer(),\n "bonus": bonus_items.from_random(), # this field is now generated randomly\n }\n )\n\n # set a custom seed\n g.configure_random_injection(seed=1234)\n\n g.expose(\n pub,\n get_bonus=deno.func(\n daily_bonus,\n t.string(),\n code="""({ performance, bonus }) => `Daily bonus: ${\n (performance > 100 ? bonus : [\'none\']).join(\', \')\n }`;\n """,\n ),\n )',path:"../examples/typegraphs/random-field.py"}},30461:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { DenoRuntime } from "@typegraph/sdk/runtimes/deno.ts";\n\ntypegraph(\n {\n name: "random-field",\n },\n (g) => {\n const deno = new DenoRuntime();\n const pub = Policy.public();\n\n const bonusItems = t.list(t.enum_(["+1 gold", "+1 metal"]));\n const dailyBonus = t.struct({\n performance: t.integer(),\n bonus: bonusItems.fromRandom(), // this field is now generated randomly\n });\n\n // set a custom seed\n g.configureRandomInjection({ seed: 1234 });\n\n g.expose(\n {\n get_bonus: deno.func(dailyBonus, t.string(), {\n code: ({ performance, bonus }) =>\n `Daily bonus: ${(performance > 100 ? bonus : ["none"]).join(", ")}`,\n }),\n },\n pub,\n );\n },\n);',path:"../examples/typegraphs/random-field.ts"}},40433:e=>{e.exports={content:'from typegraph import typegraph, Policy, t, Graph\nfrom typegraph.runtimes.random import RandomRuntime\n\n\n\n@typegraph(\n)\ndef roadmap(g: Graph):\n idea = t.struct(\n {\n "id": t.uuid(\n as_id=True\n ), # uuid is just a shorthand alias for `t.string({format: "uuid"})`\n "name": t.string(),\n "authorEmail": t.email(), # another string shorthand\n }\n )\n random = RandomRuntime(reset=None, seed=1)\n pub = Policy.public()\n g.expose(pub, get_idea=random.gen(idea))',path:"../examples/typegraphs/roadmap-random.py"}},59175:e=>{e.exports={content:'import { Policy, t, typegraph } from "@typegraph/sdk/index.ts";\nimport { RandomRuntime } from "@typegraph/sdk/runtimes/random.ts";\n\n\ntypegraph(\n {\n name: "roadmap-random",\n },\n (g) => {\n\n const idea = t.struct({\n id: t.uuid({ asId: true }), // uuid is just a shorthand alias for `t.string({}, {{format: "uuid"}: undefined})`\n name: t.string(),\n authorEmail: t.email(), // another string shorthand\n });\n\n const random = new RandomRuntime({ seed: 1 });\n const pub = Policy.public();\n g.expose({ get_idea: random.gen(idea) }, pub);\n },\n);',path:"../examples/typegraphs/roadmap-random.ts"}}}]); \ No newline at end of file diff --git a/assets/js/eb6f68a0.16112442.js b/assets/js/eb6f68a0.16112442.js new file mode 100644 index 0000000000..0a99ebe94b --- /dev/null +++ b/assets/js/eb6f68a0.16112442.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4991],{75707:(e,t,n)=>{n.d(t,{Ay:()=>c,RM:()=>s});var d=n(86070),a=n(25710);const s=[{value:"1. dev subcommand",id:"1-dev-subcommand",level:3},{value:"2. typegate subcommand",id:"2-typegate-subcommand",level:3}];function r(e){const t={a:"a",admonition:"admonition",code:"code",em:"em",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(t.p,{children:["The ",(0,d.jsx)(t.em,{children:"Meta CLI"})," comes with an embedded typegate packaged inside it. A ",(0,d.jsx)(t.a,{href:"/docs/reference/typegate",children:"typegate"})," instance is where you deploy your ",(0,d.jsx)(t.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,d.jsx)(t.admonition,{type:"note",children:(0,d.jsxs)(t.p,{children:["If you have not installed ",(0,d.jsx)(t.em,{children:"Meta CLI"})," or you have downloaded the ",(0,d.jsx)(t.em,{children:"thin"})," version, you can check ",(0,d.jsx)(t.a,{href:"/docs/reference/meta-cli#Installation",children:"this"})," installation guide of the ",(0,d.jsx)(t.em,{children:"CLI"}),"."]})}),"\n",(0,d.jsxs)(t.h3,{id:"1-dev-subcommand",children:["1. ",(0,d.jsx)(t.code,{children:"dev"})," subcommand"]}),"\n",(0,d.jsx)(t.p,{children:"You can start the embedded typegatxe easily with default configs using the following command."}),"\n",(0,d.jsx)(t.pre,{children:(0,d.jsx)(t.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,d.jsx)(t.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,d.jsxs)(t.h3,{id:"2-typegate-subcommand",children:["2. ",(0,d.jsx)(t.code,{children:"typegate"})," subcommand"]}),"\n",(0,d.jsxs)(t.p,{children:["Set the ",(0,d.jsx)(t.code,{children:"tg_admin_password"})," and ",(0,d.jsx)(t.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,d.jsx)(t.pre,{children:(0,d.jsx)(t.code,{className:"language-shell",children:"export tg_secret=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw== tg_admin_password=password\n"})}),"\n",(0,d.jsx)(t.p,{children:"Run the instance"}),"\n",(0,d.jsx)(t.pre,{children:(0,d.jsx)(t.code,{className:"language-shell",children:"meta typegate\n"})}),"\n",(0,d.jsxs)(t.p,{children:["The typegate instance runs on port ",(0,d.jsx)(t.code,{children:"7890"})," by default. You can check if the typegate node is running by accessing ",(0,d.jsx)(t.a,{href:"http://localhost:7890",children:"http://localhost:7890"})," in your browser."]})]})}function c(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,d.jsx)(t,{...e,children:(0,d.jsx)(r,{...e})}):r(e)}},38189:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>c,default:()=>m,frontMatter:()=>r,metadata:()=>o,toc:()=>l});var d=n(86070),a=n(25710),s=n(75707);const r={},c="Embedded Typegate",o={id:"reference/meta-cli/embedded-typegate/index",title:"Embedded Typegate",description:"",source:"@site/docs/reference/meta-cli/embedded-typegate/index.mdx",sourceDirName:"reference/meta-cli/embedded-typegate",slug:"/reference/meta-cli/embedded-typegate/",permalink:"/docs/reference/meta-cli/embedded-typegate/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/meta-cli/embedded-typegate/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Configuration file",permalink:"/docs/reference/meta-cli/configuration-file"},next:{title:"GraphQL",permalink:"/docs/reference/graphql/"}},i={},l=[...s.RM];function h(e){const t={h1:"h1",...(0,a.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t.h1,{id:"embedded-typegate",children:"Embedded Typegate"}),"\n",(0,d.jsx)(s.Ay,{})]})}function m(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,d.jsx)(t,{...e,children:(0,d.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/eb6f68a0.87edeae6.js b/assets/js/eb6f68a0.87edeae6.js deleted file mode 100644 index 9ae347e7a0..0000000000 --- a/assets/js/eb6f68a0.87edeae6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[4991],{75707:(e,n,t)=>{t.d(n,{Ay:()=>r,RM:()=>s});var d=t(86070),a=t(25710);const s=[{value:"1. dev subcommand",id:"1-dev-subcommand",level:3},{value:"2. typegate subcommand",id:"2-typegate-subcommand",level:3}];function c(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h3:"h3",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(n.p,{children:["The ",(0,d.jsx)(n.em,{children:"Meta CLI"})," comes with an embedded typegate packaged inside it. A ",(0,d.jsx)(n.a,{href:"/docs/reference/typegate",children:"typegate"})," instance is where you deploy your ",(0,d.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,d.jsx)(n.admonition,{type:"note",children:(0,d.jsxs)(n.p,{children:["If you have not installed ",(0,d.jsx)(n.em,{children:"Meta CLI"})," or you have downloaded the ",(0,d.jsx)(n.em,{children:"thin"})," version, you can check ",(0,d.jsx)(n.a,{href:"/docs/reference/meta-cli#Installation",children:"this"})," installation guide of the ",(0,d.jsx)(n.em,{children:"CLI"}),"."]})}),"\n",(0,d.jsxs)(n.h3,{id:"1-dev-subcommand",children:["1. ",(0,d.jsx)(n.code,{children:"dev"})," subcommand"]}),"\n",(0,d.jsx)(n.p,{children:"You can start the embedded typegatxe easily with default configs using the following command."}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-shell",children:"meta dev\n"})}),"\n",(0,d.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,d.jsxs)(n.h3,{id:"2-typegate-subcommand",children:["2. ",(0,d.jsx)(n.code,{children:"typegate"})," subcommand"]}),"\n",(0,d.jsxs)(n.p,{children:["Set the ",(0,d.jsx)(n.code,{children:"tg_admin_password"})," and ",(0,d.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,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-shell",children:"export tg_secret=a4lNi0PbEItlFZbus1oeH/+wyIxi9uH6TpL8AIqIaMBNvp7SESmuUBbfUwC0prxhGhZqHw8vMDYZAGMhSZ4fLw== tg_admin_password=password\n"})}),"\n",(0,d.jsx)(n.p,{children:"Run the instance"}),"\n",(0,d.jsx)(n.pre,{children:(0,d.jsx)(n.code,{className:"language-shell",children:"meta typegate\n"})}),"\n",(0,d.jsxs)(n.p,{children:["The typegate instance runs on port ",(0,d.jsx)(n.code,{children:"7890"})," by default. You can check if the typegate node is running by accessing ",(0,d.jsx)(n.a,{href:"http://localhost:7890",children:"http://localhost:7890"})," in your browser."]})]})}function r(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(c,{...e})}):c(e)}},38189:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>i,contentTitle:()=>r,default:()=>m,frontMatter:()=>c,metadata:()=>o,toc:()=>l});var d=t(86070),a=t(25710),s=t(75707);const c={},r="Embedded Typegate",o={id:"reference/meta-cli/embedded-typegate/index",title:"Embedded Typegate",description:"",source:"@site/docs/reference/meta-cli/embedded-typegate/index.mdx",sourceDirName:"reference/meta-cli/embedded-typegate",slug:"/reference/meta-cli/embedded-typegate/",permalink:"/docs/reference/meta-cli/embedded-typegate/",draft:!1,unlisted:!1,editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/docs/reference/meta-cli/embedded-typegate/index.mdx",tags:[],version:"current",frontMatter:{},sidebar:"docs",previous:{title:"Configuration file",permalink:"/docs/reference/meta-cli/configuration-file"},next:{title:"Changelog",permalink:"/docs/reference/changelog"}},i={},l=[...s.RM];function h(e){const n={h1:"h1",...(0,a.R)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.h1,{id:"embedded-typegate",children:"Embedded Typegate"}),"\n",(0,d.jsx)(s.Ay,{})]})}function m(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,d.jsx)(n,{...e,children:(0,d.jsx)(h,{...e})}):h(e)}}}]); \ No newline at end of file diff --git a/assets/js/fbf1744f.b0e8818b.js b/assets/js/fbf1744f.18af1e12.js similarity index 68% rename from assets/js/fbf1744f.b0e8818b.js rename to assets/js/fbf1744f.18af1e12.js index 7b12106d39..eb464bb035 100644 --- a/assets/js/fbf1744f.b0e8818b.js +++ b/assets/js/fbf1744f.18af1e12.js @@ -1 +1 @@ -"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6959],{77275:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=n(86070),r=n(25710);const s={},o="Introducing gRPC Runtime",a={permalink:"/blog/2024/09/26/introducing-grpc-runtime",editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx",source:"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx",title:"Introducing gRPC Runtime",description:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs.",date:"2024-09-26T00:00:00.000Z",tags:[],readingTime:4.4,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,nextItem:{title:"Distributed execution flow paradigms",permalink:"/blog/2024/08/27/distributed-execution-flow-paradigms"}},l={authorsImageUrls:[]},c=[{value:"What is gRPC?",id:"what-is-grpc",level:2},{value:"Why gRPC Matters for Metatype",id:"why-grpc-matters-for-metatype",level:2},{value:"Diagram: gRPC and Metatype Integration",id:"diagram-grpc-and-metatype-integration",level:2},{value:"Introducing gRPC Runtime in Metatype",id:"introducing-grpc-runtime-in-metatype",level:2},{value:"Key Technical Details",id:"key-technical-details",level:2},{value:"Architecture",id:"architecture",level:3},{value:"Implementation",id:"implementation",level:3},{value:"Benefits for Developers",id:"benefits-for-developers",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs."}),"\n",(0,i.jsx)(t.h2,{id:"what-is-grpc",children:"What is gRPC?"}),"\n",(0,i.jsxs)(t.p,{children:["gRPC, or ",(0,i.jsx)(t.strong,{children:"g"}),"oogle ",(0,i.jsx)(t.strong,{children:"R"}),"emote ",(0,i.jsx)(t.strong,{children:"P"}),"rocedure ",(0,i.jsx)(t.strong,{children:"C"}),"all, is a high-performance, open-source communication framework initially developed by Google. It enables ",(0,i.jsx)(t.strong,{children:"efficient and fast communication between microservices"})," in a distributed system, making it ideal for modern backend architectures."]}),"\n",(0,i.jsxs)(t.p,{children:["Unlike traditional HTTP APIs that use JSON, gRPC relies on ",(0,i.jsx)(t.strong,{children:"Protocol Buffers"})," (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems."]}),"\n",(0,i.jsx)(t.p,{children:"Key benefits of gRPC include:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Cross-language support"}),": gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Strong type safety"}),": Protocol Buffers ensure type-safe communication, catching errors early and improving reliability."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Bidirectional streaming"}),": gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"In short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential."}),"\n",(0,i.jsx)(t.h2,{id:"why-grpc-matters-for-metatype",children:"Why gRPC Matters for Metatype"}),"\n",(0,i.jsxs)(t.p,{children:["Metatype is a platform that enables developers to create ",(0,i.jsx)(t.strong,{children:"typegraphs"}),"\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility."]}),"\n",(0,i.jsx)(t.p,{children:"By integrating gRPC, Metatype empowers developers to:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Expose gRPC services via GraphQL or HTTP endpoints"}),", making them accessible to clients in a way that best suits their needs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Compose gRPC services with other backend components"}),", such as databases or other APIs, to create powerful and cohesive backend systems."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"diagram-grpc-and-metatype-integration",children:"Diagram: gRPC and Metatype Integration"}),"\n",(0,i.jsx)("center",{children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"gRPC and Metatype Integration Diagram",src:n(15602).A+"",width:"161",height:"681"})})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.em,{children:"Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend."})}),"\n",(0,i.jsx)(t.h2,{id:"introducing-grpc-runtime-in-metatype",children:"Introducing gRPC Runtime in Metatype"}),"\n",(0,i.jsx)(t.p,{children:"The new gRPC Runtime is the latest addition to Metatype's suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends."}),"\n",(0,i.jsx)(t.h2,{id:"key-technical-details",children:"Key Technical Details"}),"\n",(0,i.jsx)(t.h3,{id:"architecture",children:"Architecture"}),"\n",(0,i.jsx)(t.p,{children:"The gRPC Runtime integrates seamlessly with Metatype's existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"GrpcRuntime Class"}),": The main interface for defining gRPC interactions within your typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"proto_file"}),": Path to the .proto file that defines the gRPC service."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"endpoint"}),": The gRPC server address in the format ",(0,i.jsx)(t.code,{children:"tcp://:"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"call method"}),": Creates a typegraph function for gRPC method calls."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"implementation",children:"Implementation"}),"\n",(0,i.jsx)(t.p,{children:"Here's how the gRPC Runtime fits into a Metatype typegraph:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:'from typegraph import Graph, Policy, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes.grpc import GrpcRuntime\n\n@typegraph(\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef create_grpc_typegraph(g: Graph):\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\n grpc_runtime = GrpcRuntime(\n # proto_file: Path to the .proto file that defines the gRPC service\n proto_file="proto/helloworld.proto",\n # endpoint: The gRPC server address in the format tcp://:\n endpoint="tcp://localhost:4770"\n )\n \n # Expose the gRPC service within your typegraph\n # This allows you to incorporate gRPC calls alongside other runtime operations\n g.expose(\n Policy.public(),\n # call method: Creates a typegraph function for gRPC method calls\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\n greet=grpc_runtime.call("/helloworld.Greeter/SayHello"),\n )\n\n# The typegraph can now be exposed via GraphQL or HTTP, \n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\n'})}),"\n",(0,i.jsx)(t.p,{children:"This implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Define gRPC service connections using the GrpcRuntime class"}),"\n",(0,i.jsx)(t.li,{children:"Expose gRPC methods as part of your typegraph"}),"\n",(0,i.jsx)(t.li,{children:"Combine gRPC functionality with other Metatype features and runtimes"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"By structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic."}),"\n",(0,i.jsx)(t.h2,{id:"benefits-for-developers",children:"Benefits for Developers"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Unified Backend Structure"}),": Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Type Safety"}),": Leverage Metatype's strong typing system in conjunction with gRPC's protocol buffers for end-to-end type safety."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Flexible Exposure"}),": Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Composability"}),": Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsx)(t.p,{children:"To start using the gRPC Runtime in your Metatype project:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Ensure you have the latest version of Metatype installed."}),"\n",(0,i.jsx)(t.li,{children:"Prepare your .proto files for the gRPC services you want to integrate."}),"\n",(0,i.jsx)(t.li,{children:"Set up your typegraph as shown in the example above, incorporating the GrpcRuntime."}),"\n",(0,i.jsx)(t.li,{children:"Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed."}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(t.p,{children:"The addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease."}),"\n",(0,i.jsxs)(t.p,{children:["For more detailed documentation, code examples, and best practices, check out our ",(0,i.jsx)(t.a,{href:"https://metatype.dev/docs",children:"official Metatype docs"}),"#."]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},15602:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/GrpcMetatype.drawio-e6e626affae448f5b44a48ab82805ee9.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[6959],{77275:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>p,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=n(86070),r=n(25710);const s={},o="Introducing gRPC Runtime",a={permalink:"/blog/2024/09/26/introducing-grpc-runtime",editUrl:"https://github.com/metatypedev/metatype/tree/main/docs/metatype.dev/blog/2024-09-26-introducing-grpc-runtime/index.mdx",source:"@site/blog/2024-09-26-introducing-grpc-runtime/index.mdx",title:"Introducing gRPC Runtime",description:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs.",date:"2024-09-26T00:00:00.000Z",tags:[],readingTime:4.4,hasTruncateMarker:!1,authors:[],frontMatter:{},unlisted:!1,nextItem:{title:"Distributed execution flow paradigms",permalink:"/blog/2024/08/27/distributed-execution-flow-paradigms"}},l={authorsImageUrls:[]},c=[{value:"What is gRPC?",id:"what-is-grpc",level:2},{value:"Why gRPC Matters for Metatype",id:"why-grpc-matters-for-metatype",level:2},{value:"Diagram: gRPC and Metatype Integration",id:"diagram-grpc-and-metatype-integration",level:2},{value:"Introducing gRPC Runtime in Metatype",id:"introducing-grpc-runtime-in-metatype",level:2},{value:"Key Technical Details",id:"key-technical-details",level:2},{value:"Architecture",id:"architecture",level:3},{value:"Implementation",id:"implementation",level:3},{value:"Benefits for Developers",id:"benefits-for-developers",level:2},{value:"Getting Started",id:"getting-started",level:2},{value:"Conclusion",id:"conclusion",level:2}];function h(e){const t={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.p,{children:"We're excited to announce the new gRPC Runtime feature in Metatype, further enhancing our platform's ability to create versatile and powerful backends through typegraphs."}),"\n",(0,i.jsx)(t.h2,{id:"what-is-grpc",children:"What is gRPC?"}),"\n",(0,i.jsxs)(t.p,{children:["gRPC, or ",(0,i.jsx)(t.strong,{children:"g"}),"oogle ",(0,i.jsx)(t.strong,{children:"R"}),"emote ",(0,i.jsx)(t.strong,{children:"P"}),"rocedure ",(0,i.jsx)(t.strong,{children:"C"}),"all, is a high-performance, open-source communication framework initially developed by Google. It enables ",(0,i.jsx)(t.strong,{children:"efficient and fast communication between microservices"})," in a distributed system, making it ideal for modern backend architectures."]}),"\n",(0,i.jsxs)(t.p,{children:["Unlike traditional HTTP APIs that use JSON, gRPC relies on ",(0,i.jsx)(t.strong,{children:"Protocol Buffers"})," (protobufs) for serializing data, which are more compact and faster to process. This approach allows gRPC to support high-throughput, low-latency communication, which is crucial for applications where speed and efficiency matter, such as in real-time data processing or large-scale distributed systems."]}),"\n",(0,i.jsx)(t.p,{children:"Key benefits of gRPC include:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Cross-language support"}),": gRPC supports multiple programming languages, allowing services written in different languages to communicate seamlessly."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Strong type safety"}),": Protocol Buffers ensure type-safe communication, catching errors early and improving reliability."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Bidirectional streaming"}),": gRPC allows for client and server streaming, enabling continuous data transfer in both directions, ideal for applications like real-time analytics."]}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"In short, gRPC is well-suited for high-performance, scalable backend systems where speed and type safety are essential."}),"\n",(0,i.jsx)(t.h2,{id:"why-grpc-matters-for-metatype",children:"Why gRPC Matters for Metatype"}),"\n",(0,i.jsxs)(t.p,{children:["Metatype is a platform that enables developers to create ",(0,i.jsx)(t.strong,{children:"typegraphs"}),"\u2014strongly-typed, composable backend structures that can support multiple protocols and runtime environments. With the introduction of the gRPC Runtime, Metatype allows developers to incorporate gRPC services into these typegraphs, further enhancing the platform\u2019s versatility."]}),"\n",(0,i.jsx)(t.p,{children:"By integrating gRPC, Metatype empowers developers to:"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Expose gRPC services via GraphQL or HTTP endpoints"}),", making them accessible to clients in a way that best suits their needs."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Compose gRPC services with other backend components"}),", such as databases or other APIs, to create powerful and cohesive backend systems."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"diagram-grpc-and-metatype-integration",children:"Diagram: gRPC and Metatype Integration"}),"\n",(0,i.jsx)("center",{children:(0,i.jsx)(t.p,{children:(0,i.jsx)(t.img,{alt:"gRPC and Metatype Integration Diagram",src:n(15602).A+"",width:"161",height:"681"})})}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.em,{children:"Metatype\u2019s gRPC Runtime allows developers to integrate gRPC services into their typegraphs, enabling seamless interaction with gRPC services in the backend."})}),"\n",(0,i.jsx)(t.h2,{id:"introducing-grpc-runtime-in-metatype",children:"Introducing gRPC Runtime in Metatype"}),"\n",(0,i.jsx)(t.p,{children:"The new gRPC Runtime is the latest addition to Metatype's suite of runtimes, joining existing options like the HTTP runtime. This expansion allows you to incorporate gRPC services into your typegraphs, further enhancing the versatility of your Metatype-powered backends."}),"\n",(0,i.jsx)(t.h2,{id:"key-technical-details",children:"Key Technical Details"}),"\n",(0,i.jsx)(t.h3,{id:"architecture",children:"Architecture"}),"\n",(0,i.jsx)(t.p,{children:"The gRPC Runtime integrates seamlessly with Metatype's existing architecture. It acts as a bridge between your typegraph and external gRPC services, allowing you to incorporate gRPC calls alongside other runtime operations in your backend logic."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"GrpcRuntime Class"}),": The main interface for defining gRPC interactions within your typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"proto_file"}),": Path to the .proto file that defines the gRPC service."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"endpoint"}),": The gRPC server address in the format ",(0,i.jsx)(t.code,{children:"tcp://:"}),"."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"call method"}),": Creates a typegraph function for gRPC method calls."]}),"\n"]}),"\n",(0,i.jsx)(t.h3,{id:"implementation",children:"Implementation"}),"\n",(0,i.jsx)(t.p,{children:"Here's how the gRPC Runtime fits into a Metatype typegraph:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-python",children:'from typegraph import Graph, Policy, typegraph\nfrom typegraph.graph.params import Cors\nfrom typegraph.runtimes.grpc import GrpcRuntime\n\n@typegraph(\n cors=Cors(allow_origin=["https://metatype.dev", "http://localhost:3000"]),\n)\ndef create_grpc_typegraph(g: Graph):\n # The GrpcRuntime acts as a bridge between your typegraph and external gRPC services\n grpc_runtime = GrpcRuntime(\n # proto_file: Path to the .proto file that defines the gRPC service\n proto_file="proto/helloworld.proto",\n # endpoint: The gRPC server address in the format tcp://:\n endpoint="tcp://localhost:4770"\n )\n\n # Expose the gRPC service within your typegraph\n # This allows you to incorporate gRPC calls alongside other runtime operations\n g.expose(\n Policy.public(),\n # call method: Creates a typegraph function for gRPC method calls\n # It uses the full path to the gRPC method: /package_name.service_name/method_name\n greet=grpc_runtime.call("/helloworld.Greeter/SayHello"),\n )\n\n# The typegraph can now be exposed via GraphQL or HTTP,\n# allowing clients to interact with the gRPC service through Metatype\'s unified interface\n'})}),"\n",(0,i.jsx)(t.p,{children:"This implementation demonstrates how the gRPC Runtime integrates with your typegraph, allowing you to:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Define gRPC service connections using the GrpcRuntime class"}),"\n",(0,i.jsx)(t.li,{children:"Expose gRPC methods as part of your typegraph"}),"\n",(0,i.jsx)(t.li,{children:"Combine gRPC functionality with other Metatype features and runtimes"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"By structuring your gRPC interactions this way, you can seamlessly incorporate gRPC services into your larger Metatype-powered backend, alongside other data sources and business logic."}),"\n",(0,i.jsx)(t.h2,{id:"benefits-for-developers",children:"Benefits for Developers"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Unified Backend Structure"}),": Incorporate gRPC services alongside other protocols and data sources in a single, coherent typegraph."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Type Safety"}),": Leverage Metatype's strong typing system in conjunction with gRPC's protocol buffers for end-to-end type safety."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Flexible Exposure"}),": Easily expose your gRPC services via GraphQL or HTTP endpoints, allowing clients to interact with them using their preferred protocol."]}),"\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.strong,{children:"Composability"}),": Combine gRPC calls with other runtime operations, database queries, or business logic within your typegraph."]}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"getting-started",children:"Getting Started"}),"\n",(0,i.jsx)(t.p,{children:"To start using the gRPC Runtime in your Metatype project:"}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsx)(t.li,{children:"Ensure you have the latest version of Metatype installed."}),"\n",(0,i.jsx)(t.li,{children:"Prepare your .proto files for the gRPC services you want to integrate."}),"\n",(0,i.jsx)(t.li,{children:"Set up your typegraph as shown in the example above, incorporating the GrpcRuntime."}),"\n",(0,i.jsx)(t.li,{children:"Configure your Metatype backend to expose the typegraph via GraphQL or HTTP as needed."}),"\n"]}),"\n",(0,i.jsx)(t.h2,{id:"conclusion",children:"Conclusion"}),"\n",(0,i.jsx)(t.p,{children:"The addition of the gRPC Runtime to Metatype further solidifies its position as a comprehensive platform for building robust, type-safe backends. By allowing seamless integration of gRPC services alongside other protocols and data sources, Metatype empowers developers to create versatile and powerful backend systems with ease."}),"\n",(0,i.jsxs)(t.p,{children:["For more detailed documentation, code examples, and best practices, check out our ",(0,i.jsx)(t.a,{href:"https://metatype.dev/docs",children:"official Metatype docs"}),"#."]})]})}function p(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},15602:(e,t,n)=>{n.d(t,{A:()=>i});const i=n.p+"assets/images/GrpcMetatype.drawio-e6e626affae448f5b44a48ab82805ee9.png"}}]); \ No newline at end of file diff --git a/assets/js/main.3c25833c.js b/assets/js/main.3c25833c.js new file mode 100644 index 0000000000..5da6b1d66a --- /dev/null +++ b/assets/js/main.3c25833c.js @@ -0,0 +1,2 @@ +/*! For license information please see main.3c25833c.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-1||e.push("["+n.nodeName+'="'+n.value+'"]'),e}),[])}},770:(e,t)=>{function n(e){if(!e.hasAttribute("class"))return[];try{return Array.prototype.slice.call(e.classList).filter((function(e){return/^[a-z_-][a-z\d_-]*$/i.test(e)?e:null}))}catch(n){var t=e.getAttribute("class");return(t=t.trim().replace(/\s+/g," ")).split(" ")}}Object.defineProperty(t,"__esModule",{value:!0}),t.getClasses=n,t.getClassSelectors=function(e){return n(e).filter(Boolean).map((function(e){return"."+e}))}},584:(e,t)=>{function n(e,t,r,o,a,i,s){if(i!==s)for(var l=o;l<=a&&a-l+1>=s-i;++l)r[i]=t[l],n(e,t,r,l+1,a,i+1,s);else e.push(r.slice(0,i).join(""))}Object.defineProperty(t,"__esModule",{value:!0}),t.getCombinations=function(e,t){for(var r=[],o=e.length,a=[],i=1;i<=t;++i)n(r,e,a,0,o-1,0,i);return r}},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getID=function(e){var t=e.getAttribute("id");return null!==t&&""!==t?t.match(/(?:^\d|:)/)?'[id="'+t+'"]':"#"+t:null}},64:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getNthChild=function(e){var t=0,n=void 0,o=void 0,a=e.parentNode;if(Boolean(a)){var i=a.childNodes,s=i.length;for(n=0;n{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;nvo});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n(this,"feedbackButton",null),n(this,"injectedFeedbackButton",!1),n(this,"buttonHidden",null),n(this,"lastButtonIcon",null)}var r,o,a;return r=e,a=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(o=[{key:"toggleFeedbackButton",value:function(t){this.buttonHidden=!t,e.getInstance().updateFeedbackButtonState(),ur.getInstance().updateContainerStyle()}},{key:"feedbackButtonPressed",value:function(){var e=It.getInstance();e.isOpened()?e.hideWidget():(e.setAppMode("widget"),e.showWidget())}},{key:"injectFeedbackButton",value:function(){var e=this;if(!this.injectedFeedbackButton){this.injectedFeedbackButton=!0;var t=document.createElement("div");t.addEventListener("click",(function(){e.feedbackButtonPressed()})),document.body.appendChild(t),this.feedbackButton=t,this.updateFeedbackButtonState()}}},{key:"updateNotificationBadge",value:function(e){var t=document.querySelector(".bb-notification-bubble");if(t){var n="bb-notification-bubble--hidden";e>0?(t.classList.remove(n),t.innerText=e):t.classList.add(n)}}},{key:"refresh",value:function(){document.querySelector(".bb-feedback-button")?(this.updateFeedbackButtonText(),this.updateFeedbackButtonState()):(this.injectedFeedbackButton=!1,this.feedbackButton=null,this.buttonHidden=null,this.lastButtonIcon=null,this.injectFeedbackButton())}},{key:"updateFeedbackButtonText",value:function(){var t=Qe.getInstance().getFlowConfig();if(t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_BOTTOM||t.feedbackButtonPosition===e.FEEDBACK_BUTTON_CLASSIC_LEFT){var n=document.querySelector(".bb-feedback-button-classic");n&&(n.innerText=t.widgetButtonText)}}},{key:"updateFeedbackButtonState",value:function(){if(null!==this.feedbackButton){var t,n=Qe.getInstance().getFlowConfig();t=n.buttonLogo?''):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='
').concat(n.widgetButtonText,"
")):t!==this.lastButtonIcon&&(this.feedbackButton.innerHTML='
'.concat(t).concat(u("arrowdown","#fff"),'
')),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=160?"#000000":"#ffffff"},u=function(e,t){return"button"===e?'':"unmute"===e?'':"mute"===e?'':"replay"===e?'\n \n ':"dismiss"===e?'':"blur"===e?'\n \n':"pen"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n':"rect"===e?'\n \n \n \n \n \n \n \n \n \n \n':"pointer"===e?'\n \n ':"clip"===e?'\n \n \n \n \n \n':"mic"===e?'\n \n \n \n \n ':"camera"===e?'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n':"recorderon"===e?'\n \n \n \n \n \n \n \n \n \n \n \n':"recorderoff"===e?'\n \n \n \n \n \n \n \n \n ':"arrowdown"===e?'\n \n '):"arrowleft"===e?'\n \n '):"close"===e?'\n \n '):"undo"===e?'\n \n \n \n \n \n \n \n \n \n ':"circle-dot"===e?''):"circle-question"===e?''):"circle-info"===e?''):"circle-exclamation"===e?''):"circle-up"===e?''):"circle-right"===e?''):""};function d(e){return d="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},d(e)}function p(e,t){for(var n=0;n0&&(e=e.concat(this.externalRequests)),this.filters&&this.filters.length>0)for(var t=0;t-1)&&!e.find((function(e){return e.url===c.name}))&&e.push({type:"RESOURCE",date:new Date(this.startTimestamp+c.startTime),url:c.name,duration:Math.round(c.duration),initiatorType:c.initiatorType})}}}catch(l){}var u=this.blacklist.concat(this.defaultBlacklist);if(u&&u.length>0)try{e=e.filter((function(e){for(var t=0;t70&&(e=70),this.maxRequests=e}},{key:"setStopped",value:function(e){this.stopped=e}},{key:"setFilters",value:function(e){this.filters=this.filters.concat(e||[])}},{key:"setBlacklist",value:function(e){this.blacklist=this.blacklist.concat(e||[])}},{key:"cleanRequests",value:function(){var e=Object.keys(this.requests);if(e.length>this.maxRequests)for(var t=e.slice(0,e.length-this.maxRequests),n=0;n.15?"":e}},{key:"cleanupPayload",value:function(e){if(null==e)return"{}";try{if(void 0!==("undefined"==typeof TextDecoder?"undefined":d(TextDecoder))&&ArrayBuffer.isView(e))return(new TextDecoder).decode(e)}catch(t){}return e}},{key:"preparePayload",value:function(e){var t=this.cleanupPayload(e);return this.cleanupContentSize(t)}},{key:"start",value:function(){var e=this;if(!this.initialized){this.initialized=!0;var t=this;this.interceptNetworkRequests({onFetch:function(n,r){if(!e.stopped&&r&&e.requests){if(n.length>0&&void 0!==n[0]&&void 0!==n[0].url)e.requests[r]={url:n[0].url,date:new Date,request:{payload:"",headers:void 0!==n[0].headers?Object.fromEntries(n[0].headers.entries()):{}},type:void 0!==n[0].method?n[0].method:""};else if(n.length>=2&&n[1]){var o=n[1]&&n[1].method?n[1].method:"GET";e.requests[r]={request:{payload:t.preparePayload(n[1].body),headers:n[1].headers},type:o,url:n[0],date:new Date}}else e.requests[r]={url:n[0],date:new Date};e.cleanRequests()}},onFetchLoad:function(n,o){if(!e.stopped&&o&&e.requests&&e.requests[o]){try{e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:"",responseText:""},e.calcRequestTime(o)}catch(r){}try{var a="";n.headers&&void 0!==n.headers.get&&(a=n.headers.get("content-type")),e.isContentTypeSupported(a)?n.text().then((function(r){e.requests[o]&&(e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:n.statusText,responseText:t.cleanupContentSize(r)}),e.calcRequestTime(o),e.cleanRequests()})).catch((function(t){e.cleanRequests()})):(e.requests[o]&&(e.requests[o].success=!0,e.requests[o].response={status:n.status,statusText:n.statusText,responseText:""}),e.calcRequestTime(o),e.cleanRequests())}catch(r){}}},onFetchFailed:function(t,n){!e.stopped&&n&&e.requests&&e.requests[n]&&(e.requests[n].success=!1,e.calcRequestTime(n),e.cleanRequests())},onOpen:function(t,n){e.stopped||(t&&t.bbRequestId&&n.length>=2&&e.requests&&(e.requests[t.bbRequestId]={type:n[0],url:n[1],date:new Date}),e.cleanRequests())},onSend:function(t,n){e.stopped||(t&&t.bbRequestId&&e.requests&&e.requests[t.bbRequestId]&&(e.requests[t.bbRequestId].request={payload:e.preparePayload(n.length>0?n[0]:"{}"),headers:t.requestHeaders}),e.cleanRequests())},onError:function(t,n){!e.stopped&&e.requests&&t&&t.currentTarget&&t.currentTarget.bbRequestId&&e.requests[t.currentTarget.bbRequestId]&&(e.requests[t.currentTarget.bbRequestId].success=!1,e.calcRequestTime(t.bbRequestId)),e.cleanRequests()},onLoad:function(t,n){if(!e.stopped){if(t&&t.currentTarget&&t.currentTarget.bbRequestId&&e.requests&&e.requests[t.currentTarget.bbRequestId]){var r=t.currentTarget,o=r.responseType,a="<"+o+">";""!==o&&"text"!==o||(a=e.cleanupContentSize(r.responseText)),e.requests[r.bbRequestId].success=!0,e.requests[r.bbRequestId].response={status:r.status,statusText:r.statusText,responseText:a},e.calcRequestTime(r.bbRequestId)}e.cleanRequests()}}})}}},{key:"interceptNetworkRequests",value:function(e){var t,n=this,r=XMLHttpRequest.prototype.open,o=XMLHttpRequest.prototype.send;return void 0===XMLHttpRequest.prototype.gleapSetRequestHeader&&(XMLHttpRequest.prototype.gleapSetRequestHeader=XMLHttpRequest.prototype.setRequestHeader),XMLHttpRequest.prototype.gleapSetRequestHeader&&(XMLHttpRequest.prototype.setRequestHeader=function(e,t){this.requestHeaders||(this.requestHeaders={}),this.requestHeaders&&this.requestHeaders.hasOwnProperty(e)||(this.requestHeaders[e]||(this.requestHeaders[e]=[]),this.requestHeaders[e].push(t),this.gleapSetRequestHeader(e,t))}),XMLHttpRequest.prototype.open=function(){return this.bbRequestId=++n.requestId,e.onOpen&&e.onOpen(this,arguments),e.onLoad&&this.addEventListener("load",e.onLoad.bind(e)),e.onError&&this.addEventListener("error",e.onError.bind(e)),r.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){return e.onSend&&e.onSend(this,arguments),o.apply(this,arguments)},window.fetch&&(t=window.fetch,window.fetch=function(){var r=++n.requestId;return e.onFetch(arguments,r),t.apply(this,arguments).then((function(t){if(t&&"function"==typeof t.clone){var n=t.clone();e.onFetchLoad(n,r)}return t})).catch((function(t){throw e.onFetchFailed(t,r),t}))}),e}},{key:"blobToTextPromise",value:function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(e){e&&e.target&&e.target.result?t(e.target.result):n()},r.onerror=function(e){n(e)},r.readAsText(e)}))}}],o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&p(t.prototype,n),o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();f(m,"instance",void 0);const y=m;var b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:400,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:400;return new Promise((function(r,o){var a=0===e.indexOf("data:image/jpeg"),i=new Image;i.src=e,i.onerror=function(){o()},i.onload=function(){var e=document.createElement("canvas"),o=t,s=n;t>i.width/4&&(o=i.width/4),n>i.height/4&&(s=i.height/4);var l=i.width,c=i.height;l>c?l>o&&(c*=o/l,l=o):c>s&&(l*=s/c,c=s),e.width=l,e.height=c,e.getContext("2d").drawImage(i,0,0,l,c),r(a?e.toDataURL("image/jpeg",.7):e.toDataURL())}}))},w=function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))},x=function(e){if("string"==typeof e||e instanceof String)try{return JSON.parse(e)}catch(t){return{}}return e},k=function(e,t){return e.length>t?e.slice(0,t)+"...":e},S=function(e){try{var t=e.split("."),r=!1,o=t[t.length-2];return"co"!==o&&"com"!==o&&"gv"!==o&&"ac"!==o&&"edu"!==o&&"gov"!==o&&"mil"!==o&&"net"!==o&&"org"!==o||(r=!0),(t=t.slice(r?-3:-2)).join(".")}catch(n){}return e},C=function(e){try{var t=localStorage.getItem("gleap-widget-".concat(e));if(t)return JSON.parse(t)}catch(g){}return null},E=function(e,t){var n="gleap-widget-".concat(e);if(t)try{localStorage.setItem(n,JSON.stringify(t))}catch(v){}else localStorage.removeItem(n)},T=function(e){"complete"===document.readyState||"loaded"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",(function(){e()}))};const L=Math.min,I=Math.max,A=Math.round,O=Math.floor,_=e=>({x:e,y:e}),P={left:"right",right:"left",bottom:"top",top:"bottom"},M={start:"end",end:"start"};function R(e,t,n){return I(e,L(t,n))}function N(e,t){return"function"==typeof e?e(t):e}function j(e){return e.split("-")[0]}function D(e){return e.split("-")[1]}function F(e){return"x"===e?"y":"x"}function B(e){return"y"===e?"height":"width"}function z(e){return["top","bottom"].includes(j(e))?"y":"x"}function U(e){return F(z(e))}function q(e){return e.replace(/start|end/g,(e=>M[e]))}function H(e){return e.replace(/left|right|bottom|top/g,(e=>P[e]))}function W(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function $(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function G(e,t,n){let{reference:r,floating:o}=e;const a=z(t),i=U(t),s=B(i),l=j(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(D(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1)}return f}async function V(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=N(t,e),h=W(f),m=s[p?"floating"===d?"reference":"floating":d],g=$(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...i.floating,x:r,y:o}:i.reference,y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(y))&&await(null==a.getScale?void 0:a.getScale(y))||{x:1,y:1},w=$(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}const K=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=j(n),s=D(n),l="y"===z(n),c=["left","top"].includes(i)?-1:1,u=a&&l?-1:1,d=N(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}};function Z(e){return J(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function X(e){var t;return null==(t=(J(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function J(e){return e instanceof Node||e instanceof Y(e).Node}function Q(e){return e instanceof Element||e instanceof Y(e).Element}function ee(e){return e instanceof HTMLElement||e instanceof Y(e).HTMLElement}function te(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}function ne(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function re(e){return["table","td","th"].includes(Z(e))}function oe(e){const t=ae(),n=se(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ae(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ie(e){return["html","body","#document"].includes(Z(e))}function se(e){return Y(e).getComputedStyle(e)}function le(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===Z(e))return e;const t=e.assignedSlot||e.parentNode||te(e)&&e.host||X(e);return te(t)?t.host:t}function ue(e){const t=ce(e);return ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&ne(t)?t:ue(t)}function de(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ue(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=Y(o);return a?t.concat(i,i.visualViewport||[],ne(o)?o:[],i.frameElement&&n?de(i.frameElement):[]):t.concat(o,de(o,[],n))}function pe(e){const t=se(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ee(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=A(n)!==a||A(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function fe(e){return Q(e)?e:e.contextElement}function he(e){const t=fe(e);if(!ee(t))return _(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=pe(t);let i=(a?A(n.width):n.width)/r,s=(a?A(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const me=_(0);function ge(e){const t=Y(e);return ae()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:me}function ve(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=fe(e);let i=_(1);t&&(r?Q(r)&&(i=he(r)):i=he(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Y(e))&&t}(a,n,r)?ge(a):_(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=Y(a),t=r&&Q(r)?Y(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=he(o),t=o.getBoundingClientRect(),r=se(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=Y(o),o=n.frameElement}}return $({width:u,height:d,x:l,y:c})}const ye=[":popover-open",":modal"];function be(e){return ye.some((t=>{try{return e.matches(t)}catch(g){return!1}}))}function we(e){return ve(X(e)).left+le(e).scrollLeft}function xe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Y(e),r=X(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=ae();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=X(e),n=le(e),r=e.ownerDocument.body,o=I(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=I(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+we(e);const s=-n.scrollTop;return"rtl"===se(r).direction&&(i+=I(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(X(e));else if(Q(t))r=function(e,t){const n=ve(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=ee(e)?he(e):_(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=ge(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return $(r)}function ke(e,t){const n=ce(e);return!(n===t||!Q(n)||ie(n))&&("fixed"===se(n).position||ke(n,t))}function Se(e,t,n){const r=ee(t),o=X(t),a="fixed"===n,i=ve(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=_(0);if(r||!r&&!a)if(("body"!==Z(t)||ne(o))&&(s=le(t)),r){const e=ve(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=we(o));return{x:i.left+s.scrollLeft-l.x,y:i.top+s.scrollTop-l.y,width:i.width,height:i.height}}function Ce(e,t){return ee(e)&&"fixed"!==se(e).position?t?t(e):e.offsetParent:null}function Ee(e,t){const n=Y(e);if(!ee(e)||be(e))return n;let r=Ce(e,t);for(;r&&re(r)&&"static"===se(r).position;)r=Ce(r,t);return r&&("html"===Z(r)||"body"===Z(r)&&"static"===se(r).position&&!oe(r))?n:r||function(e){let t=ce(e);for(;ee(t)&&!ie(t);){if(oe(t))return t;t=ce(t)}return null}(e)||n}const Te={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=X(r),s=!!t&&be(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=_(1);const u=_(0),d=ee(r);if((d||!d&&!a)&&(("body"!==Z(r)||ne(i))&&(l=le(r)),ee(r))){const e=ve(r);c=he(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:X,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=de(e,[],!1).filter((e=>Q(e)&&"body"!==Z(e))),o=null;const a="fixed"===se(e).position;let i=a?ce(e):e;for(;Q(i)&&!ie(i);){const t=se(i),n=oe(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ne(i)&&!n&&ke(e,i))?r=r.filter((e=>e!==i)):o=t,i=ce(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=a[0],s=a.reduce(((e,n)=>{const r=xe(t,n,o);return e.top=I(r.top,e.top),e.right=L(r.right,e.right),e.bottom=L(r.bottom,e.bottom),e.left=I(r.left,e.left),e}),xe(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ee,getElementRects:async function(e){const t=this.getOffsetParent||Ee,n=this.getDimensions;return{reference:Se(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=pe(e);return{width:t,height:n}},getScale:he,isElement:Q,isRTL:function(e){return"rtl"===se(e).direction}};const Le=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=N(e,t),c={x:n,y:r},u=await V(t,l),d=z(j(o)),p=F(d);let f=c[p],h=c[d];if(a){const e="y"===p?"bottom":"right";f=R(f+u["y"===p?"top":"left"],f,f-u[e])}if(i){const e="y"===d?"bottom":"right";h=R(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Ie=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=N(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const v=j(o),y=j(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(y||!m?[H(s)]:function(e){const t=H(e);return[q(e),t,q(t)]}(s));p||"none"===h||w.push(...function(e,t,n,r){const o=D(e);let a=function(e,t,n){const r=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?a:i;default:return[]}}(j(e),"start"===n,r);return o&&(a=a.map((e=>e+"-"+o)),t&&(a=a.concat(a.map(q)))),a}(s,m,h,b));const x=[s,...w],k=await V(t,g),S=[];let C=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&S.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=D(e),o=U(e),a=B(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=H(i)),[i,H(i)]}(o,i,b);S.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:S}],!S.every((e=>e<=0))){var E,T;const e=((null==(E=a.flip)?void 0:E.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(T=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var L;const e=null==(L=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ae=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=N(e,t)||{};if(null==c)return{};const d=W(u),p={x:n,y:r},f=U(o),h=B(f),m=await i.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[f]-p[f]-a.floating[h],x=p[f]-a.reference[f],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let S=k?k[b]:0;S&&await(null==i.isElement?void 0:i.isElement(k))||(S=s.floating[b]||a.floating[h]);const C=w/2-x/2,E=S/2-m[h]/2-1,T=L(d[v],E),I=L(d[y],E),A=T,O=S-m[h]-I,_=S/2-m[h]/2+C,P=R(A,_,O),M=!l.arrow&&null!=D(o)&&_!==P&&a.reference[h]/2-(_e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'):""),a.appendChild(i),t.repositionHotspot(e,n),o=i,t.elementToTooltipMap.set(e,n)}else o=e;var s=t.createTooltip(o,n.html,n);t.elementToFloatingUIMap.set(e,s)}}})),Pe(this,"updateFilteredTooltips",(function(){t.filteredTooltips=t.getFilteredTooltips(),t.checkForTooltips()})),Pe(this,"getFilteredTooltips",(function(){if(!t.tooltips)return[];var e=window.location.href;return t.tooltips.filter((function(t){if(!t.page||0===t.page.length)return!0;var n=t.pageType,r=t.page;switch(n){case"is":return e===r;case"isnot":return e!==r;case"contains":return e.includes(r);case"notcontains":return!e.includes(r);case"startswith":return e.startsWith(r);case"endswith":return e.endsWith(r);default:return!1}}))})),Pe(this,"checkForTooltips",(function(){for(var e=0;e0&&this.filteredTooltips.forEach((function(n){n.selector&&e.matches(n.selector)&&t.linkTooltip(e,n)}))}},{key:"start",value:function(){var e=this,t=this;if(window){var n,r,o=(n=t.updateHotspotPositions.bind(t),r=null,function(){if(!r){var e=this,t=arguments;r=setTimeout((function(){n.call.apply(n,[e].concat(function(e){return function(e){if(Array.isArray(e))return Re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Re(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)?Re(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t))),r=null}),250)}});window.addEventListener("resize",o),this.observer=new MutationObserver((function(n){t.lastUrl!==window.location.href&&(t.lastUrl=window.location.href,t.filteredTooltips=t.getFilteredTooltips()),n.forEach((function(n){n.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t.processNodeInsertion(e)})),n.removedNodes.forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE&&e.elementToFloatingUIMap.has(t)){var n=e.elementToFloatingUIMap.get(t);n&&(n.tooltip&&n.tooltip.remove(),n.cleanup(),e.elementToFloatingUIMap.delete(t))}e.elementToTooltipMap.has(t)&&e.elementToTooltipMap.delete(t)}))}))})),this.observer.observe(document.body,{childList:!0,subtree:!0})}}},{key:"updateHotspotPositions",value:function(){var e=this;document.querySelectorAll("[data-gleap-tooltip-mode='hotspot']").forEach((function(t){var n=e.elementToTooltipMap.get(t);n&&e.repositionHotspot(t,n)}))}},{key:"createTooltip",value:function(e,t,n){var r=document.createElement("div");r.className="gleap-tooltip",r.innerHTML='
\n '.concat(t,'\n
\n \n \n \n
\n
'),document.body.appendChild(r);var o,a=r.querySelector(".gleap-tooltip-arrow"),i=function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=fe(e),u=o||a?[...c?de(c):[],...de(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)}));const d=c&&s?function(e,t){let n,r=null;const o=X(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-O(u)+"px "+-O(o.clientWidth-(c+d))+"px "+-O(o.clientHeight-(u+p))+"px "+-O(c)+"px",threshold:I(0,L(1,l))||1};let m=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!m)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(h){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),a}(c,n):null;let p,f=-1,m=null;i&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),c&&!l&&m.observe(c),m.observe(t));let g=l?ve(e):null;return l&&function t(){const r=ve(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n(),g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}(e,r,(function(){((e,t,n)=>{const r=new Map,o={platform:Te,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=G(c,r,l),p=r,f={},h=0;for(let m=0;m0&&void 0!==arguments[0]?arguments[0]:0,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.session&&t.session.gleapHash&&rn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash));try{E("session-".concat(t.sdkKey),null)}catch(n){}if(t.useCookies)try{!function(e){try{var t=S(window.location.host.split(":")[0]);document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT; Domain="+t}catch(n){}}("session-".concat(t.sdkKey))}catch(n){}if(t.ready=!1,t.session={gleapId:null,gleapHash:null,name:"",email:"",userId:"",phone:"",value:0},It.getInstance().sendMessage({name:"session-cleared"},!0),ur.getInstance().clearAllNotifications(!1),ur.getInstance().setNotificationCount(0),vr.getInstance().removeBannerUI(),r&&!isNaN(e)){var o=10*Math.pow(e,2);setTimeout((function(){t.startSession(e+1)}),1e3*o)}})),ze(this,"validateSession",(function(e){e&&e.gleapId&&(t.session&&t.session.gleapHash&&rn.notifyEvent("unregister-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),E("session-".concat(t.sdkKey),e),t.useCookies&&function(e,t,n){try{var r="",a=new Date;a.setTime(a.getTime()+31536e6),r="; expires="+a.toUTCString();var i=S(window.location.host.split(":")[0]);document.cookie=e+"="+(t||"")+r+"; path=/; domain="+i}catch(o){}}("session-".concat(t.sdkKey),encodeURIComponent(JSON.stringify(e))),t.session=e,t.ready=!0,t.session&&t.session.gleapHash&&rn.notifyEvent("register-pushmessage-group","gleapuser-".concat(t.session.gleapHash)),t.notifySessionReady())})),ze(this,"startSession",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{if(t.useCookies){var n=function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r0)){var o=C("session-".concat(t.sdkKey));o&&t.validateSession(o)}var a=t,i=new XMLHttpRequest;i.open("POST",a.apiUrl+"/sessions"),i.setRequestHeader("Content-Type","application/json;charset=UTF-8"),i.setRequestHeader("Api-Token",a.sdkKey);try{t.session&&t.session.gleapId&&t.session.gleapHash&&(i.setRequestHeader("Gleap-Id",t.session.gleapId),i.setRequestHeader("Gleap-Hash",t.session.gleapHash))}catch(s){}i.onreadystatechange=function(t){if(4===i.readyState)if(200===i.status||201===i.status)try{var n=JSON.parse(i.responseText);a.validateSession(n),Ve.getInstance().restart(),Ne.getInstance().load()}catch(s){}else 429!==i.status&&a.clearSession(e,!0)},i.send(JSON.stringify({lang:Zn.getInstance().getActiveLanguage()}))})),ze(this,"checkIfSessionNeedsUpdate",(function(e,n){if(!t.session||!t.session.userId||!e)return!0;try{if(t.session.userId.toString()!==e.toString())return!0}catch(o){}if(n)for(var r=Object.keys(n),a=0;a0)for(var e=0;e2)&&0!==t.streamedEventArray.length&&t.socket&&t.socket.readyState===t.socket.OPEN){var e=t;t.streamingEvents=!0;var n=new XMLHttpRequest;n.open("POST",qe.getInstance().apiUrl+"/sessions/ping"),n.setRequestHeader("Content-Type","application/json;charset=UTF-8"),qe.getInstance().injectSession(n),n.onerror=function(){e.errorCount++,e.streamingEvents=!1},n.onreadystatechange=function(t){4===n.readyState&&(200===n.status||201===n.status?e.errorCount=0:e.errorCount++,e.streamingEvents=!1)};var r=Mt.getInstance().getSessionDuration();n.send(JSON.stringify({time:r,events:t.streamedEventArray,opened:It.getInstance().isOpened(),type:"js",sdkVersion:"13.7.9",ws:!0})),t.streamedEventArray=[]}})),this.handleOpenBound=this.handleOpen.bind(this),this.handleErrorBound=this.handleError.bind(this),this.handleMessageBound=this.handleMessage.bind(this),this.handleCloseBound=this.handleClose.bind(this)}var t,r,o;return t=e,o=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(r=[{key:"cleanupWebSocket",value:function(){this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null),this.pingWS&&clearInterval(this.pingWS),this.socket&&(this.socket.removeEventListener("open",this.handleOpenBound),this.socket.removeEventListener("error",this.handleErrorBound),this.socket.removeEventListener("message",this.handleMessageBound),this.socket.removeEventListener("close",this.handleCloseBound),this.socket.close(),this.socket=null)}},{key:"initWebSocket",value:function(){this.cleanupWebSocket(),this.connectedWebSocketGleapId=qe.getInstance().session.gleapId,qe.getInstance().session&&qe.getInstance().sdkKey&&(this.socket=new WebSocket("".concat(qe.getInstance().wsApiUrl,"?gleapId=").concat(qe.getInstance().session.gleapId,"&gleapHash=").concat(qe.getInstance().session.gleapHash,"&apiKey=").concat(qe.getInstance().sdkKey,"&sdkVersion=").concat("13.7.9")),this.socket.addEventListener("open",this.handleOpenBound),this.socket.addEventListener("message",this.handleMessageBound),this.socket.addEventListener("error",this.handleErrorBound),this.socket.addEventListener("close",this.handleCloseBound))}},{key:"handleOpen",value:function(e){var t=this;this.pingWS=setInterval((function(){t.socket.readyState===t.socket.OPEN&&(t.socket.send("PING"),t.socket.send(9))}),1e4),this.connectionTimeout&&(clearTimeout(this.connectionTimeout),this.connectionTimeout=null)}},{key:"handleMessage",value:function(e){this.processMessage(JSON.parse(e.data))}},{key:"handleError",value:function(e){}},{key:"handleClose",value:function(e){var t=this;setTimeout((function(){t.initWebSocket()}),5e3)}},{key:"processMessage",value:function(e){try{if("update"===e.name){var t=e.data,r=t.a,o=t.u;It.getInstance().isOpened()||(r&&go.getInstance().performActions(r),null!=o&&ur.getInstance().setNotificationCount(o))}}catch(n){}}},{key:"getEventArray",value:function(){return this.eventArray}},{key:"stop",value:function(){this.cleanupMainLoop()}},{key:"resetErrorCountLoop",value:function(){var e=this;setInterval((function(){e.errorCount=0}),6e4)}},{key:"cleanupMainLoop",value:function(){this.mainLoopTimeout&&(clearInterval(this.mainLoopTimeout),this.mainLoopTimeout=null)}},{key:"restart",value:function(){this.connectedWebSocketGleapId!==qe.getInstance().session.gleapId&&this.initWebSocket(),this.cleanupMainLoop(),this.trackInitialEvents(),this.runEventStreamLoop()}},{key:"start",value:function(){this.startPageListener(),this.resetErrorCountLoop()}},{key:"trackInitialEvents",value:function(){e.getInstance().logEvent("sessionStarted"),e.getInstance().logCurrentPage()}},{key:"logCurrentPage",value:function(){if(!go.getInstance().disablePageTracking){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.logEvent("pageView",{page:e}))}}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"logEvent",value:function(e,t){var n={name:e,date:new Date};t&&(n.data=x(t)),this.eventArray.push(n),this.streamedEventArray.push(n),this.eventArray.length>this.eventMaxLength&&this.eventArray.shift(),this.streamedEventArray.length>this.eventMaxLength&&this.streamedEventArray.shift()}}])&&We(t.prototype,r),o&&We(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ke(e){return Ke="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},Ke(e)}function Ze(e,t){for(var n=0;n0)for(var e=0;e=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function rt(e,t,n,r,o,a,s){try{var l=e[a](s),c=l.value}catch(i){return void n(i)}l.done?t(c):Promise.resolve(c).then(r,o)}var ot=function(e){return new Promise((function(t,n){if(e){var r=new XMLHttpRequest;r.onload=function(){var e=new FileReader;e.onloadend=function(){t(e.result)},e.onerror=function(){n()},e.readAsDataURL(r.response)},r.onerror=function(e){t()},r.open("GET",e),r.responseType="blob",r.send()}else t()}))},at=function(e){return new Promise((function(t,n){if(e&&e.src){if(function(e){if(!e)return!1;for(var t=0;t1?t-1:0),o=1;o0||r.scrollLeft>0)&&(s.setAttribute("bb-scrollpos",!0),s.setAttribute("bb-scrolltop",r.scrollTop),s.setAttribute("bb-scrollleft",r.scrollLeft)),"SELECT"!==u&&"TEXTAREA"!==u&&"INPUT"!==u||(p=r.value,("value"===r.getAttribute("gleap-ignore")||r.classList.contains("gl-mask"))&&(p=new Array(p.length+1).join("*")),s.setAttribute("bb-data-value",p),"checkbox"!==r.type&&"radio"!==r.type||!r.checked||s.setAttribute("bb-data-checked",!0))),o.appendChild(s),r.shadowRoot&&(f=t,t++,i(r.shadowRoot.firstChild,s,f),ct(r.shadowRoot,s,f),void 0!==s.setAttribute&&s.setAttribute("bb-shadow-parent",f)),i(r.firstChild,s);case 22:case"end":return e.stop()}}),e,null,[[5,15]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){rt(a,r,o,i,s,"next",e)}function s(e){rt(a,r,o,i,s,"throw",e)}i(void 0)}))});return function(e,t,n){return r.apply(this,arguments)}}(),r=document.createDocumentFragment();n(e,r);var o=r.querySelector("head");return o||(o=r),ct(window.document,o),r}(window.document.documentElement),i=a.querySelectorAll("link[rel=import]");for(o=0;o0){for(var l=s.childNodes;l.length>0;)s.parentNode.insertBefore(l[0],s);s.remove()}}var c=a.querySelectorAll("script, noscript");for(o=0;o"),e&&e.childNodes&&e.childNodes.length>0)for(var r=0;r0?o.innerHTML=n.formatTime(e):(o.innerHTML="2:00",n.stopScreenRecording())}),1e3),this.mediaRecorder.ondataavailable=function(e){e.data.size>0&&r.push(e.data)},t.getVideoTracks()[0].onended=function(){n.prepareRecording(r)},this.mediaRecorder.onstop=function(){n.prepareRecording(r)},this.mediaRecorder.start(200),n.rerender()})),ft(this,"prepareRecording",(function(e){var t=new Blob(e,{type:this.getSupportedMimeType()});this.file=new File([t],"screen-recording.".concat("video/mp4"===this.getSupportedMimeType()?"mp4":"webm"),{type:this.getSupportedMimeType()});var n=document.querySelector(".bb-capture-preview video");n&&(n.src=URL.createObjectURL(t),this.audioAvailable=!0,this.isRecording=!1,this.rerender())})),this.rerender=t,this.permissionErrorText=n,navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia||(this.available=!1),setTimeout((function(){r.rerender()}),100)}var t,n;return t=e,(n=[{key:"getSupportedMimeType",value:function(){return MediaRecorder.isTypeSupported("video/mp4")?"video/mp4":MediaRecorder.isTypeSupported("video/webm;codecs=h264")?"video/webm;codecs=h264":"video/webm"}},{key:"formatTime",value:function(e){return(e-(e%=60))/60+(90&&(e.tags=t),this.excludeData)for(var n=Object.keys(this.excludeData),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(t?window.open(e,"_blank").focus():window.location.href=e)})),Tt(this,"autoWhiteListCookieManager",(function(){window&&window.cmp_block_ignoredomains&&window.cmp_block_ignoredomains.concat(["messenger-app.gleap.io"])})),Tt(this,"injectFrame",(function(){t.injectedFrame||(t.injectedFrame=!0,t.autoWhiteListCookieManager(),T((function(){Qe.getInstance().onConfigLoaded((function(){Qe.getInstance().applyStylesFromConfig();var e=document.createElement("div");e.className="gleap-frame-container gleap-frame-container--hidden gl-block",e.innerHTML='
'),document.body.appendChild(e),t.gleapFrameContainer=e,t.gleapFrame=document.querySelector(".gleap-frame"),t.updateFrameStyle(),"widget"===t.appMode&&t.showFrameContainer(!0)}))})))})),Tt(this,"showImage",(function(e){T((function(){var t=document.createElement("div");t.className="gleap-image-view",t.innerHTML='
\n \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;u1&&void 0!==arguments[1]&&arguments[1];try{this.gleapFrame=document.querySelector(".gleap-frame"),this.gleapFrame&&this.gleapFrame.contentWindow?this.gleapFrame.contentWindow.postMessage(JSON.stringify(e),"*"):t&&this.queue.push(e)}catch(r){}}},{key:"sendSessionUpdate",value:function(){this.sendMessage({name:"session-update",data:{sessionData:qe.getInstance().getSession(),apiUrl:qe.getInstance().apiUrl,sdkKey:qe.getInstance().sdkKey}})}},{key:"sendConfigUpdate",value:function(){this.sendMessage({name:"config-update",data:{config:Qe.getInstance().getFlowConfig(),aiTools:Qe.getInstance().getAiTools(),overrideLanguage:Zn.getInstance().getOverrideLanguage()}}),this.updateFrameStyle()}},{key:"showDrawingScreen",value:function(e){var t=this;this.hideWidget(),this.markerManager=new Wn(e),this.markerManager.show((function(e){e||t.hideMarkerManager(),t.showWidget()}))}},{key:"workThroughQueue",value:function(){var e=function(e){return function(e){if(Array.isArray(e))return Ct(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ct(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)?Ct(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.queue);this.queue=[];for(var t=0;t0&&(n.tags=r),e.sendMessage({name:"collect-ticket-data",data:n})}if("height-update"===t.name){e.frameHeight=t.data;var o=document.querySelector(".gleap-frame-container-inner");"survey"!==e.appMode&&"survey_full"!==e.appMode&&"survey_web"!==e.appMode||!o||(o.style.maxHeight="".concat(e.frameHeight,"px"))}if("notify-event"===t.name&&rn.notifyEvent(t.data.type,t.data.data),"cleanup-drawings"===t.name&&e.hideMarkerManager(),"open-url"===t.name){var a=t.data,i=!!t.newTab;e.urlHandler(a,i)}if("run-custom-action"===t.name&&cn.triggerCustomAction(t.data),"close-widget"===t.name&&e.hideWidget(),"tool-execution"===t.name&&rn.notifyEvent("tool-execution",t.data),"send-feedback"===t.name){var s=t.data.formData,l=t.data.action,c=t.data.outboundId,u=t.data.spamToken;new kt(l.feedbackType,"MEDIUM",s,!1,l.excludeData,c,u).sendFeedback().then((function(t){e.sendMessage({name:"feedback-sent",data:t}),rn.notifyEvent("feedback-sent",s)})).catch((function(t){e.sendMessage({name:"feedback-sending-failed",data:"Something went wrong, please try again."}),rn.notifyEvent("error-while-sending")}))}"start-screen-drawing"===t.name&&e.showDrawingScreen(t.data)})),window.addEventListener("message",(function(t){if(t.origin===e.frameUrl||t.origin===vr.getInstance().bannerUrl)try{for(var r=JSON.parse(t.data),o=0;o1&&void 0!==arguments[1]?arguments[1]:"INFO";!e||e.length<=0||(this.logArray.push({log:k(e,1e3),date:new Date,priority:t}),this.logArray.length>this.logMaxLength&&this.logArray.shift())}},{key:"addLogWithArgs",value:function(e,t){if(e&&!(e.length<=0)){var r="";try{for(var o=0;o1&&void 0!==arguments[1])||arguments[1],n=k(e.innerText||"",40).replace(/(\r\n|\n|\r)/gm,"").replace(/ +(?= )/g,""),r="",o="";if(void 0!==e.getAttribute){var a=e.getAttribute("id");a&&(r=' id="'.concat(a,'"'));var i=e.getAttribute("class");i&&(o=' class="'.concat(i,'"'))}var s=(e.tagName||"").toLowerCase(),l="<",c=">";return t||(l="[",c="]"),"".concat(l).concat(s).concat(r).concat(o).concat(c).concat(n).concat(l,"/").concat(s).concat(c)}(e.target),"CLICK")}}))}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&qt(t.prototype,n),r&&qt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Kt(e){return Kt="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},Kt(e)}function Zt(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("flow-started"===e){var n=go.getInstance();n.setGlobalDataItem("webReplay",null),n.setGlobalDataItem("screenRecordingData",null),n.takeCurrentReplay()}var r=this.getInstance().eventListeners[e];if(r)for(var o=0;o=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function dn(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)||hn(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 pn(e){return function(e){if(Array.isArray(e))return mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=hn(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function hn(e,t){if(e){if("string"==typeof e)return mn(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)?mn(e,t):void 0}}function mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}(t)+s).concat(l,")");var c=t.split("/"),u=s.split("/");c.pop();for(var d=0,p=u;d=t.length);){var a=r(b);if(","===a.slice(-1))a=x(e,a.substring(0,a.length-1)),o.push(a);else{var i="";a=x(e,a);for(var s=!1;;){var l=t.charAt(n);if(""===l){o.push((a+i).trim());break}if(s)")"===l&&(s=!1);else{if(","===l){n+=1,o.push((a+i).trim());break}"("===l&&(s=!0)}i+=l,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?y(r,S()):"object"===t&&"data"===n&&r?x(e,r):r}function E(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&E(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&E(e.parentNode,t,n)}function T(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t)||r.closest(".".concat(t)))return!0}else if(E(r,t,!0))return!0;return!(!n||!r.matches(n)&&!r.closest(n))}function L(t,n){var r=n.doc,a=n.mirror,i=n.blockClass,c=n.blockSelector,d=n.maskTextClass,p=n.maskTextSelector,m=n.inlineStylesheet,g=n.maskInputOptions,v=void 0===g?{}:g,b=n.maskTextFn,w=n.maskInputFn,x=n.dataURLOptions,E=void 0===x?{}:x,L=n.inlineImages,I=n.recordCanvas,A=n.keepIframeSrcFn,O=n.newlyAddedElement,_=void 0!==O&&O,P=function(e,t){if(t.hasNode(e)){var n=t.getId(e);return 1===n?void 0:n}}(r,a);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:e.Document,childNodes:[],compatMode:t.compatMode}:{type:e.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:e.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:P};case t.ELEMENT_NODE:return function(t,n){for(var r=n.doc,a=n.inlineStylesheet,i=n.maskInputOptions,c=void 0===i?{}:i,d=n.maskInputFn,p=n.dataURLOptions,m=void 0===p?{}:p,g=n.inlineImages,v=n.recordCanvas,b=n.keepIframeSrcFn,w=n.newlyAddedElement,x=void 0!==w&&w,E=n.rootId,T=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(t,n.blockClass,n.blockSelector),L=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return u.test(t)?"div":t}(t),I={},A=t.attributes.length,O=0;O2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var _="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",P={map:{},getId:function(){return console.error(_),-1},getNode:function(){return console.error(_),null},removeNodeFromMap:function(){console.error(_)},has:function(){return console.error(_),!1},reset:function(){console.error(_)}};function M(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var a=arguments.length,i=new Array(a),s=0;st?(r&&(clearTimeout(r),r=null),o=l,e.apply(u,i)):!r&&!1!==n.trailing&&(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(u,i)}),c))}}function R(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),a&&a.set&&a.set.call(this,e)}}),function(){return R(e,t,a||{},!0)}}function N(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(a){return function(){}}}function j(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function D(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function F(e,t,n,r){if(!e)return!1;var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t)||r&&null!==o.closest("."+t))return!0}else if(E(o,t,r))return!0;return!(!n||!(e.matches(n)||r&&null!==o.closest(n)))}function B(e,t){return t.getId(e)===d}function z(e,t){if(n(e))return!1;var r=t.getId(e);return!t.has(r)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||z(e.parentNode,t))}function U(e){return Boolean(e.changedTouches)}function q(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function H(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function W(e){return Boolean(null==e?void 0:e.shadowRoot)}("undefined"==typeof window?"undefined":wn(window))<"u"&&window.Proxy&&window.Reflect&&(P=new Proxy(P,{get:function(e,t,n){return"map"===t&&console.error(_),Reflect.get(e,t,n)}}));var $=function(){function e(){gn(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return yn(e,[{key:"getId",value:function(e){var t;return null!=(t=this.styleIDMap.get(e))?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}(),G=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(G||{}),V=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e}(V||{}),K=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(K||{}),Z=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Z||{}),Y=function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e}(Y||{}),X=function(e){return e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e}(X||{});function J(e){return"__ln"in e}var Q=function(){function e(){gn(this,e),this.length=0,this.head=null}return yn(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n=0;v--){var y=r.get(v);if(y){var b=t.mirror.getId(y.value.parentNode);if(-1===o(y.value))continue;if(-1!==b){h=y;break}var w=y.value;if(w.parentNode&&w.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var x=w.parentNode.host;if(-1!==t.mirror.getId(x)){h=y;break}}}}if(!h){for(;r.head;)r.removeNode(r.head.value);break}f=h.previous,r.removeNode(h.value),a(h.value)}var k={texts:t.texts.map((function(e){return{id:t.mirror.getId(e.node),value:e.value}})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){return{id:t.mirror.getId(e.node),attributes:e.attributes}})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};!k.texts.length&&!k.attributes.length&&!k.removes.length&&!k.adds.length||(t.texts=[],t.attributes=[],t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(k))}},this.processMutation=function(e){if(!B(e.target,t.mirror))switch(e.type){case"characterData":var o=e.target.textContent;!F(e.target,t.blockClass,t.blockSelector,!1)&&o!==e.oldValue&&t.texts.push({value:T(e.target,t.maskTextClass,t.maskTextSelector)&&o?t.maskTextFn?t.maskTextFn(o):o.replace(/[\S]/g,"*"):o,node:e.target});break;case"attributes":var a=e.target,i=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(i=s({maskInputOptions:t.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:i,maskInputFn:t.maskInputFn})),F(e.target,t.blockClass,t.blockSelector,!1)||i===e.oldValue)return;var l=t.attributes.find((function(t){return t.node===e.target}));if("IFRAME"===a.tagName&&"src"===e.attributeName&&!t.keepIframeSrcFn(i)){if(a.contentDocument)return;e.attributeName="rr_src"}if(l||(l={node:e.target,attributes:{}},t.attributes.push(l)),"style"===e.attributeName){var c=t.doc.createElement("span");e.oldValue&&c.setAttribute("style",e.oldValue),(void 0===l.attributes.style||null===l.attributes.style)&&(l.attributes.style={});for(var u=l.attributes.style,d=0,p=Array.from(a.style);d1&&void 0!==arguments[1]?arguments[1]:{},n=e.doc.defaultView;if(!n)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,a=e.scrollCb,i=e.viewportResizeCb,s=e.inputCb,l=e.mediaInteractionCb,c=e.styleSheetRuleCb,u=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),a.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),i.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),l.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),c.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),u.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)}}(e,t);var r,o=ke(e,e.doc),a=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var a,i="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,l=[],c=M((function(e){var n=Date.now()-a;t(l.map((function(e){return e.timeOffset-=n,e})),e),l=[],a=null}),s),u=M((function(e){var t=xe(e),n=U(e)?e.changedTouches[0]:e,r=n.clientX,i=n.clientY;a||(a=Date.now()),l.push({x:r,y:i,id:o.getId(t),timeOffset:Date.now()-a}),c(("undefined"==typeof DragEvent?"undefined":wn(DragEvent))<"u"&&e instanceof DragEvent?V.Drag:e instanceof MouseEvent?V.MouseMove:V.TouchMove)}),i,{trailing:!1}),d=[O("mousemove",u,r),O("touchmove",u,r),O("drag",u,r)];return function(){d.forEach((function(e){return e()}))}}(e),i=function(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.sampling;if(!1===i.mouseInteraction)return function(){};var s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,l=[];return Object.keys(K).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var i=e.toLowerCase(),s=function(e){return function(n){var i=xe(n);if(!F(i,o,a,!0)){var s=U(n)?n.changedTouches[0]:n;if(s){var l=r.getId(i),c=s.clientX,u=s.clientY;t({type:K[e],id:l,x:c,y:u})}}}}(e);l.push(O(i,s,n))})),function(){l.forEach((function(e){return e()}))}}(e),l=Se(e),c=function(e){var t=e.viewportResizeCb,n=-1,r=-1;return O("resize",M((function(){var e=j(),o=D();(n!==e||r!==o)&&(t({width:Number(o),height:Number(e)}),n=e,r=o)}),200),window)}(e),u=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,a=e.blockSelector,i=e.ignoreClass,l=e.maskInputOptions,c=e.maskInputFn,u=e.sampling,d=e.userTriggeredOnInput;function p(e){var t=xe(e),r=e.isTrusted;if(t&&"OPTION"===t.tagName&&(t=t.parentElement),t&&t.tagName&&!(Ee.indexOf(t.tagName)<0)&&!F(t,o,a,!0)){var u=t.type;if(!t.classList.contains(i)){var p=t.value,h=!1;"radio"===u||"checkbox"===u?h=t.checked:(l[t.tagName.toLowerCase()]||l[u])&&(p=s({maskInputOptions:l,tagName:t.tagName,type:u,value:p,maskInputFn:c})),f(t,Ce({text:p,isChecked:h,userTriggered:r},d));var m=t.name;"radio"===u&&m&&h&&n.querySelectorAll('input[type="radio"][name="'.concat(m,'"]')).forEach((function(e){e!==t&&f(e,Ce({text:e.value,isChecked:!h,userTriggered:!1},d))}))}}}function f(e,n){var o=Te.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Te.set(e,n);var a=r.getId(e);t(me(he({},n),{id:a}))}}var h=("last"===u.input?["change"]:["input","change"]).map((function(e){return O(e,p,n)})),m=n.defaultView;if(!m)return function(){h.forEach((function(e){return e()}))};var g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push.apply(h,pn(v.map((function(e){return R(e[0],e[1],{set:function(){p({target:this})}},!1,m)})))),function(){h.forEach((function(e){return e()}))}}(e),d=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,a=e.sampling,i=function(e){return M((function(a){var i=xe(a);if(i&&!F(i,n,r,!0)){var s=i.currentTime,l=i.volume,c=i.muted,u=i.playbackRate;t({type:e,id:o.getId(i),currentTime:s,volume:l,muted:c,playbackRate:u})}}),a.media||500)},s=[O("play",i(Y.Play)),O("pause",i(Y.Pause)),O("seeked",i(Y.Seeked)),O("volumechange",i(Y.VolumeChange)),O("ratechange",i(Y.RateChange))];return function(){s.forEach((function(e){return e()}))}}(e),p=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,a=t.win,i=a.CSSStyleSheet.prototype.insertRule;a.CSSStyleSheet.prototype.insertRule=function(e,t){var a=Ie(this,r,o.styleMirror),s=a.id,l=a.styleId;return(s&&-1!==s||l&&-1!==l)&&n({id:s,styleId:l,adds:[{rule:e,index:t}]}),i.apply(this,[e,t])};var s,l,c=a.CSSStyleSheet.prototype.deleteRule;a.CSSStyleSheet.prototype.deleteRule=function(e){var t=Ie(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,removes:[{index:e}]}),c.apply(this,[e])},a.CSSStyleSheet.prototype.replace&&(s=a.CSSStyleSheet.prototype.replace,a.CSSStyleSheet.prototype.replace=function(e){var t=Ie(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,replace:e}),s.apply(this,[e])}),a.CSSStyleSheet.prototype.replaceSync&&(l=a.CSSStyleSheet.prototype.replaceSync,a.CSSStyleSheet.prototype.replaceSync=function(e){var t=Ie(this,r,o.styleMirror),a=t.id,i=t.styleId;return(a&&-1!==a||i&&-1!==i)&&n({id:a,styleId:i,replaceSync:e}),l.apply(this,[e])});var u={};ve?u.CSSGroupingRule=a.CSSGroupingRule:(ye&&(u.CSSMediaRule=a.CSSMediaRule),we&&(u.CSSConditionRule=a.CSSConditionRule),be&&(u.CSSSupportsRule=a.CSSSupportsRule));var d={};return Object.entries(u).forEach((function(e){var t=dn(e,2),a=t[0],i=t[1];d[a]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(e,t){var i=Ie(this.parentStyleSheet,r,o.styleMirror),s=i.id,l=i.styleId;return(s&&-1!==s||l&&-1!==l)&&n({id:s,styleId:l,adds:[{rule:e,index:[].concat(pn(Le(this)),[t||0])}]}),d[a].insertRule.apply(this,[e,t])},i.prototype.deleteRule=function(e){var t=Ie(this.parentStyleSheet,r,o.styleMirror),i=t.id,s=t.styleId;return(i&&-1!==i||s&&-1!==s)&&n({id:i,styleId:s,removes:[{index:[].concat(pn(Le(this)),[e])}]}),d[a].deleteRule.apply(this,[e])}})),function(){a.CSSStyleSheet.prototype.insertRule=i,a.CSSStyleSheet.prototype.deleteRule=c,s&&(a.CSSStyleSheet.prototype.replace=s),l&&(a.CSSStyleSheet.prototype.replaceSync=l),Object.entries(u).forEach((function(e){var t=dn(e,2),n=t[0],r=t[1];r.prototype.insertRule=d[n].insertRule,r.prototype.deleteRule=d[n].deleteRule}))}}(e,{win:n}),f=Ae(e,e.doc),h=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,a=e.stylesheetManager,i=t.win,s=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(e,t,i){var l;if(o.has(e))return s.apply(this,[e,t,i]);var c=Ie(null==(l=this.parentRule)?void 0:l.parentStyleSheet,r,a.styleMirror),u=c.id,d=c.styleId;return(u&&-1!==u||d&&-1!==d)&&n({id:u,styleId:d,set:{property:e,value:t,priority:i},index:Le(this.parentRule)}),s.apply(this,[e,t,i])};var l=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(e){var t;if(o.has(e))return l.apply(this,[e]);var i=Ie(null==(t=this.parentRule)?void 0:t.parentStyleSheet,r,a.styleMirror),s=i.id,c=i.styleId;return(s&&-1!==s||c&&-1!==c)&&n({id:s,styleId:c,remove:{property:e},index:Le(this.parentRule)}),l.apply(this,[e])},function(){i.CSSStyleDeclaration.prototype.setProperty=s,i.CSSStyleDeclaration.prototype.removeProperty=l}}(e,{win:n}),m=e.collectFonts?function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],a=new WeakMap,i=r.FontFace;r.FontFace=function(e,t,n){var r=new i(e,t,n);return a.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=N(n.fonts,"add",(function(e){return function(n){return setTimeout((function(){var e=a.get(n);e&&(t(e),a.delete(n))}),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=i})),o.push(s),function(){o.forEach((function(e){return e()}))}}(e):function(){},g=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,a=e.selectionCb,i=!0,s=function(){var e=t.getSelection();if(!(!e||i&&null!=e&&e.isCollapsed)){i=e.isCollapsed||!1;for(var s=[],l=e.rangeCount||0,c=0;c0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){if("rrweb"===e.data.type){if(!e.source)return;var t=this.crossOriginIframeMap.get(e.source);if(!t)return;var n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case G.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:G.IncrementalSnapshot,data:{source:V.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case G.Meta:case G.Load:case G.DomContentLoaded:return!1;case G.Plugin:return t;case G.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case G.IncrementalSnapshot:switch(t.data.source){case V.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case V.Drag:case V.TouchMove:case V.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case V.ViewportResize:return!1;case V.MediaInteraction:case V.MouseInteraction:case V.Scroll:case V.CanvasMutation:case V.Input:return this.replaceIds(t.data,e,["id"]),t;case V.StyleSheetRule:case V.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case V.Font:return t;case V.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case V.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}}},{key:"replace",value:function(e,t,n,r){var o,a=fn(r);try{for(a.s();!(o=a.n()).done;){var i=o.value;!Array.isArray(t[i])&&"number"!=typeof t[i]||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]))}}catch(s){a.e(s)}finally{a.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}}]),e}(),Me=Object.defineProperty,Re=Object.defineProperties,Ne=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable,Be=function(e,t,n){return t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},ze=function(e,t){for(var n in t||(t={}))De.call(t,n)&&Be(e,n,t[n]);if(je){var r,o=fn(je(t));try{for(o.s();!(r=o.n()).done;)n=r.value,Fe.call(t,n)&&Be(e,n,t[n])}catch(a){o.e(a)}finally{o.f()}}return e},Ue=function(e,t){return Re(e,Ne(t))},qe=function(){function e(t){gn(this,e),this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror;var n=this;this.restorePatches.push(N(Element.prototype,"attachShadow",(function(e){return function(t){var r=e.call(this,t);return this.shadowRoot&&n.addShadowRoot(this.shadowRoot,this.ownerDocument),r}})))}return yn(e,[{key:"addShadowRoot",value:function(e,t){var n=this;!r(e)||this.shadowDoms.has(e)||(this.shadowDoms.add(e),ke(Ue(ze({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Se(Ue(ze({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),Ae({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e)}),0))}},{key:"observeAttachShadow",value:function(e){if(e.contentWindow){var t=this;this.restorePatches.push(N(e.contentWindow.HTMLElement.prototype,"attachShadow",(function(n){return function(r){var o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}})))}}},{key:"reset",value:function(){this.restorePatches.forEach((function(e){return e()})),this.shadowDoms=new WeakSet}}]),e}(),He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",We=("undefined"==typeof Uint8Array?"undefined":wn(Uint8Array))>"u"?[]:new Uint8Array(256),$e=0;$e<64;$e++)We[He.charCodeAt($e)]=$e;var Ge=new Map,Ve=function(e,t,n){if(e&&(Ye(e,t)||"object"==wn(e))){var r=function(e,t){var n=Ge.get(e);return n||(n=new Map,Ge.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o}};function Ke(e,t,n){if(e instanceof Array)return e.map((function(e){return Ke(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var r=e.constructor.name,o=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t>2],o+=He[(3&n[t])<<4|n[t+1]>>4],o+=He[(15&n[t+1])<<2|n[t+2]>>6],o+=He[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:r,base64:o}}return e instanceof DataView?{rr_type:e.constructor.name,args:[Ke(e.buffer,t,n),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?{rr_type:e.constructor.name,src:e.src}:e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Ke(e.data,t,n),e.width,e.height]}:Ye(e,t)||"object"==wn(e)?{rr_type:e.constructor.name,index:Ve(e,t,n)}:e}var Ze=function(e,t,n){return pn(e).map((function(e){return Ke(e,t,n)}))},Ye=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function Xe(e,t,n){var r=[];try{var o=N(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(r){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),at=Object.defineProperty,it=Object.defineProperties,st=Object.getOwnPropertyDescriptors,lt=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,dt=function(e,t,n){return t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},pt=function(e,t){for(var n in t||(t={}))ct.call(t,n)&&dt(e,n,t[n]);if(lt){var r,o=fn(lt(t));try{for(o.s();!(r=o.n()).done;)n=r.value,ut.call(t,n)&&dt(e,n,t[n])}catch(a){o.e(a)}finally{o.f()}}return e},ft=function(e,t){return it(e,st(t))};function ht(e){return ft(pt({},e),{timestamp:Date.now()})}var mt,gt,vt,yt=!1,bt=new i;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,a=void 0===o?"rr-block":o,s=e.blockSelector,l=void 0===s?null:s,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,d=e.maskTextClass,p=void 0===d?"rr-mask":d,f=e.maskTextSelector,h=void 0===f?null:f,m=e.inlineStylesheet,g=void 0===m||m,v=e.maskAllInputs,y=e.maskInputOptions,b=e.slimDOMOptions,w=e.maskInputFn,x=e.maskTextFn,k=e.hooks,S=e.packFn,C=e.sampling,E=void 0===C?{}:C,T=e.dataURLOptions,L=void 0===T?{}:T,I=e.mousemoveWait,_=e.recordCanvas,P=void 0!==_&&_,M=e.recordCrossOriginIframes,R=void 0!==M&&M,N=e.userTriggeredOnInput,F=void 0!==N&&N,B=e.collectFonts,z=void 0!==B&&B,U=e.inlineImages,$=void 0!==U&&U,K=e.plugins,Z=e.keepIframeSrcFn,Y=void 0===Z?function(){return!1}:Z,X=e.ignoreCSSAttributes,J=void 0===X?new Set([]):X,Q=!R||window.parent===window,ee=!1;if(!Q)try{window.parent.document,ee=!1}catch(be){ee=!0}if(Q&&!t)throw new Error("emit function is required");void 0!==I&&void 0===E.mousemove&&(E.mousemove=I),bt.reset();var te=!0===v?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==y?y:{password:!0},ne=!0===b||"all"===b?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===b,headMetaDescKeywords:"all"===b}:b||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r=r,l=n&&e.timestamp-re.timestamp>n;(s||l)&>(!0)}};var ie,se=function(e){mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.Mutation},e)}))},le=function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.Scroll},e)}))},ce=function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.CanvasMutation},e)}))},ue=new ot({mutationCb:se,adoptedStyleSheetCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.AdoptedStyleSheet},e)}))}}),de=new Pe({mirror:bt,mutationCb:se,stylesheetManager:ue,recordCrossOriginIframes:R,wrappedEmit:mt}),pe=fn(K||[]);try{for(pe.s();!(ie=pe.n()).done;){var fe=ie.value;fe.getMirror&&fe.getMirror({nodeMirror:bt,crossOriginIframeMirror:de.crossOriginIframeMirror,crossOriginIframeStyleMirror:de.crossOriginIframeStyleMirror})}}catch(we){pe.e(we)}finally{pe.f()}vt=new rt({recordCanvas:P,mutationCb:ce,win:window,blockClass:a,blockSelector:l,mirror:bt,sampling:E.canvas,dataURLOptions:L});var he=new qe({mutationCb:se,scrollCb:le,bypassOptions:{blockClass:a,blockSelector:l,maskTextClass:p,maskTextSelector:h,inlineStylesheet:g,maskInputOptions:te,dataURLOptions:L,maskTextFn:x,maskInputFn:w,recordCanvas:P,inlineImages:$,sampling:E,slimDOMOptions:ne,iframeManager:de,stylesheetManager:ue,canvasManager:vt,keepIframeSrcFn:Y},mirror:bt});gt=function(){var e,t,n,r,o,s,c,u,d,f,m,v,y=arguments.length>0&&void 0!==arguments[0]&&arguments[0];mt(ht({type:G.Meta,data:{href:window.location.href,width:D(),height:j()}}),y),ue.reset(),ge.forEach((function(e){return e.lock()}));var b=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new i:r,a=n.blockClass,s=n.blockSelector,l=n.maskTextClass,c=n.maskTextSelector,u=n.inlineStylesheet,d=n.inlineImages,p=n.recordCanvas,f=n.maskAllInputs,h=void 0!==f&&f,m=n.slimDOM,g=void 0!==m&&m,v=n.keepIframeSrcFn;return A(e,{doc:e,mirror:o,blockClass:void 0===a?"rr-block":a,blockSelector:void 0===s?null:s,maskTextClass:void 0===l?"rr-mask":l,maskTextSelector:void 0===c?null:c,skipChild:!1,inlineStylesheet:void 0===u||u,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:n.maskTextFn,maskInputFn:n.maskInputFn,slimDOMOptions:!0===g||"all"===g?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===g,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===g?{}:g,dataURLOptions:n.dataURLOptions,inlineImages:void 0!==d&&d,recordCanvas:void 0!==p&&p,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout,onStylesheetLoad:n.onStylesheetLoad,stylesheetLoadTimeout:n.stylesheetLoadTimeout,keepIframeSrcFn:void 0===v?function(){return!1}:v,newlyAddedElement:!1})}(document,{mirror:bt,blockClass:a,blockSelector:l,maskTextClass:p,maskTextSelector:h,inlineStylesheet:g,maskAllInputs:te,maskTextFn:x,slimDOM:ne,dataURLOptions:L,recordCanvas:P,inlineImages:$,onSerialize:function(e){q(e,bt)&&de.addIframe(e),H(e,bt)&&ue.trackLinkElement(e),W(e)&&he.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){de.attachIframe(e,t),he.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ue.attachLinkElement(e,t)},keepIframeSrcFn:Y});if(!b)return console.warn("Failed to snapshot the document");mt(ht({type:G.FullSnapshot,data:{node:b,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===(e=document)||void 0===e?void 0:e.documentElement.scrollLeft)||(null==(u=null==(c=null===(t=document)||void 0===t?void 0:t.body)?void 0:c.parentElement)?void 0:u.scrollLeft)||(null==(d=null===(n=document)||void 0===n?void 0:n.body)?void 0:d.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===(r=document)||void 0===r?void 0:r.documentElement.scrollTop)||(null==(m=null==(f=null===(o=document)||void 0===o?void 0:o.body)?void 0:f.parentElement)?void 0:m.scrollTop)||(null==(v=null===(s=document)||void 0===s?void 0:s.body)?void 0:v.scrollTop)||0}}})),ge.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,bt.getId(document))};try{var me=[];me.push(O("DOMContentLoaded",(function(){mt(ht({type:G.DomContentLoaded,data:{}}))})));var ve=function(e){var t;return Oe({mutationCb:se,mousemoveCb:function(e,t){return mt(ht({type:G.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.MouseInteraction},e)}))},scrollCb:le,viewportResizeCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.ViewportResize},e)}))},inputCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.Input},e)}))},mediaInteractionCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.StyleDeclaration},e)}))},canvasMutationCb:ce,fontCb:function(e){return mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.Font},e)}))},selectionCb:function(e){mt(ht({type:G.IncrementalSnapshot,data:pt({source:V.Selection},e)}))},blockClass:a,ignoreClass:u,maskTextClass:p,maskTextSelector:h,maskInputOptions:te,inlineStylesheet:g,sampling:E,recordCanvas:P,inlineImages:$,userTriggeredOnInput:F,collectFonts:z,doc:e,maskInputFn:w,maskTextFn:x,keepIframeSrcFn:Y,blockSelector:l,slimDOMOptions:ne,dataURLOptions:L,mirror:bt,iframeManager:de,stylesheetManager:ue,shadowDomManager:he,canvasManager:vt,ignoreCSSAttributes:J,plugins:(null==(t=null==K?void 0:K.filter((function(e){return e.observer})))?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return mt(ht({type:G.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};de.addLoadListener((function(e){me.push(ve(e.contentDocument))}));var ye=function(){gt(),me.push(ve(document)),yt=!0};return"interactive"===document.readyState||"complete"===document.readyState?ye():me.push(O("load",(function(){mt(ht({type:G.Load,data:{}})),ye()}),window)),function(){me.forEach((function(e){return e()})),yt=!1}}catch(me){console.warn(me)}}return wt.addCustomEvent=function(e,t){if(!yt)throw new Error("please add custom event after start recording");mt(ht({type:G.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){ge.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!yt)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=bt,wt}();function kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n4e6){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return kn(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)?kn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(r.s();!(n=r.n()).done;){var a=n.value;t="image/"===a[1].toLocaleLowerCase().slice(0,6)?t.replace(a[0],"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAQSURBVHgBAQUA+v8ABRg5/wHSAVZN1mnaAAAAAElFTkSuQmCC"):t.replace(a[0],"")}}catch(o){r.e(o)}finally{r.f()}}return{event:JSON.parse(t),size:t.length}}(t).event;e.push(n)}}))}catch(t){console.error(t)}}},{key:"stop",value:function(){this.stopFunction&&this.stopFunction(),this.startDate=void 0,this.events=[],this.bufferSize=0}},{key:"getReplayData",value:function(){return{startDate:this.startDate,events:this.events,baseUrl:window.location.origin,width:window.innerWidth,height:window.innerHeight,isMobile:w(),type:"rrweb"}}}])&&Tn(t.prototype,n),r&&Tn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function On(e){return On="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},On(e)}function _n(e,t){for(var n=0;nthis.startPoint.x&&(o=this.startPoint.x),t.y>this.startPoint.y&&(a=this.startPoint.y),this.path.setAttributeNS(null,"x",o),this.path.setAttributeNS(null,"y",a),this.path.setAttributeNS(null,"width",n),this.path.setAttributeNS(null,"height",r)}}},{key:"mouseDownRect",value:function(e){this.path=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",this.color),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",this.strokeWidthRect),this.startPoint=this.getMousePosition(e),this.appendPathToSvg(this.path)}},{key:"mouseDownPen",value:function(e){var t=this.color+"AA",n=this.strokeWidth;"blur"===this.tool&&(t="#000000",n=40),this.path=document.createElementNS("http://www.w3.org/2000/svg","path"),this.path.setAttribute("fill","none"),this.path.setAttribute("stroke",t),this.path.setAttribute("stroke-linecap","round"),this.path.setAttribute("stroke-width",n),this.buffer=[];var r=this.getMousePosition(e);this.appendToBuffer(r),this.strPath="M"+r.x+" "+r.y,this.path.setAttribute("d",this.strPath),this.appendPathToSvg(this.path)}},{key:"setTool",value:function(e){this.tool=e}},{key:"setColor",value:function(e){this.color=e}},{key:"getMousePosition",value:function(e){return e.touches&&e.touches.length>0?{x:e.touches[0].clientX,y:e.touches[0].clientY}:{x:e.clientX,y:e.clientY}}},{key:"getAveragePoint",value:function(e){var t=this.buffer.length;if(t%2==1||t>=this.bufferSize){var n,r,o=0,a=0,i=0;for(r=e;rthis.bufferSize;)this.buffer.shift()}},{key:"appendPathToSvg",value:function(e){this.svgElement.appendChild(e),this.pathBuffer.push(e),this.rerender()}},{key:"removeLastAddedPathFromSvg",value:function(){this.pathBuffer.length<=0||!this.svgElement||(this.svgElement.removeChild(this.pathBuffer[this.pathBuffer.length-1]),this.pathBuffer.pop(),this.rerender())}},{key:"fadeOutToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=0,e.style.pointerEvents="none")}},{key:"fadeInToolbar",value:function(){var e=document.querySelector(".bb-capture-toolbar");e&&(e.style.opacity=1,e.style.pointerEvents="auto")}}],n&&_n(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Nn(e){return Nn="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},Nn(e)}function jn(e,t){for(var n=0;n\n \n
'.concat(u("dismiss"),"
\n
").concat(u("rect"),'
\n
\n ').concat("capture"===this.type?'
\n '.concat(u("recorderon"),"\n ").concat(u("recorderoff"),'\n \n
\n
\n ').concat(u("mic"),'\n \n
\n
2:00
\n
\n
\n ').concat(u("pointer"),"\n
"):"",'\n
\n ').concat(u("rect"),'\n
\n
\n ').concat(u("pen"),'\n
\n
\n ').concat(u("blur"),'\n
\n
\n
\n ').concat(Zn.translateText("pickAColor"),'\n
\n
\n ').concat(u("undo"),'\n ').concat(Zn.translateText("undo"),"\n
\n ").concat("capture"!==this.type?'
'.concat(Zn.translateText("next"),"
"):"",'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
').concat(Zn.translateText("retry"),'
\n
').concat(Zn.translateText("next"),"
\n
\n
\n
\n "),document.body.appendChild(e),e.setAttribute("dir",Zn.getInstance().isRTLLayout?"rtl":"ltr")}},{key:"unregisterListeners",value:function(){this.escListener&&document.removeEventListener("keydown",this.escListener),this.pageLeaveListener&&window.removeEventListener("beforeunload",this.pageLeaveListener)}},{key:"registerListeners",value:function(){var e=this;this.escListener=function(t){var n=!1,r=!1;"key"in(t=t||window.event)&&(n="Escape"===t.key,r="Enter"===t.key),n&&e.dismiss(),"screenshot"===e.type&&r&&e.showNextStep()},document.addEventListener("keydown",this.escListener),this.pageLeaveListener=function(e){e.preventDefault(),e.returnValue=""},window.addEventListener("beforeunload",this.pageLeaveListener)}},{key:"show",value:function(e){this.callback=e,this.registerListeners(),this.hideWidgetUI(),this.createEditorUI(),this.setupMousePointer(),"screenshot"===this.type?(go.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY}),Bn.disableScroll()):this.setupScreenRecording(),this.screenDrawer=new Rn(this.captureScreenDrawerRerender.bind(this)),this.setupColorPicker(),this.setupToolbar()}},{key:"setupColorPicker",value:function(){for(var t=this,n=document.querySelector(".bb-capture-toolbar-item-selectedcolor"),r=document.querySelectorAll(".bb-capture-toolbar-item-color"),o=document.querySelector(".bb-capture-toolbar-item-colorpicker"),a=function(){var a=r[i],s=a.getAttribute("data-color");a.style.backgroundColor=s,a.onclick=function(){a&&(t.screenDrawer.setColor(s),o&&(o.style.display="none"),n.style.backgroundColor=a.style.backgroundColor,e.setPenColor(s))}},i=0;i0?r.classList.remove(e):r.classList.add(e))}}},{key:"captureRenderer",value:function(){if(this.screenRecorder){this.screenRecorder.file&&go.getInstance().setGlobalDataItem("screenRecordingData",this.screenRecorder.file);var e="bb-capture-editor-item-inactive",t=document.querySelector(".bb-capture-toolbar-item-timer"),n=document.querySelectorAll(".bb-capture-toolbar-item"),r=document.querySelector(".bb-tooltip-screen-recording"),o=document.querySelector(".bb-tooltip-audio-recording"),a=document.querySelector(".bb-capture-editor"),i="bb-capture-editor-recording",s="bb-capture-editor-notrecording";this.screenRecorder.isRecording?(a.classList.add(i),a.classList.remove(s)):(a.classList.add(s),a.classList.remove(i));var l=document.querySelector(".bb-capture-toolbar");document.querySelector(".bb-capture-preview").style.display=this.screenRecorder.file?"flex":"none",l.style.display=this.screenRecorder.file?"none":"flex";for(var c=0;c0&&(e.length>2?this.notifications=e.splice(0,e.length-2):this.notifications=e,this.renderNotifications())}},{key:"setNotificationCount",value:function(e){It.getInstance().isOpened()?(this.unreadCount=0,this.updateTabBarNotificationCount()):this.unreadCount=e,this.updateTabBarNotificationCount(),o.getInstance().updateNotificationBadge(this.unreadCount)}},{key:"showNotification",value:function(e){this.notificationContainer&&e&&e.data&&(this.notifications.find((function(t){return e.outbound===t.outbound}))||(this.notifications.push(e),e.sound&&kr.ping()),this.notifications.length>2&&this.notifications.shift(),E(this.unreadNotificationsKey,this.notifications),this.renderNotifications())}},{key:"renderNotifications",value:function(){var e=this;if(this.notificationContainer){this.clearAllNotifications(!0);var t=document.createElement("div");t.onclick=function(){e.clearAllNotifications()},t.className="gleap-notification-close",t.innerHTML=u("dismiss"),this.notificationContainer.appendChild(t);for(var n,r,o=function(){var t=e.notifications[a];n=(n=t.data.text).replaceAll("{{name}}",qe.getInstance().getName());var o=document.createElement("div");o.onclick=function(){t.data.conversation?go.openConversation(t.data.conversation.shareToken):t.data.news?go.openNewsArticle(t.data.news.id):t.data.checklist?go.openChecklist(t.data.checklist.id):go.open()},t.data.news?(o.className="gleap-notification-item-news",o.innerHTML='\n
\n '.concat(t.data.coverImageUrl&&""!==t.data.coverImageUrl&&!t.data.coverImageUrl.includes("NewsImagePlaceholder")?''):"",'\n
\n
').concat(n,"
\n ").concat(t.data.previewText&&t.data.previewText.length>0?'
'.concat(t.data.previewText,"
"):"".concat(t.data.sender?'\n
\n '.concat(t.data.sender.profileImageUrl&&'')," ").concat(t.data.sender.name,"
"):""),"\n
\n
")):t.data.checklist?((r=Math.round(t.data.currentStep/t.data.totalSteps*100))<100&&(r+=4),o.className="gleap-notification-item-checklist",o.innerHTML='\n
\n
\n
'.concat(t.data.text,'
\n
\n
\n
\n
\n \n \n \n ').concat(t.data.nextStepTitle,"\n
\n
\n
")):(o.className="gleap-notification-item",o.innerHTML="\n ".concat(t.data.sender&&t.data.sender.profileImageUrl&&''),'\n
\n ').concat(t.data.sender?'
'.concat(t.data.sender.name,"
"):"",'\n
').concat(n,"
\n
")),e.notificationContainer.appendChild(o)},a=0;a0&&void 0!==arguments[0]&&arguments[0];if(this.notificationContainer)for(e||(this.notifications=[],E(this.unreadNotificationsKey,this.notifications));this.notificationContainer.firstChild;)this.notificationContainer.removeChild(this.notificationContainer.firstChild)}},{key:"updateContainerStyle",value:function(){if(this.notificationContainer){var e=Qe.getInstance().getFlowConfig(),t="gleap-notification-container--left",n="gleap-notification-container--no-button";this.notificationContainer.classList.remove(t),this.notificationContainer.classList.remove(n),e.feedbackButtonPosition!==o.FEEDBACK_BUTTON_CLASSIC_LEFT&&e.feedbackButtonPosition!==o.FEEDBACK_BUTTON_BOTTOM_LEFT||this.notificationContainer.classList.add(t),null===o.getInstance().buttonHidden?e.feedbackButtonPosition===o.FEEDBACK_BUTTON_NONE&&this.notificationContainer.classList.add(n):o.getInstance().buttonHidden&&this.notificationContainer.classList.add(n),this.notificationContainer.setAttribute("dir",Zn.getInstance().isRTLLayout?"rtl":"ltr")}}}],r=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],n&&sr(t.prototype,n),r&&sr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function dr(e){return dr="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},dr(e)}function pr(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 fr(e){for(var t=1;t'),document.body.appendChild(t),this.bannerContainer=t}},{key:"sendMessage",value:function(e){try{var t=document.querySelector(".gleap-b-frame");t&&t.contentWindow&&t.contentWindow.postMessage(JSON.stringify(fr(fr({},e),{},{type:"banner"})),"*")}catch(n){}}},{key:"showBanner",value:function(e){this.injectBannerUI(e)}}])&&hr(t.prototype,n),r&&hr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function yr(e){return yr="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},yr(e)}function br(e,t){for(var n=0;n{this.mouseX=e.clientX,this.mouseY=e.clientY},this.handleClick=e=>{var t;this.target&&(null===(t=this.options)||void 0===t?void 0:t.onClick)&&this.options.onClick(this.target),e.preventDefault()},this.tick=()=>{this.updateTarget(),this.tickReq=window.requestAnimationFrame(this.tick)},this.active=!1,this.overlay=new Ir(null!=e?e:{})}start(e){var t,n;return!this.active&&(this.active=!0,this.options=e,document.addEventListener("mousemove",this.handleMouseMove,!0),document.addEventListener("click",this.handleClick,!0),this.overlay.addToDOM(null!==(t=e.parentElement)&&void 0!==t?t:document.body,null===(n=e.useShadowDOM)||void 0===n||n),this.tick(),!0)}stop(){this.active=!1,this.options=void 0,document.removeEventListener("mousemove",this.handleMouseMove,!0),document.removeEventListener("click",this.handleClick,!0),this.overlay.removeFromDOM(),this.target=void 0,this.mouseX=void 0,this.mouseY=void 0,this.tickReq&&window.cancelAnimationFrame(this.tickReq)}updateTarget(){var e,t;if(void 0===this.mouseX||void 0===this.mouseY)return;this.overlay.ignoreCursor();const n=document.elementFromPoint(this.mouseX,this.mouseY);if(this.overlay.captureCursor(),!n||n===this.target)return;if((null===(e=this.options)||void 0===e?void 0:e.elementFilter)&&!this.options.elementFilter(n))return this.target=void 0,void this.overlay.setBounds({x:0,y:0,width:0,height:0});this.target=n;const r=(e=>{const t=e.getBoundingClientRect();return{x:window.pageXOffset+t.left,y:window.pageYOffset+t.top,width:e.offsetWidth,height:e.offsetHeight}})(n);this.overlay.setBounds(r),(null===(t=this.options)||void 0===t?void 0:t.onHover)&&this.options.onHover(n)}}var Or=g(924);function _r(e){return _r="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},_r(e)}function Pr(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0])||r(t.gleapCollapseUI,e)&&r(t.gleapFrameContainer,n))&&(t.gleapCollapseUI&&t.gleapCollapseUI.classList.toggle(e),t.gleapFrameContainer&&t.gleapFrameContainer.classList.toggle(n))})),zr(this,"injectCollapseUI",(function(){if(!t.injectedCollapseUI){t.injectedCollapseUI=!0;var e=document.createElement("div");e.className="gleap-admin-collapse-ui",e.innerHTML='
\n '.concat(u("arrowdown"),"\n
"),document.body.appendChild(e),t.gleapCollapseUI=e,e.addEventListener("click",(function(){t.toggleCollapseUI()}))}})),zr(this,"injectFrame",(function(){var e;if(!t.injectedFrame){t.injectedFrame=!0;var n=document.createElement("div");n.className="gleap-admin-frame-container",n.innerHTML=''),document.body.appendChild(n),t.gleapFrameContainer=n,t.gleapFrame=document.querySelector(".gleap-admin-frame")}}))}var t,o,a;return t=e,a=[{key:"getInstance",value:function(){return this.instance||(this.instance=new e),this.instance}}],(o=[{key:"logCurrentPage",value:function(){var e=window.location.href;e&&e!==this.lastUrl&&(this.lastUrl=e,this.sendMessageToTourBuilder({name:"page-changed",data:{page:e}}))}},{key:"startPageListener",value:function(){var e=this;setInterval((function(){e.logCurrentPage()}),1e3)}},{key:"initAdminHelper",value:function(){var e=this;e.adminHelper=new Nr;try{e.adminHelper.onElementPicked=function(t){e.toggleCollapseUI(!0),e.sendMessageToTourBuilder({name:"element-picked",data:{selector:t}})}}catch(t){console.log(t)}e.injectFrame(),e.injectCollapseUI(),e.setFrameHeight("loading")}},{key:"setFrameHeight",value:function(e){if(this.gleapFrameContainer){var t;t="picker"===e||"navigate"===e?"65px":"editor"===e?"100vh":"0px",this.gleapFrameContainer.style.height=t}}},{key:"start",value:function(){var e=this;if("undefined"!=typeof window&&!window.gleapAdminDisabled){var t=this;window.addEventListener("message",(function(o){if(o.origin&&"https://app.gleap.io"!==!o.origin)try{var a=JSON.parse(o.data);if("admin"===a.type&&("load"===a.name&&(t.configData=a.data,t.initAdminHelper()),"smartlink-search-result"===a.name&&e.sendMessageToTourBuilder({name:"smartlink-search-result",data:a.data})),"tourbuilder"===a.type){if("loaddata"===a.name&&e.sendMessageToTourBuilder({name:"data",data:t.configData}),"smartlink-search"===a.name&&e.sendMessage({name:"smartlink-search",data:a.data}),"save"===a.name&&e.sendMessage({name:"save",data:a.data}),"click"===a.name)try{document.querySelector(a.data.selector).click()}catch(n){console.log(n)}"status-changed"===a.name&&(t.status=a.data,e.setFrameHeight(t.status),t.adminHelper.stopPicker(),"picker"===t.status&&t.adminHelper.startPicker())}}catch(r){}})),this.sendMessage({name:"init"}),this.startPageListener()}}},{key:"sendMessage",value:function(e){try{window&&window.opener&&window.opener.postMessage(JSON.stringify(Fr(Fr({},e),{},{type:"admin"})),"*")}catch(t){}}},{key:"sendMessageToTourBuilder",value:function(e){try{this.gleapFrame&&this.gleapFrame.contentWindow&&this.gleapFrame.contentWindow.postMessage(JSON.stringify(Fr(Fr({},e),{},{type:"tourbuilder"})),"*")}catch(t){}}}])&&Br(t.prototype,o),a&&Br(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Hr(e){return Hr="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},Hr(e)}function Wr(e){return function(e){if(Array.isArray(e))return $r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return $r(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)?$r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{})}function n(t){return t?e[t]:e}function r(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}function o(e){var t='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap((function(e){var n=e.matches(t),r=Array.from(e.querySelectorAll(t));return[].concat(Wr(n?[e]:[]),r)})).filter((function(e){return"none"!==getComputedStyle(e).pointerEvents&&function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}(e)}))}function a(e){if(e&&!function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(e)){var t=n("smoothScroll");e.scrollIntoView({behavior:!t||i(e)?"auto":"smooth",inline:"center",block:"center"})}}function i(e){if(e&&e.parentElement){var t=e.parentElement;return t.scrollHeight>t.clientHeight}}var s={};function l(e,t){s[e]=t}function c(e){return e?s[e]:s}function u(){s={}}var d={};function p(e,t){d[e]=t}function f(e){var t;null==(t=d[e])||t.call(d)}function h(e){if(e){var t=e.getBoundingClientRect(),n={x:t.x,y:t.y,width:t.width,height:t.height};l("__activeStagePosition",n),g(n)}}function m(e){var t=function(e){var t=window.innerWidth,r=window.innerHeight,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.classList.add("gleap-tour-overlay","gleap-tour-overlay-animated"),o.setAttribute("viewBox","0 0 ".concat(t," ").concat(r)),o.setAttribute("xmlSpace","preserve"),o.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),o.setAttribute("version","1.1"),o.setAttribute("preserveAspectRatio","xMinYMin slice"),o.style.fillRule="evenodd",o.style.clipRule="evenodd",o.style.strokeLinejoin="round",o.style.strokeMiterlimit="2",o.style.zIndex="10000",o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%";var a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d",v(e)),a.style.fill=n("overlayColor")||"rgb(0,0,0)",a.style.opacity="".concat(n("overlayOpacity")),a.style.pointerEvents="auto",a.style.cursor="auto",o.appendChild(a),o}(e);document.body.appendChild(t),S(t,(function(e){"path"===e.target.tagName&&f("overlayClick")})),l("__overlaySvg",t)}function g(e){var t=c("__overlaySvg");if(t){var n=t.firstElementChild;if("path"!==(null==n?void 0:n.tagName))throw new Error("no path element found in stage svg");n.setAttribute("d",v(e))}else m(e)}function v(e){var t=window.innerWidth,r=window.innerHeight,o=n("stagePadding")||0,a=n("stageRadius")||0,i=e.width+2*o,s=e.height+2*o,l=Math.min(a,i/2,s/2),c=Math.floor(Math.max(l,0)),u=e.x-o+c,d=e.y-o,p=i-2*c,f=s-2*c;return"M".concat(t,",0L0,0L0,").concat(r,"L").concat(t,",").concat(r,"L").concat(t,",0Z\n M").concat(u,",").concat(d," h").concat(p," a").concat(c,",").concat(c," 0 0 1 ").concat(c,",").concat(c," v").concat(f," a").concat(c,",").concat(c," 0 0 1 -").concat(c,",").concat(c," h-").concat(p," a").concat(c,",").concat(c," 0 0 1 -").concat(c,",-").concat(c," v-").concat(f," a").concat(c,",").concat(c," 0 0 1 ").concat(c,",-").concat(c," z")}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,o=e.element,i="string"==typeof o?document.querySelector(o):o;o&&!i&&t>=0?setTimeout((function(){C(),y(e,t-100)}),100):(i||(i=function(){var e=document.getElementById("gleap-tour-dummy-element");if(e)return e;var t=document.createElement("div");return t.id="gleap-tour-dummy-element",t.style.width="0",t.style.height="0",t.style.pointerEvents="none",t.style.opacity="0",t.style.position="fixed",t.style.top="50%",t.style.left="50%",document.body.appendChild(t),t}()),function(e,t){var o,i,s=400,u=Date.now(),d=c("__activeStep"),p=c("__activeElement")||e,f=!p||p===e,m="gleap-tour-dummy-element"===e.id,v="gleap-tour-dummy-element"===p.id,y=n("animate"),b=t.onHighlightStarted||n("onHighlightStarted"),w=(null==t?void 0:t.onHighlighted)||n("onHighlighted"),x=(null==d?void 0:d.onDeselected)||n("onDeselected"),k=n(),S=c();!f&&x&&x(v?void 0:p,d,{config:k,state:S}),b&&b(m?void 0:e,t,{config:k,state:S});var T=!f&&y,L=!1;C(),l("previousStep",d),l("previousElement",p),l("activeStep",t),l("activeElement",e);var I=function o(){if(c("__transitionCallback")===o){var a=Date.now()-u,i=s-a<=200;t.popover&&i&&!L&&T&&(E(e,t),L=!0),n("animate")&&a0&&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\n \n
').concat(u("unmute"),"
\n ");else{var d="";e.sender&&e.sender.firstName&&(c=!0,d='
\n
\n
').concat(e.sender.firstName,"
\n
")),l="".concat(d,'
').concat(a.message,"
")}var p={disableActiveInteraction:!i&&!s,popover:Qr({description:l,popoverClass:"gleap-tour-popover-".concat(a.type," ").concat(!c&&"gleap-tour-popover-no-sender"," ").concat(e.allowClose&&"gleap-tour-popover-can-close")},i?{showButtons:[]}:{})};a.selector&&a.selector.length>0&&(p.element=a.selector),r.push(p)}var f=["next","close"];e.backButton&&f.push("previous");var h=Yr(to(to(to(to(to(to(to(to({showProgress:!0,steps:r},"showProgress",t.length>1),"allowClose",e.allowClose),"nextBtnText",e.nextText),"doneBtnText",e.doneText),"prevBtnText",e.prevText),"showButtons",f),"onDestroyStarted",(function(){h.hasNextStep()?h.destroy():(h.destroy(),n.onCompletion&&n.onCompletion({tourId:n.productTourId})),document.removeEventListener("click",m)})),"onPopoverRender",(function(e){if(e)for(var t=document.querySelectorAll(".gleap-tour-popover-description img, .gleap-tour-popover-description video"),r=function(){setTimeout((function(){h.refresh()}),500),setTimeout((function(){h.refresh()}),750)},o=0;o1&&void 0!==arguments[1]?arguments[1]:"INFO";zt.getInstance().addLog(e,t)}},{key:"initialize",value:function(t){var n=this.getInstance();if(n.initialized)console.warn("Gleap already initialized.");else{n.initialized=!0;var r=qe.getInstance();r.sdkKey=t,r.setOnSessionReady((function(){setTimeout((function(){Qe.getInstance().start().then((function(){Ve.getInstance().start(),T((function(){o.getInstance().injectFeedbackButton(),ur.getInstance().injectNotificationUI(),e.checkForUrlParams(),rn.notifyEvent("initialized")}))})).catch((function(e){console.warn("Failed to initialize Gleap.")}))}),0)})),r.startSession()}}},{key:"checkForUrlParams",value:function(){if("undefined"!=typeof window&&window.location.search)try{var t=new URLSearchParams(window.location.search),n=t.get("gleap_feedback");n&&n.length>0&&e.startFeedbackFlow(n);var r=t.get("gleap_survey"),o=t.get("gleap_survey_format");r&&r.length>0&&e.showSurvey(r,"survey_full"===o?"survey_full":"survey");var a=t.get("gleap_tour");if(a&&a.length>0){var i=parseInt(t.get("gleap_tour_delay"));isNaN(i)&&(i=4),setTimeout((function(){e.startProductTour(a)}),1e3*i)}}catch(s){}}},{key:"destroy",value:function(){An.getInstance().stop(),Ve.getInstance().stop(),It.getInstance().destroy(),o.getInstance().toggleFeedbackButton(!1),ur.getInstance().clearAllNotifications(!0),qe.getInstance().clearSession(0,!1),vr.getInstance().removeBannerUI()}},{key:"closeBanner",value:function(){vr.getInstance().removeBannerUI()}},{key:"setUseCookies",value:function(e){qe.getInstance().useCookies=e}},{key:"identify",value:function(e,t,n){return qe.getInstance().identifySession(e,x(t),n)}},{key:"updateContact",value:function(e){return qe.getInstance().updateSession(x(e))}},{key:"clearIdentity",value:function(){qe.getInstance().clearSession()}},{key:"getIdentity",value:function(){return qe.getInstance().getSession()}},{key:"isUserIdentified",value:function(){var e=qe.getInstance().session;return!!(e&&e.userId&&e.userId.length>0)}},{key:"isOpened",value:function(){return It.getInstance().isOpened()}},{key:"hide",value:function(){It.getInstance().hideWidget()}},{key:"setMaxNetworkRequests",value:function(e){y.getInstance().setMaxRequests(e)}},{key:"startNetworkLogger",value:function(){y.getInstance().start()}},{key:"setNetworkLogsBlacklist",value:function(e){y.getInstance().setBlacklist(e)}},{key:"setNetworkLogPropsToIgnore",value:function(e){y.getInstance().setFilters(e)}},{key:"setReplayOptions",value:function(e){An.getInstance().setOptions(e)}},{key:"close",value:function(){It.getInstance().hideWidget()}},{key:"open",value:function(){It.getInstance().setAppMode("widget"),It.getInstance().showWidget()}},{key:"trackEvent",value:function(e,t){Ve.getInstance().logEvent(e,t)}},{key:"logEvent",value:function(e,t){Ve.getInstance().logEvent(e,t)}},{key:"preFillForm",value:function(e){var t=x(e);ar.getInstance().formPreFill=t,It.getInstance().sendMessage({name:"prefill-form-data",data:t},!0)}},{key:"on",value:function(e,t){rn.on(e,t)}},{key:"enableShortcuts",value:function(e){e?er.getInstance().start():er.getInstance().stop()}},{key:"showFeedbackButton",value:function(e){o.getInstance().toggleFeedbackButton(e)}},{key:"setAppVersionCode",value:function(e){Mt.setAppVersionCode(e)}},{key:"setAppBuildNumber",value:function(e){Mt.setAppBuildNumber(e)}},{key:"setWSApiUrl",value:function(e){qe.getInstance().wsApiUrl=e}},{key:"setApiUrl",value:function(e){qe.getInstance().apiUrl=e}},{key:"setBannerUrl",value:function(e){vr.getInstance().setBannerUrl(e)}},{key:"setFrameUrl",value:function(e){It.getInstance().frameUrl=e}},{key:"setTicketAttribute",value:function(e,t){Jt.getInstance().setTicketAttribute(e,t)}},{key:"attachCustomData",value:function(e){Jt.getInstance().attachCustomData(e)}},{key:"setCustomData",value:function(e,t){Jt.getInstance().setCustomData(e,t)}},{key:"removeCustomData",value:function(e){Jt.getInstance().removeCustomData(e)}},{key:"clearCustomData",value:function(){Jt.getInstance().clearCustomData()}},{key:"playSound",value:function(e){kr.playSound(e)}},{key:"showTabNotificationBadge",value:function(e){var t=ur.getInstance();t.showNotificationBadge=e,t.updateTabBarNotificationCount()}},{key:"setLanguage",value:function(t){Zn.getInstance().setOverrideLanguage(t),e.getInstance().initialized&&setTimeout((function(){e.getInstance().softReInitialize(),e.updateContact({lang:t})}),1e3)}},{key:"registerCustomAction",value:function(e){cn.registerCustomAction(e)}},{key:"triggerCustomAction",value:function(e){cn.triggerCustomAction(e)}},{key:"setStyles",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#ffffff",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:20,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:20,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:20,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:o.FEEDBACK_BUTTON_BOTTOM_LEFT;T((function(){!function(e,t,n,r,a,i,s,u){var d=c(e),p=c(n),f=c(a),h=c(t),m="#ffffff"===f,g=l(t,"#ffffff"===h?-35:-15),v=l(a,m?100:-120),y=l(a,m?30:-12),b=l(a,m?80:-30),w=(r=parseInt(r,10),Math.round(1.05*r)),x=Math.round(.8*r),k=Math.round(.6*r),S=Math.round(.4*r),C=Math.round(.25*r),E=57+s;u===o.FEEDBACK_BUTTON_CLASSIC_BOTTOM?E=s+15:(u&&u.includes("CLASSIC")||u===o.FEEDBACK_BUTTON_NONE)&&(E=s);var T='\n .gleap-font, .gleap-font * {\n font-style: normal;\n font-variant-caps: normal;\n font-variant-ligatures: normal;\n font-variant-numeric: normal;\n font-variant-east-asian: normal;\n font-weight: normal;\n font-stretch: normal;\n font-size: 100%;\n line-height: 1;\n font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .gleap-frame-container {\n right: '.concat(i,"px;\n bottom: ").concat(61+s,"px;\n width: calc(100% - 40px);\n max-width: 400px;\n position: fixed;\n z-index: ").concat(2147483631,";\n visibility: visible;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.16);\n border-radius: ").concat(x,"px;\n overflow: hidden;\n animation-duration: .3s;\n animation-fill-mode: both;\n animation-name: gleapFadeInUp;\n user-select: none;\n pointer-events: none;\n transition: max-width 0.3s ease-out;\n }\n\n :root {\n --gleap-margin-top: 50px;\n }\n\n .gleap-tooltip-anchor {\n position: relative;\n display: inline-block;\n float: left;\n max-width: 0px;\n width: 17px;\n }\n\n .gleap-tooltip-hotspot {\n position: absolute;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n }\n\n @keyframes gleap-pulse {\n 0% {\n transform: scale(0);\n opacity: 0.25;\n }\n 45% {\n transform: scale(2.5);\n opacity: 0;\n }\n 100% {\n transform: scale(0);\n opacity: 0;\n }\n }\n\n .gleap-tooltip-hotspot-animation {\n position: absolute;\n border-radius: 17px;\n opacity: 0.25;\n display: block;\n width: 17px;\n height: 17px;\n cursor: pointer;\n top: 0px;\n left: 0px;\n animation: gleap-pulse 5s infinite;\n }\n\n .gleap-tooltip-hotspot svg {\n width: 17px;\n height: 17px;\n object-fit: contain;\n display: block;\n }\n\n .gleap-tooltip-inner {\n position: relative;\n overflow: visible;\n font-size: 14px;\n font-weight: normal;\n color: #000;\n line-height: 1.3;\n }\n\n .gleap-tooltip {\n position: absolute;\n background-color: #fff;\n color: #000;\n font-size: 15px;\n line-height: 18px;\n padding: 16px;\n padding-top: 8px;\n padding-bottom: 8px;\n border-radius: 4px;\n max-width: min(350px, 80vw);\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.2s, visibility 0.2s;\n z-index: ").concat(2147483700,";\n }\n\n .gleap-tooltip a {\n color: ").concat(e,";\n text-decoration: underline;\n display: inline !important;\n margin: 0px !important;\n padding: 0px !important;\n }\n\n .gleap-tooltip ul {\n padding-left: 16px;\n }\n\n .gleap-tooltip b {\n font-weight: 600;\n }\n\n .gleap-tooltip h2 {\n font-size: 18px;\n line-height: 20px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip h3 {\n font-size: 16px;\n line-height: 18px;\n font-weight: 600;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip p {\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n }\n\n .gleap-tooltip img {\n max-width: 100%;\n max-height: 300px;\n width: 100%;\n height: auto;\n object-fit: cover;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip iframe,\n .gleap-tooltip video {\n max-width: 100%;\n width: 100%;\n height: auto;\n min-height: 200px;\n display: block;\n border: none;\n outline: none;\n padding: 0px;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 4px;\n }\n\n .gleap-tooltip-arrow {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .gleap-tooltip-arrow svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n\n .gleap-b-frame {\n width: 100%;\n height: 100%;\n border: none;\n pointer-events: auto;\n padding: 0px;\n margin: 0px;\n }\n\n .gleap-b-shown {\n transition: margin 0.3s ease-out;\n margin-top: var(--gleap-margin-top);\n position: relative;\n z-index: 10000;\n }\n\n .gleap-b-f {\n margin-top: 0px;\n }\n\n .gleap-b {\n display: none;\n position: absolute;\n top: calc(-1 * var(--gleap-margin-top));\n left: 0px;\n width: 100vw;\n height: var(--gleap-margin-top);\n }\n\n @keyframes gleapSlideIn {\n from {\n top: calc(-1 * var(--gleap-margin-top));\n }\n to {\n top: 10px;\n }\n }\n\n .gleap-b-f .gleap-b {\n position: fixed;\n top: 10px;\n animation: gleapSlideIn .25s ease-out forwards;\n max-width: 800px;\n width: calc(100% - 20px);\n left: 50%;\n z-index: ").concat(2147483699,";\n transform: translateX(-50%);\n border-radius: ").concat(S,"px;\n overflow: hidden;\n box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.15), 0px 5px 5px rgba(0, 0, 0, 0.05);\n }\n\n .gleap-b-shown .gleap-b {\n display: block;\n }\n\n .gleap-image-view {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n z-index: ").concat(2147483699,";\n background-color: ").concat(f,"cc;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .gleap-image-view-image {\n width: 90%;\n height: auto;\n max-width: 90%;\n max-height: 90%;\n object-fit: contain;\n }\n\n .gleap-image-view-close {\n position: fixed;\n top: 20px;\n right: 20px;\n width: 32px;\n height: 32px;\n opacity: 0.8;\n z-index: ").concat(2147483740,";\n box-shadow: 0px 5px 18px rgba(0, 0, 0, 0.16);\n cursor: pointer;\n }\n\n .gleap-image-view-close:hover {\n opacity: 1;\n }\n\n .gleap-image-view-close svg path {\n fill: ").concat(a,";\n }\n\n [dir=rtl].gleap-frame-container {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+s,'px;\n }\n\n .gleap-frame-container--loading iframe {\n opacity: 0;\n }\n\n .gleap-frame-container--loading::before {\n content: " ";\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n height: 100%;\n max-height: 380px;\n background: linear-gradient(\n 130deg,\n ').concat(g," 0%,\n ").concat(t,' 100%\n );\n }\n \n .gleap-frame-container--loading::after {\n content: " ";\n position: fixed;\n top: 0px;\n left: 0px;\n right: 0px;\n height: 100%;\n height: 100%;\n max-height: 380px;\n background: linear-gradient(\n 180deg,\n transparent 60%,\n ').concat(a,"1A 70%,\n ").concat(a," 100%\n );\n }\n\n .gleap-frame-container--loading-nogradient::before {\n max-height: 340px;\n background: ").concat(t," !important;\n }\n\n .gleap-frame-container--loading-nofade::after {\n display: none !important;\n }\n\n .gleap-frame-container--survey {\n bottom: ").concat(s,"px !important;\n }\n\n .gleap-frame-container--extended {\n max-width: 690px !important;\n }\n\n .gleap-frame-container--survey-full {\n position: fixed;\n top: 0 !important;\n left: 0 !important;\n bottom: 0 !important;\n right: 0 !important;\n width: 100vw !important;\n max-width: 100vw !important;\n height: 100vh !important;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(6px);\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n max-height: 100vh !important;\n border-radius: 0 !important;\n animation-name: none !important;\n }\n\n .gleap-frame-container--survey-full .gleap-frame-container-inner {\n max-width: 640px !important;\n width: calc(100% - 24px);\n border-radius: ").concat(x,"px;\n overflow: hidden;\n }\n\n .gleap-frame-container--classic {\n right: ").concat(i,"px;\n bottom: ").concat(s,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(s,"px;\n }\n\n .gleap-frame-container--no-button {\n bottom: ").concat(s,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n bottom: ").concat(s,"px;\n }\n\n .gleap-frame-container--classic-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(s,"px;\n }\n\n [dir=rtl].gleap-frame-container--classic-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(s,"px;\n }\n\n .gleap-frame-container--modern-left {\n right: auto;\n left: ").concat(i,"px;\n bottom: ").concat(61+s,"px;\n }\n\n [dir=rtl].gleap-frame-container--modern-left {\n left: auto;\n right: ").concat(i,"px;\n bottom: ").concat(61+s,"px;\n }\n\n .gleap-frame-container--animate {\n pointer-events: auto !important;\n }\n\n @keyframes gleapFadeInUp {\n from {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n @keyframes gleapFadeInUpMobile {\n from {\n opacity: 0;\n transform: translate3d(0, 10%, 0);\n }\n to {\n opacity: 1;\n transform: translate3d(0, 0, 0);\n }\n }\n\n .gleap-notification-container {\n position: fixed;\n bottom: ").concat(E,"px;\n right: ").concat(i,"px;\n z-index: ").concat(2147483630,";\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n width: 100%;\n max-width: min(340px, 80vw);\n }\n\n .gleap-notification-container--left {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container {\n left: ").concat(4+i,"px;\n right: initial !important;\n }\n\n [dir=rtl].gleap-notification-container--left {\n left: initial !important;\n right: ").concat(i,"px !important;\n align-items: flex-start !important;\n }\n\n .gleap-notification-container--no-button {\n bottom: ").concat(s,"px;\n }\n\n .gleap-notification-item {\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n .gleap-notification-close {\n border-radius: 100%;\n width: 28px;\n height: 28px;\n background-color: ").concat(v,";\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 8px;\n cursor: pointer;\n visibility: hidden;\n pointer-events: none;\n }\n\n .gleap-notification-container:hover .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-notification-close {\n visibility: visible;\n pointer-events: auto;\n animation-duration: 0.7s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n }\n\n .gleap-notification-close svg {\n width: 45%;\n height: 45%;\n object-fit: contain;\n fill: ").concat(a,";\n }\n\n .gleap-notification-item-checklist-container {\n display: flex;\n animation: fadeIn;\n animation-duration: .45s;\n background-color: ").concat(a,";\n border-radius: ").concat(v,";\n box-sizing: border-box;\n cursor: pointer;\n flex-direction: column;\n overflow: hidden;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n border-radius: ").concat(k,"px;\n margin-bottom: 12px;\n }\n\n .gleap-notification-item-checklist-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n padding: 15px;\n width: 100%;\n width: min(310px, 70vw);\n max-width: min(310px, 70vw);\n }\n\n .gleap-notification-item-checklist-content-title {\n color: ").concat(f,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 10px;\n max-width: 100%;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-checklist-content-progress {\n width: 100%;\n height: 8px;\n border-radius: 8px;\n background-color: ").concat(y,";\n }\n\n .gleap-notification-item-checklist-content-progress-inner {\n height: 100%;\n border-radius: 8px;\n background-color: ").concat(e,";\n }\n\n .gleap-notification-item-checklist-content-next {\n color: ").concat(v,";\n font-size: 15px;\n font-weight: normal;\n line-height: 21px;\n margin-top: 10px;\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n }\n\n .gleap-notification-item-checklist-content-next svg {\n height: 18px;\n margin-right: 5px;\n width: auto;\n }\n\n .gleap-notification-item-checklist-content-next b {\n font-size: 15px;\n font-weight: normal;\n color: ").concat(f,";\n }\n\n .gleap-notification-item-news {\n width: 100%;\n cursor: pointer;\n }\n\n .gleap-notification-item-news-content {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n padding: 15px;\n }\n\n .gleap-notification-item-news-preview {\n color: ").concat(v,";\n font-size: 15px;\n line-height: 21px;\n font-weight: 400;\n overflow-wrap: break-word;\n word-break: break-word;\n display: block;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender {\n display: flex;\n align-items: center;\n color: ").concat(v,";\n font-size: 15px;\n line-height: 21px;\n font-weight: 400;\n }\n \n .gleap-notification-item-news-content-title {\n color: ").concat(f,";\n font-size: 15px;\n font-weight: 500;\n line-height: 21px;\n margin-bottom: 6px;\n max-width: 100%;\n -webkit-line-clamp: 3;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .gleap-notification-item-news-sender img {\n border-radius: 100%;\n height: 20px;\n margin-right: 8px;\n object-fit: cover;\n width: 20px;\n }\n\n [dir=rtl] .gleap-notification-item-news-sender img {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-news-container {\n display: flex;\n animation: fadeIn;\n animation-duration: .45s;\n background-color: ").concat(a,";\n border-radius: ").concat(v,";\n box-sizing: border-box;\n cursor: pointer;\n flex-direction: column;\n overflow: hidden;\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n border-radius: ").concat(k,"px;\n margin-bottom: 12px;\n }\n\n .gleap-notification-item-news-image {\n background-color: ").concat(v,";\n height: 170px;\n object-fit: cover;\n width: 100%;\n }\n\n .gleap-notification-item-news:hover .gleap-notification-item-news-content-title {\n color: ").concat(e,";\n }\n\n .gleap-notification-item {\n display: flex;\n align-items: flex-end;\n cursor: pointer;\n }\n\n .gleap-notification-item img {\n width: 32px;\n height: 32px;\n min-width: 32px;\n border-radius: 100%;\n object-fit: cover;\n margin-right: 8px;\n margin-bottom: 12px;\n cursor: pointer;\n }\n\n [dir=rtl] .gleap-notification-item img {\n margin-left: 8px;\n margin-right: 0px !important;\n }\n\n .gleap-notification-item-container {\n box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.2);\n border-radius: ").concat(k,"px;\n border-bottom-left-radius: 0px;\n padding: 20px;\n background-color: ").concat(a,";\n margin-bottom: 12px;\n cursor: pointer;\n font-size: 15px;\n line-height: 21px;\n color: ").concat(f,';\n position: relative;\n }\n\n .gleap-notification-item-container::after {\n content: " ";\n position: absolute;\n bottom: 0px;\n width: 0px;\n height: 0px;\n left: -6px;\n border-style: solid;\n border-width: 0px 0px 10px 6px;\n border-color: transparent transparent ').concat(a,";\n }\n\n .gleap-notification-item-sender {\n color: ").concat(v,";\n line-height: 20px;\n }\n\n .gleap-notification-item-content {\n line-height: 20px;\n color: ").concat(f,";\n margin-top: 4px;\n min-width: min(200px, 50vw);\n word-wrap: break-word;\n word-break: break-word;\n }\n\n .gleap-frame-container-inner {\n position: relative;\n width: 100%;\n height: calc(100vh - ").concat(130+s,"px);\n max-height: ").concat(700,'px;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: calc(100vh - 40px);\n }\n \n .gleap-frame-container-inner:before {\n content: " ";\n position: absolute;\n width: 100%;\n height: calc(100% - ').concat(x,"px);\n top: ").concat(x,"px;\n background-color: ").concat(a,";\n z-index: -1;\n }\n \n .gleap-frame-container iframe {\n height: 100% !important;\n width: 100% !important;\n max-width: 100% !important;\n display: block;\n pointer-events: auto;\n }\n \n .gleap-frame-container--hidden {\n display: none !important;\n pointer-events: none;\n animation: none !important;\n }\n \n .bb-feedback-button {\n margin: 0px;\n position: fixed;\n bottom: ").concat(s,"px;\n right: ").concat(i,"px;\n border-radius: 30px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: transparent;\n color: #000000;\n z-index: ").concat(2147483630,";\n box-sizing: border-box;\n display: flex;\n align-items: center;\n padding: 0px;\n }\n\n [dir=rtl].bb-feedback-button {\n bottom: ").concat(s,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n \n .bb-feedback-button--bottomleft {\n bottom: ").concat(s,"px;\n right: auto;\n left: ").concat(i,"px;\n }\n\n [dir=rtl].bb-feedback-button--bottomleft {\n bottom: ").concat(s,"px;\n right: ").concat(i,'px;\n left: auto;\n }\n \n .bb-feedback-button--disabled {\n display: none !important;\n }\n\n .bb-feedback-button--hidden {\n display: none !important;\n }\n \n .bb-feedback-button-text {\n padding: 8px 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n background-color: #fff;\n border-radius: 8px;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.15);\n position: relative;\n z-index: 99;\n }\n \n .bb-feedback-button-text:before {\n content: "";\n position: absolute;\n box-shadow: rgba(0, 0, 0, 0.04) 6px 6px 5px;\n transform: rotate(315deg);\n bottom: 16px;\n right: -4px;\n border-width: 10px;\n border-style: solid;\n border-color: transparent #fff #fff transparent;\n }\n \n .bb-feedback-button--bottomleft .bb-feedback-button-text:before {\n display: none;\n }\n \n .bb-feedback-button-text:after {\n content: "";\n position: absolute;\n bottom: 12px;\n right: 0px;\n background-color: #fff;\n width: 5px;\n height: 30px;\n }\n \n .bb-feedback-button-text-title {\n font-family: sans-serif;\n font-size: 14px;\n color: #666;\n line-height: 18px;\n max-width: 220px;\n }\n \n .bb-feedback-button-text-title b {\n color: #000000;\n font-weight: 600;\n }\n\n .bb-notification-bubble {\n position: absolute;\n top: -5px;\n right: -5px;\n min-width: 20px;\n padding: 0px 4px;\n height: 20px;\n border-radius: 20px;\n background-color: red;\n color: #fff;\n font-size: 11px;\n font-family: sans-serif;\n text-align: center;\n line-height: 20px;\n }\n\n .bb-notification-bubble--hidden {\n display: none;\n }\n \n .bb-feedback-button-icon {\n width: 48px;\n height: 48px;\n border-radius: 48px;\n background-color: #485bff;\n transition: box-shadow, transform 0.2s ease-in-out;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n position: relative;\n }\n \n .bb-feedback-button-classic {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n top: 50%;\n right: 0px;\n position: fixed;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n padding: 9px 20px;\n text-align: center;\n background-color: #485bff;\n border-top-left-radius: 8px;\n border-top-right-radius: 8px;\n font-family: sans-serif;\n font-size: 16px;\n color: #fff;\n box-shadow: 0px 0px 14px 0px rgba(0, 0, 0, 0.25);\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n \n .bb-feedback-button-classic--left {\n top: 50%;\n left: 0px;\n right: auto;\n transform: rotate(90deg) translate(-50%, -100%);\n transform-origin: 0% 0%;\n }\n\n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--left {\n top: 50%;\n right: 0px;\n left: auto;\n transform: rotate(-90deg) translate(50%, -50%);\n transform-origin: 100% 50%;\n }\n \n .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n right: ').concat(i,"px;\n left: auto;\n }\n \n [dir=rtl].bb-feedback-button .bb-feedback-button-classic--bottom {\n top: auto;\n bottom: 0px;\n transform: none;\n left: ").concat(i,"px;\n right: auto;\n }\n\n .bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeInOpacity;\n }\n \n .bb-feedback-button--open.bb-feedback-button--classic-button-style {\n animation-duration: 0.2s;\n animation-fill-mode: both;\n animation-name: bbFadeOutRight;\n }\n \n .bb-feedback-button .bb-logo-logo {\n position: absolute;\n width: 30px;\n height: 30px;\n top: 9px;\n left: 9px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n position: absolute;\n width: 14px;\n height: 14px;\n top: 17px;\n left: 17px;\n object-fit: contain;\n animation-duration: 0.3s;\n animation-fill-mode: both;\n }\n \n .bb-feedback-button .bb-logo-arrowdown {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button--open .bb-logo-arrowdown {\n animation-name: bbZoomIn;\n }\n \n .bb-feedback-button--open .bb-logo-logo {\n animation-name: bbZoomOut;\n }\n \n .bb-feedback-button-icon:hover {\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.25), 0px 0px 20px rgba(0, 0, 0, 0.2);\n transform: scale(1.1);\n }\n \n .bb-feedback-button--open .bb-feedback-button-text {\n animation-name: bbFadeOutDown;\n }\n \n .bb-feedback-button--open .bb-feedback-button-icon {\n display: flex;\n }\n \n .bb-capture-svg {\n position: fixed;\n z-index: ").concat(2147483614,";\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n padding: 0px;\n margin: 0px;\n cursor: crosshair;\n }\n\n .bb-capture-svg--preview {\n cursor: auto !important;\n }\n \n .bb-rec-on-circle {\n animation-name: bbRecIconFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-rec-on-cont {\n animation-name: bbRecIconContFade;\n animation-duration: 2s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n }\n \n .bb-capture-editor-drag-info {\n position: fixed;\n top: -200px;\n left: 0px;\n z-index: ").concat(2147483616,";\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-editor-drag-info svg {\n width: 24px;\n height: 24px;\n }\n \n .bb-capture-editor-borderlayer {\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n border: 4px solid ").concat(e,";\n cursor: crosshair;\n z-index: ").concat(2147483610,";\n box-sizing: border-box;\n pointer-events: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-borderlayer {\n background-color: rgba(0, 0, 0, 0.8);\n }\n\n .bb-capture-editor-recording .bb-capture-editor-borderlayer {\n border: 4px solid #eb144c !important;\n }\n \n .bb-capture-editor-recording .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-editor-item-inactive {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-toolbar-drawingitem {\n opacity: 0.3;\n cursor: not-allowed !important;\n }\n \n .bb-capture-editor-notrecording .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-notrecording .bb-capture-svg {\n pointer-events: none !important;\n }\n \n .bb-capture-toolbar {\n position: fixed;\n top: 20px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,";\n background-color: #fff;\n padding: 5px;\n display: flex;\n align-items: center;\n border-radius: 8px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n transition: opacity 0.3s ease-in-out;\n }\n \n .bb-capture-dismiss {\n position: fixed;\n top: 0px;\n right: 0px;\n z-index: ").concat(2147483618,";\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n width: 36px;\n height: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: ").concat(e,";\n border-bottom-left-radius: ").concat(C,"px;\n }\n\n [dir=rtl] .bb-capture-dismiss {\n top: 0px;\n left: 0px;\n right: auto;\n border-bottom-left-radius: 0px !important;\n border-bottom-right-radius: ").concat(C,"px;\n }\n \n .bb-capture-dismiss svg path {\n fill: ").concat(d,';\n }\n \n .bb-capture-dismiss svg {\n width: 20px;\n height: 20px;\n object-fit: contain;\n }\n \n .bb-capture-button-next {\n font-family: sans-serif;\n box-sizing: border-box;\n font-weight: 600;\n text-align: center;\n width: auto;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n margin: 0px;\n line-height: 36px;\n padding: 0px 12px;\n font-size: 15px;\n margin-left: 12px;\n }\n\n [dir=rtl].bb-capture-editor .bb-capture-button-next {\n margin-left: auto;\n margin-right: 12px;\n }\n \n .bb-capture-toolbar-item-spacer {\n width: 1px;\n height: 38px;\n min-width: 1px;\n margin: 0px 5px;\n }\n \n .bb-capture-toolbar-item {\n width: 42px;\n height: 38px;\n min-width: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n position: relative;\n margin-right: 5px;\n }\n \n .bb-capture-toolbar-item svg {\n width: 23px;\n height: 23px;\n object-fit: contain;\n }\n \n .bb-capture-toolbar-item-selectedcolor {\n border-radius: 100%;\n width: 20px;\n height: 20px;\n background-color: #db4035;\n }\n \n .bb-capture-toolbar-item[data-type="undo"] svg {\n width: 18px;\n height: 18px;\n }\n \n .bb-capture-toolbar-item[data-active="true"] {\n position: relative;\n }\n \n .bb-capture-preview {\n display: none;\n background-color: rgba(0, 0, 0, 0.6);\n position: fixed;\n top: 0px;\n left: 0px;\n width: 100vw;\n height: 100vh;\n justify-content: center;\n align-items: center;\n z-index: ').concat(2147483620,";\n }\n \n .bb-capture-preview-inner {\n background-color: #fff;\n padding: 0px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n flex-direction: column;\n max-width: 640px;\n width: 100%;\n margin: 20px;\n }\n \n .bb-capture-preview-inner video {\n border-radius: 8px 8px 0px 0px;\n display: block;\n border: 0px;\n outline: none;\n width: 100%;\n max-height: 60vh;\n }\n \n .bb-capture-preview-buttons {\n display: flex;\n justify-content: space-between;\n padding: 14px;\n }\n \n .bb-capture-preview-retrybutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-sendbutton {\n font-family: sans-serif;\n border-radius: 21px;\n box-sizing: border-box;\n padding: 12px 26px;\n font-size: 16px;\n line-height: 19px;\n font-weight: 600;\n text-align: center;\n margin-top: 0px;\n margin-bottom: 0px;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-preview-retrybutton:hover,\n .bb-capture-preview-sendbutton:hover {\n opacity: 0.9;\n }\n \n .bb-capture-toolbar-item-recording {\n margin-right: 0px;\n }\n \n .bb-capture-toolbar-item-recording svg {\n width: 33px;\n height: 33px;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n position: fixed;\n top: 70px;\n left: 50%;\n transform: translateX(-50%);\n z-index: ").concat(2147483618,';\n background-color: #fff;\n display: none;\n padding: 10px;\n box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.15), 0px 0px 20px rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n }\n \n .bb-capture-toolbar-item-color {\n width: 20px;\n height: 20px;\n border-radius: 100%;\n margin-right: 12px;\n box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n \n .bb-capture-toolbar-item-color:hover {\n box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.25);\n }\n \n .bb-capture-toolbar-item-color:last-of-type {\n margin-right: 0px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color {\n margin-right: auto;\n margin-left: 12px;\n }\n \n [dir=rtl].bb-capture-editor .bb-capture-toolbar-item-color:last-of-type {\n margin-right: auto;\n margin-left: 0px;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:first-of-type {\n display: none;\n }\n \n .bb-capture-toolbar-item-recording[data-active="true"] svg:nth-of-type(2) {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:first-of-type {\n display: block;\n }\n \n .bb-capture-toolbar-item-recording[data-active="false"] svg:nth-of-type(2) {\n display: none;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #eee;\n }\n \n .bb-capture-toolbar-item:hover svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--active {\n background-color: #f8f8f8;\n }\n \n .bb-capture-toolbar-item--active svg {\n opacity: 1;\n }\n \n .bb-capture-toolbar-item--inactivecross::before {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 3px;\n width: 26px;\n margin: auto;\n border-radius: 4px;\n background-color: #e80000;\n transform: rotate(45deg);\n }\n \n .bb-capture-toolbar-item--inactivecross svg {\n fill: #eee;\n }\n \n .bb-capture-toolbar-item-timer {\n text-align: left;\n line-height: 32px;\n font-size: 14px;\n font-family: sans-serif;\n margin: 5px;\n min-width: 40px;\n display: none;\n }\n \n .bb-capture-toolbar-item .bb-tooltip {\n background-color: #555;\n color: #fff;\n visibility: hidden;\n font-size: 14px;\n font-family: sans-serif;\n text-align: center;\n padding: 5px 10px;\n position: absolute;\n z-index: 1;\n top: 45px;\n left: 0px;\n transform: translateX(calc(-50% + 21px));\n opacity: 0;\n transition: opacity 0.3s;\n white-space: nowrap;\n }\n \n .bb-capture-toolbar-item .bb-tooltip::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n transform: rotate(180deg);\n border-color: #555 transparent transparent transparent;\n }\n \n .bb-capture-toolbar-item:hover .bb-tooltip {\n visibility: visible;\n opacity: 1;\n }\n \n .bb-capture-options {\n display: none;\n }\n \n .bb-capture-options--active {\n display: flex;\n }\n\n @keyframes bbFadeOutRight {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbFadeOutDown {\n from {\n opacity: 1;\n }\n \n to {\n opacity: 0;\n transform: translate3d(0, 100%, 0);\n }\n }\n \n @keyframes bbFadeInOpacity {\n from {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n @keyframes bbZoomOut {\n from {\n opacity: 1;\n }\n \n 50% {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n to {\n opacity: 0;\n }\n }\n \n @keyframes bbZoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n \n 50% {\n opacity: 1;\n }\n }\n \n @keyframes bbRecIconContFade {\n 0% {\n fill: #b10802;\n }\n 50% {\n fill: #ff0000;\n }\n 100% {\n fill: #b10802;\n }\n } \n .bb-capture-preview-retrybutton {\n color: ').concat(f,";\n border-radius: ").concat(w,"px;\n background-color: ").concat(y,";\n }\n .bb-capture-preview-retrybutton:hover {\n background-color: ").concat(b,";\n }\n @keyframes bb-suc-fill {\n 100% {\n box-shadow: inset 0px 0px 0px 30px ").concat(e,";\n }\n }\n .bb-capture-toolbar-item-spacer {\n background-color: ").concat(y,";\n }\n .bb-tooltip {\n border-radius: ").concat(S,"px;\n }\n @keyframes bbRecIconFade {\n 0% {\n fill: transparent;\n }\n 50% {\n fill: ").concat(b,";\n }\n 100% {\n fill: transparent;\n }\n }\n .bb-capture-preview-sendbutton {\n color: ").concat(d,";\n background-color: ").concat(e,";\n border-radius: ").concat(w,"px;\n }\n .bb-capture-button-next {\n color: ").concat(d,";\n background-color: ").concat(e,";\n border-radius: ").concat(C,"px;\n }\n .bb-capture-preview-inner {\n background-color: ").concat(a,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-timer {\n color: ").concat(v,";\n }\n .bb-svg-path {\n fill: ").concat(f,";\n }\n .bb-capture-toolbar-item {\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar {\n background-color: ").concat(a,";\n border-radius: ").concat(S,"px;\n }\n .bb-capture-toolbar-item-colorpicker {\n background-color: ").concat(a,";\n }\n .bb-capture-toolbar-item--active {\n background-color: ").concat(y,";\n }\n .bb-feedback-button-classic {\n border-top-left-radius: ").concat(S,"px;\n border-top-right-radius: ").concat(S,"px;\n }\n .bb-logo-logo--default path {\n fill: ").concat(p,";\n }\n .bb-logo-arrowdown {\n fill: ").concat(p,";\n }\n .bb-feedback-button-icon {\n background-color: ").concat(n,";\n }\n .bb-feedback-button-classic {\n background-color: ").concat(n,";\n color: ").concat(p,";\n }\n\n @media only screen and (max-width: 450px) {\n [dir=rtl].gleap-frame-container,\n .gleap-frame-container {\n left: 0px;\n right: 0px;\n width: 100vw;\n max-width: 100vw;\n min-height: 100vh;\n min-height: -webkit-fill-available;\n max-height: -webkit-fill-available;\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n animation-name: gleapFadeInUpMobile;\n }\n\n .gleap-frame-container-inner {\n width: 100vw;\n height: 100%;\n }\n\n .gleap-frame-container:not(.gleap-frame-container--survey):not(.gleap-frame-container--survey-full) .gleap-frame-container-inner {\n max-height: calc(var(--glvh, 1vh) * 100) !important;\n }\n\n .gleap-frame-container--survey {\n height: auto !important;\n top: initial !important;\n bottom: 0px !important;\n min-height: initial !important;\n }\n\n .gleap-frame-container--survey .gleap-frame-container-inner {\n height: 100vh !important;\n }\n\n .bb-tooltip {\n display: none !important;\n }\n \n .bb-capture-toolbar-item-colorpicker {\n top: 75px;\n }\n \n .bb-capture-button-next {\n margin-left: auto;\n }\n \n .bb-capture-dismiss {\n display: none;\n }\n \n .bb-capture-toolbar {\n top: 15px;\n right: 15px;\n left: 15px;\n width: auto;\n transform: none;\n }\n\n .bb-capture-editor-drag-info {\n display: none;\n }\n \n .bb-capture-editor-borderlayer {\n border-width: 4px;\n }\n }\n \n @media print {\n .bb-feedback-button {\n display: none !important;\n }\n \n .gleap-frame-container {\n display: none !important;\n }\n }\n\n .gleap-tour-sender {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-bottom: 20px;\n }\n\n .gleap-tour-sender-image {\n width: 32px;\n height: 32px;\n border-radius: 32px;\n margin-right: 10px;\n background-size: cover;\n background-repeat: no-repeat;\n }\n\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: 550px;\n max-width: 550px;\n }\n\n @media only screen and (max-width: 450px) {\n .gleap-tour-popover.gleap-tour-popover-post {\n min-width: calc(100vw - 40px);\n max-width: calc(100vw - 40px);\n }\n }\n\n .gleap-tour-message,\n .gleap-tour-message p,\n .gleap-tour-message ul {\n color: ").concat(f,";\n }\n\n .gleap-tour-message p {\n line-height: 1.3;\n }\n\n .gleap-tour-message ul {\n line-height: 1.3;\n padding-left: 20px;\n margin-top: 10px;\n margin-bottom: 10px;\n }\n\n .gleap-tour-message {\n max-height: calc(80vh - 100px) !important;\n overflow-y: auto;\n min-width: 270px;\n }\n\n .gleap-tour-message iframe {\n width: 100%;\n height: 300px;\n margin-top: 10px;\n margin-bottom: 10px;\n border: none;\n outline: none;\n display: block;\n }\n\n .gleap-tour-sender-name {\n font-size: 15px;\n }\n\n .gleap-tour-video {\n width: 100%;\n max-width: 100%;\n }\n\n .gleap-tour-video--playing .gleap-tour-video-playpause {\n opacity: 0;\n }\n \n .gleap-tour-video--playing:hover .gleap-tour-video-playpause {\n opacity: 1;\n }\n\n .gleap-tour-popover-video-pointer {\n padding: 0px !important;\n border-radius: 8px;\n position: relative;\n background-color: transparent !important;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer {\n position: absolute;\n top: 0px;\n left: 20px;\n right: 20px;\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-footer button {\n padding: 5px 12px;\n }\n\n .gleap-tour-popover-video-pointer.gleap-tour-popover-can-close .gleap-tour-popover-footer {\n right: 40px !important;\n }\n\n .gleap-tour-popover-video-pointer:hover .gleap-tour-popover-footer {\n opacity: 1;\n }\n\n .gleap-tour-popover-pointer.gleap-tour-popover-no-sender .gleap-tour-message {\n padding-right: 20px;\n }\n\n .gleap-tour-video video {\n width: 100%;\n max-width: 100%;\n height: auto;\n border: none;\n outline: none;\n display: block;\n border-radius: 8px;\n }\n\n .gleap-admin-collapse-ui {\n z-index: ").concat(2147483635,";\n cursor: pointer;\n position: fixed;\n bottom: 75px;\n right: 20px;\n width: 32px;\n height: 32px;\n border-radius: 100%;\n background-color: #fff;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;\n }\n\n .gleap-admin-collapse-ui svg {\n width: 20px;\n height: 14px;\n margin-top: 6px;\n fill: #000 !important;\n }\n\n .gleap-admin-collapse-ui-active {\n bottom: 20px !important;\n }\n\n .gleap-admin-collapse-ui-active svg {\n transform: rotate(180deg);\n }\n\n .gleap-admin-frame-container-active {\n display: none !important;\n }\n\n .gleap-admin-frame-container {\n position: fixed;\n bottom: 0px;\n left: 0px;\n right: 0px;\n width: 100vw;\n z-index: ").concat(2147483640,";\n }\n\n .gleap-admin-frame {\n width: 100%;\n height: 100%;\n border: none;\n outline: none;\n display: block;\n }\n \n .gleap-tour-message .linktype-link {\n display: inline-block !important;\n background-color: transparent !important;\n color: ").concat(n," !important;\n }\n\n .gleap-tooltip .linktype-button,\n .gleap-tour-message .linktype-button {\n display: inline-block !important;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 10px 20px !important;\n text-decoration: none !important;\n background-color: ").concat(n," !important;\n color: ").concat(p," !important;\n }\n\n .gleap-tour-message img {\n width: 100%;\n max-width: 100%;\n min-height: 260px;\n height: auto;\n margin-top: 10px;\n margin-bottom: 10px;\n object-fit: cover;\n }\n\n .gleap-tour-active .gleap-tour-overlay {\n pointer-events: none;\n }\n \n .gleap-tour-active * {\n pointer-events: none;\n }\n \n .gleap-tour-active .gleap-tour-active-element,\n .gleap-tour-active .gleap-tour-active-element *,\n .gleap-tour-popover,\n .gleap-tour-popover * {\n pointer-events: auto;\n }\n \n @keyframes animate-fade-in {\n 0% {\n opacity: 0;\n }\n \n to {\n opacity: 1;\n }\n }\n \n .gleap-tour-fade .gleap-tour-overlay {\n animation: animate-fade-in 200ms ease-in-out;\n }\n \n .gleap-tour-fade .gleap-tour-popover {\n animation: animate-fade-in 200ms;\n }\n\n .gleap-tour-video-playpause {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n width: 100%;\n height: 100%;\n background-color: rgba(0,0,0,0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 8px;\n transition: opacity 200ms ease-in-out;\n }\n\n .gleap-tour-popover-video-pointer .gleap-tour-popover-arrow {\n display: none !important;\n }\n\n .gleap-tour-video-playpause svg {\n width: 34px;\n height: auto;\n fill: #fff;\n }\n \n /* Popover styles */\n .gleap-tour-popover {\n all: unset;\n box-sizing: border-box;\n color: #2d2d2d;\n margin: 0;\n padding: 15px;\n border-radius: ").concat(S,'px;\n min-width: 250px;\n max-width: 300px;\n box-shadow: 0 1px 10px #0006;\n z-index: 1000000000;\n position: fixed;\n top: 0;\n right: 0;\n background-color: #fff;\n }\n \n .gleap-tour-popover * {\n font-family: "Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif;\n }\n \n .gleap-tour-popover-title {\n font: 19px / normal sans-serif;\n font-weight: 700;\n display: block;\n position: relative;\n line-height: 1.5;\n zoom: 1;\n margin: 0;\n }\n \n .gleap-tour-popover-close-btn {\n all: unset;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 32px;\n height: 32px;\n cursor: pointer;\n font-size: 30px;\n font-weight: 500;\n line-height: 32px;\n color: #d2d2d2;\n z-index: 1;\n text-align: center;\n transition: color;\n transition-duration: 200ms;\n }\n \n .gleap-tour-popover-close-btn:hover,\n .gleap-tour-popover-close-btn:focus {\n color: #2d2d2d;\n }\n \n .gleap-tour-popover-title[style*="block"] + .gleap-tour-popover-description {\n margin-top: 5px;\n }\n \n .gleap-tour-popover-description {\n margin-bottom: 0;\n font: 15px / normal sans-serif;\n line-height: 1.5;\n font-weight: 400;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer {\n margin-top: 15px;\n text-align: right;\n zoom: 1;\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n \n .gleap-tour-popover-progress-text {\n font-size: 13px;\n font-weight: 400;\n color: #727272;\n zoom: 1;\n }\n \n .gleap-tour-popover-footer button {\n background-color: ').concat(e,";\n color: ").concat(d,";\n border-radius: ").concat(C,"px;\n box-sizing: border-box;\n padding: 10px 20px;\n font-size: 14px;\n font-weight: bold;\n line-height: 21px;\n border: none;\n text-align: center;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n display: flex;\n justify-content: center;\n align-items: center;\n box-shadow: none !important;\n outline: none !important;\n }\n\n .gleap-tour-popover-prev-btn {\n color: ").concat(f," !important;\n background-color: ").concat(y," !important;\n margin-right: 3px;\n }\n\n .gleap-tour-popover-prev-btn:hover {\n background-color: ").concat(e,"22 !important;\n color: ").concat(e,' !important;\n }\n \n .gleap-tour-popover-footer .gleap-tour-popover-btn-disabled {\n opacity: 0.5;\n pointer-events: none;\n }\n \n /* Disable the scrolling of parent element if it has an active element*/\n :not(body):has(> .gleap-tour-active-element) {\n overflow: hidden !important;\n }\n \n .gleap-tour-no-interaction, .gleap-tour-no-interaction * {\n pointer-events: none !important;\n }\n \n .gleap-tour-popover-navigation-btns {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n }\n \n .gleap-tour-popover-navigation-btns button + button {\n margin-left: 4px;\n }\n \n .gleap-tour-popover-arrow {\n content: "";\n position: absolute;\n border: 5px solid #fff;\n }\n \n .gleap-tour-popover-arrow-side-over {\n display: none;\n }\n \n /** Popover Arrow Sides **/\n .gleap-tour-popover-arrow-side-left {\n left: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-right {\n right: 100%;\n border-left-color: transparent;\n border-bottom-color: transparent;\n border-top-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-top {\n top: 100%;\n border-right-color: transparent;\n border-bottom-color: transparent;\n border-left-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-bottom {\n bottom: 100%;\n border-left-color: transparent;\n border-top-color: transparent;\n border-right-color: transparent;\n }\n \n .gleap-tour-popover-arrow-side-center {\n display: none;\n }\n \n /* Left/Start + Right/Start */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-start {\n top: 15px;\n }\n \n /* Top/Start + Bottom/Start */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-start,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-start {\n left: 15px;\n }\n \n /* End/Left + End/Right */\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-left,\n .gleap-tour-popover-arrow-align-end.gleap-tour-popover-arrow-side-right {\n bottom: 15px;\n }\n \n /* Top/End + Bottom/End */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-end,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-end {\n right: 15px;\n }\n \n /* Left/Center + Right/Center */\n .gleap-tour-popover-arrow-side-left.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-right.gleap-tour-popover-arrow-align-center {\n top: 50%;\n margin-top: -5px;\n }\n \n /* Top/Center + Bottom/Center */\n .gleap-tour-popover-arrow-side-top.gleap-tour-popover-arrow-align-center,\n .gleap-tour-popover-arrow-side-bottom.gleap-tour-popover-arrow-align-center {\n left: 50%;\n margin-left: -5px;\n }\n \n /* No arrow */\n .gleap-tour-popover-arrow-none {\n display: none;\n } \n '),L=document.querySelector(".gleap-styles");L&&L.remove();var I=document.createElement("style");I.innerHTML=T,I.className="gleap-styles",document.body.appendChild(I)}(e,t,n,a,r,i,s,u)}))}},{key:"sendSilentCrashReport",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};return e.sendSilentCrashReportWithFormData({description:t},n,r)}},{key:"sendSilentCrashReportWithFormData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MEDIUM",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{screenshot:!0,replays:!0,attachments:!0};if(!this.silentCrashReportSent){this.silentCrashReportSent=!0,setTimeout((function(){t.silentCrashReportSent=!1}),1e4);var o=r?x(r):{},a=qe.getInstance();if(a.ready){var i=e||{};a.session.email&&(i.reportedBy=a.session.email),new kt("CRASH",n,i,!0,o).sendFeedback().then((function(){})).catch((function(e){}))}}}},{key:"showSurvey",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"survey";e.startFeedbackFlowWithOptions(t,{hideBackButton:!0,format:n},!0)}},{key:"startClassicForm",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlow",value:function(t,n){e.startFeedbackFlowWithOptions(t,{hideBackButton:!n})}},{key:"startFeedbackFlowWithOptions",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=n.autostartDrawing,a=n.hideBackButton,i=n.format;if(qe.getInstance().ready){e.getInstance().setGlobalDataItem("snapshotPosition",{x:window.scrollX,y:window.scrollY});var s="start-feedbackflow";r&&(s="start-survey"),It.getInstance().setAppMode(r?i:"widget"),It.getInstance().sendMessage({name:s,data:{flow:t,hideBackButton:a,format:i}},!0),o?It.getInstance().showDrawingScreen("screenshot"):It.getInstance().showWidget()}}},{key:"openConversations",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-conversations",data:{hideBackButton:!e}},!0),It.getInstance().showWidget()}},{key:"openConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-conversation",data:{shareToken:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"startConversation",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.startBot("",t)}},{key:"startBot",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"start-bot",data:{botId:e||"",hideBackButton:!t}},!0),It.getInstance().showWidget()}},{key:"openHelpCenterCollection",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-help-collection",data:{collectionId:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"openHelpCenterArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-help-article",data:{articleId:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"openHelpCenter",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-helpcenter",data:{hideBackButton:!e}},!0),It.getInstance().showWidget()}},{key:"searchHelpCenter",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-helpcenter-search",data:{term:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"openNewsArticle",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-news-article",data:{id:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"openChecklists",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-checklists",data:{hideBackButton:!e}},!0),It.getInstance().showWidget()}},{key:"startChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"start-checklist",data:{outboundId:e,hideBackButton:!t}},!0),It.getInstance().showWidget(),!0)}},{key:"openChecklist",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-checklist",data:{id:e,hideBackButton:!t}},!0),It.getInstance().showWidget())}},{key:"openNews",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-news",data:{hideBackButton:!e}},!0),It.getInstance().showWidget()}},{key:"openFeatureRequests",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];It.getInstance().setAppMode("widget"),It.getInstance().sendMessage({name:"open-feature-requests",data:{hideBackButton:!e}},!0),It.getInstance().showWidget()}},{key:"startProductTour",value:function(e){var t=this;qe.getInstance().startProductTourConfig(e).then((function(n){t.startProductTourWithConfig(e,n)})).catch((function(e){}))}},{key:"startProductTourWithConfig",value:function(t,n){ro.getInstance().startWithConfig(t,n,(function(t){var n={tourId:t.tourId};rn.notifyEvent("productTourCompleted",n),e.trackEvent("tour-".concat(t.tourId,"-completed"),n)}))}},{key:"showBanner",value:function(e){try{vr.getInstance().showBanner(e)}catch(t){}}},{key:"showNotification",value:function(e){ur.getInstance().showNotification(e)}}],n&&ao(t.prototype,n),r&&ao(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(lo(uo,"invoked",!0),lo(uo,"silentCrashReportSent",!1),lo(uo,"instance",void 0),"undefined"!=typeof window){var po=window.GleapActions;if(po&&po.length>0)for(var fo=0;fo{y.initialize("dyWs3yourDQZkNztYzV7yZgcyMcWGpaF")}),[]),(0,b.jsx)(b.Fragment,{children:t})}var x=n(74650),k=n(30340),S=n(94887),C=n(13929),E=n(64204),T=n(98878),L=n(4715),I=n(70622),A=n(78946),O=n(43926);function _(){const{i18n:{currentLocale:e,defaultLocale:t,localeConfigs:n}}=(0,k.A)(),r=(0,T.o)(),o=n[e].htmlLang,a=e=>e.replace("-","_");return(0,b.jsxs)(x.A,{children:[Object.entries(n).map((e=>{let[t,{htmlLang:n}]=e;return(0,b.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:n},t)})),(0,b.jsx)("link",{rel:"alternate",href:r.createUrl({locale:t,fullyQualified:!0}),hrefLang:"x-default"}),(0,b.jsx)("meta",{property:"og:locale",content:a(o)}),Object.values(n).filter((e=>o!==e.htmlLang)).map((e=>(0,b.jsx)("meta",{property:"og:locale:alternate",content:a(e.htmlLang)},`meta-og-${e.htmlLang}`)))]})}function P(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,k.A)(),r=function(){const{siteConfig:{url:e,baseUrl:t,trailingSlash:n}}=(0,k.A)(),{pathname:r}=(0,p.zy)();return e+(0,A.applyTrailingSlash)((0,S.Ay)(r),{trailingSlash:n,baseUrl:t})}(),o=t?`${n}${t}`:r;return(0,b.jsxs)(x.A,{children:[(0,b.jsx)("meta",{property:"og:url",content:o}),(0,b.jsx)("link",{rel:"canonical",href:o})]})}function M(){const{i18n:{currentLocale:e}}=(0,k.A)(),{metadata:t,image:n}=(0,C.p)();return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(x.A,{children:[(0,b.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,b.jsx)("body",{className:L.w})]}),n&&(0,b.jsx)(E.be,{image:n}),(0,b.jsx)(P,{}),(0,b.jsx)(_,{}),(0,b.jsx)(O.A,{tag:I.Cy,locale:e}),(0,b.jsx)(x.A,{children:t.map(((e,t)=>(0,b.jsx)("meta",{...e},t)))})]})}const R=new Map;var N=n(95143),j=n(5775),D=n(89871);function F(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>o.forEach((e=>e?.()))}const B=function(e){let{children:t,location:n,previousLocation:r}=e;return(0,D.A)((()=>{r!==n&&(!function(e){let{location:t,previousLocation:n}=e;if(!n)return;const r=t.pathname===n.pathname,o=t.hash===n.hash,a=t.search===n.search;if(r&&o&&!a)return;const{hash:i}=t;if(i){const e=decodeURIComponent(i.substring(1)),t=document.getElementById(e);t?.scrollIntoView()}else window.scrollTo(0,0)}({location:n,previousLocation:r}),F("onRouteDidUpdate",{previousLocation:r,location:n}))}),[r,n]),t};function z(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,f.u)(d.A,e))).flat();return Promise.all(t.map((e=>e.route.component.preload?.())))}class U extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=c.A.canUseDOM?F("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=F("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),z(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return(0,b.jsx)(B,{previousLocation:this.previousLocation,location:t,children:(0,b.jsx)(p.qh,{location:t,render:()=>e})})}}const q=U,H="__docusaurus-base-url-issue-banner-container",W="__docusaurus-base-url-issue-banner",$="__docusaurus-base-url-issue-banner-suggestion-container";function G(e){return`\ndocument.addEventListener('DOMContentLoaded', function maybeInsertBanner() {\n var shouldInsert = typeof window['docusaurus'] === 'undefined';\n shouldInsert && insertBanner();\n});\n\nfunction insertBanner() {\n var bannerContainer = document.createElement('div');\n bannerContainer.id = '${H}';\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{let{route:t}=e;return!0===t.exact})))return R.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return R.set(e.pathname,t),{...e,pathname:t}}((0,p.zy)());return(0,b.jsx)(q,{location:e,children:Q})}function te(){return(0,b.jsx)(Y.A,{children:(0,b.jsx)(j.l,{children:(0,b.jsxs)(N.x,{children:[(0,b.jsxs)(w,{children:[(0,b.jsx)(Z,{}),(0,b.jsx)(M,{}),(0,b.jsx)(K,{}),(0,b.jsx)(ee,{})]}),(0,b.jsx)(J,{})]})})})}var ne=n(84054);const re=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;o?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var oe=n(7771);const ae=new Set,ie=new Set,se=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,le={prefetch:e=>{if(!(e=>!se()&&!ie.has(e)&&!ae.has(e))(e))return!1;ae.add(e);const t=(0,f.u)(d.A,e).flatMap((e=>{return t=e.route.path,Object.entries(ne).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,oe.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?re(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!se()&&!ie.has(e))(e)&&(ie.add(e),z(e))},ce=Object.freeze(le);function ue(e){let{children:t}=e;return"hash"===l.default.future.experimental_router?(0,b.jsx)(i.I9,{children:t}):(0,b.jsx)(i.Kd,{children:t})}const de=Boolean(!0);if(c.A.canUseDOM){window.docusaurus=ce;const e=document.getElementById("__docusaurus"),t=(0,b.jsx)(a.vd,{children:(0,b.jsx)(ue,{children:(0,b.jsx)(te,{})})}),n=(e,t)=>{console.error("Docusaurus React Root onRecoverableError:",e,t)},i=()=>{if(window.docusaurusRoot)window.docusaurusRoot.render(t);else if(de)window.docusaurusRoot=o.hydrateRoot(e,t,{onRecoverableError:n});else{const r=o.createRoot(e,{onRecoverableError:n});r.render(t),window.docusaurusRoot=r}};z(window.location.pathname).then((()=>{(0,r.startTransition)(i)}))}},5775:(e,t,n)=>{"use strict";n.d(t,{o:()=>d,l:()=>p});var r=n(30758),o=n(4784);const a=JSON.parse('{"docusaurus-plugin-content-docs":{"docs":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"index","docs":[{"id":"concepts/architecture/index","path":"/docs/concepts/architecture/","sidebar":"docs"},{"id":"concepts/comparisons/index","path":"/docs/concepts/comparisons/","sidebar":"docs"},{"id":"concepts/features-overview/index","path":"/docs/concepts/features-overview/","sidebar":"docs"},{"id":"concepts/mental-model/index","path":"/docs/concepts/mental-model/","sidebar":"docs"},{"id":"concepts/RFCs/index","path":"/docs/concepts/RFCs/","sidebar":"docs"},{"id":"concepts/RFCs/M0-template","path":"/docs/concepts/RFCs/M0-template","sidebar":"docs"},{"id":"guides/contributing","path":"/docs/guides/contributing","sidebar":"docs"},{"id":"guides/external-functions/index","path":"/docs/guides/external-functions/","sidebar":"docs"},{"id":"guides/files-upload/index","path":"/docs/guides/files-upload/","sidebar":"docs"},{"id":"guides/import-external-modules/index","path":"/docs/guides/import-external-modules/","sidebar":"docs"},{"id":"guides/programmatic-deployment/index","path":"/docs/guides/programmatic-deployment/","sidebar":"docs"},{"id":"guides/rest/index","path":"/docs/guides/rest/","sidebar":"docs"},{"id":"guides/securing-requests/index","path":"/docs/guides/securing-requests/","sidebar":"docs"},{"id":"guides/self-hosting","path":"/docs/guides/self-hosting","sidebar":"docs"},{"id":"guides/test-your-typegraph/index","path":"/docs/guides/test-your-typegraph/","sidebar":"docs"},{"id":"guides/wasm-functions/index","path":"/docs/guides/wasm-functions/","sidebar":"docs"},{"id":"index","path":"/docs/","sidebar":"docs"},{"id":"reference/changelog","path":"/docs/reference/changelog","sidebar":"docs"},{"id":"reference/ecosystem/index","path":"/docs/reference/ecosystem/","sidebar":"docs"},{"id":"reference/graphql/index","path":"/docs/reference/graphql/","sidebar":"docs"},{"id":"reference/meta-cli/available-commands","path":"/docs/reference/meta-cli/available-commands","sidebar":"docs"},{"id":"reference/meta-cli/configuration-file","path":"/docs/reference/meta-cli/configuration-file","sidebar":"docs"},{"id":"reference/meta-cli/embedded-typegate/index","path":"/docs/reference/meta-cli/embedded-typegate/","sidebar":"docs"},{"id":"reference/meta-cli/index","path":"/docs/reference/meta-cli/","sidebar":"docs"},{"id":"reference/metagen/index","path":"/docs/reference/metagen/","sidebar":"docs"},{"id":"reference/policies/index","path":"/docs/reference/policies/","sidebar":"docs"},{"id":"reference/rest/index","path":"/docs/reference/rest/","sidebar":"docs"},{"id":"reference/runtimes/deno/index","path":"/docs/reference/runtimes/deno/","sidebar":"docs"},{"id":"reference/runtimes/graphql/index","path":"/docs/reference/runtimes/graphql/","sidebar":"docs"},{"id":"reference/runtimes/grpc/index","path":"/docs/reference/runtimes/grpc/","sidebar":"docs"},{"id":"reference/runtimes/http/index","path":"/docs/reference/runtimes/http/","sidebar":"docs"},{"id":"reference/runtimes/index","path":"/docs/reference/runtimes/","sidebar":"docs"},{"id":"reference/runtimes/kv/index","path":"/docs/reference/runtimes/kv/","sidebar":"docs"},{"id":"reference/runtimes/prisma/index","path":"/docs/reference/runtimes/prisma/","sidebar":"docs"},{"id":"reference/runtimes/python/index","path":"/docs/reference/runtimes/python/","sidebar":"docs"},{"id":"reference/runtimes/random/index","path":"/docs/reference/runtimes/random/","sidebar":"docs"},{"id":"reference/runtimes/s3/index","path":"/docs/reference/runtimes/s3/","sidebar":"docs"},{"id":"reference/runtimes/substantial/index","path":"/docs/reference/runtimes/substantial/","sidebar":"docs"},{"id":"reference/runtimes/temporal/index","path":"/docs/reference/runtimes/temporal/","sidebar":"docs"},{"id":"reference/runtimes/wasm/index","path":"/docs/reference/runtimes/wasm/","sidebar":"docs"},{"id":"reference/typegate/authentication/index","path":"/docs/reference/typegate/authentication/","sidebar":"docs"},{"id":"reference/typegate/cors/index","path":"/docs/reference/typegate/cors/","sidebar":"docs"},{"id":"reference/typegate/index","path":"/docs/reference/typegate/","sidebar":"docs"},{"id":"reference/typegate/rate-limiting/index","path":"/docs/reference/typegate/rate-limiting/","sidebar":"docs"},{"id":"reference/typegate/synchronization/index","path":"/docs/reference/typegate/synchronization/","sidebar":"docs"},{"id":"reference/typegraph/client/index","path":"/docs/reference/typegraph/client/","sidebar":"docs"},{"id":"reference/typegraph/index","path":"/docs/reference/typegraph/","sidebar":"docs"},{"id":"reference/types/comparison","path":"/docs/reference/types/comparison","sidebar":"docs"},{"id":"reference/types/functions","path":"/docs/reference/types/functions","sidebar":"docs"},{"id":"reference/types/index","path":"/docs/reference/types/","sidebar":"docs"},{"id":"reference/types/injections","path":"/docs/reference/types/injections","sidebar":"docs"},{"id":"reference/types/parameter-transformations","path":"/docs/reference/types/parameter-transformations","sidebar":"docs"},{"id":"tutorials/metatype-basics/index","path":"/docs/tutorials/metatype-basics/","sidebar":"docs"},{"id":"tutorials/quick-start/index","path":"/docs/tutorials/quick-start/","sidebar":"docs"}],"draftIds":[],"sidebars":{"docs":{"link":{"path":"/docs/","label":"index"}}}}],"breadcrumbs":true},"use-cases":{"path":"/use-cases","versions":[{"name":"current","label":"Next","isLast":true,"path":"/use-cases","mainDocId":"automatic-crud-validation/index","docs":[{"id":"automatic-crud-validation/index","path":"/use-cases/automatic-crud-validation/","sidebar":"useCases"},{"id":"backend-for-frontend/index","path":"/use-cases/backend-for-frontend/","sidebar":"useCases"},{"id":"faas-runner/index","path":"/use-cases/faas-runner/","sidebar":"useCases"},{"id":"graphql-server/index","path":"/use-cases/graphql-server/","sidebar":"useCases"},{"id":"iam-provider/index","path":"/use-cases/iam-provider/","sidebar":"useCases"},{"id":"microservice-orchestration/index","path":"/use-cases/microservice-orchestration/","sidebar":"useCases"},{"id":"orm-for-the-edge/index","path":"/use-cases/orm-for-the-edge/","sidebar":"useCases"},{"id":"programmable-api-gateway/index","path":"/use-cases/programmable-api-gateway/","sidebar":"useCases"}],"draftIds":[],"sidebars":{"useCases":{"link":{"path":"/use-cases/automatic-crud-validation/","label":"Instant APIs on your database"}}}}],"breadcrumbs":true}},"docusaurus-lunr-search":{"default":{"fileNames":{"searchDoc":"search-doc-1731559296632.json","lunrIndex":"lunr-index-1731559296632.json"}}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var s=n(22654);const l=JSON.parse('{"docusaurusVersion":"3.4.0","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"3.4.0"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"3.4.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"3.4.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"3.4.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"3.4.0"},"docusaurus-plugin-sass":{"type":"package","name":"docusaurus-plugin-sass","version":"0.2.5"},"tailwindcss":{"type":"local"},"custom-code-loader":{"type":"local"},"posthog-docusaurus":{"type":"package","name":"posthog-docusaurus","version":"2.0.0"},"docusaurus-lunr-search":{"type":"package","name":"docusaurus-lunr-search","version":"3.4.0"},"docusaurus-theme-frontmatter":{"type":"package","name":"docusaurus-theme-frontmatter","version":"1.3.0"}}}');var c=n(86070);const u={siteConfig:o.default,siteMetadata:l,globalData:a,i18n:i,codeTranslations:s},d=r.createContext(u);function p(e){let{children:t}=e;return(0,c.jsx)(d.Provider,{value:u,children:t})}},82017:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(30758),o=n(25283),a=n(74650),i=n(78946),s=n(22653),l=n(17832),c=n(86070);function u(e){let{error:t,tryAgain:n}=e;return(0,c.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",minHeight:"100vh",width:"100%",maxWidth:"80ch",fontSize:"20px",margin:"0 auto",padding:"1rem"},children:[(0,c.jsx)("h1",{style:{fontSize:"3rem"},children:"This page crashed"}),(0,c.jsx)("button",{type:"button",onClick:n,style:{margin:"1rem 0",fontSize:"2rem",cursor:"pointer",borderRadius:20,padding:"1rem"},children:"Try again"}),(0,c.jsx)(d,{error:t})]})}function d(e){let{error:t}=e;const n=(0,i.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,c.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:n})}function p(e){let{children:t}=e;return(0,c.jsx)(l.W,{value:{plugin:{name:"docusaurus-core-error-boundary",id:"default"}},children:t})}function f(e){let{error:t,tryAgain:n}=e;return(0,c.jsx)(p,{children:(0,c.jsxs)(m,{fallback:()=>(0,c.jsx)(u,{error:t,tryAgain:n}),children:[(0,c.jsx)(a.A,{children:(0,c.jsx)("title",{children:"Page Error"})}),(0,c.jsx)(s.A,{children:(0,c.jsx)(u,{error:t,tryAgain:n})})]})})}const h=e=>(0,c.jsx)(f,{...e});class m extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){o.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??h)(e)}return e??null}}},25283:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,o={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},74650:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(30758);var r=n(70248),o=n(86070);function a(e){return(0,o.jsx)(r.mg,{...e})}},92076:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(30758),o=n(41742),a=n(78946),i=n(30340),s=n(51716),l=n(25283),c=n(25880),u=n(94887),d=n(86070);function p(e,t){let{isNavLink:n,to:p,href:f,activeClassName:h,isActive:m,"data-noBrokenLinkCheck":g,autoAddBaseUrl:v=!0,...y}=e;const{siteConfig:b}=(0,i.A)(),{trailingSlash:w,baseUrl:x}=b,k=b.future.experimental_router,{withBaseUrl:S}=(0,u.hH)(),C=(0,c.A)(),E=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(()=>E.current));const T=p||f;const L=(0,s.A)(T),I=T?.replace("pathname://","");let A=void 0!==I?(O=I,v&&(e=>e.startsWith("/"))(O)?S(O):O):void 0;var O;"hash"===k&&A?.startsWith("./")&&(A=A?.slice(1)),A&&L&&(A=(0,a.applyTrailingSlash)(A,{trailingSlash:w,baseUrl:x}));const _=(0,r.useRef)(!1),P=n?o.k2:o.N_,M=l.A.canUseIntersectionObserver,R=(0,r.useRef)(),N=()=>{_.current||null==A||(window.docusaurus.preload(A),_.current=!0)};(0,r.useEffect)((()=>(!M&&L&&null!=A&&window.docusaurus.prefetch(A),()=>{M&&R.current&&R.current.disconnect()})),[R,A,M,L]);const j=A?.startsWith("#")??!1,D=!y.target||"_self"===y.target,F=!A||!L||!D;return g||!j&&F||C.collectLink(A),y.id&&C.collectAnchor(y.id),F?(0,d.jsx)("a",{ref:E,href:A,...T&&!L&&{target:"_blank",rel:"noopener noreferrer"},...y}):(0,d.jsx)(P,{...y,onMouseEnter:N,onTouchStart:N,innerRef:e=>{E.current=e,M&&e&&L&&(R.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(R.current.unobserve(e),R.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),R.current.observe(e))},to:A,...n&&{isActive:m,activeClassName:h}})}const f=r.forwardRef(p)},88237:(e,t,n)=>{"use strict";n.d(t,{A:()=>c,T:()=>l});var r=n(30758),o=n(86070);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var i=n(22654);function s(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return i[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(s({message:n,id:r}),t)}function c(e){let{children:t,id:n,values:r}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const i=s({message:t,id:n});return(0,o.jsx)(o.Fragment,{children:a(i,r)})}},95163:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},51716:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>o,z:()=>r})},94887:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>s,hH:()=>i});var r=n(30758),o=n(30340),a=n(51716);function i(){const{siteConfig:e}=(0,o.A)(),{baseUrl:t,url:n}=e,i=e.future.experimental_router,s=(0,r.useCallback)(((e,r)=>function(e){let{siteUrl:t,baseUrl:n,url:r,options:{forcePrependBaseUrl:o=!1,absolute:i=!1}={},router:s}=e;if(!r||r.startsWith("#")||(0,a.z)(r))return r;if("hash"===s)return r.startsWith("/")?`.${r}`:`./${r}`;if(o)return n+r.replace(/^\//,"");if(r===n.replace(/\/$/,""))return n;const l=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?t+l:l}({siteUrl:n,baseUrl:t,url:e,options:r,router:i})),[n,t,i]);return{withBaseUrl:s}}function s(e,t){void 0===t&&(t={});const{withBaseUrl:n}=i();return n(e,t)}},25880:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(30758);n(86070);const o=r.createContext({collectAnchor:()=>{},collectLink:()=>{}}),a=()=>(0,r.useContext)(o);function i(){return a()}},30340:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(30758),o=n(5775);function a(){return(0,r.useContext)(o.o)}},39646:(e,t,n)=>{"use strict";n.d(t,{P_:()=>i,kh:()=>a});var r=n(30340),o=n(95163);function a(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,r.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}function i(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=a(e),i=r?.[t];if(!i&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return i}},5197:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(30758),o=n(95143);function a(){return(0,r.useContext)(o.o)}},89871:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(30758);const o=n(25283).A.canUseDOM?r.useLayoutEffect:r.useEffect},80053:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(30758),o=n(17832);function a(){const e=r.useContext(o.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}},7771:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function o(e){const t={};return function e(n,o){Object.entries(n).forEach((n=>{let[a,i]=n;const s=o?`${o}.${a}`:a;r(i)?e(i,s):t[s]=i}))}(e),t}},17832:(e,t,n)=>{"use strict";n.d(t,{W:()=>i,o:()=>a});var r=n(30758),o=n(86070);const a=r.createContext(null);function i(e){let{children:t,value:n}=e;const i=r.useContext(a),s=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:i,value:n})),[i,n]);return(0,o.jsx)(a.Provider,{value:s,children:t})}},62939:(e,t,n)=>{"use strict";n.d(t,{zK:()=>f,vT:()=>u,Gy:()=>l,HW:()=>h,ht:()=>c,r7:()=>p,jh:()=>d});var r=n(25557),o=n(39646);const a=e=>e.versions.find((e=>e.isLast));function i(e,t){const n=function(e,t){const n=a(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}(e,t),o=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(o.id):{}}}const s={},l=()=>(0,o.kh)("docusaurus-plugin-content-docs")??s,c=e=>{try{return(0,o.P_)("docusaurus-plugin-content-docs",e,{failfast:!0})}catch(t){throw new Error("You are using a feature of the Docusaurus docs plugin, but this plugin does not seem to be enabled"+("Default"===e?"":` (pluginId=${e}`),{cause:t})}};function u(e){void 0===e&&(e={});const t=l(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const o=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),a=o?{pluginId:o[0],pluginData:o[1]}:void 0;if(!a&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return a}(t,n,e)}function d(e){return c(e).versions}function p(e){const t=c(e);return a(t)}function f(e){const t=c(e),{pathname:n}=(0,r.zy)();return i(t,n)}function h(e){const t=c(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=a(e);return{latestDocSuggestion:i(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},57316:(e,t,n)=>{"use strict";function r(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(){return i=Object.assign||function(e){for(var t=1;t{"use strict";n.r(t),n.d(t,{default:()=>a});var r=n(58744),o=n.n(r);o().configure({showSpinner:!1});const a={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{o().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){o().done()}}},16636:(e,t,n)=>{"use strict";n.r(t);var r=n(63477),o=n(4784);!function(e){const{themeConfig:{prism:t}}=o.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{"php"===e&&n(1274),n(45433)(`./prism-${e}`)})),delete globalThis.Prism}(r.My)},55230:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(30758);var r=n(13526),o=n(88237),a=n(13929),i=n(92076),s=n(25880);const l={anchorWithStickyNavbar:"anchorWithStickyNavbar_gmPS",anchorWithHideOnScrollNavbar:"anchorWithHideOnScrollNavbar_PA6j"};var c=n(86070);function u(e){let{as:t,id:n,...u}=e;const d=(0,s.A)(),{navbar:{hideOnScroll:p}}=(0,a.p)();if("h1"===t||!n)return(0,c.jsx)(t,{...u,id:void 0});d.collectAnchor(n);const f=(0,o.T)({id:"theme.common.headingLinkTitle",message:"Direct link to {heading}",description:"Title for link to heading"},{heading:"string"==typeof u.children?u.children:n});return(0,c.jsxs)(t,{...u,className:(0,r.A)("anchor",p?l.anchorWithHideOnScrollNavbar:l.anchorWithStickyNavbar,u.className),id:n,children:[u.children,(0,c.jsx)(i.A,{className:"hash-link",to:`#${n}`,"aria-label":f,title:f,children:"\u200b"})]})}},20351:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(30758);const r={iconExternalLink:"iconExternalLink_oKM7"};var o=n(86070);function a(e){let{width:t=13.5,height:n=13.5}=e;return(0,o.jsx)("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:r.iconExternalLink,children:(0,o.jsx)("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"})})}},22653:(e,t,n)=>{"use strict";n.d(t,{A:()=>yt});var r=n(30758),o=n(13526),a=n(82017),i=n(64204),s=n(25557),l=n(88237),c=n(35623),u=n(86070);const d="__docusaurus_skipToContent_fallback";function p(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}function f(){const e=(0,r.useRef)(null),{action:t}=(0,s.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.getElementById(d);t&&p(t)}),[]);return(0,c.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&p(e.current)})),{containerRef:e,onClick:n}}const h=(0,l.T)({id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation",message:"Skip to main content"});function m(e){const t=e.children??h,{containerRef:n,onClick:r}=f();return(0,u.jsx)("div",{ref:n,role:"region","aria-label":h,children:(0,u.jsx)("a",{...e,href:`#${d}`,onClick:r,children:t})})}var g=n(81274),v=n(4715);const y={skipToContent:"skipToContent_kkJt"};function b(){return(0,u.jsx)(m,{className:y.skipToContent})}var w=n(13929),x=n(67214);function k(e){let{width:t=21,height:n=21,color:r="currentColor",strokeWidth:o=1.2,className:a,...i}=e;return(0,u.jsx)("svg",{viewBox:"0 0 15 15",width:t,height:n,...i,children:(0,u.jsx)("g",{stroke:r,strokeWidth:o,children:(0,u.jsx)("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})})})}const S={closeButton:"closeButton_YMCa"};function C(e){return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"}),...e,className:(0,o.A)("clean-btn close",S.closeButton,e.className),children:(0,u.jsx)(k,{width:14,height:14,strokeWidth:3.1})})}const E={content:"content_qw9T"};function T(e){const{announcementBar:t}=(0,w.p)(),{content:n}=t;return(0,u.jsx)("div",{...e,className:(0,o.A)(E.content,e.className),dangerouslySetInnerHTML:{__html:n}})}const L={announcementBar:"announcementBar_sF1Y",announcementBarPlaceholder:"announcementBarPlaceholder_dCav",announcementBarClose:"announcementBarClose_tJzs",announcementBarContent:"announcementBarContent_H5Gj"};function I(){const{announcementBar:e}=(0,w.p)(),{isActive:t,close:n}=(0,x.M)();if(!t)return null;const{backgroundColor:r,textColor:o,isCloseable:a}=e;return(0,u.jsxs)("div",{className:L.announcementBar,style:{backgroundColor:r,color:o},role:"banner",children:[a&&(0,u.jsx)("div",{className:L.announcementBarPlaceholder}),(0,u.jsx)(T,{className:L.announcementBarContent}),a&&(0,u.jsx)(C,{onClick:n,className:L.announcementBarClose})]})}var A=n(14491),O=n(793);var _=n(94259),P=n(831);const M=r.createContext(null);function R(e){let{children:t}=e;const n=function(){const e=(0,A.M)(),t=(0,P.YL)(),[n,o]=(0,r.useState)(!1),a=null!==t.component,i=(0,_.ZC)(a);return(0,r.useEffect)((()=>{a&&!i&&o(!0)}),[a,i]),(0,r.useEffect)((()=>{a?e.shown||o(!0):o(!1)}),[e.shown,a]),(0,r.useMemo)((()=>[n,o]),[n])}();return(0,u.jsx)(M.Provider,{value:n,children:t})}function N(e){if(e.component){const t=e.component;return(0,u.jsx)(t,{...e.props})}}function j(){const e=(0,r.useContext)(M);if(!e)throw new _.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,o=(0,r.useCallback)((()=>n(!1)),[n]),a=(0,P.YL)();return(0,r.useMemo)((()=>({shown:t,hide:o,content:N(a)})),[o,a,t])}function D(e){let{header:t,primaryMenu:n,secondaryMenu:r}=e;const{shown:a}=j();return(0,u.jsxs)("div",{className:"navbar-sidebar",children:[t,(0,u.jsxs)("div",{className:(0,o.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":a}),children:[(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:n}),(0,u.jsx)("div",{className:"navbar-sidebar__item menu",children:r})]})]})}var F=n(64322),B=n(5197);function z(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"})})}function U(e){return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:24,height:24,...e,children:(0,u.jsx)("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"})})}const q={toggle:"toggle_Zzz4",toggleButton:"toggleButton_k661",darkToggleIcon:"darkToggleIcon_WKry",lightToggleIcon:"lightToggleIcon_IKxN",toggleButtonDisabled:"toggleButtonDisabled_Gvex"};function H(e){let{className:t,buttonClassName:n,value:r,onChange:a}=e;const i=(0,B.A)(),s=(0,l.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===r?(0,l.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,l.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return(0,u.jsx)("div",{className:(0,o.A)(q.toggle,t),children:(0,u.jsxs)("button",{className:(0,o.A)("clean-btn",q.toggleButton,!i&&q.toggleButtonDisabled,n),type:"button",onClick:()=>a("dark"===r?"light":"dark"),disabled:!i,title:s,"aria-label":s,"aria-live":"polite",children:[(0,u.jsx)(z,{className:(0,o.A)(q.toggleIcon,q.lightToggleIcon)}),(0,u.jsx)(U,{className:(0,o.A)(q.toggleIcon,q.darkToggleIcon)})]})})}const W=r.memo(H),$={darkNavbarColorModeToggle:"darkNavbarColorModeToggle_tYqz"};function G(e){let{className:t}=e;const n=(0,w.p)().navbar.style,r=(0,w.p)().colorMode.disableSwitch,{colorMode:o,setColorMode:a}=(0,F.G)();return r?null:(0,u.jsx)(W,{className:t,buttonClassName:"dark"===n?$.darkNavbarColorModeToggle:void 0,value:o,onChange:a})}var V=n(67520);function K(){return(0,u.jsx)(V.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function Z(){const e=(0,A.M)();return(0,u.jsx)("button",{type:"button","aria-label":(0,l.T)({id:"theme.docs.sidebar.closeSidebarButtonAriaLabel",message:"Close navigation bar",description:"The ARIA label for close button of mobile sidebar"}),className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle(),children:(0,u.jsx)(k,{color:"var(--ifm-color-emphasis-600)"})})}function Y(){return(0,u.jsxs)("div",{className:"navbar-sidebar__brand",children:[(0,u.jsx)(K,{}),(0,u.jsx)(G,{className:"margin-right--md"}),(0,u.jsx)(Z,{})]})}var X=n(92076),J=n(94887),Q=n(51716);function ee(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}var te=n(20351);function ne(e){let{activeBasePath:t,activeBaseRegex:n,to:r,href:o,label:a,html:i,isDropdownLink:s,prependBaseUrlToHref:l,...c}=e;const d=(0,J.Ay)(r),p=(0,J.Ay)(t),f=(0,J.Ay)(o,{forcePrependBaseUrl:!0}),h=a&&o&&!(0,Q.A)(o),m=i?{dangerouslySetInnerHTML:{__html:i}}:{children:(0,u.jsxs)(u.Fragment,{children:[a,h&&(0,u.jsx)(te.A,{...s&&{width:12,height:12}})]})};return o?(0,u.jsx)(X.A,{href:l?f:o,...c,...m}):(0,u.jsx)(X.A,{to:d,isNavLink:!0,...(t||n)&&{isActive:(e,t)=>n?ee(n,t.pathname):t.pathname.startsWith(p)},...c,...m})}function re(e){let{className:t,isDropdownItem:n=!1,...r}=e;const a=(0,u.jsx)(ne,{className:(0,o.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n,...r});return n?(0,u.jsx)("li",{children:a}):a}function oe(e){let{className:t,isDropdownItem:n,...r}=e;return(0,u.jsx)("li",{className:"menu__list-item",children:(0,u.jsx)(ne,{className:(0,o.A)("menu__link",t),...r})})}function ae(e){let{mobile:t=!1,position:n,...r}=e;const o=t?oe:re;return(0,u.jsx)(o,{...r,activeClassName:r.activeClassName??(t?"menu__link--active":"navbar__link--active")})}var ie=n(53609),se=n(74768),le=n(30340);const ce={dropdownNavbarItemMobile:"dropdownNavbarItemMobile_vUqO"};function ue(e,t){return e.some((e=>function(e,t){return!!(0,se.ys)(e.to,t)||!!ee(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function de(e){let{items:t,position:n,className:a,onClick:i,...s}=e;const l=(0,r.useRef)(null),[c,d]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{l.current&&!l.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),document.addEventListener("focusin",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),document.removeEventListener("focusin",e)}}),[l]),(0,u.jsxs)("div",{ref:l,className:(0,o.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c}),children:[(0,u.jsx)(ne,{"aria-haspopup":"true","aria-expanded":c,role:"button",href:s.to?void 0:"#",className:(0,o.A)("navbar__link",a),...s,onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(!c))},children:s.children??s.label}),(0,u.jsx)("ul",{className:"dropdown__menu",children:t.map(((e,t)=>(0,r.createElement)(Oe,{isDropdownItem:!0,activeClassName:"dropdown__link--active",...e,key:t})))})]})}function pe(e){let{items:t,className:n,position:a,onClick:i,...l}=e;const c=function(){const{siteConfig:{baseUrl:e}}=(0,le.A)(),{pathname:t}=(0,s.zy)();return t.replace(e,"/")}(),d=ue(t,c),{collapsed:p,toggleCollapsed:f,setCollapsed:h}=(0,ie.u)({initialState:()=>!d});return(0,r.useEffect)((()=>{d&&h(!d)}),[c,d,h]),(0,u.jsxs)("li",{className:(0,o.A)("menu__list-item",{"menu__list-item--collapsed":p}),children:[(0,u.jsx)(ne,{role:"button",className:(0,o.A)(ce.dropdownNavbarItemMobile,"menu__link menu__link--sublist menu__link--sublist-caret",n),...l,onClick:e=>{e.preventDefault(),f()},children:l.children??l.label}),(0,u.jsx)(ie.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:p,children:t.map(((e,t)=>(0,r.createElement)(Oe,{mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active",...e,key:t})))})]})}function fe(e){let{mobile:t=!1,...n}=e;const r=t?pe:de;return(0,u.jsx)(r,{...n})}var he=n(98878);function me(e){let{width:t=20,height:n=20,...r}=e;return(0,u.jsx)("svg",{viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0,...r,children:(0,u.jsx)("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})})}const ge="iconLanguage_J6eA";var ve=n(68835),ye=n(39646),be=n(91176),we=n.n(be);function xe(){const e=(0,s.zy)(),t=(0,s.W6)(),{siteConfig:{baseUrl:n}}=(0,le.A)(),[o,a]=(0,r.useState)({wordToHighlight:"",isTitleSuggestion:!1,titleText:""});return(0,r.useEffect)((()=>{if(!e.state?.highlightState||0===e.state.highlightState.wordToHighlight.length)return;a(e.state.highlightState);const{highlightState:n,...r}=e.state;t.replace({...e,state:r})}),[e.state?.highlightState,t,e]),(0,r.useEffect)((()=>{if(0===o.wordToHighlight.length)return;const e=document.getElementsByTagName("article")[0]??document.getElementsByTagName("main")[0];if(!e)return;const t=new(we())(e),n={ignoreJoiners:!0};return t.mark(o.wordToHighlight,n),()=>t.unmark(n)}),[o,n]),null}const ke=e=>{const t=(0,r.useRef)(!1),o=(0,r.useRef)(null),[a,i]=(0,r.useState)(!1),l=(0,s.W6)(),{siteConfig:c={}}=(0,le.A)(),d=(c.plugins||[]).find((e=>Array.isArray(e)&&"string"==typeof e[0]&&e[0].includes("docusaurus-lunr-search"))),p=(0,B.A)(),{baseUrl:f}=c,h=d&&d[1]?.assetUrl||f,m=(0,ye.P_)("docusaurus-lunr-search"),g=()=>{t.current||(Promise.all([fetch(`${h}${m.fileNames.searchDoc}`).then((e=>e.json())),fetch(`${h}${m.fileNames.lunrIndex}`).then((e=>e.json())),Promise.all([n.e(7570),n.e(8649)]).then(n.bind(n,26989)),Promise.all([n.e(1869),n.e(1963)]).then(n.bind(n,31963))]).then((e=>{let[t,n,{default:r}]=e;const{searchDocs:o,options:a}=t;o&&0!==o.length&&(((e,t,n,r)=>{new n({searchDocs:e,searchIndex:t,baseUrl:f,inputSelector:"#search_input_react",handleSelected:(e,t,n)=>{const o=n.url||"/";document.createElement("a").href=o,e.setVal(""),t.target.blur();let a="";if(r.highlightResult)try{const e=(n.text||n.subcategory||n.title).match(new RegExp("\\w*","g"));if(e&&e.length>0){const t=document.createElement("div");t.innerHTML=e[0],a=t.textContent}}catch(i){console.log(i)}l.push(o,{highlightState:{wordToHighlight:a}})},maxHits:r.maxHits})})(o,n,r,a),i(!0))})),t.current=!0)},v=(0,r.useCallback)((t=>{o.current.contains(t.target)||o.current.focus(),e.handleSearchBarToggle&&e.handleSearchBarToggle(!e.isSearchBarExpanded)}),[e.isSearchBarExpanded]);let y;return p&&(g(),y=window.navigator.platform.startsWith("Mac")?"Search \u2318+K":"Search Ctrl+K"),(0,r.useEffect)((()=>{e.autoFocus&&a&&o.current.focus()}),[a]),(0,u.jsxs)("div",{className:"navbar__search",children:[(0,u.jsx)("span",{"aria-label":"expand searchbar",role:"button",className:(0,ve.A)("search-icon",{"search-icon-hidden":e.isSearchBarExpanded}),onClick:v,onKeyDown:v,tabIndex:0}),(0,u.jsx)("input",{id:"search_input_react",type:"search",placeholder:a?y:"Loading...","aria-label":"Search",className:(0,ve.A)("navbar__search-input",{"search-bar-expanded":e.isSearchBarExpanded},{"search-bar":!e.isSearchBarExpanded}),onClick:g,onMouseOver:g,onFocus:v,onBlur:v,ref:o,disabled:!a}),(0,u.jsx)(xe,{})]},"search-box")},Se={navbarSearchContainer:"navbarSearchContainer_YXBI"};function Ce(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:(0,o.A)(n,Se.navbarSearchContainer),children:t})}var Ee=n(62939),Te=n(52295);var Le=n(23432);const Ie=e=>e.docs.find((t=>t.id===e.mainDocId));const Ae={default:ae,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:r,queryString:o="",...a}=e;const{i18n:{currentLocale:i,locales:c,localeConfigs:d}}=(0,le.A)(),p=(0,he.o)(),{search:f,hash:h}=(0,s.zy)(),m=[...n,...c.map((e=>{const n=`${`pathname://${p.createUrl({locale:e,fullyQualified:!1})}`}${f}${h}${o}`;return{label:d[e].label,lang:d[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...r],g=t?(0,l.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):d[i].label;return(0,u.jsx)(fe,{...a,mobile:t,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(me,{className:ge}),g]}),items:m})},search:function(e){let{mobile:t,className:n}=e;return t?null:(0,u.jsx)(Ce,{className:n,children:(0,u.jsx)(ke,{})})},dropdown:fe,html:function(e){let{value:t,className:n,mobile:r=!1,isDropdownItem:a=!1}=e;const i=a?"li":"div";return(0,u.jsx)(i,{className:(0,o.A)({navbar__item:!r&&!a,"menu__list-item":r},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Ee.zK)(r),i=(0,Te.QB)(t,r),s=a?.path===i?.path;return null===i||i.unlisted&&!s?null:(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>s||!!a?.sidebar&&a.sidebar===i.sidebar,label:n??i.id,to:i.path})},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:r,...o}=e;const{activeDoc:a}=(0,Ee.zK)(r),i=(0,Te.fW)(t,r).link;if(!i)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return(0,u.jsx)(ae,{exact:!0,...o,isActive:()=>a?.sidebar===t,label:n??i.label,to:i.path})},docsVersion:function(e){let{label:t,to:n,docsPluginId:r,...o}=e;const a=(0,Te.Vd)(r)[0],i=t??a.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(a).path;return(0,u.jsx)(ae,{...o,label:i,to:s})},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:r,dropdownItemsBefore:o,dropdownItemsAfter:a,...i}=e;const{search:c,hash:d}=(0,s.zy)(),p=(0,Ee.zK)(n),f=(0,Ee.jh)(n),{savePreferredVersionName:h}=(0,Le.g1)(n),m=[...o,...f.map((e=>{const t=p.alternateDocVersions[e.name]??Ie(e);return{label:e.label,to:`${t.path}${c}${d}`,isActive:()=>e===p.activeVersion,onClick:()=>h(e.name)}})),...a],g=(0,Te.Vd)(n)[0],v=t&&m.length>1?(0,l.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):g.label,y=t&&m.length>1?void 0:Ie(g).path;return m.length<=1?(0,u.jsx)(ae,{...i,mobile:t,label:v,to:y,isActive:r?()=>!1:void 0}):(0,u.jsx)(fe,{...i,mobile:t,label:v,to:y,items:m,isActive:r?()=>!1:void 0})}};function Oe(e){let{type:t,...n}=e;const r=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=Ae[r];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return(0,u.jsx)(o,{...n})}function _e(){const e=(0,A.M)(),t=(0,w.p)().navbar.items;return(0,u.jsx)("ul",{className:"menu__list",children:t.map(((t,n)=>(0,r.createElement)(Oe,{mobile:!0,...t,onClick:()=>e.toggle(),key:n})))})}function Pe(e){return(0,u.jsx)("button",{...e,type:"button",className:"clean-btn navbar-sidebar__back",children:(0,u.jsx)(l.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)",children:"\u2190 Back to main menu"})})}function Me(){const e=0===(0,w.p)().navbar.items.length,t=j();return(0,u.jsxs)(u.Fragment,{children:[!e&&(0,u.jsx)(Pe,{onClick:()=>t.hide()}),t.content]})}function Re(){const e=(0,A.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?(0,u.jsx)(D,{header:(0,u.jsx)(Y,{}),primaryMenu:(0,u.jsx)(_e,{}),secondaryMenu:(0,u.jsx)(Me,{})}):null}const Ne={navbarHideable:"navbarHideable_ZRt4",navbarHidden:"navbarHidden__zjS"};function je(e){return(0,u.jsx)("div",{role:"presentation",...e,className:(0,o.A)("navbar-sidebar__backdrop",e.className)})}function De(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:a}}=(0,w.p)(),i=(0,A.M)(),{navbarRef:s,isNavbarVisible:d}=function(e){const[t,n]=(0,r.useState)(e),o=(0,r.useRef)(!1),a=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(a.current=e.getBoundingClientRect().height)}),[]);return(0,O.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=s?n(!1):i+c{if(!e)return;const r=t.location.hash;if(r?document.getElementById(r.substring(1)):void 0)return o.current=!0,void n(!1);n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return(0,u.jsxs)("nav",{ref:s,"aria-label":(0,l.T)({id:"theme.NavBar.navAriaLabel",message:"Main",description:"The ARIA label for the main navigation"}),className:(0,o.A)("navbar","navbar--fixed-top",n&&[Ne.navbarHideable,!d&&Ne.navbarHidden],{"navbar--dark":"dark"===a,"navbar--primary":"primary"===a,"navbar-sidebar--show":i.shown}),children:[t,(0,u.jsx)(je,{onClick:i.toggle}),(0,u.jsx)(Re,{})]})}var Fe=n(78946);const Be={errorBoundaryError:"errorBoundaryError_FzC7",errorBoundaryFallback:"errorBoundaryFallback_bhT6"};function ze(e){return(0,u.jsx)("button",{type:"button",...e,children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again rendering when the React error boundary captures an error",children:"Try again"})})}function Ue(e){let{error:t}=e;const n=(0,Fe.getErrorCausalChain)(t).map((e=>e.message)).join("\n\nCause:\n");return(0,u.jsx)("p",{className:Be.errorBoundaryError,children:n})}class qe extends r.Component{componentDidCatch(e,t){throw this.props.onError(e,t)}render(){return this.props.children}}const He="right";function We(e){let{width:t=30,height:n=30,className:r,...o}=e;return(0,u.jsx)("svg",{className:r,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true",...o,children:(0,u.jsx)("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"})})}function $e(){const{toggle:e,shown:t}=(0,A.M)();return(0,u.jsx)("button",{onClick:e,"aria-label":(0,l.T)({id:"theme.docs.sidebar.toggleSidebarButtonAriaLabel",message:"Toggle navigation bar",description:"The ARIA label for hamburger menu button of mobile navigation"}),"aria-expanded":t,className:"navbar__toggle clean-btn",type:"button",children:(0,u.jsx)(We,{})})}const Ge={colorModeToggle:"colorModeToggle_CW8R"};function Ve(e){let{items:t}=e;return(0,u.jsx)(u.Fragment,{children:t.map(((e,t)=>(0,u.jsx)(qe,{onError:t=>new Error(`A theme navbar item failed to render.\nPlease double-check the following navbar item (themeConfig.navbar.items) of your Docusaurus config:\n${JSON.stringify(e,null,2)}`,{cause:t}),children:(0,u.jsx)(Oe,{...e})},t)))})}function Ke(e){let{left:t,right:n}=e;return(0,u.jsxs)("div",{className:"navbar__inner",children:[(0,u.jsx)("div",{className:"navbar__items",children:t}),(0,u.jsx)("div",{className:"navbar__items navbar__items--right",children:n})]})}function Ze(){const e=(0,A.M)(),t=(0,w.p)().navbar.items,[n,r]=function(e){function t(e){return"left"===(e.position??He)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return(0,u.jsx)(Ke,{left:(0,u.jsxs)(u.Fragment,{children:[!e.disabled&&(0,u.jsx)($e,{}),(0,u.jsx)(K,{}),(0,u.jsx)(Ve,{items:n})]}),right:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ve,{items:r}),(0,u.jsx)(G,{className:Ge.colorModeToggle}),!o&&(0,u.jsx)(Ce,{children:(0,u.jsx)(ke,{})})]})})}function Ye(){return(0,u.jsx)(De,{children:(0,u.jsx)(Ze,{})})}function Xe(e){let{item:t}=e;const{to:n,href:r,label:o,prependBaseUrlToHref:a,...i}=t,s=(0,J.Ay)(n),l=(0,J.Ay)(r,{forcePrependBaseUrl:!0});return(0,u.jsxs)(X.A,{className:"footer__link-item",...r?{href:a?l:r}:{to:s},...i,children:[o,r&&!(0,Q.A)(r)&&(0,u.jsx)(te.A,{})]})}function Je(e){let{item:t}=e;return t.html?(0,u.jsx)("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)("li",{className:"footer__item",children:(0,u.jsx)(Xe,{item:t})},t.href??t.to)}function Qe(e){let{column:t}=e;return(0,u.jsxs)("div",{className:"col footer__col",children:[(0,u.jsx)("div",{className:"footer__title",children:t.title}),(0,u.jsx)("ul",{className:"footer__items clean-list",children:t.items.map(((e,t)=>(0,u.jsx)(Je,{item:e},t)))})]})}function et(e){let{columns:t}=e;return(0,u.jsx)("div",{className:"row footer__links",children:t.map(((e,t)=>(0,u.jsx)(Qe,{column:e},t)))})}function tt(){return(0,u.jsx)("span",{className:"footer__link-separator",children:"\xb7"})}function nt(e){let{item:t}=e;return t.html?(0,u.jsx)("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):(0,u.jsx)(Xe,{item:t})}function rt(e){let{links:t}=e;return(0,u.jsx)("div",{className:"footer__links text--center",children:(0,u.jsx)("div",{className:"footer__links",children:t.map(((e,n)=>(0,u.jsxs)(r.Fragment,{children:[(0,u.jsx)(nt,{item:e}),t.length!==n+1&&(0,u.jsx)(tt,{})]},n)))})})}function ot(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?(0,u.jsx)(et,{columns:t}):(0,u.jsx)(rt,{links:t})}var at=n(15871);const it={footerLogoLink:"footerLogoLink_D2d8"};function st(e){let{logo:t}=e;const{withBaseUrl:n}=(0,J.hH)(),r={light:n(t.src),dark:n(t.srcDark??t.src)};return(0,u.jsx)(at.A,{className:(0,o.A)("footer__logo",t.className),alt:t.alt,sources:r,width:t.width,height:t.height,style:t.style})}function lt(e){let{logo:t}=e;return t.href?(0,u.jsx)(X.A,{href:t.href,className:it.footerLogoLink,target:t.target,children:(0,u.jsx)(st,{logo:t})}):(0,u.jsx)(st,{logo:t})}function ct(e){let{copyright:t}=e;return(0,u.jsx)("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function ut(e){let{style:t,links:n,logo:r,copyright:a}=e;return(0,u.jsx)("footer",{className:(0,o.A)("footer",{"footer--dark":"dark"===t}),children:(0,u.jsxs)("div",{className:"container container-fluid",children:[n,(r||a)&&(0,u.jsxs)("div",{className:"footer__bottom text--center",children:[r&&(0,u.jsx)("div",{className:"margin-bottom--sm",children:r}),a]})]})})}function dt(){const{footer:e}=(0,w.p)();if(!e)return null;const{copyright:t,links:n,logo:r,style:o}=e;return(0,u.jsx)(ut,{style:o,links:n&&n.length>0&&(0,u.jsx)(ot,{links:n}),logo:r&&(0,u.jsx)(lt,{logo:r}),copyright:t&&(0,u.jsx)(ct,{copyright:t})})}const pt=r.memo(dt),ft=(0,_.fM)([F.a,x.o,O.Tv,Le.VQ,i.Jx,function(e){let{children:t}=e;return(0,u.jsx)(P.y_,{children:(0,u.jsx)(A.e,{children:(0,u.jsx)(R,{children:t})})})}]);function ht(e){let{children:t}=e;return(0,u.jsx)(ft,{children:t})}var mt=n(55230);function gt(e){let{error:t,tryAgain:n}=e;return(0,u.jsx)("main",{className:"container margin-vert--xl",children:(0,u.jsx)("div",{className:"row",children:(0,u.jsxs)("div",{className:"col col--6 col--offset-3",children:[(0,u.jsx)(mt.A,{as:"h1",className:"hero__title",children:(0,u.jsx)(l.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed",children:"This page crashed."})}),(0,u.jsx)("div",{className:"margin-vert--lg",children:(0,u.jsx)(ze,{onClick:n,className:"button button--primary shadow--lw"})}),(0,u.jsx)("hr",{}),(0,u.jsx)("div",{className:"margin-vert--md",children:(0,u.jsx)(Ue,{error:t})})]})})})}const vt={mainWrapper:"mainWrapper_Ge4w"};function yt(e){const{children:t,noFooter:n,wrapperClassName:r,title:s,description:l}=e;return(0,v.J)(),(0,u.jsxs)(ht,{children:[(0,u.jsx)(i.be,{title:s,description:l}),(0,u.jsx)(b,{}),(0,u.jsx)(I,{}),(0,u.jsx)(Ye,{}),(0,u.jsx)("div",{id:d,className:(0,o.A)(g.G.wrapper.main,vt.mainWrapper,r),children:(0,u.jsx)(a.A,{fallback:e=>(0,u.jsx)(gt,{...e}),children:t})}),!n&&(0,u.jsx)(pt,{})]})}},67520:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});n(30758);var r=n(92076),o=n(94887),a=n(30340),i=n(13929),s=n(15871),l=n(86070);function c(e){let{logo:t,alt:n,imageClassName:r}=e;const a={light:(0,o.Ay)(t.src),dark:(0,o.Ay)(t.srcDark||t.src)},i=(0,l.jsx)(s.A,{className:t.className,sources:a,height:t.height,width:t.width,alt:n,style:t.style});return r?(0,l.jsx)("div",{className:r,children:i}):i}function u(e){const{siteConfig:{title:t}}=(0,a.A)(),{navbar:{title:n,logo:s}}=(0,i.p)(),{imageClassName:u,titleClassName:d,...p}=e,f=(0,o.Ay)(s?.href||"/"),h=n?"":t,m=s?.alt??h;return(0,l.jsxs)(r.A,{to:f,...p,...s?.target&&{target:s.target},children:[s&&(0,l.jsx)(c,{logo:s,alt:m,imageClassName:u}),null!=n&&(0,l.jsx)("b",{className:d,children:n})]})}},43926:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});n(30758);var r=n(74650),o=n(86070);function a(e){let{locale:t,version:n,tag:a}=e;const i=t;return(0,o.jsxs)(r.A,{children:[t&&(0,o.jsx)("meta",{name:"docusaurus_locale",content:t}),n&&(0,o.jsx)("meta",{name:"docusaurus_version",content:n}),a&&(0,o.jsx)("meta",{name:"docusaurus_tag",content:a}),i&&(0,o.jsx)("meta",{name:"docsearch:language",content:i}),n&&(0,o.jsx)("meta",{name:"docsearch:version",content:n}),a&&(0,o.jsx)("meta",{name:"docsearch:docusaurus_tag",content:a})]})}},15871:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(30758),o=n(13526),a=n(5197),i=n(64322);const s={themedComponent:"themedComponent_Ev3p","themedComponent--light":"themedComponent--light_IPMc","themedComponent--dark":"themedComponent--dark_olOz"};var l=n(86070);function c(e){let{className:t,children:n}=e;const c=(0,a.A)(),{colorMode:u}=(0,i.G)();return(0,l.jsx)(l.Fragment,{children:(c?"dark"===u?["dark"]:["light"]:["light","dark"]).map((e=>{const a=n({theme:e,className:(0,o.A)(t,s.themedComponent,s[`themedComponent--${e}`])});return(0,l.jsx)(r.Fragment,{children:a},e)}))})}function u(e){const{sources:t,className:n,alt:r,...o}=e;return(0,l.jsx)(c,{className:n,children:e=>{let{theme:n,className:a}=e;return(0,l.jsx)("img",{src:t[n],alt:r,className:a,...o})}})}},53609:(e,t,n)=>{"use strict";n.d(t,{N:()=>v,u:()=>c});var r=n(30758),o=n(25283),a=n(89871),i=n(4746),s=n(86070);const l="ease-in-out";function c(e){let{initialState:t}=e;const[n,o]=(0,r.useState)(t??!1),a=(0,r.useCallback)((()=>{o((e=>!e))}),[]);return{collapsed:n,setCollapsed:o,toggleCollapsed:a}}const u={display:"none",overflow:"hidden",height:"0px"},d={display:"block",overflow:"visible",height:"auto"};function p(e,t){const n=t?u:d;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function f(e){let{collapsibleRef:t,collapsed:n,animation:o}=e;const a=(0,r.useRef)(!1);(0,r.useEffect)((()=>{const e=t.current;function r(){const t=e.scrollHeight,n=o?.duration??function(e){if((0,i.O)())return 1;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${o?.easing??l}`,height:`${t}px`}}function s(){const t=r();e.style.transition=t.transition,e.style.height=t.height}if(!a.current)return p(e,n),void(a.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(s(),requestAnimationFrame((()=>{e.style.height=u.height,e.style.overflow=u.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{s()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,o])}function h(e){if(!o.A.canUseDOM)return e?u:d}function m(e){let{as:t="div",collapsed:n,children:o,animation:a,onCollapseTransitionEnd:i,className:l,disableSSRStyle:c}=e;const u=(0,r.useRef)(null);return f({collapsibleRef:u,collapsed:n,animation:a}),(0,s.jsx)(t,{ref:u,style:c?void 0:h(n),onTransitionEnd:e=>{"height"===e.propertyName&&(p(u.current,n),i?.(n))},className:l,children:o})}function g(e){let{collapsed:t,...n}=e;const[o,i]=(0,r.useState)(!t),[l,c]=(0,r.useState)(t);return(0,a.A)((()=>{t||i(!0)}),[t]),(0,a.A)((()=>{o&&c(t)}),[o,t]),o?(0,s.jsx)(m,{...n,collapsed:l}):null}function v(e){let{lazy:t,...n}=e;const r=t?g:m;return(0,s.jsx)(r,{...n})}},67214:(e,t,n)=>{"use strict";n.d(t,{M:()=>m,o:()=>h});var r=n(30758),o=n(5197),a=n(27311),i=n(94259),s=n(13929),l=n(86070);const c=(0,a.Wf)("docusaurus.announcement.dismiss"),u=(0,a.Wf)("docusaurus.announcement.id"),d=()=>"true"===c.get(),p=e=>c.set(String(e)),f=r.createContext(null);function h(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,s.p)(),t=(0,o.A)(),[n,a]=(0,r.useState)((()=>!!t&&d()));(0,r.useEffect)((()=>{a(d())}),[]);const i=(0,r.useCallback)((()=>{p(!0),a(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=u.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;u.set(t),r&&p(!1),!r&&d()||a(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return(0,l.jsx)(f.Provider,{value:n,children:t})}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},64322:(e,t,n)=>{"use strict";n.d(t,{G:()=>v,a:()=>g});var r=n(30758),o=n(25283),a=n(94259),i=n(27311),s=n(13929),l=n(86070);const c=r.createContext(void 0),u="theme",d=(0,i.Wf)(u),p={light:"light",dark:"dark"},f=e=>e===p.dark?p.dark:p.light,h=e=>o.A.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{d.set(f(e))};function g(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,s.p)(),[o,a]=(0,r.useState)(h(e));(0,r.useEffect)((()=>{t&&d.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:o=!0}=r;t?(a(t),o&&m(t)):(a(n?window.matchMedia("(prefers-color-scheme: dark)").matches?p.dark:p.light:e),d.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==u)return;const t=d.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const l=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||l.current?l.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:i,get isDarkTheme(){return o===p.dark},setLightTheme(){i(p.light)},setDarkTheme(){i(p.dark)}})),[o,i])}();return(0,l.jsx)(c.Provider,{value:n,children:t})}function v(){const e=(0,r.useContext)(c);if(null==e)throw new a.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},23432:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>v,g1:()=>b});var r=n(30758),o=n(62939),a=n(95163),i=n(13929),s=n(52295),l=n(94259),c=n(27311),u=n(86070);const d=e=>`docs-preferred-version-${e}`,p={save:(e,t,n)=>{(0,c.Wf)(d(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.Wf)(d(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.Wf)(d(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const h=r.createContext(null);function m(){const e=(0,o.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[a,s]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{s(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function o(e){const t=p.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(p.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,o(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[a,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){p.save(e,t,n),s((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function g(e){let{children:t}=e;const n=m();return(0,u.jsx)(h.Provider,{value:n,children:t})}function v(e){let{children:t}=e;return s.C5?(0,u.jsx)(g,{children:t}):(0,u.jsx)(u.Fragment,{children:t})}function y(){const e=(0,r.useContext)(h);if(!e)throw new l.dV("DocsPreferredVersionContextProvider");return e}function b(e){void 0===e&&(e=a.W);const t=(0,o.ht)(e),[n,i]=y(),{preferredVersionName:s}=n[e];return{preferredVersion:t.versions.find((e=>e.name===s))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}},33471:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,t:()=>c});var r=n(30758),o=n(94259),a=n(86070);const i=Symbol("EmptyContext"),s=r.createContext(i);function l(e){let{children:t,name:n,items:o}=e;const i=(0,r.useMemo)((()=>n&&o?{name:n,items:o}:null),[n,o]);return(0,a.jsx)(s.Provider,{value:i,children:t})}function c(){const e=(0,r.useContext)(s);if(e===i)throw new o.dV("DocsSidebarProvider");return e}},19463:(e,t,n)=>{"use strict";n.d(t,{n:()=>s,r:()=>l});var r=n(30758),o=n(94259),a=n(86070);const i=r.createContext(null);function s(e){let{children:t,version:n}=e;return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(null===e)throw new o.dV("DocsVersionProvider");return e}},14491:(e,t,n)=>{"use strict";n.d(t,{e:()=>f,M:()=>h});var r=n(30758),o=n(831),a=n(20772),i=n(25557),s=n(94259);function l(e){!function(e){const t=(0,i.W6)(),n=(0,s._q)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var c=n(13929),u=n(86070);const d=r.createContext(void 0);function p(){const e=function(){const e=(0,o.YL)(),{items:t}=(0,c.p)().navbar;return 0===t.length&&!e.component}(),t=(0,a.l)(),n=!e&&"mobile"===t,[i,s]=(0,r.useState)(!1);l((()=>{if(i)return s(!1),!1}));const u=(0,r.useCallback)((()=>{s((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&s(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:i})),[e,n,u,i])}function f(e){let{children:t}=e;const n=p();return(0,u.jsx)(d.Provider,{value:n,children:t})}function h(){const e=r.useContext(d);if(void 0===e)throw new s.dV("NavbarMobileSidebarProvider");return e}},831:(e,t,n)=>{"use strict";n.d(t,{GX:()=>c,YL:()=>l,y_:()=>s});var r=n(30758),o=n(94259),a=n(86070);const i=r.createContext(null);function s(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return(0,a.jsx)(i.Provider,{value:n,children:t})}function l(){const e=(0,r.useContext)(i);if(!e)throw new o.dV("NavbarSecondaryMenuContentProvider");return e[0]}function c(e){let{component:t,props:n}=e;const a=(0,r.useContext)(i);if(!a)throw new o.dV("NavbarSecondaryMenuContentProvider");const[,s]=a,l=(0,o.Be)(n);return(0,r.useEffect)((()=>{s({component:t,props:l})}),[s,t,l]),(0,r.useEffect)((()=>()=>s({component:null,props:null})),[s]),null}},4715:(e,t,n)=>{"use strict";n.d(t,{w:()=>o,J:()=>a});var r=n(30758);const o="navigation-with-keyboard";function a(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(o),"mousedown"===e.type&&document.body.classList.remove(o)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(o),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},20772:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(30758),o=n(25283);const a={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function s(e){let{desktopBreakpoint:t=i}=void 0===e?{}:e;const[n,s]=(0,r.useState)((()=>"ssr"));return(0,r.useEffect)((()=>{function e(){s(function(e){if(!o.A.canUseDOM)throw new Error("getWindowSize() should only be called after React hydration");return window.innerWidth>e?a.desktop:a.mobile}(t))}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[t]),n}},81274:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",unlistedBanner:"theme-unlisted-banner",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{blogFooterTagsRow:"theme-blog-footer-tags-row",blogFooterEditMetaRow:"theme-blog-footer-edit-meta-row"},pages:{pageFooterEditMetaRow:"theme-pages-footer-edit-meta-row"}}},4746:(e,t,n)=>{"use strict";function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}n.d(t,{O:()=>r})},52295:(e,t,n)=>{"use strict";n.d(t,{d1:()=>L,Nr:()=>h,w8:()=>y,C5:()=>p,$S:()=>m,cC:()=>f,B5:()=>T,Vd:()=>S,QB:()=>E,fW:()=>C,OF:()=>k,Y:()=>w});var r=n(30758),o=n(25557),a=n(70389),i=n(62939),s=n(23432),l=n(19463),c=n(33471);function u(e){return Array.from(new Set(e))}var d=n(74768);const p=!!i.Gy;function f(e){const t=(0,l.r)();if(!e)return;const n=t.docs[e];if(!n)throw new Error(`no version doc found by id=${e}`);return n}function h(e){return"link"!==e.type||e.unlisted?"category"===e.type?function(e){if(e.href&&!e.linkUnlisted)return e.href;for(const t of e.items){const e=h(t);if(e)return e}}(e):void 0:e.href}function m(){const{pathname:e}=(0,o.zy)(),t=(0,c.t)();if(!t)throw new Error("Unexpected: cant find current sidebar in context");const n=x({sidebarItems:t.items,pathname:e,onlyCategories:!0}).slice(-1)[0];if(!n)throw new Error(`${e} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);return n}const g=(e,t)=>void 0!==e&&(0,d.ys)(e,t),v=(e,t)=>e.some((e=>y(e,t)));function y(e,t){return"link"===e.type?g(e.href,t):"category"===e.type&&(g(e.href,t)||v(e.items,t))}function b(e,t){switch(e.type){case"category":return y(e,t)||e.items.some((e=>b(e,t)));case"link":return!e.unlisted||y(e,t);default:return!0}}function w(e,t){return(0,r.useMemo)((()=>e.filter((e=>b(e,t)))),[e,t])}function x(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const o=[];return function e(t){for(const a of t)if("category"===a.type&&((0,d.ys)(a.href,n)||e(a.items))||"link"===a.type&&(0,d.ys)(a.href,n)){return r&&"category"!==a.type||o.unshift(a),!0}return!1}(t),o}function k(){const e=(0,c.t)(),{pathname:t}=(0,o.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;return!1!==n&&e?x({sidebarItems:e.items,pathname:t}):null}function S(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,s.g1)(e),o=(0,i.r7)(e);return(0,r.useMemo)((()=>u([t,n,o].filter(Boolean))),[t,n,o])}function C(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable sidebar ids are:\n- ${t.map((e=>e[0])).join("\n- ")}`);return r[1]}),[e,n])}function E(e,t){const n=S(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`Couldn't find any doc with id "${e}" in version${n.length>1?"s":""} "${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${u(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function T(e){let{route:t}=e;const n=(0,o.zy)(),r=(0,l.r)(),i=t.routes,s=i.find((e=>(0,o.B6)(n.pathname,e)));if(!s)return null;const c=s.sidebar,u=c?r.docsSidebars[c]:void 0;return{docElement:(0,a.v)(i),sidebarName:c,sidebarItems:u}}function L(e){return e.filter((e=>!("category"===e.type||"link"===e.type)||!!h(e)))}},64204:(e,t,n)=>{"use strict";n.d(t,{e3:()=>p,be:()=>u,Jx:()=>f});var r=n(30758),o=n(13526),a=n(74650),i=n(80053),s=n(94887),l=n(30340);var c=n(86070);function u(e){let{title:t,description:n,keywords:r,image:o,children:i}=e;const u=function(e){const{siteConfig:t}=(0,l.A)(),{title:n,titleDelimiter:r}=t;return e?.trim().length?`${e.trim()} ${r} ${n}`:n}(t),{withBaseUrl:d}=(0,s.hH)(),p=o?d(o,{absolute:!0}):void 0;return(0,c.jsxs)(a.A,{children:[t&&(0,c.jsx)("title",{children:u}),t&&(0,c.jsx)("meta",{property:"og:title",content:u}),n&&(0,c.jsx)("meta",{name:"description",content:n}),n&&(0,c.jsx)("meta",{property:"og:description",content:n}),r&&(0,c.jsx)("meta",{name:"keywords",content:Array.isArray(r)?r.join(","):r}),p&&(0,c.jsx)("meta",{property:"og:image",content:p}),p&&(0,c.jsx)("meta",{name:"twitter:image",content:p}),i]})}const d=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(d),s=(0,o.A)(i,t);return(0,c.jsxs)(d.Provider,{value:s,children:[(0,c.jsx)(a.A,{children:(0,c.jsx)("html",{className:s})}),n]})}function f(e){let{children:t}=e;const n=(0,i.A)(),r=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const a=`plugin-id-${n.plugin.id}`;return(0,c.jsx)(p,{className:(0,o.A)(r,a),children:t})}},94259:(e,t,n)=>{"use strict";n.d(t,{Be:()=>c,ZC:()=>s,_q:()=>i,dV:()=>l,fM:()=>u});var r=n(30758),o=n(89871),a=n(86070);function i(e){const t=(0,r.useRef)(e);return(0,o.A)((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function s(e){const t=(0,r.useRef)();return(0,o.A)((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}function c(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function u(e){return t=>{let{children:n}=t;return(0,a.jsx)(a.Fragment,{children:e.reduceRight(((e,t)=>(0,a.jsx)(t,{children:e})),n)})}}},74768:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>s,ys:()=>i});var r=n(30758),o=n(68384),a=n(30340);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function s(){const{baseUrl:e}=(0,a.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function o(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(o).flatMap((e=>e.routes??[])))}(n)}({routes:o.A,baseUrl:e})),[e])}},793:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>p,Tv:()=>c,gk:()=>f});var r=n(30758),o=n(25283),a=n(5197),i=(n(89871),n(94259)),s=n(86070);const l=r.createContext(void 0);function c(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return(0,s.jsx)(l.Provider,{value:n,children:t})}function u(){const e=(0,r.useContext)(l);if(null==e)throw new i.dV("ScrollControllerProvider");return e}const d=()=>o.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function p(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=u(),o=(0,r.useRef)(d()),a=(0,i._q)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=d();a(e,o.current),o.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[a,n,...t])}function f(){const e=(0,r.useRef)(null),t=(0,a.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const o=document.documentElement.scrollTop;(n&&o>e||!n&&ot&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},70622:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>r,tU:()=>o});n(30340);const r="default";function o(e,t){return`docs-${e}-${t}`}},27311:(e,t,n)=>{"use strict";n.d(t,{Wf:()=>c});n(30758);const r=JSON.parse('{"N":"localStorage","M":""}'),o=r.N;function a(e){let{key:t,oldValue:n,newValue:r,storage:o}=e;if(n===r)return;const a=document.createEvent("StorageEvent");a.initStorageEvent("storage",!1,!1,t,n,r,window.location.href,o),window.dispatchEvent(a)}function i(e){if(void 0===e&&(e=o),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,s||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),s=!0),null}var t}let s=!1;const l={get:()=>null,set:()=>{},del:()=>{},listen:()=>()=>{}};function c(e,t){const n=`${e}${r.M}`;if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t,listen:t}}(n);const o=i(t?.persistence);return null===o?l:{get:()=>{try{return o.getItem(n)}catch(e){return console.error(`Docusaurus storage error, can't get key=${n}`,e),null}},set:e=>{try{const t=o.getItem(n);o.setItem(n,e),a({key:n,oldValue:t,newValue:e,storage:o})}catch(t){console.error(`Docusaurus storage error, can't set ${n}=${e}`,t)}},del:()=>{try{const e=o.getItem(n);o.removeItem(n),a({key:n,oldValue:e,newValue:null,storage:o})}catch(e){console.error(`Docusaurus storage error, can't delete key=${n}`,e)}},listen:e=>{try{const t=t=>{t.storageArea===o&&t.key===n&&e(t)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)}catch(t){return console.error(`Docusaurus storage error, can't listen for changes of key=${n}`,t),()=>{}}}}}},98878:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(30340),o=n(25557),a=n(78946);function i(){const{siteConfig:{baseUrl:e,url:t,trailingSlash:n},i18n:{defaultLocale:i,currentLocale:s}}=(0,r.A)(),{pathname:l}=(0,o.zy)(),c=(0,a.applyTrailingSlash)(l,{trailingSlash:n,baseUrl:e}),u=s===i?e:e.replace(`/${s}/`,"/"),d=c.replace(e,"");return{createUrl:function(e){let{locale:n,fullyQualified:r}=e;return`${r?t:""}${function(e){return e===i?`${u}`:`${u}${e}/`}(n)}${d}`}}}},35623:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(30758),o=n(25557),a=n(94259);function i(e){const t=(0,o.zy)(),n=(0,a.ZC)(t),i=(0,a._q)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},13929:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var r=n(30340);function o(){return(0,r.A)().siteConfig.themeConfig}},90717:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=void 0;const r=n(61664);function o(e){return e.endsWith("/")?e:`${e}/`}function a(e){return(0,r.removeSuffix)(e,"/")}t.addTrailingSlash=o,t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[i]=e.split(/[#?]/),s="/"===i||i===r?i:(l=i,n?o(l):a(l));var l;return e.replace(i,s)},t.addLeadingSlash=function(e){return(0,r.addPrefix)(e,"/")},t.removeTrailingSlash=a},435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=void 0,t.getErrorCausalChain=function e(t){return t.cause?[t,...e(t.cause)]:[t]}},78946:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCausalChain=t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=t.removeTrailingSlash=t.addLeadingSlash=t.addTrailingSlash=t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="__blog-post-container";var o=n(90717);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(o).default}}),Object.defineProperty(t,"addTrailingSlash",{enumerable:!0,get:function(){return o.addTrailingSlash}}),Object.defineProperty(t,"addLeadingSlash",{enumerable:!0,get:function(){return o.addLeadingSlash}}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return o.removeTrailingSlash}});var a=n(61664);Object.defineProperty(t,"addPrefix",{enumerable:!0,get:function(){return a.addPrefix}}),Object.defineProperty(t,"removeSuffix",{enumerable:!0,get:function(){return a.removeSuffix}}),Object.defineProperty(t,"addSuffix",{enumerable:!0,get:function(){return a.addSuffix}}),Object.defineProperty(t,"removePrefix",{enumerable:!0,get:function(){return a.removePrefix}});var i=n(435);Object.defineProperty(t,"getErrorCausalChain",{enumerable:!0,get:function(){return i.getErrorCausalChain}})},61664:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removePrefix=t.addSuffix=t.removeSuffix=t.addPrefix=void 0,t.addPrefix=function(e,t){return e.startsWith(t)?e:`${t}${e}`},t.removeSuffix=function(e,t){return""===t?e:e.endsWith(t)?e.slice(0,-t.length):e},t.addSuffix=function(e,t){return e.endsWith(t)?e:`${e}${t}`},t.removePrefix=function(e,t){return e.startsWith(t)?e.slice(t.length):e}},98222:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r=n(25283).A.canUseDOM?{onRouteUpdate(){window.posthog.capture("$pageview")}}:null},68835:(e,t,n)=>{"use strict";function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;to,A:()=>a});const a=o},83332:(e,t,n)=>{"use strict";n.d(t,{zR:()=>w,TM:()=>T,yJ:()=>f,sC:()=>I,AO:()=>p});var r=n(95265);function o(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,o=e.length;r=0;p--){var f=i[p];"."===f?a(i,p):".."===f?(a(i,p),d++):d&&(a(i,p),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&o(i[0])||i.unshift("");var h=i.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};var s=n(25385);function l(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function f(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),a.state=t):(void 0===(a=(0,r.A)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function h(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=f(e,t,m(),w.location);u.confirmTransitionTo(o,r,n,(function(e){e&&(w.entries[w.index]=o,d({action:r,location:o}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(35959),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),m=l(n),g=0;g{"use strict";e.exports=function(e,t,n,r,o,a,i,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],u=0;(l=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},5526:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},91176:function(e){e.exports=function(){"use strict";var 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(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},n=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=o,this.iframesTimeout=a}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach((function(t){var n=e.filter((function(e){return e.contains(t)})).length>0;-1!==e.indexOf(t)||n||e.push(t)})),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var o=e.contentWindow;if(r=o.document,!o||!r)throw new Error("iframe inaccessible")}catch(a){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,o=!1,a=null,i=function i(){if(!o){o=!0,clearTimeout(a);try{r.isIframeBlank(e)||(e.removeEventListener("load",i),r.getIframeContents(e,t,n))}catch(s){n()}}};e.addEventListener("load",i),a=setTimeout(i,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(r){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,(function(){return!0}),(function(e){r++,n.waitForIframes(e.querySelector("html"),(function(){--r||t()}))}),(function(e){e||t()}))}},{key:"forEachIframe",value:function(t,n,r){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},i=t.querySelectorAll("iframe"),s=i.length,l=0;i=Array.prototype.slice.call(i);var c=function(){--s<=0&&a(l)};s||c(),i.forEach((function(t){e.matches(t,o.exclude)?c():o.onIframeReady(t,(function(e){n(t)&&(l++,r(e)),c()}),c)}))}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:(null===t||e.nextNode())&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var o=!1,a=!1;return r.forEach((function(e,t){e.val===n&&(o=t,a=e.handled)})),this.compareNodeIframe(e,t,n)?(!1!==o||a?!1===o||a||(r[o].handled=!0):r.push({val:n,handled:!0}),!0):(!1===o&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var o=this;e.forEach((function(e){e.handled||o.getIframeContents(e.val,(function(e){o.createInstanceOnIframe(e).forEachNode(t,n,r)}))}))}},{key:"iterateThroughNodes",value:function(e,t,n,r,o){for(var a=this,i=this.createIterator(t,e,r),s=[],l=[],c=void 0,u=void 0,d=function(){var e=a.getIteratorNode(i);return u=e.prevNode,c=e.node};d();)this.iframes&&this.forEachIframe(t,(function(e){return a.checkIframeFilter(c,u,e,s)}),(function(t){a.createInstanceOnIframe(t).forEachNode(e,(function(e){return l.push(e)}),r)})),l.push(c);l.forEach((function(e){n(e)})),this.iframes&&this.handleOpenIframes(s,e,n,r),o()}},{key:"forEachNode",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=this.getContexts(),i=a.length;i||o(),a.forEach((function(a){var s=function(){r.iterateThroughNodes(e,a,t,n,(function(){--i<=0&&o()}))};r.iframes?r.waitForIframes(a,s):s()}))}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var o=!1;return n.every((function(t){return!r.call(e,t)||(o=!0,!1)})),o}return!1}}]),e}(),a=function(){function a(e){t(this,a),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(a,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e)}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],i="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(a):this.escapeStr(a);""!==i&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(i)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynomyms(i)+"|"+this.processSynomyms(s)+")"+r))}return e}},{key:"processSynomyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,(function(e){return"\\"===e.charAt(0)?"?":"\x01"}))).replace(/(?:\\)*\*/g,(function(e){return"\\"===e.charAt(0)?"*":"\x02"}))}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,(function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"}))}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105","A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010d","C\xc7\u0106\u010c","d\u0111\u010f","D\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119","E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012b","I\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142","L\u0141","n\xf1\u0148\u0144","N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014d","O\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159","R\u0158","s\u0161\u015b\u0219\u015f","S\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163","T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016b","U\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xff","Y\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017a","Z\u017d\u017b\u0179"]:["a\xe0\xe1\u1ea3\xe3\u1ea1\u0103\u1eb1\u1eaf\u1eb3\u1eb5\u1eb7\xe2\u1ea7\u1ea5\u1ea9\u1eab\u1ead\xe4\xe5\u0101\u0105A\xc0\xc1\u1ea2\xc3\u1ea0\u0102\u1eb0\u1eae\u1eb2\u1eb4\u1eb6\xc2\u1ea6\u1ea4\u1ea8\u1eaa\u1eac\xc4\xc5\u0100\u0104","c\xe7\u0107\u010dC\xc7\u0106\u010c","d\u0111\u010fD\u0110\u010e","e\xe8\xe9\u1ebb\u1ebd\u1eb9\xea\u1ec1\u1ebf\u1ec3\u1ec5\u1ec7\xeb\u011b\u0113\u0119E\xc8\xc9\u1eba\u1ebc\u1eb8\xca\u1ec0\u1ebe\u1ec2\u1ec4\u1ec6\xcb\u011a\u0112\u0118","i\xec\xed\u1ec9\u0129\u1ecb\xee\xef\u012bI\xcc\xcd\u1ec8\u0128\u1eca\xce\xcf\u012a","l\u0142L\u0141","n\xf1\u0148\u0144N\xd1\u0147\u0143","o\xf2\xf3\u1ecf\xf5\u1ecd\xf4\u1ed3\u1ed1\u1ed5\u1ed7\u1ed9\u01a1\u1edf\u1ee1\u1edb\u1edd\u1ee3\xf6\xf8\u014dO\xd2\xd3\u1ece\xd5\u1ecc\xd4\u1ed2\u1ed0\u1ed4\u1ed6\u1ed8\u01a0\u1ede\u1ee0\u1eda\u1edc\u1ee2\xd6\xd8\u014c","r\u0159R\u0158","s\u0161\u015b\u0219\u015fS\u0160\u015a\u0218\u015e","t\u0165\u021b\u0163T\u0164\u021a\u0162","u\xf9\xfa\u1ee7\u0169\u1ee5\u01b0\u1eeb\u1ee9\u1eed\u1eef\u1ef1\xfb\xfc\u016f\u016bU\xd9\xda\u1ee6\u0168\u1ee4\u01af\u1eea\u1ee8\u1eec\u1eee\u1ef0\xdb\xdc\u016e\u016a","y\xfd\u1ef3\u1ef7\u1ef9\u1ef5\xffY\xdd\u1ef2\u1ef6\u1ef8\u1ef4\u0178","z\u017e\u017c\u017aZ\u017d\u017b\u0179"],r=[];return e.split("").forEach((function(o){n.every((function(n){if(-1!==n.indexOf(o)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0}))})),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xa1\xbf",r=this.opt.accuracy,o="string"==typeof r?r:r.value,a="string"==typeof r?[]:r.limiters,i="";switch(a.forEach((function(e){i+="|"+t.escapeStr(e)})),o){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr(n)))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach((function(e){t.opt.separateWordSearch?e.split(" ").forEach((function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)})):e.trim()&&-1===n.indexOf(e)&&n.push(e)})),{keywords:n.sort((function(e,t){return t.length-e.length})),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort((function(e,t){return e.start-t.start})).forEach((function(e){var o=t.callNoMatchOnInvalidRanges(e,r),a=o.start,i=o.end;o.valid&&(e.start=a,e.length=i-a,n.push(e),r=i)})),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,o=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?o=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:o}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,o=!0,a=n.length,i=t-a,s=parseInt(e.start,10)-i;return(r=(s=s>a?a:s)+parseInt(e.length,10))>a&&(r=a,this.log("End range automatically set to the max value of "+a)),s<0||r-s<0||s>a||r>a?(o=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(o=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:o}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,(function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})}),(function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),(function(){e({value:n,nodes:r})}))}},{key:"matchesExclude",value:function(e){return o.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",o=e.splitText(t),a=o.splitText(n-t),i=document.createElement(r);return i.setAttribute("data-markjs","true"),this.opt.className&&i.setAttribute("class",this.opt.className),i.textContent=o.textContent,o.parentNode.replaceChild(i,o),a}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,o){var a=this;e.nodes.every((function(i,s){var l=e.nodes[s+1];if(void 0===l||l.start>t){if(!r(i.node))return!1;var c=t-i.start,u=(n>i.end?i.end:n)-i.start,d=e.value.substr(0,i.start),p=e.value.substr(u+i.start);if(i.node=a.wrapRangeInTextNode(i.node,c,u),e.value=d+p,e.nodes.forEach((function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=u),e.nodes[n].end-=u)})),n-=u,o(i.node.previousSibling,i.start),!(n>i.end))return!1;t=i.end}return!0}))}},{key:"wrapMatches",value:function(e,t,n,r,o){var a=this,i=0===t?0:t+1;this.getTextNodes((function(t){t.nodes.forEach((function(t){t=t.node;for(var o=void 0;null!==(o=e.exec(t.textContent))&&""!==o[i];)if(n(o[i],t)){var s=o.index;if(0!==i)for(var l=1;l{"use strict";n.r(t)},94127:(e,t,n)=>{"use strict";n.r(t)},58744:function(e,t,n){var r,o;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,s((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),l(c,i(e,u,d)),1===e?(l(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){l(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),s=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return l(i,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&f(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var s=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),l=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(o="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=o)},86150:(e,t,n)=>{var r=n(5526);e.exports=f,e.exports.parse=a,e.exports.compile=function(e,t){return s(a(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,i=0,s="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],p=n[1],f=n.index;if(s+=e.slice(i,f),i=f+d.length,p)s+=p[1];else{var h=e[i],m=n[2],g=n[3],v=n[4],y=n[5],b=n[6],w=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=h&&h!==m,k="+"===b||"*"===b,S="?"===b||"*"===b,C=n[2]||u,E=v||y;r.push({name:g||a++,prefix:m||"",delimiter:C,optional:S,repeat:k,partial:x,asterisk:!!w,pattern:E?c(E):w?".*":"[^"+l(C)+"]+?"})}}return i{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.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=a.length);l++){var c=s[l];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],p="string"==typeof c?c:c.content,f=t(r,u),h=p.indexOf(f);if(h>-1){++o;var m=p.substring(0,h),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),v=p.substring(h+f.length),y=[];m&&y.push.apply(y,i([m])),y.push(g),v&&y.push.apply(y,i([v])),"string"==typeof c?s.splice.apply(s,[l,1].concat(y)):c.content=y}}else c.content&&i(c.content)}return s}(n.tokens)}}}})}(Prism)},57507:(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=57507},29670:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var s={},l=e[r];if(l){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in s))for(var i in o(t,a),s[t]=!0,n[t])s[i]=!0}t(l.require,c),t(l.optional,c),t(l.modify,c)}n[r]=s,a.pop()}}return function(e){var t=n[e];return t||(o(e,r),t=n[e]),t}}function o(e){for(var t in e)return!0;return!1}return function(a,i,s){var l=function(e){var t={};for(var n in e){var r=e[n];for(var o in r)if("meta"!=o){var a=r[o];t[o]="string"==typeof a?{title:a}:a}}return t}(a),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var o in n={},e){var a=e[o];t(a&&a.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+o+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+o+" because it is a component.");n[t]=o}))}return n[r]||r}}(l);i=i.map(c),s=(s||[]).map(c);var u=n(i),d=n(s);i.forEach((function e(n){var r=l[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var p,f=r(l),h=u;o(h);){for(var m in p={},h){var g=l[m];t(g&&g.modify,(function(e){e in d&&(p[e]=!0)}))}for(var v in d)if(!(v in u))for(var y in f(v))if(y in u){p[v]=!0;break}for(var b in h=p)u[b]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,o){var a=o?o.series:void 0,i=o?o.parallel:e,s={},l={};function c(e){if(e in s)return s[e];l[e]=!0;var o,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)o=r(e);else{var p=i(u.map((function(e){var t=c(e);return delete l[e],t})));a?o=a(p,(function(){return r(e)})):r(e)}return s[e]=o}for(var u in n)c(u);var d=[];for(var p in l)d.push(s[p]);return i(d)}(f,u,t,n)}};return w}}();e.exports=t},16186:(e,t,n)=>{"use strict";var r=n(62985);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},2736:(e,t,n)=>{e.exports=n(16186)()},62985:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},19481:(e,t,n)=>{"use strict";var r=n(30758),o=n(31896);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n